build-sys: meson: fix meson dist version
authorIgor V. Kovalenko <igor.v.kovalenko@gmail.com>
Tue, 2 Mar 2021 05:22:22 +0000 (08:22 +0300)
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>
Mon, 15 Mar 2021 18:25:06 +0000 (18:25 +0000)
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/516>

.gitlab-ci.yml
meson.build
scripts/save-tarball-version.sh [new file with mode: 0755]

index e5d1558..1b6dc11 100644 (file)
@@ -101,8 +101,10 @@ build-meson:
     - meson build
     - cd build
     - ninja
+    - ulimit -c 0 # don't dump core files on tests that are supposed to assert
     - ninja test
     - ninja test-daemon
+    - ninja dist
   artifacts:
     paths:
       - build/
index 5a1df59..6b86ba2 100644 (file)
@@ -4,6 +4,8 @@ project('pulseaudio', 'c', 'cpp',
         default_options : [ 'c_std=gnu11', 'cpp_std=c++11' ]
         )
 
+meson.add_dist_script('scripts/save-tarball-version.sh', meson.project_version())
+
 pa_version_str = meson.project_version()
 # For tarballs, the first split will do nothing, but for builds in git, we
 # split out suffixes when there are commits since the last tag
diff --git a/scripts/save-tarball-version.sh b/scripts/save-tarball-version.sh
new file mode 100755 (executable)
index 0000000..961aa15
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+if [ "x${1}" == "x" ]; then
+    echo "Package version must be specified to generate tarball version"
+    exit 1
+fi
+
+echo "${1}" > "$MESON_DIST_ROOT/.tarball-version"