1{ stdenv
2, lib
3, fetchFromGitHub
4, go-md2man
5, installShellFiles
6, libusb-compat-0_1
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "teensy-loader-cli";
11 version = "2.2";
12
13 src = fetchFromGitHub {
14 owner = "PaulStoffregen";
15 repo = "teensy_loader_cli";
16 rev = finalAttrs.version;
17 sha256 = "sha256-C9Qhd6LhAES7X0sh4rofjAM+gxwuosahVQHeR76LyIo=";
18 };
19
20 nativeBuildInputs = [
21 go-md2man
22 installShellFiles
23 ];
24
25 buildInputs = [
26 libusb-compat-0_1
27 ];
28
29 installPhase = ''
30 runHook preInstall
31
32 install -Dm555 teensy_loader_cli $out/bin/teensy-loader-cli
33 install -Dm444 -t $out/share/doc/teensy-loader-cli *.md *.txt
34 go-md2man -in README.md -out teensy-loader-cli.1
35 installManPage *.1
36
37 runHook postInstall
38 '';
39
40 meta = with lib; {
41 description = "Firmware uploader for the Teensy microcontroller boards";
42 homepage = "https://www.pjrc.com/teensy/";
43 license = licenses.gpl3Only;
44 platforms = platforms.unix;
45 };
46})