archrelease: copy trunk to extra-x86_64
[arch-packages.git] / gtk4 / trunk / PKGBUILD
blobf0c94361e14b17c75e9235af5aadecbb7f556d05
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
3 pkgbase=gtk4
4 pkgname=(
5   gtk4
6   gtk4-demos
7   gtk4-docs
8   gtk-update-icon-cache
10 pkgver=4.10.3
11 pkgrel=2
12 epoch=1
13 pkgdesc="GObject-based multi-platform GUI toolkit"
14 url="https://www.gtk.org/"
15 arch=(x86_64)
16 license=(LGPL)
17 depends=(
18   adwaita-icon-theme
19   cairo
20   cantarell-fonts
21   dconf
22   desktop-file-utils
23   fontconfig
24   fribidi
25   gdk-pixbuf2
26   glib2
27   graphene
28   gst-plugins-bad-libs
29   harfbuzz
30   iso-codes
31   libcloudproviders
32   libcolord
33   libcups
34   libegl
35   libepoxy
36   libgl
37   libjpeg
38   libpng
39   librsvg
40   libtiff
41   libx11
42   libxcursor
43   libxdamage
44   libxext
45   libxfixes
46   libxi
47   libxinerama
48   libxkbcommon
49   libxrandr
50   libxrender
51   pango
52   shared-mime-info
53   tracker3
54   wayland
56 makedepends=(
57   docbook-xsl
58   gi-docgen
59   git
60   gobject-introspection
61   meson
62   python-docutils
63   python-gobject
64   sassc
65   shaderc
66   wayland-protocols
68 checkdepends=(weston)
69 _commit=06b3ced8e7fc936caed43379b120d75be09713ca  # tags/4.10.3^0
70 source=(
71   "git+https://gitlab.gnome.org/GNOME/gtk.git#commit=$_commit"
72   gtk-update-icon-cache.{hook,script}
73   gtk4-querymodules.{hook,script}
75 b2sums=('SKIP'
76         '136bdb410c46daf769175e8e8837286576391797a4762b8cf388217e893dd6c5087c5c91c347cbdf7d3e9dcd2c978c2fb275b5af1f3425c9f7979fbc65a81324'
77         '6bcd839ef82296d864587e0cc7acc0145bdea8e5235af304747cf3c0e564c2757cc67c0373dc044bec83dccfc57dc899546c2fccea96cff2bba22f09978a3814'
78         'dd589bd1ad2b13f0e06f6899776a083f20a1aac24d4308d666ffd0d1cff38457b8257b8366f92e767b4233b3d86b6b54fa50339faf84c4801a824986366dce30'
79         '4b90eb8d582509b09aab401313d4399cc139ad21b5dd7d45d79860d0764c7494c60714e0794e09823e51d1894ac032a994f27d79d1499abf24ee6f59bdb0c243')
81 pkgver() {
82   cd gtk
83   git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
86 prepare() {
87   cd gtk
89   # GtkTreeListModel fixes
90   # https://gitlab.gnome.org/GNOME/gtk/-/issues/5707
91   git cherry-pick -n 4f47683710bbb4b56c286c6ee6a5c394fcf2b755 # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5873
92   git cherry-pick -n 541de3451cdaef589ab724ccf612d868455f2b31 # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5918
95 build() {
96   local meson_options=(
97     -D broadway-backend=true
98     -D cloudproviders=enabled
99     -D colord=enabled
100     -D gtk_doc=true
101     -D man-pages=true
102     -D tracker=enabled
103   )
105   CFLAGS+=" -DG_DISABLE_CAST_CHECKS"
106   arch-meson gtk build "${meson_options[@]}"
107   meson compile -C build
110 check() (
111   export XDG_RUNTIME_DIR="$PWD/runtime-dir" WAYLAND_DISPLAY=wayland-5
113   mkdir -p -m 700 "$XDG_RUNTIME_DIR"
114   weston --backend=headless-backend.so --socket=$WAYLAND_DISPLAY --idle-time=0 &
115   _w=$!
117   trap "kill $_w; wait" EXIT
119   meson test -C build --print-errorlogs
122 _pick() {
123   local p="$1" f d; shift
124   for f; do
125     d="$srcdir/$p/${f#$pkgdir/}"
126     mkdir -p "$(dirname "$d")"
127     mv "$f" "$d"
128     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
129   done
132 package_gtk4() {
133   depends+=(gtk-update-icon-cache)
134   optdepends=('evince: Default print preview command')
135   provides=(libgtk-4.so)
137   meson install -C build --destdir "$pkgdir"
139   install -Dm644 /dev/stdin "$pkgdir/usr/share/gtk-4.0/settings.ini" <<END
140 [Settings]
141 gtk-icon-theme-name = Adwaita
142 gtk-theme-name = Adwaita
143 gtk-font-name = Cantarell 11
146   install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk4-querymodules.hook
147   install -D gtk4-querymodules.script "$pkgdir/usr/share/libalpm/scripts/gtk4-querymodules"
149   cd "$pkgdir"
151   _pick demo usr/bin/gtk4-{demo,demo-application,icon-browser,node-editor,print-editor,widget-factory}
152   _pick demo usr/share/applications/org.gtk.{Demo4,IconBrowser4,PrintEditor4,WidgetFactory4,gtk4.NodeEditor}.desktop
153   _pick demo usr/share/glib-2.0/schemas/org.gtk.Demo4.gschema.xml
154   _pick demo usr/share/icons/hicolor/*/apps/org.gtk.{Demo4,IconBrowser4,PrintEditor4,WidgetFactory4,gtk4.NodeEditor}[-.]*
155   _pick demo usr/share/man/man1/gtk4-{demo,demo-application,icon-browser,node-editor,widget-factory}.1
156   _pick demo usr/share/metainfo/org.gtk.{Demo4,IconBrowser4,PrintEditor4,WidgetFactory4,gtk4.NodeEditor}.appdata.xml
158   _pick docs usr/share/doc
160   # Built by GTK 4, shared with GTK 3
161   _pick guic usr/bin/gtk4-update-icon-cache
162   _pick guic usr/share/man/man1/gtk4-update-icon-cache.1
167 package_gtk4-demos() {
168   pkgdesc+=" (demo applications)"
169   depends=(gtk4)
170   mv demo/* "$pkgdir"
173 package_gtk4-docs() {
174   pkgdesc+=" (documentation)"
175   depends=()
176   mv docs/* "$pkgdir"
179 package_gtk-update-icon-cache() {
180   pkgdesc="GTK icon cache updater"
181   depends=(gdk-pixbuf2 librsvg hicolor-icon-theme)
183   mv guic/* "$pkgdir"
184   ln -s gtk4-update-icon-cache "$pkgdir/usr/bin/gtk-update-icon-cache"
185   ln -s gtk4-update-icon-cache.1 "$pkgdir/usr/share/man/man1/gtk-update-icon-cache.1"
187   install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk-update-icon-cache.hook
188   install -D gtk-update-icon-cache.script "$pkgdir/usr/share/libalpm/scripts/gtk-update-icon-cache"
191 # vim:set sw=2 sts=-1 et: