diff --git a/deskutils/xdg-desktop-portal/Makefile b/deskutils/xdg-desktop-portal/Makefile index 8619ed9cf75a..31eaac2be18c 100644 --- a/deskutils/xdg-desktop-portal/Makefile +++ b/deskutils/xdg-desktop-portal/Makefile @@ -1,36 +1,37 @@ PORTNAME= xdg-desktop-portal PORTVERSION= 1.8.1 +PORTREVISION= 1 CATEGORIES= deskutils PATCH_SITES= https://patch-diff.githubusercontent.com/raw/flatpak/xdg-desktop-portal/pull/:freebsd_compat PATCHFILES= 532.patch:-p1:freebsd_compat MAINTAINER= arrowd@FreeBSD.org COMMENT= Portal frontend service for Flatpak LICENSE= LGPL21 LIB_DEPENDS= libfuse.so:sysutils/fusefs-libs \ libgeoclue-2.so:net/geoclue \ libjson-glib-1.0.so:devel/json-glib \ libpipewire-0.3.so:multimedia/pipewire \ libportal.so:deskutils/libportal USES= autoreconf gettext-tools gmake gnome libtool pkgconfig USE_GNOME= glib20 GNU_CONFIGURE= yes USE_GITHUB= yes GH_ACCOUNT= flatpak .include .if (${OSVERSION} >= 1400000 && ${OSVERSION} < 1400008) \ || (${OSVERSION} >= 1300000 && ${OSVERSION} < 1300501) \ || ${OSVERSION} < 1300000 IGNORE= requires O_PATH support in open(2) .endif .include 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 new file mode 100644 index 000000000000..c8289ab96b5b --- /dev/null +++ b/deskutils/xdg-desktop-portal/files/patch-zzz-disable_flatpak_and_snap @@ -0,0 +1,34 @@ +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 ();