summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c0764ca2ca6e8a9d3fe9b207f3d30fb86995bee4 (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
# Maintainer: Alexandre Bouvier <contact@amb.tf>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
_pkgname=libretro-citra
pkgname=$_pkgname-git
pkgver=r10157.973795ccb
pkgrel=1
pkgdesc="Nintendo 3DS core"
arch=('x86_64')
url="https://github.com/libretro/citra"
license=('GPL-2.0-or-later')
groups=('libretro')
depends=(
	'crypto++'
	'enet'
	'gcc-libs'
	'glibc'
	'glslang'
	'libretro-core-info'
)
makedepends=(
	'boost'
	'catch2'
	'cmake'
	'cubeb'
	'ffmpeg4.4'
	'git'
	'libinih'
	'openssl'
	'robin-map'
	'spirv-headers'
	'vulkan-memory-allocator'
	'xbyak'
	'zstd'
)
provides=("$_pkgname=${pkgver#r}")
conflicts=("$_pkgname")
source=(
	"$_pkgname::git+$url.git"
	'dds-ktx::git+https://github.com/septag/dds-ktx.git'
	'faad2::git+https://github.com/knik0/faad2.git'
	'fmt::git+https://github.com/fmtlib/fmt.git'
	'lodepng::git+https://github.com/lvandeve/lodepng.git'
	'nihstro::git+https://github.com/neobrain/nihstro.git'
	'pablomk7-dynarmic::git+https://github.com/PabloMK7/dynarmic.git'
	'pablomk7-sirit::git+https://github.com/PabloMK7/sirit.git'
	'soundtouch::git+https://codeberg.org/soundtouch/soundtouch.git'
	'teakra::git+https://github.com/wwylele/teakra.git'
	'vulkan-headers::git+https://github.com/KhronosGroup/Vulkan-Headers.git'
)
b2sums=(
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
)

pkgver() {
	cd $_pkgname
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	cd $_pkgname
	git config submodule.dds-ktx.url ../dds-ktx
	git config submodule.dynarmic.url ../pablomk7-dynarmic
	git config submodule.faad2.url ../faad2
	git config submodule.fmt.url ../fmt
	git config submodule.lodepng.url ../lodepng
	git config submodule.nihstro.url ../nihstro
	git config submodule.sirit.url ../pablomk7-sirit
	git config submodule.soundtouch.url ../soundtouch
	git config submodule.teakra.url ../teakra
	git config submodule.vulkan-headers.url ../vulkan-headers
	git -c protocol.file.allow=always submodule update
	sed -i '/cmake-modules/a include(FindPkgConfig)' CMakeLists.txt
	sed -i '/check_submodules_present()/d' CMakeLists.txt
	sed -i '/BOOST_ASIO_DISABLE_CONCEPTS/d' CMakeLists.txt
	sed -i 's/boost/Boost::&/' src/citra_libretro/CMakeLists.txt
	sed -i 's/robin_map/tsl::&/' src/citra_libretro/CMakeLists.txt
	sed -i '/gamemode\.h/i #include "common/assert.h"' src/common/linux/gamemode.cpp
}

build() {
	cmake -B build -S $_pkgname \
		-DCITRA_ENABLE_BUNDLE_TARGET=OFF \
		-DCITRA_USE_PRECOMPILED_HEADERS=OFF \
		-DCITRA_WARNINGS_AS_ERRORS=OFF \
		-DCMAKE_BUILD_TYPE="Release" \
		-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
		-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
		-DCMAKE_INCLUDE_PATH="/usr/include/ffmpeg4.4" \
		-DENABLE_DEDICATED_ROOM=OFF \
		-DENABLE_LIBUSB=OFF \
		-DENABLE_OPENAL=OFF \
		-DENABLE_QT=OFF \
		-DENABLE_SCRIPTING=OFF \
		-DENABLE_SDL2=OFF \
		-DENABLE_TESTS=OFF \
		-DENABLE_WEB_SERVICE=OFF \
		-DSIRIT_USE_SYSTEM_SPIRV_HEADERS=ON \
		-DUSE_SYSTEM_BOOST=ON \
		-DUSE_SYSTEM_CATCH2=ON \
		-DUSE_SYSTEM_CRYPTOPP=ON \
		-DUSE_SYSTEM_CUBEB=ON \
		-DUSE_SYSTEM_ENET=ON \
		-DUSE_SYSTEM_FFMPEG_HEADERS=ON \
		-DUSE_SYSTEM_GLSLANG=ON \
		-DUSE_SYSTEM_INIH=ON \
		-DUSE_SYSTEM_OPENSSL=ON \
		-DUSE_SYSTEM_VMA=ON \
		-DUSE_SYSTEM_XBYAK=ON \
		-DUSE_SYSTEM_ZSTD=ON \
		-Wno-dev
	cmake --build build
}

package() {
	depends+=(
		libcrypto.so
		libssl.so
		libcubeb.so
		libboost_serialization.so
		libboost_iostreams.so
		libzstd.so
	)
	# shellcheck disable=SC2154
	install -D -t "$pkgdir"/usr/lib/libretro build/citra_libretro.so
}