2009-12-03 12:08:52 +00:00
|
|
|
require python.inc
|
2012-03-12 21:24:10 +00:00
|
|
|
DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib"
|
2012-04-11 10:53:58 +00:00
|
|
|
PR = "${INC_PR}.10"
|
2011-01-19 09:04:43 +00:00
|
|
|
|
|
|
|
DISTRO_SRC_URI ?= "file://sitecustomize.py"
|
2011-04-20 22:53:12 +00:00
|
|
|
DISTRO_SRC_URI_linuxstdbase = ""
|
2011-10-14 07:06:13 +00:00
|
|
|
SRC_URI += "\
|
2010-07-06 12:07:49 +00:00
|
|
|
file://01-use-proper-tools-for-cross-build.patch \
|
|
|
|
file://03-fix-tkinter-detection.patch \
|
|
|
|
file://04-default-is-optimized.patch \
|
|
|
|
file://05-enable-ctypes-cross-build.patch \
|
2011-04-26 19:04:40 +00:00
|
|
|
file://06-ctypes-libffi-fix-configure.patch \
|
2010-10-11 21:33:54 +00:00
|
|
|
file://06-avoid_usr_lib_termcap_path_in_linking.patch \
|
2010-07-06 12:07:49 +00:00
|
|
|
file://99-ignore-optimization-flag.patch \
|
2011-01-19 09:04:43 +00:00
|
|
|
${DISTRO_SRC_URI} \
|
2011-07-11 07:23:17 +00:00
|
|
|
file://multilib.patch \
|
2011-09-22 01:55:33 +00:00
|
|
|
file://cgi_py.patch \
|
2011-09-29 15:54:04 +00:00
|
|
|
file://remove_sqlite_rpath.patch \
|
2011-11-05 01:25:03 +00:00
|
|
|
file://setup_py_skip_cross_import_check.patch \
|
2011-12-28 00:12:01 +00:00
|
|
|
file://add-md5module-support.patch \
|
2012-02-03 20:21:22 +00:00
|
|
|
file://host_include_contamination.patch \
|
2012-03-12 21:24:08 +00:00
|
|
|
file://sys_platform_is_now_always_linux2.patch \
|
2012-03-14 18:06:09 +00:00
|
|
|
file://fix_for_using_different_libdir.patch \
|
2009-12-03 12:08:52 +00:00
|
|
|
"
|
2010-12-08 04:06:29 +00:00
|
|
|
|
2009-12-03 12:08:52 +00:00
|
|
|
S = "${WORKDIR}/Python-${PV}"
|
|
|
|
|
|
|
|
inherit autotools
|
|
|
|
|
|
|
|
# The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
|
|
|
|
#Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
|
|
|
|
TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
|
|
|
|
TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
|
|
|
|
|
|
|
|
do_configure_prepend() {
|
2011-04-29 04:49:31 +00:00
|
|
|
autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf"
|
2009-12-03 12:08:52 +00:00
|
|
|
}
|
|
|
|
|
2011-05-03 16:40:34 +00:00
|
|
|
do_compile() {
|
2012-03-12 21:24:09 +00:00
|
|
|
# regenerate platform specific files, because they depend on system headers
|
|
|
|
cd Lib/plat-linux2
|
|
|
|
include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python \
|
|
|
|
${S}/Tools/scripts/h2py.py -i '(u_long)' \
|
|
|
|
${STAGING_INCDIR}/dlfcn.h \
|
|
|
|
${STAGING_INCDIR}/linux/cdrom.h \
|
|
|
|
${STAGING_INCDIR}/netinet/in.h \
|
|
|
|
${STAGING_INCDIR}/sys/types.h
|
|
|
|
sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
|
|
|
|
cd -
|
|
|
|
|
2011-05-03 16:40:34 +00:00
|
|
|
#
|
|
|
|
# Copy config.h and an appropriate Makefile for distutils.sysconfig,
|
|
|
|
# which laters uses the information out of these to compile extensions
|
|
|
|
#
|
|
|
|
# The following part (until python compilation) should probably moved to an
|
|
|
|
# -initial recipe to handle staging better
|
|
|
|
#
|
2009-12-03 12:08:52 +00:00
|
|
|
install -d ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
|
|
|
|
install -d ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
|
|
|
|
install -m 0644 pyconfig.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
|
2011-05-03 16:40:34 +00:00
|
|
|
|
|
|
|
# remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
|
|
|
|
sed -i -e s,ccache,'$(CCACHE)', Makefile
|
|
|
|
|
2012-04-11 10:53:58 +00:00
|
|
|
# remove any bogus LD_LIBRARY_PATH
|
|
|
|
sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
|
|
|
|
|
2009-12-03 12:08:52 +00:00
|
|
|
install -m 0644 Makefile Makefile.orig
|
2011-05-03 16:40:34 +00:00
|
|
|
sed -i -e 's,${includedir},${STAGING_INCDIR},' Makefile
|
|
|
|
sed -i -e 's,${libdir},${STAGING_LIBDIR},' Makefile
|
2011-10-29 20:10:08 +00:00
|
|
|
sed -i -e 's,LDFLAGS=,LDFLAGS=-L. -L${STAGING_LIBDIR},' Makefile
|
2009-12-03 12:08:52 +00:00
|
|
|
install -m 0644 Makefile ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
|
2011-07-20 18:47:36 +00:00
|
|
|
# save copy of it now, because if we do it in do_install and
|
|
|
|
# then call do_install twice we get Makefile.orig == Makefile.sysroot
|
|
|
|
install -m 0644 Makefile Makefile.sysroot
|
2009-12-03 12:08:52 +00:00
|
|
|
|
2011-11-05 01:25:03 +00:00
|
|
|
export CROSS_COMPILE="${TARGET_PREFIX}"
|
|
|
|
|
2009-12-03 12:08:52 +00:00
|
|
|
oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
|
|
|
|
HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
|
|
|
|
STAGING_LIBDIR=${STAGING_LIBDIR} \
|
|
|
|
STAGING_INCDIR=${STAGING_INCDIR} \
|
|
|
|
BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
|
|
|
|
OPT="${CFLAGS}" libpython${PYTHON_MAJMIN}.so
|
|
|
|
|
|
|
|
oe_libinstall -so libpython${PYTHON_MAJMIN} ${STAGING_LIBDIR}
|
|
|
|
|
|
|
|
oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
|
|
|
|
HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
|
|
|
|
STAGING_LIBDIR=${STAGING_LIBDIR} \
|
|
|
|
STAGING_INCDIR=${STAGING_INCDIR} \
|
|
|
|
BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
|
|
|
|
OPT="${CFLAGS}"
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
2011-05-03 16:40:34 +00:00
|
|
|
# make install needs the original Makefile, or otherwise the inclues would
|
|
|
|
# go to ${D}${STAGING...}/...
|
2009-12-03 12:08:52 +00:00
|
|
|
install -m 0644 Makefile.orig Makefile
|
2011-11-05 01:25:03 +00:00
|
|
|
|
|
|
|
export CROSS_COMPILE="${TARGET_PREFIX}"
|
2009-12-03 12:08:52 +00:00
|
|
|
|
|
|
|
oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \
|
|
|
|
HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \
|
2012-03-14 18:06:09 +00:00
|
|
|
CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
|
2009-12-03 12:08:52 +00:00
|
|
|
STAGING_LIBDIR=${STAGING_LIBDIR} \
|
|
|
|
STAGING_INCDIR=${STAGING_INCDIR} \
|
|
|
|
BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
|
|
|
|
DESTDIR=${D} LIBDIR=${libdir} install
|
|
|
|
|
2011-05-03 16:40:34 +00:00
|
|
|
install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
|
|
|
|
|
2011-01-19 09:04:43 +00:00
|
|
|
if [ -e ${WORKDIR}/sitecustomize.py ]; then
|
|
|
|
install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
|
|
|
|
fi
|
2011-05-03 16:40:34 +00:00
|
|
|
}
|
2009-12-03 12:08:52 +00:00
|
|
|
|
2012-02-23 10:43:40 +00:00
|
|
|
SSTATE_SCAN_FILES += "Makefile"
|
2011-05-03 16:40:34 +00:00
|
|
|
PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
|
|
|
|
|
|
|
|
py_package_preprocess () {
|
|
|
|
# copy back the old Makefile to fix target package
|
2011-05-25 12:40:05 +00:00
|
|
|
install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
|
2009-12-03 12:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
require python-${PYTHON_MAJMIN}-manifest.inc
|
|
|
|
|
|
|
|
# manual dependency additions
|
2010-11-10 13:07:12 +00:00
|
|
|
RPROVIDES_${PN}-core = "${PN}"
|
|
|
|
RRECOMMENDS_${PN}-core = "${PN}-readline"
|
2010-11-02 13:08:49 +00:00
|
|
|
RRECOMMENDS_${PN}-crypt = "openssl"
|
2009-12-03 12:08:52 +00:00
|
|
|
|
|
|
|
# package libpython2
|
2011-08-03 15:19:36 +00:00
|
|
|
PACKAGES =+ "lib${BPN}2"
|
|
|
|
FILES_lib${BPN}2 = "${libdir}/libpython*.so.*"
|
2009-12-03 12:08:52 +00:00
|
|
|
|
|
|
|
# catch debug extensions (isn't that already in python-core-dbg?)
|
2010-11-02 13:08:49 +00:00
|
|
|
FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
|
2009-12-03 12:08:52 +00:00
|
|
|
|
|
|
|
# catch all the rest (unsorted)
|
2010-11-02 13:08:49 +00:00
|
|
|
PACKAGES += "${PN}-misc"
|
|
|
|
FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
|
2009-12-03 12:08:52 +00:00
|
|
|
|
|
|
|
# catch manpage
|
2010-11-02 13:08:49 +00:00
|
|
|
PACKAGES += "${PN}-man"
|
|
|
|
FILES_${PN}-man = "${datadir}/man"
|
|
|
|
|
|
|
|
BBCLASSEXTEND = "nativesdk"
|