13 withGpio ? stdenv.hostPlatform.isLinux,
16 stdenv.mkDerivation (finalAttrs: {
21 url = "https://review.sourcearcade.org/flashprog";
22 rev = "v${finalAttrs.version}";
23 hash = "sha256-S+UKDtpKYenwm+zR+Bg8HHxb2Jr7mFHAVCZdZTqCyRQ=";
35 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
38 ++ lib.optionals (withJlink) [
41 ++ lib.optionals (withGpio) [
47 yesNo = flag: if flag then "yes" else "no";
52 "CONFIG_JLINK_SPI=${yesNo withJlink}"
53 "CONFIG_LINUX_GPIO_SPI=${yesNo withGpio}"
54 "CONFIG_ENABLE_LIBPCI_PROGRAMMERS=${yesNo (!stdenv.hostPlatform.isDarwin)}"
55 "CONFIG_INTERNAL_X86=${yesNo (!(stdenv.hostPlatform.isDarwin) && stdenv.hostPlatform.isx86_64)}"
56 "CONFIG_INTERNAL_DMI=${yesNo (!(stdenv.hostPlatform.isDarwin) && stdenv.hostPlatform.isx86_64)}"
57 "CONFIG_RAYER_SPI=${yesNo (!(stdenv.hostPlatform.isDarwin) && stdenv.hostPlatform.isx86_64)}"
61 homepage = "https://flashprog.org";
62 description = "Utility for reading, writing, erasing and verifying flash ROM chips";
63 license = with licenses; [ gpl2Plus ];
64 maintainers = with maintainers; [
68 platforms = platforms.all;
69 mainProgram = "flashprog";