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.

1061 lines
46 KiB

Synchronize package descriptions with the Womb. * gnu/packages/algebra.scm, gnu/packages/aspell.scm, gnu/packages/autotools.scm, gnu/packages/base.scm, gnu/packages/bash.scm, gnu/packages/bison.scm, gnu/packages/cdrom.scm, gnu/packages/cflow.scm, gnu/packages/compression.scm, gnu/packages/cpio.scm, gnu/packages/cppi.scm, gnu/packages/ddrescue.scm, gnu/packages/dejagnu.scm, gnu/packages/ed.scm, gnu/packages/emacs.scm, gnu/packages/fdisk.scm, gnu/packages/freeipmi.scm, gnu/packages/gawk.scm, gnu/packages/gcal.scm, gnu/packages/gcc.scm, gnu/packages/gdb.scm, gnu/packages/gdbm.scm, gnu/packages/gettext.scm, gnu/packages/ghostscript.scm, gnu/packages/global.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gnutls.scm, gnu/packages/gperf.scm, gnu/packages/gprolog.scm, gnu/packages/groff.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm, gnu/packages/guile.scm, gnu/packages/gv.scm, gnu/packages/help2man.scm, gnu/packages/idutils.scm, gnu/packages/indent.scm, gnu/packages/less.scm, gnu/packages/libidn.scm, gnu/packages/libsigsegv.scm, gnu/packages/libunistring.scm, gnu/packages/lightning.scm, gnu/packages/linux.scm, gnu/packages/lsh.scm, gnu/packages/m4.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/multiprecision.scm, gnu/packages/nano.scm, gnu/packages/ncurses.scm, gnu/packages/nettle.scm, gnu/packages/ocrad.scm, gnu/packages/oggvorbis.scm, gnu/packages/parted.scm, gnu/packages/plotutils.scm, gnu/packages/pth.scm, gnu/packages/readline.scm, gnu/packages/recutils.scm, gnu/packages/rush.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/shishi.scm, gnu/packages/smalltalk.scm, gnu/packages/system.scm, gnu/packages/texinfo.scm, gnu/packages/time.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/wdiff.scm, gnu/packages/wget.scm, gnu/packages/which.scm, gnu/packages/xnee.scm, gnu/packages/zile.scm: Change value of the 'description' field to that of the Womb.
8 years ago
gnu: Some cleanup based on lint checkers. * gnu/packages/admin.scm, gnu/packages/aidc.scm, gnu/packages/algebra.scm, gnu/packages/apr.scm, gnu/packages/avahi.scm, gnu/packages/backup.scm, gnu/packages/base.scm, gnu/packages/calcurse.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/compression.scm, gnu/packages/cook.scm, gnu/packages/crypto.scm, gnu/packages/cryptsetup.scm, gnu/packages/curl.scm, gnu/packages/cyrus-sasl.scm, gnu/packages/databases.scm, gnu/packages/doxygen.scm, gnu/packages/dwm.scm, gnu/packages/elf.scm, gnu/packages/emacs.scm, gnu/packages/feh.scm, gnu/packages/file.scm, gnu/packages/fish.scm, gnu/packages/flex.scm, gnu/packages/fltk.scm, gnu/packages/fontutils.scm, gnu/packages/games.scm, gnu/packages/gcal.scm, gnu/packages/gcc.scm, gnu/packages/geeqie.scm, gnu/packages/ghostscript.scm, gnu/packages/gimp.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gperf.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm, gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile.scm, gnu/packages/hurd.scm, gnu/packages/icu4c.scm, gnu/packages/image.scm, gnu/packages/imagemagick.scm, gnu/packages/irssi.scm, gnu/packages/kde.scm, gnu/packages/libdaemon.scm, gnu/packages/libevent.scm, gnu/packages/libidn.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm, gnu/packages/lout.scm, gnu/packages/lsh.scm, gnu/packages/lsof.scm, gnu/packages/lua.scm, gnu/packages/maths.scm, gnu/packages/mcrypt.scm, gnu/packages/mp3.scm, gnu/packages/netpbm.scm, gnu/packages/noweb.scm, gnu/packages/ocaml.scm, gnu/packages/openssl.scm, gnu/packages/pcre.scm, gnu/packages/pdf.scm, gnu/packages/pkg-config.scm, gnu/packages/pretty-print.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/rsync.scm, gnu/packages/scheme.scm, gnu/packages/scrot.scm, gnu/packages/sdl.scm, gnu/packages/skribilo.scm, gnu/packages/ssh.scm, gnu/packages/stalonetray.scm, gnu/packages/tcl.scm, gnu/packages/tcsh.scm, gnu/packages/telephony.scm, gnu/packages/texlive.scm, gnu/packages/tor.scm, gnu/packages/valgrind.scm, gnu/packages/version-control.scm, gnu/packages/vim.scm, gnu/packages/vpn.scm, gnu/packages/w3m.scm, gnu/packages/web.scm, gnu/packages/wordnet.scm, gnu/packages/xiph.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/packages/zile.scm, gnu/packages/zip.scm, gnu/packages/zsh.scm [synopsis, description]: Adjust according to lint checkers. * gnu/packages/fltk.scm (fltk)[source]: Wrap long line in uri. * /gnu/packages/xiph.scm (libogg, libtheora, vorbis-tools)[source]: Same.
7 years ago
Synchronize package descriptions with the Womb. * gnu/packages/algebra.scm, gnu/packages/aspell.scm, gnu/packages/autotools.scm, gnu/packages/base.scm, gnu/packages/bash.scm, gnu/packages/bison.scm, gnu/packages/cdrom.scm, gnu/packages/cflow.scm, gnu/packages/compression.scm, gnu/packages/cpio.scm, gnu/packages/cppi.scm, gnu/packages/ddrescue.scm, gnu/packages/dejagnu.scm, gnu/packages/ed.scm, gnu/packages/emacs.scm, gnu/packages/fdisk.scm, gnu/packages/freeipmi.scm, gnu/packages/gawk.scm, gnu/packages/gcal.scm, gnu/packages/gcc.scm, gnu/packages/gdb.scm, gnu/packages/gdbm.scm, gnu/packages/gettext.scm, gnu/packages/ghostscript.scm, gnu/packages/global.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gnutls.scm, gnu/packages/gperf.scm, gnu/packages/gprolog.scm, gnu/packages/groff.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm, gnu/packages/guile.scm, gnu/packages/gv.scm, gnu/packages/help2man.scm, gnu/packages/idutils.scm, gnu/packages/indent.scm, gnu/packages/less.scm, gnu/packages/libidn.scm, gnu/packages/libsigsegv.scm, gnu/packages/libunistring.scm, gnu/packages/lightning.scm, gnu/packages/linux.scm, gnu/packages/lsh.scm, gnu/packages/m4.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/multiprecision.scm, gnu/packages/nano.scm, gnu/packages/ncurses.scm, gnu/packages/nettle.scm, gnu/packages/ocrad.scm, gnu/packages/oggvorbis.scm, gnu/packages/parted.scm, gnu/packages/plotutils.scm, gnu/packages/pth.scm, gnu/packages/readline.scm, gnu/packages/recutils.scm, gnu/packages/rush.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/shishi.scm, gnu/packages/smalltalk.scm, gnu/packages/system.scm, gnu/packages/texinfo.scm, gnu/packages/time.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/wdiff.scm, gnu/packages/wget.scm, gnu/packages/which.scm, gnu/packages/xnee.scm, gnu/packages/zile.scm: Change value of the 'description' field to that of the Womb.
8 years ago
gnu: Fix common unquote typos. It's easy to mistype ‘("foo" foo)’ as ‘("foo", foo)’ (which also works). Fix such typos for the proper edification of our young. * gnu/packages/android.scm: Move unquotes to their operands. * gnu/packages/bootloaders.scm: Likewise. * gnu/packages/build-tools.scm: Likewise. * gnu/packages/chemistry.scm: Likewise. * gnu/packages/compression.scm: Likewise. * gnu/packages/connman.scm: Likewise. * gnu/packages/django.scm: Likewise. * gnu/packages/emulators.scm: Likewise. * gnu/packages/engineering.scm: Likewise. * gnu/packages/file-systems.scm: Likewise. * gnu/packages/freedesktop.scm: Likewise. * gnu/packages/games.scm: Likewise. * gnu/packages/gimp.scm: Likewise. * gnu/packages/gl.scm: Likewise. * gnu/packages/gnome.scm: Likewise. * gnu/packages/graphics.scm: Likewise. * gnu/packages/haskell.scm: Likewise. * gnu/packages/irc.scm: Likewise. * gnu/packages/julia.scm: Likewise. * gnu/packages/kde-frameworks.scm: Likewise. * gnu/packages/linux.scm: Likewise. * gnu/packages/lua.scm: Likewise. * gnu/packages/mail.scm: Likewise. * gnu/packages/make-bootstrap.scm: Likewise. * gnu/packages/messaging.scm: Likewise. * gnu/packages/music.scm: Likewise. * gnu/packages/networking.scm: Likewise. * gnu/packages/ocaml.scm: Likewise. * gnu/packages/perl.scm: Likewise. * gnu/packages/python.scm: Likewise. * gnu/packages/python-web.scm: Likewise. * gnu/packages/qt.scm: Likewise. * gnu/packages/ratpoison.scm: Likewise. * gnu/packages/sdl.scm: Likewise. * gnu/packages/sml.scm: Likewise. * gnu/packages/terminals.scm: Likewise. * gnu/packages/text-editors.scm: Likewise. * gnu/packages/video.scm: Likewise. * gnu/packages/virtualization.scm: Likewise. * gnu/packages/vulkan.scm: Likewise. * gnu/packages/wget.scm: Likewise. * gnu/packages/wine.scm: Likewise. * gnu/packages/wm.scm: Likewise. * gnu/packages/xdisorg.scm: Likewise. * gnu/packages/xml.scm: Likewise. * gnu/packages/xorg.scm: Likewise.
4 years ago
gnu: util-linux: Move libraries to separate output. Fixes <https://bugs.gnu.org/37732>. Reported by Diego Nicola Barbato <dnbarbato@posteo.de>. * gnu/packages/linux.scm (util-linux)[outputs]: Add "lib". [arguments]: Update #:configure-flags and the "move-static-libraries" phase accordingly. Add phases "patch-build-scripts" and "adjust-pkg-config-files". (e2fsprogs, psm, mtd-utils, f2fs-tools, f2fs-tools-1.7, eudev, xfsprogs)[inputs]: Change to the "lib" output of UTIL-LINUX. (btrfs-progs)[inputs]: Remove duplicate UTIL-LINUX inputs and change to use the "lib" output. * gnu/packages/admin.scm (pam-mount)[inputs]: Add UTIL-LINUX:LIB. (testdisk)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/android.scm (abootimg)[inputs]: Likewise. * gnu/packages/audio.scm (jack-1)[propagated-inputs]: Likewise. * gnu/packages/bootloaders.scm (syslinux, vboot-utils)[inputs]: Likewise. * gnu/packages/chez.scm (chez-scheme)[inputs]: Likewise. * gnu/packages/cryptsetup.scm (cryptsetup, cryptsetup-static)[inputs]: Likewise. * gnu/packages/databases.scm (postgresql, 4store)[inputs]: Likewise. * gnu/packages/disk.scm (ndctl, gptfdisk, fdisk, gparted, rmlint, volume-key)[inputs]: Likewise. (parted)[inputs]: Likewise. [native-inputs]: Add UTIL-LINUX. * gnu/packages/efi.scm (sbsigntools)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/engineering.scm (lib3mf)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/enlightenment.scm (efl)[propagated-inputs]: Likewise. * gnu/packages/file-systems.scm (glusterfs, jfsutils, zfs)[inputs]: Likewise. * gnu/packages/firmware.scm (ovmf)[inputs]: Likewise. * gnu/packages/fontutils.scm (fontconfig)[propagated-inputs]: Likewise. * gnu/packages/freedesktop.scm (localed)[inputs]: Likewise. * gnu/packages/glib.scm (glib, appstream-glib)[propagated-inputs]: Likewise. * gnu/packages/gnome.scm (tracker, gnome-terminal)[inputs]: Likewise. * gnu/packages/jupyter.scm (xeus)[inputs]: Likewise. * gnu/packages/kde.scm (kpmcore)[inputs]: Likewise. * gnu/packages/kodi.scm (crossguid)[inputs]: Likewise. * gnu/packages/lighting.scm (ola)[inputs]: Likewise. * gnu/packages/music.scm (libgig)[inputs]: Likewise. * gnu/packages/nfs.scm (nfs-utils)[inputs]: Likewise. * gnu/packages/opencog.scm (opencog)[inputs]: Likewise. * gnu/packages/package-management.scm (msitools)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/password-utils.scm (pwsafe)[inputs]: Likewise. * gnu/packages/telephony.scm (pjproject)[propagated-inputs]: Likewise. * gnu/packages/rdf.scm (rasqal)[inputs]: Likewise. * gnu/packages/search.scm (xapian)[inputs]: Likewise. * gnu/packages/sssd.scm (sssd)[native-inputs]: Likewise. * gnu/packages/storage.scm (ceph)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/task-management.scm (taskwarrior)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/virtualization.scm (libvirt, xen)[inputs]: Likewise. * gnu/packages/xorg.scm (libsm)[inputs]: Likewise.
2 years ago
gnu: util-linux: Move libraries to separate output. Fixes <https://bugs.gnu.org/37732>. Reported by Diego Nicola Barbato <dnbarbato@posteo.de>. * gnu/packages/linux.scm (util-linux)[outputs]: Add "lib". [arguments]: Update #:configure-flags and the "move-static-libraries" phase accordingly. Add phases "patch-build-scripts" and "adjust-pkg-config-files". (e2fsprogs, psm, mtd-utils, f2fs-tools, f2fs-tools-1.7, eudev, xfsprogs)[inputs]: Change to the "lib" output of UTIL-LINUX. (btrfs-progs)[inputs]: Remove duplicate UTIL-LINUX inputs and change to use the "lib" output. * gnu/packages/admin.scm (pam-mount)[inputs]: Add UTIL-LINUX:LIB. (testdisk)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/android.scm (abootimg)[inputs]: Likewise. * gnu/packages/audio.scm (jack-1)[propagated-inputs]: Likewise. * gnu/packages/bootloaders.scm (syslinux, vboot-utils)[inputs]: Likewise. * gnu/packages/chez.scm (chez-scheme)[inputs]: Likewise. * gnu/packages/cryptsetup.scm (cryptsetup, cryptsetup-static)[inputs]: Likewise. * gnu/packages/databases.scm (postgresql, 4store)[inputs]: Likewise. * gnu/packages/disk.scm (ndctl, gptfdisk, fdisk, gparted, rmlint, volume-key)[inputs]: Likewise. (parted)[inputs]: Likewise. [native-inputs]: Add UTIL-LINUX. * gnu/packages/efi.scm (sbsigntools)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/engineering.scm (lib3mf)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/enlightenment.scm (efl)[propagated-inputs]: Likewise. * gnu/packages/file-systems.scm (glusterfs, jfsutils, zfs)[inputs]: Likewise. * gnu/packages/firmware.scm (ovmf)[inputs]: Likewise. * gnu/packages/fontutils.scm (fontconfig)[propagated-inputs]: Likewise. * gnu/packages/freedesktop.scm (localed)[inputs]: Likewise. * gnu/packages/glib.scm (glib, appstream-glib)[propagated-inputs]: Likewise. * gnu/packages/gnome.scm (tracker, gnome-terminal)[inputs]: Likewise. * gnu/packages/jupyter.scm (xeus)[inputs]: Likewise. * gnu/packages/kde.scm (kpmcore)[inputs]: Likewise. * gnu/packages/kodi.scm (crossguid)[inputs]: Likewise. * gnu/packages/lighting.scm (ola)[inputs]: Likewise. * gnu/packages/music.scm (libgig)[inputs]: Likewise. * gnu/packages/nfs.scm (nfs-utils)[inputs]: Likewise. * gnu/packages/opencog.scm (opencog)[inputs]: Likewise. * gnu/packages/package-management.scm (msitools)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/password-utils.scm (pwsafe)[inputs]: Likewise. * gnu/packages/telephony.scm (pjproject)[propagated-inputs]: Likewise. * gnu/packages/rdf.scm (rasqal)[inputs]: Likewise. * gnu/packages/search.scm (xapian)[inputs]: Likewise. * gnu/packages/sssd.scm (sssd)[native-inputs]: Likewise. * gnu/packages/storage.scm (ceph)[inputs]: Add UTIL-LINUX:LIB. * gnu/packages/task-management.scm (taskwarrior)[inputs]: Change to the "lib" output of UTIL-LINUX. * gnu/packages/virtualization.scm (libvirt, xen)[inputs]: Likewise. * gnu/packages/xorg.scm (libsm)[inputs]: Likewise.
2 years ago
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
  5. ;;; Copyright © 2016, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  6. ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
  7. ;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym@scratchpost.org>
  8. ;;; Copyright © 2016, 2017 David Craven <david@craven.ch>
  9. ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
  10. ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  11. ;;; Copyright © 2019 nee <nee@cock.li>
  12. ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
  13. ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
  14. ;;; Copyright © 2018, 2019, 2020 Vagrant Cascadian <vagrant@debian.org>
  15. ;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
  16. ;;;
  17. ;;; This file is part of GNU Guix.
  18. ;;;
  19. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  20. ;;; under the terms of the GNU General Public License as published by
  21. ;;; the Free Software Foundation; either version 3 of the License, or (at
  22. ;;; your option) any later version.
  23. ;;;
  24. ;;; GNU Guix is distributed in the hope that it will be useful, but
  25. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  26. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. ;;; GNU General Public License for more details.
  28. ;;;
  29. ;;; You should have received a copy of the GNU General Public License
  30. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  31. (define-module (gnu packages bootloaders)
  32. #:use-module (gnu packages)
  33. #:use-module (gnu packages admin)
  34. #:use-module (gnu packages algebra)
  35. #:use-module (gnu packages assembly)
  36. #:use-module (gnu packages base)
  37. #:use-module (gnu packages disk)
  38. #:use-module (gnu packages bison)
  39. #:use-module (gnu packages cdrom)
  40. #:use-module (gnu packages check)
  41. #:use-module (gnu packages compression)
  42. #:use-module (gnu packages cross-base)
  43. #:use-module (gnu packages disk)
  44. #:use-module (gnu packages firmware)
  45. #:use-module (gnu packages flex)
  46. #:use-module (gnu packages fontutils)
  47. #:use-module (gnu packages gcc)
  48. #:use-module (gnu packages gettext)
  49. #:use-module (gnu packages linux)
  50. #:use-module (gnu packages man)
  51. #:use-module (gnu packages mtools)
  52. #:use-module (gnu packages ncurses)
  53. #:use-module (gnu packages perl)
  54. #:use-module (gnu packages pkg-config)
  55. #:use-module (gnu packages python)
  56. #:use-module (gnu packages texinfo)
  57. #:use-module (gnu packages tls)
  58. #:use-module (gnu packages sdl)
  59. #:use-module (gnu packages swig)
  60. #:use-module (gnu packages valgrind)
  61. #:use-module (gnu packages virtualization)
  62. #:use-module (gnu packages xorg)
  63. #:use-module (gnu packages web)
  64. #:use-module (guix build-system gnu)
  65. #:use-module (guix download)
  66. #:use-module (guix git-download)
  67. #:use-module ((guix licenses) #:prefix license:)
  68. #:use-module (guix packages)
  69. #:use-module (guix utils)
  70. #:use-module (srfi srfi-1)
  71. #:use-module (srfi srfi-26)
  72. #:use-module (ice-9 regex))
  73. (define unifont
  74. ;; GNU Unifont, <http://gnu.org/s/unifont>.
  75. ;; GRUB needs it for its graphical terminal, gfxterm.
  76. (origin
  77. (method url-fetch)
  78. (uri
  79. "http://unifoundry.com/pub/unifont-7.0.06/font-builds/unifont-7.0.06.bdf.gz")
  80. (sha256
  81. (base32
  82. "0p2vhnc18cnbmb39vq4m7hzv4mhnm2l0a2s7gx3ar277fwng3hys"))))
  83. (define-public grub
  84. (package
  85. (name "grub")
  86. (version "2.04")
  87. (source (origin
  88. (method url-fetch)
  89. (uri (string-append "mirror://gnu/grub/grub-" version ".tar.xz"))
  90. (sha256
  91. (base32
  92. "0zgp5m3hmc9jh8wpjx6czzkh5id2y8n1k823x2mjvm2sk6b28ag5"))
  93. (patches (search-patches
  94. "grub-efi-fat-serial-number.patch"
  95. "grub-setup-root.patch"
  96. "grub-verifiers-Blocklist-fallout-cleanup.patch"
  97. "grub-cross-system-i686.patch"))))
  98. (build-system gnu-build-system)
  99. (arguments
  100. `(#:configure-flags
  101. ;; Counterintuitively, this *disables* a spurious Python dependency by
  102. ;; calling the ‘true’ binary instead. Python is only needed during
  103. ;; bootstrapping (for genptl.py), not when building from a release.
  104. (list "PYTHON=true")
  105. #:phases (modify-phases %standard-phases
  106. (add-after 'unpack 'patch-stuff
  107. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  108. (substitute* "grub-core/Makefile.in"
  109. (("/bin/sh") (which "sh")))
  110. ;; Give the absolute file name of 'mdadm', used to
  111. ;; determine the root file system when it's a RAID
  112. ;; device. Failing to do that, 'grub-probe' silently
  113. ;; fails if 'mdadm' is not in $PATH.
  114. (substitute* "grub-core/osdep/linux/getroot.c"
  115. (("argv\\[0\\] = \"mdadm\"")
  116. (string-append "argv[0] = \""
  117. (assoc-ref inputs "mdadm")
  118. "/sbin/mdadm\"")))
  119. ;; Make the font visible.
  120. (copy-file (assoc-ref (or native-inputs inputs)
  121. "unifont")
  122. "unifont.bdf.gz")
  123. (system* "gunzip" "unifont.bdf.gz")
  124. ;; Give the absolute file name of 'ckbcomp'.
  125. (substitute* "util/grub-kbdcomp.in"
  126. (("^ckbcomp ")
  127. (string-append (assoc-ref inputs "console-setup")
  128. "/bin/ckbcomp ")))
  129. #t))
  130. (add-before 'check 'disable-flaky-test
  131. (lambda _
  132. ;; This test is unreliable. For more information, see:
  133. ;; <https://bugs.gnu.org/26936>.
  134. (substitute* "Makefile.in"
  135. (("grub_cmd_date grub_cmd_set_date grub_cmd_sleep")
  136. "grub_cmd_date grub_cmd_sleep"))
  137. #t))
  138. (add-before 'check 'disable-pixel-perfect-test
  139. (lambda _
  140. ;; This test compares many screenshots rendered with an
  141. ;; older Unifont (9.0.06) than that packaged in Guix.
  142. (substitute* "Makefile.in"
  143. (("test_unset grub_func_test")
  144. "test_unset"))
  145. #t)))
  146. ;; Disable tests on ARM and AARCH64 platforms.
  147. #:tests? ,(not (any (cute string-prefix? <> (or (%current-target-system)
  148. (%current-system)))
  149. '("arm" "aarch64")))))
  150. (inputs
  151. `(("gettext" ,gettext-minimal)
  152. ;; Depend on LVM2 for libdevmapper, used by 'grub-probe' and
  153. ;; 'grub-install' to recognize mapped devices (LUKS, etc.)
  154. ,@(if (member (or (%current-target-system)
  155. (%current-system))
  156. (package-supported-systems lvm2))
  157. `(("lvm2" ,lvm2))
  158. '())
  159. ;; Depend on mdadm, which is invoked by 'grub-probe' and 'grub-install'
  160. ;; to determine whether the root file system is RAID.
  161. ,@(if (member (or (%current-target-system)
  162. (%current-system))
  163. (package-supported-systems mdadm))
  164. `(("mdadm" ,mdadm))
  165. '())
  166. ;; Console-setup's ckbcomp is invoked by grub-kbdcomp. It is required
  167. ;; for generating alternative keyboard layouts.
  168. ("console-setup" ,console-setup)
  169. ;; Needed for ‘grub-mount’, the only reliable way to tell whether a given
  170. ;; file system will be readable by GRUB without rebooting.
  171. ,@(if (member (or (%current-target-system)
  172. (%current-system))
  173. (package-supported-systems fuse))
  174. `(("fuse" ,fuse))
  175. '())
  176. ("freetype" ,freetype)
  177. ;; ("libusb" ,libusb)
  178. ("ncurses" ,ncurses)))
  179. (native-inputs
  180. `(("pkg-config" ,pkg-config)
  181. ("unifont" ,unifont)
  182. ("bison" ,bison)
  183. ("flex" ,flex)
  184. ("texinfo" ,texinfo)
  185. ("help2man" ,help2man)
  186. ;; XXX: When building GRUB 2.02 on 32-bit x86, we need a binutils
  187. ;; capable of assembling 64-bit instructions. However, our default
  188. ;; binutils on 32-bit x86 is not 64-bit capable.
  189. ,@(if (string-match "^i[3456]86-" (%current-system))
  190. (let ((binutils (package/inherit
  191. binutils
  192. (name "binutils-i386")
  193. (arguments
  194. (substitute-keyword-arguments (package-arguments binutils)
  195. ((#:configure-flags flags ''())
  196. `(cons "--enable-64-bit-bfd" ,flags)))))))
  197. `(("ld-wrapper" ,(make-ld-wrapper "ld-wrapper-i386"
  198. #:binutils binutils))
  199. ("binutils" ,binutils)))
  200. '())
  201. ;; Dependencies for the test suite. The "real" QEMU is needed here,
  202. ;; because several targets are used.
  203. ("parted" ,parted)
  204. ,@(if (member (%current-system) (package-supported-systems qemu-minimal))
  205. `(("qemu" ,qemu-minimal))
  206. '())
  207. ("xorriso" ,xorriso)))
  208. (home-page "https://www.gnu.org/software/grub/")
  209. (synopsis "GRand Unified Boot loader")
  210. (description
  211. "GRUB is a multiboot bootloader. It is used for initially loading the
  212. kernel of an operating system and then transferring control to it. The kernel
  213. then goes on to load the rest of the operating system. As a multiboot
  214. bootloader, GRUB handles the presence of multiple operating systems installed
  215. on the same computer; upon booting the computer, the user is presented with a
  216. menu to select one of the installed operating systems.")
  217. (license license:gpl3+)
  218. (properties '((cpe-name . "grub2")))))
  219. (define-public grub-minimal
  220. (package
  221. (inherit grub)
  222. (name "grub-minimal")
  223. (inputs
  224. (fold alist-delete (package-inputs grub)
  225. '("lvm2" "mdadm" "fuse" "console-setup")))
  226. (native-inputs
  227. (fold alist-delete (package-native-inputs grub)
  228. '("help2man" "texinfo" "parted" "qemu" "xorriso")))
  229. (arguments
  230. `(#:configure-flags (list "PYTHON=true")
  231. #:phases (modify-phases %standard-phases
  232. (add-after 'unpack 'patch-stuff
  233. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  234. (substitute* "grub-core/Makefile.in"
  235. (("/bin/sh") (which "sh")))
  236. ;; Make the font visible.
  237. (copy-file (assoc-ref (or native-inputs inputs)
  238. "unifont")
  239. "unifont.bdf.gz")
  240. (system* "gunzip" "unifont.bdf.gz")
  241. #t)))
  242. #:tests? #f))))
  243. (define-public grub-efi
  244. (package
  245. (inherit grub)
  246. (name "grub-efi")
  247. (synopsis "GRand Unified Boot loader (UEFI version)")
  248. (inputs
  249. `(("efibootmgr" ,efibootmgr)
  250. ("mtools" ,mtools)
  251. ,@(package-inputs grub)))
  252. (arguments
  253. `(;; TODO: Tests need a UEFI firmware for qemu. There is one at
  254. ;; https://github.com/tianocore/edk2/tree/master/OvmfPkg .
  255. ;; Search for 'OVMF' in "tests/util/grub-shell.in".
  256. ,@(substitute-keyword-arguments (package-arguments grub)
  257. ((#:tests? _ #f) #f)
  258. ((#:configure-flags flags ''())
  259. `(cons "--with-platform=efi" ,flags))
  260. ((#:phases phases)
  261. `(modify-phases ,phases
  262. (add-after 'patch-stuff 'use-absolute-efibootmgr-path
  263. (lambda* (#:key inputs #:allow-other-keys)
  264. (substitute* "grub-core/osdep/unix/platform.c"
  265. (("efibootmgr")
  266. (string-append (assoc-ref inputs "efibootmgr")
  267. "/sbin/efibootmgr")))
  268. #t))
  269. (add-after 'patch-stuff 'use-absolute-mtools-path
  270. (lambda* (#:key inputs #:allow-other-keys)
  271. (let ((mtools (assoc-ref inputs "mtools")))
  272. (substitute* "util/grub-mkrescue.c"
  273. (("\"mformat\"")
  274. (string-append "\"" mtools
  275. "/bin/mformat\"")))
  276. (substitute* "util/grub-mkrescue.c"
  277. (("\"mcopy\"")
  278. (string-append "\"" mtools
  279. "/bin/mcopy\"")))
  280. #t))))))))))
  281. ;; Because grub searches hardcoded paths it's easiest to just build grub
  282. ;; again to make it find both grub-pc and grub-efi. There is a command
  283. ;; line argument which allows you to specify ONE platform - but
  284. ;; grub-mkrescue will use multiple platforms if they are available
  285. ;; in the installation directory (without command line argument).
  286. (define-public grub-hybrid
  287. (package
  288. (inherit grub-efi)
  289. (name "grub-hybrid")
  290. (synopsis "GRand Unified Boot loader (hybrid version)")
  291. (inputs
  292. `(("grub" ,grub)
  293. ,@(package-inputs grub-efi)))
  294. (arguments
  295. (substitute-keyword-arguments (package-arguments grub-efi)
  296. ((#:modules modules `((guix build utils) (guix build gnu-build-system)))
  297. `((ice-9 ftw) ,@modules))
  298. ((#:phases phases)
  299. `(modify-phases ,phases
  300. (add-after 'install 'install-non-efi
  301. (lambda* (#:key inputs outputs #:allow-other-keys)
  302. (let ((input-dir (string-append (assoc-ref inputs "grub")
  303. "/lib/grub"))
  304. (output-dir (string-append (assoc-ref outputs "out")
  305. "/lib/grub")))
  306. (for-each
  307. (lambda (basename)
  308. (if (not (or (string-prefix? "." basename)
  309. (file-exists? (string-append output-dir "/" basename))))
  310. (symlink (string-append input-dir "/" basename)
  311. (string-append output-dir "/" basename))))
  312. (scandir input-dir))
  313. #t)))))))))
  314. (define-public syslinux
  315. (let ((commit "bb41e935cc83c6242de24d2271e067d76af3585c"))
  316. (package
  317. (name "syslinux")
  318. (version (git-version "6.04-pre" "1" commit))
  319. (source (origin
  320. (method git-fetch)
  321. (uri (git-reference
  322. (url "https://github.com/geneC/syslinux")
  323. (commit commit)))
  324. (file-name (git-file-name name version))
  325. (sha256
  326. (base32
  327. "0k8dvafd6410kqxf3kyr4y8jzmpmrih6wbjqg6gklak7945yflrc"))))
  328. (build-system gnu-build-system)
  329. (native-inputs
  330. `(("nasm" ,nasm)
  331. ("perl" ,perl)
  332. ("python-2" ,python-2)))
  333. (inputs
  334. `(("libuuid" ,util-linux "lib")
  335. ("mtools" ,mtools)))
  336. (arguments
  337. `(#:parallel-build? #f
  338. #:make-flags
  339. (list (string-append "BINDIR=" %output "/bin")
  340. (string-append "SBINDIR=" %output "/sbin")
  341. (string-append "LIBDIR=" %output "/lib")
  342. (string-append "INCDIR=" %output "/include")
  343. (string-append "DATADIR=" %output "/share")
  344. (string-append "MANDIR=" %output "/share/man")
  345. "PERL=perl"
  346. "bios")
  347. #:phases
  348. (modify-phases %standard-phases
  349. (add-after 'unpack 'patch-files
  350. (lambda* (#:key inputs #:allow-other-keys)
  351. (substitute* (find-files "." "Makefile.*|ppmtolss16")
  352. (("/bin/pwd") (which "pwd"))
  353. (("/bin/echo") (which "echo"))
  354. (("/usr/bin/perl") (which "perl")))
  355. (let ((mtools (assoc-ref inputs "mtools")))
  356. (substitute* (find-files "." "\\.c$")
  357. (("mcopy")
  358. (string-append mtools "/bin/mcopy"))
  359. (("mattrib")
  360. (string-append mtools "/bin/mattrib"))))
  361. #t))
  362. (delete 'configure)
  363. (add-before 'build 'set-permissions
  364. (lambda _
  365. (invoke "chmod" "a+w" "utils/isohybrid.in")))
  366. (replace 'check
  367. (lambda _
  368. (setenv "CC" "gcc")
  369. (substitute* "tests/unittest/include/unittest/unittest.h"
  370. ;; Don't look up headers under /usr.
  371. (("/usr/include/") ""))
  372. (invoke "make" "unittest"))))))
  373. (home-page "https://www.syslinux.org")
  374. (synopsis "Lightweight Linux bootloader")
  375. (description "Syslinux is a lightweight Linux bootloader.")
  376. ;; The Makefile specifically targets i386 and x86_64 using nasm.
  377. (supported-systems '("i686-linux" "x86_64-linux"))
  378. (license (list license:gpl2+
  379. license:bsd-3 ; gnu-efi/*
  380. license:bsd-4 ; gnu-efi/inc/* gnu-efi/lib/*
  381. ;; Also contains:
  382. license:expat license:isc license:zlib)))))
  383. (define-public dtc
  384. (package
  385. (name "dtc")
  386. (version "1.5.1")
  387. (source (origin
  388. (method url-fetch)
  389. (uri (string-append
  390. "mirror://kernel.org/software/utils/dtc/"
  391. "dtc-" version ".tar.xz"))
  392. (sha256
  393. (base32
  394. "07q3mdsvl4smbiakriq3hnsyyd0q344lsm306q0kgz4hjq1p82v6"))))
  395. (build-system gnu-build-system)
  396. (native-inputs
  397. `(("bison" ,bison)
  398. ("flex" ,flex)
  399. ("libyaml" ,libyaml)
  400. ("pkg-config" ,pkg-config)
  401. ("swig" ,swig)
  402. ("valgrind" ,valgrind)))
  403. (inputs
  404. `(("python" ,python)))
  405. (arguments
  406. `(#:make-flags
  407. (list "CC=gcc"
  408. ;; /bin/fdt{get,overlay,put} need help finding libfdt.so.1.
  409. (string-append "LDFLAGS=-Wl,-rpath="
  410. (assoc-ref %outputs "out") "/lib")
  411. (string-append "PREFIX=" (assoc-ref %outputs "out"))
  412. (string-append "SETUP_PREFIX=" (assoc-ref %outputs "out"))
  413. "INSTALL=install")
  414. #:phases
  415. (modify-phases %standard-phases
  416. (delete 'configure)))) ; no configure script
  417. (home-page "https://www.devicetree.org")
  418. (synopsis "Compiles device tree source files")
  419. (description "@command{dtc} compiles
  420. @uref{http://elinux.org/Device_Tree_Usage, device tree source files} to device
  421. tree binary files. These are board description files used by Linux and BSD.")
  422. (license license:gpl2+)))
  423. (define u-boot
  424. (package
  425. (name "u-boot")
  426. (version "2020.07")
  427. (source (origin
  428. (method url-fetch)
  429. (uri (string-append
  430. "ftp://ftp.denx.de/pub/u-boot/"
  431. "u-boot-" version ".tar.bz2"))
  432. (sha256
  433. (base32
  434. "0sjzy262x93aaqd6z24ziaq19xjjjk5f577ivf768vmvwsgbzxf1"))))
  435. (native-inputs
  436. `(("bc" ,bc)
  437. ("bison" ,bison)
  438. ("dtc" ,dtc)
  439. ("flex" ,flex)
  440. ("lz4" ,lz4)
  441. ("perl" ,perl)
  442. ("python" ,python)
  443. ("python-coverage" ,python-coverage)
  444. ("python-pytest" ,python-pytest)
  445. ("sdl2" ,sdl2)
  446. ("swig" ,swig)))
  447. (build-system gnu-build-system)
  448. (home-page "https://www.denx.de/wiki/U-Boot/")
  449. (synopsis "ARM bootloader")
  450. (description "U-Boot is a bootloader used mostly for ARM boards. It
  451. also initializes the boards (RAM etc).")
  452. (license license:gpl2+)))
  453. (define-public u-boot-tools
  454. (package
  455. (inherit u-boot)
  456. (name "u-boot-tools")
  457. (arguments
  458. `(#:make-flags '("HOSTCC=gcc")
  459. #:test-target "tests"
  460. #:phases
  461. (modify-phases %standard-phases
  462. (add-after 'unpack 'patch
  463. (lambda* (#:key inputs #:allow-other-keys)
  464. (substitute* "Makefile"
  465. (("/bin/pwd") (which "pwd"))
  466. (("/bin/false") (which "false")))
  467. (substitute* "tools/dtoc/fdt_util.py"
  468. (("'cc'") "'gcc'"))
  469. (substitute* "tools/patman/test_util.py"
  470. ;; python*-coverage is simply called coverage in guix.
  471. (("%s-coverage") "coverage")
  472. ;; XXX Allow for only 99% test coverage.
  473. ;; TODO: Find out why that is needed.
  474. (("if coverage != '100%':") "if not int(coverage.rstrip('%')) >= 99:"))
  475. (substitute* "test/run"
  476. ;; Make it easier to find test failures.
  477. (("#!/bin/bash") "#!/bin/bash -x")
  478. ;; This test would require git.
  479. (("\\./tools/patman/patman") (which "true"))
  480. ;; FIXME: test fails, needs further investiation
  481. (("run_test \"binman\"") ": run_test \"binman\"")
  482. ;; FIXME: code coverage not working
  483. (("run_test \"binman code coverage\"") ": run_test \"binman code coverage\"")
  484. (("run_test \"dtoc code coverage\"") ": run_test \"dtoc code coverage\"")
  485. (("run_test \"fdt code coverage\"") ": run_test \"fdt code coverage\"")
  486. ;; This test would require internet access.
  487. (("\\./tools/buildman/buildman") (which "true")))
  488. (substitute* "test/py/tests/test_sandbox_exit.py"
  489. (("def test_ctrl_c")
  490. "@pytest.mark.skip(reason='Guix has problems with SIGINT')
  491. def test_ctrl_c"))
  492. ;; Test against the tools being installed rather than tools built
  493. ;; for "sandbox" target.
  494. (substitute* "test/image/test-imagetools.sh"
  495. (("BASEDIR=sandbox") "BASEDIR=."))
  496. (for-each (lambda (file)
  497. (substitute* file
  498. ;; Disable signatures, due to GPL/Openssl
  499. ;; license incompatibilities. See
  500. ;; https://bugs.gnu.org/34717 for details.
  501. (("CONFIG_FIT_SIGNATURE=y") "CONFIG_FIT_SIGNATURE=n")
  502. ;; This test requires a sound system, which is un-used
  503. ;; in u-boot-tools.
  504. (("CONFIG_SOUND=y") "CONFIG_SOUND=n")))
  505. (find-files "configs" "sandbox_.*defconfig$|tools-only_defconfig"))
  506. #t))
  507. (replace 'configure
  508. (lambda* (#:key make-flags #:allow-other-keys)
  509. (apply invoke "make" "tools-only_defconfig" make-flags)))
  510. (replace 'build
  511. (lambda* (#:key inputs make-flags #:allow-other-keys)
  512. (apply invoke "make" "tools-all" make-flags)))
  513. (replace 'install
  514. (lambda* (#:key outputs #:allow-other-keys)
  515. (let* ((out (assoc-ref outputs "out"))
  516. (bin (string-append out "/bin")))
  517. (for-each (lambda (name)
  518. (install-file name bin))
  519. '("tools/netconsole"
  520. "tools/jtagconsole"
  521. "tools/gen_eth_addr"
  522. "tools/gen_ethaddr_crc"
  523. "tools/img2srec"
  524. "tools/mkenvimage"
  525. "tools/dumpimage"
  526. "tools/mkimage"
  527. "tools/proftool"
  528. "tools/fdtgrep"
  529. "tools/env/fw_printenv"
  530. "tools/sunxi-spl-image-builder"))
  531. #t)))
  532. (delete 'check)
  533. (add-after 'install 'check
  534. (lambda* (#:key make-flags test-target #:allow-other-keys)
  535. (invoke "test/image/test-imagetools.sh")))
  536. ;; Only run full test suite on x86_64 systems, as many tests
  537. ;; assume x86_64.
  538. ,@(if (string-match "^x86_64-linux"
  539. (or (%current-target-system)
  540. (%current-system)))
  541. '((add-after 'check 'check-x86
  542. (lambda* (#:key make-flags test-target #:allow-other-keys)
  543. (apply invoke "make" "mrproper" make-flags)
  544. (setenv "SDL_VIDEODRIVER" "dummy")
  545. (setenv "PAGER" "cat")
  546. (apply invoke "make" test-target make-flags))))
  547. '()))))
  548. (description "U-Boot is a bootloader used mostly for ARM boards. It
  549. also initializes the boards (RAM etc). This package provides its
  550. board-independent tools.")))
  551. (define-public (make-u-boot-package board triplet)
  552. "Returns a u-boot package for BOARD cross-compiled for TRIPLET."
  553. (let ((same-arch? (lambda ()
  554. (string=? (%current-system)
  555. (gnu-triplet->nix-system triplet)))))
  556. (package
  557. (inherit u-boot)
  558. (name (string-append "u-boot-"
  559. (string-replace-substring (string-downcase board)
  560. "_" "-")))
  561. (native-inputs
  562. `(,@(if (not (same-arch?))
  563. `(("cross-gcc" ,(cross-gcc triplet))
  564. ("cross-binutils" ,(cross-binutils triplet)))
  565. `())
  566. ,@(package-native-inputs u-boot)))
  567. (arguments
  568. `(#:modules ((ice-9 ftw)
  569. (srfi srfi-1)
  570. (guix build utils)
  571. (guix build gnu-build-system))
  572. #:test-target "test"
  573. #:make-flags
  574. (list "HOSTCC=gcc"
  575. ,@(if (not (same-arch?))
  576. `((string-append "CROSS_COMPILE=" ,triplet "-"))
  577. '()))
  578. #:phases
  579. (modify-phases %standard-phases
  580. (replace 'configure
  581. (lambda* (#:key outputs make-flags #:allow-other-keys)
  582. (let ((config-name (string-append ,board "_defconfig")))
  583. (if (file-exists? (string-append "configs/" config-name))
  584. (apply invoke "make" `(,@make-flags ,config-name))
  585. (begin
  586. (display "Invalid board name. Valid board names are:"
  587. (current-error-port))
  588. (let ((suffix-len (string-length "_defconfig"))
  589. (entries (scandir "configs")))
  590. (for-each (lambda (file-name)
  591. (when (string-suffix? "_defconfig" file-name)
  592. (format (current-error-port)
  593. "- ~A\n"
  594. (string-drop-right file-name
  595. suffix-len))))
  596. (sort entries string-ci<)))
  597. (error "Invalid boardname ~s." ,board))))))
  598. (replace 'install
  599. (lambda* (#:key outputs #:allow-other-keys)
  600. (let* ((out (assoc-ref outputs "out"))
  601. (libexec (string-append out "/libexec"))
  602. (uboot-files (append
  603. (remove
  604. ;; Those would not be reproducible
  605. ;; because of the randomness used
  606. ;; to produce them.
  607. ;; It's expected that the user will
  608. ;; use u-boot-tools to generate them
  609. ;; instead.
  610. (lambda (name)
  611. (string-suffix?
  612. "sunxi-spl-with-ecc.bin"
  613. name))
  614. (find-files "." ".*\\.(bin|efi|img|spl|itb|dtb|rksd)$"))
  615. (find-files "." "^(MLO|SPL)$"))))
  616. (mkdir-p libexec)
  617. (install-file ".config" libexec)
  618. ;; Useful for "qemu -kernel".
  619. (install-file "u-boot" libexec)
  620. (for-each
  621. (lambda (file)
  622. (let ((target-file (string-append libexec "/" file)))
  623. (mkdir-p (dirname target-file))
  624. (copy-file file target-file)))
  625. uboot-files)
  626. #t)))))))))
  627. (define-public u-boot-vexpress
  628. (make-u-boot-package "vexpress_ca9x4" "arm-linux-gnueabihf"))
  629. (define-public u-boot-malta
  630. (make-u-boot-package "malta" "mips64el-linux-gnuabi64"))
  631. (define-public u-boot-am335x-boneblack
  632. (let ((base (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf")))
  633. (package
  634. (inherit base)
  635. (name "u-boot-am335x-boneblack")
  636. (description "U-Boot is a bootloader used mostly for ARM boards. It
  637. also initializes the boards (RAM etc).
  638. This U-Boot is built for the BeagleBone Black, which was removed upstream,
  639. adjusted from the am335x_evm build with several device trees removed so that
  640. it fits within common partitioning schemes.")
  641. (arguments
  642. (substitute-keyword-arguments (package-arguments base)
  643. ((#:phases phases)
  644. `(modify-phases ,phases
  645. (add-after 'unpack 'patch-defconfig
  646. ;; Patch out other devicetrees to build image small enough to
  647. ;; fit within typical partitioning schemes where the first
  648. ;; partition begins at sector 2048.
  649. (lambda _
  650. (substitute* "configs/am335x_evm_defconfig"
  651. (("CONFIG_OF_LIST=.*$") "CONFIG_OF_LIST=\"am335x-evm am335x-boneblack\"\n"))
  652. #t)))))))))
  653. (define-public u-boot-am335x-evm
  654. (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf"))
  655. (define-public (make-u-boot-sunxi64-package board triplet)
  656. (let ((base (make-u-boot-package board triplet)))
  657. (package
  658. (inherit base)
  659. (arguments
  660. (substitute-keyword-arguments (package-arguments base)
  661. ((#:phases phases)
  662. `(modify-phases ,phases
  663. (add-after 'unpack 'set-environment
  664. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  665. (let ((bl31
  666. (string-append
  667. (assoc-ref (or native-inputs inputs) "firmware")
  668. "/bl31.bin")))
  669. (setenv "BL31" bl31)
  670. ;; This is necessary when we're using the bundled dtc.
  671. ;(setenv "PATH" (string-append (getenv "PATH") ":"
  672. ; "scripts/dtc"))
  673. )
  674. #t))))))
  675. (native-inputs
  676. `(("firmware" ,arm-trusted-firmware-sun50i-a64)
  677. ,@(package-native-inputs base))))))
  678. (define-public u-boot-pine64-plus
  679. (make-u-boot-sunxi64-package "pine64_plus" "aarch64-linux-gnu"))
  680. (define-public u-boot-pine64-lts
  681. (make-u-boot-sunxi64-package "pine64-lts" "aarch64-linux-gnu"))
  682. (define-public u-boot-pinebook
  683. (let ((base (make-u-boot-sunxi64-package "pinebook" "aarch64-linux-gnu")))
  684. (package
  685. (inherit base)
  686. (arguments
  687. (substitute-keyword-arguments (package-arguments base)
  688. ((#:phases phases)
  689. `(modify-phases ,phases
  690. (add-after 'unpack 'patch-pinebook-config
  691. ;; Fix regression with LCD video output introduced in 2020.01
  692. ;; https://patchwork.ozlabs.org/patch/1225130/
  693. (lambda _
  694. (substitute* "configs/pinebook_defconfig"
  695. (("CONFIG_VIDEO_BRIDGE_ANALOGIX_ANX6345=y") "CONFIG_VIDEO_BRIDGE_ANALOGIX_ANX6345=y\nCONFIG_VIDEO_BPP32=y"))
  696. #t)))))))))
  697. (define-public u-boot-bananapi-m2-ultra
  698. (make-u-boot-package "Bananapi_M2_Ultra" "arm-linux-gnueabihf"))
  699. (define-public u-boot-a20-olinuxino-lime
  700. (make-u-boot-package "A20-OLinuXino-Lime" "arm-linux-gnueabihf"))
  701. (define-public u-boot-a20-olinuxino-lime2
  702. (make-u-boot-package "A20-OLinuXino-Lime2" "arm-linux-gnueabihf"))
  703. (define-public u-boot-a20-olinuxino-micro
  704. (make-u-boot-package "A20-OLinuXino_MICRO" "arm-linux-gnueabihf"))
  705. (define-public u-boot-nintendo-nes-classic-edition
  706. (make-u-boot-package "Nintendo_NES_Classic_Edition" "arm-linux-gnueabihf"))
  707. (define-public u-boot-wandboard
  708. (make-u-boot-package "wandboard" "arm-linux-gnueabihf"))
  709. (define-public u-boot-mx6cuboxi
  710. (make-u-boot-package "mx6cuboxi" "arm-linux-gnueabihf"))
  711. (define-public u-boot-novena
  712. (let ((base (make-u-boot-package "novena" "arm-linux-gnueabihf")))
  713. (package
  714. (inherit base)
  715. (description "U-Boot is a bootloader used mostly for ARM boards. It
  716. also initializes the boards (RAM etc).
  717. This U-Boot is built for Novena. Be advised that this version, contrary
  718. to Novena upstream, does not load u-boot.img from the first partition.")
  719. (arguments
  720. (substitute-keyword-arguments (package-arguments base)
  721. ((#:phases phases)
  722. `(modify-phases ,phases
  723. (add-after 'unpack 'patch-novena-defconfig
  724. ;; Patch configuration to disable loading u-boot.img from FAT partition,
  725. ;; allowing it to be installed at a device offset.
  726. (lambda _
  727. (substitute* "configs/novena_defconfig"
  728. (("CONFIG_SPL_FS_FAT=y") "# CONFIG_SPL_FS_FAT is not set"))
  729. #t)))))))))
  730. (define-public u-boot-cubieboard
  731. (make-u-boot-package "Cubieboard" "arm-linux-gnueabihf"))
  732. (define-public u-boot-cubietruck
  733. (make-u-boot-package "Cubietruck" "arm-linux-gnueabihf"))
  734. (define-public u-boot-puma-rk3399
  735. (let ((base (make-u-boot-package "puma-rk3399" "aarch64-linux-gnu")))
  736. (package
  737. (inherit base)
  738. (arguments
  739. (substitute-keyword-arguments (package-arguments base)
  740. ((#:phases phases)
  741. `(modify-phases ,phases
  742. (add-after 'unpack 'set-environment
  743. (lambda* (#:key inputs #:allow-other-keys)
  744. ;; Need to copy the firmware into u-boot build
  745. ;; directory.
  746. (copy-file (string-append (assoc-ref inputs "firmware")
  747. "/bl31.bin") "bl31-rk3399.bin")
  748. (copy-file (string-append (assoc-ref inputs "firmware-m0")
  749. "/rk3399m0.bin") "rk3399m0.bin")
  750. #t))
  751. (add-after 'build 'build-itb
  752. (lambda* (#:key make-flags #:allow-other-keys)
  753. ;; The u-boot.itb is not built by default.
  754. (apply invoke "make" `(,@make-flags ,"u-boot.itb"))))
  755. (add-after 'build-itb 'build-rksd
  756. (lambda* (#:key inputs #:allow-other-keys)
  757. ;; Build Rockchip SD card images.
  758. (invoke "./tools/mkimage" "-T" "rksd" "-n" "rk3399" "-d"
  759. "spl/u-boot-spl.bin" "u-boot-spl.rksd")))))))
  760. (native-inputs
  761. `(("firmware" ,arm-trusted-firmware-puma-rk3399)
  762. ("firmware-m0" ,rk3399-cortex-m0)
  763. ,@(package-native-inputs base))))))
  764. (define-public u-boot-qemu-riscv64
  765. (make-u-boot-package "qemu-riscv64" "riscv64-linux-gnu"))
  766. (define-public u-boot-qemu-riscv64-smode
  767. (let ((base (make-u-boot-package "qemu-riscv64_smode" "riscv64-linux-gnu")))
  768. (package
  769. (inherit base)
  770. (source (origin
  771. (inherit (package-source u-boot))
  772. (patches
  773. (search-patches "u-boot-riscv64-fix-extlinux.patch")))))))
  774. (define-public u-boot-sifive-fu540
  775. (make-u-boot-package "sifive_fu540" "riscv64-linux-gnu"))
  776. (define-public u-boot-rock64-rk3328
  777. (let ((base (make-u-boot-package "rock64-rk3328" "aarch64-linux-gnu")))
  778. (package
  779. (inherit base)
  780. (arguments
  781. (substitute-keyword-arguments (package-arguments base)
  782. ((#:phases phases)
  783. `(modify-phases ,phases
  784. (add-after 'unpack 'set-environment
  785. (lambda* (#:key inputs #:allow-other-keys)
  786. (let ((bl31 (string-append (assoc-ref inputs "firmware")
  787. "/bl31.elf")))
  788. (setenv "BL31" bl31))
  789. #t))))))
  790. (native-inputs
  791. `(("firmware" ,arm-trusted-firmware-rk3328)
  792. ,@(package-native-inputs base))))))
  793. (define-public u-boot-firefly-rk3399
  794. (let ((base (make-u-boot-package "firefly-rk3399" "aarch64-linux-gnu")))
  795. (package
  796. (inherit base)
  797. (arguments
  798. (substitute-keyword-arguments (package-arguments base)
  799. ((#:phases phases)
  800. `(modify-phases ,phases
  801. (add-after 'unpack 'set-environment
  802. (lambda* (#:key inputs #:allow-other-keys)
  803. (setenv "BL31" (string-append (assoc-ref inputs "firmware")
  804. "/bl31.elf"))
  805. #t))
  806. ;; Phases do not succeed on the bl31 ELF.
  807. (delete 'strip)
  808. (delete 'validate-runpath)))))
  809. (native-inputs
  810. `(("firmware" ,arm-trusted-firmware-rk3399)
  811. ,@(package-native-inputs base))))))
  812. (define-public u-boot-rockpro64-rk3399
  813. (let ((base (make-u-boot-package "rockpro64-rk3399" "aarch64-linux-gnu")))
  814. (package
  815. (inherit base)
  816. (arguments
  817. (substitute-keyword-arguments (package-arguments base)
  818. ((#:phases phases)
  819. `(modify-phases ,phases
  820. (add-after 'unpack 'set-environment
  821. (lambda* (#:key inputs #:allow-other-keys)
  822. (setenv "BL31" (string-append (assoc-ref inputs "firmware")
  823. "/bl31.elf"))
  824. #t))
  825. ;; Phases do not succeed on the bl31 ELF.
  826. (delete 'strip)
  827. (delete 'validate-runpath)))))
  828. (native-inputs
  829. `(("firmware" ,arm-trusted-firmware-rk3399)
  830. ,@(package-native-inputs base))))))
  831. (define-public u-boot-pinebook-pro-rk3399
  832. (let ((base (make-u-boot-package "pinebook-pro-rk3399" "aarch64-linux-gnu")))
  833. (package
  834. (inherit base)
  835. (arguments
  836. (substitute-keyword-arguments (package-arguments base)
  837. ((#:phases phases)
  838. `(modify-phases ,phases
  839. (add-after 'unpack 'set-environment
  840. (lambda* (#:key inputs #:allow-other-keys)
  841. (setenv "BL31" (string-append (assoc-ref inputs "firmware")
  842. "/bl31.elf"))
  843. #t))
  844. ;; Phases do not succeed on the bl31 ELF.
  845. (delete 'strip)
  846. (delete 'validate-runpath)))))
  847. (native-inputs
  848. `(("firmware" ,arm-trusted-firmware-rk3399)
  849. ,@(package-native-inputs base))))))
  850. (define-public vboot-utils
  851. (package
  852. (name "vboot-utils")
  853. (version "R63-10032.B")
  854. (source (origin
  855. ;; XXX: Snapshots are available but changes timestamps every download.
  856. (method git-fetch)
  857. (uri (git-reference
  858. (url (string-append "https://chromium.googlesource.com"
  859. "/chromiumos/platform/vboot_reference"))
  860. (commit (string-append "release-" version))))
  861. (file-name (string-append name "-" version "-checkout"))
  862. (sha256
  863. (base32
  864. "0h0m3l69vp9dr6xrs1p6y7ilkq3jq8jraw2z20kqfv7lvc9l1lxj"))
  865. (patches
  866. (search-patches "vboot-utils-skip-test-workbuf.patch"
  867. "vboot-utils-fix-tests-show-contents.patch"
  868. "vboot-utils-fix-format-load-address.patch"))))
  869. (build-system gnu-build-system)
  870. (arguments
  871. `(#:make-flags (list "CC=gcc"
  872. ;; On ARM, we must pass "HOST_ARCH=arm" so that the
  873. ;; ${HOST_ARCH} and ${ARCH} variables in the makefile
  874. ;; match. Otherwise, ${HOST_ARCH} will be assigned
  875. ;; "armv7l", the value of `uname -m`, and will not
  876. ;; match ${ARCH}, which will make the tests require
  877. ;; QEMU for testing.
  878. ,@(if (string-prefix? "arm"
  879. (or (%current-target-system)
  880. (%current-system)))
  881. '("HOST_ARCH=arm")
  882. '())
  883. (string-append "DESTDIR=" (assoc-ref %outputs "out")))
  884. #:phases (modify-phases %standard-phases
  885. (add-after 'unpack 'patch-hard-coded-paths
  886. (lambda* (#:key inputs outputs #:allow-other-keys)
  887. (let ((coreutils (assoc-ref inputs "coreutils"))
  888. (diffutils (assoc-ref inputs "diffutils")))
  889. (substitute* "futility/misc.c"
  890. (("/bin/cp") (string-append coreutils "/bin/cp")))
  891. (substitute* "tests/bitmaps/TestBmpBlock.py"
  892. (("/usr/bin/cmp") (string-append diffutils "/bin/cmp")))
  893. (substitute* "vboot_host.pc.in"
  894. (("prefix=/usr")
  895. (string-append "prefix=" (assoc-ref outputs "out"))))
  896. #t)))
  897. (delete 'configure)
  898. (add-before 'check 'patch-tests
  899. (lambda _
  900. ;; These tests compare diffs against known-good values.
  901. ;; Patch the paths to match those in the build container.
  902. (substitute* (find-files "tests/futility/expect_output")
  903. (("/mnt/host/source/src/platform/vboot_reference")
  904. (string-append "/tmp/guix-build-" ,name "-" ,version
  905. ".drv-0/source")))
  906. ;; Tests require write permissions to many of these files.
  907. (for-each make-file-writable (find-files "tests/futility"))
  908. #t))
  909. (add-after 'install 'install-devkeys
  910. (lambda* (#:key outputs #:allow-other-keys)
  911. (let* ((out (assoc-ref outputs "out"))
  912. (share (string-append out "/share/vboot-utils")))
  913. (copy-recursively "tests/devkeys"
  914. (string-append share "/devkeys"))
  915. #t))))
  916. #:test-target "runtests"))
  917. (native-inputs
  918. `(("pkg-config" ,pkg-config)
  919. ;; For tests.
  920. ("diffutils" ,diffutils)
  921. ("python@2" ,python-2)))
  922. (inputs
  923. `(("coreutils" ,coreutils)
  924. ("libyaml" ,libyaml)
  925. ("openssl" ,openssl)
  926. ("openssl:static" ,openssl "static")
  927. ("util-linux" ,util-linux "lib")))
  928. (home-page
  929. "https://dev.chromium.org/chromium-os/chromiumos-design-docs/verified-boot")
  930. (synopsis "ChromiumOS verified boot utilities")
  931. (description
  932. "vboot-utils is a collection of tools to facilitate booting of
  933. Chrome-branded devices. This includes the @command{cgpt} partitioning
  934. program, the @command{futility} and @command{crossystem} firmware management
  935. tools, and more.")
  936. (license license:bsd-3)))
  937. (define-public os-prober
  938. (package
  939. (name "os-prober")
  940. (version "1.77")
  941. (source
  942. (origin
  943. (method url-fetch)
  944. (uri (string-append "mirror://debian/pool/main/o/os-prober/os-prober_"
  945. version ".tar.xz"))
  946. (sha256
  947. (base32
  948. "0pvhrw4h05n21zw7ig3a3bi8aqdh6zxs0x1znz4g7vhspsps93ld"))))
  949. (build-system gnu-build-system)
  950. (arguments
  951. `(#:modules ((guix build gnu-build-system)
  952. (guix build utils)
  953. (ice-9 regex) ; for string-match
  954. (srfi srfi-26)) ; for cut
  955. #:make-flags
  956. (list ,(string-append "CC=" (cc-for-target)))
  957. #:tests? #f ; no tests
  958. #:phases
  959. (modify-phases %standard-phases
  960. (replace 'configure
  961. (lambda* (#:key outputs #:allow-other-keys)
  962. (substitute* (find-files ".")
  963. (("/usr") (assoc-ref outputs "out")))
  964. (substitute* (find-files "." "50mounted-tests$")
  965. (("mkdir") "mkdir -p"))
  966. #t))
  967. (replace 'install
  968. (lambda* (#:key outputs #:allow-other-keys)
  969. (define (find-files-non-recursive directory)
  970. (find-files directory
  971. (lambda (file stat)
  972. (string-match (string-append "^" directory "/[^/]*$")
  973. file))
  974. #:directories? #t))
  975. (let* ((out (assoc-ref outputs "out"))
  976. (bin (string-append out "/bin"))
  977. (lib (string-append out "/lib"))
  978. (share (string-append out "/share")))
  979. (for-each (cut install-file <> bin)
  980. (list "linux-boot-prober" "os-prober"))
  981. (install-file "newns" (string-append lib "/os-prober"))
  982. (install-file "common.sh" (string-append share "/os-prober"))
  983. (install-file "os-probes/mounted/powerpc/20macosx"
  984. (string-append lib "/os-probes/mounted"))
  985. (for-each
  986. (lambda (directory)
  987. (for-each
  988. (lambda (file)
  989. (let ((destination (string-append lib "/" directory
  990. "/" (basename file))))
  991. (mkdir-p (dirname destination))
  992. (copy-recursively file destination)))
  993. (append (find-files-non-recursive (string-append directory "/common"))
  994. (find-files-non-recursive (string-append directory "/x86")))))
  995. (list "os-probes" "os-probes/mounted" "os-probes/init"
  996. "linux-boot-probes" "linux-boot-probes/mounted"))
  997. #t))))))
  998. (home-page "https://joeyh.name/code/os-prober")
  999. (synopsis "Detect other operating systems")
  1000. (description "os-prober probes disks on the system for other operating
  1001. systems so that they can be added to the bootloader. It also works out how to
  1002. boot existing GNU/Linux systems and detects what distribution is installed in
  1003. order to add a suitable bootloader menu entry.")
  1004. (license license:gpl2+)))