2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-10-27 00:29:36 +00:00
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gmt
|
|
|
|
, numpy
|
|
|
|
, netcdf4
|
|
|
|
, pandas
|
|
|
|
, packaging
|
|
|
|
, xarray
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pygmt";
|
2021-04-26 19:14:03 +00:00
|
|
|
version = "0.3.1";
|
2020-10-27 00:29:36 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "GenericMappingTools";
|
|
|
|
repo = "pygmt";
|
|
|
|
rev = "v${version}";
|
2021-04-26 19:14:03 +00:00
|
|
|
sha256 = "0v57n3by9dwckjfmrgf1km4y3gwzj2gk0s9ly64hlaf05zihqnvc";
|
2020-10-27 00:29:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pygmt/clib/loading.py \
|
|
|
|
--replace "env.get(\"GMT_LIBRARY_PATH\", \"\")" "env.get(\"GMT_LIBRARY_PATH\", \"${gmt}/lib\")"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ numpy netcdf4 pandas packaging xarray ];
|
|
|
|
|
|
|
|
doCheck = false; # requires network access
|
|
|
|
|
|
|
|
postBuild = "export HOME=$TMP";
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pygmt" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-27 00:29:36 +00:00
|
|
|
description = "A Python interface for the Generic Mapping Tools";
|
|
|
|
homepage = "https://github.com/GenericMappingTools/pygmt";
|
|
|
|
license = licenses.bsd3;
|
2020-12-09 12:39:15 +00:00
|
|
|
# pygmt.exceptions.GMTCLibNotFoundError: Error loading the GMT shared library '/nix/store/r3xnnqgl89vrnq0kzxx0bmjwzks45mz8-gmt-6.1.1/lib/libgmt.dylib'
|
|
|
|
broken = stdenv.isDarwin;
|
2020-10-27 00:29:36 +00:00
|
|
|
maintainers = with maintainers; [ sikmir ];
|
|
|
|
};
|
|
|
|
}
|