commit:     ef8bb10ad88faeaf84a9ff6133507413618bd41d
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 11 10:24:41 2018 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Thu Jan 11 10:35:38 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef8bb10a

games-emulation/dolphin: Fix building with new glibc

Closes: https://bugs.gentoo.org/637986
Package-Manager: Portage-2.3.19, Repoman-2.3.6

 games-emulation/dolphin/dolphin-5.0.ebuild         | 64 ++++++++--------------
 .../files/dolphin-5.0-CHAR_WIDTH-collision.patch   | 49 +++++++++++++++++
 2 files changed, 72 insertions(+), 41 deletions(-)

diff --git a/games-emulation/dolphin/dolphin-5.0.ebuild 
b/games-emulation/dolphin/dolphin-5.0.ebuild
index 66b0fe9c7da..19005325105 100644
--- a/games-emulation/dolphin/dolphin-5.0.ebuild
+++ b/games-emulation/dolphin/dolphin-5.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -7,7 +7,7 @@ PLOCALES="ar ca cs da_DK de el en es fa fr hr hu it ja ko ms_MY 
nb nl pl pt pt_B
 PLOCALE_BACKUP="en"
 WX_GTK_VER="3.0"
 
-inherit cmake-utils eutils l10n pax-utils toolchain-funcs versionator wxwidgets
+inherit cmake-utils desktop l10n pax-utils toolchain-funcs versionator 
wxwidgets
 
 SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}.zip -> ${P}.zip"
 KEYWORDS="amd64"
@@ -17,15 +17,15 @@ HOMEPAGE="https://www.dolphin-emu.org/";
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="alsa ao bluetooth doc egl +evdev ffmpeg llvm log lto openal +pch 
portaudio profile pulseaudio qt5 sdl upnp +wxwidgets"
+IUSE="alsa ao bluetooth doc egl +evdev ffmpeg libav llvm log lto openal +pch 
portaudio profile pulseaudio qt5 sdl upnp +wxwidgets"
 
-RDEPEND=">=media-libs/libsfml-2.1
+RDEPEND="
+       >=media-libs/libsfml-2.1
        >net-libs/enet-1.3.7
        >=net-libs/mbedtls-2.1.1
        dev-libs/lzo
-       media-libs/libpng:=
-       sys-libs/glibc
-       sys-libs/readline:=
+       media-libs/libpng:0=
+       sys-libs/readline:0=
        sys-libs/zlib
        x11-libs/libXext
        x11-libs/libXi
@@ -37,14 +37,17 @@ RDEPEND=">=media-libs/libsfml-2.1
        bluetooth? ( net-wireless/bluez )
        egl? ( media-libs/mesa[egl] )
        evdev? (
-                       dev-libs/libevdev
-                       virtual/udev
+               dev-libs/libevdev
+               virtual/udev
+       )
+       ffmpeg? (
+               libav? ( media-video/libav:= )
+               !libav? ( media-video/ffmpeg:= )
        )
-       ffmpeg? ( virtual/ffmpeg )
        llvm? ( sys-devel/llvm )
        openal? (
-                       media-libs/openal
-                       media-libs/libsoundtouch
+               media-libs/openal
+               media-libs/libsoundtouch
        )
        portaudio? ( media-libs/portaudio )
        profile? ( dev-util/oprofile )
@@ -57,35 +60,20 @@ RDEPEND=">=media-libs/libsfml-2.1
        sdl? ( media-libs/libsdl2[haptic,joystick] )
        upnp? ( >=net-libs/miniupnpc-1.7 )
        wxwidgets? (
-                               dev-libs/glib:2
-                               x11-libs/gtk+:2
-                               x11-libs/wxGTK:${WX_GTK_VER}[opengl,X]
-       )
-       "
+               dev-libs/glib:2
+               x11-libs/gtk+:2
+               x11-libs/wxGTK:${WX_GTK_VER}[opengl,X]
+       )"
 DEPEND="${RDEPEND}
-       >=dev-util/cmake-2.8.8
-       >=sys-devel/gcc-4.9.0
        app-arch/zip
        media-libs/freetype
        sys-devel/gettext
-       virtual/pkgconfig
-       "
-
-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
+       virtual/pkgconfig"
 
