mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
461c584707
DediProg produces SPI-based flash chip programmers which are rather common in the hardware/embedded space. Add support for their linux-based programming driver. See: https://github.com/DediProgSW/SF100Linux Signed-off-by: Markus Theil <theil.markus@gmail.com>
52 lines
1.3 KiB
Nix
52 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
pkgs,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
libusb1,
|
|
pkg-config,
|
|
}:
|
|
|
|
let
|
|
dediprogVersion = "1.14.20.x";
|
|
dediprogHash = "sha256-hQvBZIwaWEC41vj2flaekIUP9Fwtj/JPi3XwRxfUbD0=";
|
|
in
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "dediprog-sf100-linux";
|
|
version = finalAttrs.dediprogVersion;
|
|
|
|
inherit dediprogVersion dediprogHash;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "DediProgSW";
|
|
repo = "SF100Linux";
|
|
rev = "V${finalAttrs.dediprogVersion}";
|
|
hash = finalAttrs.dediprogHash;
|
|
};
|
|
|
|
buildInputs = [ libusb1 ];
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
udevRules = pkgs.writeText "dediprog.rules" ''
|
|
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="dada", MODE="660", GROUP="plugdev"
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
install -Dm0755 ./dpcmd -t $out/bin
|
|
install -Dm0644 ./ChipInfoDb.dedicfg -t $out/share/DediProg
|
|
install -Dm0644 ${finalAttrs.udevRules} -D $out/lib/udev/rules.d/60-dediprog.rules
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
homepage = "https://github.com/DediProgSW/SF100Linux";
|
|
description = "Linux software for DediProg SF100/SF600 programmers";
|
|
license = lib.licenses.gpl2;
|
|
platforms = lib.platforms.linux;
|
|
maintainers = with lib.maintainers; [ thillux ];
|
|
};
|
|
})
|