Skip to contentSkip to conversation

gobject-introspection: New package

PATCH Superseded aduskett at gmail.com 5 participants 19 messages Oct 21, 2019 – Feb 4, 2020 Arm/Amlogic Meson SoC support

v14 of 17 Superseded Latest is v17 →

lore
Share & tools
lore
#0 lore raw

v14 cover gobject-introspection: New package

From: Adam Duskett <[email protected]>

Included in version 14 of the gobject-introspection patch series. The patch series is almost identical with V13 except for one significant change:

With permission from Arnout I have included the patch:
package/pkg-meson.mk: set Python sysconfigdata However; the patch has one big flaw I would like to discuss:

The patch breaks libglib2 if a target-python is not selected or is not yet
built and installed before building target libglib2. Indeed, it would be
because we would pass _PYTHON_SYSCONFIGDATA_NAME="" as an environment
variable, which leads to the following error during libglib2-configure:
meson.build:1978:0: ERROR: <ExternalProgram 'python3' -> ['output/host/bin/python3']> is not a valid python or it is missing setuptools

However, I do believe the patch is a better direction to go than the previous
patch: package/meson: prevent python include path manipulation for two significant reasons:

1) Meson does not have to be patched.
2) It fixes the suffix of built python applications that use meson (such as newer versions of python-gobject.) With the old patch, the suffix of the python libraries is -x86-64 even though the binaries themselves would be the target architecture, which causes import errors on the target. With this patch, the suffix is correct.

I propose keeping the patch but modifying it to work correctly if the target-python isn't selected or isn't yet built. I need help however with this as I am not great with makefile syntax this complex.

Thanks!

Adam

Adam Duskett (5):
package/libiberty: new package
package/prelink-cross: new package
package/gdb: depend on libiberty
package/pkg-meson.mk: set Python sysconfigdata
package/gobject-introspection: new package

 DEVELOPERS                                    |   3 +
 package/Config.in                             |   1 +
 package/gdb/gdb.mk                            |   4 +-
 ...lete-upstream-attempt-at-cross-compi.patch |  33 ++++
 ...d-cross-compilation-support-to-meson.patch | 163 ++++++++++++++++++
 ...d-disable-tests-when-cross-compiling.patch |  27 +++
 ...canner-add-use-binary-wrapper-option.patch |  52 ++++++
 ...scanner-add-a-use-ldd-wrapper-option.patch |  48 ++++++
 ...scanner-add-a-lib-dirs-envvar-option.patch |  73 ++++++++
 .../0007-Add-rpath-links-to-ccompiler.patch   |  29 ++++
 ...-error-return-codes-from-ldd-wrapper.patch |  28 +++
 package/gobject-introspection/Config.in       |  26 +++
 .../gobject-introspection/g-ir-compiler.in    |   2 +
 .../g-ir-scanner-lddwrapper.in                |   2 +
 .../g-ir-scanner-qemuwrapper.in               |  17 ++
 package/gobject-introspection/g-ir-scanner.in |   7 +
 .../gobject-introspection.hash                |   4 +
 .../gobject-introspection.mk                  | 103 +++++++++++
 package/libiberty/libiberty.hash              |   2 +
 package/libiberty/libiberty.mk                |  27 +++
 package/pkg-meson.mk                          |   3 +
 package/prelink-cross/prelink-cross.hash      |   3 +
 package/prelink-cross/prelink-cross.mk        |  16 ++
 23 files changed, 672 insertions(+), 1 deletion(-)
 create mode 100644 package/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch
 create mode 100644 package/gobject-introspection/0002-add-cross-compilation-support-to-meson.patch
 create mode 100644 package/gobject-introspection/0003-meson.build-disable-tests-when-cross-compiling.patch
 create mode 100644 package/gobject-introspection/0004-giscanner-add-use-binary-wrapper-option.patch
 create mode 100644 package/gobject-introspection/0005-giscanner-add-a-use-ldd-wrapper-option.patch
 create mode 100644 package/gobject-introspection/0006-giscanner-add-a-lib-dirs-envvar-option.patch
 create mode 100644 package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch
 create mode 100644 package/gobject-introspection/0008-ignore-error-return-codes-from-ldd-wrapper.patch
 create mode 100644 package/gobject-introspection/Config.in
 create mode 100644 package/gobject-introspection/g-ir-compiler.in
 create mode 100644 package/gobject-introspection/g-ir-scanner-lddwrapper.in
 create mode 100644 package/gobject-introspection/g-ir-scanner-qemuwrapper.in
 create mode 100644 package/gobject-introspection/g-ir-scanner.in
 create mode 100644 package/gobject-introspection/gobject-introspection.hash
 create mode 100644 package/gobject-introspection/gobject-introspection.mk
 create mode 100644 package/libiberty/libiberty.hash
 create mode 100644 package/libiberty/libiberty.mk
 create mode 100644 package/prelink-cross/prelink-cross.hash
 create mode 100644 package/prelink-cross/prelink-cross.mk
Signature · 1 line
2.21.0
#1 lore raw

PATCH v14 1/5 package/libiberty: new package

From: Adam Duskett <[email protected]>

Some packages, like prelink-cross, will want to use libiberty but do not bundle their own instance (which is good!).

However, libiberty is made for being bundled in packages: all GNU packages that use libiberty (gcc, binutils, gdb et al...) all have their own bundled variant. This means that there is no official upstream for libiberty; the closest being as part of the combined binutils-gdb tree.

So we introduce a new host-only package, that installs just libiberty from a binutils released tarball.

Again, as libiberty is usually bundled in packages, it usually only install a static version. Furthermore, it does not obey to the usual --enable-shared and --disable-static flags; it only ever builds a static version.

Furthermore, this library is not built with -fPIC, but some packages may pick it to build shared objects. This is the case for host-gdb, for example, which accidentally picks that library instead of its internal one.

So, rather than fix the various gdb versions and variants we can use, we ensure that the libiberty we install is usable in shared objects, and we ensure it is always built before host-gdb.

---
Changes v1 -> v11:
- Add this patch to the series

 DEVELOPERS                       |  1 +
 package/libiberty/libiberty.hash |  2 ++
 package/libiberty/libiberty.mk   | 27 +++++++++++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 package/libiberty/libiberty.hash
 create mode 100644 package/libiberty/libiberty.mk
DEVELOPERS +1 -0
index 906ccae006..f10711ee6a 100644
@@ -2426,6 +2426,7 @@ F:	package/keyutils/
 F:	package/libbsd/
 F:	package/libedit/
 F:	package/libgsm/
+F:	package/libiberty/
 F:	package/libinput/
 F:	package/libiscsi/
 F:	package/libpri/
package/libiberty/libiberty.hash new file +2 -0
new file mode 100644
index 0000000000..270f38dfa7
@@ -0,0 +1,2 @@
+# From ftp://gcc.gnu.org/pub/binutils/releases/sha512.sum
+sha512  d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a  binutils-2.32.tar.xz
package/libiberty/libiberty.mk new file +27 -0
new file mode 100644
index 0000000000..17976fdd4f
@@ -0,0 +1,27 @@
+################################################################################
+#
+# libiberty
+#
+################################################################################
+
+LIBIBERTY_VERSION = 2.32
+LIBIBERTY_SOURCE = binutils-$(LIBIBERTY_VERSION).tar.xz
+LIBIBERTY_SITE = $(BR2_GNU_MIRROR)/binutils
+LIBIBERTY_DL_SUBDIR = binutils
+LIBIBERTY_SUBDIR = libiberty
+
+# We explicitly disable multilib, as we do in binutils.
+# By default, libiberty installs nothing, so we must force it.
+HOST_LIBIBERTY_CONF_OPTS = \
+	--disable-multilib \
+	--enable-install-libiberty
+
+# Some packages (e.g. host-gdb) will pick this library and build shared
+# objects with it. But libiberty does not honour the --enable-shared and
+# --disable-static flags; it only ever builds a static library no matter
+# what. So we must force -fPIC in build flags.
+HOST_LIBIBERTY_CONF_ENV = \
+	CFLAGS="$(HOST_CFLAGS) -fPIC" \
+	LDFLAGS="$(HOST_LDFLAGS) -fPIC"
+
+$(eval $(host-autotools-package))
Signature · 1 line
2.21.0
#2 lore raw

PATCH v14 1/5 package/libiberty: new package

Hi Adam,

Quoted 12 lines · On Mon, Oct 21, 2019 at 10:05 PM <[email protected]> wrote:

From: Adam Duskett <[email protected]>

Some packages, like prelink-cross, will want to use libiberty but do not bundle their own instance (which is good!).

However, libiberty is made for being bundled in packages: all GNU packages that use libiberty (gcc, binutils, gdb et al...) all have their own bundled variant. This means that there is no official upstream for libiberty; the closest being as part of the combined binutils-gdb tree.

