From 5d92a95ea9b480235b7c9ca5949a681376eba725 Mon Sep 17 00:00:00 2001 From: Nitin A Kamble Date: Tue, 1 May 2012 10:23:29 -0700 Subject: python: upgrade from 2.7.2 to 2.7.3 bin/python2 link is provided by the python install process, so no need to create it. rebase these patches to the newer code: fix_for_using_different_libdir.patch 04-default-is-optimized.patch remove this patch as it is upstream now: sys_platform_is_now_always_linux2.patch Change default python version to 2.7.3 in the distro config Signed-off-by: Nitin A Kamble --- .../recipes-devtools/python/python-native_2.7.2.bb | 48 ------ .../recipes-devtools/python/python-native_2.7.3.bb | 44 ++++++ meta/recipes-devtools/python/python.inc | 8 +- .../python/python/04-default-is-optimized.patch | 30 ++-- .../python/fix_for_using_different_libdir.patch | 30 ++-- .../python/sys_platform_is_now_always_linux2.patch | 39 ----- meta/recipes-devtools/python/python_2.7.2.bb | 170 --------------------- meta/recipes-devtools/python/python_2.7.3.bb | 169 ++++++++++++++++++++ 8 files changed, 252 insertions(+), 286 deletions(-) delete mode 100644 meta/recipes-devtools/python/python-native_2.7.2.bb create mode 100644 meta/recipes-devtools/python/python-native_2.7.3.bb delete mode 100644 meta/recipes-devtools/python/python/sys_platform_is_now_always_linux2.patch delete mode 100644 meta/recipes-devtools/python/python_2.7.2.bb create mode 100644 meta/recipes-devtools/python/python_2.7.3.bb (limited to 'meta/recipes-devtools') diff --git a/meta/recipes-devtools/python/python-native_2.7.2.bb b/meta/recipes-devtools/python/python-native_2.7.2.bb deleted file mode 100644 index 175f31d94..000000000 --- a/meta/recipes-devtools/python/python-native_2.7.2.bb +++ /dev/null @@ -1,48 +0,0 @@ -require python.inc -DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native" -PR = "${INC_PR}.4" - -SRC_URI += "file://04-default-is-optimized.patch \ - file://05-enable-ctypes-cross-build.patch \ - file://06-ctypes-libffi-fix-configure.patch \ - file://10-distutils-fix-swig-parameter.patch \ - file://11-distutils-never-modify-shebang-line.patch \ - file://12-distutils-prefix-is-inside-staging-area.patch \ - file://debug.patch \ - file://unixccompiler.patch \ - file://nohostlibs.patch \ - file://multilib.patch \ - file://add-md5module-support.patch \ - file://sys_platform_is_now_always_linux2.patch \ - " -S = "${WORKDIR}/Python-${PV}" - -inherit native - -RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-core-native" - -EXTRA_OEMAKE = '\ - BUILD_SYS="" \ - HOST_SYS="" \ - LIBC="" \ - STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \ - STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \ -' - -do_configure_prepend() { - autoreconf --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" -} - -do_install() { - oe_runmake 'DESTDIR=${D}' install - install -d ${D}${bindir}/ - install -m 0755 Parser/pgen ${D}${bindir}/ - - # Make sure we use /usr/bin/env python - for PYTHSCRIPT in `grep -rIl ${bindir}/python ${D}${bindir}`; do - sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT - done - - ln -sf python ${D}${bindir}/python2 - -} diff --git a/meta/recipes-devtools/python/python-native_2.7.3.bb b/meta/recipes-devtools/python/python-native_2.7.3.bb new file mode 100644 index 000000000..50bf894d0 --- /dev/null +++ b/meta/recipes-devtools/python/python-native_2.7.3.bb @@ -0,0 +1,44 @@ +require python.inc +DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native" +PR = "${INC_PR}.0" + +SRC_URI += "file://04-default-is-optimized.patch \ + file://05-enable-ctypes-cross-build.patch \ + file://06-ctypes-libffi-fix-configure.patch \ + file://10-distutils-fix-swig-parameter.patch \ + file://11-distutils-never-modify-shebang-line.patch \ + file://12-distutils-prefix-is-inside-staging-area.patch \ + file://debug.patch \ + file://unixccompiler.patch \ + file://nohostlibs.patch \ + file://multilib.patch \ + file://add-md5module-support.patch \ + " +S = "${WORKDIR}/Python-${PV}" + +inherit native + +RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-core-native" + +EXTRA_OEMAKE = '\ + BUILD_SYS="" \ + HOST_SYS="" \ + LIBC="" \ + STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \ + STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \ +' + +do_configure_prepend() { + autoreconf --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" +} + +do_install() { + oe_runmake 'DESTDIR=${D}' install + install -d ${D}${bindir}/ + install -m 0755 Parser/pgen ${D}${bindir}/ + + # Make sure we use /usr/bin/env python + for PYTHSCRIPT in `grep -rIl ${bindir}/python ${D}${bindir}`; do + sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT + done +} diff --git a/meta/recipes-devtools/python/python.inc b/meta/recipes-devtools/python/python.inc index 2f17b00c2..eee7a6437 100644 --- a/meta/recipes-devtools/python/python.inc +++ b/meta/recipes-devtools/python/python.inc @@ -3,14 +3,14 @@ HOMEPAGE = "http://www.python.org" LICENSE = "PSFv2" SECTION = "devel/python" # bump this on every change in contrib/python/generate-manifest-2.7.py -INC_PR = "r2" +INC_PR = "r0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=2dffb81509b47974467ea23409909b1c" +LIC_FILES_CHKSUM = "file://LICENSE;md5=ed3abfd1059e2d3a36a8cff3986f9bb6" SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2" -SRC_URI[md5sum] = "ba7b2f11ffdbf195ee0d111b9455a5bd" -SRC_URI[sha256sum] = "5057eb067eb5b5a6040dbd0e889e06550bde9ec041dadaa855ee9490034cbdab" +SRC_URI[md5sum] = "c57477edd6d18bd9eeca2f21add73919" +SRC_URI[sha256sum] = "726457e11cb153adc3f428aaf1901fc561a374c30e5e7da6742c0742a338663c" PYTHON_MAJMIN = "2.7" diff --git a/meta/recipes-devtools/python/python/04-default-is-optimized.patch b/meta/recipes-devtools/python/python/04-default-is-optimized.patch index 042ac5e46..7ce819a3c 100644 --- a/meta/recipes-devtools/python/python/04-default-is-optimized.patch +++ b/meta/recipes-devtools/python/python/04-default-is-optimized.patch @@ -1,14 +1,20 @@ Upstream-Status: Inappropriate [embedded specific] +Updated original patch for python 2.7.3 + +Signed-Off-By: Nitin A Kamble +2012/05/01 + + # when compiling for an embedded system, we need every bit of # performance we can get. default to optimized with the option # of opt-out. # Signed-Off: Michael 'Mickey' Lauer -Index: Python-2.6.6/Python/compile.c +Index: Python-2.7.3/Python/compile.c =================================================================== ---- Python-2.6.6.orig/Python/compile.c -+++ Python-2.6.6/Python/compile.c +--- Python-2.7.3.orig/Python/compile.c ++++ Python-2.7.3/Python/compile.c @@ -32,7 +32,7 @@ #include "symtable.h" #include "opcode.h" @@ -18,16 +24,16 @@ Index: Python-2.6.6/Python/compile.c #define DEFAULT_BLOCK_SIZE 16 #define DEFAULT_BLOCKS 8 -Index: Python-2.6.6/Modules/main.c +Index: Python-2.7.3/Modules/main.c =================================================================== ---- Python-2.6.6.orig/Modules/main.c -+++ Python-2.6.6/Modules/main.c +--- Python-2.7.3.orig/Modules/main.c ++++ Python-2.7.3/Modules/main.c @@ -40,7 +40,7 @@ static char **orig_argv; static int orig_argc; /* command line options */ --#define BASE_OPTS "3bBc:dEhiJm:OQ:sStuUvVW:xX?" -+#define BASE_OPTS "3bBc:dEhiJm:NOQ:sStuUvVW:xX?" +-#define BASE_OPTS "3bBc:dEhiJm:OQ:RsStuUvVW:xX?" ++#define BASE_OPTS "3bBc:dEhiJm:NOQ:RsStuUvVW:xX?" #ifndef RISCOS #define PROGRAM_OPTS BASE_OPTS @@ -38,10 +44,10 @@ Index: Python-2.6.6/Modules/main.c --O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\ --OO : remove doc-strings in addition to the -O optimizations\n\ +-N : do NOT optimize generated bytecode\n\ - -Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n\ - -s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\ - -S : don't imply 'import site' on initialization\n\ -@@ -328,8 +327,8 @@ Py_Main(int argc, char **argv) + -R : use a pseudo-random salt to make hash() values of various types be\n\ + unpredictable between separate invocations of the interpreter, as\n\ + a defense against denial-of-service attacks\n\ +@@ -365,8 +364,8 @@ Py_Main(int argc, char **argv) /* case 'J': reserved for Jython */ diff --git a/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch b/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch index e8f19a24d..50d391542 100644 --- a/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch +++ b/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch @@ -7,10 +7,14 @@ in the install process of the host python. Signed-Off-By: Nitin A Kamble Date: 2012/03/14 -Index: Python-2.7.2/Lib/sysconfig.py +Updated for python 2.7.3 +Signed-Off-By: Nitin A Kamble +Date: 2012/05/01 + +Index: Python-2.7.3/Lib/sysconfig.py =================================================================== ---- Python-2.7.2.orig/Lib/sysconfig.py -+++ Python-2.7.2/Lib/sysconfig.py +--- Python-2.7.3.orig/Lib/sysconfig.py ++++ Python-2.7.3/Lib/sysconfig.py @@ -7,10 +7,10 @@ from os.path import pardir, realpath _INSTALL_SCHEMES = { @@ -41,14 +45,14 @@ Index: Python-2.7.2/Lib/sysconfig.py 'include': '{userbase}/include/python{py_version_short}', 'scripts': '{userbase}/bin', 'data' : '{userbase}', -Index: Python-2.7.2/Makefile.pre.in +Index: Python-2.7.3/Makefile.pre.in =================================================================== ---- Python-2.7.2.orig/Makefile.pre.in -+++ Python-2.7.2/Makefile.pre.in -@@ -928,25 +928,25 @@ libinstall: build_all $(srcdir)/Lib/$(PL - done; \ - done - $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt +--- Python-2.7.3.orig/Makefile.pre.in ++++ Python-2.7.3/Makefile.pre.in +@@ -941,25 +941,25 @@ libinstall: build_all $(srcdir)/Lib/$(PL + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ @@ -56,7 +60,7 @@ Index: Python-2.7.2/Makefile.pre.in -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ $(DESTDIR)$(LIBDEST) - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -+ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ ++ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST) -f \ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ @@ -67,12 +71,12 @@ Index: Python-2.7.2/Makefile.pre.in -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -+ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -+ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ ++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \ $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" # Create the PLATDIR source directory, if one wasn't distributed.. diff --git a/meta/recipes-devtools/python/python/sys_platform_is_now_always_linux2.patch b/meta/recipes-devtools/python/python/sys_platform_is_now_always_linux2.patch deleted file mode 100644 index ed529366c..000000000 --- a/meta/recipes-devtools/python/python/sys_platform_is_now_always_linux2.patch +++ /dev/null @@ -1,39 +0,0 @@ -Upstream-Status: Accepted [http://hg.python.org/cpython/rev/c816479f6aaf/] -Bugtracker: http://bugs.python.org/issue12326 - -[Removed "Misc/NEWS" hunk] - -Signed-off-by: Andreas Oberritter - -# HG changeset patch -# User Victor Stinner -# Date 1313841758 -7200 -# Node ID c816479f6aaf71dbd3f3fe4b239186d60c55ce48 -# Parent 3e093590ac57fdda428c7da3f72ddf0c475ecf2b -Issue #12326: sys.platform is now always 'linux2' on Linux - -Even if Python is compiled on Linux 3. - -diff --git a/configure b/configure ---- a/configure -+++ b/configure -@@ -2995,6 +2995,7 @@ then - MACHDEP="$ac_md_system$ac_md_release" - - case $MACHDEP in -+ linux*) MACHDEP="linux2";; - cygwin*) MACHDEP="cygwin";; - darwin*) MACHDEP="darwin";; - atheos*) MACHDEP="atheos";; -diff --git a/configure.in b/configure.in ---- a/configure.in -+++ b/configure.in -@@ -293,6 +293,7 @@ then - MACHDEP="$ac_md_system$ac_md_release" - - case $MACHDEP in -+ linux*) MACHDEP="linux2";; - cygwin*) MACHDEP="cygwin";; - darwin*) MACHDEP="darwin";; - atheos*) MACHDEP="atheos";; - diff --git a/meta/recipes-devtools/python/python_2.7.2.bb b/meta/recipes-devtools/python/python_2.7.2.bb deleted file mode 100644 index bd5c1ffde..000000000 --- a/meta/recipes-devtools/python/python_2.7.2.bb +++ /dev/null @@ -1,170 +0,0 @@ -require python.inc -DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" -PR = "${INC_PR}.20" - -DISTRO_SRC_URI ?= "file://sitecustomize.py" -DISTRO_SRC_URI_linuxstdbase = "" -SRC_URI += "\ - 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 \ - file://06-ctypes-libffi-fix-configure.patch \ - file://06-avoid_usr_lib_termcap_path_in_linking.patch \ - file://99-ignore-optimization-flag.patch \ - ${DISTRO_SRC_URI} \ - file://multilib.patch \ - file://cgi_py.patch \ - file://remove_sqlite_rpath.patch \ - file://setup_py_skip_cross_import_check.patch \ - file://add-md5module-support.patch \ - file://host_include_contamination.patch \ - file://sys_platform_is_now_always_linux2.patch \ - file://fix_for_using_different_libdir.patch \ - file://setuptweaks.patch \ - file://check-if-target-is-64b-not-host.patch \ - file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ - file://avoid_warning_about_bsddb.patch \ - file://avoid_warning_about_tkinter.patch \ - file://avoid_warning_for_sunos_specific_module.patch \ -" - -S = "${WORKDIR}/Python-${PV}" - -inherit autotools multilib_header - -# 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() { - rm -f ${S}/Makefile.orig - autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" -} - -do_compile() { - # 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 - - - # - # 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 - # - 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}/ - - # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144 - sed -i -e s,ccache,'$(CCACHE)', Makefile - - # remove any bogus LD_LIBRARY_PATH - sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile - - if [ ! -f Makefile.orig ]; then - install -m 0644 Makefile Makefile.orig - fi - sed -i -e 's,^LDFLAGS=.*,LDFLAGS=-L. -L${STAGING_LIBDIR},g' \ - -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 - install -m 0644 Makefile ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/ - # 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 - - export CROSS_COMPILE="${TARGET_PREFIX}" - - oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ - HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ - STAGING_LIBDIR=${STAGING_LIBDIR} \ - STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ - 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} \ - STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ - BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ - OPT="${CFLAGS}" -} - -do_install() { - # make install needs the original Makefile, or otherwise the inclues would - # go to ${D}${STAGING...}/... - install -m 0644 Makefile.orig Makefile - - export CROSS_COMPILE="${TARGET_PREFIX}" - - oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ - HOSTPYTHON=${STAGING_BINDIR_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} install - - install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile - - if [ -e ${WORKDIR}/sitecustomize.py ]; then - install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} - fi - - oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h -} - -SSTATE_SCAN_FILES += "Makefile" -PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" - -py_package_preprocess () { - # copy back the old Makefile to fix target package - install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile -} - -require python-${PYTHON_MAJMIN}-manifest.inc - -# manual dependency additions -RPROVIDES_${PN}-core = "${PN}" -RRECOMMENDS_${PN}-core = "${PN}-readline" -RRECOMMENDS_${PN}-crypt = "openssl" - -# package libpython2 -PACKAGES =+ "lib${BPN}2${PKGSUFFIX}" -FILES_lib${BPN}2${PKGSUFFIX} = "${libdir}/libpython*.so.*" - -# catch debug extensions (isn't that already in python-core-dbg?) -FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug" - -# catch all the rest (unsorted) -PACKAGES += "${PN}-misc" -FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" - -# catch manpage -PACKAGES += "${PN}-man" -FILES_${PN}-man = "${datadir}/man" - -BBCLASSEXTEND = "nativesdk" - -PKGSUFFIX = "" -PKGSUFFIX_virtclass-nativesdk = "-nativesdk" diff --git a/meta/recipes-devtools/python/python_2.7.3.bb b/meta/recipes-devtools/python/python_2.7.3.bb new file mode 100644 index 000000000..b06d7b7f9 --- /dev/null +++ b/meta/recipes-devtools/python/python_2.7.3.bb @@ -0,0 +1,169 @@ +require python.inc +DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" +PR = "${INC_PR}.0" + +DISTRO_SRC_URI ?= "file://sitecustomize.py" +DISTRO_SRC_URI_linuxstdbase = "" +SRC_URI += "\ + 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 \ + file://06-ctypes-libffi-fix-configure.patch \ + file://06-avoid_usr_lib_termcap_path_in_linking.patch \ + file://99-ignore-optimization-flag.patch \ + ${DISTRO_SRC_URI} \ + file://multilib.patch \ + file://cgi_py.patch \ + file://remove_sqlite_rpath.patch \ + file://setup_py_skip_cross_import_check.patch \ + file://add-md5module-support.patch \ + file://host_include_contamination.patch \ + file://fix_for_using_different_libdir.patch \ + file://setuptweaks.patch \ + file://check-if-target-is-64b-not-host.patch \ + file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ + file://avoid_warning_about_bsddb.patch \ + file://avoid_warning_about_tkinter.patch \ + file://avoid_warning_for_sunos_specific_module.patch \ +" + +S = "${WORKDIR}/Python-${PV}" + +inherit autotools multilib_header + +# 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() { + rm -f ${S}/Makefile.orig + autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf" +} + +do_compile() { + # 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 - + + # + # 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 + # + 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}/ + + # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144 + sed -i -e s,ccache,'$(CCACHE)', Makefile + + # remove any bogus LD_LIBRARY_PATH + sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile + + if [ ! -f Makefile.orig ]; then + install -m 0644 Makefile Makefile.orig + fi + sed -i -e 's,^LDFLAGS=.*,LDFLAGS=-L. -L${STAGING_LIBDIR},g' \ + -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 + install -m 0644 Makefile ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/ + # 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 + + export CROSS_COMPILE="${TARGET_PREFIX}" + + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ + 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} \ + STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ + BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + OPT="${CFLAGS}" +} + +do_install() { + # make install needs the original Makefile, or otherwise the inclues would + # go to ${D}${STAGING...}/... + install -m 0644 Makefile.orig Makefile + + export CROSS_COMPILE="${TARGET_PREFIX}" + + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ + HOSTPYTHON=${STAGING_BINDIR_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} install + + install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile + + if [ -e ${WORKDIR}/sitecustomize.py ]; then + install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} + fi + + oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h +} + +SSTATE_SCAN_FILES += "Makefile" +PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" + +py_package_preprocess () { + # copy back the old Makefile to fix target package + install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile +} + +require python-${PYTHON_MAJMIN}-manifest.inc + +# manual dependency additions +RPROVIDES_${PN}-core = "${PN}" +RRECOMMENDS_${PN}-core = "${PN}-readline" +RRECOMMENDS_${PN}-crypt = "openssl" + +# package libpython2 +PACKAGES =+ "lib${BPN}2${PKGSUFFIX}" +FILES_lib${BPN}2${PKGSUFFIX} = "${libdir}/libpython*.so.*" + +# catch debug extensions (isn't that already in python-core-dbg?) +FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug" + +# catch all the rest (unsorted) +PACKAGES += "${PN}-misc" +FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" + +# catch manpage +PACKAGES += "${PN}-man" +FILES_${PN}-man = "${datadir}/man" + +BBCLASSEXTEND = "nativesdk" + +PKGSUFFIX = "" +PKGSUFFIX_virtclass-nativesdk = "-nativesdk" -- cgit v1.2.3