11 , enablePython ? false
13 , enablePosixThreads ? false
14 , enableOpenMPThreads ? false
17 stdenv.mkDerivation rec {
22 url = "https://confluence.ecmwf.int/download/attachments/45757960/eccodes-${version}-Source.tar.gz";
23 hash = "sha256-2nQUOmSyvuol6ifGOHW8jsKU5p5b0Ih4AgQOsEFR15o=";
27 substituteInPlace cmake/FindOpenJPEG.cmake --replace openjpeg-2.1 ${openjpeg.incDir}
29 # https://github.com/ecmwf/ecbuild/issues/40
30 substituteInPlace cmake/ecbuild_config.h.in \
31 --replace @CMAKE_INSTALL_PREFIX@/@INSTALL_LIB_DIR@ @eccodes_FULL_INSTALL_LIB_DIR@ \
32 --replace @CMAKE_INSTALL_PREFIX@/@INSTALL_BIN_DIR@ @eccodes_FULL_INSTALL_BIN_DIR@
33 substituteInPlace cmake/pkg-config.pc.in \
34 --replace '$'{prefix}/@INSTALL_LIB_DIR@ @eccodes_FULL_INSTALL_LIB_DIR@ \
35 --replace '$'{prefix}/@INSTALL_INCLUDE_DIR@ @eccodes_FULL_INSTALL_INCLUDE_DIR@ \
36 --replace '$'{prefix}/@INSTALL_BIN_DIR@ @eccodes_FULL_INSTALL_BIN_DIR@
37 substituteInPlace cmake/ecbuild_install_project.cmake \
38 --replace '$'{CMAKE_INSTALL_PREFIX}/'$'{INSTALL_INCLUDE_DIR} '$'{'$'{PROJECT_NAME}_FULL_INSTALL_INCLUDE_DIR}
41 nativeBuildInputs = [ cmake gfortran perl ];
50 propagatedBuildInputs = lib.optionals enablePython [
56 "-DENABLE_PYTHON=${if enablePython then "ON" else "OFF"}"
58 "-DENABLE_ECCODES_THREADS=${if enablePosixThreads then "ON" else "OFF"}"
59 "-DENABLE_ECCODES_OMP_THREADS=${if enableOpenMPThreads then "ON" else "OFF"}"
64 # Only do tests that don't require downloading 120MB of testdata
66 ctest -R "eccodes_t_(definitions|calendar|unit_tests|md5|uerra|grib_2nd_order_numValues|julian)" -VV
70 homepage = "https://confluence.ecmwf.int/display/ECC/";
71 license = licenses.asl20;
72 maintainers = with maintainers; [ knedlsepp ];
73 platforms = platforms.unix;
74 description = "ECMWF library for reading and writing GRIB, BUFR and GTS abbreviated header";