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"
|
2013-03-04 04:35:57 +00:00
|
|
|
PR = "${INC_PR}.3"
|
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://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 \
|
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-14 18:06:09 +00:00
|
|
|
file://fix_for_using_different_libdir.patch \
|
2012-04-23 21:46:42 +00:00
|
|
|
file://setuptweaks.patch \
|
2012-04-05 20:54:21 +00:00
|
|
|
file://check-if-target-is-64b-not-host.patch \
|
2012-04-05 20:54:22 +00:00
|
|
|
file://search_db_h_in_inc_dirs_and_avoid_warning.patch \
|
2012-04-05 20:54:24 +00:00
|
|
|
file://avoid_warning_about_tkinter.patch \
|
2012-04-05 20:54:25 +00:00
|
|
|
file://avoid_warning_for_sunos_specific_module.patch \
|
2012-08-04 13:14:08 +00:00
|
|
|
file://python-2.7.3-berkeley-db-5.3.patch \
|
|
|
|
file://python-2.7.3-remove-bsdb-rpath.patch \
|
2012-11-14 14:31:24 +00:00
|
|
|
file://builddir.patch \
|
2013-03-04 04:35:57 +00:00
|
|
|
file://python-2.7.3-CVE-2012-2135.patch \
|
2013-06-13 09:28:28 +00:00
|
|
|
file://gcc-4.8-fix-configure-Wformat.patch \
|
2013-07-19 15:10:59 +00:00
|
|
|
file://fix-makefile-for-ptest.patch \
|
|
|
|
file://run-ptest \
|
2013-08-29 18:54:17 +00:00
|
|
|
file://CVE-2013-4073_py27.patch \
|
|
|
|
file://pypirc-secure.patch \
|
2013-11-25 17:25:24 +00:00
|
|
|
file://parallel-makeinst-create-bindir.patch \
|
2014-02-28 11:53:33 +00:00
|
|
|
file://python-2.7.3-CVE-2013-1752-smtplib-fix.patch \
|
2014-04-03 07:52:22 +00:00
|
|
|
file://python-fix-build-error-with-Readline-6.3.patch \
|
2014-04-07 15:48:11 +00:00
|
|
|
file://python-2.7.3-CVE-2014-1912.patch \
|
2014-07-24 13:51:44 +00:00
|
|
|
file://json-flaw-fix.patch \
|
2014-08-14 09:27:50 +00:00
|
|
|
file://posix_close.patch \
|
2014-10-29 11:16:08 +00:00
|
|
|
file://remove-BOM-insection-code.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}"
|
|
|
|
|
2013-03-10 06:13:58 +00:00
|
|
|
inherit autotools multilib_header python-dir pythonnative
|
2009-12-03 12:08:52 +00:00
|
|
|
|
|
|
|
# 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__"
|
|
|
|
|
2014-10-14 09:20:24 +00:00
|
|
|
# The following is a hack until we drop ac_cv_sizeof_off_t from site files
|
|
|
|
EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'ac_cv_sizeof_off_t=8', '', d)}"
|
|
|
|
|
2009-12-03 12:08:52 +00:00
|
|
|
do_configure_prepend() {
|
2012-04-23 21:46:42 +00:00
|
|
|
rm -f ${S}/Makefile.orig
|
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
|
2012-07-19 17:46:07 +00:00
|
|
|
include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \
|
2012-03-12 21:24:09 +00:00
|
|
|
${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
|
|
|
# remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
|
2013-11-28 08:34:48 +00:00
|
|
|
sed -i -e s,ccache\ ,'$(CCACHE) ', Makefile
|
2011-05-03 16:40:34 +00:00
|
|
|
|
2012-04-11 10:53:58 +00:00
|
|
|
# remove any bogus LD_LIBRARY_PATH
|
|
|
|
sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
|
|
|
|
|
2012-04-23 21:46:42 +00:00
|
|
|
if [ ! -f Makefile.orig ]; then
|
|
|
|
install -m 0644 Makefile Makefile.orig
|
|
|
|
fi
|
2014-09-03 16:42:54 +00:00
|
|
|
sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \
|
2012-04-23 21:46:42 +00:00
|
|
|
-e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
|
|
|
|
-e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
|
|
|
|
-e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
|
|
|
|
-e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
|
|
|
|
-e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
|
|
|
|
-e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
|
|
|
|
Makefile
|
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}"
|
2012-11-14 14:31:24 +00:00
|
|
|
export PYTHONBUILDDIR="${S}"
|
2009-12-03 12:08:52 +00:00
|
|
|
|
2012-07-19 17:46:07 +00:00
|
|
|
oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
|
|
|
|
HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
|
2009-12-03 12:08:52 +00:00
|
|
|
STAGING_LIBDIR=${STAGING_LIBDIR} \
|
|
|
|
STAGING_INCDIR=${STAGING_INCDIR} \
|
2012-04-23 21:46:42 +00:00
|
|
|
STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
|
2009-12-03 12:08:52 +00:00
|
|
|
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}"
|
2012-11-14 14:31:24 +00:00
|
|
|
export PYTHONBUILDDIR="${S}"
|
2013-10-06 08:37:40 +00:00
|
|
|
|
|
|
|
# After swizzling the makefile, we need to run the build again.
|
|
|
|
# install can race with the build so we have to run this first, then install
|
|
|
|
oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
|
|
|
|
HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
|
|
|
|
CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
|
|
|
|
STAGING_LIBDIR=${STAGING_LIBDIR} \
|
|
|
|
STAGING_INCDIR=${STAGING_INCDIR} \
|
|
|
|
STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
|
|
|
|
BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
|
|
|
|
DESTDIR=${D} LIBDIR=${libdir}
|
2009-12-03 12:08:52 +00:00
|
|
|
|
2012-07-19 17:46:07 +00:00
|
|
|
oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
|
|
|
|
HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-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} \
|
2012-04-23 21:46:42 +00:00
|
|
|
STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
|
2009-12-03 12:08:52 +00:00
|
|
|
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
|
2012-04-09 05:01:07 +00:00
|
|
|
|
|
|
|
oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
|
2011-05-03 16:40:34 +00:00
|
|
|
}
|
2009-12-03 12:08:52 +00:00
|
|
|
|
2013-06-17 14:57:49 +00:00
|
|
|
do_install_append_class-nativesdk () {
|
|
|
|
create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
|
|
|
|
}
|
|
|
|
|
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
|
2013-03-19 09:09:38 +00:00
|
|
|
|
|
|
|
# Remove references to buildmachine paths in target Makefile
|
|
|
|
sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g ${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"
|
2012-10-27 08:48:17 +00:00
|
|
|
RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
|
2009-12-03 12:08:52 +00:00
|
|
|
|
|
|
|
# package libpython2
|
2011-12-22 17:43:33 +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}"
|
2013-07-19 15:10:59 +00:00
|
|
|
RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-misc"
|
|
|
|
#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
|
|
|
|
inherit ptest
|
2009-12-03 12:08:52 +00:00
|
|
|
|
2013-11-18 12:54:55 +00:00
|
|
|
# This must come after inherit ptest for the override to take effect
|
|
|
|
do_install_ptest() {
|
|
|
|
cp ${B}/Makefile ${D}${PTEST_PATH}
|
|
|
|
sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \
|
|
|
|
-e s:LIBDIR:${libdir}:g \
|
|
|
|
-i ${D}${PTEST_PATH}/run-ptest
|
|
|
|
}
|
|
|
|
|
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"
|