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: de9365facc
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2023-09-22 18:01:21 +01:00
parent f492ba3ccf
commit b17fcfae7a
6 changed files with 157 additions and 11 deletions
@@ -1,6 +1,10 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Sam James <sam@gentoo.org> (2023-09-22)
# sys-apps/flatpak is not keyworded here
sys-apps/xdg-desktop-portal flatpak
# Matt Turner <mattst88@gentoo.org> (2023-05-30)
# sys-apps/dbus-broker is not keyworded
app-accessibility/at-spi2-core dbus-broker
@@ -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
@@ -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
@@ -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
+4
View File
@@ -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>
@@ -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
}