summary refs log tree commit diff
path: root/pkgs/development/python-modules/basemap/default.nix
blob: c97548bdee8881fcb45d4687f22740fda45aac52 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib, stdenv
, buildPythonPackage
, fetchFromGitHub
, numpy
, matplotlib
, pillow
, setuptools
, pyproj
, pyshp
, six
, pkgs
}:

buildPythonPackage rec {
  pname = "basemap";
  version = "1.2.1";

  src = fetchFromGitHub {
    owner = "matplotlib";
    repo = "basemap";
    rev = "v${version}rel";
    sha256 = "13lw1iwa8hadpvqdgb06nh881l8c17awzvvwbfwblvb9q9s0lnzp";
  };

  propagatedBuildInputs = [ numpy matplotlib pillow pyproj pyshp six ];
  buildInputs = [ setuptools pkgs.geos ];

  # Standard configurePhase from `buildPythonPackage` seems to break the setup.py script
  configurePhase = ''
    export GEOS_DIR=${pkgs.geos}
  '';

  # The 'check' target is not supported by the `setup.py` script.
  # TODO : do the post install checks (`cd examples && ${python.interpreter} run_all.py`)
  doCheck = false;

  meta = with lib; {
    homepage = "https://matplotlib.org/basemap/";
    description = "Plot data on map projections with matplotlib";
    longDescription = ''
      An add-on toolkit for matplotlib that lets you plot data on map projections with
      coastlines, lakes, rivers and political boundaries. See
      http://matplotlib.github.com/basemap/users/examples.html for examples of what it can do.
    '';
    license = with licenses; [ mit gpl2 ];
  };

}