All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection
@ 2021-03-25 17:38 Ross Burton
  2021-03-25 17:39 ` [PATCH v2 2/3] bitbake.conf: ensure BUILD_* tools match target tools Ross Burton
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ross Burton @ 2021-03-25 17:38 UTC (permalink / raw)
  To: openembedded-core

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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-devtools/meson/meson.inc         |  1 +
 .../meson/meson/gi-target-dep.patch           | 41 +++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 meta/recipes-devtools/meson/meson/gi-target-dep.patch

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
            file://cross-prop-default.patch \
            file://0001-modules-python.py-do-not-substitute-python-s-install.patch \
            file://0001-minstall-Correctly-set-uid-gid-of-installed-files.patch \
+           file://gi-target-dep.patch \
            "
 SRC_URI[sha256sum] = "72e1c782ba9bda204f4a1ed57f98d027d7b6eb9414c723eebbd6ec7f1955c8a6"
 
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 @@
+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
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-29 15:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25 17:38 [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection Ross Burton
2021-03-25 17:39 ` [PATCH v2 2/3] bitbake.conf: ensure BUILD_* tools match target tools Ross Burton
2021-03-25 17:39 ` [PATCH v2 3/3] meson: use native-file instead of environment variables Ross Burton
2021-03-25 18:15 ` [OE-core] [PATCH v2 1/3] meson: fix native/host confusion in gobject-introspection Alexander Kanavin
2021-03-25 19:07   ` Ross Burton
2021-03-26 18:48     ` Khem Raj
2021-03-29  9:25       ` Ross Burton
2021-03-29 15:26         ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.