Files
quantenzitrone 6b61249106 various: switch to finalAttrs pattern
this shouldn't create any rebuilds
2026-01-30 02:36:22 +01:00

67 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchurl,
cmake,
libuuid,
gnutls,
makeWrapper,
nixosTests,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "taskserver";
version = "1.1.0";
src = fetchurl {
url = "http://www.taskwarrior.org/download/taskd-${finalAttrs.version}.tar.gz";
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 : ${lib.makeBinPath [ gnutls ]}
done
substituteInPlace {doc/,src/,./}CMakeLists.txt \
--replace-fail "cmake_minimum_required (VERSION 2.8)" "cmake_minimum_required(VERSION 3.10)"
substituteInPlace CMakeLists.txt \
--replace-fail "cmake_policy(SET CMP0037 OLD)" ""
'';
buildInputs = [
libuuid
gnutls
];
nativeBuildInputs = [
cmake
makeWrapper
];
passthru.tests = { inherit (nixosTests) taskserver; };
meta = {
description = "Server for synchronising Taskwarrior 2 clients";
homepage = "https://taskwarrior.org";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
matthiasbeyer
makefu
];
};
})