summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python_2.7.3.bb
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-11-14 14:31:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-11-18 16:42:07 +0000
commit89bc43e1b2dcf0d15004b0eb65ea75c6adbfcf8e (patch)
tree84ec9eb39b1bfba19d02acc2f9a26bee72c3c767 /meta/recipes-devtools/python/python_2.7.3.bb
parentdadb3a7fa70a016fd4bf2b059d37a5e0f759eef1 (diff)
downloadpoky-89bc43e1b2dcf0d15004b0eb65ea75c6adbfcf8e.tar.gz
python: Resolve intermediate staging issues
Its bad practise to poke into the sysroot without knowledge of sstate. This adds a patch to python allowing us to account for cross compiling and allow it to find the Makefile/pyconfig.h files without needing them in the sysroot for do_compile/do_install to complete. Tested on two architectures and compared with buildhistory with no significant delta. (From OE-Core rev: 16da4f75a75dc8020803df9ea73a2a7ead88cc5a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python_2.7.3.bb')
-rw-r--r--meta/recipes-devtools/python/python_2.7.3.bb25
1 files changed, 3 insertions, 22 deletions
diff --git a/meta/recipes-devtools/python/python_2.7.3.bb b/meta/recipes-devtools/python/python_2.7.3.bb
index 3a17c85bb8..f0d5c90d30 100644
--- a/meta/recipes-devtools/python/python_2.7.3.bb
+++ b/meta/recipes-devtools/python/python_2.7.3.bb
@@ -27,6 +27,7 @@ SRC_URI += "\
27 file://avoid_warning_for_sunos_specific_module.patch \ 27 file://avoid_warning_for_sunos_specific_module.patch \
28 file://python-2.7.3-berkeley-db-5.3.patch \ 28 file://python-2.7.3-berkeley-db-5.3.patch \
29 file://python-2.7.3-remove-bsdb-rpath.patch \ 29 file://python-2.7.3-remove-bsdb-rpath.patch \
30 file://builddir.patch \
30" 31"
31 32
32S = "${WORKDIR}/Python-${PV}" 33S = "${WORKDIR}/Python-${PV}"
@@ -55,17 +56,6 @@ do_compile() {
55 sed -e 's,${STAGING_DIR_HOST},,g' -i *.py 56 sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
56 cd - 57 cd -
57 58
58 #
59 # Copy config.h and an appropriate Makefile for distutils.sysconfig,
60 # which laters uses the information out of these to compile extensions
61 #
62 # The following part (until python compilation) should probably moved to an
63 # -initial recipe to handle staging better
64 #
65 install -d ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
66 install -d ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
67 install -m 0644 pyconfig.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
68
69 # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144 59 # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
70 sed -i -e s,ccache,'$(CCACHE)', Makefile 60 sed -i -e s,ccache,'$(CCACHE)', Makefile
71 61
@@ -83,22 +73,12 @@ do_compile() {
83 -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \ 73 -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
84 -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \ 74 -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
85 Makefile 75 Makefile
86 install -m 0644 Makefile ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
87 # save copy of it now, because if we do it in do_install and 76 # save copy of it now, because if we do it in do_install and
88 # then call do_install twice we get Makefile.orig == Makefile.sysroot 77 # then call do_install twice we get Makefile.orig == Makefile.sysroot
89 install -m 0644 Makefile Makefile.sysroot 78 install -m 0644 Makefile Makefile.sysroot
90 79
91 export CROSS_COMPILE="${TARGET_PREFIX}" 80 export CROSS_COMPILE="${TARGET_PREFIX}"
92 81 export PYTHONBUILDDIR="${S}"
93 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
94 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
95 STAGING_LIBDIR=${STAGING_LIBDIR} \
96 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
97 STAGING_INCDIR=${STAGING_INCDIR} \
98 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
99 OPT="${CFLAGS}" libpython${PYTHON_MAJMIN}.so
100
101 oe_libinstall -so libpython${PYTHON_MAJMIN} ${STAGING_LIBDIR}
102 82
103 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ 83 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
104 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ 84 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
@@ -115,6 +95,7 @@ do_install() {
115 install -m 0644 Makefile.orig Makefile 95 install -m 0644 Makefile.orig Makefile
116 96
117 export CROSS_COMPILE="${TARGET_PREFIX}" 97 export CROSS_COMPILE="${TARGET_PREFIX}"
98 export PYTHONBUILDDIR="${S}"
118 99
119 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ 100 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
120 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ 101 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \