nixpkgs/pkgs/by-name/ca/cargo-show-asm/package.nix

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

48 lines
1.3 KiB
Nix
Raw Normal View History

2022-10-17 09:34:50 +00:00
{ lib
, rustPlatform
, fetchCrate
2022-10-17 09:34:50 +00:00
, installShellFiles
2022-10-19 23:46:56 +00:00
, stdenv
2022-10-17 09:34:50 +00:00
, nix-update-script
2022-10-17 10:00:35 +00:00
, callPackage
2022-10-17 09:34:50 +00:00
}:
2022-10-19 23:46:56 +00:00
2022-10-17 09:34:50 +00:00
rustPlatform.buildRustPackage rec {
pname = "cargo-show-asm";
version = "0.2.41";
2022-10-17 09:34:50 +00:00
src = fetchCrate {
inherit pname version;
hash = "sha256-U9i/xp9WxMYf4GMsZB7qYOpuuuEw4mWZp+ZEyguGtQQ=";
2022-10-17 09:34:50 +00:00
};
cargoHash = "sha256-eUaEpex9x9bdqPJ4p5QvkWKaxs3ih4Gb9+4deGBZgXU=";
2022-10-17 09:34:50 +00:00
2022-10-19 23:46:56 +00:00
nativeBuildInputs = [
installShellFiles
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
2022-10-19 23:46:56 +00:00
installShellCompletion --cmd cargo-asm \
2022-10-17 09:34:50 +00:00
--bash <($out/bin/cargo-asm --bpaf-complete-style-bash) \
--fish <($out/bin/cargo-asm --bpaf-complete-style-fish) \
2022-10-19 23:46:56 +00:00
--zsh <($out/bin/cargo-asm --bpaf-complete-style-zsh)
2022-10-17 09:34:50 +00:00
'';
2022-10-17 10:00:35 +00:00
passthru = {
updateScript = nix-update-script { };
2022-10-17 10:00:35 +00:00
tests = lib.optionalAttrs stdenv.hostPlatform.isx86_64 {
test-basic-x86_64 = callPackage ./test-basic-x86_64.nix { };
};
2022-10-17 09:34:50 +00:00
};
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";
changelog = "https://github.com/pacak/cargo-show-asm/blob/${version}/Changelog.md";
2022-10-17 09:34:50 +00:00
license = with licenses; [ asl20 mit ];
maintainers = with maintainers; [ figsoda oxalica matthiasbeyer ];
2023-05-27 21:01:05 +00:00
mainProgram = "cargo-asm";
2022-10-17 09:34:50 +00:00
};
}