Merge pull request #199940 from reckenrode/zhf-edk2-darwin

This commit is contained in:
Martin Weinelt 2022-11-07 13:23:02 +01:00 committed by GitHub
commit ba047a1e4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

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
'';

View File

@ -61,7 +61,7 @@ edk2 = buildStdenv.mkDerivation {
${"GCC5_${targetArch}_PREFIX"}=stdenv.cc.targetPrefix;
makeFlags = [ "-C BaseTools" ]
++ lib.optionals (stdenv.cc.isClang) [ "BUILD_CC=clang BUILD_CXX=clang++ BUILD_AS=clang" ];
++ lib.optionals (stdenv.cc.isClang) [ "CXX=llvm BUILD_AR=ar BUILD_CC=clang BUILD_CXX=clang++ BUILD_AS=clang BUILD_LD=ld" ];
NIX_CFLAGS_COMPILE = "-Wno-return-type" + lib.optionalString (stdenv.cc.isGNU) " -Wno-error=stringop-truncation";

View File

@ -1,5 +1,7 @@
{ lib
, stdenv
, edk2
, llvmPackages
, util-linux
, nasm
, python3
@ -8,9 +10,12 @@ edk2.mkDerivation "ShellPkg/ShellPkg.dsc" (finalAttrs: {
pname = "edk2-uefi-shell";
inherit (edk2) version;
nativeBuildInputs = [ util-linux nasm python3 ];
nativeBuildInputs = [ util-linux nasm python3 ]
++ lib.optionals stdenv.cc.isClang [ llvmPackages.bintools llvmPackages.llvm ];
strictDeps = true;
NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isClang [ "-fno-pic" "-Qunused-arguments" ];
# We only have a .efi file in $out which shouldn't be patched or stripped
dontPatchELF = true;
dontStrip = true;