Unverified Commit dca5800d authored by misuzu's avatar misuzu Committed by GitHub
Browse files

lm4flash: init at 0.1.3 (#369386)

parents 3cbcf3eb a1210cfc
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -15312,6 +15312,12 @@
    githubId = 44561540;
    name = "Synth Morxemplum";
  };
  MostafaKhaled = {
    email = "mostafa.khaled.5422@gmail.com";
    github = "mostafa-khaled775";
    githubId = 112074172;
    name = "Mostafa Khaled";
  };
  MostAwesomeDude = {
    email = "cds@corbinsimpson.com";
    github = "MostAwesomeDude";
+57 −0
Original line number Diff line number Diff line
{
  fetchFromGitHub,
  stdenv,
  libusb1,
  pkg-config,
  lib,
  writeText,
}:
let
  stellaris-udev-rules = writeText "61.stellpad.rules" ''
    SUBSYSTEM=="usb", ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666"
  '';
in
stdenv.mkDerivation rec {
  pname = "lm4flash";
  version = "0.1.3";

  src = fetchFromGitHub {
    owner = "utzig";
    repo = "lm4tools";
    tag = "v${version}";
    hash = "sha256-ZjuCH/XjQEgg6KHAvb95/BkAy+C2OdbtBb/i6K30+uo=";
  };
  sourceRoot = "${src.name}/lm4flash";

  strictDeps = true;

  nativeBuildInputs = [
    pkg-config
  ];

  buildInputs = [
    libusb1
  ];

  buildFlags = [ "release" ];

  installFlags = [ "PREFIX=$(out)" ];

  postInstall = ''
    install -Dm644 "${stellaris-udev-rules}" "$out/etc/udev/rules.d/61.stellpad.rules"
  '';

  meta = {
    description = "Command-line firmware flashing tool for the Stellaris Launchpad";
    longDescription = ''
      Command-line firmware flashing tool using libusb-1.0 to communicate with
      the Stellaris Launchpad ICDI. Works on all Linux, Mac OS X, Windows, and
      BSD systems.
    '';
    homepage = "https://github.com/utzig/lm4tools";
    license = lib.licenses.gpl2Plus;
    mainProgram = "lm4flash";
    maintainers = with lib.maintainers; [ MostafaKhaled ];
    platforms = lib.platforms.all;
  };
}