2022-12-02 08:20:57 +00:00
|
|
|
{ lib
|
2023-11-16 04:20:00 +00:00
|
|
|
, stdenv
|
2022-12-02 08:20:57 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, isPyPy
|
|
|
|
, python
|
2023-10-09 19:29:22 +00:00
|
|
|
, oldest-supported-numpy
|
2022-12-02 08:20:57 +00:00
|
|
|
, setuptools
|
2023-10-09 19:29:22 +00:00
|
|
|
, wheel
|
2022-12-02 08:20:57 +00:00
|
|
|
, numpy
|
|
|
|
, zlib
|
|
|
|
, netcdf
|
|
|
|
, hdf5
|
|
|
|
, curl
|
|
|
|
, libjpeg
|
|
|
|
, cython
|
|
|
|
, cftime
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "netcdf4";
|
2022-12-02 08:20:57 +00:00
|
|
|
version = "1.6.2";
|
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = isPyPy;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "netCDF4";
|
|
|
|
inherit version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-A4KwL/aiiEGfb/7IXexA9FH0G4dVVHFUxXXd2fD0rlM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
oldest-supported-numpy
|
|
|
|
setuptools
|
|
|
|
wheel
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cftime
|
|
|
|
numpy
|
|
|
|
zlib
|
|
|
|
netcdf
|
|
|
|
hdf5
|
|
|
|
curl
|
|
|
|
libjpeg
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
2022-12-02 08:20:57 +00:00
|
|
|
pushd test/
|
|
|
|
NO_NET=1 NO_CDL=1 ${python.interpreter} run_all.py
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
env = {
|
|
|
|
# Variables used to configure the build process
|
|
|
|
USE_NCCONFIG = "0";
|
|
|
|
HDF5_DIR = lib.getDev hdf5;
|
|
|
|
NETCDF4_DIR = netcdf;
|
|
|
|
CURL_DIR = curl.dev;
|
|
|
|
JPEG_DIR = libjpeg.dev;
|
|
|
|
} // lib.optionalAttrs stdenv.cc.isClang {
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error=int-conversion";
|
|
|
|
};
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
pythonImportsCheck = [ "netCDF4" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Interface to netCDF library (versions 3 and 4)";
|
2022-12-02 08:20:57 +00:00
|
|
|
homepage = "https://github.com/Unidata/netcdf4-python";
|
|
|
|
changelog = "https://github.com/Unidata/netcdf4-python/raw/v${version}/Changelog";
|
|
|
|
maintainers = with maintainers; [ ];
|
|
|
|
license = licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|