2017-12-09 00:45:29 +01:00
|
|
|
project('geary', [ 'vala', 'c' ],
|
2020-09-25 08:23:15 +10:00
|
|
|
version: '40.alpha',
|
2017-12-09 00:45:29 +01:00
|
|
|
license: 'LGPL2.1+',
|
2019-09-27 17:26:37 +10:00
|
|
|
meson_version: '>= 0.50',
|
2017-12-09 00:45:29 +01:00
|
|
|
)
|
|
|
|
|
|
2019-09-28 00:25:07 +10:00
|
|
|
# Build-time configuration options
|
|
|
|
|
enable_valadoc = get_option('valadoc')
|
2017-12-09 00:45:29 +01:00
|
|
|
install_contractor_file = get_option('contractor')
|
|
|
|
|
iso_3166_xml = get_option('iso_3166_xml')
|
2019-09-28 00:25:07 +10:00
|
|
|
iso_639_xml = get_option('iso_639_xml')
|
|
|
|
|
reference_tracking = get_option('ref_tracking')
|
2017-12-09 00:45:29 +01:00
|
|
|
|
2019-05-03 19:47:57 -04:00
|
|
|
# Build type
|
|
|
|
|
if get_option('profile') == 'development'
|
2019-09-28 00:34:39 +10:00
|
|
|
profile = '.Devel'
|
2019-08-28 20:03:29 +10:00
|
|
|
name_suffix = ' (Development)'
|
2019-08-28 22:13:01 +10:00
|
|
|
elif get_option('profile') == 'beta'
|
2019-09-28 00:34:39 +10:00
|
|
|
profile = '.Beta'
|
2019-08-28 22:13:01 +10:00
|
|
|
name_suffix = ' (Beta)'
|
2019-05-03 19:47:57 -04:00
|
|
|
else
|
|
|
|
|
profile = ''
|
|
|
|
|
name_suffix = ''
|
|
|
|
|
endif
|
|
|
|
|
|
2019-09-27 23:55:32 +10:00
|
|
|
# Configurable install dirs
|
2019-09-28 00:31:18 +10:00
|
|
|
geary_prefix = get_option('prefix')
|
2020-03-30 19:24:57 +11:00
|
|
|
bin_dir = geary_prefix / get_option('bindir')
|
|
|
|
|
data_dir = geary_prefix / get_option('datadir')
|
|
|
|
|
lib_dir = geary_prefix / get_option('libdir')
|
|
|
|
|
locale_dir = geary_prefix / get_option('localedir')
|
2019-09-27 23:55:32 +10:00
|
|
|
|
2019-09-28 00:31:18 +10:00
|
|
|
# Source dirs
|
2020-03-30 19:24:57 +11:00
|
|
|
metadata_dir = meson.source_root() / 'bindings'/ 'metadata'
|
|
|
|
|
po_dir = meson.source_root() / 'po'
|
|
|
|
|
vapi_dir = meson.source_root() / 'bindings' / 'vapi'
|
2017-12-09 00:45:29 +01:00
|
|
|
|
2019-09-28 00:31:18 +10:00
|
|
|
# Compiler configuration
|
2017-12-09 00:45:29 +01:00
|
|
|
add_project_arguments([
|
2019-09-28 00:31:18 +10:00
|
|
|
# Make sure Meson can find custom VAPIs
|
2017-12-09 00:45:29 +01:00
|
|
|
'--vapidir', vapi_dir,
|
|
|
|
|
'--metadatadir', metadata_dir,
|
|
|
|
|
],
|
|
|
|
|
language: 'vala'
|
|
|
|
|
)
|
2019-09-28 00:31:18 +10:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
valac = meson.get_compiler('vala')
|
2017-12-09 00:45:29 +01:00
|
|
|
|
2018-04-14 22:18:00 +10:00
|
|
|
#
|
2018-05-19 10:32:45 +10:00
|
|
|
# Required libraries and other dependencies
|
2018-04-14 22:18:00 +10:00
|
|
|
#
|
|
|
|
|
|
2020-08-20 12:34:44 +10:00
|
|
|
target_vala = '0.48.6'
|
2020-08-23 17:40:28 +10:00
|
|
|
target_glib = '2.64'
|
2019-03-25 18:42:30 +11:00
|
|
|
target_gtk = '3.24.7'
|
2020-02-18 23:45:37 +11:00
|
|
|
target_webkit = '2.26'
|
2017-12-09 00:45:29 +01:00
|
|
|
|
2020-03-07 18:02:37 +11:00
|
|
|
if not valac.version().version_compare('>=' + target_vala)
|
|
|
|
|
error('Vala does not meet minimum required version: ' + target_vala)
|
|
|
|
|
endif
|
|
|
|
|
|
2018-05-19 10:32:45 +10:00
|
|
|
# Primary deps
|
2017-12-09 00:45:29 +01:00
|
|
|
glib = dependency('glib-2.0', version: '>=' + target_glib)
|
2019-11-30 20:09:28 +01:00
|
|
|
gmime = dependency('gmime-3.0', version: '>= 3.2.4')
|
2017-12-09 00:45:29 +01:00
|
|
|
gtk = dependency('gtk+-3.0', version: '>=' + target_gtk)
|
2019-10-25 15:51:13 +11:00
|
|
|
sqlite = dependency('sqlite3', version: '>= 3.24')
|
2018-05-19 10:32:45 +10:00
|
|
|
webkit2gtk = dependency('webkit2gtk-4.0', version: '>=' + target_webkit)
|
|
|
|
|
|
|
|
|
|
# Secondary deps - keep sorted alphabetically
|
2019-06-03 10:31:52 +00:00
|
|
|
# We need appdata.its from appstream-glib:
|
|
|
|
|
# https://gitlab.gnome.org/GNOME/geary/issues/439
|
|
|
|
|
appstream_glib = dependency('appstream-glib', version: '>=0.7.10')
|
2020-04-08 11:59:44 +10:00
|
|
|
cairo = dependency('cairo')
|
2020-03-07 18:06:45 +11:00
|
|
|
enchant = dependency('enchant-2', version: '>=2.1')
|
2019-02-26 22:54:28 +11:00
|
|
|
folks = dependency('folks', version: '>=0.11')
|
2019-01-10 17:33:37 +11:00
|
|
|
gck = dependency('gck-1')
|
2017-12-09 00:45:29 +01:00
|
|
|
gcr = dependency('gcr-3', version: '>= 3.10.1')
|
2018-05-19 10:32:45 +10:00
|
|
|
gdk = dependency('gdk-3.0', version: '>=' + target_gtk)
|
|
|
|
|
gee = dependency('gee-0.8', version: '>= 0.8.5')
|
|
|
|
|
gio = dependency('gio-2.0', version: '>=' + target_glib)
|
2018-05-23 17:46:48 +10:00
|
|
|
goa = dependency('goa-1.0')
|
2020-03-21 16:52:30 +11:00
|
|
|
gsound = dependency('gsound')
|
2019-05-24 13:50:35 +02:00
|
|
|
gspell = dependency('gspell-1')
|
2018-05-19 10:32:45 +10:00
|
|
|
gthread = dependency('gthread-2.0', version: '>=' + target_glib)
|
2018-08-08 20:12:53 +02:00
|
|
|
iso_codes = dependency('iso-codes')
|
2017-06-22 15:01:19 +02:00
|
|
|
javascriptcoregtk = dependency('javascriptcoregtk-4.0', version: '>=' + target_webkit)
|
2018-09-26 18:43:46 -06:00
|
|
|
json_glib = dependency('json-glib-1.0', version: '>= 1.0')
|
2020-08-27 08:30:15 +10:00
|
|
|
libhandy = dependency('libhandy-1', version: '>= 0.90')
|
2018-05-19 10:32:45 +10:00
|
|
|
libmath = cc.find_library('m')
|
2019-09-26 23:16:14 +10:00
|
|
|
libpeas = dependency('libpeas-1.0', version: '>= 1.24.0')
|
2020-03-02 12:25:08 +11:00
|
|
|
libpeas_gtk = dependency('libpeas-gtk-1.0', version: '>= 1.24.0')
|
2018-05-19 10:32:45 +10:00
|
|
|
libsecret = dependency('libsecret-1', version: '>= 0.11')
|
|
|
|
|
libsoup = dependency('libsoup-2.4', version: '>= 2.48')
|
2019-02-21 12:00:17 +11:00
|
|
|
libunwind_dep = dependency(
|
|
|
|
|
'libunwind', version: '>= 1.1', required: not get_option('libunwind_optional')
|
|
|
|
|
)
|
|
|
|
|
libunwind_generic_dep = dependency(
|
|
|
|
|
'libunwind-generic', version: '>= 1.1', required: not get_option('libunwind_optional')
|
|
|
|
|
)
|
2018-05-19 10:32:45 +10:00
|
|
|
libxml = dependency('libxml-2.0', version: '>= 2.7.8')
|
2018-06-15 11:38:10 +03:00
|
|
|
libytnef = dependency('libytnef', version: '>= 1.9.3', required: get_option('tnef-support'))
|
2018-05-19 10:32:45 +10:00
|
|
|
posix = valac.find_library('posix')
|
2017-06-22 15:01:19 +02:00
|
|
|
webkit2gtk_web_extension = dependency('webkit2gtk-web-extension-4.0', version: '>=' + target_webkit)
|
2018-05-19 10:32:45 +10:00
|
|
|
|
2019-04-26 18:22:43 +10:00
|
|
|
# Libunwind system dependencies above ensures appropriate versions,
|
2020-08-19 09:34:58 +02:00
|
|
|
# but this declared dependency is what we actually build against so we
|
2019-04-26 18:22:43 +10:00
|
|
|
# can include the custom VAPI correctly. We need to add unwind_lib to
|
|
|
|
|
# the search path for these so Flatpak builds can find the C lib.
|
2019-02-17 17:56:46 +01:00
|
|
|
if libunwind_dep.found()
|
|
|
|
|
unwind_lib = libunwind_dep.get_pkgconfig_variable('libdir')
|
|
|
|
|
libunwind = declare_dependency(
|
|
|
|
|
dependencies: [
|
|
|
|
|
valac.find_library('libunwind', dirs: [vapi_dir, unwind_lib]),
|
|
|
|
|
cc.find_library('libunwind', dirs: unwind_lib),
|
|
|
|
|
cc.find_library('libunwind-generic', dirs: unwind_lib)
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
endif
|
2017-12-09 00:45:29 +01:00
|
|
|
|
2019-02-24 22:08:48 +11:00
|
|
|
# Optional dependencies
|
|
|
|
|
appstream_util = find_program('appstream-util', required: false)
|
|
|
|
|
desktop_file_validate = find_program('desktop-file-validate', required: false)
|
2019-04-19 13:19:07 +10:00
|
|
|
libmessagingmenu_dep = dependency('messaging-menu', version: '>= 12.10', required: false)
|
2018-04-14 22:18:00 +10:00
|
|
|
|
2019-09-28 00:31:18 +10:00
|
|
|
#
|
|
|
|
|
# Internal build configuration
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# Build variables
|
|
|
|
|
geary_id = 'org.gnome.Geary@0@'.format(profile)
|
|
|
|
|
geary_version = meson.project_version()
|
2020-03-29 23:53:24 -04:00
|
|
|
revno = get_option('revno')
|
|
|
|
|
if revno == ''
|
|
|
|
|
revno = run_command('build-aux/git_version.py').stdout().strip()
|
|
|
|
|
endif
|
2019-09-28 00:31:18 +10:00
|
|
|
|
|
|
|
|
gnome = import('gnome')
|
|
|
|
|
i18n = import('i18n')
|
|
|
|
|
|
|
|
|
|
# Static install dirs
|
2020-03-30 19:24:57 +11:00
|
|
|
dbus_services_dir = data_dir / 'dbus-1' / 'services'
|
|
|
|
|
client_lib_dir = lib_dir / 'geary'
|
|
|
|
|
plugins_dir = client_lib_dir / 'plugins'
|
|
|
|
|
web_extensions_dir = client_lib_dir / 'web-extensions'
|
2019-09-28 00:31:18 +10:00
|
|
|
|
2018-05-19 10:32:45 +10:00
|
|
|
# Ensure SQLite was built correctly
|
2019-01-09 12:29:34 +03:00
|
|
|
if not cc.has_header_symbol('sqlite3.h', 'SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER', dependencies: sqlite)
|
2018-05-19 10:32:45 +10:00
|
|
|
error('SQLite3 is missing FTS3 tokenizer support. Please compile it with -DSQLITE_ENABLE_FTS3.\n'
|
|
|
|
|
+ 'See https://bugzilla.gnome.org/show_bug.cgi?id=763203 for details.')
|
|
|
|
|
endif
|
|
|
|
|
|
2018-04-14 22:18:00 +10:00
|
|
|
#
|
|
|
|
|
# Build glue
|
|
|
|
|
#
|
|
|
|
|
|
2020-05-08 18:30:35 +10:00
|
|
|
vala_unit_proj = subproject(
|
|
|
|
|
'vala-unit',
|
|
|
|
|
default_options: [
|
|
|
|
|
'install=false',
|
|
|
|
|
'valadoc=@0@'.format(enable_valadoc)
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
vala_unit_dep = vala_unit_proj.get_variable('vala_unit_dep')
|
|
|
|
|
|
2017-12-09 00:45:29 +01:00
|
|
|
if enable_valadoc
|
|
|
|
|
valadoc = find_program('valadoc')
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# Language detection
|
2020-03-30 19:24:57 +11:00
|
|
|
iso_codes_dir = iso_codes.get_pkgconfig_variable('prefix')/'share'/'xml'/'iso-codes'
|
2017-12-09 00:45:29 +01:00
|
|
|
if iso_639_xml == ''
|
2020-03-30 19:24:57 +11:00
|
|
|
iso_639_xml = iso_codes_dir / 'iso_639.xml'
|
2017-12-09 00:45:29 +01:00
|
|
|
endif
|
|
|
|
|
if iso_3166_xml == ''
|
2020-03-30 19:24:57 +11:00
|
|
|
iso_3166_xml = iso_codes_dir / 'iso_3166.xml'
|
2017-12-09 00:45:29 +01:00
|
|
|
endif
|
|
|
|
|
files(iso_639_xml, iso_3166_xml) # Check to make sure these exist
|
|
|
|
|
|
|
|
|
|
# Post-install scripts
|
2020-03-30 19:24:57 +11:00
|
|
|
meson.add_install_script('build-aux' / 'post_install.py')
|
2017-12-09 00:45:29 +01:00
|
|
|
|
2019-10-25 11:48:09 +11:00
|
|
|
# GNOME Builder doesn't support YAML manifests, so generate a JSON
|
|
|
|
|
# version from the YAML and commit it. :( GNOME/gnome-builder#520
|
|
|
|
|
yaml_to_json = find_program('build-aux' / 'yaml_to_json.py')
|
|
|
|
|
custom_target(
|
|
|
|
|
'org.gnome.Geary.json',
|
|
|
|
|
build_by_default: true,
|
|
|
|
|
command: [yaml_to_json, '@INPUT@', meson.source_root(), '@OUTPUT@'],
|
2020-03-13 17:13:58 +11:00
|
|
|
input: files('org.gnome.Geary.yaml'),
|
2019-10-25 11:48:09 +11:00
|
|
|
output: 'org.gnome.Geary.json'
|
|
|
|
|
)
|
|
|
|
|
|
2017-12-09 00:45:29 +01:00
|
|
|
# Subfolders
|
|
|
|
|
subdir('desktop')
|
|
|
|
|
subdir('help')
|
|
|
|
|
subdir('icons')
|
|
|
|
|
subdir('po')
|
|
|
|
|
subdir('sql')
|
|
|
|
|
subdir('ui')
|
|
|
|
|
subdir('src')
|
|
|
|
|
subdir('test')
|