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''; diff --git a/pkgs/by-name/gn/gnu-efi/package.nix b/pkgs/by-name/gn/gnu-efi/package.nix new file mode 100644 index 000000000000..4c61c8d4c3a3 --- /dev/null +++ b/pkgs/by-name/gn/gnu-efi/package.nix @@ -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 ]; + }; +}) 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; + }; + } +) diff --git a/pkgs/by-name/re/refind/package.nix b/pkgs/by-name/re/refind/package.nix index 2b77b5b7916e..29f684f86ef8 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}" ] @@ -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" diff --git a/pkgs/development/libraries/gnu-efi/default.nix b/pkgs/development/libraries/gnu-efi/default.nix deleted file mode 100644 index a675633b503d..000000000000 --- a/pkgs/development/libraries/gnu-efi/default.nix +++ /dev/null @@ -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 = [ ]; - }; -} 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