kumquat-buildroot/package/python3/python3-004-no-import-when-cross-compiling.patch
Maxime Ripard f1c092da8b python3: Port python2 patches to reduce the interpreter size
Some of the python2 patches were left behind when doing the python3
package. This was because the python build system can now autodetect
what packages can be built in the system.

However, some of these patches are actually useful to reduce drastically
the size of the interpreter.

This patch ports the relevant patches to the python3 package, and adds a
new patch to remove the idle3 IDE as well from the interpreter.

Fixes #5696

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-06-28 22:02:44 +02:00

28 lines
1.0 KiB
Diff

Disable import check when cross-compiling
Once Python has compiled an extension (i.e some C code, potentially
linked to a library), it tries to import it. This cannot work in
cross-compilation mode, so we just disable this check.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
setup.py | 4 ++++
1 file changed, 4 insertions(+)
Index: Python-3.3.0/setup.py
===================================================================
--- Python-3.3.0.orig/setup.py
+++ Python-3.3.0/setup.py
@@ -318,6 +318,10 @@
self.announce('WARNING: skipping import check for Cygwin-based "%s"'
% ext.name)
return
+ if os.environ.get('CROSS_COMPILING') == 'yes':
+ self.announce('WARNING: skipping import check for cross compiled "%s"'
+ % ext.name)
+ return
ext_filename = os.path.join(
self.build_lib,
self.get_ext_filename(self.get_ext_fullname(ext.name)))