meson: allow setting the version string during configuration
This will be useful when building distro packages, because we can set the version string to the rpm/dpkg/whatever version string, and getter reports from end users.
This commit is contained in:
parent
e4d5753bd0
commit
e1ca734edd
|
@ -585,6 +585,7 @@ endif
|
||||||
|
|
||||||
vcs_tagger = [meson.source_root() + '/tools/meson-vcs-tag.sh',
|
vcs_tagger = [meson.source_root() + '/tools/meson-vcs-tag.sh',
|
||||||
meson.source_root(),
|
meson.source_root(),
|
||||||
|
get_option('version-tag'),
|
||||||
meson.project_version()]
|
meson.project_version()]
|
||||||
|
|
||||||
sed = find_program('sed')
|
sed = find_program('sed')
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
# -*- mode: meson -*-
|
# -*- mode: meson -*-
|
||||||
# SPDX-License-Identifier: LGPL-2.1+
|
# 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'],
|
option('split-usr', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||||
description : '''/bin, /sbin aren't symlinks into /usr''')
|
description : '''/bin, /sbin aren't symlinks into /usr''')
|
||||||
option('split-bin', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('split-bin', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||||
|
|
|
@ -4,7 +4,13 @@ set -eu
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
dir="$1"
|
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
|
# 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
|
# dirty when invoked with --git-dir (even though 'git status' is happy). Work
|
||||||
|
|
Loading…
Reference in New Issue