mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-30 08:44:31 +00:00
Merge pull request #291897 from funkeleinhorn/add-flashprog
Refactor flashprog
This commit is contained in:
commit
7c636c48b7
@ -6801,6 +6801,15 @@
|
||||
githubId = 21362942;
|
||||
name = "Fugi";
|
||||
};
|
||||
funkeleinhorn = {
|
||||
email = "git@funkeleinhorn.com";
|
||||
github = "funkeleinhorn";
|
||||
githubId = 103313934;
|
||||
name = "Funkeleinhorn";
|
||||
keys = [{
|
||||
fingerprint = "689D 1C81 DA0D 1EB2 F029 D24E C7BE A25A 0A33 5A72";
|
||||
}];
|
||||
};
|
||||
fusion809 = {
|
||||
email = "brentonhorne77@gmail.com";
|
||||
github = "fusion809";
|
||||
|
@ -2,15 +2,17 @@
|
||||
, installShellFiles
|
||||
, lib
|
||||
, libftdi1
|
||||
, libgpiod_1
|
||||
, libgpiod
|
||||
, libjaylink
|
||||
, libusb1
|
||||
, pciutils
|
||||
, pkg-config
|
||||
, stdenv
|
||||
, withJlink ? true
|
||||
, withGpio ? stdenv.isLinux
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation {
|
||||
pname = "flashprog";
|
||||
version = "1.0.1";
|
||||
|
||||
@ -24,24 +26,36 @@ stdenv.mkDerivation rec {
|
||||
installShellFiles
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libftdi1
|
||||
libjaylink
|
||||
libusb1
|
||||
] ++ lib.optionals (!stdenv.isDarwin) [
|
||||
libgpiod_1
|
||||
pciutils
|
||||
] ++ lib.optionals (withJlink) [
|
||||
libjaylink
|
||||
] ++ lib.optionals (withGpio) [
|
||||
libgpiod
|
||||
];
|
||||
|
||||
makeFlags = [ "PREFIX=$(out)" "libinstall" ]
|
||||
++ lib.optionals stdenv.isDarwin [ "CONFIG_ENABLE_LIBPCI_PROGRAMMERS=no" ]
|
||||
++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ "CONFIG_INTERNAL_X86=no" "CONFIG_INTERNAL_DMI=no" "CONFIG_RAYER_SPI=0" ];
|
||||
makeFlags =
|
||||
let
|
||||
yesNo = flag: if flag then "yes" else "no";
|
||||
in
|
||||
[
|
||||
"libinstall"
|
||||
"PREFIX=$(out)"
|
||||
"CONFIG_JLINK_SPI=${yesNo withJlink}"
|
||||
"CONFIG_LINUX_GPIO_SPI=${yesNo withGpio}"
|
||||
"CONFIG_ENABLE_LIBPCI_PROGRAMMERS=${yesNo (!stdenv.isDarwin)}"
|
||||
"CONFIG_INTERNAL_X86=${yesNo (!(stdenv.isDarwin) && stdenv.isx86_64)}"
|
||||
"CONFIG_INTERNAL_DMI=${yesNo (!(stdenv.isDarwin) && stdenv.isx86_64)}"
|
||||
"CONFIG_RAYER_SPI=${yesNo (!(stdenv.isDarwin) && stdenv.isx86_64)}"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://flashprog.org";
|
||||
description = "Utility for reading, writing, erasing and verifying flash ROM chips";
|
||||
license = with licenses; [ gpl2 gpl2Plus ];
|
||||
license = with licenses; [ gpl2Plus ];
|
||||
maintainers = with maintainers; [ felixsinger ];
|
||||
platforms = platforms.all;
|
||||
mainProgram = "flashprog";
|
||||
|
Loading…
Reference in New Issue
Block a user