summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2017-11-16 11:59:41 -0600
committerMichael Catanzaro <mcatanzaro@igalia.com>2017-11-16 11:59:41 -0600
commit3cebbef663bc632e1392d6624d7d17764d680177 (patch)
treeb269e539ccfe327dcb5ff0c7c1159cffb99eef6b
parentcfd3b9de45463475a76c132a3d79d8ada1ede8c5 (diff)
downloadepiphany-3cebbef663bc632e1392d6624d7d17764d680177.tar.gz
Improve tech preview version computation
This did not work on the SDK builder: the version got set to an empty string. I'm not sure why, but my guess is the command was not executed from the source root. Meson documentation says the execution directory is undefined, so let's make sure to get that right, at least.
-rwxr-xr-xcompute-tech-preview-version.sh10
-rw-r--r--meson.build7
2 files changed, 16 insertions, 1 deletions
diff --git a/compute-tech-preview-version.sh b/compute-tech-preview-version.sh
new file mode 100755
index 000000000..9db2f77c9
--- /dev/null
+++ b/compute-tech-preview-version.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# This script is a not-very-elaborate workaround for the fact that Meson's
+# run_command() executes commands in an unspecified directory. All we need to
+# do here is ensure we run git describe in the source directory.
+#
+# It would be nice if we didn't need to use a script for something so simple.
+
+cd $MESON_SOURCE_ROOT
+git describe
diff --git a/meson.build b/meson.build
index 5f861b25c..483363122 100644
--- a/meson.build
+++ b/meson.build
@@ -41,7 +41,12 @@ tech_preview = get_option('tech_preview')
conf.set10('TECH_PREVIEW', tech_preview)
if tech_preview
- conf.set_quoted('VERSION', run_command('git', 'describe').stdout().strip())
+ msg = 'Computing Epiphany Tech Preview version: '
+ res = run_command(join_paths(meson.source_root(), 'compute-tech-preview-version.sh'))
+ assert(res.returncode() == 0, msg + 'FAIL (script returned nonzero exit status)')
+ tech_preview_version = res.stdout().strip()
+ message(msg + tech_preview_version)
+ conf.set_quoted('VERSION', tech_preview_version)
else
conf.set_quoted('VERSION', meson.project_version())
endif