2023-04-12 12:48:02 +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-10-09 19:29:22 +00:00
|
|
|
version = "0.10.0";
|
2023-02-02 18:25:31 +00:00
|
|
|
format = "pyproject";
|
2020-10-27 00:29:36 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
2020-10-27 00:29:36 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "GenericMappingTools";
|
|
|
|
repo = "pygmt";
|
2022-06-26 10:26:21 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-+bkjqHjJIwk44u226q6xqeGmwMWleyc4lRfMZdDjVBA=";
|
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\")"
|
|
|
|
'';
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
netcdf4
|
|
|
|
pandas
|
|
|
|
packaging
|
|
|
|
xarray
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-mpl
|
|
|
|
ghostscript
|
|
|
|
ipython
|
|
|
|
];
|
|
|
|
|
|
|
|
# The *entire* test suite requires network access
|
|
|
|
doCheck = false;
|
2020-10-27 00:29:36 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
postBuild = ''
|
|
|
|
export HOME=$TMP
|
|
|
|
'';
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pygmt"
|
|
|
|
];
|
2020-10-27 00:29:36 +00:00
|
|
|
|
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;
|
2023-04-12 12:48:02 +00:00
|
|
|
changelog = "https://github.com/GenericMappingTools/pygmt/releases/tag/v${version}";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|