diff options
Diffstat (limited to 'meta/recipes-devtools/python/python_2.7.2.bb')
-rw-r--r-- | meta/recipes-devtools/python/python_2.7.2.bb | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python_2.7.2.bb b/meta/recipes-devtools/python/python_2.7.2.bb new file mode 100644 index 0000000000..af14adbbb3 --- /dev/null +++ b/meta/recipes-devtools/python/python_2.7.2.bb | |||
@@ -0,0 +1,144 @@ | |||
1 | require python.inc | ||
2 | DEPENDS = "python-native db gdbm openssl readline sqlite3 zlib" | ||
3 | DEPENDS_sharprom = "python-native db readline zlib gdbm openssl" | ||
4 | PR = "${INC_PR}.0" | ||
5 | |||
6 | DISTRO_SRC_URI ?= "file://sitecustomize.py" | ||
7 | DISTRO_SRC_URI_linuxstdbase = "" | ||
8 | SRC_URI += "\ | ||
9 | file://01-use-proper-tools-for-cross-build.patch \ | ||
10 | file://03-fix-tkinter-detection.patch \ | ||
11 | file://04-default-is-optimized.patch \ | ||
12 | file://05-enable-ctypes-cross-build.patch \ | ||
13 | file://06-ctypes-libffi-fix-configure.patch \ | ||
14 | file://06-avoid_usr_lib_termcap_path_in_linking.patch \ | ||
15 | file://07-linux3-regen-fix.patch \ | ||
16 | file://99-ignore-optimization-flag.patch \ | ||
17 | ${DISTRO_SRC_URI} \ | ||
18 | file://multilib.patch \ | ||
19 | file://cgi_py.patch \ | ||
20 | file://remove_sqlite_rpath.patch \ | ||
21 | " | ||
22 | |||
23 | S = "${WORKDIR}/Python-${PV}" | ||
24 | |||
25 | inherit autotools | ||
26 | |||
27 | # The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources | ||
28 | #Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :( | ||
29 | TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__" | ||
30 | TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__" | ||
31 | |||
32 | do_configure_prepend() { | ||
33 | autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" | ||
34 | } | ||
35 | |||
36 | do_compile() { | ||
37 | # | ||
38 | # Copy config.h and an appropriate Makefile for distutils.sysconfig, | ||
39 | # which laters uses the information out of these to compile extensions | ||
40 | # | ||
41 | # The following part (until python compilation) should probably moved to an | ||
42 | # -initial recipe to handle staging better | ||
43 | # | ||
44 | install -d ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/ | ||
45 | install -d ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/ | ||
46 | install -m 0644 pyconfig.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/ | ||
47 | |||
48 | # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144 | ||
49 | sed -i -e s,ccache,'$(CCACHE)', Makefile | ||
50 | |||
51 | install -m 0644 Makefile Makefile.orig | ||
52 | sed -i -e 's,${includedir},${STAGING_INCDIR},' Makefile | ||
53 | sed -i -e 's,${libdir},${STAGING_LIBDIR},' Makefile | ||
54 | install -m 0644 Makefile ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/ | ||
55 | # save copy of it now, because if we do it in do_install and | ||
56 | # then call do_install twice we get Makefile.orig == Makefile.sysroot | ||
57 | install -m 0644 Makefile Makefile.sysroot | ||
58 | |||
59 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ | ||
60 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ | ||
61 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
62 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
63 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
64 | OPT="${CFLAGS}" libpython${PYTHON_MAJMIN}.so | ||
65 | |||
66 | oe_libinstall -so libpython${PYTHON_MAJMIN} ${STAGING_LIBDIR} | ||
67 | |||
68 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ | ||
69 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ | ||
70 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
71 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
72 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
73 | OPT="${CFLAGS}" | ||
74 | } | ||
75 | |||
76 | do_install() { | ||
77 | # make install needs the original Makefile, or otherwise the inclues would | ||
78 | # go to ${D}${STAGING...}/... | ||
79 | install -m 0644 Makefile.orig Makefile | ||
80 | |||
81 | oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ | ||
82 | HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ | ||
83 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
84 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
85 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
86 | DESTDIR=${D} LIBDIR=${libdir} install | ||
87 | |||
88 | install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
89 | |||
90 | if [ -e ${WORKDIR}/sitecustomize.py ]; then | ||
91 | install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} | ||
92 | fi | ||
93 | } | ||
94 | |||
95 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" | ||
96 | |||
97 | py_package_preprocess () { | ||
98 | # copy back the old Makefile to fix target package | ||
99 | install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile | ||
100 | } | ||
101 | |||
102 | require python-${PYTHON_MAJMIN}-manifest.inc | ||
103 | |||
104 | # manual dependency additions | ||
105 | RPROVIDES_${PN}-core = "${PN}" | ||
106 | RRECOMMENDS_${PN}-core = "${PN}-readline" | ||
107 | RRECOMMENDS_${PN}-crypt = "openssl" | ||
108 | |||
109 | # add sitecustomize | ||
110 | FILES_${PN}-core += "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py" | ||
111 | # ship 2to3 | ||
112 | FILES_${PN}-core += "${bindir}/2to3" | ||
113 | |||
114 | # package libpython2 | ||
115 | PACKAGES =+ "lib${BPN}2" | ||
116 | FILES_lib${BPN}2 = "${libdir}/libpython*.so.*" | ||
117 | |||
118 | # additional stuff -dev | ||
119 | |||
120 | FILES_${PN}-dev = "\ | ||
121 | ${includedir} \ | ||
122 | ${libdir}/lib*${SOLIBSDEV} \ | ||
123 | ${libdir}/*.la \ | ||
124 | ${libdir}/*.a \ | ||
125 | ${libdir}/*.o \ | ||
126 | ${libdir}/pkgconfig \ | ||
127 | ${base_libdir}/*.a \ | ||
128 | ${base_libdir}/*.o \ | ||
129 | ${datadir}/aclocal \ | ||
130 | ${datadir}/pkgconfig \ | ||
131 | " | ||
132 | |||
133 | # catch debug extensions (isn't that already in python-core-dbg?) | ||
134 | FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug" | ||
135 | |||
136 | # catch all the rest (unsorted) | ||
137 | PACKAGES += "${PN}-misc" | ||
138 | FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" | ||
139 | |||
140 | # catch manpage | ||
141 | PACKAGES += "${PN}-man" | ||
142 | FILES_${PN}-man = "${datadir}/man" | ||
143 | |||
144 | BBCLASSEXTEND = "nativesdk" | ||