From a5983b59397933b505cebc1ebb327f8a083c80c6 Mon Sep 17 00:00:00 2001 From: ProsperousPotato Date: Mon, 12 Jan 2026 20:33:44 +0000 Subject: add patched gtk+ from flussence --- x11-libs/gtk+/Manifest | 2 + x11-libs/gtk+/files/atk-bridge.patch | 87 ++++++++++++ x11-libs/gtk+/files/settings.ini | 4 + x11-libs/gtk+/files/update-icon-cache.patch | 46 ++++++ x11-libs/gtk+/gtk+-3.24.51.ebuild | 213 ++++++++++++++++++++++++++++ x11-libs/gtk+/metadata.xml | 31 ++++ 6 files changed, 383 insertions(+) create mode 100644 x11-libs/gtk+/Manifest create mode 100644 x11-libs/gtk+/files/atk-bridge.patch create mode 100644 x11-libs/gtk+/files/settings.ini create mode 100644 x11-libs/gtk+/files/update-icon-cache.patch create mode 100644 x11-libs/gtk+/gtk+-3.24.51.ebuild create mode 100644 x11-libs/gtk+/metadata.xml diff --git a/x11-libs/gtk+/Manifest b/x11-libs/gtk+/Manifest new file mode 100644 index 0000000..ac90093 --- /dev/null +++ b/x11-libs/gtk+/Manifest @@ -0,0 +1,2 @@ +DIST gtk-3.24.51.sha256sum 168 BLAKE2B c8559a552390a347c3842f1df3a11ca4b87883b1a0421c2075ea4ea36c14fd2a1bd79f820f4ad3d397f9dcb194da55a3dc28c367e0991866a3108a51bde69b3b SHA512 1f1f415a66828087935e8f561ffe46b5643e34411e06cecc8b9158a1031427560e51232bfb172aa70b49f9f0990f94560af349abc1faceb234069b6f56c8198a +DIST gtk-3.24.51.tar.xz 13483636 BLAKE2B 8e7483852ab74206cb1f2302bb996d706ffde9e53038f3f6d09fc456fa49d1cf2c0862c9d2f8e357eaf368a847bdb50d55b5edfe00b86ef4e30c04735940ec62 SHA512 f96ee1c586284af315709ec38e841bd1b2558d09e2162834a132ffc4bbcddca272a92a828550a3accaa3e4da1964ad32b3b48291e929a108a913bd18c61cd73b diff --git a/x11-libs/gtk+/files/atk-bridge.patch b/x11-libs/gtk+/files/atk-bridge.patch new file mode 100644 index 0000000..298942a --- /dev/null +++ b/x11-libs/gtk+/files/atk-bridge.patch @@ -0,0 +1,87 @@ +From 168e00a41c383aed29f442f56e4d2a28baa47e11 Mon Sep 17 00:00:00 2001 +From: Enne Eziarc +Date: Fri, 3 Mar 2023 20:24:31 +0000 +Subject: [PATCH 2/2] Make atk-bridge optional on X11 + +--- + gtk/a11y/gtkaccessibility.c | 4 ++-- + meson.build | 13 ++++++++++--- + meson_options.txt | 2 ++ + 3 files changed, 14 insertions(+), 5 deletions(-) + +diff --git a/gtk/a11y/gtkaccessibility.c b/gtk/a11y/gtkaccessibility.c +index 7f0e5207d..f2ef2eb7e 100644 +--- a/gtk/a11y/gtkaccessibility.c ++++ b/gtk/a11y/gtkaccessibility.c +@@ -37,7 +37,7 @@ + #include + #include + +-#ifdef GDK_WINDOWING_X11 ++#ifdef HAVE_ATK_BRIDGE + #include + #endif + +@@ -988,7 +988,7 @@ _gtk_accessibility_init (void) + _gtk_accessibility_override_atk_util (); + do_window_event_initialization (); + +-#ifdef GDK_WINDOWING_X11 ++#ifdef HAVE_ATK_BRIDGE + atk_bridge_adaptor_init (NULL, NULL); + #endif + +diff --git a/meson.build b/meson.build +index 5444fa112..000fd3932 100644 +--- a/meson.build ++++ b/meson.build +@@ -564,7 +564,6 @@ if x11_enabled + xfixes_dep = dependency('xfixes', required: false) + xcomposite_dep = dependency('xcomposite', required: false) + fontconfig_dep = dependency('fontconfig', fallback: ['fontconfig', 'fontconfig_dep']) +- atkbridge_dep = dependency('atk-bridge-2.0', version: at_spi2_atk_req) + + backend_immodules += ['xim'] + +@@ -583,8 +582,6 @@ if x11_enabled + x11_pkgs += ['xdamage'] + endif + +- atk_pkgs += ['atk-bridge-2.0'] +- + cdata.set('HAVE_XDAMAGE', xdamage_dep.found() ? 1 : false) + cdata.set('HAVE_XCURSOR', xcursor_dep.found() ? 1 : false) + cdata.set('HAVE_XCOMPOSITE', xcomposite_dep.found() ? 1 : false) +@@ -626,6 +623,16 @@ if x11_enabled + cdata.set('XINPUT_2_4', 1) + endif + ++ enable_atk_bridge = get_option('atk_bridge') ++ if enable_atk_bridge ++ atkbridge_dep = dependency('atk-bridge-2.0', version: at_spi2_atk_req, required: enable_atk_bridge) ++ if atkbridge_dep.found() ++ cdata.set('HAVE_ATK_BRIDGE', 1) ++ atk_pkgs += ['atk-bridge-2.0'] ++ endif ++ else ++ atkbridge_dep = [] ++ endif + + enable_xinerama = get_option('xinerama') + if enable_xinerama != 'no' +diff --git a/meson_options.txt b/meson_options.txt +index 94099aa01..c4ec4fd44 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -11,6 +11,8 @@ option('quartz_backend', type: 'boolean', value: true, + description : 'Enable the macOS gdk backend (only when building on macOS)') + + # Optional dependencies ++option('atk_bridge', type: 'boolean', value: true, ++ description : 'Enable AT-SPI ATK bridge support') + option('xinerama', type: 'combo', choices : ['yes', 'no', 'auto'], value : 'auto', + description : 'Enable support for the Xinerama extension') + option('cloudproviders', type: 'boolean', value: false, +-- +2.39.2 + diff --git a/x11-libs/gtk+/files/settings.ini b/x11-libs/gtk+/files/settings.ini new file mode 100644 index 0000000..a65c0a8 --- /dev/null +++ b/x11-libs/gtk+/files/settings.ini @@ -0,0 +1,4 @@ +[Settings] +gtk-theme-name = Adwaita +gtk-icon-theme-name = gnome +gtk-cursor-theme-name = Adwaita diff --git a/x11-libs/gtk+/files/update-icon-cache.patch b/x11-libs/gtk+/files/update-icon-cache.patch new file mode 100644 index 0000000..a658997 --- /dev/null +++ b/x11-libs/gtk+/files/update-icon-cache.patch @@ -0,0 +1,46 @@ +From 122eb59b31368fd1bc077dc066e3abefb1ee6c6e Mon Sep 17 00:00:00 2001 +From: Enne Eziarc +Date: Fri, 3 Mar 2023 21:07:28 +0000 +Subject: [PATCH 1/2] Don't build or use bundled gtk-update-icon-cache + +--- + docs/reference/gtk/meson.build | 1 - + gtk/meson.build | 10 ---------- + 2 files changed, 11 deletions(-) + +diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build +index 9fa282d38..6e84d9ffa 100644 +--- a/docs/reference/gtk/meson.build ++++ b/docs/reference/gtk/meson.build +@@ -500,7 +500,6 @@ if get_option('man') and xsltproc.found() + + man_files = [ + [ 'gtk-query-immodules-3.0', '1', ], +- [ 'gtk-update-icon-cache', '1', ], + [ 'gtk-encode-symbolic-svg', '1', ], + [ 'gtk-launch', '1', ], + [ 'gtk-builder-tool', '1', ], +diff --git a/gtk/meson.build b/gtk/meson.build +index 4b7a453e1..944c091dd 100644 +--- a/gtk/meson.build ++++ b/gtk/meson.build +@@ -1113,16 +1113,6 @@ if win32_enabled + extra_update_icon_cache_objs = import('windows').compile_resources(uac_rc) + endif + +-gtk_update_icon_cache = executable( +- 'gtk-update-icon-cache', +- 'updateiconcache.c', +- extra_update_icon_cache_objs, +- c_args: gtk_cargs, +- dependencies: libgtk_dep, +- install: true +-) +-gtk_tools += gtk_update_icon_cache +- + gtk_query_immodules = executable( + 'gtk-query-immodules-3.0', + 'queryimmodules.c', +-- +2.39.2 + diff --git a/x11-libs/gtk+/gtk+-3.24.51.ebuild b/x11-libs/gtk+/gtk+-3.24.51.ebuild new file mode 100644 index 0000000..d4930e7 --- /dev/null +++ b/x11-libs/gtk+/gtk+-3.24.51.ebuild @@ -0,0 +1,213 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 +# shellcheck disable=SC2317 + +# https://codeberg.org/flussence/flussence-overlay.git + +EAPI=8 + +GNOME_ORG_MODULE="gtk" +inherit gnome2 meson-multilib multilib verify-sig virtualx + +DESCRIPTION="Gimp ToolKit +" +HOMEPAGE="https://www.gtk.org/" +SRC_URI+=" verify-sig? ( ${SRC_URI%%.tar*}.sha256sum )" +LICENSE="LGPL-2+" +SLOT="3" +KEYWORDS="~amd64 ~x86" +IUSE="aqua accessibility broadway cloudproviders colord cups examples gtk-doc +introspection sysprof test vim-syntax wayland +X xinerama" +RESTRICT="!test? ( test )" + +REQUIRED_USE=" + || ( aqua wayland X ) + test? ( X ) + xinerama? ( X ) +" + +COMMON_DEPEND=" + >=dev-libs/fribidi-0.19.7[${MULTILIB_USEDEP}] + >=dev-libs/glib-2.57.2:2[${MULTILIB_USEDEP}] + media-libs/fontconfig[${MULTILIB_USEDEP}] + >=media-libs/harfbuzz-2.2.0:= + >=media-libs/libepoxy-1.4[X(+)?,egl(+),${MULTILIB_USEDEP}] + virtual/libintl[${MULTILIB_USEDEP}] + >=x11-libs/cairo-1.14[aqua?,glib,svg(+),X?,${MULTILIB_USEDEP}] + >=x11-libs/gdk-pixbuf-2.30:2[introspection?,${MULTILIB_USEDEP}] + >=x11-libs/pango-1.44.0[introspection?,${MULTILIB_USEDEP}] + x11-misc/shared-mime-info + + cloudproviders? ( net-libs/libcloudproviders[${MULTILIB_USEDEP}] ) + colord? ( >=x11-misc/colord-0.1.9:0=[${MULTILIB_USEDEP}] ) + cups? ( >=net-print/cups-2.0[${MULTILIB_USEDEP}] ) + introspection? ( >=dev-libs/gobject-introspection-1.39:= ) + wayland? ( + >=dev-libs/wayland-1.14.91[${MULTILIB_USEDEP}] + >=dev-libs/wayland-protocols-1.32 + media-libs/mesa[wayland,${MULTILIB_USEDEP}] + >=x11-libs/libxkbcommon-0.2[${MULTILIB_USEDEP}] + ) + X? ( + accessibility? ( >=app-accessibility/at-spi2-core-2.46.0[${MULTILIB_USEDEP}] ) + media-libs/libglvnd[X(+),${MULTILIB_USEDEP}] + x11-libs/libX11[${MULTILIB_USEDEP}] + x11-libs/libXcomposite[${MULTILIB_USEDEP}] + x11-libs/libXcursor[${MULTILIB_USEDEP}] + x11-libs/libXdamage[${MULTILIB_USEDEP}] + x11-libs/libXext[${MULTILIB_USEDEP}] + x11-libs/libXfixes[${MULTILIB_USEDEP}] + >=x11-libs/libXi-1.8[${MULTILIB_USEDEP}] + >=x11-libs/libXrandr-1.5[${MULTILIB_USEDEP}] + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] ) + ) +" +DEPEND="${COMMON_DEPEND} + test? ( + media-fonts/font-cursor-misc + media-fonts/font-misc-misc + ) + sysprof? ( >=dev-util/sysprof-capture-3.33.2:3[${MULTILIB_USEDEP}] ) + 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[${MULTILIB_USEDEP}] + >=x11-themes/adwaita-icon-theme-3.14 + vim-syntax? ( app-vim/gtk-syntax ) +" +BDEPEND=" + app-text/docbook-xml-dtd:4.1.2 + app-text/docbook-xsl-stylesheets + >=dev-build/gtk-doc-am-1.20 + dev-libs/gobject-introspection-common + dev-libs/libxslt + >=dev-util/gdbus-codegen-2.48 + dev-util/glib-utils + wayland? ( dev-util/wayland-scanner ) + >=sys-devel/gettext-0.19.7 + virtual/pkgconfig + x11-libs/gdk-pixbuf:2 + gtk-doc? ( + app-text/docbook-xml-dtd:4.3 + >=dev-util/gtk-doc-1.20 + ) + test? ( sys-apps/dbus ) +" + +MULTILIB_CHOST_TOOLS=( + /usr/bin/gtk-query-immodules-3.0"$(get_exeext)" +) + +PATCHES=( + # get rid of gtk3-atk-bridge crap + "${FILESDIR}"/atk-bridge.patch + # gtk-update-icon-cache is installed by dev-util/gtk-update-icon-cache + "${FILESDIR}"/update-icon-cache.patch +) + +src_unpack() { + if use verify-sig; then + pushd "${DISTDIR}" || die + verify-sig_verify_unsigned_checksums "${A##* }" sha256 "${A%% *}" + popd || die + fi + + default +} + +multilib_src_configure() { + local emesonargs + emesonargs=( + "$(meson_use accessibility atk_bridge)" + "$(meson_use aqua quartz_backend)" + "$(meson_use broadway broadway_backend)" + "$(meson_use cloudproviders)" + "$(meson_use examples demos)" + "$(meson_use examples)" + "$(meson_native_use_bool gtk-doc gtk_doc)" + "$(meson_native_use_bool introspection)" + "$(meson_use sysprof profiler)" + "$(meson_use wayland wayland_backend)" + "$(meson_use X x11_backend)" + "-Dcolord=$(usex colord yes no)" + "-Dprint_backends=$(usex cups cups,file,lpr file,lpr)" + "-Dxinerama=$(usex xinerama yes no)" + # Include backend immodules into gtk itself, to avoid problems like + # https://gitlab.gnome.org/GNOME/gnome-shell/issues/109 from a + # user overridden GTK_IM_MODULE envvar + -Dbuiltin_immodules=backend + -Dman=true + "$(meson_use test tests)" + -Dtracker3=false + ) + meson_src_configure +} + +multilib_src_compile() { + meson_src_compile +} + +multilib_src_test() { + virtx dbus-run-session meson test -C "${BUILD_DIR}" --timeout-multiplier 4 || die +} + +multilib_src_install() { + meson_src_install +} + +multilib_src_install_all() { + insinto /etc/gtk-3.0 + doins "${FILESDIR}"/settings.ini + # Skip README.win32.md that would get installed by default + DOCS=( NEWS README.md ) + einstalldocs +} + +pkg_preinst() { + gnome2_pkg_preinst + + # shellcheck disable=SC2329 + multilib_pkg_preinst() { + # Make immodules.cache belongs to gtk+ alone + local cache + cache="/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" + + if [[ -e "${EROOT}${cache}" ]]; then + cp "${EROOT}${cache}" "${ED}${cache}" || die + else + touch "${ED}${cache}" || die + fi + } + multilib_parallel_foreach_abi multilib_pkg_preinst +} + +pkg_postinst() { + gnome2_pkg_postinst + + # shellcheck disable=SC2329 + multilib_pkg_postinst() { + gnome2_query_immodules_gtk3 || + die "Update immodules cache failed (for ${ABI})" + } + multilib_parallel_foreach_abi multilib_pkg_postinst + + 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 +} + +pkg_postrm() { + gnome2_pkg_postrm + + if [[ -z ${REPLACED_BY_VERSION} ]]; then + # shellcheck disable=SC2329 + multilib_pkg_postrm() { + rm -f "${EROOT}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" + } + multilib_foreach_abi multilib_pkg_postrm + fi +} diff --git a/x11-libs/gtk+/metadata.xml b/x11-libs/gtk+/metadata.xml new file mode 100644 index 0000000..aaf21a0 --- /dev/null +++ b/x11-libs/gtk+/metadata.xml @@ -0,0 +1,31 @@ + + + + + This is a patched version of Gentoo's gtk+:3 ebuild to make optional its + transitive dependency on sys-apps/dbus, by adding a + USE=accessibility flag. Disabling it makes dev-libs/atk + redundant, and also prevents spawning extra runtime processes for it. + Note that many other packages pull in ATK anyway, including all the + Chromium-based blobs. + + + gentoo+bugs@flussence.eu + flussence + + + https://gitlab.gnome.org/GNOME/gtk/-/issues/ + https://gitlab.gnome.org/GNOME/gtk/-/tags?format=atom + https://www.gtk.org/docs/ + cpe:/a:gtk:gtk%2B + + + + Enable the GDK Broadway backend. + Enable GtkPlacesSidebar to access cloud services + Use x11-misc/colord for color management + in printing + Enable profiling data capture support using + dev-util/sysprof-capture + + -- cgit v1.2.3