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";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.8.0";
|
2023-02-02 18:25:31 +00:00
|
|
|
format = "pyproject";
|
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}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-wbqJaibRZW7qiNyLArr7I/dzHprILHQpORtdHWkIfSE=";
|
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
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook pytest-mpl ghostscript ipython ];
|
2021-05-20 23:08:51 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|