From 47e5145d0b5c2d9af6cd43d70bf3ba6aea634c33 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 6 Apr 2016 23:38:10 +0200 Subject: [PATCH] taskserver: integrate pki scripts In the patchPhase all scripts related to generating a CA for taskwarrior are written into share/taskd and patched to actually work within nixos environment --- pkgs/servers/misc/taskserver/default.nix | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/misc/taskserver/default.nix b/pkgs/servers/misc/taskserver/default.nix index 3d34bb8e11f2..a1502b4d6c44 100644 --- a/pkgs/servers/misc/taskserver/default.nix +++ b/pkgs/servers/misc/taskserver/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, cmake, libuuid, gnutls }: +{ stdenv, fetchurl, cmake, libuuid, gnutls, makeWrapper }: stdenv.mkDerivation rec { name = "taskserver-${version}"; @@ -11,6 +11,26 @@ stdenv.mkDerivation rec { sha256 = "1d110q9vw8g5syzihxymik7hd27z1592wkpz55kya6lphzk8i13v"; }; + patchPhase = '' + pkipath=$out/share/taskd/pki + mkdir -p $pkipath + cp -r pki/* $pkipath + echo "patching paths in pki/generate" + sed -i "s#^\.#$pkipath#" $pkipath/generate + for f in $pkipath/generate* ;do + i=$(basename $f) + echo patching $i + sed -i \ + -e 's/which/type -p/g' \ + -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 + + echo wrapping $i + makeWrapper $pkipath/$i $out/bin/taskd-pki-$i \ + --prefix PATH : ${gnutls}/bin/ + done + ''; + + buildInputs = [ makeWrapper ]; nativeBuildInputs = [ cmake libuuid gnutls ]; meta = { @@ -18,6 +38,6 @@ stdenv.mkDerivation rec { homepage = http://taskwarrior.org; license = stdenv.lib.licenses.mit; platforms = stdenv.lib.platforms.linux; - maintainers = with stdenv.lib.maintainers; [ matthiasbeyer ]; + maintainers = with stdenv.lib.maintainers; [ matthiasbeyer makefu ]; }; }