diff options
author | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2022-10-06 21:02:17 -0700 |
---|---|---|
committer | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2022-10-06 21:02:17 -0700 |
commit | 17857658be8fb973f73110f2379f9d57c47a7805 (patch) | |
tree | 19dfc69e202417c269a98429fa952f40463dcf2c | |
parent | Updated to 0.9.14 (diff) | |
download | endless-sky-17857658be8fb973f73110f2379f9d57c47a7805.tar.xz |
Updated to 0.9.15
Fix some serious compilation bugs.
-rw-r--r-- | PKGBUILD | 49 |
1 files changed, 45 insertions, 4 deletions
@@ -6,9 +6,13 @@ # # I maintain this because: # Arch version lacks additional optimization and hardening flags +# Arch version uses git +# Arch version forces compilation with all threads +# Arch version forces msse3, and single thread flto +# Arch version compiles a second time during package() with incorrect FLAGS pkgname=endless-sky -pkgver=0.9.14 +pkgver=0.9.15 pkgrel=1 pkgdesc="A sandbox-style space exploration and combat game" arch=('x86_64' 'i686' 'aarch64') @@ -22,6 +26,7 @@ license=( 'custom:CC-BY-SA-4.0' 'custom:public-domain' ) +options=('lto') depends=( 'gcc-libs' 'openal' @@ -31,31 +36,67 @@ depends=( 'libjpeg-turbo' 'sdl2' 'libmad' + 'util-linux-libs' ) makedepends=('scons') optdepends=( 'endless-sky-high-dpi: high resolution graphics assets' ) source=("$pkgname-$pkgver.tar.gz::https://github.com/endless-sky/endless-sky/archive/v${pkgver}.tar.gz") -b2sums=('5845c3b595f0feba7fc5f6ce1ead88b34e9426c3db53cf013fc67f9197d2cabad8fae39056fa6f4d6da76fceb43a9709397b95daba855d1b1ebf3c25a04ba007') +b2sums=('cb94be3ad4f9073142513a8ed171a56fd0bc1aa041799021a8c11c3d0736b1634edda0dd85483669dfab44feff1f4d994b8bf3baf39d82a9d542545a30404f2f') prepare() { cd "$pkgname-$pkgver" # binary is installed to /usr/games instead of /usr/bin sed -i 's:games", sky:bin", sky:' SConstruct + + # Stop forcing msse3, O3, and single thread flto + sed \ + -e 's|<Add option="-msse3" />||' \ + -e 's|<Add option="-O3" />||' \ + -e 's|<Add option="-flto" />||' \ + -i EndlessSky.cbp + + sed \ + -e 's|<Add option="-msse3" />||' \ + -e 's|<Add option="-O3" />||' \ + -e 's|<Add option="-flto" />||' \ + -i EndlessSkyLib.cbp + + sed \ + -e 's|<Add option="-msse3" />||' \ + -e 's|<Add option="-O3" />||' \ + -e 's|<Add option="-flto" />||' \ + -i EndlessSkyTests.cbp + + sed \ + -e 's|, "-O3", "-flto"||' \ + -e 's|env.Append(LINKFLAGS = ["-O3", "-flto"])||' \ + -i SConstruct } build() { cd "$pkgname-$pkgver" - export CFLAGS="$CFLAGS -O3 -flto=auto -fPIE" - export CXXFLAGS="$CXXFLAGS -O3 -flto=auto -fPIE" + + export CFLAGS="$CFLAGS -O3 -fPIE" + export CXXFLAGS="$CXXFLAGS -O3 -fPIE" export LDFLAGS="$LDFLAGS,-pie" + scons "${MAKEFLAGS}" } package() { cd "$pkgname-$pkgver" + + # For reasons of black magic, adding these flags again prevents a second compilation during this step. + # This halves compilation time. + # Also prevents this second compilation from being using in the package wwith incorrect FLAGS. + # Madness. + export CFLAGS="$CFLAGS -O3 -fPIE" + export CXXFLAGS="$CXXFLAGS -O3 -fPIE" + export LDFLAGS="$LDFLAGS,-pie" + scons \ DESTDIR="$pkgdir" \ PREFIX=/usr \ |