[gsettings-desktop-schemas] build: Compile schemas in a post-install script



commit 200721659a4a0bd6593054915303c76279ee23f4
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Dec 11 16:24:04 2018 +0100

    build: Compile schemas in a post-install script
    
    From gnome.compile_schemas meson docs: "Note that this is not for
    installing schemas and is only useful when running the application
    locally for example during tests."
    
    So delegate compiling schemas in the install dir to a post-install
    script, similarly to how it's done in GTK+.

 build-aux/meson/post-install.sh | 9 +++++++++
 meson.build                     | 4 ++++
 schemas/meson.build             | 2 --
 3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/build-aux/meson/post-install.sh b/build-aux/meson/post-install.sh
new file mode 100755
index 0000000..ae20da7
--- /dev/null
+++ b/build-aux/meson/post-install.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+datadir=$1
+
+# Package managers set this so we don't need to run
+if [ -z "$DESTDIR" ]; then
+  echo Compiling GSettings schemas...
+  glib-compile-schemas ${datadir}/glib-2.0/schemas
+fi
diff --git a/meson.build b/meson.build
index 3bb9efd..c15e365 100644
--- a/meson.build
+++ b/meson.build
@@ -40,3 +40,7 @@ pkg.generate(name: gsettings_desktop_schemas_name,
 subdir('headers')
 subdir('schemas')
 subdir('po')
+
+# Keep this in sync with post-install.sh expected arguments
+meson.add_install_script('build-aux/meson/post-install.sh',
+                         datadir)
diff --git a/schemas/meson.build b/schemas/meson.build
index 75ee977..69a3f98 100644
--- a/schemas/meson.build
+++ b/schemas/meson.build
@@ -50,8 +50,6 @@ endforeach
 
 install_data(generated_schemas, install_dir: schemasdir)
 
-gnome.compile_schemas(build_by_default: true)
-
 install_data(
   'gsettings-desktop-schemas.convert',
   'wm-schemas.convert',


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