]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix version number for Meson build
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 22 Jan 2025 11:17:29 +0000 (12:17 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 27 Jan 2025 08:13:34 +0000 (09:13 +0100)
meson/version/meson.build
pdns/recursordist/meson-dist-script.sh [moved from pdns/recursordist/meson-dist-script with 100% similarity]
pdns/recursordist/meson.build
pdns/recursordist/version.sh [new file with mode: 0755]

index 5fdf56938bf4075b2c829ddbe53b1f9163c6d9ac..621272ce4ef6581acbec37c4025bc894cae36736 100644 (file)
@@ -1,4 +1,2 @@
-gen_version_prog = find_program('gen-version', dirs: product_source_dir / 'builder-support', required: true)
-gen_version_prog_res = run_command(gen_version_prog, check: true)
-product_version = gen_version_prog_res.stdout().strip()
+product_version = meson.project_version()
 conf.set_quoted('VERSION', product_version, description: 'Version')
index 3c9976c87b45658aa7ffda6ee5baec20b79f8bcf..c9ddfe2750cbe2d7245e3c4c4f61c62a9d7a2637 100644 (file)
@@ -1,7 +1,7 @@
 project(
   'pdns-recursor',
   ['c', 'cpp'],
-  version: run_command('builder-support' / 'gen-version', check: true).stdout().strip(),
+  version: run_command('version.sh', 'get-vcs', check: true).stdout().strip(),
   license: 'GPLv2',
   license_files: 'NOTICE',
   meson_version: '>= 1.2.1',
@@ -11,7 +11,11 @@ project(
     'cpp_std=c++17',
   ],
 )
-meson.add_dist_script('meson-dist-script')
+meson.add_dist_script('meson-dist-script.sh')
+
+# When runniog meson dist, the command below produces multiple lines on stderr:
+# Unable to evaluate subdir([]) in AstInterpreter --> Skipping
+meson.add_dist_script('version.sh', 'set-dist', meson.project_version())
 
 add_project_arguments('-DRECURSOR', language: 'cpp')
 
diff --git a/pdns/recursordist/version.sh b/pdns/recursordist/version.sh
new file mode 100755 (executable)
index 0000000..320e6d0
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$1" = "get-vcs" ]; then
+  builder-support/gen-version
+elif [ "$1" = "set-dist" ]; then
+  $MESONREWRITE -V --sourcedir="$MESON_PROJECT_DIST_ROOT" kwargs set project / version "$2"
+else
+  exit 1
+fi