summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Ospald <hasufell@gentoo.org>2013-02-12 16:58:28 +0000
committerJulian Ospald <hasufell@gentoo.org>2013-02-12 16:58:28 +0000
commit250572c10ae2560444cbd8dbc083b8c976b17364 (patch)
treee11cadd503e7b469a98a4370d2ea06414534f6ef
parentStable for ppc, wrt bug #456962 (diff)
downloadgentoo-2-250572c10ae2560444cbd8dbc083b8c976b17364.tar.gz
gentoo-2-250572c10ae2560444cbd8dbc083b8c976b17364.tar.bz2
gentoo-2-250572c10ae2560444cbd8dbc083b8c976b17364.zip
fix build with miniupnpc-1.8 wrt #456952
(Portage version: 2.2.0_alpha161/cvs/Linux x86_64, signed Manifest commit with key E73C35B3)
-rw-r--r--games-strategy/megaglest/ChangeLog8
-rw-r--r--games-strategy/megaglest/files/megaglest-3.7.1-miniupnpc-1.8.patch158
-rw-r--r--games-strategy/megaglest/megaglest-3.7.1.ebuild6
3 files changed, 167 insertions, 5 deletions
diff --git a/games-strategy/megaglest/ChangeLog b/games-strategy/megaglest/ChangeLog
index e543f7925c80..ef483b3749c1 100644
--- a/games-strategy/megaglest/ChangeLog
+++ b/games-strategy/megaglest/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for games-strategy/megaglest
-# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-strategy/megaglest/ChangeLog,v 1.12 2012/12/28 11:28:19 ago Exp $
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-strategy/megaglest/ChangeLog,v 1.13 2013/02/12 16:58:28 hasufell Exp $
+
+ 12 Feb 2013; Julian Ospald <hasufell@gentoo.org> megaglest-3.7.1.ebuild,
+ +files/megaglest-3.7.1-miniupnpc-1.8.patch:
+ fix build with miniupnpc-1.8 wrt #456952
28 Dec 2012; Agostino Sarubbo <ago@gentoo.org> megaglest-3.7.1.ebuild:
Stable for x86, wrt bug #448546
diff --git a/games-strategy/megaglest/files/megaglest-3.7.1-miniupnpc-1.8.patch b/games-strategy/megaglest/files/megaglest-3.7.1-miniupnpc-1.8.patch
new file mode 100644
index 000000000000..61177224a070
--- /dev/null
+++ b/games-strategy/megaglest/files/megaglest-3.7.1-miniupnpc-1.8.patch
@@ -0,0 +1,158 @@
+http://megaglest.svn.sourceforge.net/viewvc/megaglest?view=revision&revision=3958
+https://bugs.gentoo.org/show_bug.cgi?id=456952
+
+--- trunk/source/shared_lib/CMakeLists.txt 2012/12/24 18:05:13 3957
++++ trunk/source/shared_lib/CMakeLists.txt 2012/12/26 01:11:11 3958
+@@ -297,7 +297,12 @@
+ ADD_DEFINITIONS(-DMINIUPNPC_VERSION_PRE1_6)
+ message(STATUS "Adding macro for miniupnpc version: pre v1.6")
+ ENDIF()
+- IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6)
++ IF(MINIUPNPC_VERSION_PRE1_7)
++ ADD_DEFINITIONS(-DMINIUPNPC_VERSION_PRE1_7)
++ message(STATUS "Adding macro for miniupnpc version: pre v1.7")
++ ENDIF()
++
++ IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7)
+ message(STATUS "**No macros required for miniupnpc version")
+ ENDIF()
+
+--- trunk/mk/cmake/Modules/FindMiniupnpc.cmake 2012/12/24 18:05:13 3957
++++ trunk/mk/cmake/Modules/FindMiniupnpc.cmake 2012/12/26 01:11:11 3958
+@@ -58,20 +58,40 @@
+ #include <stdio.h>
+ int main()
+ {
+- struct UPNPDev *devlist = NULL;
+- int upnp_delay = 5000;
+- const char *upnp_multicastif = NULL;
+- const char *upnp_minissdpdsock = NULL;
+- int upnp_sameport = 0;
+- int upnp_ipv6 = 0;
+- int upnp_error = 0;
+- devlist = upnpDiscover(upnp_delay, upnp_multicastif, upnp_minissdpdsock, upnp_sameport, upnp_ipv6, &upnp_error);
++ static struct UPNPUrls urls;
++ static struct IGDdatas data;
++
++ GetUPNPUrls (&urls, &data, \"myurl\",0);
+
+ return 0;
+ }"
+- MINIUPNPC_VERSION_1_6_OR_HIGHER)
+-
+- IF (NOT MINIUPNPC_VERSION_1_6_OR_HIGHER)
++ MINIUPNPC_VERSION_1_7_OR_HIGHER)
++
++ IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
++ set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
++ set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
++ check_cxx_source_runs("
++ #include <miniwget.h>
++ #include <miniupnpc.h>
++ #include <upnpcommands.h>
++ #include <stdio.h>
++ int main()
++ {
++ struct UPNPDev *devlist = NULL;
++ int upnp_delay = 5000;
++ const char *upnp_multicastif = NULL;
++ const char *upnp_minissdpdsock = NULL;
++ int upnp_sameport = 0;
++ int upnp_ipv6 = 0;
++ int upnp_error = 0;
++ devlist = upnpDiscover(upnp_delay, upnp_multicastif, upnp_minissdpdsock, upnp_sameport, upnp_ipv6, &upnp_error);
++
++ return 0;
++ }"
++ MINIUPNPC_VERSION_PRE1_7)
++ ENDIF()
++
++ IF (NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
+ set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
+ check_cxx_source_runs("
+@@ -96,25 +116,27 @@
+
+ ENDIF()
+
+- set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
+- set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
+- check_cxx_source_runs("
+- #include <miniwget.h>
+- #include <miniupnpc.h>
+- #include <upnpcommands.h>
+- #include <stdio.h>
+- static struct UPNPUrls urls;
+- static struct IGDdatas data;
+- int main()
+- {
+- char externalIP[16] = "";
+- UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIP);
++ IF (NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
++ set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
++ set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
++ check_cxx_source_runs("
++ #include <miniwget.h>
++ #include <miniupnpc.h>
++ #include <upnpcommands.h>
++ #include <stdio.h>
++ static struct UPNPUrls urls;
++ static struct IGDdatas data;
++ int main()
++ {
++ char externalIP[16] = "";
++ UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIP);
+
+- return 0;
+- }"
+- MINIUPNPC_VERSION_1_5_OR_HIGHER)
++ return 0;
++ }"
++ MINIUPNPC_VERSION_1_5_OR_HIGHER)
++ ENDIF()
+
+- IF (NOT MINIUPNPC_VERSION_1_5_OR_HIGHER)
++ IF (NOT MINIUPNPC_VERSION_1_5_OR_HIGHER AND NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
+ set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
+ check_cxx_source_runs("
+@@ -141,8 +163,12 @@
+ IF(MINIUPNPC_VERSION_PRE1_6)
+ message(STATUS "Found miniupnpc version is pre v1.6")
+ ENDIF()
+- IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6)
+- message(STATUS "Found miniupnpc version is v1.6 or higher")
++ IF(MINIUPNPC_VERSION_PRE1_7)
++ message(STATUS "Found miniupnpc version is pre v1.7")
++ ENDIF()
++
++ IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7)
++ message(STATUS "Found miniupnpc version is v1.7 or higher")
+ ENDIF()
+
+ else ()
+--- trunk/source/shared_lib/sources/platform/posix/socket.cpp 2012/12/24 18:05:13 3957
++++ trunk/source/shared_lib/sources/platform/posix/socket.cpp 2012/12/26 01:11:11 3958
+@@ -2478,13 +2478,22 @@
+ if(SystemFlags::VERBOSE_MODE_ENABLED) printf("UPnP device found: %s %s\n", dev->descURL, dev->st);
+
+ //printf("UPnP device found: [%s] [%s] lanaddr [%s]\n", dev->descURL, dev->st,lanaddr);
++#ifndef MINIUPNPC_VERSION_PRE1_7
++ descXML = (char *)miniwget_getaddr(dev->descURL, &descXMLsize, lanaddr, (sizeof(lanaddr) / sizeof(lanaddr[0])),0);
++#else
+ descXML = (char *)miniwget_getaddr(dev->descURL, &descXMLsize, lanaddr, (sizeof(lanaddr) / sizeof(lanaddr[0])));
++#endif
+ if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"LAN address: %s\n", lanaddr);
+
+ if (descXML) {
+ parserootdesc (descXML, descXMLsize, &data);
+ free (descXML); descXML = 0;
++
++#ifndef MINIUPNPC_VERSION_PRE1_7
++ GetUPNPUrls (&urls, &data, dev->descURL,0);
++#else
+ GetUPNPUrls (&urls, &data, dev->descURL);
++#endif
+ }
+ snprintf(buf, 255,"UPnP device found: %s %s LAN address %s", dev->descURL, dev->st, lanaddr);
+
diff --git a/games-strategy/megaglest/megaglest-3.7.1.ebuild b/games-strategy/megaglest/megaglest-3.7.1.ebuild
index 58873205d890..58dc3d176f03 100644
--- a/games-strategy/megaglest/megaglest-3.7.1.ebuild
+++ b/games-strategy/megaglest/megaglest-3.7.1.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/games-strategy/megaglest/megaglest-3.7.1.ebuild,v 1.3 2012/12/28 11:28:19 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-strategy/megaglest/megaglest-3.7.1.ebuild,v 1.4 2013/02/12 16:58:28 hasufell Exp $
EAPI=4
VIRTUALX_REQUIRED="manual"
@@ -66,7 +66,7 @@ src_prepare() {
need-wxwidgets unicode
fi
- epatch "${FILESDIR}"/${P}-{static-build,as-needed}.patch
+ epatch "${FILESDIR}"/${P}-{static-build,as-needed,miniupnpc-1.8}.patch
}
src_configure() {