1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonAtLeast
5, basemap-data
6, cython
7, geos
8, numpy
9, matplotlib
10, pillow
11, pyproj
12, pyshp
13, python
14, pythonRelaxDepsHook
15, setuptools
16}:
17
18buildPythonPackage rec {
19 pname = "basemap";
20 version = "1.3.8";
21
22 src = fetchFromGitHub {
23 owner = "matplotlib";
24 repo = "basemap";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-QH/pC1WIa0XQaDbAhYwKbCeCyxUprJbNyRfguiLjlHI=";
27 };
28
29 sourceRoot = "${src.name}/packages/basemap";
30
31 nativeBuildInputs = [
32 cython
33 geos
34 pythonRelaxDepsHook
35 setuptools
36 ];
37
38 pythonRelaxDeps = true;
39
40 propagatedBuildInputs = [
41 basemap-data
42 numpy
43 matplotlib
44 pillow # undocumented optional dependency
45 pyproj
46 pyshp
47 ];
48
49 # Standard configurePhase from `buildPythonPackage` seems to break the setup.py script
50 preBuild = ''
51 export GEOS_DIR=${geos}
52 '';
53
54 # test have various problems including requiring internet connection, permissions issues, problems with latest version of pillow
55 doCheck = false;
56
57 checkPhase = ''
58 cd ../../examples
59 export HOME=$TEMPDIR
60 ${python.interpreter} run_all.py
61 '';
62
63 meta = with lib; {
64 homepage = "https://matplotlib.org/basemap/";
65 description = "Plot data on map projections with matplotlib";
66 longDescription = ''
67 An add-on toolkit for matplotlib that lets you plot data on map projections with
68 coastlines, lakes, rivers and political boundaries. See
69 http://matplotlib.github.com/basemap/users/examples.html for examples of what it can do.
70 '';
71 maintainers = with maintainers; [ ];
72 license = with licenses; [ mit lgpl21 ];
73 };
74}