commit:     793914c32d038d8aba300c0be19418a2a0b85394
Author:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 12 04:57:24 2015 +0000
Commit:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
CommitDate: Sat Dec 12 04:58:47 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=793914c3

games-emulation/dolphin - Bumps to version 5.0

Package-Manager: portage-2.2.24

 games-emulation/dolphin/Manifest                   |   1 +
 games-emulation/dolphin/dolphin-5.0.ebuild         | 153 +++++++++++++++++++++
 .../files/dolphin-5.0-dynamic-llvm-detect.patch    |  54 ++++++++
 .../files/dolphin-5.0-miniupnpc-abi-14.patch       | 137 ++++++++++++++++++
 4 files changed, 345 insertions(+)

diff --git a/games-emulation/dolphin/Manifest b/games-emulation/dolphin/Manifest
index e127728..7bdb097 100644
--- a/games-emulation/dolphin/Manifest
+++ b/games-emulation/dolphin/Manifest
@@ -1,2 +1,3 @@
 DIST dolphin-4.0.2.zip 28261421 SHA256 
f20c824ee83c3a495fd019747d2f8254477b94c135415b386142f89716d05d66 SHA512 
5b1931a133fd431b8f03f47c4c1cfe89f752de17f792e2729421df439564d15a8e35b17e82e31cef99230157de4aa16b2572b28ad67f23ca23c5492972df2938
 WHIRLPOOL 
48dcc47de02e6aa25e5318bc2564df1ab510210556e3e7c9442f405abd04879b8cff85afb5f1fa7a36364902a472f18bf5fa8da3a9db59b915d41d4e60f3b235
 DIST dolphin-4.0.zip 23439392 SHA256 
a698caf05f47a55c30e09d0aab053a412df683de2e139a6348156b03c502a0ec SHA512 
02e366c2fa95ab5f37b0a66b94a5b56a632ef81e13febd982d6385cfaf7fa3edb4364180d4b8312e82bc7b8f150d02cde10248996f6a12286a20d684024aca20
 WHIRLPOOL 
0cb7b28b911111f4b7bf93c56f2dd31d080e7e0418fb53d9cc9093ca995d2c99a1fa7d5d82111e2c8db363e2b07384be39ec0062ab0252233f480b8e45e9304e
+DIST dolphin-5.0.zip 28317729 SHA256 
2b1003360d52baf12a1bcd4d75f379749b0fd4001948ec1a24d0539c37aae055 SHA512 
1b1c0dd6da4ba7e9ffe30499fae582b922c9bbd8b3d8159fbf9f4bfa1e744ef5b4c00a85d34f7cdd6e01efa32133f59b2a1f42cafc9d620f7fc7462c4ba73615
 WHIRLPOOL 
73cc25bafcb0d32592e8ad799b0a3d458cfa944ad15380a3b8f1cf27f3e024c314b08469a17f6d92edced95631bba38e39e1ccd625227c0520813abbd399e0f4

