commit:     f5825d8e2cef9ad84495c8e91b5dac13fb6ccf01
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 11 16:44:19 2025 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Fri Jun 13 07:16:04 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f5825d8e

xfce-base/exo: avoid automagic deps on gtk+[X,wayland]

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 exo 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/957816
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 xfce-base/exo/{exo-4.20.0.ebuild => exo-4.20.0-r1.ebuild} | 13 +++++++++++--
 xfce-base/exo/{exo-4.21.0.ebuild => exo-4.21.0-r1.ebuild} | 13 +++++++++++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/xfce-base/exo/exo-4.20.0.ebuild 
b/xfce-base/exo/exo-4.20.0-r1.ebuild
similarity index 76%
rename from xfce-base/exo/exo-4.20.0.ebuild
rename to xfce-base/exo/exo-4.20.0-r1.ebuild
index 7a10a918327e..4f6c76d390c8 100644
--- a/xfce-base/exo/exo-4.20.0.ebuild
+++ b/xfce-base/exo/exo-4.20.0-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit xdg-utils
+inherit flag-o-matic xdg-utils
 
 DESCRIPTION="Extensions, widgets and framework library with session support 
for Xfce"
 HOMEPAGE="
@@ -15,10 +15,11 @@ 
SRC_URI="https://archive.xfce.org/src/xfce/${PN}/${PV%.*}/${P}.tar.bz2";
 LICENSE="GPL-2+ LGPL-2.1+"
 SLOT="0"
 KEYWORDS="amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~sparc x86 
~amd64-linux ~x86-linux ~x64-solaris"
+IUSE="wayland X"
 
 DEPEND="
        >=dev-libs/glib-2.72.0
-       >=x11-libs/gtk+-3.24.0:3
+       >=x11-libs/gtk+-3.24.0:3[wayland?,X?]
        >=xfce-base/libxfce4ui-4.15.1:=[gtk3(+)]
        >=xfce-base/libxfce4util-4.17.2:=
 "
@@ -30,6 +31,14 @@ BDEPEND="
        virtual/pkgconfig
 "
 
+src_configure() {
+       # defang automagic dependencies
+       use X || append-cppflags -DGENTOO_GTK_HIDE_X11
+       use wayland || append-cppflags -DGENTOO_GTK_HIDE_WAYLAND
+
+       default
+}
+
 src_install() {
        default
        find "${D}" -name '*.la' -delete || die

diff --git a/xfce-base/exo/exo-4.21.0.ebuild 
b/xfce-base/exo/exo-4.21.0-r1.ebuild
similarity index 76%
rename from xfce-base/exo/exo-4.21.0.ebuild
rename to xfce-base/exo/exo-4.21.0-r1.ebuild
index 0ec4ed91f4a5..f1e70a679ef2 100644
--- a/xfce-base/exo/exo-4.21.0.ebuild
+++ b/xfce-base/exo/exo-4.21.0-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit xdg-utils
+inherit flag-o-matic xdg-utils
 
 DESCRIPTION="Extensions, widgets and framework library with session support 
for Xfce"
 HOMEPAGE="
@@ -15,10 +15,11 @@ 
SRC_URI="https://archive.xfce.org/src/xfce/${PN}/${PV%.*}/${P}.tar.bz2";
 LICENSE="GPL-2+ LGPL-2.1+"
 SLOT="0"
 KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 
~amd64-linux ~x86-linux ~x64-solaris"
+IUSE="wayland X"
 
 DEPEND="
        >=dev-libs/glib-2.72.0
-       >=x11-libs/gtk+-3.24.0:3
+       >=x11-libs/gtk+-3.24.0:3[wayland?,X?]
        >=xfce-base/libxfce4ui-4.15.1:=[gtk3(+)]
        >=xfce-base/libxfce4util-4.17.2:=
 "
@@ -30,6 +31,14 @@ BDEPEND="
        virtual/pkgconfig
 "
 
+src_configure() {
+       # defang automagic dependencies
+       use X || append-cppflags -DGENTOO_GTK_HIDE_X11
+       use wayland || append-cppflags -DGENTOO_GTK_HIDE_WAYLAND
+
+       default
+}
+
 src_install() {
        default
        find "${D}" -name '*.la' -delete || die

Reply via email to