Quoted 5 lines

So we introduce a new host-only package, that installs just libiberty from a binutils released tarball.

Again, as libiberty is usually bundled in packages, it usually only install a static version. Furthermore, it does not obey to the usual

s/install/installs and perhaps remove "to" after obey

Any plans for v15? Or are you waiting for the next gobject-introspection release that would make some related patches as obsolete?

Regards,
Yegor

Quoted 84 lines

--enable-shared and --disable-static flags; it only ever builds a static version.

Furthermore, this library is not built with -fPIC, but some packages may pick it to build shared objects. This is the case for host-gdb, for example, which accidentally picks that library instead of its internal one.

So, rather than fix the various gdb versions and variants we can use, we ensure that the libiberty we install is usable in shared objects, and we ensure it is always built before host-gdb.

---
Changes v1 -> v11:
- Add this patch to the series

 DEVELOPERS                       |  1 +
 package/libiberty/libiberty.hash |  2 ++
 package/libiberty/libiberty.mk   | 27 +++++++++++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 package/libiberty/libiberty.hash
 create mode 100644 package/libiberty/libiberty.mk
DEVELOPERS +1 -0
index 906ccae006..f10711ee6a 100644
@@ -2426,6 +2426,7 @@ F:        package/keyutils/
 F:     package/libbsd/
 F:     package/libedit/
 F:     package/libgsm/
+F:     package/libiberty/
 F:     package/libinput/
 F:     package/libiscsi/
 F:     package/libpri/
package/libiberty/libiberty.hash new file +2 -0
new file mode 100644
index 0000000000..270f38dfa7
@@ -0,0 +1,2 @@
+# From ftp://gcc.gnu.org/pub/binutils/releases/sha512.sum
+sha512  d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a  binutils-2.32.tar.xz
package/libiberty/libiberty.mk new file +27 -1
new file mode 100644
index 0000000000..17976fdd4f
@@ -0,0 +1,27 @@
+################################################################################
+#
+# libiberty
+#
+################################################################################
+
+LIBIBERTY_VERSION = 2.32
+LIBIBERTY_SOURCE = binutils-$(LIBIBERTY_VERSION).tar.xz
+LIBIBERTY_SITE = $(BR2_GNU_MIRROR)/binutils
+LIBIBERTY_DL_SUBDIR = binutils
+LIBIBERTY_SUBDIR = libiberty
+
+# We explicitly disable multilib, as we do in binutils.
+# By default, libiberty installs nothing, so we must force it.
+HOST_LIBIBERTY_CONF_OPTS = \
+       --disable-multilib \
+       --enable-install-libiberty
+
+# Some packages (e.g. host-gdb) will pick this library and build shared
+# objects with it. But libiberty does not honour the --enable-shared and
+# --disable-static flags; it only ever builds a static library no matter
+# what. So we must force -fPIC in build flags.
+HOST_LIBIBERTY_CONF_ENV = \
+       CFLAGS="$(HOST_CFLAGS) -fPIC" \
+       LDFLAGS="$(HOST_LDFLAGS) -fPIC"
+
+$(eval $(host-autotools-package))
--

2.21.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#3 lore raw

PATCH v14 2/5 package/prelink-cross: new package

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

Prelink-cross emulates a runtime linker for a given sysroot. This is necessary to allow gobject-introspection to build its typelib files during cross-compiling.

We're using a sha1 on the cross_prelink branch, as we need the RTLD-enabled variant of prelink-cross.

---
Changes v11 -> v13:
- Change version to a853a5d715d84eec93aa68e8f2df26b7d860f5b2 as the commit

    id b10e14218646d8b74773b82b0f8b395bce698fa2 no longer exists.

Changes v10 -> v11:
- adopted by Yann
- switch to a https git server
- drop the Config.in.host entry
- fix typo in commit log

Changes v9 -> v10:
- None

Changes v8 -> v9:
- Add the package to the DEVELOPERS file under my name.
- Bump version to a853a5d715d84eec93aa68e8f2df26b7d860f5b2
- Add host-elfutils as a dependency.

Changes v7 -> v8:
- None

Changes v1 -> v7:
- Add patch to series.

 DEVELOPERS                               |  1 +
 package/prelink-cross/prelink-cross.hash |  3 +++
 package/prelink-cross/prelink-cross.mk   | 16 ++++++++++++++++
 3 files changed, 20 insertions(+)
 create mode 100644 package/prelink-cross/prelink-cross.hash
 create mode 100644 package/prelink-cross/prelink-cross.mk
DEVELOPERS +1 -0
index f10711ee6a..fa2497155d 100644
@@ -53,6 +53,7 @@ F:	package/openjdk/
 F:	package/openjdk-bin/
 F:	package/php/
 F:	package/policycoreutils/
+F:	package/prelink-cross/
 F:	package/python3/
 F:	package/python-aioredis/
 F:	package/python-asgiref/
package/prelink-cross/prelink-cross.hash new file +3 -0
new file mode 100644
index 0000000000..3ac33ac3d0
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  cb3f5d833cd74b7e90e38465c9c948b0f4138c017509cb91e391b0931063429e  prelink-cross-a853a5d715d84eec93aa68e8f2df26b7d860f5b2.tar.gz
+sha256  b8a2f73f743dc1a51aff23f1aacbca4b868564db52496fa3c0caba755bfd1eaf  COPYING
package/prelink-cross/prelink-cross.mk new file +16 -0
new file mode 100644
index 0000000000..b43c209b16
@@ -0,0 +1,16 @@
+################################################################################
+#
+# host-prelink-cross
+#
+################################################################################
+
+HOST_PRELINK_CROSS_VERSION = a853a5d715d84eec93aa68e8f2df26b7d860f5b2
+HOST_PRELINK_CROSS_SITE = https://git.yoctoproject.org/git/prelink-cross
+HOST_PRELINK_CROSS_SITE_METHOD = git
+HOST_PRELINK_CROSS_LICENSE = GPL-2.0
+HOST_PRELINK_CROSS_LICENSE_FILES = COPYING
+# Sources from git, no configure script present
+HOST_PRELINK_CROSS_AUTORECONF = YES
+HOST_PRELINK_CROSS_DEPENDENCIES = host-elfutils host-libiberty
+
+$(eval $(host-autotools-package))
Signature · 1 line
2.21.0
#4 lore raw

PATCH v14 3/5 package/gdb: depend on libiberty

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

If present, GDB may use a system installed libiberty. As such, we must ensure that host-libiberty is installed first.

---
v13 -> v14:
- Fix typo in the comment. (Arnout)

v1 -> v11:
- Add this patch to the series

 package/gdb/gdb.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/gdb/gdb.mk +3 -1
index 46d745a897..01f7e14460 100644
@@ -35,7 +35,9 @@ endif
 # For the host variant, we really want to build with XML support,
 # which is needed to read XML descriptions of target architectures. We
 # also need ncurses.
-HOST_GDB_DEPENDENCIES = host-expat host-ncurses
+# As for libiberty, gdb may use a system-installed one if present, so
+# we must ensure ours is installed first.
+HOST_GDB_DEPENDENCIES = host-expat host-libiberty host-ncurses
 
 # Disable building documentation
 GDB_MAKE_OPTS += MAKEINFO=true
Signature · 1 line
2.21.0
#5 lore raw

PATCH v14 4/5 package/pkg-meson.mk: set Python sysconfigdata

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

meson has support for Python dependencies, to e.g. build Python modules. It parses Python's sysconfig module to find the appropriate configuration variables. However, the sysconfig module is the one for the host, _not_ for the target. Therefore, wrong values may be set. Many of them get overridden anyway by the cross-compilation.conf. One particular one that is problematic is that it uses the python-XXX.pc pkg-config file for the host instead of the target, because it explicitly sets the PKG_CONFIG_LIBDIR found in sysconfig.

Use the same trick as for python package: pass PYTHONPATH, PYTHONNOUSERSITE and _PYTHON_SYSCONFIGDATA_NAME in the environment to point to staging instead of host. This ensures the sysconfig from the target is used instead of the one from the host.

An alternative would be to patch meson to not use the PKG_CONFIG_LIBDIR from sysconfig. However, it is likely that other problems will pop up at some point because of using the wrong sysconfig.

Note that this approach will still break things when meson needs to build something for the host during a target build.

---
Changes v1 -> v14:
- Add this patch to the series.

 package/pkg-meson.mk | 3 +++
 1 file changed, 3 insertions(+)
package/pkg-meson.mk +3 -0
index 184a22a44a..b6360fb738 100644
@@ -84,6 +84,9 @@ define $(2)_CONFIGURE_CMDS
 	    ) \
 	    package/meson/cross-compilation.conf.in \
 	    > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
