dune: let dune install itself

This commit is contained in:
sternenseemann 2021-01-08 17:25:54 +01:00 committed by Vincent Laporte
parent 223474d8ac
commit f3704de649

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, ocaml, findlib, opaline }:
{ stdenv, fetchurl, ocaml, findlib }:
if !stdenv.lib.versionAtLeast ocaml.version "4.02"
then throw "dune is not available for OCaml ${ocaml.version}"
@ -15,15 +15,13 @@ stdenv.mkDerivation rec {
buildInputs = [ ocaml findlib ];
buildFlags = [ "release" ];
makeFlags = [
"PREFIX=${placeholder "out"}"
"LIBDIR=$(OCAMLFIND_DESTDIR)"
];
dontAddPrefix = true;
installPhase = ''
runHook preInstall
${opaline}/bin/opaline -prefix $out -libdir $OCAMLFIND_DESTDIR
runHook postInstall
'';
meta = {
homepage = "https://dune.build/";
description = "A composable build system";