libattr: remove libattr because it is clashing with udev/attr and is not used by...
[openembedded.git] / recipes / python / python_2.6.2.bb
blob8a14db5e7dcc594939decf8f8336c4ad85964ef5
1 require python.inc
2 DEPENDS = "python-native db gdbm openssl readline sqlite3 tcl zlib\
3 ${@base_contains('DISTRO_FEATURES', 'tk', 'tk', '', d)}"
4 DEPENDS_sharprom = "python-native db readline zlib gdbm openssl"
5 # set to .0 on every increase of INC_PR
6 PR = "${INC_PR}.0"
8 SRC_URI = "\
9 http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
10 file://00-fix-bindir-libdir-for-cross.patch \
11 file://01-use-proper-tools-for-cross-build.patch \
12 file://02-remove-test-for-cross.patch \
13 file://03-fix-tkinter-detection.patch \
14 file://04-default-is-optimized.patch \
15 file://05-enable-ctypes-cross-build.patch \
16 file://99-ignore-optimization-flag.patch \
18 # not yet pushed forward
19 # sitebranding
21 # file://05-install.patch \
22 # file://06-fix-urllib-exception.patch \
23 # file://16-bug1179-imageop.patch \
24 # file://13-set-wakeup-fix.patch \
26 file://sitecustomize.py \
28 S = "${WORKDIR}/Python-${PV}"
30 inherit autotools
32 # The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
33 #Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
34 TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
35 TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
37 do_configure_prepend() {
38 autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || oenote "_ctypes failed to autoreconf"
42 # Copy config.h and an appropriate Makefile for distutils.sysconfig,
43 # which laters uses the information out of these to compile extensions
45 do_compile_prepend() {
46 install -d ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
47 install -d ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
48 install -m 0644 pyconfig.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
49 install -m 0644 Makefile Makefile.orig
50 install -m 0644 Makefile Makefile.backup
51 sed -e 's,${includedir},${STAGING_INCDIR},' < Makefile.backup > Makefile
52 install -m 0644 Makefile Makefile.backup
53 sed -e 's,${libdir},${STAGING_LIBDIR},' < Makefile.backup > Makefile
54 install -m 0644 Makefile ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
57 do_compile() {
58 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
59 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
60 STAGING_LIBDIR=${STAGING_LIBDIR} \
61 STAGING_INCDIR=${STAGING_INCDIR} \
62 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
63 OPT="${CFLAGS}" libpython${PYTHON_MAJMIN}.so
65 oe_libinstall -so libpython${PYTHON_MAJMIN} ${STAGING_LIBDIR}
67 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
68 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
69 STAGING_LIBDIR=${STAGING_LIBDIR} \
70 STAGING_INCDIR=${STAGING_INCDIR} \
71 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
72 RUNSHARED= OPT="${CFLAGS}"
75 do_stage() {
76 install -m 0644 Include/*.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
77 oe_libinstall -a -so libpython${PYTHON_MAJMIN} ${STAGING_LIBDIR}
80 do_install() {
81 install -m 0644 Makefile.orig Makefile
83 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
84 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
85 STAGING_LIBDIR=${STAGING_LIBDIR} \
86 STAGING_INCDIR=${STAGING_INCDIR} \
87 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
88 DESTDIR=${D} LIBDIR=${libdir} RUNSHARED= install
90 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
92 # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
93 sed -i -e s,ccache,'$(CCACHE)', ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
96 require python-${PYTHON_MAJMIN}-manifest.inc
98 # manual dependency additions
99 RPROVIDES_python-core = "python"
100 RRECOMMENDS_python-core = "python-readline"
101 RRECOMMENDS_python-crypt = "openssl"
103 # add sitecustomize
104 FILES_python-core += "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py"
105 # ship 2to3
106 FILES_python-core += "${bindir}/2to3"
108 # package libpython2
109 PACKAGES =+ "libpython2"
110 FILES_libpython2 = "${libdir}/libpython*.so*"
112 # additional stuff -dev
114 FILES_${PN}-dev = "\
115 ${includedir} \
116 ${libdir}/lib*${SOLIBSDEV} \
117 ${libdir}/*.la \
118 ${libdir}/*.a \
119 ${libdir}/*.o \
120 ${libdir}/pkgconfig \
121 ${base_libdir}/*.a \
122 ${base_libdir}/*.o \
123 ${datadir}/aclocal \
124 ${datadir}/pkgconfig \
127 # catch debug extensions (isn't that already in python-core-dbg?)
128 FILES_python-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
130 # catch all the rest (unsorted)
131 PACKAGES += "python-misc"
132 FILES_python-misc = "${libdir}/python${PYTHON_MAJMIN}"
134 # catch manpage
135 PACKAGES += "python-man"
136 FILES_python-man = "${datadir}/man"
138 SRC_URI[md5sum] = "245db9f1e0f09ab7e0faaa0cf7301011"
139 SRC_URI[sha256sum] = "a1cdc4a8f6c1f947ea3b87d097af2db4371019bac941d92c3844124c5694328b"