2017-12-09 00:45:29 +01:00
|
|
|
project('geary', [ 'vala', 'c' ],
|
2024-05-20 10:55:51 +02:00
|
|
|
version: '46.0',
|
2025-12-11 23:39:20 +01:00
|
|
|
license: 'LGPL-2.1-or-later',
|
2025-12-11 23:42:01 +01:00
|
|
|
meson_version: '>= 1.7',
|
2017-12-09 00:45:29 +01:00
|
|
|
)
|
|
|
|
|
|
2020-10-03 21:59:01 +10:00
|
|
|
# Determine the type of build
|
|
|
|
|
profile = get_option('profile')
|
|
|
|
|
appid_suffix = ''
|
|
|
|
|
name_suffix = ''
|
|
|
|
|
if profile == 'auto'
|
2024-05-20 11:05:51 +02:00
|
|
|
if run_command('[', '-d', '.git', ']', check: false).returncode() == 0
|
2020-10-03 21:59:01 +10:00
|
|
|
profile = 'development'
|
|
|
|
|
else
|
2020-10-03 23:31:35 +10:00
|
|
|
error('No build profile specified, see BUILDING.md')
|
2020-10-03 21:59:01 +10:00
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
if profile == 'development'
|
|
|
|
|
appid_suffix = '.Devel'
|
|
|
|
|
elif profile == 'beta'
|
|
|
|
|
appid_suffix = '.Beta'
|
2019-08-28 22:13:01 +10:00
|
|
|
name_suffix = ' (Beta)'
|
2020-10-03 21:59:01 +10:00
|
|
|
elif profile != 'release'
|
2020-10-03 23:31:35 +10:00
|
|
|
error('Unknown build profile specified, see BUILDING.md')
|
2019-05-03 19:47:57 -04:00
|
|
|
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
|
2022-03-18 12:18:45 +01:00
|
|
|
metadata_dir = meson.project_source_root() / 'bindings'/ 'metadata'
|
|
|
|
|
po_dir = meson.project_source_root() / 'po'
|
|
|
|
|
vapi_dir = meson.project_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
|
|
|
#
|
|
|
|
|
|
2025-08-08 09:44:29 +02:00
|
|
|
target_glib = '2.80'
|
|
|
|
|
target_gtk = '4.16.0'
|
Adapt vala-unit and tests to GLib 2.70 and later
`GLib.TestSuite` is a special type of object, as it doesn't actually
have an associated copy function or a reference/unreference function.
In practice, that actually means there's no way to actually have 2
strong references to such an object, or to copy it somehow. Due to the
way GObject properties in Vala work, that means you can't really use
them either.
Ever since vala commit 5f0a146f65, this got reflected properly in the
internally maintained GLib VAPI (as people were experiencing double
frees otherwise), but it was added only conditionally for GLib 2.70 or
later. In practice, that means you only get vala compiler issues if you
(impliclty) set `--target-glib=2.70` (or a later version).
To fix this for vala-unit and our own Geary tests, this commit changes
the `ValaUnit.TestCase` class to only allow "stealing" the strong
reference to the `GLib.TestSuite`, rather than somehowing allowing
people to hold a weak reference, and by also making it a protected field
rather than a property.
Since this changes the API of ValaUnit, we also bump the version. In
general though, I hope people aren't using ValaUnit externally, since
these types of API/ABI breaks can happen with Vala libraries.
Link: https://gitlab.gnome.org/GNOME/vala/-/commit/5f0a146f65673379fc84c3cd8e6bca826ffad96f
2025-12-07 10:09:15 +01:00
|
|
|
target_vala = '0.56'
|
2025-08-08 09:44:29 +02:00
|
|
|
target_webkit = '2.40'
|
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')
|
2025-08-08 09:44:29 +02:00
|
|
|
gtk = dependency('gtk4', version: '>=' + target_gtk)
|
2019-10-25 15:51:13 +11:00
|
|
|
sqlite = dependency('sqlite3', version: '>= 3.24')
|
2025-08-08 09:44:29 +02:00
|
|
|
webkitgtk = dependency('webkitgtk-6.0', version: '>=' + target_webkit)
|
2018-05-19 10:32:45 +10:00
|
|
|
|
|
|
|
|
# Secondary deps - keep sorted alphabetically
|
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')
|
2025-12-12 19:59:50 +01:00
|
|
|
gck = dependency('gck-2')
|
|
|
|
|
gcr = dependency('gcr-4')
|
2018-05-19 10:32:45 +10:00
|
|
|
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')
|
2025-08-08 09:44:29 +02:00
|
|
|
libspelling = dependency('libspelling-1')
|
2018-05-19 10:32:45 +10:00
|
|
|
gthread = dependency('gthread-2.0', version: '>=' + target_glib)
|
2020-11-13 08:41:08 +11:00
|
|
|
icu_uc = dependency('icu-uc', version: '>=60')
|
2018-08-08 20:12:53 +02:00
|
|
|
iso_codes = dependency('iso-codes')
|
2025-08-08 09:44:29 +02:00
|
|
|
javascriptcoregtk = dependency('javascriptcoregtk-6.0', version: '>=' + target_webkit)
|
2018-09-26 18:43:46 -06:00
|
|
|
json_glib = dependency('json-glib-1.0', version: '>= 1.0')
|
2025-08-08 09:44:29 +02:00
|
|
|
libadwaita = dependency('libadwaita-1', version: '>= 1.7')
|
2018-05-19 10:32:45 +10:00
|
|
|
libmath = cc.find_library('m')
|
2025-12-12 00:34:02 +01:00
|
|
|
libpeas = dependency('libpeas-2')
|
2018-05-19 10:32:45 +10:00
|
|
|
libsecret = dependency('libsecret-1', version: '>= 0.11')
|
2022-08-25 23:12:45 +02:00
|
|
|
libsoup = dependency('libsoup-3.0')
|
2020-09-13 16:27:51 +10:00
|
|
|
libstemmer_dep = cc.find_library('stemmer')
|
2019-02-21 12:00:17 +11:00
|
|
|
libunwind_dep = dependency(
|
2020-10-03 21:06:43 +10:00
|
|
|
'libunwind', version: '>= 1.1', required: get_option('libunwind')
|
2019-02-21 12:00:17 +11:00
|
|
|
)
|
|
|
|
|
libunwind_generic_dep = dependency(
|
2020-10-03 21:06:43 +10:00
|
|
|
'libunwind-generic', version: '>= 1.1', required: get_option('libunwind')
|
2019-02-21 12:00:17 +11:00
|
|
|
)
|
2018-05-19 10:32:45 +10:00
|
|
|
libxml = dependency('libxml-2.0', version: '>= 2.7.8')
|
2020-10-03 21:06:43 +10:00
|
|
|
libytnef = dependency('libytnef', version: '>= 1.9.3', required: get_option('tnef'))
|
2018-05-19 10:32:45 +10:00
|
|
|
posix = valac.find_library('posix')
|
2025-08-08 09:44:29 +02:00
|
|
|
webkitgtk_web_extension = dependency('webkitgtk-web-process-extension-6.0', version: '>=' + target_webkit)
|
2018-05-19 10:32:45 +10:00
|
|
|
|
2020-09-13 16:26:46 +10:00
|
|
|
# System dependencies above ensures appropriate versions for the
|
|
|
|
|
# following libraries, but the declared dependency is what we actually
|
|
|
|
|
# build against so we can include the custom VAPI correctly.
|
|
|
|
|
|
2021-01-18 22:16:24 +11:00
|
|
|
icu_uc = declare_dependency(
|
|
|
|
|
dependencies: [
|
|
|
|
|
valac.find_library('icu-uc', dirs: [vapi_dir]),
|
|
|
|
|
cc.find_library('icuuc'),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2019-02-17 17:56:46 +01:00
|
|
|
if libunwind_dep.found()
|
2020-09-13 16:26:46 +10:00
|
|
|
# We need to add native lib to the search path for these so Flatpak
|
|
|
|
|
# builds can find it.
|
2022-07-15 13:26:59 +02:00
|
|
|
unwind_lib = libunwind_dep.get_variable(pkgconfig: 'libdir')
|
2019-02-17 17:56:46 +01:00
|
|
|
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
|
|
|
|
2020-09-13 16:27:51 +10:00
|
|
|
libstemmer = declare_dependency(
|
|
|
|
|
dependencies: [
|
|
|
|
|
valac.find_library('libstemmer', dirs: [vapi_dir]),
|
|
|
|
|
libstemmer_dep,
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2019-02-24 22:08:48 +11:00
|
|
|
# Optional dependencies
|
2024-12-28 12:01:40 +01:00
|
|
|
appstreamcli = find_program('appstreamcli', required: false)
|
2019-02-24 22:08:48 +11:00
|
|
|
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
|
2020-10-03 21:59:01 +10:00
|
|
|
geary_id = 'org.gnome.Geary@0@'.format(appid_suffix)
|
2019-09-28 00:31:18 +10:00
|
|
|
geary_version = meson.project_version()
|
2020-03-29 23:53:24 -04:00
|
|
|
revno = get_option('revno')
|
|
|
|
|
if revno == ''
|
2024-05-20 11:05:51 +02:00
|
|
|
revno = run_command('build-aux/git_version.py', check: false).stdout().strip()
|
2020-03-29 23:53:24 -04:00
|
|
|
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)
|
2020-11-04 00:55:13 +11:00
|
|
|
error('SQLite3 was not built with FTS3 support. See BUILDING.md for details.')
|
|
|
|
|
endif
|
|
|
|
|
if not cc.has_header_symbol('sqlite3.h', 'Fts5ExtensionApi', dependencies: sqlite)
|
|
|
|
|
error('SQLite3 was not built with FTS5 support. See BUILDING.md for details.')
|
2018-05-19 10:32:45 +10:00
|
|
|
endif
|
|
|
|
|
|
2018-04-14 22:18:00 +10:00
|
|
|
#
|
|
|
|
|
# Build glue
|
|
|
|
|
#
|
|
|
|
|
|
2020-10-03 21:06:43 +10:00
|
|
|
valadoc = find_program('valadoc', required: get_option('valadoc'))
|
|
|
|
|
|
2020-05-08 18:30:35 +10:00
|
|
|
vala_unit_proj = subproject(
|
|
|
|
|
'vala-unit',
|
|
|
|
|
default_options: [
|
|
|
|
|
'install=false',
|
2020-10-03 21:06:43 +10:00
|
|
|
'valadoc=@0@'.format(valadoc.found())
|
2020-05-08 18:30:35 +10:00
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
vala_unit_dep = vala_unit_proj.get_variable('vala_unit_dep')
|
|
|
|
|
|
2017-12-09 00:45:29 +01:00
|
|
|
# Language detection
|
2020-10-03 21:06:43 +10:00
|
|
|
|
2022-07-15 13:26:59 +02:00
|
|
|
iso_codes_dir = iso_codes.get_variable(pkgconfig: 'prefix')/'share'/'xml'/'iso-codes'
|
2020-10-03 21:06:43 +10:00
|
|
|
|
|
|
|
|
iso_639_xml = get_option('iso_639_xml')
|
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
|
2020-10-03 21:06:43 +10:00
|
|
|
|
|
|
|
|
iso_3166_xml = get_option('iso_3166_xml')
|
2017-12-09 00:45:29 +01:00
|
|
|
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
|
2020-10-03 21:06:43 +10:00
|
|
|
|
2017-12-09 00:45:29 +01:00
|
|
|
files(iso_639_xml, iso_3166_xml) # Check to make sure these exist
|
|
|
|
|
|
2025-07-11 16:04:54 +02:00
|
|
|
# Make sure the locale C.UTF-8 is installed on the system
|
|
|
|
|
|
|
|
|
|
c_utf8_check = run_command('locale', '-a', check: true).stdout()
|
|
|
|
|
have_c_utf8 = 'C.utf8' in c_utf8_check.split('\n')
|
|
|
|
|
|
|
|
|
|
if not have_c_utf8
|
|
|
|
|
warning('C.utf8 locale not available on this system.')
|
|
|
|
|
endif
|
|
|
|
|
|
2022-03-18 12:18:59 +01:00
|
|
|
# Post-install script
|
|
|
|
|
gnome.post_install(
|
|
|
|
|
gtk_update_icon_cache: true,
|
|
|
|
|
glib_compile_schemas: true,
|
|
|
|
|
update_desktop_database: true,
|
|
|
|
|
)
|
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')
|