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

Add taskwarrior3 and taskchampion-sync-server
This commit is contained in:
Matthias Beyer 2024-04-19 13:24:37 +02:00 committed by GitHub
commit 6eacd2ac58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 118 additions and 0 deletions

View File

@ -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";

View File

@ -0,0 +1,29 @@
{
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";
};
}

View File

@ -0,0 +1,83 @@
{
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;
};
}