diff options
author | Alejandro Hernandez <alejandro.hernandez@linux.intel.com> | 2015-11-10 23:34:48 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-01 21:32:06 +0000 |
commit | 2268a702f1d5528a8a1f5af19b099d25b486dec3 (patch) | |
tree | 333b2f93236469c62a5ae0e5f8fb6ab8fc13ea59 /meta/recipes-devtools/python/python3_3.5.0.bb | |
parent | ed8d1bef240a835ea01ff5f722048084722448db (diff) | |
download | poky-2268a702f1d5528a8a1f5af19b099d25b486dec3.tar.gz |
python3: Upgrade from 3.4.3 to 3.5
python3-native_3.4.3.bb -> python3-native_3.5.0.bb:
- changed version
- changed cheksum
- no license change, just dates
python3_3.4.3.bb -> python3_3.5.0.bb:
- changed version
- changed cheksum
- no license change, just dates
New:
- use_packed_importlib.patch: Fixes importlib on cross-compile environments
Rebased:
- Manifest
- 000-cross-compile.patch
- 020-dont-compile-python-files.patch
- 04-default-is-optimized.patch
- python-3.3-multilib.patch
- distutils3-base.bbclass
- distutils3-native-base.bbclass
- python3native.bbclass
Upstream:
- makerace.patch
Misc:
- pip2 is handled as default on major distros,
modified python3-pip to leave /usr/bin/pip available for pip2
- Fixed importing pip3 from python3 interpreter
(From OE-Core rev: 701ec1977ced1bb08461e6de98b4f63d21cba8a6)
Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
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.0.bb')
-rw-r--r-- | meta/recipes-devtools/python/python3_3.5.0.bb | 222 |
1 files changed, 222 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3_3.5.0.bb b/meta/recipes-devtools/python/python3_3.5.0.bb new file mode 100644 index 0000000000..d0872be2b6 --- /dev/null +++ b/meta/recipes-devtools/python/python3_3.5.0.bb | |||
@@ -0,0 +1,222 @@ | |||
1 | require recipes-devtools/python/python.inc | ||
2 | |||
3 | DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline sqlite3 zlib virtual/libintl xz" | ||
4 | PR = "${INC_PR}.0" | ||
5 | PYTHON_MAJMIN = "3.5" | ||
6 | PYTHON_BINABI= "${PYTHON_MAJMIN}m" | ||
7 | DISTRO_SRC_URI ?= "file://sitecustomize.py" | ||
8 | DISTRO_SRC_URI_linuxstdbase = "" | ||
9 | SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ | ||
10 | file://python-config.patch \ | ||
11 | file://000-cross-compile.patch \ | ||
12 | file://020-dont-compile-python-files.patch \ | ||
13 | file://030-fixup-include-dirs.patch \ | ||
14 | file://070-dont-clean-ipkg-install.patch \ | ||
15 | file://080-distutils-dont_adjust_files.patch \ | ||
16 | file://110-enable-zlib.patch \ | ||
17 | file://130-readline-setup.patch \ | ||
18 | file://150-fix-setupterm.patch \ | ||
19 | file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \ | ||
20 | ${DISTRO_SRC_URI} \ | ||
21 | " | ||
22 | |||
23 | SRC_URI += "\ | ||
24 | file://03-fix-tkinter-detection.patch \ | ||
25 | file://04-default-is-optimized.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://python3-setup.py-no-host-headers-libs.patch \ | ||
36 | file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \ | ||
37 | file://setup.py-check-cross_compiling-when-get-FLAGS.patch \ | ||
38 | file://setup.py-find-libraries-in-staging-dirs.patch \ | ||
39 | file://use_packed_importlib.patch \ | ||
40 | " | ||
41 | SRC_URI[md5sum] = "d149d2812f10cbe04c042232e7964171" | ||
42 | SRC_URI[sha256sum] = "d6d7aa1634a5eeeca6ed4fca266982a04f84bd8f3945a9179e20b24ad2e2be91" | ||
43 | |||
44 | LIC_FILES_CHKSUM = "file://LICENSE;md5=dd98d01d471fac8d8dbdd975229dba03" | ||
45 | |||
46 | S = "${WORKDIR}/Python-${PV}" | ||
47 | |||
48 | inherit autotools multilib_header python3native pkgconfig | ||
49 | |||
50 | CONFIGUREOPTS += " --with-system-ffi " | ||
51 | |||
52 | CACHED_CONFIGUREVARS = "ac_cv_have_chflags=no \ | ||
53 | ac_cv_have_lchflags=no \ | ||
54 | ac_cv_have_long_long_format=yes \ | ||
55 | ac_cv_buggy_getaddrinfo=no \ | ||
56 | ac_cv_file__dev_ptmx=yes \ | ||
57 | ac_cv_file__dev_ptc=no \ | ||
58 | " | ||
59 | |||
60 | TARGET_CC_ARCH += "-DNDEBUG -fno-inline" | ||
61 | EXTRA_OEMAKE += "CROSS_COMPILE=yes" | ||
62 | EXTRA_OECONF += "CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ --without-ensurepip" | ||
63 | |||
64 | export CROSS_COMPILE = "${TARGET_PREFIX}" | ||
65 | export _PYTHON_PROJECT_BASE = "${B}" | ||
66 | export _PYTHON_PROJECT_SRC = "${S}" | ||
67 | export CCSHARED = "-fPIC" | ||
68 | |||
69 | # Fix ctypes cross compilation | ||
70 | export CROSSPYTHONPATH = "${B}/build/lib.linux-${TARGET_ARCH}-${PYTHON_MAJMIN}:${S}/Lib:${S}/Lib/plat-linux" | ||
71 | |||
72 | # No ctypes option for python 3 | ||
73 | PYTHONLSBOPTS = "" | ||
74 | |||
75 | do_configure_append() { | ||
76 | rm -f ${S}/Makefile.orig | ||
77 | autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi | ||
78 | } | ||
79 | |||
80 | do_compile() { | ||
81 | # regenerate platform specific files, because they depend on system headers | ||
82 | cd ${S}/Lib/plat-linux* | ||
83 | include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | ||
84 | ${S}/Tools/scripts/h2py.py -i '(u_long)' \ | ||
85 | ${STAGING_INCDIR}/dlfcn.h \ | ||
86 | ${STAGING_INCDIR}/linux/cdrom.h \ | ||
87 | ${STAGING_INCDIR}/netinet/in.h \ | ||
88 | ${STAGING_INCDIR}/sys/types.h | ||
89 | sed -e 's,${STAGING_DIR_HOST},,g' -i *.py | ||
90 | cd - | ||
91 | |||
92 | |||
93 | # remove any bogus LD_LIBRARY_PATH | ||
94 | sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile | ||
95 | |||
96 | if [ ! -f Makefile.orig ]; then | ||
97 | install -m 0644 Makefile Makefile.orig | ||
98 | fi | ||
99 | sed -i -e 's,^CONFIGURE_LDFLAGS=.*,CONFIGURE_LDFLAGS=-L. -L${STAGING_LIBDIR},g' \ | ||
100 | -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \ | ||
101 | -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \ | ||
102 | -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \ | ||
103 | -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \ | ||
104 | -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \ | ||
105 | -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \ | ||
106 | Makefile | ||
107 | # save copy of it now, because if we do it in do_install and | ||
108 | # then call do_install twice we get Makefile.orig == Makefile.sysroot | ||
109 | install -m 0644 Makefile Makefile.sysroot | ||
110 | |||
111 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ | ||
112 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | ||
113 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
114 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
115 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
116 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
117 | LIB=${baselib} \ | ||
118 | ARCH=${TARGET_ARCH} \ | ||
119 | OPT="${CFLAGS}" libpython3.so | ||
120 | |||
121 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ | ||
122 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | ||
123 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
124 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
125 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
126 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
127 | LIB=${baselib} \ | ||
128 | ARCH=${TARGET_ARCH} \ | ||
129 | OPT="${CFLAGS}" | ||
130 | } | ||
131 | |||
132 | do_install() { | ||
133 | # make install needs the original Makefile, or otherwise the inclues would | ||
134 | # go to ${D}${STAGING...}/... | ||
135 | install -m 0644 Makefile.orig Makefile | ||
136 | |||
137 | install -d ${D}${libdir}/pkgconfig | ||
138 | install -d ${D}${libdir}/python${PYTHON_MAJMIN}/config | ||
139 | |||
140 | # rerun the build once again with original makefile this time | ||
141 | # run install in a separate step to avoid compile/install race | ||
142 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ | ||
143 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | ||
144 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
145 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
146 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
147 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
148 | LIB=${baselib} \ | ||
149 | ARCH=${TARGET_ARCH} \ | ||
150 | DESTDIR=${D} LIBDIR=${libdir} | ||
151 | |||
152 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \ | ||
153 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \ | ||
154 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
155 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
156 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
157 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
158 | LIB=${baselib} \ | ||
159 | ARCH=${TARGET_ARCH} \ | ||
160 | DESTDIR=${D} LIBDIR=${libdir} install | ||
161 | |||
162 | # avoid conflict with 2to3 from Python 2 | ||
163 | rm -f ${D}/${bindir}/2to3 | ||
164 | |||
165 | install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
166 | |||
167 | if [ -e ${WORKDIR}/sitecustomize.py ]; then | ||
168 | install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} | ||
169 | fi | ||
170 | |||
171 | oe_multilib_header python${PYTHON_BINABI}/pyconfig.h | ||
172 | } | ||
173 | |||
174 | do_install_append_class-nativesdk () { | ||
175 | create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' | ||
176 | } | ||
177 | |||
178 | SSTATE_SCAN_FILES += "Makefile" | ||
179 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" | ||
180 | |||
181 | py_package_preprocess () { | ||
182 | # copy back the old Makefile to fix target package | ||
183 | install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
184 | # Remove references to buildmachine paths in target Makefile and _sysconfigdata | ||
185 | sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \ | ||
186 | ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \ | ||
187 | ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py | ||
188 | } | ||
189 | |||
190 | require python-${PYTHON_MAJMIN}-manifest.inc | ||
191 | |||
192 | # manual dependency additions | ||
193 | RPROVIDES_${PN}-core = "${PN}" | ||
194 | RRECOMMENDS_${PN}-core = "${PN}-readline" | ||
195 | RRECOMMENDS_${PN}-crypt = "openssl" | ||
196 | RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl" | ||
197 | |||
198 | FILES_${PN}-2to3 += "${bindir}/2to3-${PYTHON_MAJMIN}" | ||
199 | FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3" | ||
200 | FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}" | ||
201 | |||
202 | PACKAGES =+ "${PN}-pyvenv" | ||
203 | FILES_${PN}-pyvenv += "${bindir}/pyvenv-${PYTHON_MAJMIN} ${bindir}/pyvenv" | ||
204 | |||
205 | # package libpython3 | ||
206 | PACKAGES =+ "libpython3 libpython3-staticdev" | ||
207 | FILES_libpython3 = "${libdir}/libpython*.so.*" | ||
208 | FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/libpython${PYTHON_BINABI}.a" | ||
209 | |||
210 | # catch debug extensions (isn't that already in python-core-dbg?) | ||
211 | FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug" | ||
212 | |||
213 | # catch all the rest (unsorted) | ||
214 | PACKAGES += "${PN}-misc" | ||
215 | RDEPENDS_${PN}-misc += "${PN}-core" | ||
216 | FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" | ||
217 | |||
218 | # catch manpage | ||
219 | PACKAGES += "${PN}-man" | ||
220 | FILES_${PN}-man = "${datadir}/man" | ||
221 | |||
222 | BBCLASSEXTEND = "nativesdk" | ||