public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/xdg-desktop-portal/, sys-apps/xdg-desktop-portal/files/
@ 2021-01-23  0:25 Andreas Sturmlechner
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Sturmlechner @ 2021-01-23  0:25 UTC (permalink / raw
  To: gentoo-commits

commit:     0b58bf6bd3490c8f8daa62e3d8c1f8c5792bbf36
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 22 21:37:10 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Jan 23 00:25:37 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b58bf6b

sys-apps/xdg-desktop-portal: xdp-utils: check if alternate doc portal

...path matches in path_for_fd()

See also: https://github.com/flatpak/xdg-desktop-portal/issues/545

Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../xdg-desktop-portal-1.8.0-fix-doc-portal.patch  | 135 +++++++++++++++++++++
 .../xdg-desktop-portal-1.8.0-r1.ebuild             |  45 +++++++
 2 files changed, 180 insertions(+)

diff --git a/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.8.0-fix-doc-portal.patch b/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.8.0-fix-doc-portal.patch
new file mode 100644
index 00000000000..46b3aaf0fb4
--- /dev/null
+++ b/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.8.0-fix-doc-portal.patch
@@ -0,0 +1,135 @@
+From 57096483afb069e69b9addcc39fe92b72051f1d2 Mon Sep 17 00:00:00 2001
+From: James Henstridge <james@jamesh.id.au>
+Date: Tue, 24 Nov 2020 15:48:19 +0800
+Subject: [PATCH] xdp-utils: check if alternate doc portal path matches in
+ path_for_fd()
+
+The document portal uses different inode number when exposing a
+particular document in different parts of the file system.  As sandboxed
+apps only have a subtree of the document portal file system mounted, the
+"same file" checks in xdp_app_info_get_path_for_fd() would fail for
+document portal paths.
+
+To fix this, we check to see whether the corresponding "by-app/$app_id"
+path matches the stat information of the file descriptor.
+
+Fixes #545
+---
+ document-portal/document-portal.c |  2 ++
+ src/documents.c                   |  2 ++
+ src/xdp-utils.c                   | 47 +++++++++++++++++++++++++++++--
+ src/xdp-utils.h                   |  3 ++
+ 5 files changed, 85 insertions(+), 2 deletions(-)
+
+diff --git a/document-portal/document-portal.c b/document-portal/document-portal.c
+index a4c044a..a4aacc4 100644
+--- a/document-portal/document-portal.c
++++ b/document-portal/document-portal.c
+@@ -1448,6 +1448,8 @@ on_name_acquired (GDBusConnection *connection,
+ 
+   fuse_dev = stbuf.st_dev;
+ 
++  xdp_set_documents_mountpoint (xdp_fuse_get_mountpoint ());
++
+   while ((invocation = g_queue_pop_head (&get_mount_point_invocations)) != NULL)
+     {
+       xdp_dbus_documents_complete_get_mount_point (dbus_api, invocation, xdp_fuse_get_mountpoint ());
+diff --git a/src/documents.c b/src/documents.c
+index 99de9e4..9ddc4ac 100644
+--- a/src/documents.c
++++ b/src/documents.c
+@@ -31,6 +31,7 @@
+ #include <gio/gunixfdlist.h>
+ 
+ #include "xdp-dbus.h"
++#include "xdp-utils.h"
+ #include "document-enums.h"
+ 
+ static XdpDocuments *documents = NULL;
+@@ -46,6 +47,7 @@ init_document_proxy (GDBusConnection *connection)
+   xdp_documents_call_get_mount_point_sync (documents,
+                                            &documents_mountpoint,
+                                            NULL, NULL);
++  xdp_set_documents_mountpoint (documents_mountpoint);
+ }
+ 
+ char *
+diff --git a/src/xdp-utils.c b/src/xdp-utils.c
+index fa6ca6f..ef68f0f 100644
+--- a/src/xdp-utils.c
++++ b/src/xdp-utils.c
+@@ -884,6 +884,35 @@ verify_proc_self_fd (XdpAppInfo *app_info,
+   return xdp_app_info_remap_path (app_info, path_buffer);
+ }
+ 
++static char *documents_mountpoint = NULL;
++
++void
++xdp_set_documents_mountpoint (const char *path)
++{
++  g_clear_pointer (&documents_mountpoint, g_free);
++  documents_mountpoint = g_strdup (path);
++}
++
++/* alternate_document_path converts a file path  */
++char *
++xdp_get_alternate_document_path (const char *path, const char *app_id)
++{
++  int len;
++
++  /* If we don't know where the document portal is mounted, then there
++   * is no alternate path */
++  if (documents_mountpoint == NULL)
++    return NULL;
++
++  /* If the path is not within the document portal, then there is no
++   * alternative path */
++  len = strlen (documents_mountpoint);
++  if (!g_str_has_prefix (path, documents_mountpoint) || path[len] != '/')
++    return NULL;
++
++  return g_strconcat (documents_mountpoint, "/by-app/", app_id, &path[len], NULL);
++}
++
+ char *
+ xdp_app_info_get_path_for_fd (XdpAppInfo *app_info,
+                               int fd,
+@@ -981,8 +1010,22 @@ xdp_app_info_get_path_for_fd (XdpAppInfo *app_info,
+       st_buf->st_dev != real_st_buf.st_dev ||
+       st_buf->st_ino != real_st_buf.st_ino)
+     {
+-      /* Different files on the inside and the outside, reject the request */
+-      return NULL;
++      /* If the path is provided by the document portal, the inode
++         number will not match, due to only a subtree being mounted in
++         the sandbox.  So we check to see if the equivalent path
++         within that subtree matches our file descriptor.
++
++         If the alternate path doesn't match either, then we treat it
++         as a failure.
++      */
++      g_autofree char *alt_path = NULL;
++      alt_path = xdp_get_alternate_document_path (path, xdp_app_info_get_id (app_info));
++
++      if (alt_path == NULL ||
++          stat (alt_path, &real_st_buf) < 0 ||
++          st_buf->st_dev != real_st_buf.st_dev ||
++          st_buf->st_ino != real_st_buf.st_ino)
++        return NULL;
+     }
+ 
+   if (writable_out)
+diff --git a/src/xdp-utils.h b/src/xdp-utils.h
+index 7105bce..fea28b8 100644
+--- a/src/xdp-utils.h
++++ b/src/xdp-utils.h
+@@ -88,6 +88,9 @@ char **     xdp_app_info_rewrite_commandline (XdpAppInfo *app_info,
+ 
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(XdpAppInfo, xdp_app_info_unref)
+ 
++void  xdp_set_documents_mountpoint    (const char *path);
++char *xdp_get_alternate_document_path (const char *path, const char *app_id);
++
+ XdpAppInfo *xdp_invocation_lookup_app_info_sync (GDBusMethodInvocation *invocation,
+                                                  GCancellable          *cancellable,
+                                                  GError               **error);

diff --git a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.8.0-r1.ebuild b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.8.0-r1.ebuild
new file mode 100644
index 00000000000..bb8cc5472f0
--- /dev/null
+++ b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.8.0-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools systemd
+
+DESCRIPTION="Desktop integration portal"
+HOMEPAGE="https://flatpak.org/ https://github.com/flatpak/xdg-desktop-portal"
+SRC_URI="https://github.com/flatpak/${PN}/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
+IUSE="geolocation screencast"
+
+BDEPEND="
+	dev-util/gdbus-codegen
+	sys-devel/gettext
+	virtual/pkgconfig
+"
+DEPEND="
+	dev-libs/glib:2
+	dev-libs/json-glib
+	media-libs/fontconfig
+	sys-fs/fuse:0
+	geolocation? ( >=app-misc/geoclue-2.5.3:2.0 )
+	screencast? ( >=media-video/pipewire-0.3:= )
+"
+RDEPEND="${DEPEND}
+	sys-apps/dbus
+"
+
+PATCHES=( "${FILESDIR}/${P}-fix-doc-portal.patch" )
+
+src_configure() {
+	local myeconfargs=(
+		--with-systemduserunitdir="$(systemd_get_userunitdir)"
+		$(use_enable geolocation geoclue)
+		$(use_enable screencast pipewire)
+		--disable-docbook-docs # flatpak not packaged
+		--disable-libportal # not packaged
+	)
+	econf "${myeconfargs[@]}"
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-apps/xdg-desktop-portal/, sys-apps/xdg-desktop-portal/files/
@ 2023-09-22  6:40 Andrew Ammerlaan
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Ammerlaan @ 2023-09-22  6:40 UTC (permalink / raw
  To: gentoo-commits

commit:     de9365facce0ed2d37216f8cd73c64d7ef2b2a64
Author:     Guillermo Joandet <gjoandet <AT> gmail <DOT> com>
AuthorDate: Sat Aug  5 05:29:08 2023 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Fri Sep 22 06:37:51 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de9365fa

sys-apps/xdg-desktop-portal: Version bump to 1.18.0

Signed-off-by: Guillermo Joandet <gjoandet <AT> gmail.com>
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 sys-apps/xdg-desktop-portal/Manifest               |  1 +
 ...rtal-1.18.0-sandbox-disable-failing-tests.patch | 69 +++++++++++++++++
 .../xdg-desktop-portal-1.18.0.ebuild               | 89 ++++++++++++++++++++++
 3 files changed, 159 insertions(+)

diff --git a/sys-apps/xdg-desktop-portal/Manifest b/sys-apps/xdg-desktop-portal/Manifest
index 1a7ceb2245bd..3518f9b5a90e 100644
--- a/sys-apps/xdg-desktop-portal/Manifest
+++ b/sys-apps/xdg-desktop-portal/Manifest
@@ -1 +1,2 @@
 DIST xdg-desktop-portal-1.16.0.tar.xz 250524 BLAKE2B 9d5bd760621b114a19c1cc8895f91c43fcfed0dd067ba9678de0f11dc7835ec29c4a2c452274adbd36ee1318359caa8d7ca0c585558eb73a2a4e53528e6b02da SHA512 f7e7e96d3a6757901fbc4c0310aac0afbf37882c279a2859e06f63528049cd9b50dd2d55445d1386f03f62557c1a2ec81d4ee081200367d6269d2dffc75f0912
+DIST xdg-desktop-portal-1.18.0.tar.xz 260788 BLAKE2B 3a7575af17a5b21d6f313a098a9144df9d6f24768c6e16e4fb45382fac3c64aab3b361b29226769c8cc979c278ec61469f32841792bb0f4e7d9e83fc1fab40fc SHA512 416c0736342b2909c10db025da72edca6d106b46224341bdf45ab41152c01b97f4a4eb78df924a6fbc771475bf103c1aea3005d8ff683f1eca935dbd1afe4a51

diff --git a/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.18.0-sandbox-disable-failing-tests.patch b/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.18.0-sandbox-disable-failing-tests.patch
new file mode 100644
index 000000000000..148888f43b6f
--- /dev/null
+++ b/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.18.0-sandbox-disable-failing-tests.patch
@@ -0,0 +1,69 @@
+diff --git a/tests/meson.build b/tests/meson.build
+index a2dafee..ec2b628 100644
+--- a/tests/meson.build
++++ b/tests/meson.build
+@@ -163,20 +163,15 @@ limited_portals = executable(
+ portal_tests = [
+   'account',
+   'background',
+-  'camera',
+   'color',
+   'email',
+-  'inhibit',
+-  'location',
+   'notification',
+   'openfile',
+-  'openuri',
+   'prepareprint',
+   'print',
+   'savefile',
+   'screenshot',
+   'trash',
+-  'wallpaper',
+ ]
+ 
+ test_env = env_tests
+diff --git a/tests/test_globalshortcuts.py b/tests/test_globalshortcuts.py
+index 56349cb..da0656d 100644
+--- a/tests/test_globalshortcuts.py
++++ b/tests/test_globalshortcuts.py
+@@ -20,7 +20,7 @@ class TestGlobalShortcuts:
+     def test_version(self, portal_mock):
+         portal_mock.check_version(1)
+ 
+-    def test_global_shortcuts_create_close_session(self, portal_mock):
++    def _test_global_shortcuts_create_close_session(self, portal_mock):
+         request = portal_mock.create_request()
+         options = {
+             "session_handle_token": "session_token0",
+@@ -49,7 +49,7 @@ class TestGlobalShortcuts:
+         assert session.closed
+ 
+     @pytest.mark.parametrize("params", ({"force-close": 500},))
+-    def test_global_shortcuts_create_session_signal_closed(self, portal_mock):
++    def _test_global_shortcuts_create_session_signal_closed(self, portal_mock):
+         request = portal_mock.create_request()
+         options = {
+             "session_handle_token": "session_token0",
+diff --git a/tests/test_remotedesktop.py b/tests/test_remotedesktop.py
+index 49b6b18..77648bc 100644
+--- a/tests/test_remotedesktop.py
++++ b/tests/test_remotedesktop.py
+@@ -20,7 +20,7 @@ class TestRemoteDesktop:
+     def test_version(self, portal_mock):
+         portal_mock.check_version(2)
+ 
+-    def test_remote_desktop_create_close_session(self, portal_mock):
++    def _test_remote_desktop_create_close_session(self, portal_mock):
+         request = portal_mock.create_request()
+         options = {
+             "session_handle_token": "session_token0",
+@@ -49,7 +49,7 @@ class TestRemoteDesktop:
+         assert session.closed
+ 
+     @pytest.mark.parametrize("params", ({"force-close": 500},))
+-    def test_remote_desktop_create_session_signal_closed(self, portal_mock):
++    def _test_remote_desktop_create_session_signal_closed(self, portal_mock):
+         request = portal_mock.create_request()
+         options = {
+             "session_handle_token": "session_token0",

diff --git a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.0.ebuild b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.0.ebuild
new file mode 100644
index 000000000000..c06c7f539604
--- /dev/null
+++ b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.0.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit meson python-any-r1 systemd
+
+DESCRIPTION="Desktop integration portal"
+HOMEPAGE="https://flatpak.org/ https://github.com/flatpak/xdg-desktop-portal"
+SRC_URI="https://github.com/flatpak/${PN}/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+IUSE="geolocation man systemd test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+	>=dev-libs/glib-2.66:2
+	dev-libs/json-glib
+	>=sys-fs/fuse-3.10.0:3[suid]
+	x11-libs/gdk-pixbuf
+	geolocation? ( >=app-misc/geoclue-2.5.3:2.0 )
+	>=media-video/pipewire-0.3:=
+	systemd? ( sys-apps/systemd )
+	test? (
+		dev-libs/libportal
+	)
+	man? ( dev-python/docutils )
+"
+RDEPEND="${DEPEND}
+	sys-apps/dbus
+"
+BDEPEND="
+	dev-util/gdbus-codegen
+	sys-devel/gettext
+	virtual/pkgconfig
+	test? (
+		${PYTHON_DEPS}
+		$(python_gen_any_dep '
+			dev-python/pytest[${PYTHON_USEDEP}]
+			dev-python/python-dbusmock[${PYTHON_USEDEP}]
+		')
+	)
+"
+
+PATCHES=(
+	# These tests require connections to pipewire, internet, /dev/fuse
+	"${FILESDIR}/${P}-sandbox-disable-failing-tests.patch"
+)
+
+python_check_deps() {
+	python_has_version "dev-python/pytest[${PYTHON_USEDEP}]" &&
+	python_has_version "dev-python/python-dbusmock[${PYTHON_USEDEP}]"
+}
+
+src_configure() {
+	local emesonargs=(
+		-Ddbus-service-dir="${EPREFIX}/usr/share/dbus-1/services"
+		-Dflatpak-interfaces-dir="${EPREFIX}/usr/share/dbus-1/interfaces"
+		-Dsystemd-user-unit-dir="$(systemd_get_userunitdir)"
+		$(meson_feature test libportal)     # Only used for tests
+		$(meson_feature geolocation geoclue)
+		$(meson_feature systemd)
+		-Ddocbook-docs=disabled  # requires flatpak
+		# -Dxmlto-flags=
+		-Ddatarootdir="${EPREFIX}/usr/share"
+		-Dinstalled-tests=false
+		$(meson_feature test pytest)
+		$(meson_feature man man-pages)
+	)
+	meson_src_configure
+}
+
+pkg_postinst() {
+	if ! has_version gui-libs/xdg-desktop-portal-lxqt && ! has_version gui-libs/xdg-desktop-portal-wlr && \
+		! has_version kde-plasma/xdg-desktop-portal-kde && ! has_version sys-apps/xdg-desktop-portal-gnome && \
+		! has_version sys-apps/xdg-desktop-portal-gtk; then
+		elog "${PN} is not usable without any of the following XDP"
+		elog "implementations installed:"
+		elog "  gui-libs/xdg-desktop-portal-lxqt"
+		elog "  gui-libs/xdg-desktop-portal-wlr"
+		elog "  kde-plasma/xdg-desktop-portal-kde"
+		elog "  sys-apps/xdg-desktop-portal-gnome"
+		elog "  sys-apps/xdg-desktop-portal-gtk"
+	fi
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-apps/xdg-desktop-portal/, sys-apps/xdg-desktop-portal/files/
@ 2023-10-14  2:26 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-10-14  2:26 UTC (permalink / raw
  To: gentoo-commits

commit:     c551c46f7f8ce26730d6424552e83fb4d74a63e2
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 14 02:20:56 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Oct 14 02:21:41 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c551c46f

sys-apps/xdg-desktop-portal: provide default portal config

Install a default to avoid breakage: >=1.18.0 assumes that DEs/WMs
will install their own, but we want some fallback in case they don't
(so will probably keep this forever). DEs need time to catch up even
if they will eventually provide one anyway. See bug #915356.

TODO: Add some docs on wiki for users to add their own preference
for minimalist WMs etc.

Thanks to abby from Void for pointing me to https://github.com/void-linux/void-packages/commit/b4c404aac0af3ced08671a8840cd261198689cef
and psykose as well.

Bug: https://github.com/flatpak/xdg-desktop-portal/issues/1017
Bug: https://github.com/flatpak/xdg-desktop-portal/issues/1077
Bug: https://github.com/flatpak/xdg-desktop-portal/issues/1102
Closes: https://bugs.gentoo.org/915356
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../xdg-desktop-portal/files/default-portals.conf  |   2 +
 .../xdg-desktop-portal-1.18.0-r2.ebuild            | 121 +++++++++++++++++++++
 2 files changed, 123 insertions(+)

diff --git a/sys-apps/xdg-desktop-portal/files/default-portals.conf b/sys-apps/xdg-desktop-portal/files/default-portals.conf
new file mode 100644
index 000000000000..028e24d2bbee
--- /dev/null
+++ b/sys-apps/xdg-desktop-portal/files/default-portals.conf
@@ -0,0 +1,2 @@
+[preferred]
+default=*

diff --git a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.0-r2.ebuild b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.0-r2.ebuild
new file mode 100644
index 000000000000..a5c4f5c61cce
--- /dev/null
+++ b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.0-r2.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit meson python-any-r1 systemd
+
+DESCRIPTION="Desktop integration portal"
+HOMEPAGE="https://flatpak.org/ https://github.com/flatpak/xdg-desktop-portal"
+SRC_URI="https://github.com/flatpak/${PN}/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+IUSE="geolocation flatpak seccomp systemd test"
+RESTRICT="!test? ( test )"
+# Upstream expect flatpak to be used w/ seccomp and flatpak needs bwrap anyway
+REQUIRED_USE="flatpak? ( seccomp )"
+
+DEPEND="
+	>=dev-libs/glib-2.66:2
+	dev-libs/json-glib
+	dev-python/docutils
+	>=media-video/pipewire-0.3:=
+	>=sys-fs/fuse-3.10.0:3[suid]
+	x11-libs/gdk-pixbuf
+	geolocation? ( >=app-misc/geoclue-2.5.3:2.0 )
+	flatpak? ( sys-apps/flatpak )
+	seccomp? ( sys-apps/bubblewrap )
+	systemd? ( sys-apps/systemd )
+"
+RDEPEND="
+	${DEPEND}
+	sys-apps/dbus
+"
+BDEPEND="
+	dev-util/gdbus-codegen
+	sys-devel/gettext
+	virtual/pkgconfig
+	test? (
+		${PYTHON_DEPS}
+		dev-libs/libportal
+		$(python_gen_any_dep '
+			dev-python/pytest[${PYTHON_USEDEP}]
+			dev-python/pytest-xdist[${PYTHON_USEDEP}]
+			dev-python/python-dbusmock[${PYTHON_USEDEP}]
+		')
+	)
+"
+
+PATCHES=(
+	# These tests require connections to pipewire, internet, /dev/fuse
+	"${FILESDIR}/${P}-sandbox-disable-failing-tests.patch"
+
+	# https://github.com/flatpak/xdg-desktop-portal/pull/1100
+	"${FILESDIR}/0001-meson.build-allow-linux-to-build-without-flatpak-ins.patch"
+	"${FILESDIR}/0002-meson.build-allow-linux-to-build-without-bubblewrap.patch"
+	"${FILESDIR}/0003-Make-flatpak-bwrap-optional.patch"
+)
+
+pkg_setup() {
+	use test && python-any-r1_pkg_setup
+}
+
+python_check_deps() {
+	python_has_version "dev-python/pytest[${PYTHON_USEDEP}]" &&
+	python_has_version "dev-python/pytest-xdist[${PYTHON_USEDEP}]" &&
+	python_has_version "dev-python/python-dbusmock[${PYTHON_USEDEP}]"
+}
+
+src_configure() {
+	local emesonargs=(
+		-Ddbus-service-dir="${EPREFIX}/usr/share/dbus-1/services"
+		-Dsystemd-user-unit-dir="$(systemd_get_userunitdir)"
+		$(meson_feature flatpak)
+		# Only used for tests
+		$(meson_feature test libportal)
+		$(meson_feature geolocation geoclue)
+		$(meson_feature seccomp bwrap)
+		$(meson_feature systemd)
+		# Requires flatpak
+		-Ddocbook-docs=disabled
+		# -Dxmlto-flags=
+		-Ddatarootdir="${EPREFIX}/usr/share"
+		-Dman-pages=enabled
+		-Dinstalled-tests=false
+		$(meson_feature test pytest)
+	)
+
+	meson_src_configure
+}
+
+src_install() {
+	meson_src_install
+
+	# Install a default to avoid breakage: >=1.18.0 assumes that DEs/WMs
+	# will install their own, but we want some fallback in case they don't
+	# (so will probably keep this forever). DEs need time to catch up even
+	# if they will eventually provide one anyway. See bug #915356.
+	#
+	# TODO: Add some docs on wiki for users to add their own preference
+	# for minimalist WMs etc.
+	insinto /usr/share/xdg-desktop-portal
+	newins "${FILESDIR}"/default-portals.conf portals.conf
+}
+
+pkg_postinst() {
+	if ! has_version gui-libs/xdg-desktop-portal-lxqt && ! has_version gui-libs/xdg-desktop-portal-wlr && \
+		! has_version kde-plasma/xdg-desktop-portal-kde && ! has_version sys-apps/xdg-desktop-portal-gnome && \
+		! has_version sys-apps/xdg-desktop-portal-gtk; then
+		elog "${PN} is not usable without any of the following XDP"
+		elog "implementations installed:"
+		elog "  gui-libs/xdg-desktop-portal-lxqt"
+		elog "  gui-libs/xdg-desktop-portal-wlr"
+		elog "  kde-plasma/xdg-desktop-portal-kde"
+		elog "  sys-apps/xdg-desktop-portal-gnome"
+		elog "  sys-apps/xdg-desktop-portal-gtk"
+	fi
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-14  2:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-22  6:40 [gentoo-commits] repo/gentoo:master commit in: sys-apps/xdg-desktop-portal/, sys-apps/xdg-desktop-portal/files/ Andrew Ammerlaan
  -- strict thread matches above, loose matches on Subject: below --
2023-10-14  2:26 Sam James
2021-01-23  0:25 Andreas Sturmlechner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox