*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / sci-visualization / veusz / veusz-3.0.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python3_6 )
7
8 inherit eutils distutils-r1 virtualx xdg-utils gnome2-utils
9
10 DESCRIPTION="Qt scientific plotting package with good Postscript output"
11 HOMEPAGE="https://veusz.github.io/"
12 SRC_URI="https://github.com/${PN}/${PN}/releases/download/${P}/${P}.tar.gz"
13
14 SLOT="0"
15 LICENSE="GPL-2"
16 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
17 IUSE="dbus doc fits hdf5 minuit"
18
19 CDEPEND="dev-python/PyQt5[widgets,svg,printsupport,${PYTHON_USEDEP}]
20         dev-python/numpy[${PYTHON_USEDEP}]"
21 RDEPEND="${CDEPEND}
22         dbus? ( dev-python/dbus-python[${PYTHON_USEDEP}] )
23         fits? ( dev-python/astropy[${PYTHON_USEDEP}] )
24         hdf5? ( dev-python/h5py[${PYTHON_USEDEP}] )
25         minuit? ( || ( dev-python/iminuit[${PYTHON_USEDEP}] dev-python/pyminuit[${PYTHON_USEDEP}] ) )"
26 DEPEND="${CDEPEND}
27         dev-python/setuptools[${PYTHON_USEDEP}]
28         dev-python/sip[${PYTHON_USEDEP}]
29         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
30
31 PATCHES=("${FILESDIR}/fix_spline.patch")
32
33 python_test() {
34         distutils_install_for_testing
35         cd tests || die
36         VIRTUALX_COMMAND="${EPYTHON}" \
37                 VEUSZ_RESOURCE_DIR="${S}" \
38                 virtualmake runselftest.py
39 }
40
41 python_install() {
42         distutils-r1_python_install
43         # symlink the license, bug #341653
44         rm "${D}/$(python_get_sitedir)"/${PN}/{COPYING,AUTHORS,ChangeLog} || die
45         mkdir -p "${D}/$(python_get_sitedir)" || die
46         cat >> "${D}/$(python_get_sitedir)"/${PN}/COPYING <<- EOF
47         Please visit
48
49         https://www.gnu.org/licenses/gpl-2.0.html
50
51         for the full license text.
52         EOF
53 }
54
55 python_install_all() {
56         distutils-r1_python_install_all
57
58         if use doc; then
59                 dodoc Documents/manual/pdf/${PN}.pdf
60                 docinto html
61                 dodoc -r Documents/manual/html
62         fi
63
64         doicon icons/veusz.png
65         domenu "${FILESDIR}"/veusz.desktop
66         insinto /usr/share/mime/packages
67         doins "${FILESDIR}"/veusz.xml
68 }
69
70 pkg_postinst() {
71         xdg_desktop_database_update
72         xdg_mimeinfo_database_update
73         gnome2_icon_cache_update
74 }
75
76 pkg_postrm() {
77         xdg_desktop_database_update
78         xdg_mimeinfo_database_update
79         gnome2_icon_cache_update
80 }