summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cb154641261db0a3864dcbf4c3640a953a04193b (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
# Maintainer: Alexandre Bouvier <contact@amb.tf>
_pkgname=libretro-ppsspp
pkgname=$_pkgname-git
pkgver=1.17.1.r357.g443bdef239
pkgrel=1
pkgdesc="Sony PlayStation Portable core"
arch=('aarch64' 'armv7h' 'i486' 'i686' 'pentium4' 'x86_64')
url="https://www.ppsspp.org/"
license=('GPL-2.0-or-later')
groups=('libretro')
depends=(
	'gcc-libs'
	'glibc'
	'libretro-core-info'
	'snappy'
)
makedepends=(
	'cmake'
	'ffmpeg4.4' # https://github.com/hrydgard/ppsspp/issues/15308
	'git'
	'glew'
	'libchdr'
	'libgl'
	'libpng'
	'libzip'
	'miniupnpc'
	'openxr'
	'python'
	'rapidjson'
	'zlib'
	'zstd'
)
optdepends=('ppsspp-assets')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=(
	'ppsspp::git+https://github.com/hrydgard/ppsspp.git'
	'armips::git+https://github.com/Kingcom/armips.git'
	'cpu_features::git+https://github.com/google/cpu_features.git'
	'glslang::git+https://github.com/KhronosGroup/glslang.git'
	'rcheevos::git+https://github.com/RetroAchievements/rcheevos.git'
	'SPIRV-Cross::git+https://github.com/KhronosGroup/SPIRV-Cross.git'
)
b2sums=(
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
)

pkgver() {
	cd ppsspp
	git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
	cd ppsspp
	git config submodule.cpu_features.url ../cpu_features
	git config submodule.ext/armips.url ../armips
	git config submodule.ext/glslang.url ../glslang
	git config submodule.ext/rcheevos.url ../rcheevos
	git config submodule.ext/SPIRV-Cross.url ../SPIRV-Cross
	git -c protocol.file.allow=always submodule update
	sed -i 's/ext\/rapidjson\/include\/\(rapidjson\/document\.h\)/\1/' Core/RetroAchievements.cpp
	sed -i '/libchdr/d' ext/CMakeLists.txt
}

build() {
	export FFMPEG_DIR="/usr/include/ffmpeg4.4;/usr/lib/ffmpeg4.4"
	cmake -S ppsspp -B build \
		-DARMIPS_USE_STD_FILESYSTEM=ON \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
		-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
		-DCMAKE_SKIP_RPATH=ON \
		-DLIBRETRO=ON \
		-DUSE_SYSTEM_FFMPEG=ON \
		-DUSE_SYSTEM_LIBZIP=ON \
		-DUSE_SYSTEM_MINIUPNPC=ON \
		-DUSE_SYSTEM_SNAPPY=ON \
		-DUSE_SYSTEM_ZSTD=ON \
		-Wno-dev
	cmake --build build
}

package() {
	depends+=(
		'libavcodec.so'
		'libavformat.so'
		'libavutil.so'
		'libchdr.so'
		'libGLEW.so'
		'libminiupnpc.so'
		'libOpenGL.so'
		'libpng16.so'
		'libswresample.so'
		'libswscale.so'
		'libzip.so'
		'libz.so'
		'libzstd.so'
	)
	# shellcheck disable=SC2154
	install -D -t "$pkgdir"/usr/lib/libretro build/lib/ppsspp_libretro.so
}