From 579e1f80b4d4b3955fe783663ce9dead08cff15b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 4 Sep 2021 18:18:58 +0200 Subject: [PATCH] pkgbuild: build using pgo/pgo.sh --- PKGBUILD | 78 +++----------------------------------------------------- 1 file changed, 4 insertions(+), 74 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index b05d7078..68ecfccf 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,3 +1,5 @@ +PGO=auto # none|partial|full-current-session|full-headless-sway|full-headless-cage + pkgname=('foot-git' 'foot-terminfo-git') pkgver=1.9.0 pkgrel=1 @@ -14,80 +16,8 @@ pkgver() { } build() { - local compiler=other - local do_pgo=no - - # makepkg uses -O2 by default, but we *really* want -O3 - CFLAGS+=" -O3" - - # Figure out which compiler we're using, and whether or not to do PGO - case $(${CC-cc} --version) in - *GCC*) - compiler=gcc - do_pgo=yes - ;; - - *clang*) - compiler=clang - - # We need llvm to be able to manage the profiling data - if command -v llvm-profdata > /dev/null; then - do_pgo=yes - - # Meson adds -fprofile-correction, which Clang doesn't - # understand - CFLAGS+=" -Wno-ignored-optimization-argument" - fi - ;; - esac - - meson \ - --prefix=/usr \ - --buildtype=release \ - --wrap-mode=nofallback \ - -Db_lto=true .. - - if [[ ${do_pgo} == yes ]]; then - find -name "*.gcda" -delete - meson configure -Db_pgo=generate - ninja - - # If fcft/tllist are subprojects, we need to ensure their tests - # have been executed, or we’ll get “profile count data file not - # found” errors. - ninja test - - local script_options="--scroll --scroll-region --colors-regular --colors-bright --colors-256 --colors-rgb --attr-bold --attr-italic --attr-underline --sixel" - - tmp_file=$(mktemp) - - if [[ -v WAYLAND_DISPLAY ]]; then - ./footclient --version - ./foot \ - --config /dev/null \ - --term=xterm \ - sh -c "../scripts/generate-alt-random-writes.py ${script_options} ${tmp_file} && cat ${tmp_file}" - else - ./footclient --version - ./foot --version - ../scripts/generate-alt-random-writes.py \ - --rows=67 \ - --cols=135 \ - ${script_options} \ - ${tmp_file} - ./pgo ${tmp_file} ${tmp_file} ${tmp_file} - fi - - rm "${tmp_file}" - - if [[ ${compiler} == clang ]]; then - llvm-profdata merge default_*profraw --output=default.profdata - fi - - meson configure -Db_pgo=use - fi - - ninja + rm -rf * + ../pgo/pgo.sh ${PGO} .. . } check() {