diff options
Diffstat (limited to 'pkgs/by-name/mc/mcumgr-client/package.nix')
-rw-r--r-- | pkgs/by-name/mc/mcumgr-client/package.nix | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/by-name/mc/mcumgr-client/package.nix b/pkgs/by-name/mc/mcumgr-client/package.nix new file mode 100644 index 0000000000000..d80bb6231ec14 --- /dev/null +++ b/pkgs/by-name/mc/mcumgr-client/package.nix @@ -0,0 +1,46 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + nix-update-script, + pkg-config, + udev, + stdenv, + darwin, +}: + +rustPlatform.buildRustPackage rec { + pname = "mcumgr-client"; + version = "0.0.4"; + + src = fetchFromGitHub { + owner = "vouch-opensource"; + repo = "mcumgr-client"; + rev = "v${version}"; + hash = "sha256-MTNMnA5/CzwVrhNhDrfaXOatT4BFmc4nOPhIxTyc248="; + }; + + cargoLock = { + lockFile = ./Cargo.lock; + }; + + passthru.updateScript = nix-update-script { }; + + postPatch = '' + ln -s ${./Cargo.lock} Cargo.lock + ''; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = + lib.optionals stdenv.isLinux [ udev ] + ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.IOKit ]; + + meta = with lib; { + description = "Client for mcumgr commands"; + homepage = "https://github.com/vouch-opensource/mcumgr-client"; + license = licenses.asl20; + maintainers = with maintainers; [ otavio ]; + mainProgram = "mcumgr-client"; + }; +} |