# Maintainer: Jaroslav Lichtblau # Contributor: Jakob "flocke" Nixdorf pkgname=0ad-svn pkgver=7029 pkgrel=1 pkgdesc="Cross-platform, 3D and historically-based real-time strategy game" arch=('i686' 'x86_64') url="http://wildfiregames.com/0ad" license=('GPL2' 'CCPL') depends=('binutils' 'boost' 'crypto++' 'devil' 'enet' 'gamin' 'libogg' \ 'libpng' 'libvorbis' 'libxml2' 'mesa' 'nspr' 'nasm' 'openal' \ 'sdl' 'valgrind' 'wxgtk' 'zlib' 'spidermonkey') makedepends=('gcc' 'subversion' 'premake') source=(0ad.sh) md5sums=('e44fcdb23628a6a2b6232a8171c38d13') _svntrunk="http://svn.wildfiregames.com/public/ps/trunk" _svnmod="trunk" build() { msg "Starting SVN checkout..." cd ${srcdir} if [ -d $_svnmod/.svn ]; then (cd $_svnmod && svn up -r $pkgver) else svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod fi msg "SVN checkout done or server timeout" msg "Copying checkout to build directory..." if [ -d ${srcdir}/$_svnmod-build ]; then rm -r $_svnmod-build fi cp -r $_svnmod $_svnmod-build cd $_svnmod-build msg "Building FCollada..." cd ${srcdir}/$_svnmod-build/libraries/fcollada/src || return 1 make || return 1 msg "Updating Workspaces..." cd ${srcdir}/$_svnmod-build/build/workspaces ./update-workspaces.sh || return 1 msg "Building 0 AD..." cd ${srcdir}/$_svnmod-build/build/workspaces/gcc || return 1 LDFLAGS="-ljs" CFLAGS="-I/usr/include/js" make || return 1 msg "Installing binaries..." install -d ${pkgdir}/opt/0ad || return 1 cp -r ${srcdir}/$_svnmod-build/binaries/* ${pkgdir}/opt/0ad || return 1 install -d ${pkgdir}/opt/0ad/system/spidermonkey || return 1 cp -r ${srcdir}/spidermonkey/lib/* ${pkgdir}/opt/0ad/system/spidermonkey/ || return 1 msg "Removing SVN stuff..." cd ${pkgdir}/opt/0ad || return 1 find -name ".svn" -type d -print0 | xargs -0 rm -rf || return 1 msg "Removing sucky windows stuff..." cd ${pkgdir}/opt/0ad/system || return 1 rm *.exe rm *.dll rm *.bat rm Microsoft.VC* rm *.sys rm *.pdb rm -rf ape rm -rf textureconv rm ../data/createzip.bat msg "Fixing file permissions..." cd ${pkgdir}/opt/0ad/data || return 1 chgrp -R games ${pkgdir}/opt/0ad || return 1 chmod -R 664 ${pkgdir}/opt/0ad/data/cache || return 1 chmod -R 664 ${pkgdir}/opt/0ad/logs || return 1 msg "Installing run script..." install -D -m755 ${srcdir}/0ad.sh ${pkgdir}/usr/bin/0ad || return 1 }