2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl, curl, hdf5, netcdf
|
2021-01-03 21:40:14 +00:00
|
|
|
, # build, install and link to a CDI library [default=no]
|
|
|
|
enable_cdi_lib ? false
|
|
|
|
, # build a completely statically linked CDO binary
|
|
|
|
enable_all_static ? stdenv.hostPlatform.isStatic
|
|
|
|
, # Use CXX as default compiler [default=no]
|
|
|
|
enable_cxx ? false
|
2017-09-05 13:40:20 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-06 10:49:05 +01:00
|
|
|
pname = "cdo";
|
|
|
|
version = "1.9.7.1";
|
2017-09-05 13:40:20 +01:00
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
buildInputs = [ curl netcdf hdf5 ];
|
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-06 10:49:05 +01:00
|
|
|
url = "https://code.mpimet.mpg.de/attachments/download/20124/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "0b4n8dwxfsdbz4jflsx0b75hwapdf1rp14p48dfr7ksv0qp9aw9p";
|
2017-09-05 13:40:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# Configure phase
|
|
|
|
configureFlags = [
|
|
|
|
"--with-netcdf=${netcdf}" "--with-hdf5=${hdf5}"]
|
2021-01-21 17:00:13 +00:00
|
|
|
++ lib.optional (enable_cdi_lib) "--enable-cdi-lib"
|
|
|
|
++ lib.optional (enable_all_static) "--enable-all-static"
|
|
|
|
++ lib.optional (enable_cxx) "--enable-cxx";
|
2017-09-05 13:40:20 +01:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2017-09-05 13:40:20 +01:00
|
|
|
description = "Collection of command line Operators to manipulate and analyse Climate and NWP model Data";
|
|
|
|
longDescription = ''
|
|
|
|
Supported data formats are GRIB 1/2, netCDF 3/4, SERVICE, EXTRA and IEG.
|
|
|
|
There are more than 600 operators available.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://code.mpimet.mpg.de/projects/cdo/";
|
2019-08-06 10:49:05 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.ltavard ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
2017-09-05 13:40:20 +01:00
|
|
|
};
|
|
|
|
}
|