mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-22 23:17:15 +03:00
32 lines
643 B
Nix
32 lines
643 B
Nix
{ mkCargoDerivation
|
|
, cargo-llvm-cov
|
|
}:
|
|
|
|
{ cargoExtraArgs ? "--locked"
|
|
, 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 = "";
|
|
})
|