14 enablePosixThreads ? false,
15 enableOpenMPThreads ? false,
18 stdenv.mkDerivation rec {
23 url = "https://confluence.ecmwf.int/download/attachments/45757960/eccodes-${version}-Source.tar.gz";
24 hash = "sha256-DE10ZwCsxJr5yHiSXxsmvdQkQ/98LXxnbesrq7aEevs=";
28 substituteInPlace cmake/FindOpenJPEG.cmake --replace openjpeg-2.1 ${openjpeg.incDir}
30 # https://github.com/ecmwf/ecbuild/issues/40
31 substituteInPlace cmake/ecbuild_config.h.in \
32 --replace @CMAKE_INSTALL_PREFIX@/@INSTALL_LIB_DIR@ @eccodes_FULL_INSTALL_LIB_DIR@ \
33 --replace @CMAKE_INSTALL_PREFIX@/@INSTALL_BIN_DIR@ @eccodes_FULL_INSTALL_BIN_DIR@
34 substituteInPlace cmake/pkg-config.pc.in \
35 --replace '$'{prefix}/@INSTALL_LIB_DIR@ @eccodes_FULL_INSTALL_LIB_DIR@ \
36 --replace '$'{prefix}/@INSTALL_INCLUDE_DIR@ @eccodes_FULL_INSTALL_INCLUDE_DIR@ \
37 --replace '$'{prefix}/@INSTALL_BIN_DIR@ @eccodes_FULL_INSTALL_BIN_DIR@
38 substituteInPlace cmake/ecbuild_install_project.cmake \
39 --replace '$'{CMAKE_INSTALL_PREFIX}/'$'{INSTALL_INCLUDE_DIR} '$'{'$'{PROJECT_NAME}_FULL_INSTALL_INCLUDE_DIR}
55 propagatedBuildInputs = lib.optionals enablePython [
61 "-DENABLE_PYTHON=${if enablePython then "ON" else "OFF"}"
63 "-DENABLE_ECCODES_THREADS=${if enablePosixThreads then "ON" else "OFF"}"
64 "-DENABLE_ECCODES_OMP_THREADS=${if enableOpenMPThreads then "ON" else "OFF"}"
69 # Only do tests that don't require downloading 120MB of testdata
71 ctest -R "eccodes_t_(definitions|calendar|unit_tests|md5|uerra|grib_2nd_order_numValues|julian)" -VV
75 homepage = "https://confluence.ecmwf.int/display/ECC/";
76 license = licenses.asl20;
77 maintainers = with maintainers; [ ];
78 platforms = platforms.unix;
79 description = "ECMWF library for reading and writing GRIB, BUFR and GTS abbreviated header";