summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python-native_2.7.17.bb
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2019-11-18 15:28:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-21 23:08:19 +0000
commitf681fd3b2fd69b6ecf71c317bc4a8e8786c0a38f (patch)
tree006e8d9d1fe955de723c09bc398da2c11d5984d9 /meta/recipes-devtools/python/python-native_2.7.17.bb
parentd05b78b245e9a1b2743d3f649378dc3e3565b12d (diff)
downloadpoky-f681fd3b2fd69b6ecf71c317bc4a8e8786c0a38f.tar.gz
python: update to 2.7.17
Drop backports, rebase a couple of patches. This is the second last release of py 2.x; upstream support ends on 1 January 2020, there will be one final 2.x afterwards. Note that the only thing that still needs python 2.x in oe-core is u-boot; when the next u-boot update arrives, we should find out where the py3 migration is for that component before merging the update. (From OE-Core rev: 184b60eb905bb75ecc7a0c29a175e624d8555fac) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python-native_2.7.17.bb')
-rw-r--r--meta/recipes-devtools/python/python-native_2.7.17.bb88
1 files changed, 88 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-native_2.7.17.bb b/meta/recipes-devtools/python/python-native_2.7.17.bb
new file mode 100644
index 0000000000..936810d980
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native_2.7.17.bb
@@ -0,0 +1,88 @@
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://unixccompiler.patch \
11 file://nohostlibs.patch \
12 file://multilib.patch \
13 file://add-md5module-support.patch \
14 file://0001-python-Resolve-intermediate-staging-issues.patch \
15 file://parallel-makeinst-create-bindir.patch \
16 file://revert_use_of_sysconfigdata.patch \
17 file://0001-python-native-fix-one-do_populate_sysroot-warning.patch \
18 "
19
20S = "${WORKDIR}/Python-${PV}"
21
22FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:"
23
24inherit native
25
26EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --with-system-expat=${STAGING_DIR_HOST}"
27
28EXTRA_OEMAKE = '\
29 LIBC="" \
30 STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
31 STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
32'
33
34do_configure_append() {
35 autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
36}
37
38# Regenerate all of the generated files
39# This ensures that pgen and friends get created during the compile phase
40do_compile_prepend() {
41 oe_runmake regen-all
42}
43
44do_install() {
45 oe_runmake 'DESTDIR=${D}' install
46 install -d ${D}${bindir}/${PN}
47 install -m 0755 Parser/pgen ${D}${bindir}/${PN}
48
49 # Make sure we use /usr/bin/env python
50 for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
51 sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
52 done
53
54 # Add a symlink to the native Python so that scripts can just invoke
55 # "nativepython" and get the right one without needing absolute paths
56 # (these often end up too long for the #! parser in the kernel as the
57 # buffer is 128 bytes long).
58 ln -s python-native/python ${D}${bindir}/nativepython
59
60 # We don't want modules in ~/.local being used in preference to those
61 # installed in the native sysroot, so disable user site support.
62 sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
63}
64
65python(){
66
67 # Read JSON manifest
68 import json
69 pythondir = d.getVar('THISDIR')
70 with open(pythondir+'/python/python2-manifest.json') as manifest_file:
71 manifest_str = manifest_file.read()
72 json_start = manifest_str.find('# EOC') + 6
73 manifest_file.seek(json_start)
74 manifest_str = manifest_file.read()
75 python_manifest = json.loads(manifest_str)
76
77 rprovides = d.getVar('RPROVIDES').split()
78
79 # Hardcoded since it cant be python-native-foo, should be python-foo-native
80 pn = 'python'
81
82 for key in python_manifest:
83 pypackage = pn + '-' + key + '-native'
84 if pypackage not in rprovides:
85 rprovides.append(pypackage)
86
87 d.setVar('RPROVIDES', ' '.join(rprovides))
88}