diff options
author | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2023-04-08 18:49:39 -0700 |
---|---|---|
committer | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2023-04-08 18:49:39 -0700 |
commit | db264f5cb11c79bfc379b8726ae57c4fd64a2e74 (patch) | |
tree | 82eaea9de69d2e460442eea7c0590f97b5ded779 | |
parent | Fix build failure. (diff) | |
download | lincity-ng-db264f5cb11c79bfc379b8726ae57c4fd64a2e74.tar.xz |
Fix build error for reals this time.
-It still compiles twice. :/
Also utilize MAKEFLAGS for multi-threaded compilation.
-rw-r--r-- | PKGBUILD | 28 |
1 files changed, 21 insertions, 7 deletions
@@ -6,7 +6,7 @@ pkgname=lincity-ng pkgver=2.0 -pkgrel=10 +pkgrel=10.2 pkgdesc="A city simulation game" arch=('x86_64') url="https://sourceforge.net/projects/lincity-ng.berlios/" @@ -20,21 +20,35 @@ b2sums=('39992e6a2ef78e53eea1b0e347c968f6828089b5267e6d62dac7405ea91b182335431b1 build() { cd ${pkgname}-${pkgver} - # Build fails due to this Werror - export CFLAGS="$CFLAGS -Wno-error=format-security" - export CXXFLAGS="$CXXFLAGS -Wno-error=format-security" - export CFLAGS="$CFLAGS -O3 -fPIE" export CXXFLAGS="$CXXFLAGS -O3 -fPIE" 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 + jam "${MAKEFLAGS}" } package() { cd ${pkgname}-${pkgver} - jam -sprefix="${pkgdir}/usr" install + + # 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" + export CXXFLAGS="$CXXFLAGS -O3 -fPIE" + 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" } |