2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, boost, zlib, openssl
|
|
|
|
, upnpSupport ? true, miniupnpc ? null
|
2020-09-25 04:45:31 +00:00
|
|
|
, aesniSupport ? stdenv.hostPlatform.aesSupport
|
|
|
|
, avxSupport ? stdenv.hostPlatform.avxSupport
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert upnpSupport -> miniupnpc != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "i2pd";
|
2021-04-05 15:23:46 +00:00
|
|
|
version = "2.37.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PurpleI2P";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-04-05 15:23:46 +00:00
|
|
|
sha256 = "sha256-//ootg0RZR2vzO702jGXuJ5qGMO49GSG0Lw6dKzGGt8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = with lib; [ boost zlib openssl ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ optional upnpSupport miniupnpc;
|
2021-02-16 17:04:54 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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)
|
|
|
|
];
|
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -D i2pd $out/bin/i2pd
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://i2pd.website";
|
|
|
|
description = "Minimal I2P router written in C++";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ edwtjo ];
|
2021-02-16 17:04:54 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|