From 406405d8bd419627114217a8c9f08593adff1372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Zimmermann?= Date: Mon, 5 Nov 2018 13:58:01 +0100 Subject: [PATCH] buildDunePackage: add support for pre and post phase hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörg Thalheim --- pkgs/build-support/ocaml/dune.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index 8fda4d76c43c..3426f8e957d9 100644 --- a/pkgs/build-support/ocaml/dune.nix +++ b/pkgs/build-support/ocaml/dune.nix @@ -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;