astromenace: enable cross building

The packed file gamedata.vfs is now created in the post
install stage and removed in the pre remove stage.
This allows cross builds to work, because AstroMenace does
not have to be run on the host.
This commit is contained in:
Jürgen Buchmüller 2015-11-20 13:27:57 +01:00
parent 35efdfebbc
commit 4d44d98648
4 changed files with 23 additions and 6 deletions

View File

@ -0,0 +1,8 @@
case "$ACTION" in
post) # Pack the game data
echo "AstroMenace: packaging game data..."
/usr/bin/astromenace --pack --rawdata=/usr/share/astromenace/RAW_VFS_DATA \
> /usr/share/astromenace/gamedata.log
mv /usr/bin/gamedata.vfs /usr/share/astromenace
;;
esac

View File

@ -0,0 +1,5 @@
case "$ACTION" in
pre) # Remove packed game data and log
rm -f /usr/share/astromenace/gamedata.*
;;
esac

View File

@ -1,4 +1,5 @@
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=AstroMenace
Comment=Hardcore 3D space shooter

View File

@ -1,14 +1,13 @@
# Template file for 'astromenace'
pkgname=astromenace
version=1.3.2
revision=1
revision=2
wrksrc=AstroMenace
build_style=cmake
hostmakedepends="cmake pkg-config"
makedepends="SDL-devel libopenal-devel freealut-devel libvorbis-devel
makedepends="SDL-devel glu-devel libopenal-devel freealut-devel libvorbis-devel
fontconfig-devel freetype-devel libXinerama-devel"
depends="astromenace-data>=${version}_${revision}"
nocross=yes
short_desc="Hardcore 3D space shooter"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="GPL-3 OFL-1.1 CC-BY-SA-3.0"
@ -16,6 +15,11 @@ homepage="http://www.viewizard.com/"
distfiles="${SOURCEFORGE_SITE}/openastromenace/${version}/${pkgname}-src-${version}.tar.bz2"
checksum=9b775df2b157565b97aca008dd879b867cd3377c07b829cee6b5342639357fe6
if [ "$CROSS_BUILD" ]; then
configure_args+=" -DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include/GL"
configure_args+=" -DOPENGL_gl_LIBRARY=${XBPS_CROSS_BASE}/usr/lib/libGL.so.1"
fi
do_install() {
vbin build/AstroMenace ${pkgname}
vdoc ReadMe.txt README
@ -25,14 +29,13 @@ do_install() {
usr/share/icons/hicolor/${size}x${size}/apps ${pkgname}.png
done
vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
build/AstroMenace --pack --rawdata=RAW_VFS_DATA
vinstall build/gamedata.vfs 644 usr/share/${pkgname}
}
astromenace-data_package() {
short_desc+=" - data file"
noarch="yes"
pkg_install() {
vmove usr/share/astromenace
vmkdir usr/share/astromenace
vcopy ${wrksrc}/RAW_VFS_DATA usr/share/astromenace
}
}