flashrom: unbreak darwin

This commit is contained in:
Jiajie Chen 2023-05-09 08:58:26 +08:00
parent 6dee6324c7
commit 2472f4eaee

View File

@ -21,7 +21,8 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ pkg-config installShellFiles ]; nativeBuildInputs = [ pkg-config installShellFiles ];
buildInputs = [ libftdi1 libusb1 pciutils ] buildInputs = [ libftdi1 libusb1 ]
++ lib.optional (!stdenv.isDarwin) [ pciutils ]
++ lib.optional jlinkSupport libjaylink; ++ lib.optional jlinkSupport libjaylink;
postPatch = '' postPatch = ''
@ -30,7 +31,8 @@ stdenv.mkDerivation rec {
''; '';
makeFlags = [ "PREFIX=$(out)" "libinstall" ] makeFlags = [ "PREFIX=$(out)" "libinstall" ]
++ lib.optional jlinkSupport "CONFIG_JLINK_SPI=yes"; ++ lib.optional jlinkSupport "CONFIG_JLINK_SPI=yes"
++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ "CONFIG_INTERNAL_X86=no" "CONFIG_INTERNAL_DMI=no" "CONFIG_RAYER_SPI=no" ];
postInstall = '' postInstall = ''
install -Dm644 util/flashrom_udev.rules $out/lib/udev/rules.d/flashrom.rules install -Dm644 util/flashrom_udev.rules $out/lib/udev/rules.d/flashrom.rules
@ -42,6 +44,5 @@ stdenv.mkDerivation rec {
license = licenses.gpl2; license = licenses.gpl2;
maintainers = with maintainers; [ fpletz felixsinger ]; maintainers = with maintainers; [ fpletz felixsinger ];
platforms = platforms.all; platforms = platforms.all;
broken = stdenv.isDarwin; # requires DirectHW
}; };
} }