2022-10-29 20:10:28 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2022-11-25 09:27:49 +00:00
|
|
|
, cmake
|
2022-10-29 20:10:28 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "miniupnpc";
|
|
|
|
version = "2.2.4";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://miniupnp.tuxfamily.org/files/${pname}-${version}.tar.gz";
|
2022-10-29 09:06:54 +01:00
|
|
|
sha256 = "0jrc84lkc7xb53rb8dbswxrxj21ndj1iiclmk3r9wkp6xm55w6j8";
|
2017-03-02 18:27:10 +00:00
|
|
|
};
|
2022-10-29 20:10:28 +01:00
|
|
|
|
2022-11-25 09:27:49 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2022-10-29 20:10:28 +01:00
|
|
|
|
|
|
|
doCheck = !stdenv.isFreeBSD;
|
|
|
|
|
2022-12-11 18:52:09 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
2022-10-29 20:10:28 +01:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-12-11 18:52:09 +00:00
|
|
|
chmod +x $out/lib/libminiupnpc${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
|
|
|
|
# for some reason cmake does not install binaries and manpages
|
|
|
|
# https://github.com/miniupnp/miniupnp/issues/637
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -a upnpc-static $out/bin/upnpc
|
|
|
|
cp -a ../external-ip.sh $out/bin/external-ip
|
|
|
|
mkdir -p $out/share/man
|
|
|
|
cp -a ../man3 $out/share/man
|
2022-10-29 20:10:28 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://miniupnp.tuxfamily.org/";
|
|
|
|
description = "A client that implements the UPnP Internet Gateway Device (IGD) specification";
|
|
|
|
platforms = with platforms; linux ++ freebsd ++ darwin;
|
|
|
|
license = licenses.bsd3;
|
2022-12-22 14:37:51 +00:00
|
|
|
mainProgram = "upnpc";
|
2011-05-17 12:34:18 +01:00
|
|
|
};
|
|
|
|
}
|