[PATCH] meson: Allow for build metadata in project version

Michael Riesch michael.riesch at wolfvision.net
Fri Feb 17 13:42:36 CET 2023


The build metadata is split off correctly from the version string
obtained with utils/gen-version.sh, but for the meson project version
this step is not carried out.

Allow for build metadata in the meson project version, which may be
used by package maintainers.

Signed-off-by: Michael Riesch <michael.riesch at wolfvision.net>
---
 meson.build | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 9eee9d39..d518454d 100644
--- a/meson.build
+++ b/meson.build
@@ -29,9 +29,10 @@ libcamera_version = libcamera_git_version.split('+')[0]
 # A shallow clone, or a clone without a reachable tag equivalent to the
 # meson.project_version() could leave the project in a mis-described state.
 # Produce a warning in this event, and fix to a best effort.
-if libcamera_version != meson.project_version()
+if libcamera_version != meson.project_version().split('+')[0]
     warning('The sources disagree about the version: '
-            + libcamera_version + ' != ' + meson.project_version())
+            + libcamera_version + ' != '
+	    + meson.project_version().split('+')[0])
 
     summary({'libcamera git version' : libcamera_git_version,
              'Source version match' : false,
@@ -40,9 +41,9 @@ if libcamera_version != meson.project_version()
 
     # Replace the version components reported by git with the release version,
     # but keep all trailing information supplied by git.
-    libcamera_git_version = (meson.project_version() +
+    libcamera_version = meson.project_version().split('+')[0]
+    libcamera_git_version = (libcamera_version +
                              libcamera_git_version.strip(libcamera_version))
-    libcamera_version = meson.project_version()
 
     # Append a marker to show we have modified this version string
     libcamera_git_version += '-nvm'
-- 
2.30.2



More information about the libcamera-devel mailing list