summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-02-14 11:04:36 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-02-14 15:36:34 +0100
commitea2a57bee3506c8a724034c3ba0de2c87b47173b (patch)
tree347b206885a81679b6d0916538b7c8c0249ebca1 /meson.build
parentdocs: Use v255~rc1 instead of v255-rc1 (diff)
downloadsystemd-ea2a57bee3506c8a724034c3ba0de2c87b47173b.tar.xz
systemd-ea2a57bee3506c8a724034c3ba0de2c87b47173b.zip
meson: Start adding devel and rc suffixes to the project version
Let's make sure that versions generated by meson-vcs-tag.sh always sort higher than official and stable releases. We achieve this by immediately updating the meson version in meson.build after a new release. To make sure this version always sorts lower than future rcs, we suffix it with "~devel" which will sort lower than "~rcX". The new release workflow is to update the version in meson.build for each rc and the official release and to also update the version number after a new release to the next development version. The full version is exposed as PROJECT_VERSION_FULL and used where it makes sense over PROJECT_VERSION. We also switch to reading the version from a meson.version file in the repo instead of hardcoding it in meson.build. This makes it easier to access both inside and outside of the project. The meson-vcs-tag.sh script is rewritten to query the version from meson.version instead of passing it in via the command line. This makes it easier to use outside of systemd since users don't have to query the version themselves first.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build16
1 files changed, 11 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index ff79efd989..e4a9758ec5 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
project('systemd', 'c',
- version : '255',
+ version : files('meson.version'),
license : 'LGPLv2+',
default_options: [
'c_std=gnu11',
@@ -18,8 +18,9 @@ libudev_version = '1.7.8'
conf = configuration_data()
conf.set_quoted('PROJECT_URL', 'https://systemd.io/')
-conf.set('PROJECT_VERSION', meson.project_version(),
+conf.set('PROJECT_VERSION', meson.project_version().split('~')[0],
description : 'Numerical project version (used where a simple number is expected)')
+conf.set_quoted('PROJECT_VERSION_FULL', meson.project_version(), description : 'Full project version')
# This is to be used instead of meson.source_root(), as the latter will return
# the wrong result when systemd is being built as a meson subproject
@@ -1859,13 +1860,12 @@ version_h = vcs_tag(
output : 'version.h',
command: [project_source_root / 'tools/meson-vcs-tag.sh',
project_source_root,
- meson.project_version(),
version_tag,
])
shared_lib_tag = get_option('shared-lib-tag')
if shared_lib_tag == ''
- shared_lib_tag = meson.project_version()
+ shared_lib_tag = meson.project_version().split('~')[0]
endif
#####################################################################
@@ -2559,11 +2559,17 @@ foreach exec : public_programs
args : exec.full_path(),
depends: exec)
+ version = meson.project_version()
+ if name == 'udevadm'
+ # For compatibility reasons we can't use the full version in udevadm.
+ version = version.split('~')[0]
+ endif
+
test('check-version-' + name,
check_version,
suite : 'dist',
args : [exec.full_path(),
- meson.project_version()],
+ version],
depends: exec)
endif
endforeach