lol
1{ lib, stdenv, fetchFromGitHub
2, installShellFiles
3, boost, zlib, openssl
4, upnpSupport ? true, miniupnpc
5, aesniSupport ? stdenv.hostPlatform.aesSupport
6, avxSupport ? stdenv.hostPlatform.avxSupport
7}:
8
9stdenv.mkDerivation rec {
10 pname = "i2pd";
11 version = "2.49.0";
12
13 src = fetchFromGitHub {
14 owner = "PurpleI2P";
15 repo = pname;
16 rev = version;
17 sha256 = "sha256-y2+V+p/EZS90cwNl/gavclJ1TyJa/CdNnjKLMuwe7q0=";
18 };
19
20 buildInputs = [ boost zlib openssl ]
21 ++ lib.optional upnpSupport miniupnpc;
22
23 nativeBuildInputs = [
24 installShellFiles
25 ];
26
27 makeFlags =
28 let ynf = a: b: a + "=" + (if b then "yes" else "no"); in
29 [ (ynf "USE_AESNI" aesniSupport)
30 (ynf "USE_AVX" avxSupport)
31 (ynf "USE_UPNP" upnpSupport)
32 ];
33
34 enableParallelBuilding = true;
35
36 installPhase = ''
37 install -D i2pd $out/bin/i2pd
38 install --mode=444 -D 'contrib/i2pd.service' "$out/etc/systemd/system/i2pd.service"
39 installManPage 'debian/i2pd.1'
40 '';
41
42 meta = with lib; {
43 homepage = "https://i2pd.website";
44 description = "Minimal I2P router written in C++";
45 license = licenses.bsd3;
46 maintainers = with maintainers; [ edwtjo ];
47 platforms = platforms.unix;
48 };
49}