diff options
author | Nitin A Kamble <nitin.a.kamble@intel.com> | 2012-05-01 10:23:29 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-03 15:48:04 +0100 |
commit | 7b08f6a9a11c76aa6b0910feb49accae5db25de3 (patch) | |
tree | d5333890dd7a553eef6b8a32a16e5ff446fb4fbb /meta/recipes-devtools/python/python_2.7.3.bb | |
parent | 4f4ab8bfe33283105112e81ee242a2e72527dd18 (diff) | |
download | poky-7b08f6a9a11c76aa6b0910feb49accae5db25de3.tar.gz |
python: upgrade from 2.7.2 to 2.7.3
bin/python2 link is provided by the python install process,
so no need to create it.
rebase these patches to the newer code:
fix_for_using_different_libdir.patch
04-default-is-optimized.patch
remove this patch as it is upstream now:
sys_platform_is_now_always_linux2.patch
Change default python version to 2.7.3 in the distro config
(From OE-Core rev: 5d92a95ea9b480235b7c9ca5949a681376eba725)
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python_2.7.3.bb')
-rw-r--r-- | meta/recipes-devtools/python/python_2.7.3.bb | 169 |
1 files changed, 169 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python_2.7.3.bb b/meta/recipes-devtools/python/python_2.7.3.bb new file mode 100644 index 0000000000..b06d7b7f90 --- /dev/null +++ b/meta/recipes-devtools/python/python_2.7.3.bb | |||
@@ -0,0 +1,169 @@ | |||
1 | require python.inc | ||
2 | DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" | ||
3 | PR = "${INC_PR}.0" | ||
4 | |||
5 | DISTRO_SRC_URI ?= "file://sitecustomize.py" | ||
6 | DISTRO_SRC_URI_linuxstdbase = "" | ||
7 | SRC_URI += "\ | ||
8 | file://01-use-proper-tools-for-cross-build.patch \ | ||
9 | file://03-fix-tkinter-detection.patch \ | ||
10 | file://04-default-is-optimized.patch \ | ||
11 | file://05-enable-ctypes-cross-build.patch \ | ||
12 | file://06-ctypes-libffi-fix-configure.patch \ | ||
13 | file://06-avoid_usr_lib_termcap_path_in_linking.patch \ | ||
14 | file://99-ignore-optimization-flag.patch \ | ||
15 | ${DISTRO_SRC_URI} \ | ||
16 | file://multilib.patch \ | ||
17 | file://cgi_py.patch \ | ||
18 | file://remove_sqlite_rpath.patch \ | ||
19 | file://setup_py_skip_cross_import_check.patch \ | ||
20 | file://add-md5module-support.patch \ | ||
21 | file://host_include_contamination.patch \ | ||
22 | file://fix_for_using_different_libdir.patch \ | ||
23 | file://setuptweaks.patch \ | ||
24 | file://check-if-target-is-64b-not-host.patch \ | ||
25 | file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ | ||
26 | file://avoid_warning_about_bsddb.patch \ | ||
27 | file://avoid_warning_about_tkinter.patch \ | ||
28 | file://avoid_warning_for_sunos_specific_module.patch \ | ||
29 | " | ||
30 | |||
31 | S = "${WORKDIR}/Python-${PV}" | ||
32 | |||
33 | inherit autotools multilib_header | ||
34 | |||
35 | # The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources | ||
36 | #Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :( | ||
37 | TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__" | ||
38 | TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__" | ||
39 | |||
40 | do_configure_prepend() { | ||
41 | rm -f ${S}/Makefile.orig | ||
42 | autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" | ||
43 | } | ||
44 | |||
45 | do_compile() { | ||
46 | # regenerate platform specific files, because they depend on system headers | ||
47 | cd Lib/plat-linux2 | ||
48 | include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python \ | ||
49 | ${S}/Tools/scripts/h2py.py -i '(u_long)' \ | ||
50 | ${STAGING_INCDIR}/dlfcn.h \ | ||
51 | ${STAGING_INCDIR}/linux/cdrom.h \ | ||
52 | ${STAGING_INCDIR}/netinet/in.h \ | ||
53 | ${STAGING_INCDIR}/sys/types.h | ||
54 | sed -e 's,${STAGING_DIR_HOST},,g' -i *.py | ||
55 | cd - | ||
56 | |||
57 | # | ||
58 | # Copy config.h and an appropriate Makefile for distutils.sysconfig, | ||
59 | # which laters uses the information out of these to compile extensions | ||
60 | # | ||
61 | # The following part (until python compilation) should probably moved to an | ||
62 | # -initial recipe to handle staging better | ||
63 | # | ||
64 | install -d ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/ | ||
65 | install -d ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/ | ||
66 | install -m 0644 pyconfig.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/ | ||
67 | |||
68 | # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144 | ||
69 | sed -i -e s,ccache,'$(CCACHE)', Makefile | ||
70 | |||
71 | # remove any bogus LD_LIBRARY_PATH | ||
72 | sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile | ||
73 | |||
74 | if [ ! -f Makefile.orig ]; then | ||
75 | install -m 0644 Makefile Makefile.orig | ||
76 | fi | ||
77 | sed -i -e 's,^LDFLAGS=.*,LDFLAGS=-L. -L${STAGING_LIBDIR},g' \ | ||
78 | -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \ | ||
79 | -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \ | ||
80 | -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \ | ||
81 | -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \ | ||
82 | -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \ | ||
83 | -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \ | ||
84 | Makefile | ||
85 | install -m 0644 Makefile ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/ | ||
86 | # save copy of it now, because if we do it in do_install and | ||
87 | # then call do_install twice we get Makefile.orig == Makefile.sysroot | ||
88 | install -m 0644 Makefile Makefile.sysroot | ||
89 | |||
90 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
91 | |||
92 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ | ||
93 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ | ||
94 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
95 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
96 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
97 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
98 | OPT="${CFLAGS}" libpython${PYTHON_MAJMIN}.so | ||
99 | |||
100 | oe_libinstall -so libpython${PYTHON_MAJMIN} ${STAGING_LIBDIR} | ||
101 | |||
102 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ | ||
103 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ | ||
104 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
105 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
106 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
107 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
108 | OPT="${CFLAGS}" | ||
109 | } | ||
110 | |||
111 | do_install() { | ||
112 | # make install needs the original Makefile, or otherwise the inclues would | ||
113 | # go to ${D}${STAGING...}/... | ||
114 | install -m 0644 Makefile.orig Makefile | ||
115 | |||
116 | export CROSS_COMPILE="${TARGET_PREFIX}" | ||
117 | |||
118 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ | ||
119 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ | ||
120 | CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ | ||
121 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
122 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
123 | STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ | ||
124 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
125 | DESTDIR=${D} LIBDIR=${libdir} install | ||
126 | |||
127 | install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
128 | |||
129 | if [ -e ${WORKDIR}/sitecustomize.py ]; then | ||
130 | install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} | ||
131 | fi | ||
132 | |||
133 | oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h | ||
134 | } | ||
135 | |||
136 | SSTATE_SCAN_FILES += "Makefile" | ||
137 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" | ||
138 | |||
139 | py_package_preprocess () { | ||
140 | # copy back the old Makefile to fix target package | ||
141 | install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
142 | } | ||
143 | |||
144 | require python-${PYTHON_MAJMIN}-manifest.inc | ||
145 | |||
146 | # manual dependency additions | ||
147 | RPROVIDES_${PN}-core = "${PN}" | ||
148 | RRECOMMENDS_${PN}-core = "${PN}-readline" | ||
149 | RRECOMMENDS_${PN}-crypt = "openssl" | ||
150 | |||
151 | # package libpython2 | ||
152 | PACKAGES =+ "lib${BPN}2${PKGSUFFIX}" | ||
153 | FILES_lib${BPN}2${PKGSUFFIX} = "${libdir}/libpython*.so.*" | ||
154 | |||
155 | # catch debug extensions (isn't that already in python-core-dbg?) | ||
156 | FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug" | ||
157 | |||
158 | # catch all the rest (unsorted) | ||
159 | PACKAGES += "${PN}-misc" | ||
160 | FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" | ||
161 | |||
162 | # catch manpage | ||
163 | PACKAGES += "${PN}-man" | ||
164 | FILES_${PN}-man = "${datadir}/man" | ||
165 | |||
166 | BBCLASSEXTEND = "nativesdk" | ||
167 | |||
168 | PKGSUFFIX = "" | ||
169 | PKGSUFFIX_virtclass-nativesdk = "-nativesdk" | ||