commit:     75101640edbe637afd9a503258a86b1b1f8d8888
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 11 01:16:35 2025 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Wed Jun 11 03:35:19 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75101640

app-crypt/gcr: avoid automagic deps on gtk+[X]

e.g. the upstream code checks whether GDK_WINDOWING_X11 is defined
by the gtk headers, and if so will compile against the x11 symbols
it provides. This means that gcr built on a system with gtk+[-X]
will be compatible with anything, but when built on a system with
gtk+[X], requires that at runtime.

Use a Gentoo-specific macro hack to hide the GTK implementations when we
don't want it, alongside new USE flags to control the dependency usage.

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

 app-crypt/gcr/{gcr-3.41.1-r2.ebuild => gcr-3.41.1-r3.ebuild} | 12 +++++++++---
 app-crypt/gcr/{gcr-3.41.2.ebuild => gcr-3.41.2-r1.ebuild}    | 12 +++++++++---
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/app-crypt/gcr/gcr-3.41.1-r2.ebuild 
b/app-crypt/gcr/gcr-3.41.1-r3.ebuild
similarity index 86%
rename from app-crypt/gcr/gcr-3.41.1-r2.ebuild
rename to app-crypt/gcr/gcr-3.41.1-r3.ebuild
index e17302e397e6..585bea600256 100644
--- a/app-crypt/gcr/gcr-3.41.1-r2.ebuild
+++ b/app-crypt/gcr/gcr-3.41.1-r3.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 PYTHON_COMPAT=( python3_{10..13} )
 
-inherit gnome.org gnome2-utils meson python-any-r1 vala xdg
+inherit flag-o-matic gnome.org gnome2-utils meson python-any-r1 vala xdg
 
 DESCRIPTION="Libraries for cryptographic UIs and accessing PKCS#11 modules"
 HOMEPAGE="https://gitlab.gnome.org/GNOME/gcr";
@@ -12,7 +12,7 @@ HOMEPAGE="https://gitlab.gnome.org/GNOME/gcr";
 LICENSE="GPL-2+ LGPL-2+"
 SLOT="0/1" # subslot = suffix of libgcr-base-3 and co
 
-IUSE="gtk gtk-doc +introspection systemd test +vala"
+IUSE="gtk gtk-doc +introspection systemd test +vala wayland X"
 REQUIRED_USE="
        gtk-doc? ( introspection )
        vala? ( introspection )
@@ -27,7 +27,7 @@ DEPEND="
        >=app-crypt/p11-kit-0.19.0
        >=app-crypt/libsecret-0.20
        systemd? ( sys-apps/systemd:= )
-       gtk? ( >=x11-libs/gtk+-3.22:3[introspection?] )
+       gtk? ( >=x11-libs/gtk+-3.22:3[introspection?,wayland?,X?] )
        >=sys-apps/dbus-1
        introspection? ( >=dev-libs/gobject-introspection-1.58:= )
 "
@@ -61,6 +61,12 @@ src_prepare() {
 }
 
 src_configure() {
+       if use gtk; then
+               # defang automagic dependencies
+               use X || append-flags -DGENTOO_GTK_HIDE_X11
+               use wayland || append-flags -DGENTOO_GTK_HIDE_WAYLAND
+       fi
+
        local emesonargs=(
                $(meson_use introspection)
                $(meson_use gtk)

diff --git a/app-crypt/gcr/gcr-3.41.2.ebuild 
b/app-crypt/gcr/gcr-3.41.2-r1.ebuild
similarity index 86%
rename from app-crypt/gcr/gcr-3.41.2.ebuild
rename to app-crypt/gcr/gcr-3.41.2-r1.ebuild
index b93ba362c323..7787727f534a 100644
--- a/app-crypt/gcr/gcr-3.41.2.ebuild
+++ b/app-crypt/gcr/gcr-3.41.2-r1.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 PYTHON_COMPAT=( python3_{10..13} )
 
-inherit gnome.org gnome2-utils meson python-any-r1 vala xdg
+inherit flag-o-matic gnome.org gnome2-utils meson python-any-r1 vala xdg
 
 DESCRIPTION="Libraries for cryptographic UIs and accessing PKCS#11 modules"
 HOMEPAGE="https://gitlab.gnome.org/GNOME/gcr";
@@ -12,7 +12,7 @@ HOMEPAGE="https://gitlab.gnome.org/GNOME/gcr";
 LICENSE="GPL-2+ LGPL-2+"
 SLOT="0/1" # subslot = suffix of libgcr-base-3 and co
 
-IUSE="gtk gtk-doc +introspection systemd test +vala"
+IUSE="gtk gtk-doc +introspection systemd test +vala wayland X"
 REQUIRED_USE="
        gtk-doc? ( introspection )
        vala? ( introspection )
@@ -27,7 +27,7 @@ DEPEND="
        >=app-crypt/p11-kit-0.19.0
        >=app-crypt/libsecret-0.20
        systemd? ( sys-apps/systemd:= )
-       gtk? ( >=x11-libs/gtk+-3.22:3[introspection?] )
+       gtk? ( >=x11-libs/gtk+-3.22:3[introspection?,wayland?,X?] )
        >=sys-apps/dbus-1
        introspection? ( >=dev-libs/gobject-introspection-1.58:= )
 "
@@ -61,6 +61,12 @@ src_prepare() {
 }
 
 src_configure() {
+       if use gtk; then
+               # defang automagic dependencies
+               use X || append-flags -DGENTOO_GTK_HIDE_X11
+               use wayland || append-flags -DGENTOO_GTK_HIDE_WAYLAND
+       fi
+
        local emesonargs=(
                $(meson_use introspection)
                $(meson_use gtk)

Reply via email to