[gjs/wip/jtojnar/nixos-fixes: 1/5] vuild: Pass schemadir to compile-gschemas.py



commit 14bae0e2bc7e817f53f0dcd8ecd032f554d12e6f
Author: Jan Tojnar <jtojnar gmail com>
Date:   Sun Mar 15 01:26:47 2020 +0100

    vuild: Pass schemadir to compile-gschemas.py
    
    Avoiding the duplication will make patching easier for downstreams who need that.

 build/compile-gschemas.py | 7 +++++--
 meson.build               | 7 ++++---
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/build/compile-gschemas.py b/build/compile-gschemas.py
index 3dd1729d..fc0b1afc 100644
--- a/build/compile-gschemas.py
+++ b/build/compile-gschemas.py
@@ -2,9 +2,12 @@
 
 import os
 import subprocess
+import sys
 
-prefix = os.environ.get('MESON_INSTALL_PREFIX')
-schemadir = os.path.join(prefix, 'share', 'glib-2.0', 'schemas')
+if len(sys.argv) < 2:
+    sys.exit("usage: compile-gschemas.py <schemadir>")
+
+schemadir = sys.argv[1]
 
 if os.environ.get('DESTDIR') is None:
     print('Compiling GSettings schemas...')
diff --git a/meson.build b/meson.build
index ed51dbba..2e61801f 100644
--- a/meson.build
+++ b/meson.build
@@ -303,6 +303,7 @@ configure_file(output: 'config.h', configuration: header_conf)
 gjsjsdir = get_option('datadir') / api_name
 pkglibexecdir = get_option('libexecdir') / meson.project_name()
 abs_pkglibexecdir = get_option('prefix') / pkglibexecdir
+abs_datadir = get_option('prefix') / get_option('datadir')
 pkglibdir = get_option('libdir') / meson.project_name()
 
 ### Build dtrace probes ########################################################
@@ -540,9 +541,9 @@ install_data('installed-tests/extra/lsan.supp',
     install_dir: get_option('datadir') / api_name / 'lsan')
 
 if get_option('installed_tests')
-    install_data('installed-tests/js/org.gnome.GjsTest.gschema.xml',
-        install_dir: get_option('datadir') / 'glib-2.0/schemas')
-    meson.add_install_script('build/compile-gschemas.py')
+    schemadir = abs_datadir / 'glib-2.0' / 'schemas'
+    install_data('installed-tests/js/org.gnome.GjsTest.gschema.xml', install_dir: schemadir)
+    meson.add_install_script('build/compile-gschemas.py', schemadir)
 endif
 
 ### Generate pkg-config file ###################################################


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