-}
+PATCHES=( "${FILESDIR}"/${P}-CHAR_WIDTH-collision.patch )
 
 src_prepare() {
+       cmake-utils_src_prepare
 
        # Remove automatic dependencies to prevent building without flags 
enabled.
        if use !alsa; then
@@ -139,13 +127,12 @@ src_prepare() {
 }
 
 src_configure() {
-
        if use wxwidgets; then
                need-wxwidgets unicode
        fi
 
        local mycmakeargs=(
-               "-DUSE_SHARED_ENET=ON"
+               -DUSE_SHARED_ENET=ON
                $( cmake-utils_use ffmpeg ENCODE_FRAMEDUMPS )
                $( cmake-utils_use log FASTLOG )
                $( cmake-utils_use profile OPROFILING )
@@ -162,12 +149,7 @@ src_configure() {
        cmake-utils_src_configure
 }
 
-src_compile() {
-
-       cmake-utils_src_compile
-}
 src_install() {
-
        cmake-utils_src_install
 
        dodoc Readme.md

diff --git 
a/games-emulation/dolphin/files/dolphin-5.0-CHAR_WIDTH-collision.patch 
b/games-emulation/dolphin/files/dolphin-5.0-CHAR_WIDTH-collision.patch
new file mode 100644
index 00000000000..d6e4c7a2dc0
--- /dev/null
+++ b/games-emulation/dolphin/files/dolphin-5.0-CHAR_WIDTH-collision.patch
@@ -0,0 +1,49 @@
+Avoid clash with TS 18661-1:2014 macros
+https://bugs.gentoo.org/637986
+
+--- a/Source/Core/VideoBackends/OGL/RasterFont.cpp
++++ b/Source/Core/VideoBackends/OGL/RasterFont.cpp
+@@ -15,7 +15,7 @@
+ namespace OGL
+ {
+ 
+-static const int CHAR_WIDTH = 8;
++static const int DOLPHIN_CHAR_WIDTH = 8;
+ static const int CHAR_HEIGHT = 13;
+ static const int CHAR_OFFSET = 32;
+ static const int CHAR_COUNT = 95;
+@@ -146,20 +146,20 @@
+       glGenTextures(1, &texture);
+       glActiveTexture(GL_TEXTURE8);
+       glBindTexture(GL_TEXTURE_2D, texture);
+-      std::vector<u32> texture_data(CHAR_WIDTH * CHAR_COUNT * CHAR_HEIGHT);
++      std::vector<u32> texture_data(DOLPHIN_CHAR_WIDTH * CHAR_COUNT * 
CHAR_HEIGHT);
+       for (int y = 0; y < CHAR_HEIGHT; y++)
+       {
+               for (int c = 0; c < CHAR_COUNT; c++)
+               {
+-                      for (int x = 0; x < CHAR_WIDTH; x++)
++                      for (int x = 0; x < DOLPHIN_CHAR_WIDTH; x++)
+                       {
+-                              bool pixel = (0 != (rasters[c][y] & (1 << 
(CHAR_WIDTH - x - 1))));
+-                              texture_data[CHAR_WIDTH * CHAR_COUNT * y + 
CHAR_WIDTH * c + x] = pixel ? -1 : 0;
++                              bool pixel = (0 != (rasters[c][y] & (1 << 
(DOLPHIN_CHAR_WIDTH - x - 1))));
++                              texture_data[DOLPHIN_CHAR_WIDTH * CHAR_COUNT * 
y + DOLPHIN_CHAR_WIDTH * c + x] = pixel ? -1 : 0;
+                       }
+               }
+       }
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+-      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CHAR_WIDTH * CHAR_COUNT, 
CHAR_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_data.data());
++      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, DOLPHIN_CHAR_WIDTH * 
CHAR_COUNT, CHAR_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_data.data());
+ 
+       // generate shader
+       ProgramShaderCache::CompileShader(s_shader, s_vertexShaderSrc, 
s_fragmentShaderSrc);
+@@ -196,7 +196,7 @@
+       std::vector<GLfloat> vertices(text.length() * 6 * 4);
+ 
+       int usage = 0;
+-      GLfloat delta_x = GLfloat(2 * CHAR_WIDTH) / GLfloat(bbWidth);
++      GLfloat delta_x = GLfloat(2 * DOLPHIN_CHAR_WIDTH) / GLfloat(bbWidth);
+       GLfloat delta_y = GLfloat(2 * CHAR_HEIGHT) / GLfloat(bbHeight);
+       GLfloat border_x = 2.0f / GLfloat(bbWidth);
+       GLfloat border_y = 4.0f / GLfloat(bbHeight);

Reply via email to