OVMF: fix build on x86_64-darwin

ZHF #199919
This commit is contained in:
Randy Eckenrode 2022-11-06 19:36:57 -05:00
parent 4d3207ecf7
commit b808a354d2
No known key found for this signature in database
GPG Key ID: 64C1CD4EC2A600D9

View File

@ -1,4 +1,4 @@
{ stdenv, nixosTests, lib, edk2, util-linux, nasm, acpica-tools
{ stdenv, nixosTests, lib, edk2, util-linux, nasm, acpica-tools, llvmPackages
, csmSupport ? false, seabios ? null
, secureBoot ? false
, httpSupport ? false
@ -33,7 +33,8 @@ edk2.mkDerivation projectDscPath (finalAttrs: {
outputs = [ "out" "fd" ];
nativeBuildInputs = [ util-linux nasm acpica-tools ];
nativeBuildInputs = [ util-linux nasm acpica-tools ]
++ lib.optionals stdenv.cc.isClang [ llvmPackages.bintools llvmPackages.llvm ];
strictDeps = true;
hardeningDisable = [ "format" "stackprotector" "pic" "fortify" ];
@ -44,6 +45,8 @@ edk2.mkDerivation projectDscPath (finalAttrs: {
++ lib.optionals httpSupport [ "-D NETWORK_HTTP_ENABLE=TRUE" "-D NETWORK_HTTP_BOOT_ENABLE=TRUE" ]
++ lib.optionals tpmSupport [ "-D TPM_ENABLE" "-D TPM2_ENABLE" "-D TPM2_CONFIG_ENABLE"];
NIX_CFLAGS_COMPILE = lib.optional stdenv.cc.isClang "-Qunused-arguments";
postPatch = lib.optionalString csmSupport ''
cp ${seabios}/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin
'';