summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aa817b613dc4884aa8f6251a911b38fc7efb1475 (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
# Contributor: nalquas <nalquas.dev@gmail.com>
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=tvtower-bin
_pkgname=TVTower
pkgver=0.8.2
_subver=20231220
pkgrel=2
pkgdesc="A tribute to Mad TV. Written in BlitzMax, Lua and a bit of C."
arch=(
	'i686'
	'x86_64'
)
url="https://www.tvtower.org/"
_ghurl="https://github.com/TVTower/TVTower"
license=('LicenseRef-custom')
provides=("${pkgname%-bin}=${pkgver}")
conflicts=("${pkgname%-bin}")
depends=(
	'libglvnd'
	'freetype2'
	'libxcb'
	'lib32-glu'
	'lib32-libxcb'
	'lib32-gcc-libs'
	'lib32-libglvnd'
	'lib32-glibc'
	'lib32-freetype2'
)
makedepends=(
	'gendesk'
)
noextract=("${pkgname%-bin}-${pkgver}.zip")
source=(
	"${pkgname%-bin}-${pkgver}.zip::${_ghurl}/releases/download/v${pkgver}/${_pkgname}_v${pkgver}_${_subver}.zip"
	"${pkgname%-bin}.sh"
)
sha256sums=('503e6ff876e5afbcbb56638c6076b54d5392e67e48651b3b7bdf44faf750f286'
            'a9783526d93e6c72c7e1551cc5cc513fd6056dcc4593abe8fac815721d32dd5a')
build() {
	case "${CARCH}" in
		i686)
			_RUNNAME="${_pkgname}_Linux32"
		;;
		x86_64)
			_RUNNAME="${_pkgname}_Linux64"
		;;
	esac
	sed -e "s|@appname@|${pkgname%-bin}|g" \
        -e "s|@runname@|${_RUNNAME}|g" \
        -i "${srcdir}/${pkgname%-bin}.sh"
	gendesk -q -f -n --categories="Game" --name="${_pkgname}" --exec="${pkgname%-bin}"
	install -Dm755 -d "${srcdir}/opt/${pkgname%-bin}/logfiles"
	bsdtar -xf "${srcdir}/${pkgname%-bin}-${pkgver}.zip" -C "${srcdir}/opt/${pkgname%-bin}"
	rm -rf "${srcdir}/opt/${pkgname%-bin}/"*.{bat,exe}
	for _logtxt in app ai1 ai2 ai3 ai4;do
		touch "${srcdir}/opt/${pkgname%-bin}/logfiles/log.${_logtxt}.txt"
	done
	touch "${srcdir}/opt/${pkgname%-bin}/log.profiler.txt"
}
package() {
	install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
	cp -r "${srcdir}/opt" "${pkgdir}"
	install -Dm644 "${srcdir}/opt/${pkgname%-bin}/LICENCE.txt" -t "${pkgdir}/usr/share/licenses/${pkgname}"
	install -Dm644 "${srcdir}/opt/${pkgname%-bin}/${pkgname%-bin}.png" -t "${pkgdir}/usr/share/pixmaps"
	install -Dm644 "${srcdir}/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications"
	chmod 777 "${pkgdir}/opt/${pkgname%-bin}/savegames"
	find "${pkgdir}/opt/${pkgname%-bin}/logfiles" -name "log.*.txt" -perm 644 -exec chmod 666 {} \;
}