diff options
| author | Alejandro Hernandez <alejandro.hernandez@linux.intel.com> | 2015-02-11 17:57:49 -0600 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-23 17:35:29 +0000 |
| commit | cb02ecb507ddad3cb17c78020b42c004aa2903ae (patch) | |
| tree | 0f30353b3c8a3aaf6294f8db9c8fb7cff5575ab9 /meta/recipes-devtools/python/python_2.7.9.bb | |
| parent | 122ee11bd1817f776336e54898cb36162fe527df (diff) | |
| download | poky-cb02ecb507ddad3cb17c78020b42c004aa2903ae.tar.gz | |
Python: Upgrade from 2.7.3 to 2.7.9:
- Based on Paul Eggletons work to partially upgrade to Python 2.7.6
Modified:
default-versions.inc: switched to python 2.7.9
generate-manifest-2.7.py: fixed _sysconfigdata
python-2.7-manifest.inc: fixed _sysconfigdata
python.inc: Updated checksums and source, no LICENSE
change just updated some dates
python-native_2.7.3 -> python-native_2.7.9 and updated patches
python_2.7.3 -> python_2.7.9, and added ac_cv_file__dev_ptmx=no
ac_cv_file__dev_ptc=no in EXTRA_OECONF to solve python
issue #3754, only needed when cross compiling, also updated patches
use_sysroot_ncurses_instead_of_host.patch: New patch to use ncursesw
from sysroot instead of hosts, introduced by fix for python issue #15268
Rebased:
01-use-proper-tools-for-cross-build.patch
03-fix-tkinter-detection.patch
05-enable-ctypes-cross-build.patch
06-avoid_usr_lib_termcap_path_in_linking.patch
avoid_warning_about_tkinter.patch
builddir.patch
fix_for_using_different_libdir.patch
host_include_contamination.patch
multilib.patch
nohostlibs.patch
search_db_h_in_inc_dirs_and_avoid_warning.patch
Deleted (fixed on upstream):
06-ctypes-libffi-fix-configure.patch
CVE-2013-4073_py27.patch
gcc-4.8-fix-configure-Wformat.patch
json-flaw-fix.patch
posix_close.patch
pypirc-secure.patch
python-2.7.3-CVE-2012-2135.patch
python-2.7.3-CVE-2013-1752-smtplib-fix.patch
python-2.7.3-CVE-2014-1912.patch
python-2.7.3-CVE-2014-7185.patch
python-2.7.3-berkeley-db-5.3.patch
python-fix-build-error-with-Readline-6.3.patch
remove-BOM-insection-code.patch
remove_sqlite_rpath.patch
python2.7.3-nossl3.patch
[YOCTO #7059]
(From OE-Core rev: d4ad95f0d5f08891637c644e85b09da9c4585059)
Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python_2.7.9.bb')
| -rw-r--r-- | meta/recipes-devtools/python/python_2.7.9.bb | 178 |
1 files changed, 178 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python_2.7.9.bb b/meta/recipes-devtools/python/python_2.7.9.bb new file mode 100644 index 0000000000..048ec3903a --- /dev/null +++ b/meta/recipes-devtools/python/python_2.7.9.bb | |||
| @@ -0,0 +1,178 @@ | |||
| 1 | require python.inc | ||
| 2 | DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" | ||
| 3 | PR = "${INC_PR}" | ||
| 4 | |||
| 5 | DISTRO_SRC_URI ?= "file://sitecustomize.py" | ||
| 6 | DISTRO_SRC_URI_linuxstdbase = "" | ||
| 7 | SRC_URI += "\ | ||
| 8 | file://01-use-proper-tools-for-cross-build.patch \ | ||
| 9 | file://03-fix-tkinter-detection.patch \ | ||
| 10 | file://06-avoid_usr_lib_termcap_path_in_linking.patch \ | ||
| 11 | ${DISTRO_SRC_URI} \ | ||
| 12 | file://multilib.patch \ | ||
| 13 | file://cgi_py.patch \ | ||
| 14 | file://setup_py_skip_cross_import_check.patch \ | ||
| 15 | file://add-md5module-support.patch \ | ||
| 16 | file://host_include_contamination.patch \ | ||
| 17 | file://fix_for_using_different_libdir.patch \ | ||
| 18 | file://setuptweaks.patch \ | ||
| 19 | file://check-if-target-is-64b-not-host.patch \ | ||
| 20 | file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ | ||
| 21 | file://avoid_warning_about_tkinter.patch \ | ||
| 22 | file://avoid_warning_for_sunos_specific_module.patch \ | ||
| 23 | file://python-2.7.3-remove-bsdb-rpath.patch \ | ||
| 24 | file://fix-makefile-for-ptest.patch \ | ||
| 25 | file://run-ptest \ | ||
| 26 | file://parallel-makeinst-create-bindir.patch \ | ||
| 27 | file://use_sysroot_ncurses_instead_of_host.patch \ | ||
| 28 | " | ||
| 29 | |||
| 30 | S = "${WORKDIR}/Python-${PV}" | ||
| 31 | |||
| 32 | inherit autotools multilib_header python-dir pythonnative | ||
| 33 | |||
| 34 | # The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources | ||
| 35 | #Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :( | ||
| 36 | TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__" | ||
| 37 | TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__" | ||
| 38 | |||
| 39 | # The following is a hack until we drop ac_cv_sizeof_off_t from site files | ||
| 40 | EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'ac_cv_sizeof_off_t=8', '', d)} ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no" | ||
| 41 | |||
| 42 | do_configure_prepend() { | ||
| 43 | rm -f ${S}/Makefile.orig | ||
| 44 | autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" | ||
| 45 | } | ||
| 46 | |||
| 47 | do_compile() { | ||
| 48 | # regenerate platform specific files, because they depend on system headers | ||
| 49 | cd ${S}/Lib/plat-linux2 | ||
| 50 | include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
| 51 | ${S}/Tools/scripts/h2py.py -i '(u_long)' \ | ||
| 52 | ${STAGING_INCDIR}/dlfcn.h \ | ||
| 53 | ${STAGING_INCDIR}/linux/cdrom.h \ | ||
| 54 | ${STAGING_INCDIR}/netinet/in.h \ | ||
| 55 | ${STAGING_INCDIR}/sys/types.h | ||
| 56 | sed -e 's,${STAGING_DIR_HOST},,g' -i *.py | ||
| 57 | cd - | ||
| 58 | |||
| 59 | # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144 | ||
| 60 | sed -i -e s,ccache\ ,'$(CCACHE) ', Makefile | ||
| 61 | |||
| 62 | # remove any bogus LD_LIBRARY_PATH | ||
| 63 | sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile | ||
| 64 | |||
| 65 | if [ ! -f Makefile.orig ]; then | ||
| 66 | install -m 0644 Makefile Makefile.orig | ||
| 67 | fi | ||
| 68 | sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \ | ||
| 69 | -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \ | ||
| 70 | -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \ | ||
| 71 | -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \ | ||
| 72 | -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \ | ||
| 73 | -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \ | ||
| 74 | -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \ | ||
| 75 | Makefile | ||
| 76 | # save copy of it now, because if we do it in do_install and | ||
| 77 | # then call do_install twice we get Makefile.orig == Makefile.sysroot | ||
| 78 | install -m 0644 Makefile Makefile.sysroot | ||
| 79 | |||
| 80 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
| 81 | export PYTHONBUILDDIR="${B}" | ||
| 82 | |||
| 83 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
| 84 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
| 85 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
| 86 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
| 87 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
| 88 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
| 89 | OPT="${CFLAGS}" | ||
| 90 | } | ||
| 91 | |||
| 92 | do_install() { | ||
| 93 | # make install needs the original Makefile, or otherwise the inclues would | ||
| 94 | # go to ${D}${STAGING...}/... | ||
| 95 | install -m 0644 Makefile.orig Makefile | ||
| 96 | |||
| 97 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
| 98 | export PYTHONBUILDDIR="${B}" | ||
| 99 | |||
| 100 | # After swizzling the makefile, we need to run the build again. | ||
| 101 | # install can race with the build so we have to run this first, then install | ||
| 102 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
| 103 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
| 104 | CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ | ||
| 105 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
| 106 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
| 107 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
| 108 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
| 109 | DESTDIR=${D} LIBDIR=${libdir} | ||
| 110 | |||
| 111 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
| 112 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
| 113 | CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ | ||
| 114 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
| 115 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
| 116 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
| 117 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
| 118 | DESTDIR=${D} LIBDIR=${libdir} install | ||
| 119 | |||
| 120 | install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
| 121 | |||
| 122 | if [ -e ${WORKDIR}/sitecustomize.py ]; then | ||
| 123 | install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} | ||
| 124 | fi | ||
| 125 | |||
| 126 | oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h | ||
| 127 | } | ||
| 128 | |||
| 129 | do_install_append_class-nativesdk () { | ||
| 130 | create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' | ||
| 131 | } | ||
| 132 | |||
| 133 | SSTATE_SCAN_FILES += "Makefile" | ||
| 134 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" | ||
| 135 | |||
| 136 | py_package_preprocess () { | ||
| 137 | # copy back the old Makefile to fix target package | ||
| 138 | install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
| 139 | |||
| 140 | # Remove references to buildmachine paths in target Makefile | ||
| 141 | sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
| 142 | } | ||
| 143 | |||
| 144 | require python-${PYTHON_MAJMIN}-manifest.inc | ||
| 145 | |||
| 146 | # manual dependency additions | ||
| 147 | RPROVIDES_${PN}-core = "${PN}" | ||
| 148 | RRECOMMENDS_${PN}-core = "${PN}-readline" | ||
| 149 | RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules" | ||
| 150 | RRECOMMENDS_${PN}-crypt = "openssl" | ||
| 151 | |||
| 152 | # package libpython2 | ||
| 153 | PACKAGES =+ "lib${BPN}2" | ||
| 154 | FILES_lib${BPN}2 = "${libdir}/libpython*.so.*" | ||
| 155 | |||
| 156 | # catch debug extensions (isn't that already in python-core-dbg?) | ||
| 157 | FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug" | ||
| 158 | |||
| 159 | # catch all the rest (unsorted) | ||
| 160 | PACKAGES += "${PN}-misc" | ||
| 161 | FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" | ||
| 162 | RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-misc" | ||
| 163 | #inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten | ||
| 164 | inherit ptest | ||
| 165 | |||
| 166 | # This must come after inherit ptest for the override to take effect | ||
| 167 | do_install_ptest() { | ||
| 168 | cp ${B}/Makefile ${D}${PTEST_PATH} | ||
| 169 | sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \ | ||
| 170 | -e s:LIBDIR:${libdir}:g \ | ||
| 171 | -i ${D}${PTEST_PATH}/run-ptest | ||
| 172 | } | ||
| 173 | |||
| 174 | # catch manpage | ||
| 175 | PACKAGES += "${PN}-man" | ||
| 176 | FILES_${PN}-man = "${datadir}/man" | ||
| 177 | |||
| 178 | BBCLASSEXTEND = "nativesdk" | ||
