From 8e1e15cf11e50d5a5466caf4479b0981a698e305 Mon Sep 17 00:00:00 2001 From: sanana Date: Sun, 9 Mar 2025 23:34:11 +0300 Subject: [PATCH 1/7] lib/licenses: add bsdAxisNoDisclaimerUnmodified This is a variant composed of clause 1 and 3 of a BSD-Modified found in the Linux kernel and this extra variant has the words "without modification" added at the end of clause 1 either with or without a comma. It also lacks the warranty disclaimer. See . --- lib/licenses.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/licenses.nix b/lib/licenses.nix index 5d0aff11b7a3..44fca61afbbd 100644 --- a/lib/licenses.nix +++ b/lib/licenses.nix @@ -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''; From 3fc3e474c5549c907cb7900c79007e08280a78f1 Mon Sep 17 00:00:00 2001 From: sanana Date: Mon, 10 Mar 2025 20:16:16 +0300 Subject: [PATCH 2/7] gnu-efi: 3.0.18 -> 4.0.0, fix meta, format This update may break packages that depend on gnu-efi, as this is an ABI break and most upstream packages have not been updated to support this release. --- .../development/libraries/gnu-efi/default.nix | 62 +++++++++++++------ 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/pkgs/development/libraries/gnu-efi/default.nix b/pkgs/development/libraries/gnu-efi/default.nix index a675633b503d..837cbe3c4188 100644 --- a/pkgs/development/libraries/gnu-efi/default.nix +++ b/pkgs/development/libraries/gnu-efi/default.nix @@ -1,15 +1,26 @@ -{ lib, stdenv, buildPackages, fetchFromGitHub, pciutils -, gitUpdater, fwupd-efi, ipxe, refind, syslinux }: +{ + lib, + stdenv, + buildPackages, + fetchFromGitHub, + pciutils, + fwupd-efi, + ipxe, + refind, + syslinux, +}: -stdenv.mkDerivation rec { +assert lib.assertMsg stdenv.hostPlatform.isEfi "gnu-efi may only be built for EFI platforms"; + +stdenv.mkDerivation (finalAttrs: { pname = "gnu-efi"; - version = "3.0.18"; + version = "4.0.0"; src = fetchFromGitHub { owner = "ncroxon"; repo = "gnu-efi"; - rev = version; - hash = "sha256-WTXUIBiyWEVCKfhUUWK5vrK6XmcvsAMl4CuhEw5oYWI="; + tag = finalAttrs.version; + hash = "sha256-vVtJkAPe5tPDLAFZibnJRC7G7WtOg11JT5QipdO+FIk="; }; buildInputs = [ pciutils ]; @@ -27,21 +38,32 @@ stdenv.mkDerivation rec { --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; - }; + passthru.tests = { + inherit + fwupd-efi + ipxe + syslinux + ; }; - meta = with lib; { + meta = { description = "GNU EFI development toolchain"; - homepage = "https://sourceforge.net/projects/gnu-efi/"; - license = licenses.bsd3; - platforms = platforms.linux; - maintainers = [ ]; + 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; [ ]; }; -} +}) From 819f04e96985d4bd95245f447dce784a724414cb Mon Sep 17 00:00:00 2001 From: sanana Date: Mon, 10 Mar 2025 20:22:12 +0300 Subject: [PATCH 3/7] gnu-efi: move to by-name/ --- .../gnu-efi/default.nix => by-name/gn/gnu-efi/package.nix} | 0 pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 4 deletions(-) rename pkgs/{development/libraries/gnu-efi/default.nix => by-name/gn/gnu-efi/package.nix} (100%) diff --git a/pkgs/development/libraries/gnu-efi/default.nix b/pkgs/by-name/gn/gnu-efi/package.nix similarity index 100% rename from pkgs/development/libraries/gnu-efi/default.nix rename to pkgs/by-name/gn/gnu-efi/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9dcf99c47ce9..6c13fd742be3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 From 9fadf9802a05faa9cbd20c3caa08fabad92b6da4 Mon Sep 17 00:00:00 2001 From: sanana Date: Wed, 12 Mar 2025 18:09:46 +0300 Subject: [PATCH 4/7] gnu-efi: add lzcunt as maintainer --- pkgs/by-name/gn/gnu-efi/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/gn/gnu-efi/package.nix b/pkgs/by-name/gn/gnu-efi/package.nix index 837cbe3c4188..4c61c8d4c3a3 100644 --- a/pkgs/by-name/gn/gnu-efi/package.nix +++ b/pkgs/by-name/gn/gnu-efi/package.nix @@ -64,6 +64,6 @@ stdenv.mkDerivation (finalAttrs: { mit ]; platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ ]; + maintainers = with lib.maintainers; [ lzcunt ]; }; }) From 4d057a7924668c163aa2675c1c1705b0ff77daaa Mon Sep 17 00:00:00 2001 From: sanana Date: Sun, 16 Mar 2025 13:43:25 +0300 Subject: [PATCH 5/7] gnu-efi_3: init at 3.0.19 GNU-EFI was updated to 4.0.0, however rEFInd does not support 4.0.0 yet, so we have to keep GNU-EFI 3. --- pkgs/by-name/gn/gnu-efi_3/package.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pkgs/by-name/gn/gnu-efi_3/package.nix diff --git a/pkgs/by-name/gn/gnu-efi_3/package.nix b/pkgs/by-name/gn/gnu-efi_3/package.nix new file mode 100644 index 000000000000..ad04a677616e --- /dev/null +++ b/pkgs/by-name/gn/gnu-efi_3/package.nix @@ -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; + }; + } +) From 52918060b954949e22a71e65534938b464bb5871 Mon Sep 17 00:00:00 2001 From: sanana Date: Mon, 10 Mar 2025 20:23:36 +0300 Subject: [PATCH 6/7] refind: fix build by using `gnu-efi_3` instead of `gnu-efi` --- pkgs/by-name/re/refind/package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/re/refind/package.nix b/pkgs/by-name/re/refind/package.nix index 2b77b5b7916e..24c108f1423a 100644 --- a/pkgs/by-name/re/refind/package.nix +++ b/pkgs/by-name/re/refind/package.nix @@ -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}" ] From d43fa3231a38e272ffcb0df42af97e782553c8ce Mon Sep 17 00:00:00 2001 From: sanana Date: Sun, 16 Mar 2025 14:12:34 +0300 Subject: [PATCH 7/7] refind: add johnrtitor as maintainer Authored-By: John Titor <50095635+JohnRTitor@users.noreply.github.com> --- pkgs/by-name/re/refind/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/re/refind/package.nix b/pkgs/by-name/re/refind/package.nix index 24c108f1423a..29f684f86ef8 100644 --- a/pkgs/by-name/re/refind/package.nix +++ b/pkgs/by-name/re/refind/package.nix @@ -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"