flashrom: fix build on aarch64

This commit is contained in:
Thomas 2021-11-12 11:35:25 -06:00 committed by Thomas Watson
parent 8f39ad3da1
commit 928b9e29e3

View file

@ -1,4 +1,5 @@
{ fetchurl { fetchurl
, fetchpatch
, gcc9Stdenv , gcc9Stdenv
, installShellFiles , installShellFiles
, lib , lib
@ -20,11 +21,18 @@ gcc9Stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ pkg-config installShellFiles ]; nativeBuildInputs = [ pkg-config installShellFiles ];
buildInputs = [ libftdi1 libusb1 ] buildInputs = [ libftdi1 libusb1 pciutils ]
# https://github.com/flashrom/flashrom/issues/125
++ lib.optional (!gcc9Stdenv.isAarch64) pciutils
++ lib.optional jlinkSupport libjaylink; ++ 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 = '' postPatch = ''
substituteInPlace util/z60_flashrom.rules \ substituteInPlace util/z60_flashrom.rules \
--replace "plugdev" "flashrom" --replace "plugdev" "flashrom"