Skip to content

Commit

Permalink
i2pd: expose flags
Browse files Browse the repository at this point in the history
  • Loading branch information
edwtjo committed Jan 23, 2018
1 parent 4bed2d6 commit a4f433c
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions pkgs/tools/networking/i2pd/default.nix
@@ -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 {

Expand All @@ -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
Expand Down

0 comments on commit a4f433c

Please sign in to comment.