1{ lib, stdenv, fetchFromGitHub, makeWrapper, which, perl, perlPackages }:
2
3stdenv.mkDerivation rec {
4 pname = "taskopen";
5 version = "1.1.5";
6
7 src = fetchFromGitHub {
8 owner = "ValiValpas";
9 repo = "taskopen";
10 rev = "v${version}";
11 sha256 = "sha256-/xf7Ph2KKiZ5lgLKk95nCgw/z9wIBmuWf3QGaNebgHg=";
12 };
13
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 '';
19
20 nativeBuildInputs = [ makeWrapper ];
21 buildInputs = [ which ]
22 ++ (with perlPackages; [ JSON perl ]);
23
24 installPhase = ''
25 make PREFIX=$out
26 make PREFIX=$out install
27 '';
28
29 postFixup = ''
30 wrapProgram $out/bin/taskopen \
31 --set PERL5LIB "$PERL5LIB"
32 '';
33
34 meta = with lib; {
35 description = "Script for taking notes and open urls with taskwarrior";
36 homepage = "https://github.com/ValiValpas/taskopen";
37 platforms = platforms.linux;
38 license = licenses.free;
39 maintainers = [ maintainers.winpat ];
40 };
41}