All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/3] package/gobject-introspection: fix host-linking
@ 2020-02-24 17:09 aduskett at gmail.com
  2020-02-24 17:09 ` [Buildroot] [PATCH v2 2/3] package/gobject-introspection: export cc in g-ir-scanner aduskett at gmail.com
  2020-02-24 17:09 ` [Buildroot] [PATCH v2 3/3] package/meson: determine g-ir-scanner and g-ir-compiler paths from pkgconfig aduskett at gmail.com
  0 siblings, 2 replies; 4+ messages in thread
From: aduskett at gmail.com @ 2020-02-24 17:09 UTC (permalink / raw)
  To: buildroot

From: Adam Duskett <Aduskett@gmail.com>

When building, gobject-introspection uses g-ir-scanner to build several .gir
files. g-ir-scanner does not use LDPATH, so LD_LIBRARY_PATH must be used in
order to ensure that g-ir-scanner does not use the host library path.

This fix has the added benefit of allowing the host gobject-introspection to
build the host .gir, .rnc, and .typelib files, which some packages may require.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 package/gobject-introspection/gobject-introspection.mk | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/gobject-introspection/gobject-introspection.mk b/package/gobject-introspection/gobject-introspection.mk
index 67e5e37dee..e28748be2e 100644
--- a/package/gobject-introspection/gobject-introspection.mk
+++ b/package/gobject-introspection/gobject-introspection.mk
@@ -33,11 +33,11 @@ HOST_GOBJECT_INTROSPECTION_DEPENDENCIES = \
 GOBJECT_INTROSPECTION_NINJA_ENV += \
 	CC="$(TARGET_CC)"
 
-# Disable introspection data on the host, as it is not needed and
-# the package will attempt to use the systems libglib2 which will fail
-# if the systems libglib2 version is older than 2.60.
-HOST_GOBJECT_INTROSPECTION_CONF_OPTS = \
-	-Denable-introspection-data=false
+# When building, gobject-introspection uses g-ir-scanner to build several .gir
+# files. g-ir-scanner does not use LDPATH, so LD_LIBRARY_PATH must be used in
+# order to ensure that g-ir-scanner does not use the host library path.
+HOST_GOBJECT_INTROSPECTION_NINJA_ENV += \
+	LD_LIBRARY_PATH="$(HOST_DIR)/lib"
 
 # Use the host gi-scanner to prevent the scanner from generating incorrect
 # elf classes.
-- 
2.21.1 (Apple Git-122.3)

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

* [Buildroot] [PATCH v2 2/3] package/gobject-introspection: export cc in g-ir-scanner
  2020-02-24 17:09 [Buildroot] [PATCH v2 1/3] package/gobject-introspection: fix host-linking aduskett at gmail.com
@ 2020-02-24 17:09 ` aduskett at gmail.com
  2020-02-24 17:09 ` [Buildroot] [PATCH v2 3/3] package/meson: determine g-ir-scanner and g-ir-compiler paths from pkgconfig aduskett at gmail.com
  1 sibling, 0 replies; 4+ messages in thread
From: aduskett at gmail.com @ 2020-02-24 17:09 UTC (permalink / raw)
  To: buildroot

From: Adam Duskett <Aduskett@gmail.com>

Without this export, the host variant of g-ir-scanner will call the host
gcc for linking.

For autotools packages, this is not an issue as they use
Makefile.introspection, which will export the cross-cc, however for meson,
this is not the case, and linking errors occur when meson packages generate
.gir and .typelib files.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 package/gobject-introspection/g-ir-scanner.in          | 2 ++
 package/gobject-introspection/gobject-introspection.mk | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/package/gobject-introspection/g-ir-scanner.in b/package/gobject-introspection/g-ir-scanner.in
index 9f97497b7e..d5847ad063 100644
--- a/package/gobject-introspection/g-ir-scanner.in
+++ b/package/gobject-introspection/g-ir-scanner.in
@@ -1,6 +1,8 @@
 #!/usr/bin/env bash
 
 export GI_SCANNER_DISABLE_CACHE=1
+export CC="$(dirname "${0}")/../../../../bin/@BASENAME_TARGET_CC@"
+
 ${HOST_DIR}/bin/g-ir-scanner \
 --lib-dirs-envvar=GIR_EXTRA_LIBS_PATH \
 --use-binary-wrapper=$(dirname $0)/g-ir-scanner-qemuwrapper \
