Gentoo Archives: gentoo-commits

From: Devan Franchini <twitch153@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/files/, games-emulation/dolphin/
Date: Sat, 12 Dec 2015 04:59:27
Message-Id: 1449896327.793914c32d038d8aba300c0be19418a2a0b85394.twitch153@gentoo
1 commit: 793914c32d038d8aba300c0be19418a2a0b85394
2 Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 12 04:57:24 2015 +0000
4 Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 12 04:58:47 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=793914c3
7
8 games-emulation/dolphin - Bumps to version 5.0
9
10 Package-Manager: portage-2.2.24
11
12 games-emulation/dolphin/Manifest | 1 +
13 games-emulation/dolphin/dolphin-5.0.ebuild | 153 +++++++++++++++++++++
14 .../files/dolphin-5.0-dynamic-llvm-detect.patch | 54 ++++++++
15 .../files/dolphin-5.0-miniupnpc-abi-14.patch | 137 ++++++++++++++++++
16 4 files changed, 345 insertions(+)
17
18 diff --git a/games-emulation/dolphin/Manifest b/games-emulation/dolphin/Manifest
19 index e127728..7bdb097 100644
20 --- a/games-emulation/dolphin/Manifest
21 +++ b/games-emulation/dolphin/Manifest
22 @@ -1,2 +1,3 @@
23 DIST dolphin-4.0.2.zip 28261421 SHA256 f20c824ee83c3a495fd019747d2f8254477b94c135415b386142f89716d05d66 SHA512 5b1931a133fd431b8f03f47c4c1cfe89f752de17f792e2729421df439564d15a8e35b17e82e31cef99230157de4aa16b2572b28ad67f23ca23c5492972df2938 WHIRLPOOL 48dcc47de02e6aa25e5318bc2564df1ab510210556e3e7c9442f405abd04879b8cff85afb5f1fa7a36364902a472f18bf5fa8da3a9db59b915d41d4e60f3b235
24 DIST dolphin-4.0.zip 23439392 SHA256 a698caf05f47a55c30e09d0aab053a412df683de2e139a6348156b03c502a0ec SHA512 02e366c2fa95ab5f37b0a66b94a5b56a632ef81e13febd982d6385cfaf7fa3edb4364180d4b8312e82bc7b8f150d02cde10248996f6a12286a20d684024aca20 WHIRLPOOL 0cb7b28b911111f4b7bf93c56f2dd31d080e7e0418fb53d9cc9093ca995d2c99a1fa7d5d82111e2c8db363e2b07384be39ec0062ab0252233f480b8e45e9304e
25 +DIST dolphin-5.0.zip 28317729 SHA256 2b1003360d52baf12a1bcd4d75f379749b0fd4001948ec1a24d0539c37aae055 SHA512 1b1c0dd6da4ba7e9ffe30499fae582b922c9bbd8b3d8159fbf9f4bfa1e744ef5b4c00a85d34f7cdd6e01efa32133f59b2a1f42cafc9d620f7fc7462c4ba73615 WHIRLPOOL 73cc25bafcb0d32592e8ad799b0a3d458cfa944ad15380a3b8f1cf27f3e024c314b08469a17f6d92edced95631bba38e39e1ccd625227c0520813abbd399e0f4
26
27 diff --git a/games-emulation/dolphin/dolphin-5.0.ebuild b/games-emulation/dolphin/dolphin-5.0.ebuild
28 new file mode 100644
29 index 0000000..9ef670f
30 --- /dev/null
31 +++ b/games-emulation/dolphin/dolphin-5.0.ebuild
32 @@ -0,0 +1,153 @@
33 +# Copyright 1999-2015 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Id$
36 +
37 +EAPI=5
38 +
39 +WX_GTK_VER="3.0"
40 +
41 +inherit cmake-utils eutils pax-utils toolchain-funcs versionator wxwidgets games
42 +
43 +SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}-rc.zip -> ${P}.zip"
44 +KEYWORDS="~amd64"
45 +
46 +DESCRIPTION="Gamecube and Wii game emulator"
47 +HOMEPAGE="https://www.dolphin-emu.org/"
48 +
49 +LICENSE="GPL-2"
50 +SLOT="0"
51 +IUSE="alsa ao bluetooth doc ffmpeg lto +lzo openal opengl openmp portaudio pulseaudio"
52 +
53 +S=${WORKDIR}/${P}-rc/
54 +RDEPEND=">=media-libs/glew-1.10
55 + >=media-libs/libsfml-2.1
56 + >=net-libs/miniupnpc-1.8
57 + sys-libs/readline:=
58 + x11-libs/libXext
59 + x11-libs/libXrandr
60 + media-libs/libsdl2[haptic,joystick]
61 + net-libs/polarssl[havege]
62 + alsa? ( media-libs/alsa-lib )
63 + ao? ( media-libs/libao )
64 + bluetooth? ( net-wireless/bluez )
65 + ffmpeg? ( virtual/ffmpeg
66 + !!>=media-video/libav-10 )
67 + lzo? ( dev-libs/lzo )
68 + openal? ( media-libs/openal )
69 + opengl? ( virtual/opengl )
70 + portaudio? ( media-libs/portaudio )
71 + pulseaudio? ( media-sound/pulseaudio )
72 + "
73 +DEPEND="${RDEPEND}
74 + app-arch/zip
75 + media-gfx/nvidia-cg-toolkit
76 + media-libs/freetype
77 + media-libs/libsoundtouch
78 + >net-libs/enet-1.3.7
79 + >=sys-devel/gcc-4.9.0
80 + x11-libs/wxGTK:${WX_GTK_VER}
81 + "
82 +
83 +pkg_pretend() {
84 +
85 + local ver=4.9.0
86 + local msg="${PN} needs at least GCC ${ver} set to compile."
87 +
88 + if [[ ${MERGE_TYPE} != binary ]]; then
89 + if ! version_is_at_least ${ver} $(gcc-fullversion); then
90 + eerror ${msg}
91 + die ${msg}
92 + fi
93 + fi
94 +
95 +}
96 +
97 +src_prepare() {
98 +
99 + epatch "${FILESDIR}"/"${P}"-dynamic-llvm-detect.patch
100 + epatch "${FILESDIR}"/"${P}"-miniupnpc-abi-14.patch
101 +
102 + # Remove automatic dependencies to prevent building without flags enabled.
103 + if use !alsa; then
104 + sed -i -e '/include(FindALSA/d' CMakeLists.txt || die
105 + fi
106 + if use !ao; then
107 + sed -i -e '/check_lib(AO/d' CMakeLists.txt || die
108 + fi
109 + if use !bluetooth; then
110 + sed -i -e '/check_lib(BLUEZ/d' CMakeLists.txt || die
111 + fi
112 + if use !openal; then
113 + sed -i -e '/include(FindOpenAL/d' CMakeLists.txt || die
114 + fi
115 + if use !portaudio; then
116 + sed -i -e '/CMAKE_REQUIRED_LIBRARIES portaudio/d' CMakeLists.txt || die
117 + fi
118 + if use !pulseaudio; then
119 + sed -i -e '/check_lib(PULSEAUDIO/d' CMakeLists.txt || die
120 + fi
121 +
122 + # Remove ALL the bundled libraries, aside from:
123 + # - SOIL: The sources are not public.
124 + # - Bochs-disasm: Don't know what it is.
125 + # - GL: A custom gl.h file is used.
126 + # - gtest: Their build set up solely relies on the build in gtest.
127 + # - xxhash: Not on the tree.
128 + mv Externals/SOIL . || die
129 + mv Externals/Bochs_disasm . || die
130 + mv Externals/GL . || die
131 + mv Externals/gtest . || die
132 + mv Externals/xxhash . || die
133 + rm -r Externals/* || die "Failed to delete Externals dir."
134 + mv Bochs_disasm Externals || die
135 + mv SOIL Externals || die
136 + mv GL Externals || die
137 + mv gtest Externals || die
138 + mv xxhash Externals || die
139 +}
140 +
141 +src_configure() {
142 +
143 + local mycmakeargs=(
144 + "-DDOLPHIN_WC_REVISION=${PV}"
145 + "-DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}"
146 + "-Dprefix=${GAMES_PREFIX}"
147 + "-Ddatadir=${GAMES_DATADIR}/${PN}"
148 + "-Dplugindir=$(games_get_libdir)/${PN}"
149 + "-DUSE_SHARED_ENET=ON"
150 + $( cmake-utils_use ffmpeg ENCODE_FRAMEDUMPS )
151 + $( cmake-utils_use_enable lto LTO )
152 + $( cmake-utils_use openmp OPENMP )
153 + )
154 +
155 + cmake-utils_src_configure
156 +}
157 +
158 +src_compile() {
159 +
160 + cmake-utils_src_compile
161 +}
162 +src_install() {
163 +
164 + cmake-utils_src_install
165 +
166 + dodoc Readme.md
167 + if use doc; then
168 + dodoc -r docs/ActionReplay docs/DSP docs/WiiMote
169 + fi
170 +
171 + doicon Installer/dolphin-emu.xpm
172 + make_desktop_entry "dolphin-emu" "Dolphin Emulator" "dolphin-emu" "Game;Emulator;"
173 +
174 + prepgamesdirs
175 +}
176 +
177 +pkg_postinst() {
178 + # Add pax markings for hardened systems
179 + pax-mark -m "${EPREFIX}"/usr/games/bin/"${PN}"-emu
180 +
181 + if ! use portaudio; then
182 + ewarn "If you want microphone capabilities in dolphin-emu, rebuild with"
183 + ewarn "USE=\"portaudio\""
184 + fi
185 +}
186
187 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
188 new file mode 100644
189 index 0000000..798ec56
190 --- /dev/null
191 +++ b/games-emulation/dolphin/files/dolphin-5.0-dynamic-llvm-detect.patch
192 @@ -0,0 +1,54 @@
193 +From 1515497ab88dc2452ed0db20a4610663cd04ff21 Mon Sep 17 00:00:00 2001
194 +From: comex <comexk@×××××.com>
195 +Date: Tue, 7 Jul 2015 07:49:46 -0400
196 +Subject: [PATCH] Make the LLVM detect script verify that the dynamic library actually exists.
197 +
198 +For some dumb reason, llvm-config doesn't provide the flags to link
199 +against the dynamic library copy of LLVM (as opposed to static), so the
200 +script has to guess the library name. However, in some installations
201 +(such as mine), there is no dynamic copy, which caused Dolphin to fail
202 +to link. Change the script to do a link test. If it fails, one option
203 +would be to fall back on static linking, but I just have it fail to
204 +detect LLVM, because statically linking Dolphin against LLVM is really
205 +not a great idea - huge binary, long link time.
206 +---
207 + CMakeTests/FindLLVM.cmake | 12 +++++++++---
208 + 1 file changed, 9 insertions(+), 3 deletions(-)
209 +
210 +diff --git a/CMakeTests/FindLLVM.cmake b/CMakeTests/FindLLVM.cmake
211 +index 7fe664f..cfcfaed 100644
212 +--- a/CMakeTests/FindLLVM.cmake
213 ++++ b/CMakeTests/FindLLVM.cmake
214 +@@ -1,6 +1,9 @@
215 + # This file only exists because LLVM's cmake files are broken.
216 + # This affects both LLVM 3.4 and 3.5.
217 + # Hopefully when they fix their cmake system we don't need this garbage.
218 ++
219 ++include(CheckLibraryExists)
220 ++
221 + list(APPEND LLVM_CONFIG_EXECUTABLES "llvm-config")
222 + list(APPEND LLVM_CONFIG_EXECUTABLES "llvm-config-3.5")
223 + list(APPEND LLVM_CONFIG_EXECUTABLES "llvm-config-3.4")
224 +@@ -11,13 +14,16 @@ foreach(LLVM_CONFIG_NAME ${LLVM_CONFIG_EXECUTABLES})
225 + execute_process(COMMAND ${LLVM_CONFIG_EXE} --version OUTPUT_VARIABLE LLVM_PACKAGE_VERSION
226 + OUTPUT_STRIP_TRAILING_WHITESPACE )
227 + if (${LLVM_PACKAGE_VERSION} VERSION_GREATER "3.3")
228 +- set(LLVM_FOUND 1)
229 + execute_process(COMMAND ${LLVM_CONFIG_EXE} --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
230 + OUTPUT_STRIP_TRAILING_WHITESPACE )
231 + execute_process(COMMAND ${LLVM_CONFIG_EXE} --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS
232 + OUTPUT_STRIP_TRAILING_WHITESPACE )
233 +- set(LLVM_LIBRARIES "${LLVM_LDFLAGS} -lLLVM-${LLVM_PACKAGE_VERSION}")
234 +- break()
235 ++ check_library_exists(LLVM-${LLVM_PACKAGE_VERSION} LLVMVerifyFunction "${LLVM_LDFLAGS}" HAVE_DYNAMIC_LLVM_${LLVM_PACKAGE_VERSION})
236 ++ if (HAVE_DYNAMIC_LLVM_${LLVM_PACKAGE_VERSION})
237 ++ set(LLVM_LIBRARIES "${LLVM_LDFLAGS} -lLLVM-${LLVM_PACKAGE_VERSION}")
238 ++ set(LLVM_FOUND 1)
239 ++ break()
240 ++ endif()
241 + endif()
242 + endif()
243 + endforeach()
244 +--
245 +2.6.2
246 +
247
248 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
249 new file mode 100644
250 index 0000000..ecb6abb
251 --- /dev/null
252 +++ b/games-emulation/dolphin/files/dolphin-5.0-miniupnpc-abi-14.patch
253 @@ -0,0 +1,137 @@
254 +From 8c5744bca705a0895bd51c966a30171ee2bab43a Mon Sep 17 00:00:00 2001
255 +From: Marisa Kirisame <marisa@××××××××.org>
256 +Date: Tue, 29 Sep 2015 23:10:31 +0200
257 +Subject: [PATCH] miniupnpc API version 14 changed the upnpDiscover functions,
258 + adding an argument for TTL (should default to 2) this enables support for
259 + that should the build system have that specific version installed, the
260 + miniupnpc bundled in the project is unchanged
261 +
262 +---
263 + CMakeLists.txt | 5 ++++-
264 + CMakeTests/FindMiniupnpc.cmake | 39 +++++++++++++++++++++++++++++++++-----
265 + Source/Core/Core/NetPlayServer.cpp | 4 ++++
266 + 3 files changed, 42 insertions(+), 6 deletions(-)
267 +
268 +diff --git a/CMakeLists.txt b/CMakeLists.txt
269 +index 291efee..7ac0679 100644
270 +--- a/CMakeLists.txt
271 ++++ b/CMakeLists.txt
272 +@@ -690,9 +690,12 @@ if(USE_UPNP)
273 + if(NOT APPLE AND NOT ANDROID)
274 + include(FindMiniupnpc)
275 + endif()
276 +- if(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER)
277 ++ if(MINIUPNP_FOUND AND (MINIUPNPC_VERSION_1_7_OR_HIGHER OR MINIUPNPC_VERSION_API14_OR_HIGHER))
278 + message("Using shared miniupnpc")
279 + include_directories(${MINIUPNP_INCLUDE_DIR})
280 ++ if (MINIUPNPC_VERSION_API14_OR_HIGHER)
281 ++ add_definitions(-DUPNPDISCOVER_HAS_TTL)
282 ++ endif()
283 + else()
284 + message("Using static miniupnpc from Externals")
285 + add_subdirectory(Externals/miniupnpc)
286 +diff --git a/CMakeTests/FindMiniupnpc.cmake b/CMakeTests/FindMiniupnpc.cmake
287 +index bb1048c..5301d40 100644
288 +--- a/CMakeTests/FindMiniupnpc.cmake
289 ++++ b/CMakeTests/FindMiniupnpc.cmake
290 +@@ -58,6 +58,30 @@ if (MINIUPNP_FOUND)
291 + #include <stdio.h>
292 + int main()
293 + {
294 ++ struct UPNPDev *devlist = NULL;
295 ++ int upnp_delay = 5000;
296 ++ const char *upnp_multicastif = NULL;
297 ++ const char *upnp_minissdpdsock = NULL;
298 ++ int upnp_sameport = 0;
299 ++ int upnp_ipv6 = 0;
300 ++ unsigned char upnp_ttl = 2;
301 ++ int upnp_error = 0;
302 ++ devlist = upnpDiscover(upnp_delay, upnp_multicastif, upnp_minissdpdsock, upnp_sameport, upnp_ipv6, upnp_ttl, &upnp_error);
303 ++
304 ++ return 0;
305 ++ }"
306 ++ MINIUPNPC_VERSION_API14_OR_HIGHER)
307 ++
308 ++IF (NOT MINIUPNPC_VERSION_API14_OR_HIGHER)
309 ++ set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
310 ++ set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
311 ++ check_cxx_source_runs("
312 ++ #include <miniwget.h>
313 ++ #include <miniupnpc.h>
314 ++ #include <upnpcommands.h>
315 ++ #include <stdio.h>
316 ++ int main()
317 ++ {
318 + static struct UPNPUrls urls;
319 + static struct IGDdatas data;
320 +
321 +@@ -66,8 +90,9 @@ if (MINIUPNP_FOUND)
322 + return 0;
323 + }"
324 + MINIUPNPC_VERSION_1_7_OR_HIGHER)
325 ++ ENDIF()
326 +
327 +-IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
328 ++IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER AND NOT MINIUPNPC_VERSION_API14_OR_HIGHER)
329 + set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
330 + set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
331 + check_cxx_source_runs("
332 +@@ -91,7 +116,7 @@ IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
333 + MINIUPNPC_VERSION_PRE1_7)
334 + ENDIF()
335 +
336 +- IF (NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
337 ++ IF (NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER AND NOT MINIUPNPC_VERSION_API14_OR_HIGHER)
338 + set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
339 + set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
340 + check_cxx_source_runs("
341 +@@ -116,7 +141,7 @@ IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
342 +
343 + ENDIF()
344 +
345 +- IF (NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
346 ++ 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)
347 + set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
348 + set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
349 + check_cxx_source_runs("
350 +@@ -136,7 +161,7 @@ IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
351 + MINIUPNPC_VERSION_1_5_OR_HIGHER)
352 + ENDIF()
353 +
354 +- 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)
355 ++ 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)
356 + set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
357 + set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
358 + check_cxx_source_runs("
359 +@@ -167,10 +192,14 @@ IF(MINIUPNPC_VERSION_PRE1_7)
360 + message(STATUS "Found miniupnpc version is pre v1.7")
361 + ENDIF()
362 +
363 +-IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7)
364 ++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)
365 + message(STATUS "Found miniupnpc version is v1.7 or higher")
366 + ENDIF()
367 +
368 ++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)
369 ++ message(STATUS "Found miniupnpc version is v1.9 API version 14 or higher")
370 ++ENDIF()
371 ++
372 + else ()
373 + message (STATUS "Could not find miniupnp")
374 + endif ()
375 +diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp
376 +index 7ed283a..27b46c9 100644
377 +--- a/Source/Core/Core/NetPlayServer.cpp
378 ++++ b/Source/Core/Core/NetPlayServer.cpp
379 +@@ -904,7 +904,11 @@ bool NetPlayServer::initUPnP()
380 + memset(&m_upnp_data, 0, sizeof(IGDdatas));
381 +
382 + // Find all UPnP devices
383 ++#ifdef UPNPDISCOVER_HAS_TTL
384 ++ UPNPDev *devlist = upnpDiscover(2000, nullptr, nullptr, 0, 0, 2, &upnperror);
385 ++#else
386 + UPNPDev *devlist = upnpDiscover(2000, nullptr, nullptr, 0, 0, &upnperror);
387 ++#endif
388 + if (!devlist)
389 + {
390 + WARN_LOG(NETPLAY, "An error occured trying to discover UPnP devices.");