From 9ed4ef038a4a8140accfa97b2eb6b75f8bed3693 Mon Sep 17 00:00:00 2001 From: Alejandro Hernandez Date: Tue, 19 Jan 2016 22:47:49 +0000 Subject: python: Upgrade 2.7.9 > 2.7.11 - no license change, just dates Rebased: - check-if-target-is-64b-not-host.patch - add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch Signed-off-by: Alejandro Hernandez Signed-off-by: Richard Purdie --- meta/conf/distro/include/default-versions.inc | 4 +- .../python/python-native_2.7.11.bb | 63 ++++++++ .../recipes-devtools/python/python-native_2.7.9.bb | 63 -------- meta/recipes-devtools/python/python.inc | 6 +- .../add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch | 13 +- .../python/check-if-target-is-64b-not-host.patch | 16 +- meta/recipes-devtools/python/python_2.7.11.bb | 174 +++++++++++++++++++++ meta/recipes-devtools/python/python_2.7.9.bb | 174 --------------------- 8 files changed, 255 insertions(+), 258 deletions(-) create mode 100644 meta/recipes-devtools/python/python-native_2.7.11.bb delete mode 100644 meta/recipes-devtools/python/python-native_2.7.9.bb create mode 100644 meta/recipes-devtools/python/python_2.7.11.bb delete mode 100644 meta/recipes-devtools/python/python_2.7.9.bb diff --git a/meta/conf/distro/include/default-versions.inc b/meta/conf/distro/include/default-versions.inc index 573063edfb..a04ea718bd 100644 --- a/meta/conf/distro/include/default-versions.inc +++ b/meta/conf/distro/include/default-versions.inc @@ -4,8 +4,8 @@ # Force the python versions in one place PYTHON_BASEVERSION ?= "2.7" -PREFERRED_VERSION_python ?= "2.7.9" -PREFERRED_VERSION_python-native ?= "2.7.9" +PREFERRED_VERSION_python ?= "2.7.11" +PREFERRED_VERSION_python-native ?= "2.7.11" # Force the older version of liberation-fonts until we fix the fontforge issue PREFERRED_VERSION_liberation-fonts ?= "1.04" diff --git a/meta/recipes-devtools/python/python-native_2.7.11.bb b/meta/recipes-devtools/python/python-native_2.7.11.bb new file mode 100644 index 0000000000..34f5c2914e --- /dev/null +++ b/meta/recipes-devtools/python/python-native_2.7.11.bb @@ -0,0 +1,63 @@ +require python.inc + +EXTRANATIVEPATH += "bzip2-native" +DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native" +PR = "${INC_PR}.1" + +SRC_URI += "\ + file://05-enable-ctypes-cross-build.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://builddir.patch \ + file://parallel-makeinst-create-bindir.patch \ + file://revert_use_of_sysconfigdata.patch \ + file://avoid_parallel_make_races_on_pgen.patch \ + " +S = "${WORKDIR}/Python-${PV}" + +FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:" + +inherit native + +RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-codecs-native python-core-native" + +EXTRA_OECONF_append = " --bindir=${bindir}/${PN}" + +EXTRA_OEMAKE = '\ + BUILD_SYS="" \ + HOST_SYS="" \ + LIBC="" \ + STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \ + STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \ +' + +do_configure_append() { + autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi +} + +do_install() { + oe_runmake 'DESTDIR=${D}' install + install -d ${D}${bindir}/${PN} + install -m 0755 Parser/pgen ${D}${bindir}/${PN} + + # Make sure we use /usr/bin/env python + for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do + sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT + done + + # Add a symlink to the native Python so that scripts can just invoke + # "nativepython" and get the right one without needing absolute paths + # (these often end up too long for the #! parser in the kernel as the + # buffer is 128 bytes long). + ln -s python-native/python ${D}${bindir}/nativepython + + # We don't want modules in ~/.local being used in preference to those + # installed in the native sysroot, so disable user site support. + sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py +} diff --git a/meta/recipes-devtools/python/python-native_2.7.9.bb b/meta/recipes-devtools/python/python-native_2.7.9.bb deleted file mode 100644 index 34f5c2914e..0000000000 --- a/meta/recipes-devtools/python/python-native_2.7.9.bb +++ /dev/null @@ -1,63 +0,0 @@ -require python.inc - -EXTRANATIVEPATH += "bzip2-native" -DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native" -PR = "${INC_PR}.1" - -SRC_URI += "\ - file://05-enable-ctypes-cross-build.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://builddir.patch \ - file://parallel-makeinst-create-bindir.patch \ - file://revert_use_of_sysconfigdata.patch \ - file://avoid_parallel_make_races_on_pgen.patch \ - " -S = "${WORKDIR}/Python-${PV}" - -FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:" - -inherit native - -RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-codecs-native python-core-native" - -EXTRA_OECONF_append = " --bindir=${bindir}/${PN}" - -EXTRA_OEMAKE = '\ - BUILD_SYS="" \ - HOST_SYS="" \ - LIBC="" \ - STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \ - STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \ -' - -do_configure_append() { - autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi -} - -do_install() { - oe_runmake 'DESTDIR=${D}' install - install -d ${D}${bindir}/${PN} - install -m 0755 Parser/pgen ${D}${bindir}/${PN} - - # Make sure we use /usr/bin/env python - for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do - sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT - done - - # Add a symlink to the native Python so that scripts can just invoke - # "nativepython" and get the right one without needing absolute paths - # (these often end up too long for the #! parser in the kernel as the - # buffer is 128 bytes long). - ln -s python-native/python ${D}${bindir}/nativepython - - # We don't want modules in ~/.local being used in preference to those - # installed in the native sysroot, so disable user site support. - sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py -} diff --git a/meta/recipes-devtools/python/python.inc b/meta/recipes-devtools/python/python.inc index 878f5826be..52250d27bb 100644 --- a/meta/recipes-devtools/python/python.inc +++ b/meta/recipes-devtools/python/python.inc @@ -5,12 +5,12 @@ SECTION = "devel/python" # bump this on every change in contrib/python/generate-manifest-2.7.py INC_PR = "r1" -LIC_FILES_CHKSUM = "file://LICENSE;md5=dff3d00f049545862992d2d097831a13" +LIC_FILES_CHKSUM = "file://LICENSE;md5=dd98d01d471fac8d8dbdd975229dba03" SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz" -SRC_URI[md5sum] = "38d530f7efc373d64a8fb1637e3baaa7" -SRC_URI[sha256sum] = "90d27e14ea7e03570026850e2e50ba71ad20b7eb31035aada1cf3def8f8d4916" +SRC_URI[md5sum] = "1dbcc848b4cd8399a8199d000f9f823c" +SRC_URI[sha256sum] = "962b4c45af50124ea61f11a30deb4342fc0bc21126790fa1d7f6c79809413f46" # python recipe is actually python 2.x # also, exclude pre-releases for both python 2.x and 3.x diff --git a/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch index 5ba54806eb..a97ff6b250 100644 --- a/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch +++ b/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch @@ -13,19 +13,16 @@ Signed-off-by: Jackie Huang configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/configure.ac b/configure.ac -index 87a4f02..f20cc7b 100644 ---- a/configure.ac -+++ b/configure.ac +Index: Python-2.7.11/configure.ac +=================================================================== +--- Python-2.7.11.orig/configure.ac ++++ Python-2.7.11/configure.ac @@ -33,7 +33,7 @@ if test "$cross_compiling" = yes; then AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found]) fi AC_MSG_RESULT($interp) -- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp +- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp + PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH):$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp fi elif test "$cross_compiling" = maybe; then AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH]) --- -2.5.0 - diff --git a/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch b/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch index 2b62db3826..e6d6c65bbe 100644 --- a/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch +++ b/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch @@ -11,11 +11,11 @@ Signed-off-by: Andrei Gherzan Upstream-Status: Pending -Index: Python-2.7.2/setup.py +Index: Python-2.7.11/setup.py =================================================================== ---- Python-2.7.2.orig/setup.py 2012-03-25 01:10:41.540163187 +0200 -+++ Python-2.7.2/setup.py 2012-03-25 01:26:06.092539990 +0200 -@@ -23,6 +23,21 @@ +--- Python-2.7.11.orig/setup.py ++++ Python-2.7.11/setup.py +@@ -35,6 +35,21 @@ COMPILED_WITH_PYDEBUG = ('--with-pydebug # This global variable is used to hold the list of modules to be disabled. disabled_module_list = [] @@ -37,16 +37,16 @@ Index: Python-2.7.2/setup.py def add_dir_to_list(dirlist, dir): """Add the directory 'dir' to the list 'dirlist' (at the front) if 1) 'dir' is not already in 'dirlist' -@@ -628,7 +643,7 @@ +@@ -716,7 +731,7 @@ class PyBuildExt(build_ext): exts.append( Extension('audioop', ['audioop.c']) ) # Disabled on 64-bit platforms -- if sys.maxint != 9223372036854775807L: +- if sys.maxsize != 9223372036854775807L: + if not target_is_64bit_platform(): # Operations on images exts.append( Extension('imageop', ['imageop.c']) ) else: -@@ -1418,7 +1433,7 @@ +@@ -1545,7 +1560,7 @@ class PyBuildExt(build_ext): missing.append('_codecs_%s' % loc) # Dynamic loading module @@ -54,4 +54,4 @@ Index: Python-2.7.2/setup.py + if not target_is_64bit_platform(): # This requires sizeof(int) == sizeof(long) == sizeof(char*) dl_inc = find_file('dlfcn.h', [], inc_dirs) - if (dl_inc is not None) and (platform not in ['atheos']): + if (dl_inc is not None) and (host_platform not in ['atheos']): diff --git a/meta/recipes-devtools/python/python_2.7.11.bb b/meta/recipes-devtools/python/python_2.7.11.bb new file mode 100644 index 0000000000..0287c191ab --- /dev/null +++ b/meta/recipes-devtools/python/python_2.7.11.bb @@ -0,0 +1,174 @@ +require python.inc +DEPENDS = "python-native libffi bzip2 db gdbm openssl readline sqlite3 zlib" +PR = "${INC_PR}" + +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://06-avoid_usr_lib_termcap_path_in_linking.patch \ + ${DISTRO_SRC_URI} \ + file://multilib.patch \ + file://cgi_py.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_tkinter.patch \ + file://avoid_warning_for_sunos_specific_module.patch \ + file://python-2.7.3-remove-bsdb-rpath.patch \ + file://fix-makefile-for-ptest.patch \ + file://run-ptest \ + file://parallel-makeinst-create-bindir.patch \ + file://use_sysroot_ncurses_instead_of_host.patch \ + file://avoid_parallel_make_races_on_pgen.patch \ + file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \ +" + +S = "${WORKDIR}/Python-${PV}" + +inherit autotools multilib_header python-dir pythonnative + +CONFIGUREOPTS += " --with-system-ffi " + +# 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)} ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no" + +do_configure_append() { + rm -f ${S}/Makefile.orig + autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi +} + +do_compile() { + # regenerate platform specific files, because they depend on system headers + cd ${S}/Lib/plat-linux2 + include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-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 - + + # 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=${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 + # 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}" + export PYTHONBUILDDIR="${B}" + + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-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}" + export PYTHONBUILDDIR="${B}" + + # 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} + + 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} 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 +} + +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' +} + +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 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile + + # Remove references to buildmachine paths in target Makefile and _sysconfigdata + 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 \ + ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py +} + +require python-${PYTHON_MAJMIN}-manifest.inc + +# manual dependency additions +RPROVIDES_${PN}-core = "${PN}" +RRECOMMENDS_${PN}-core = "${PN}-readline" +RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules" +RRECOMMENDS_${PN}-crypt = "openssl" + +# package libpython2 +PACKAGES =+ "lib${BPN}2" +FILES_lib${BPN}2 = "${libdir}/libpython*.so.*" + +# catch all the rest (unsorted) +PACKAGES += "${PN}-misc" +FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" +RDEPENDS_${PN}-modules += "${PN}-misc" +RDEPENDS_${PN}-ptest = "${PN}-modules" +#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten +inherit ptest + +# 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 +} + +# catch manpage +PACKAGES += "${PN}-man" +FILES_${PN}-man = "${datadir}/man" + +BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-devtools/python/python_2.7.9.bb b/meta/recipes-devtools/python/python_2.7.9.bb deleted file mode 100644 index 0287c191ab..0000000000 --- a/meta/recipes-devtools/python/python_2.7.9.bb +++ /dev/null @@ -1,174 +0,0 @@ -require python.inc -DEPENDS = "python-native libffi bzip2 db gdbm openssl readline sqlite3 zlib" -PR = "${INC_PR}" - -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://06-avoid_usr_lib_termcap_path_in_linking.patch \ - ${DISTRO_SRC_URI} \ - file://multilib.patch \ - file://cgi_py.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_tkinter.patch \ - file://avoid_warning_for_sunos_specific_module.patch \ - file://python-2.7.3-remove-bsdb-rpath.patch \ - file://fix-makefile-for-ptest.patch \ - file://run-ptest \ - file://parallel-makeinst-create-bindir.patch \ - file://use_sysroot_ncurses_instead_of_host.patch \ - file://avoid_parallel_make_races_on_pgen.patch \ - file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \ -" - -S = "${WORKDIR}/Python-${PV}" - -inherit autotools multilib_header python-dir pythonnative - -CONFIGUREOPTS += " --with-system-ffi " - -# 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)} ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no" - -do_configure_append() { - rm -f ${S}/Makefile.orig - autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi -} - -do_compile() { - # regenerate platform specific files, because they depend on system headers - cd ${S}/Lib/plat-linux2 - include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-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 - - - # 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=${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 - # 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}" - export PYTHONBUILDDIR="${B}" - - oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ - HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-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}" - export PYTHONBUILDDIR="${B}" - - # 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} - - 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} 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 -} - -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' -} - -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 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile - - # Remove references to buildmachine paths in target Makefile and _sysconfigdata - 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 \ - ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py -} - -require python-${PYTHON_MAJMIN}-manifest.inc - -# manual dependency additions -RPROVIDES_${PN}-core = "${PN}" -RRECOMMENDS_${PN}-core = "${PN}-readline" -RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules" -RRECOMMENDS_${PN}-crypt = "openssl" - -# package libpython2 -PACKAGES =+ "lib${BPN}2" -FILES_lib${BPN}2 = "${libdir}/libpython*.so.*" - -# catch all the rest (unsorted) -PACKAGES += "${PN}-misc" -FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" -RDEPENDS_${PN}-modules += "${PN}-misc" -RDEPENDS_${PN}-ptest = "${PN}-modules" -#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten -inherit ptest - -# 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 -} - -# catch manpage -PACKAGES += "${PN}-man" -FILES_${PN}-man = "${datadir}/man" - -BBCLASSEXTEND = "nativesdk" -- cgit 1.2.3-korg