diff --git a/package/gobject-introspection/gobject-introspection.mk b/package/gobject-introspection/gobject-introspection.mk
index e28748be2e..6472f89c52 100644
--- a/package/gobject-introspection/gobject-introspection.mk
+++ b/package/gobject-introspection/gobject-introspection.mk
@@ -101,6 +101,8 @@ define GOBJECT_INTROSPECTION_INSTALL_WRAPPERS
 		$(INSTALL) -D -m 755 \
 			$(GOBJECT_INTROSPECTION_PKGDIR)/$(w).in $(STAGING_DIR)/usr/bin/$(w)
 	)
+	$(SED) "s%@BASENAME_TARGET_CC@%$(notdir $(TARGET_CC))%g" $(STAGING_DIR)/usr/bin/g-ir-scanner
+
 	# Gobject-introspection installs Makefile.introspection in
 	# $(STAGING_DIR)/usr/share which is needed for autotools-based programs to
 	# build .gir and .typelib files. Unfortuantly, gobject-introspection-1.0.pc
-- 
2.21.1 (Apple Git-122.3)

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

* [Buildroot] [PATCH v2 3/3] package/meson: determine g-ir-scanner and g-ir-compiler paths from pkgconfig
  2020-02-24 17:09 [Buildroot] [PATCH v2 1/3] package/gobject-introspection: fix host-linking aduskett at gmail.com
  2020-02-24 17:09 ` [Buildroot] [PATCH v2 2/3] package/gobject-introspection: export cc in g-ir-scanner aduskett at gmail.com
@ 2020-02-24 17:09 ` aduskett at gmail.com
  2020-02-26 14:02   ` Angelo Compagnucci
  1 sibling, 1 reply; 4+ messages in thread
From: aduskett at gmail.com @ 2020-02-24 17:09 UTC (permalink / raw)
  To: buildroot

From: Adam Duskett <Aduskett@gmail.com>

Currently, meson hard-codes the paths of these utilities, which results in
cross-compiled environments running the host versions of these tools instead of
the wrappers installed in the staging directory.

GObject-introspection provides the appropriate paths to these utilities via
pkg-config, so it would be best to use the results of pkg-config instead of
hard-coding these paths.

Current upstream-status: submitted
https://github.com/mesonbuild/meson/pull/6687

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 ...d-g-ir-compiler-paths-from-pkgconfig.patch | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/meson/0004-determine-g-ir-scanner-and-g-ir-compiler-paths-from-pkgconfig.patch

diff --git a/package/meson/0004-determine-g-ir-scanner-and-g-ir-compiler-paths-from-pkgconfig.patch b/package/meson/0004-determine-g-ir-scanner-and-g-ir-compiler-paths-from-pkgconfig.patch
new file mode 100644
index 0000000000..637f11d5e8
--- /dev/null
+++ b/package/meson/0004-determine-g-ir-scanner-and-g-ir-compiler-paths-from-pkgconfig.patch
@@ -0,0 +1,39 @@
+From 9ccaed380780178c4dab3a681f652ac7cd27452d Mon Sep 17 00:00:00 2001
+From: Adam Duskett <aduskett@gmail.com>
+Date: Mon, 24 Feb 2020 08:56:47 +0300
+Subject: [PATCH] determine g-ir-scanner and g-ir-compiler paths from pkgconfig
+
+Do not hardcode the name of those binaries; gobject-introspection
+provides them via pkgconfig.
+
+Upstream-Status: submitted
+https://github.com/mesonbuild/meson/pull/6687
+Signed-off-by: Adam Duskett <aduskett@gmail.com>
+
+---
+ mesonbuild/modules/gnome.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
+index 7c5a363..0002498 100644
+--- a/mesonbuild/modules/gnome.py
++++ b/mesonbuild/modules/gnome.py
+@@ -744,15 +744,15 @@ class GnomeModule(ExtensionModule):
+         if kwargs.get('install_dir'):
+             raise MesonException('install_dir is not supported with generate_gir(), see "install_dir_gir" and "install_dir_typelib"')
+ 
+-        giscanner = self.interpreter.find_program_impl('g-ir-scanner')
+-        gicompiler = self.interpreter.find_program_impl('g-ir-compiler')
+-
+         girtargets = [self._unwrap_gir_target(arg, state) for arg in args]
+ 
+         if len(girtargets) > 1 and any([isinstance(el, build.Executable) for el in girtargets]):
+             raise MesonException('generate_gir only accepts a single argument when one of the arguments is an executable')
+ 
+         self.gir_dep, pkgargs = self._get_gir_dep(state)
++        giscanner = self.gir_dep.get_pkgconfig_variable('g_ir_scanner', {})
++        gicompiler = self.gir_dep.get_pkgconfig_variable('g_ir_compiler', {})
++
+ 
+         ns = kwargs.pop('namespace')
+         nsversion = kwargs.pop('nsversion')
-- 
2.21.1 (Apple Git-122.3)

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

* [Buildroot] [PATCH v2 3/3] package/meson: determine g-ir-scanner and g-ir-compiler paths from pkgconfig
  2020-02-24 17:09 ` [Buildroot] [PATCH v2 3/3] package/meson: determine g-ir-scanner and g-ir-compiler paths from pkgconfig aduskett at gmail.com
