blob: 4748028b787816dccae86de8a7d726c26d2219ec (
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
|
# Maintainer: xiota / aur.chaotic.cx
# Contributor: Kerrick Staley <kerrick@kerrickstaley.com>
## useful links
# https://dolphin-emu.org
# https://github.com/dolphin-emu/dolphin
## options
: ${_debugfast:=false}
: ${_build_unittests:=false}
: ${_build_clang:=true}
: ${_build_mold:=false}
: ${_build_debugfast:=true}
: ${_build_avx:=false}
: ${_build_git:=true}
unset _pkgtype
[[ "${_build_debugfast::1}" == "t" ]] && _pkgtype+="-debugfast"
[[ "${_build_avx::1}" == "t" ]] && _pkgtype+="-avx"
[[ "${_build_git::1}" == "t" ]] && _pkgtype+="-git"
# basic info
_pkgname="dolphin-emu"
pkgname="$_pkgname${_pkgtype:-}"
pkgver=5.0.r21148.g5090a028
pkgrel=1
pkgdesc='A Gamecube and Wii emulator'
url="https://github.com/dolphin-emu/dolphin"
license=('GPL-2.0-or-later')
arch=(x86_64)
# main package
_main_package() {
depends=(
alsa-lib
bluez-libs
curl
ffmpeg
gcc-libs
glibc
libevdev
libgl
libpulse
libudev.so
libx11
libxi
libxrandr
qt6-base
qt6-svg
## optional
bzip2
cubeb
curl
fmt
hidapi
libiconv
liblzma.so
libspng
libusb
lz4
lzo
mbedtls2
miniupnpc
pugixml
sdl2
sfml
zstd
## broken
#enet
#libmgba
#minizip-ng
#xxhash
#zlib-ng
)
makedepends+=(
cmake
git
ninja
python
)
if [[ "${_build_unittests::1}" == "t" ]] ; then
checkdepends=('gtest')
check() {
ninja -C build unittests
}
fi
options=(!emptydirs)
if [[ "${_build_clang::1}" == "t" ]] ; then
makedepends+=(
clang
llvm
)
else
options+=(!lto)
fi
if [[ "${_build_mold::1}" == "t" ]] ; then
makedepends+=(mold)
elif [[ "${_build_clang::1}" == "t" ]] ; then
makedepends+=(lld)
fi
if [[ "${_build_git::1}" != "t" ]] ; then
_main_stable
else
_main_git
fi
_source_dolphin_emu
}
# submodules
_source_dolphin_emu() {
source+=(
#'bylaws.libadrenotools'::'git+https://github.com/bylaws/libadrenotools.git'
#'curl'::'git+https://github.com/curl/curl.git'
#'dolphin-emu.ext-win-ffmpeg'::'git+https://github.com/dolphin-emu/ext-win-ffmpeg.git'
#'dolphin-emu.ext-win-qt'::'git+https://github.com/dolphin-emu/ext-win-qt.git'
#'fmtlib.fmt'::'git+https://github.com/fmtlib/fmt.git'
#'google.googletest'::'git+https://github.com/google/googletest.git'
#'khronosgroup.spirv-cross'::'git+https://github.com/KhronosGroup/SPIRV-Cross.git'
#'libsdl-org.sdl'::'git+https://github.com/libsdl-org/SDL.git'
#'libusb'::'git+https://github.com/libusb/libusb.git'
#'libusb.hidapi'::'git+https://github.com/libusb/hidapi.git'
#'lz4'::'git+https://github.com/lz4/lz4.git'
#'mozilla.cubeb'::'git+https://github.com/mozilla/cubeb.git'
#'randy408.libspng'::'git+https://github.com/randy408/libspng.git'
'cyan4973.xxhash'::'git+https://github.com/Cyan4973/xxHash.git'
'epezent.implot'::'git+https://github.com/epezent/implot.git'
'gpuopen-librariesandsdks.vulkanmemoryallocator'::'git+https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git'
'lsalzman.enet'::'git+https://github.com/lsalzman/enet.git'
'mgba-emu.mgba'::'git+https://github.com/mgba-emu/mgba.git'
'retroachievements.rcheevos'::'git+https://github.com/RetroAchievements/rcheevos.git'
'syoyo.tinygltf'::'git+https://github.com/syoyo/tinygltf.git'
'zlib-ng'::'git+https://github.com/zlib-ng/zlib-ng.git'
)
sha256sums+=(
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
#'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
)
_prepare_dolphin_emu() (
cd "$_pkgsrc"
local -A _submodules=(
#['bylaws.libadrenotools']='Externals/libadrenotools'
#['curl']='Externals/curl/curl'
#['dolphin-emu.ext-win-ffmpeg']='Externals/FFmpeg-bin'
#['dolphin-emu.ext-win-qt']='Externals/Qt'
#['fmtlib.fmt']='Externals/fmt/fmt'
#['google.googletest']='Externals/gtest'
#['khronosgroup.spirv-cross']='Externals/spirv_cross/SPIRV-Cross'
#['libsdl-org.sdl']='Externals/SDL/SDL'
#['libusb']='Externals/libusb/libusb'
#['libusb.hidapi']='Externals/hidapi/hidapi-src'
#['lz4']='Externals/lz4/lz4'
#['mozilla.cubeb']='Externals/cubeb/cubeb'
#['randy408.libspng']='Externals/libspng/libspng'
['cyan4973.xxhash']='Externals/xxhash/xxHash'
['epezent.implot']='Externals/implot/implot'
['gpuopen-librariesandsdks.vulkanmemoryallocator']='Externals/VulkanMemoryAllocator'
['lsalzman.enet']='Externals/enet/enet'
['mgba-emu.mgba']='Externals/mGBA/mgba'
['retroachievements.rcheevos']='Externals/rcheevos/rcheevos'
['syoyo.tinygltf']='Externals/tinygltf/tinygltf'
['zlib-ng']='Externals/zlib-ng/zlib-ng'
)
_submodule_update
)
}
# stable package
_main_stable() {
:
}
# git package
_main_git() {
provides=(
'dolphin-emu'
'dolphin-emu-nogui'
'dolphin-emu-tool'
)
conflicts=(
'dolphin-emu'
'dolphin-emu-nogui'
'dolphin-emu-tool'
)
_pkgsrc="$_pkgname"
source=("$_pkgname"::"git+$url.git")
sha256sums+=('SKIP')
pkgver() {
cd "$_pkgsrc"
git describe --long --tags --abbrev=8 | sed -E 's/([^-]*-g)/r\1/;s/-/./g'
}
}
# common functions
prepare() {
_submodule_update() {
for key in ${!_submodules[@]} ; do
git submodule init "${_submodules[${key}]}"
git submodule set-url "${_submodules[${key}]}" "${srcdir}/${key}"
git -c protocol.file.allow=always submodule update "${_submodules[${key}]}"
done
}
_prepare_dolphin_emu
# Fix version string
local _pkgver=$(pkgver)
sed -Ez \
-e 's@\n\s+execute_process\([^\(\)]+\bdescribe [^\(\)]*--dirty\b[^\(\)]+\)@\n\nset(DOLPHIN_WC_DESCRIBE "'"${_pkgver:?}"'")@' \
-i "$srcdir/$_pkgsrc/CMake/ScmRevGen.cmake"
# Delete gcc specific options
sed '/_ARCHIVE_/d' -i "$srcdir/$_pkgsrc/CMakeLists.txt"
}
build() {
local _cmake_options=(
-B build
-S "$_pkgsrc"
-G Ninja
-DCMAKE_BUILD_TYPE=None
-DCMAKE_INSTALL_PREFIX='/usr'
-DDISTRIBUTOR='aur.archlinux.org'
-DENABLE_AUTOUPDATE=OFF
# -DENABLE_ANALYTICS=OFF # default:Opt-in
# -DUSE_SYSTEM_LIBS=ON # default:AUTO
-DUSE_SYSTEM_ENET=OFF
-DUSE_SYSTEM_LIBMGBA=OFF
-DUSE_SYSTEM_MINIZIP=OFF
-DUSE_SYSTEM_XXHASH=OFF
-DUSE_SYSTEM_ZLIB=OFF
-Wno-dev
)
if [ "${_debugfast::1}" == "t" ] ; then
_cmake_options+=(-DFASTLOG=ON)
fi
if [[ "${_build_unittests::1}" == "t" ]] ; then
_cmake_options+=(-DENABLE_TESTS=ON)
else
_cmake_options+=(-DENABLE_TESTS=OFF)
fi
if [[ "${_build_clang::1}" == "t" ]] ; then
export AR=llvm-ar
export NM=llvm-nm
export CC=clang
export CXX=clang++
_cmake_options+=(
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
-DENABLE_LTO=ON
)
else
_cmake_options+=(-DENABLE_LTO=OFF)
fi
if [[ "${_build_mold::1}" == "t" ]] ; then
export LDFLAGS+=" -fuse-ld=mold"
elif [[ "${_build_clang::1}" == "t" ]] ; then
export LDFLAGS+=" -fuse-ld=lld"
fi
if [[ "${_build_avx::1}" == "t" ]] ; then
export CFLAGS="$(echo "$CFLAGS" | sed -E 's@(\s*-(march|mtune)=\S+\s*)@ @g;s@\s*-O[0-9]\s*@ @g;s@\s+@ @g') -march=x86-64-v3 -mtune=generic -O3"
export CXXFLAGS="$(echo "$CXXFLAGS" | sed -E 's@(\s*-(march|mtune)=\S+\s*)@ @g;s@\s*-O[0-9]\s*@ @g;s@\s+@ @g') -march=x86-64-v3 -mtune=generic -O3"
fi
cmake "${_cmake_options[@]}"
cmake --build build
}
package() {
DESTDIR="$pkgdir" cmake --install build
install -Dm644 "$srcdir/$_pkgsrc/Data/51-usb-device.rules" \
-t "$pkgdir/usr/lib/udev/rules.d/"
rm -rf "$pkgdir"/usr/{include,lib/libdiscord-rpc.a}
}
# execute
_main_package
|