diff options
Diffstat (limited to 'sys-apps/xdg-desktop-portal')
8 files changed, 195 insertions, 138 deletions
diff --git a/sys-apps/xdg-desktop-portal/Manifest b/sys-apps/xdg-desktop-portal/Manifest index 36ef1df5823f..a8aed08dbd2d 100644 --- a/sys-apps/xdg-desktop-portal/Manifest +++ b/sys-apps/xdg-desktop-portal/Manifest @@ -1,3 +1 @@ -DIST xdg-desktop-portal-1.14.4.tar.xz 510492 BLAKE2B 32f71cbc74d6bb3010e31172972dd7bfc4c982691ef55f66c29d5cf4aa2abeed816f890800691e898f739c2c7aa13db1e04f322c89ce30e9ac8a69b87435a448 SHA512 23fa4f9fdf39f22d6eaa4f6020db5f81d272b85fe6051467c5e28a752c65b18a9b540fafe5b27725fafa29dffefcd113d873928cd78e3658895cd24d96b82f73 -DIST xdg-desktop-portal-1.14.5.tar.xz 514880 BLAKE2B ec470a54c3336c73af1cee1c589726884dc5607d7af6e68d4ea8653706fb5a33aa2bf8e45b432d4954c49fa313d62f43f658efb0222c2c706cd377bdbf74c5b7 SHA512 5ce108ca5ef7bffe292d2ac39f22e555c56b02ec1635716bb1fb71aebf9146aa1fdda1392a6c8e2c9e61f1789445eb642b91cf8d25d3aa3f196a368026aeb984 -DIST xdg-desktop-portal-1.14.6.tar.xz 515076 BLAKE2B fa39b207fa883cd15389d644eb6e6491f8619a4609d3fc9c7e92c039f7247c4b2acbc5031ec25213b61b69d1b14f1f8867b41a20f0d85e4bfd56a9d3d5d715f4 SHA512 2991f435d6808d0838b0ed64f37694dbd9128473edfbc36468e9ee289a962a8c2ec465b87c22a1571801de34bd08ea64b4570dcc3160e03fb6a07270a311e263 +DIST xdg-desktop-portal-1.18.4.tar.xz 699380 BLAKE2B 969d9359744f26a931d5d86fbdac222b0d55f7942bb8b1ffba67343c88696dbb4c905b122363c5eae5dcac8b55f58d03433acbbca6f7594a16e72e13bc78353a SHA512 482676777e8180752e13ff485acab91de117f4ecf2aefd313a6f596df800f37d7004ee4ba1040009eb69a6efc780efc7dcd7e46b3f59c47bd9f21aef48d346de 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/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/metadata.xml b/sys-apps/xdg-desktop-portal/metadata.xml index 8641e5bdd399..0b034d09a049 100644 --- a/sys-apps/xdg-desktop-portal/metadata.xml +++ b/sys-apps/xdg-desktop-portal/metadata.xml @@ -5,4 +5,11 @@ <email>kde@gentoo.org</email> <name>Gentoo KDE Project</name> </maintainer> + <use> + <flag name="flatpak">Enable <pkg>sys-apps/flatpak</pkg> integration</flag> + <flag name="seccomp">Use <pkg>sys-apps/bubblewrap</pkg> (which requires seccomp) to sandbox some functionality like icon handling</flag> + </use> + <upstream> + <remote-id type="github">flatpak/xdg-desktop-portal</remote-id> + </upstream> </pkgmetadata> diff --git a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.14.4.ebuild b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.14.4.ebuild deleted file mode 100644 index 88a0b170d6e9..000000000000 --- a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.14.4.ebuild +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit 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 screencast systemd" - -DEPEND=" - >=dev-libs/glib-2.66:2 - dev-libs/json-glib - >=sys-fs/fuse-3.10.0:3 - x11-libs/gdk-pixbuf - geolocation? ( >=app-misc/geoclue-2.5.3:2.0 ) - screencast? ( >=media-video/pipewire-0.3:= ) - systemd? ( sys-apps/systemd ) -" -RDEPEND="${DEPEND} - sys-apps/dbus -" -BDEPEND=" - dev-util/gdbus-codegen - sys-devel/gettext - virtual/pkgconfig -" - -src_configure() { - local myeconfargs=( - --disable-docbook-docs # requires flatpak - --disable-libportal # not packaged - --with-systemduserunitdir="$(systemd_get_userunitdir)" - $(use_enable geolocation geoclue) - $(use_enable screencast pipewire) - $(use_with systemd) - ) - econf "${myeconfargs[@]}" -} diff --git a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.14.5.ebuild b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.14.5.ebuild deleted file mode 100644 index b3c3088512f7..000000000000 --- a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.14.5.ebuild +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit 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 screencast systemd" - -DEPEND=" - >=dev-libs/glib-2.66:2 - dev-libs/json-glib - >=sys-fs/fuse-3.10.0:3 - x11-libs/gdk-pixbuf - geolocation? ( >=app-misc/geoclue-2.5.3:2.0 ) - screencast? ( >=media-video/pipewire-0.3:= ) - systemd? ( sys-apps/systemd ) -" -RDEPEND="${DEPEND} - sys-apps/dbus -" -BDEPEND=" - dev-util/gdbus-codegen - sys-devel/gettext - virtual/pkgconfig -" - -src_configure() { - local myeconfargs=( - --disable-docbook-docs # requires flatpak - --disable-libportal # not packaged - --with-systemduserunitdir="$(systemd_get_userunitdir)" - $(use_enable geolocation geoclue) - $(use_enable screencast pipewire) - $(use_with systemd) - ) - econf "${myeconfargs[@]}" -} diff --git a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.14.6.ebuild b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.14.6.ebuild deleted file mode 100644 index b3c3088512f7..000000000000 --- a/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.14.6.ebuild +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit 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 screencast systemd" - -DEPEND=" - >=dev-libs/glib-2.66:2 - dev-libs/json-glib - >=sys-fs/fuse-3.10.0:3 - x11-libs/gdk-pixbuf - geolocation? ( >=app-misc/geoclue-2.5.3:2.0 ) - screencast? ( >=media-video/pipewire-0.3:= ) - systemd? ( sys-apps/systemd ) -" -RDEPEND="${DEPEND} - sys-apps/dbus -" -BDEPEND=" - dev-util/gdbus-codegen - sys-devel/gettext - virtual/pkgconfig -" - -src_configure() { - local myeconfargs=( - --disable-docbook-docs # requires flatpak - --disable-libportal # not packaged - --with-systemduserunitdir="$(systemd_get_userunitdir)" - $(use_enable geolocation geoclue) - $(use_enable screencast pipewire) - $(use_with systemd) - ) - econf "${myeconfargs[@]}" -} 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 new file mode 100644 index 000000000000..889eee8e6bcb --- /dev/null +++ b/sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.4.ebuild @@ -0,0 +1,116 @@ +# Copyright 1999-2024 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 + >=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 + dev-python/docutils + 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}/${PN}-1.18.0-sandbox-disable-failing-tests.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 flatpak-interfaces) + # Only used for tests + $(meson_feature test libportal) + $(meson_feature geolocation geoclue) + $(meson_use seccomp sandboxed-image-validation) + $(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 +} |