* [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; 5+ 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] 5+ 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; 5+ 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] 5+ 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; 5+ 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] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/xdg-desktop-portal/, sys-apps/xdg-desktop-portal/files/
@ 2025-02-28 12:08 Sam James
0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-02-28 12:08 UTC (permalink / raw
To: gentoo-commits
commit: 97e7889ff8bd49e52fe72d5408ccd4bf6659ee22
Author: Anna (navi) Figueiredo Gomes <navi <AT> vlhl <DOT> dev>
AuthorDate: Thu Feb 27 10:51:00 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 28 12:07:08 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97e7889f
sys-apps/xdg-desktop-portal: add user initd
Signed-off-by: Anna (navi) Figueiredo Gomes <navi <AT> vlhl.dev>
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/xdg-desktop-portal/files/xdg-desktop-portal.initd | 11 +++++++++++
...rtal-1.18.4.ebuild => xdg-desktop-portal-1.18.4-r1.ebuild} | 6 ++++--
sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4.ebuild | 2 +-
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal.initd b/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal.initd
new file mode 100644
index 000000000000..5fe428be554f
--- /dev/null
+++ b/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+depend() {
+ need dbus
+}
+
+DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
+supervisor=supervise-daemon
+command="/usr/libexec/xdg-desktop-portal"
diff --git a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4.ebuild b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4-r1.ebuild
similarity index 94%
copy from sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4.ebuild
copy to sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4-r1.ebuild
index 995a8b46daf0..6948deab963d 100644
--- a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4.ebuild
+++ b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -13,7 +13,7 @@ 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"
+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
@@ -99,6 +99,8 @@ src_install() {
# for minimalist WMs etc.
insinto /usr/share/xdg-desktop-portal
newins "${FILESDIR}"/default-portals.conf portals.conf
+ exeinto /etc/user/init.d
+ newexe "${FILESDIR}"/xdg-desktop-portal.initd xdg-desktop-portal
}
pkg_postinst() {
diff --git a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4.ebuild b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4.ebuild
index 995a8b46daf0..86612571b2ab 100644
--- a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4.ebuild
+++ b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/xdg-desktop-portal/, sys-apps/xdg-desktop-portal/files/
@ 2025-03-19 22:50 Sam James
0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-03-19 22:50 UTC (permalink / raw
To: gentoo-commits
commit: 9d2c7e21b776f68866e045407c10e6b1133b189f
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 19 22:49:00 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Mar 19 22:50:11 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d2c7e21
sys-apps/xdg-desktop-portal: avoid gstreamer harder for now
gstreamer is searched for unconditionally, but we don't have gstreamer-pbutils
packaged yet, so that's a problem. Make it conditional for now (as it ought
to be upstream either way if they're going to have an option for it).
Noticed the upstream bug link and got the patch (tweaked style slightly
after) from flint2's PR at https://github.com/gentoo/gentoo/pull/41133.
Closes: https://bugs.gentoo.org/951609
Closes: https://bugs.gentoo.org/951611
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-desktop-portal-1.20.0-optional-gstreamer.patch | 104 +++++++++++++++++++++
...rtal-1.20.0-sandbox-disable-failing-tests.patch | 7 +-
.../xdg-desktop-portal-1.20.0.ebuild | 3 +
3 files changed, 111 insertions(+), 3 deletions(-)
diff --git a/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.20.0-optional-gstreamer.patch b/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.20.0-optional-gstreamer.patch
new file mode 100644
index 000000000000..e89844a8345f
--- /dev/null
+++ b/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.20.0-optional-gstreamer.patch
@@ -0,0 +1,104 @@
+https://bugs.gentoo.org/951611
+https://bugs.gentoo.org/951609
+https://github.com/flatpak/xdg-desktop-portal/issues/1650
+https://github.com/flint2/gentoo/blob/7c8a4b4deb84826f20a7c8af1a0f125cd4942b4a/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.20.0-disable-gstreamer.patch
+
+gstreamer is searched for unconditionally, but we don't have gstreamer-pbutils
+packaged yet, so that's a problem. Make it conditional for now (as it ought
+to be upstream either way if they're going to have an option for it).
+--- a/meson.build
++++ b/meson.build
+@@ -112,7 +112,7 @@ gio_unix_dep = dependency('gio-unix-2.0')
+ json_glib_dep = dependency('json-glib-1.0')
+ fuse3_dep = dependency('fuse3', version: '>= 3.10.0')
+ gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0')
+-gst_pbutils_dep = dependency('gstreamer-pbutils-1.0')
++gst_pbutils_dep = dependency('gstreamer-pbutils-1.0', required: get_option('sandboxed-sound-validation'))
+ geoclue_dep = dependency(
+ 'libgeoclue-2.0',
+ version: '>= 2.5.2',
+@@ -122,8 +122,8 @@ pipewire_dep = dependency('libpipewire-0.3', version: '>= 0.2.90')
+ libsystemd_dep = dependency('libsystemd', required: get_option('systemd'))
+ gudev_dep = dependency('gudev-1.0', required: get_option('gudev'))
+ umockdev_dep = dependency('umockdev-1.0', required: get_option('tests'))
+-
+-gst_inspect = find_program('gst-inspect-1.0', required: false)
++gst_inspect = find_program('gst-inspect-1.0', required: get_option('sandboxed-sound-validation'))
++have_gst_inspect = gst_inspect.found()
+ if gst_inspect.found()
+ have_wav_parse = run_command(
+ gst_inspect, 'wavparse', '--exists',
+@@ -132,6 +132,7 @@ if gst_inspect.found()
+ else
+ have_wav_parse = false
+ endif
++
+ if have_wav_parse
+ config_h.set('HAVE_WAV_PARSE', 1)
+ endif
+@@ -224,7 +225,7 @@ enable_tests = get_option('tests') \
+ .require(python.found() and python.language_version().version_compare('>=3.9'),
+ error_message: 'Python version >=3.9 is required') \
+ .require(umockdev_dep.found()) \
+- .require(have_wav_parse,
++ .require(not have_wav_parse and not get_option('sandboxed-sound-validation').allowed(),
+ error_message: 'gst-inspect and the wavparse plugins are required') \
+ .allowed()
+
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -206,14 +206,16 @@ if bwrap.found()
+ validate_sound_c_args += '-DHELPER="@0@"'.format(bwrap.full_path())
+ endif
+
+-xdp_validate_sound = executable(
+- 'xdg-desktop-portal-validate-sound',
+- 'validate-sound.c',
+- dependencies: [gst_pbutils_dep],
+- c_args: validate_sound_c_args,
+- install: true,
+- install_dir: libexecdir,
+-)
++if gst_inspect.found()
++ xdp_validate_sound = executable(
++ 'xdg-desktop-portal-validate-sound',
++ 'validate-sound.c',
++ dependencies: [gst_pbutils_dep],
++ c_args: validate_sound_c_args,
++ install: true,
++ install_dir: libexecdir,
++ )
++endif
+
+ configure_file(
+ input: 'xdg-desktop-portal-rewrite-launchers.service.in',
+--- a/tests/meson.build
++++ b/tests/meson.build
+@@ -94,7 +94,6 @@ pytest_files = [
+ 'test_inhibit.py',
+ 'test_inputcapture.py',
+ 'test_location.py',
+- 'test_notification.py',
+ 'test_openuri.py',
+ 'test_permission_store.py',
+ 'test_print.py',
+@@ -122,7 +121,6 @@ template_files = [
+ 'templates/__init__.py',
+ 'templates/inputcapture.py',
+ 'templates/lockdown.py',
+- 'templates/notification.py',
+ 'templates/print.py',
+ 'templates/remotedesktop.py',
+ 'templates/screenshot.py',
+@@ -131,6 +129,11 @@ template_files = [
+ 'templates/wallpaper.py',
+ ]
+
++if have_gst_inspect
++ template_files += ['templates/notification.py']
++ pytest_files += ['test_notification.py']
++endif
++
+ foreach pytest_file : pytest_files
+ testname = pytest_file.replace('.py', '').replace('test_', '')
+ test(
diff --git a/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.20.0-sandbox-disable-failing-tests.patch b/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.20.0-sandbox-disable-failing-tests.patch
index 2faee17533cb..42162dafc571 100644
--- a/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.20.0-sandbox-disable-failing-tests.patch
+++ b/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.20.0-sandbox-disable-failing-tests.patch
@@ -1,6 +1,8 @@
+diff --git a/tests/meson.build b/tests/meson.build
+index 377d48a..8a6ebe0 100644
--- a/tests/meson.build
+++ b/tests/meson.build
-@@ -87,14 +87,11 @@ pytest_files = [
+@@ -87,13 +87,11 @@ pytest_files = [
'test_clipboard.py',
'test_documents.py',
'test_document_fuse.py',
@@ -11,11 +13,10 @@
'test_inhibit.py',
'test_inputcapture.py',
- 'test_location.py',
-- 'test_notification.py',
'test_openuri.py',
'test_permission_store.py',
'test_print.py',
-@@ -188,4 +185,4 @@ if enable_installed_tests
+@@ -191,4 +189,4 @@ if enable_installed_tests
install_dir: installed_tests_data_dir,
)
endforeach
diff --git a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.20.0.ebuild b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.20.0.ebuild
index dbffadc6d97c..90a013fc9354 100644
--- a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.20.0.ebuild
+++ b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.20.0.ebuild
@@ -54,6 +54,8 @@ BDEPEND="
"
PATCHES=(
+ # Needed until gstreamer-rs (for gstreamer-pbutils) is packaged
+ "${FILESDIR}/${PN}-1.20.0-optional-gstreamer.patch"
# These tests require connections to pipewire, internet, /dev/fuse
"${FILESDIR}/${PN}-1.20.0-sandbox-disable-failing-tests.patch"
)
@@ -79,6 +81,7 @@ src_configure() {
# Needs gstreamer-pbutils (part of gstreamer-rs)?
# Not yet packaged
#$(meson_feature seccomp sandboxed-sound-validation)
+ -Dsandboxed-sound-validation=disabled
$(meson_feature systemd)
# Requires flatpak
-Ddocumentation=disabled
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-03-19 22:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-14 2:26 [gentoo-commits] repo/gentoo:master commit in: sys-apps/xdg-desktop-portal/, sys-apps/xdg-desktop-portal/files/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2025-03-19 22:50 Sam James
2025-02-28 12:08 Sam James
2023-09-22 6:40 Andrew Ammerlaan
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