*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / pyqtgraph / pyqtgraph-0.10.0-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python{2_7,3_6} )
6 inherit distutils-r1
7
8 DESCRIPTION="A pure-python graphics and GUI library built on PyQt and numpy"
9 HOMEPAGE="http://www.pyqtgraph.org/ https://pypi.org/project/pyqtgraph/"
10 SRC_URI="http://www.pyqtgraph.org/downloads/${PV}/${P}.tar.gz"
11
12 LICENSE="MIT"
13 SLOT="0"
14 KEYWORDS="amd64 x86"
15 IUSE="doc examples opengl svg"
16
17 RDEPEND="dev-python/numpy[${PYTHON_USEDEP}]
18         sci-libs/scipy[${PYTHON_USEDEP}]
19         dev-python/PyQt5[gui,widgets,opengl=,svg=,${PYTHON_USEDEP}]
20         opengl? ( dev-python/pyopengl[${PYTHON_USEDEP}] )"
21 DEPEND="${RDEPEND}
22         dev-python/setuptools[${PYTHON_USEDEP}]
23         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
24
25 PATCHES=( "${FILESDIR}"/${P}-qt5.patch )
26 S=${WORKDIR}/${PN}-${P}
27
28 python_prepare_all() {
29         distutils-r1_python_prepare_all
30
31         # fix distutils warning
32         sed -i 's/install_requires/requires/' setup.py || die
33
34         if ! use opengl; then
35                 rm -r pyqtgraph/opengl || die
36         fi
37 }
38
39 python_compile_all() {
40         use doc && emake -C doc html
41 }
42
43 python_install_all() {
44         use doc && local HTML_DOCS=( doc/build/html/. )
45         use examples && dodoc -r examples
46         distutils-r1_python_install_all
47 }