gnu: guile-opengl: Use https URL.
[jackhill/guix/guix.git] / gnu / packages / grub.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
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)
29 #:use-module (gnu packages disk)
30 #:use-module (gnu packages bison)
31 #:use-module (gnu packages gettext)
32 #:use-module (gnu packages fontutils)
33 #:use-module (gnu packages linux)
34 #:use-module (gnu packages qemu)
35 #:use-module (gnu packages man)
36 #:use-module (gnu packages texinfo)
37 #:use-module (gnu packages ncurses)
38 #:use-module (gnu packages cdrom)
39 #:use-module (srfi srfi-1))
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.
47 (package (inherit qemu-minimal)
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
61 ,@(package-arguments qemu-minimal)))
62
63 ;; The manual fails to build with Texinfo 5.x.
64 (native-inputs (alist-delete "texinfo" (package-native-inputs qemu)))))
65
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
77 (define-public grub
78 (package
79 (name "grub")
80 (version "2.02beta3")
81 (source (origin
82 (method url-fetch)
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"))
88 (sha256
89 (base32
90 "18ddwnw0vxs7zigvah0g6a5z5vvlz0p8fjglxv1h59sjbrakvv1h"))))
91 (build-system gnu-build-system)
92 (arguments
93 '(;; Two warnings: suggest braces, signed/unsigned comparison.
94 #:configure-flags '("--disable-werror")
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")))
101
102 ;; Make the font visible.
103 (copy-file (assoc-ref inputs "unifont") "unifont.bdf.gz")
104 (system* "gunzip" "unifont.bdf.gz")
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"))
112 #t)))))
113 (inputs
114 `(;; ("lvm2" ,lvm2)
115 ("gettext" ,gnu-gettext)
116 ("freetype" ,freetype)
117 ;; ("libusb" ,libusb)
118 ;; ("fuse" ,fuse)
119 ("ncurses" ,ncurses)))
120 (native-inputs
121 `(("unifont" ,unifont)
122 ("bison" ,bison)
123 ("flex" ,flex)
124 ("texinfo" ,texinfo)
125 ("help2man" ,help2man)
126
127 ;; Dependencies for the test suite. The "real" QEMU is needed here,
128 ;; because several targets are used.
129 ("parted" ,parted)
130 ("qemu" ,qemu-for-tests)
131 ("xorriso" ,xorriso)))
132 (home-page "http://www.gnu.org/software/grub/")
133 (synopsis "GRand Unified Boot loader")
134 (description
135 "GRUB is a multiboot bootloader. It is used for initially loading the
136 kernel of an operating system and then transferring control to it. The kernel
137 then goes on to load the rest of the operating system. As a multiboot
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
140 menu to select one of the installed operating systems.")
141 (license gpl3+)
142 (properties '((cpe-name . "grub2")))))