buildDunePackage: add support for pre and post phase hooks

Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
This commit is contained in:
Théo Zimmermann 2018-11-05 13:58:01 +01:00
parent 794158fcd5
commit 406405d8bd
No known key found for this signature in database
GPG Key ID: F1744A0942F536C7

View File

@ -9,9 +9,21 @@ else
stdenv.mkDerivation ({
buildPhase = "dune build -p ${pname}";
checkPhase = "dune runtest -p ${pname}";
inherit (dune) installPhase;
buildPhase = ''
runHook preBuild
dune build -p ${pname}
runHook postBuild
'';
checkPhase = ''
runHook preCheck
dune runtest -p ${pname}
runHook postCheck
'';
installPhase = ''
runHook preInstall
${dune.installPhase}
runHook postInstall
'';
meta.platform = ocaml.meta.platform;