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