Skip to content

Commit

Permalink
meson: Rewrite .replace usage
Browse files Browse the repository at this point in the history
Meson introduces a .replace() method in version 0.58.0. However we aim
to restrict ourselves to 0.56 meson features, as released by Debian
stable.

The recent introduction of release management infrastructure makes use
of the .replace() method to fix up the version string when there is a
mis-match between the release version and any (lack) of tags in the git
version description. This breaks when built on systems with only meson
0.56.

Refactor this to use a concatenation of the project version and a
stripped git version to regenerate the full source version string that
will be reported by libcamera.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
  • Loading branch information
kbingham committed Oct 28, 2022
1 parent 2f0987d commit 02518e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ if libcamera_version != meson.project_version()
},
bool_yn : true, section : 'Versions')

libcamera_git_version = libcamera_git_version.replace(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_git_version.strip(libcamera_version))
libcamera_version = meson.project_version()

# Append a marker to show we have modified this version string
Expand Down

0 comments on commit 02518e5

Please sign in to comment.