2020-03-06 21:36:36 +01:00
|
|
|
|
pkgname=('foot-git' 'foot-terminfo-git')
|
2021-07-18 17:58:05 +02:00
|
|
|
|
pkgver=1.8.2
|
2019-07-15 15:48:03 +02:00
|
|
|
|
pkgrel=1
|
2020-06-05 12:06:31 +02:00
|
|
|
|
arch=('x86_64' 'aarch64')
|
2019-11-23 12:41:50 +01:00
|
|
|
|
url=https://codeberg.org/dnkl/foot
|
2019-07-15 15:48:03 +02:00
|
|
|
|
license=(mit)
|
2021-06-24 20:18:51 +02:00
|
|
|
|
depends=('libxkbcommon' 'wayland' 'pixman' 'fontconfig' 'libutf8proc' 'fcft>=2.4.0')
|
2020-08-25 18:52:44 +02:00
|
|
|
|
makedepends=('meson' 'ninja' 'scdoc' 'python' 'ncurses' 'wayland-protocols' 'tllist>=1.0.4')
|
2019-07-15 15:48:03 +02:00
|
|
|
|
source=()
|
|
|
|
|
|
|
|
|
|
|
|
pkgver() {
|
2019-10-24 21:21:44 +02:00
|
|
|
|
cd ../.git &> /dev/null && git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
|
|
|
|
|
|
head -3 ../meson.build | grep version | cut -d "'" -f 2
|
2019-07-15 15:48:03 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
build() {
|
PKGBUILD: do PGO with either gcc or clang, but nothing else
Before this, we assumed gcc was being used. The build would fail if
clang (or something else) was used.
Now, we check whether we’re compiling with gcc or clang, and disable
PGO if it’s neither of them.
Furthermore, we’re now adding the necessary flags needed to do PGO
with clang.
Note that ‘llvm-profdata’, from the ‘llvm’ package is needed for
PGO:ing with clang. PGO is disabled if it isn’t available. It would be
nice to have ‘llvm’ as an optional make dependency, but PKGBUILDs
doesn’t appear to support such a thing.
Finally, the -Wno-missing-profile flag, and its friends, have been
removed; instead we execute “footclient --version” (and “foot
--version”, in partial PGO builds) to ensure all generated binaries
have been executed before we do the final build (with
-Db_pgo=use). This fixes build failures with clang >= 11.x.
2021-03-26 20:36:34 +01:00
|
|
|
|
local compiler=other
|
|
|
|
|
|
local do_pgo=no
|
|
|
|
|
|
|
2020-05-25 21:14:52 +02:00
|
|
|
|
# makepkg uses -O2 by default, but we *really* want -O3
|
PKGBUILD: do PGO with either gcc or clang, but nothing else
Before this, we assumed gcc was being used. The build would fail if
clang (or something else) was used.
Now, we check whether we’re compiling with gcc or clang, and disable
PGO if it’s neither of them.
Furthermore, we’re now adding the necessary flags needed to do PGO
with clang.
Note that ‘llvm-profdata’, from the ‘llvm’ package is needed for
PGO:ing with clang. PGO is disabled if it isn’t available. It would be
nice to have ‘llvm’ as an optional make dependency, but PKGBUILDs
doesn’t appear to support such a thing.
Finally, the -Wno-missing-profile flag, and its friends, have been
removed; instead we execute “footclient --version” (and “foot
--version”, in partial PGO builds) to ensure all generated binaries
have been executed before we do the final build (with
-Db_pgo=use). This fixes build failures with clang >= 11.x.
2021-03-26 20:36:34 +01:00
|
|
|
|
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
|
2020-05-25 21:14:52 +02:00
|
|
|
|
|
2020-02-16 14:40:59 +01:00
|
|
|
|
meson --prefix=/usr --buildtype=release --wrap-mode=nofallback -Db_lto=true ..
|
2019-11-20 10:45:15 +01:00
|
|
|
|
|
PKGBUILD: do PGO with either gcc or clang, but nothing else
Before this, we assumed gcc was being used. The build would fail if
clang (or something else) was used.
Now, we check whether we’re compiling with gcc or clang, and disable
PGO if it’s neither of them.
Furthermore, we’re now adding the necessary flags needed to do PGO
with clang.
Note that ‘llvm-profdata’, from the ‘llvm’ package is needed for
PGO:ing with clang. PGO is disabled if it isn’t available. It would be
nice to have ‘llvm’ as an optional make dependency, but PKGBUILDs
doesn’t appear to support such a thing.
Finally, the -Wno-missing-profile flag, and its friends, have been
removed; instead we execute “footclient --version” (and “foot
--version”, in partial PGO builds) to ensure all generated binaries
have been executed before we do the final build (with
-Db_pgo=use). This fixes build failures with clang >= 11.x.
2021-03-26 20:36:34 +01:00
|
|
|
|
if [[ ${do_pgo} == yes ]]; then
|
|
|
|
|
|
find -name "*.gcda" -delete
|
|
|
|
|
|
meson configure -Db_pgo=generate
|
|
|
|
|
|
ninja
|
2020-11-16 19:40:41 +01:00
|
|
|
|
|
2021-04-22 11:28:04 +02:00
|
|
|
|
# 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
|
|
|
|
|
|
|
PKGBUILD: do PGO with either gcc or clang, but nothing else
Before this, we assumed gcc was being used. The build would fail if
clang (or something else) was used.
Now, we check whether we’re compiling with gcc or clang, and disable
PGO if it’s neither of them.
Furthermore, we’re now adding the necessary flags needed to do PGO
with clang.
Note that ‘llvm-profdata’, from the ‘llvm’ package is needed for
PGO:ing with clang. PGO is disabled if it isn’t available. It would be
nice to have ‘llvm’ as an optional make dependency, but PKGBUILDs
doesn’t appear to support such a thing.
Finally, the -Wno-missing-profile flag, and its friends, have been
removed; instead we execute “footclient --version” (and “foot
--version”, in partial PGO builds) to ensure all generated binaries
have been executed before we do the final build (with
-Db_pgo=use). This fixes build failures with clang >= 11.x.
2021-03-26 20:36:34 +01:00
|
|
|
|
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
|
2019-08-21 19:41:41 +02:00
|
|
|
|
|
PKGBUILD: do PGO with either gcc or clang, but nothing else
Before this, we assumed gcc was being used. The build would fail if
clang (or something else) was used.
Now, we check whether we’re compiling with gcc or clang, and disable
PGO if it’s neither of them.
Furthermore, we’re now adding the necessary flags needed to do PGO
with clang.
Note that ‘llvm-profdata’, from the ‘llvm’ package is needed for
PGO:ing with clang. PGO is disabled if it isn’t available. It would be
nice to have ‘llvm’ as an optional make dependency, but PKGBUILDs
doesn’t appear to support such a thing.
Finally, the -Wno-missing-profile flag, and its friends, have been
removed; instead we execute “footclient --version” (and “foot
--version”, in partial PGO builds) to ensure all generated binaries
have been executed before we do the final build (with
-Db_pgo=use). This fixes build failures with clang >= 11.x.
2021-03-26 20:36:34 +01:00
|
|
|
|
rm "${tmp_file}"
|
|
|
|
|
|
|
|
|
|
|
|
if [[ ${compiler} == clang ]]; then
|
|
|
|
|
|
llvm-profdata merge default_*profraw --output=default.profdata
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
meson configure -Db_pgo=use
|
|
|
|
|
|
fi
|
2020-11-16 19:40:41 +01:00
|
|
|
|
|
2019-07-15 15:48:03 +02:00
|
|
|
|
ninja
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-11-20 10:36:12 +01:00
|
|
|
|
check() {
|
|
|
|
|
|
ninja test
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-03-06 21:36:36 +01:00
|
|
|
|
package_foot-git() {
|
2019-09-21 00:22:28 +02:00
|
|
|
|
pkgdesc="A wayland native terminal emulator"
|
2020-07-25 09:06:04 +02:00
|
|
|
|
changelog=CHANGELOG.md
|
2020-11-12 08:02:57 +01:00
|
|
|
|
depends+=('foot-terminfo')
|
2020-03-06 21:36:36 +01:00
|
|
|
|
conflicts=('foot')
|
|
|
|
|
|
provides=('foot')
|
2019-09-21 00:22:28 +02:00
|
|
|
|
|
2019-07-15 15:48:03 +02:00
|
|
|
|
DESTDIR="${pkgdir}/" ninja install
|
2019-09-21 00:22:28 +02:00
|
|
|
|
rm -rf "${pkgdir}/usr/share/terminfo"
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-03-06 21:36:36 +01:00
|
|
|
|
package_foot-terminfo-git() {
|
2019-09-21 00:22:28 +02:00
|
|
|
|
pkgdesc="Terminfo files for the foot terminal emulator"
|
2019-09-21 00:29:17 +02:00
|
|
|
|
depends=('ncurses')
|
2020-03-06 21:36:36 +01:00
|
|
|
|
conflicts=('foot-terminfo')
|
|
|
|
|
|
provides=('foot-terminfo')
|
2019-09-21 00:22:28 +02:00
|
|
|
|
|
|
|
|
|
|
install -dm 755 "${pkgdir}/usr/share/terminfo/f/"
|
|
|
|
|
|
cp f/* "${pkgdir}/usr/share/terminfo/f/"
|
2019-07-15 15:48:03 +02:00
|
|
|
|
}
|