+	_PYTHON_SYSCONFIGDATA_NAME="$$(if $$(BR2_PACKAGE_PYTHON3),$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" \
+	PYTHONPATH="$$(if $$(BR2_PACKAGE_PYTHON3),$$(PYTHON3_PATH),$$(PYTHON_PATH))" \
+	PYTHONNOUSERSITE=1 \
 	PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
 		--prefix=/usr \
 		--libdir=lib \
Signature · 1 line
2.21.0
#6 lore raw

PATCH v14 4/5 package/pkg-meson.mk: set Python sysconfigdata

package/pkg-meson.mk define $(2)_CONFIGURE_CMDS · line 87

Quoted 1 line · On Mon, 21 Oct 2019 13:04:37 -0700 aduskett at gmail.com wrote:
package/pkg-meson.mk +1 -0
+	_PYTHON_SYSCONFIGDATA_NAME="$$(if $$(BR2_PACKAGE_PYTHON3),$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" \

Why do we need this conditional on BR2_PACKAGE_PYTHON3 ? package/pkg-python.mk is using PKG_PYTHON_SYSCONFIGDATA_NAME unconditionally, regardless of Python 2.x vs. Python 3.x. Could you explain this ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH v14 4/5 package/pkg-meson.mk: set Python sysconfigdata

Note that this patch was authored by me, Adam accidentally took over authorship
(which is why he said on IRC he needs to send a v15).

Quoted 9 lines · Thomas Petazzoni

package/pkg-meson.mk define $(2)_CONFIGURE_CMDS · line 87

Quoted 1 line · On Mon, 21 Oct 2019 13:04:37 -0700 aduskett at gmail.com wrote:
package/pkg-meson.mk +1 -0
+	_PYTHON_SYSCONFIGDATA_NAME="$$(if $$(BR2_PACKAGE_PYTHON3),$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" \

Why do we need this conditional on BR2_PACKAGE_PYTHON3 ? package/pkg-python.mk is using PKG_PYTHON_SYSCONFIGDATA_NAME unconditionally, regardless of Python 2.x vs. Python 3.x. Could you explain this ?

I can :-)

It's a mistake. I noticed that PKG_PYTHON_SYSCONFIGDATA_NAME was left empty for
python2, so I made sure it got the correct value (in Python2 there is only one _sysconfigdata). However, python2 doesn't have the _PYTHON_SYSCONFIGDATA_NAME variable so it's meaningless.

Should be tested if things work OK with python2 on target, but I expect they do.

Regards,
Arnout

#8 lore raw

PATCH v14 4/5 package/pkg-meson.mk: set Python sysconfigdata

Quoted 14 lines · Arnout Vandecappelle

Note that this patch was authored by me, Adam accidentally took over authorship
(which is why he said on IRC he needs to send a v15).

Quoted 9 lines · Thomas Petazzoni

package/pkg-meson.mk define $(2)_CONFIGURE_CMDS · line 87

Quoted 1 line · On Mon, 21 Oct 2019 13:04:37 -0700 aduskett at gmail.com wrote:
package/pkg-meson.mk +1 -0
+	_PYTHON_SYSCONFIGDATA_NAME="$$(if $$(BR2_PACKAGE_PYTHON3),$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" \

Why do we need this conditional on BR2_PACKAGE_PYTHON3 ? package/pkg-python.mk is using PKG_PYTHON_SYSCONFIGDATA_NAME unconditionally, regardless of Python 2.x vs. Python 3.x. Could you explain this ?

Quoted 8 lines

I can :-)

It's a mistake. I noticed that PKG_PYTHON_SYSCONFIGDATA_NAME was left empty for
python2, so I made sure it got the correct value (in Python2 there is only one _sysconfigdata). However, python2 doesn't have the _PYTHON_SYSCONFIGDATA_NAME variable so it's meaningless.

Should be tested if things work OK with python2 on target, but I expect they do.

I hadn't read Adam's remark in the cover letter yet, about how this patch
breaks the build of libglib2.

I suspect that we shold not set _PYTHON_SYSCONFIGDATA_NAME if python3 is not
selected. Indeed, python3 *will* observe this environment variable, but if target python3 is not selected, it will be empty. meson will do checks for host-python, and setting that environment variable will break the check (which is BTW an example of the comment I made in the commit log of this patch: "Note that this approach will still break things when meson needs to build something for the host during a target build."). libglib2 indeed does use python3 during the build, so it asks meson to check for it, but since it doesn't try to build C modules for the host, it still works even with a wrong _sysconfigdata.

Adam, could you test if this works better?

+ $$(if
$$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME)") \

Regards,
Arnout

#9 lore raw

PATCH v14 4/5 package/pkg-meson.mk: set Python sysconfigdata

Hey Arnout;

I absolutely can!
I will do so today, and if it works, I will send a V15 with you as the author of the patch.

Thanks!

Adam

Quoted 50 lines · Arnout Vandecappelle
Quoted 14 lines · Arnout Vandecappelle

Note that this patch was authored by me, Adam accidentally took over authorship
(which is why he said on IRC he needs to send a v15).

Quoted 9 lines · Thomas Petazzoni
Quoted 1 line · On Mon, 21 Oct 2019 13:04:37 -0700 aduskett at gmail.com wrote:

+ _PYTHON_SYSCONFIGDATA_NAME="$$(if $$(BR2_PACKAGE_PYTHON3),$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" \

Why do we need this conditional on BR2_PACKAGE_PYTHON3 ? package/pkg-python.mk is using PKG_PYTHON_SYSCONFIGDATA_NAME unconditionally, regardless of Python 2.x vs. Python 3.x. Could you explain this ?

Quoted 8 lines

I can :-)

It's a mistake. I noticed that PKG_PYTHON_SYSCONFIGDATA_NAME was left empty for
python2, so I made sure it got the correct value (in Python2 there is only one _sysconfigdata). However, python2 doesn't have the _PYTHON_SYSCONFIGDATA_NAME variable so it's meaningless.

Should be tested if things work OK with python2 on target, but I expect they do.

I hadn't read Adam's remark in the cover letter yet, about how this patch
breaks the build of libglib2.

I suspect that we shold not set _PYTHON_SYSCONFIGDATA_NAME if python3 is not
selected. Indeed, python3 *will* observe this environment variable, but if target python3 is not selected, it will be empty. meson will do checks for host-python, and setting that environment variable will break the check (which is BTW an example of the comment I made in the commit log of this patch: "Note that this approach will still break things when meson needs to build something for the host during a target build."). libglib2 indeed does use python3 during the build, so it asks meson to check for it, but since it doesn't try to build C modules for the host, it still works even with a wrong _sysconfigdata.

Adam, could you test if this works better?

+ $$(if
$$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME)") \

Regards,
Arnout

#10 lore raw

PATCH v14 4/5 package/pkg-meson.mk: set Python sysconfigdata

In reply to Arnout Vandecappelle

Arnout:

Quoted 40 lines · Arnout Vandecappelle
Quoted 14 lines · Arnout Vandecappelle

Note that this patch was authored by me, Adam accidentally took over authorship
(which is why he said on IRC he needs to send a v15).

Quoted 9 lines · Thomas Petazzoni
Quoted 1 line · On Mon, 21 Oct 2019 13:04:37 -0700 aduskett at gmail.com wrote:

+ _PYTHON_SYSCONFIGDATA_NAME="$$(if $$(BR2_PACKAGE_PYTHON3),$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" \

Why do we need this conditional on BR2_PACKAGE_PYTHON3 ? package/pkg-python.mk is using PKG_PYTHON_SYSCONFIGDATA_NAME unconditionally, regardless of Python 2.x vs. Python 3.x. Could you explain this ?

Quoted 8 lines

I can :-)

It's a mistake. I noticed that PKG_PYTHON_SYSCONFIGDATA_NAME was left empty for
python2, so I made sure it got the correct value (in Python2 there is only one _sysconfigdata). However, python2 doesn't have the _PYTHON_SYSCONFIGDATA_NAME variable so it's meaningless.

Should be tested if things work OK with python2 on target, but I expect they do.

I hadn't read Adam's remark in the cover letter yet, about how this patch
breaks the build of libglib2.

I suspect that we shold not set _PYTHON_SYSCONFIGDATA_NAME if python3 is not
selected. Indeed, python3 *will* observe this environment variable, but if target python3 is not selected, it will be empty. meson will do checks for host-python, and setting that environment variable will break the check (which is BTW an example of the comment I made in the commit log of this patch: "Note that this approach will still break things when meson needs to build something for the host during a target build."). libglib2 indeed does use python3 during the build, so it asks meson to check for it, but since it doesn't try to build C modules for the host, it still works even with a wrong _sysconfigdata.

Quoted 5 lines

Adam, could you test if this works better?

+ $$(if
$$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME)") \

