1{
2 lib,
3 stdenv,
4 fetchurl,
5 cmake,
6 libuuid,
7 gnutls,
8 makeWrapper,
9 nixosTests,
10}:
11
12stdenv.mkDerivation rec {
13 pname = "taskserver";
14 version = "1.1.0";
15
16 src = fetchurl {
17 url = "http://www.taskwarrior.org/download/taskd-${version}.tar.gz";
18 sha256 = "1d110q9vw8g5syzihxymik7hd27z1592wkpz55kya6lphzk8i13v";
19 };
20
21 patchPhase = ''
22 pkipath=$out/share/taskd/pki
23 mkdir -p $pkipath
24 cp -r pki/* $pkipath
25 echo "patching paths in pki/generate"
26 sed -i "s#^\.#$pkipath#" $pkipath/generate
27 for f in $pkipath/generate* ;do
28 i=$(basename $f)
29 echo patching $i
30 sed -i \
31 -e 's/which/type -p/g' \
32 -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
33
34 echo wrapping $i
35 makeWrapper $pkipath/$i $out/bin/taskd-pki-$i \
36 --prefix PATH : ${lib.makeBinPath [ gnutls ]}
37 done
38 '';
39
40 buildInputs = [
41 libuuid
42 gnutls
43 ];
44 nativeBuildInputs = [
45 cmake
46 makeWrapper
47 ];
48
49 passthru.tests = { inherit (nixosTests) taskserver; };
50
51 meta = {
52 description = "Server for synchronising Taskwarrior 2 clients";
53 homepage = "https://taskwarrior.org";
54 license = lib.licenses.mit;
55 platforms = lib.platforms.linux;
56 maintainers = with lib.maintainers; [
57 matthiasbeyer
58 makefu
59 ];
60 };
61}