summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2022-03-26 12:50:53 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2022-03-26 12:50:53 +0100
commitb72de63a50fcd46ec290b0028f47f1f9f00b7a9b (patch)
tree2d710598e971dd30e9ae032a4fb25f874840bb16 /extra
parentd565dba6363eb9dd30b20facec104fc304dd6805 (diff)
downloadpackages-b72de63a50fcd46ec290b0028f47f1f9f00b7a9b.tar.xz
extra/meson: local arch-meson script and patch for no LTO for i486
Diffstat (limited to 'extra')
-rw-r--r--extra/meson/PKGBUILD20
-rwxr-xr-xextra/meson/arch-meson21
2 files changed, 29 insertions, 12 deletions
diff --git a/extra/meson/PKGBUILD b/extra/meson/PKGBUILD
index 74cfa56b..376dd629 100644
--- a/extra/meson/PKGBUILD
+++ b/extra/meson/PKGBUILD
@@ -17,15 +17,11 @@ checkdepends_pentium4=("${checkdepends_i686[@]}")
unset check
unset checkdepends
-# do not set b_lto to true in arch-meson wrapper on i486
-if [ "${CARCH}" = "i486" ]; then
- eval "$(
- {
- declare -f package || \
- printf 'package() {\n}\n'
- } \
- | sed '
- $i sed -i "s/b_lto=.*/b_lto=false/" "$pkgdir/usr/bin/arch-meson"
- '
- )"
-fi
+# fail if upstream changes arch-meson
+# we patch a version of arch-meson reading CARCH (later maybe LTOFLAGS)
+# to find out whether it should add blto to the arch flags
+for ((i=0; i<${#sha512sums[@]}; i++)); do
+ if [ "${sha512sums[${i}]}" = 'f451f8a7ef9cf1dd724c2ce20bb85a3f1611b87b2e7a17ef0fdbe8ab82a67389f818ea30a5adfe8413143e4eac77ea2e0b8234b5b2466b41a892e2bd0435376c' ]; then
+ sha512sums[${i}]='4b389796c52a5aa84a05cecc9b0c87924992627a61faf1707624f157d03315df143a562bec982d3ad7c64a7de767fce56567e718005cb92e297672d37b39230e'
+ fi
+done
diff --git a/extra/meson/arch-meson b/extra/meson/arch-meson
new file mode 100755
index 00000000..577edca4
--- /dev/null
+++ b/extra/meson/arch-meson
@@ -0,0 +1,21 @@
+#!/bin/bash -ex
+# Highly opinionated wrapper for Arch Linux packaging
+
+CARCH=$(. /etc/makepkg.conf; echo $CARCH)
+
+if [ "${CARCH}" = "i486" ]; then
+ LTO="b_lto=false"
+else
+ LTO="b_lto=true"
+fi
+
+exec meson setup \
+ --prefix /usr \
+ --libexecdir lib \
+ --sbindir bin \
+ --buildtype plain \
+ --auto-features enabled \
+ --wrap-mode nodownload \
+ -D "${LTO}" \
+ -D b_pie=true \
+ "$@"