diff options
author | Felix Singer <felixsinger@posteo.net> | 2021-10-07 23:43:16 +0200 |
---|---|---|
committer | Felix Singer <felixsinger@posteo.net> | 2021-10-13 02:29:33 +0200 |
commit | 20785d5f4dad88138a2c9299de1d944438b4fc24 (patch) | |
tree | 81af0b724b4661de967fdf327b3a5365dac45846 /pkgs/tools/misc/flashrom | |
parent | 42ef9b1a20d330c10268440d53edd02f805991dc (diff) |
flashrom: Add support for Segger J-Link devices
Add the build option `jlinkSupport`, which allows using libjaylink. It is necessary for Segger J-Link devices. This option is set to false by default. Signed-off-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'pkgs/tools/misc/flashrom')
-rw-r--r-- | pkgs/tools/misc/flashrom/default.nix | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/pkgs/tools/misc/flashrom/default.nix b/pkgs/tools/misc/flashrom/default.nix index d1a106549ab05..03465d593ff4f 100644 --- a/pkgs/tools/misc/flashrom/default.nix +++ b/pkgs/tools/misc/flashrom/default.nix @@ -1,11 +1,13 @@ -{ lib +{ fetchurl , gcc9Stdenv -, fetchurl -, pkg-config +, installShellFiles +, lib , libftdi1 +, libjaylink , libusb1 , pciutils -, installShellFiles +, pkg-config +, jlinkSupport ? false }: gcc9Stdenv.mkDerivation rec { @@ -17,23 +19,26 @@ gcc9Stdenv.mkDerivation rec { sha256 = "0ax4kqnh7kd3z120ypgp73qy1knz47l6qxsqzrfkd97mh5cdky71"; }; + nativeBuildInputs = [ pkg-config installShellFiles ]; + buildInputs = [ libftdi1 libusb1 ] + # https://github.com/flashrom/flashrom/issues/125 + ++ lib.optional (!gcc9Stdenv.isAarch64) pciutils + ++ lib.optional jlinkSupport libjaylink; + postPatch = '' substituteInPlace util/z60_flashrom.rules \ --replace "plugdev" "flashrom" ''; - makeFlags = [ "PREFIX=$(out)" "libinstall" ]; + makeFlags = [ "PREFIX=$(out)" "libinstall" ] + ++ lib.optional jlinkSupport "CONFIG_JLINK_SPI=yes"; postInstall = '' install -Dm644 util/z60_flashrom.rules $out/lib/udev/rules.d/flashrom.rules ''; - nativeBuildInputs = [ pkg-config installShellFiles ]; - buildInputs = [ libftdi1 libusb1 ] - ++ lib.optional (!gcc9Stdenv.isAarch64) pciutils; - meta = with lib; { - homepage = "http://www.flashrom.org"; + homepage = "https://www.flashrom.org"; description = "Utility for reading, writing, erasing and verifying flash ROM chips"; license = licenses.gpl2; maintainers = with maintainers; [ funfunctor fpletz felixsinger ]; |