summary refs log tree commit diff
path: root/pkgs/development/tools/misc/teensy-loader-cli/default.nix
blob: e03320f84295ad9581452f9a308efc5076b01ed9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ stdenv, fetchFromGitHub, go-md2man, installShellFiles, libusb }:

stdenv.mkDerivation rec {
  pname = "teensy-loader-cli";
  version = "2.1.20191110";

  src = fetchFromGitHub {
    owner = "PaulStoffregen";
    repo = "teensy_loader_cli";
    rev = "e98b5065cdb9f04aa4dde3f2e6e6e6f12dd97592";
    sha256 = "1yx8vsh6b29pqr4zb6sx47429i9x51hj9psn8zksfz75j5ivfd5i";
  };

  buildInputs = [ libusb ];

  nativeBuildInputs = [ go-md2man installShellFiles ];

  installPhase = ''
    install -Dm555 teensy_loader_cli $out/bin/teensy-loader-cli
    install -Dm444 -t $out/share/doc/${pname} *.md *.txt
    go-md2man -in README.md -out ${pname}.1
    installManPage *.1
  '';

  meta = with stdenv.lib; {
    description = "Firmware uploader for the Teensy microcontroller boards";
    homepage = "https://www.pjrc.com/teensy/";
    license = licenses.gpl3;
    maintainers = with maintainers; [ the-kenny ];
    platforms = platforms.unix;
  };
}