Merge branch 'org.openembedded.dev' of git://git.openembedded.net/openembedded into...
[vuplus_openembedded] / packages / python / python_2.5.2.bb
1 DESCRIPTION = "Python Programming Language"
2 HOMEPAGE = "http://www.python.org"
3 LICENSE = "PSF"
4 SECTION = "devel/python"
5 PRIORITY = "optional"
6 DEPENDS = "python-native db gdbm openssl readline sqlite3 zlib"
7 DEPENDS_sharprom = "python-native db readline zlib gdbm openssl"
8 # bump this on every change in contrib/python/generate-manifest-2.5.py
9 PR = "ml14"
10
11 PYTHON_MAJMIN = "2.5"
12
13 SRC_URI = "\
14   http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
15   file://bindir-libdir.patch;patch=1 \
16   file://crosscompile.patch;patch=1 \
17   file://fix-tkinter-detection.patch;patch=1 \
18   file://autohell.patch;patch=1 \
19   file://sitebranding.patch;patch=1 \
20   file://enable-ctypes-module.patch;patch=1 \
21   file://default-is-optimized.patch;patch=1 \
22   \
23   file://05-install.patch;patch=1 \
24   file://06-fix-urllib-exception.patch;patch=1 \
25   file://16-bug1179-imageop.patch;patch=1 \
26   file://13-set-wakeup-fix.patch;patch=1 \
27   \
28   file://sitecustomize.py \
29 "
30
31 SRC_URI_append_opendreambox = " \
32   file://some_configure_fixes.patch;patch=1;pnum=0 \
33   file://strict_aliasing_site.patch;patch=0;pnum=0 \
34   file://fix_pthread_site.patch;patch=0;pnum=0 \
35   file://forced_largefile_support.patch;patch=1;pnum=1"
36
37 S = "${WORKDIR}/Python-${PV}"
38
39 inherit autotools
40
41 EXTRA_OECONF = "--with-threads --with-pymalloc --with-cyclic-gc \
42                 --without-cxx --with-signal-module --with-wctype-functions \
43                 --enable-shared"
44
45 #
46 # copy config.h and an appropriate Makefile for distutils.sysconfig
47 # which laters uses the information out of these to compile extensions
48 #
49 do_compile_prepend() {
50         install -d ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
51         install -d ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
52         install -m 0644 pyconfig.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
53         install -m 0644 Makefile Makefile.orig
54         install -m 0644 Makefile Makefile.backup
55         sed -e 's,${includedir},${STAGING_INCDIR},' < Makefile.backup > Makefile
56         install -m 0644 Makefile Makefile.backup
57         sed -e 's,${libdir},${STAGING_LIBDIR},' < Makefile.backup > Makefile
58         install -m 0644 Makefile ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
59 }
60
61 do_compile() {
62         oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
63                 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
64                 STAGING_LIBDIR=${STAGING_LIBDIR} \
65                 STAGING_INCDIR=${STAGING_INCDIR} \
66                 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
67                 OPT="${CFLAGS}" libpython2.5.so
68
69         oe_libinstall -so libpython2.5 ${STAGING_LIBDIR}
70
71         oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
72                 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
73                 STAGING_LIBDIR=${STAGING_LIBDIR} \
74                 STAGING_INCDIR=${STAGING_INCDIR} \
75                 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
76                 OPT="${CFLAGS}"
77 }
78
79 do_stage() {
80         install -m 0644 Include/*.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
81         oe_libinstall -a -so libpython${PYTHON_MAJMIN} ${STAGING_LIBDIR}
82 }
83
84 do_install() {
85         install -m 0644 Makefile.orig Makefile
86         
87         oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
88                 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
89                 STAGING_LIBDIR=${STAGING_LIBDIR} \
90                 STAGING_INCDIR=${STAGING_INCDIR} \
91                 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
92                 DESTDIR=${D} LIBDIR=${libdir} install
93
94         install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
95
96         # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
97         sed -i -e s,ccache,'$(CCACHE)', ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
98 }
99
100 require python-${PYTHON_MAJMIN}-manifest.inc
101
102 # manual dependency additions
103 RPROVIDES_python-core = "python"
104 RRECOMMENDS_python-core = "python-readline"
105 RRECOMMENDS_python-crypt = "openssl"
106
107 # add sitecustomize
108 FILES_python-core += "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py"
109
110 # package libpython
111 PACKAGES =+ "libpython2"
112 FILES_libpython2 = "${libdir}/libpython*"
113
114 # catch debug extensions
115 FILES_python-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
116
117 # catch all the rest (unsorted)
118 PACKAGES += "python-misc"
119 FILES_python-misc = "${libdir}/python${PYTHON_MAJMIN}"
120
121 # catch manpage
122 PACKAGES += "python-man"
123 FILES_python-man = "${datadir}/man"
124