1{ stdenv, fetchFromGitHub, go-md2man, installShellFiles, libusb-compat-0_1 }:
2
3stdenv.mkDerivation rec {
4 pname = "teensy-loader-cli";
5 version = "2.1.20191110";
6
7 src = fetchFromGitHub {
8 owner = "PaulStoffregen";
9 repo = "teensy_loader_cli";
10 rev = "e98b5065cdb9f04aa4dde3f2e6e6e6f12dd97592";
11 sha256 = "1yx8vsh6b29pqr4zb6sx47429i9x51hj9psn8zksfz75j5ivfd5i";
12 };
13
14 buildInputs = [ libusb-compat-0_1 ];
15
16 nativeBuildInputs = [ go-md2man installShellFiles ];
17
18 installPhase = ''
19 install -Dm555 teensy_loader_cli $out/bin/teensy-loader-cli
20 install -Dm444 -t $out/share/doc/${pname} *.md *.txt
21 go-md2man -in README.md -out ${pname}.1
22 installManPage *.1
23 '';
24
25 meta = with stdenv.lib; {
26 description = "Firmware uploader for the Teensy microcontroller boards";
27 homepage = "https://www.pjrc.com/teensy/";
28 license = licenses.gpl3;
29 platforms = platforms.unix;
30 };
31}