Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package dunelegacy for openSUSE:Factory 
checked in at 2026-08-25 13:19:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/dunelegacy (Old)
 and      /work/SRC/openSUSE:Factory/.dunelegacy.new.1258 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "dunelegacy"

Tue Aug 25 13:19:17 2026 rev:7 rq:1373417 version:0.99.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/dunelegacy/dunelegacy.changes    2026-04-07 
16:52:07.708544105 +0200
+++ /work/SRC/openSUSE:Factory/.dunelegacy.new.1258/dunelegacy.changes  
2026-08-25 13:19:21.798422861 +0200
@@ -1,0 +2,7 @@
+Mon Aug 17 13:43:13 UTC 2026 - Bernhard Wiedemann <[email protected]>
+
+- Add patch:
+  * dunelegacy-system-miniupnpc.patch
+    Build with miniupnpc < 2.3 (Leap 16.0)
+
+-------------------------------------------------------------------

New:
----
  dunelegacy-system-miniupnpc.patch

----------(New B)----------
  New:- Add patch:
  * dunelegacy-system-miniupnpc.patch
    Build with miniupnpc < 2.3 (Leap 16.0)
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ dunelegacy.spec ++++++
--- /var/tmp/diff_new_pack.8QyJbW/_old  2026-08-25 13:19:22.739455997 +0200
+++ /var/tmp/diff_new_pack.8QyJbW/_new  2026-08-25 13:19:22.741456068 +0200
@@ -29,6 +29,8 @@
 # PATCH-FEATURE-UPSTREAM https://sourceforge.net/p/dunelegacy/patches/7/
 Source9:        %{name}.6
 Patch0:         dunelegacy-fix-cmake.patch
+# PATCH-FIX-UPSTREAM dunelegacy-system-miniupnpc.patch -- Build against a 
system miniupnpc older than 2.3
+Patch1:         dunelegacy-system-miniupnpc.patch
 BuildRequires:  cmake
 BuildRequires:  discord-rpc-devel
 BuildRequires:  gcc-c++

++++++ dunelegacy-system-miniupnpc.patch ++++++
From: openSUSE games maintainers
Subject: Build against a system miniupnpc older than 2.3

The build assumed the vcpkg-provided miniupnpc, which always ships a CMake
package config and is new enough for the seven-argument UPNP_GetValidIGD().
Distributions may ship neither: openSUSE Leap 16.0 has miniupnpc 2.2.6 built
with its plain Makefile, so only miniupnpc.pc is installed and the wanaddr
output parameter (added in 2.2.8, API version 18) does not exist yet.

Fall back to pkg-config for detection and select the matching UPNP_GetValidIGD()
prototype. The returned WAN address was unused anyway.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 090493e..dae145b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -370,7 +370,14 @@ if(APPLE)
 endif()
 
 # Find miniupnpc for UPnP support
-find_package(miniupnpc CONFIG REQUIRED)
+find_package(miniupnpc CONFIG QUIET)
+if(NOT TARGET miniupnpc::miniupnpc)
+    # vcpkg always provides the CMake package config, but distributions that
+    # build miniupnpc with its plain Makefile install only miniupnpc.pc.
+    find_package(PkgConfig REQUIRED)
+    pkg_check_modules(MINIUPNPC REQUIRED IMPORTED_TARGET GLOBAL miniupnpc)
+    add_library(miniupnpc::miniupnpc ALIAS PkgConfig::MINIUPNPC)
+endif()
 
 # Find discord-rpc for Discord Rich Presence
 find_library(DISCORD_RPC_LIBRARY discord-rpc PATHS ${CMAKE_PREFIX_PATH}/lib)
diff --git a/src/Network/UPnPManager.cpp b/src/Network/UPnPManager.cpp
index 851e316..b3abbd6 100644
--- a/src/Network/UPnPManager.cpp
+++ b/src/Network/UPnPManager.cpp
@@ -67,11 +67,18 @@ bool UPnPManager::discover(int timeoutMs) {
     }
     
     // Find a valid IGD (Internet Gateway Device)
+#if MINIUPNPC_API_VERSION >= 18
     char wanAddress[64] = {0};
-    int result = UPNP_GetValidIGD(deviceList, &data->urls, &data->igdData, 
+    int result = UPNP_GetValidIGD(deviceList, &data->urls, &data->igdData,
                                    data->lanAddress, sizeof(data->lanAddress),
                                    wanAddress, sizeof(wanAddress));
-    
+#else
+    // miniupnpc before 2.2.8 does not report the WAN address here; we only
+    // need the external address, which UPNP_GetExternalIPAddress() gives us.
+    int result = UPNP_GetValidIGD(deviceList, &data->urls, &data->igdData,
+                                   data->lanAddress, sizeof(data->lanAddress));
+#endif
+
     freeUPNPDevlist(deviceList);
     
     // Only result == 1 means a valid, connected IGD

Reply via email to