1{ lib, stdenv, fetchurl, cmake, libuuid, gnutls, makeWrapper }:
2
3stdenv.mkDerivation rec {
4 pname = "taskserver";
5 version = "1.1.0";
6
7 src = fetchurl {
8 url = "http://www.taskwarrior.org/download/taskd-${version}.tar.gz";
9 sha256 = "1d110q9vw8g5syzihxymik7hd27z1592wkpz55kya6lphzk8i13v";
10 };
11
12 patchPhase = ''
13 pkipath=$out/share/taskd/pki
14 mkdir -p $pkipath
15 cp -r pki/* $pkipath
16 echo "patching paths in pki/generate"
17 sed -i "s#^\.#$pkipath#" $pkipath/generate
18 for f in $pkipath/generate* ;do
19 i=$(basename $f)
20 echo patching $i
21 sed -i \
22 -e 's/which/type -p/g' \
23 -e 's#^\. ./vars#if test -e ./vars;then . ./vars; else echo "cannot find ./vars - copy the template from '$pkipath'/vars into the working directory";exit 1; fi#' $f
24
25 echo wrapping $i
26 makeWrapper $pkipath/$i $out/bin/taskd-pki-$i \
27 --prefix PATH : ${lib.makeBinPath [ gnutls ]}
28 done
29 '';
30
31 buildInputs = [ libuuid gnutls ];
32 nativeBuildInputs = [ cmake makeWrapper ];
33
34 meta = {
35 description = "Server for synchronising Taskwarrior clients";
36 homepage = "https://taskwarrior.org";
37 license = lib.licenses.mit;
38 platforms = lib.platforms.linux;
39 maintainers = with lib.maintainers; [ matthiasbeyer makefu ];
40 };
41}