# Contributor: Bart Ribbers # Maintainer: Bart Ribbers pkgname=dolphin-emu pkgver=5.0_git20220817 pkgrel=1 _commit="86d760b8143989627bdff1be4474ce2fe59db8e9" _commit_libspng="dc5b1032c08efac68ad30170f7ccbf0aa8dd55c9" _commit_mgba="40d4c430fc36caeb7ea32fd39624947ed487d2f2" _commit_spirv="50b4d5389b6a06f86fb63a2848e1a7da6d9755ca" _commit_zlib="a406284705a462939c7a634119884a31b87d6af9" # Upstream doesn't actively support non 64-bit platforms and they're too slow # to emulate any games anyway arch="x86_64 aarch64 riscv64" url="https://dolphin-emu.org" pkgdesc="A Gamecube / Wii emulator" license="GPL-2.0-or-later" makedepends=" bluez-dev cmake curl-dev enet-dev eudev-dev ffmpeg-dev hidapi-dev libevdev-dev libpng-dev libusb-dev libx11-dev libxi-dev libxrandr-dev lzo-dev mesa-dev mesa-egl mbedtls-dev miniupnpc-dev ninja pugixml-dev pulseaudio-dev qt6-qtbase-dev qt6-qtbase-x11 sfml-dev vulkan-headers xz-dev zlib-dev zstd-dev " # The following dependencies are required, but atm not supported for using system wide libraries # minizip-dev xxhash-dev soundtouch-dev gtest-dev source="https://github.com/dolphin-emu/dolphin/archive/$_commit/dolphin-emu-$_commit.tar.gz https://github.com/mgba-emu/mgba/archive/$_commit_mgba/mgba-$_commit_mgba.tar.gz https://github.com/randy408/libspng/archive/$_commit_libspng/libspng-$_commit_libspng.tar.gz https://github.com/KhronosGroup/SPIRV-Cross/archive/$_commit_spirv/spirv-cross-$_commit_spirv.tar.gz https://github.com/zlib-ng/zlib-ng/archive/$_commit_zlib/zlib-ng-$_commit.tar.gz " subpackages="$pkgname-doc $pkgname-lang" builddir="$srcdir/dolphin-$_commit" [ "$CARCH" = "riscv64" ] && options="$options textrels" prepare() { default_prepare rmdir Externals/mGBA/mgba mv "$srcdir"/mgba-$_commit_mgba Externals/mGBA/mgba rmdir Externals/libspng/libspng mv "$srcdir"/libspng-$_commit_libspng Externals/libspng/libspng rmdir Externals/spirv_cross/SPIRV-Cross mv "$srcdir"/SPIRV-Cross-$_commit_spirv Externals/spirv_cross/SPIRV-Cross rmdir Externals/zlib-ng/zlib-ng mv "$srcdir"/zlib-ng-$_commit_zlib Externals/zlib-ng/zlib-ng # Make sure we never use non-system libraries except the ones that are not # supported being used system-wide by removing them from the Externals # folder # # Vulkan's API is not backwards-compatible # New release dropped VK_PRESENT_MODE_RANGE_SIZE_KHR # but Dolphin still relies on it # See e.g. https://bugs.gentoo.org/729832 KEEP_SOURCES=" Bochs_disasm FatFs FreeSurround Vulkan cpp-optparse cubeb fmt glslang gtest imgui libspng mGBA minizip picojson rangeset soundtouch spirv_cross xxhash zlib-ng " # Move the libraries we want to keep out of the externals folder for s in $KEEP_SOURCES; do mv -v "Externals/$s" . done # Remove the rest rm -r Externals/* # Move them back for s in $KEEP_SOURCES; do mv -v "$s" "Externals/" done } build() { # Enable a generic build for riscv64 # This enables building for the architecture but disables JIT and is thus slow # TODO: see if support for riscv64 has been enabled upstream and disable the generic build case "$CARCH" in riscv64) _generic=ON ;; *) _generic=OFF ;; esac cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=None \ -DCMAKE_INSTALL_PREFIX=/usr \ -DUSE_SHARED_ENET=ON \ -DENABLE_LLVM=OFF \ -DENABLE_GENERIC=$_generic \ -DDISTRIBUTOR="alpinelinux.org" \ -DUSE_DISCORD_PRESENCE=OFF \ -DENABLE_AUTOUPDATE=OFF \ -DENABLE_ANALYTICS=ON \ # opt-in, a pop up box at first launch, thus fine cmake --build build } check() { cd build CTEST_OUTPUT_ON_FAILURE=TRUE ctest } package() { DESTDIR="$pkgdir" cmake --install build install -Dm 644 Data/51-usb-device.rules -t "$pkgdir"/usr/lib/udev/rules.d/ } sha512sums=" 0ecbf79562ecaf5bb2976e2594a73a9977aeced0cc608712106763278330a90d4b4c13b12beae84275380c83a5700dbe28601d785fb8b366084593c8295b63df dolphin-emu-86d760b8143989627bdff1be4474ce2fe59db8e9.tar.gz 26d7b60cbc7415652bb9ca2a42ccd532856867db57bf6dd91d8204551970109b6b9f4a96c42d643ea96b9d071d6aec924d3c1bb79c251c95183b7fb8536456c9 mgba-40d4c430fc36caeb7ea32fd39624947ed487d2f2.tar.gz 1931c8e8ce17926fa21fb167828a20aa7cca22090c6c82b1b28c8fa0024ede235128309148be661f39d80bea20e16cc36e19cd2673490daf01e5eb6f5461da01 libspng-dc5b1032c08efac68ad30170f7ccbf0aa8dd55c9.tar.gz 237bf9c902c23721592bff44b493198bc6b732cbaf4712b1bf56bfe1df76e7290fadec7cccd1694fccd808a1f57b681f696c323ef616f547bb54ddc97c604cea spirv-cross-50b4d5389b6a06f86fb63a2848e1a7da6d9755ca.tar.gz 8f6eea6bb938551b64906138fab640446d80e1be34b3e1a07e9c4ed5a6d9e28218b580663a1453156928065749d65041503d69ce06f560886ee0dc3d90350de5 zlib-ng-86d760b8143989627bdff1be4474ce2fe59db8e9.tar.gz "