i2pd: expose flags

This commit is contained in:
Edward Tjörnhammar 2018-01-23 11:58:41 +01:00
parent 4bed2d659d
commit a4f433c03c
No known key found for this signature in database
GPG Key ID: 7B82CE4A866B6845

View File

@ -1,4 +1,11 @@
{ stdenv, fetchFromGitHub, fetchpatch, boost, zlib, openssl }:
{ stdenv, fetchFromGitHub, fetchpatch
, boost, zlib, openssl
, upnpSupport ? true, miniupnpc ? null
, aesniSupport ? false
, avxSupport ? false
}:
assert upnpSupport -> miniupnpc != null;
stdenv.mkDerivation rec {
@ -13,8 +20,14 @@ stdenv.mkDerivation rec {
sha256 = "1yl5h7mls50vkg7x5510mljmgsm02arqhcanwkrqw4ilwvcp1mgz";
};
buildInputs = [ boost zlib openssl ];
makeFlags = [ "USE_AESNI=no" "USE_AVX=no" ];
buildInputs = with stdenv.lib; [ boost zlib openssl ]
++ optional upnpSupport miniupnpc;
makeFlags =
let ynf = a: b: a + "=" + (if b then "yes" else "no"); in
[ (ynf "USE_AESNI" aesniSupport)
(ynf "USE_AVX" avxSupport)
(ynf "USE_UPNP" upnpSupport)
];
installPhase = ''
install -D i2pd $out/bin/i2pd