pmaports/temp/gtk+3.0/APKBUILD
Timothee LF e38c7c069a
temp/gtk+3.0: upgrade to 9999_git20201022
Remove patches:
'0001-gtk-meson.build-add-new-hdy-files.patch' and
'10-Revert-gdkseatdefault-Grab-touch-events-where-applic.patch'
appear in the code downloaded from Purism at precisely the
location of the patches.

[ci:skip-build]: already built successfully in CI
2020-10-28 14:51:03 +01:00

140 lines
3.6 KiB
Text

# Forked from Alpine to apply Purism's patches for responsivness
pkgname=gtk+3.0
pkgver=9999_git20201022
pkgrel=0
_commit="a3994f140fe20c0bc7c6cd13a60cdf9700461a94"
pkgdesc="The GTK+ Toolkit (v3)"
url="https://www.gtk.org/"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.post-deinstall"
arch="all"
license="LGPL-2.1-or-later"
options="!check" # Most glade tests fail :c
subpackages="$pkgname-demo $pkgname-dev $pkgname-lang $pkgname-dbg"
depends="shared-mime-info gtk-update-icon-cache"
replaces="gtk+"
depends_dev="
atk-dev
gdk-pixbuf-dev
glib-dev
libepoxy-dev
libxext-dev
libxi-dev
libxinerama-dev
wayland-protocols
wayland-libs-client
wayland-libs-cursor
libxkbcommon-dev
"
makedepends="
$depends_dev
cups-dev
expat-dev
gettext-dev
gnutls-dev
gobject-introspection-dev
libice-dev
tiff-dev
zlib-dev
at-spi2-atk-dev
cairo-dev
fontconfig-dev
pango-dev
wayland-dev
libx11-dev
libxcomposite-dev
libxcursor-dev
libxdamage-dev
libxfixes-dev
libxrandr-dev
meson
gtk-doc
iso-codes-dev
"
checkdepends="
xvfb-run
ibus
librsvg
gdk-pixbuf
"
source="https://source.puri.sm/Librem5/gtk/-/archive/$_commit/gtk-$_commit.tar.gz
check-version.py
"
builddir="$srcdir/gtk-$_commit"
prepare() {
default_prepare
# Prevent unexpected downgrade: 3.90.99 is higher than Alpine's version
# (pma#694), but still passes the libportal check (pma#841)
for _ver in gtk_minor_version gtk_micro_version gtk_interface_age; do
sed -i "s/m4_define(\[$_ver\], \[.*\])/m4_define([$_ver], [90])/g" configure.ac
done
sed -i "s/ version: '.*',/ version: '3.90.99',/g" meson.build
sed -i "s/^gtk_interface_age = .*/gtk_interface_age = 90/g" meson.build
# Upstream forgot to include this in the tarball
# https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1776
mv "$srcdir"/check-version.py .
}
build() {
# postmarketOS specific: disable stuff that takes forever to (cross)compile:
# man=false, gtk_doc=false, tests=false
meson \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--buildtype=plain \
-Dman=false \
-Dgtk_doc=false \
-Dtests=false \
-Dbroadway_backend=true \
output
ninja -C output
}
check() {
xvfb-run ninja -C output test
}
package() {
DESTDIR="$pkgdir" ninja -C output install
# use gtk-update-icon-cache from gtk+2.0 for now
rm -f "$pkgdir"/usr/bin/gtk-update-icon-cache
rm -f "$pkgdir"/usr/share/man/man1/gtk-update-icon-cache.1
}
demo() {
pkgdesc="$pkgdesc (demonstration application)"
install -Dm755 "$pkgdir"/usr/bin/gtk3-demo \
"$pkgdir"/usr/bin/gtk3-widget-factory \
"$pkgdir"/usr/bin/gtk3-demo-application \
-t "$subpkgdir"/usr/bin
install -Dm644 "$pkgdir"/usr/share/gtk-3.0/gtkbuilder.rng \
-t "$subpkgdir"/usr/share/gtk-3.0
install -Dm644 "$pkgdir"/usr/share/glib-2.0/schemas/org.gtk.Demo.gschema.xml \
-t "$subpkgdir"/usr/share/glib-2.0/schemas
install -Dm644 "$pkgdir"/usr/share/applications/gtk3-widget-factory.desktop \
"$pkgdir"/usr/share/applications/gtk3-demo.desktop \
-t "$subpkgdir"/usr/share/applications
mkdir -p "$subpkgdir"/usr/share
mv "$pkgdir"/usr/share/icons "$subpkgdir"/usr/share
}
dev() {
replaces="gtk+-dev"
default_dev
}
doc() {
replaces="gtk+-doc"
default_doc
}
sha512sums="bd573a5d48b5621cb243418f6bb9a5b2954e218d7955f7acb1a340c8b67f363bb1c4fcde24fa7e5314a557aaa00e5e0fb7d6b8d3ffbf79da733c0ce422c608ec gtk-a3994f140fe20c0bc7c6cd13a60cdf9700461a94.tar.gz
b97ccd8fb78d7c32fe91607befd6a7c0dd969fbfc9c242948fc88085133e3461583a0b18ade199b73f9659cae5f5525b940e66535a6ced4b916af9a88b3cc578 check-version.py"