summaryrefslogtreecommitdiff
blob: dbf5287c27c8954e03d24731a6cbf96963b58527 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/urwid/urwid-1.1.1.ebuild,v 1.2 2013/08/03 09:45:46 mgorny Exp $

EAPI="5"
PYTHON_USE_WITH="ncurses"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="*-jython"
PYTHON_TESTS_FAILURES_TOLERANT_ABIS="3.1"
DISTUTILS_SRC_TEST="setup.py"

inherit distutils eutils

DESCRIPTION="Urwid is a curses-based user interface library for Python"
HOMEPAGE="http://excess.org/urwid/ http://pypi.python.org/pypi/urwid"
SRC_URI="http://excess.org/urwid/${P}.tar.gz"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux"
IUSE="doc examples test"

DEPEND="dev-python/setuptools
	doc? ( dev-python/sphinx )
	test? ( dev-python/twisted-core )"

PYTHON_CFLAGS=("2.* + -fno-strict-aliasing")

src_prepare() {
	distutils_src_prepare

	epatch "${FILESDIR}"/${PN}-1.1.0-sphinx.patch

	if [[ $(python_get_version -f --major) == 3 ]] ; then
		2to3-$(PYTHON -f --ABI) -nw --no-diffs docs/conf.py || die
	fi
}

src_compile() {
	distutils_src_compile

	if use doc ; then
		cd docs
		PYTHONPATH="$(ls -d ../build-$(PYTHON -f --ABI)/lib*)" sphinx-build . _build/html || die
	fi
}

src_install() {
	distutils_src_install

	use doc && dohtml -r docs/_build/html/*

	if use examples ; then
		dodoc -r examples
		docompress -x /usr/share/doc/${PF}/examples
	fi
}