aboutsummaryrefslogtreecommitdiffstats
path: root/community/supertuxkart/APKBUILD
blob: d26ab769fc97b2ba9eb7ab72b50e096c69a9e34a (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
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Contributor: Antoni Aloy <aaloytorrens@gmail.com>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=supertuxkart
pkgver=1.4
pkgrel=0
# s390x mainframes don't have GPUs
arch="all !s390x"
url="https://supertuxkart.net/"
pkgdesc="Kart racing game featuring Tux and his friends"
license="GPL-3.0-or-later"
depends="$pkgname-data"
makedepends="
	bluez-dev
	cmake
	curl-dev
	freetype-dev
	fribidi-dev
	glew-dev
	harfbuzz-dev
	jpeg-dev
	libpng-dev
	libvorbis-dev
	libxkbcommon-dev
	libxrandr-dev
	openal-soft-dev
	openssl-dev>3
	samurai
	sdl2-dev
	sqlite-dev
	wayland-dev
	"
source="https://github.com/supertuxkart/stk-code/releases/download/$pkgver/SuperTuxKart-$pkgver-src.tar.xz
	server_config.xml
	64bittype.patch
	no-install-libs.patch
	"
subpackages="$pkgname-server $pkgname-data::noarch"
builddir="$srcdir/SuperTuxKart-$pkgver-src"

[ "$CARCH" = "riscv64" ] && options="textrels" # Temporarily allow textrels

build() {
	case "$CARCH" in
		arm*|aarch64) GLES2_RENDERER=ON ;;
		* ) GLES2_RENDERER=OFF ;;
	esac

	# Game
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_RECORDER=0 \
		-DUSE_GLES2=$GLES2_RENDERER
	cmake --build build

	# Server only
	cmake -B build-server -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_RECORDER=0 \
		-DSERVER_ONLY=ON
	cmake --build build-server
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

server() {
	depends="$pkgname-data"
	cd "$builddir"
	DESTDIR="$subpkgdir" cmake --install build-server
	mv "$subpkgdir"/usr/bin/supertuxkart \
		"$subpkgdir"/usr/bin/supertuxkart-server

	# Remove desktop app, icons and pixmaps
	# Data is included in data() subpackage
	rm -r "${subpkgdir:?}"/usr/share/

	install -Dm644 "$srcdir"/server_config.xml \
		"$subpkgdir"/usr/share/supertuxkart/data/server_config.xml
}

data() {
	pkgdesc="$pkgdesc (data files)"

	amove usr/share/supertuxkart/data
}

sha512sums="
e88f3fb5ccdb38d0ef75e92d73b43c5cc7a1f6c76ac9502033df099a00d6dc3e86b2c5442b806237d2420c44ada7dd23a2c90ecf94785a44d2348c933770a5ab  SuperTuxKart-1.4-src.tar.xz
104a0b6e6c7abca53b76895d8889edde7745e420e1579c46c63fbfba87c12080f248a1871a92e268f0010ec05ea3d7756072da49784a66156403050f6ec0056e  server_config.xml
75ae2a2a5ab0992cc870fba18f262838f9c2ca04a5a03f2439f77ff352eac43c4fc1338444a53cad40f63341f8eb7543770550f8a17338c1b57f4678a5eb8386  64bittype.patch
7ab08b69a030c8adff17a7bea12509c1119672e65fe645c16b60e91cbdf1f6ab20083c192f4db5290400ba9076b686859b8a7d2ec411552bd7bce1351019f184  no-install-libs.patch
"