diff options
author | Mario Rodas <marsam@users.noreply.github.com> | 2020-04-28 04:20:00 -0500 |
---|---|---|
committer | Vincent Laporte <vbgl@users.noreply.github.com> | 2020-04-29 16:08:52 +0200 |
commit | f7ac956a2b5b8c7f3a50c63547af493c68372169 (patch) | |
tree | 1c64930933a59e259b211d9ab27e74388d2a0509 /pkgs/build-support/ocaml | |
parent | ed3fe70602461daaba13e4c1f67f622780bd271f (diff) |
buildDunePackage: add support for parallel build
dune allows to specify the number of jobs to build the package.
Diffstat (limited to 'pkgs/build-support/ocaml')
-rw-r--r-- | pkgs/build-support/ocaml/dune.nix | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index 435bbe89c1c48..b134effab8ac3 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 = '' |