buildDunePackage: fix doc installation

The default directory where dune expects docs is in
`$out/doc`, but Nix installs it in `$out/share/doc`
This commit is contained in:
Antonio Nuno Monteiro 2023-03-10 19:08:39 -08:00 committed by Vincent Laporte
parent adb03acc9b
commit 45c3600bb1

View File

@ -30,7 +30,10 @@ stdenv.mkDerivation ({
'';
installPhase = ''
runHook preInstall
dune install --prefix $out --libdir $OCAMLFIND_DESTDIR ${pname}
dune install --prefix $out --libdir $OCAMLFIND_DESTDIR ${pname} \
${if lib.versionAtLeast Dune.version "2.9"
then "--docdir $out/share/doc"
else ""}
runHook postInstall
'';