summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python_2.7.11.bb
diff options
context:
space:
mode:
authorAlejandro Hernandez <alejandro.hernandez@linux.intel.com>2016-01-19 22:47:49 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-20 17:07:14 +0000
commit40738af46b9f4347de43c245015bb21d42eb8036 (patch)
treef924a4249058fd24c90e625829939b1380e6cc4f /meta/recipes-devtools/python/python_2.7.11.bb
parent35855a02f81d044c7a3d708719cd05f7dd11a389 (diff)
downloadpoky-40738af46b9f4347de43c245015bb21d42eb8036.tar.gz
python: Upgrade 2.7.9 > 2.7.11
- no license change, just dates Rebased: - check-if-target-is-64b-not-host.patch - add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch (From OE-Core rev: 9ed4ef038a4a8140accfa97b2eb6b75f8bed3693) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python_2.7.11.bb')
-rw-r--r--meta/recipes-devtools/python/python_2.7.11.bb174
1 files changed, 174 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python_2.7.11.bb b/meta/recipes-devtools/python/python_2.7.11.bb
new file mode 100644
index 0000000000..0287c191ab
--- /dev/null
+++ b/meta/recipes-devtools/python/python_2.7.11.bb
@@ -0,0 +1,174 @@
1require python.inc
2DEPENDS = "python-native libffi bzip2 db gdbm openssl readline sqlite3 zlib"
3PR = "${INC_PR}"
4
5DISTRO_SRC_URI ?= "file://sitecustomize.py"
6DISTRO_SRC_URI_linuxstdbase = ""
7SRC_URI += "\
8 file://01-use-proper-tools-for-cross-build.patch \
9 file://03-fix-tkinter-detection.patch \
10 file://06-avoid_usr_lib_termcap_path_in_linking.patch \
11 ${DISTRO_SRC_URI} \
12 file://multilib.patch \
13 file://cgi_py.patch \
14 file://setup_py_skip_cross_import_check.patch \
15 file://add-md5module-support.patch \
16 file://host_include_contamination.patch \
17 file://fix_for_using_different_libdir.patch \
18 file://setuptweaks.patch \
19 file://check-if-target-is-64b-not-host.patch \
20 file://search_db_h_in_inc_dirs_and_avoid_warning.patch \
21 file://avoid_warning_about_tkinter.patch \
22 file://avoid_warning_for_sunos_specific_module.patch \
23 file://python-2.7.3-remove-bsdb-rpath.patch \
24 file://fix-makefile-for-ptest.patch \
25 file://run-ptest \
26 file://parallel-makeinst-create-bindir.patch \
27 file://use_sysroot_ncurses_instead_of_host.patch \
28 file://avoid_parallel_make_races_on_pgen.patch \
29 file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
30"
31
32S = "${WORKDIR}/Python-${PV}"
33
34inherit autotools multilib_header python-dir pythonnative
35
36CONFIGUREOPTS += " --with-system-ffi "
37
38# The following is a hack until we drop ac_cv_sizeof_off_t from site files
39EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'ac_cv_sizeof_off_t=8', '', d)} ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no"
40
41do_configure_append() {
42 rm -f ${S}/Makefile.orig
43 autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
44}
45
46do_compile() {
47 # regenerate platform specific files, because they depend on system headers
48 cd ${S}/Lib/plat-linux2
49 include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \
50 ${S}/Tools/scripts/h2py.py -i '(u_long)' \
51 ${STAGING_INCDIR}/dlfcn.h \
52 ${STAGING_INCDIR}/linux/cdrom.h \
53 ${STAGING_INCDIR}/netinet/in.h \
54 ${STAGING_INCDIR}/sys/types.h
55 sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
56 cd -
57
58 # remove any bogus LD_LIBRARY_PATH
59 sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
60
61 if [ ! -f Makefile.orig ]; then
62 install -m 0644 Makefile Makefile.orig
63 fi
64 sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \
65 -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
66 -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
67 -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
68 -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
69 -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
70 -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
71 Makefile
72 # save copy of it now, because if we do it in do_install and
73 # then call do_install twice we get Makefile.orig == Makefile.sysroot
74 install -m 0644 Makefile Makefile.sysroot
75
76 export CROSS_COMPILE="${TARGET_PREFIX}"
77 export PYTHONBUILDDIR="${B}"
78
79 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
80 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
81 STAGING_LIBDIR=${STAGING_LIBDIR} \
82 STAGING_INCDIR=${STAGING_INCDIR} \
83 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
84 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
85 OPT="${CFLAGS}"
86}
87
88do_install() {
89 # make install needs the original Makefile, or otherwise the inclues would
90 # go to ${D}${STAGING...}/...
91 install -m 0644 Makefile.orig Makefile
92
93 export CROSS_COMPILE="${TARGET_PREFIX}"
94 export PYTHONBUILDDIR="${B}"
95
96 # After swizzling the makefile, we need to run the build again.
97 # install can race with the build so we have to run this first, then install
98 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
99 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
100 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
101 STAGING_LIBDIR=${STAGING_LIBDIR} \
102 STAGING_INCDIR=${STAGING_INCDIR} \
103 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
104 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
105 DESTDIR=${D} LIBDIR=${libdir}
106
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 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
114 DESTDIR=${D} LIBDIR=${libdir} install
115
116 install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
117
118 if [ -e ${WORKDIR}/sitecustomize.py ]; then
119 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
120 fi
121
122 oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
123}
124
125do_install_append_class-nativesdk () {
126 create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
127}
128
129SSTATE_SCAN_FILES += "Makefile"
130PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
131
132py_package_preprocess () {
133 # copy back the old Makefile to fix target package
134 install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
135
136 # Remove references to buildmachine paths in target Makefile and _sysconfigdata
137 sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
138 ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
139 ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
140}
141
142require python-${PYTHON_MAJMIN}-manifest.inc
143
144# manual dependency additions
145RPROVIDES_${PN}-core = "${PN}"
146RRECOMMENDS_${PN}-core = "${PN}-readline"
147RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules"
148RRECOMMENDS_${PN}-crypt = "openssl"
149
150# package libpython2
151PACKAGES =+ "lib${BPN}2"
152FILES_lib${BPN}2 = "${libdir}/libpython*.so.*"
153
154# catch all the rest (unsorted)
155PACKAGES += "${PN}-misc"
156FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
157RDEPENDS_${PN}-modules += "${PN}-misc"
158RDEPENDS_${PN}-ptest = "${PN}-modules"
159#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
160inherit ptest
161
162# This must come after inherit ptest for the override to take effect
163do_install_ptest() {
164 cp ${B}/Makefile ${D}${PTEST_PATH}
165 sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \
166 -e s:LIBDIR:${libdir}:g \
167 -i ${D}${PTEST_PATH}/run-ptest
168}
169
170# catch manpage
171PACKAGES += "${PN}-man"
172FILES_${PN}-man = "${datadir}/man"
173
174BBCLASSEXTEND = "nativesdk"