2023-08-13 20:50:43 +02:00
|
|
|
{ lib, runCommand, makeBinaryWrapper, rust-audit-info, cargo, cargo-auditable }:
|
2022-12-07 06:18:58 +01:00
|
|
|
|
2023-08-26 23:07:05 +02:00
|
|
|
if cargo-auditable.meta.broken then
|
|
|
|
cargo
|
|
|
|
else
|
2023-04-24 20:19:25 +02:00
|
|
|
runCommand "auditable-${cargo.name}" {
|
2023-04-24 20:18:23 +02:00
|
|
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
2023-08-13 20:50:43 +02:00
|
|
|
|
|
|
|
passthru.tests = runCommand "rust-audit-info-test" {
|
|
|
|
nativeBuildInputs = [ rust-audit-info ];
|
|
|
|
} ''
|
|
|
|
rust-audit-info ${lib.getBin rust-audit-info}/bin/rust-audit-info > $out
|
|
|
|
'';
|
|
|
|
|
2022-12-07 06:18:58 +01:00
|
|
|
meta = cargo-auditable.meta // {
|
|
|
|
mainProgram = "cargo";
|
|
|
|
};
|
2023-04-24 20:18:23 +02:00
|
|
|
} ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper ${cargo}/bin/cargo $out/bin/cargo \
|
|
|
|
--set CARGO_AUDITABLE_IGNORE_UNSUPPORTED 1 \
|
2023-08-13 20:43:11 +02:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ cargo cargo-auditable ]} \
|
|
|
|
--add-flags auditable
|
2023-04-24 20:18:23 +02:00
|
|
|
''
|