gnu: emacs-sly: Update to 20200228.
[jackhill/guix/guix.git] / gnu / packages / efi.scm
CommitLineData
f8ff37d6
DM
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2019 Danny Milosavljevic <dannym@scratchpost.org>
b856a78c 3;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
bc6c06b0 4;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
f8ff37d6
DM
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages efi)
3da49652
DM
22 #:use-module (gnu packages autotools)
23 #:use-module (gnu packages bash)
24 #:use-module (gnu packages linux)
25 #:use-module (gnu packages man)
527aab6f 26 #:use-module (gnu packages perl)
3da49652
DM
27 #:use-module (gnu packages pkg-config)
28 #:use-module (gnu packages tls)
f8ff37d6
DM
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix download)
3da49652 32 #:use-module (guix git-download)
f8ff37d6 33 #:use-module (guix packages)
b856a78c
EF
34 #:use-module (guix utils)
35 #:use-module (ice-9 match))
f8ff37d6
DM
36
37(define-public gnu-efi
38 (package
39 (name "gnu-efi")
93882a9c 40 (version "3.0.11")
f8ff37d6
DM
41 (source
42 (origin
43 (method url-fetch)
44 (uri (string-append "mirror://sourceforge/gnu-efi/"
93882a9c 45 "gnu-efi-" version ".tar.bz2"))
f8ff37d6 46 (sha256
93882a9c 47 (base32 "1ffnc4xbzfggs37ymrgfx76j56kk2644c081ivhr2bjkla9ag3gj"))))
f8ff37d6
DM
48 (build-system gnu-build-system)
49 (arguments
93882a9c 50 `(#:tests? #f ; none exist
f8ff37d6
DM
51 #:make-flags
52 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
53 #:phases
54 (modify-phases %standard-phases
55 (delete 'configure))))
56 (synopsis "EFI toolchain")
57 (description "This package provides an EFI (Extensible Firmware
58Interface) toolchain for building programs that can run in the
59environment presented by Intel's EFI.")
60 (home-page "https://directory.fsf.org/wiki/GNU_EFI")
61 ;; Distribution is allowed only when accepting all those licenses.
62 (license (list license:bsd-2 license:bsd-3 license:bsd-4 license:expat))))
3da49652
DM
63
64(define-public sbsigntools
65 (package
66 (name "sbsigntools")
bc6c06b0 67 (version "0.9.3")
3da49652
DM
68 (source
69 (origin
70 (method git-fetch)
71 (uri
72 (git-reference
73 (url "https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git")
74 (commit (string-append "v" version))
75 (recursive? #t)))
76 (file-name (git-file-name name version))
77 (sha256
bc6c06b0 78 (base32 "0gc3xmp73xl7z4nkwz4qy960rdflmx7k4ksgyblcnia9smvsir6y"))))
3da49652
DM
79 (build-system gnu-build-system)
80 (arguments
81 `(#:phases
82 (modify-phases %standard-phases
83 (add-after 'unpack 'patch-more-shebangs
84 (lambda* (#:key inputs #:allow-other-keys)
85 (substitute* "lib/ccan.git/tools/create-ccan-tree"
86 (("#!/bin/bash")
87 (string-append "#!"
88 (assoc-ref inputs "bash")
89 "/bin/bash")))
90 #t))
91 (add-after 'unpack 'patch
92 (lambda* (#:key inputs outputs #:allow-other-keys)
93 (substitute* '("configure.ac"
94 "tests/Makefile.am")
95 (("/usr/include/efi")
96 (string-append (assoc-ref inputs "gnu-efi")
97 "/include/efi"))
98 (("/usr/lib/gnuefi")
99 (string-append (assoc-ref inputs "gnu-efi")
100 "/lib")))
101 #t))
102 (add-after 'unpack 'setenv
103 (lambda _
104 (setenv "CC" "gcc")
105 #t)))))
106 (native-inputs
107 `(("autoconf" ,autoconf)
108 ("automake" ,automake)
109 ("bash" ,bash)
110 ("help2man" ,help2man)
111 ("pkg-config" ,pkg-config)
112 ("util-linux" ,util-linux))) ; getopt
113 (inputs
114 `(("gnu-efi" ,gnu-efi)
115 ("openssl" ,openssl)))
116 (synopsis "EFI signing tools")
117 (description "This package provides tools for signing EFI binaries.")
118 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git/")
119 (license license:gpl3+)))
527aab6f
DM
120
121(define-public efitools
122 (package
123 (name "efitools")
124 (version "1.9.2")
125 (source
126 (origin
127 (method git-fetch)
128 (uri
129 (git-reference
130 (url "https://git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git")
131 (commit (string-append "v" version))))
132 (file-name (git-file-name name version))
133 (sha256
134 (base32
135 "0jabgl2pxvfl780yvghq131ylpf82k7banjz0ksjhlm66ik8gb1i"))))
136 (build-system gnu-build-system)
137 (arguments
138 `(#:tests? #f ; No tests exist.
139 #:make-flags
140 '("CC=gcc")
141 #:phases
142 (modify-phases %standard-phases
143 (add-after 'unpack 'patch
144 (lambda* (#:key inputs outputs #:allow-other-keys)
145 (substitute* "Make.rules"
146 (("/usr/include/efi")
147 (string-append (assoc-ref inputs "gnu-efi")
148 "/include/efi"))
149 (("\\$\\(DESTDIR\\)/usr")
150 (string-append (assoc-ref outputs "out")))
151 (("/usr/lib/gnuefi")
152 (string-append (assoc-ref inputs "gnu-efi")
153 "/lib")))
154 #t))
155 (add-after 'unpack 'patch-more-shebangs
156 (lambda* (#:key inputs #:allow-other-keys)
157 (substitute* "xxdi.pl"
158 (("#!.*")
159 (string-append "#!"
160 (assoc-ref inputs "perl")
161 "/bin/perl\n")))
162 #t))
163 (delete 'configure))))
164 (native-inputs
165 `(("help2man" ,help2man)
166 ("perl" ,perl)
167 ("perl-file-slurp" ,perl-file-slurp)
168 ("sbsigntools" ,sbsigntools)))
169 (inputs
170 `(("gnu-efi" ,gnu-efi)
171 ("openssl" ,openssl)))
172 (synopsis "EFI tools (key management, variable management)")
173 (description "This package provides EFI tools for EFI key management
174and EFI variable management.")
175 (home-page "https://blog.hansenpartnership.com/efitools-1-4-with-linux-key-manipulation-utilities-released/")
176 ;; Programs are under GPL 2.
177 ;; Library routines (in lib/) are under LGPL 2.1.
178 ;; Compiling/linking/using OpenSSL is permitted.
179 (license (list license:gpl2
180 license:lgpl2.1))))
bb4a8f48
DM
181
182(define-public efilinux
183 (package
184 (name "efilinux")
185 (version "1.1")
186 (source (origin
187 (method git-fetch)
188 (uri (git-reference
189 (url "https://github.com/mfleming/efilinux.git")
190 (commit (string-append "efilinux-" version))))
191 (file-name (git-file-name name version))
192 (sha256
193 (base32
194 "0b4nxzr3wl5v4b52r79iw1arfgasz26xb38r2blw9v2qz2s1q9w2"))))
195 (build-system gnu-build-system)
196 (arguments
197 `(#:make-flags
198 (list "CC=gcc"
b856a78c
EF
199 ,@(match (%current-system)
200 ("aarch64-linux"
201 '("ARCH=aarch64"))
202 ("armhf-linux"
203 '("ARCH=arm"))
204 (_ '()))
bb4a8f48
DM
205 (string-append "INCDIR=" (assoc-ref %build-inputs "gnu-efi")
206 "/include")
207 (string-append "LIBDIR=" (assoc-ref %build-inputs "gnu-efi")
208 "/lib"))
209 #:tests? #f ; No tests exist.
210 #:phases
211 (modify-phases %standard-phases
212 (delete 'configure)
213 (replace 'install
214 (lambda* (#:key outputs #:allow-other-keys)
215 (install-file "efilinux.efi"
216 (string-append (assoc-ref outputs "out")
c7797b75 217 "/libexec"))
bb4a8f48
DM
218 #t)))))
219 (inputs
220 `(("gnu-efi" ,gnu-efi)))
221 (synopsis "Minimal Linux loader for UEFI")
222 (description "This package provides a minimal Linux loader as an UEFI
223program.")
224 (home-page "https://github.com/mfleming/efilinux")
225 (license license:bsd-2)))