1{
2 lib,
3 stdenv,
4 fetchurl,
5 openssl,
6 coreutils,
7 nixosTests,
8}:
9
10stdenv.mkDerivation rec {
11 pname = "spiped";
12 version = "1.6.4";
13
14 src = fetchurl {
15 url = "https://www.tarsnap.com/spiped/spiped-${version}.tgz";
16 hash = "sha256-Qk+003adkSsE3kPSHMMnSM39MSHE8dJtVJmSpUZ44Go=";
17 };
18
19 buildInputs = [ openssl ];
20
21 postPatch = ''
22 substituteInPlace libcperciva/cpusupport/Build/cpusupport.sh \
23 --replace "dirname" "${coreutils}/bin/dirname" \
24 --replace "2>/dev/null" "2>stderr.log"
25
26 substituteInPlace libcperciva/POSIX/posix-l.sh \
27 --replace "rm" "${coreutils}/bin/rm" \
28 --replace "2>/dev/null" "2>stderr.log"
29 '';
30
31 installPhase = ''
32 runHook preInstall
33 mkdir -p $out/bin $out/share/man/man1
34 make install BINDIR=$out/bin MAN1DIR=$out/share/man/man1
35 runHook postInstall
36 '';
37
38 passthru.tests.spiped = nixosTests.spiped;
39
40 meta = {
41 description = "Utility for secure encrypted channels between sockets";
42 homepage = "https://www.tarsnap.com/spiped.html";
43 license = lib.licenses.bsd2;
44 platforms = lib.platforms.unix;
45 maintainers = [ lib.maintainers.thoughtpolice ];
46 };
47}