2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
2022-10-30 15:09:59 +00:00
|
|
|
, fetchFromGitHub
|
2022-10-21 18:38:19 +00:00
|
|
|
, installShellFiles
|
2022-10-30 15:09:59 +00:00
|
|
|
, stdenv
|
2022-10-21 18:38:19 +00:00
|
|
|
, nix-update-script
|
|
|
|
, callPackage
|
|
|
|
}:
|
2022-10-30 15:09:59 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-asm";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "0.2.0";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pacak";
|
|
|
|
repo = "cargo-show-asm";
|
|
|
|
rev = version;
|
2022-10-30 15:09:59 +00:00
|
|
|
hash = "sha256-qsr28zuvu+i7P/MpwhDKQFFXTyFFo+vWrjBrpD1V8PY=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
cargoHash = "sha256-IL+BB08uZr5fm05ITxpm66jTb+pYYlLKOwQ8uf5rKSs=";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-10-30 15:09:59 +00:00
|
|
|
installShellCompletion --cmd cargo-asm \
|
2022-10-21 18:38:19 +00:00
|
|
|
--bash <($out/bin/cargo-asm --bpaf-complete-style-bash) \
|
|
|
|
--fish <($out/bin/cargo-asm --bpaf-complete-style-fish) \
|
2022-10-30 15:09:59 +00:00
|
|
|
--zsh <($out/bin/cargo-asm --bpaf-complete-style-zsh)
|
2022-10-21 18:38:19 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
attrPath = pname;
|
|
|
|
};
|
|
|
|
tests = lib.optionalAttrs stdenv.hostPlatform.isx86_64 {
|
|
|
|
test-basic-x86_64 = callPackage ./test-basic-x86_64.nix { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Cargo subcommand showing the assembly, LLVM-IR and MIR generated for Rust code";
|
|
|
|
homepage = "https://github.com/pacak/cargo-show-asm";
|
|
|
|
license = with licenses; [ asl20 mit ];
|
2022-10-30 15:09:59 +00:00
|
|
|
maintainers = with maintainers; [ figsoda oxalica ];
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
}
|