temp/gtk+3.0: copy fork from v20.05 branch (MR 1546)

This commit is contained in:
Oliver Smith 2020-09-04 22:10:11 +02:00
parent 428aeb4488
commit 7cf6bae884
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
7 changed files with 420 additions and 0 deletions

View file

@ -0,0 +1,38 @@
Upstreaming: https://source.puri.sm/Librem5/gtk/-/merge_requests/17
From 74c44f81ae64605765a03ba65bc413e35690532f Mon Sep 17 00:00:00 2001
From: Oliver Smith <ollieparanoid@postmarketos.org>
Date: Thu, 20 Aug 2020 14:53:06 +0200
Subject: [PATCH] gtk/meson.build: add new hdy-* files
Fix the build with meson.
---
gtk/meson.build | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/gtk/meson.build b/gtk/meson.build
index 5a0b1547d8..ffbf97b385 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -385,11 +385,18 @@ gtk_sources = files(
'gdkpixbufutils.c',
'language-names.c',
'script-names.c',
+ 'hdy-view-switcher-bar.c',
+ 'hdy-view-switcher-button.c',
+ 'hdy-view-switcher.c',
)
gtk_private_type_headers = files(
'gtkcsstypesprivate.h',
'gtktexthandleprivate.h',
+ 'hdy-style-private.h',
+ 'hdy-view-switcher-bar-private.h',
+ 'hdy-view-switcher-button-private.h',
+ 'hdy-view-switcher-private.h',
)
gtk_gir_public_headers = files(
--
2.20.1

View file

@ -0,0 +1,28 @@
diff --git a/gdk/gdkseatdefault.c b/gdk/gdkseatdefault.c
index ce4bdc82d2..9650f4b121 100644
--- a/gdk/gdkseatdefault.c
+++ b/gdk/gdkseatdefault.c
@@ -134,22 +134,9 @@ gdk_seat_default_grab (GdkSeat *seat,
if (capabilities & GDK_SEAT_CAPABILITY_ALL_POINTING)
{
- /* ALL_POINTING spans 3 capabilities; get the mask for the ones we have */
- GdkEventMask pointer_evmask = 0;
-
- /* We let tablet styli take over the pointer cursor */
- if (capabilities & (GDK_SEAT_CAPABILITY_POINTER |
- GDK_SEAT_CAPABILITY_TABLET_STYLUS))
- {
- pointer_evmask |= POINTER_EVENTS;
- }
-
- if (capabilities & GDK_SEAT_CAPABILITY_TOUCH)
- pointer_evmask |= TOUCH_EVENTS;
-
status = gdk_device_grab (priv->master_pointer, window,
GDK_OWNERSHIP_NONE, owner_events,
- pointer_evmask, cursor,
+ POINTER_EVENTS, cursor,
evtime);
}

143
temp/gtk+3.0/APKBUILD Normal file
View file

@ -0,0 +1,143 @@
# Forked from Alpine to apply Purism's patches for responsivness
pkgname=gtk+3.0
pkgver=9999_git20200616
pkgrel=2
_commit="21ecddab70544dc4421cd34247e9c7c2ef551409"
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
10-Revert-gdkseatdefault-Grab-touch-events-where-applic.patch
check-version.py
0001-gtk-meson.build-add-new-hdy-files.patch
"
builddir="$srcdir/gtk-$_commit"
prepare() {
default_prepare
# Prevent unexpected downgrade (pma#694)
for _ver in gtk_minor_version gtk_micro_version gtk_interface_age; do
sed -i "s/m4_define(\[$_ver\], \[.*\])/m4_define([$_ver], [99])/g" configure.ac
done
sed -i "s/ version: '.*',/ version: '3.99.99',/g" meson.build
sed -i "s/^gtk_interface_age = .*/gtk_interface_age = 99/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="8d2a85ad058191348927454170c8ab63dfbdfce6a7b3172824aa33b128d17b6f3de7ba85445efa658adb5d7a98d60730e014d1113b19a2f036222f32ae62bf00 gtk-21ecddab70544dc4421cd34247e9c7c2ef551409.tar.gz
e4ea76484b70bd9beb65b2964bbcff3b3f78f5f6fe70b12309a7721ca134e3735e8aaac09803f93b393a6130a703f8f346c0df89ad45d18c580dac1e0e922276 10-Revert-gdkseatdefault-Grab-touch-events-where-applic.patch
b97ccd8fb78d7c32fe91607befd6a7c0dd969fbfc9c242948fc88085133e3461583a0b18ade199b73f9659cae5f5525b940e66535a6ced4b916af9a88b3cc578 check-version.py
2464ee16e0731ad1b3a2c15cb3274bbb4ae55eab34e9c6310712003142c127efe0c342c510fe4edf399d14e33050300702432b5515954ddcb380d08aac0589c2 0001-gtk-meson.build-add-new-hdy-files.patch"

View file

@ -0,0 +1,200 @@
#!/usr/bin/env python3
import re
import sys
try:
configure_ac = sys.argv[1]
except Exception:
configure_ac = 'configure.ac'
try:
meson_build = sys.argv[2]
except Exception:
meson_build = 'meson.build'
CONFIGURE_MAJOR_VERSION_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_major_version\]
\s*
,
\s*
\[
(?P<version>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
CONFIGURE_MINOR_VERSION_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_minor_version\]
\s*
,
\s*
\[
(?P<version>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
CONFIGURE_MICRO_VERSION_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_micro_version\]
\s*
,
\s*
\[
(?P<version>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
CONFIGURE_INTERFACE_AGE_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_interface_age\]
\s*
,
\s*
\[
(?P<age>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
MESON_VERSION_RE = re.compile(
r'''
^
\s*
version
\s*
:{1}
\s*
\'{1}
(?P<major>[0-9]+)
\.{1}
(?P<minor>[0-9]+)
\.{1}
(?P<micro>[0-9]+)
\'{1}
\s*
,?
$
''',
re.UNICODE | re.VERBOSE
)
MESON_INTERFACE_AGE_RE = re.compile(
r'''
^\s*gtk_interface_age\s*={1}\s*(?P<age>[0-9]+)\s*$
''',
re.UNICODE | re.VERBOSE
)
version = {}
with open(configure_ac, 'r') as f:
line = f.readline()
while line:
res = CONFIGURE_MAJOR_VERSION_RE.match(line)
if res:
if 'major' in version:
print(f'Redefinition of major version; version is already set to {version["major"]}')
sys.exit(1)
version['major'] = res.group('version')
line = f.readline()
continue
res = CONFIGURE_MINOR_VERSION_RE.match(line)
if res:
if 'minor' in version:
print(f'Redefinition of minor version; version is already set to {version["minor"]}')
sys.exit(1)
version['minor'] = res.group('version')
line = f.readline()
continue
res = CONFIGURE_MICRO_VERSION_RE.match(line)
if res:
if 'micro' in version:
print(f'Redefinition of micro version; version is already set to {version["micro"]}')
sys.exit(1)
version['micro'] = res.group('version')
line = f.readline()
continue
res = CONFIGURE_INTERFACE_AGE_RE.match(line)
if res:
if 'age' in version:
print(f'Redefinition of interface age; age is already set to {version["age"]}')
sys.exit(1)
version['age'] = res.group('age')
line = f.readline()
continue
if ('major', 'minor', 'micro', 'age') in version:
break
line = f.readline()
print(f'GTK version defined in {configure_ac}: {version["major"]}.{version["minor"]}.{version["micro"]} (age: {version["age"]})')
configure_version = version
version = {}
with open(meson_build, 'r') as f:
line = f.readline()
inside_project = False
while line:
if line.startswith('project('):
inside_project = True
if inside_project:
res = MESON_VERSION_RE.match(line)
if res:
version['major'] = res.group('major')
version['minor'] = res.group('minor')
version['micro'] = res.group('micro')
if inside_project and line.endswith(')'):
inside_project = False
res = MESON_INTERFACE_AGE_RE.match(line)
if res:
version['age'] = res.group('age')
if ('major', 'minor', 'micro', 'age') in version:
break
line = f.readline()
print(f'GTK version defined in {meson_build}: {version["major"]}.{version["minor"]}.{version["micro"]} (age: {version["age"]})')
meson_version = version
if configure_version != meson_version:
print('Version mismatch between Autotools and Meson builds')
sys.exit(1)
sys.exit(0)

View file

@ -0,0 +1,5 @@
#!/bin/sh
rm -f etc/gtk-3.0/gtk.immodules
rm -f etc/gtk-3.0/gdk-pixbuf.loaders

View file

@ -0,0 +1,5 @@
#!/bin/sh
usr/bin/gtk-query-immodules-3.0 > etc/gtk-3.0/gtk.immodules
usr/bin/gdk-pixbuf-query-loaders > etc/gtk-3.0/gdk-pixbuf.loaders

View file

@ -0,0 +1 @@
gtk+3.0.post-install