$$(if $$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" Also does not work, because the target python3 may not yet be built.

Quoted 5 lines

Regards,
Arnout

#11 lore raw

PATCH v14 4/5 package/pkg-meson.mk: set Python sysconfigdata

Quoted 7 lines · On Wed, 23 Oct 2019 13:42:54 -0700 Adam Duskett <[email protected]> wrote:
Quoted 5 lines

Adam, could you test if this works better?

+ $$(if
$$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME)") \

$$(if $$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" Also does not work, because the target python3 may not yet be built.

But that is totally unrelated to the _sysconfigdata "fallback" that I was criticizing. The issue of "you're passing _PYTHON_SYSCONFIG_DATA_NAME regardless of whether Python was built before or not" was already present in your initial submission.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#12 lore raw

PATCH v14 4/5 package/pkg-meson.mk: set Python sysconfigdata

Quoted 10 lines · Thomas Petazzoni
Quoted 7 lines · On Wed, 23 Oct 2019 13:42:54 -0700 Adam Duskett <[email protected]> wrote:
Quoted 5 lines

Adam, could you test if this works better?

+ $$(if
$$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME)") \

$$(if $$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" Also does not work, because the target python3 may not yet be built.

Ugh indeed, another side effect of this environment being used for both "host"
python and "cross" python...

I'm starting to think this is not such a good solution after all...

Quoted 4 lines

But that is totally unrelated to the _sysconfigdata "fallback" that I was criticizing. The issue of "you're passing _PYTHON_SYSCONFIG_DATA_NAME regardless of whether Python was built before or not" was already present in your initial submission.

With "initial submission", do you mean *my* initial submission (i.e. this patch
4/5 from v14), or Adam's initial submission which patched meson itself and which was taken over from yocto? The latter did not actually change sysconfigdata at all; instead it patched meson to not make use of the pkg_config_libdir that comes out of sysconfigdata (which is I think the only thing from sysconfigdata that is actually used by meson).

I'll dive into the meson code again to see if I can find something better...

Regards,
Arnout

#13 lore raw

PATCH v14 4/5 package/pkg-meson.mk: set Python sysconfigdata

Quoted 25 lines · Arnout Vandecappelle
Quoted 10 lines · Thomas Petazzoni
Quoted 7 lines · On Wed, 23 Oct 2019 13:42:54 -0700 Adam Duskett <[email protected]> wrote:
Quoted 5 lines

Adam, could you test if this works better?

+ $$(if
$$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME)") \

$$(if $$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" Also does not work, because the target python3 may not yet be built.

Ugh indeed, another side effect of this environment being used for both "host"
python and "cross" python...

I'm starting to think this is not such a good solution after all...

Quoted 4 lines

But that is totally unrelated to the _sysconfigdata "fallback" that I was criticizing. The issue of "you're passing _PYTHON_SYSCONFIG_DATA_NAME regardless of whether Python was built before or not" was already present in your initial submission.

Quoted 8 lines

With "initial submission", do you mean *my* initial submission (i.e. this patch
4/5 from v14), or Adam's initial submission which patched meson itself and which was taken over from yocto? The latter did not actually change sysconfigdata at all; instead it patched meson to not make use of the pkg_config_libdir that comes out of sysconfigdata (which is I think the only thing from sysconfigdata that is actually used by meson).

I'll dive into the meson code again to see if I can find something better...

OK, I *think* I've come up with an alternative (but I'm sure as hell not going
to implement it :-).

Essentially, it's the same issue as for pkg-config: we should distinguish
between the host version and the cross version (i.e. executable that can run on the host but that returns results for the target). Meson is very explicit about such a distinction, so anything pertaining to cross-compilation should be passed through cross-compilation.conf instead of in the environment.

As far as I can see in the source code, we can in fact set a
"cross-compilation" python in the [binaries] section. So, we could create a python wrapper that sets those environment variables, and point to that python wrapper in the cross-compilation.conf.

And of course, we can use the same approach in pkg-python.mk: set
$(2)_PYTHON_INTERPRETER to the python wrapper instead of $(HOST_DIR)/bin/python.

Regards,
Arnout

#14 lore raw

PATCH v14 4/5 package/pkg-meson.mk: set Python sysconfigdata

This might be a good solution, but it is beyond my skillset to implement it properly.

If the rest of the series looks good, perhaps we could come up with a solution during the developer conference and them implement GOI?

Regards;
Adam

Quoted 59 lines · Arnout Vandecappelle
Quoted 25 lines · Arnout Vandecappelle
Quoted 10 lines · Thomas Petazzoni
Quoted 7 lines · On Wed, 23 Oct 2019 13:42:54 -0700 Adam Duskett <[email protected]> wrote:
Quoted 5 lines

Adam, could you test if this works better?

+ $$(if
$$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME)") \

$$(if $$(BR2_PACKAGE_PYTHON3),_PYTHON_SYSCONFIGDATA_NAME="$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" Also does not work, because the target python3 may not yet be built.

Ugh indeed, another side effect of this environment being used for both "host"
python and "cross" python...

I'm starting to think this is not such a good solution after all...

Quoted 4 lines

But that is totally unrelated to the _sysconfigdata "fallback" that I was criticizing. The issue of "you're passing _PYTHON_SYSCONFIG_DATA_NAME regardless of whether Python was built before or not" was already present in your initial submission.

Quoted 8 lines

With "initial submission", do you mean *my* initial submission (i.e. this patch
4/5 from v14), or Adam's initial submission which patched meson itself and which was taken over from yocto? The latter did not actually change sysconfigdata at all; instead it patched meson to not make use of the pkg_config_libdir that comes out of sysconfigdata (which is I think the only thing from sysconfigdata that is actually used by meson).

I'll dive into the meson code again to see if I can find something better...

OK, I *think* I've come up with an alternative (but I'm sure as hell not going
to implement it :-).

Essentially, it's the same issue as for pkg-config: we should distinguish
between the host version and the cross version (i.e. executable that can run on the host but that returns results for the target). Meson is very explicit about such a distinction, so anything pertaining to cross-compilation should be passed through cross-compilation.conf instead of in the environment.

As far as I can see in the source code, we can in fact set a
"cross-compilation" python in the [binaries] section. So, we could create a python wrapper that sets those environment variables, and point to that python wrapper in the cross-compilation.conf.

And of course, we can use the same approach in pkg-python.mk: set
$(2)_PYTHON_INTERPRETER to the python wrapper instead of $(HOST_DIR)/bin/python.

Regards,
Arnout

#15 lore raw

PATCH v14 4/5 package/pkg-meson.mk: set Python sysconfigdata

In reply to aduskett at gmail.com

Hi,

this patch breaks pkg-meson.mk on building glib2, as suggested by Adam lets substitute it with this patch:
https://patchwork.ozlabs.org/patch/1120929/

Best regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
Quoted 46 lines · aduskett at gmail.com

From: Adam Duskett <[email protected]>

meson has support for Python dependencies, to e.g. build Python modules. It parses Python's sysconfig module to find the appropriate configuration variables. However, the sysconfig module is the one for the host, _not_ for the target. Therefore, wrong values may be set. Many of them get overridden anyway by the cross-compilation.conf. One particular one that is problematic is that it uses the python-XXX.pc pkg-config file for the host instead of the target, because it explicitly sets the PKG_CONFIG_LIBDIR found in sysconfig.

Use the same trick as for python package: pass PYTHONPATH, PYTHONNOUSERSITE and _PYTHON_SYSCONFIGDATA_NAME in the environment to point to staging instead of host. This ensures the sysconfig from the target is used instead of the one from the host.

An alternative would be to patch meson to not use the PKG_CONFIG_LIBDIR from sysconfig. However, it is likely that other problems will pop up at some point because of using the wrong sysconfig.

Note that this approach will still break things when meson needs to build something for the host during a target build.

---
Changes v1 -> v14:
- Add this patch to the series.

  package/pkg-meson.mk | 3 +++
  1 file changed, 3 insertions(+)
package/pkg-meson.mk +3 -0
index 184a22a44a..b6360fb738 100644
@@ -84,6 +84,9 @@ define $(2)_CONFIGURE_CMDS
  	    ) \
  	    package/meson/cross-compilation.conf.in \
  	    > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
+	_PYTHON_SYSCONFIGDATA_NAME="$$(if $$(BR2_PACKAGE_PYTHON3),$$(PKG_PYTHON_SYSCONFIGDATA_NAME),_sysconfigdata)" \
+	PYTHONPATH="$$(if $$(BR2_PACKAGE_PYTHON3),$$(PYTHON3_PATH),$$(PYTHON_PATH))" \
+	PYTHONNOUSERSITE=1 \
  	PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
  		--prefix=/usr \
  		--libdir=lib \
#16 lore raw

PATCH v14 5/5 package/gobject-introspection: new package

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

GObject introspection is a middleware layer between C libraries (using GObject) and language bindings. The C library can be scanned at compile time and generate a metadata file, in addition to the actual native C library. Then at runtime, language bindings can read this metadata and automatically provide bindings to call into the C library.

There's an XML format called GIR used by GObject-Introspection. The purpose of it is to provide a standard structure to access the complete available API that a library or other unit of code exports. It is meant to be language agnostic using namespaces to separate core, language or library specific functionality.

Cross-compiling gobject-introspection is not an easy task. The main issue is that in the process of creating the XML files, gobject-introspection must first run and scan the binary, which, if the binary is cross-compiled, would not typically be possible from the host system.

Because of this limitation, several wrappers are used to call instead first out qemu which will then run the native scanner to create the binaries.

There are seven total patches and four different wrapper files needed to successfully cross-compile and run this package, many of them are from open-embedded, but two of them are of my own doing.

1) Revert a previous, incomplete attempt at adding cross-compiling support.

2) Add support for cross compiling with meson.

