libnatpmp: Update to 20230423
authorTianling Shen <cnsztl@immortalwrt.org>
Tue, 2 Jul 2024 11:07:30 +0000 (19:07 +0800)
committerRosen Penev <rosenp@gmail.com>
Tue, 2 Jul 2024 16:36:28 +0000 (09:36 -0700)
Rebased patches.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
libs/libnatpmp/Makefile
libs/libnatpmp/patches/010-cmake.patch

index f66a82287fc76110e8c7e1dca41123e5edbf1872..008f21b1e91bfae6ce262af0050439bab761d5e7 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libnatpmp
-PKG_VERSION:=20150609
-PKG_RELEASE:=3
+PKG_VERSION:=20230423
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://miniupnp.tuxfamily.org/files
-PKG_HASH:=e1aa9c4c4219bc06943d6b2130f664daee213fb262fcb94dd355815b8f4536b0
+PKG_HASH:=0684ed2c8406437e7519a1bd20ea83780db871b3a3a5d752311ba3e889dbfc70
 
 PKG_MAINTAINER:=
 PKG_LICENSE:=BSD-3-Clause
index c7bb7375a2f90bde5be4f874eefcad19e3603b0e..0f712901c07ba54f13b54bef77c89b58d6402984 100644 (file)
@@ -1,53 +1,50 @@
---- /dev/null
+--- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -0,0 +1,50 @@
-+cmake_minimum_required(VERSION 2.8.12)
-+
-+if(POLICY CMP0048)
-+      cmake_policy(SET CMP0048 NEW)
-+endif()
-+
+@@ -4,7 +4,10 @@ if(POLICY CMP0048)
+       cmake_policy(SET CMP0048 NEW)
+ endif()
+-project(natpmp)
 +project(natpmp C)
 +
-+set (NATPMP_VERSION 20150609)
++set (NATPMP_VERSION 20230423)
 +set (NATPMP_API_VERSION 1)
-+
-+set (NATPMP_SOURCES
-+        natpmp.c
-+        getgateway.c
-+)
-+
-+if (WIN32)
-+    set (NATPMP_SOURCES ${NATPMP_SOURCES} wingettimeofday.c)
-+endif (WIN32)
-+
-+# Library itself
+ set (NATPMP_SOURCES
+         natpmp.c
+@@ -16,20 +19,33 @@ if (WIN32)
+ endif (WIN32)
+ # Library itself
+-add_library(natpmp STATIC ${NATPMP_SOURCES})
+-target_include_directories(natpmp PUBLIC ${CMAKE_CURRENT_LIST_DIR})
 +add_library(natpmp SHARED ${NATPMP_SOURCES})
 +set_target_properties (natpmp PROPERTIES OUTPUT_NAME "natpmp")
 +set_target_properties (natpmp PROPERTIES VERSION ${NATPMP_VERSION})
 +set_target_properties (natpmp PROPERTIES SOVERSION ${NATPMP_API_VERSION})
-+target_compile_definitions(natpmp PRIVATE -DENABLE_STRNATPMPERR)
+ target_compile_definitions(natpmp PRIVATE -DENABLE_STRNATPMPERR)
 +target_include_directories(natpmp PUBLIC ${CMAKE_CURRENT_LIST_DIR})
-+
-+if (WIN32)
-+      target_link_libraries(natpmp PUBLIC ws2_32 Iphlpapi)
-+      target_compile_definitions(natpmp PUBLIC -DNATPMP_STATICLIB)
-+endif (WIN32)
-+
+ if (WIN32)
+       target_link_libraries(natpmp PUBLIC ws2_32 Iphlpapi)
+       target_compile_definitions(natpmp PUBLIC -DNATPMP_STATICLIB)
+ endif (WIN32)
 +install(TARGETS natpmp
 +      RUNTIME DESTINATION bin
 +      LIBRARY DESTINATION lib${LIB_SUFFIX}
 +      ARCHIVE DESTINATION lib${LIB_SUFFIX})
 +
-+# Executables
-+add_executable(natpmpc natpmpc.c)
-+target_link_libraries(natpmpc natpmp)
-+
+ # Executables
+ add_executable(natpmpc natpmpc.c)
+ target_link_libraries(natpmpc natpmp)
 +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/natpmpc DESTINATION bin)
 +
-+add_executable(testgetgateway
-+      testgetgateway.c
-+      getgateway.c)
-+target_link_libraries(testgetgateway natpmp)
+ add_executable(testgetgateway
+       testgetgateway.c
+       getgateway.c)
+ target_link_libraries(testgetgateway natpmp)
 +
 +install(FILES natpmp.h DESTINATION include)
++install(FILES natpmp_declspec.h DESTINATION include)