From 46df6d36e592e1a2a020747b269ee59e0ef1c01e Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Sun, 8 Dec 2024 12:15:00 +0100 Subject: [PATCH] fix: build profile can be specified manually --- meson.build | 29 +++++++++++++++++++++-------- meson_options.txt | 1 + 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 6eff010..ac20bf0 100644 --- a/meson.build +++ b/meson.build @@ -38,17 +38,30 @@ iconsdir = datadir / 'icons' podir = meson.project_source_root() / 'po' gettext_package = meson.project_name() -# are we building a tagged version? -if run_command('git', 'describe', '--tags', '--exact-match').returncode() != 0 - profile = 'Devel' - vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip() - if vcs_tag == '' - version_suffix = '-devel' +opt_profile = get_option('profile') + +# if a profile isn't specified infer from git +if opt_profile == 'default' + # are we building a tagged version? + if run_command('git', 'describe', '--tags', '--exact-match').returncode() != 0 + profile = 'Devel' + vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip() + if vcs_tag == '' + version_suffix = '-devel' + else + version_suffix = '-@0@'.format(vcs_tag) + endif + application_id = '@0@.@1@'.format(base_id, profile) else - version_suffix = '-@0@'.format(vcs_tag) + profile = '' + version_suffix = '' + application_id = base_id endif +elif opt_profile == 'development' + profile = 'Devel' + version_suffix = '-devel' application_id = '@0@.@1@'.format(base_id, profile) -else +elif opt_profile == 'release' profile = '' version_suffix = '' application_id = base_id diff --git a/meson_options.txt b/meson_options.txt index 7d397e1..aaebed1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,6 +3,7 @@ option( type: 'combo', choices: [ 'default', + 'release', 'development' ], value: 'default',