summaryrefslogtreecommitdiff
path: root/.gitlab-ci
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2023-03-20 02:01:33 +0100
committerMarge Bot <marge-bot@gnome.org>2023-04-20 15:59:56 +0000
commitea629cabbfa51d5ad2a521970f6c5288346e55fe (patch)
tree387631fce169b01fcaac9981e43f239a6cc802f2 /.gitlab-ci
parentd97c667937a76de843fe8637915acf91b8b55799 (diff)
downloadgnome-shell-ea629cabbfa51d5ad2a521970f6c5288346e55fe.tar.gz
ci: Make fringe meson-install arguments optional
Both the subdir and prepare arguments are very specific to building the extensions-tool subproject stand-alone. In order to make the script more generic, turn those required arguments into optional --subdir and --prepare ones. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2712>
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x.gitlab-ci/install-meson-project.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/.gitlab-ci/install-meson-project.sh b/.gitlab-ci/install-meson-project.sh
index e87407fe2..8ecf8a300 100755
--- a/.gitlab-ci/install-meson-project.sh
+++ b/.gitlab-ci/install-meson-project.sh
@@ -4,12 +4,14 @@ set -e
usage() {
cat <<-EOF
- Usage: $(basename $0) [OPTION…] REPO_URL COMMIT SUBDIR PREPARE
+ Usage: $(basename $0) [OPTION…] REPO_URL COMMIT
Check out and install a meson project
Options:
-Dkey=val Option to pass on to meson
+ --subdir Build subdirectory instead of whole project
+ --prepare Script to run before build
-h, --help Display this help
@@ -19,6 +21,8 @@ usage() {
TEMP=$(getopt \
--name=$(basename $0) \
--options='D:h' \
+ --longoptions='subdir:' \
+ --longoptions='prepare:' \
--longoptions='help' \
-- "$@")
@@ -26,6 +30,8 @@ eval set -- "$TEMP"
unset TEMP
MESON_OPTIONS=()
+SUBDIR=.
+PREPARE=:
while true; do
case "$1" in
@@ -34,6 +40,16 @@ while true; do
shift 2
;;
+ --subdir)
+ SUBDIR=$2
+ shift 2
+ ;;
+
+ --prepare)
+ PREPARE=$2
+ shift 2
+ ;;
+
-h|--help)
usage
exit 0
@@ -46,15 +62,13 @@ while true; do
esac
done
-if [[ $# -lt 4 ]]; then
+if [[ $# -lt 2 ]]; then
usage
exit 1
fi
REPO_URL="$1"
COMMIT="$2"
-SUBDIR="$3"
-PREPARE="$4"
CHECKOUT_DIR=$(mktemp --directory)
trap "rm -rf $CHECKOUT_DIR" EXIT