3) Disable tests when cross-compiling.

4) Add support for the various wrappers. (See patch for details.)

5) Add an option to use a binary wrapper; this patch will force giscanner to use a wrapper executable to run binaries it's producing, instead of attempting to run them from the host.

6) Add an option to use an LDD wrapper, again, useful for cross-compiled environments.

7) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)

8) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the environment for the package to correctly link against the passed on paths.

9) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127 when it can't find a library, which will break subprocess.check_output().

---
Changes v13 -> v14:
- Bump to version 1.62.0

Changes v10 -> v11:
- reorder config.in entries: arch deps first, then toolchain deps and order packages deps alphabetically (Yann)
- drop dependency on threads, wchar, and !static: it's implicit from glibc (Yann)
- Bump to version 1.60.2
- Switched to a meson build system as autotools is no longer supported with gobject-introspection 1.60.x.
- Removed the following patches that are no longer needed:
- 0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch
- 0005-user-PYTHON_CONFIG-to-find-includes.patch
- 0008-fix-gobject-pc.file.patch
- Add the following patches:
- 0002-add-cross-compilation-support-to-meson.patch
- 0003-meson.build-disable-tests-when-cross-compiling.patch
- 0008-ignore-error-return-codes-from-ldd-wrapper.patch

Changes v9 -> v10:
- Makefile cleanup
- Fix license syntax (Thomas)
- Add libffi as a mandatory dependency (Thomas)
- remove --disalbe-static (Thomas)
- add --with-cairo if the cairo package is selected (Thomas)
- Change PYTHON_INCLUDES to PYTHON_CONFIG in gobject-introspection.mk (Thomas)
- Use | for all sed functions (Thomas)
- Remove GOBJECT_INTROSPECTION_WRAPPERS (Thomas)
- Add GOBJECT_INTROSPECTION_REMOVE_DEVELOPMENT_FILES target finalize hook. (Thomas)
- Use $(dirname $0) in wrappers instead of $STAGING_DIR (Thomas)
- Remove _GIR_EXTRA_LIBS_PATH in pkg-autotools.mk in favor of a seperate patch. (Thomas)

Changes v8 -> v9:
- Create the $(STAGING_DIR)/usr/lib/gio/modules-dummy directory in the GOBJECT_INTROSPECTION_POST_PATCH_HOOKS to prevent qemu from segfaulting when g-ir-scanner-qemuwrapper is ran.
- Remove the $(STAGING_DIR) prefix from gobject-introspection-1.0.pc to prevent pkg-config from appending a second staging_dir to the path of the g-ir-compiler. This prevents packages such a gstreamer1 from trying to call $(STAGING_DIR)/$(STAGING_DIR)/usr/bin/g-ir-compiler, which will break the build.

Changes v7 -> v8:
- Add "select BR2_PACKAGE_HOST_PRELINK_CROSS" to Config.in

Changes v6 -> v7:
- Remove the cross-ldd script in favor of the prelink-cross package.
- Install the ldd and qemu wrappers in a post patch hook seperate of the other wrappers.
- Set --enable-introspection-data in the configure options.

Changes v5 -> v6:
- Update gobject-introspection to 1.56.1
- Remove upstreamed 0008-add-Float128.patch

Changes v4 -> v5:
- Added a more detailed commit message (Yann)
- Removed $HOST_DIR/bin/qemu- at HOST_QEMU_ARCH@ @HOST_QEMU_CPU_TUNE@ in favor of @QEMU_USER@ (Thanks Yann)

Changes v3 -> v4:
- Removed RFC tag.
- Added 0007-Add-rpath-links-to-ccompiler.patch
- Removed config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch as it is not Yocto specific.
- Added the _GIR_EXTRA_LIBS_PATH to pkg-autotools.mk. This allows package specific Gir libraries to be passed on to g-ir-scanner-qemuwrapper.
- Fixed a typo in g-ir-scanner-qemuwrapper.in.
- Remove BR2_PACKAGE_GOBJECT_INTROSPECTION_ARCH_SUPPORTS_TARGET in favor of BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS

Changes v2 -> v3:
- Removed Linux kernel dependency (baruch)
- Changed $(LINUX_VERSION) to $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) (baruch)
- Changed @LINUX_VERSION@ in g-ir-scanner-qemuwrapper.in to @TOOLCHAIN_HEADERS_VERSION@ to match the above variable change.
- Added BR2_PACKAGE_GOBJECT_INTROSPECTION_ARCH_SUPPORTS_TARGET in Config.in with only BR2_arm selected for now.
- Removed BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS in favor of the above change.
- Added two new lines in the base Makefile which removes any remaining .gir or .rnc files from the target filing system, as these are not needed or runtime, only compile time.

Changes v1 -> v2:
- Fixed wrappers
- Added 0007-giscanner-add-a-lib-dirs-envvar-option.patch
- Added 0008-add-Float128.patch

 DEVELOPERS                                    |   1 +
 package/Config.in                             |   1 +
 ...lete-upstream-attempt-at-cross-compi.patch |  33 ++++
 ...d-cross-compilation-support-to-meson.patch | 163 ++++++++++++++++++
 ...d-disable-tests-when-cross-compiling.patch |  27 +++
 ...canner-add-use-binary-wrapper-option.patch |  52 ++++++
 ...scanner-add-a-use-ldd-wrapper-option.patch |  48 ++++++
 ...scanner-add-a-lib-dirs-envvar-option.patch |  73 ++++++++
 .../0007-Add-rpath-links-to-ccompiler.patch   |  29 ++++
 ...-error-return-codes-from-ldd-wrapper.patch |  28 +++
 package/gobject-introspection/Config.in       |  26 +++
 .../gobject-introspection/g-ir-compiler.in    |   2 +
 .../g-ir-scanner-lddwrapper.in                |   2 +
 .../g-ir-scanner-qemuwrapper.in               |  17 ++
 package/gobject-introspection/g-ir-scanner.in |   7 +
 .../gobject-introspection.hash                |   4 +
 .../gobject-introspection.mk                  | 103 +++++++++++
 17 files changed, 616 insertions(+)
 create mode 100644 package/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch
 create mode 100644 package/gobject-introspection/0002-add-cross-compilation-support-to-meson.patch
 create mode 100644 package/gobject-introspection/0003-meson.build-disable-tests-when-cross-compiling.patch
 create mode 100644 package/gobject-introspection/0004-giscanner-add-use-binary-wrapper-option.patch
 create mode 100644 package/gobject-introspection/0005-giscanner-add-a-use-ldd-wrapper-option.patch
 create mode 100644 package/gobject-introspection/0006-giscanner-add-a-lib-dirs-envvar-option.patch
 create mode 100644 package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch
 create mode 100644 package/gobject-introspection/0008-ignore-error-return-codes-from-ldd-wrapper.patch
 create mode 100644 package/gobject-introspection/Config.in
 create mode 100644 package/gobject-introspection/g-ir-compiler.in
 create mode 100644 package/gobject-introspection/g-ir-scanner-lddwrapper.in
 create mode 100644 package/gobject-introspection/g-ir-scanner-qemuwrapper.in
 create mode 100644 package/gobject-introspection/g-ir-scanner.in
 create mode 100644 package/gobject-introspection/gobject-introspection.hash
 create mode 100644 package/gobject-introspection/gobject-introspection.mk
DEVELOPERS +1 -0
index fa2497155d..cd58877d92 100644
@@ -31,6 +31,7 @@ F:	package/audit/
 F:	package/busybox/
 F:	package/checkpolicy/
 F:	package/cppdb/
+F:	package/gobject-introspection/
 F:	package/gstreamer1/gstreamer1/
 F:	package/gstreamer1/gstreamer1-mm/
 F:	package/gstreamer1/gst1-plugins-bad/
