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