depot/third_party/nixpkgs/pkgs/tools/networking/miniupnpc/default.nix
Default email 2c76a4cb41 Project import generated by Copybara.
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
2023-11-16 04:20:00 +00:00

41 lines
1 KiB
Nix

{ lib
, stdenv
, fetchurl
, cmake
}:
stdenv.mkDerivation rec {
pname = "miniupnpc";
version = "2.2.5";
src = fetchurl {
url = "https://miniupnp.tuxfamily.org/files/${pname}-${version}.tar.gz";
sha256 = "sha256-OKzV9GAvfPi83B7DCy1Y2y6ZEuXZ9TUN2ZsGv9/7UXw=";
};
nativeBuildInputs = [ cmake ];
doCheck = !stdenv.isFreeBSD;
makeFlags = [ "PREFIX=$(out)" ];
postInstall = ''
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
'';
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;
mainProgram = "upnpc";
};
}