summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-03-25 17:38:59 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-31 00:06:23 +0100
commitff9c4b014179481a5ea76487187205e606f8b4b2 (patch)
tree7f7ba8725aedcc001bd1112a46c3520de3543ff3
parent57b37e3b03d9074bdb6bed5cc4a850385332cc63 (diff)
downloadpoky-ff9c4b014179481a5ea76487187205e606f8b4b2.tar.gz
meson: fix native/host confusion in gobject-introspection
When building G-I we want to use *native* binaries (as they need to be executed) but the *cross* libraries, as otherwise when using the correct pkg-config binary in native lookups Meson will end up linking native and cross libraries together. (From OE-Core rev: 958d7f8cebe863705dc6710b671764879ea68575) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/meson/meson.inc1
-rw-r--r--meta/recipes-devtools/meson/meson/gi-target-dep.patch41
2 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index fc3ca85fae..e186dede92 100644
--- a/meta/recipes-devtools/meson/meson.inc
+++ b/meta/recipes-devtools/meson/meson.inc
@@ -15,6 +15,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
15 file://cross-prop-default.patch \ 15 file://cross-prop-default.patch \
16 file://0001-modules-python.py-do-not-substitute-python-s-install.patch \ 16 file://0001-modules-python.py-do-not-substitute-python-s-install.patch \
17 file://0001-minstall-Correctly-set-uid-gid-of-installed-files.patch \ 17 file://0001-minstall-Correctly-set-uid-gid-of-installed-files.patch \
18 file://gi-target-dep.patch \
18 " 19 "
19SRC_URI[sha256sum] = "72e1c782ba9bda204f4a1ed57f98d027d7b6eb9414c723eebbd6ec7f1955c8a6" 20SRC_URI[sha256sum] = "72e1c782ba9bda204f4a1ed57f98d027d7b6eb9414c723eebbd6ec7f1955c8a6"
20 21
diff --git a/meta/recipes-devtools/meson/meson/gi-target-dep.patch b/meta/recipes-devtools/meson/meson/gi-target-dep.patch
new file mode 100644
index 0000000000..25b30ca27a
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/gi-target-dep.patch
@@ -0,0 +1,41 @@
1When building gobject-introspection we want the *native* binaries (as they need
2to be executed) but *host* gobject-introspection libraries, as otherwise the
3native pkg-config can be used and the build will try to link native and host
4binaries together.
5
6Upstream-Status: Pending
7Signed-off-by: Ross Burton <ross.burton@arm.com>
8
9diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
10index f9660838e..2eefc3fc7 100644
11--- a/mesonbuild/modules/gnome.py
12+++ b/mesonbuild/modules/gnome.py
13@@ -84,8 +84,8 @@ class GnomeModule(ExtensionModule):
14 mlog.bold('https://github.com/mesonbuild/meson/issues/1387'),
15 once=True)
16
17- def _get_native_dep(self, state, depname, required=True):
18- kwargs = {'native': True, 'required': required}
19+ def _get_dep(self, state, depname, native=False, required=True):
20+ kwargs = {'native': native, 'required': required}
21 holder = self.interpreter.func_dependency(state.current_node, [depname], kwargs)
22 return holder.held_object
23
24@@ -101,7 +101,7 @@ class GnomeModule(ExtensionModule):
25 return ExternalProgram.from_entry(name, prog)
26
27 # Check if pkgconfig has a variable
28- dep = self._get_native_dep(state, depname, required=False)
29+ dep = self._get_dep(state, depname, native=True, required=False)
30 if dep.found() and dep.type_name == 'pkgconfig':
31 value = dep.get_pkgconfig_variable(varname, {})
32 if value:
33@@ -481,7 +481,7 @@ class GnomeModule(ExtensionModule):
34
35 def _get_gir_dep(self, state):
36 if not self.gir_dep:
37- self.gir_dep = self._get_native_dep(state, 'gobject-introspection-1.0')
38+ self.gir_dep = self._get_dep(state, 'gobject-introspection-1.0')
39 self.giscanner = self._get_native_binary(state, 'g-ir-scanner', 'gobject-introspection-1.0', 'g_ir_scanner')
40 self.gicompiler = self._get_native_binary(state, 'g-ir-compiler', 'gobject-introspection-1.0', 'g_ir_compiler')
41 return self.gir_dep, self.giscanner, self.gicompiler