PKGBUILDs/extra/gtk4/PKGBUILD

142 lines
4.3 KiB
Bash
Raw Normal View History

2021-01-11 17:18:54 +00:00
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2021-01-11 17:27:56 +00:00
# - use github mirror, more reliable
2021-01-11 17:18:54 +00:00
pkgbase=gtk4
2021-04-10 00:10:05 +00:00
pkgname=(gtk4 gtk-update-icon-cache gtk4-docs gtk4-demos)
2021-12-31 23:44:06 +00:00
pkgver=4.6.0
2022-02-04 00:09:08 +00:00
pkgrel=3
2021-01-11 17:18:54 +00:00
epoch=1
pkgdesc="GObject-based multi-platform GUI toolkit"
url="https://www.gtk.org/"
2021-12-31 23:44:06 +00:00
arch=(x86_64)
2021-01-11 17:18:54 +00:00
license=(LGPL)
2021-12-31 23:44:06 +00:00
depends=(glib2 cairo pango fribidi gdk-pixbuf2 libpng libtiff libjpeg libepoxy
libgl libegl harfbuzz libxkbcommon graphene iso-codes tracker3
libcolord wayland libxrandr libx11 libxrender libxi libxext libxcursor
libxdamage libxfixes fontconfig libxinerama libcloudproviders libcups
2022-01-18 00:08:08 +00:00
gst-plugins-bad-libs librsvg dconf shared-mime-info desktop-file-utils
adwaita-icon-theme cantarell-fonts)
2021-12-31 23:44:06 +00:00
makedepends=(git meson gi-docgen shaderc sassc gobject-introspection docbook-xsl
wayland-protocols python-gobject python-docutils)
checkdepends=(weston)
_commit=70cb61fb7104c76a15bc6494a10e6ff1d470f6d8 # tags/4.6.0^0
2021-01-11 17:27:56 +00:00
source=("git+https://github.com/GNOME/gtk.git#commit=$_commit"
2022-02-04 00:09:08 +00:00
0001-demos-Make-our-stack-noexec.patch
2021-01-15 13:44:26 +00:00
gtk-update-icon-cache.{hook,script} gtk4-querymodules.hook)
2021-01-11 17:18:54 +00:00
sha256sums=('SKIP'
2022-02-04 00:09:08 +00:00
'31b0dd527ab808e2a7b83168fff126116be4194f9e7784f6543fb593c47a1433'
2021-01-11 17:18:54 +00:00
'2d435e3bec8b79b533f00f6d04decb1d7c299c6e89b5b175f20be0459f003fe8'
2021-01-15 13:44:26 +00:00
'f1d3a0dbfd82f7339301abecdbe5f024337919b48bd0e09296bb0e79863b2541'
'cd8e607eddd9941f279084e1d15309941423d26cca1897f43524a02e58e48816')
2021-01-11 17:18:54 +00:00
pkgver() {
cd gtk
2021-12-31 23:44:06 +00:00
git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
2021-01-11 17:18:54 +00:00
}
prepare() {
cd gtk
2022-01-18 00:08:08 +00:00
2022-02-04 00:09:08 +00:00
# Fix kerning with OpenGL
git cherry-pick -n cb1dd662204fe6c953a20dece74f78ec93a34a68
2022-01-18 00:08:08 +00:00
# Ensure noexecstack
git cherry-pick -n 46509b6dd28c58ae 17c2a1cb4ea2093d
2022-02-04 00:09:08 +00:00
git apply -3 ../0001-demos-Make-our-stack-noexec.patch
2021-01-11 17:18:54 +00:00
}
build() {
2021-11-01 22:09:48 +00:00
CFLAGS+=" -DG_DISABLE_CAST_CHECKS"
2021-04-12 03:29:02 +00:00
local meson_options=(
-D broadway-backend=true
-D cloudproviders=enabled
-D tracker=enabled
-D colord=enabled
-D gtk_doc=true
2021-01-11 17:18:54 +00:00
-D man-pages=true
2021-04-12 03:29:02 +00:00
)
arch-meson gtk build "${meson_options[@]}"
2021-01-11 17:18:54 +00:00
meson compile -C build
}
2021-12-31 23:44:06 +00:00
check() (
export XDG_RUNTIME_DIR="$PWD/runtime-dir" WAYLAND_DISPLAY=wayland-5
mkdir -p -m 700 "$XDG_RUNTIME_DIR"
weston --backend=headless-backend.so --socket=$WAYLAND_DISPLAY --idle-time=0 &
_w=$!
trap "kill $_w; wait" EXIT
meson test -C build --print-errorlogs
)
2021-04-10 00:10:05 +00:00
_pick() {
local p="$1" f d; shift
for f; do
d="$srcdir/$p/${f#$pkgdir/}"
mkdir -p "$(dirname "$d")"
mv "$f" "$d"
rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
done
}
2021-01-11 17:18:54 +00:00
package_gtk4() {
depends+=(gtk-update-icon-cache)
2021-04-10 00:10:05 +00:00
provides=(libgtk-4.so)
2021-01-11 17:18:54 +00:00
2021-08-22 20:18:06 +00:00
meson install -C build --destdir "$pkgdir"
2021-01-11 17:18:54 +00:00
install -Dm644 /dev/stdin "$pkgdir/usr/share/gtk-4.0/settings.ini" <<END
[Settings]
gtk-icon-theme-name = Adwaita
gtk-theme-name = Adwaita
gtk-font-name = Cantarell 11
END
2021-01-15 13:44:26 +00:00
install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk4-querymodules.hook
2021-04-10 00:10:05 +00:00
cd "$pkgdir"
_pick guic usr/bin/gtk4-update-icon-cache
_pick guic usr/share/man/man1/gtk4-update-icon-cache.1
2021-03-30 21:56:48 +00:00
2021-04-10 00:10:05 +00:00
_pick docs usr/share/doc
_pick demo usr/bin/gtk4-{demo,demo-application,icon-browser,print-editor,widget-factory}
_pick demo usr/share/applications/org.gtk.{Demo,IconBrowser,PrintEditor,WidgetFactory}4.desktop
_pick demo usr/share/glib-2.0/schemas/org.gtk.Demo4.gschema.xml
_pick demo usr/share/icons/hicolor/*/apps/org.gtk.{Demo,IconBrowser,PrintEditor,WidgetFactory}4[-.]*
_pick demo usr/share/man/man1/gtk4-{demo,demo-application,icon-browser,widget-factory}.1
_pick demo usr/share/metainfo/org.gtk.{Demo,IconBrowser,PrintEditor,WidgetFactory}4.appdata.xml
2021-01-11 17:18:54 +00:00
}
package_gtk-update-icon-cache() {
pkgdesc="GTK icon cache updater"
depends=(gdk-pixbuf2 librsvg hicolor-icon-theme)
2021-04-10 00:10:05 +00:00
mv guic/* "$pkgdir"
2021-01-11 17:18:54 +00:00
ln -s gtk4-update-icon-cache "$pkgdir/usr/bin/gtk-update-icon-cache"
ln -s gtk4-update-icon-cache.1 "$pkgdir/usr/share/man/man1/gtk-update-icon-cache.1"
install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk-update-icon-cache.hook
install -D gtk-update-icon-cache.script "$pkgdir/usr/share/libalpm/scripts/gtk-update-icon-cache"
}
2021-03-30 21:56:48 +00:00
package_gtk4-docs() {
pkgdesc+=" (documentation)"
depends=()
2021-04-10 00:10:05 +00:00
mv docs/* "$pkgdir"
}
package_gtk4-demos() {
pkgdesc+=" (demo applications)"
depends=(gtk4)
mv demo/* "$pkgdir"
2021-03-30 21:56:48 +00:00
}
2021-12-31 23:44:06 +00:00
# vim:set sw=2 et: