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