package/Config.in +1 -0
index c8ff524e83..21aa631bad 100644
@@ -1715,6 +1715,7 @@ menu "Other"
 	source "package/glibmm/Config.in"
 	source "package/glm/Config.in"
 	source "package/gmp/Config.in"
+	source "package/gobject-introspection/Config.in"
 	source "package/gsl/Config.in"
 	source "package/gtest/Config.in"
 	source "package/jemalloc/Config.in"
package/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch new file +33 -0
new file mode 100644
index 0000000000..1e8bd3518a
@@ -0,0 +1,33 @@
+From 3a9d1e5ee0aae56fafec0beba2014c19e4ff310c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Wed, 23 Mar 2016 17:07:28 +0200
+Subject: [PATCH] Revert an incomplete upstream attempt at cross-compile support
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ common.mk                | 4 ----
+ giscanner/gdumpparser.py | 6 ------
+ 2 files changed, 10 deletions(-)
+
+diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py
+index 1134f33..9bdc2bc 100644
+--- a/giscanner/gdumpparser.py
++++ b/giscanner/gdumpparser.py
+@@ -156,12 +156,6 @@ blob containing data gleaned from GObject's primitive introspection."""
+         out_path = os.path.join(self._binary.tmpdir, 'dump.xml')
+
+         args = []
+-
+-        # Prepend the launcher command and arguments, if defined
+-        launcher = os.environ.get('GI_CROSS_LAUNCHER')
+-        if launcher:
+-            args.extend(launcher.split())
+-
+         args.extend(self._binary.args)
+         args.append('--introspect-dump=%s,%s' % (in_path, out_path))
+ 
+-- 
+2.7.0
+
package/gobject-introspection/0002-add-cross-compilation-support-to-meson.patch new file +163 -0

163 lines not on this page · raw message

package/gobject-introspection/0003-meson.build-disable-tests-when-cross-compiling.patch new file +27 -0
new file mode 100644
index 0000000000..10d592272a
@@ -0,0 +1,27 @@
+From 2c384187cc22113c0c9b1cd233948118f7c085ef Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Mon, 25 Mar 2019 13:28:48 +0100
+Subject: [PATCH] meson.build: disable tests when cross-compiling
+
+Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/64]
+Signed-off-by: Alexander Kanavin <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ meson.build | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 2544ff3..4c16fe5 100644
+--- a/meson.build
++++ b/meson.build
+@@ -168,7 +168,9 @@ if get_option('enable-introspection-data') == true
+ endif
+ subdir('examples')
+ subdir('docs')
+-subdir('tests')
++if not meson.is_cross_build()
++    subdir('tests')
++endif
+ 
+ install_data('Makefile.introspection', install_dir: join_paths(get_option('datadir'), 'gobject-introspection-1.0'))
+ install_data('m4/introspection.m4', install_dir: join_paths(get_option('datadir'), 'aclocal'))
package/gobject-introspection/0004-giscanner-add-use-binary-wrapper-option.patch new file +52 -0

52 lines not on this page · raw message

package/gobject-introspection/0005-giscanner-add-a-use-ldd-wrapper-option.patch new file +48 -0

48 lines not on this page · raw message

package/gobject-introspection/0006-giscanner-add-a-lib-dirs-envvar-option.patch new file +73 -0

73 lines not on this page · raw message

package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch new file +29 -0
new file mode 100644
index 0000000000..08835d3ecc
@@ -0,0 +1,29 @@
+From 72a427bc50daee8f1ded0e9221e53dbbf2a80f08 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <[email protected]>
+Date: Wed, 14 Mar 2018 12:07:10 -0400
+Subject: [PATCH] Add rpath links to ccompiler
+
+This patch allows gobject-introspection to process extra paths passed to the
+compiler via the GIR_EXTRA_LIBS_PATH variable.
+
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ giscanner/ccompiler.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
+index a8bd5b1..51bb9bc 100644
+--- a/giscanner/ccompiler.py
++++ b/giscanner/ccompiler.py
+@@ -229,6 +229,8 @@ class CCompiler(object):
+ 
+         for envvar in runtime_path_envvar:
+             if envvar in os.environ:
++                for envvar_path in os.environ[envvar].split(':'):
++                    args.append("-Wl,-rpath-link," + envvar_path)
+                 os.environ[envvar] = \
+                     os.pathsep.join(runtime_paths + [os.environ[envvar]])
+             else:
+-- 
+2.14.3
+
package/gobject-introspection/0008-ignore-error-return-codes-from-ldd-wrapper.patch new file +28 -0
new file mode 100644
index 0000000000..568758d332
@@ -0,0 +1,28 @@
+From f742da8b3913f4818d3f419117076afe62f4dbf4 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Wed, 5 Sep 2018 16:46:52 +0200
+Subject: [PATCH] giscanner: ignore error return codes from ldd-wrapper
+
+prelink-rtld, which we use instead of ldd returns 127 when it can't find a library.
+It is not an error per se, but it breaks subprocess.check_output().
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ giscanner/shlibs.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
+index d67df95..80352a6 100644
+--- a/giscanner/shlibs.py
++++ b/giscanner/shlibs.py
+@@ -102,7 +102,7 @@ def _resolve_non_libtool(options, binary, libraries):
+             args.extend(['otool', '-L', binary.args[0]])
+         else:
+             args.extend(['ldd', binary.args[0]])
+-        output = subprocess.check_output(args)
++        output = subprocess.run(args, check=False, stdout=subprocess.PIPE).stdout
+         if isinstance(output, bytes):
+             output = output.decode("utf-8", "replace")
+ 
package/gobject-introspection/Config.in new file +26 -0
new file mode 100644
index 0000000000..b93d5e4c45
@@ -0,0 +1,26 @@
+config BR2_PACKAGE_GOBJECT_INTROSPECTION
+	bool "gobject-introspection"
+	depends on BR2_USE_MMU # python3, libglib2
+	depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	select BR2_PACKAGE_HOST_PRELINK_CROSS
+	select BR2_PACKAGE_HOST_QEMU
+	select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
+	select BR2_PACKAGE_LIBFFI
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_ZLIB
+	help
+	  GObject introspection is a middleware layer between C
+	  libraries (using GObject) and language bindings. The C library
+	  can be scanned at compile time and generate a metadata file,
+	  in addition to the actual native C library. Then at runtime,
+	  language bindings can read this metadata and automatically
+	  provide bindings to call into the C library.
+
+	  https://wiki.gnome.org/action/show/Projects/GObjectIntrospection
+
+comment "gobject-introspection needs a glibc toolchain"
+	depends on BR2_USE_MMU
+	depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_USES_GLIBC
package/gobject-introspection/g-ir-compiler.in new file +2 -0
new file mode 100644
index 0000000000..579fd53fa4
@@ -0,0 +1,2 @@
+#!/bin/sh
+$(dirname $0)/g-ir-scanner-qemuwrapper $(dirname $0)/g-ir-compiler.real "$@"
package/gobject-introspection/g-ir-scanner-lddwrapper.in new file +2 -0
new file mode 100644
index 0000000000..02f5c2883d
@@ -0,0 +1,2 @@
+#!/bin/sh
+${HOST_DIR}/sbin/prelink-rtld --root=$(dirname $0)/../../ "$@"
package/gobject-introspection/g-ir-scanner-qemuwrapper.in new file +17 -0
new file mode 100644
index 0000000000..b69222d27a
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Pass -r to qemu-user as to trick glibc into not errorings out if the host kernel
+# is older than the target kernel.
+# Use a modules directory which does not exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+GIO_MODULE_DIR=$(dirname $0)/../lib/gio/modules-dummy \
+ at QEMU_USER@ -r @TOOLCHAIN_HEADERS_VERSION@ \
+-L $(dirname $0)/../../ \
+-E LD_LIBRARY_PATH=$GIR_EXTRA_LIBS_PATH:.libs:$(dirname $0)/../lib:$(dirname $0)/../../lib \
+"$@"
+
+if [ $? -ne 0 ]; then
+    echo "If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help."
+    echo '(typically like this: GIR_EXTRA_LIBS_PATH="$(@D)/.libs")'
+    exit 1
+fi
package/gobject-introspection/g-ir-scanner.in new file +7 -0
new file mode 100644
index 0000000000..09530aad56
@@ -0,0 +1,7 @@
+#!/bin/sh
+export GI_SCANNER_DISABLE_CACHE=1
+$HOST_DIR/bin/g-ir-scanner \
+--lib-dirs-envvar=GIR_EXTRA_LIBS_PATH \
+--use-binary-wrapper=$(dirname $0)/g-ir-scanner-qemuwrapper \
+--use-ldd-wrapper=$(dirname $0)/g-ir-scanner-lddwrapper \
+--add-include-path=$(dirname $0)/../share/gir-1.0 "$@"
package/gobject-introspection/gobject-introspection.hash new file +4 -0
new file mode 100644
index 0000000000..0454c59565
@@ -0,0 +1,4 @@
+#From http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/1.62/gobject-introspection-1.62.0.sha256sum
+sha256 b1ee7ed257fdbc008702bdff0ff3e78a660e7e602efa8f211dc89b9d1e7d90a2 gobject-introspection-1.62.0.tar.xz
+sha256 d245807f90032872d1438d741ed21e2490e1175dc8aa3afa5ddb6c8e529b58e5 COPYING.LGPL
+sha256 32b1062f7da84967e7019d01ab805935caa7ab7321a7ced0e30ebe75e5df1670 COPYING.GPL
package/gobject-introspection/gobject-introspection.mk new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
2.21.0
#17 lore raw

