mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
buildDunePackage: add support for parallel build
dune allows to specify the number of jobs to build the package.
This commit is contained in:
parent
ed3fe70602
commit
f7ac956a2b
@ -1,6 +1,6 @@
|
|||||||
{ stdenv, ocaml, findlib, dune, dune_2, opaline }:
|
{ 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
|
let Dune = if args.useDune2 or false then dune_2 else dune; in
|
||||||
|
|
||||||
@ -11,14 +11,16 @@ else
|
|||||||
|
|
||||||
stdenv.mkDerivation ({
|
stdenv.mkDerivation ({
|
||||||
|
|
||||||
|
inherit enableParallelBuilding;
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
dune build -p ${pname}
|
dune build -p ${pname} ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
runHook preCheck
|
runHook preCheck
|
||||||
dune runtest -p ${pname}
|
dune runtest -p ${pname} ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
|
||||||
runHook postCheck
|
runHook postCheck
|
||||||
'';
|
'';
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user