edk2: use finalAttrs (#416413)

This commit is contained in:
Adam C. Stephens 2025-06-14 11:21:36 -04:00 committed by GitHub
commit e4766bb0c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,22 +31,23 @@ let
throw "Unsupported architecture"; throw "Unsupported architecture";
buildType = if stdenv.hostPlatform.isDarwin then "CLANGPDB" else "GCC5"; buildType = if stdenv.hostPlatform.isDarwin then "CLANGPDB" else "GCC5";
in
edk2 = stdenv.mkDerivation { stdenv.mkDerivation (finalAttrs: {
pname = "edk2"; pname = "edk2";
version = "202505"; version = "202505";
srcWithVendoring = fetchFromGitHub { srcWithVendoring = fetchFromGitHub {
owner = "tianocore"; owner = "tianocore";
repo = "edk2"; repo = "edk2";
tag = "edk2-stable${edk2.version}"; tag = "edk2-stable${finalAttrs.version}";
fetchSubmodules = true; fetchSubmodules = true;
hash = "sha256-VuiEqVpG/k7pfy0cOC6XmY+8NBtU/OHdDB9Y52tyNe8="; hash = "sha256-VuiEqVpG/k7pfy0cOC6XmY+8NBtU/OHdDB9Y52tyNe8=";
}; };
src = applyPatches { src = applyPatches {
name = "edk2-${edk2.version}-unvendored-src"; name = "edk2-${finalAttrs.version}-unvendored-src";
src = edk2.srcWithVendoring; src = finalAttrs.srcWithVendoring;
patches = [ patches = [
# pass targetPrefix as an env var # pass targetPrefix as an env var
@ -134,7 +135,7 @@ let
meta = { meta = {
description = "Intel EFI development kit"; description = "Intel EFI development kit";
homepage = "https://github.com/tianocore/tianocore.github.io/wiki/EDK-II/"; homepage = "https://github.com/tianocore/tianocore.github.io/wiki/EDK-II/";
changelog = "https://github.com/tianocore/edk2/releases/tag/edk2-stable${edk2.version}"; changelog = "https://github.com/tianocore/edk2/releases/tag/edk2-stable${finalAttrs.version}";
license = lib.licenses.bsd2; license = lib.licenses.bsd2;
platforms = with lib.platforms; aarch64 ++ arm ++ i686 ++ x86_64 ++ loongarch64 ++ riscv64; platforms = with lib.platforms; aarch64 ++ arm ++ i686 ++ x86_64 ++ loongarch64 ++ riscv64;
maintainers = [ lib.maintainers.mjoerg ]; maintainers = [ lib.maintainers.mjoerg ];
@ -151,7 +152,7 @@ let
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts coreutils gnused #!nix-shell -i bash -p common-updater-scripts coreutils gnused
set -eu -o pipefail set -eu -o pipefail
version="$(list-git-tags --url="${edk2.srcWithVendoring.url}" | version="$(list-git-tags --url="${finalAttrs.srcWithVendoring.url}" |
sed -E --quiet 's/^edk2-stable([0-9]{6})$/\1/p' | sed -E --quiet 's/^edk2-stable([0-9]{6})$/\1/p' |
sort --reverse --numeric-sort | sort --reverse --numeric-sort |
head -n 1)" head -n 1)"
@ -164,12 +165,12 @@ let
mkDerivation = mkDerivation =
projectDscPath: attrsOrFun: projectDscPath: attrsOrFun:
stdenv.mkDerivation ( stdenv.mkDerivation (
finalAttrs: finalAttrsInner:
let let
attrs = lib.toFunction attrsOrFun finalAttrs; attrs = lib.toFunction attrsOrFun finalAttrsInner;
in in
{ {
inherit (edk2) src; inherit (finalAttrs) src;
depsBuildBuild = [ buildPackages.stdenv.cc ] ++ attrs.depsBuildBuild or [ ]; depsBuildBuild = [ buildPackages.stdenv.cc ] ++ attrs.depsBuildBuild or [ ];
nativeBuildInputs = [ nativeBuildInputs = [
@ -210,8 +211,4 @@ let
] ]
); );
}; };
}; })
in
edk2