diff --git a/games-emulation/dolphin/dolphin-5.0.ebuild 
b/games-emulation/dolphin/dolphin-5.0.ebuild
new file mode 100644
index 0000000..9ef670f
--- /dev/null
+++ b/games-emulation/dolphin/dolphin-5.0.ebuild
@@ -0,0 +1,153 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+WX_GTK_VER="3.0"
+
+inherit cmake-utils eutils pax-utils toolchain-funcs versionator wxwidgets 
games
+
+SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}-rc.zip -> ${P}.zip"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Gamecube and Wii game emulator"
+HOMEPAGE="https://www.dolphin-emu.org/";
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="alsa ao bluetooth doc ffmpeg lto +lzo openal opengl openmp portaudio 
pulseaudio"
+
+S=${WORKDIR}/${P}-rc/
+RDEPEND=">=media-libs/glew-1.10
+       >=media-libs/libsfml-2.1
+       >=net-libs/miniupnpc-1.8
+       sys-libs/readline:=
+       x11-libs/libXext
+       x11-libs/libXrandr
+       media-libs/libsdl2[haptic,joystick]
+       net-libs/polarssl[havege]
+       alsa? ( media-libs/alsa-lib )
+       ao? ( media-libs/libao )
+       bluetooth? ( net-wireless/bluez )
+       ffmpeg? ( virtual/ffmpeg
+                       !!>=media-video/libav-10 )
+       lzo? ( dev-libs/lzo )
+       openal? ( media-libs/openal )
+       opengl? ( virtual/opengl )
+       portaudio? ( media-libs/portaudio )
+       pulseaudio? ( media-sound/pulseaudio )
+       "
+DEPEND="${RDEPEND}
+       app-arch/zip
+       media-gfx/nvidia-cg-toolkit
+       media-libs/freetype
+       media-libs/libsoundtouch
+       >net-libs/enet-1.3.7
+       >=sys-devel/gcc-4.9.0
+       x11-libs/wxGTK:${WX_GTK_VER}
+       "
+
+pkg_pretend() {
+
+       local ver=4.9.0
+       local msg="${PN} needs at least GCC ${ver} set to compile."
+
+       if [[ ${MERGE_TYPE} != binary ]]; then
+               if ! version_is_at_least ${ver} $(gcc-fullversion); then
+                       eerror ${msg}
+                       die ${msg}
+               fi
+       fi
+
+}
+
+src_prepare() {
+
+       epatch "${FILESDIR}"/"${P}"-dynamic-llvm-detect.patch
+       epatch "${FILESDIR}"/"${P}"-miniupnpc-abi-14.patch
+
+       # Remove automatic dependencies to prevent building without flags 
enabled.
+       if use !alsa; then
+               sed -i -e '/include(FindALSA/d' CMakeLists.txt || die
+       fi
+       if use !ao; then
+               sed -i -e '/check_lib(AO/d' CMakeLists.txt || die
+       fi
+       if use !bluetooth; then
+               sed -i -e '/check_lib(BLUEZ/d' CMakeLists.txt || die
+       fi
+       if use !openal; then
+               sed -i -e '/include(FindOpenAL/d' CMakeLists.txt || die
+       fi
+       if use !portaudio; then
+               sed -i -e '/CMAKE_REQUIRED_LIBRARIES portaudio/d' 
CMakeLists.txt || die
+       fi
+       if use !pulseaudio; then
+               sed -i -e '/check_lib(PULSEAUDIO/d' CMakeLists.txt || die
+       fi
+
+       # Remove ALL the bundled libraries, aside from:
+       # - SOIL: The sources are not public.
+       # - Bochs-disasm: Don't know what it is.
+       # - GL: A custom gl.h file is used.
+       # - gtest: Their build set up solely relies on the build in gtest.
+       # - xxhash: Not on the tree.
+       mv Externals/SOIL . || die
+       mv Externals/Bochs_disasm . || die
+       mv Externals/GL . || die
+       mv Externals/gtest . || die
+       mv Externals/xxhash . || die
+       rm -r Externals/* || die "Failed to delete Externals dir."
+       mv Bochs_disasm Externals || die
+       mv SOIL Externals || die
+       mv GL Externals || die
+       mv gtest Externals || die
+       mv xxhash Externals || die
+}
+
+src_configure() {
+
+       local mycmakeargs=(
+               "-DDOLPHIN_WC_REVISION=${PV}"
+               "-DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}"
+               "-Dprefix=${GAMES_PREFIX}"
+               "-Ddatadir=${GAMES_DATADIR}/${PN}"
+               "-Dplugindir=$(games_get_libdir)/${PN}"
+               "-DUSE_SHARED_ENET=ON"
+               $( cmake-utils_use ffmpeg ENCODE_FRAMEDUMPS )
+               $( cmake-utils_use_enable lto LTO )
+               $( cmake-utils_use openmp OPENMP )
+       )
+
+       cmake-utils_src_configure
+}
+
+src_compile() {
+
+       cmake-utils_src_compile
+}
+src_install() {
+
+       cmake-utils_src_install
+
+       dodoc Readme.md
+       if use doc; then
+               dodoc -r docs/ActionReplay docs/DSP docs/WiiMote
+       fi
+
+       doicon Installer/dolphin-emu.xpm
+       make_desktop_entry "dolphin-emu" "Dolphin Emulator" "dolphin-emu" 
"Game;Emulator;"
+
+       prepgamesdirs
+}
+
+pkg_postinst() {
+       # Add pax markings for hardened systems
+       pax-mark -m "${EPREFIX}"/usr/games/bin/"${PN}"-emu
+
+       if ! use portaudio; then
+               ewarn "If you want microphone capabilities in dolphin-emu, 
rebuild with"
+               ewarn "USE=\"portaudio\""
+       fi
+}

diff --git 
a/games-emulation/dolphin/files/dolphin-5.0-dynamic-llvm-detect.patch 
b/games-emulation/dolphin/files/dolphin-5.0-dynamic-llvm-detect.patch
new file mode 100644
index 0000000..798ec56
--- /dev/null
+++ b/games-emulation/dolphin/files/dolphin-5.0-dynamic-llvm-detect.patch
@@ -0,0 +1,54 @@
+From 1515497ab88dc2452ed0db20a4610663cd04ff21 Mon Sep 17 00:00:00 2001
+From: comex <com...@gmail.com>
+Date: Tue, 7 Jul 2015 07:49:46 -0400
+Subject: [PATCH] Make the LLVM detect script verify that the dynamic library 
actually exists.
+
+For some dumb reason, llvm-config doesn't provide the flags to link
+against the dynamic library copy of LLVM (as opposed to static), so the
+script has to guess the library name.  However, in some installations
+(such as mine), there is no dynamic copy, which caused Dolphin to fail
+to link.  Change the script to do a link test.  If it fails, one option
+would be to fall back on static linking, but I just have it fail to
+detect LLVM, because statically linking Dolphin against LLVM is really
+not a great idea - huge binary, long link time.
+---
+ CMakeTests/FindLLVM.cmake | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeTests/FindLLVM.cmake b/CMakeTests/FindLLVM.cmake
+index 7fe664f..cfcfaed 100644
+--- a/CMakeTests/FindLLVM.cmake
++++ b/CMakeTests/FindLLVM.cmake
+@@ -1,6 +1,9 @@
+ # This file only exists because LLVM's cmake files are broken.
+ # This affects both LLVM 3.4 and 3.5.
+ # Hopefully when they fix their cmake system we don't need this garbage.
++
++include(CheckLibraryExists)
++
+ list(APPEND LLVM_CONFIG_EXECUTABLES "llvm-config")
+ list(APPEND LLVM_CONFIG_EXECUTABLES "llvm-config-3.5")
+ list(APPEND LLVM_CONFIG_EXECUTABLES "llvm-config-3.4")
+@@ -11,13 +14,16 @@ foreach(LLVM_CONFIG_NAME ${LLVM_CONFIG_EXECUTABLES})
+               execute_process(COMMAND ${LLVM_CONFIG_EXE} --version 
OUTPUT_VARIABLE LLVM_PACKAGE_VERSION
+                       OUTPUT_STRIP_TRAILING_WHITESPACE )
+               if (${LLVM_PACKAGE_VERSION} VERSION_GREATER "3.3")
+-                      set(LLVM_FOUND 1)
+                       execute_process(COMMAND ${LLVM_CONFIG_EXE} --includedir 
OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
+                               OUTPUT_STRIP_TRAILING_WHITESPACE )
+                       execute_process(COMMAND ${LLVM_CONFIG_EXE} --ldflags 
OUTPUT_VARIABLE LLVM_LDFLAGS
+                               OUTPUT_STRIP_TRAILING_WHITESPACE )
+-                      set(LLVM_LIBRARIES "${LLVM_LDFLAGS} 
-lLLVM-${LLVM_PACKAGE_VERSION}")
+-                      break()
++                      check_library_exists(LLVM-${LLVM_PACKAGE_VERSION} 
LLVMVerifyFunction "${LLVM_LDFLAGS}" HAVE_DYNAMIC_LLVM_${LLVM_PACKAGE_VERSION})
++                      if (HAVE_DYNAMIC_LLVM_${LLVM_PACKAGE_VERSION})
++                              set(LLVM_LIBRARIES "${LLVM_LDFLAGS} 
-lLLVM-${LLVM_PACKAGE_VERSION}")
++                              set(LLVM_FOUND 1)
++                              break()
++                      endif()
+               endif()
+       endif()
+ endforeach()
+-- 
+2.6.2
+

diff --git a/games-emulation/dolphin/files/dolphin-5.0-miniupnpc-abi-14.patch 
b/games-emulation/dolphin/files/dolphin-5.0-miniupnpc-abi-14.patch
new file mode 100644
index 0000000..ecb6abb
--- /dev/null
+++ b/games-emulation/dolphin/files/dolphin-5.0-miniupnpc-abi-14.patch
@@ -0,0 +1,137 @@
+From 8c5744bca705a0895bd51c966a30171ee2bab43a Mon Sep 17 00:00:00 2001
+From: Marisa Kirisame <mar...@sayachan.org>
+Date: Tue, 29 Sep 2015 23:10:31 +0200
+Subject: [PATCH] miniupnpc API version 14 changed the upnpDiscover functions,
+ adding an argument for TTL (should default to 2) this enables support for
+ that should the build system have that specific version installed, the
+ miniupnpc bundled in the project is unchanged
+
+---
+ CMakeLists.txt                     |  5 ++++-
+ CMakeTests/FindMiniupnpc.cmake     | 39 +++++++++++++++++++++++++++++++++-----
+ Source/Core/Core/NetPlayServer.cpp |  4 ++++
+ 3 files changed, 42 insertions(+), 6 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 291efee..7ac0679 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -690,9 +690,12 @@ if(USE_UPNP)
+       if(NOT APPLE AND NOT ANDROID)
+               include(FindMiniupnpc)
+       endif()
+-      if(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER)
++      if(MINIUPNP_FOUND AND (MINIUPNPC_VERSION_1_7_OR_HIGHER OR 
MINIUPNPC_VERSION_API14_OR_HIGHER))
+               message("Using shared miniupnpc")
+               include_directories(${MINIUPNP_INCLUDE_DIR})
++              if (MINIUPNPC_VERSION_API14_OR_HIGHER)
++                      add_definitions(-DUPNPDISCOVER_HAS_TTL)
++              endif()
+       else()
+               message("Using static miniupnpc from Externals")
+               add_subdirectory(Externals/miniupnpc)
+diff --git a/CMakeTests/FindMiniupnpc.cmake b/CMakeTests/FindMiniupnpc.cmake
+index bb1048c..5301d40 100644
+--- a/CMakeTests/FindMiniupnpc.cmake
++++ b/CMakeTests/FindMiniupnpc.cmake
+@@ -58,6 +58,30 @@ if (MINIUPNP_FOUND)
+       #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;
++      unsigned char upnp_ttl = 2;
++      int upnp_error = 0;
++      devlist = upnpDiscover(upnp_delay, upnp_multicastif, 
upnp_minissdpdsock, upnp_sameport, upnp_ipv6, upnp_ttl, &upnp_error);
++
++      return 0;
++      }"
++      MINIUPNPC_VERSION_API14_OR_HIGHER)
++
++IF (NOT MINIUPNPC_VERSION_API14_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()
++      {
+       static struct UPNPUrls urls;
+       static struct IGDdatas data;
+ 
+@@ -66,8 +90,9 @@ if (MINIUPNP_FOUND)
+       return 0;
+       }"
+       MINIUPNPC_VERSION_1_7_OR_HIGHER)
++   ENDIF()
+ 
+-IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
++IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER AND NOT 
MINIUPNPC_VERSION_API14_OR_HIGHER)
+       set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
+       set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
+       check_cxx_source_runs("
+@@ -91,7 +116,7 @@ IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
+       MINIUPNPC_VERSION_PRE1_7)
+    ENDIF()
+ 
+-   IF (NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
++   IF (NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER 
AND NOT MINIUPNPC_VERSION_API14_OR_HIGHER)
+          set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
+          set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
+          check_cxx_source_runs("
+@@ -116,7 +141,7 @@ IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
+ 
+    ENDIF()
+ 
+-   IF (NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7 AND NOT 
MINIUPNPC_VERSION_1_7_OR_HIGHER)
++   IF (NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7 AND NOT 
MINIUPNPC_VERSION_1_7_OR_HIGHER AND NOT MINIUPNPC_VERSION_API14_OR_HIGHER)
+          set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
+          set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
+          check_cxx_source_runs("
+@@ -136,7 +161,7 @@ IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
+          MINIUPNPC_VERSION_1_5_OR_HIGHER)
+       ENDIF()
+ 
+-      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)
++      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 AND NOT MINIUPNPC_VERSION_API14_OR_HIGHER)
+               set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
+               set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
+               check_cxx_source_runs("
+@@ -167,10 +192,14 @@ 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)
++IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6 AND NOT 
MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_API14_OR_HIGHER)
+       message(STATUS "Found miniupnpc version is v1.7 or higher")
+ ENDIF()
+ 
++IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6 AND NOT 
MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
++      message(STATUS "Found miniupnpc version is v1.9 API version 14 or 
higher")
++ENDIF()
++
+ else ()
+       message (STATUS "Could not find miniupnp")
+ endif ()
+diff --git a/Source/Core/Core/NetPlayServer.cpp 
b/Source/Core/Core/NetPlayServer.cpp
+index 7ed283a..27b46c9 100644
+--- a/Source/Core/Core/NetPlayServer.cpp
++++ b/Source/Core/Core/NetPlayServer.cpp
+@@ -904,7 +904,11 @@ bool NetPlayServer::initUPnP()
+       memset(&m_upnp_data, 0, sizeof(IGDdatas));
+ 
+       // Find all UPnP devices
++#ifdef UPNPDISCOVER_HAS_TTL
++      UPNPDev *devlist = upnpDiscover(2000, nullptr, nullptr, 0, 0, 2, 
&upnperror);
++#else
+       UPNPDev *devlist = upnpDiscover(2000, nullptr, nullptr, 0, 0, 
&upnperror);
++#endif
+       if (!devlist)
+       {
+               WARN_LOG(NETPLAY, "An error occured trying to discover UPnP 
devices.");

Reply via email to