|
60 | 60 | riscv64-linux.target = "riscv64";
|
61 | 61 | };
|
62 | 62 |
|
63 |
| - canEfi = lib.any (system: stdenv.hostPlatform.system == system) ( |
64 |
| - lib.mapAttrsToList (name: _: name) efiSystemsBuild |
65 |
| - ); |
66 |
| - inPCSystems = lib.any (system: stdenv.hostPlatform.system == system) ( |
67 |
| - lib.mapAttrsToList (name: _: name) pcSystems |
68 |
| - ); |
| 63 | + xenSystemsBuild = { |
| 64 | + i686-linux.target = "i386"; |
| 65 | + x86_64-linux.target = "x86_64"; |
| 66 | + }; |
| 67 | + |
| 68 | + inPCSystems = lib.any (system: stdenv.hostPlatform.system == system) (lib.attrNames pcSystems); |
69 | 69 |
|
70 | 70 | gnulib = fetchFromSavannah {
|
71 | 71 | repo = "gnulib";
|
|
88 | 88 | hash = "sha256-IoRiJHNQ58y0UhCAD0CrpFiI8Mz1upzAtyh5K4Njh/w=";
|
89 | 89 | };
|
90 | 90 | in
|
| 91 | + |
| 92 | +assert zfsSupport -> zfs != null; |
| 93 | +assert !(efiSupport && xenSupport); |
| 94 | + |
91 | 95 | stdenv.mkDerivation rec {
|
92 | 96 | pname = "grub";
|
93 | 97 | version = "2.12";
|
@@ -605,7 +609,7 @@ stdenv.mkDerivation rec {
|
605 | 609 | ]
|
606 | 610 | ++ lib.optionals xenSupport [
|
607 | 611 | "--with-platform=xen"
|
608 |
| - "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" |
| 612 | + "--target=${xenSystemsBuild.${stdenv.hostPlatform.system}.target}" |
609 | 613 | ];
|
610 | 614 |
|
611 | 615 | # save target that grub is compiled for
|
@@ -653,16 +657,13 @@ stdenv.mkDerivation rec {
|
653 | 657 | license = licenses.gpl3Plus;
|
654 | 658 |
|
655 | 659 | platforms =
|
656 |
| - if xenSupport then |
657 |
| - [ |
658 |
| - "x86_64-linux" |
659 |
| - "i686-linux" |
660 |
| - ] |
| 660 | + if efiSupport then |
| 661 | + lib.attrNames efiSystemsBuild |
| 662 | + else if xenSupport then |
| 663 | + lib.attrNames xenSystemsBuild |
661 | 664 | else
|
662 | 665 | platforms.gnu ++ platforms.linux;
|
663 | 666 |
|
664 | 667 | maintainers = [ ];
|
665 |
| - |
666 |
| - broken = !(efiSupport -> canEfi) || !(zfsSupport -> zfs != null) || (efiSupport && xenSupport); |
667 | 668 | };
|
668 | 669 | }
|
0 commit comments