diff -Nru warzone2100-3.2.1/debian/changelog warzone2100-3.2.1/debian/changelog --- warzone2100-3.2.1/debian/changelog 2016-11-28 19:51:47.000000000 +0000 +++ warzone2100-3.2.1/debian/changelog 2018-02-22 18:35:47.000000000 +0000 @@ -1,3 +1,10 @@ +warzone2100 (3.2.1-2+rpi1) buster-staging; urgency=medium + + * Fix build with miniupnpc API 16 (Closes: 889059) + + Replace fix-upnpDiscover.patch with new patch miniupnpc-api.patch + + -- Peter Michael Green Thu, 22 Feb 2018 18:35:47 +0000 + warzone2100 (3.2.1-2) unstable; urgency=medium * Team upload. diff -Nru warzone2100-3.2.1/debian/patches/fix-upnpDiscover.patch warzone2100-3.2.1/debian/patches/fix-upnpDiscover.patch --- warzone2100-3.2.1/debian/patches/fix-upnpDiscover.patch 2016-11-28 19:51:47.000000000 +0000 +++ warzone2100-3.2.1/debian/patches/fix-upnpDiscover.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -From: Russell Coker -Date: Mon, 19 Sep 2016 23:24:25 +0200 -Subject: fix-upnpDiscover - -remove extra arg from upnpDiscover() -Forwarded: no ---- - lib/netplay/netplay.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/netplay/netplay.cpp b/lib/netplay/netplay.cpp -index 6c14dde..14266db 100644 ---- a/lib/netplay/netplay.cpp -+++ b/lib/netplay/netplay.cpp -@@ -951,7 +951,7 @@ static int upnp_init(void *asdf) - if (NetPlay.isUPNP) - { - debug(LOG_NET, "Searching for UPnP devices for automatic port forwarding..."); -- devlist = upnpDiscover(3000, NULL, NULL, 0, 0, 2, &result); -+ devlist = upnpDiscover(3000, NULL, NULL, 0, 0, &result); - debug(LOG_NET, "UPnP device search finished."); - if (devlist) - { diff -Nru warzone2100-3.2.1/debian/patches/miniupnpc-api.patch warzone2100-3.2.1/debian/patches/miniupnpc-api.patch --- warzone2100-3.2.1/debian/patches/miniupnpc-api.patch 1970-01-01 00:00:00.000000000 +0000 +++ warzone2100-3.2.1/debian/patches/miniupnpc-api.patch 2018-02-22 18:24:14.000000000 +0000 @@ -0,0 +1,49 @@ +support both mininupnp API +versions 14+ and the version previously used in Debian. + +Thanks to Thomas Bernard for pointing out what the problem with upnpDiscover +was and providing the #if conditions to use. + +miniwget fix based on changes to testminiwget.c at +https://github.com/miniupnp/miniupnp/commit/c4991916e5c12a7754e935e71a5313e75af6aeb9#diff-9813014a8c763f65cfbd4caec9552ddd + +This patch replaces fix-upnpDiscover.patch by Russel corker +which made the package build with the version of miniupnpc in Debian at the time +but broke support for API version 14+ + +Author: Peter Michael Green +Bug-debian: http://bugs.debian.org/889059 + +Index: warzone2100-3.2.1/lib/netplay/netplay.cpp +=================================================================== +--- warzone2100-3.2.1.orig/lib/netplay/netplay.cpp ++++ warzone2100-3.2.1/lib/netplay/netplay.cpp +@@ -951,7 +951,11 @@ static int upnp_init(void *asdf) + if (NetPlay.isUPNP) + { + debug(LOG_NET, "Searching for UPnP devices for automatic port forwarding..."); ++#if defined(MINIUPNPC_API_VERSION) && (MINIUPNPC_API_VERSION >= 14) + devlist = upnpDiscover(3000, NULL, NULL, 0, 0, 2, &result); ++#else ++ devlist = upnpDiscover(3000, NULL, NULL, 0, 0, &result); ++#endif + debug(LOG_NET, "UPnP device search finished."); + if (devlist) + { +@@ -971,7 +975,16 @@ static int upnp_init(void *asdf) + + debug(LOG_NET, "UPnP device found: %s %s\n", dev->descURL, dev->st); + ++#if defined(MINIUPNPC_API_VERSION) && (MINIUPNPC_API_VERSION >= 16) ++ int status_code = -1; ++ descXML = (char *)miniwget_getaddr(dev->descURL, &descXMLsize, lanaddr, sizeof(lanaddr), dev->scope_id, &status_code); ++ if (descXML && (status_code != 200)) { ++ free(descXML); ++ descXML = NULL; ++ } ++#else + descXML = (char *)miniwget_getaddr(dev->descURL, &descXMLsize, lanaddr, sizeof(lanaddr), dev->scope_id); ++#endif + debug(LOG_NET, "LAN address: %s", lanaddr); + if (descXML) + { diff -Nru warzone2100-3.2.1/debian/patches/series warzone2100-3.2.1/debian/patches/series --- warzone2100-3.2.1/debian/patches/series 2016-11-28 19:51:47.000000000 +0000 +++ warzone2100-3.2.1/debian/patches/series 2018-02-22 18:12:25.000000000 +0000 @@ -3,8 +3,8 @@ revert-e397b24d4724d835d6cdc39a92800e64c0551dab.patch fix-yacc.patch redefinition-FTBFS.patch -fix-upnpDiscover.patch add-needed-const.patch appdata.patch quickstartguide.patch openssl-1.1.patch +miniupnpc-api.patch