db-move: moved xdg-desktop-portal-gnome from [testing] to [extra] (x86_64)
[arch-packages.git] / gtk4 / trunk / PKGBUILD
blob63d999977dcfb78bec4e946fafc6e26c6ee776ae
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=1
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
90 build() {
91   local meson_options=(
92     -D broadway-backend=true
93     -D cloudproviders=enabled
94     -D colord=enabled
95     -D gtk_doc=true
96     -D man-pages=true
97     -D tracker=enabled
98   )
100   CFLAGS+=" -DG_DISABLE_CAST_CHECKS"
101   arch-meson gtk build "${meson_options[@]}"
102   meson compile -C build
105 check() (
106   export XDG_RUNTIME_DIR="$PWD/runtime-dir" WAYLAND_DISPLAY=wayland-5
108   mkdir -p -m 700 "$XDG_RUNTIME_DIR"
109   weston --backend=headless-backend.so --socket=$WAYLAND_DISPLAY --idle-time=0 &
110   _w=$!
112   trap "kill $_w; wait" EXIT
114   meson test -C build --print-errorlogs
117 _pick() {
118   local p="$1" f d; shift
119   for f; do
120     d="$srcdir/$p/${f#$pkgdir/}"
121     mkdir -p "$(dirname "$d")"
122     mv "$f" "$d"
123     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
124   done
127 package_gtk4() {
128   depends+=(gtk-update-icon-cache)
129   optdepends=('evince: Default print preview command')
130   provides=(libgtk-4.so)
132   meson install -C build --destdir "$pkgdir"
134   install -Dm644 /dev/stdin "$pkgdir/usr/share/gtk-4.0/settings.ini" <<END
135 [Settings]
136 gtk-icon-theme-name = Adwaita
137 gtk-theme-name = Adwaita
138 gtk-font-name = Cantarell 11
141   install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk4-querymodules.hook
142   install -D gtk4-querymodules.script "$pkgdir/usr/share/libalpm/scripts/gtk4-querymodules"
144   cd "$pkgdir"
146   _pick demo usr/bin/gtk4-{demo,demo-application,icon-browser,node-editor,print-editor,widget-factory}
147   _pick demo usr/share/applications/org.gtk.{Demo4,IconBrowser4,PrintEditor4,WidgetFactory4,gtk4.NodeEditor}.desktop
148   _pick demo usr/share/glib-2.0/schemas/org.gtk.Demo4.gschema.xml
149   _pick demo usr/share/icons/hicolor/*/apps/org.gtk.{Demo4,IconBrowser4,PrintEditor4,WidgetFactory4,gtk4.NodeEditor}[-.]*
150   _pick demo usr/share/man/man1/gtk4-{demo,demo-application,icon-browser,node-editor,widget-factory}.1
151   _pick demo usr/share/metainfo/org.gtk.{Demo4,IconBrowser4,PrintEditor4,WidgetFactory4,gtk4.NodeEditor}.appdata.xml
153   _pick docs usr/share/doc
155   # Built by GTK 4, shared with GTK 3
156   _pick guic usr/bin/gtk4-update-icon-cache
157   _pick guic usr/share/man/man1/gtk4-update-icon-cache.1
162 package_gtk4-demos() {
163   pkgdesc+=" (demo applications)"
164   depends=(gtk4)
165   mv demo/* "$pkgdir"
168 package_gtk4-docs() {
169   pkgdesc+=" (documentation)"
170   depends=()
171   mv docs/* "$pkgdir"
174 package_gtk-update-icon-cache() {
175   pkgdesc="GTK icon cache updater"
176   depends=(gdk-pixbuf2 librsvg hicolor-icon-theme)
178   mv guic/* "$pkgdir"
179   ln -s gtk4-update-icon-cache "$pkgdir/usr/bin/gtk-update-icon-cache"
180   ln -s gtk4-update-icon-cache.1 "$pkgdir/usr/share/man/man1/gtk-update-icon-cache.1"
182   install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk-update-icon-cache.hook
183   install -D gtk-update-icon-cache.script "$pkgdir/usr/share/libalpm/scripts/gtk-update-icon-cache"
186 # vim:set sw=2 sts=-1 et: