public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: gui-libs/gtk/files/, gui-libs/gtk/
@ 2021-08-29 20:38 Matt Turner
  0 siblings, 0 replies; 5+ messages in thread
From: Matt Turner @ 2021-08-29 20:38 UTC (permalink / raw
  To: gentoo-commits

commit:     9d5cf21a1ba1c177b39a06ef673ccc8a6fd1744e
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 29 20:35:08 2021 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sun Aug 29 20:37:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d5cf21a

gui-libs/gtk: Add patch to avoid sassc dependency

Closes: https://bugs.gentoo.org/810889
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 ...-Fix-detection-for-pre-compiled-css-files.patch | 29 ++++++++++++++++++++++
 gui-libs/gtk/gtk-4.4.0.ebuild                      |  4 +++
 2 files changed, 33 insertions(+)

diff --git a/gui-libs/gtk/files/4.4.0-build-Fix-detection-for-pre-compiled-css-files.patch b/gui-libs/gtk/files/4.4.0-build-Fix-detection-for-pre-compiled-css-files.patch
new file mode 100644
index 00000000000..1292e85cefa
--- /dev/null
+++ b/gui-libs/gtk/files/4.4.0-build-Fix-detection-for-pre-compiled-css-files.patch
@@ -0,0 +1,29 @@
+From 552a4b2c82f41c1dbba410b825673cf67d089b68 Mon Sep 17 00:00:00 2001
+From: Kalev Lember <klember@redhat.com>
+Date: Mon, 23 Aug 2021 15:38:46 +0200
+Subject: [PATCH] build: Fix detection for pre-compiled css files
+
+The default theme changed from Adwaita to Default and this tripped up
+the logic to detect if the tarball builds contain pre-built css files or
+not. Fix this by looking at pre-compiled css files in themes/Default/
+instead of themes/Adwaita/.
+---
+ gtk/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gtk/meson.build b/gtk/meson.build
+index fa66764c50..bfb5105fe5 100644
+--- a/gtk/meson.build
++++ b/gtk/meson.build
+@@ -842,7 +842,7 @@ gtk_gresources_xml = configure_file(output: 'gtk.gresources.xml',
+ 
+ theme_deps = []
+ # For git checkouts, but not for tarballs...
+-if not fs.exists('theme/Adwaita/Adwaita.css')
++if not fs.exists('theme/Default/Default-light.css')
+   # ... build the theme files
+   sassc = find_program('sassc', required: false)
+   if not sassc.found()
+-- 
+2.31.1
+

diff --git a/gui-libs/gtk/gtk-4.4.0.ebuild b/gui-libs/gtk/gtk-4.4.0.ebuild
index 231c1298890..f0a65fdf2fe 100644
--- a/gui-libs/gtk/gtk-4.4.0.ebuild
+++ b/gui-libs/gtk/gtk-4.4.0.ebuild
@@ -90,6 +90,10 @@ BDEPEND="
 	)
 "
 
+PATCHES=(
+	"${FILESDIR}"/${PV}-build-Fix-detection-for-pre-compiled-css-files.patch
+)
+
 src_configure() {
 	local emesonargs=(
 		# GDK backends


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: gui-libs/gtk/files/, gui-libs/gtk/
@ 2023-05-26  8:36 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2023-05-26  8:36 UTC (permalink / raw
  To: gentoo-commits

commit:     a91f6a60cc56438e3da74c9aee59b04998065426
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 26 08:25:57 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 26 08:26:16 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a91f6a60

gui-libs/gtk: backport fix for Nautilus delete (+ 2 other fixes)

- Backport Nautilus delete pane fix
- Backport crash fix
- Backport rendering fix for X11

Closes: https://bugs.gentoo.org/906649
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/gtk-4.10.3-black-screen-rendering.patch  |  37 ++++
 .../gtk/files/gtk-4.10.3-crash-css-color.patch     | 107 ++++++++++
 gui-libs/gtk/files/gtk-4.10.3-list-delete.patch    |  95 +++++++++
 gui-libs/gtk/gtk-4.10.3-r1.ebuild                  | 221 +++++++++++++++++++++
 4 files changed, 460 insertions(+)

diff --git a/gui-libs/gtk/files/gtk-4.10.3-black-screen-rendering.patch b/gui-libs/gtk/files/gtk-4.10.3-black-screen-rendering.patch
new file mode 100644
index 000000000000..0431cf2bf16a
--- /dev/null
+++ b/gui-libs/gtk/files/gtk-4.10.3-black-screen-rendering.patch
@@ -0,0 +1,37 @@
+https://gitlab.gnome.org/GNOME/gtk/-/commit/b686ce1cb62dba505120e0f1116c516662a06e30
+
+From b686ce1cb62dba505120e0f1116c516662a06e30 Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg@gnome.org>
+Date: Fri, 21 Apr 2023 10:58:19 +0200
+Subject: [PATCH] gdk/x11: Invalidate whole surface after size change
+
+The Expose events following a ConfigureNotify may arrive at
+a time that we did not resize the surface yet, making these
+expose events a no-op. Even though gsk/gtk take care of the
+window content itself, this might lead to unrendered portions
+of the window shadow.
+
+This may be seen with GSK_RENDERER=cairo and GDK_BACKEND=x11,
+attempting to tile a window (e.g. gtk4-demo) left or right.
+The window will show black rectangles or other artifacts in
+the window shadow areas that correspond to the newly painted
+portions (as the window needs to expand vertically).
+
+In order to fix this with a similar behavior to Wayland,
+consider ourselves the whole surface invalidated after resize,
+in order to ensure everything is painted from scratch.
+
+(cherry-picked from commit 24302315fb8f46be141a9eda60e8d107c84a948d)
+--- a/gdk/x11/gdksurface-x11.c
++++ b/gdk/x11/gdksurface-x11.c
+@@ -208,6 +208,8 @@ gdk_x11_surface_update_size (GdkX11Surface *self,
+       cairo_surface_set_device_scale (self->cairo_surface, scale, scale);
+     }
+ 
++  gdk_surface_invalidate_rect (surface, NULL);
++
+   return TRUE;
+ }
+ 
+-- 
+GitLab

diff --git a/gui-libs/gtk/files/gtk-4.10.3-crash-css-color.patch b/gui-libs/gtk/files/gtk-4.10.3-crash-css-color.patch
new file mode 100644
index 000000000000..df8781a73a6c
--- /dev/null
+++ b/gui-libs/gtk/files/gtk-4.10.3-crash-css-color.patch
@@ -0,0 +1,107 @@
+https://gitlab.gnome.org/GNOME/gtk/-/commit/966a23503a2e8bbb948270e06f3eb13ca4c06632
+
+From 966a23503a2e8bbb948270e06f3eb13ca4c06632 Mon Sep 17 00:00:00 2001
+From: Benjamin Otte <otte@redhat.com>
+Date: Tue, 2 May 2023 19:48:54 +0200
+Subject: [PATCH] css: Don't transition to currentColor
+
+Transition to the color that is in use instead.
+
+Fixes crashes because currentColor is not an RGBA color and
+therefor could not be queried later.
+
+Fixes #5798
+--- a/gtk/gtkcssfiltervalue.c
++++ b/gtk/gtkcssfiltervalue.c
+@@ -102,10 +102,10 @@ gtk_css_filter_clear (GtkCssFilter *filter)
+ }
+ 
+ static void
+-gtk_css_filter_init_identity (GtkCssFilter     *filter,
+-                              GtkCssFilterType  type)
++gtk_css_filter_init_identity (GtkCssFilter       *filter,
++                              const GtkCssFilter *other)
+ {
+-  switch (type)
++  switch (other->type)
+     {
+     case GTK_CSS_FILTER_BRIGHTNESS:
+       filter->brightness.value = _gtk_css_number_value_new (1, GTK_CSS_NUMBER);
+@@ -135,7 +135,7 @@ gtk_css_filter_init_identity (GtkCssFilter     *filter,
+       filter->blur.value = _gtk_css_number_value_new (0, GTK_CSS_PX);
+       break;
+     case GTK_CSS_FILTER_DROP_SHADOW:
+-      filter->drop_shadow.value = gtk_css_shadow_value_new_filter ();
++      filter->drop_shadow.value = gtk_css_shadow_value_new_filter (other->drop_shadow.value);
+       break;
+     case GTK_CSS_FILTER_NONE:
+     default:
+@@ -143,7 +143,7 @@ gtk_css_filter_init_identity (GtkCssFilter     *filter,
+       break;
+     }
+ 
+-  filter->type = type;
++  filter->type = other->type;
+ }
+ 
+ #define R 0.2126
+@@ -466,7 +466,7 @@ gtk_css_value_filter_equal (const GtkCssValue *value1,
+     {
+       GtkCssFilter filter;
+ 
+-      gtk_css_filter_init_identity (&filter, larger->filters[i].type);
++      gtk_css_filter_init_identity (&filter, &larger->filters[i]);
+ 
+       if (!gtk_css_filter_equal (&larger->filters[i], &filter))
+         {
+@@ -590,7 +590,7 @@ gtk_css_value_filter_transition (GtkCssValue *start,
+     {
+       GtkCssFilter filter;
+ 
+-      gtk_css_filter_init_identity (&filter, start->filters[i].type);
++      gtk_css_filter_init_identity (&filter, &start->filters[i]);
+       gtk_css_filter_transition (&result->filters[i],
+                                  &start->filters[i],
+                                  &filter,
+@@ -602,7 +602,7 @@ gtk_css_value_filter_transition (GtkCssValue *start,
+     {
+       GtkCssFilter filter;
+ 
+-      gtk_css_filter_init_identity (&filter, end->filters[i].type);
++      gtk_css_filter_init_identity (&filter, &end->filters[i]);
+       gtk_css_filter_transition (&result->filters[i],
+                                  &filter,
+                                  &end->filters[i],
+--- a/gtk/gtkcssshadowvalue.c
++++ b/gtk/gtkcssshadowvalue.c
+@@ -331,7 +331,7 @@ gtk_css_shadow_value_new (ShadowValue *shadows,
+ }
+ 
+ GtkCssValue *
+-gtk_css_shadow_value_new_filter (void)
++gtk_css_shadow_value_new_filter (const GtkCssValue *other)
+ {
+   ShadowValue value;
+ 
+@@ -340,7 +340,7 @@ gtk_css_shadow_value_new_filter (void)
+   value.voffset = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
+   value.radius = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
+   value.spread = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
+-  value.color = _gtk_css_color_value_new_current_color ();
++  value.color = gtk_css_value_ref (other->shadows[0].color);
+ 
+   return gtk_css_shadow_value_new (&value, 1, TRUE);
+ }
+--- a/gtk/gtkcssshadowvalueprivate.h
++++ b/gtk/gtkcssshadowvalueprivate.h
+@@ -35,7 +35,7 @@
+ G_BEGIN_DECLS
+ 
+ GtkCssValue *   gtk_css_shadow_value_new_none         (void);
+-GtkCssValue *   gtk_css_shadow_value_new_filter       (void);
++GtkCssValue *   gtk_css_shadow_value_new_filter       (const GtkCssValue        *other);
+ 
+ GtkCssValue *   gtk_css_shadow_value_parse            (GtkCssParser             *parser,
+                                                        gboolean                  box_shadow_mode);
+-- 
+GitLab

diff --git a/gui-libs/gtk/files/gtk-4.10.3-list-delete.patch b/gui-libs/gtk/files/gtk-4.10.3-list-delete.patch
new file mode 100644
index 000000000000..d46bba79d014
--- /dev/null
+++ b/gui-libs/gtk/files/gtk-4.10.3-list-delete.patch
@@ -0,0 +1,95 @@
+https://bugs.gentoo.org/906649
+https://gitlab.gnome.org/GNOME/gtk/-/issues/5707
+https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5744
+https://gitlab.gnome.org/GNOME/gtk/-/commit/4f47683710bbb4b56c286c6ee6a5c394fcf2b755
+
+From 4f47683710bbb4b56c286c6ee6a5c394fcf2b755 Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen@redhat.com>
+Date: Wed, 29 Mar 2023 02:23:46 +0000
+Subject: [PATCH] Merge branch 'wip/otte/trelistmodel-fixage' into 'main'
+
+treelistmodel: Don't add items in reverse
+
+Closes #5707
+
+See merge request GNOME/gtk!5744
+
+(cherry picked from commit c5a53f235a2ed1b0acd0a8c29153e62377262d04)
+
+1718db14 treelistmodel: Don't add items in reverse
+cd860beb Add a test for splicing treelistmodel
+--- a/gtk/gtktreelistmodel.c
++++ b/gtk/gtktreelistmodel.c
+@@ -357,7 +357,7 @@ gtk_tree_list_model_items_changed_cb (GListModel *model,
+     }
+ 
+   tree_added = added;
+-  for (i = 0; i < added; i++)
++  for (i = added; i-- > 0;)
+     {
+       child = gtk_rb_tree_insert_before (node->children, child);
+       child->parent = node;
+--- a/testsuite/gtk/treelistmodel.c
++++ b/testsuite/gtk/treelistmodel.c
+@@ -261,6 +261,51 @@ test_remove_some (void)
+   g_object_unref (tree);
+ }
+ 
++static void
++splice (GListStore *store,
++        guint       pos,
++        guint       removed,
++        guint      *numbers,
++        guint       added)
++{
++  GObject **objects = g_newa (GObject *, added);
++  guint i;
++
++  for (i = 0; i < added; i++)
++    {
++      /* 0 cannot be differentiated from NULL, so don't use it */
++      g_assert_cmpint (numbers[i], !=, 0);
++      objects[i] = g_object_new (G_TYPE_OBJECT, NULL);
++      g_object_set_qdata (objects[i], number_quark, GUINT_TO_POINTER (numbers[i]));
++    }
++
++  g_list_store_splice (store, pos, removed, (gpointer *) objects, added);
++
++  for (i = 0; i < added; i++)
++    g_object_unref (objects[i]);
++}
++
++static void
++test_splice (void)
++{
++  GtkTreeListModel *tree = new_model (100, TRUE);
++  gpointer item;
++
++  assert_model (tree, "100 100 100 99 98 97 96 95 94 93 92 91 90 90 89 88 87 86 85 84 83 82 81 80 80 79 78 77 76 75 74 73 72 71 70 70 69 68 67 66 65 64 63 62 61 60 60 59 58 57 56 55 54 53 52 51 50 50 49 48 47 46 45 44 43 42 41 40 40 39 38 37 36 35 34 33 32 31 30 30 29 28 27 26 25 24 23 22 21 20 20 19 18 17 16 15 14 13 12 11 10 10 9 8 7 6 5 4 3 2 1");
++  assert_changes (tree, "");
++
++  item = g_list_model_get_item (G_LIST_MODEL (tree), 1);
++  g_assert_true (G_IS_LIST_MODEL (item));
++  splice (item, 0, 5, (guint[5]) { 300, 301, 302, 303, 304 }, 5);
++  /* expected */
++  assert_model (tree, "100 100 300 301 302 303 304 95 94 93 92 91 90 90 89 88 87 86 85 84 83 82 81 80 80 79 78 77 76 75 74 73 72 71 70 70 69 68 67 66 65 64 63 62 61 60 60 59 58 57 56 55 54 53 52 51 50 50 49 48 47 46 45 44 43 42 41 40 40 39 38 37 36 35 34 33 32 31 30 30 29 28 27 26 25 24 23 22 21 20 20 19 18 17 16 15 14 13 12 11 10 10 9 8 7 6 5 4 3 2 1");
++  /* real outcome */
++  // assert_model (tree, "100 100 304 303 302 301 300 95 94 93 92 91 90 90 89 88 87 86 85 84 83 82 81 80 80 79 78 77 76 75 74 73 72 71 70 70 69 68 67 66 65 64 63 62 61 60 60 59 58 57 56 55 54 53 52 51 50 50 49 48 47 46 45 44 43 42 41 40 40 39 38 37 36 35 34 33 32 31 30 30 29 28 27 26 25 24 23 22 21 20 20 19 18 17 16 15 14 13 12 11 10 10 9 8 7 6 5 4 3 2 1");
++  assert_changes (tree, "2-5+5");
++
++  g_object_unref (tree);
++}
++
+ /* Test for https://gitlab.gnome.org/GNOME/gtk/-/issues/4595 */
+ typedef struct _DemoNode DemoNode;
+ 
+@@ -391,6 +436,7 @@ main (int argc, char *argv[])
+ 
+   g_test_add_func ("/treelistmodel/expand", test_expand);
+   g_test_add_func ("/treelistmodel/remove_some", test_remove_some);
++  g_test_add_func ("/treelistmodel/remove_splice", test_splice);
+   g_test_add_func ("/treelistmodel/collapse-change", test_collapse_change);
+ 
+   return g_test_run ();
+-- 
+GitLab

diff --git a/gui-libs/gtk/gtk-4.10.3-r1.ebuild b/gui-libs/gtk/gtk-4.10.3-r1.ebuild
new file mode 100644
index 000000000000..c3401a156233
--- /dev/null
+++ b/gui-libs/gtk/gtk-4.10.3-r1.ebuild
@@ -0,0 +1,221 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+inherit gnome.org gnome2-utils meson optfeature python-any-r1 virtualx xdg
+
+DESCRIPTION="GTK is a multi-platform toolkit for creating graphical user interfaces"
+HOMEPAGE="https://www.gtk.org/ https://gitlab.gnome.org/GNOME/gtk/"
+
+LICENSE="LGPL-2+"
+SLOT="4"
+IUSE="aqua broadway cloudproviders colord cups examples ffmpeg gstreamer +introspection sysprof test vulkan wayland +X cpu_flags_x86_f16c"
+REQUIRED_USE="
+	|| ( aqua wayland X )
+	test? ( introspection )
+"
+
+KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+
+COMMON_DEPEND="
+	>=dev-libs/glib-2.72.0:2
+	>=x11-libs/cairo-1.17.6[aqua?,glib,svg(+),X?]
+	>=x11-libs/pango-1.50.0[introspection?]
+	>=dev-libs/fribidi-1.0.6
+	>=media-libs/harfbuzz-2.6.0:=
+	>=x11-libs/gdk-pixbuf-2.30:2[introspection?]
+	media-libs/libpng:=
+	media-libs/tiff:=
+	media-libs/libjpeg-turbo:=
+	>=media-libs/libepoxy-1.4[egl,X(+)?]
+	>=media-libs/graphene-1.10.0[introspection?]
+	app-text/iso-codes
+	x11-misc/shared-mime-info
+
+	cloudproviders? ( net-libs/libcloudproviders )
+	colord? ( >=x11-misc/colord-0.1.9:0= )
+	cups? ( >=net-print/cups-2.0 )
+	ffmpeg? ( media-video/ffmpeg:= )
+	gstreamer? (
+		>=media-libs/gst-plugins-bad-1.12.3:1.0
+		>=media-libs/gst-plugins-base-1.12.3:1.0[opengl]
+	)
+	introspection? ( >=dev-libs/gobject-introspection-1.72:= )
+	vulkan? ( media-libs/vulkan-loader:= )
+	wayland? (
+		>=dev-libs/wayland-1.21.0
+		>=dev-libs/wayland-protocols-1.25
+		media-libs/mesa[wayland]
+		>=x11-libs/libxkbcommon-0.2
+	)
+	X? (
+		>=app-accessibility/at-spi2-core-2.46.0
+		media-libs/fontconfig
+		media-libs/mesa[X(+)]
+		x11-libs/libX11
+		>=x11-libs/libXi-1.8
+		x11-libs/libXext
+		>=x11-libs/libXrandr-1.5
+		x11-libs/libXcursor
+		x11-libs/libXfixes
+		x11-libs/libXdamage
+		x11-libs/libXinerama
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sysprof? ( >=dev-util/sysprof-capture-3.40.1:4 )
+	X? ( x11-base/xorg-proto )
+"
+RDEPEND="${COMMON_DEPEND}
+	>=dev-util/gtk-update-icon-cache-3
+"
+# librsvg for svg icons (PDEPEND to avoid circular dep), bug #547710
+PDEPEND="
+	gnome-base/librsvg
+	>=x11-themes/adwaita-icon-theme-3.14
+"
+BDEPEND="
+	dev-libs/gobject-introspection-common
+	introspection? (
+		${PYTHON_DEPS}
+		$(python_gen_any_dep '
+			dev-python/pygobject:3[${PYTHON_USEDEP}]
+		')
+	)
+	dev-python/docutils
+	>=dev-util/gdbus-codegen-2.48
+	dev-util/glib-utils
+	>=sys-devel/gettext-0.19.7
+	virtual/pkgconfig
+	test? (
+		dev-libs/glib:2
+		media-fonts/cantarell
+		wayland? ( dev-libs/weston[headless] )
+	)
+"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-list-delete.patch
+	"${FILESDIR}"/${P}-crash-css-color.patch
+	"${FILESDIR}"/${P}-black-screen-rendering.patch
+)
+
+python_check_deps() {
+	python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" || return
+}
+
+pkg_setup() {
+	use introspection && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+	default
+	xdg_environment_reset
+
+	# Nothing should use gtk4-update-icon-cache and an unversioned one is shipped by dev-util/gtk-update-icon-cache
+	sed -i -e '/gtk4-update-icon-cache/d' tools/meson.build || die
+	# Workaround RWX ELF sections, https://gitlab.gnome.org/GNOME/gtk/-/issues/4598
+	sed -i -e 's/^ld =.*/ld = disabler()/g' gtk/meson.build demos/gtk-demo/meson.build demos/widget-factory/meson.build || die
+	sed -i -e 's/^objcopy =.*/objcopy = disabler()/g' gtk/meson.build demos/gtk-demo/meson.build demos/widget-factory/meson.build || die
+}
+
+src_configure() {
+	local emesonargs=(
+		# GDK backends
+		$(meson_use X x11-backend)
+		$(meson_use wayland wayland-backend)
+		$(meson_use broadway broadway-backend)
+		-Dwin32-backend=false
+		$(meson_use aqua macos-backend)
+
+		# Media backends
+		$(meson_feature ffmpeg media-ffmpeg)
+		$(meson_feature gstreamer media-gstreamer)
+
+		# Print backends
+		-Dprint-cpdb=disabled
+		$(meson_feature cups print-cups)
+
+		# Optional dependencies
+		$(meson_feature vulkan)
+		$(meson_feature cloudproviders)
+		$(meson_feature sysprof)
+		-Dtracker=disabled  # tracker3 is not packaged in Gentoo yet
+		$(meson_feature colord)
+		# Expected to fail with GCC < 11
+		# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71993
+		$(meson_feature cpu_flags_x86_f16c f16c)
+
+		# Documentation and introspection
+		-Dgtk_doc=false # we ship pregenerated API docs from tarball
+		-Dupdate_screenshots=false
+		-Dman-pages=true
+		$(meson_feature introspection)
+
+		# Demos and binaries
+		$(meson_use test build-testsuite)
+		$(meson_use examples build-examples)
+		$(meson_use examples demos)
+		-Dbuild-tests=false
+	)
+	meson_src_configure
+}
+
+src_test() {
+	"${BROOT}${GLIB_COMPILE_SCHEMAS}" --allow-any-name "${S}/gtk" || die
+
+	if use X; then
+		einfo "Running tests under X"
+		GSETTINGS_SCHEMA_DIR="${S}/gtk" virtx meson_src_test --setup=x11 --timeout-multiplier=130
+	fi
+
+	if use wayland; then
+		einfo "Running tests under Weston"
+
+		export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
+
+		weston --backend=headless-backend.so --socket=wayland-5 --idle-time=0 &
+		compositor=$!
+		export WAYLAND_DISPLAY=wayland-5
+
+		GSETTINGS_SCHEMA_DIR="${S}/gtk" meson_src_test --setup=wayland --timeout-multiplier=130
+
+		exit_code=$?
+		kill ${compositor}
+	fi
+}
+
+src_install() {
+	meson_src_install
+
+	insinto /usr/share/gtk-doc/html
+	# This will install API docs specific to X11 and wayland regardless of USE flags, but this is intentional
+	doins -r "${S}"/docs/reference/{gtk/gtk4,gsk/gsk4,gdk/gdk4{,-wayland,-x11}}
+}
+
+pkg_preinst() {
+	xdg_pkg_preinst
+	gnome2_schemas_savelist
+}
+
+pkg_postinst() {
+	xdg_pkg_postinst
+	gnome2_schemas_update
+
+	if ! has_version "app-text/evince"; then
+		elog "Please install app-text/evince for print preview functionality."
+		elog "Alternatively, check \"gtk-print-preview-command\" documentation and"
+		elog "add it to your settings.ini file."
+	fi
+
+	if use examples ; then
+		optfeature "syntax highlighting in gtk4-demo" app-text/highlight
+	fi
+}
+
+pkg_postrm() {
+	xdg_pkg_postrm
+	gnome2_schemas_update
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: gui-libs/gtk/files/, gui-libs/gtk/
@ 2023-07-16 14:30 Matt Turner
  0 siblings, 0 replies; 5+ messages in thread
From: Matt Turner @ 2023-07-16 14:30 UTC (permalink / raw
  To: gentoo-commits

commit:     b69099c78014c15933043371cc3b4adb10d8d3bc
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 16 14:28:24 2023 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sun Jul 16 14:30:16 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b69099c7

gui-libs/gtk: Fix unaligned accesses

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 ...4.10.4-gtk-Align-key_size-up-to-key_align.patch |  50 +++++++
 ...gtk-Pass-G_ALIGNOF-.-to-gtk_sort_keys_new.patch | 160 +++++++++++++++++++++
 gui-libs/gtk/gtk-4.10.4.ebuild                     |   5 +
 3 files changed, 215 insertions(+)

diff --git a/gui-libs/gtk/files/4.10.4-gtk-Align-key_size-up-to-key_align.patch b/gui-libs/gtk/files/4.10.4-gtk-Align-key_size-up-to-key_align.patch
new file mode 100644
index 000000000000..388c8011344f
--- /dev/null
+++ b/gui-libs/gtk/files/4.10.4-gtk-Align-key_size-up-to-key_align.patch
@@ -0,0 +1,50 @@
+From a3582031576783fbc644fdd2ad914820d0ba4863 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Mon, 19 Jun 2023 15:50:04 -0400
+Subject: [PATCH] gtk: Align key_size up to key_align
+
+Avoids unaligned accesses when e.g. the key_size is 12 and key_align is
+8. We need to round the key size up to 16 to ensure that all keys are
+appropriately aligned.
+
+This manifested as a failure in the `gtk:gtk / sorter` unit test on
+sparc.
+
+Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5907
+(cherry picked from commit 3f360aa883dc51ad986c721be01b494020e5ac9d)
+---
+ gtk/gtkmultisorter.c   | 3 ++-
+ gtk/gtksortlistmodel.c | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/gtk/gtkmultisorter.c b/gtk/gtkmultisorter.c
+index ddbdb440cb..e8744015af 100644
+--- a/gtk/gtkmultisorter.c
++++ b/gtk/gtkmultisorter.c
+@@ -186,7 +186,8 @@ gtk_multi_sort_keys_new (GtkMultiSorter *self)
+     {
+       result->keys[i].keys = gtk_sorter_get_keys (gtk_sorters_get (&self->sorters, i));
+       result->keys[i].offset = GTK_SORT_KEYS_ALIGN (keys->key_size, gtk_sort_keys_get_key_align (result->keys[i].keys));
+-      keys->key_size = result->keys[i].offset + gtk_sort_keys_get_key_size (result->keys[i].keys);
++      keys->key_size = result->keys[i].offset + GTK_SORT_KEYS_ALIGN (gtk_sort_keys_get_key_size (result->keys[i].keys),
++                                                                     gtk_sort_keys_get_key_align (result->keys[i].keys));
+       keys->key_align = MAX (keys->key_align, gtk_sort_keys_get_key_align (result->keys[i].keys));
+     }
+ 
+diff --git a/gtk/gtksortlistmodel.c b/gtk/gtksortlistmodel.c
+index c2feb9e250..44414c1fd4 100644
+--- a/gtk/gtksortlistmodel.c
++++ b/gtk/gtksortlistmodel.c
+@@ -439,7 +439,8 @@ gtk_sort_list_model_create_keys (GtkSortListModel *self)
+   g_assert (self->key_size == 0);
+ 
+   self->sort_keys = gtk_sorter_get_keys (self->sorter);
+-  self->key_size = gtk_sort_keys_get_key_size (self->sort_keys);
++  self->key_size = GTK_SORT_KEYS_ALIGN (gtk_sort_keys_get_key_size (self->sort_keys),
++                                        gtk_sort_keys_get_key_align (self->sort_keys));
+   self->keys = g_malloc_n (self->n_items, self->key_size);
+   self->missing_keys = gtk_bitset_new_range (0, self->n_items);
+ }
+-- 
+2.41.0
+

diff --git a/gui-libs/gtk/files/4.10.4-gtk-Pass-G_ALIGNOF-.-to-gtk_sort_keys_new.patch b/gui-libs/gtk/files/4.10.4-gtk-Pass-G_ALIGNOF-.-to-gtk_sort_keys_new.patch
new file mode 100644
index 000000000000..3cfe54078c03
--- /dev/null
+++ b/gui-libs/gtk/files/4.10.4-gtk-Pass-G_ALIGNOF-.-to-gtk_sort_keys_new.patch
@@ -0,0 +1,160 @@
+From 00cdaba5a89eedb6f7334bdfa523e374e5dc4b12 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Mon, 19 Jun 2023 15:47:17 -0400
+Subject: [PATCH] gtk: Pass G_ALIGNOF (...) to gtk_sort_keys_new
+
+The sizeof and G_ALIGNOF are often, but not always, identical.
+
+(cherry picked from commit a4440453868ebe7c87d0a69de9609b33a688a8bb)
+---
+ gtk/gtknumericsorter.c     | 22 +++++++++++-----------
+ gtk/gtksorter.c            |  2 +-
+ gtk/gtkstringsorter.c      |  2 +-
+ gtk/gtktreelistrowsorter.c |  2 +-
+ 4 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/gtk/gtknumericsorter.c b/gtk/gtknumericsorter.c
+index 4f474ad14d..f66d5ff505 100644
+--- a/gtk/gtknumericsorter.c
++++ b/gtk/gtknumericsorter.c
+@@ -227,7 +227,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
+                                                       ? &GTK_ASCENDING_BOOLEAN_SORT_KEYS_CLASS
+                                                       : &GTK_DESCENDING_BOOLEAN_SORT_KEYS_CLASS,
+                                   sizeof (char),
+-                                  sizeof (char));
++                                  G_ALIGNOF (char));
+       break;
+ 
+     case G_TYPE_CHAR:
+@@ -236,7 +236,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
+                                                       ? &GTK_ASCENDING_CHAR_SORT_KEYS_CLASS
+                                                       : &GTK_DESCENDING_CHAR_SORT_KEYS_CLASS,
+                                   sizeof (char),
+-                                  sizeof (char));
++                                  G_ALIGNOF (char));
+       break;
+ 
+     case G_TYPE_UCHAR:
+@@ -245,7 +245,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
+                                                       ? &GTK_ASCENDING_UCHAR_SORT_KEYS_CLASS
+                                                       : &GTK_DESCENDING_UCHAR_SORT_KEYS_CLASS,
+                                   sizeof (guchar),
+-                                  sizeof (guchar));
++                                  G_ALIGNOF (guchar));
+       break;
+ 
+     case G_TYPE_INT:
+@@ -254,7 +254,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
+                                                       ? &GTK_ASCENDING_INT_SORT_KEYS_CLASS
+                                                       : &GTK_DESCENDING_INT_SORT_KEYS_CLASS,
+                                   sizeof (int),
+-                                  sizeof (int));
++                                  G_ALIGNOF (int));
+       break;
+ 
+     case G_TYPE_UINT:
+@@ -263,7 +263,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
+                                                       ? &GTK_ASCENDING_UINT_SORT_KEYS_CLASS
+                                                       : &GTK_DESCENDING_UINT_SORT_KEYS_CLASS,
+                                   sizeof (guint),
+-                                  sizeof (guint));
++                                  G_ALIGNOF (guint));
+       break;
+ 
+     case G_TYPE_FLOAT:
+@@ -272,7 +272,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
+                                                       ? &GTK_ASCENDING_FLOAT_SORT_KEYS_CLASS
+                                                       : &GTK_DESCENDING_FLOAT_SORT_KEYS_CLASS,
+                                   sizeof (float),
+-                                  sizeof (float));
++                                  G_ALIGNOF (float));
+       break;
+ 
+     case G_TYPE_DOUBLE:
+@@ -281,7 +281,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
+                                                       ? &GTK_ASCENDING_DOUBLE_SORT_KEYS_CLASS
+                                                       : &GTK_DESCENDING_DOUBLE_SORT_KEYS_CLASS,
+                                   sizeof (double),
+-                                  sizeof (double));
++                                  G_ALIGNOF (double));
+       break;
+ 
+     case G_TYPE_LONG:
+@@ -290,7 +290,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
+                                                       ? &GTK_ASCENDING_LONG_SORT_KEYS_CLASS
+                                                       : &GTK_DESCENDING_LONG_SORT_KEYS_CLASS,
+                                   sizeof (long),
+-                                  sizeof (long));
++                                  G_ALIGNOF (long));
+       break;
+ 
+     case G_TYPE_ULONG:
+@@ -299,7 +299,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
+                                                       ? &GTK_ASCENDING_ULONG_SORT_KEYS_CLASS
+                                                       : &GTK_DESCENDING_ULONG_SORT_KEYS_CLASS,
+                                   sizeof (gulong),
+-                                  sizeof (gulong));
++                                  G_ALIGNOF (gulong));
+       break;
+ 
+     case G_TYPE_INT64:
+@@ -308,7 +308,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
+                                                       ? &GTK_ASCENDING_INT64_SORT_KEYS_CLASS
+                                                       : &GTK_DESCENDING_INT64_SORT_KEYS_CLASS,
+                                   sizeof (gint64),
+-                                  sizeof (gint64));
++                                  G_ALIGNOF (gint64));
+       break;
+ 
+     case G_TYPE_UINT64:
+@@ -317,7 +317,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
+                                                       ? &GTK_ASCENDING_UINT64_SORT_KEYS_CLASS
+                                                       : &GTK_DESCENDING_UINT64_SORT_KEYS_CLASS,
+                                   sizeof (guint64),
+-                                  sizeof (guint64));
++                                  G_ALIGNOF (guint64));
+       break;
+ 
+     default:
+diff --git a/gtk/gtksorter.c b/gtk/gtksorter.c
+index 2de29554ec..18bf950cf6 100644
+--- a/gtk/gtksorter.c
++++ b/gtk/gtksorter.c
+@@ -304,7 +304,7 @@ gtk_sorter_get_keys (GtkSorter *self)
+   if (priv->keys)
+     return gtk_sort_keys_ref (priv->keys);
+ 
+-  fallback = gtk_sort_keys_new (GtkDefaultSortKeys, &GTK_DEFAULT_SORT_KEYS_CLASS, sizeof (gpointer), sizeof (gpointer));
++  fallback = gtk_sort_keys_new (GtkDefaultSortKeys, &GTK_DEFAULT_SORT_KEYS_CLASS, sizeof (gpointer), G_ALIGNOF (gpointer));
+   fallback->sorter = g_object_ref (self);
+ 
+   return (GtkSortKeys *) fallback;
+diff --git a/gtk/gtkstringsorter.c b/gtk/gtkstringsorter.c
+index 70739509e2..17c46b4436 100644
+--- a/gtk/gtkstringsorter.c
++++ b/gtk/gtkstringsorter.c
+@@ -234,7 +234,7 @@ gtk_string_sort_keys_new (GtkStringSorter *self)
+   result = gtk_sort_keys_new (GtkStringSortKeys,
+                               &GTK_STRING_SORT_KEYS_CLASS,
+                               sizeof (char *),
+-                              sizeof (char *));
++                              G_ALIGNOF (char *));
+ 
+   result->expression = gtk_expression_ref (self->expression);
+   result->ignore_case = self->ignore_case;
+diff --git a/gtk/gtktreelistrowsorter.c b/gtk/gtktreelistrowsorter.c
+index d7932cb067..6503948a89 100644
+--- a/gtk/gtktreelistrowsorter.c
++++ b/gtk/gtktreelistrowsorter.c
+@@ -350,7 +350,7 @@ gtk_tree_list_row_sort_keys_new (GtkTreeListRowSorter *self)
+   result = gtk_sort_keys_new (GtkTreeListRowSortKeys,
+                               &GTK_TREE_LIST_ROW_SORT_KEYS_CLASS,
+                               sizeof (gpointer[MAX_KEY_DEPTH]),
+-                              sizeof (gpointer[MAX_KEY_DEPTH]));
++                              G_ALIGNOF (gpointer));
+ 
+   if (self->sorter)
+     result->sort_keys = gtk_sorter_get_keys (self->sorter);
+-- 
+2.41.0
+

diff --git a/gui-libs/gtk/gtk-4.10.4.ebuild b/gui-libs/gtk/gtk-4.10.4.ebuild
index 5624e17877cc..79ae3bf49fc8 100644
--- a/gui-libs/gtk/gtk-4.10.4.ebuild
+++ b/gui-libs/gtk/gtk-4.10.4.ebuild
@@ -96,6 +96,11 @@ BDEPEND="
 	)
 "
 
+PATCHES=(
+	"${FILESDIR}"/${PV}-gtk-Pass-G_ALIGNOF-.-to-gtk_sort_keys_new.patch
+	"${FILESDIR}"/${PV}-gtk-Align-key_size-up-to-key_align.patch
+)
+
 python_check_deps() {
 	python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" || return
 }


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: gui-libs/gtk/files/, gui-libs/gtk/
@ 2024-08-02  0:38 Eli Schwartz
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Schwartz @ 2024-08-02  0:38 UTC (permalink / raw
  To: gentoo-commits

commit:     78658acbd51f6965cd11fd39dc3e9877f23cf221
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Thu Jun 20 03:03:40 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Fri Aug  2 00:36:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78658acb

gui-libs/gtk: add a "poison" macro support to disable X/wayland

Many packages perform automagic dependencies on gdk's backend
implementations by checking if the macro is defined and then using the
code it unlocks, rather than having a buildsystem option such as
-Dwayland=true.

It's unfeasible to patch every such package's source code to add
configure options and respect them. Instead add a truly filthy hack and
permit gtk itself to selectively show or hide the windowing system in
use.

Bug: https://bugs.gentoo.org/624960
Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/37259
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 ...add-a-poison-macro-to-hide-GDK_WINDOWING_.patch | 91 ++++++++++++++++++++++
 .../{gtk-4.14.3.ebuild => gtk-4.12.5-r2.ebuild}    | 49 +++++-------
 .../{gtk-4.14.3.ebuild => gtk-4.14.3-r1.ebuild}    |  8 ++
 .../{gtk-4.14.4.ebuild => gtk-4.14.4-r1.ebuild}    |  8 ++
 4 files changed, 126 insertions(+), 30 deletions(-)

diff --git a/gui-libs/gtk/files/0001-gdk-add-a-poison-macro-to-hide-GDK_WINDOWING_.patch b/gui-libs/gtk/files/0001-gdk-add-a-poison-macro-to-hide-GDK_WINDOWING_.patch
new file mode 100644
index 000000000000..652e9e116339
--- /dev/null
+++ b/gui-libs/gtk/files/0001-gdk-add-a-poison-macro-to-hide-GDK_WINDOWING_.patch
@@ -0,0 +1,91 @@
+From 0537043f72ea1a634b101efa9e11cc0a22baaf71 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Wed, 19 Jun 2024 21:28:31 -0400
+Subject: [PATCH] gdk: add a "poison" macro to hide GDK_WINDOWING_*
+
+Many packages perform automagic dependencies on gdk's backend
+implementations by checking if the macro is defined and then using the
+code it unlocks, rather than having a buildsystem option such as
+-Dwayland=true.
+
+It's unfeasible to patch every such package's source code to add
+configure options and respect them. Instead add a truly filthy hack and
+permit gtk itself to selectively show or hide the windowing system in
+use.
+
+By default, we assume this macro is never defined. It should only ever
+be defined inside an ebuild, as such:
+
+```
+use wayland || append-cflags -DGENTOO_GTK_HIDE_WAYLAND
+use X || append-cflags -DGENTOO_GTK_HIDE_X11
+```
+
+When seen, this will prevent code using "#ifdef GDK_WINDOWING_*" from
+seeing the define, so the automagic dependency won't be picked up. It
+will also cause any attempt to #include the backend-specific headers to
+bug out.
+
+Bug: https://bugs.gentoo.org/624960
+Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
+---
+ gdk/gdkconfig.h.meson    | 7 +++++++
+ gdk/wayland/gdkwayland.h | 4 ++++
+ gdk/x11/gdkx.h           | 4 ++++
+ 3 files changed, 15 insertions(+)
+
+diff --git a/gdk/gdkconfig.h.meson b/gdk/gdkconfig.h.meson
+index d5b48f3184..22baab52ae 100644
+--- a/gdk/gdkconfig.h.meson
++++ b/gdk/gdkconfig.h.meson
+@@ -10,10 +10,17 @@
+ G_BEGIN_DECLS
+ 
+ 
++#ifndef GENTOO_GTK_HIDE_X11
+ #mesondefine GDK_WINDOWING_X11
++#endif
++
+ #mesondefine GDK_WINDOWING_BROADWAY
+ #mesondefine GDK_WINDOWING_MACOS
++
++#ifndef GENTOO_GTK_HIDE_WAYLAND
+ #mesondefine GDK_WINDOWING_WAYLAND
++#endif
++
+ #mesondefine GDK_WINDOWING_WIN32
+ 
+ #mesondefine GDK_RENDERING_CAIRO
+diff --git a/gdk/wayland/gdkwayland.h b/gdk/wayland/gdkwayland.h
+index 846445910e..5d84619295 100644
+--- a/gdk/wayland/gdkwayland.h
++++ b/gdk/wayland/gdkwayland.h
+@@ -24,6 +24,10 @@
+ 
+ #pragma once
+ 
++#ifdef GENTOO_GTK_HIDE_WAYLAND
++  #error "A Gentoo ebuild has hidden wayland and it cannot be used in this compilation unit. Please file a bug if you see this error."
++#endif
++
+ #include <gdk/gdk.h>
+ 
+ #define __GDKWAYLAND_H_INSIDE__
+diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
+index 6bef6b6de8..d4f8b94550 100644
+--- a/gdk/x11/gdkx.h
++++ b/gdk/x11/gdkx.h
+@@ -24,6 +24,10 @@
+ 
+ #pragma once
+ 
++#ifdef GENTOO_GTK_HIDE_X11
++  #error "A Gentoo ebuild has hidden x11 and it cannot be used in this compilation unit. Please file a bug if you see this error."
++#endif
++
+ #include <gdk/gdk.h>
+ 
+ #include <X11/Xlib.h>
+-- 
+2.44.2
+

diff --git a/gui-libs/gtk/gtk-4.14.3.ebuild b/gui-libs/gtk/gtk-4.12.5-r2.ebuild
similarity index 82%
copy from gui-libs/gtk/gtk-4.14.3.ebuild
copy to gui-libs/gtk/gtk-4.12.5-r2.ebuild
index 7f0c8930ab74..aaf7a773087e 100644
--- a/gui-libs/gtk/gtk-4.14.3.ebuild
+++ b/gui-libs/gtk/gtk-4.12.5-r2.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://www.gtk.org/ https://gitlab.gnome.org/GNOME/gtk/"
 
 LICENSE="LGPL-2+"
 SLOT="4"
-IUSE="aqua broadway cloudproviders colord cups examples gstreamer +introspection sysprof test vulkan wayland +X cpu_flags_x86_f16c"
+IUSE="aqua broadway cloudproviders colord cups examples ffmpeg gstreamer +introspection sysprof test vulkan wayland +X cpu_flags_x86_f16c"
 REQUIRED_USE="
 	|| ( aqua wayland X )
 	test? ( introspection )
@@ -18,7 +18,6 @@ REQUIRED_USE="
 
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
 
-# TODO: Optional gst build dep on >=gst-plugins-base-1.23.1, so depend on it once we can
 COMMON_DEPEND="
 	>=dev-libs/glib-2.76.0:2
 	>=x11-libs/cairo-1.17.6[aqua?,glib,svg(+),X?]
@@ -37,17 +36,13 @@ COMMON_DEPEND="
 	cloudproviders? ( net-libs/libcloudproviders )
 	colord? ( >=x11-misc/colord-0.1.9:0= )
 	cups? ( >=net-print/cups-2.0 )
-	examples? ( gnome-base/librsvg:2 )
+	ffmpeg? ( media-video/ffmpeg:= )
 	gstreamer? (
-		>=media-libs/gstreamer-1.12.3:1.0
 		>=media-libs/gst-plugins-bad-1.12.3:1.0
-		|| (
-			>=media-libs/gst-plugins-base-1.12.3:1.0[gles2]
-			>=media-libs/gst-plugins-base-1.12.3:1.0[opengl]
-		)
+		>=media-libs/gst-plugins-base-1.12.3:1.0[opengl]
 	)
 	introspection? ( >=dev-libs/gobject-introspection-1.76:= )
-	vulkan? ( >=media-libs/vulkan-loader-1.3:= )
+	vulkan? ( media-libs/vulkan-loader:= )
 	wayland? (
 		>=dev-libs/wayland-1.21.0
 		>=dev-libs/wayland-protocols-1.31
@@ -55,6 +50,7 @@ COMMON_DEPEND="
 		>=x11-libs/libxkbcommon-0.2
 	)
 	X? (
+		>=app-accessibility/at-spi2-core-2.46.0
 		media-libs/fontconfig
 		media-libs/mesa[X(+)]
 		x11-libs/libX11
@@ -68,19 +64,15 @@ COMMON_DEPEND="
 	)
 "
 DEPEND="${COMMON_DEPEND}
-	kernel_linux? (
-		x11-libs/libdrm
-		sys-kernel/linux-headers
-	)
 	sysprof? ( >=dev-util/sysprof-capture-3.40.1:4 )
 	X? ( x11-base/xorg-proto )
 "
 RDEPEND="${COMMON_DEPEND}
 	>=dev-util/gtk-update-icon-cache-3
 "
-# librsvg for svg icons (PDEPEND to avoid circular dep on wd40 profiles with librsvg[tools]), bug #547710
+# librsvg for svg icons (PDEPEND to avoid circular dep), bug #547710
 PDEPEND="
-	gnome-base/librsvg:2
+	gnome-base/librsvg
 	>=x11-themes/adwaita-icon-theme-3.14
 "
 BDEPEND="
@@ -108,6 +100,14 @@ BDEPEND="
 	)
 "
 
