Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-emulation/mgba/files/, games-emulation/mgba/
Date: Sat, 01 Feb 2020 03:11:15
Message-Id: 1580526661.8136abfbeda3d5b792d2b8a388c466a1da4f7ad0.polynomial-c@gentoo
1 commit: 8136abfbeda3d5b792d2b8a388c466a1da4f7ad0
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 1 03:03:56 2020 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 1 03:11:01 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8136abfb
7
8 games-emulation/mgba: Fixed build with USE="qt -sdl"
9
10 Thanks-to: Esteve Varela Colominas <esteve.varela <AT> gmail.com>
11 Closes: https://bugs.gentoo.org/707578
12 Package-Manager: Portage-2.3.86, Repoman-2.3.20
13 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
14
15 games-emulation/mgba/files/mgba-0.8.0-no_sdl.patch | 50 ++++++++++++++++++++++
16 games-emulation/mgba/mgba-0.8.0.ebuild | 4 ++
17 2 files changed, 54 insertions(+)
18
19 diff --git a/games-emulation/mgba/files/mgba-0.8.0-no_sdl.patch b/games-emulation/mgba/files/mgba-0.8.0-no_sdl.patch
20 new file mode 100644
21 index 00000000000..d89828976cd
22 --- /dev/null
23 +++ b/games-emulation/mgba/files/mgba-0.8.0-no_sdl.patch
24 @@ -0,0 +1,50 @@
25 +From aa3403401bfb7259795313603929586bee91ce1b Mon Sep 17 00:00:00 2001
26 +From: Vicki Pfau <vi@×××××××.com>
27 +Date: Fri, 31 Jan 2020 18:09:58 -0800
28 +Subject: [PATCH] Qt: Fix non-SDL build (fixes #1656)
29 +
30 +---
31 + CHANGES | 3 +++
32 + src/platform/qt/InputController.cpp | 12 ++++++++++++
33 + 2 files changed, 15 insertions(+)
34 +
35 +diff --git a/CHANGES b/CHANGES
36 +index 7aac48d6..6418b059 100644
37 +--- a/CHANGES
38 ++++ b/CHANGES
39 +@@ -1,3 +1,6 @@
40 ++Misc:
41 ++ - Qt: Fix non-SDL build (fixes mgba.io/i/1656)
42 ++
43 + 0.8.0: (2020-01-21)
44 + Features:
45 + - Improved logging configuration
46 +diff --git a/src/platform/qt/InputController.cpp b/src/platform/qt/InputController.cpp
47 +index 77ee0704..c6a598ce 100644
48 +--- a/src/platform/qt/InputController.cpp
49 ++++ b/src/platform/qt/InputController.cpp
50 +@@ -271,9 +271,21 @@ void InputController::setPreferredGamepad(uint32_t type, int index) {
51 + if (!m_config) {
52 + return;
53 + }
54 ++#ifdef BUILD_SDL
55 + char name[34] = {0};
56 ++#if SDL_VERSION_ATLEAST(2, 0, 0)
57 + SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(SDL_JoystickListGetPointer(&s_sdlEvents.joysticks, index)->joystick), name, sizeof(name));
58 ++#else
59 ++ const char* name = SDL_JoystickName(SDL_JoystickIndex(SDL_JoystickListGetPointer(&s_sdlEvents.joysticks, index)->joystick));
60 ++ if (!name) {
61 ++ return;
62 ++ }
63 ++#endif
64 + mInputSetPreferredDevice(m_config->input(), "gba", type, m_playerId, name);
65 ++#else
66 ++ UNUSED(type);
67 ++ UNUSED(index);
68 ++#endif
69 + }
70 +
71 + mRumble* InputController::rumble() {
72 +--
73 +2.25.0
74 +
75
76 diff --git a/games-emulation/mgba/mgba-0.8.0.ebuild b/games-emulation/mgba/mgba-0.8.0.ebuild
77 index 3543aa68ebf..cc49129ae05 100644
78 --- a/games-emulation/mgba/mgba-0.8.0.ebuild
79 +++ b/games-emulation/mgba/mgba-0.8.0.ebuild
80 @@ -44,6 +44,10 @@ RDEPEND="
81 "
82 DEPEND="${RDEPEND}"
83
84 +PATCHES=(
85 + "${FILESDIR}/${P}-no_sdl.patch" #707578
86 +)
87 +
88 src_prepare() {
89 xdg_environment_reset
90 cmake_src_prepare