diff --git a/pkgs/tools/misc/flashrom/default.nix b/pkgs/tools/misc/flashrom/default.nix index 03465d593ff4..4c227cbe3f96 100644 --- a/pkgs/tools/misc/flashrom/default.nix +++ b/pkgs/tools/misc/flashrom/default.nix @@ -1,4 +1,5 @@ { fetchurl +, fetchpatch , gcc9Stdenv , installShellFiles , lib @@ -20,11 +21,18 @@ gcc9Stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config installShellFiles ]; - buildInputs = [ libftdi1 libusb1 ] - # https://github.com/flashrom/flashrom/issues/125 - ++ lib.optional (!gcc9Stdenv.isAarch64) pciutils + buildInputs = [ libftdi1 libusb1 pciutils ] ++ lib.optional jlinkSupport libjaylink; + patches = [ + # remove when updating from 1.2 + (fetchpatch { + name = "fix-aarch64-build.patch"; + url = "https://github.com/flashrom/flashrom/commit/da6b3b70cb852dd8e9f9e21aef95fa83e7f7ab0d.patch"; + sha256 = "sha256-fXYDXgT/ik+qtxxFEyJ7/axtycbwLkEg0UD+hzsYEwg="; + }) + ]; + postPatch = '' substituteInPlace util/z60_flashrom.rules \ --replace "plugdev" "flashrom"