gnu-efi: 3.0.18 -> 4.0.0, adopt, modernise; gnu-efi_3: init at 3.0.19 (#388761)

This commit is contained in:
Masum Reza
2025-03-16 17:03:19 +05:30
committed by GitHub
6 changed files with 101 additions and 58 deletions
+5
View File
@@ -220,6 +220,11 @@ lib.mapAttrs mkLicense ({
fullName = "Lawrence Berkeley National Labs BSD variant license";
};
bsdAxisNoDisclaimerUnmodified = {
fullName = "BSD-Axis without Warranty Disclaimer with Unmodified requirement";
url = "https://scancode-licensedb.aboutcode.org/bsd-no-disclaimer-unmodified.html";
};
bsdOriginal = {
spdxId = "BSD-4-Clause";
fullName = ''BSD 4-clause "Original" or "Old" License'';
+69
View File
@@ -0,0 +1,69 @@
{
lib,
stdenv,
buildPackages,
fetchFromGitHub,
pciutils,
fwupd-efi,
ipxe,
refind,
syslinux,
}:
assert lib.assertMsg stdenv.hostPlatform.isEfi "gnu-efi may only be built for EFI platforms";
stdenv.mkDerivation (finalAttrs: {
pname = "gnu-efi";
version = "4.0.0";
src = fetchFromGitHub {
owner = "ncroxon";
repo = "gnu-efi";
tag = finalAttrs.version;
hash = "sha256-vVtJkAPe5tPDLAFZibnJRC7G7WtOg11JT5QipdO+FIk=";
};
buildInputs = [ pciutils ];
hardeningDisable = [ "stackprotector" ];
makeFlags = [
"PREFIX=\${out}"
"HOSTCC=${buildPackages.stdenv.cc.targetPrefix}cc"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
postPatch = ''
substituteInPlace Make.defaults \
--replace "-Werror" ""
'';
passthru.tests = {
inherit
fwupd-efi
ipxe
syslinux
;
};
meta = {
description = "GNU EFI development toolchain";
homepage = "https://github.com/ncroxon/gnu-efi";
license = with lib.licenses; [
# This is a mess, upstream is aware.
# The source for these is Fedora's SPDX identifier for this package.
# Fedora also has gpl2Only here, but 4.0.0 doesn't have gpl2Only code.
# However, both upstream and Fedora seems to have missed
# bsdAxisNoDisclaimerUnmodified and MIT.
bsd2
bsd2Patent
bsd3
bsdAxisNoDisclaimerUnmodified
bsdOriginal
gpl2Plus
mit
];
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ lzcunt ];
};
})
+20
View File
@@ -0,0 +1,20 @@
{
fetchFromGitHub,
gnu-efi,
refind,
}:
gnu-efi.overrideAttrs (
finalAttrs: prevAttrs: {
version = "3.0.19";
src = fetchFromGitHub {
owner = "ncroxon";
repo = "gnu-efi";
rev = finalAttrs.version;
hash = "sha256-xtiKglLXm9m4li/8tqbOsyM6ThwGhyu/g4kw5sC4URY=";
};
passthru.tests = {
inherit refind;
};
}
)
+7 -7
View File
@@ -2,7 +2,7 @@
lib,
stdenv,
fetchurl,
gnu-efi,
gnu-efi_3,
nixosTests,
efibootmgr,
openssl,
@@ -54,17 +54,17 @@ stdenv.mkDerivation rec {
];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ gnu-efi ];
buildInputs = [ gnu-efi_3 ];
hardeningDisable = [ "stackprotector" ];
makeFlags =
[
"prefix="
"EFIINC=${gnu-efi}/include/efi"
"EFILIB=${gnu-efi}/lib"
"GNUEFILIB=${gnu-efi}/lib"
"EFICRT0=${gnu-efi}/lib"
"EFIINC=${gnu-efi_3}/include/efi"
"EFILIB=${gnu-efi_3}/lib"
"GNUEFILIB=${gnu-efi_3}/lib"
"EFICRT0=${gnu-efi_3}/lib"
"HOSTARCH=${hostarch}"
"ARCH=${hostarch}"
]
@@ -173,7 +173,7 @@ stdenv.mkDerivation rec {
Linux kernels that provide EFI stub support.
'';
homepage = "http://refind.sourceforge.net/";
maintainers = with maintainers; [ ];
maintainers = with maintainers; [ johnrtitor ];
platforms = [
"i686-linux"
"x86_64-linux"
@@ -1,47 +0,0 @@
{ lib, stdenv, buildPackages, fetchFromGitHub, pciutils
, gitUpdater, fwupd-efi, ipxe, refind, syslinux }:
stdenv.mkDerivation rec {
pname = "gnu-efi";
version = "3.0.18";
src = fetchFromGitHub {
owner = "ncroxon";
repo = "gnu-efi";
rev = version;
hash = "sha256-WTXUIBiyWEVCKfhUUWK5vrK6XmcvsAMl4CuhEw5oYWI=";
};
buildInputs = [ pciutils ];
hardeningDisable = [ "stackprotector" ];
makeFlags = [
"PREFIX=\${out}"
"HOSTCC=${buildPackages.stdenv.cc.targetPrefix}cc"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
postPatch = ''
substituteInPlace Make.defaults \
--replace "-Werror" ""
'';
passthru = {
updateScript = gitUpdater {
# No nicer place to find latest release.
url = "https://git.code.sf.net/p/gnu-efi/code";
};
tests = {
inherit fwupd-efi ipxe refind syslinux;
};
};
meta = with lib; {
description = "GNU EFI development toolchain";
homepage = "https://sourceforge.net/projects/gnu-efi/";
license = licenses.bsd3;
platforms = platforms.linux;
maintainers = [ ];
};
}
-4
View File
@@ -9001,10 +9001,6 @@ with pkgs;
qxmpp = qt6Packages.callPackage ../development/libraries/qxmpp { };
gnu-efi = if stdenv.hostPlatform.isEfi
then callPackage ../development/libraries/gnu-efi { }
else null;
gnutls = callPackage ../development/libraries/gnutls {
inherit (darwin.apple_sdk.frameworks) Security;
util-linux = util-linuxMinimal; # break the cyclic dependency