build: Update how build profiles are handled

Default to development build profile if a `.git` directory exists, else
error out of build configuration.

This make `auto` the default build profile and if set and a `.git`
directory is present default to `development`, else raise an error.
Add some docs to INSTALL describing build profiles and update how they
are used in the source to match.
This commit is contained in:
Michael Gratton 2020-10-03 21:59:01 +10:00 committed by Michael James Gratton
parent aaa2934acf
commit 23bd2507a7
4 changed files with 50 additions and 14 deletions

View file

@ -4,16 +4,26 @@ project('geary', [ 'vala', 'c' ],
meson_version: '>= 0.50',
)
# Build type
if get_option('profile') == 'development'
profile = '.Devel'
# Determine the type of build
profile = get_option('profile')
appid_suffix = ''
name_suffix = ''
if profile == 'auto'
if run_command('[', '-d', '.git', ']').returncode() == 0
profile = 'development'
else
error('No build profile specified, see INSTALL')
endif
endif
if profile == 'development'
appid_suffix = '.Devel'
name_suffix = ' (Development)'
elif get_option('profile') == 'beta'
profile = '.Beta'
elif profile == 'beta'
appid_suffix = '.Beta'
name_suffix = ' (Beta)'
else
profile = ''
name_suffix = ''
elif profile != 'release'
error('Unknown build profile specified, see INSTALL')
endif
# Configurable install dirs
@ -120,7 +130,7 @@ libmessagingmenu_dep = dependency('messaging-menu', version: '>= 12.10', require
#
# Build variables
geary_id = 'org.gnome.Geary@0@'.format(profile)
geary_id = 'org.gnome.Geary@0@'.format(appid_suffix)
geary_version = meson.project_version()
revno = get_option('revno')
if revno == ''