Merge pull request #140902 from felixsinger/pkgs/flashrom/add-libjaylink

flashrom: Add support for Segger J-Link devices

authored by

Lassulus and committed by
GitHub
e7c8c949 fe49c16a

+20 -19
+20 -19
pkgs/tools/misc/flashrom/default.nix
··· 1 - { lib 2 - , stdenv 3 - , fetchurl 4 - , meson 5 - , ninja 6 - , pkg-config 1 + { fetchurl 2 + , gcc9Stdenv 3 + , installShellFiles 4 + , lib 7 5 , libftdi1 6 + , libjaylink 8 7 , libusb1 9 8 , pciutils 10 - , installShellFiles 9 + , pkg-config 10 + , jlinkSupport ? false 11 11 }: 12 12 13 - stdenv.mkDerivation rec { 13 + gcc9Stdenv.mkDerivation rec { 14 14 pname = "flashrom"; 15 15 version = "1.2"; 16 16 ··· 19 19 sha256 = "0ax4kqnh7kd3z120ypgp73qy1knz47l6qxsqzrfkd97mh5cdky71"; 20 20 }; 21 21 22 + nativeBuildInputs = [ pkg-config installShellFiles ]; 23 + buildInputs = [ libftdi1 libusb1 ] 24 + # https://github.com/flashrom/flashrom/issues/125 25 + ++ lib.optional (!gcc9Stdenv.isAarch64) pciutils 26 + ++ lib.optional jlinkSupport libjaylink; 27 + 22 28 postPatch = '' 23 29 substituteInPlace util/z60_flashrom.rules \ 24 30 --replace "plugdev" "flashrom" 25 31 ''; 26 32 27 - # Meson build doesn't build and install manpage. Only Makefile can. 28 - # Build manpage from source directory. Here we're inside the ./build subdirectory 33 + makeFlags = [ "PREFIX=$(out)" "libinstall" ] 34 + ++ lib.optional jlinkSupport "CONFIG_JLINK_SPI=yes"; 35 + 29 36 postInstall = '' 30 - make flashrom.8 -C .. 31 - installManPage ../flashrom.8 32 - install -Dm644 ../util/z60_flashrom.rules $out/etc/udev/rules.d/flashrom.rules 37 + install -Dm644 util/z60_flashrom.rules $out/lib/udev/rules.d/flashrom.rules 33 38 ''; 34 - 35 - mesonFlags = lib.optionals stdenv.isAarch64 [ "-Dpciutils=false" ]; 36 - nativeBuildInputs = [ meson pkg-config ninja installShellFiles ]; 37 - buildInputs = [ libftdi1 libusb1 pciutils ]; 38 39 39 40 meta = with lib; { 40 - homepage = "http://www.flashrom.org"; 41 + homepage = "https://www.flashrom.org"; 41 42 description = "Utility for reading, writing, erasing and verifying flash ROM chips"; 42 43 license = licenses.gpl2; 43 44 maintainers = with maintainers; [ funfunctor fpletz felixsinger ]; 44 45 platforms = platforms.all; 45 - broken = stdenv.isDarwin; # requires DirectHW 46 + broken = gcc9Stdenv.isDarwin; # requires DirectHW 46 47 }; 47 48 }