@@ -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
310stdenv.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