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