aboutsummaryrefslogtreecommitdiffstats
path: root/testing/stone-soup/APKBUILD
blob: e44294d48297d3ca2b6b0f9db3d4648f043e877e (plain) (blame)
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
# Contributor: Matthew T Hoare <matthew.t.hoare@gmail.com>
# Maintainer: Matthew T Hoare <matthew.t.hoare@gmail.com>
pkgname=stone-soup
pkgver=0.26.1
pkgrel=0
pkgdesc="Open-source, single-player, role-playing roguelike game of exploration and treasure-hunting"
url="https://crawl.develz.org"
arch="all"
license="BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND MIT AND Zlib AND Apache-2.0 AND BSL-1.0"
depends="mesa-dri-gallium ttf-dejavu"
makedepends="freetype-dev glu-dev lua5.1-dev mesa-dev ncurses-dev perl py3-yaml
	python3 sdl2-dev sdl2_image-dev sdl2_mixer-dev sqlite-dev"
options="!check" # no checks
source="$pkgname-$pkgver.tar.gz::https://github.com/crawl/crawl/archive/$pkgver.tar.gz
	crawl.desktop
	crawl-tiles.desktop"
builddir="$srcdir/crawl-$pkgver/crawl-ref/"

prepare() {
	default_prepare

	# fix backtrace build failure
	sed -i '10s/$/ \&\& (!defined(TARGET_OS_LINUX) || defined(_GLIBC_))/' source/crash.cc

	# fix SDL version
	sed -i 's|SDL_main.h|SDL2/&|' source/main.cc

	# specify tarball version
	echo "$pkgver" > source/util/release_ver

	# adjust makefile to use /usr/bin, owner root:root
	sed -i 's|bin_prefix    := bin|bin_prefix    := usr/bin|' source/Makefile
	sed -i 's/INSTALL_UGRP := games:games/INSTALL_UGRP := root:root/' source/Makefile

	# create separate source directories for console and tiles versions
	cp -r source console
	cp -r source tiles
}

build() {
	# first build tiles version
	make -C tiles USE_UNICODE=y TILES=y SOUND=y

	# then build console version
	make -C console USE_UNICODE=y SOUND=y
}

package() {
	# first install tiles version
	make -C tiles \
		DESTDIR="$pkgdir" \
		SAVEDIR="~/.crawl/" \
		DATADIR="/usr/share/$pkgname/data" \
		USE_UNICODE=y \
		TILES=y \
		install

	# rename tiles executable to avoid clashing with console crawl
	mv "$pkgdir"/usr/bin/crawl "$pkgdir"/usr/bin/crawl-tiles

	# now install console version
	make -C console \
		DESTDIR="$pkgdir" \
		SAVEDIR="~/.crawl/" \
		DATADIR="/usr/share/$pkgname/data" \
		USE_UNICODE=y \
		install

	# install icon and .desktop files
	install -Dm644 source/dat/tiles/stone_soup_icon-32x32.png \
		"$pkgdir"/usr/share/pixmaps/"$pkgname".png
	install -Dm644 "$srcdir"/crawl.desktop \
		"$pkgdir"/usr/share/applications/crawl.desktop
	install -Dm644 "$srcdir"/crawl-tiles.desktop \
		"$pkgdir"/usr/share/applications/crawl-tiles.desktop
}

sha512sums="c2fa089b700c0dcbc2b8afa3410144cbf99f9bbc3cc5481baf0c3f281dcce11ef34165dfa561d17320784057bfdb90310df9c64242b6936d478b33ad27298d17  stone-soup-0.26.1.tar.gz
8e14cfa97f8765126050b14dc85cee60a6f00fe458b21714a34403872fbfc11f7b1d42897424936fbaaba5ad0fed76c10a90c4c144076c9526f7e653c3dbbca0  crawl.desktop
d8c64f6c388f3551e6744b0fccfa0fc7148cb839174a5ed464fdb46511f8e0f4e66cb297f91446e5e098cbacddaba88476f499fb50e6c39e6563fe8231dafe54  crawl-tiles.desktop"