2023-03-24 00:07:29 +00:00
|
|
|
{ stdenv, lib, fetchurl, iptables-legacy, libuuid, openssl, pkg-config
|
2021-04-05 15:23:46 +00:00
|
|
|
, which, iproute2, gnused, coreutils, gawk, makeWrapper
|
2021-05-20 23:08:51 +00:00
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-03-24 00:07:29 +00:00
|
|
|
scriptBinEnv = lib.makeBinPath [ which iproute2 iptables-legacy gnused coreutils gawk ];
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2021-08-05 21:33:18 +00:00
|
|
|
pname = "miniupnpd";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "2.3.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-10-30 15:09:59 +00:00
|
|
|
url = "https://miniupnp.tuxfamily.org/files/miniupnpd-${version}.tar.gz";
|
|
|
|
sha256 = "0crv975qqppnj27jba96yysq2911y49vjd74sp9vnjb54z0d9pyi";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
buildInputs = [ iptables-legacy libuuid openssl ];
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs= [ pkg-config makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
# ./configure is not a standard configure file, errors with:
|
|
|
|
# Option not recognized : --prefix=
|
|
|
|
dontAddPrefix = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installFlags = [ "PREFIX=$(out)" "INSTALLPREFIX=$(out)" ];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
for script in $out/etc/miniupnpd/ip{,6}tables_{init,removeall}.sh
|
|
|
|
do
|
|
|
|
wrapProgram $script --set PATH '${scriptBinEnv}:$PATH'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
passthru.tests = {
|
|
|
|
bittorrent-integration = nixosTests.bittorrent;
|
2023-03-24 00:07:29 +00:00
|
|
|
inherit (nixosTests) upnp;
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-10-30 15:09:59 +00:00
|
|
|
homepage = "https://miniupnp.tuxfamily.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A daemon that implements the UPnP Internet Gateway Device (IGD) specification";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
}
|