nixpkgs/pkgs/by-name/ca/cargo-auditable/builder.nix
Ross Smyth 28a915286d cargo-auditable: add nix-update-script
(cherry picked from commit 5cd317d2da)
2026-06-26 20:06:58 +00:00

68 lines
1.7 KiB
Nix

{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
installShellFiles,
auditable-bootstrap,
}:
lib.extendMkDerivation {
constructDrv = rustPlatform.buildRustPackage.override { cargo-auditable = auditable-bootstrap; };
extendDrvArgs =
finalAttrs:
{
pname ? "cargo-auditable",
auditable ? true,
hash ? "",
cargoHash ? "",
passthru ? { },
...
}:
{
inherit auditable pname;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "rust-secure-code";
repo = "cargo-auditable";
tag = "v${finalAttrs.version}";
inherit hash;
};
nativeBuildInputs = [
installShellFiles
];
checkFlags = [
# requires wasm32-unknown-unknown target
"--skip=test_wasm"
# Seems to be a bug in tests of locked vs. semver compatible packages
# https://github.com/rust-secure-code/cargo-auditable/issues/235
"--skip=test_proc_macro"
"--skip=test_self_hosting"
];
postInstall = ''
installManPage cargo-auditable/cargo-auditable.1
'';
passthru = passthru // {
bootstrap = auditable-bootstrap;
};
meta = {
description = "Tool to make production Rust binaries auditable";
mainProgram = "cargo-auditable";
homepage = "https://github.com/rust-secure-code/cargo-auditable";
changelog = "https://github.com/rust-secure-code/cargo-auditable/blob/v${finalAttrs.version}/cargo-auditable/CHANGELOG.md";
license = with lib.licenses; [
mit # or
asl20
];
maintainers = with lib.maintainers; [ RossSmyth ];
broken = stdenv.hostPlatform != stdenv.buildPlatform;
};
};
}