Commit | Line | Data |
---|---|---|
65d8b777 | 1 | ;;; GNU Guix --- Functional package management for GNU |
99effc8f | 2 | ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> |
04e0eac1 | 3 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
f0150f87 | 4 | ;;; Copyright © 2015 Leo Famulari <leo@famulari.name> |
4c726001 | 5 | ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org> |
65d8b777 LC |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
9 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
10 | ;;; under the terms of the GNU General Public License as published by | |
11 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
12 | ;;; your option) any later version. | |
13 | ;;; | |
14 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
15 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ;;; GNU General Public License for more details. | |
18 | ;;; | |
19 | ;;; You should have received a copy of the GNU General Public License | |
20 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
21 | ||
22 | (define-module (gnu packages grub) | |
23 | #:use-module (guix download) | |
24 | #:use-module (guix packages) | |
25 | #:use-module ((guix licenses) #:select (gpl3+)) | |
26 | #:use-module (guix build-system gnu) | |
27 | #:use-module (gnu packages) | |
28 | #:use-module (gnu packages flex) | |
7febe3a2 | 29 | #:use-module (gnu packages disk) |
65d8b777 | 30 | #:use-module (gnu packages bison) |
1dba6407 | 31 | #:use-module (gnu packages gettext) |
a86177d6 | 32 | #:use-module (gnu packages fontutils) |
65d8b777 LC |
33 | #:use-module (gnu packages linux) |
34 | #:use-module (gnu packages qemu) | |
58301666 MW |
35 | #:use-module (gnu packages man) |
36 | #:use-module (gnu packages texinfo) | |
65d8b777 | 37 | #:use-module (gnu packages ncurses) |
6facbc75 | 38 | #:use-module (gnu packages cdrom) |
0ded70f3 | 39 | #:use-module (srfi srfi-1)) |
6facbc75 LC |
40 | |
41 | (define qemu-for-tests | |
42 | ;; Newer QEMU versions, such as 1.5.1, no longer support the 'shutdown' | |
43 | ;; instruction. This leads to test hangs, as reported at | |
44 | ;; <https://bugs.launchpad.net/bugs/947597> and fixed at | |
45 | ;; <http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/4828>. | |
46 | ;; Work around it by using an older QEMU. | |
06da1a6b | 47 | (package (inherit qemu-minimal) |
6facbc75 LC |
48 | (version "1.3.1") |
49 | (source (origin | |
50 | (method url-fetch) | |
51 | (uri (string-append "http://wiki.qemu-project.org/download/qemu-" | |
52 | version ".tar.bz2")) | |
53 | (sha256 | |
54 | (base32 | |
55 | "1bqfrb5dlsxm8gxhkksz8qzi5fhj3xqhxyfwbqcphhcv1kpyfwip")))) | |
56 | ||
57 | ;; With recent GLib versions, we get a test failure: | |
58 | ;; ERROR:tests/rtc-test.c:176:check_time: assertion failed (ABS(t - s) <= wiggle): (382597824 <= 2) | |
59 | ;; Simply disable the tests. | |
60 | (arguments `(#:tests? #f | |
06da1a6b | 61 | ,@(package-arguments qemu-minimal))) |
6facbc75 LC |
62 | |
63 | ;; The manual fails to build with Texinfo 5.x. | |
64 | (native-inputs (alist-delete "texinfo" (package-native-inputs qemu))))) | |
65d8b777 | 65 | |
9b24c768 LC |
66 | (define unifont |
67 | ;; GNU Unifont, <http://gnu.org/s/unifont>. | |
68 | ;; GRUB needs it for its graphical terminal, gfxterm. | |
69 | (origin | |
70 | (method url-fetch) | |
71 | (uri | |
72 | "http://unifoundry.com/pub/unifont-7.0.06/font-builds/unifont-7.0.06.bdf.gz") | |
73 | (sha256 | |
74 | (base32 | |
75 | "0p2vhnc18cnbmb39vq4m7hzv4mhnm2l0a2s7gx3ar277fwng3hys")))) | |
76 | ||
65d8b777 LC |
77 | (define-public grub |
78 | (package | |
79 | (name "grub") | |
4c726001 | 80 | (version "2.02beta3") |
65d8b777 LC |
81 | (source (origin |
82 | (method url-fetch) | |
4c726001 JN |
83 | (uri (string-append |
84 | "ftp://alpha.gnu.org/gnu/grub/grub-" | |
85 | "2.02~beta3" | |
86 | ".tar.xz")) | |
87 | (file-name (string-append name "-" version ".tar.xz")) | |
65d8b777 LC |
88 | (sha256 |
89 | (base32 | |
4c726001 | 90 | "18ddwnw0vxs7zigvah0g6a5z5vvlz0p8fjglxv1h59sjbrakvv1h")))) |
65d8b777 LC |
91 | (build-system gnu-build-system) |
92 | (arguments | |
4c726001 JN |
93 | '(;; Two warnings: suggest braces, signed/unsigned comparison. |
94 | #:configure-flags '("--disable-werror") | |
04e0eac1 MW |
95 | #:phases (modify-phases %standard-phases |
96 | (add-after | |
97 | 'unpack 'patch-stuff | |
98 | (lambda* (#:key inputs #:allow-other-keys) | |
99 | (substitute* "grub-core/Makefile.in" | |
100 | (("/bin/sh") (which "sh"))) | |
65d8b777 | 101 | |
04e0eac1 MW |
102 | ;; Make the font visible. |
103 | (copy-file (assoc-ref inputs "unifont") "unifont.bdf.gz") | |
104 | (system* "gunzip" "unifont.bdf.gz") | |
4c726001 JN |
105 | |
106 | ;; We hit an assertion failure in | |
107 | ;; grub-core/tests/video_checksum.c, as reported at | |
108 | ;; <https://lists.gnu.org/archive/html/grub-devel/2016-07/msg00026.html>. | |
109 | ;; Disable this test for now. | |
110 | (substitute* "tests/grub_func_test.in" | |
111 | (("set -e") "exit 77\nset -e")) | |
04e0eac1 | 112 | #t))))) |
65d8b777 LC |
113 | (inputs |
114 | `(;; ("lvm2" ,lvm2) | |
1dba6407 | 115 | ("gettext" ,gnu-gettext) |
65d8b777 LC |
116 | ("freetype" ,freetype) |
117 | ;; ("libusb" ,libusb) | |
04e0eac1 | 118 | ;; ("fuse" ,fuse) |
01eafd38 | 119 | ("ncurses" ,ncurses))) |
65d8b777 | 120 | (native-inputs |
9b24c768 LC |
121 | `(("unifont" ,unifont) |
122 | ("bison" ,bison) | |
65d8b777 | 123 | ("flex" ,flex) |
58301666 MW |
124 | ("texinfo" ,texinfo) |
125 | ("help2man" ,help2man) | |
65d8b777 LC |
126 | |
127 | ;; Dependencies for the test suite. The "real" QEMU is needed here, | |
128 | ;; because several targets are used. | |
7febe3a2 | 129 | ("parted" ,parted) |
6facbc75 | 130 | ("qemu" ,qemu-for-tests) |
65d8b777 LC |
131 | ("xorriso" ,xorriso))) |
132 | (home-page "http://www.gnu.org/software/grub/") | |
79c311b8 | 133 | (synopsis "GRand Unified Boot loader") |
65d8b777 | 134 | (description |
a22dc0c4 | 135 | "GRUB is a multiboot bootloader. It is used for initially loading the |
35b9e423 | 136 | kernel of an operating system and then transferring control to it. The kernel |
c5779c93 | 137 | then goes on to load the rest of the operating system. As a multiboot |
574e86f9 LC |
138 | bootloader, GRUB handles the presence of multiple operating systems installed |
139 | on the same computer; upon booting the computer, the user is presented with a | |
a22dc0c4 | 140 | menu to select one of the installed operating systems.") |
99effc8f LC |
141 | (license gpl3+) |
142 | (properties '((cpe-name . "grub2"))))) |