summaryrefslogtreecommitdiff
blob: 1a06ca3010b6c545a11f452b92288e9cc7f4e77a (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"
PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS="1"

inherit distutils

DESCRIPTION="Python network library that uses greenlet and libevent for easy and scalable concurrency"
HOMEPAGE="http://gevent.org/"
SRC_URI="mirror://pypi/g/gevent/${P}.tar.gz"

LICENSE="as-is MIT"
KEYWORDS="~amd64 ~x86"
SLOT="0"
IUSE="doc examples"

DEPEND="dev-libs/libevent
	>=dev-python/greenlet-0.2
	doc? ( dev-python/sphinx )"
RDEPEND="${DEPEND}"
RESTRICT_PYTHON_ABIS="3.*"

src_compile() {
	distutils_src_compile

	if use doc; then
		cd "${S}/doc"
		PYTHONPATH=".." emake html || die "Building documentation failed"
	fi
}

src_test() {
	testing() {
		cd "${S}/greentest"
		PYTHONPATH="$(dir -d ../build-${PYTHON_ABI}/lib*)" $(PYTHON) testrunner.py || die "Tests failed"
	}
	python_execute_function testing
}

src_install() {
	distutils_src_install

	if use doc; then
		dohtml -r doc/_build/html/* || die
	fi

	if use examples; then
		insinto /usr/share/doc/${PF}
		doins -r examples || die "doins failed"
	fi

	dodoc TODO || die "dodoc failed"
}