diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2019-04-15 12:54:54 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-04-16 11:10:02 +0100 |
commit | 0ee1b6d0c934944c0b6dba69e4c16d8e848b85bd (patch) | |
tree | 6d952de325df29a087789c74fc8bb4abadc69249 /meta/recipes-devtools/python/python_2.7.15.bb | |
parent | 24597588d29388ab4fc9485fcf27f8b580a4f5e8 (diff) | |
download | poky-0ee1b6d0c934944c0b6dba69e4c16d8e848b85bd.tar.gz |
python: update to 2.7.16
Drop backported patches
License-update: copyright years
(From OE-Core rev: 061dfcdf062d64e4e1e50e28edfacb14e41b7d74)
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_2.7.15.bb')
-rw-r--r-- | meta/recipes-devtools/python/python_2.7.15.bb | 271 |
1 files changed, 0 insertions, 271 deletions
diff --git a/meta/recipes-devtools/python/python_2.7.15.bb b/meta/recipes-devtools/python/python_2.7.15.bb deleted file mode 100644 index 62051a227b..0000000000 --- a/meta/recipes-devtools/python/python_2.7.15.bb +++ /dev/null | |||
@@ -1,271 +0,0 @@ | |||
1 | require python.inc | ||
2 | |||
3 | DEPENDS = "python-native libffi bzip2 gdbm openssl \ | ||
4 | readline sqlite3 zlib virtual/crypt" | ||
5 | |||
6 | PR = "${INC_PR}" | ||
7 | |||
8 | DISTRO_SRC_URI ?= "file://sitecustomize.py" | ||
9 | DISTRO_SRC_URI_linuxstdbase = "" | ||
10 | SRC_URI += "\ | ||
11 | file://01-use-proper-tools-for-cross-build.patch \ | ||
12 | file://03-fix-tkinter-detection.patch \ | ||
13 | file://06-avoid_usr_lib_termcap_path_in_linking.patch \ | ||
14 | ${DISTRO_SRC_URI} \ | ||
15 | file://multilib.patch \ | ||
16 | file://cgi_py.patch \ | ||
17 | file://setup_py_skip_cross_import_check.patch \ | ||
18 | file://add-md5module-support.patch \ | ||
19 | file://host_include_contamination.patch \ | ||
20 | file://fix_for_using_different_libdir.patch \ | ||
21 | file://setuptweaks.patch \ | ||
22 | file://check-if-target-is-64b-not-host.patch \ | ||
23 | file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ | ||
24 | ${@bb.utils.contains('PACKAGECONFIG', 'tk', '', 'file://avoid_warning_about_tkinter.patch', d)} \ | ||
25 | file://avoid_warning_for_sunos_specific_module.patch \ | ||
26 | file://python-2.7.3-remove-bsdb-rpath.patch \ | ||
27 | file://run-ptest \ | ||
28 | file://parallel-makeinst-create-bindir.patch \ | ||
29 | file://use_sysroot_ncurses_instead_of_host.patch \ | ||
30 | file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \ | ||
31 | file://pass-missing-libraries-to-Extension-for-mul.patch \ | ||
32 | file://support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch \ | ||
33 | file://float-endian.patch \ | ||
34 | file://0001-closes-bpo-34540-Convert-shutil._call_external_zip-t.patch \ | ||
35 | file://0001-2.7-bpo-34623-Use-XML_SetHashSalt-in-_elementtree-GH.patch \ | ||
36 | file://0001-python2-use-cc_basename-to-replace-CC-for-checking-c.patch \ | ||
37 | " | ||
38 | |||
39 | S = "${WORKDIR}/Python-${PV}" | ||
40 | |||
41 | inherit autotools multilib_header python-dir pythonnative ptest | ||
42 | |||
43 | CONFIGUREOPTS += " --with-system-ffi " | ||
44 | |||
45 | EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no ac_cv_working_tzset=yes" | ||
46 | |||
47 | PACKAGECONFIG ??= "bdb" | ||
48 | PACKAGECONFIG[bdb] = ",,db" | ||
49 | PACKAGECONFIG[tk] = ",,tk" | ||
50 | |||
51 | do_configure_append() { | ||
52 | rm -f ${S}/Makefile.orig | ||
53 | autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi | ||
54 | } | ||
55 | |||
56 | do_compile() { | ||
57 | # regenerate platform specific files, because they depend on system headers | ||
58 | cd ${S}/Lib/plat-linux2 | ||
59 | include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
60 | ${S}/Tools/scripts/h2py.py -i '(u_long)' \ | ||
61 | ${STAGING_INCDIR}/dlfcn.h \ | ||
62 | ${STAGING_INCDIR}/linux/cdrom.h \ | ||
63 | ${STAGING_INCDIR}/netinet/in.h \ | ||
64 | ${STAGING_INCDIR}/sys/types.h | ||
65 | sed -e 's,${STAGING_DIR_HOST},,g' -i *.py | ||
66 | cd - | ||
67 | |||
68 | # remove any bogus LD_LIBRARY_PATH | ||
69 | sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile | ||
70 | |||
71 | if [ ! -f Makefile.orig ]; then | ||
72 | install -m 0644 Makefile Makefile.orig | ||
73 | fi | ||
74 | sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \ | ||
75 | -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \ | ||
76 | -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \ | ||
77 | -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \ | ||
78 | -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \ | ||
79 | -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \ | ||
80 | -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \ | ||
81 | Makefile | ||
82 | # save copy of it now, because if we do it in do_install and | ||
83 | # then call do_install twice we get Makefile.orig == Makefile.sysroot | ||
84 | install -m 0644 Makefile Makefile.sysroot | ||
85 | |||
86 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
87 | export PYTHONBUILDDIR="${B}" | ||
88 | |||
89 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
90 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
91 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
92 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
93 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
94 | OPT="${CFLAGS}" | ||
95 | } | ||
96 | |||
97 | do_install() { | ||
98 | # make install needs the original Makefile, or otherwise the inclues would | ||
99 | # go to ${D}${STAGING...}/... | ||
100 | install -m 0644 Makefile.orig Makefile | ||
101 | |||
102 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
103 | export PYTHONBUILDDIR="${B}" | ||
104 | |||
105 | # After swizzling the makefile, we need to run the build again. | ||
106 | # install can race with the build so we have to run this first, then install | ||
107 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
108 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
109 | CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ | ||
110 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
111 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
112 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
113 | DESTDIR=${D} LIBDIR=${libdir} | ||
114 | |||
115 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ | ||
116 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ | ||
117 | CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ | ||
118 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
119 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
120 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
121 | DESTDIR=${D} LIBDIR=${libdir} install | ||
122 | |||
123 | install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
124 | |||
125 | if [ -e ${WORKDIR}/sitecustomize.py ]; then | ||
126 | install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} | ||
127 | fi | ||
128 | |||
129 | oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h | ||
130 | |||
131 | if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'bdb', d)}" ]; then | ||
132 | rm -rf ${D}/${libdir}/python${PYTHON_MAJMIN}/bsddb | ||
133 | fi | ||
134 | |||
135 | # Python 3.x version of 2to3 is now the default | ||
136 | mv ${D}/${bindir}/2to3 ${D}/${bindir}/2to3-${PYTHON_MAJMIN} | ||
137 | } | ||
138 | |||
139 | do_install_append_class-nativesdk () { | ||
140 | create_wrapper ${D}${bindir}/python2.7 PYTHONHOME='${prefix}' TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1' | ||
141 | } | ||
142 | |||
143 | SSTATE_SCAN_FILES += "Makefile" | ||
144 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" | ||
145 | |||
146 | py_package_preprocess () { | ||
147 | # copy back the old Makefile to fix target package | ||
148 | install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
149 | |||
150 | # Remove references to buildmachine paths in target Makefile and _sysconfigdata | ||
151 | sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \ | ||
152 | -e 's|${DEBUG_PREFIX_MAP}||g' \ | ||
153 | -e 's:${HOSTTOOLS_DIR}/::g' \ | ||
154 | -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ | ||
155 | -e 's:${RECIPE_SYSROOT}::g' \ | ||
156 | -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ | ||
157 | ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \ | ||
158 | ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py | ||
159 | (cd ${PKGD}; python -m py_compile ./${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py) | ||
160 | } | ||
161 | |||
162 | PACKAGES_remove = "${PN}" | ||
163 | |||
164 | # manual dependency additions | ||
165 | RPROVIDES_${PN}-core = "${PN}" | ||
166 | RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules" | ||
167 | RRECOMMENDS_${PN}-crypt = "openssl" | ||
168 | |||
169 | # package libpython2 | ||
170 | PACKAGES =+ "lib${BPN}2" | ||
171 | FILES_lib${BPN}2 = "${libdir}/libpython*.so.*" | ||
172 | |||
173 | # catch all the rest (unsorted) | ||
174 | PACKAGES += "${PN}-misc" | ||
175 | FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" | ||
176 | RDEPENDS_${PN}-modules += "${PN}-misc" | ||
177 | |||
178 | # ptest | ||
179 | RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests unzip tzdata-europe coreutils sed" | ||
180 | RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk', '', d)}" | ||
181 | # catch manpage | ||
182 | PACKAGES += "${PN}-man" | ||
183 | FILES_${PN}-man = "${datadir}/man" | ||
184 | |||
185 | # Nasty but if bdb isn't enabled the package won't be generated | ||
186 | RDEPENDS_${PN}-modules_remove = "${@bb.utils.contains('PACKAGECONFIG', 'bdb', '', '${PN}-bsddb', d)}" | ||
187 | |||
188 | RDEPENDS_${PN}-dev = "" | ||
189 | |||
190 | BBCLASSEXTEND = "nativesdk" | ||
191 | |||
192 | # We want bytecode precompiled .py files (.pyc's) by default | ||
193 | # but the user may set it on their own conf | ||
194 | |||
195 | INCLUDE_PYCS ?= "1" | ||
196 | |||
197 | python(){ | ||
198 | import collections, json | ||
199 | |||
200 | filename = os.path.join(d.getVar('THISDIR'), 'python', 'python2-manifest.json') | ||
201 | # This python changes the datastore based on the contents of a file, so mark | ||
202 | # that dependency. | ||
203 | bb.parse.mark_dependency(d, filename) | ||
204 | |||
205 | with open(filename) as manifest_file: | ||
206 | manifest_str = manifest_file.read() | ||
207 | json_start = manifest_str.find('# EOC') + 6 | ||
208 | manifest_file.seek(json_start) | ||
209 | manifest_str = manifest_file.read() | ||
210 | python_manifest = json.loads(manifest_str, object_pairs_hook=collections.OrderedDict) | ||
211 | |||
212 | include_pycs = d.getVar('INCLUDE_PYCS') | ||
213 | |||
214 | packages = d.getVar('PACKAGES').split() | ||
215 | pn = d.getVar('PN') | ||
216 | |||
217 | newpackages=[] | ||
218 | |||
219 | for key in python_manifest: | ||
220 | pypackage= pn + '-' + key | ||
221 | |||
222 | if pypackage not in packages: | ||
223 | # We need to prepend, otherwise python-misc gets everything | ||
224 | # so we use a new variable | ||
225 | newpackages.append(pypackage) | ||
226 | |||
227 | # "Build" python's manifest FILES, RDEPENDS and SUMMARY | ||
228 | d.setVar('FILES_' + pypackage, '') | ||
229 | for value in python_manifest[key]['files']: | ||
230 | d.appendVar('FILES_' + pypackage, ' ' + value) | ||
231 | if include_pycs == '1': | ||
232 | if value.endswith('.py'): | ||
233 | d.appendVar('FILES_' + pypackage, ' ' + value + 'c') | ||
234 | |||
235 | for value in python_manifest[key]['rdepends']: | ||
236 | # Make it work with or without $PN | ||
237 | if '${PN}' in value: | ||
238 | value=value.split('-')[1] | ||
239 | d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value) | ||
240 | d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary']) | ||
241 | |||
242 | # Prepending so to avoid python-misc getting everything | ||
243 | packages = newpackages + packages | ||
244 | d.setVar('PACKAGES', ' '.join(packages)) | ||
245 | d.setVar('ALLOW_EMPTY_${PN}-modules', '1') | ||
246 | } | ||
247 | |||
248 | # Files needed to create a new manifest | ||
249 | SRC_URI += "file://create_manifest2.py file://get_module_deps2.py file://python2-manifest.json" | ||
250 | |||
251 | do_create_manifest() { | ||
252 | # This task should be run with every new release of Python. | ||
253 | # We must ensure that PACKAGECONFIG enables everything when creating | ||
254 | # a new manifest, this is to base our new manifest on a complete | ||
255 | # native python build, containing all dependencies, otherwise the task | ||
256 | # wont be able to find the required files. | ||
257 | # e.g. BerkeleyDB is an optional build dependency so it may or may not | ||
258 | # be present, we must ensure it is. | ||
259 | |||
260 | cd ${WORKDIR} | ||
261 | # This needs to be executed by python-native and NOT by HOST's python | ||
262 | nativepython create_manifest2.py | ||
263 | cp python2-manifest.json.new ${THISDIR}/python/python2-manifest.json | ||
264 | } | ||
265 | |||
266 | # bitbake python -c create_manifest | ||
267 | addtask do_create_manifest | ||
268 | |||
269 | # Make sure we have native python ready when we create a new manifest | ||
270 | do_create_manifest[depends] += "python:do_prepare_recipe_sysroot" | ||
271 | do_create_manifest[depends] += "python:do_patch" | ||