[gobject-introspection: 2/4] meson: add option 'gir-dir-prefix'



commit 3938b86f5289c2b28a5ec42965b8da4b509445c4
Author: Kai Kang <kai kang windriver com>
Date:   Fri Sep 14 01:26:38 2018 -0700

    meson: add option 'gir-dir-prefix'
    
    Add option 'gir-dir-prefix' for meson to make the installation path of
    .gir files could be configured which has been done for autoconf.
    
    Signed-off-by: Kai Kang <kai kang windriver com>

 gir/meson.build   | 1 -
 meson.build       | 8 +++++++-
 meson_options.txt | 4 ++++
 3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gir/meson.build b/gir/meson.build
index 607bbc45..1cb514a1 100644
--- a/gir/meson.build
+++ b/gir/meson.build
@@ -34,7 +34,6 @@ gir_files = [
 ]
 
 typelibdir = join_paths(get_option('libdir'), 'girepository-1.0')
-girdir = join_paths(get_option('datadir'), 'gir-1.0')
 install_data(gir_files, install_dir: girdir)
 
 scanner_command = [
diff --git a/meson.build b/meson.build
index 3f5d970d..78585a90 100644
--- a/meson.build
+++ b/meson.build
@@ -18,7 +18,12 @@ python = pymod.find_installation(get_option('python'))
 cc = meson.get_compiler('c')
 config = configuration_data()
 config.set_quoted('GIR_SUFFIX', 'gir-1.0')
-config.set_quoted('GIR_DIR', join_paths(get_option('prefix'), get_option('datadir'), 'gir-1.0'))
+gir_dir_prefix = get_option('gir-dir-prefix')
+if gir_dir_prefix == ''
+    gir_dir_prefix = get_option('datadir')
+endif
+girdir = join_paths(get_option('prefix'), gir_dir_prefix, 'gir-1.0')
+config.set_quoted('GIR_DIR', girdir)
 config.set_quoted('GOBJECT_INTROSPECTION_LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
 
 foreach type : ['char', 'short', 'int', 'long']
@@ -93,6 +98,7 @@ pkgconfig_conf.set('libdir', join_paths('${prefix}', get_option('libdir')))
 pkgconfig_conf.set('datarootdir', join_paths('${prefix}', get_option('datadir')))
 pkgconfig_conf.set('datadir', '${datarootdir}')
 pkgconfig_conf.set('includedir', join_paths('${prefix}', get_option('includedir')))
+pkgconfig_conf.set('GIR_DIR', join_paths('${prefix}', gir_dir_prefix, 'gir-1.0'))
 if host_system == 'windows' or host_system == 'cygwin'
   pkgconfig_conf.set('EXEEXT', '.exe')
 else
diff --git a/meson_options.txt b/meson_options.txt
index 49726be6..ee6958dd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -21,3 +21,7 @@ option('cairo-libname', type: 'string',
 option('python', type: 'string', value: 'python3',
   description: 'Path or name of the Python interpreter to build for'
 )
+
+option('gir-dir-prefix', type: 'string',
+  description: 'Intermediate prefix for gir installation under ${prefix}'
+)


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