summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python-native_2.7.17.bb
diff options
context:
space:
mode:
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.bb90
1 files changed, 0 insertions, 90 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
deleted file mode 100644
index 72aa34c234..0000000000
--- a/meta/recipes-devtools/python/python-native_2.7.17.bb
+++ /dev/null
@@ -1,90 +0,0 @@
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# Cross-compiling Python needs a native pgen, build it here for use later.
39do_compile_append() {
40 oe_runmake Parser/pgen
41}
42
43do_install() {
44 oe_runmake 'DESTDIR=${D}' install
45 install -d ${D}${bindir}/${PN}
46 install -m 0755 Parser/pgen ${D}${bindir}/${PN}
47
48 # Make sure we use /usr/bin/env python
49 for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
50 sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
51 done
52
53 # Add a symlink to the native Python so that scripts can just invoke
54 # "nativepython" and get the right one without needing absolute paths
55 # (these often end up too long for the #! parser in the kernel as the
56 # buffer is 128 bytes long).
57 ln -s python-native/python ${D}${bindir}/nativepython
58
59 # We don't want modules in ~/.local being used in preference to those
60 # installed in the native sysroot, so disable user site support.
61 sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
62}
63
64python(){
65
66 # Read JSON manifest
67 import json
68 pythondir = d.getVar('THISDIR')
69 with open(pythondir+'/python/python2-manifest.json') as manifest_file:
70 manifest_str = manifest_file.read()
71 json_start = manifest_str.find('# EOC') + 6
72 manifest_file.seek(json_start)
73 manifest_str = manifest_file.read()
74 python_manifest = json.loads(manifest_str)
75
76 rprovides = d.getVar('RPROVIDES').split()
77
78 # Hardcoded since it cant be python-native-foo, should be python-foo-native
79 pn = 'python'
80
81 # ${PN}-misc-native is not in the manifest
82 rprovides.append(pn + '-misc-native')
83
84 for key in python_manifest:
85 pypackage = pn + '-' + key + '-native'
86 if pypackage not in rprovides:
87 rprovides.append(pypackage)
88
89 d.setVar('RPROVIDES', ' '.join(rprovides))
90}