2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2021-08-23 13:56:10 +01:00
|
|
|
, stdenv
|
2021-08-23 13:39:23 +01:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libusb1
|
|
|
|
, libftdi1
|
|
|
|
, pkg-config
|
|
|
|
, rustfmt
|
2021-08-23 13:56:10 +01:00
|
|
|
, AppKit
|
2021-08-23 13:39:23 +01:00
|
|
|
}:
|
2020-08-24 12:07:21 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-embed";
|
2021-06-24 00:18:43 +01:00
|
|
|
version = "0.11.0";
|
2020-08-24 12:07:21 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "probe-rs";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-06-24 00:18:43 +01:00
|
|
|
sha256 = "151zdnv4i0dgkk4w3j2a1sdklcxw07bgqjs7sv6lvkylrx8dfrxa";
|
2020-08-24 12:07:21 +01:00
|
|
|
};
|
|
|
|
|
2021-06-24 00:18:43 +01:00
|
|
|
cargoSha256 = "00p2rwqrax99kwadc8bfq8pbcijals2nzpx43wb03kwxl4955wn9";
|
2020-08-24 12:07:21 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config rustfmt ];
|
2021-08-23 13:56:10 +01:00
|
|
|
buildInputs = [ libusb1 libftdi1 ] ++ lib.optionals stdenv.isDarwin [ AppKit ];
|
2021-05-11 01:43:37 +01:00
|
|
|
|
|
|
|
cargoBuildFlags = [ "--features=ftdi" ];
|
2020-08-24 12:07:21 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-10-11 06:55:05 +01:00
|
|
|
description = "A cargo extension for working with microcontrollers";
|
2020-10-23 14:05:17 +01:00
|
|
|
homepage = "https://probe.rs/";
|
2020-08-24 12:07:21 +01:00
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
|
|
maintainers = with maintainers; [ fooker ];
|
|
|
|
};
|
|
|
|
}
|