mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-27 12:36:51 +03:00
32 lines
635 B
Nix
32 lines
635 B
Nix
|
{ mkCargoDerivation
|
||
|
, cargo-llvm-cov
|
||
|
}:
|
||
|
|
||
|
{ cargoExtraArgs ? ""
|
||
|
, cargoLlvmCovCommand ? "test"
|
||
|
, cargoLlvmCovExtraArgs ? "--lcov --output-path $out"
|
||
|
, ...
|
||
|
}@origArgs:
|
||
|
|
||
|
let
|
||
|
args = builtins.removeAttrs origArgs [
|
||
|
"cargoExtraArgs"
|
||
|
"cargoLlvmCovCommand"
|
||
|
"cargoLlvmCovExtraArgs"
|
||
|
];
|
||
|
in
|
||
|
|
||
|
mkCargoDerivation (args // {
|
||
|
pnameSuffix = "-llvm-cov";
|
||
|
|
||
|
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cargo-llvm-cov ];
|
||
|
|
||
|
doInstallCargoArtifacts = false;
|
||
|
|
||
|
buildPhaseCargoCommand = ''
|
||
|
cargoWithProfile llvm-cov "${cargoLlvmCovCommand}" ${cargoExtraArgs} ${cargoLlvmCovExtraArgs}
|
||
|
'';
|
||
|
|
||
|
installPhaseCommand = "";
|
||
|
})
|