summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-12-11 16:24:04 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-12-11 16:26:06 +0100
commit200721659a4a0bd6593054915303c76279ee23f4 (patch)
treea43f2d747a980bc8b42b94edfcd5fb6130a6eacf
parent81824492eef810f72dadcceb927fc3aedda5a531 (diff)
downloadgsettings-desktop-schemas-200721659a4a0bd6593054915303c76279ee23f4.tar.gz
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+.
-rwxr-xr-xbuild-aux/meson/post-install.sh9
-rw-r--r--meson.build4
-rw-r--r--schemas/meson.build2
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',