Merge pull request #140360 from oxalica/taskwarrior

This commit is contained in:
Sandro 2021-10-03 16:43:04 +02:00 committed by GitHub
commit 5b7d2373aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,34 +1,27 @@
{ lib, stdenv, fetchurl, cmake, libuuid, gnutls, python3, bash }: { lib, stdenv, fetchFromGitHub, cmake, libuuid, gnutls, python3, xdg-utils }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "taskwarrior"; pname = "taskwarrior";
version = "2.5.3"; version = "2.6.0";
srcs = [ src = fetchFromGitHub {
(fetchurl { owner = "GothenburgBitFactory";
url = "https://github.com/GothenburgBitFactory/taskwarrior/releases/download/v${version}/${sourceRoot}.tar.gz"; repo = "taskwarrior";
sha256 = "0fwnxshhlha21hlgg5z1ad01w13zm1hlmncs274y5n8i15gdfhvj"; rev = "v${version}";
}) sha256 = "sha256-2wVjRecfIlNFAxXFaiKfxy9zArDIYDTfDdrnSM7H8fM=";
(fetchurl { fetchSubmodules = true;
url = "https://github.com/GothenburgBitFactory/taskwarrior/releases/download/v${version}/tests-${version}.tar.gz"; };
sha256 = "165xmf9h6rb7l6l9nlyygj0mx9bi1zyd78z0lrl3nadhmgzggv0b";
})
];
sourceRoot = "task-${version}"; postPatch = ''
substituteInPlace src/commands/CmdNews.cpp \
postUnpack = '' --replace "xdg-open" "${lib.getBin xdg-utils}/bin/xdg-open"
mv test ${sourceRoot}
''; '';
nativeBuildInputs = [ cmake libuuid gnutls ]; nativeBuildInputs = [ cmake libuuid gnutls python3 ];
doCheck = true; doCheck = true;
preCheck = '' preCheck = ''
find test -type f -exec sed -i \ patchShebangs --build test
-e "s|/usr/bin/env python3|${python3.interpreter}|" \
-e "s|/usr/bin/env bash|${bash}/bin/bash|" \
{} +
''; '';
checkTarget = "test"; checkTarget = "test";
@ -37,15 +30,13 @@ stdenv.mkDerivation rec {
ln -s "../../doc/task/scripts/bash/task.sh" "$out/share/bash-completion/completions/task.bash" ln -s "../../doc/task/scripts/bash/task.sh" "$out/share/bash-completion/completions/task.bash"
mkdir -p "$out/share/fish/vendor_completions.d" mkdir -p "$out/share/fish/vendor_completions.d"
ln -s "../../../share/doc/task/scripts/fish/task.fish" "$out/share/fish/vendor_completions.d/" ln -s "../../../share/doc/task/scripts/fish/task.fish" "$out/share/fish/vendor_completions.d/"
mkdir -p "$out/share/zsh/site-functions"
ln -s "../../../share/doc/task/scripts/zsh/_task" "$out/share/zsh/site-functions/"
''; '';
meta = with lib; { meta = with lib; {
description = "Highly flexible command-line tool to manage TODO lists"; description = "Highly flexible command-line tool to manage TODO lists";
homepage = "https://taskwarrior.org"; homepage = "https://taskwarrior.org";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ marcweber ]; maintainers = with maintainers; [ marcweber oxalica ];
platforms = platforms.unix; platforms = platforms.unix;
}; };
} }