1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages grub)
20 #:use-module (guix download)
21 #:use-module (guix packages)
22 #:use-module ((guix licenses) #:select (gpl3+))
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages flex)
26 #:use-module (gnu packages bison)
27 #:use-module ((gnu packages gettext) #:renamer (symbol-prefix-proc 'gnu:))
28 #:use-module (gnu packages fontutils)
29 #:use-module (gnu packages linux)
30 #:use-module (gnu packages qemu)
31 #:use-module (gnu packages ncurses)
32 #:use-module (gnu packages cdrom)
33 #:use-module (srfi srfi-1))
35 (define qemu-for-tests
36 ;; Newer QEMU versions, such as 1.5.1, no longer support the 'shutdown'
37 ;; instruction. This leads to test hangs, as reported at
38 ;; <https://bugs.launchpad.net/bugs/947597> and fixed at
39 ;; <http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/4828>.
40 ;; Work around it by using an older QEMU.
41 (package (inherit qemu)
45 (uri (string-append "http://wiki.qemu-project.org/download/qemu-"
49 "1bqfrb5dlsxm8gxhkksz8qzi5fhj3xqhxyfwbqcphhcv1kpyfwip"))))
51 ;; With recent GLib versions, we get a test failure:
52 ;; ERROR:tests/rtc-test.c:176:check_time: assertion failed (ABS(t - s) <= wiggle): (382597824 <= 2)
53 ;; Simply disable the tests.
54 (arguments `(#:tests? #f
55 ,@(package-arguments qemu)))
57 ;; The manual fails to build with Texinfo 5.x.
58 (native-inputs (alist-delete "texinfo" (package-native-inputs qemu)))))
66 (uri (string-append "mirror://gnu/grub/grub-"
70 "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq"))
71 (patches (list (search-patch "grub-gets-undeclared.patch")))))
72 (build-system gnu-build-system)
74 '(#:configure-flags '("--disable-werror")
75 #:phases (alist-cons-before
76 'patch-source-shebangs 'patch-stuff
78 (substitute* "grub-core/Makefile.in"
79 (("/bin/sh") (which "sh")))
81 ;; TODO: Re-enable this test when we have Parted.
82 (substitute* "tests/partmap_test.in"
83 (("set -e") "exit 77")))
87 ("gettext" ,gnu:gettext)
88 ("freetype" ,freetype)
90 ("ncurses" ,ncurses)))
95 ;; Dependencies for the test suite. The "real" QEMU is needed here,
96 ;; because several targets are used.
97 ("qemu" ,qemu-for-tests)
98 ("xorriso" ,xorriso)))
99 (home-page "http://www.gnu.org/software/grub/")
100 (synopsis "GRand unified boot loader")
102 "GRUB is a multiboot bootloader. It is used for initially loading the
103 kernel of an operating system and then transfering control to it. The kernel
104 then goes on to load the rest of the operating system. As a multiboot boot
105 loader, GRUB handles the presence of multiple operating systems installed on
106 the same computer; upon booting the computer, the user is presented with a
107 menu to select one of the installed operating systems.")