Commit 763ccd2f authored by Michael Gratton's avatar Michael Gratton 🤞

Fix compiling and using GSettings schema when built by Meson.

* desktop/meson.build: Make sure the schema is re-compiled with the
  source XML changes.

* meson.build: Make compiling the schema mandatory, since both running
  the client locally and unit tests require it. Fix path to compiled
  schema so the client can find it.
parent afb23651
......@@ -35,8 +35,18 @@ if install_contractor_file
)
endif
# GSettings schemas
geary_compiled_schema = gnome.compile_schemas() # Always compile, even if necessary. Makes sure it's valid.
# GSettings schemas.
#
# Compile since it makes sure the schema is valid and is used for both
# running the client locally and for tests.
#
# Note the use of depend_files here is a kludge to ensure that the
# schema is re-compiled if the source changes. This is not supported
# by Meson but it works, so request for official support has been
# added, see: https://github.com/mesonbuild/meson/issues/2770
geary_compiled_schema = gnome.compile_schemas(
depend_files: files('org.gnome.Geary.gschema.xml'),
)
install_data('org.gnome.Geary.gschema.xml',
install_dir: join_paths(datadir, 'glib-2.0', 'schemas'),
)
......@@ -13,7 +13,6 @@ 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')
local_gsettings = get_option('local_gsettings')
enable_valadoc = get_option('valadoc')
# Some variables
......@@ -128,7 +127,7 @@ conf.set_quoted('PACKAGE_STRING', '@0@-@1@'.format(meson.project_name(), meson.p
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.source_root(), 'desktop'))
conf.set_quoted('_GSETTINGS_DIR', join_paths(meson.build_root(), 'desktop'))
conf.set_quoted('_INSTALL_PREFIX', geary_prefix)
conf.set_quoted('LANGUAGE_SUPPORT_DIRECTORY', locale_dir)
conf.set_quoted('ISO_CODE_639_XML', iso_639_xml)
......
option('valadoc', type: 'boolean', value: false, description: 'Whether to build the documentaton (requires valadoc).')
option('contractor', type: 'boolean', value: false, description: 'Whether to install the contractor file (Elementary OS-specific).')
option('local_gsettings', type: 'boolean', value: false, description: 'Whether to compile GSettings schema inside the build folder.')
option('poodle', type: 'boolean', value: true, description: 'Whether to apply the POODLE SSLv3 fix.')
option('ref_tracking', type: 'boolean', value: false, description: 'Whether to use explicit reference tracking.')
option('iso_639_xml', type: 'string', value: '', description: 'Full path to the ISO 639 XML file.')
......
......@@ -51,10 +51,7 @@ geary_web_process = library('geary-web-process',
geary_bin_sources = files(
join_paths('client', 'application', 'main.vala'),
)
if local_gsettings
geary_bin_sources += geary_compiled_schema
endif
geary_bin_sources += geary_compiled_schema
geary_bin_dependencies = [
libmath,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment