[geary] Fix compiling and using GSettings schema when built by Meson.



commit 763ccd2f7c442c6bbfd3842dd8d538e61851d4f0
Author: Michael James Gratton <mike vee net>
Date:   Tue Dec 12 15:33:36 2017 +1100

    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.

 desktop/meson.build |   14 ++++++++++++--
 meson.build         |    3 +--
 meson_options.txt   |    1 -
 src/meson.build     |    5 +----
 4 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/desktop/meson.build b/desktop/meson.build
index fc18da2..15a6920 100644
--- a/desktop/meson.build
+++ b/desktop/meson.build
@@ -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'),
 )
diff --git a/meson.build b/meson.build
index 2b1d7f1..2185980 100644
--- a/meson.build
+++ b/meson.build
@@ -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)
diff --git a/meson_options.txt b/meson_options.txt
index 00b1151..234e979 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,6 +1,5 @@
 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.')
diff --git a/src/meson.build b/src/meson.build
index 1c74e81..bed6282 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]