2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-10-27 00:29:36 +00:00
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2021-05-20 23:08:51 +00:00
|
|
|
, setuptools-scm
|
2020-10-27 00:29:36 +00:00
|
|
|
, gmt
|
|
|
|
, numpy
|
|
|
|
, netcdf4
|
|
|
|
, pandas
|
|
|
|
, packaging
|
|
|
|
, xarray
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytest-mpl
|
|
|
|
, ipython
|
|
|
|
, ghostscript
|
|
|
|
, pytestCheckHook
|
2020-10-27 00:29:36 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pygmt";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "0.7.0";
|
2020-10-27 00:29:36 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "GenericMappingTools";
|
|
|
|
repo = "pygmt";
|
2022-06-26 10:26:21 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-07-14 12:49:19 +00:00
|
|
|
sha256 = "sha256-Z38fZvmeWDLZEIyH+UG6Nb6KNnjEuXIn3RRH4CPWz9A=";
|
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\")"
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2020-10-27 00:29:36 +00:00
|
|
|
propagatedBuildInputs = [ numpy netcdf4 pandas packaging xarray ];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
doCheck = false; # the *entire* test suite requires network access
|
|
|
|
checkInputs = [ pytestCheckHook pytest-mpl ghostscript ipython ];
|
|
|
|
postBuild = ''
|
|
|
|
export HOME=$TMP
|
|
|
|
'';
|
2020-10-27 00:29:36 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|