archrelease: copy trunk to extra-x86_64
[arch-packages.git] / gtk4 / trunk / PKGBUILD
blob5884fa6d5c0f5cf7a7414d48131713116c579ae3
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
3 pkgbase=gtk4
4 pkgname=(gtk4 gtk-update-icon-cache gtk4-docs gtk4-demos)
5 pkgver=4.4.1
6 pkgrel=1
7 epoch=1
8 pkgdesc="GObject-based multi-platform GUI toolkit"
9 arch=(x86_64)
10 url="https://www.gtk.org/"
11 depends=(glib2 cairo pango fribidi gdk-pixbuf2 libepoxy libgl libegl harfbuzz
12          libxkbcommon graphene iso-codes tracker3 libcolord wayland libxrandr
13          libx11 libxrender libxi libxext libxcursor libxdamage libxfixes
14          fontconfig libxinerama libcloudproviders libcups rest json-glib
15          gst-plugins-bad-libs librsvg dconf shared-mime-info desktop-file-utils
16          adwaita-icon-theme cantarell-fonts)
17 makedepends=(git meson gi-docgen shaderc sassc gobject-introspection docbook-xsl
18              wayland-protocols)
19 license=(LGPL)
20 _commit=3090fbac82d86543cd198ddf38d4044e05c87d91  # tags/4.4.1^0
21 source=("git+https://gitlab.gnome.org/GNOME/gtk.git#commit=$_commit"
22         gtk-update-icon-cache.{hook,script} gtk4-querymodules.hook)
23 sha256sums=('SKIP'
24             '2d435e3bec8b79b533f00f6d04decb1d7c299c6e89b5b175f20be0459f003fe8'
25             'f1d3a0dbfd82f7339301abecdbe5f024337919b48bd0e09296bb0e79863b2541'
26             'cd8e607eddd9941f279084e1d15309941423d26cca1897f43524a02e58e48816')
28 pkgver() {
29   cd gtk
30   git describe --tags | sed 's/-/+/g'
33 prepare() {
34   cd gtk
37 build() {
38   CFLAGS+=" -DG_DISABLE_CAST_CHECKS"
39   local meson_options=(
40     -D broadway-backend=true
41     -D cloudproviders=enabled
42     -D tracker=enabled
43     -D colord=enabled
44     -D gtk_doc=true
45     -D man-pages=true
46   )
48   arch-meson gtk build "${meson_options[@]}"
49   meson compile -C build
52 _pick() {
53   local p="$1" f d; shift
54   for f; do
55     d="$srcdir/$p/${f#$pkgdir/}"
56     mkdir -p "$(dirname "$d")"
57     mv "$f" "$d"
58     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
59   done
62 package_gtk4() {
63   depends+=(gtk-update-icon-cache)
64   provides=(libgtk-4.so)
66   meson install -C build --destdir "$pkgdir"
68   install -Dm644 /dev/stdin "$pkgdir/usr/share/gtk-4.0/settings.ini" <<END
69 [Settings]
70 gtk-icon-theme-name = Adwaita
71 gtk-theme-name = Adwaita
72 gtk-font-name = Cantarell 11
73 END
75   install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk4-querymodules.hook
77   cd "$pkgdir"
79   _pick guic usr/bin/gtk4-update-icon-cache
80   _pick guic usr/share/man/man1/gtk4-update-icon-cache.1
82   _pick docs usr/share/doc
84   _pick demo usr/bin/gtk4-{demo,demo-application,icon-browser,print-editor,widget-factory}
85   _pick demo usr/share/applications/org.gtk.{Demo,IconBrowser,PrintEditor,WidgetFactory}4.desktop
86   _pick demo usr/share/glib-2.0/schemas/org.gtk.Demo4.gschema.xml
87   _pick demo usr/share/icons/hicolor/*/apps/org.gtk.{Demo,IconBrowser,PrintEditor,WidgetFactory}4[-.]*
88   _pick demo usr/share/man/man1/gtk4-{demo,demo-application,icon-browser,widget-factory}.1
89   _pick demo usr/share/metainfo/org.gtk.{Demo,IconBrowser,PrintEditor,WidgetFactory}4.appdata.xml
92 package_gtk-update-icon-cache() {
93   pkgdesc="GTK icon cache updater"
94   depends=(gdk-pixbuf2 librsvg hicolor-icon-theme)
96   mv guic/* "$pkgdir"
97   ln -s gtk4-update-icon-cache "$pkgdir/usr/bin/gtk-update-icon-cache"
98   ln -s gtk4-update-icon-cache.1 "$pkgdir/usr/share/man/man1/gtk-update-icon-cache.1"
100   install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk-update-icon-cache.hook
101   install -D gtk-update-icon-cache.script "$pkgdir/usr/share/libalpm/scripts/gtk-update-icon-cache"
104 package_gtk4-docs() {
105   pkgdesc+=" (documentation)"
106   depends=()
107   mv docs/* "$pkgdir"
110 package_gtk4-demos() {
111   pkgdesc+=" (demo applications)"
112   depends=(gtk4)
113   mv demo/* "$pkgdir"
116 # vim:set ts=2 sw=2 et: