[libwnck] build: Support new GNOME versioning schema
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libwnck] build: Support new GNOME versioning schema
- Date: Mon, 10 May 2021 17:00:50 +0000 (UTC)
commit c823cd3d70f60986a9f12cbb8143b4049b9ea496
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Mon May 10 18:56:45 2021 +0200
build: Support new GNOME versioning schema
alpha, beta and rc releases can will be exposed source side as:
major: MAJOR_VERSION-1
minor: 99-MINOR_VERSION_LEVEL
micro: MICRO_VERSION
So that:
40.alpha => 39.97.0
40.alpha.1 => 39.97.1
40.beta => 39.98.0
40.beta.1 => 39.98.1
40.rc => 39.99.0
40.rc.1 => 39.99.1
40.0 => 40.0.0
40.1 => 40.1.0
libwnck/meson.build | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/libwnck/meson.build b/libwnck/meson.build
index 04f30d6..eef9de5 100644
--- a/libwnck/meson.build
+++ b/libwnck/meson.build
@@ -4,9 +4,29 @@ libwnck_includedir = join_paths(PACKAGE_NAME, meson.project_name())
version_data = configuration_data()
version_array = meson.project_version().split('.')
-version_data.set('WNCK_MAJOR_VERSION', version_array[0])
-version_data.set('WNCK_MINOR_VERSION', version_array[1])
-version_data.set('WNCK_MICRO_VERSION', version_array[2])
+
+major_version = version_array[0].to_int()
+minor_version = version_array[1]
+micro_version = (version_array.length() == 3) ? version_array[2].to_int() : 0
+
+if minor_version == 'alpha'
+ minor_version = 97
+elif minor_version == 'beta'
+ minor_version = 98
+elif minor_version == 'rc'
+ minor_version = 99
+else
+ # Ensure that only numbers are expected in this case
+ minor_version = minor_version.to_int()
+endif
+
+if minor_version >= 97
+ major_version = major_version - 1
+endif
+
+version_data.set('WNCK_MAJOR_VERSION', major_version)
+version_data.set('WNCK_MINOR_VERSION', minor_version)
+version_data.set('WNCK_MICRO_VERSION', micro_version)
headers = [
'libwnck.h',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]