summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2024-06-16 21:27:40 +0100
committerJames Le Cuirot <chewi@gentoo.org>2024-06-16 21:34:03 +0100
commit92aeba092b5b096a4db323465fc0620c25d610f0 (patch)
tree70b670a0f4ab627b1805581068b747ba5288a1b3 /games-strategy
parentdev-python/nbxmpp: enable py3.13 (diff)
downloadgentoo-92aeba092b5b096a4db323465fc0620c25d610f0.tar.gz
gentoo-92aeba092b5b096a4db323465fc0620c25d610f0.tar.bz2
gentoo-92aeba092b5b096a4db323465fc0620c25d610f0.zip
games-strategy/s25rttr: Fix compatibility with miniupnpc 2.2.8 with patch
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'games-strategy')
-rw-r--r--games-strategy/s25rttr/files/s25rttr-0.9.5-miniupnpc.patch34
-rw-r--r--games-strategy/s25rttr/s25rttr-0.9.5-r1.ebuild (renamed from games-strategy/s25rttr/s25rttr-0.9.5.ebuild)6
2 files changed, 38 insertions, 2 deletions
diff --git a/games-strategy/s25rttr/files/s25rttr-0.9.5-miniupnpc.patch b/games-strategy/s25rttr/files/s25rttr-0.9.5-miniupnpc.patch
new file mode 100644
index 000000000000..e09c258e2b41
--- /dev/null
+++ b/games-strategy/s25rttr/files/s25rttr-0.9.5-miniupnpc.patch
@@ -0,0 +1,34 @@
+From c7b6e56337cbb03d9ed3aa601cb6e79e7858249a Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+Date: Sun, 16 Jun 2024 21:22:08 +0100
+Subject: [PATCH] Support miniupnpc API version 18 (release 2.2.8) and adjust
+ status check
+
+getValidIGD was treating non-zero return codes as successful, but only 1
+should really be considered successful in this context.
+
+This maintains compatibility with earlier versions.
+---
+ libs/network/src/UPnP_Other.cpp | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/external/libutil/libs/network/src/UPnP_Other.cpp b/libs/network/src/UPnP_Other.cpp
+index d684b9c..8fc9418 100644
+--- a/external/libutil/libs/network/src/UPnP_Other.cpp
++++ b/external/libutil/libs/network/src/UPnP_Other.cpp
+@@ -91,7 +91,11 @@ inline DeviceList discover(int delay, const char* multicastIf = nullptr, const c
+ inline bool getValidIGD(const DeviceList& deviceList, Urls& urls, IGDdatas& data, std::string& lanAddr)
+ {
+ lanAddr.resize(15); // Format: aaa.bbb.ccc.ddd
+- return UPNP_GetValidIGD(deviceList, &urls, &data, &lanAddr[0], lanAddr.size()) != 0;
++#if (MINIUPNPC_API_VERSION >= 18)
++ return UPNP_GetValidIGD(deviceList, &urls, &data, &lanAddr[0], lanAddr.size(), NULL, 0) == 1;
++#else
++ return UPNP_GetValidIGD(deviceList, &urls, &data, &lanAddr[0], lanAddr.size()) == 1;
++#endif
+ }
+
+ inline void addPortMapping(const char* controlURL, const char* servicetype, const std::string& extPort,
+--
+2.45.1
+
diff --git a/games-strategy/s25rttr/s25rttr-0.9.5.ebuild b/games-strategy/s25rttr/s25rttr-0.9.5-r1.ebuild
index 1184da066c3a..439ea5525533 100644
--- a/games-strategy/s25rttr/s25rttr-0.9.5.ebuild
+++ b/games-strategy/s25rttr/s25rttr-0.9.5-r1.ebuild
@@ -19,14 +19,15 @@ IUSE="test"
RESTRICT="!test? ( test )"
REQUIRED_USE="${LUA_REQUIRED_USE}"
-RDEPEND="${LUA_DEPS}
+RDEPEND="
+ ${LUA_DEPS}
app-arch/bzip2
dev-libs/boost:=[nls]
>=media-libs/libsamplerate-0.1.9
>=media-libs/libsdl2-2.0.10-r2[opengl,sound,video]
media-libs/libsndfile
media-libs/sdl2-mixer[vorbis,wav]
- net-libs/miniupnpc
+ net-libs/miniupnpc:=
virtual/opengl
"
@@ -44,6 +45,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-0.9.0_pre20200723-cmake_lua_version.patch
"${FILESDIR}"/${PN}-0.9.5-gcc-13.patch
"${FILESDIR}"/${PN}-0.9.5-boost.patch
+ "${FILESDIR}"/${PN}-0.9.5-miniupnpc.patch
)
# Build type is checked but blank is valid.