about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/rust/cargo-binutils/default.nix
blob: f499512ce53227e1e16bff2ba6f0cc46ccbb9a0b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib, fetchFromGitHub, rustPlatform, runCommand }:

rustPlatform.buildRustPackage rec {
  pname = "cargo-binutils";
  version = "0.3.3";

  # Upstream doesn't commit `Cargo.lock`, see https://github.com/rust-embedded/cargo-binutils/pull/99
  src =
    let
      repo = fetchFromGitHub {
        owner = "rust-embedded";
        repo = pname;
        rev = "v${version}";
        sha256 = "sha256-Dgn+f4aSsDSh+RC8yvt3ydkdtwib5jEVsnZkod5c7Vo=";
      };
    in
    runCommand "source" { } ''
      cp -R ${repo} $out
      chmod -R +w $out
      cp ${./Cargo.lock} $out/Cargo.lock
    '';

  cargoSha256 = "sha256-6du86HxkDQAeIXScXBKuv0j4YZiG4O6IwVIXZnJgTO8=";

  meta = with lib; {
    description = "Cargo subcommands to invoke the LLVM tools shipped with the Rust toolchain.";
    longDescription = ''
      In order for this to work, you either need to run `rustup component add llvm-tools-preview` or install the `llvm-tools-preview` component using your Nix library (e.g. nixpkgs-mozilla, or rust-overlay)
    '';
    homepage = "https://github.com/rust-embedded/cargo-binutils";
    license = with licenses; [ asl20 mit ];
    maintainers = with maintainers; [ stupremee ];
  };
}