commit:     47a3d74dc5c3f919f857429dbbc95a11c1496fdf
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 28 20:50:16 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Mar 28 20:50:16 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47a3d74d

sys-apps/xdg-desktop-portal-gnome: fix USE="-wayland" build

Closes: https://bugs.gentoo.org/903189
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../xdg-desktop-portal-gnome-44.0-x11-only.patch   | 36 ++++++++++++++++++++++
 .../xdg-desktop-portal-gnome-44.0.ebuild           |  6 ++++
 2 files changed, 42 insertions(+)

diff --git 
a/sys-apps/xdg-desktop-portal-gnome/files/xdg-desktop-portal-gnome-44.0-x11-only.patch
 
b/sys-apps/xdg-desktop-portal-gnome/files/xdg-desktop-portal-gnome-44.0-x11-only.patch
new file mode 100644
index 000000000000..0c7af9253bae
--- /dev/null
+++ 
b/sys-apps/xdg-desktop-portal-gnome/files/xdg-desktop-portal-gnome-44.0-x11-only.patch
@@ -0,0 +1,36 @@
+From d19e5a66fbba22274a774ac603d2ecb3ff528779 Mon Sep 17 00:00:00 2001
+From: David Seifert <s...@gentoo.org>
+Date: Tue, 28 Mar 2023 20:42:32 +0200
+Subject: [PATCH] Do not reference wayland routines without wayland support
+
+* If GTK4 is built without Wayland support, there will be no
+  `init_external_window_wayland_display` symbol.
+
+Bug: https://bugs.gentoo.org/903189
+---
+ src/externalwindow.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/externalwindow.c b/src/externalwindow.c
+index c3ea3d7..f7372bb 100644
+--- a/src/externalwindow.c
++++ b/src/externalwindow.c
+@@ -90,10 +90,14 @@ init_external_window_display (GError **error)
+   const char *session_type;
+ 
+   session_type = getenv ("XDG_SESSION_TYPE");
++#ifdef HAVE_GTK_WAYLAND
+   if (g_strcmp0 (session_type, "wayland") == 0)
+     return init_external_window_wayland_display (error);
+-  else if (g_strcmp0 (session_type, "x11") == 0)
++#endif
++#ifdef HAVE_GTK_X11
++  if (g_strcmp0 (session_type, "x11") == 0)
+     return init_external_window_x11_display (error);
++#endif
+ 
+   g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+                "Unsupported or missing session type '%s'",
+-- 
+GitLab
+

diff --git 
a/sys-apps/xdg-desktop-portal-gnome/xdg-desktop-portal-gnome-44.0.ebuild 
b/sys-apps/xdg-desktop-portal-gnome/xdg-desktop-portal-gnome-44.0.ebuild
index ef62dd2dfcc4..e902e5b3a415 100644
--- a/sys-apps/xdg-desktop-portal-gnome/xdg-desktop-portal-gnome-44.0.ebuild
+++ b/sys-apps/xdg-desktop-portal-gnome/xdg-desktop-portal-gnome-44.0.ebuild
@@ -34,6 +34,12 @@ BDEPEND="
        wayland? ( dev-util/wayland-scanner )
 "
 
+PATCHES=(
+       # backport
+       # 
https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/merge_requests/83
+       "${FILESDIR}"/${P}-x11-only.patch
+)
+
 src_configure() {
        local emesonargs=(
                -Dsystemduserunitdir="$(systemd_get_userunitdir)"

Reply via email to