From 19279812409265b2bb86edf465d47c529ed9226d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 5 May 2021 12:16:20 +0100 Subject: Add a Meson build system This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. Verified to be backwards-compatible as far as Meson 0.49.0 (Debian 9 backports). Loosely based on previous work by Jussi Pakkanen (see #133). Differences between the Autotools and Meson builds: The Meson build requires a version of libcap that has pkg-config metadata (introduced in libcap 2.23, in 2013). The Meson build has no equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 and RHEL <= 7 that require a setuid bwrap executable, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this via packaging rather than the upstream build system. The Meson build supports being used as a subproject, and there is CI for this. It automatically disables shell completions and man pages, moves the bubblewrap executable to ${libexecdir}, and renames the bubblewrap executable according to a program_prefix option that the caller must specify (for example, Flatpak would use -Dprogram_prefix=flatpak- to get /usr/libexec/flatpak-bwrap). See the tests/use-as-subproject/ directory for an example. Signed-off-by: Simon McVittie --- ci/builddeps.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ci') diff --git a/ci/builddeps.sh b/ci/builddeps.sh index 65fa8b4..4accd2e 100755 --- a/ci/builddeps.sh +++ b/ci/builddeps.sh @@ -64,6 +64,7 @@ if dpkg-vendor --derives-from Debian; then libcap-dev \ libselinux1-dev \ libtool \ + meson \ pkg-config \ python3 \ xsltproc \ @@ -92,6 +93,7 @@ if command -v yum; then libubsan \ libxslt \ make \ + meson \ redhat-rpm-config \ rsync \ ${NULL+} -- cgit v1.2.1