summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bae3313ed992a0ceec994180e5616ca5961ba757 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Maintainer: Michael Healy <horsemanoffaith@gmail.com>
# Contributor: Xiao-Long Chen <chenxiaolong@cxl.epac.to>
# Contributor: Christopher Reimer <github@creimer.net>
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>


# vercheck-pkgbuild: auto
# vercheck-ubuntu: name=gtk+3.0, repo=cosmic
# vercheck-archlinux: name=gtk3, repo=extra, arch=x86_64
# vercheck-gnome: name=gtk+, majorver=3.22
# vercheck-ppa: name=gtk+3.0, url=ppa:gnome3-team/gnome3-staging

_use_ppa=true

pkgbase=gtk3-ubuntu
pkgname=(gtk3-ubuntu gtk-update-icon-cache-ubuntu)
_ubuntu_ver=3.24.13
_ubuntu_rel=1ubuntu1
pkgver=3.24.13
pkgrel=2
pkgdesc="GObject-based multi-platform toolkit"
arch=(x86_64)
url="http://www.gtk.org/"
depends=(adwaita-icon-theme at-spi2-atk atk cairo cantarell-fonts colord dconf desktop-file-utils gdk-pixbuf2 gtk-update-icon-cache json-glib libcanberra libcups libepoxy librsvg libxcomposite libxcursor libxdamage libxi libxinerama libxkbcommon libxrandr mesa pango rest shared-mime-info wayland wayland-protocols gtk-update-icon-cache)
makedepends=(gobject-introspection git gtk-doc glib2-docs sassc)
license=(LGPL)
_commit=f737908d2f7dc121e0d85507c16fd7a399d4b36a  # tags/3.24.13^0
source=("git+https://gitlab.gnome.org/GNOME/gtk.git#commit=$_commit"
	settings.ini
	gtk-query-immodules-3.0.hook
	gtk-update-icon-cache.hook
	gtk-update-icon-cache.script)

source+=("https://launchpad.net/ubuntu/+archive/primary/+files/gtk+3.0_${_ubuntu_ver:-${pkgver}}-${_ubuntu_rel}.debian.tar.xz")

sha512sums=('SKIP'
            'ad2c0b0388f4169592b9574f0b3db673a969b7c4721548c4ac7c438eddbcdc378fcaac04e2b6c858a1562cc23ddf4804e5f7be08068340b7c9365e2b11ddcfb8'
            'f0ffd95544863f2e10fda81488b4727aa9a8a35a7d39fb96872db6664d03442db2b58af788b5990825c7b3a83681f7220ca481409cca5421dfb39b9a3bbac9ac'
            'abfd73de4faa6f53784182800395aa3c39bb98e15a0eb300fb4142073ff7ce565a0836a2363393b2f132060b5293dbc0c30c380a023f38d5bd39c62cb58389c2'
            '5cd50d93bb6bc203438a2a0764bd717409658e124058b18a1da26a21f10ef7564a16f32fc0633a68b45b2e303fa63a5efefeadd6b0bf1d7f474556df8cdb6c58'
            'bf7c8572421711fdf2e82be0d18b6a93747ac9ed236e4bcc8ab65e66d927ee704c6633f9479206c394e7823ed03958e98d43c2e21e4d2be3a7c8db7bb7bef1e0')

pkgver() {
  cd gtk
  git describe --tags | sed 's/-/+/g'
}

prepare() {
    cd gtk

    local patches=(
       gdk-Don-t-distribute-generated-files-in-tarballs.patch
       gtk-Really-don-t-distribute-built-files.patch
       demos-examples-tests-Don-t-distribute-built-files.patch
       016_no_offscreen_widgets_grabbing.patch
       017_no_offscreen_device_grabbing.patch
       060_ignore-random-icons.patch
       reftest-known-fail.patch
       Don-t-test-default-constructed-GdkPixbuf-properties.patch
       Disable-accessibility-dump-aka-a11ytests-test.patch
       073_treeview_almost_fixed.patch
       bzg_gtkcellrenderer_grabbing_modifier.patch
       ubuntu_gtk_custom_menu_items.patch
       print-dialog-show-options-of-remote-dnssd-printers.patch
       uimanager-guard-against-nested-node-updates.patch
       x-canonical-accel.patch
       message-dialog-restore-traditional-look-on-unity.patch
       0001-gtk-reftest-Force-icon-theme-to-Adwaita.patch
       0001-calendar-always-emit-day-selected-once.patch
       0001-gtkwindow-set-transparent-background-color.patch
       unity-border-radius.patch
       unity-headerbar-maximized-mode.patch
    )

    for i in "${patches[@]}"; do
        msg "Applying ${i} ..."
        patch -p1 -i "../debian/patches/${i}"
    done

    NOCONFIGURE=1 ./autogen.sh
}

build() {
    cd gtk

    CXX=/bin/false ./configure --prefix=/usr \
        --sysconfdir=/etc \
        --localstatedir=/var \
        --disable-schemas-compile \
        --enable-x11-backend \
        --enable-broadway-backend \
        --enable-wayland-backend \
        --enable-gtk-doc

    #https://bugzilla.gnome.org/show_bug.cgi?id=655517
    sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

    make
}

package_gtk3-ubuntu() {
    depends+=(gtk-update-icon-cache)
    provides=(gtk3 gtk3-print-backends)
    conflicts=(gtk3 gtk3-print-backends)
    replaces=("gtk3-print-backends<=3.22.26-1")
    install=gtk3.install

    cd gtk
    make DESTDIR="$pkgdir" install

    install -Dm644 ../settings.ini "$pkgdir/usr/share/gtk-3.0/settings.ini"
    install -Dm644 ../gtk-query-immodules-3.0.hook "$pkgdir/usr/share/libalpm/hooks/gtk-query-immodules-3.0.hook"

    # split this out to use with gtk2 too
    rm "$pkgdir/usr/bin/gtk-update-icon-cache"
}

package_gtk-update-icon-cache-ubuntu() {
    pkgdesc="GTK+ icon cache updater"
    provides=(gtk-update-icon-cache)
    conflicts=(gtk-update-icon-cache)
    depends=(gdk-pixbuf2 librsvg hicolor-icon-theme)

    cd gtk
    install -D gtk/gtk-update-icon-cache "$pkgdir/usr/bin/gtk-update-icon-cache"
    install -Dm644 ../gtk-update-icon-cache.hook "$pkgdir/usr/share/libalpm/hooks/gtk-update-icon-cache.hook"
    install -D ../gtk-update-icon-cache.script "$pkgdir/usr/share/libalpm/scripts/gtk-update-icon-cache"
}