2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
pythonOlder,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
setuptools-scm,
|
|
|
|
gmt,
|
|
|
|
numpy,
|
|
|
|
netcdf4,
|
|
|
|
pandas,
|
|
|
|
packaging,
|
|
|
|
xarray,
|
|
|
|
pytest-mpl,
|
|
|
|
ipython,
|
|
|
|
ghostscript,
|
|
|
|
pytestCheckHook,
|
2020-10-27 00:29:36 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pygmt";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "0.11.0";
|
2024-09-19 14:19:46 +00:00
|
|
|
pyproject = true;
|
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}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-DbewB/lP44bpNSQ4ht7n0coS2Ml7qmEU4CP91p5YtZg=";
|
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\")"
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pygmt" ];
|
2020-10-27 00:29:36 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Python interface for the Generic Mapping Tools";
|
2020-10-27 00:29:36 +00:00
|
|
|
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'
|
2024-09-26 11:04:55 +00:00
|
|
|
broken = stdenv.hostPlatform.isDarwin;
|
2020-10-27 00:29:36 +00:00
|
|
|
maintainers = with maintainers; [ sikmir ];
|
|
|
|
};
|
|
|
|
}
|