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:
parent
aaa2934acf
commit
23bd2507a7
4 changed files with 50 additions and 14 deletions
26
INSTALL
26
INSTALL
|
|
@ -15,6 +15,28 @@ repository:
|
||||||
A convenience Makefile for development only is also provided. To use
|
A convenience Makefile for development only is also provided. To use
|
||||||
it, simply invoke make from the top-level directory.
|
it, simply invoke make from the top-level directory.
|
||||||
|
|
||||||
|
Build profiles
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Geary can be built using a number of different build profiles, which
|
||||||
|
determine things like the application id, the location of stored data,
|
||||||
|
the name of the application and other visual elements that distinguish
|
||||||
|
release builds from other types.
|
||||||
|
|
||||||
|
These can be set at build configuration time using the Meson `setup`
|
||||||
|
and `configure` commands, using the standard `-Dprofile=…` option. See
|
||||||
|
the `profile` option in `meson_options.txt` for the current list of
|
||||||
|
supported types.
|
||||||
|
|
||||||
|
Maintainers must select the `release` build profile when packaging
|
||||||
|
non-test release builds, otherwise Geary will using branding and data
|
||||||
|
locations intended for development only.
|
||||||
|
|
||||||
|
Note that setting the profile does not alter such things as cmopiler
|
||||||
|
options, use the standard Meson `--buildtype` argument for that.
|
||||||
|
|
||||||
|
If built from
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
|
@ -94,5 +116,5 @@ the initial configuration step:
|
||||||
meson --prefix=/usr -C build
|
meson --prefix=/usr -C build
|
||||||
|
|
||||||
---
|
---
|
||||||
Copyright 2016 Software Freedom Conservancy Inc.
|
Copyright © 2016 Software Freedom Conservancy Inc.
|
||||||
Copyright 2018 Michael Gratton <mike@vee.net>
|
Copyright © 2018-2020 Michael Gratton <mike@vee.net>
|
||||||
|
|
|
||||||
28
meson.build
28
meson.build
|
|
@ -4,16 +4,26 @@ project('geary', [ 'vala', 'c' ],
|
||||||
meson_version: '>= 0.50',
|
meson_version: '>= 0.50',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Build type
|
# Determine the type of build
|
||||||
if get_option('profile') == 'development'
|
profile = get_option('profile')
|
||||||
profile = '.Devel'
|
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)'
|
name_suffix = ' (Development)'
|
||||||
elif get_option('profile') == 'beta'
|
elif profile == 'beta'
|
||||||
profile = '.Beta'
|
appid_suffix = '.Beta'
|
||||||
name_suffix = ' (Beta)'
|
name_suffix = ' (Beta)'
|
||||||
else
|
elif profile != 'release'
|
||||||
profile = ''
|
error('Unknown build profile specified, see INSTALL')
|
||||||
name_suffix = ''
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Configurable install dirs
|
# Configurable install dirs
|
||||||
|
|
@ -120,7 +130,7 @@ libmessagingmenu_dep = dependency('messaging-menu', version: '>= 12.10', require
|
||||||
#
|
#
|
||||||
|
|
||||||
# Build variables
|
# Build variables
|
||||||
geary_id = 'org.gnome.Geary@0@'.format(profile)
|
geary_id = 'org.gnome.Geary@0@'.format(appid_suffix)
|
||||||
geary_version = meson.project_version()
|
geary_version = meson.project_version()
|
||||||
revno = get_option('revno')
|
revno = get_option('revno')
|
||||||
if revno == ''
|
if revno == ''
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,12 @@
|
||||||
option(
|
option(
|
||||||
'profile',
|
'profile',
|
||||||
type: 'combo',
|
type: 'combo',
|
||||||
value: 'default',
|
choices: [
|
||||||
choices: ['default','development','beta'],
|
'auto',
|
||||||
|
'development',
|
||||||
|
'beta',
|
||||||
|
'release'
|
||||||
|
],
|
||||||
description: 'Specifies the application type to be built'
|
description: 'Specifies the application type to be built'
|
||||||
)
|
)
|
||||||
option(
|
option(
|
||||||
|
|
|
||||||
|
|
@ -487,7 +487,7 @@ public class Application.MainWindow :
|
||||||
load_config(application.config);
|
load_config(application.config);
|
||||||
restore_saved_window_state();
|
restore_saved_window_state();
|
||||||
|
|
||||||
if (_PROFILE != "") {
|
if (_PROFILE != "release") {
|
||||||
this.get_style_context().add_class("devel");
|
this.get_style_context().add_class("devel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue