2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libnatpmp";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "20230423";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-07-15 17:15:38 +00:00
|
|
|
url = "https://miniupnp.tuxfamily.org/files/${pname}-${version}.tar.gz";
|
|
|
|
hash = "sha256-BoTtLIQGQ351GaG9IOqDeA24cbOjpddSMRuj6Inb/HA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
|
|
|
# install natpmp_declspec.h too, else nothing that uses this library will build
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/miniupnp/libnatpmp/commit/5f4a7c65837a56e62c133db33c28cd1ea71db662.patch";
|
|
|
|
hash = "sha256-tvoGFmo5AzUgb40bIs/EzikE0ex1SFzE5peLXhktnbc=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
makeFlags = [
|
|
|
|
"INSTALLPREFIX=$(out)"
|
|
|
|
"CC:=$(CC)"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
|
|
|
|
2021-09-26 12:46:18 +00:00
|
|
|
postFixup = ''
|
|
|
|
chmod +x $out/lib/*
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "NAT-PMP client";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "http://miniupnp.free.fr/libnatpmp.html";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ orivej ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "natpmpc";
|
2021-03-15 08:37:03 +00:00
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|