From f7ac956a2b5b8c7f3a50c63547af493c68372169 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Tue, 28 Apr 2020 04:20:00 -0500 Subject: buildDunePackage: add support for parallel build dune allows to specify the number of jobs to build the package. --- pkgs/build-support/ocaml/dune.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pkgs/build-support/ocaml') diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index 435bbe89c1c..b134effab8a 100644 --- a/pkgs/build-support/ocaml/dune.nix +++ b/pkgs/build-support/ocaml/dune.nix @@ -1,6 +1,6 @@ { stdenv, ocaml, findlib, dune, dune_2, opaline }: -{ pname, version, buildInputs ? [], ... }@args: +{ pname, version, buildInputs ? [], enableParallelBuilding ? true, ... }@args: let Dune = if args.useDune2 or false then dune_2 else dune; in @@ -11,14 +11,16 @@ else stdenv.mkDerivation ({ + inherit enableParallelBuilding; + buildPhase = '' runHook preBuild - dune build -p ${pname} + dune build -p ${pname} ''${enableParallelBuilding:+-j $NIX_BUILD_CORES} runHook postBuild ''; checkPhase = '' runHook preCheck - dune runtest -p ${pname} + dune runtest -p ${pname} ''${enableParallelBuilding:+-j $NIX_BUILD_CORES} runHook postCheck ''; installPhase = '' -- cgit 1.4.1