1{ stdenv, fetchurl, taskwarrior, perl, ncurses }:
2
3stdenv.mkDerivation rec {
4 version = "0.8";
5 name = "tasknc-${version}";
6
7 src = fetchurl {
8 url = "https://github.com/mjheagle8/tasknc/archive/v${version}.tar.gz";
9 sha256 = "0max5schga9hmf3vfqk2ic91dr6raxglyyjcqchzla280kxn5c28";
10 };
11
12 #
13 # I know this is ugly, but the Makefile does strange things in this package,
14 # so we have to:
15 #
16 # 1. Remove the "doc" task dependency from the "all" target
17 # 2. Remove the "tasknc.1" task dependency from the "install" target
18 # 3. Remove the installing of the tasknc.1 file from the install target as
19 # we just removed the build target for it.
20 #
21 # TODO : One could also provide a patch for the doc/manual.pod file so it
22 # actually builds, but I'm not familiar with this, so this is the faster
23 # approach for me. We have no manpage, though.
24 #
25 preConfigure = ''
26 sed -i -r 's,(all)(.*)doc,\1\2,' Makefile
27 sed -i -r 's,(install)(.*)tasknc\.1,\1\2,' Makefile
28 sed -i -r 's,install\ -D\ -m644\ tasknc\.1\ (.*),,' Makefile
29 '';
30
31 installPhase = ''
32 mkdir $out/bin/ -p
33 mkdir $out/share/man1 -p
34 mkdir $out/share/tasknc -p
35 DESTDIR=$out PREFIX= MANPREFIX=share make install
36 '';
37
38 buildInputs = [ taskwarrior perl ncurses ];
39
40 meta = {
41 homepage = "https://github.com/mjheagle8/tasknc";
42 description = "a ncurses wrapper around taskwarrior";
43 maintainers = [ stdenv.lib.maintainers.matthiasbeyer ];
44 platforms = stdenv.lib.platforms.linux; # Cannot test others
45 };
46}