diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2014-08-29 01:22:47 +0400 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2014-08-29 01:22:47 +0400 |
commit | 469f22d717e53c48d13a66ca862942e8098accc5 (patch) | |
tree | ea3b52ac0f28cb5ca86ef2da98d71adfb76427cd /pkgs/tools/misc/grub | |
parent | 0078bc5d8f87512104902eab00c8a44bef286067 (diff) | |
parent | 0fdbc444113a80c1bd0477676a33ab1fb27bae1a (diff) | |
download | nixpkgs-469f22d717e53c48d13a66ca862942e8098accc5.tar nixpkgs-469f22d717e53c48d13a66ca862942e8098accc5.tar.gz nixpkgs-469f22d717e53c48d13a66ca862942e8098accc5.tar.bz2 nixpkgs-469f22d717e53c48d13a66ca862942e8098accc5.tar.lz nixpkgs-469f22d717e53c48d13a66ca862942e8098accc5.tar.xz nixpkgs-469f22d717e53c48d13a66ca862942e8098accc5.tar.zst nixpkgs-469f22d717e53c48d13a66ca862942e8098accc5.zip |
Merge pull request #2449 from wkennington/master.grub
Grub Update
Diffstat (limited to 'pkgs/tools/misc/grub')
-rw-r--r-- | pkgs/tools/misc/grub/2.0x.nix | 62 |
1 files changed, 33 insertions, 29 deletions
diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index b1877bdcf98..e3c07af759c 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -1,30 +1,45 @@ -{ fetchurl, stdenv, flex, bison, gettext, ncurses, libusb, freetype, qemu -, devicemapper, EFIsupport ? false }: - +{ stdenv, fetchurl, autogen, flex, bison, python, autoconf, automake +, gettext, ncurses, libusb, freetype, qemu, devicemapper +, linuxPackages ? null +, efiSupport ? false +, zfsSupport ? false +}: + +with stdenv.lib; let + efiSystems = { + "i686-linux".target = "i386"; + "x86_64-linux".target = "x86_64"; + }; - prefix = "grub${if EFIsupport then "-efi" else ""}"; + canEfi = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) efiSystems); - version = "2.00"; + prefix = "grub${if efiSupport then "-efi" else ""}"; + + version = "2.02-beta2"; unifont_bdf = fetchurl { url = "http://unifoundry.com/unifont-5.1.20080820.bdf.gz"; sha256 = "0s0qfff6n6282q28nwwblp5x295zd6n71kl43xj40vgvdqxv0fxx"; }; +in ( -in +assert efiSupport -> canEfi; +assert zfsSupport -> linuxPackages != null && linuxPackages.zfs != null; stdenv.mkDerivation rec { name = "${prefix}-${version}"; src = fetchurl { - url = "mirror://gnu/grub/grub-${version}.tar.xz"; - sha256 = "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq"; + name = "grub-2.02-beta2.tar.xz"; + url = "http://alpha.gnu.org/gnu/grub/grub-2.02~beta2.tar.xz"; + sha256 = "13a13fhc0wf473dn73zhga15mjvkg6vqp4h25dxg4n7am2r05izn"; }; - nativeBuildInputs = [ flex bison ]; + nativeBuildInputs = [ autogen flex bison python autoconf automake ]; buildInputs = [ ncurses libusb freetype gettext devicemapper ] - ++ stdenv.lib.optional doCheck qemu; + ++ optional doCheck qemu + ++ optional zfsSupport linuxPackages.zfs; preConfigure = '' for i in "tests/util/"*.in @@ -43,27 +58,19 @@ stdenv.mkDerivation rec { # See <http://www.mail-archive.com/qemu-devel@nongnu.org/msg22775.html>. sed -i "tests/util/grub-shell.in" \ -e's/qemu-system-i386/qemu-system-x86_64 -nodefaults/g' - - # Fix for building on Glibc 2.16. Won't be needed once the - # gnulib in grub is updated. - sed -i '/gets is a security hole/d' grub-core/gnulib/stdio.in.h ''; prePatch = - '' gunzip < "${unifont_bdf}" > "unifont.bdf" + '' sh autogen.sh + gunzip < "${unifont_bdf}" > "unifont.bdf" sed -i "configure" \ -e "s|/usr/src/unifont.bdf|$PWD/unifont.bdf|g" ''; patches = [ ./fix-bash-completion.patch ]; - configureFlags = - let arch = if stdenv.system == "i686-linux" then "i386" - else if stdenv.system == "x86_64-linux" then "x86_64" - else throw "unsupported EFI firmware architecture"; - in - stdenv.lib.optionals EFIsupport - [ "--with-platform=efi" "--target=${arch}" "--program-prefix=" ]; + configureFlags = optional zfsSupport "--enable-libzfs" + ++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystems.${stdenv.system}.target}" "--program-prefix=" ]; doCheck = false; enableParallelBuilding = true; @@ -72,7 +79,7 @@ stdenv.mkDerivation rec { paxmark pms $out/sbin/grub-{probe,bios-setup} ''; - meta = { + meta = with stdenv.lib; { description = "GNU GRUB, the Grand Unified Boot Loader (2.x beta)"; longDescription = @@ -89,11 +96,8 @@ stdenv.mkDerivation rec { homepage = http://www.gnu.org/software/grub/; - license = stdenv.lib.licenses.gpl3Plus; + license = licenses.gpl3Plus; - platforms = if EFIsupport then - [ "i686-linux" "x86_64-linux" ] - else - stdenv.lib.platforms.gnu; + platforms = platforms.gnu; }; -} +}) |