summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3_3.5.3.bb
diff options
context:
space:
mode:
authorDerek Straka <derek@asterius.io>2018-01-30 12:22:49 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-02-06 11:06:27 +0000
commit39e48c8b066518909ea647bb3168243061fc1414 (patch)
tree4208257e1662982bd6fc9ea67b49c19de3245ba8 /meta/recipes-devtools/python/python3_3.5.3.bb
parent863df3c81f3f9786924c98aad01d1219c540fb26 (diff)
downloadpoky-39e48c8b066518909ea647bb3168243061fc1414.tar.gz
python3: update target and native recipes to 3.5.4
Use the latest 3.5 version until the 3.6 migration is complete Removed the following upstreamed patches: - python3/Fix-29519-weakref-spewing-exceptions-during-interp-f.patch - python3/upstream-random-fixes.patch Rebased the following pathes: - python3/0001-cross-compile-support.patch Regenerated the manifest based on the latest release version Updated the license checksum for the latest version that updated the copyright dates (From OE-Core rev: eb80d0391d7d4e83a61ed8850d936b102be3fa02) Signed-off-by: Derek Straka <derek@asterius.io> 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/python3_3.5.3.bb')
-rw-r--r--meta/recipes-devtools/python/python3_3.5.3.bb310
1 files changed, 0 insertions, 310 deletions
diff --git a/meta/recipes-devtools/python/python3_3.5.3.bb b/meta/recipes-devtools/python/python3_3.5.3.bb
deleted file mode 100644
index 3ae0db2b8b..0000000000
--- a/meta/recipes-devtools/python/python3_3.5.3.bb
+++ /dev/null
@@ -1,310 +0,0 @@
1require recipes-devtools/python/python.inc
2
3DEPENDS = "python3-native libffi bzip2 gdbm openssl readline sqlite3 zlib virtual/libintl xz"
4
5PR = "${INC_PR}.0"
6PYTHON_MAJMIN = "3.5"
7PYTHON_BINABI= "${PYTHON_MAJMIN}m"
8DISTRO_SRC_URI ?= "file://sitecustomize.py"
9DISTRO_SRC_URI_linuxstdbase = ""
10SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
11file://python-config.patch \
12file://0001-cross-compile-support.patch \
13file://030-fixup-include-dirs.patch \
14file://070-dont-clean-ipkg-install.patch \
15file://080-distutils-dont_adjust_files.patch \
16file://130-readline-setup.patch \
17file://150-fix-setupterm.patch \
18file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
19file://tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch \
20file://support_SOURCE_DATE_EPOCH_in_py_compile.patch \
21${DISTRO_SRC_URI} \
22"
23
24SRC_URI += "\
25 file://03-fix-tkinter-detection.patch \
26 file://avoid_warning_about_tkinter.patch \
27 file://cgi_py.patch \
28 file://host_include_contamination.patch \
29 file://python-3.3-multilib.patch \
30 file://shutil-follow-symlink-fix.patch \
31 file://sysroot-include-headers.patch \
32 file://unixccompiler.patch \
33 file://avoid-ncursesw-include-path.patch \
34 file://python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
35 file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \
36 file://setup.py-check-cross_compiling-when-get-FLAGS.patch \
37 file://configure.ac-fix-LIBPL.patch \
38 file://upstream-random-fixes.patch \
39 file://0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch \
40 file://Fix-29519-weakref-spewing-exceptions-during-interp-f.patch \
41 file://pass-missing-libraries-to-Extension-for-mul.patch \
42 "
43SRC_URI[md5sum] = "57d1f8bfbabf4f2500273fb0706e6f21"
44SRC_URI[sha256sum] = "eefe2ad6575855423ab630f5b51a8ef6e5556f774584c06beab4926f930ddbb0"
45
46LIC_FILES_CHKSUM = "file://LICENSE;md5=b680ed99aa60d350c65a65914494207e"
47
48# exclude pre-releases for both python 2.x and 3.x
49UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
50
51S = "${WORKDIR}/Python-${PV}"
52
53inherit autotools multilib_header python3native pkgconfig
54
55CONFIGUREOPTS += " --with-system-ffi "
56
57CACHED_CONFIGUREVARS = "ac_cv_have_chflags=no \
58 ac_cv_have_lchflags=no \
59 ac_cv_have_long_long_format=yes \
60 ac_cv_buggy_getaddrinfo=no \
61 ac_cv_file__dev_ptmx=yes \
62 ac_cv_file__dev_ptc=no \
63"
64
65TARGET_CC_ARCH += "-DNDEBUG -fno-inline"
66SDK_CC_ARCH += "-DNDEBUG -fno-inline"
67EXTRA_OEMAKE += "CROSS_COMPILE=yes"
68EXTRA_OECONF += "CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ --without-ensurepip"
69
70export CROSS_COMPILE = "${TARGET_PREFIX}"
71export _PYTHON_PROJECT_BASE = "${B}"
72export _PYTHON_PROJECT_SRC = "${S}"
73export CCSHARED = "-fPIC"
74
75# Fix cross compilation of different modules
76export CROSSPYTHONPATH = "${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/:${B}/build/lib.linux-${TARGET_ARCH}-${PYTHON_MAJMIN}:${S}/Lib:${S}/Lib/plat-linux"
77
78# No ctypes option for python 3
79PYTHONLSBOPTS = ""
80
81do_configure_append() {
82 rm -f ${S}/Makefile.orig
83 autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
84}
85
86do_compile() {
87 # regenerate platform specific files, because they depend on system headers
88 cd ${S}/Lib/plat-linux*
89 include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python3-native/python3 \
90 ${S}/Tools/scripts/h2py.py -i '(u_long)' \
91 ${STAGING_INCDIR}/dlfcn.h \
92 ${STAGING_INCDIR}/linux/cdrom.h \
93 ${STAGING_INCDIR}/netinet/in.h \
94 ${STAGING_INCDIR}/sys/types.h
95 sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
96 cd -
97
98
99 # remove any bogus LD_LIBRARY_PATH
100 sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
101
102 if [ ! -f Makefile.orig ]; then
103 install -m 0644 Makefile Makefile.orig
104 fi
105 sed -i -e 's,^CONFIGURE_LDFLAGS=.*,CONFIGURE_LDFLAGS=-L. -L${STAGING_LIBDIR},g' \
106 -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
107 -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
108 -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
109 -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
110 -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
111 -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
112 Makefile
113 # save copy of it now, because if we do it in do_install and
114 # then call do_install twice we get Makefile.orig == Makefile.sysroot
115 install -m 0644 Makefile Makefile.sysroot
116
117 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
118 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
119 STAGING_LIBDIR=${STAGING_LIBDIR} \
120 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
121 STAGING_INCDIR=${STAGING_INCDIR} \
122 LIB=${baselib} \
123 ARCH=${TARGET_ARCH} \
124 OPT="${CFLAGS}" libpython3.so
125
126 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
127 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
128 STAGING_LIBDIR=${STAGING_LIBDIR} \
129 STAGING_INCDIR=${STAGING_INCDIR} \
130 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
131 LIB=${baselib} \
132 ARCH=${TARGET_ARCH} \
133 OPT="${CFLAGS}"
134}
135
136do_install() {
137 # make install needs the original Makefile, or otherwise the inclues would
138 # go to ${D}${STAGING...}/...
139 install -m 0644 Makefile.orig Makefile
140
141 install -d ${D}${libdir}/pkgconfig
142 install -d ${D}${libdir}/python${PYTHON_MAJMIN}/config
143
144 # rerun the build once again with original makefile this time
145 # run install in a separate step to avoid compile/install race
146 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
147 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
148 STAGING_LIBDIR=${STAGING_LIBDIR} \
149 STAGING_INCDIR=${STAGING_INCDIR} \
150 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
151 LIB=${baselib} \
152 ARCH=${TARGET_ARCH} \
153 DESTDIR=${D} LIBDIR=${libdir}
154
155 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
156 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
157 STAGING_LIBDIR=${STAGING_LIBDIR} \
158 STAGING_INCDIR=${STAGING_INCDIR} \
159 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
160 LIB=${baselib} \
161 ARCH=${TARGET_ARCH} \
162 DESTDIR=${D} LIBDIR=${libdir} install
163
164 # avoid conflict with 2to3 from Python 2
165 rm -f ${D}/${bindir}/2to3
166
167 install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
168 install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}/Makefile
169
170 if [ -e ${WORKDIR}/sitecustomize.py ]; then
171 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
172 fi
173
174 oe_multilib_header python${PYTHON_BINABI}/pyconfig.h
175}
176
177do_install_append_class-nativesdk () {
178 create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
179}
180
181SSTATE_SCAN_FILES += "Makefile"
182PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
183
184py_package_preprocess () {
185 # copy back the old Makefile to fix target package
186 install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
187 install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}/Makefile
188 # Remove references to buildmachine paths in target Makefile and _sysconfigdata
189 sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
190 -e 's|${DEBUG_PREFIX_MAP}||g' \
191 -e 's:${HOSTTOOLS_DIR}/::g' \
192 -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
193 -e 's:${RECIPE_SYSROOT}::g' \
194 -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
195 ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
196 ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}/Makefile \
197 ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
198}
199
200# manual dependency additions
201RPROVIDES_${PN}-modules = "${PN}"
202RRECOMMENDS_${PN}-crypt = "openssl"
203RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
204
205FILES_${PN}-2to3 += "${bindir}/2to3-${PYTHON_MAJMIN}"
206FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
207FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
208
209PACKAGES =+ "${PN}-pyvenv"
210FILES_${PN}-pyvenv += "${bindir}/pyvenv-${PYTHON_MAJMIN} ${bindir}/pyvenv"
211
212# package libpython3
213PACKAGES =+ "libpython3 libpython3-staticdev"
214FILES_libpython3 = "${libdir}/libpython*.so.*"
215FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/libpython${PYTHON_BINABI}.a"
216INSANE_SKIP_${PN}-dev += "dev-elf"
217
218# catch all the rest (unsorted)
219PACKAGES += "${PN}-misc"
220RDEPENDS_${PN}-misc += "${PN}-core ${PN}-email ${PN}-codecs"
221RDEPENDS_${PN}-modules += "${PN}-misc"
222FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
223
224# catch manpage
225PACKAGES += "${PN}-man"
226FILES_${PN}-man = "${datadir}/man"
227
228BBCLASSEXTEND = "nativesdk"
229
230RPROVIDES_${PN} += "${PN}-modules"
231
232# We want bytecode precompiled .py files (.pyc's) by default
233# but the user may set it on their own conf
234INCLUDE_PYCS ?= "1"
235
236python(){
237 import json
238
239 filename = os.path.join(d.getVar('THISDIR'), 'python3', 'python3-manifest.json')
240 # This python changes the datastore based on the contents of a file, so mark
241 # that dependency.
242 bb.parse.mark_dependency(d, filename)
243
244 with open(filename) as manifest_file:
245 python_manifest=json.load(manifest_file)
246
247 include_pycs = d.getVar('INCLUDE_PYCS')
248
249 packages = d.getVar('PACKAGES').split()
250 pn = d.getVar('PN')
251
252 newpackages=[]
253 for key in python_manifest:
254 pypackage= pn + '-' + key
255
256 if pypackage not in packages:
257 # We need to prepend, otherwise python-misc gets everything
258 # so we use a new variable
259 newpackages.append(pypackage)
260
261 # "Build" python's manifest FILES, RDEPENDS and SUMMARY
262 d.setVar('FILES_' + pypackage, '')
263 for value in python_manifest[key]['files']:
264 d.appendVar('FILES_' + pypackage, ' ' + value)
265
266 # Add cached files
267 if include_pycs == '1':
268 for value in python_manifest[key]['cached']:
269 d.appendVar('FILES_' + pypackage, ' ' + value)
270
271 d.setVar('RDEPENDS_' + pypackage, '')
272 for value in python_manifest[key]['rdepends']:
273 # Make it work with or without $PN
274 if '${PN}' in value:
275 value=value.split('-')[1]
276 d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
277 d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary'])
278
279 # We need to ensure staticdev packages match for files first so we sort in reverse
280 newpackages.sort(reverse=True)
281 # Prepending so to avoid python-misc getting everything
282 packages = newpackages + packages
283 d.setVar('PACKAGES', ' '.join(packages))
284 d.setVar('ALLOW_EMPTY_${PN}-modules', '1')
285}
286
287# Files needed to create a new manifest
288SRC_URI += "file://create_manifest3.py file://get_module_deps3.py file://python3-manifest.json"
289
290do_create_manifest() {
291 # This task should be run with every new release of Python.
292 # We must ensure that PACKAGECONFIG enables everything when creating
293 # a new manifest, this is to base our new manifest on a complete
294 # native python build, containing all dependencies, otherwise the task
295 # wont be able to find the required files.
296 # e.g. BerkeleyDB is an optional build dependency so it may or may not
297 # be present, we must ensure it is.
298
299 cd ${WORKDIR}
300 # This needs to be executed by python-native and NOT by HOST's python
301 nativepython3 create_manifest3.py
302 cp python3-manifest.json.new ${THISDIR}/python3/python3-manifest.json
303}
304
305# bitbake python -c create_manifest
306addtask do_create_manifest
307
308# Make sure we have native python ready when we create a new manifest
309do_create_manifest[depends] += "python3:do_prepare_recipe_sysroot"
310do_create_manifest[depends] += "python3:do_patch"