From 140d576980a1bb9f829769089c5d7bb238b10352 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Fri, 9 Sep 2022 23:02:04 +0200 Subject: [PATCH] dev-qt/qtgui: Quick fix for QT_CONFIG(dbus) not working right now Signed-off-by: Andreas Sturmlechner --- .../files/qtgui-5.15.6-fix-no-dbus.patch | 94 +++++++++++++++++++ dev-qt/qtgui/qtgui-5.15.6.ebuild | 3 + 2 files changed, 97 insertions(+) create mode 100644 dev-qt/qtgui/files/qtgui-5.15.6-fix-no-dbus.patch diff --git a/dev-qt/qtgui/files/qtgui-5.15.6-fix-no-dbus.patch b/dev-qt/qtgui/files/qtgui-5.15.6-fix-no-dbus.patch new file mode 100644 index 000000000..4eabad27b --- /dev/null +++ b/dev-qt/qtgui/files/qtgui-5.15.6-fix-no-dbus.patch @@ -0,0 +1,94 @@ +From aea5a02a4b262ca9ebace0cd99d8296f5659f0a5 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner +Date: Fri, 9 Sep 2022 20:13:13 +0200 +Subject: [PATCH] Replace #if QT_CONFIG(dbus) with #ifndef QT_NO_DBUS + +Signed-off-by: Andreas Sturmlechner +--- + src/gui/kernel/qguiapplication.cpp | 2 +- + .../services/genericunix/qgenericunixservices.cpp | 14 +++++++------- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp +index 87643a3a39..e191420303 100644 +--- a/src/gui/kernel/qguiapplication.cpp ++++ b/src/gui/kernel/qguiapplication.cpp +@@ -263,7 +263,7 @@ static void initThemeHints() + + static bool checkNeedPortalSupport() + { +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty() || qEnvironmentVariableIsSet("SNAP"); + #else + return false; +diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp +index fa92a0dfa6..ba646173d6 100644 +--- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp ++++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp +@@ -51,7 +51,7 @@ + #include + #include + +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + // These QtCore includes are needed for xdg-desktop-portal support + #include + +@@ -184,7 +184,7 @@ static inline bool launch(const QString &launcher, const QUrl &url) + return ok; + } + +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + static inline bool checkNeedPortalSupport() + { + return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty() || qEnvironmentVariableIsSet("SNAP"); +@@ -391,7 +391,7 @@ private: + + QGenericUnixServices::QGenericUnixServices() + { +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + QDBusMessage message = QDBusMessage::createMethodCall( + QStringLiteral("org.freedesktop.portal.Desktop"), QStringLiteral("/org/freedesktop/portal/desktop"), + QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("Get")); +@@ -413,7 +413,7 @@ QGenericUnixServices::QGenericUnixServices() + + QPlatformServiceColorPicker *QGenericUnixServices::colorPicker(QWindow *parent) + { +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + // Make double sure that we are in a wayland environment. In particular check + // WAYLAND_DISPLAY so also XWayland apps benefit from portal-based color picking. + // Outside wayland we'll rather rely on other means than the XDG desktop portal. +@@ -437,7 +437,7 @@ QByteArray QGenericUnixServices::desktopEnvironment() const + bool QGenericUnixServices::openUrl(const QUrl &url) + { + if (url.scheme() == QLatin1String("mailto")) { +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + if (checkNeedPortalSupport()) { + QDBusError error = xdgDesktopPortalSendEmail(url); + if (isPortalReturnPermanent(error)) +@@ -449,7 +449,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url) + return openDocument(url); + } + +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + if (checkNeedPortalSupport()) { + QDBusError error = xdgDesktopPortalOpenUrl(url); + if (isPortalReturnPermanent(error)) +@@ -466,7 +466,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url) + + bool QGenericUnixServices::openDocument(const QUrl &url) + { +-#if QT_CONFIG(dbus) ++#ifndef QT_NO_DBUS + if (checkNeedPortalSupport()) { + QDBusError error = xdgDesktopPortalOpenFile(url); + if (isPortalReturnPermanent(error)) +-- +2.37.3 + diff --git a/dev-qt/qtgui/qtgui-5.15.6.ebuild b/dev-qt/qtgui/qtgui-5.15.6.ebuild index e8389d10f..f01c36e80 100644 --- a/dev-qt/qtgui/qtgui-5.15.6.ebuild +++ b/dev-qt/qtgui/qtgui-5.15.6.ebuild @@ -74,6 +74,9 @@ PDEPEND=" wayland? ( =dev-qt/qtwayland-${QT5_PV}* ) " +# workaround the fact that QT_CONFIG(dbus) does not work for us +PATCHES=( "${FILESDIR}/${P}-fix-no-dbus.patch" ) + QT5_TARGET_SUBDIRS=( src/tools/qvkgen src/gui