@ 2020-02-26 14:02   ` Angelo Compagnucci
  0 siblings, 0 replies; 4+ messages in thread
From: Angelo Compagnucci @ 2020-02-26 14:02 UTC (permalink / raw)
  To: buildroot

On Mon, Feb 24, 2020 at 6:10 PM <aduskett@gmail.com> wrote:
>
> From: Adam Duskett <Aduskett@gmail.com>
>
> Currently, meson hard-codes the paths of these utilities, which results in
> cross-compiled environments running the host versions of these tools instead of
> the wrappers installed in the staging directory.
>
> GObject-introspection provides the appropriate paths to these utilities via
> pkg-config, so it would be best to use the results of pkg-config instead of
> hard-coding these paths.
>
> Current upstream-status: submitted
> https://github.com/mesonbuild/meson/pull/6687
>
> Signed-off-by: Adam Duskett <Aduskett@gmail.com>
> ---
>  ...d-g-ir-compiler-paths-from-pkgconfig.patch | 39 +++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 package/meson/0004-determine-g-ir-scanner-and-g-ir-compiler-paths-from-pkgconfig.patch
>
> diff --git a/package/meson/0004-determine-g-ir-scanner-and-g-ir-compiler-paths-from-pkgconfig.patch b/package/meson/0004-determine-g-ir-scanner-and-g-ir-compiler-paths-from-pkgconfig.patch
> new file mode 100644
> index 0000000000..637f11d5e8
> --- /dev/null
> +++ b/package/meson/0004-determine-g-ir-scanner-and-g-ir-compiler-paths-from-pkgconfig.patch
> @@ -0,0 +1,39 @@
> +From 9ccaed380780178c4dab3a681f652ac7cd27452d Mon Sep 17 00:00:00 2001
> +From: Adam Duskett <aduskett@gmail.com>
> +Date: Mon, 24 Feb 2020 08:56:47 +0300
> +Subject: [PATCH] determine g-ir-scanner and g-ir-compiler paths from pkgconfig
> +
> +Do not hardcode the name of those binaries; gobject-introspection
> +provides them via pkgconfig.
> +
> +Upstream-Status: submitted
> +https://github.com/mesonbuild/meson/pull/6687
> +Signed-off-by: Adam Duskett <aduskett@gmail.com>
Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
> +
> +---
> + mesonbuild/modules/gnome.py | 6 +++---
> + 1 file changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
> +index 7c5a363..0002498 100644
> +--- a/mesonbuild/modules/gnome.py
> ++++ b/mesonbuild/modules/gnome.py
> +@@ -744,15 +744,15 @@ class GnomeModule(ExtensionModule):
> +         if kwargs.get('install_dir'):
> +             raise MesonException('install_dir is not supported with generate_gir(), see "install_dir_gir" and "install_dir_typelib"')
> +
> +-        giscanner = self.interpreter.find_program_impl('g-ir-scanner')
> +-        gicompiler = self.interpreter.find_program_impl('g-ir-compiler')
> +-
> +         girtargets = [self._unwrap_gir_target(arg, state) for arg in args]
> +
> +         if len(girtargets) > 1 and any([isinstance(el, build.Executable) for el in girtargets]):
> +             raise MesonException('generate_gir only accepts a single argument when one of the arguments is an executable')
> +
> +         self.gir_dep, pkgargs = self._get_gir_dep(state)
> ++        giscanner = self.gir_dep.get_pkgconfig_variable('g_ir_scanner', {})
> ++        gicompiler = self.gir_dep.get_pkgconfig_variable('g_ir_compiler', {})
> ++
> +
> +         ns = kwargs.pop('namespace')
> +         nsversion = kwargs.pop('nsversion')
> --
> 2.21.1 (Apple Git-122.3)
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

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

end of thread, other threads:[~2020-02-26 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24 17:09 [Buildroot] [PATCH v2 1/3] package/gobject-introspection: fix host-linking aduskett at gmail.com
2020-02-24 17:09 ` [Buildroot] [PATCH v2 2/3] package/gobject-introspection: export cc in g-ir-scanner aduskett at gmail.com
2020-02-24 17:09 ` [Buildroot] [PATCH v2 3/3] package/meson: determine g-ir-scanner and g-ir-compiler paths from pkgconfig aduskett at gmail.com
2020-02-26 14:02   ` Angelo Compagnucci

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.