commit:     fe3e0b355ab5864ab432b84c018ca66793aa41b0
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 08:32:50 2025 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Wed Jun  4 08:36:41 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe3e0b35

dev-libs/libportal: Fix building with QT 6.9

Thanks-to: Harris Landgarten
Thanks-to: Sam James
Closes: https://bugs.gentoo.org/957114
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 .../files/libportal-0.9.1-qt6.9-compat.patch       | 41 ++++++++++++++++++++++
 dev-libs/libportal/libportal-0.9.1.ebuild          |  5 ++-
 2 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/dev-libs/libportal/files/libportal-0.9.1-qt6.9-compat.patch 
b/dev-libs/libportal/files/libportal-0.9.1-qt6.9-compat.patch
new file mode 100644
index 000000000000..ed2b1ff8ca7b
--- /dev/null
+++ b/dev-libs/libportal/files/libportal-0.9.1-qt6.9-compat.patch
@@ -0,0 +1,41 @@
+From 796053d2eebe4532aad6bd3fd80cdf3b197806ec Mon Sep 17 00:00:00 2001
+From: Jan Grulich <[email protected]>
+Date: Thu, 27 Mar 2025 09:38:10 +0100
+Subject: [PATCH] qt6: fix build against Qt 6.9+
+
+QGenericUnixServices was renamed to QDesktopUnixServices in Qt 6.9.
+
+Upstream change: https://codereview.qt-project.org/c/qt/qtbase/+/609639
+---
+ libportal/portal-qt6.cpp | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/libportal/portal-qt6.cpp b/libportal/portal-qt6.cpp
+index d38a4e30..34f0d72a 100644
+--- a/libportal/portal-qt6.cpp
++++ b/libportal/portal-qt6.cpp
+@@ -31,8 +31,12 @@
+ #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+ #include <qpa/qplatformintegration.h>
+ #include <private/qguiapplication_p.h>
++#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
++#include <private/qdesktopunixservices_p.h>
++#else
+ #include <private/qgenericunixservices_p.h>
+ #endif
++#endif
+ 
+ static gboolean
+ _xdp_parent_export_qt (XdpParent *parent,
+@@ -45,7 +49,11 @@ _xdp_parent_export_qt (XdpParent *parent,
+   }
+ 
+ #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
++#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
++  if (const auto services = 
dynamic_cast<QDesktopUnixServices*>(QGuiApplicationPrivate::platformIntegration()->services()))
++#else
+   if (const auto services = 
dynamic_cast<QGenericUnixServices*>(QGuiApplicationPrivate::platformIntegration()->services()))
++#endif
+     {
+       g_autofree char *handle = 
g_strdup(services->portalWindowIdentifier(w).toUtf8().constData());
+ 

diff --git a/dev-libs/libportal/libportal-0.9.1.ebuild 
b/dev-libs/libportal/libportal-0.9.1.ebuild
index ccdcb5526d58..4a6e7108101c 100644
--- a/dev-libs/libportal/libportal-0.9.1.ebuild
+++ b/dev-libs/libportal/libportal-0.9.1.ebuild
@@ -46,7 +46,10 @@ BDEPEND="
        vala? ( $(vala_depend) )
 "
 
-PATCHES=( "${FILESDIR}/${P}-bogus-qt6widgets.patch" )
+PATCHES=(
+       "${FILESDIR}/${P}-bogus-qt6widgets.patch"
+       "${FILESDIR}/${P}-qt6.9-compat.patch"
+)
 
 python_check_deps() {
        python_has_version \

Reply via email to