Commit | Line | Data |
---|---|---|
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) | |
1dba6407 | 27 | #:use-module (gnu packages gettext) |
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 | 32 | #:use-module (gnu packages cdrom) |
0ded70f3 | 33 | #:use-module (srfi srfi-1)) |
6facbc75 LC |
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. | |
4942d42a | 41 | (package (inherit qemu-headless) |
6facbc75 LC |
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 | |
01eafd38 LC |
70 | "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq")) |
71 | (patches (list (search-patch "grub-gets-undeclared.patch"))))) | |
65d8b777 LC |
72 | (build-system gnu-build-system) |
73 | (arguments | |
01eafd38 | 74 | '(#:configure-flags '("--disable-werror") |
65d8b777 LC |
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) | |
1dba6407 | 87 | ("gettext" ,gnu-gettext) |
65d8b777 LC |
88 | ("freetype" ,freetype) |
89 | ;; ("libusb" ,libusb) | |
01eafd38 | 90 | ("ncurses" ,ncurses))) |
65d8b777 LC |
91 | (native-inputs |
92 | `(("bison" ,bison) | |
93 | ("flex" ,flex) | |
94 | ||
95 | ;; Dependencies for the test suite. The "real" QEMU is needed here, | |
96 | ;; because several targets are used. | |
6facbc75 | 97 | ("qemu" ,qemu-for-tests) |
65d8b777 LC |
98 | ("xorriso" ,xorriso))) |
99 | (home-page "http://www.gnu.org/software/grub/") | |
79c311b8 | 100 | (synopsis "GRand Unified Boot loader") |
65d8b777 | 101 | (description |
a22dc0c4 | 102 | "GRUB is a multiboot bootloader. It is used for initially loading the |
79c311b8 | 103 | kernel of an operating system and then transferring control to it. The kernel |
c5779c93 | 104 | then goes on to load the rest of the operating system. As a multiboot |
574e86f9 LC |
105 | bootloader, GRUB handles the presence of multiple operating systems installed |
106 | on the same computer; upon booting the computer, the user is presented with a | |
a22dc0c4 | 107 | menu to select one of the installed operating systems.") |
65d8b777 | 108 | (license gpl3+))) |