summary refs log tree commit diff
path: root/pkgs/applications/misc/taskwarrior/default.nix
blob: 812c9b72f99ef47924b22d956426585fcd62f04b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ lib, stdenv, fetchurl, cmake, libuuid, gnutls, python3, bash }:

stdenv.mkDerivation rec {
  pname = "taskwarrior";
  version = "2.5.3";

  srcs = [
    (fetchurl {
      url = "https://github.com/GothenburgBitFactory/taskwarrior/releases/download/v${version}/${sourceRoot}.tar.gz";
      sha256 = "0fwnxshhlha21hlgg5z1ad01w13zm1hlmncs274y5n8i15gdfhvj";
    })
    (fetchurl {
      url = "https://github.com/GothenburgBitFactory/taskwarrior/releases/download/v${version}/tests-${version}.tar.gz";
      sha256 = "165xmf9h6rb7l6l9nlyygj0mx9bi1zyd78z0lrl3nadhmgzggv0b";
    })
  ];

  sourceRoot = "task-${version}";

  postUnpack = ''
    mv test ${sourceRoot}
  '';

  nativeBuildInputs = [ cmake libuuid gnutls ];

  doCheck = true;
  preCheck = ''
    find test -type f -exec sed -i \
      -e "s|/usr/bin/env python3|${python3.interpreter}|" \
      -e "s|/usr/bin/env bash|${bash}/bin/bash|" \
      {} +
  '';
  checkTarget = "test";

  postInstall = ''
    mkdir -p "$out/share/bash-completion/completions"
    ln -s "../../doc/task/scripts/bash/task.sh" "$out/share/bash-completion/completions/task.bash"
    mkdir -p "$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; {
    description = "Highly flexible command-line tool to manage TODO lists";
    homepage = "https://taskwarrior.org";
    license = licenses.mit;
    maintainers = with maintainers; [ marcweber ];
    platforms = platforms.unix;
  };
}