From: aduskett at gmail.com <aduskett@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v14 4/5] package/pkg-meson.mk: set Python sysconfigdata
Date: Mon, 21 Oct 2019 13:04:37 -0700 [thread overview]
Message-ID: <20191021200438.97453-5-aduskett@gmail.com> (raw)
In-Reply-To: <20191021200438.97453-1-aduskett@gmail.com>
From: Adam Duskett <Aduskett@gmail.com>
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.
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
Changes v1 -> v14:
- Add this patch to the series.
package/pkg-meson.mk | 3 +++
1 file changed, 3 insertions(+)
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 184a22a44a..b6360fb738 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -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 \
--
2.21.0
next prev parent reply other threads:[~2019-10-21 20:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 20:04 [Buildroot] [PATCH v14 0/5] gobject-introspection: New package aduskett at gmail.com
2019-10-21 20:04 ` [Buildroot] [PATCH v14 1/5] package/libiberty: new package aduskett at gmail.com
2020-01-16 10:33 ` Yegor Yefremov
2019-10-21 20:04 ` [Buildroot] [PATCH v14 2/5] package/prelink-cross: " aduskett at gmail.com
2019-10-21 20:04 ` [Buildroot] [PATCH v14 3/5] package/gdb: depend on libiberty aduskett at gmail.com
2019-10-21 20:04 ` aduskett at gmail.com [this message]
2019-10-22 20:59 ` [Buildroot] [PATCH v14 4/5] package/pkg-meson.mk: set Python sysconfigdata Thomas Petazzoni
2019-10-22 21:58 ` Arnout Vandecappelle
2019-10-22 22:19 ` Arnout Vandecappelle
2019-10-23 19:48 ` Adam Duskett
2019-10-23 20:42 ` Adam Duskett
2019-10-23 20:50 ` Thomas Petazzoni
2019-10-23 21:03 ` Arnout Vandecappelle
2019-10-23 21:27 ` Arnout Vandecappelle
2019-10-24 16:22 ` Adam Duskett
2020-01-27 16:55 ` Giulio Benetti
2019-10-21 20:04 ` [Buildroot] [PATCH v14 5/5] package/gobject-introspection: new package aduskett at gmail.com
2020-02-04 10:53 ` Arnout Vandecappelle
2020-01-26 20:42 ` [Buildroot] [PATCH v14 0/5] gobject-introspection: New package Giulio Benetti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191021200438.97453-5-aduskett@gmail.com \
--to=aduskett@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox