commit:     768db5bdac1b07ede2801a6190a679642f3c86e9
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  3 03:22:02 2026 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat Jan  3 03:31:10 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=768db5bd

games-emulation/mgba: add 0.11.0_pre20260101 (using Qt6)

Won't wait especially long to stable this + cleanup old if no
major issues.

Seems fine at a glance, but I don't really use it to know. Feel free
to file a bug if there's a need for a newer snapshot for bugfixes
before the actual 0.11 release as I likely won't update this
regularly otherwise and do not know how long 0.11 will take.

Closes: https://bugs.gentoo.org/966286
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 games-emulation/mgba/Manifest                      |   1 +
 .../files/mgba-0.11.0_pre20260101-debugger.patch   |  12 ++
 .../mgba/mgba-0.11.0_pre20260101.ebuild            | 150 +++++++++++++++++++++
 3 files changed, 163 insertions(+)

diff --git a/games-emulation/mgba/Manifest b/games-emulation/mgba/Manifest
index 2ccc94c476ff..8be97b68d305 100644
--- a/games-emulation/mgba/Manifest
+++ b/games-emulation/mgba/Manifest
@@ -1 +1,2 @@
 DIST mgba-0.10.5.tar.gz 14358730 BLAKE2B 
0542bf6d299f4659033ed1f621f575b486cdb7c04877c894be73f210cfcf16ee1b27130ae94395d18e640590d4de78e7ec8b870c6d26764b6b70937040e9e484
 SHA512 
d7b0b0c82e2285acafa0dc0cdb4accfcde9d9a8d8a06ed32f3a15585121ee86aecf8f5f6a762003dad1006fb9e2dcd8a3d141fda71c077182623886f64c042f5
+DIST mgba-0.11.0_pre20260101.tar.gz 16060078 BLAKE2B 
6800fd42b67126bfd5d2468209f530b809d78008e467f8ffcc1204cef97069f634b804b8ba5b10ed6ba01700ef3b231bae9f312d6e18f28599acb5a8d9f2362e
 SHA512 
222933512ebff2e10d432a7555b01cefdd2779e27b53a91e90704aa3da0b1919cb9284d3a4b93eb322e93f96e440db45bc5e47513b86c2b50eb1e05b330e86f3

diff --git a/games-emulation/mgba/files/mgba-0.11.0_pre20260101-debugger.patch 
b/games-emulation/mgba/files/mgba-0.11.0_pre20260101-debugger.patch
new file mode 100644
index 000000000000..793214c08431
--- /dev/null
+++ b/games-emulation/mgba/files/mgba-0.11.0_pre20260101-debugger.patch
@@ -0,0 +1,12 @@
+Just a quick fix for USE="gui -debug", haven't spent time on this.
+--- a/src/platform/qt/scripting/ScriptingController.cpp
++++ b/src/platform/qt/scripting/ScriptingController.cpp
+@@ -87,6 +87,8 @@
+       if (m_controller->hasStarted()) {
+               attach();
++#ifdef ENABLE_DEBUGGERS
+       } else {
+               m_controller->attachDebugger(false);
++#endif
+       }
+       updateVideoScale();

