Merge pull request #145667 from tpwrules/fix-flashrom-aarch64

flashrom: fix build on aarch64
This commit is contained in:
Robert Scott 2021-11-12 21:52:24 +00:00 committed by GitHub
commit cf05198542
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"