From 2e92c181a081e003cce0ef1bcc79da85fbbc269b Mon Sep 17 00:00:00 2001 From: Dylan Van Assche Date: Fri, 1 Jan 2021 18:38:47 +0100 Subject: [PATCH] meson.build: compile GLib schemas on install Run a script as a post install to make sure that all GLib schemas are compiled --- build-aux/post_install.py | 14 ++++++++++++++ meson.build | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 build-aux/post_install.py diff --git a/build-aux/post_install.py b/build-aux/post_install.py new file mode 100644 index 0000000..bf5128c --- /dev/null +++ b/build-aux/post_install.py @@ -0,0 +1,14 @@ +#!/usr/bin/python3 + +import os +import subprocess +import sys + +destdir = os.environ.get('DESTDIR', '') + +if not destdir and len(sys.argv) > 1: + datadir = sys.argv[1] + + print('Compiling gsettings schemas...') + subprocess.call(['glib-compile-schemas', os.path.join(datadir, 'glib-2.0', 'schemas')]) + diff --git a/meson.build b/meson.build index 634eefe..54dac50 100644 --- a/meson.build +++ b/meson.build @@ -98,6 +98,11 @@ libname = 'libfeedback-' + apiversion json_glib_validate = find_program('json-glib-validate', required: false) +meson.add_install_script( + join_paths('build-aux', 'post_install.py'), + datadir +) + subdir('data') subdir('libfeedback') subdir('src')