blob: f32267d0c41e6288978390d0937c53550a78c121 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 0b860cb8a22ae876b6088939dbabca216bc29431 Mon Sep 17 00:00:00 2001
Brad Bishop316dfdd2018-06-25 12:45:53 -04002From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 4 Aug 2017 16:18:47 +0300
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08004Subject: [PATCH] gobject-introspection: determine g-ir-scanner and
Brad Bishop316dfdd2018-06-25 12:45:53 -04005 g-ir-compiler paths from pkgconfig
6
7Do not hardcode the name of those binaries; gobject-introspection
8provides them via pkgconfig, and they can be set to something else
9(for example when cross-compiling).
10
11Upstream-Status: Pending
12Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13
14---
15 mesonbuild/modules/gnome.py | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019index b29bab9..dc4c401 100644
Brad Bishop316dfdd2018-06-25 12:45:53 -040020--- a/mesonbuild/modules/gnome.py
21+++ b/mesonbuild/modules/gnome.py
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080022@@ -393,8 +393,6 @@ class GnomeModule(ExtensionModule):
Brad Bishop316dfdd2018-06-25 12:45:53 -040023 raise MesonException('Gir takes one argument')
24 if kwargs.get('install_dir'):
25 raise MesonException('install_dir is not supported with generate_gir(), see "install_dir_gir" and "install_dir_typelib"')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080026- giscanner = self.interpreter.find_program_impl('g-ir-scanner')
27- gicompiler = self.interpreter.find_program_impl('g-ir-compiler')
Brad Bishop316dfdd2018-06-25 12:45:53 -040028 girtarget = args[0]
29 while hasattr(girtarget, 'held_object'):
30 girtarget = girtarget.held_object
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080031@@ -405,6 +403,8 @@ class GnomeModule(ExtensionModule):
Brad Bishop316dfdd2018-06-25 12:45:53 -040032 self.gir_dep = PkgConfigDependency('gobject-introspection-1.0',
33 state.environment,
34 {'native': True})
35+ giscanner = os.environ['PKG_CONFIG_SYSROOT_DIR'] + self.gir_dep.get_pkgconfig_variable('g_ir_scanner', {})
36+ gicompiler = os.environ['PKG_CONFIG_SYSROOT_DIR'] + self.gir_dep.get_pkgconfig_variable('g_ir_compiler', {})
37 pkgargs = self.gir_dep.get_compile_args()
38 except Exception:
39 raise MesonException('gobject-introspection dependency was not found, gir cannot be generated.')