depot/third_party/nixpkgs/pkgs/development/tools/rust/cargo-show-asm/default.nix
Default email a3d4720129 Project import generated by Copybara.
GitOrigin-RevId: e182da8622a354d44c39b3d7a542dc12cd7baa5f
2022-12-28 22:21:41 +01:00

47 lines
1.2 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, stdenv
, nix-update-script
, callPackage
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-asm";
version = "0.2.0";
src = fetchFromGitHub {
owner = "pacak";
repo = "cargo-show-asm";
rev = version;
hash = "sha256-qsr28zuvu+i7P/MpwhDKQFFXTyFFo+vWrjBrpD1V8PY=";
};
cargoHash = "sha256-IL+BB08uZr5fm05ITxpm66jTb+pYYlLKOwQ8uf5rKSs=";
nativeBuildInputs = [
installShellFiles
];
postInstall = ''
installShellCompletion --cmd cargo-asm \
--bash <($out/bin/cargo-asm --bpaf-complete-style-bash) \
--fish <($out/bin/cargo-asm --bpaf-complete-style-fish) \
--zsh <($out/bin/cargo-asm --bpaf-complete-style-zsh)
'';
passthru = {
updateScript = nix-update-script { };
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 ];
maintainers = with maintainers; [ figsoda oxalica ];
};
}