1 { lib, stdenv, fetchurl, curl, hdf5, netcdf, eccodes, python3
2 , # build, install and link to a CDI library [default=no]
4 , # build a completely statically linked CDO binary
5 enable_all_static ? stdenv.hostPlatform.isStatic
6 , # Use CXX as default compiler [default=no]
10 stdenv.mkDerivation rec {
15 buildInputs = [ curl netcdf hdf5 python3 ];
18 url = "https://code.mpimet.mpg.de/attachments/download/29481/${pname}-${version}.tar.gz";
19 sha256 = "sha256-TfH+K4+S9Uwn6585nt+rQNkyIAWmcyyhUk71wWJ6xOc=";
23 "--with-netcdf=${netcdf}"
25 "--with-eccodes=${eccodes}"
27 ++ lib.optional enable_cdi_lib "--enable-cdi-lib"
28 ++ lib.optional enable_all_static "--enable-all-static"
29 ++ lib.optional enable_cxx "--enable-cxx";
31 # address error: 'TARGET_OS_MACCATALYST' is not defined,
32 # evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
33 # we don't want to appear to be a catalyst build;
34 # we are a TARGET_OS_MAC
35 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DTARGET_OS_MACCATALYST=0";
38 description = "Collection of command line Operators to manipulate and analyse Climate and NWP model Data";
41 Supported data formats are GRIB 1/2, netCDF 3/4, SERVICE, EXTRA and IEG.
42 There are more than 600 operators available.
44 homepage = "https://code.mpimet.mpg.de/projects/cdo/";
45 license = licenses.bsd3;
46 maintainers = [ maintainers.ltavard ];
47 platforms = with platforms; linux ++ darwin;