about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/embedded/teensy-loader-cli/default.nix
blob: e8445a9955f22f3250d90b070371b2c3be0aceec (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ stdenv
, lib
, fetchFromGitHub
, go-md2man
, installShellFiles
, libusb-compat-0_1
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "teensy-loader-cli";
  version = "2.2";

  src = fetchFromGitHub {
    owner = "PaulStoffregen";
    repo = "teensy_loader_cli";
    rev = finalAttrs.version;
    sha256 = "sha256-C9Qhd6LhAES7X0sh4rofjAM+gxwuosahVQHeR76LyIo=";
  };

  nativeBuildInputs = [
    go-md2man
    installShellFiles
  ];

  buildInputs = [
    libusb-compat-0_1
  ];

  installPhase = ''
    runHook preInstall

    install -Dm555 teensy_loader_cli $out/bin/teensy-loader-cli
    install -Dm444 -t $out/share/doc/teensy-loader-cli *.md *.txt
    go-md2man -in README.md -out teensy-loader-cli.1
    installManPage *.1

    runHook postInstall
  '';

  meta = with lib; {
    description = "Firmware uploader for the Teensy microcontroller boards";
    homepage = "https://www.pjrc.com/teensy/";
    license = licenses.gpl3Only;
    platforms = platforms.unix;
  };
})