You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

109 lines
4.3 KiB

  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. (define-module (gnu packages grub)
  19. #:use-module (guix download)
  20. #:use-module (guix packages)
  21. #:use-module ((guix licenses) #:select (gpl3+))
  22. #:use-module (guix build-system gnu)
  23. #:use-module (gnu packages)
  24. #:use-module (gnu packages flex)
  25. #:use-module (gnu packages bison)
  26. #:use-module ((gnu packages gettext) #:renamer (symbol-prefix-proc 'gnu:))
  27. #:use-module (gnu packages fontutils)
  28. #:use-module (gnu packages linux)
  29. #:use-module (gnu packages qemu)
  30. #:use-module (gnu packages ncurses)
  31. #:use-module (gnu packages cdrom)
  32. #:use-module (srfi srfi-1))
  33. (define qemu-for-tests
  34. ;; Newer QEMU versions, such as 1.5.1, no longer support the 'shutdown'
  35. ;; instruction. This leads to test hangs, as reported at
  36. ;; <https://bugs.launchpad.net/bugs/947597> and fixed at
  37. ;; <http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/4828>.
  38. ;; Work around it by using an older QEMU.
  39. (package (inherit qemu)
  40. (version "1.3.1")
  41. (source (origin
  42. (method url-fetch)
  43. (uri (string-append "http://wiki.qemu-project.org/download/qemu-"
  44. version ".tar.bz2"))
  45. (sha256
  46. (base32
  47. "1bqfrb5dlsxm8gxhkksz8qzi5fhj3xqhxyfwbqcphhcv1kpyfwip"))))
  48. ;; With recent GLib versions, we get a test failure:
  49. ;; ERROR:tests/rtc-test.c:176:check_time: assertion failed (ABS(t - s) <= wiggle): (382597824 <= 2)
  50. ;; Simply disable the tests.
  51. (arguments `(#:tests? #f
  52. ,@(package-arguments qemu)))
  53. ;; The manual fails to build with Texinfo 5.x.
  54. (native-inputs (alist-delete "texinfo" (package-native-inputs qemu)))))
  55. (define-public grub
  56. (package
  57. (name "grub")
  58. (version "2.00")
  59. (source (origin
  60. (method url-fetch)
  61. (uri (string-append "mirror://gnu/grub/grub-"
  62. version ".tar.xz"))
  63. (sha256
  64. (base32
  65. "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq"))
  66. (patches (list (search-patch "grub-gets-undeclared.patch")))))
  67. (build-system gnu-build-system)
  68. (arguments
  69. '(#:configure-flags '("--disable-werror")
  70. #:phases (alist-cons-before
  71. 'patch-source-shebangs 'patch-stuff
  72. (lambda _
  73. (substitute* "grub-core/Makefile.in"
  74. (("/bin/sh") (which "sh")))
  75. ;; TODO: Re-enable this test when we have Parted.
  76. (substitute* "tests/partmap_test.in"
  77. (("set -e") "exit 77")))
  78. %standard-phases)))
  79. (inputs
  80. `(;; ("lvm2" ,lvm2)
  81. ("gettext" ,gnu:gettext)
  82. ("freetype" ,freetype)
  83. ;; ("libusb" ,libusb)
  84. ("ncurses" ,ncurses)))
  85. (native-inputs
  86. `(("bison" ,bison)
  87. ("flex" ,flex)
  88. ;; Dependencies for the test suite. The "real" QEMU is needed here,
  89. ;; because several targets are used.
  90. ("qemu" ,qemu-for-tests)
  91. ("xorriso" ,xorriso)))
  92. (home-page "http://www.gnu.org/software/grub/")
  93. (synopsis "GRand unified boot loader")
  94. (description
  95. "GRUB is a multiboot bootloader. It is used for initially loading the
  96. kernel of an operating system and then transfering control to it. The kernel
  97. then goes on to load the rest of the operating system. As a multiboot boot
  98. loader, GRUB handles the presence of multiple operating systems installed on
  99. the same computer; upon booting the computer, the user is presented with a
  100. menu to select one of the installed operating systems.")
  101. (license gpl3+)))