From 461c5847079342003b7629f0fac5d8d19a8d8c4b Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Sun, 2 Jun 2024 20:26:12 +0200 Subject: [PATCH] dediprog-sf100: init at 1.14.20.x 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 --- pkgs/by-name/de/dediprog-sf100/package.nix | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 pkgs/by-name/de/dediprog-sf100/package.nix diff --git a/pkgs/by-name/de/dediprog-sf100/package.nix b/pkgs/by-name/de/dediprog-sf100/package.nix new file mode 100644 index 0000000000000..8de2013b66aa0 --- /dev/null +++ b/pkgs/by-name/de/dediprog-sf100/package.nix @@ -0,0 +1,51 @@ +{ + 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 ]; + }; +})