void-packages/srcpkgs/teeworlds/template

56 lines
1.4 KiB
Bash

# Template file for 'teeworlds'
pkgname=teeworlds
version=0.7.5
revision=2
hostmakedepends="bam python pkg-config"
makedepends="zlib-devel SDL2-devel glu-devel freetype-devel"
short_desc="Retro multiplayer shooter"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="custom:Zlib-like"
homepage="https://www.teeworlds.com"
distfiles="https://github.com/teeworlds/teeworlds/archive/${version}.tar.gz"
checksum=6e67846b38750d2a372d7835fa3775db016458a20a85aa52f1c758102ddd4abe
case "$XBPS_TARGET_MACHINE" in
i686) _ARCH=x86;;
x86_64*) _ARCH=x86_64;;
ppc64*) _ARCH=ppc64;;
ppc*) _ARCH=ppc;;
armv7l*) _ARCH=armv7l;;
arm*) _ARCH=arm;;
aarch64*) _ARCH=aarch64;;
*) _ARCH=${XBPS_TARGET_MACHINE%%-musl};;
esac
do_configure() {
if [ "$CC" = cc ]; then
# argh, bam is useless
export CC=gcc
fi
sed -i "/cc.includes:Add.\"src\"/a\
settings.cc.exe_c = '$CC'; \
settings.cc.exe_cxx = '$CXX'; \
settings.cc.flags_c:Add('$CFLAGS'); \
settings.cc.flags_cxx:Add('$CXXFLAGS'); \
settings.link.exe = '$CXX'; \
settings.link.flags:Add('${LDFLAGS}');" bam.lua
bam -t -v config
}
do_build() {
bam -v conf=release arch=${_ARCH}
}
do_install() {
pushd build/${_ARCH}/release
vbin teeworlds
vbin teeworlds_srv
vmkdir usr/share/teeworlds
cp -r data ${DESTDIR}/usr/share/teeworlds/data
popd
vlicense license.txt LICENSE
vinstall other/teeworlds.desktop 644 usr/share/applications
}