diff options
Diffstat (limited to 'overlays/postfwd.nix')
-rw-r--r-- | overlays/postfwd.nix | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/overlays/postfwd.nix b/overlays/postfwd.nix new file mode 100644 index 00000000..8a4f4bd8 --- /dev/null +++ b/overlays/postfwd.nix | |||
@@ -0,0 +1,32 @@ | |||
1 | { final, prev, sources, ... }: | ||
2 | let | ||
3 | deps = with final.perlPackages; [NetDNS NetServer IOMultiplex NetAddrIP NetCIDRLite DigestMD5 TimeHiRes Storable]; | ||
4 | in { | ||
5 | postfwd = prev.stdenv.mkDerivation rec { | ||
6 | inherit (sources.postfwd) pname version src; | ||
7 | |||
8 | nativeBuildInputs = with prev; [ makeWrapper ]; | ||
9 | propagatedBuildInputs = [final.perlPackages.perl] ++ deps; | ||
10 | |||
11 | buildPhase = '' | ||
12 | runHook preBuild | ||
13 | |||
14 | substituteInPlace sbin/postfwd3 \ | ||
15 | --replace "/usr/bin/perl -T" "/usr/bin/perl" | ||
16 | |||
17 | runHook postBuild | ||
18 | ''; | ||
19 | |||
20 | installPhase = '' | ||
21 | runHook preInstall | ||
22 | |||
23 | mkdir -p $out/bin | ||
24 | cp -t $out/bin sbin/postfwd3 | ||
25 | |||
26 | wrapProgram $out/bin/postfwd3 \ | ||
27 | --prefix PERL5LIB : ${final.perlPackages.makePerlPath deps} | ||
28 | |||
29 | runHook postInstall | ||
30 | ''; | ||
31 | }; | ||
32 | } | ||