buildrootschalter/package/python3/python3-003-sysconfigdata-install-location.patch
Thomas Petazzoni 0d327c267a python3: bump to 3.4.0rc1
This commit bumps the Python3 package to use Python 3.4.0rc1.

About the patches:

 * The patches below 100 are significantly changed, because like for
   Python 2.x, a good number of improvements have been made in the
   upstream Python for cross-compilation. Therefore, almost all of
   these patches have been modified.

 * All the patches above 100 are simply updated for Python 3.4.0, with
   a small refactoring for the handling of test modules.

The details of the python3.mk changes are:

 * --without-ensurepip to tell Python to not use PIP at build time.

 * Many environment variables are no longer passed, they were specific
   to our cross-compilation patches

 * The fixup of the LIBDIR in the Python Makefile is no longer needed
   since Python has switched to _sysconfigdata.py for distutils
   configuration instead of parsing the Makefile.

 * A new post patch hooks touches the two files generated by pgen to
   make sure they are newer than the pgen sources, which ensures pgen
   is not built/executed.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-18 23:22:18 +01:00

77 lines
3.2 KiB
Diff

Change the install location of _sysconfigdata.py
The _sysconfigdata.py module contains definitions that are needed when
building Python modules. In cross-compilation mode, when building
Python extensions for the target, we need to use the _sysconfigdata.py
of the target Python while executing the host Python.
However until now, the _sysconfigdata.py module was installed in
build/lib.<arch>-<version> directory, together with a number of
architecture-specific shared objects, which cannot be used with the
host Python.
To solve this problem, this patch moves _sysconfigdata.py to a
separate location, build/sysconfigdata.<arch>-<version>/, and only
this directory gets added to the PYTHONPATH of the host Python
interpreter when building Python modules for the target.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/Makefile.pre.in
===================================================================
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -543,6 +543,9 @@
# sys.path fixup -- see Modules/getpath.c.
pybuilddir.txt: $(BUILDPYTHON)
$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars
+ echo `cat pybuilddir.txt`/sysconfigdata > pysysconfigdatadir.txt
+ mkdir -p `cat pysysconfigdatadir.txt`
+ cp `cat pybuilddir.txt`/_sysconfigdata.py `cat pysysconfigdatadir.txt`
# Build the shared modules
# Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
@@ -1181,7 +1184,7 @@
else true; \
fi; \
done
- @for i in $(srcdir)/Lib/*.py `cat pybuilddir.txt`/_sysconfigdata.py; \
+ @for i in $(srcdir)/Lib/*.py ; \
do \
if test -x $$i; then \
$(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
@@ -1191,6 +1194,11 @@
echo $(INSTALL_DATA) $$i $(LIBDEST); \
fi; \
done
+ $(INSTALL_DATA) `cat pysysconfigdatadir.txt`/_sysconfigdata.py \
+ $(DESTDIR)$(LIBDEST)
+ mkdir -p $(DESTDIR)$(LIBDEST)/sysconfigdata
+ $(INSTALL_DATA) `cat pysysconfigdatadir.txt`/_sysconfigdata.py \
+ $(DESTDIR)$(LIBDEST)/sysconfigdata
@for d in $(LIBSUBDIRS); \
do \
a=$(srcdir)/Lib/$$d; \
@@ -1513,7 +1521,7 @@
find build -name 'fficonfig.h' -exec rm -f {} ';' || true
find build -name '*.py' -exec rm -f {} ';' || true
find build -name '*.py[co]' -exec rm -f {} ';' || true
- -rm -f pybuilddir.txt
+ -rm -f pybuilddir.txt pysysconfigdatadir.txt
-rm -f Lib/lib2to3/*Grammar*.pickle
-rm -f Modules/_testembed Modules/_freeze_importlib
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -67,7 +67,7 @@
AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
fi
AC_MSG_RESULT($interp)
- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pysysconfigdatadir.txt && echo $(abs_builddir)/`cat pysysconfigdatadir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
fi
elif test "$cross_compiling" = maybe; then
AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])