From f2bef62716b4c5853ea16465f31182569dbb80ef Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Mon, 21 Oct 2013 05:09:02 -0500 Subject: Update grub 2.00 to 2.02-beta2 --- pkgs/tools/misc/grub/2.0x.nix | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index b1877bdcf98c..59658e47a08f 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -1,11 +1,17 @@ -{ fetchurl, stdenv, flex, bison, gettext, ncurses, libusb, freetype, qemu -, devicemapper, EFIsupport ? false }: +{ fetchurl, stdenv, autogen, flex, bison, python, autoconf, automake +, gettext, ncurses, libusb, freetype, qemu, devicemapper +, linuxPackages ? null +, EFIsupport ? false +, zfsSupport ? false +}: + +assert zfsSupport -> linuxPackages != null && linuxPackages.zfs != null; let prefix = "grub${if EFIsupport then "-efi" else ""}"; - version = "2.00"; + version = "2.02-beta2"; unifont_bdf = fetchurl { url = "http://unifoundry.com/unifont-5.1.20080820.bdf.gz"; @@ -18,13 +24,14 @@ stdenv.mkDerivation rec { name = "${prefix}-${version}"; src = fetchurl { - url = "mirror://gnu/grub/grub-${version}.tar.xz"; - sha256 = "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq"; + url = "http://git.savannah.gnu.org/cgit/grub.git/snapshot/grub-2.02-beta2.tar.gz"; + sha256 = "1n2l7k76lqqaavz12615vx5kca0kl8g13bkimc7xsd9s7c1ir5lr"; }; - nativeBuildInputs = [ flex bison ]; + nativeBuildInputs = [ autogen flex bison python autoconf automake ]; buildInputs = [ ncurses libusb freetype gettext devicemapper ] - ++ stdenv.lib.optional doCheck qemu; + ++ stdenv.lib.optional doCheck qemu + ++ stdenv.lib.optional zfsSupport linuxPackages.zfs; preConfigure = '' for i in "tests/util/"*.in @@ -43,14 +50,11 @@ stdenv.mkDerivation rec { # See . 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" ''; @@ -61,8 +65,8 @@ stdenv.mkDerivation rec { 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 + in stdenv.lib.optional zfsSupport "--enable-libzfs" + ++ stdenv.lib.optionals EFIsupport [ "--with-platform=efi" "--target=${arch}" "--program-prefix=" ]; doCheck = false; @@ -72,7 +76,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 = @@ -87,13 +91,13 @@ stdenv.mkDerivation rec { operating system (e.g., GNU). ''; - homepage = http://www.gnu.org/software/grub/; + homepage = http://wwwp.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.gnu; }; } -- cgit 1.4.1 From 1f460e00efb99a1450f5b5806d68ff6633641ad8 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Wed, 30 Apr 2014 18:04:45 -0500 Subject: grub: Build grub2 from git instead of using the unpredictable generated tarball --- pkgs/tools/misc/grub/2.0x.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index 59658e47a08f..04971b68a845 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -1,4 +1,4 @@ -{ fetchurl, stdenv, autogen, flex, bison, python, autoconf, automake +{ stdenv, fetchurl, fetchgit, autogen, flex, bison, python, autoconf, automake , gettext, ncurses, libusb, freetype, qemu, devicemapper , linuxPackages ? null , EFIsupport ? false @@ -23,9 +23,10 @@ in stdenv.mkDerivation rec { name = "${prefix}-${version}"; - src = fetchurl { - url = "http://git.savannah.gnu.org/cgit/grub.git/snapshot/grub-2.02-beta2.tar.gz"; - sha256 = "1n2l7k76lqqaavz12615vx5kca0kl8g13bkimc7xsd9s7c1ir5lr"; + src = fetchgit { + url = "git://git.sv.gnu.org/grub.git"; + rev = "refs/tags/grub-2.02-beta2"; + sha256 = "157bknkcxibmvq19pagphlwfxd9xny7002gcanfzhjzcjpfz4scy"; }; nativeBuildInputs = [ autogen flex bison python autoconf automake ]; -- cgit 1.4.1 From 2ea1433b77755b954df979307525fa6578f241b8 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Fri, 2 May 2014 09:17:54 -0500 Subject: grub: Fetch from alpha.gnu.org instead of git --- pkgs/tools/misc/grub/2.0x.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index 04971b68a845..2c150f8ec96f 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, fetchgit, autogen, flex, bison, python, autoconf, automake +{ stdenv, fetchurl, autogen, flex, bison, python, autoconf, automake , gettext, ncurses, libusb, freetype, qemu, devicemapper , linuxPackages ? null , EFIsupport ? false @@ -23,10 +23,10 @@ in stdenv.mkDerivation rec { name = "${prefix}-${version}"; - src = fetchgit { - url = "git://git.sv.gnu.org/grub.git"; - rev = "refs/tags/grub-2.02-beta2"; - sha256 = "157bknkcxibmvq19pagphlwfxd9xny7002gcanfzhjzcjpfz4scy"; + src = fetchurl { + name = "grub-2.02-beta2.tar.xz"; + url = "http://alpha.gnu.org/gnu/grub/grub-2.02~beta2.tar.xz"; + sha256 = "13a13fhc0wf473dn73zhga15mjvkg6vqp4h25dxg4n7am2r05izn"; }; nativeBuildInputs = [ autogen flex bison python autoconf automake ]; -- cgit 1.4.1 From dd18e67cfb27515791620a0e69e4e427b77e2670 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sat, 3 May 2014 19:59:47 -0500 Subject: grub: Cleanup efi support --- pkgs/tools/misc/grub/2.0x.nix | 37 ++++++++++++++++++------------------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 19 insertions(+), 20 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index 2c150f8ec96f..028ec5657529 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -1,15 +1,20 @@ { stdenv, fetchurl, autogen, flex, bison, python, autoconf, automake , gettext, ncurses, libusb, freetype, qemu, devicemapper , linuxPackages ? null -, EFIsupport ? false +, efiSupport ? false , zfsSupport ? false }: -assert zfsSupport -> linuxPackages != null && linuxPackages.zfs != null; - +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); + + prefix = "grub${if efiSupport then "-efi" else ""}"; version = "2.02-beta2"; @@ -17,8 +22,10 @@ let 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}"; @@ -31,8 +38,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autogen flex bison python autoconf automake ]; buildInputs = [ ncurses libusb freetype gettext devicemapper ] - ++ stdenv.lib.optional doCheck qemu - ++ stdenv.lib.optional zfsSupport linuxPackages.zfs; + ++ optional doCheck qemu + ++ optional zfsSupport linuxPackages.zfs; preConfigure = '' for i in "tests/util/"*.in @@ -62,13 +69,8 @@ stdenv.mkDerivation rec { 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.optional zfsSupport "--enable-libzfs" - ++ 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; @@ -96,9 +98,6 @@ stdenv.mkDerivation rec { license = licenses.gpl3Plus; - platforms = if EFIsupport then - [ "i686-linux" "x86_64-linux" ] - else - platforms.gnu; + platforms = platforms.gnu; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2dc957cb3db3..3d2350b661e5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1220,7 +1220,7 @@ let grub2 = callPackage ../tools/misc/grub/2.0x.nix { }; - grub2_efi = grub2.override { EFIsupport = true; }; + grub2_efi = grub2.override { efiSupport = true; }; grub2_zfs = grub2.override { zfsSupport = true; }; -- cgit 1.4.1 From 0fdbc444113a80c1bd0477676a33ab1fb27bae1a Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Thu, 28 Aug 2014 13:36:41 -0700 Subject: grub: Fix typo --- pkgs/tools/misc/grub/2.0x.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index 028ec5657529..e3c07af759c9 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -94,7 +94,7 @@ stdenv.mkDerivation rec { operating system (e.g., GNU). ''; - homepage = http://wwwp.gnu.org/software/grub/; + homepage = http://www.gnu.org/software/grub/; license = licenses.gpl3Plus; -- cgit 1.4.1