about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/rust/svd2rust/default.nix
blob: c66cbe3c2c823736ddd0d62d56c8079d321e1f47 (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
{ lib, stdenv, fetchFromGitHub, rustPlatform, libiconv }:

with rustPlatform;

buildRustPackage rec {
  pname = "svd2rust";
  version = "0.18.0";

  src = fetchFromGitHub {
    owner = "rust-embedded";
    repo = "svd2rust";
    rev = "v${version}";
    sha256 = "1p0zq3q4g9lr0ghavp7v1dwsqq19lkljkm1i2hsb1sk3pxa1f69n";
  };
  cargoPatches = [ ./cargo-lock.patch ];

  cargoSha256 = "0c0f86x17fzav5q76z3ha3g00rbgyz2lm5a5v28ggy0jmg9xgsv6";

  buildInputs = lib.optional stdenv.isDarwin libiconv;

  meta = with lib; {
    description = "Generate Rust register maps (`struct`s) from SVD files";
    homepage = "https://github.com/rust-embedded/svd2rust";
    license = with licenses; [ mit asl20 ];
  };
}