about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/basemap/default.nix
blob: 578fd84db77c15b4b95cca40c83570dec1ea8dcb (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonAtLeast
, basemap-data
, cython
, geos
, numpy
, matplotlib
, pillow
, pyproj
, pyshp
, python
, pythonRelaxDepsHook
, setuptools
}:

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

  src = fetchFromGitHub {
    owner = "matplotlib";
    repo = "basemap";
    rev = "refs/tags/v${version}";
    hash = "sha256-oWKCUARTMCiXDp4SCOOrOUQLUDU4DIzwsmUXCXoDvx0=";
  };

  sourceRoot = "${src.name}/packages/basemap";

  nativeBuildInputs = [
    cython
    geos
    pythonRelaxDepsHook
    setuptools
  ];

  pythonRelaxDeps = true;

  propagatedBuildInputs = [
    basemap-data
    numpy
    matplotlib
    pillow # undocumented optional dependency
    pyproj
    pyshp
  ];

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

  # test have various problems including requiring internet connection, permissions issues, problems with latest version of pillow
  doCheck = false;

  checkPhase = ''
    cd ../../examples
    export HOME=$TEMPDIR
    ${python.interpreter} run_all.py
  '';

  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.
    '';
    maintainers = with maintainers; [ ];
    license = with licenses; [ mit lgpl21 ];
  };
}