aboutsummaryrefslogtreecommitdiffstats
path: root/testing/sgt-puzzles/APKBUILD
blob: 8b7e139db5fb0bf0d3d8949c25dbbbf04941f234 (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
# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=sgt-puzzles
_pkgname=puzzles
pkgver=0_git20211031
_pkgver=20211031
_commit=640f923
pkgrel=0
pkgdesc="Simon Tatham's Portable Puzzle Collection"
url="https://www.chiark.greenend.org.uk/~sgtatham/puzzles/"
arch="all"
license="GPL-2.0-or-later"
makedepends="cmake imagemagick gtk+3.0-dev perl-dev"
options="!check" # No testsuite

# We should append "sgt-" prefix to all the programs and icons.
# That way, we avoid conflicts with other programs
source="
	https://sourceforge.net/projects/aat-linux-repository/files/sources/alpine/sgt-puzzles/puzzles-$_pkgver.$_commit.tar.gz
	0001-change-desktop-variables-according-to-prefix.patch
	"
_icondir="usr/share/pixmaps"
_desktopdir="usr/share/applications"
builddir="$srcdir/$_pkgname-$_pkgver.$_commit"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

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

	# Append "sgt-" prefix to icon files
	# Move icons to hicolor directory, like upstream distributions do
	# And remove "-48d24" suffix
	mkdir -p "$pkgdir"/usr/share/icons/hicolor/48x48/apps
	for f in "$pkgdir"/"$_icondir"/*.png
	do
		mv -v -- "$f" \
		"$pkgdir"/usr/share/icons/hicolor/48x48/apps/sgt-"$(basename -- $f | sed 's/-48d24//g')"
	done

	# Append "sgt-" prefix to desktop files
	for f in "$pkgdir"/"$_desktopdir"/*.desktop
	do
		mv -v -- "$f" \
		"$pkgdir"/usr/share/applications/sgt-"$(basename -- $f)"
	done

	# Remove redundant directory
	rm -r "$pkgdir"/usr/share/pixmaps
}

sha512sums="
1431912593337c73089d1d7daa47457532a3c9d788484fb70b412cc1641deae6685515f0ea53fa1d66590569eba9fd8923a32590494accacba64c0845794fd1a  puzzles-20211031.640f923.tar.gz
ebe33479a779abf9cd0ea12232ab2319fa279ba467ee635460962eb714c87f2a87e82b160fc43665b0e9e39b5ba72d6bcc2c0cb35abe0adde6de40c18775bee6  0001-change-desktop-variables-according-to-prefix.patch
"