2024-07-27 06:49:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
2024-09-19 14:19:46 +00:00
|
|
|
nixosTests,
|
2022-11-02 22:02:43 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "miniupnpc";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "2.2.8";
|
2022-11-02 22:02:43 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "miniupnp";
|
|
|
|
repo = "miniupnp";
|
2024-07-27 06:49:29 +00:00
|
|
|
rev = "miniupnpc_${lib.replaceStrings [ "." ] [ "_" ] version}";
|
|
|
|
hash = "sha256-kPH5nr+rIcF3mxl+L0kN5dn+9xvQccVa8EduwhuYboY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2022-11-02 22:02:43 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
sourceRoot = "${src.name}/miniupnpc";
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2022-11-02 22:02:43 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
(lib.cmakeBool "UPNPC_BUILD_SHARED" (!stdenv.hostPlatform.isStatic))
|
|
|
|
(lib.cmakeBool "UPNPC_BUILD_STATIC" stdenv.hostPlatform.isStatic)
|
|
|
|
];
|
2022-11-02 22:02:43 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
doCheck = !stdenv.hostPlatform.isFreeBSD;
|
2022-11-02 22:02:43 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2024-07-27 06:49:29 +00:00
|
|
|
mv $out/bin/upnpc-* $out/bin/upnpc
|
|
|
|
mv $out/bin/upnp-listdevices-* $out/bin/upnp-listdevices
|
|
|
|
mv $out/bin/external-ip.sh $out/bin/external-ip
|
2022-11-02 22:02:43 +00:00
|
|
|
'';
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) upnp;
|
|
|
|
};
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://miniupnp.tuxfamily.org/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Client that implements the UPnP Internet Gateway Device (IGD) specification";
|
2022-11-02 22:02:43 +00:00
|
|
|
platforms = with platforms; linux ++ freebsd ++ darwin;
|
|
|
|
license = licenses.bsd3;
|
2022-12-28 21:21:41 +00:00
|
|
|
mainProgram = "upnpc";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|