From 45c3600bb13554ab0c68a6a3d2d3d5fe0af39ef3 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Fri, 10 Mar 2023 19:08:39 -0800 Subject: [PATCH] buildDunePackage: fix doc installation The default directory where dune expects docs is in `$out/doc`, but Nix installs it in `$out/share/doc` --- pkgs/build-support/ocaml/dune.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index ce3b389b9cee..1ad2d236446a 100644 --- a/pkgs/build-support/ocaml/dune.nix +++ b/pkgs/build-support/ocaml/dune.nix @@ -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 '';