summaryrefslogtreecommitdiff
blob: 7ae149f76646f3cd5fbe568849acef5731fad992 (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
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5
PYTHON_COMPAT=( python2_7 )

inherit distutils-r1 versionator virtualx

DESCRIPTION="Kiwi is a pure Python framework and set of enhanced PyGTK widgets"
HOMEPAGE="https://launchpad.net/kiwi
	https://pypi.org/project/kiwi-gtk/"
MY_PN="${PN}-gtk"
MY_P="${MY_PN}-${PV}"
SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
IUSE="examples test"

RDEPEND=">=dev-python/setuptools-0.8[${PYTHON_USEDEP}]
		>=dev-python/pygtk-2.24[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
	test? ( dev-python/mock[${PYTHON_USEDEP}] )"

S="${WORKDIR}/${MY_P}"

python_prepare_all() {
	sed -e "s:share/doc/kiwi:share/doc/${PF}:g" -i setup.py || die "sed failed"
	distutils-r1_python_prepare_all
}

python_test() {
	testing() {
		"${PYTHON}" -m unittest discover || die "tests failed"
	}
	VIRTUALX_COMMAND=virtualmake testing
}

python_install_all() {
	use examples && local EXAMPLES=( examples/. )
	distutils-r1_python_install_all
	rmdir "${D}"usr/share/doc/${PF}/{api,howto} || die
}