2023-03-20 02:44:14 +03:00
|
|
|
{ mkCargoDerivation
|
|
|
|
, cargo-llvm-cov
|
|
|
|
}:
|
|
|
|
|
2023-08-27 22:17:58 +03:00
|
|
|
{ cargoExtraArgs ? "--locked"
|
2023-03-20 02:44:14 +03:00
|
|
|
, 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 = "";
|
|
|
|
})
|