diff --git a/games-emulation/mgba/mgba-0.11.0_pre20260101.ebuild 
b/games-emulation/mgba/mgba-0.11.0_pre20260101.ebuild
new file mode 100644
index 000000000000..e2a0dedef536
--- /dev/null
+++ b/games-emulation/mgba/mgba-0.11.0_pre20260101.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# can recognize luajit but tests currently fail with it
+LUA_COMPAT=( lua5-{3..4} )
+inherit cmake lua-single xdg
+
+if [[ ${PV} == 9999 ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/mgba-emu/mgba.git";
+else
+       MGBA_HASH=e8ef4be03cc8de9cc19f03778eadc375f6269d5a
+       SRC_URI="
+               https://github.com/mgba-emu/mgba/archive/${MGBA_HASH}.tar.gz
+                       -> ${P}.tar.gz
+       "
+       KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+       S=${WORKDIR}/${PN}-${MGBA_HASH}
+fi
+
+DESCRIPTION="Game Boy Advance Emulator"
+HOMEPAGE="https://mgba.io/";
+
+LICENSE="MPL-2.0 BSD LGPL-2.1+ public-domain discord? ( MIT )"
+SLOT="0/$(ver_cut 1-2)"
+IUSE="
+       debug discord elf ffmpeg gles2 gles3 gui libretro
+       lua +opengl +sdl +sqlite test
+"
+# gles3+gui with neither gles2 nor opengl currently fails to build
+REQUIRED_USE="
+       gui? (
+               || ( gles2 gles3 opengl ) sqlite
+               gles3? ( || ( gles2 opengl ) )
+       )
+       lua? ( ${LUA_REQUIRED_USE} )
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       media-libs/freetype
+       media-libs/libpng:=
+       virtual/minizip:=
+       debug? ( dev-libs/libedit )
+       elf? ( dev-libs/elfutils )
+       ffmpeg? ( media-video/ffmpeg:= )
+       gles2? ( media-libs/libglvnd )
+       gles3? ( media-libs/libglvnd )
+       lua? (
+               ${LUA_DEPS}
+               dev-libs/json-c:=
+       )
+       opengl? ( media-libs/libglvnd )
+       gui? (
+               dev-qt/qtbase:6[gui,network,opengl,widgets]
+               dev-qt/qtmultimedia:6
+       )
+       sdl? ( media-libs/libsdl2[sound,joystick,gles2?,opengl?,video] )
+       sqlite? ( dev-db/sqlite:3 )
+"
+DEPEND="
+       ${RDEPEND}
+       test? ( dev-util/cmocka )
+"
+BDEPEND="
+       gui? ( dev-qt/qttools:6[linguist] )
+       lua? ( virtual/pkgconfig )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.10.0-optional-updater.patch
+       "${FILESDIR}"/${PN}-0.11.0_pre20260101-debugger.patch
+)
+
+CMAKE_QA_COMPAT_SKIP=1 #958356
+
+pkg_setup() {
+       use lua && lua-single_pkg_setup
+}
+
+src_configure() {
+       # has unwanted logic with RelWithDebInfo
+       local -x CMAKE_BUILD_TYPE=Release
+
+       local mycmakeargs=(
+               -DBUILD_CINEMA=$(usex test)
+               -DBUILD_GL=$(usex opengl)
+               -DBUILD_GLES2=$(usex gles2)
+               -DBUILD_GLES3=$(usex gles3)
+               -DBUILD_HEADLESS=yes #918855
+               -DBUILD_LIBRETRO=$(usex libretro)
+               -DBUILD_LTO=no # let users' flags handle this
+               -DBUILD_QT=$(usex gui)
+               $(usev gui -DFORCE_QT_VERSION=6)
+               -DBUILD_SDL=$(usex sdl) # also used for gamepads in QT build
+               -DBUILD_SUITE=$(usex test)
+               -DBUILD_UPDATER=no
+               -DENABLE_DEBUGGERS=$(usex debug)
+               -DENABLE_GDB_STUB=$(usex debug)
+               -DENABLE_SCRIPTING=$(usex lua)
+               -DMARKDOWN=no #752048
+               -DSKIP_GIT=yes
+               -DUSE_DISCORD_RPC=$(usex discord)
+               -DUSE_EDITLINE=$(usex debug)
+               -DUSE_ELF=$(usex elf)
+               -DUSE_EPOXY=no
+               -DUSE_FFMPEG=$(usex ffmpeg)
+               -DUSE_FREETYPE=yes
+               -DUSE_JSON_C=yes
+               -DUSE_LIBZIP=no
+               $(usev lua -DUSE_LUA="${ELUA#lua}")
+               -DUSE_LZMA=yes
+               -DUSE_MINIZIP=yes
+               -DUSE_PNG=yes
+               -DUSE_SQLITE3=$(usex sqlite)
+               -DUSE_ZLIB=yes
+               $(usev libretro 
-DLIBRETRO_LIBDIR="${EPREFIX}"/usr/$(get_libdir)/libretro)
+       )
+
+       cmake_src_configure
+}
+
+src_test() {
+       # CMakeLists.txt forces SKIP_RPATH=yes when PREFIX=/usr
+       local -x LD_LIBRARY_PATH=${BUILD_DIR}:${LD_LIBRARY_PATH}
+       local -x QT_QPA_PLATFORM=offscreen
+
+       cmake_src_test
+}
+
+src_install() {
+       cmake_src_install
+
+       use !test || rm "${ED}"/usr/bin/mgba-cinema || die
+
+       rm -r -- "${ED}"/usr/share/doc/${PF}/{LICENSE,licenses} || die
+}
+
+pkg_preinst() {
+       xdg_pkg_preinst
+
+       # hack: .shader/ were directories in <0.11 and are now single (zip) 
files
+       # named the same, that leads to portage mis-merging and leaving an empty
+       # directory behind rather than the new file
+       if use gui && has_version '<games-emulation/mgba-0.11[gui]'; then
+               rm -rf -- "${EROOT}"/usr/share/mgba/shaders/*.shader/ || die
+       fi
+}

Reply via email to