PATCH v14 5/5 package/gobject-introspection: new package

Just a few minor comments :-)

On 21/10/2019 22:04, aduskett at gmail.com wrote:
[snip]

Quoted 19 lines

There are seven total patches and four different wrapper files needed to successfully cross-compile and run this package, many of them are from open-embedded, but two of them are of my own doing.

1) Revert a previous, incomplete attempt at adding cross-compiling support.

2) Add support for cross compiling with meson.

3) Disable tests when cross-compiling.

4) Add support for the various wrappers. (See patch for details.)

5) Add an option to use a binary wrapper; this patch will force giscanner to use a wrapper executable to run binaries it's producing, instead of attempting to run them from the host.

6) Add an option to use an LDD wrapper, again, useful for cross-compiled environments.

Quoted 8 lines

7) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)

8) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the environment for the package to correctly link against the passed on paths.

9) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127 when it can't find a library, which will break subprocess.check_output().

I count just 8 patches, and only one of them is by you.

[snip]

package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch line 9

Quoted 11 lines

+++ b/package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch

package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch new file +9 -0
@@ -0,0 +1,29 @@
+From 72a427bc50daee8f1ded0e9221e53dbbf2a80f08 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <[email protected]>
+Date: Wed, 14 Mar 2018 12:07:10 -0400
+Subject: [PATCH] Add rpath links to ccompiler
+
+This patch allows gobject-introspection to process extra paths passed to the
+compiler via the GIR_EXTRA_LIBS_PATH variable.
+
+Signed-off-by: Adam Duskett <[email protected]>

Did you send this patch upstream? Looks perfectly upstreamable to me.

Quoted 14 lines
package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch new file +14 -0
+---
+ giscanner/ccompiler.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
+index a8bd5b1..51bb9bc 100644
+--- a/giscanner/ccompiler.py
++++ b/giscanner/ccompiler.py
+@@ -229,6 +229,8 @@ class CCompiler(object):
+ 
+         for envvar in runtime_path_envvar:
+             if envvar in os.environ:
++                for envvar_path in os.environ[envvar].split(':'):
++                    args.append("-Wl,-rpath-link," + envvar_path)

package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch

Quoted 10 lines
package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch new file +10 -0
+                 os.environ[envvar] = \
+                     os.pathsep.join(runtime_paths + [os.environ[envvar]])
+             else:[snip]
+GOBJECT_INTROSPECTION_VERSION_MAJOR = 1.62
+GOBJECT_INTROSPECTION_VERSION = $(GOBJECT_INTROSPECTION_VERSION_MAJOR).0
+GOBJECT_INTROSPECTION_SITE = http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/$(GOBJECT_INTROSPECTION_VERSION_MAJOR)
+GOBJECT_INTROSPECTION_SOURCE = gobject-introspection-$(GOBJECT_INTROSPECTION_VERSION).tar.xz
+GOBJECT_INTROSPECTION_INSTALL_STAGING = YES
+GOBJECT_INTROSPECTION_AUTORECONF = YES
+GOBJECT_INTROSPECTION_LICENSE = LGPL-2.0+ or GPL-2.0+

It's AND, not OR, so 'GPL-2.0+, LGPL-2.0+' (I prefer to put GPL first because
it's stronger).

Also some files are BSD-2-Clause.

Quoted 1 line

+GOBJECT_INTROSPECTION_LICENSE_FILES = COPYING.LGPL COPYING.GPL

Unfortunately no license file for the BSD, so the best we can do is
giscanner/scannerlexer.l

package/gobject-introspection/gobject-introspection.mk line 24

Quoted 10 lines
package/gobject-introspection/gobject-introspection.mk new file +10 -0
+
+GOBJECT_INTROSPECTION_DEPENDENCIES = \
+	host-autoconf-archive \
+	host-gobject-introspection \
+	host-prelink-cross \
+	python3 \
+	host-qemu \
+	libffi \
+	libglib2 \
+	zlib

Nitpick: I like dependences to be sorted.

Quoted 20 lines
package/gobject-introspection/gobject-introspection.mk new file +20 -0
+HOST_GOBJECT_INTROSPECTION_DEPENDENCIES = \
+	host-bison \
+	host-flex \
+	host-libglib2 \
+	host-python3
+
+# g-ir-scanner will default to /usr/bin/ld for linking if this is not set.
+GOBJECT_INTROSPECTION_NINJA_ENV += \
+	CC="$(TARGET_CC)"
+
+# Use the host gi-scanner to prevent the scanner from generating incorrect
+# elf classes.
+GOBJECT_INTROSPECTION_CONF_OPTS = \
+	-Denable-host-gi=true \
+	-Denable-gi-cross-wrapper="$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper" \
+	-Denable-gi-ldd-wrapper="$(STAGING_DIR)/usr/bin/g-ir-scanner-lddwrapper" \
+	-Denable-introspection-data=true
+
+ifeq ($(BR2_PACKAGE_CAIRO),y)
+GOBJECT_INTROSPECTION_DEPENDENCIES += cairo

package/gobject-introspection/gobject-introspection.mk line 55

Quoted 10 lines
package/gobject-introspection/gobject-introspection.mk new file +10 -0
+GOBJECT_INTROSPECTION_CONF_OPTS += -Dcairo=true
+endif
+
+# GI_SCANNER_DISABLE_CACHE=1 prevents g-ir-scanner from writing cache data to $HOME
+HOST_GOBJECT_INTROSPECTION_CONF_ENV = \
+	GI_SCANNER_DISABLE_CACHE=1
+
+# GI_SCANNER_DISABLE_CACHE=1 prevents g-ir-scanner from writing cache data to $HOME
+GOBJECT_INTROSPECTION_CONF_ENV = \
+	GI_SCANNER_DISABLE_CACHE=1

Nitpick: we usually put the target first, then the host (which is not entirely
logical, because you first build the host and then the target; but ok). Also, no need to repeat the comment.

# GI_SCANNER_DISABLE_CACHE=1 prevents g-ir-scanner from writing cache data to $HOME GOBJECT_INTROSPECTION_CONF_ENV = \
GI_SCANNER_DISABLE_CACHE=1
HOST_GOBJECT_INTROSPECTION_CONF_ENV = \
GI_SCANNER_DISABLE_CACHE=1

Quoted 13 lines
package/gobject-introspection/gobject-introspection.mk new file +13 -0
+# Make sure g-ir-tool-template uses the host python.
+define GOBJECT_INTROSPECTION_FIX_TOOLTEMPLATE_PYTHON_PATH
+	$(SED) '1s%#!.*%#!$(HOST_DIR)/bin/python%' $(@D)/tools/g-ir-tool-template.in
+endef
+GOBJECT_INTROSPECTION_PRE_CONFIGURE_HOOKS += GOBJECT_INTROSPECTION_FIX_TOOLTEMPLATE_PYTHON_PATH
+HOST_GOBJECT_INTROSPECTION_PRE_CONFIGURE_HOOKS += GOBJECT_INTROSPECTION_FIX_TOOLTEMPLATE_PYTHON_PATH
+
+# These wrappers allow gobject-introspection to build the internal introspection
+# libraries during the build process.
+define GOBJECT_INTROSPECTION_INSTALL_PRE_WRAPPERS
+	$(INSTALL) -D -m 755 $(GOBJECT_INTROSPECTION_PKGDIR)/g-ir-scanner-lddwrapper.in \
+		$(STAGING_DIR)/usr/bin/g-ir-scanner-lddwrapper
+	$(INSTALL) -D -m 755 $(GOBJECT_INTROSPECTION_PKGDIR)/g-ir-scanner-qemuwrapper.in \

package/gobject-introspection/gobject-introspection.mk line 79

Quoted 10 lines
package/gobject-introspection/gobject-introspection.mk new file +10 -0
+		$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
+	$(SED) "s%@QEMU_USER@%$(QEMU_USER)%g" \
+		$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
+	$(SED) "s%@TOOLCHAIN_HEADERS_VERSION@%$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)%g" \
+		$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
+	# Use a modules directory which does not exist so we don't load random things
+	# which may then get deleted (or their dependencies) and potentially segfault
+	mkdir -p $(STAGING_DIR)/usr/lib/gio/modules-dummy
+endef
+GOBJECT_INTROSPECTION_POST_PATCH_HOOKS += GOBJECT_INTROSPECTION_INSTALL_PRE_WRAPPERS

