Skip to content

Commit

Permalink
dev-qt/qtbase: prevent automagically building against gtk[X,wayland]
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
eli-schwartz committed Aug 25, 2024
1 parent a48dc95 commit 45a4656
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
)
)
Expand Down Expand Up @@ -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

Expand Down
11 changes: 9 additions & 2 deletions dev-qt/qtbase/qtbase-6.7.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
)
)
Expand Down Expand Up @@ -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

Expand Down
11 changes: 9 additions & 2 deletions dev-qt/qtbase/qtbase-6.8.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
)
)
Expand Down Expand Up @@ -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

Expand Down
11 changes: 9 additions & 2 deletions dev-qt/qtbase/qtbase-6.9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
)
)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 45a4656

Please sign in to comment.