summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/meson/meson/gi-target-dep.patch
blob: 25b30ca27aed48674009ecc1b7ded10dfa7b66b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
When building gobject-introspection we want the *native* binaries (as they need
to be executed) but *host* gobject-introspection libraries, as otherwise the
native pkg-config can be used and the build will try to link native and host
binaries together.

Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@arm.com>

diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index f9660838e..2eefc3fc7 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -84,8 +84,8 @@ class GnomeModule(ExtensionModule):
                      mlog.bold('https://github.com/mesonbuild/meson/issues/1387'),
                      once=True)
 
-    def _get_native_dep(self, state, depname, required=True):
-        kwargs = {'native': True, 'required': required}
+    def _get_dep(self, state, depname, native=False, required=True):
+        kwargs = {'native': native, 'required': required}
         holder = self.interpreter.func_dependency(state.current_node, [depname], kwargs)
         return holder.held_object
 
@@ -101,7 +101,7 @@ class GnomeModule(ExtensionModule):
             return ExternalProgram.from_entry(name, prog)
 
         # Check if pkgconfig has a variable
-        dep = self._get_native_dep(state, depname, required=False)
+        dep = self._get_dep(state, depname, native=True, required=False)
         if dep.found() and dep.type_name == 'pkgconfig':
             value = dep.get_pkgconfig_variable(varname, {})
             if value:
@@ -481,7 +481,7 @@ class GnomeModule(ExtensionModule):
 
     def _get_gir_dep(self, state):
         if not self.gir_dep:
-            self.gir_dep = self._get_native_dep(state, 'gobject-introspection-1.0')
+            self.gir_dep = self._get_dep(state, 'gobject-introspection-1.0')
             self.giscanner = self._get_native_binary(state, 'g-ir-scanner', 'gobject-introspection-1.0', 'g_ir_scanner')
             self.gicompiler = self._get_native_binary(state, 'g-ir-compiler', 'gobject-introspection-1.0', 'g_ir_compiler')
         return self.gir_dep, self.giscanner, self.gicompiler