summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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