10 , jlinkSupport ? false
13 stdenv.mkDerivation rec {
18 url = "https://download.flashrom.org/releases/flashrom-v${version}.tar.bz2";
19 hash = "sha256-oFMjRFPM0BLnnzRDvcxhYlz5e3/Xy0zdi/v/vosUliM=";
22 nativeBuildInputs = [ pkg-config installShellFiles ];
23 buildInputs = [ libftdi1 libusb1 ]
24 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pciutils ]
25 ++ lib.optional jlinkSupport libjaylink;
28 substituteInPlace util/flashrom_udev.rules \
29 --replace 'GROUP="plugdev"' 'TAG+="uaccess", TAG+="udev-acl"'
32 makeFlags = [ "PREFIX=$(out)" "libinstall" ]
33 ++ lib.optional jlinkSupport "CONFIG_JLINK_SPI=yes"
34 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ "CONFIG_INTERNAL_X86=no" "CONFIG_INTERNAL_DMI=no" "CONFIG_RAYER_SPI=no" ];
37 install -Dm644 util/flashrom_udev.rules $out/lib/udev/rules.d/flashrom.rules
41 homepage = "https://www.flashrom.org";
42 description = "Utility for reading, writing, erasing and verifying flash ROM chips";
43 license = licenses.gpl2Plus;
44 maintainers = with maintainers; [ fpletz felixsinger ];
45 platforms = platforms.all;
46 mainProgram = "flashrom";