diff options
author | Alejandro Hernandez <alejandro.hernandez@linux.intel.com> | 2017-01-24 00:55:06 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-01 23:27:06 +0000 |
commit | 30b2044de65665470a95e33e934816c0caa91325 (patch) | |
tree | ce7fdf9bda1aeb07dd362411152b23dc36375e40 /meta/recipes-devtools/python/python_2.7.13.bb | |
parent | 1bd3e545bd14428e0695bafd80fe350a57463363 (diff) | |
download | poky-30b2044de65665470a95e33e934816c0caa91325.tar.gz |
python: Upgrade both python and python-native to 2.7.13
Rebased:
- python-native/multilib.patch
- python/multilib.patch
- python/01-use-proper-tools-for-cross-build.patch
Upstream:
- CVE-2016-1000110
(From OE-Core rev: 2eaadc5464e3340359b626026d80afb6bc01d3f1)
Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python_2.7.13.bb')
-rw-r--r-- | meta/recipes-devtools/python/python_2.7.13.bb | 171 |
1 files changed, 171 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python_2.7.13.bb b/meta/recipes-devtools/python/python_2.7.13.bb new file mode 100644 index 0000000000..4ef99523e0 --- /dev/null +++ b/meta/recipes-devtools/python/python_2.7.13.bb | |||
@@ -0,0 +1,171 @@ | |||
1 | require python.inc | ||
2 | DEPENDS = "python-native libffi 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 | file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \ | ||
29 | file://Don-t-use-getentropy-on-Linux.patch \ | ||
30 | " | ||
31 | |||
32 | S = "${WORKDIR}/Python-${PV}" | ||
33 | |||
34 | inherit autotools multilib_header python-dir pythonnative | ||
35 | |||
36 | CONFIGUREOPTS += " --with-system-ffi " | ||
37 | |||
38 | EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no" | ||
39 | |||
40 | do_configure_append() { | ||
41 | rm -f ${S}/Makefile.orig | ||
42 | autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi | ||
43 | } | ||
44 | |||
45 | do_compile() { | ||
46 | # regenerate platform specific files, because they depend on system headers | ||
47 | cd ${S}/Lib/plat-linux2 | ||
48 | include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
49 | ${S}/Tools/scripts/h2py.py -i '(u_long)' \ | ||
50 | ${STAGING_INCDIR}/dlfcn.h \ | ||
51 | ${STAGING_INCDIR}/linux/cdrom.h \ | ||
52 | ${STAGING_INCDIR}/netinet/in.h \ | ||
53 | ${STAGING_INCDIR}/sys/types.h | ||
54 | sed -e 's,${STAGING_DIR_HOST},,g' -i *.py | ||
55 | cd - | ||
56 | |||
57 | # remove any bogus LD_LIBRARY_PATH | ||
58 | sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile | ||
59 | |||
60 | if [ ! -f Makefile.orig ]; then | ||
61 | install -m 0644 Makefile Makefile.orig | ||
62 | fi | ||
63 | sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \ | ||
64 | -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \ | ||
65 | -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \ | ||
66 | -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \ | ||
67 | -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \ | ||
68 | -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \ | ||
69 | -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \ | ||
70 | Makefile | ||
71 | # save copy of it now, because if we do it in do_install and | ||
72 | # then call do_install twice we get Makefile.orig == Makefile.sysroot | ||
73 | install -m 0644 Makefile Makefile.sysroot | ||
74 | |||
75 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
76 | export PYTHONBUILDDIR="${B}" | ||
77 | |||
78 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
79 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
80 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
81 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
82 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
83 | OPT="${CFLAGS}" | ||
84 | } | ||
85 | |||
86 | do_install() { | ||
87 | # make install needs the original Makefile, or otherwise the inclues would | ||
88 | # go to ${D}${STAGING...}/... | ||
89 | install -m 0644 Makefile.orig Makefile | ||
90 | |||
91 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
92 | export PYTHONBUILDDIR="${B}" | ||
93 | |||
94 | # After swizzling the makefile, we need to run the build again. | ||
95 | # install can race with the build so we have to run this first, then install | ||
96 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
97 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
98 | CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ | ||
99 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
100 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
101 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
102 | DESTDIR=${D} LIBDIR=${libdir} | ||
103 | |||
104 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
105 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
106 | CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ | ||
107 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
108 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
109 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
110 | DESTDIR=${D} LIBDIR=${libdir} install | ||
111 | |||
112 | install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
113 | |||
114 | if [ -e ${WORKDIR}/sitecustomize.py ]; then | ||
115 | install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} | ||
116 | fi | ||
117 | |||
118 | oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h | ||
119 | } | ||
120 | |||
121 | do_install_append_class-nativesdk () { | ||
122 | create_wrapper ${D}${bindir}/python2.7 PYTHONHOME='${prefix}' TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' | ||
123 | } | ||
124 | |||
125 | SSTATE_SCAN_FILES += "Makefile" | ||
126 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" | ||
127 | |||
128 | py_package_preprocess () { | ||
129 | # copy back the old Makefile to fix target package | ||
130 | install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
131 | |||
132 | # Remove references to buildmachine paths in target Makefile and _sysconfigdata | ||
133 | sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \ | ||
134 | ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \ | ||
135 | ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py | ||
136 | python -m py_compile ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py | ||
137 | } | ||
138 | |||
139 | require python-${PYTHON_MAJMIN}-manifest.inc | ||
140 | |||
141 | # manual dependency additions | ||
142 | RPROVIDES_${PN}-core = "${PN}" | ||
143 | RRECOMMENDS_${PN}-core = "${PN}-readline" | ||
144 | RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules" | ||
145 | RRECOMMENDS_${PN}-crypt = "openssl" | ||
146 | |||
147 | # package libpython2 | ||
148 | PACKAGES =+ "lib${BPN}2" | ||
149 | FILES_lib${BPN}2 = "${libdir}/libpython*.so.*" | ||
150 | |||
151 | # catch all the rest (unsorted) | ||
152 | PACKAGES += "${PN}-misc" | ||
153 | FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" | ||
154 | RDEPENDS_${PN}-modules += "${PN}-misc" | ||
155 | RDEPENDS_${PN}-ptest = "${PN}-modules" | ||
156 | #inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten | ||
157 | inherit ptest | ||
158 | |||
159 | # This must come after inherit ptest for the override to take effect | ||
160 | do_install_ptest() { | ||
161 | cp ${B}/Makefile ${D}${PTEST_PATH} | ||
162 | sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \ | ||
163 | -e s:LIBDIR:${libdir}:g \ | ||
164 | -i ${D}${PTEST_PATH}/run-ptest | ||
165 | } | ||
166 | |||
167 | # catch manpage | ||
168 | PACKAGES += "${PN}-man" | ||
169 | FILES_${PN}-man = "${datadir}/man" | ||
170 | |||
171 | BBCLASSEXTEND = "nativesdk" | ||