Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
80 lines
1.8 KiB
Nix
80 lines
1.8 KiB
Nix
{
|
|
fetchgit,
|
|
gitUpdater,
|
|
lib,
|
|
libftdi1,
|
|
libgpiod,
|
|
libjaylink,
|
|
libusb1,
|
|
meson,
|
|
ninja,
|
|
pciutils,
|
|
pkg-config,
|
|
stdenv,
|
|
withJlink ? true,
|
|
withGpio ? stdenv.hostPlatform.isLinux,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "flashprog";
|
|
version = "1.4";
|
|
|
|
src = fetchgit {
|
|
url = "https://review.sourcearcade.org/flashprog";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-mpSmPZ306DedRi3Dcck/cDqoumgwFYpljiJtma+LZz4=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
meson
|
|
ninja
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [
|
|
libftdi1
|
|
libusb1
|
|
]
|
|
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
|
|
pciutils
|
|
]
|
|
++ lib.optionals withJlink [
|
|
libjaylink
|
|
]
|
|
++ lib.optionals withGpio [
|
|
libgpiod
|
|
];
|
|
|
|
postPatch = ''
|
|
# Remove these rules from flashprog to avoid conflicts with libftdi
|
|
sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001"/d' "util/50-flashprog.rules"
|
|
sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010"/d' "util/50-flashprog.rules"
|
|
sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011"/d' "util/50-flashprog.rules"
|
|
sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014"/d' "util/50-flashprog.rules"
|
|
'';
|
|
|
|
postInstall = ''
|
|
install -Dm644 ../util/50-flashprog.rules "$out/lib/udev/rules.d/50-flashprog.rules"
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
|
|
passthru.updateScript = gitUpdater {
|
|
rev-prefix = "v";
|
|
allowedVersions = "^[0-9\\.]+$";
|
|
};
|
|
|
|
meta = with lib; {
|
|
homepage = "https://flashprog.org";
|
|
description = "Utility for reading, writing, erasing and verifying flash ROM chips";
|
|
changelog = "https://flashprog.org/wiki/Flashprog/v${finalAttrs.version}";
|
|
license = with licenses; [ gpl2 ];
|
|
maintainers = with maintainers; [
|
|
felixsinger
|
|
funkeleinhorn
|
|
];
|
|
platforms = platforms.all;
|
|
mainProgram = "flashprog";
|
|
};
|
|
})
|