[libupnp] Add new port for libupnp (pupnp) (#48267)

This commit is contained in:
Kai Blaschke
2025-12-02 00:24:17 +01:00
committed by GitHub
parent b9ae7048fb
commit c39217bc52
6 changed files with 139 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45c13c195d..7eb05f7277 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -226,6 +226,8 @@ if(NOT MSVC)
endif()
else()
find_package(PTHREADS4W CONFIG REQUIRED)
+ add_library(Threads::Shared ALIAS PThreads4W::PThreads4W)
+ add_library(Threads::Static ALIAS PThreads4W::PThreads4W)
endif()
#

View File

@@ -0,0 +1,58 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO pupnp/pupnp
REF "release-${VERSION}"
SHA512 2aed5c72cb8e33b89d85e6755b99e7bd4e82ffb58d03ef58c2cdd790d4dc6c33b3a9f91168595930be53f0bb803e266e2bb02ea5fcc5cda8edada9453bf56492
PATCHES
fix-pthreads4w-targets.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" LIBUPNP_BUILD_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LIBUPNP_BUILD_SHARED)
if(LIBUPNP_BUILD_STATIC)
set(UPNP_TARGET "Static")
else()
set(UPNP_TARGET "Shared")
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
client-api UPNP_ENABLE_CLIENT_API
ipv6 UPNP_ENABLE_IPV6
ssl UPNP_ENABLE_OPEN_SSL
webserver UPNP_ENABLE_WEBSERVER
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTING=OFF
-DIXML_ENABLE_SCRIPT_SUPPORT=ON
-DUPNP_ENABLE_GENA=ON
-DUPNP_ENABLE_SOAP=ON
-DUPNP_ENABLE_SSDP=ON
-DUPNP_ENABLE_BLOCKING_TCP_CONNECTIONS=OFF
-DUPNP_ENABLE_DEVICE_API=${UPNP_ENABLE_WEBSERVER}
-DUPNP_MINISERVER_REUSEADDR=${UPNP_ENABLE_WEBSERVER}
-DUPNP_BUILD_SHARED=${LIBUPNP_BUILD_SHARED}
-DUPNP_BUILD_STATIC=${LIBUPNP_BUILD_STATIC}
-DUPNP_BUILD_SAMPLES=OFF
-DUPNP_ENABLE_UNSPECIFIED_SERVER=OFF
${FEATURE_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/UPNP DO_NOT_DELETE_PARENT_CONFIG_PATH)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/IXML)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_copy_pdbs()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

18
ports/libupnp/usage Normal file
View File

@@ -0,0 +1,18 @@
libupnp provides pkg-config modules:
# Linux SDK for UPnP Devices
libupnp
libupnp provides CMake targets:
find_package(UPNP CONFIG REQUIRED)
target_link_libraries(main PRIVATE UPNP::Shared)
-- or --
target_link_libraries(main PRIVATE UPNP::Static)
libixml provides CMake targets:
find_package(IXML CONFIG REQUIRED)
target_link_libraries(main PRIVATE IXML::Shared)
-- or --
target_link_libraries(main PRIVATE IXML::Static)

37
ports/libupnp/vcpkg.json Normal file
View File

@@ -0,0 +1,37 @@
{
"name": "libupnp",
"version": "1.14.25",
"description": "libupnp: Build UPnP-compliant control points, devices, and bridges on several operating systems.",
"homepage": "https://github.com/pupnp/pupnp/",
"documentation": "https://github.com/pupnp/pupnp/",
"license": "BSD-3-Clause",
"supports": "!uwp",
"dependencies": [
"pthreads",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"client-api": {
"description": "Enable control point code (client)"
},
"ipv6": {
"description": "Enable IPv6 support"
},
"ssl": {
"description": "OpenSSL support for encrypted connections",
"dependencies": [
"openssl"
]
},
"webserver": {
"description": "Enable integrated webserver"
}
}
}

View File

@@ -5660,6 +5660,10 @@
"baseline": "1.8.3",
"port-version": 0
},
"libupnp": {
"baseline": "1.14.25",
"port-version": 0
},
"liburcu": {
"baseline": "0.15.2",
"port-version": 0

9
versions/l-/libupnp.json Normal file
View File

@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "49cc2e5824590583f7277390e1e74512cfa56889",
"version": "1.14.25",
"port-version": 0
}
]
}