summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5ef191b45e8d51af592f932865463a1b93d3c2cf (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
# Maintainer: Alexandre Bouvier <contact@amb.tf>
_pkgname=shadps4-qtlauncher
pkgname=$_pkgname-git
pkgver=r272.6487f9b
pkgrel=1
pkgdesc="Sony PlayStation 4 emulator (Qt GUI)"
arch=('aarch64' 'x86_64')
url="https://shadps4.net/"
license=('GPL-2.0-or-later')
depends=(
	'glibc'
	'hicolor-icon-theme'
	'sdl3>=3.1.8'
)
makedepends=(
	'cmake>=3.16.3'
	'fmt>=10.2'
	'git'
	'libgcc'
	'libstdc++'
	'openal'
	'qt6-base'
	'qt6-multimedia'
	'qt6-tools'
	'toml11>=4.2'
	'vulkan-headers>=1:1.4.329'
)
optdepends=('shadps4: for emulation support')
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
source=(
	"$_pkgname::git+https://github.com/shadps4-emu/shadps4-qtlauncher.git"
	"nlohmann-json::git+https://github.com/nlohmann/json.git"
	"spdlog::git+https://github.com/gabime/spdlog.git"
	"volk::git+https://github.com/zeux/volk.git"
)
b2sums=('SKIP'{,,,})

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

prepare() {
	cd $_pkgname
	git config submodule.externals/json.url ../nlohmann-json
	git config submodule.externals/spdlog.url ../spdlog
	git config submodule.externals/volk.url ../volk
	git -c protocol.file.allow=always submodule update
	# remove hardcoded flag
	sed -i '/-march=/d' CMakeLists.txt
}

build() {
	local options=(
		-D CMAKE_BUILD_TYPE=Release
		-D CMAKE_C_FLAGS_RELEASE="-DNDEBUG"
		-D CMAKE_CXX_FLAGS_RELEASE="-DNDEBUG"
		-D CMAKE_INSTALL_PREFIX=/usr
		-D CMAKE_SKIP_INSTALL_RPATH=ON
		-D ENABLE_UPDATER=OFF
		-Wno-dev
	)
	cmake "${options[@]}" -B build -S $_pkgname
	cmake --build build
}

package() {
	depends+=(
		'libfmt.so'
		'libgcc_s.so'
		'libopenal.so'
		'libstdc++.so'
		'qt6-base'
		'qt6-multimedia'
	)

	# shellcheck disable=SC2154
	DESTDIR="$pkgdir" cmake --install build
}