gnu: Update harfbuzz to 0.9.20.
[jackhill/guix/guix.git] / gnu / packages / grub.scm
CommitLineData
65d8b777
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3;;;
4;;; This file is part of GNU Guix.
5;;;
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.
10;;;
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.
15;;;
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/>.
18
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:))
a86177d6 28 #:use-module (gnu packages fontutils)
65d8b777
LC
29 #:use-module (gnu packages linux)
30 #:use-module (gnu packages qemu)
31 #:use-module (gnu packages ncurses)
6facbc75
LC
32 #:use-module (gnu packages cdrom)
33 #:use-module (srfi srfi-1))
34
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)
42 (version "1.3.1")
43 (source (origin
44 (method url-fetch)
45 (uri (string-append "http://wiki.qemu-project.org/download/qemu-"
46 version ".tar.bz2"))
47 (sha256
48 (base32
49 "1bqfrb5dlsxm8gxhkksz8qzi5fhj3xqhxyfwbqcphhcv1kpyfwip"))))
50
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)))
56
57 ;; The manual fails to build with Texinfo 5.x.
58 (native-inputs (alist-delete "texinfo" (package-native-inputs qemu)))))
65d8b777
LC
59
60(define-public grub
61 (package
62 (name "grub")
63 (version "2.00")
64 (source (origin
65 (method url-fetch)
66 (uri (string-append "mirror://gnu/grub/grub-"
67 version ".tar.xz"))
68 (sha256
69 (base32
70 "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq"))))
71 (build-system gnu-build-system)
72 (arguments
73 '(#:patches (list (assoc-ref %build-inputs "patch/gets"))
74 #:configure-flags '("--disable-werror")
75 #:phases (alist-cons-before
76 'patch-source-shebangs 'patch-stuff
77 (lambda _
78 (substitute* "grub-core/Makefile.in"
79 (("/bin/sh") (which "sh")))
80
81 ;; TODO: Re-enable this test when we have Parted.
82 (substitute* "tests/partmap_test.in"
83 (("set -e") "exit 77")))
84 %standard-phases)))
85 (inputs
86 `(;; ("lvm2" ,lvm2)
87 ("gettext" ,gnu:gettext)
88 ("freetype" ,freetype)
89 ;; ("libusb" ,libusb)
90 ("ncurses" ,ncurses)
91
92 ("patch/gets" ,(search-patch "grub-gets-undeclared.patch"))))
93 (native-inputs
94 `(("bison" ,bison)
95 ("flex" ,flex)
96
97 ;; Dependencies for the test suite. The "real" QEMU is needed here,
98 ;; because several targets are used.
6facbc75 99 ("qemu" ,qemu-for-tests)
65d8b777
LC
100 ("xorriso" ,xorriso)))
101 (home-page "http://www.gnu.org/software/grub/")
f50d2669 102 (synopsis "GRand unified boot loader")
65d8b777
LC
103 (description
104 "GNU GRUB is a Multiboot boot loader. It was derived from GRUB, GRand
105Unified Bootloader, which was originally designed and implemented by Erich
106Stefan Boleyn.
107
108Briefly, the boot loader is the first software program that runs when a
109computer starts. It is responsible for loading and transferring control to
110the operating system kernel software (such as the Hurd or the Linux). The
111kernel, in turn, initializes the rest of the operating system (e.g., GNU).")
112 (license gpl3+)))