1{ lib
2, stdenv
3, rustPlatform
4, fetchFromGitHub
5, libusb1
6, libftdi1
7, pkg-config
8, rustfmt
9, AppKit
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "cargo-embed";
14 version = "0.13.0";
15
16 src = fetchFromGitHub {
17 owner = "probe-rs";
18 repo = pname;
19 rev = "v${version}";
20 sha256 = "sha256-UlQ7KJmzPWu0vVsYPIkYeqkFFhxe7mEMfUVN7iMaUw0=";
21 };
22
23 cargoSha256 = "sha256-RkYX5z764Kkr0xK7yYQ0lCw0/7KpmdJmKWqLzwkj4hs=";
24
25 nativeBuildInputs = [ pkg-config rustfmt ];
26 buildInputs = [ libusb1 libftdi1 ] ++ lib.optionals stdenv.isDarwin [ AppKit ];
27
28 buildFeatures = [ "ftdi" ];
29
30 meta = with lib; {
31 description = "A cargo extension for working with microcontrollers";
32 homepage = "https://probe.rs/";
33 changelog = "https://github.com/probe-rs/cargo-embed/blob/v${version}/CHANGELOG.md";
34 license = with licenses; [ asl20 /* or */ mit ];
35 maintainers = with maintainers; [ fooker newam ];
36 };
37}