Skip to content

Commit a4f433c

Browse files
committedJan 23, 2018
i2pd: expose flags
1 parent 4bed2d6 commit a4f433c

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed
 

Diff for: ‎pkgs/tools/networking/i2pd/default.nix

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
{ stdenv, fetchFromGitHub, fetchpatch, boost, zlib, openssl }:
1+
{ stdenv, fetchFromGitHub, fetchpatch
2+
, boost, zlib, openssl
3+
, upnpSupport ? true, miniupnpc ? null
4+
, aesniSupport ? false
5+
, avxSupport ? false
6+
}:
7+
8+
assert upnpSupport -> miniupnpc != null;
29

310
stdenv.mkDerivation rec {
411

@@ -13,8 +20,14 @@ stdenv.mkDerivation rec {
1320
sha256 = "1yl5h7mls50vkg7x5510mljmgsm02arqhcanwkrqw4ilwvcp1mgz";
1421
};
1522

16-
buildInputs = [ boost zlib openssl ];
17-
makeFlags = [ "USE_AESNI=no" "USE_AVX=no" ];
23+
buildInputs = with stdenv.lib; [ boost zlib openssl ]
24+
++ optional upnpSupport miniupnpc;
25+
makeFlags =
26+
let ynf = a: b: a + "=" + (if b then "yes" else "no"); in
27+
[ (ynf "USE_AESNI" aesniSupport)
28+
(ynf "USE_AVX" avxSupport)
29+
(ynf "USE_UPNP" upnpSupport)
30+
];
1831

1932
installPhase = ''
2033
install -D i2pd $out/bin/i2pd

0 commit comments

Comments
 (0)
Please sign in to comment.