summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build1
-rw-r--r--meson_options.txt3
-rwxr-xr-xtools/meson-vcs-tag.sh8
3 files changed, 11 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index e3641e088c..f528b4125f 100644
--- a/meson.build
+++ b/meson.build
@@ -585,6 +585,7 @@ endif
vcs_tagger = [meson.source_root() + '/tools/meson-vcs-tag.sh',
meson.source_root(),
+ get_option('version-tag'),
meson.project_version()]
sed = find_program('sed')
diff --git a/meson_options.txt b/meson_options.txt
index 1423b8998e..42693bc47c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,6 +1,9 @@
# -*- mode: meson -*-
# SPDX-License-Identifier: LGPL-2.1+
+option('version-tag', type : 'string',
+ description : 'override the git version string')
+
option('split-usr', type : 'combo', choices : ['auto', 'true', 'false'],
description : '''/bin, /sbin aren't symlinks into /usr''')
option('split-bin', type : 'combo', choices : ['auto', 'true', 'false'],
diff --git a/tools/meson-vcs-tag.sh b/tools/meson-vcs-tag.sh
index 4345c2145a..1eb7668eed 100755
--- a/tools/meson-vcs-tag.sh
+++ b/tools/meson-vcs-tag.sh
@@ -4,7 +4,13 @@ set -eu
set -o pipefail
dir="$1"
-fallback="$2"
+tag="$2"
+fallback="$3"
+
+if [ -n "$tag" ]; then
+ echo "$tag"
+ exit 0
+fi
# Apparently git describe has a bug where it always considers the work-tree
# dirty when invoked with --git-dir (even though 'git status' is happy). Work