btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / ta / taskopen / package.nix
blobee40e19261a98b3826953a4e441af9940ac4def0
1 { lib, stdenv, fetchFromGitHub, makeWrapper, which, perl, perlPackages }:
3 stdenv.mkDerivation rec {
4   pname = "taskopen";
5   version = "1.1.5";
7   src = fetchFromGitHub {
8     owner = "ValiValpas";
9     repo = "taskopen";
10     rev = "v${version}";
11     sha256 = "sha256-/xf7Ph2KKiZ5lgLKk95nCgw/z9wIBmuWf3QGaNebgHg=";
12   };
14   postPatch = ''
15     # We don't need a DESTDIR and an empty string results in an absolute path
16     # (due to the trailing slash) which breaks the build.
17     sed 's|$(DESTDIR)/||' -i Makefile
18   '';
20   nativeBuildInputs = [ makeWrapper ];
21   buildInputs = [ which ]
22     ++ (with perlPackages; [ JSON perl ]);
24   installPhase = ''
25     make PREFIX=$out
26     make PREFIX=$out install
27   '';
29   postFixup = ''
30     wrapProgram $out/bin/taskopen \
31          --set PERL5LIB "$PERL5LIB"
32   '';
34   meta = with lib; {
35     description = "Script for taking notes and open urls with taskwarrior";
36     mainProgram = "taskopen";
37     homepage = "https://github.com/ValiValpas/taskopen";
38     platforms = platforms.linux;
39     license = licenses.gpl2Plus;
40     maintainers = [ maintainers.winpat ];
41   };