Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / pygmt / default.nix
blob318706edd930894260c106ab99b4b384c2497814
1 { lib, stdenv
2 , pythonOlder
3 , buildPythonPackage
4 , fetchFromGitHub
5 , gmt
6 , numpy
7 , netcdf4
8 , pandas
9 , packaging
10 , xarray
13 buildPythonPackage rec {
14   pname = "pygmt";
15   version = "0.2.0";
17   disabled = pythonOlder "3.6";
19   src = fetchFromGitHub {
20     owner = "GenericMappingTools";
21     repo = "pygmt";
22     rev = "v${version}";
23     sha256 = "1yx1n6mxfmwg69ls5560nm6d3jxyghv27981iplz7m7990bbp468";
24   };
26   postPatch = ''
27     substituteInPlace pygmt/clib/loading.py \
28       --replace "env.get(\"GMT_LIBRARY_PATH\", \"\")" "env.get(\"GMT_LIBRARY_PATH\", \"${gmt}/lib\")"
29   '';
31   propagatedBuildInputs = [ numpy netcdf4 pandas packaging xarray ];
33   doCheck = false; # requires network access
35   postBuild = "export HOME=$TMP";
37   pythonImportsCheck = [ "pygmt" ];
39   meta = with lib; {
40     description = "A Python interface for the Generic Mapping Tools";
41     homepage = "https://github.com/GenericMappingTools/pygmt";
42     license = licenses.bsd3;
43     # pygmt.exceptions.GMTCLibNotFoundError: Error loading the GMT shared library '/nix/store/r3xnnqgl89vrnq0kzxx0bmjwzks45mz8-gmt-6.1.1/lib/libgmt.dylib'
44     broken = stdenv.isDarwin;
45     maintainers = with maintainers; [ sikmir ];
46   };