# Contributor: Bart Ribbers # Maintainer: Bart Ribbers pkgname=dolphin-emu pkgver=5.0_git20230716 pkgrel=0 _commit="d867e2baeb95f6fddd7aee2679d5c324a1c5bd1d" _commit_cubeb="27d2a102b0b75d9e49d43bc1ea516233fb87d778" _commit_gtest="58d77fa8070e8cec2dc1ed015d66b454c8d78850" _commit_implot="d87512353495e7760e7fda7566a05beef7627d8f" _commit_mgba="8739b22fbc90fdf0b4f6612ef9c0520f0ba44a51" _commit_rcheevos="d9e990e6d13527532b7e2bb23164a1f3b7f33bb5" _commit_spirv="50b4d5389b6a06f86fb63a2848e1a7da6d9755ca" _commit_vulkan_memory="498e20dfd1343d99b9115201034bb0219801cdec" _commit_zlib="ce01b1e41da298334f8214389cc9369540a7560f" # 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="Gamecube / Wii emulator" license="GPL-2.0-or-later" makedepends=" bluez-dev cmake curl-dev enet-dev eudev-dev ffmpeg-dev fmt-dev hidapi-dev libevdev-dev libpng-dev libspng-dev libusb-dev libx11-dev libxi-dev libxrandr-dev lzo-dev mesa-dev mbedtls-dev miniupnpc-dev ninja pugixml-dev pulseaudio-dev qt6-qtbase-dev qt6-qtsvg-dev sfml-dev vulkan-headers vulkan-loader-dev 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/mozilla/cubeb/archive/$_commit_cubeb/cubeb-$_commit_cubeb.tar.gz https://github.com/google/googletest/archive/$_commit_gtest/googletest-$_commit_gtest.tar.gz https://github.com/epezent/implot/archive/$_commit_implot/implot-$_commit_implot.tar.gz https://github.com/mgba-emu/mgba/archive/$_commit_mgba/mgba-$_commit_mgba.tar.gz https://github.com/RetroAchievements/rcheevos/archive/$_commit_rcheevos/rcheevos-$_commit_rcheevos.tar.gz https://github.com/KhronosGroup/SPIRV-Cross/archive/$_commit_spirv/spirv-cross-$_commit_spirv.tar.gz https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/$_commit_vulkan_memory/VulkanMemoryAllocator-$_commit_vulkan_memory.tar.gz https://github.com/zlib-ng/zlib-ng/archive/$_commit_zlib/zlib-ng-$_commit_zlib.tar.gz gcc13.patch " subpackages="$pkgname-doc $pkgname-lang" builddir="$srcdir/dolphin-$_commit" prepare() { default_prepare git init -q rmdir Externals/mGBA/mgba mv "$srcdir"/mgba-$_commit_mgba Externals/mGBA/mgba 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 rmdir Externals/cubeb/cubeb mv "$srcdir"/cubeb-$_commit_cubeb Externals/cubeb/cubeb rmdir Externals/gtest mv "$srcdir"/googletest-$_commit_gtest Externals/gtest rmdir Externals/rcheevos/rcheevos mv "$srcdir"/rcheevos-$_commit_rcheevos Externals/rcheevos/rcheevos rmdir Externals/implot/implot mv "$srcdir"/implot-$_commit_implot Externals/implot/implot rmdir Externals/VulkanMemoryAllocator mv "$srcdir"/VulkanMemoryAllocator-$_commit_vulkan_memory Externals/VulkanMemoryAllocator # 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 KEEP_SOURCES=" Bochs_disasm FatFs FreeSurround Vulkan VulkanMemoryAllocator cpp-optparse cubeb expr glslang gtest imgui implot mGBA minizip picojson rangeset rcheevos 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 # analytics is opt-in, a pop up box at first launch, thus fine CFLAGS="$CFLAGS -O2" \ CXXFLAGS="$CXXFLAGS -O2" \ cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=None \ -DCMAKE_INSTALL_PREFIX=/usr \ -DENABLE_LLVM=OFF \ -DENABLE_GENERIC=$_generic \ -DDISTRIBUTOR="alpinelinux.org" \ -DUSE_DISCORD_PRESENCE=OFF \ -DENABLE_AUTOUPDATE=OFF \ -DENABLE_ANALYTICS=ON \ -DUSE_SANITIZERS=OFF \ -DWITH_SANITIZER=OFF 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=" 12c96dd80bca5d2e76e3c977d28674d8962c62c50bb7292c30b23a62c4888fd0ccdf197495698b2943c12ae7a1143c436c38b4dc0d53e93afee1a28e83943689 dolphin-emu-d867e2baeb95f6fddd7aee2679d5c324a1c5bd1d.tar.gz 0844b56a949a23474b4f8b736bfc61bfe713f2ededd7148644a65883d963606dbde9bed6fc07f1b9181af4e4f8c411e0147352a8556e660907f74b0e617a25d0 cubeb-27d2a102b0b75d9e49d43bc1ea516233fb87d778.tar.gz d8153c426e4f9c89a74721cc4a24dfcaf319810f4f10aa25fc972f99da2d96d66bc840cf2f51b756fef6b1ca47e8d2c8633f5862cc24e34d57309ad48802124a googletest-58d77fa8070e8cec2dc1ed015d66b454c8d78850.tar.gz 2b48ee1313ec6c0790fd10f5772082c91902fe3aa0a10a05b19107ee85096ef4e97b1068841cb7f6f947acfdd5df3695b01807222bdc1e4509cf79a1e6852ade implot-d87512353495e7760e7fda7566a05beef7627d8f.tar.gz 782d456b7bf827591c774f146a88821b41b3b936faefddb5aee82bb0dd16ca7ad7228a1c331e1e517eac40a71cc4c94cc44bee12560946328c8433e1c6327225 mgba-8739b22fbc90fdf0b4f6612ef9c0520f0ba44a51.tar.gz 2959002fc41225d7aedd0d69a5ca54b84a4e727814d5dca5b953a0075dd84fd2a2a3751e1840232ec6996868aa41874a00fdffabdf0d141ca53872849c5a8b40 rcheevos-d9e990e6d13527532b7e2bb23164a1f3b7f33bb5.tar.gz 237bf9c902c23721592bff44b493198bc6b732cbaf4712b1bf56bfe1df76e7290fadec7cccd1694fccd808a1f57b681f696c323ef616f547bb54ddc97c604cea spirv-cross-50b4d5389b6a06f86fb63a2848e1a7da6d9755ca.tar.gz 1a58832ba11b953f097e321e335e5884e7f08e08ef7e7dff43c6faf7a0b7ffaf268b4c50f29fdc5eb08b03d4957f4194b72c4f4c87ae8f060bedf6f965063272 VulkanMemoryAllocator-498e20dfd1343d99b9115201034bb0219801cdec.tar.gz 73f4e56410ae298ef211ebab52b1a0d3d5bfae91c2de3cd294b56cd0a78ab50e1203b396c7df462f360c1aaaa9392ec5625473d1e9eb084cc64bc813e28d12a1 zlib-ng-ce01b1e41da298334f8214389cc9369540a7560f.tar.gz 8cdd88c93c49325de4cae62af14a14576f679c5b4c1350fb835e7007916d228811ecf5ba9e526760bd2388c69c46990fa33d2dd8bbb1b673dc7e6896ea958b44 gcc13.patch "