OCaml findlib: OCAMLPATH could be undefined

This commit is contained in:
John Ericson 2019-11-05 19:43:24 -05:00
parent 9167482d12
commit 67cc85ec67

View File

@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
setupHook = writeText "setupHook.sh" ''
addOCamlPath () {
if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib"; then
export OCAMLPATH="''${OCAMLPATH}''${OCAMLPATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/"
export OCAMLPATH="''${OCAMLPATH-}''${OCAMLPATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/"
fi
if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs"; then
export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs"