archrelease: copy trunk to extra-x86_64
[arch-packages.git] / gtk3 / trunk / PKGBUILD
blob8158b47eceb298fa41740cb2d37cd15e614164ba
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2 # Contributor: Ionut Biru <ibiru@archlinux.org>
4 pkgbase=gtk3
5 pkgname=(gtk3 gtk3-docs gtk3-demos)
6 pkgver=3.24.34+r156+g812b3930d0
7 pkgrel=1
8 epoch=1
9 pkgdesc="GObject-based multi-platform GUI toolkit"
10 url="https://www.gtk.org/"
11 arch=(x86_64)
12 depends=(atk cairo libxcursor libxinerama libxrandr libxi libepoxy gdk-pixbuf2
13          dconf libxcomposite libxdamage pango shared-mime-info at-spi2-atk
14          wayland libxkbcommon adwaita-icon-theme librsvg desktop-file-utils
15          mesa cantarell-fonts libcolord libcups fribidi iso-codes
16          libcloudproviders tracker3 gtk-update-icon-cache)
17 makedepends=(gobject-introspection gtk-doc git glib2-docs sassc meson
18              wayland-protocols)
19 license=(LGPL)
20 options=(debug)
21 _commit=812b3930d0bb11d67d4a2c159d037c8c0d440c50  # gtk-3-24
22 source=("git+https://gitlab.gnome.org/GNOME/gtk.git#commit=$_commit"
23         gtk-query-immodules-3.0.hook)
24 sha256sums=('SKIP'
25             'a0319b6795410f06d38de1e8695a9bf9636ff2169f40701671580e60a108e229')
27 pkgver() {
28   cd gtk
29   git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
32 prepare() {
33   cd gtk
35   # https://bugs.archlinux.org/task/76018
36   # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4381#note_1465559
37   git revert -n da4066774b926880631af099469d308714b5606c
40 build() {
41   CFLAGS+=" -DG_DISABLE_CAST_CHECKS"
42   local meson_options=(
43     -D broadway_backend=true
44     -D cloudproviders=true
45     -D tracker3=true
46     -D colord=yes
47     -D gtk_doc=true
48     -D man=true
49   )
51   arch-meson gtk build "${meson_options[@]}"
52   meson compile -C build
55 _pick() {
56   local p="$1" f d; shift
57   for f; do
58     d="$srcdir/$p/${f#$pkgdir/}"
59     mkdir -p "$(dirname "$d")"
60     mv "$f" "$d"
61     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
62   done
65 package_gtk3() {
66   optdepends=('evince: Default print preview command')
67   provides=(gtk3-print-backends libgtk-3.so libgdk-3.so libgailutil-3.so)
68   conflicts=(gtk3-print-backends)
69   replaces=("gtk3-print-backends<=3.22.26-1")
70   install=gtk3.install
72   meson install -C build --destdir "$pkgdir"
74   install -Dm644 /dev/stdin "$pkgdir/usr/share/gtk-3.0/settings.ini" <<END
75 [Settings]
76 gtk-icon-theme-name = Adwaita
77 gtk-theme-name = Adwaita
78 gtk-font-name = Cantarell 11
79 END
81   install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 gtk-query-immodules-3.0.hook
83   cd "$pkgdir"
85   rm usr/bin/gtk-update-icon-cache
86   rm usr/share/man/man1/gtk-update-icon-cache.1
88   _pick docs usr/share/gtk-doc
90   _pick demo usr/bin/gtk3-{demo,demo-application,icon-browser,widget-factory}
91   _pick demo usr/share/applications/gtk3-{demo,icon-browser,widget-factory}.desktop
92   _pick demo usr/share/glib-2.0/schemas/org.gtk.{Demo,exampleapp}.gschema.xml
93   _pick demo usr/share/icons/hicolor/*/apps/gtk3-{demo,widget-factory}[-.]*
94   _pick demo usr/share/man/man1/gtk3-{demo,demo-application,icon-browser,widget-factory}.1
97 package_gtk3-docs() {
98   pkgdesc+=" (documentation)"
99   depends=()
100   mv docs/* "$pkgdir"
103 package_gtk3-demos() {
104   pkgdesc+=" (demo applications)"
105   depends=(gtk3)
106   mv demo/* "$pkgdir"
109 # vim:set sw=2 et: