diff --git a/pkgs/development/libraries/eccodes/default.nix b/pkgs/development/libraries/eccodes/default.nix index b6d4cd29f7e1..54df7be6f1ba 100644 --- a/pkgs/development/libraries/eccodes/default.nix +++ b/pkgs/development/libraries/eccodes/default.nix @@ -24,6 +24,17 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace cmake/FindOpenJPEG.cmake --replace openjpeg-2.1 ${openjpeg.incDir} + + # https://github.com/ecmwf/ecbuild/issues/40 + substituteInPlace cmake/ecbuild_config.h.in \ + --replace @CMAKE_INSTALL_PREFIX@/@INSTALL_LIB_DIR@ @eccodes_FULL_INSTALL_LIB_DIR@ \ + --replace @CMAKE_INSTALL_PREFIX@/@INSTALL_BIN_DIR@ @eccodes_FULL_INSTALL_BIN_DIR@ + substituteInPlace cmake/pkg-config.pc.in \ + --replace '$'{prefix}/@INSTALL_LIB_DIR@ @eccodes_FULL_INSTALL_LIB_DIR@ \ + --replace '$'{prefix}/@INSTALL_INCLUDE_DIR@ @eccodes_FULL_INSTALL_INCLUDE_DIR@ \ + --replace '$'{prefix}/@INSTALL_BIN_DIR@ @eccodes_FULL_INSTALL_BIN_DIR@ + substituteInPlace cmake/ecbuild_install_project.cmake \ + --replace '$'{CMAKE_INSTALL_PREFIX}/'$'{INSTALL_INCLUDE_DIR} '$'{'$'{PROJECT_NAME}_FULL_INSTALL_INCLUDE_DIR} ''; nativeBuildInputs = [ cmake gfortran perl ];