~hkdb/geary/disco-3.34.0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
project('geary', [ 'vala', 'c' ],
  version: '3.34.0',
  license: 'LGPL2.1+',
  meson_version: '>= 0.49',
)

gnome = import('gnome')
i18n = import('i18n')

# Option
install_contractor_file = get_option('contractor')
iso_639_xml = get_option('iso_639_xml')
iso_3166_xml = get_option('iso_3166_xml')
reference_tracking = get_option('ref_tracking')
poodle = get_option('poodle')
enable_valadoc = get_option('valadoc')

revno = run_command('build-aux/git_version.py').stdout().strip()

# Build type
if get_option('profile') == 'development'
  profile = 'Devel'
  name_suffix = ' (Development)'
elif get_option('profile') == 'beta'
  profile = 'Beta'
  name_suffix = ' (Beta)'
else
  profile = ''
  name_suffix = ''
endif

geary_id = 'org.gnome.Geary@0@'.format(profile)
geary_version = meson.project_version()

# Some variables
cc = meson.get_compiler('c')
valac = meson.get_compiler('vala')
config_h_dir = include_directories('.')
geary_prefix = get_option('prefix')
bindir = join_paths(geary_prefix, get_option('bindir'))
datadir = join_paths(geary_prefix, get_option('datadir'))
libdir = join_paths(geary_prefix, get_option('libdir'))
locale_dir = join_paths(geary_prefix, get_option('localedir'))
po_dir = join_paths(meson.source_root(), 'po')
vapi_dir = join_paths(meson.source_root(), 'bindings', 'vapi')
metadata_dir = join_paths(meson.source_root(), 'bindings', 'metadata')
dbus_services_dir = join_paths(datadir, 'dbus-1', 'services')
web_extensions_dir = join_paths(libdir, 'geary', 'web-extensions')

# Make sure Meson can find our custom VAPI's
add_project_arguments([
    '--vapidir', vapi_dir,
    '--metadatadir', metadata_dir,
  ],
  language: 'vala'
)

#
# Required libraries and other dependencies
#

target_glib = '2.54' # Also passed to valac, so don't include a point rev
target_gtk = '3.24.7'
target_webkit = '2.20'

# Primary deps
glib = dependency('glib-2.0', version: '>=' + target_glib)
gmime = dependency('gmime-2.6', version: '>= 2.6.17')
gtk = dependency('gtk+-3.0', version: '>=' + target_gtk)
sqlite = dependency('sqlite3', version: '>= 3.12')
webkit2gtk = dependency('webkit2gtk-4.0', version: '>=' + target_webkit)

# Secondary deps - keep sorted alphabetically
# We need appdata.its from appstream-glib:
# https://gitlab.gnome.org/GNOME/geary/issues/439
appstream_glib = dependency('appstream-glib', version: '>=0.7.10')
enchant = dependency('enchant-2', version: '>=2.1', required: false) # see below
folks = dependency('folks', version: '>=0.11')
gck = dependency('gck-1')
gcr = dependency('gcr-3', version: '>= 3.10.1')
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)
goa = dependency('goa-1.0')
gspell = dependency('gspell-1')
gthread = dependency('gthread-2.0', version: '>=' + target_glib)
iso_codes = dependency('iso-codes')
javascriptcoregtk = dependency('javascriptcoregtk-4.0', version: '>=' + target_webkit)
json_glib = dependency('json-glib-1.0', version: '>= 1.0')
libcanberra = dependency('libcanberra', version: '>= 0.28')
libhandy = dependency('libhandy-0.0', version: '>= 0.0.9', required: false)
libmath = cc.find_library('m')
libsecret = dependency('libsecret-1', version: '>= 0.11')
libsoup = dependency('libsoup-2.4', version: '>= 2.48')
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')
)
libxml = dependency('libxml-2.0', version: '>= 2.7.8')
libytnef = dependency('libytnef', version: '>= 1.9.3', required: get_option('tnef-support'))
posix = valac.find_library('posix')
webkit2gtk_web_extension = dependency('webkit2gtk-web-extension-4.0', version: '>=' + target_webkit)

# Can currently use either Enchant 1 or 2
if not enchant.found()
  enchant = dependency('enchant', version: '>=1.6')
endif

# Handy isn't necessarily packaged by distros, so fall back to a
# subproject until it is.
if not libhandy.found()
  libhandy_subproj = subproject(
    'libhandy',
    default_options: [
      'examples=false',
      'glade_catalog=disabled',
      'tests=false',
    ]
  )

  libhandy = declare_dependency(
    dependencies: [
      libhandy_subproj.get_variable('libhandy_dep'),
      libhandy_subproj.get_variable('libhandy_vapi'),
    ]
  )
endif

# Libunwind system dependencies above ensures appropriate versions,
# but this declared depencency is what we actually build against so we
# 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.
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

# Optional dependencies
appstream_util = find_program('appstream-util', required: false)
desktop_file_validate = find_program('desktop-file-validate', required: false)
libmessagingmenu_dep = dependency('messaging-menu', version: '>= 12.10', required: false)
libunity = dependency('unity', version: '>= 5.12.0', required: false)

if libmessagingmenu_dep.found()
  # The libmessagingmenu dependency above determines if the lib is
  # present, but since it uses a broken name for its VAPI we have to
  # find that and the C libs separately.
  libmessagingmenu = declare_dependency(
    include_directories: include_directories(
      libmessagingmenu_dep.get_pkgconfig_variable('includedir')
    ),
    dependencies: [
      valac.find_library('MessagingMenu-1.0', dirs: [ '/usr/share/vala/vapi' ]),
      cc.find_library('messaging-menu')
    ],
  )
endif

# Ensure SQLite was built correctly
if not cc.has_header_symbol('sqlite3.h', 'SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER', dependencies: sqlite)
  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

#
# Build glue
#

if enable_valadoc
  valadoc = find_program('valadoc')
endif

# Language detection
iso_codes_dir = join_paths(iso_codes.get_pkgconfig_variable('prefix'), 'share', 'xml', 'iso-codes')
if iso_639_xml == ''
  iso_639_xml = join_paths(iso_codes_dir, 'iso_639.xml')
endif
if iso_3166_xml == ''
  iso_3166_xml = join_paths(iso_codes_dir, 'iso_3166.xml')
endif
files(iso_639_xml, iso_3166_xml) # Check to make sure these exist

# Configuration
conf = configuration_data()
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('G_LOG_DOMAIN', meson.project_name())
conf.set_quoted('PACKAGE_NAME', meson.project_name())
conf.set_quoted('PACKAGE_STRING', '@0@-@1@'.format(meson.project_name(), meson.project_version()))
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
conf.set_quoted('_BUILD_ROOT_DIR', meson.build_root())
conf.set_quoted('_SOURCE_ROOT_DIR', meson.source_root())
conf.set_quoted('_GSETTINGS_DIR', join_paths(meson.build_root(), 'desktop'))
conf.set_quoted('_INSTALL_PREFIX', geary_prefix)
conf.set_quoted('_WEB_EXTENSIONS_DIR', web_extensions_dir)
conf.set_quoted('LANGUAGE_SUPPORT_DIRECTORY', locale_dir)
conf.set_quoted('ISO_CODE_639_XML', iso_639_xml)
conf.set_quoted('ISO_CODE_3166_XML', iso_3166_xml)
conf.set('GCR_API_SUBJECT_TO_CHANGE', true)
conf.set_quoted('_VERSION', geary_version)
conf.set_quoted('_APP_ID', geary_id)
conf.set_quoted('_PROFILE', profile)
conf.set_quoted('_NAME_SUFFIX', name_suffix)
conf.set_quoted('_REVNO', revno)
configure_file(output: 'config.h', configuration: conf)

# Post-install scripts
meson.add_install_script(join_paths('build-aux', 'post_install.py'))

# Subfolders
subdir('desktop')
subdir('help')
subdir('icons')
subdir('po')
subdir('sql')
subdir('ui')
subdir('src')
subdir('test')