gnome-shell/.gitlab-ci/install-meson-project.sh
Florian Müllner 0cd882697a ci: Use backend-agnostic meson commands
There's no alternative backend in sight for us, but it's nice to
only deal with a single build tool.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1937>
2021-08-24 08:18:26 +00:00

35 lines
526 B
Bash
Executable File

#!/bin/bash
set -e
if [[ $# -lt 4 ]]; then
echo Usage: $0 [options] [repo-url] [commit] [subdir]
echo Options:
echo -Dkey=val
exit 1
fi
MESON_OPTIONS=()
while [[ $1 =~ ^-D ]]; do
MESON_OPTIONS+=( "$1" )
shift
done
REPO_URL="$1"
COMMIT="$2"
SUBDIR="$3"
PREPARE="$4"
REPO_DIR="$(basename ${REPO_URL%.git})"
git clone --depth 1 "$REPO_URL" -b "$COMMIT"
pushd "$REPO_DIR"
pushd "$SUBDIR"
sh -c "$PREPARE"
meson --prefix=/usr _build "${MESON_OPTIONS[@]}"
meson install -C _build
popd
popd
rm -rf "$REPO_DIR"