# Maintainer: jc_gargma # Maintainer (Arch): Eric BĂ©langer # # I maintain this because: # Arch version lacks additional optimization and hardening flags pkgname=lincity-ng pkgver=2.0 pkgrel=10.2 pkgdesc="A city simulation game" arch=('x86_64') url="https://sourceforge.net/projects/lincity-ng.berlios/" license=('GPL' 'custom') depends=('sdl_mixer' 'sdl_ttf' 'sdl_image' 'physfs' 'libxml2' 'sdl_gfx' 'libgl') makedepends=('ftjam' 'mesa' 'glu') # # For some reason this breaks compiling. "error: C++ compiler cannot create executables" # # But old-fashioned raw injection of -flto=auto via export doesn't. #options=(lto) source=(https://sourceforge.net/projects/${pkgname}.berlios/files/${pkgname}-${pkgver}.tar.bz2) b2sums=('39992e6a2ef78e53eea1b0e347c968f6828089b5267e6d62dac7405ea91b182335431b1718ef9892b649b1437751959deb9fa407dfd899fd1dfca55145d059f2') build() { cd ${pkgname}-${pkgver} export CFLAGS="$CFLAGS -O3 -fPIE -flto=auto" export CXXFLAGS="$CXXFLAGS -O3 -fPIE -flto=auto" export LDFLAGS="$LDFLAGS,-pie" # Build fails due to -Werror=format-security export CFLAGS="$(echo $CFLAGS | sed 's/-Werror=format-security/-Wno-error=format-security/')" export CXXFLAGS="$(echo $CXXFLAGS | sed 's/-Werror=format-security/-Wno-error=format-security/')" ./configure --prefix=/usr jam "${MAKEFLAGS}" } package() { cd ${pkgname}-${pkgver} # For reasons of black magic, this program compiles a second time during this step. # FLAGS are set again here to ensure optimization and prevent build failure. # Madness. export CFLAGS="$CFLAGS -O3 -fPIE -flto=auto" export CXXFLAGS="$CXXFLAGS -O3 -fPIE -flto=auto" export LDFLAGS="$LDFLAGS,-pie" # Build fails due to -Werror=format-security export CFLAGS="$(echo $CFLAGS | sed 's/-Werror=format-security/-Wno-error=format-security/')" export CXXFLAGS="$(echo $CXXFLAGS | sed 's/-Werror=format-security/-Wno-error=format-security/')" jam "${MAKEFLAGS}" -s prefix="${pkgdir}/usr" install install -D -m644 COPYING-data.txt "${pkgdir}/usr/share/licenses/${pkgname}/COPYING-data.txt" install -D -m644 COPYING-fonts.txt "${pkgdir}/usr/share/licenses/${pkgname}/COPYING-fonts.txt" }