aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven 'sleipnir' Rebhan <odinshorse@googlemail.com>2009-04-19 20:57:24 +0000
committerSven 'sleipnir' Rebhan <odinshorse@googlemail.com>2009-04-19 20:57:24 +0000
commit7ae3df84091539a89d39925507e240fd86701b03 (patch)
treece76a7cbf10cf5cab89762d0e9c02b49b3174848 /dev-lang
parentactually remove older version (diff)
downloadembedded-cross-7ae3df84091539a89d39925507e240fd86701b03.tar.gz
embedded-cross-7ae3df84091539a89d39925507e240fd86701b03.tar.bz2
embedded-cross-7ae3df84091539a89d39925507e240fd86701b03.zip
Bump python version. Please test!
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/python/Manifest6
-rw-r--r--dev-lang/python/files/python-2.5.4-cross-Makefile.pre.in.patch10
-rw-r--r--dev-lang/python/files/python-2.5.4-enable-ctypes-module.patch94
-rw-r--r--dev-lang/python/python-2.5.4-r2.ebuild354
4 files changed, 464 insertions, 0 deletions
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index ca65418..4e38e3e 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -1,3 +1,4 @@
+AUX #python-2.5.2-cross-enable-ctypes-module.patch# 3831 RMD160 b852b8d384a80c3b0f9c8055f7713ed45cd51c48 SHA1 1461530408c7f92b3dc7a3170b498cdaebdb5dcc SHA256 b05ec41f247cf19752357443390245f6cfa80cbff5771355eb9239ac41e224d0
AUX pydoc.conf 330 RMD160 0cd619ec251597e0fcadc05bfd249915e73baa17 SHA1 a56100d45378c554b9822f6ed512a6cb7841ef50 SHA256 a45ebba2de5f2b0e963db4101507203d095c5ff667ae5002c4897a9c87786fa1
AUX pydoc.init 666 RMD160 11caf3a78bce4cdaebacaf21eaf26cc1ce30282e SHA1 88c5cb6d5bf737c74e1be93118cf157630af9ad7 SHA256 0d25c71232b74adb87dc709cc7cd8f8b13c452c0fe82fa33808f907f7a96d628
AUX python-2.4.4-test-cross.patch 977 RMD160 8fdcd45dc202993988f7a1c2b3d918068883b99e SHA1 96f25777150ba05765282a43f08da6b6fab3cb73 SHA256 ff2a131776d560d188ec5069e17fea3eb09c26fdd02124ae5ff34d791c9fd9f6
@@ -11,6 +12,11 @@ AUX python-2.5.2-cross-distutils-sysconfig.patch 2211 RMD160 9269c1897ebd6f83691
AUX python-2.5.2-cross-enable-ctypes-module.patch 3830 RMD160 52e92eae2ba60d67efb0494f9c4b47544991dcbb SHA1 c77c0c2db298619b2d4f57dc28609d4b1586565b SHA256 028c3ed4bf841fd19641e2c1af0dce68626aeb26168a97acabbba48aa1085cb6
AUX python-2.5.2-cross-setup-sysroot.patch 11356 RMD160 4d19bfc67e298a6b9b24adfcc367b72194c21985 SHA1 b628aaaa61bcc48efe25e9d2ca274f5ea8532c82 SHA256 a395d40f79a1f5188de031ec239283b637d68791a59c4870b8dd2ae914303b55
AUX python-2.5.2_turkish.patch 4882 RMD160 69486e369849e0706f4261410f231649397cf793 SHA1 1dc369bdfb10bc9ddb63a5672fa561acf8dee32c SHA256 bf4019ae2acd4b6868db0b625910f668f857711ae00b29f638d038611444b169
+AUX python-2.5.4-cross-Makefile.pre.in.patch 349 RMD160 c46f87b9b232e1d2f55a60e2558edcb2fa0efd50 SHA1 04e915c1e29c8e15f48a240853af1ee6c9210674 SHA256 a0b6313dcd6aeed2cb1b82353a2e339fe79cd9b861811cb67e90739ec84deec7
+AUX python-2.5.4-enable-ctypes-module.patch 3034 RMD160 6374bbd2ad13e180324aa5d97ff42ab52a3d3118 SHA1 77b2d479d0ba37cec4d71c29c8d6ffe651a15765 SHA256 4f3ba96b5a5986adbffc8385299780b2a2b3aa7b6875c2c46d16a50bba258516
DIST Python-2.5.2.tar.bz2 9807597 RMD160 b23b02739833e6730799c5866e2b77aae884b63f SHA1 4755d212f50af704c20224a6966e23acc5aea60f SHA256 f2f80e2a62a039e9a1ffa0fdf58707b2d12b3ff33c56472b46bb6d53f45e083e
+DIST Python-2.5.4.tar.bz2 9821313 RMD160 3a76c83464c3b1c38a60351ab054e33ac7195663 SHA1 0f2e819d6381f72f26c734e00a6780b3933ea404 SHA256 bc8d896a2bfe5523ba93b8d89b71017b74e8e6cb21dc676a0ccff668c8780110
DIST python-gentoo-patches-2.5.2-r8.tar.bz2 28376 RMD160 c4e02a5ed947b253781ec11fd9f5f26498e41c81 SHA1 92e359402e7b6751b28671e19ad7ea0736b62614 SHA256 c008abb01c40057facf3d7fa8ad3a31e792f1b7d41bba96e0084e7476e05a0e3
+DIST python-gentoo-patches-2.5.4.tar.bz2 19474 RMD160 00bb0918414db251b11b7f19a9f8a112c9e49fbd SHA1 fd4955f7da3049abecc4df0e203e783a90390cf8 SHA256 6e050dd8e8a90655bf935af99ad1ae6456bc072f075ddb9bcd532201bbb37274
EBUILD python-2.5.2-r8.ebuild 11808 RMD160 23d50c9937fea1a4ad4856f7ce73c2a43c4be438 SHA1 050e8e2d9273423b3a3bcd8622edc65f0dbac9d6 SHA256 46e67fe27ebfd8cea8c64c40f71d15138c49bf793a2bcf624896aa04b8ea18e9
+EBUILD python-2.5.4-r2.ebuild 11460 RMD160 726938ef8be895f9494b31e419e6a808f917f275 SHA1 2cf8c2fe0d52b60a844e149a63e49fe15574fb24 SHA256 62171b21b92edabeb9c27959310196253c2bcb83df6896a444dbb5a1c70b4db7
diff --git a/dev-lang/python/files/python-2.5.4-cross-Makefile.pre.in.patch b/dev-lang/python/files/python-2.5.4-cross-Makefile.pre.in.patch
new file mode 100644
index 0000000..1be9bf1
--- /dev/null
+++ b/dev-lang/python/files/python-2.5.4-cross-Makefile.pre.in.patch
@@ -0,0 +1,10 @@
+--- Makefile.pre.in 2009-03-06 18:39:38.000000000 +0000
++++ Makefile.pre.in.new 2009-03-06 18:40:08.000000000 +0000
+@@ -93,6 +93,7 @@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+ SCRIPTDIR= $(prefix)/@@GENTOO_LIBDIR@@
++LIBDIRNAME= @@GENTOO_LIBDIR@@
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
diff --git a/dev-lang/python/files/python-2.5.4-enable-ctypes-module.patch b/dev-lang/python/files/python-2.5.4-enable-ctypes-module.patch
new file mode 100644
index 0000000..e4355f0
--- /dev/null
+++ b/dev-lang/python/files/python-2.5.4-enable-ctypes-module.patch
@@ -0,0 +1,94 @@
+This patch was taken from gitweb.openembedded.org (Author: Michael 'mickey' Lauer) and
+enables the cross compilation of the ctypes module.
+
+--- setup.py 2006-08-10 01:42:18.000000000 +0200
++++ setup.py.new 2007-11-21 18:00:43.000000000 +0100
+@@ -1321,16 +1329,16 @@
+ ffi_configfile):
+ from distutils.dir_util import mkpath
+ mkpath(ffi_builddir)
+- config_args = []
++ config_args = ['--host=%s' % os.environ["CHOST"], ]
+
+ # Pass empty CFLAGS because we'll just append the resulting
+ # CFLAGS to Python's; -g or -O2 is to be avoided.
+- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
+- % (ffi_builddir, ffi_srcdir, " ".join(config_args))
++ cmd = "(cd %s && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \
++ % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args))
+
+ res = os.system(cmd)
+ if res or not os.path.exists(ffi_configfile):
+- print "Failed to configure _ctypes module"
++ print "Failed to configure _ctypes module, ret %d or missing %s"% (res, ffi_configfile, )
+ return False
+
+ fficonfig = {}
+--- Modules/_ctypes/malloc_closure.c 2006-06-12 22:56:48.000000000 +0200
++++ Modules/_ctypes/malloc_closure.c.new 2007-11-22 10:30:17.000000000 +0100
+@@ -27,7 +27,9 @@
+ /******************************************************************/
+
+ typedef union _tagITEM {
++#if FFI_CLOSURES
+ ffi_closure closure;
++#endif
+ union _tagITEM *next;
+ } ITEM;
+
+--- Modules/_ctypes/callbacks.c 2008-04-25 19:55:19.000000000 +0000
++++ Modules/_ctypes/callbacks.c.new 2009-04-19 18:22:59.000000000 +0000
+@@ -20,8 +20,10 @@
+ Py_XDECREF(self->converters);
+ Py_XDECREF(self->callable);
+ Py_XDECREF(self->restype);
++#if FFI_CLOSURES
+ if (self->pcl)
+ FreeClosure(self->pcl);
++#endif
+ PyObject_Del(self);
+ }
+
+@@ -365,12 +367,13 @@
+
+ assert(CThunk_CheckExact(p));
+
++#if FFI_CLOSURES
+ p->pcl = MallocClosure();
+ if (p->pcl == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+-
++#endif
+ for (i = 0; i < nArgs; ++i) {
+ PyObject *cnv = PySequence_GetItem(converters, i);
+ if (cnv == NULL)
+@@ -409,13 +412,14 @@
+ "ffi_prep_cif failed with %d", result);
+ goto error;
+ }
++#if FFI_CLOSURES
+ result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p);
+ if (result != FFI_OK) {
+ PyErr_Format(PyExc_RuntimeError,
+ "ffi_prep_closure failed with %d", result);
+ goto error;
+ }
+-
++#endif
+ Py_INCREF(converters);
+ p->converters = converters;
+ Py_INCREF(callable);
+--- Modules/_ctypes/ctypes.h 2009-04-19 18:35:49.000000000 +0000
++++ Modules/_ctypes/ctypes.h.new 2009-04-19 18:36:34.000000000 +0000
+@@ -69,7 +69,9 @@
+
+ typedef struct {
+ PyObject_VAR_HEAD
++#if FFI_CLOSURES
+ ffi_closure *pcl; /* the C callable */
++#endif
+ ffi_cif cif;
+ PyObject *converters;
+ PyObject *callable;
diff --git a/dev-lang/python/python-2.5.4-r2.ebuild b/dev-lang/python/python-2.5.4-r2.ebuild
new file mode 100644
index 0000000..9ebc96f
--- /dev/null
+++ b/dev-lang/python/python-2.5.4-r2.ebuild
@@ -0,0 +1,354 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.4-r2.ebuild,v 1.8 2009/04/19 16:33:39 maekke Exp $
+
+# NOTE about python-portage interactions :
+# - Do not add a pkg_setup() check for a certain version of portage
+# in dev-lang/python. It _WILL_ stop people installing from
+# Gentoo 1.4 images.
+
+EAPI=1
+
+inherit eutils autotools flag-o-matic python multilib versionator toolchain-funcs alternatives libtool
+
+# we need this so that we don't depends on python.eclass
+PYVER_MAJOR=$(get_major_version)
+PYVER_MINOR=$(get_version_component_range 2)
+PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
+
+MY_P="Python-${PV}"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
+HOMEPAGE="http://www.python.org/"
+SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2
+ mirror://gentoo/python-gentoo-patches-${PV}.tar.bz2"
+
+LICENSE="PSF-2.2"
+SLOT="2.5"
+KEYWORDS="alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc ~sparc-fbsd x86 ~x86-fbsd"
+IUSE="+xml ncurses gdbm ssl readline tk berkdb ipv6 build ucs2 sqlite doc +threads examples elibc_uclibc wininst"
+
+# NOTE: dev-python/{elementtree,celementtree,pysqlite,ctypes,cjkcodecs}
+# do not conflict with the ones in python proper. - liquidx
+
+DEPEND=">=sys-libs/zlib-1.1.3
+ !build? (
+ sqlite? ( >=dev-db/sqlite-3 )
+ tk? ( >=dev-lang/tk-8.0 )
+ ncurses? ( >=sys-libs/ncurses-5.2
+ readline? ( >=sys-libs/readline-4.1 ) )
+ berkdb? ( || ( sys-libs/db:4.5 sys-libs/db:4.4 sys-libs/db:4.3
+ sys-libs/db:4.2 ) )
+ gdbm? ( sys-libs/gdbm )
+ ssl? ( dev-libs/openssl )
+ doc? ( dev-python/python-docs:2.5 )
+ xml? ( dev-libs/expat )
+ )"
+
+# NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri
+# NOTE: added blocker to enforce correct merge order for bug 88777. - zmedico
+
+PDEPEND="${DEPEND} app-admin/python-updater"
+PROVIDE="virtual/python"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ if tc-is-cross-compiler ; then
+ epatch "${FILESDIR}"/python-2.4.4-test-cross.patch \
+ "${FILESDIR}"/python-2.5-cross-printf.patch
+ else
+ rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch
+ fi
+
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
+
+ if tc-is-cross-compiler ; then
+ # Change setup.py to respect the SYSROOT environment variable
+ epatch "${FILESDIR}/python-2.5.2-cross-setup-sysroot.patch"
+ fi
+ # Compilation of the ctypes extension fails for archs that do not have FFI_CLOSURES.
+ # This fixes the compilation and makes ctypes also available to those archs.
+ epatch "${FILESDIR}/${P}"-enable-ctypes-module.patch
+ # Add a libdirname to enable python cross-compiling and add a user specifyable libdir
+ epatch "${FILESDIR}/${P}"-cross-Makefile.pre.in.patch
+ # Make distutils cross-compile aware
+ epatch "${FILESDIR}"/python-2.5.2-cross-distutils-sysconfig.patch
+ epatch "${FILESDIR}"/python-2.5.2-cross-distutils-build_ext.patch
+ epatch "${FILESDIR}"/python-2.5.2-cross-distutils-install.patch
+
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+ Lib/distutils/command/install.py \
+ Lib/distutils/sysconfig.py \
+ Lib/site.py \
+ Makefile.pre.in \
+ Modules/Setup.dist \
+ Modules/getpath.c \
+ setup.py || die
+
+ # fix os.utime() on hppa. utimes it not supported but unfortunately reported
+ # as working - gmsoft (22 May 04)
+ # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
+ [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i "${S}"/configure
+
+ if ! use wininst; then
+ # remove microsoft windows executables
+ rm Lib/distutils/command/wininst-*.exe
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ # disable extraneous modules with extra dependencies
+ if use build; then
+ export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _sqlite3"
+ export PYTHON_DISABLE_SSL=1
+ else
+ # dbm module can link to berkdb or gdbm
+ # defaults to gdbm when both are enabled, #204343
+ local disable
+ use berkdb || use gdbm || disable="${disable} dbm"
+ use berkdb || disable="${disable} bsddb"
+ use xml || disable="${disable} pyexpat"
+ use gdbm || disable="${disable} gdbm"
+ use ncurses || disable="${disable} _curses _curses_panel"
+ use readline || disable="${disable} readline"
+ use sqlite || disable="${disable} _sqlite3"
+ use ssl || export PYTHON_DISABLE_SSL=1
+ use tk || disable="${disable} _tkinter"
+ export PYTHON_DISABLE_MODULES="${disable}"
+ fi
+
+ if use !xml; then
+ ewarn "You have configured Python without XML support."
+ ewarn "This is NOT a recommended configuration as you"
+ ewarn "may face problems parsing any XML documents."
+ fi
+
+ einfo "Disabled modules: $PYTHON_DISABLE_MODULES"
+}
+
+src_compile() {
+ filter-flags -malign-double
+
+ # Seems to no longer be necessary
+ #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
+ [ "${ARCH}" = "alpha" ] && append-flags -fPIC
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=50309
+ if is-flag -O3; then
+ is-flag -fstack-protector-all && replace-flags -O3 -O2
+ use hardened && replace-flags -O3 -O2
+ fi
+
+ # See #228905
+ if [[ $(gcc-major-version) -ge 4 ]]; then
+ append-flags -fwrapv
+ fi
+
+ export OPT="${CFLAGS}"
+
+ local myconf
+
+ # super-secret switch. don't use this unless you know what you're
+ # doing. enabling UCS2 support will break your existing python
+ # modules
+ use ucs2 \
+ && myconf="${myconf} --enable-unicode=ucs2" \
+ || myconf="${myconf} --enable-unicode=ucs4"
+
+ use threads \
+ && myconf="${myconf} --with-threads" \
+ || myconf="${myconf} --without-threads"
+
+ src_configure
+
+ if tc-is-cross-compiler ; then
+ OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
+ ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
+ emake python Parser/pgen || die "cross-make failed"
+ mv python hostpython
+ mv Parser/pgen Parser/hostpgen
+ make distclean
+ sed -i \
+ -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
+ -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
+ Makefile.pre.in || die
+ fi
+
+ # export CXX so it ends up in /usr/lib/python2.x/config/Makefile
+ tc-export CXX
+
+ # set LDFLAGS so we link modules with -lpython2.5 correctly.
+ # Needed on FreeBSD unless python2.5 is already installed.
+ # Please query BSD team before removing this!
+ append-ldflags "-L."
+
+ econf \
+ --with-fpectl \
+ --enable-shared \
+ `use_enable ipv6` \
+ --infodir='${prefix}'/share/info \
+ --mandir='${prefix}'/share/man \
+ --with-libc='' \
+ ${myconf} || die
+ emake || die "Parallel make failed"
+}
+
+src_install() {
+ dodir /usr
+ src_configure
+ make DESTDIR="${D}" altinstall maninstall || die
+
+ mv "${D}"/usr/bin/python${PYVER}-config \
+ "${D}"/usr/bin/python-config-${PYVER}
+
+ # Fix slotted collisions
+ mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER}
+ mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER}
+ mv "${D}"/usr/share/man/man1/python.1 \
+ "${D}"/usr/share/man/man1/python${PYVER}.1
+ rm -f "${D}"/usr/bin/smtpd.py
+
+ # While we're working on the config stuff... Let's fix the OPT var
+ # so that it doesn't have any opts listed in it. Prevents the problem
+ # with compiling things with conflicting opts later.
+ dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
+ /usr/$(get_libdir)/python${PYVER}/config/Makefile
+
+ if use build ; then
+ rm -rf \
+ "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
+ else
+ use elibc_uclibc && rm -rf \
+ "${D}"/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
+ use berkdb || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/bsddb
+ use tk || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/lib-tk
+ fi
+
+ prep_ml_includes usr/include/python${PYVER}
+
+ # The stuff below this line extends from 2.1, and should be deprecated
+ # in 2.3, or possibly can wait till 2.4
+
+ # seems like the build do not install Makefile.pre.in anymore
+ # it probably shouldn't - use DistUtils, people!
+ insinto /usr/$(get_libdir)/python${PYVER}/config
+ doins "${S}"/Makefile.pre.in
+
+ if use examples ; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r "${S}"/Tools || die "doins failed"
+ fi
+
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
+}
+
+pkg_postrm() {
+ local mansuffix=$(ecompress --suffix)
+ python_makesym
+ alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/python-config" \
+ "python-config-[0-9].[0-9]"
+
+ alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
+ "python[0-9].[0-9].1${mansuffix}"
+
+ python_mod_cleanup /usr/lib/python${PYVER}
+ [[ "$(get_libdir)" == "lib" ]] || \
+ python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
+}
+
+pkg_postinst() {
+ local myroot
+ myroot=$(echo $ROOT | sed 's:/$::')
+ local mansuffix=$(ecompress --suffix)
+
+ python_makesym
+ alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
+ alternatives_auto_makesym "/usr/bin/python-config" \
+ "python-config-[0-9].[0-9]"
+
+ alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
+ "python[0-9].[0-9].1${mansuffix}"
+
+ python_mod_optimize
+ python_mod_optimize -x "(site-packages|test)" \
+ /usr/lib/python${PYVER}
+ [[ "$(get_libdir)" == "lib" ]] || \
+ python_mod_optimize -x "(site-packages|test)" \
+ /usr/$(get_libdir)/python${PYVER}
+
+ # workaround possible python-upgrade-breaks-portage situation
+ if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
+ if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then
+ einfo "Working around possible python-portage upgrade breakage"
+ mkdir -p ${myroot}/usr/lib/portage/pym
+ cp \
+ ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py \
+ ${myroot}/usr/lib/portage/pym
+ python_mod_optimize /usr/lib/portage/pym
+ fi
+ fi
+
+ echo
+ ewarn
+ ewarn "If you have just upgraded from an older version of python you will"
+ ewarn "need to run:"
+ ewarn
+ ewarn "/usr/sbin/python-updater"
+ ewarn
+ ewarn "This will automatically rebuild all the python dependent modules"
+ ewarn "to run with python-${PYVER}."
+ ewarn
+ ewarn "Your original Python is still installed and can be accessed via"
+ ewarn "/usr/bin/python2.x."
+ ewarn
+ ebeep 5
+}
+
+src_test() {
+ # Tests won't work when cross compiling
+ if tc-is-cross-compiler ; then
+ elog "Disabling tests due to crosscompiling."
+ return
+ fi
+
+ # Disabling byte compiling breaks test_import
+ python_enable_pyc
+
+ #skip all tests that fail during emerge but pass without emerge:
+ #(See bug# 67970)
+ local skip_tests="distutils global mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree"
+
+ # test_pow fails on alpha.
+ # http://bugs.python.org/issue756093
+ [[ ${ARCH} == "alpha" ]] && skip_tests="${skip_tests} pow"
+
+ for test in ${skip_tests} ; do
+ mv "${S}"/Lib/test/test_${test}.py "${T}"
+ done
+
+ # Redirect stdin from /dev/tty as a workaround for bug #248081.
+ # rerun failed tests in verbose mode (regrtest -w)
+ EXTRATESTOPTS="-w" make test < /dev/tty || die "make test failed"
+
+ for test in ${skip_tests} ; do
+ mv "${T}"/test_${test}.py "${S}"/Lib/test/test_${test}.py
+ done
+
+ elog "Portage skipped the following tests which aren't able to run from emerge:"
+ for test in ${skip_tests} ; do
+ elog "test_${test}.py"
+ done
+
+ elog "If you'd like to run them, you may:"
+ elog "cd /usr/lib/python${PYVER}/test"
+ elog "and run the tests separately."
+}