2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, which, cctools }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
generic = { version, sha256 }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "miniupnpc";
|
|
|
|
inherit version;
|
|
|
|
src = fetchurl {
|
2022-10-30 15:09:59 +00:00
|
|
|
url = "https://miniupnp.tuxfamily.org/files/${pname}-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
nativeBuildInputs = lib.optionals stdenv.isDarwin [ which cctools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
patches = lib.optional stdenv.isFreeBSD ./freebsd.patch;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = !stdenv.isFreeBSD;
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" "INSTALLPREFIX=$(out)" ];
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
postInstall = ''
|
|
|
|
chmod +x "$out"/lib/libminiupnpc${stdenv.hostPlatform.extensions.sharedLibrary}
|
|
|
|
'';
|
2021-10-01 09:20:50 +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 client that implements the UPnP Internet Gateway Device (IGD) specification";
|
|
|
|
platforms = with platforms; linux ++ freebsd ++ darwin;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
miniupnpc_2 = generic {
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "2.2.4";
|
|
|
|
sha256 = "0jrc84lkc7xb53rb8dbswxrxj21ndj1iiclmk3r9wkp6xm55w6j8";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
miniupnpc_1 = generic {
|
|
|
|
version = "1.9.20160209";
|
|
|
|
sha256 = "0vsbv6a8by67alx4rxfsrxxsnmq74rqlavvvwiy56whxrkm728ap";
|
|
|
|
};
|
|
|
|
}
|