nixpkgs/pkgs/by-name/es/espflash/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.5 KiB
Nix
Raw Permalink Normal View History

{
lib
, rustPlatform
, fetchFromGitHub
, pkg-config
2024-02-12 13:14:57 +01:00
, installShellFiles
, udev
, stdenv
2024-03-28 12:04:37 +01:00
, CoreServices
, Security
, nix-update-script
, openssl
, SystemConfiguration
}:
rustPlatform.buildRustPackage rec {
pname = "espflash";
2024-03-13 13:17:30 +01:00
version = "3.0.0";
src = fetchFromGitHub {
owner = "esp-rs";
repo = "espflash";
rev = "v${version}";
2024-03-13 13:17:30 +01:00
hash = "sha256-0CnYdz1KG/y4B+dOp9rYE097ctf4GNmyqv3/xywdA6A=";
};
nativeBuildInputs = [
pkg-config
2024-02-12 13:14:57 +01:00
installShellFiles
];
# Needed to get openssl-sys to use pkg-config.
OPENSSL_NO_VENDOR = 1;
buildInputs = [ openssl ] ++ lib.optionals stdenv.isLinux [
udev
] ++ lib.optionals stdenv.isDarwin [
2024-03-28 12:04:37 +01:00
CoreServices
Security
SystemConfiguration
];
2024-03-13 13:17:30 +01:00
cargoHash = "sha256-CmhBl+d5odc0QL45aWCJcBZIVeJsdpxJweh7FT8cpyY=";
2024-02-12 13:14:57 +01:00
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd espflash \
--bash <($out/bin/espflash completions bash) \
--zsh <($out/bin/espflash completions zsh) \
--fish <($out/bin/espflash completions fish)
'';
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "Serial flasher utility for Espressif SoCs and modules based on esptool.py";
homepage = "https://github.com/esp-rs/espflash";
changelog = "https://github.com/esp-rs/espflash/blob/v${version}/CHANGELOG.md";
mainProgram = "espflash";
license = with licenses; [ mit /* or */ asl20 ];
maintainers = with maintainers; [ matthiasbeyer ];
};
}