diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-09-14 21:35:44 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-09-14 21:44:27 +0200 |
commit | 8a808aa493980e212b4d5f5465330905c8294e59 (patch) | |
tree | 5a45b6260233037b4431a220b6ec7d3a8794edfa | |
parent | 2fc963326df7d39a83ea768416329a27b9fd6e1c (diff) | |
download | slirp-8a808aa493980e212b4d5f5465330905c8294e59.zip slirp-8a808aa493980e212b4d5f5465330905c8294e59.tar.gz slirp-8a808aa493980e212b4d5f5465330905c8294e59.tar.bz2 |
meson: remove meson-dist script
Unfortunately meson subprojects do not support add_dist_script, so we
cannot generate the .tarball-version file at "meson dist" time.
Include the version in the meson project declaration, and use
build-aux/git-version-gen only to determine SLIRP_VERSION_STRING.
Instead of the dist script, we check that the version in the
project declaration matches the latest tag. If they do not match
it will be impossible to run "ninja dist" successfully.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rwxr-xr-x | build-aux/meson-dist | 16 | ||||
-rw-r--r-- | meson.build | 16 |
2 files changed, 12 insertions, 20 deletions
diff --git a/build-aux/meson-dist b/build-aux/meson-dist deleted file mode 100755 index 80d534f..0000000 --- a/build-aux/meson-dist +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -e -set -o pipefail - -if test "$1" = ""; then - echo "Version not provided" >&2 - exit 1 -fi -if ! test -d "$2"; then - echo "Source directory not provided" >&2 - exit 1 -fi - -# generate tarball version -echo "$1" > "$MESON_DIST_ROOT/.tarball-version" diff --git a/meson.build b/meson.build index 922d602..65bc6cb 100644 --- a/meson.build +++ b/meson.build @@ -1,12 +1,10 @@ project('libslirp', 'c', - version : run_command('build-aux/git-version-gen', '@0@/.tarball-version'.format(meson.source_root()), check : true).stdout().strip(), + version : '4.3.1', license : 'BSD-3-Clause', default_options : ['warning_level=1', 'c_std=gnu99'], meson_version : '>= 0.49', ) -meson.add_dist_script('build-aux/meson-dist', meson.project_version(), meson.source_root()) - version = meson.project_version() varr = version.split('.') major_version = varr[0] @@ -17,7 +15,17 @@ conf = configuration_data() conf.set('SLIRP_MAJOR_VERSION', major_version) conf.set('SLIRP_MINOR_VERSION', minor_version) conf.set('SLIRP_MICRO_VERSION', micro_version) -conf.set_quoted('SLIRP_VERSION_STRING', version) + +full_version = run_command('build-aux/git-version-gen', + '@0@/.tarball-version'.format(meson.source_root()), + check : true).stdout().strip() +if full_version.startswith('UNKNOWN') + full_version = meson.project_version() +elif not full_version.startswith(meson.project_version()) + error('meson.build project version @0@ does not match git-describe output @1@' + .format(meson.project_version(), full_version)) +endif +conf.set_quoted('SLIRP_VERSION_STRING', full_version) # libtool versioning - this applies to libslirp # |