summaryrefslogtreecommitdiff
blob: 07362efd779c19bbeaadcc10add1cf1769bd9539 (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
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

PYTHON_COMPAT=( python2_7 python3_{5,6} )

inherit distutils-r1

DESCRIPTION="Pythonic library to create text UIs and ASCII art animations"
HOMEPAGE="https://github.com/peterbrittain/asciimatics"
SRC_URI="https://github.com/peterbrittain/asciimatics/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="doc examples"

DEPEND="
	dev-python/pillow[${PYTHON_USEDEP}]
	dev-python/future[${PYTHON_USEDEP}]
	dev-python/wcwidth[${PYTHON_USEDEP}]
	dev-python/pyfiglet[${PYTHON_USEDEP}]
	dev-python/setuptools[${PYTHON_USEDEP}]
	doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"

src_prepare() {
	sed -i -e "s/use_scm_version.*/version='${PV}',/g;" setup.py || die
	distutils-r1_src_prepare
}

python_compile_all() {
	if use doc; then
		sed -i -e 's/base_version = .*//g;' doc/source/conf.py || die
		sed -i -e 's/release = .*//g;' doc/source/conf.py || die
		sed -i -e 's/version = .*//g;' doc/source/conf.py || die
		sphinx-build -b html doc/source doc/_build/ || die
		HTML_DOCS=( doc/_build/. )
	fi
}

python_install_all() {
	use examples && dodoc -r samples
	distutils-r1_python_install_all
}