commit: 6edb37a2fcfc33926e784ad3f2bcd533b3121eb7 Author: Alfred Wingate <parona <AT> protonmail <DOT> com> AuthorDate: Sat Jan 18 14:23:44 2025 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sat Jan 18 16:34:05 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6edb37a2
games-emulation/dolphin: add 2412 Bug: https://bugs.gentoo.org/946588 Closes: https://bugs.gentoo.org/945374 Signed-off-by: Alfred Wingate <parona <AT> protonmail.com> Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> games-emulation/dolphin/Manifest | 1 + games-emulation/dolphin/dolphin-2412.ebuild | 301 +++++++++++++++++++++ ...2412-fix-build-without-retro-achievements.patch | 68 +++++ .../files/dolphin-2412-fix-libfmt-11.1.ebuild | 75 +++++ 4 files changed, 445 insertions(+) diff --git a/games-emulation/dolphin/Manifest b/games-emulation/dolphin/Manifest index 7730538a400e..99d2614d0e16 100644 --- a/games-emulation/dolphin/Manifest +++ b/games-emulation/dolphin/Manifest @@ -1,6 +1,7 @@ DIST Vulkan-Headers-05fe2cc910a68c9ba5dac07db46ef78573acee72.tar.gz 2288519 BLAKE2B bd11ba3ecac3bf0f6df255a4b87556092b9630c85b97cbcc2c0901d5293882da6f996e326cce8f410f8503f9e29454f0a2994c4adceb4565490d435b307d4495 SHA512 3679a087ea024a15b2d30730834345d2af3869ae012bcc5a996eed90558516d16b762010d887b9c762b5177bfc0a21b3bd29dbc4e236e067132623482068b058 DIST VulkanMemoryAllocator-009ecd192c1289c7529bff248a16cfe896254816.tar.gz 904841 BLAKE2B 64966d40b86197a18f86c9715acb2ea649ea6b69d3de38d9385a8130e35519036eca49b7503886123284be58d5c248dd9d7c5cb16a489c64d385439c382dcd30 SHA512 3a47a4bc81562b96f598f357b803d2219fa167e6eb87779837efa6e85fc6eaff8e1cfbdea0935117a7b3c630cc99944b94e91823eafa8a94d80b2c459f33c317 DIST dolphin-2407.tar.gz 19773792 BLAKE2B a6de162479d45e6b1cba5444df5abdeafd92773d1e49cc837dfc6c1ab45ed11d7a3f72a582ddb56d0ecc6b550d03c1a02a9389852ba438d8a9235d5ea3285d4b SHA512 8bb8459d8b653708e34d5df184d96ba9705e8c50b00d066862d4012f78b7e71938207979b3bd900dd14c35c3b6c0258bb5c8fad9ba73267188e98d8a2edfb73f +DIST dolphin-2412.tar.gz 19926717 BLAKE2B 89036561987283067a1f116aa38a94c92d0c8e3114d28a0545787f63b389cb204b265bdd4c2452ec02ca3fe90fccf5fc0fd55be3acb9b8bd346e3738f3f96767 SHA512 3025e24b4cdc8cf3493e23a7968064cb9090d622a3a830b0a964fc87af840227125de8c0f69243c7d3975fc5ea2dd0c485d870301c25e8fa078abe83ae88bca9 DIST dolphin-5.0_p20220520.tar.gz 34880474 BLAKE2B 925cddfe8a5d6febced5721bea6ced7c8d2855619f74ca8940b95dc78ea523b4a1083b9ef6efe3561d833b8e9ecb742cb2adf5a1864c06b629b3ecd9e92cc871 SHA512 4993cb10061b142f6627c96493885a5f9d88857d8949c2e8e8d5df5ba6e19b4f98d199da5e641d3d61294884e1cbbe8191bc5b4445c60bf80723046b2524aad5 DIST implot-cc5e1daa5c7f2335a9460ae79c829011dc5cef2d.tar.gz 137924 BLAKE2B c830275b05a74e8a60a7164f22c01dd9a5a35f9219736785c9cc17830dae809eb8cba65604b0388c3966d7658c9fe71cb9a8468c23d3ed17b7890581a2222cb8 SHA512 ab9935e759f38d19e6f60ed195c22018929ba46fccf783f4486346d7ffb7040b6097bc4c3d3b3577cc91f0c413684e07449a24bebf3db9c937638092c181de92 DIST mgba-40d4c430fc36caeb7ea32fd39624947ed487d2f2.tar.gz 12921593 BLAKE2B 8c5cf7b9b53f897f6248ad6bc51efafaa8a9d5df137d42d30f4b042b6d1527049644595938626c8cae1385d329bc45bf42db8dcc4424b963a3899e0df53246eb SHA512 26d7b60cbc7415652bb9ca2a42ccd532856867db57bf6dd91d8204551970109b6b9f4a96c42d643ea96b9d071d6aec924d3c1bb79c251c95183b7fb8536456c9 diff --git a/games-emulation/dolphin/dolphin-2412.ebuild b/games-emulation/dolphin/dolphin-2412.ebuild new file mode 100644 index 000000000000..43af88d4f93b --- /dev/null +++ b/games-emulation/dolphin/dolphin-2412.ebuild @@ -0,0 +1,301 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_COMPAT=( 18 ) +LLVM_OPTIONAL=1 + +inherit cmake llvm-r1 pax-utils xdg-utils + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/dolphin-emu/dolphin" + EGIT_SUBMODULES=( + Externals/mGBA/mgba + Externals/implot/implot + Externals/tinygltf/tinygltf + Externals/Vulkan-Headers + Externals/VulkanMemoryAllocator + Externals/zlib-ng/zlib-ng + Externals/minizip-ng/minizip-ng + ) +else + MGBA_COMMIT=8739b22fbc90fdf0b4f6612ef9c0520f0ba44a51 + IMPLOT_COMMIT=cc5e1daa5c7f2335a9460ae79c829011dc5cef2d + TINYGLTF_COMMIT=c5641f2c22d117da7971504591a8f6a41ece488b + VULKAN_HEADERS_COMMIT=05fe2cc910a68c9ba5dac07db46ef78573acee72 + VULKANMEMORYALLOCATOR_COMMIT=009ecd192c1289c7529bff248a16cfe896254816 + ZLIB_NG_COMMIT=ce01b1e41da298334f8214389cc9369540a7560f + MINIZIP_NG_COMMIT=3eed562ef0ea3516db30d1c8ecb0e1b486d8cb70 + SRC_URI=" + https://github.com/dolphin-emu/dolphin/archive/${PV}.tar.gz + -> ${P}.tar.gz + https://github.com/epezent/implot/archive/${IMPLOT_COMMIT}.tar.gz + -> implot-${IMPLOT_COMMIT}.tar.gz + https://github.com/syoyo/tinygltf/archive/${TINYGLTF_COMMIT}.tar.gz + -> tinygltf-${TINYGLTF_COMMIT}.tar.gz + https://github.com/KhronosGroup/Vulkan-Headers/archive/${VULKAN_HEADERS_COMMIT}.tar.gz + -> Vulkan-Headers-${VULKAN_HEADERS_COMMIT}.tar.gz + https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/${VULKANMEMORYALLOCATOR_COMMIT}.tar.gz + -> VulkanMemoryAllocator-${VULKANMEMORYALLOCATOR_COMMIT}.tar.gz + https://github.com/zlib-ng/zlib-ng/archive/${ZLIB_NG_COMMIT}.tar.gz + -> zlib-ng-${ZLIB_NG_COMMIT}.tar.gz + https://github.com/zlib-ng/minizip-ng/archive/${MINIZIP_NG_COMMIT}.tar.gz + -> minizip-ng-${MINIZIP_NG_COMMIT}.tar.gz + mgba? ( + https://github.com/mgba-emu/mgba/archive/${MGBA_COMMIT}.tar.gz + -> mgba-${MGBA_COMMIT}.tar.gz + ) + " + KEYWORDS="~amd64 ~arm64" +fi + +DESCRIPTION="Gamecube and Wii game emulator" +HOMEPAGE="https://dolphin-emu.org/" + +LICENSE="GPL-2+ BSD BSD-2 LGPL-2.1+ MIT ZLIB" +SLOT="0" +IUSE=" + alsa bluetooth discord-presence doc egl +evdev ffmpeg +gui llvm log mgba + profile pulseaudio sdl systemd telemetry test upnp vulkan +" +REQUIRED_USE=" + mgba? ( gui ) + llvm? ( ${LLVM_REQUIRED_USE} ) +" +RESTRICT="!test? ( test )" + +RDEPEND=" + app-arch/bzip2:= + >=app-arch/lz4-1.8:= + app-arch/xz-utils + >=app-arch/zstd-1.4.0:= + dev-libs/hidapi + >=dev-libs/libfmt-10.1:= + dev-libs/lzo:2 + dev-libs/pugixml + dev-libs/xxhash + media-libs/cubeb + media-libs/libsfml:= + media-libs/libspng + >=net-libs/enet-1.3.18:1.3= + net-libs/mbedtls:0= + net-misc/curl + x11-libs/libX11 + x11-libs/libXi + x11-libs/libXrandr + virtual/libusb:1 + virtual/opengl + alsa? ( media-libs/alsa-lib ) + bluetooth? ( net-wireless/bluez:= ) + evdev? ( + dev-libs/libevdev + virtual/udev + ) + ffmpeg? ( media-video/ffmpeg:= ) + gui? ( + dev-qt/qtbase:6[gui,widgets] + dev-qt/qtsvg:6 + ) + llvm? ( $(llvm_gen_dep 'llvm-core/llvm:${LLVM_SLOT}=') ) + profile? ( dev-util/oprofile ) + pulseaudio? ( media-libs/libpulse ) + sdl? ( media-libs/libsdl2 ) + systemd? ( sys-apps/systemd:0= ) + upnp? ( net-libs/miniupnpc:= ) +" +DEPEND=" + ${RDEPEND} + egl? ( media-libs/libglvnd ) + test? ( dev-cpp/gtest ) +" +BDEPEND=" + sys-devel/gettext + virtual/pkgconfig +" + +# vulkan-loader required for vulkan backend which can be selected +# at runtime. +RDEPEND+=" + vulkan? ( media-libs/vulkan-loader ) +" + +# [directory]=license +declare -A KEEP_BUNDLED=( + # please keep this list in CMakeLists.txt order + + # TODO: use system libraries + # bug #873952 + # https://github.com/dolphin-emu/dolphin/pull/13089 + [zlib-ng]=ZLIB + [minizip-ng]=ZLIB + + [Bochs_disasm]=LGPL-2.1+ + [cpp-optparse]=MIT + [imgui]=MIT + [implot]=MIT + [glslang]=BSD + + [tinygltf]=MIT + + [FreeSurround]=GPL-2+ + [soundtouch]=LGPL-2.1+ + + # FIXME: discord-rpc not packaged + [discord-rpc]=MIT + + [mGBA]=MPL-2.0 + + [picojson]=BSD-2 + [expr]=MIT + [rangeset]=ZLIB + [FatFs]=FatFs + [Vulkan-Headers]="|| ( Apache-2.0 MIT )" + [VulkanMemoryAllocator]=MIT +) + +PATCHES=( + "${FILESDIR}"/dolphin-2407-minizip.patch + "${FILESDIR}"/dolphin-2412-fix-libfmt-11.1.ebuild + "${FILESDIR}"/dolphin-2412-fix-build-without-retro-achievements.patch +) + +add_bundled_licenses() { + for license in ${KEEP_BUNDLED[@]}; do + LICENSE+=" ${license}" + done +} +add_bundled_licenses + +pkg_setup() { + use llvm && llvm-r1_pkg_setup +} + +src_prepare() { + if [[ ${PV} != *9999 ]]; then + mv -T "${WORKDIR}/implot-${IMPLOT_COMMIT}" Externals/implot/implot || die + mv -T "${WORKDIR}/tinygltf-${TINYGLTF_COMMIT}" Externals/tinygltf/tinygltf || die + mv -T "${WORKDIR}/Vulkan-Headers-${VULKAN_HEADERS_COMMIT}" Externals/Vulkan-Headers || die + mv -T "${WORKDIR}/VulkanMemoryAllocator-${VULKANMEMORYALLOCATOR_COMMIT}" Externals/VulkanMemoryAllocator || die + mv -T "${WORKDIR}/zlib-ng-${ZLIB_NG_COMMIT}" Externals/zlib-ng/zlib-ng || die + mv -T "${WORKDIR}/minizip-ng-${MINIZIP_NG_COMMIT}" Externals/minizip-ng/minizip-ng || die + if use mgba; then + mv -T "${WORKDIR}/mgba-${MGBA_COMMIT}" Externals/mGBA/mgba || die + fi + fi + + cmake_src_prepare + + local s remove=() + for s in Externals/*; do + [[ -f ${s} ]] && continue + if ! has "${s#Externals/}" "${!KEEP_BUNDLED[@]}"; then + remove+=( "${s}" ) + fi + done + + einfo "removing sources: ${remove[*]}" + rm -r "${remove[@]}" || die + + # Remove dirty suffix: needed for netplay + sed -i -e 's/--dirty/&=""/' CMake/ScmRevGen.cmake || die +} + +src_configure() { + local mycmakeargs=( + -DDSPTOOL=ON + -DENABLE_ALSA=$(usex alsa) + -DENABLE_ANALYTICS=$(usex telemetry) + -DENABLE_AUTOUPDATE=OFF + -DENABLE_BLUEZ=$(usex bluetooth) + -DENABLE_CLI_TOOL=ON + -DENABLE_EGL=$(usex egl) + -DENABLE_EVDEV=$(usex evdev) + -DENABLE_LLVM=$(usex llvm) + -DENABLE_LTO=OFF # just adds -flto, user can do that via flags + -DENABLE_NOGUI=$(usex !gui) + -DENABLE_PULSEAUDIO=$(usex pulseaudio) + -DENABLE_QT=$(usex gui) + -DENABLE_SDL=$(usex sdl) + -DENABLE_TESTS=$(usex test) + -DENABLE_VULKAN=$(usex vulkan) + -DENCODE_FRAMEDUMPS=$(usex ffmpeg) + -DFASTLOG=$(usex log) + -DOPROFILING=$(usex profile) + -DUSE_DISCORD_PRESENCE=$(usex discord-presence) + -DUSE_MGBA=$(usex mgba) + -DUSE_RETRO_ACHIEVEMENTS=OFF + -DUSE_UPNP=$(usex upnp) + + -DCMAKE_DISABLE_FIND_PACKAGE_SYSTEMD=$(usex !systemd) + + # Use system libraries + -DUSE_SYSTEM_FMT=ON + -DUSE_SYSTEM_PUGIXML=ON + -DUSE_SYSTEM_ENET=ON + -DUSE_SYSTEM_XXHASH=ON + -DUSE_SYSTEM_BZIP2=ON + -DUSE_SYSTEM_LIBLZMA=ON + -DUSE_SYSTEM_ZSTD=ON + -DUSE_SYSTEM_MINIZIP=OFF + -DUSE_SYSTEM_LZO=ON + -DUSE_SYSTEM_LZ4=ON + -DUSE_SYSTEM_SPNG=ON + -DUSE_SYSTEM_CUBEB=ON + -DUSE_SYSTEM_LIBUSB=ON + -DUSE_SYSTEM_SFML=ON + -DUSE_SYSTEM_MBEDTLS=ON + -DUSE_SYSTEM_CURL=ON + -DUSE_SYSTEM_ICONV=ON + -DUSE_SYSTEM_HIDAPI=ON + + # Use ccache only when user did set FEATURES=ccache (or similar) + # not when ccache binary is present in system (automagic). + -DCCACHE_BIN=CCACHE_BIN-NOTFOUND + + # Undo cmake.eclass's defaults. + # All dolphin's libraries are private + # and rely on circular dependency resolution. + -DBUILD_SHARED_LIBS=OFF + + # Avoid warning spam around unset variables. + -Wno-dev + ) + + # System installed git shouldnt affect non live builds + [[ ${PV} != *9999 ]] && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON ) + + use test && mycmakeargs+=( -DUSE_SYSTEM_GTEST=ON ) + use mgba && mycmakeargs+=( -DUSE_SYSTEM_LIBMGBA=OFF ) + use sdl && mycmakeargs+=( -DUSE_SYSTEM_SDL2=ON ) + use upnp && mycmakeargs+=( -DUSE_SYSTEM_MINIUPNPC=ON ) + + cmake_src_configure +} + +src_test() { + cmake_build unittests +} + +src_install() { + cmake_src_install + + dodoc Readme.md + if use doc; then + dodoc -r docs/ActionReplay docs/DSP docs/WiiMote + fi + + # Add pax markings for hardened systems + pax-mark -m "${ED}"/usr/bin/"${PN}"{-emu{,-nogui},-tool} +} + +pkg_postinst() { + xdg_desktop_database_update + xdg_icon_cache_update +} + +pkg_postrm() { + xdg_desktop_database_update + xdg_icon_cache_update +} diff --git a/games-emulation/dolphin/files/dolphin-2412-fix-build-without-retro-achievements.patch b/games-emulation/dolphin/files/dolphin-2412-fix-build-without-retro-achievements.patch new file mode 100644 index 000000000000..01575fb551c3 --- /dev/null +++ b/games-emulation/dolphin/files/dolphin-2412-fix-build-without-retro-achievements.patch @@ -0,0 +1,68 @@ +https://github.com/dolphin-emu/dolphin/pull/13226 + +https://github.com/dolphin-emu/dolphin/commit/84ab15e020a993286329e1fc0b0e47ffc3c0a536 +From 84ab15e020a993286329e1fc0b0e47ffc3c0a536 Mon Sep 17 00:00:00 2001 +From: JosJuice <[email protected]> +Date: Sun, 15 Dec 2024 18:00:14 +0100 +Subject: [PATCH 1/2] AchievementManager: Add required forward declarations + +This was causing compilation errors when building without +USE_RETRO_ACHIEVEMENTS. +--- a/Source/Core/Core/AchievementManager.h ++++ b/Source/Core/Core/AchievementManager.h +@@ -275,11 +275,21 @@ class AchievementManager + + #include <string> + ++namespace ActionReplay ++{ ++struct ARCode; ++} ++ + namespace DiscIO + { + class Volume; + } + ++namespace Gecko ++{ ++class GeckoCode; ++} ++ + class AchievementManager + { + public: + +https://github.com/dolphin-emu/dolphin/commit/ad24ddb6bb01ddaba19bf72e8eda5cae354701ae +From ad24ddb6bb01ddaba19bf72e8eda5cae354701ae Mon Sep 17 00:00:00 2001 +From: JosJuice <[email protected]> +Date: Sun, 15 Dec 2024 18:15:57 +0100 +Subject: [PATCH 2/2] VerifyTool: Add missing USE_RETRO_ACHIEVEMENTS ifdefs + +--- a/Source/Core/DolphinTool/VerifyCommand.cpp ++++ b/Source/Core/DolphinTool/VerifyCommand.cpp +@@ -133,8 +133,10 @@ int VerifyCommand(const std::vector<std::string>& args) + hashes_to_calculate.md5 = true; + else if (algorithm == "sha1") + hashes_to_calculate.sha1 = true; ++#ifdef USE_RETRO_ACHIEVEMENTS + else if (algorithm == "rchash") + rc_hash_calculate = true; ++#endif + } + + if (!hashes_to_calculate.crc32 && !hashes_to_calculate.md5 && !hashes_to_calculate.sha1 && +@@ -163,11 +165,13 @@ int VerifyCommand(const std::vector<std::string>& args) + verifier.Finish(); + const DiscIO::VolumeVerifier::Result& result = verifier.GetResult(); + ++#ifdef USE_RETRO_ACHIEVEMENTS + // Calculate rcheevos hash + if (rc_hash_calculate) + { + rc_hash_result = AchievementManager::CalculateHash(input_file_path); + } ++#endif + + // Print the report + if (!algorithm_is_set) diff --git a/games-emulation/dolphin/files/dolphin-2412-fix-libfmt-11.1.ebuild b/games-emulation/dolphin/files/dolphin-2412-fix-libfmt-11.1.ebuild new file mode 100644 index 000000000000..0f5c3fd91c41 --- /dev/null +++ b/games-emulation/dolphin/files/dolphin-2412-fix-libfmt-11.1.ebuild @@ -0,0 +1,75 @@ +https://github.com/dolphin-emu/dolphin/commit/22dc21cca42b2eaf373ac9e1b5128c566615aa71 +https://github.com/dolphin-emu/dolphin/pull/13262 + +From 825092ad33a2e7466e79520c1338d0bed56ca299 Mon Sep 17 00:00:00 2001 +From: Ferdinand Bachmann <[email protected]> +Date: Sat, 4 Jan 2025 18:45:32 +0100 +Subject: [PATCH 1/2] BBA/HLE: Fix incorrect fmt format string + +--- a/Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp ++++ b/Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp +@@ -686,7 +686,7 @@ bool CEXIETHERNET::BuiltInBBAInterface::SendFrame(const u8* frame, u32 size) + } + + default: +- ERROR_LOG_FMT(SP1, "Unsupported EtherType {#06x}", *ethertype); ++ ERROR_LOG_FMT(SP1, "Unsupported EtherType {:#06x}", *ethertype); + return false; + } + + +From b79bdb13c05b4fcef23cd30b210d40662d28373b Mon Sep 17 00:00:00 2001 +From: Ferdinand Bachmann <[email protected]> +Date: Sat, 4 Jan 2025 18:46:04 +0100 +Subject: [PATCH 2/2] Common: Fix compile failure with fmt>=11 + +--- a/Source/Core/Common/Logging/Log.h ++++ b/Source/Core/Common/Logging/Log.h +@@ -99,7 +99,13 @@ void GenericLogFmt(LogLevel level, LogType type, const char* file, int line, con + static_assert(NumFields == sizeof...(args), + "Unexpected number of replacement fields in format string; did you pass too few or " + "too many arguments?"); +- GenericLogFmtImpl(level, type, file, line, format, fmt::make_format_args(args...)); ++ ++#if FMT_VERSION >= 110000 ++ auto&& format_str = fmt::format_string<Args...>(format); ++#else ++ auto&& format_str = format; ++#endif ++ GenericLogFmtImpl(level, type, file, line, format_str, fmt::make_format_args(args...)); + } + } // namespace Common::Log + +--- a/Source/Core/Common/MsgHandler.h ++++ b/Source/Core/Common/MsgHandler.h +@@ -41,12 +41,17 @@ bool MsgAlertFmt(bool yes_no, MsgType style, Common::Log::LogType log_type, cons + static_assert(NumFields == sizeof...(args), + "Unexpected number of replacement fields in format string; did you pass too few or " + "too many arguments?"); +-#if FMT_VERSION >= 90000 ++#if FMT_VERSION >= 110000 ++ static_assert(std::is_base_of_v<fmt::detail::compile_string, S>); ++ auto&& format_str = fmt::format_string<Args...>(format); ++#elif FMT_VERSION >= 90000 + static_assert(fmt::detail::is_compile_string<S>::value); ++ auto&& format_str = format; + #else + static_assert(fmt::is_compile_string<S>::value); ++ auto&& format_str = format; + #endif +- return MsgAlertFmtImpl(yes_no, style, log_type, file, line, format, ++ return MsgAlertFmtImpl(yes_no, style, log_type, file, line, format_str, + fmt::make_format_args(args...)); + } + +@@ -60,7 +65,9 @@ bool MsgAlertFmtT(bool yes_no, MsgType style, Common::Log::LogType log_type, con + static_assert(NumFields == sizeof...(args), + "Unexpected number of replacement fields in format string; did you pass too few or " + "too many arguments?"); +-#if FMT_VERSION >= 90000 ++#if FMT_VERSION >= 110000 ++ static_assert(std::is_base_of_v<fmt::detail::compile_string, S>); ++#elif FMT_VERSION >= 90000 + static_assert(fmt::detail::is_compile_string<S>::value); + #else + static_assert(fmt::is_compile_string<S>::value);
