| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-python/testtools/testtools-0.9.15.ebuild,v 1.6 2012/06/27 01:38:55 jer Exp $
|
| 4 |
|
| 5 |
EAPI="4"
|
| 6 |
SUPPORT_PYTHON_ABIS="1"
|
| 7 |
DISTUTILS_SRC_TEST="setup.py"
|
| 8 |
inherit distutils versionator
|
| 9 |
|
| 10 |
SERIES="$(get_version_component_range 1-2)"
|
| 11 |
|
| 12 |
DESCRIPTION="Extensions to the Python unittest library"
|
| 13 |
HOMEPAGE="https://launchpad.net/testtools http://pypi.python.org/pypi/testtools"
|
| 14 |
SRC_URI="http://launchpad.net/${PN}/${SERIES}/${PV}/+download/${P}.tar.gz"
|
| 15 |
|
| 16 |
LICENSE="MIT"
|
| 17 |
SLOT="0"
|
| 18 |
KEYWORDS="~alpha amd64 arm hppa ~ia64 ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd"
|
| 19 |
IUSE=""
|
| 20 |
|
| 21 |
DEPEND=""
|
| 22 |
RDEPEND=""
|
| 23 |
|
| 24 |
src_compile() {
|
| 25 |
distutils_src_compile
|
| 26 |
|
| 27 |
if [[ ! -e testtools/_compat2x.py ]]; then
|
| 28 |
die "_compat2x.py removed upstream; fix src_compile"
|
| 29 |
fi
|
| 30 |
|
| 31 |
fix_compat() {
|
| 32 |
# _compat2x.py is expected to have syntax incompatible with python 3.
|
| 33 |
# This breaks compileall. Replace with "raise SyntaxError".
|
| 34 |
if [[ $(python_get_version -l --major) == 3 ]]; then
|
| 35 |
echo "raise SyntaxError" > build-${PYTHON_ABI}/lib/testtools/_compat2x.py
|
| 36 |
fi
|
| 37 |
}
|
| 38 |
python_execute_function -q fix_compat
|
| 39 |
}
|
| 40 |
|
| 41 |
# dev-python/subunit imports some objects from testtools.tests.helpers, so
|
| 42 |
# tests need to be installed.
|