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 DEPENDS_opendreambox = "python-native db gdbm openssl readline sqlite3 zlib"
6 DEPENDS_vuplus = "python-native db gdbm openssl readline sqlite3 zlib"
7 # set to .0 on every increase of INC_PR
11 http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
12 file://00-fix-parallel-make.patch;patch=1 \
13 file://01-use-proper-tools-for-cross-build.patch;patch=1 \
14 file://02-remove-test-for-cross.patch;patch=1 \
15 file://03-fix-tkinter-detection.patch;patch=1 \
16 file://04-default-is-optimized.patch;patch=1 \
17 file://05-enable-ctypes-cross-build.patch;patch=1 \
18 file://06-ctypes-libffi-fix-configure.patch;patch=1 \
19 file://ipv6-cross.patch;patch=1 \
20 file://python-module-rpath-fix.patch;patch=1 \
21 file://sitecustomize.py \
24 SRC_URI_append_opendreambox = " \
25 file://some_configure_fixes.patch;patch=1;pnum=0 \
26 file://strict_aliasing_site.patch;patch=0;pnum=0 \
27 file://fix_pthread_site.patch;patch=0;pnum=0 \
28 file://forced_largefile_support.patch;patch=1;pnum=1"
29 SRC_URI_append_vuplus = " \
30 file://some_configure_fixes.patch;patch=1;pnum=0 \
31 file://strict_aliasing_site.patch;patch=0;pnum=0 \
32 file://fix_pthread_site.patch;patch=0;pnum=0 \
33 file://forced_largefile_support.patch;patch=1;pnum=1"
35 S = "${WORKDIR}/Python-${PV}"
39 # The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
40 #Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
41 TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
42 TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
44 do_configure_prepend() {
45 rm -R ${S}/Lib/plat-linux3 || /bin/true
46 ln -sf ${S}/Lib/plat-linux2 ${S}/Lib/plat-linux3
47 autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || oenote "_ctypes failed to autoreconf"
51 # Copy config.h and an appropriate Makefile for distutils.sysconfig,
52 # which laters uses the information out of these to compile extensions
54 do_compile_prepend() {
55 install -d ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
56 install -d ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
57 install -m 0644 pyconfig.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
58 install -m 0644 Makefile Makefile.orig
59 install -m 0644 Makefile Makefile.backup
60 sed -e 's,${includedir},${STAGING_INCDIR},' < Makefile.backup > Makefile
61 install -m 0644 Makefile Makefile.backup
62 sed -e 's,${libdir},${STAGING_LIBDIR},' < Makefile.backup > Makefile
63 install -m 0644 Makefile ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
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 OPT="${CFLAGS}" libpython${PYTHON_MAJMIN}.so
74 oe_libinstall -so libpython${PYTHON_MAJMIN} ${STAGING_LIBDIR}
76 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
77 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
78 STAGING_LIBDIR=${STAGING_LIBDIR} \
79 STAGING_INCDIR=${STAGING_INCDIR} \
80 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
81 RUNSHARED= OPT="${CFLAGS}"
85 install -m 0644 Include/*.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
86 oe_libinstall -a -so libpython${PYTHON_MAJMIN} ${STAGING_LIBDIR}
90 install -m 0644 Makefile.orig Makefile
92 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
93 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
94 STAGING_LIBDIR=${STAGING_LIBDIR} \
95 STAGING_INCDIR=${STAGING_INCDIR} \
96 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
97 DESTDIR=${D} LIBDIR=${libdir} RUNSHARED= install
99 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
101 # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
102 sed -i -e s,ccache,'$(CCACHE)', ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
105 do_install_append() {
106 # remove unecessary files from python-distutils' packages
107 rm ${D}/${libdir}/python${PYTHON_MAJMIN}/config/libpython2.6.a
108 rm ${D}/${libdir}/python${PYTHON_MAJMIN}/distutils/command/win*
111 require python-${PYTHON_MAJMIN}-manifest.inc
113 # manual dependency additions
114 RPROVIDES_python-core = "python"
115 RRECOMMENDS_python-core = "python-readline"
116 RRECOMMENDS_python-crypt = "openssl"
119 FILES_python-core += "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py"
121 FILES_python-core += "${bindir}/2to3"
124 PACKAGES =+ "libpython2"
125 FILES_libpython2 = "${libdir}/libpython*.so*"
127 # additional stuff -dev
131 ${libdir}/lib*${SOLIBSDEV} \
135 ${libdir}/pkgconfig \
139 ${datadir}/pkgconfig \
142 # catch debug extensions (isn't that already in python-core-dbg?)
143 FILES_python-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
145 # catch all the rest (unsorted)
146 PACKAGES += "python-misc"
147 FILES_python-misc = "${libdir}/python${PYTHON_MAJMIN}"
148 RDEPENDS_python-misc += "python-shell"
151 PACKAGES += "python-man"
152 FILES_python-man = "${datadir}/man"