nixpkgs/pkgs/development/compilers/rust/cargo-auditable-cargo-wrapper.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
694 B
Nix
Raw Normal View History

{ lib, runCommand, makeBinaryWrapper, rust-audit-info, cargo, cargo-auditable }:
2022-12-07 06:18:58 +01:00
if cargo-auditable.meta.broken then
cargo
else
runCommand "auditable-${cargo.name}" {
nativeBuildInputs = [ makeBinaryWrapper ];
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";
};
} ''
mkdir -p $out/bin
makeWrapper ${cargo}/bin/cargo $out/bin/cargo \
--set CARGO_AUDITABLE_IGNORE_UNSUPPORTED 1 \
--prefix PATH : ${lib.makeBinPath [ cargo cargo-auditable ]} \
--add-flags auditable
''