mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 20:39:04 +02:00
edk2/OVMF: Determine build type from CC setting
This commit is contained in:
parent
fe8afcb993
commit
94d114dc2a
|
@ -17,13 +17,9 @@ let
|
||||||
throw "Unsupported architecture";
|
throw "Unsupported architecture";
|
||||||
|
|
||||||
version = lib.getVersion edk2;
|
version = lib.getVersion edk2;
|
||||||
buildType = if stdenv.isDarwin then
|
|
||||||
"CLANGPDB"
|
|
||||||
else
|
|
||||||
"GCC5";
|
|
||||||
in
|
in
|
||||||
|
|
||||||
edk2.mkDerivation projectDscPath buildType {
|
edk2.mkDerivation projectDscPath {
|
||||||
name = "OVMF-${version}";
|
name = "OVMF-${version}";
|
||||||
|
|
||||||
outputs = [ "out" "fd" ];
|
outputs = [ "out" "fd" ];
|
||||||
|
|
|
@ -30,6 +30,11 @@ buildStdenv = if stdenv.isDarwin then
|
||||||
else
|
else
|
||||||
stdenv;
|
stdenv;
|
||||||
|
|
||||||
|
buildType = if stdenv.isDarwin then
|
||||||
|
"CLANGPDB"
|
||||||
|
else
|
||||||
|
"GCC5";
|
||||||
|
|
||||||
edk2 = buildStdenv.mkDerivation {
|
edk2 = buildStdenv.mkDerivation {
|
||||||
pname = "edk2";
|
pname = "edk2";
|
||||||
version = "201911";
|
version = "201911";
|
||||||
|
@ -44,9 +49,9 @@ edk2 = buildStdenv.mkDerivation {
|
||||||
buildInputs = [ libuuid pythonEnv ];
|
buildInputs = [ libuuid pythonEnv ];
|
||||||
|
|
||||||
makeFlags = [ "-C BaseTools" ]
|
makeFlags = [ "-C BaseTools" ]
|
||||||
++ lib.optional (stdenv.isDarwin) [ "BUILD_CC=clang BUILD_CXX=clang++ BUILD_AS=clang" ];
|
++ lib.optional (stdenv.cc.isClang) [ "BUILD_CC=clang BUILD_CXX=clang++ BUILD_AS=clang" ];
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = "-Wno-return-type" + lib.optionalString (!stdenv.isDarwin) " -Wno-error=stringop-truncation";
|
NIX_CFLAGS_COMPILE = "-Wno-return-type" + lib.optionalString (stdenv.cc.isGNU) " -Wno-error=stringop-truncation";
|
||||||
|
|
||||||
hardeningDisable = [ "format" "fortify" ];
|
hardeningDisable = [ "format" "fortify" ];
|
||||||
|
|
||||||
|
@ -66,7 +71,7 @@ edk2 = buildStdenv.mkDerivation {
|
||||||
};
|
};
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
mkDerivation = projectDscPath: buildType: attrs: buildStdenv.mkDerivation ({
|
mkDerivation = projectDscPath: attrs: buildStdenv.mkDerivation ({
|
||||||
inherit (edk2) src;
|
inherit (edk2) src;
|
||||||
|
|
||||||
buildInputs = [ bc pythonEnv ] ++ attrs.buildInputs or [];
|
buildInputs = [ bc pythonEnv ] ++ attrs.buildInputs or [];
|
||||||
|
|
Loading…
Reference in a new issue