X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fpython%2F004-sysconfigdata-install-location.patch;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fpython%2F004-sysconfigdata-install-location.patch;h=a72db1ae790953f5e105234419ba488a4848a9b9;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/python/004-sysconfigdata-install-location.patch b/cirros-testvm/src-cirros/buildroot-2015.05/package/python/004-sysconfigdata-install-location.patch new file mode 100644 index 0000000..a72db1a --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/python/004-sysconfigdata-install-location.patch @@ -0,0 +1,76 @@ +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.- 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.-/, 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 + +Index: b/Makefile.pre.in +=================================================================== +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -462,6 +462,9 @@ + rm -f ./pybuilddir.txt ; \ + exit 1 ; \ + fi ++ 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 +@@ -1002,7 +1005,7 @@ + else true; \ + fi; \ + done +- @for i in $(srcdir)/Lib/*.py `cat pybuilddir.txt`/_sysconfigdata.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \ ++ @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \ + do \ + if test -x $$i; then \ + $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \ +@@ -1012,6 +1015,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; \ +@@ -1337,7 +1345,7 @@ + Modules/Setup Modules/Setup.local Modules/Setup.config \ + Modules/ld_so_aix Modules/python.exp Misc/python.pc + -rm -f python*-gdb.py +- -rm -f pybuilddir.txt ++ -rm -f pybuilddir.txt pysysconfigdatadir.txt + find $(srcdir)/[a-zA-Z]* '(' -name '*.fdc' -o -name '*~' \ + -o -name '[@,#]*' -o -name '*.old' \ + -o -name '*.orig' -o -name '*.rej' \ +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -33,7 +33,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/plat-$(MACHDEP) '$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/plat-$(MACHDEP) '$interp + fi + elif test "$cross_compiling" = maybe; then + AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])