+PATCHES=(
+	# Gentoo-specific patch to add a "poison" macro support, allowing other ebuilds
+	# with USE="-wayland -X" to trick gtk into claiming that it wasn't built with
+	# such support.
+	# https://bugs.gentoo.org/624960
+	"${FILESDIR}"/0001-gdk-add-a-poison-macro-to-hide-GDK_WINDOWING_.patch
+)
+
 python_check_deps() {
 	python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" || return
 }
@@ -147,6 +147,7 @@ src_configure() {
 		$(meson_use aqua macos-backend)
 
 		# Media backends
+		$(meson_feature ffmpeg media-ffmpeg)
 		$(meson_feature gstreamer media-gstreamer)
 
 		# Print backends
@@ -172,7 +173,7 @@ src_configure() {
 		-Dman-pages=true
 
 		# Demos, examples, and tests
-		-Dprofile=default
+		-Ddemo-profile=default
 		$(meson_use examples build-demos)
 		$(meson_use test build-testsuite)
 		$(meson_use examples build-examples)
@@ -186,13 +187,7 @@ src_test() {
 
 	if use X; then
 		einfo "Running tests under X"
-		GSETTINGS_SCHEMA_DIR="${S}/gtk" virtx meson_src_test --timeout-multiplier=130 \
-			--setup=x11 \
-			--no-suite=failing \
-			--no-suite=x11_failing \
-			--no-suite=flaky \
-			--no-suite=headless \
-			--no-suite=gsk-compare-broadway
+		GSETTINGS_SCHEMA_DIR="${S}/gtk" virtx meson_src_test --setup=x11 --timeout-multiplier=130
 	fi
 
 	if use wayland; then
@@ -204,13 +199,7 @@ src_test() {
 		compositor=$!
 		export WAYLAND_DISPLAY=wayland-5
 
-		GSETTINGS_SCHEMA_DIR="${S}/gtk" meson_src_test --timeout-multiplier=130 \
-			--setup=wayland \
-			--no-suite=failing \
-			--no-suite=wayland_failing \
-			--no-suite=flaky \
-			--no-suite=headless \
-			--no-suite=gsk-compare-broadway
+		GSETTINGS_SCHEMA_DIR="${S}/gtk" meson_src_test --setup=wayland --timeout-multiplier=130
 
 		exit_code=$?
 		kill ${compositor}

diff --git a/gui-libs/gtk/gtk-4.14.3.ebuild b/gui-libs/gtk/gtk-4.14.3-r1.ebuild
similarity index 95%
rename from gui-libs/gtk/gtk-4.14.3.ebuild
rename to gui-libs/gtk/gtk-4.14.3-r1.ebuild
index 7f0c8930ab74..00d8f5bbcaa1 100644
--- a/gui-libs/gtk/gtk-4.14.3.ebuild
+++ b/gui-libs/gtk/gtk-4.14.3-r1.ebuild
@@ -108,6 +108,14 @@ BDEPEND="
 	)
 "
 
+PATCHES=(
+	# Gentoo-specific patch to add a "poison" macro support, allowing other ebuilds
+	# with USE="-wayland -X" to trick gtk into claiming that it wasn't built with
+	# such support.
+	# https://bugs.gentoo.org/624960
+	"${FILESDIR}"/0001-gdk-add-a-poison-macro-to-hide-GDK_WINDOWING_.patch
+)
+
 python_check_deps() {
 	python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" || return
 }

diff --git a/gui-libs/gtk/gtk-4.14.4.ebuild b/gui-libs/gtk/gtk-4.14.4-r1.ebuild
similarity index 95%
rename from gui-libs/gtk/gtk-4.14.4.ebuild
rename to gui-libs/gtk/gtk-4.14.4-r1.ebuild
index 7f0c8930ab74..00d8f5bbcaa1 100644
--- a/gui-libs/gtk/gtk-4.14.4.ebuild
+++ b/gui-libs/gtk/gtk-4.14.4-r1.ebuild
@@ -108,6 +108,14 @@ BDEPEND="
 	)
 "
 
+PATCHES=(
+	# Gentoo-specific patch to add a "poison" macro support, allowing other ebuilds
+	# with USE="-wayland -X" to trick gtk into claiming that it wasn't built with
+	# such support.
+	# https://bugs.gentoo.org/624960
+	"${FILESDIR}"/0001-gdk-add-a-poison-macro-to-hide-GDK_WINDOWING_.patch
+)
+
 python_check_deps() {
 	python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" || return
 }


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: gui-libs/gtk/files/, gui-libs/gtk/
@ 2024-08-12 16:49 Eli Schwartz
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Schwartz @ 2024-08-12 16:49 UTC (permalink / raw
  To: gentoo-commits

commit:     d5e9a6d557b54cfc2495d7875c29792452900214
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 12 16:47:26 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Mon Aug 12 16:48:27 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5e9a6d5

gui-libs/gtk: backport patch to fix race conditions when building

Backported upstream in 4.14 already.

Closes: https://bugs.gentoo.org/924979
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 .../6510b876d1cb5428db4822974cdebfed209692b0.patch | 134 +++++++++++++++++++++
 gui-libs/gtk/gtk-4.12.5-r2.ebuild                  |   2 +
 2 files changed, 136 insertions(+)

diff --git a/gui-libs/gtk/files/6510b876d1cb5428db4822974cdebfed209692b0.patch b/gui-libs/gtk/files/6510b876d1cb5428db4822974cdebfed209692b0.patch
new file mode 100644
index 000000000000..0ff0398ab0c8
--- /dev/null
+++ b/gui-libs/gtk/files/6510b876d1cb5428db4822974cdebfed209692b0.patch
@@ -0,0 +1,134 @@
+From 6510b876d1cb5428db4822974cdebfed209692b0 Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen@redhat.com>
+Date: Tue, 9 Apr 2024 21:01:26 -0400
+Subject: [PATCH] build: Add a missing dependency
+
+Add the generated gdk headers to the sources for all the backends,
+to guarantee that they are generated before the library is used.
+
+Fixes: #6618
+---
+ gdk/broadway/meson.build |  3 +--
+ gdk/macos/meson.build    |  2 +-
+ gdk/meson.build          | 12 +++++++++---
+ gdk/wayland/meson.build  |  7 +------
+ gdk/win32/meson.build    |  2 +-
+ gdk/x11/meson.build      |  7 +------
+ 6 files changed, 14 insertions(+), 19 deletions(-)
+
+diff --git a/gdk/broadway/meson.build b/gdk/broadway/meson.build
+index ef7fa0ef589..f0a77b37c2d 100644
+--- a/gdk/broadway/meson.build
++++ b/gdk/broadway/meson.build
+@@ -52,8 +52,7 @@ broadwayjs_h = custom_target('broadwayjs.h',
+ )
+ 
+ libgdk_broadway = static_library('gdk-broadway',
+-  clienthtml_h, broadwayjs_h,
+-  gdk_broadway_sources, gdkconfig, gdkenum_h,
++  sources: [ clienthtml_h, broadwayjs_h, gdk_broadway_sources, gdk_gen_headers ],
+   include_directories: [confinc, gdkinc],
+   c_args: [
+     '-DGTK_COMPILATION',
+diff --git a/gdk/macos/meson.build b/gdk/macos/meson.build
+index b3baefb898e..d80334b8946 100644
+--- a/gdk/macos/meson.build
++++ b/gdk/macos/meson.build
+@@ -61,7 +61,7 @@ gdk_macos_deps = [
+ libgdk_c_args += ['-xobjective-c']
+ 
+ libgdk_macos = static_library('gdk-macos',
+-  gdk_macos_sources, gdkconfig, gdkenum_h,
++  sources: [ gdk_macos_sources, gdk_gen_headers ],
+   include_directories: [ confinc, gdkinc, ],
+   c_args: [ libgdk_c_args, common_cflags, ],
+   link_with: [],
+diff --git a/gdk/meson.build b/gdk/meson.build
+index 9c0a36e19ec..62e80ea6c44 100644
+--- a/gdk/meson.build
++++ b/gdk/meson.build
+@@ -202,7 +202,13 @@ gdkwayland_inc = include_directories('wayland')
+ wlinc = include_directories('.')
+ win32rcinc = include_directories('win32/rc')
+ 
+-gdk_gen_headers = [gdkenum_h, gdkmarshal_h, gdkconfig, gdkversionmacros_h, gdk_visibility_h]
++gdk_gen_headers = [
++  gdkenum_h,
++  gdkmarshal_h,
++  gdkconfig,
++  gdkversionmacros_h,
++  gdk_visibility_h,
++]
+ 
+ gdk_deps = [
+   libm,
+@@ -278,7 +284,7 @@ if gdk_backends.length() == 0
+ endif
+ 
+ libgdk = static_library('gdk',
+-  sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
++  sources: [gdk_sources, gdk_backends_gen_headers, gdk_gen_headers],
+   dependencies: gdk_deps + [libgtk_css_dep],
+   link_with: [libgtk_css],
+   include_directories: [confinc, gdkx11_inc, wlinc],
+@@ -290,7 +296,7 @@ libgdk = static_library('gdk',
+ # list the dependencies and generated headers and such, for use in the
+ # "public" libgtk_dep used by internal executables.
+ libgdk_dep = declare_dependency(
+-  sources: ['gdk.h', gdkconfig, gdkenum_h],
++  sources: ['gdk.h', gdk_gen_headers],
+   include_directories: [confinc, gdkx11_inc, wlinc],
+   dependencies: gdk_deps + [libgtk_css_dep],
+ )
+diff --git a/gdk/wayland/meson.build b/gdk/wayland/meson.build
+index 00e584a1053..e7c1ac34103 100644
+--- a/gdk/wayland/meson.build
++++ b/gdk/wayland/meson.build
+@@ -117,12 +117,7 @@ foreach p: proto_sources
+ endforeach
+ 
+ libgdk_wayland = static_library('gdk-wayland',
+-  sources: [
+-    gdk_wayland_sources,
+-    gdk_wayland_gen_headers,
+-    gdkconfig,
+-    gdkenum_h,
+-  ],
++  sources: [ gdk_wayland_sources, gdk_wayland_gen_headers, gdk_gen_headers ],
+   include_directories: [ confinc, gdkinc, ],
+   c_args: [
+     '-DGTK_COMPILATION',
+diff --git a/gdk/win32/meson.build b/gdk/win32/meson.build
+index 3dc16aabb6c..cc56a15d95a 100644
+--- a/gdk/win32/meson.build
++++ b/gdk/win32/meson.build
+@@ -64,7 +64,7 @@ gdk_win32_deps = [
+ ]
+ 
+ libgdk_win32 = static_library('gdk-win32',
+-  gdk_win32_sources, gdkconfig, gdkenum_h,
++  sources: [ gdk_win32_sources, gdk_gen_headers ],
+   include_directories: [ confinc, gdkinc ],
+   c_args: [
+     '-DGTK_COMPILATION',
+diff --git a/gdk/x11/meson.build b/gdk/x11/meson.build
+index 013d8b1d00c..c9aa5383ab1 100644
+--- a/gdk/x11/meson.build
++++ b/gdk/x11/meson.build
+@@ -73,12 +73,7 @@ gdk_x11_deps = [
+ ]
+ 
+ libgdk_x11 = static_library('gdk-x11',
+-  sources: [
+-    gdkmarshal_h,
+-    gdkenum_h,
+-    gdkconfig,
+-    gdk_x11_sources,
+-  ],
++  sources: [ gdk_gen_headers, gdk_x11_sources ],
+   include_directories: [ confinc, gdkinc, ],
+   c_args: [
+     '-DGTK_COMPILATION',
+-- 
+GitLab
+

diff --git a/gui-libs/gtk/gtk-4.12.5-r2.ebuild b/gui-libs/gtk/gtk-4.12.5-r2.ebuild
index ded47b8e3d93..976e4ff77b5f 100644
--- a/gui-libs/gtk/gtk-4.12.5-r2.ebuild
+++ b/gui-libs/gtk/gtk-4.12.5-r2.ebuild
@@ -106,6 +106,8 @@ PATCHES=(
 	# such support.
 	# https://bugs.gentoo.org/624960
 	"${FILESDIR}"/0001-gdk-add-a-poison-macro-to-hide-GDK_WINDOWING_.patch
+	# backport patch to fix race conditions in building generated headers
+	"${FILESDIR}"/6510b876d1cb5428db4822974cdebfed209692b0.patch
 )
 
 python_check_deps() {


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-12 16:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-29 20:38 [gentoo-commits] repo/gentoo:master commit in: gui-libs/gtk/files/, gui-libs/gtk/ Matt Turner
  -- strict thread matches above, loose matches on Subject: below --
2023-05-26  8:36 Sam James
2023-07-16 14:30 Matt Turner
2024-08-02  0:38 Eli Schwartz
2024-08-12 16:49 Eli Schwartz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox