xdg-desktop-portal is a D-Bus service that allows applications to interact with the desktop in a safe way. Several aspects of desktop interaction, like file chooser, desktop style, etc are implemented in different D-Bus APIs, known as portals. Sandboxed applications benefit the most from this service since they don't need special permissions to use the portal APIs, but any application can use it. xdg-desktop-portal safeguards many resources and features with a user-controlled permission system. This service needs a backend implementing desktop-specific portal interfaces.
Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.
Download (HTTP): https://github.com/flatpak/xdg-desktop-portal/releases/download/1.18.4/xdg-desktop-portal-1.18.4.tar.xz
Download MD5 sum: 4ebe7be08961456544d0ceeca22a03ea
Download size: 684 KB
Estimated disk space required: 34 MB (with tests)
Estimated build time: 0.1 SBU (add 0.3 SBU for tests; with parallelism=4)
Fuse-3.16.2, gdk-pixbuf-2.42.12, JSON-GLib-1.10.0, pipewire-1.2.7, and dbus-1.14.10 (at runtime). Furthermore, a backend is needed at runtime for this package to be of any use, either xdg-desktop-portal-gtk-1.15.1 or xdg-desktop-portal-gnome-47.1 or xdg-desktop-portal-lxqt-1.1.0
bubblewrap-0.11.0 and docutils-0.21.2 (for building the manual pages)
Although there is an option to build the package without bubblewrap, upstream developers and LFS editors alike highly recommend to not use this possibility, as it will create a large security issue.
GeoClue-2.7.2 (for the “location” portal), and pytest-8.3.4 with libportal-0.8.1 and dbusmock-0.32.2 (for running tests)
sphinx-8.1.3 with sphinxext.opengraph, sphinx_copybutton, furo, and flatpak
Install xdg-desktop-portal by running the following commands:
mkdir build && cd build && meson setup --prefix=/usr --buildtype=release .. && ninja
If you have installed the needed dependencies, you can test the results by running ninja test. Six tests are known to fail if you are not using gnome-terminal-3.54.2 and are in GNOME.
Now, as the root
user:
ninja install
The main configuration files are ~/.config/xdg-desktop-portal/portals.conf
,
/etc/xdg-desktop-portal/portals.conf
, and
/usr/share/xdg-desktop-portal/portals.conf
.
Several other locations can be searched for configuration files.
See portals.conf(5).
The various configuration files are used to choose the backend depending of various conditions. See portals.conf(5) for details.