Unverified Commit 6eacd2ac authored by Matthias Beyer's avatar Matthias Beyer Committed by GitHub
Browse files

Merge pull request #303632 from mlaradji/add-taskwarrior-3

Add taskwarrior3 and taskchampion-sync-server
parents ae4e2c93 62f12e3a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -13394,6 +13394,12 @@
      fingerprint = "64BE BF11 96C3 DD7A 443E  8314 1DC0 82FA DE5B A863";
    }];
  };
  mlaradji = {
    name = "Mohamed Laradji";
    email = "mlaradji@pm.me";
    github = "mlaradji";
    githubId = 33703663;
  };
  mlatus = {
    email = "wqseleven@gmail.com";
    github = "Ninlives";
+29 −0
Original line number Diff line number Diff line
{
  lib,
  rustPlatform,
  fetchFromGitHub,
}:
rustPlatform.buildRustPackage rec {
  pname = "taskchampion-sync-server";
  version = "0.4.1-unstable-2024-04-08";
  src = fetchFromGitHub {
      owner = "GothenburgBitFactory";
      repo = "taskchampion-sync-server";
      rev = "31cb732f0697208ef9a8d325a79688612087185a";
      fetchSubmodules = false;
      sha256 = "sha256-CUgXJcrCOenbw9ZDFBody5FAvpT1dsZBojJk3wOv9U4=";
    };

  cargoHash = "sha256-TpShnVQ2eFNLXJzOTlWVaLqT56YkP4zCGCf3yVtNcvI=";

  # cargo tests fail when checkType="release" (default)
  checkType = "debug";

  meta = {
    description = "Sync server for Taskwarrior 3";
    license = lib.licenses.mit;
    homepage = "https://github.com/GothenburgBitFactory/taskchampion-sync-server";
    maintainers = with lib.maintainers; [mlaradji];
    mainProgram = "taskchampion-sync-server";
  };
}
+83 −0
Original line number Diff line number Diff line
{
  rustPlatform,
  rustc,
  cargo,
  corrosion,
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  libuuid,
  gnutls,
  python3,
  xdg-utils,
  installShellFiles,
}:
stdenv.mkDerivation rec {
    pname = "taskwarrior";
    version = "3.0.0-unstable-2024-04-07";
    src = fetchFromGitHub {
      owner = "GothenburgBitFactory";
      repo = "taskwarrior";
      rev = "fd306712b85dda3ea89de4e617aebeb98b2ede80";
      fetchSubmodules = true;
      sha256 = "sha256-vzfHq/LHfnTx6CVGFCuO6W5aSqj1jVqldMdmyciSDDk=";
    };

  postPatch = ''
    substituteInPlace src/commands/CmdNews.cpp \
      --replace "xdg-open" "${lib.getBin xdg-utils}/bin/xdg-open"
  '';

  nativeBuildInputs = [
    cmake
    libuuid
    python3
    installShellFiles
    corrosion
    cargo
    rustc
    rustPlatform.cargoSetupHook
  ];

  doCheck = true;
  preCheck = ''
    patchShebangs --build test
  '';
  checkTarget = "test";

  cargoDeps = rustPlatform.fetchCargoTarball {
    name = "${pname}-${version}-cargo-deps";
    inherit src;
    sourceRoot = src.name;
    hash = "sha256-zQca/1tI/GUCekKhrg2iSL+h69SH6Ttsj3MqwDKj8HQ=";
  };
  cargoRoot = "./";
  preConfigure = ''
    export CMAKE_PREFIX_PATH="${corrosion}:$CMAKE_PREFIX_PATH"
  '';

  postInstall = ''
    # ZSH is installed automatically from some reason, only bash and fish need
    # manual installation
    installShellCompletion --cmd task \
      --bash $out/share/doc/task/scripts/bash/task.sh \
      --fish $out/share/doc/task/scripts/fish/task.fish
    rm -r $out/share/doc/task/scripts/bash
    rm -r $out/share/doc/task/scripts/fish
    # Install vim and neovim plugin
    mkdir -p $out/share/vim-plugins
    mv $out/share/doc/task/scripts/vim $out/share/vim-plugins/task
    mkdir -p $out/share/nvim
    ln -s $out/share/vim-plugins/task $out/share/nvim/site
  '';

  meta = with lib; {
    description = "Highly flexible command-line tool to manage TODO lists";
    homepage = "https://taskwarrior.org";
    license = licenses.mit;
    maintainers = with maintainers; [marcweber oxalica mlaradji];
    mainProgram = "task";
    platforms = platforms.unix;
  };
}