summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-09-22 17:53:37 +0100
committerSam James <sam@gentoo.org>2023-09-22 18:01:21 +0100
commitb17fcfae7a5b01d42d887380cb74386c00a6e6bd (patch)
treeaf005b3da6c0fec7a23c8564f5b37f15da7c8f06 /sys-apps/xdg-desktop-portal
parentsys-apps/xdg-desktop-portal: Fix python_setup for USE="-test" (diff)
downloadgentoo-b17fcfae7a5b01d42d887380cb74386c00a6e6bd.tar.gz
gentoo-b17fcfae7a5b01d42d887380cb74386c00a6e6bd.tar.bz2
gentoo-b17fcfae7a5b01d42d887380cb74386c00a6e6bd.zip
sys-apps/xdg-desktop-portal: various fixes
* Fix missing flatpak, bubblewrap dependencies. 1.18.0 makes these mandatory by way of dropping autotools support. Previous versions always required this in their meson build system, but we didn't use meson before. Include a variant of https://github.com/flatpak/xdg-desktop-portal/pull/1100 on top to make flatpak optional as well as bubblewrap (we need the latter optional because not all of our platforms support seccomp). * Fix dependency sorting. Only GNOME uses the 'in order of build system' rule, others usually do alphabetical. * Always install man pages per QA policy. Bug: https://bugs.gentoo.org/914510 Fixes: de9365facce0ed2d37216f8cd73c64d7ef2b2a64 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-apps/xdg-desktop-portal')
-rw-r--r--sys-apps/xdg-desktop-portal/files/0001-meson.build-allow-linux-to-build-without-flatpak-ins.patch37
-rw-r--r--sys-apps/xdg-desktop-portal/files/0002-meson.build-allow-linux-to-build-without-bubblewrap.patch33
-rw-r--r--sys-apps/xdg-desktop-portal/files/0003-Make-flatpak-bwrap-optional.patch57
-rw-r--r--sys-apps/xdg-desktop-portal/metadata.xml4
-rw-r--r--sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.0-r1.ebuild (renamed from sys-apps/xdg-desktop-portal/xdg-desktop-portal-1.18.0.ebuild)33
5 files changed, 153 insertions, 11 deletions
diff --git a/sys-apps/xdg-desktop-portal/files/0001-meson.build-allow-linux-to-build-without-flatpak-ins.patch b/sys-apps/xdg-desktop-portal/files/0001-meson.build-allow-linux-to-build-without-flatpak-ins.patch
new file mode 100644
index 000000000000..9f758f7b5432
--- /dev/null
+++ b/sys-apps/xdg-desktop-portal/files/0001-meson.build-allow-linux-to-build-without-flatpak-ins.patch
@@ -0,0 +1,37 @@
+https://github.com/flatpak/xdg-desktop-portal/pull/1100
+
+From b734c44545276141b785dd31ff9c0c78a7801baa Mon Sep 17 00:00:00 2001
+From: "Anna (navi) Figueiredo Gomes" <navi@vlhl.dev>
+Date: Fri, 8 Sep 2023 22:07:06 +0200
+Subject: [PATCH 1/3] meson.build: allow linux to build without flatpak
+ installed
+
+the old automake scripts would allow for building without flatpak, as the
+xml file would just not be copied (because it doesn't exist) so it
+wouldn't be used to generate files.
+
+this allows similar behaviour by not requiring the flatpak dependency in
+meson.
+
+Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
+---
+ meson.build | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 2254c0d..2366d9e 100644
+--- a/meson.build
++++ b/meson.build
+@@ -21,8 +21,7 @@ endif
+
+ flatpak_intf_dir = get_option('flatpak-interfaces-dir')
+ if flatpak_intf_dir == ''
+- flatpak_required = host_machine.system() in ['linux']
+- flatpak_dep = dependency('flatpak', version: '>= 1.5.0', required : flatpak_required)
++ flatpak_dep = dependency('flatpak', version: '>= 1.5.0', required : false)
+ if flatpak_dep.found()
+ flatpak_intf_dir = flatpak_dep.get_variable(pkgconfig: 'interfaces_dir')
+ endif
+--
+2.42.0
+
diff --git a/sys-apps/xdg-desktop-portal/files/0002-meson.build-allow-linux-to-build-without-bubblewrap.patch b/sys-apps/xdg-desktop-portal/files/0002-meson.build-allow-linux-to-build-without-bubblewrap.patch
new file mode 100644
index 000000000000..ce10d326828f
--- /dev/null
+++ b/sys-apps/xdg-desktop-portal/files/0002-meson.build-allow-linux-to-build-without-bubblewrap.patch
@@ -0,0 +1,33 @@
+https://github.com/flatpak/xdg-desktop-portal/pull/1100
+
+From 8cf28b590ab23e94d6b80eaa6893ed51542d3dd8 Mon Sep 17 00:00:00 2001
+From: "Anna (navi) Figueiredo Gomes" <navi@vlhl.dev>
+Date: Sat, 9 Sep 2023 01:20:36 +0200
+Subject: [PATCH 2/3] meson.build: allow linux to build without bubblewrap
+
+per the same logic as flatpak, there's no reason to force bwrap as a
+dependency to build xdp under linux, as there is systems without bwrap
+that would want to be able to build xdp
+
+Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
+---
+ meson.build | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 2366d9e..ad7faae 100644
+--- a/meson.build
++++ b/meson.build
+@@ -112,8 +112,7 @@ libportal_dep = dependency('libportal',
+ pipewire_dep = dependency('libpipewire-0.3', version: '>= 0.2.90')
+ libsystemd_dep = dependency('libsystemd', required: get_option('systemd'))
+
+-bwrap_required = host_machine.system() in ['linux']
+-bwrap = find_program('bwrap', required: bwrap_required)
++bwrap = find_program('bwrap', required: false)
+
+ have_libportal = libportal_dep.found()
+ if have_libportal
+--
+2.42.0
+
diff --git a/sys-apps/xdg-desktop-portal/files/0003-Make-flatpak-bwrap-optional.patch b/sys-apps/xdg-desktop-portal/files/0003-Make-flatpak-bwrap-optional.patch
new file mode 100644
index 000000000000..78b0b3e522a2
--- /dev/null
+++ b/sys-apps/xdg-desktop-portal/files/0003-Make-flatpak-bwrap-optional.patch
@@ -0,0 +1,57 @@
+From 5b4ad3e7a9828df2cd06d663d89800c346f5051f Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 22 Sep 2023 17:35:21 +0100
+Subject: [PATCH] Make flatpak, bwrap optional
+
+See https://github.com/flatpak/xdg-desktop-portal/pull/1100
+
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ meson.build | 4 ++--
+ meson_options.txt | 8 ++++++++
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index ad7faae..933eb54 100644
+--- a/meson.build
++++ b/meson.build
+@@ -21,7 +21,7 @@ endif
+
+ flatpak_intf_dir = get_option('flatpak-interfaces-dir')
+ if flatpak_intf_dir == ''
+- flatpak_dep = dependency('flatpak', version: '>= 1.5.0', required : false)
++ flatpak_dep = dependency('flatpak', version: '>= 1.5.0', required : get_option('flatpak'))
+ if flatpak_dep.found()
+ flatpak_intf_dir = flatpak_dep.get_variable(pkgconfig: 'interfaces_dir')
+ endif
+@@ -112,7 +112,7 @@ libportal_dep = dependency('libportal',
+ pipewire_dep = dependency('libpipewire-0.3', version: '>= 0.2.90')
+ libsystemd_dep = dependency('libsystemd', required: get_option('systemd'))
+
+-bwrap = find_program('bwrap', required: false)
++bwrap = find_program('bwrap', required: get_option('bwrap'))
+
+ have_libportal = libportal_dep.found()
+ if have_libportal
+diff --git a/meson_options.txt b/meson_options.txt
+index edcbcd8..d1914ce 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -2,6 +2,14 @@ option('dbus-service-dir',
+ type: 'string',
+ value: '',
+ description: 'directory for dbus service files (default: PREFIX/share/dbus-1/services)')
++option('bwrap',
++ type: 'feature',
++ value: 'enabled',
++ description: 'Use bwrap (requires seccomp) for sandboxing for e.g. icon validation. Recommended.')
++option('flatpak',
++ type: 'feature',
++ value: 'enabled',
++ description: 'Enable flatpak integration')
+ option('flatpak-interfaces-dir',
+ type: 'string',
+ value: '',
+--
+2.42.0
+
diff --git a/sys-apps/xdg-desktop-portal/metadata.xml b/sys-apps/xdg-desktop-portal/metadata.xml
index 004564dfa989..0b034d09a049 100644
--- a/sys-apps/xdg-desktop-portal/metadata.xml
+++ b/sys-apps/xdg-desktop-portal/metadata.xml
@@ -5,6 +5,10 @@
<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>
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-r1.ebuild
index 0d2ad6cdbcd9..ebec9c9e36e2 100644
--- 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-r1.ebuild
@@ -14,23 +14,24 @@ 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"
+IUSE="geolocation flatpak seccomp systemd test"
RESTRICT="!test? ( test )"
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 )
- >=media-video/pipewire-0.3:=
+ flatpak? ( sys-apps/flatpak )
+ seccomp? ( sys-apps/bubblewrap )
systemd? ( sys-apps/systemd )
- test? (
- dev-libs/libportal
- )
- man? ( dev-python/docutils )
+ test? ( dev-libs/libportal )
"
-RDEPEND="${DEPEND}
+RDEPEND="
+ ${DEPEND}
sys-apps/dbus
"
BDEPEND="
@@ -49,10 +50,15 @@ BDEPEND="
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_setup
+ use test && python-any-r1_pkg_setup
}
python_check_deps() {
@@ -65,16 +71,21 @@ src_configure() {
-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 flatpak)
+ # Only used for tests
+ $(meson_feature test libportal)
$(meson_feature geolocation geoclue)
+ $(meson_feature seccomp bwrap)
$(meson_feature systemd)
- -Ddocbook-docs=disabled # requires flatpak
+ # Requires flatpak
+ -Ddocbook-docs=disabled
# -Dxmlto-flags=
-Ddatarootdir="${EPREFIX}/usr/share"
+ -Dman-pages=enabled
-Dinstalled-tests=false
$(meson_feature test pytest)
- $(meson_feature man man-pages)
)
+
meson_src_configure
}