From 78aaef60ff7d18c041eae1b2a862a3bc784b84ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Fri, 24 Nov 2023 15:14:39 +0100 Subject: [PATCH] meson: Make sure everything works without a pre-release version --- data/meson.build | 8 ++++---- meson.build | 12 +++++++++++- src/meson.build | 10 +--------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/data/meson.build b/data/meson.build index 498b4a2b..1f80f1b3 100644 --- a/data/meson.build +++ b/data/meson.build @@ -29,18 +29,18 @@ endif if is_release development_release = '' else - release_version = major_version + '~' + appstream_version = major_version + '~' if pre_release_version != '' - release_version += pre_release_version + '-' + appstream_version += pre_release_version + '-' endif - release_version += devel_version + appstream_version += devel_version development_release = '''

Development release.

-
'''.format(release_version, release_date) + '''.format(appstream_version, release_date) endif appdata_conf = configuration_data() appdata_conf.set('app-id', application_id) diff --git a/meson.build b/meson.build index ec8e25d5..46baf6a3 100644 --- a/meson.build +++ b/meson.build @@ -87,9 +87,19 @@ else application_id = '@0@.@1@'.format(base_id, profile) endif +version = major_version +if pre_release_version != '' + version += '.' + pre_release_version +endif + +full_version = version +if devel_version != '' + version += '-' + devel_version +endif + meson.add_dist_script( 'build-aux/dist-vendor.sh', - meson.project_build_root() / 'meson-dist' / meson.project_name() + '-' + major_version + '.' + pre_release_version, + meson.project_build_root() / 'meson-dist' / meson.project_name() + '-' + version, meson.project_source_root() ) diff --git a/src/meson.build b/src/meson.build index fe90a20f..43009a05 100644 --- a/src/meson.build +++ b/src/meson.build @@ -7,19 +7,11 @@ ui_resources = gnome.compile_resources( install_dir: pkgdatadir, ) -version = major_version -if pre_release_version != '' - version += '.' + pre_release_version -endif -if devel_version != '' - version += '-' + devel_version -endif - global_conf = configuration_data() global_conf.set_quoted('APP_ID', application_id) global_conf.set_quoted('PKGDATADIR', pkgdatadir) global_conf.set('PROFILE', profile) -global_conf.set_quoted('VERSION', version) +global_conf.set_quoted('VERSION', full_version) global_conf.set_quoted('GETTEXT_PACKAGE', gettext_package) global_conf.set_quoted('LOCALEDIR', localedir) config = configure_file(