Unverified Commit 39abaaa2 authored by tomberek's avatar tomberek Committed by GitHub
Browse files

Merge pull request #301926 from otavio/mcumgr

mcumgr-client: init at 0.0.4
parents 3e1e3b27 1fcc6b0e
Loading
Loading
Loading
Loading
+965 −0

File added.

Preview size limit exceeded, changes collapsed.

+46 −0
Original line number Diff line number Diff line
{
  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";
  };
}