summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python-native_2.7.16.bb
diff options
context:
space:
mode:
authorArmin Kuster <akuster@mvista.com>2019-05-29 15:06:39 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-27 18:05:18 +0100
commit81439e7d18ad12b25c67812c5277c24c92c8e3b5 (patch)
tree299ce99ef6fc426473a173b167933ee37e249338 /meta/recipes-devtools/python/python-native_2.7.16.bb
parentf2961d88af7fa7345f40b1dc3b0edc926c5a2304 (diff)
downloadpoky-81439e7d18ad12b25c67812c5277c24c92c8e3b5.tar.gz
python: Update to 2.7.16
Source: Python.org MR: 98220 Type: Security Fix & Integration Disposition: Backport from python.org ChangeID: 96fdd2dee9fe9317eb72584583ae0100c0be9eaa Description: Bug fix update per Python.org https://www.python.org/downloads/release/python-2716/ drop backported patch License-update: copyright years Helps prepare Thud for 2.7 EOL support moving forward. Update includes: CVE-CVE-2019-5010 https://github.com/python/cpython/commit/06b15424b0dcacb1c551b2a36e739fffa8d0c595 (From OE-Core rev: 592e7de7f5208940fbcfcad3371f93f8ce2ca738) Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python-native_2.7.16.bb')
-rw-r--r--meta/recipes-devtools/python/python-native_2.7.16.bb89
1 files changed, 89 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-native_2.7.16.bb b/meta/recipes-devtools/python/python-native_2.7.16.bb
new file mode 100644
index 0000000000..b7442800d9
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native_2.7.16.bb
@@ -0,0 +1,89 @@
1require python.inc
2EXTRANATIVEPATH += "bzip2-native"
3DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native expat-native gdbm-native db-native"
4
5SRC_URI += "\
6 file://05-enable-ctypes-cross-build.patch \
7 file://10-distutils-fix-swig-parameter.patch \
8 file://11-distutils-never-modify-shebang-line.patch \
9 file://0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch \
10 file://debug.patch \
11 file://unixccompiler.patch \
12 file://nohostlibs.patch \
13 file://multilib.patch \
14 file://add-md5module-support.patch \
15 file://builddir.patch \
16 file://parallel-makeinst-create-bindir.patch \
17 file://revert_use_of_sysconfigdata.patch \
18 file://0001-python-native-fix-one-do_populate_sysroot-warning.patch \
19 "
20
21S = "${WORKDIR}/Python-${PV}"
22
23FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:"
24
25inherit native
26
27EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --with-system-expat=${STAGING_DIR_HOST}"
28
29EXTRA_OEMAKE = '\
30 LIBC="" \
31 STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
32 STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
33'
34
35do_configure_append() {
36 autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
37}
38
39# Regenerate all of the generated files
40# This ensures that pgen and friends get created during the compile phase
41do_compile_prepend() {
42 oe_runmake regen-all
43}
44
45do_install() {
46 oe_runmake 'DESTDIR=${D}' install
47 install -d ${D}${bindir}/${PN}
48 install -m 0755 Parser/pgen ${D}${bindir}/${PN}
49
50 # Make sure we use /usr/bin/env python
51 for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
52 sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
53 done
54
55 # Add a symlink to the native Python so that scripts can just invoke
56 # "nativepython" and get the right one without needing absolute paths
57 # (these often end up too long for the #! parser in the kernel as the
58 # buffer is 128 bytes long).
59 ln -s python-native/python ${D}${bindir}/nativepython
60
61 # We don't want modules in ~/.local being used in preference to those
62 # installed in the native sysroot, so disable user site support.
63 sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
64}
65
66python(){
67
68 # Read JSON manifest
69 import json
70 pythondir = d.getVar('THISDIR')
71 with open(pythondir+'/python/python2-manifest.json') as manifest_file:
72 manifest_str = manifest_file.read()
73 json_start = manifest_str.find('# EOC') + 6
74 manifest_file.seek(json_start)
75 manifest_str = manifest_file.read()
76 python_manifest = json.loads(manifest_str)
77
78 rprovides = d.getVar('RPROVIDES').split()
79
80 # Hardcoded since it cant be python-native-foo, should be python-foo-native
81 pn = 'python'
82
83 for key in python_manifest:
84 pypackage = pn + '-' + key + '-native'
85 if pypackage not in rprovides:
86 rprovides.append(pypackage)
87
88 d.setVar('RPROVIDES', ' '.join(rprovides))
89}