commit:     45a465608ea72d3de1aa22b6d250873251751aeb
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 25 06:30:56 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Sun Aug 25 20:23:23 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45a46560

dev-qt/qtbase: prevent automagically building against gtk[X,wayland]

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

It's only needed, of course, by the qgtk3 platformtheme plugin which not
necessarily everyone builds, wants, or uses at runtime :) but still.

We can solve this with a (new) gentoo-specific macro that hides the
GTK implementations when we don't want it. This is gated on our existing
USE flags for wayland/X support.

Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 .../qtbase/{qtbase-6.7.2-r3.ebuild => qtbase-6.7.2-r4.ebuild} | 11 +++++++++--
 dev-qt/qtbase/qtbase-6.7.9999.ebuild                          | 11 +++++++++--
 dev-qt/qtbase/qtbase-6.8.9999.ebuild                          | 11 +++++++++--
 dev-qt/qtbase/qtbase-6.9999.ebuild                            | 11 +++++++++--
 4 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/dev-qt/qtbase/qtbase-6.7.2-r3.ebuild 
b/dev-qt/qtbase/qtbase-6.7.2-r4.ebuild
similarity index 96%
rename from dev-qt/qtbase/qtbase-6.7.2-r3.ebuild
rename to dev-qt/qtbase/qtbase-6.7.2-r4.ebuild
index 2782f8186d06..e7e909a26a94 100644
--- a/dev-qt/qtbase/qtbase-6.7.2-r3.ebuild
+++ b/dev-qt/qtbase/qtbase-6.7.2-r4.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit qt6-build toolchain-funcs
+inherit flag-o-matic qt6-build toolchain-funcs
 
 DESCRIPTION="Cross-platform application development framework"
 
@@ -99,7 +99,7 @@ COMMON_DEPEND="
                        cups? ( net-print/cups )
                        gtk? (
                                x11-libs/gdk-pixbuf:2
-                               x11-libs/gtk+:3
+                               >=x11-libs/gtk+-3.24.41-r1:3[X?,wayland?]
                                x11-libs/pango
                        )
                )
@@ -170,6 +170,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # The only component that uses gdk backends is the qgtk3 platformtheme 
plugin
+       if use gtk; then
+               # defang automagic dependencies
+               use wayland || append-cxxflags -DGENTOO_GTK_HIDE_WAYLAND
+               use X || append-cxxflags -DGENTOO_GTK_HIDE_X11
+       fi
+
        local mycmakeargs=(
                -DBUILD_WITH_PCH=OFF
 

diff --git a/dev-qt/qtbase/qtbase-6.7.9999.ebuild 
b/dev-qt/qtbase/qtbase-6.7.9999.ebuild
index e4a66f7137f8..580f9e80474a 100644
--- a/dev-qt/qtbase/qtbase-6.7.9999.ebuild
+++ b/dev-qt/qtbase/qtbase-6.7.9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit qt6-build toolchain-funcs
+inherit flag-o-matic qt6-build toolchain-funcs
 
 DESCRIPTION="Cross-platform application development framework"
 
@@ -99,7 +99,7 @@ COMMON_DEPEND="
                        cups? ( net-print/cups )
                        gtk? (
                                x11-libs/gdk-pixbuf:2
-                               x11-libs/gtk+:3
+                               >=x11-libs/gtk+-3.24.41-r1:3[X?,wayland?]
                                x11-libs/pango
                        )
                )
@@ -166,6 +166,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # The only component that uses gdk backends is the qgtk3 platformtheme 
plugin
+       if use gtk; then
+               # defang automagic dependencies
+               use wayland || append-cxxflags -DGENTOO_GTK_HIDE_WAYLAND
+               use X || append-cxxflags -DGENTOO_GTK_HIDE_X11
+       fi
+
        local mycmakeargs=(
                -DBUILD_WITH_PCH=OFF
 

diff --git a/dev-qt/qtbase/qtbase-6.8.9999.ebuild 
b/dev-qt/qtbase/qtbase-6.8.9999.ebuild
index 9af015d9b088..1381d70d7a19 100644
--- a/dev-qt/qtbase/qtbase-6.8.9999.ebuild
+++ b/dev-qt/qtbase/qtbase-6.8.9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit qt6-build toolchain-funcs
+inherit flag-o-matic qt6-build toolchain-funcs
 
 DESCRIPTION="Cross-platform application development framework"
 
@@ -99,7 +99,7 @@ COMMON_DEPEND="
                        cups? ( net-print/cups )
                        gtk? (
                                x11-libs/gdk-pixbuf:2
-                               x11-libs/gtk+:3
+                               >=x11-libs/gtk+-3.24.41-r1:3[X?,wayland?]
                                x11-libs/pango
                        )
                )
@@ -166,6 +166,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # The only component that uses gdk backends is the qgtk3 platformtheme 
plugin
+       if use gtk; then
+               # defang automagic dependencies
+               use wayland || append-cxxflags -DGENTOO_GTK_HIDE_WAYLAND
+               use X || append-cxxflags -DGENTOO_GTK_HIDE_X11
+       fi
+
        local mycmakeargs=(
                -DBUILD_WITH_PCH=OFF
 

diff --git a/dev-qt/qtbase/qtbase-6.9999.ebuild 
b/dev-qt/qtbase/qtbase-6.9999.ebuild
index 9af015d9b088..1381d70d7a19 100644
--- a/dev-qt/qtbase/qtbase-6.9999.ebuild
+++ b/dev-qt/qtbase/qtbase-6.9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit qt6-build toolchain-funcs
+inherit flag-o-matic qt6-build toolchain-funcs
 
 DESCRIPTION="Cross-platform application development framework"
 
@@ -99,7 +99,7 @@ COMMON_DEPEND="
                        cups? ( net-print/cups )
                        gtk? (
                                x11-libs/gdk-pixbuf:2
-                               x11-libs/gtk+:3
+                               >=x11-libs/gtk+-3.24.41-r1:3[X?,wayland?]
                                x11-libs/pango
                        )
                )
@@ -166,6 +166,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # The only component that uses gdk backends is the qgtk3 platformtheme 
plugin
+       if use gtk; then
+               # defang automagic dependencies
+               use wayland || append-cxxflags -DGENTOO_GTK_HIDE_WAYLAND
+               use X || append-cxxflags -DGENTOO_GTK_HIDE_X11
+       fi
+
        local mycmakeargs=(
                -DBUILD_WITH_PCH=OFF
 

Reply via email to