diff --git a/deskutils/xdg-desktop-portal/Makefile b/deskutils/xdg-desktop-portal/Makefile index 726224b9336e..157a17b41d1b 100644 --- a/deskutils/xdg-desktop-portal/Makefile +++ b/deskutils/xdg-desktop-portal/Makefile @@ -1,31 +1,32 @@ PORTNAME= xdg-desktop-portal PORTVERSION= 1.18.2 +PORTREVISION= 1 CATEGORIES= deskutils wayland MAINTAINER= arrowd@FreeBSD.org COMMENT= Portal frontend service for Flatpak WWW= https://github.com/flatpak/xdg-desktop-portal LICENSE= LGPL21 LIB_DEPENDS= libfuse3.so:sysutils/fusefs-libs3 \ libgeoclue-2.so:net/geoclue \ libjson-glib-1.0.so:devel/json-glib \ libpipewire-0.3.so:multimedia/pipewire \ libportal.so:deskutils/libportal USES= gettext-tools gmake gnome meson pkgconfig USE_GNOME= gdkpixbuf2 glib20 USE_GITHUB= yes GH_ACCOUNT= flatpak MESON_ARGS= -Ddocbook-docs=disabled -Dman-pages=disabled -Dpytest=disabled \ -Dflatpak-interfaces=disabled -Dsandboxed-image-validation=false \ -Dsystemd=disabled post-install: @${RM} -r ${STAGEDIR}${PREFIX}/lib/systemd .include diff --git a/deskutils/xdg-desktop-portal/files/patch-src_xdp-utils.c b/deskutils/xdg-desktop-portal/files/patch-src_xdp-utils.c new file mode 100644 index 000000000000..30e10ea526a5 --- /dev/null +++ b/deskutils/xdg-desktop-portal/files/patch-src_xdp-utils.c @@ -0,0 +1,32 @@ +Make it possible to run firefox with KDE filedialogs. + +The call for parse_app_info_from_flatpak_info uses the /proc/$PID/root +file to access the flatpak information file. + +We neither have support for /proc/$PID/root nor flatpaks or snaps. + +With this fix and deskutils/plasma5-xdg-desktop-portal-kde it is now possible +to run firefox using the KDE file dialogs. + +> GTK_USE_PORTAL=1 firefox + +--- src/xdp-utils.c.orig 2023-11-22 21:48:20 UTC ++++ src/xdp-utils.c +@@ -587,6 +587,7 @@ parse_app_info_from_flatpak_info (int pid, GError **er + static XdpAppInfo * + parse_app_info_from_flatpak_info (int pid, GError **error) + { ++#ifndef __FreeBSD__ + g_autofree char *root_path = NULL; + int root_fd = -1; + int info_fd = -1; +@@ -689,6 +690,9 @@ parse_app_info_from_flatpak_info (int pid, GError **er + app_info->u.flatpak.keyfile = g_steal_pointer (&metadata); + + return g_steal_pointer (&app_info); ++#else ++ return NULL; ++#endif // __FreeBSD__ + } + + int diff --git a/deskutils/xdg-desktop-portal/files/patch-zzz-disable_flatpak_and_snap b/deskutils/xdg-desktop-portal/files/patch-zzz-disable_flatpak_and_snap deleted file mode 100644 index c8289ab96b5b..000000000000 --- a/deskutils/xdg-desktop-portal/files/patch-zzz-disable_flatpak_and_snap +++ /dev/null @@ -1,34 +0,0 @@ -Make it possible to run firefox with KDE filedialogs. - -The call for parse_app_info_from_flatpak_info uses the /proc/$PID/root -file to access the flatpak information file. - -We neither have support for /proc/$PID/root nor flatpaks or snaps. - -With this fix and deskutils/plasma5-xdg-desktop-portal-kde it is now possible -to run firefox using the KDE file dialogs. - -> GTK_USE_PORTAL=1 firefox - ---- src/xdp-utils.c.patched 2021-07-22 16:25:27.756116000 +0200 -+++ src/xdp-utils.c 2021-07-22 16:30:51.814245000 +0200 -@@ -630,6 +630,11 @@ - g_autoptr(XdpAppInfo) app_info = NULL; - g_autoptr(GError) local_error = NULL; - -+// On FreeBSD the main use of the xdg-portal is to be able to use -+// "native" file dialogs, say the KDE file dialogs in firefox. -+// There is no support for the application package mechanisms like -+// flatpak and snap yet. -+#ifndef __FreeBSD__ - app_info = parse_app_info_from_flatpak_info (pid, &local_error); - if (app_info == NULL && local_error) - { -@@ -646,6 +651,7 @@ - return NULL; - } - } -+#endif - - if (app_info == NULL) - app_info = xdp_app_info_new_host ();