1 From bbc34f00fd30a13eafc607a956de60d822260355 Mon Sep 17 00:00:00 2001
2 From: Kai Kang <kai.kang@windriver.com>
3 Date: Fri, 14 Sep 2018 01:26:38 -0700
4 Subject: [PATCH] meson: add option 'gir-dir-prefix'
6 Add option 'gir-dir-prefix' for meson to make the installation path of
7 .gir files could be configured which has been done for autoconf.
9 Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gobject-introspection/commit/3938b86f5289c2b28a5ec42965b8da4b509445c4]
10 Signed-off-by: Kai Kang <kai.kang@windriver.com>
13 meson.build | 8 +++++++-
14 meson_options.txt | 4 ++++
15 3 files changed, 11 insertions(+), 2 deletions(-)
17 diff --git a/gir/meson.build b/gir/meson.build
18 index 607bbc4..1cb514a 100644
21 @@ -34,7 +34,6 @@ gir_files = [
24 typelibdir = join_paths(get_option('libdir'), 'girepository-1.0')
25 -girdir = join_paths(get_option('datadir'), 'gir-1.0')
26 install_data(gir_files, install_dir: girdir)
29 diff --git a/meson.build b/meson.build
30 index a1432f7..17acd82 100644
33 @@ -18,7 +18,12 @@ python = pymod.find_installation(get_option('python'))
34 cc = meson.get_compiler('c')
35 config = configuration_data()
36 config.set_quoted('GIR_SUFFIX', 'gir-1.0')
37 -config.set_quoted('GIR_DIR', join_paths(get_option('prefix'), get_option('datadir'), 'gir-1.0'))
38 +gir_dir_prefix = get_option('gir-dir-prefix')
39 +if gir_dir_prefix == ''
40 + gir_dir_prefix = get_option('datadir')
42 +girdir = join_paths(get_option('prefix'), gir_dir_prefix, 'gir-1.0')
43 +config.set_quoted('GIR_DIR', girdir)
44 config.set_quoted('GOBJECT_INTROSPECTION_LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
46 foreach type : ['char', 'short', 'int', 'long']
47 @@ -93,6 +98,7 @@ pkgconfig_conf.set('libdir', join_paths('${prefix}', get_option('libdir')))
48 pkgconfig_conf.set('datarootdir', join_paths('${prefix}', get_option('datadir')))
49 pkgconfig_conf.set('datadir', '${datarootdir}')
50 pkgconfig_conf.set('includedir', join_paths('${prefix}', get_option('includedir')))
51 +pkgconfig_conf.set('GIR_DIR', join_paths('${prefix}', gir_dir_prefix, 'gir-1.0'))
52 if host_system == 'windows' or host_system == 'cygwin'
53 pkgconfig_conf.set('EXEEXT', '.exe')
55 diff --git a/meson_options.txt b/meson_options.txt
56 index 49726be..ee6958d 100644
57 --- a/meson_options.txt
58 +++ b/meson_options.txt
59 @@ -21,3 +21,7 @@ option('cairo-libname', type: 'string',
60 option('python', type: 'string', value: 'python3',
61 description: 'Path or name of the Python interpreter to build for'
64 +option('gir-dir-prefix', type: 'string',
65 + description: 'Intermediate prefix for gir installation under ${prefix}'