about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libnatpmp
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libnatpmp')
-rw-r--r--nixpkgs/pkgs/development/libraries/libnatpmp/default.nix22
1 files changed, 17 insertions, 5 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix b/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix
index f718170fc76c..49e89b97344b 100644
--- a/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix
@@ -1,15 +1,27 @@
-{ lib, stdenv, fetchurl, fixDarwinDylibNames }:
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, fixDarwinDylibNames
+}:
 
 stdenv.mkDerivation rec {
   pname = "libnatpmp";
-  version = "20150609";
+  version = "20230423";
 
   src = fetchurl {
-    name = "${pname}-${version}.tar.gz";
-    url = "http://miniupnp.free.fr/files/download.php?file=${pname}-${version}.tar.gz";
-    sha256 = "1c1n8n7mp0amsd6vkz32n8zj3vnsckv308bb7na0dg0r8969rap1";
+    url = "https://miniupnp.tuxfamily.org/files/${pname}-${version}.tar.gz";
+    hash = "sha256-BoTtLIQGQ351GaG9IOqDeA24cbOjpddSMRuj6Inb/HA=";
   };
 
+  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=";
+    })
+  ];
+
   makeFlags = [
     "INSTALLPREFIX=$(out)"
     "CC:=$(CC)"