edk2/OVMF: Support build on macOS

In order to use OVMF firmware with e.g. qemu on macOS, these packages
needed to be made macOS ready. This meant choosing the clang build in
this case, because it is the only one working on macOS.

Unfortunately, just using clang on all platforms doesn't work because
there are hardcoded assumptions in the edk2 build system.
This commit is contained in:
Markus Partheymüller
2020-04-20 09:53:32 +02:00
parent e3efdbf3f8
commit f5f53288cc
2 changed files with 34 additions and 10 deletions
@@ -17,9 +17,13 @@ let
throw "Unsupported architecture";
version = lib.getVersion edk2;
buildType = if stdenv.isDarwin then
"CLANGPDB"
else
"GCC5";
in
edk2.mkDerivation projectDscPath {
edk2.mkDerivation projectDscPath buildType {
name = "OVMF-${version}";
outputs = [ "out" "fd" ];
@@ -57,6 +61,6 @@ edk2.mkDerivation projectDscPath {
description = "Sample UEFI firmware for QEMU and KVM";
homepage = https://github.com/tianocore/tianocore.github.io/wiki/OVMF;
license = stdenv.lib.licenses.bsd2;
platforms = ["x86_64-linux" "i686-linux" "aarch64-linux"];
platforms = ["x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin"];
};
}