1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
4 pkgname=(gtk4 gtk-update-icon-cache gtk4-docs gtk4-demos)
8 pkgdesc="GObject-based multi-platform GUI toolkit"
9 url="https://www.gtk.org/"
12 depends=(glib2 cairo pango fribidi gdk-pixbuf2 libpng libtiff libjpeg libepoxy
13 libgl libegl harfbuzz libxkbcommon graphene iso-codes tracker3
14 libcolord wayland libxrandr libx11 libxrender libxi libxext libxcursor
15 libxdamage libxfixes fontconfig libxinerama libcloudproviders libcups
16 gst-plugins-bad-libs librsvg dconf shared-mime-info desktop-file-utils
17 adwaita-icon-theme cantarell-fonts)
18 makedepends=(git meson gi-docgen shaderc sassc gobject-introspection docbook-xsl
19 wayland-protocols python-gobject python-docutils)
21 _commit=57ba5ad39ea0686360559c3a17042634d70fad34 # tags/4.6.6^0
22 source=("git+https://gitlab.gnome.org/GNOME/gtk.git#commit=$_commit"
23 gtk-update-icon-cache.{hook,script} gtk4-querymodules.hook)
25 '2d435e3bec8b79b533f00f6d04decb1d7c299c6e89b5b175f20be0459f003fe8'
26 'f1d3a0dbfd82f7339301abecdbe5f024337919b48bd0e09296bb0e79863b2541'
27 'cd8e607eddd9941f279084e1d15309941423d26cca1897f43524a02e58e48816')
31 git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
39 CFLAGS+=" -DG_DISABLE_CAST_CHECKS"
41 -D broadway-backend=true
42 -D cloudproviders=enabled
49 arch-meson gtk build "${meson_options[@]}"
50 meson compile -C build
53 # checkdepends=(weston)
55 # export XDG_RUNTIME_DIR="$PWD/runtime-dir" WAYLAND_DISPLAY=wayland-5
57 # mkdir -p -m 700 "$XDG_RUNTIME_DIR"
58 # weston --backend=headless-backend.so --socket=$WAYLAND_DISPLAY --idle-time=0 &
61 # trap "kill $_w; wait" EXIT
63 # meson test -C build --print-errorlogs
67 local p="$1" f d; shift
69 d="$srcdir/$p/${f#$pkgdir/}"
70 mkdir -p "$(dirname "$d")"
72 rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
77 depends+=(gtk-update-icon-cache)
78 optdepends=('evince: Default print preview command')
79 provides=(libgtk-4.so)
81 meson install -C build --destdir "$pkgdir"
83 install -Dm644 /dev/stdin "$pkgdir/usr/share/gtk-4.0/settings.ini" <<END
85 gtk-icon-theme-name = Adwaita
86 gtk-theme-name = Adwaita
87 gtk-font-name = Cantarell 11
90 install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk4-querymodules.hook
94 _pick guic usr/bin/gtk4-update-icon-cache
95 _pick guic usr/share/man/man1/gtk4-update-icon-cache.1
97 _pick docs usr/share/doc
99 _pick demo usr/bin/gtk4-{demo,demo-application,icon-browser,print-editor,widget-factory}
100 _pick demo usr/share/applications/org.gtk.{Demo,IconBrowser,PrintEditor,WidgetFactory}4.desktop
101 _pick demo usr/share/glib-2.0/schemas/org.gtk.Demo4.gschema.xml
102 _pick demo usr/share/icons/hicolor/*/apps/org.gtk.{Demo,IconBrowser,PrintEditor,WidgetFactory}4[-.]*
103 _pick demo usr/share/man/man1/gtk4-{demo,demo-application,icon-browser,widget-factory}.1
104 _pick demo usr/share/metainfo/org.gtk.{Demo,IconBrowser,PrintEditor,WidgetFactory}4.appdata.xml
107 package_gtk-update-icon-cache() {
108 pkgdesc="GTK icon cache updater"
109 depends=(gdk-pixbuf2 librsvg hicolor-icon-theme)
112 ln -s gtk4-update-icon-cache "$pkgdir/usr/bin/gtk-update-icon-cache"
113 ln -s gtk4-update-icon-cache.1 "$pkgdir/usr/share/man/man1/gtk-update-icon-cache.1"
115 install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk-update-icon-cache.hook
116 install -D gtk-update-icon-cache.script "$pkgdir/usr/share/libalpm/scripts/gtk-update-icon-cache"
119 package_gtk4-docs() {
120 pkgdesc+=" (documentation)"
125 package_gtk4-demos() {
126 pkgdesc+=" (demo applications)"