zoxide: 0.9.6 -> 0.9.7 (#380745)
[NixPkgs.git] / pkgs / by-name / el / elf2nucleus / package.nix
blob835aab1b2fd0c6ff62ad23769159696e084f02c2
2   installShellFiles,
3   fetchFromGitHub,
4   lib,
5   micronucleus,
6   rustPlatform,
7   stdenv,
8 }:
10 rustPlatform.buildRustPackage rec {
11   pname = "elf2nucleus";
12   version = "0.1.0";
14   src = fetchFromGitHub {
15     owner = "kpcyrd";
16     repo = pname;
17     rev = "v${version}";
18     hash = "sha256-FAIOtGfGow+0DrPPEBEfvaiinNZLQlGWKJ4DkMj63OA=";
19   };
21   useFetchCargoVendor = true;
22   cargoHash = "sha256-Xw+heCEwQePyU2gElpG8PTIUZA7y+Onx+2AX2NZzDGs=";
24   nativeBuildInputs = [ installShellFiles ];
26   buildInputs = [ micronucleus ];
28   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
29     installShellCompletion --cmd elf2nucleus \
30       --bash <($out/bin/elf2nucleus --completions bash) \
31       --fish <($out/bin/elf2nucleus --completions fish) \
32       --zsh <($out/bin/elf2nucleus --completions zsh)
33   '';
35   meta = with lib; {
36     description = "Integrate micronucleus into the cargo buildsystem, flash an AVR firmware from an elf file";
37     mainProgram = "elf2nucleus";
38     homepage = "https://github.com/kpcyrd/elf2nucleus";
39     license = licenses.gpl3Plus;
40     maintainers = [ maintainers.marble ];
41   };