dev-perl/Class-Inspector: amd64 stable
[gentoo.git] / dev-python / basemap / basemap-1.0.7-r1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 PYTHON_COMPAT=( python2_7 )
7
8 inherit distutils-r1 flag-o-matic
9
10 DESCRIPTION="matplotlib toolkit to plot map projections"
11 HOMEPAGE="https://matplotlib.org/basemap/ https://pypi.python.org/pypi/basemap"
12 SRC_URI="mirror://sourceforge/matplotlib/${P}.tar.gz"
13
14 IUSE="examples test"
15 SLOT="0"
16 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
17 LICENSE="MIT GPL-2"
18
19 CDEPEND="sci-libs/shapelib
20         >=dev-python/matplotlib-0.98[${PYTHON_USEDEP}]
21         >=sci-libs/geos-3.3.1[python,${PYTHON_USEDEP}]"
22
23 DEPEND="${CDEPEND}
24         dev-python/setuptools[${PYTHON_USEDEP}]"
25
26 RDEPEND="${CDEPEND}
27         >=dev-python/pupynere-1.0.8[${PYTHON_USEDEP}]
28         dev-python/httplib2[${PYTHON_USEDEP}]
29         dev-python/dap[${PYTHON_USEDEP}]"
30
31 DOCS="FAQ API_CHANGES"
32 #REQUIRED_USE="test? ( examples )"
33 # The test phase ought never have been onvoked according to the above.
34 # The test phase appears to require the package to fist be emerged, which ...
35 # Until the distutils_install_for_testing func refrains from failing with
36 # mkdir: cannot create directory ‘/test’: Permission denied
37 # reluctantly this phase is assigned
38 RESTRICT="test"
39
40 src_prepare() {
41         sed -i \
42                 -e "s:/usr:${EPREFIX}/usr:g" \
43                 setup.py || die
44         # use /usr/share/data
45         sed -i \
46                 -e "/_datadir.*=.*join/s|\(.*datadir.*=\).*|\1'${EROOT}usr/share/${PN}'|g" \
47                 "${S}"/lib/mpl_toolkits/basemap/*.py || die
48         distutils-r1_src_prepare
49         append-flags -fno-strict-aliasing
50 }
51
52 #src_test() {
53 #       distutils_install_for_testing
54 #}
55
56 python_install() {
57         distutils-r1_python_install
58         #  --install-data="${EPREFIX}/usr/share/${PN}" on testing is found not to work;
59         # setup.py is a mess. Someone care to patch setup.py please proceed; substitute with
60         insinto usr/share/basemap/
61         doins  lib/mpl_toolkits/basemap/data/*
62
63         # clean up collision with matplotlib
64         rm -f "${D}$(python_get_sitedir)/mpl_toolkits/__init__.py"
65         # respect FHS
66         rm -fr "${D}$(python_get_sitedir)/mpl_toolkits/basemap/data"
67 }
68
69 python_install_all() {
70         use examples && local EXAMPLES=( examples/. )
71         distutils-r1_python_install_all
72 }