mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
Without pixman renderer override pgo builds in cage/sway require access to actual render devices. In Gentoo's case the builds are run as ordinary user and within a "sandbox" which prevents and logs access outside of predefined places during build. So let's default to pixman renderer for the PGO builds. Hopefully that won't matter for the pgo optimizations to do the right thing within foot.
24 lines
657 B
Bash
Executable file
24 lines
657 B
Bash
Executable file
#!/bin/sh
|
||
|
||
set -eux
|
||
|
||
srcdir=$(realpath "${1}")
|
||
blddir=$(realpath "${2}")
|
||
|
||
runtime_dir=$(mktemp -d)
|
||
sway_conf=$(mktemp)
|
||
|
||
cleanup() {
|
||
rm -f "${sway_conf}"
|
||
rm -rf "${runtime_dir}"
|
||
}
|
||
trap cleanup EXIT INT HUP TERM
|
||
|
||
# Generate a custom config that executes our generate-pgo-data script
|
||
> "${sway_conf}" echo "exec '${srcdir}'/pgo/full-headless-sway-inner.sh '${srcdir}' '${blddir}'"
|
||
|
||
# Run Sway. full-headless-sway-inner.sh ends with a ‘swaymsg exit’
|
||
XDG_RUNTIME_DIR="${runtime_dir}" WLR_RENDERER=pixman WLR_BACKENDS=headless sway -c "${sway_conf}"
|
||
|
||
# Sway’s exit code doesn’t reflect our script’s exit code
|
||
[ -f "${blddir}"/pgo-ok ] || exit 1
|