d7b87df2a1b2adceb2f41e36ccaf0901b435914e
[gentoo.git] / dev-python / pmw / pmw-2.0.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 PYTHON_COMPAT=( python3_{5,6} )
7 PYTHON_REQ_USE="tk"
8
9 inherit distutils-r1 virtualx
10
11 MY_PN="Pmw"
12 MY_P="${MY_PN}-${PV}"
13
14 DESCRIPTION="Toolkit for building high-level compound widgets in Python using the Tkinter module"
15 HOMEPAGE="http://pmw.sourceforge.net/"
16 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
17
18 LICENSE="BSD"
19 SLOT="py3"
20 KEYWORDS="alpha amd64 ia64 ppc sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
21 IUSE="doc examples test"
22
23 DEPEND="!dev-python/pmw:0"
24 RDEPEND="${DEPEND}"
25 # https://sourceforge.net/p/pmw/bugs/39/
26 RESTRICT="test"
27
28 S="${WORKDIR}/${MY_P}"
29
30 python_prepare() {
31         distutils-r1_python_prepare
32         2to3 Pmw
33 }
34
35 python_test() {
36         VIRTUALX_COMMAND="${PYTHON}"
37         cd "${BUILD_DIR}/lib/Pmw/Pmw_${PV//./_}/" || die
38         cp tests/{flagup.bmp,earthris.gif} . || die
39         for test in tests/*_test.py; do
40                 echo "running test "$test
41                 PYTHONPATH=tests:../../ virtualmake $test || die
42         done
43 }
44
45 python_install_all() {
46         local DIR="Pmw/Pmw_${PV//./_}"
47
48         use doc && HTML_DOCS=( "${DIR}"/doc/. )
49         use examples && EXAMPLES=( "${DIR}"/demos/. )
50
51         distutils-r1_python_install_all
52 }