From 4350364ef613e5ebc022be05882dc6df010bce80 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 17 Sep 2026 13:12:12 +0100 Subject: [PATCH] CI: Fall back to using `git archive` if `meson dist` is unimplemented Older versions of Meson didn't have `meson dist`. Signed-off-by: Simon McVittie --- .gitlab-ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aeed84f24..de604355b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,9 @@ # Copyright 2019 Endless OS Foundation LLC # SPDX-License-Identifier: LGPL-2.0-or-later +variables: + CAN_MESON_DIST: "yes" + stages: - build @@ -22,7 +25,13 @@ stages: - meson test -C _build # Ensure that we can build as a subproject - rm -fr _build/meson-dist - - meson dist -C _build + - | + if [ "$CAN_MESON_DIST" = yes ]; then + meson dist -C _build + else + mkdir -p _build/meson-dist + git archive --prefix=libglnx/ HEAD | xz > _build/meson-dist/libglnx.tar.xz + fi - mkdir -p tests/use-as-subproject/subprojects/libglnx - tar --strip-components=1 -C tests/use-as-subproject/subprojects/libglnx -xf _build/meson-dist/*.tar.xz - meson setup tests/use-as-subproject/_build tests/use-as-subproject