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;name=archive \
12 file://00-fix-bindir-libdir-for-cross.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://99-ignore-optimization-flag.patch;patch=1 \
20 # not yet pushed forward
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 \
28 file://sitecustomize.py \
30 SRC_URI[archive.md5sum] = "fee5408634a54e721a93531aba37f8c1"
31 SRC_URI[archive.sha256sum] = "dad8d5575144a210d5cc4fdbc40b8a26386e9cdb1ef58941bec0be02c7cb9d89"
33 SRC_URI_append_opendreambox = " \
34 file://some_configure_fixes.patch;patch=1;pnum=0 \
35 file://strict_aliasing_site.patch;patch=0;pnum=0 \
36 file://fix_pthread_site.patch;patch=0;pnum=0 \
37 file://forced_largefile_support.patch;patch=1;pnum=1"
38 SRC_URI_append_vuplus = " \
39 file://some_configure_fixes.patch;patch=1;pnum=0 \
40 file://strict_aliasing_site.patch;patch=0;pnum=0 \
41 file://fix_pthread_site.patch;patch=0;pnum=0 \
42 file://forced_largefile_support.patch;patch=1;pnum=1"
44 S = "${WORKDIR}/Python-${PV}"
48 # The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
49 #Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
50 TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
51 TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
53 do_configure_prepend() {
54 autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || oenote "_ctypes failed to autoreconf"
58 # Copy config.h and an appropriate Makefile for distutils.sysconfig,
59 # which laters uses the information out of these to compile extensions
61 do_compile_prepend() {
62 install -d ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
63 install -d ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
64 install -m 0644 pyconfig.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
65 install -m 0644 Makefile Makefile.orig
66 install -m 0644 Makefile Makefile.backup
67 sed -e 's,${includedir},${STAGING_INCDIR},' < Makefile.backup > Makefile
68 install -m 0644 Makefile Makefile.backup
69 sed -e 's,${libdir},${STAGING_LIBDIR},' < Makefile.backup > Makefile
70 install -m 0644 Makefile ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
74 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
75 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
76 STAGING_LIBDIR=${STAGING_LIBDIR} \
77 STAGING_INCDIR=${STAGING_INCDIR} \
78 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
79 OPT="${CFLAGS}" libpython${PYTHON_MAJMIN}.so
81 oe_libinstall -so libpython${PYTHON_MAJMIN} ${STAGING_LIBDIR}
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 RUNSHARED= OPT="${CFLAGS}"
92 install -m 0644 Include/*.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
93 oe_libinstall -a -so libpython${PYTHON_MAJMIN} ${STAGING_LIBDIR}
97 install -m 0644 Makefile.orig Makefile
99 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
100 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
101 STAGING_LIBDIR=${STAGING_LIBDIR} \
102 STAGING_INCDIR=${STAGING_INCDIR} \
103 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
104 DESTDIR=${D} LIBDIR=${libdir} RUNSHARED= install
106 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
108 # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
109 sed -i -e s,ccache,'$(CCACHE)', ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
112 require python-${PYTHON_MAJMIN}-manifest.inc
114 # manual dependency additions
115 RPROVIDES_python-core = "python"
116 RRECOMMENDS_python-core = "python-readline"
117 RRECOMMENDS_python-crypt = "openssl"
120 FILES_python-core += "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py"
122 FILES_python-core += "${bindir}/2to3"
125 PACKAGES =+ "libpython2"
126 FILES_libpython2 = "${libdir}/libpython*.so*"
128 # additional stuff -dev
132 ${libdir}/lib*${SOLIBSDEV} \
136 ${libdir}/pkgconfig \
140 ${datadir}/pkgconfig \
143 # catch debug extensions (isn't that already in python-core-dbg?)
144 FILES_python-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
146 # catch all the rest (unsorted)
147 PACKAGES += "python-misc"
148 FILES_python-misc = "${libdir}/python${PYTHON_MAJMIN}"
149 RDEPENDS_python-misc += "python-shell"
152 PACKAGES += "python-man"
153 FILES_python-man = "${datadir}/man"