Don't mess with staging in a post-patch hook. Ideally it should be done in a
install hook, but that's difficult in this case. But still, move it to a pre-configure or pre-build hook.

Or maybe better: install them in HOST_DIR/bin during the install of
host-gobject-introspection. It means we can't use the relative paths to STAGING_DIR in those scripts any more, but we can just use the STAGING_DIR environment variable (which gets exported anyway, just like HOST_DIR). Or better yet, use the relative path $(dirname $0)/../@GNU_TARGET_NAME@/sysroot so it is fully relocatable.

package/gobject-introspection/gobject-introspection.mk line 81

Quoted 2 lines
package/gobject-introspection/gobject-introspection.mk new file +2 -0
+
+# Move the real compiler and scanner to .real, and replace them with the wrappers.

Can you add why the wrapper is needed?

package/gobject-introspection/gobject-introspection.mk line 84

Quoted 3 lines
package/gobject-introspection/gobject-introspection.mk new file +3 -0
+define GOBJECT_INTROSPECTION_INSTALL_WRAPPERS
+	# Move the real binaries to their names.real, then replace them with
+	# the wrappers.

No need to repeat that comment :-)

package/gobject-introspection/gobject-introspection.mk line 89

Quoted 5 lines
package/gobject-introspection/gobject-introspection.mk new file +5 -0
+	$(foreach w,g-ir-compiler g-ir-scanner,
+		mv $(STAGING_DIR)/usr/bin/$(w) $(STAGING_DIR)/usr/bin/$(w).real
+		$(INSTALL) -D -m 755 \
+			$(GOBJECT_INTROSPECTION_PKGDIR)/$(w).in $(STAGING_DIR)/usr/bin/$(w)
+	)

I think it's better to put these in HOST_DIR as well. It's better for packages
that use g-ir-scanner/compiler, because they can find it in $PATH (with the usual problem that there's no distinction between native and cross compilation, but we don't really expect to need any native goi stuff, right?).

package/gobject-introspection/gobject-introspection.mk line 95

Quoted 6 lines
package/gobject-introspection/gobject-introspection.mk new file +6 -0
+	$(SED) "s%toolsdir=.*%toolsdir=$(STAGING_DIR)/usr/bin%g" \
+		$(STAGING_DIR)/usr/lib/pkgconfig/gobject-introspection-1.0.pc
+endef
+GOBJECT_INTROSPECTION_POST_INSTALL_STAGING_HOOKS += GOBJECT_INTROSPECTION_INSTALL_WRAPPERS
+
+# Only .typelib files are needed to run.

Good call!

package/gobject-introspection/gobject-introspection.mk line 98

Quoted 3 lines
package/gobject-introspection/gobject-introspection.mk new file +3 -0
+define GOBJECT_INTROSPECTION_REMOVE_DEVELOPMENT_FILES
+	find $(TARGET_DIR)/usr/share/ -name '*.gir' -print0 | xargs -0 rm -f
+	find $(TARGET_DIR)/usr/share/ -name '*.rnc' -print0 | xargs -0 rm -f

I believe you can do

	find $(TARGET_DIR)/usr/share \( -name '*.gir' -o '*.rnc' \) -delete

Regards,
Arnout

Quoted 6 lines
package/gobject-introspection/gobject-introspection.mk new file +5 -0
+endef
+GOBJECT_INTROSPECTION_TARGET_FINALIZE_HOOKS += GOBJECT_INTROSPECTION_REMOVE_DEVELOPMENT_FILES
+
+$(eval $(meson-package))
+$(eval $(host-meson-package))
#18 lore raw

v14 cover gobject-introspection: New package

In reply to aduskett at gmail.com

Hi Adam,

I'm bumping udisks which has new dependency libblockdev that in order needs gobject-introspection and also libbytesize and volume_key that I'm going to send patches for. So I'm testing this patch series.

Only needed to rebase a little and update to latest gobject-introspection version(1.63.2).

I'll let you know all the results. You can follow the udisks version bumping at:
https://elinux.org/Buildroot#Important

Kind regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
Quoted 87 lines · aduskett at gmail.com

From: Adam Duskett <[email protected]>

Included in version 14 of the gobject-introspection patch series. The patch series is almost identical with V13 except for one significant change:

With permission from Arnout I have included the patch:
package/pkg-meson.mk: set Python sysconfigdata However; the patch has one big flaw I would like to discuss:

The patch breaks libglib2 if a target-python is not selected or is not yet
built and installed before building target libglib2. Indeed, it would be
because we would pass _PYTHON_SYSCONFIGDATA_NAME="" as an environment
variable, which leads to the following error during libglib2-configure:
meson.build:1978:0: ERROR: <ExternalProgram 'python3' -> ['output/host/bin/python3']> is not a valid python or it is missing setuptools

However, I do believe the patch is a better direction to go than the previous
patch: package/meson: prevent python include path manipulation for two significant reasons:

1) Meson does not have to be patched.
2) It fixes the suffix of built python applications that use meson (such as newer versions of python-gobject.) With the old patch, the suffix of the python libraries is -x86-64 even though the binaries themselves would be the target architecture, which causes import errors on the target. With this patch, the suffix is correct.

I propose keeping the patch but modifying it to work correctly if the target-python isn't selected or isn't yet built. I need help however with this as I am not great with makefile syntax this complex.

Thanks!

Adam

Adam Duskett (5):
package/libiberty: new package
package/prelink-cross: new package
package/gdb: depend on libiberty
package/pkg-meson.mk: set Python sysconfigdata
package/gobject-introspection: new package

  DEVELOPERS                                    |   3 +
  package/Config.in                             |   1 +
  package/gdb/gdb.mk                            |   4 +-
  ...lete-upstream-attempt-at-cross-compi.patch |  33 ++++
  ...d-cross-compilation-support-to-meson.patch | 163 ++++++++++++++++++
  ...d-disable-tests-when-cross-compiling.patch |  27 +++
  ...canner-add-use-binary-wrapper-option.patch |  52 ++++++
  ...scanner-add-a-use-ldd-wrapper-option.patch |  48 ++++++
  ...scanner-add-a-lib-dirs-envvar-option.patch |  73 ++++++++
  .../0007-Add-rpath-links-to-ccompiler.patch   |  29 ++++
  ...-error-return-codes-from-ldd-wrapper.patch |  28 +++
  package/gobject-introspection/Config.in       |  26 +++
  .../gobject-introspection/g-ir-compiler.in    |   2 +
  .../g-ir-scanner-lddwrapper.in                |   2 +
  .../g-ir-scanner-qemuwrapper.in               |  17 ++
  package/gobject-introspection/g-ir-scanner.in |   7 +
  .../gobject-introspection.hash                |   4 +
  .../gobject-introspection.mk                  | 103 +++++++++++
  package/libiberty/libiberty.hash              |   2 +
  package/libiberty/libiberty.mk                |  27 +++
  package/pkg-meson.mk                          |   3 +
  package/prelink-cross/prelink-cross.hash      |   3 +
  package/prelink-cross/prelink-cross.mk        |  16 ++
  23 files changed, 672 insertions(+), 1 deletion(-)

create mode 100644 package/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch create mode 100644 package/gobject-introspection/0002-add-cross-compilation-support-to-meson.patch create mode 100644 package/gobject-introspection/0003-meson.build-disable-tests-when-cross-compiling.patch create mode 100644 package/gobject-introspection/0004-giscanner-add-use-binary-wrapper-option.patch create mode 100644 package/gobject-introspection/0005-giscanner-add-a-use-ldd-wrapper-option.patch create mode 100644 package/gobject-introspection/0006-giscanner-add-a-lib-dirs-envvar-option.patch create mode 100644 package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch create mode 100644 package/gobject-introspection/0008-ignore-error-return-codes-from-ldd-wrapper.patch create mode 100644 package/gobject-introspection/Config.in
create mode 100644 package/gobject-introspection/g-ir-compiler.in
create mode 100644 package/gobject-introspection/g-ir-scanner-lddwrapper.in
create mode 100644 package/gobject-introspection/g-ir-scanner-qemuwrapper.in
create mode 100644 package/gobject-introspection/g-ir-scanner.in
create mode 100644 package/gobject-introspection/gobject-introspection.hash
create mode 100644 package/gobject-introspection/gobject-introspection.mk
create mode 100644 package/libiberty/libiberty.hash
create mode 100644 package/libiberty/libiberty.mk
create mode 100644 package/prelink-cross/prelink-cross.hash
create mode 100644 package/prelink-cross/prelink-cross.mk