acr-cli: init at 0.14 (#359508)
[NixPkgs.git] / pkgs / by-name / el / elf2nucleus / package.nix
blobde0b88e988060634c19c7288aa2fca9cd1055e17
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   cargoHash = "sha256-IeQnI6WTzxSI/VzoHtVukZtB1jX98wzLOT01NMLD5wQ=";
23   nativeBuildInputs = [ installShellFiles ];
25   buildInputs = [ micronucleus ];
27   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
28     installShellCompletion --cmd elf2nucleus \
29       --bash <($out/bin/elf2nucleus --completions bash) \
30       --fish <($out/bin/elf2nucleus --completions fish) \
31       --zsh <($out/bin/elf2nucleus --completions zsh)
32   '';
34   meta = with lib; {
35     description = "Integrate micronucleus into the cargo buildsystem, flash an AVR firmware from an elf file";
36     mainProgram = "elf2nucleus";
37     homepage = "https://github.com/kpcyrd/elf2nucleus";
38     license = licenses.gpl3Plus;
39     maintainers = [ maintainers.marble ];
40   };