aboutsummaryrefslogtreecommitdiffstats
path: root/community/dolphin-emu/APKBUILD
blob: 4a93054facc7546f22ddefd965676989c0e66b9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=dolphin-emu
pkgver=5.0_git20240429
pkgrel=2
_commit="a9544510468740b77cf06ef28daaa65fe247fd32"
_commit_cubeb="54217bca3f3e0cd53c073690a23dd25d83557909"
_commit_enet="2a85cd64459f6ba038d233a634d9440490dbba12"
_commit_tinygltf="c5641f2c22d117da7971504591a8f6a41ece488b"
_commit_gtest="58d77fa8070e8cec2dc1ed015d66b454c8d78850"
_commit_implot="cc5e1daa5c7f2335a9460ae79c829011dc5cef2d"
_commit_mgba="8739b22fbc90fdf0b4f6612ef9c0520f0ba44a51"
_commit_rcheevos="a6cdbb4a529d85b74777597fcff037dde7bef66b"
_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
	eudev-dev
	ffmpeg4-dev
	fmt-dev
	gtest-dev
	hidapi-dev
	libevdev-dev
	libpng-dev
	libspng-dev
	libusb-dev
	libx11-dev
	libxi-dev
	libxrandr-dev
	lz4-dev
	lzo-dev
	mesa-dev
	mbedtls2-dev
	miniupnpc-dev
	ninja
	pugixml-dev
	pulseaudio-dev
	qt6-qtbase-dev
	qt6-qtsvg-dev
	sdl2-dev
	sfml-dev
	vulkan-headers
	vulkan-loader-dev
	xz-dev
	xxhash-dev
	zlib-dev
	zstd-dev
	"
# The following dependencies are required, but atm not supported for using system wide libraries
# minizip-dev soundtouch-dev gtest-dev
source="https://github.com/dolphin-emu/dolphin/archive/$_commit/dolphin-emu-$_commit.tar.gz
	https://github.com/lsalzman/enet/archive/$_commit_enet/enet-$_commit_enet.tar.gz
	https://github.com/mozilla/cubeb/archive/$_commit_cubeb/cubeb-$_commit_cubeb.tar.gz
	https://github.com/syoyo/tinygltf/archive/$_commit_tinygltf/tinygltf-$_commit_tinygltf.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/tinygltf/tinygltf
	mv "$srcdir"/tinygltf-$_commit_tinygltf Externals/tinygltf/tinygltf

	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

	rmdir Externals/enet/enet
	mv "$srcdir"/enet-$_commit_enet Externals/enet/enet

	# 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
		enet
		cubeb
		expr
		glslang
		gtest
		imgui
		implot
		mGBA
		minizip
		picojson
		rangeset
		rcheevos
		soundtouch
		spirv_cross
		tinygltf
		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 \
		-DUSE_SYSTEM_FMT=ON \
		-DUSE_SYSTEM_ENET=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="
e0ba33ce96a1e0eab9b9b9307284a9d9202a7c05fabb1a3bd55b981031ccb2fbad7e6d9c7f5bf8e97746b6033869ead05c079167325a7102fe0ba25df11094aa  dolphin-emu-a9544510468740b77cf06ef28daaa65fe247fd32.tar.gz
42f2f0b75bcdb883db39d31c4912e6f2f100f27ca8c7da6198b53c826acf27d1737b9010f9b881510d7a90395109ae078c58b1e50e1f25490e17eef0e779db92  enet-2a85cd64459f6ba038d233a634d9440490dbba12.tar.gz
7ba1cd5b74d49512d2ebf9b07889ee3ad46559afe3293bcbebae0613661f7502f0baaa20b6723738c21b2d71f9d8f72ed1252703533507dec5d2b5ad84784017  cubeb-54217bca3f3e0cd53c073690a23dd25d83557909.tar.gz
486bcf32be137dea5746117074dc51bc978290698de7831e1c4bbaa4acb56ed99fc34c38e69878a955b3e5f10f43eab07b0637164f822beae0fddd099aa0c56d  tinygltf-c5641f2c22d117da7971504591a8f6a41ece488b.tar.gz
d8153c426e4f9c89a74721cc4a24dfcaf319810f4f10aa25fc972f99da2d96d66bc840cf2f51b756fef6b1ca47e8d2c8633f5862cc24e34d57309ad48802124a  googletest-58d77fa8070e8cec2dc1ed015d66b454c8d78850.tar.gz
ab9935e759f38d19e6f60ed195c22018929ba46fccf783f4486346d7ffb7040b6097bc4c3d3b3577cc91f0c413684e07449a24bebf3db9c937638092c181de92  implot-cc5e1daa5c7f2335a9460ae79c829011dc5cef2d.tar.gz
782d456b7bf827591c774f146a88821b41b3b936faefddb5aee82bb0dd16ca7ad7228a1c331e1e517eac40a71cc4c94cc44bee12560946328c8433e1c6327225  mgba-8739b22fbc90fdf0b4f6612ef9c0520f0ba44a51.tar.gz
af8f571c3041c35fd00beaa46019b81711a0263983bd34aa65b0d92463b7f0d76c498b2ca906567f7165aefaa872ce0f835e5e1daa83b3bbf37480b8a95d0a0c  rcheevos-a6cdbb4a529d85b74777597fcff037dde7bef66b.tar.gz
237bf9c902c23721592bff44b493198bc6b732cbaf4712b1bf56bfe1df76e7290fadec7cccd1694fccd808a1f57b681f696c323ef616f547bb54ddc97c604cea  spirv-cross-50b4d5389b6a06f86fb63a2848e1a7da6d9755ca.tar.gz
1a58832ba11b953f097e321e335e5884e7f08e08ef7e7dff43c6faf7a0b7ffaf268b4c50f29fdc5eb08b03d4957f4194b72c4f4c87ae8f060bedf6f965063272  VulkanMemoryAllocator-498e20dfd1343d99b9115201034bb0219801cdec.tar.gz
73f4e56410ae298ef211ebab52b1a0d3d5bfae91c2de3cd294b56cd0a78ab50e1203b396c7df462f360c1aaaa9392ec5625473d1e9eb084cc64bc813e28d12a1  zlib-ng-ce01b1e41da298334f8214389cc9369540a7560f.tar.gz
8cdd88c93c49325de4cae62af14a14576f679c5b4c1350fb835e7007916d228811ecf5ba9e526760bd2388c69c46990fa33d2dd8bbb1b673dc7e6896ea958b44  gcc13.patch
"