# Maintainer: jc_gargma # Maintainer (Arch): Sven-Hendrik Haase # Contributor (Arch): t3ddy # Contributor (Arch): Adrián Chaves Fernández (Gallaecio) # # I maintain this because: # Arch version lacks additional optimization and hardening flags pkgname=0ad pkgver=a25.b _pkgver=0.0.25b-alpha pkgrel=3 pkgdesc="Cross-platform, 3D and historically-based real-time strategy game" arch=('x86_64') url="https://play0ad.com/" license=('GPL2' 'CCPL') depends=('0ad-data' 'binutils' 'boost-libs' 'curl' 'enet' 'libogg' 'libpng' 'libvorbis' 'libxml2' 'openal' 'sdl2' 'wxgtk3' 'zlib' 'libgl' 'glu' 'fmt' 'gloox' 'miniupnpc' 'libminiupnpc.so' 'icu' 'nspr' 'libsodium') makedepends=('boost' 'cmake' 'mesa' 'zip' 'libsm' 'rust') source=("https://releases.wildfiregames.com/$pkgname-$_pkgver-unix-build.tar.xz" "python-3.10.patch") b2sums=('674d69d625137709a186f9273607dc353fc99aea68ef3f2ea5031dbe2f684176910d757c3f03c7fbdac475d30708be448b71f5020d27a65c346bf147223bcb9d' '6b6853eacbeadfe7e95382c97572c60b1838d5f4b0b925c2bb977be76db6a0a2ac97376089a42fca6a7956319b69c56ec0d2fb59a1114002d708486582de346d') prepare() { patch -d $pkgname-$_pkgver -p1 < python-3.10.patch # Fix spidermonkey build with Python 3.10 } build() { cd "$pkgname-$_pkgver/build/workspaces" # rust is prone to OOM, use 1 thread per 2GB ram export MAKEFLAGS="-j32" # More threads #sed -i 's/JOBS=${JOBS:="-j2"}/JOBS=${JOBS:="-j32"}/' update-workspaces.sh # -fPIE and -pie break compilation # -flto=auto and -flto=1 break compilation since a24.b export CFLAGS="$CFLAGS -O3 -fstack-protector-all -fPIC" export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all -fPIC" export WX_CONFIG="wx-config-gtk3" ./update-workspaces.sh $MAKEFLAGS \ --without-pch \ --bindir=/usr/bin \ --libdir=/usr/lib/0ad \ --datadir=/usr/share/0ad/data cd gcc VERBOSE=1 make } package() { cd "$pkgname-$_pkgver" install -d "${pkgdir}"/usr/{bin,lib/0ad,share/"${pkgname}"/data} install -Dm755 binaries/system/pyrogenesis "${pkgdir}/usr/bin" install -Dm755 binaries/system/*.so "${pkgdir}/usr/lib/0ad" cp -r binaries/data/l10n/ "${pkgdir}/usr/share/${pkgname}/data/" install -Dm755 build/resources/${pkgname}.sh "${pkgdir}/usr/bin/${pkgname}" install -Dm644 build/resources/${pkgname}.desktop "${pkgdir}/usr/share/applications/${pkgname}.desktop" install -Dm644 build/resources/${pkgname}.png "${pkgdir}/usr/share/pixmaps/${pkgname}.png" }