ocamlPackages.findlib: don't wait configurePhase to set OCAMLFIND_DESTDIR

this fixes ocamlfind printconf destdir inside nix-shell

fixes #152028

the regression was introduced by
a3ab43d3a4 which was meant to fix building
ocamlPackages.ocamlbuild with strictDeps. This commit keeps ocamlbuild
building.
main
Guillaume Girol 2 years ago
parent cb372c3b88
commit 79fb9f824e
  1. 8
      pkgs/development/tools/ocaml/findlib/default.nix

@ -36,15 +36,21 @@ stdenv.mkDerivation rec {
export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs"
fi
}
createOcamlDestDir () {
exportOcamlDestDir () {
export OCAMLFIND_DESTDIR="''$out/lib/ocaml/${ocaml.version}/site-lib/"
}
createOcamlDestDir () {
if test -n "''${createFindlibDestdir-}"; then
mkdir -p $OCAMLFIND_DESTDIR
fi
}
# run for every buildInput
addEnvHooks "$targetOffset" addOCamlPath
# run before configurePhase, even without buildInputs, and not in nix-shell
preConfigureHooks+=(createOcamlDestDir)
# run even in nix-shell, and even without buildInputs
addEnvHooks "$hostOffset" exportOcamlDestDir
'';
meta = {

Loading…
Cancel
Save