Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
43cef0ba | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2021 Ludovic Courtès <ludo@gnu.org> |
35dfcdd7 | 3 | ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr> |
233e7676 | 4 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> |
ec80220c | 5 | ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org> |
31aa4379 | 6 | ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> |
e1e27737 | 7 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> |
a428fdd4 | 8 | ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il> |
1348185a | 9 | ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org> |
c2354111 | 10 | ;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr> |
7994250f | 11 | ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com> |
96e9f097 | 12 | ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org> |
dc9bdb1e | 13 | ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org> |
4ac70d02 | 14 | ;;; Copyright © 2016, 2018, 2019, 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
4ca80a2b | 15 | ;;; Copyright © 2016, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net> |
9b0942c1 | 16 | ;;; Copyright © 2016 David Craven <david@craven.ch> |
594d740d | 17 | ;;; Copyright © 2016 John Darrington <jmd@gnu.org> |
6f20fa3b | 18 | ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org> |
5849c68a | 19 | ;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com> |
440a3143 | 20 | ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com> |
3c986a7d | 21 | ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is> |
84334427 | 22 | ;;; Copyright © 2017, 2018, 2020 Leo Famulari <leo@famulari.name> |
01be4f93 | 23 | ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com> |
189d8422 | 24 | ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com> |
9b70f2c3 | 25 | ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com> |
1113386b | 26 | ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org> |
9cb4bda2 | 27 | ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com> |
3116c8b5 | 28 | ;;; Copyright © 2017 nee <nee-git@hidamari.blue> |
a73e7dd3 | 29 | ;;; Copyright © 2017 Dave Love <fx@gnu.org> |
25637b77 | 30 | ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr> |
e74b2c8e | 31 | ;;; Copyright © 2018, 2020 Brendan Tildesley <mail@brendan.scot> |
a0a273c1 | 32 | ;;; Copyright © 2018 Manuel Graf <graf@init.at> |
ff598353 | 33 | ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com> |
b2a5ef2e | 34 | ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com> |
bf2a9969 | 35 | ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de> |
76f5428b | 36 | ;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
71bd55cb | 37 | ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com> |
2f3c0fb3 | 38 | ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com> |
db87a223 | 39 | ;;; Copyright © 2019, 2020, 2021 Brice Waegeneire <brice@waegenei.re> |
8c6c97de | 40 | ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net> |
baa195dd | 41 | ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com> |
a69bc738 | 42 | ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz> |
dedbdacf | 43 | ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com> |
c06c7a3a | 44 | ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> |
11a5ffba | 45 | ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> |
1acf4c59 | 46 | ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com> |
b523b034 | 47 | ;;; Copyright © 2020 John Soo <jsoo1@asu.edu> |
a6843071 | 48 | ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de> |
d888a9c9 | 49 | ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com> |
957f4e4c | 50 | ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
c02cad6d | 51 | ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com> |
830c5479 | 52 | ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com> |
8c66ac72 | 53 | ;;; Copyright © 2020 David Dashyan <mail@davie.li> |
764fbd0a | 54 | ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net> |
794e26fd | 55 | ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com> |
fd76c904 | 56 | ;;; |
233e7676 | 57 | ;;; This file is part of GNU Guix. |
fd76c904 | 58 | ;;; |
233e7676 | 59 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
fd76c904 LC |
60 | ;;; under the terms of the GNU General Public License as published by |
61 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
62 | ;;; your option) any later version. | |
63 | ;;; | |
233e7676 | 64 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
fd76c904 LC |
65 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
66 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
67 | ;;; GNU General Public License for more details. | |
68 | ;;; | |
69 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 70 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
fd76c904 | 71 | |
1ffa7090 | 72 | (define-module (gnu packages linux) |
59a43334 | 73 | #:use-module (gnu packages) |
0c60cc53 | 74 | #:use-module (gnu packages acl) |
75750abb DC |
75 | #:use-module (gnu packages admin) |
76 | #:use-module (gnu packages algebra) | |
624ee211 | 77 | #:use-module (gnu packages audio) |
75750abb | 78 | #:use-module (gnu packages autotools) |
1eacffb9 | 79 | #:use-module (gnu packages backup) |
75750abb | 80 | #:use-module (gnu packages base) |
c7adafa7 | 81 | #:use-module (gnu packages bash) |
75750abb | 82 | #:use-module (gnu packages bison) |
a6843071 | 83 | #:use-module (gnu packages boost) |
75750abb DC |
84 | #:use-module (gnu packages calendar) |
85 | #:use-module (gnu packages check) | |
78410b09 | 86 | #:use-module (gnu packages cpio) |
e385e957 | 87 | #:use-module (gnu packages crypto) |
17a21bcf | 88 | #:use-module (gnu packages cryptsetup) |
f61e0e79 | 89 | #:use-module (gnu packages compression) |
255d1bbe | 90 | #:use-module (gnu packages dbm) |
b3ed50e6 | 91 | #:use-module (gnu packages datastructures) |
75750abb DC |
92 | #:use-module (gnu packages docbook) |
93 | #:use-module (gnu packages documentation) | |
94 | #:use-module (gnu packages elf) | |
1ffa7090 | 95 | #:use-module (gnu packages flex) |
afc9d8ec | 96 | #:use-module (gnu packages file) |
75750abb | 97 | #:use-module (gnu packages freedesktop) |
957f4e4c | 98 | #:use-module (gnu packages gawk) |
75750abb DC |
99 | #:use-module (gnu packages gcc) |
100 | #:use-module (gnu packages gettext) | |
101 | #:use-module (gnu packages glib) | |
626de0d1 | 102 | #:use-module (gnu packages golang) |
d7d42d6b | 103 | #:use-module (gnu packages gperf) |
8c6c97de | 104 | #:use-module (gnu packages gstreamer) |
75750abb | 105 | #:use-module (gnu packages gtk) |
8a890f3c | 106 | #:use-module (gnu packages haskell-apps) |
76f5428b | 107 | #:use-module (gnu packages haskell-xyz) |
1d484507 | 108 | #:use-module (gnu packages libunwind) |
1ffa7090 | 109 | #:use-module (gnu packages libusb) |
cfd8daaf JS |
110 | #:use-module (gnu packages llvm) |
111 | #:use-module (gnu packages lua) | |
01be4f93 | 112 | #:use-module (gnu packages man) |
75750abb | 113 | #:use-module (gnu packages maths) |
dfe93c9a | 114 | #:use-module (gnu packages multiprecision) |
1ffa7090 | 115 | #:use-module (gnu packages ncurses) |
8d8d227b | 116 | #:use-module (gnu packages netpbm) |
c7adafa7 | 117 | #:use-module (gnu packages networking) |
f8f44dd7 | 118 | #:use-module (gnu packages ninja) |
aff0cce9 | 119 | #:use-module (gnu packages nss) |
1ffa7090 | 120 | #:use-module (gnu packages perl) |
75750abb | 121 | #:use-module (gnu packages pciutils) |
1ffa7090 | 122 | #:use-module (gnu packages pkg-config) |
0d74462a | 123 | #:use-module (gnu packages popt) |
75750abb | 124 | #:use-module (gnu packages pulseaudio) |
7c0dbe78 | 125 | #:use-module (gnu packages python) |
e68f954e | 126 | #:use-module (gnu packages python-xyz) |
75750abb DC |
127 | #:use-module (gnu packages readline) |
128 | #:use-module (gnu packages rrdtool) | |
62b28c0e | 129 | #:use-module (gnu packages samba) |
8c6c97de | 130 | #:use-module (gnu packages sdl) |
9a3d176e | 131 | #:use-module (gnu packages serialization) |
b1fb4b23 | 132 | #:use-module (gnu packages slang) |
794e26fd | 133 | #:use-module (gnu packages sqlite) |
f57d2639 | 134 | #:use-module (gnu packages texinfo) |
75343704 | 135 | #:use-module (gnu packages tls) |
b3ed50e6 | 136 | #:use-module (gnu packages valgrind) |
7d2511bc | 137 | #:use-module (gnu packages video) |
d888a9c9 | 138 | #:use-module (gnu packages vulkan) |
7f412f33 | 139 | #:use-module (gnu packages web) |
7d2511bc | 140 | #:use-module (gnu packages xiph) |
75750abb | 141 | #:use-module (gnu packages xml) |
58c4f11e TGR |
142 | #:use-module (gnu packages xdisorg) |
143 | #:use-module (gnu packages xorg) | |
a73e7dd3 | 144 | #:use-module (gnu packages groff) |
e8ded3ee | 145 | #:use-module (gnu packages rsync) |
a73e7dd3 | 146 | #:use-module (gnu packages selinux) |
3eb7c000 | 147 | #:use-module (gnu packages swig) |
220193ad | 148 | #:use-module (guix build-system cmake) |
75750abb | 149 | #:use-module (guix build-system gnu) |
626de0d1 | 150 | #:use-module (guix build-system go) |
8c6c97de | 151 | #:use-module (guix build-system meson) |
e102f940 | 152 | #:use-module (guix build-system python) |
a94546ec | 153 | #:use-module (guix build-system trivial) |
6a8c4b9e | 154 | #:use-module (guix build-system linux-module) |
75750abb | 155 | #:use-module (guix download) |
6d31c175 | 156 | #:use-module (guix git-download) |
75750abb DC |
157 | #:use-module ((guix licenses) #:prefix license:) |
158 | #:use-module (guix packages) | |
1ad9c105 MW |
159 | #:use-module (guix gexp) |
160 | #:use-module (guix store) | |
161 | #:use-module (guix monads) | |
75750abb | 162 | #:use-module (guix utils) |
9e1f5a26 | 163 | #:use-module (guix deprecation) ;for libcap/next |
adddd5ba | 164 | #:use-module (srfi srfi-1) |
17db0706 | 165 | #:use-module (srfi srfi-2) |
a94546ec LC |
166 | #:use-module (srfi srfi-26) |
167 | #:use-module (ice-9 match)) | |
fd76c904 | 168 | |
aaf4cb20 LC |
169 | (define-public (system->linux-architecture arch) |
170 | "Return the Linux architecture name for ARCH, a Guix system name such as | |
6d7ef2aa | 171 | \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"." |
618cea69 NK |
172 | (let ((arch (car (string-split arch #\-)))) |
173 | (cond ((string=? arch "i686") "i386") | |
174 | ((string-prefix? "mips" arch) "mips") | |
aaf4cb20 | 175 | ((string-prefix? "arm" arch) "arm") |
503275e9 | 176 | ((string-prefix? "aarch64" arch) "arm64") |
605fec78 | 177 | ((string-prefix? "alpha" arch) "alpha") |
c89e2107 | 178 | ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le" |
b91004c2 | 179 | ((string-prefix? "s390" arch) "s390") |
7180dd67 | 180 | ((string-prefix? "riscv" arch) "riscv") |
618cea69 NK |
181 | (else arch)))) |
182 | ||
440a3143 CSLL |
183 | (define-public (system->defconfig system) |
184 | "Some systems (notably powerpc-linux) require a special target for kernel | |
70c68ed5 | 185 | defconfig. Return the appropriate make target if applicable, otherwise return |
440a3143 CSLL |
186 | \"defconfig\"." |
187 | (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig") | |
62942992 | 188 | ((string-prefix? "powerpc64-" system) "ppc64_defconfig") |
c89e2107 | 189 | ((string-prefix? "powerpc64le-" system) "ppc64_defconfig") |
440a3143 CSLL |
190 | (else "defconfig"))) |
191 | ||
1ad9c105 MW |
192 | \f |
193 | ;;; | |
194 | ;;; Kernel source code deblobbing. | |
195 | ;;; | |
196 | ||
197 | (define (linux-libre-deblob-scripts version | |
198 | deblob-hash | |
199 | deblob-check-hash) | |
200 | (list (version-major+minor version) | |
201 | (origin | |
202 | (method url-fetch) | |
203 | (uri (string-append "https://linux-libre.fsfla.org" | |
204 | "/pub/linux-libre/releases/" version "-gnu/" | |
cca5720f | 205 | "deblob-" (version-major+minor version))) |
1bc27503 | 206 | (file-name (string-append "linux-libre-deblob-" |
cca5720f | 207 | version)) |
1ad9c105 MW |
208 | (sha256 deblob-hash)) |
209 | (origin | |
210 | (method url-fetch) | |
211 | (uri (string-append "https://linux-libre.fsfla.org" | |
212 | "/pub/linux-libre/releases/" version "-gnu/" | |
213 | "deblob-check")) | |
105a0370 | 214 | (file-name (string-append "linux-libre-deblob-check-" version)) |
1ad9c105 MW |
215 | (sha256 deblob-check-hash)))) |
216 | ||
1ad9c105 MW |
217 | (define* (computed-origin-method gexp-promise hash-algo hash |
218 | #:optional (name "source") | |
219 | #:key (system (%current-system)) | |
220 | (guile (default-guile))) | |
221 | "Return a derivation that executes the G-expression that results | |
222 | from forcing GEXP-PROMISE." | |
223 | (mlet %store-monad ((guile (package->derivation guile system))) | |
224 | (gexp->derivation (or name "computed-origin") | |
225 | (force gexp-promise) | |
226 | #:graft? #f ;nothing to graft | |
227 | #:system system | |
228 | #:guile-for-build guile))) | |
229 | ||
230 | (define (make-linux-libre-source version | |
231 | upstream-source | |
232 | deblob-scripts) | |
233 | "Return a 'computed' origin that generates a Linux-libre tarball from the | |
234 | corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS." | |
235 | (match deblob-scripts | |
236 | ((deblob-version (? origin? deblob) (? origin? deblob-check)) | |
237 | (unless (string=? deblob-version (version-major+minor version)) | |
238 | ;; The deblob script cannot be expected to work properly on a | |
239 | ;; different version (major+minor) of Linux, even if no errors | |
240 | ;; are signaled during execution. | |
241 | (error "deblob major+minor version mismatch")) | |
242 | (origin | |
243 | (method computed-origin-method) | |
244 | (file-name (string-append "linux-libre-" version "-guix.tar.xz")) | |
245 | (sha256 #f) | |
246 | (uri | |
247 | (delay | |
248 | (with-imported-modules '((guix build utils)) | |
249 | #~(begin | |
250 | (use-modules (guix build utils) | |
251 | (srfi srfi-1) | |
252 | (ice-9 match) | |
253 | (ice-9 ftw)) | |
8b41fdaf MC |
254 | |
255 | (setvbuf (current-output-port) 'line) | |
256 | ||
1ad9c105 MW |
257 | (let ((dir (string-append "linux-" #$version))) |
258 | ||
259 | (mkdir "/tmp/bin") | |
260 | (set-path-environment-variable | |
261 | "PATH" '("bin") | |
262 | (list "/tmp" | |
263 | #+(canonical-package bash) | |
264 | #+(canonical-package coreutils) | |
265 | #+(canonical-package diffutils) | |
266 | #+(canonical-package findutils) | |
267 | #+(canonical-package patch) | |
268 | #+(canonical-package xz) | |
269 | #+(canonical-package sed) | |
270 | #+(canonical-package grep) | |
271 | #+(canonical-package bzip2) | |
272 | #+(canonical-package gzip) | |
273 | #+(canonical-package tar) | |
957f4e4c | 274 | #+(canonical-package gawk) |
b9a7fa81 | 275 | #+python-wrapper)) |
1ad9c105 MW |
276 | |
277 | (with-directory-excursion "/tmp/bin" | |
278 | ||
279 | (copy-file #+deblob "deblob") | |
280 | (chmod "deblob" #o755) | |
281 | (substitute* "deblob" | |
282 | (("/bin/sh") (which "sh"))) | |
283 | ||
284 | (copy-file #+deblob-check "deblob-check") | |
285 | (chmod "deblob-check" #o755) | |
286 | (substitute* "deblob-check" | |
287 | (("/bin/sh") (which "sh")) | |
288 | (("/bin/sed") (which "sed")) | |
289 | (("/usr/bin/python") (which "python")))) | |
290 | ||
291 | (if (file-is-directory? #+upstream-source) | |
292 | (begin | |
293 | (format #t "Copying upstream linux source...~%") | |
1ad9c105 MW |
294 | (invoke "cp" "--archive" #+upstream-source dir) |
295 | (invoke "chmod" "--recursive" "u+w" dir)) | |
296 | (begin | |
297 | (format #t "Unpacking upstream linux tarball...~%") | |
1ad9c105 MW |
298 | (invoke "tar" "xf" #$upstream-source) |
299 | (match (scandir "." | |
300 | (lambda (name) | |
301 | (and (not (member name '("." ".."))) | |
302 | (file-is-directory? name)))) | |
303 | ((unpacked-dir) | |
304 | (unless (string=? dir unpacked-dir) | |
305 | (rename-file unpacked-dir dir))) | |
306 | (dirs | |
307 | (error "multiple directories found" dirs))))) | |
308 | ||
309 | (with-directory-excursion dir | |
1ad9c105 | 310 | (format #t "Running deblob script...~%") |
1ad9c105 MW |
311 | (invoke "/tmp/bin/deblob")) |
312 | ||
313 | (format #t "~%Packing new Linux-libre tarball...~%") | |
d0aff873 | 314 | (invoke "tar" "cvfa" #$output |
1ad9c105 MW |
315 | ;; Avoid non-determinism in the archive. |
316 | "--mtime=@0" | |
317 | "--owner=root:0" | |
318 | "--group=root:0" | |
319 | "--sort=name" | |
320 | "--hard-dereference" | |
957f4e4c MC |
321 | dir) |
322 | ||
323 | (format #t "~%Scanning the generated tarball for blobs...~%") | |
324 | (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs" | |
325 | #$output)))))))))) | |
1ad9c105 MW |
326 | |
327 | \f | |
328 | ;;; | |
329 | ;;; Kernel sources. | |
330 | ;;; | |
331 | ||
6023cc74 LC |
332 | (define (linux-libre-urls version) |
333 | "Return a list of URLs for Linux-Libre VERSION." | |
334 | (list (string-append | |
8420c7a3 | 335 | "https://linux-libre.fsfla.org/pub/linux-libre/releases/" |
6023cc74 LC |
336 | version "-gnu/linux-libre-" version "-gnu.tar.xz") |
337 | ||
338 | ;; XXX: Work around <http://bugs.gnu.org/14851>. | |
339 | (string-append | |
340 | "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-" | |
341 | version "-gnu.tar.xz") | |
342 | ||
343 | ;; Maybe this URL will become valid eventually. | |
344 | (string-append | |
345 | "mirror://gnu/linux-libre/" version "-gnu/linux-libre-" | |
346 | version "-gnu.tar.xz"))) | |
347 | ||
1ad9c105 MW |
348 | (define (%upstream-linux-source version hash) |
349 | (origin | |
350 | (method url-fetch) | |
351 | (uri (string-append "mirror://kernel.org" | |
352 | "/linux/kernel/v" (version-major version) ".x/" | |
353 | "linux-" version ".tar.xz")) | |
354 | (sha256 hash))) | |
355 | ||
66b5bc31 LF |
356 | ;; The current "stable" kernels. That is, the most recently released major |
357 | ;; versions that are still supported upstream. | |
edfd9796 | 358 | (define-public linux-libre-5.12-version "5.12.12") |
a21355bd LF |
359 | (define deblob-scripts-5.12 |
360 | (linux-libre-deblob-scripts | |
361 | linux-libre-5.12-version | |
362 | (base32 "1vdsr9y4gckknrbqcjyfakwva3k0vb5zcivzk3k1s9mh7qp9dils") | |
41d73dfb | 363 | (base32 "1p1jzrci97sipjdx3h0vmdnw35z2vyvczinxmp65xi1ja7ww0g14"))) |
a21355bd LF |
364 | (define-public linux-libre-5.12-pristine-source |
365 | (let ((version linux-libre-5.12-version) | |
edfd9796 | 366 | (hash (base32 "1a1ymbgkp8ngrkf7cfjrn56zb9qz1mm1j1pmd60g85ln7nyb4ai1"))) |
a21355bd LF |
367 | (make-linux-libre-source version |
368 | (%upstream-linux-source version hash) | |
369 | deblob-scripts-5.12))) | |
370 | ||
1b5b8821 LF |
371 | ;; The "longterm" kernels — the older releases with long-term upstream support. |
372 | ;; Here are the support timelines: | |
373 | ;; <https://www.kernel.org/category/releases.html> | |
0a5b2b82 | 374 | (define-public linux-libre-5.10-version "5.10.45") |
66b5bc31 LF |
375 | (define deblob-scripts-5.10 |
376 | (linux-libre-deblob-scripts | |
27ae8da8 | 377 | linux-libre-5.10-version |
8791cc3b | 378 | (base32 "1rmnx1px4sizs2lq831yd2g9dyflg0vmykz3cv9443x2a2vwy81f") |
f23d5340 | 379 | (base32 "1zsr02zmpx3968277sy8pfs2mdlgh86ifymwyj0r56wnhzf5q6hk"))) |
66b5bc31 LF |
380 | (define-public linux-libre-5.10-pristine-source |
381 | (let ((version linux-libre-5.10-version) | |
0a5b2b82 | 382 | (hash (base32 "01rmw5rnxyybr8sh0v9rgamrg71ign2nr7m0ilrq9704k6dj9dzj"))) |
66b5bc31 LF |
383 | (make-linux-libre-source version |
384 | (%upstream-linux-source version hash) | |
385 | deblob-scripts-5.10))) | |
1b131e1f | 386 | |
879eb819 | 387 | (define-public linux-libre-5.4-version "5.4.127") |
fe752d8c LF |
388 | (define deblob-scripts-5.4 |
389 | (linux-libre-deblob-scripts | |
b1b8ac09 | 390 | linux-libre-5.4-version |
81df99fc | 391 | (base32 "12g1wm7xvjvmjanbgg0ahxm4vs2n5bvicfnnnag4h35vl4q3lggg") |
b97a533a | 392 | (base32 "1xghbbnaisjd0k1klbyn1p7r6r4x5a1bpmkm56a3gh2zvw4s7mj8"))) |
952820c5 MW |
393 | (define-public linux-libre-5.4-pristine-source |
394 | (let ((version linux-libre-5.4-version) | |
879eb819 | 395 | (hash (base32 "1gr89x1ymxaslp9fqcchaa7939yvhxy67z3pgskmx6z2vrd9pgd0"))) |
9e34a5f3 TGR |
396 | (make-linux-libre-source version |
397 | (%upstream-linux-source version hash) | |
952820c5 | 398 | deblob-scripts-5.4))) |
9e34a5f3 | 399 | |
ff9a4ced | 400 | (define-public linux-libre-4.19-version "4.19.195") |
fe752d8c LF |
401 | (define deblob-scripts-4.19 |
402 | (linux-libre-deblob-scripts | |
40930841 | 403 | linux-libre-4.19-version |
7acd3d3c | 404 | (base32 "1jfcz4lnm44b3xzrkiipvw35kl0vvdvhr2pg7jfwf02f6qbvay18") |
fe752d8c | 405 | (base32 "1jiaw0as1ippkrjdpd52657w5mz9qczg3y2hlra7m9k0xawwiqlf"))) |
1ad9c105 MW |
406 | (define-public linux-libre-4.19-pristine-source |
407 | (let ((version linux-libre-4.19-version) | |
ff9a4ced | 408 | (hash (base32 "02rdy5mdmwxli0cin5n7ab492y9fs01hhqxrjq6b4idwv5baa42m"))) |
1ad9c105 MW |
409 | (make-linux-libre-source version |
410 | (%upstream-linux-source version hash) | |
411 | deblob-scripts-4.19))) | |
412 | ||
52bbf336 | 413 | (define-public linux-libre-4.14-version "4.14.237") |
fe752d8c LF |
414 | (define deblob-scripts-4.14 |
415 | (linux-libre-deblob-scripts | |
76ab528d | 416 | linux-libre-4.14-version |
9a57cac2 | 417 | (base32 "07afckszdm4pq008i6ij0pxpw2rpgi5q931nxh6dxcczpicvwbc9") |
fe752d8c | 418 | (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky"))) |
1ad9c105 MW |
419 | (define-public linux-libre-4.14-pristine-source |
420 | (let ((version linux-libre-4.14-version) | |
52bbf336 | 421 | (hash (base32 "0kib9p61hhwjbr8zhir9aw86qik7k6bm95503n3k09ayyachajpq"))) |
1ad9c105 MW |
422 | (make-linux-libre-source version |
423 | (%upstream-linux-source version hash) | |
424 | deblob-scripts-4.14))) | |
425 | ||
69a81892 | 426 | (define-public linux-libre-4.9-version "4.9.273") |
fe752d8c LF |
427 | (define deblob-scripts-4.9 |
428 | (linux-libre-deblob-scripts | |
65812dd3 | 429 | linux-libre-4.9-version |
19f0fafa | 430 | (base32 "1w8cb8w1cpcwswc3rxq6vwjafw6yy0igib34rrm93ag5h6inncfv") |
fe752d8c | 431 | (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2"))) |
1ad9c105 MW |
432 | (define-public linux-libre-4.9-pristine-source |
433 | (let ((version linux-libre-4.9-version) | |
69a81892 | 434 | (hash (base32 "0jjarv3xfkc21j1xhgch53w8wm6rq3xw1i03rjw9fv5i9k4x6qsw"))) |
1ad9c105 MW |
435 | (make-linux-libre-source version |
436 | (%upstream-linux-source version hash) | |
437 | deblob-scripts-4.9))) | |
438 | ||
574d3178 | 439 | (define-public linux-libre-4.4-version "4.4.273") |
fe752d8c LF |
440 | (define deblob-scripts-4.4 |
441 | (linux-libre-deblob-scripts | |
044be2e3 | 442 | linux-libre-4.4-version |
17315616 | 443 | (base32 "1lid4k7g947yi3hcjj0lz0fnssawbph3jsy67vrv57l5imrhv3zs") |
fe752d8c | 444 | (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf"))) |
1ad9c105 MW |
445 | (define-public linux-libre-4.4-pristine-source |
446 | (let ((version linux-libre-4.4-version) | |
574d3178 | 447 | (hash (base32 "1pd39cak0zhda3m9nvn9yxgd070wxvckaha5wl8pi7c8i6jfpclb"))) |
1ad9c105 MW |
448 | (make-linux-libre-source version |
449 | (%upstream-linux-source version hash) | |
450 | deblob-scripts-4.4))) | |
451 | ||
452 | (define %boot-logo-patch | |
453 | ;; Linux-Libre boot logo featuring Freedo and a gnu. | |
454 | (origin | |
455 | (method url-fetch) | |
456 | (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/" | |
457 | "lemote/gnewsense/branches/3.16/100gnu+freedo.patch")) | |
458 | (sha256 | |
459 | (base32 | |
460 | "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06")))) | |
461 | ||
462 | (define %linux-libre-arm-export-__sync_icache_dcache-patch | |
463 | (origin | |
464 | (method url-fetch) | |
465 | (uri (string-append | |
466 | "https://salsa.debian.org/kernel-team/linux" | |
467 | "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0" | |
468 | "/debian/patches/bugfix/arm/" | |
469 | "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch")) | |
470 | (file-name "linux-libre-arm-export-__sync_icache_dcache.patch") | |
471 | (sha256 | |
472 | (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f")))) | |
473 | ||
474 | (define (source-with-patches source patches) | |
475 | (origin | |
476 | (inherit source) | |
477 | (patches (append (origin-patches source) | |
478 | patches)))) | |
479 | ||
a21355bd LF |
480 | (define-public linux-libre-5.12-source |
481 | (source-with-patches linux-libre-5.12-pristine-source | |
482 | (list %boot-logo-patch | |
b5069d8e VC |
483 | %linux-libre-arm-export-__sync_icache_dcache-patch |
484 | ;; Pinebook Pro patch to fix LCD display | |
485 | (search-patch | |
486 | "linux-libre-arm64-generic-pinebook-lcd.patch")))) | |
a21355bd | 487 | |
66b5bc31 LF |
488 | (define-public linux-libre-5.10-source |
489 | (source-with-patches linux-libre-5.10-pristine-source | |
490 | (list %boot-logo-patch | |
d018a11e | 491 | %linux-libre-arm-export-__sync_icache_dcache-patch |
b5069d8e VC |
492 | ;; Pinebook Pro patch to fix LCD display |
493 | (search-patch | |
494 | "linux-libre-arm64-generic-pinebook-lcd.patch")))) | |
66b5bc31 | 495 | |
952820c5 MW |
496 | (define-public linux-libre-5.4-source |
497 | (source-with-patches linux-libre-5.4-pristine-source | |
498 | (list %boot-logo-patch | |
730a4b10 VC |
499 | %linux-libre-arm-export-__sync_icache_dcache-patch |
500 | ;; Pinebook Pro patch from linux-next, | |
501 | ;; can be dropped for linux-libre 5.7 | |
502 | (search-patch | |
503 | "linux-libre-support-for-Pinebook-Pro.patch")))) | |
9e34a5f3 | 504 | |
1ad9c105 MW |
505 | (define-public linux-libre-4.19-source |
506 | (source-with-patches linux-libre-4.19-pristine-source | |
507 | (list %boot-logo-patch | |
7089a45a | 508 | %linux-libre-arm-export-__sync_icache_dcache-patch))) |
1ad9c105 MW |
509 | |
510 | (define-public linux-libre-4.14-source | |
511 | (source-with-patches linux-libre-4.14-pristine-source | |
ceaeae8f | 512 | (list %boot-logo-patch))) |
1ad9c105 MW |
513 | |
514 | (define-public linux-libre-4.9-source | |
515 | (source-with-patches linux-libre-4.9-pristine-source | |
19783b74 | 516 | (list %boot-logo-patch))) |
1ad9c105 MW |
517 | |
518 | (define-public linux-libre-4.4-source | |
519 | (source-with-patches linux-libre-4.4-pristine-source | |
90ff53af | 520 | (list %boot-logo-patch))) |
1ad9c105 MW |
521 | |
522 | \f | |
523 | ;;; | |
524 | ;;; Kernel headers. | |
525 | ;;; | |
526 | ||
527 | (define (make-linux-libre-headers version hash-string) | |
528 | (make-linux-libre-headers* version | |
529 | (origin | |
530 | (method url-fetch) | |
531 | (uri (linux-libre-urls version)) | |
532 | (sha256 (base32 hash-string))))) | |
533 | ||
534 | (define (make-linux-libre-headers* version source) | |
b450d2b4 DC |
535 | (package |
536 | (name "linux-libre-headers") | |
a15cee50 | 537 | (version version) |
1ad9c105 | 538 | (source source) |
b450d2b4 | 539 | (build-system gnu-build-system) |
a15cee50 CD |
540 | (native-inputs `(("perl" ,perl) |
541 | ,@(if (version>=? version "4.16") | |
542 | `(("flex" ,flex) | |
543 | ("bison" ,bison)) | |
e8ded3ee TGR |
544 | '()) |
545 | ,@(if (version>=? version "5.3") | |
546 | `(("rsync" ,rsync)) | |
a15cee50 | 547 | '()))) |
b450d2b4 DC |
548 | (arguments |
549 | `(#:modules ((guix build gnu-build-system) | |
550 | (guix build utils) | |
551 | (srfi srfi-1)) | |
552 | #:phases | |
553 | (modify-phases %standard-phases | |
554 | (delete 'configure) | |
555 | (replace 'build | |
556 | (lambda _ | |
557 | (let ((arch ,(system->linux-architecture | |
558 | (or (%current-target-system) | |
440a3143 CSLL |
559 | (%current-system)))) |
560 | (defconfig ,(system->defconfig | |
561 | (or (%current-target-system) | |
562 | (%current-system))))) | |
b450d2b4 | 563 | (setenv "ARCH" arch) |
618cea69 | 564 | (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")) |
5dc9ded1 MW |
565 | (invoke "make" defconfig) |
566 | (invoke "make" "mrproper" "headers_check")))) | |
b450d2b4 DC |
567 | (replace 'install |
568 | (lambda* (#:key outputs #:allow-other-keys) | |
80fe5c60 | 569 | (let ((out (assoc-ref outputs "out"))) |
5dc9ded1 MW |
570 | (invoke "make" |
571 | (string-append "INSTALL_HDR_PATH=" out) | |
572 | "headers_install") | |
b15389e1 | 573 | |
5dc9ded1 MW |
574 | (mkdir (string-append out "/include/config")) |
575 | (call-with-output-file | |
576 | (string-append out | |
577 | "/include/config/kernel.release") | |
578 | (lambda (p) | |
579 | (format p "~a-default~%" ,version))) | |
b15389e1 | 580 | |
5dc9ded1 MW |
581 | ;; Remove the '.install' and '..install.cmd' files; the |
582 | ;; latter contains store paths, which pulls in bootstrap | |
583 | ;; binaries in the build environment, and prevents bit | |
584 | ;; reproducibility for the bootstrap binaries. | |
585 | (for-each delete-file (find-files out "\\.install")) | |
586 | ||
587 | #t)))) | |
b15389e1 | 588 | #:allowed-references () |
80fe5c60 | 589 | #:tests? #f)) |
6fd52309 | 590 | (home-page "https://www.gnu.org/software/linux-libre/") |
80fe5c60 LC |
591 | (synopsis "GNU Linux-Libre kernel headers") |
592 | (description "Headers of the Linux-Libre kernel.") | |
b450d2b4 | 593 | (license license:gpl2))) |
80fe5c60 | 594 | |
a21355bd LF |
595 | (define-public linux-libre-headers-5.12 |
596 | (make-linux-libre-headers* linux-libre-5.12-version | |
597 | linux-libre-5.12-source)) | |
598 | ||
66b5bc31 LF |
599 | (define-public linux-libre-headers-5.10 |
600 | (make-linux-libre-headers* linux-libre-5.10-version | |
601 | linux-libre-5.10-source)) | |
602 | ||
952820c5 MW |
603 | (define-public linux-libre-headers-5.4 |
604 | (make-linux-libre-headers* linux-libre-5.4-version | |
605 | linux-libre-5.4-source)) | |
9e34a5f3 | 606 | |
1ad9c105 MW |
607 | (define-public linux-libre-headers-4.19 |
608 | (make-linux-libre-headers* linux-libre-4.19-version | |
609 | linux-libre-4.19-source)) | |
610 | ||
611 | (define-public linux-libre-headers-4.14 | |
612 | (make-linux-libre-headers* linux-libre-4.14-version | |
613 | linux-libre-4.14-source)) | |
614 | ||
615 | (define-public linux-libre-headers-4.9 | |
616 | (make-linux-libre-headers* linux-libre-4.9-version | |
617 | linux-libre-4.9-source)) | |
618 | ||
619 | (define-public linux-libre-headers-4.4 | |
620 | (make-linux-libre-headers* linux-libre-4.4-version | |
621 | linux-libre-4.4-source)) | |
622 | ||
623 | ;; The following package is used in the early bootstrap, and thus must be kept | |
624 | ;; stable and with minimal build requirements. | |
429243a4 MB |
625 | (define-public linux-libre-headers-5.4.20 |
626 | (make-linux-libre-headers "5.4.20" | |
627 | "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47")) | |
1ad9c105 | 628 | |
429243a4 | 629 | (define-public linux-libre-headers linux-libre-headers-5.4.20) |
1ad9c105 MW |
630 | |
631 | \f | |
632 | ;;; | |
633 | ;;; Kernel configurations. | |
634 | ;;; | |
3fb7b612 | 635 | |
c258807a | 636 | (define* (kernel-config arch #:key variant) |
a94546ec | 637 | "Return the absolute file name of the Linux-Libre build configuration file |
c258807a | 638 | for ARCH and optionally VARIANT, or #f if there is no such configuration." |
7994250f | 639 | (let* ((name (string-append (if variant (string-append variant "-") "") |
25847b32 | 640 | (if (string=? "i386" arch) "i686" arch) ".conf")) |
7994250f AK |
641 | (file (string-append "linux-libre/" name))) |
642 | (search-auxiliary-file file))) | |
a94546ec | 643 | |
90c18c32 | 644 | (define %default-extra-linux-options |
24446ce2 TGR |
645 | `(;; Some very mild hardening. |
646 | ("CONFIG_SECURITY_DMESG_RESTRICT" . #t) | |
18b3ba6f VC |
647 | ;; All kernels should have NAMESPACES options enabled |
648 | ("CONFIG_NAMESPACES" . #t) | |
649 | ("CONFIG_UTS_NS" . #t) | |
650 | ("CONFIG_IPC_NS" . #t) | |
651 | ("CONFIG_USER_NS" . #t) | |
652 | ("CONFIG_PID_NS" . #t) | |
653 | ("CONFIG_NET_NS" . #t) | |
450dcd1a VC |
654 | ;; Various options needed for elogind service: |
655 | ;; https://issues.guix.gnu.org/43078 | |
656 | ("CONFIG_CGROUP_FREEZER" . #t) | |
657 | ("CONFIG_BLK_CGROUP" . #t) | |
658 | ("CONFIG_CGROUP_WRITEBACK" . #t) | |
659 | ("CONFIG_CGROUP_SCHED" . #t) | |
660 | ("CONFIG_CGROUP_PIDS" . #t) | |
661 | ("CONFIG_CGROUP_FREEZER" . #t) | |
662 | ("CONFIG_CGROUP_DEVICE" . #t) | |
663 | ("CONFIG_CGROUP_CPUACCT" . #t) | |
664 | ("CONFIG_CGROUP_PERF" . #t) | |
665 | ("CONFIG_SOCK_CGROUP_DATA" . #t) | |
666 | ("CONFIG_BLK_CGROUP_IOCOST" . #t) | |
667 | ("CONFIG_CGROUP_NET_PRIO" . #t) | |
668 | ("CONFIG_CGROUP_NET_CLASSID" . #t) | |
669 | ("CONFIG_MEMCG" . #t) | |
670 | ("CONFIG_MEMCG_SWAP" . #t) | |
671 | ("CONFIG_MEMCG_KMEM" . #t) | |
672 | ("CONFIG_CPUSETS" . #t) | |
673 | ("CONFIG_PROC_PID_CPUSET" . #t) | |
82fd2eee CN |
674 | ;; Allow disk encryption by default |
675 | ("CONFIG_DM_CRYPT" . m) | |
24446ce2 | 676 | ;; Modules required for initrd: |
b9f7895d DC |
677 | ("CONFIG_NET_9P" . m) |
678 | ("CONFIG_NET_9P_VIRTIO" . m) | |
679 | ("CONFIG_VIRTIO_BLK" . m) | |
680 | ("CONFIG_VIRTIO_NET" . m) | |
681 | ("CONFIG_VIRTIO_PCI" . m) | |
682 | ("CONFIG_VIRTIO_BALLOON" . m) | |
683 | ("CONFIG_VIRTIO_MMIO" . m) | |
684 | ("CONFIG_FUSE_FS" . m) | |
685 | ("CONFIG_CIFS" . m) | |
686 | ("CONFIG_9P_FS" . m))) | |
90c18c32 | 687 | |
78410b09 JS |
688 | ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration |
689 | (define %bpf-extra-linux-options | |
690 | `(;; Needed for probes | |
691 | ("CONFIG_UPROBE_EVENTS" . #t) | |
692 | ("CONFIG_KPROBE_EVENTS" . #t) | |
693 | ;; kheaders module also helpful for tracing | |
694 | ("CONFIG_IKHEADERS" . #t) | |
695 | ("CONFIG_BPF" . #t) | |
696 | ("CONFIG_BPF_SYSCALL" . #t) | |
697 | ("CONFIG_BPF_JIT_ALWAYS_ON" . #t) | |
698 | ;; optional, for tc filters | |
699 | ("CONFIG_NET_CLS_BPF" . m) | |
700 | ;; optional, for tc actions | |
701 | ("CONFIG_NET_ACT_BPF" . m) | |
702 | ("CONFIG_BPF_JIT" . #t) | |
703 | ;; for Linux kernel versions 4.1 through 4.6 | |
704 | ;; ("CONFIG_HAVE_BPF_JIT" . y) | |
705 | ;; for Linux kernel versions 4.7 and later | |
706 | ("CONFIG_HAVE_EBPF_JIT" . #t) | |
707 | ;; optional, for kprobes | |
708 | ("CONFIG_BPF_EVENTS" . #t) | |
709 | ;; kheaders module | |
710 | ("CONFIG_IKHEADERS" . #t))) | |
711 | ||
90c18c32 DC |
712 | (define (config->string options) |
713 | (string-join (map (match-lambda | |
714 | ((option . 'm) | |
715 | (string-append option "=m")) | |
716 | ((option . #t) | |
717 | (string-append option "=y")) | |
718 | ((option . #f) | |
719 | (string-append option "=n"))) | |
720 | options) | |
721 | "\n")) | |
722 | ||
1ad9c105 MW |
723 | \f |
724 | ;;; | |
725 | ;;; Kernel package utilities. | |
726 | ;;; | |
727 | ||
728 | (define* (make-linux-libre version hash-string supported-systems | |
c258807a | 729 | #:key |
b04cba9e | 730 | (extra-version #f) |
c258807a DC |
731 | ;; A function that takes an arch and a variant. |
732 | ;; See kernel-config for an example. | |
733 | (configuration-file #f) | |
90c18c32 | 734 | (defconfig "defconfig") |
64de7d1c MW |
735 | (extra-options %default-extra-linux-options) |
736 | (patches (list %boot-logo-patch))) | |
1ad9c105 MW |
737 | (make-linux-libre* version |
738 | (origin | |
739 | (method url-fetch) | |
740 | (uri (linux-libre-urls version)) | |
741 | (sha256 (base32 hash-string)) | |
742 | (patches patches)) | |
743 | supported-systems | |
744 | #:extra-version extra-version | |
745 | #:configuration-file configuration-file | |
746 | #:defconfig defconfig | |
747 | #:extra-options extra-options)) | |
748 | ||
749 | (define* (make-linux-libre* version source supported-systems | |
750 | #:key | |
b04cba9e | 751 | (extra-version #f) |
1ad9c105 MW |
752 | ;; A function that takes an arch and a variant. |
753 | ;; See kernel-config for an example. | |
1ad9c105 MW |
754 | (configuration-file #f) |
755 | (defconfig "defconfig") | |
756 | (extra-options %default-extra-linux-options)) | |
614d1738 | 757 | (package |
a6d01325 DC |
758 | (name (if extra-version |
759 | (string-append "linux-libre-" extra-version) | |
760 | "linux-libre")) | |
c258807a | 761 | (version version) |
1ad9c105 | 762 | (source source) |
3129b9c2 | 763 | (supported-systems supported-systems) |
614d1738 | 764 | (build-system gnu-build-system) |
614d1738 DC |
765 | (native-inputs |
766 | `(("perl" ,perl) | |
767 | ("bc" ,bc) | |
768 | ("openssl" ,openssl) | |
78602fad | 769 | ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION |
81d98d7e MW |
770 | ("flex" ,flex) |
771 | ("bison" ,bison) | |
ce899af1 | 772 | |
ce899af1 MW |
773 | ;; These are needed to compile the GCC plugins. |
774 | ("gmp" ,gmp) | |
775 | ("mpfr" ,mpfr) | |
776 | ("mpc" ,mpc) | |
777 | ||
64b5e413 LC |
778 | ,@(match (and configuration-file |
779 | (configuration-file | |
780 | (system->linux-architecture | |
781 | (or (%current-target-system) (%current-system))) | |
782 | #:variant (version-major+minor version))) | |
783 | (#f ;no config for this platform | |
784 | '()) | |
785 | ((? string? config) | |
786 | `(("kconfig" ,config)))))) | |
614d1738 DC |
787 | (arguments |
788 | `(#:modules ((guix build gnu-build-system) | |
789 | (guix build utils) | |
790 | (srfi srfi-1) | |
c5ceec41 | 791 | (srfi srfi-26) |
5c79f238 | 792 | (ice-9 ftw) |
614d1738 DC |
793 | (ice-9 match)) |
794 | #:phases | |
795 | (modify-phases %standard-phases | |
c5bd8753 MW |
796 | (add-after 'unpack 'patch-/bin/pwd |
797 | (lambda _ | |
798 | (substitute* (find-files "." "^Makefile(\\.include)?$") | |
799 | (("/bin/pwd") "pwd")) | |
800 | #t)) | |
9416459b | 801 | (replace 'configure |
4b42703e | 802 | (lambda* (#:key inputs native-inputs target #:allow-other-keys) |
96e9f097 RN |
803 | ;; Avoid introducing timestamps |
804 | (setenv "KCONFIG_NOTIMESTAMP" "1") | |
805 | (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH")) | |
806 | ||
4b42703e | 807 | ;; Set ARCH and CROSS_COMPILE |
6d7ef2aa DC |
808 | (let ((arch ,(system->linux-architecture |
809 | (or (%current-target-system) | |
810 | (%current-system))))) | |
4b42703e DC |
811 | (setenv "ARCH" arch) |
812 | (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")) | |
6d7ef2aa | 813 | |
4b42703e DC |
814 | (when target |
815 | (setenv "CROSS_COMPILE" (string-append target "-")) | |
816 | (format #t "`CROSS_COMPILE' set to `~a'~%" | |
817 | (getenv "CROSS_COMPILE")))) | |
beacfcab | 818 | |
b04cba9e S |
819 | (setenv "EXTRAVERSION" ,(and extra-version |
820 | (string-append "-" extra-version))) | |
a6d01325 | 821 | |
a94546ec | 822 | (let ((build (assoc-ref %standard-phases 'build)) |
65416733 | 823 | (config (assoc-ref (or native-inputs inputs) "kconfig"))) |
1650dd8a | 824 | |
e4e9c0a0 DC |
825 | ;; Use a custom kernel configuration file or a default |
826 | ;; configuration file. | |
1650dd8a LC |
827 | (if config |
828 | (begin | |
829 | (copy-file config ".config") | |
830 | (chmod ".config" #o666)) | |
fdd400d8 | 831 | (invoke "make" ,defconfig)) |
a94546ec LC |
832 | |
833 | ;; Appending works even when the option wasn't in the | |
834 | ;; file. The last one prevails if duplicated. | |
90c18c32 DC |
835 | (let ((port (open-file ".config" "a")) |
836 | (extra-configuration ,(config->string extra-options))) | |
837 | (display extra-configuration port) | |
a94546ec LC |
838 | (close-port port)) |
839 | ||
fdd400d8 | 840 | (invoke "make" "oldconfig")))) |
614d1738 | 841 | (replace 'install |
4b42703e | 842 | (lambda* (#:key inputs native-inputs outputs #:allow-other-keys) |
beacfcab LC |
843 | (let* ((out (assoc-ref outputs "out")) |
844 | (moddir (string-append out "/lib/modules")) | |
5c79f238 | 845 | (dtbdir (string-append out "/lib/dtbs"))) |
e4e9c0a0 DC |
846 | ;; Install kernel image, kernel configuration and link map. |
847 | (for-each (lambda (file) (install-file file out)) | |
d0a39b92 | 848 | (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$")) |
e4e9c0a0 | 849 | ;; Install device tree files |
a8e3fd5f VC |
850 | (unless (null? (find-files "." "\\.dtb$")) |
851 | (mkdir-p dtbdir) | |
852 | (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir) | |
853 | "dtbs_install")) | |
e4e9c0a0 | 854 | ;; Install kernel modules |
beacfcab | 855 | (mkdir-p moddir) |
fdd400d8 | 856 | (invoke "make" |
5c79f238 DM |
857 | ;; Disable depmod because the Guix system's module directory |
858 | ;; is an union of potentially multiple packages. It is not | |
859 | ;; possible to use depmod to usefully calculate a dependency | |
860 | ;; graph while building only one of those packages. | |
861 | "DEPMOD=true" | |
fdd400d8 DM |
862 | (string-append "MODULE_DIR=" moddir) |
863 | (string-append "INSTALL_PATH=" out) | |
864 | (string-append "INSTALL_MOD_PATH=" out) | |
865 | "INSTALL_MOD_STRIP=1" | |
5c79f238 DM |
866 | "modules_install") |
867 | (let* ((versions (filter (lambda (name) | |
868 | (not (string-prefix? "." name))) | |
869 | (scandir moddir))) | |
870 | (version (match versions | |
871 | ((x) x)))) | |
872 | ;; There are symlinks to the build and source directory, | |
873 | ;; both of which will point to target /tmp/guix-build* | |
874 | ;; and thus not be useful in a profile. Delete the symlinks. | |
875 | (false-if-file-not-found | |
876 | (delete-file (string-append moddir "/" version "/build"))) | |
877 | (false-if-file-not-found | |
878 | (delete-file (string-append moddir "/" version "/source")))) | |
879 | #t)))) | |
beacfcab | 880 | #:tests? #f)) |
f8aa265e | 881 | (home-page "https://www.gnu.org/software/linux-libre/") |
f50d2669 | 882 | (synopsis "100% free redistribution of a cleaned Linux kernel") |
a22dc0c4 | 883 | (description |
79c311b8 LC |
884 | "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel. |
885 | It has been modified to remove all non-free binary blobs.") | |
f40ae739 MO |
886 | (license license:gpl2) |
887 | (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan. | |
beacfcab | 888 | |
1ad9c105 MW |
889 | \f |
890 | ;;; | |
891 | ;;; Generic kernel packages. | |
892 | ;;; | |
adbe6dea | 893 | |
a21355bd LF |
894 | (define-public linux-libre-5.12 |
895 | (make-linux-libre* linux-libre-5.12-version | |
896 | linux-libre-5.12-source | |
897 | '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux") | |
898 | #:configuration-file kernel-config)) | |
899 | ||
ed5a75c7 LF |
900 | (define-public linux-libre-version linux-libre-5.12-version) |
901 | (define-public linux-libre-pristine-source linux-libre-5.12-pristine-source) | |
902 | (define-public linux-libre-source linux-libre-5.12-source) | |
903 | (define-public linux-libre linux-libre-5.12) | |
1b5b8821 | 904 | |
66b5bc31 LF |
905 | (define-public linux-libre-5.10 |
906 | (make-linux-libre* linux-libre-5.10-version | |
907 | linux-libre-5.10-source | |
908 | '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux") | |
909 | #:configuration-file kernel-config)) | |
910 | ||
952820c5 MW |
911 | (define-public linux-libre-5.4 |
912 | (make-linux-libre* linux-libre-5.4-version | |
913 | linux-libre-5.4-source | |
b3d25e21 | 914 | '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux") |
9e34a5f3 TGR |
915 | #:configuration-file kernel-config)) |
916 | ||
ff148ea5 | 917 | (define-public linux-libre-4.19 |
1ad9c105 MW |
918 | (make-linux-libre* linux-libre-4.19-version |
919 | linux-libre-4.19-source | |
920 | '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux") | |
921 | #:configuration-file kernel-config)) | |
adbe6dea MW |
922 | |
923 | (define-public linux-libre-4.14 | |
1ad9c105 MW |
924 | (make-linux-libre* linux-libre-4.14-version |
925 | linux-libre-4.14-source | |
926 | '("x86_64-linux" "i686-linux" "armhf-linux") | |
927 | #:configuration-file kernel-config)) | |
a15cee50 | 928 | |
52d901da | 929 | (define-public linux-libre-4.9 |
1ad9c105 MW |
930 | (make-linux-libre* linux-libre-4.9-version |
931 | linux-libre-4.9-source | |
932 | '("x86_64-linux" "i686-linux") | |
933 | #:configuration-file kernel-config)) | |
52d901da | 934 | |
75b314a6 | 935 | (define-public linux-libre-4.4 |
1ad9c105 MW |
936 | (make-linux-libre* linux-libre-4.4-version |
937 | linux-libre-4.4-source | |
938 | '("x86_64-linux" "i686-linux") | |
939 | #:configuration-file kernel-config | |
940 | #:extra-options | |
941 | (append | |
942 | `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html | |
943 | ;; This option was removed upstream in version 4.7. | |
944 | ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)) | |
945 | %default-extra-linux-options))) | |
75b314a6 | 946 | |
dfcd1a87 RG |
947 | ;; Linux-Libre-LTS points to the *newest* released long-term support version of |
948 | ;; Linux-Libre. | |
29412200 RG |
949 | ;; Reference: https://jxself.org/linux-libre/ |
950 | ||
951 | (define-public linux-libre-lts-version linux-libre-5.10-version) | |
952 | (define-public linux-libre-lts-pristine-source linux-libre-5.10-pristine-source) | |
953 | (define-public linux-libre-lts-source linux-libre-5.10-source) | |
954 | (define-public linux-libre-lts linux-libre-5.10) | |
955 | ||
1ad9c105 MW |
956 | \f |
957 | ;;; | |
958 | ;;; Specialized kernel variants. | |
959 | ;;; | |
a15cee50 | 960 | |
403b3a8c | 961 | (define-public linux-libre-arm-generic |
1ad9c105 MW |
962 | (make-linux-libre* linux-libre-version |
963 | linux-libre-source | |
964 | '("armhf-linux") | |
965 | #:defconfig "multi_v7_defconfig" | |
6978df6a VC |
966 | #:extra-version "arm-generic" |
967 | #:extra-options | |
968 | (append | |
969 | `(;; needed to fix the RTC on rockchip platforms | |
970 | ("CONFIG_RTC_DRV_RK808" . #t)) | |
971 | %default-extra-linux-options))) | |
1dbb9302 | 972 | |
1eb27d5c LF |
973 | (define-public linux-libre-arm-veyron |
974 | (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic)) | |
975 | ||
ba0dc1db VC |
976 | (define-public linux-libre-arm-generic-5.10 |
977 | (make-linux-libre* linux-libre-5.10-version | |
978 | linux-libre-5.10-source | |
979 | '("armhf-linux") | |
980 | #:defconfig "multi_v7_defconfig" | |
981 | #:extra-version "arm-generic" | |
982 | #:extra-options | |
983 | (append | |
984 | `(;; needed to fix the RTC on rockchip platforms | |
985 | ("CONFIG_RTC_DRV_RK808" . #t)) | |
986 | %default-extra-linux-options))) | |
987 | ||
8a54e42b VC |
988 | (define-public linux-libre-arm-generic-5.4 |
989 | (make-linux-libre* linux-libre-5.4-version | |
990 | linux-libre-5.4-source | |
991 | '("armhf-linux") | |
992 | #:defconfig "multi_v7_defconfig" | |
993 | #:extra-version "arm-generic" | |
994 | #:extra-options | |
995 | (append | |
996 | `(;; needed to fix the RTC on rockchip platforms | |
997 | ("CONFIG_RTC_DRV_RK808" . #t)) | |
998 | %default-extra-linux-options))) | |
999 | ||
ff148ea5 | 1000 | (define-public linux-libre-arm-generic-4.19 |
1ad9c105 MW |
1001 | (make-linux-libre* linux-libre-4.19-version |
1002 | linux-libre-4.19-source | |
1003 | '("armhf-linux") | |
1004 | #:defconfig "multi_v7_defconfig" | |
1005 | #:extra-version "arm-generic")) | |
cde7c23f | 1006 | |
adbe6dea | 1007 | (define-public linux-libre-arm-generic-4.14 |
1ad9c105 MW |
1008 | (make-linux-libre* linux-libre-4.14-version |
1009 | linux-libre-4.14-source | |
1010 | '("armhf-linux") | |
1011 | #:defconfig "multi_v7_defconfig" | |
1012 | #:extra-version "arm-generic")) | |
adbe6dea | 1013 | |
f6948189 | 1014 | (define-public linux-libre-arm-omap2plus |
1ad9c105 MW |
1015 | (make-linux-libre* linux-libre-version |
1016 | linux-libre-source | |
1017 | '("armhf-linux") | |
1018 | #:defconfig "omap2plus_defconfig" | |
1019 | #:extra-version "arm-omap2plus")) | |
ff148ea5 MW |
1020 | |
1021 | (define-public linux-libre-arm-omap2plus-4.19 | |
1ad9c105 MW |
1022 | (make-linux-libre* linux-libre-4.19-version |
1023 | linux-libre-4.19-source | |
1024 | '("armhf-linux") | |
1025 | #:defconfig "omap2plus_defconfig" | |
1026 | #:extra-version "arm-omap2plus")) | |
f6948189 | 1027 | |
adbe6dea | 1028 | (define-public linux-libre-arm-omap2plus-4.14 |
1ad9c105 MW |
1029 | (make-linux-libre* linux-libre-4.14-version |
1030 | linux-libre-4.14-source | |
1031 | '("armhf-linux") | |
1032 | #:defconfig "omap2plus_defconfig" | |
1033 | #:extra-version "arm-omap2plus")) | |
adbe6dea | 1034 | |
058e96c5 VC |
1035 | (define-public linux-libre-arm64-generic |
1036 | (make-linux-libre* linux-libre-version | |
1037 | linux-libre-source | |
1038 | '("aarch64-linux") | |
ece9fba6 VC |
1039 | #:defconfig "defconfig" |
1040 | #:extra-version "arm64-generic" | |
1041 | #:extra-options | |
1042 | (append | |
1043 | `(;; needed to fix the RTC on rockchip platforms | |
1044 | ("CONFIG_RTC_DRV_RK808" . #t) | |
1045 | ;; Pinebook display, battery, charger and usb | |
1046 | ("CONFIG_DRM_ANALOGIX_ANX6345" . m) | |
1047 | ("CONFIG_CHARGER_AXP20X" . m) | |
1048 | ("CONFIG_INPUT_AXP20X_PEK" . m) | |
1049 | ("CONFIG_CHARGER_AXP20X" . m) | |
1050 | ("CONFIG_BATTERY_AXP20X" . m) | |
1051 | ("CONFIG_PINCTRL_AXP209" . m) | |
1052 | ("CONFIG_AXP20X_POWER" . m) | |
e7fbf100 VC |
1053 | ("CONFIG_AXP20X_ADC" . m) |
1054 | ;; Pinebook PRO battery and sound support | |
1055 | ("CONFIG_BATTERY_CW2015" . m) | |
1056 | ("CONFIG_CHARGER_GPIO" . m) | |
1057 | ("CONFIG_SND_SOC_ES8316" . m)) | |
ece9fba6 VC |
1058 | %default-extra-linux-options))) |
1059 | ||
1060 | (define-public linux-libre-arm64-generic-5.10 | |
1061 | (make-linux-libre* linux-libre-5.10-version | |
1062 | linux-libre-5.10-source | |
1063 | '("aarch64-linux") | |
058e96c5 | 1064 | #:defconfig "defconfig" |
6978df6a | 1065 | #:extra-version "arm64-generic" |
2d4c25f0 VC |
1066 | #:extra-options |
1067 | (append | |
1068 | `(;; needed to fix the RTC on rockchip platforms | |
4d850f7c VC |
1069 | ("CONFIG_RTC_DRV_RK808" . #t) |
1070 | ;; Pinebook display, battery, charger and usb | |
1071 | ("CONFIG_DRM_ANALOGIX_ANX6345" . m) | |
1072 | ("CONFIG_CHARGER_AXP20X" . m) | |
1073 | ("CONFIG_INPUT_AXP20X_PEK" . m) | |
1074 | ("CONFIG_CHARGER_AXP20X" . m) | |
1075 | ("CONFIG_BATTERY_AXP20X" . m) | |
1076 | ("CONFIG_PINCTRL_AXP209" . m) | |
1077 | ("CONFIG_AXP20X_POWER" . m) | |
d018a11e VC |
1078 | ("CONFIG_AXP20X_ADC" . m) |
1079 | ;; Pinebook PRO battery and sound support | |
1080 | ("CONFIG_BATTERY_CW2015" . m) | |
1081 | ("CONFIG_CHARGER_GPIO" . m) | |
1082 | ("CONFIG_SND_SOC_ES8316" . m)) | |
2d4c25f0 VC |
1083 | %default-extra-linux-options))) |
1084 | ||
611d45f6 VC |
1085 | (define-public linux-libre-arm64-generic-5.4 |
1086 | (make-linux-libre* linux-libre-5.4-version | |
1087 | linux-libre-5.4-source | |
1088 | '("aarch64-linux") | |
1089 | #:defconfig "defconfig" | |
1090 | #:extra-version "arm64-generic" | |
1091 | #:extra-options | |
1092 | (append | |
1093 | `(;; needed to fix the RTC on rockchip platforms | |
1094 | ("CONFIG_RTC_DRV_RK808" . #t)) | |
1095 | %default-extra-linux-options))) | |
1096 | ||
b3d25e21 VC |
1097 | (define-public linux-libre-riscv64-generic |
1098 | (make-linux-libre* linux-libre-version | |
1099 | linux-libre-source | |
1100 | '("riscv64-linux") | |
1101 | #:extra-version "riscv64-generic")) | |
1102 | ||
3ca1c066 EF |
1103 | (define-public linux-libre-mips64el-fuloong2e |
1104 | (make-linux-libre* linux-libre-version | |
1105 | linux-libre-source | |
1106 | '("mips64el-linux") | |
1107 | #:defconfig "fuloong2e_defconfig" | |
1108 | #:extra-version "mips64el-fuloong2e" | |
1109 | #:extra-options | |
1110 | (append | |
1111 | `(("CONFIG_OVERLAY_FS" . m)) | |
1112 | %default-extra-linux-options))) | |
1113 | ||
78410b09 JS |
1114 | (define-public linux-libre-with-bpf |
1115 | (let ((base-linux-libre | |
1116 | (make-linux-libre* | |
ed5a75c7 LF |
1117 | linux-libre-5.12-version |
1118 | linux-libre-5.12-source | |
78410b09 JS |
1119 | '("x86_64-linux" "i686-linux" "armhf-linux" |
1120 | "aarch64-linux" "riscv64-linux") | |
1121 | #:extra-version "bpf" | |
1122 | #:configuration-file kernel-config | |
1123 | #:extra-options | |
1124 | (append %bpf-extra-linux-options | |
1125 | %default-extra-linux-options)))) | |
1126 | (package | |
1127 | (inherit base-linux-libre) | |
1128 | (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre)))))) | |
1129 | ||
1130 | ||
e1f640db TGR |
1131 | \f |
1132 | ;;; | |
1133 | ;;; Linux kernel modules. | |
1134 | ;;; | |
1135 | ||
7bf28446 | 1136 | (define-public acpi-call-linux-module |
6aa8f213 TGR |
1137 | (package |
1138 | (name "acpi-call-linux-module") | |
1139 | (version "1.2.1") | |
1140 | (source | |
1141 | (origin | |
1142 | (method git-fetch) | |
1143 | (uri (git-reference | |
1144 | (url "https://github.com/nix-community/acpi_call") | |
1145 | (commit (string-append "v" version)))) | |
1146 | (file-name (git-file-name name version)) | |
1147 | (sha256 | |
1148 | (base32 "0mr4rjbv6fj4phf038addrgv32940bphghw2v9n1z4awvw7wzkbg")))) | |
1149 | (build-system linux-module-build-system) | |
1150 | (arguments | |
1151 | `(#:tests? #f ; no tests | |
1152 | #:phases | |
1153 | (modify-phases %standard-phases | |
6f78fe35 TGR |
1154 | (add-before 'install 'patch-shebangs-harder |
1155 | ;; The (only) shebangs in examples/ don't justify a reference. | |
1156 | ;; However, do substitute a more portable one than the original. | |
1157 | (lambda _ | |
1158 | (substitute* (find-files "examples" ".") | |
1159 | (("^(#! *)/[^ ]*/" _ shebang) | |
1160 | (string-append shebang "/usr/bin/env "))) | |
1161 | #t)) | |
6aa8f213 TGR |
1162 | (add-after 'install 'install-documentation |
1163 | (lambda* (#:key outputs #:allow-other-keys) | |
1164 | (let* ((out (assoc-ref outputs "out")) | |
1165 | (doc (string-append out "/share/doc/" ,name "-" ,version))) | |
1166 | (for-each (lambda (file) | |
1167 | (let ((target (string-append doc "/" file))) | |
1168 | (mkdir-p (dirname target)) | |
1169 | (copy-recursively file target))) | |
1170 | (list "README.md" "examples")) | |
1171 | #t)))))) | |
1172 | (home-page "https://github.com/teleshoes/acpi_call") | |
1173 | (synopsis "Linux kernel module to perform ACPI method calls") | |
1174 | (description | |
1175 | "This simple Linux kernel module allows calls from user space to any | |
7bf28446 TGR |
1176 | @acronym{ACPI, Advanced Configuration and Power Interface} method provided by |
1177 | your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass | |
44585a0e | 1178 | any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING}, |
7bf28446 TGR |
1179 | and @code{ACPI_BUFFER}. |
1180 | ||
1181 | It grants direct and undocumented access to your hardware that may cause damage | |
1182 | and should be used with caution, especially on untested models.") | |
6aa8f213 | 1183 | (license license:gpl3+))) ; see README.md (no licence headers) |
7bf28446 | 1184 | |
ce5af131 | 1185 | (define-public rtl8812au-aircrack-ng-linux-module |
a8bbda7f DD |
1186 | (let ((commit "059e06a51be025fde5b2bec6565540b3d9981b0b") |
1187 | (revision "4")) | |
ce5af131 TGR |
1188 | (package |
1189 | (name "rtl8812au-aircrack-ng-linux-module") | |
1190 | (version (git-version "5.6.4.2" revision commit)) | |
1191 | (source | |
1192 | (origin | |
1193 | (method git-fetch) | |
1194 | (uri (git-reference | |
b0e7b699 | 1195 | (url "https://github.com/aircrack-ng/rtl8812au") |
ce5af131 TGR |
1196 | (commit commit))) |
1197 | (file-name (git-file-name name version)) | |
1198 | (sha256 | |
a8bbda7f | 1199 | (base32 "0h6l2r3yj7j9zf11dw0zcdyn50ajnjw8yvv86dzlfj80dn75n98f")) |
ce5af131 TGR |
1200 | (modules '((guix build utils))) |
1201 | (snippet | |
1202 | '(begin | |
1203 | ;; Remove bundled tarballs, APKs, word lists, speadsheets, | |
1204 | ;; and other unnecessary unlicenced things. | |
1205 | (for-each delete-file-recursively (list "android" | |
1206 | "docs" | |
1207 | "tools")) | |
1208 | #t)))) | |
1209 | (build-system linux-module-build-system) | |
1210 | (arguments | |
de728cb8 TGR |
1211 | `(#:make-flags |
1212 | (list (string-append "KSRC=" | |
1213 | (assoc-ref %build-inputs "linux-module-builder") | |
1214 | "/lib/modules/build")) | |
1215 | #:phases | |
ce5af131 TGR |
1216 | (modify-phases %standard-phases |
1217 | (replace 'build | |
de728cb8 TGR |
1218 | (lambda* (#:key (make-flags '()) #:allow-other-keys) |
1219 | (apply invoke "make" make-flags)))) | |
ce5af131 TGR |
1220 | #:tests? #f)) ; no test suite |
1221 | (supported-systems '("x86_64-linux" "i686-linux")) | |
1222 | (home-page "https://github.com/aircrack-ng/rtl8812au") | |
1223 | (synopsis "Linux driver for Realtek USB wireless network adapters") | |
1224 | (description | |
1225 | "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless | |
1226 | network adapters, modified by the aircrack-ng project to support monitor mode | |
1227 | and frame injection. It provides a @code{88XXau} kernel module that supports | |
1228 | RTL8812AU, RTL8821AU, and RTL8814AU chips.") | |
1229 | (license license:gpl2+)))) | |
1230 | ||
f3b075a0 | 1231 | (define-public rtl8821ce-linux-module |
2df1c4f1 ZZ |
1232 | (let ((commit "897e7c4c15dd5a0a569745dc223d969a26ff5bfc") |
1233 | (revision "3")) | |
f3b075a0 MR |
1234 | (package |
1235 | (name "rtl8821ce-linux-module") | |
1236 | (version (git-version "0.0.0" revision commit)) | |
1237 | (source | |
1238 | (origin | |
1239 | (method git-fetch) | |
1240 | (uri (git-reference | |
b0e7b699 | 1241 | (url "https://github.com/tomaspinho/rtl8821ce") |
f3b075a0 MR |
1242 | (commit commit))) |
1243 | (file-name (git-file-name name version)) | |
1244 | (sha256 | |
1245 | (base32 | |
2df1c4f1 | 1246 | "0935dzz0njxh78wfd17yqah1dxn6b3kaszvzclwwrwwhwcrdp80j")))) |
f3b075a0 MR |
1247 | (build-system linux-module-build-system) |
1248 | (arguments | |
d1fe14be TGR |
1249 | `(#:make-flags |
1250 | (list "CC=gcc" | |
1251 | (string-append "KSRC=" | |
1252 | (assoc-ref %build-inputs "linux-module-builder") | |
1253 | "/lib/modules/build")) | |
1254 | #:phases | |
f3b075a0 MR |
1255 | (modify-phases %standard-phases |
1256 | (replace 'build | |
d1fe14be TGR |
1257 | (lambda* (#:key (make-flags '()) #:allow-other-keys) |
1258 | (apply invoke "make" make-flags)))) | |
1259 | #:tests? #f)) ; no test suite | |
f3b075a0 MR |
1260 | (home-page "https://github.com/tomaspinho/rtl8821ce") |
1261 | (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters") | |
1262 | (description "This is Realtek's RTL8821CE Linux driver for wireless | |
1263 | network adapters.") | |
1264 | (license license:gpl2)))) | |
1265 | ||
b40a36ba MW |
1266 | (define-public vhba-module |
1267 | (package | |
1268 | (name "vhba-module") | |
0847e479 | 1269 | (version "20200106") |
b40a36ba MW |
1270 | (source (origin |
1271 | (method url-fetch) | |
1272 | (uri (string-append | |
1273 | "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-" | |
1274 | version ".tar.bz2")) | |
1275 | (sha256 | |
1276 | (base32 | |
0847e479 | 1277 | "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr")))) |
b40a36ba MW |
1278 | (build-system linux-module-build-system) |
1279 | (arguments | |
1280 | ;; TODO: No tests? | |
1281 | `(#:tests? #f)) | |
1282 | (home-page "https://cdemu.sourceforge.io/") | |
1283 | (synopsis "Kernel module that emulates SCSI devices") | |
1284 | (description "VHBA module provides a Virtual (SCSI) HBA, which is the link | |
1285 | between the CDemu userspace daemon and linux kernel.") | |
1286 | (license license:gpl2+))) | |
1287 | ||
cc62eab1 | 1288 | (define-public bbswitch-module |
d753aee0 PN |
1289 | ;; Use "develop" branch since stable release does not build on Linux >= 5.6. |
1290 | ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205. | |
1291 | (let ((commit "ddbd243638c7bc2baecf43a78aff46cdc12e9b2e")) | |
1292 | (package | |
1293 | (name "bbswitch-module") | |
1294 | (version (git-version "0.8" "1" commit)) | |
1295 | (source (origin | |
1296 | (method git-fetch) | |
1297 | (uri (git-reference | |
1298 | (url "https://github.com/Bumblebee-Project/bbswitch") | |
1299 | (commit commit))) | |
1300 | (file-name (git-file-name name version)) | |
1301 | (sha256 | |
1302 | (base32 | |
1303 | "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb")))) | |
1304 | (build-system linux-module-build-system) | |
1305 | (arguments | |
1306 | ;; No tests. | |
1307 | `(#:tests? #f)) | |
1308 | (home-page "https://github.com/Bumblebee-Project/bbswitch") | |
1309 | (synopsis "Kernel module that disables discrete Nvidia graphics cards") | |
1310 | (description "The bbswitch module provides a way to toggle the Nvidia | |
cc62eab1 | 1311 | graphics card on Optimus laptops.") |
d753aee0 | 1312 | (license license:gpl2)))) |
cc62eab1 | 1313 | |
7eea1de7 BW |
1314 | (define-public ddcci-driver-linux |
1315 | (package | |
1316 | (name "ddcci-driver-linux") | |
1317 | (version "0.3.3") | |
1318 | (source | |
1319 | (origin | |
1320 | (method git-fetch) | |
1321 | (uri | |
1322 | (git-reference | |
1323 | (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git") | |
1324 | (commit (string-append "v" version)))) | |
1325 | (file-name (git-file-name name version)) | |
1326 | (sha256 | |
1327 | (base32 | |
1328 | "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f")))) | |
1329 | (build-system linux-module-build-system) | |
1330 | (arguments | |
1331 | `(#:tests? #f ; no tests | |
1332 | #:phases | |
1333 | (modify-phases %standard-phases | |
1334 | (replace 'build | |
1335 | (lambda args | |
1336 | (for-each | |
1337 | (lambda (module) | |
1338 | (with-directory-excursion module | |
1339 | (apply (assoc-ref %standard-phases 'build) args))) | |
1340 | '("ddcci" "ddcci-backlight")) | |
1341 | #t)) | |
1342 | (replace 'install | |
1343 | (lambda args | |
1344 | (for-each | |
1345 | (lambda (module) | |
1346 | (with-directory-excursion module | |
1347 | (apply (assoc-ref %standard-phases 'install) args))) | |
1348 | '("ddcci" "ddcci-backlight")) | |
1349 | #t))))) | |
1350 | (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux") | |
1351 | (synopsis "Pair of Linux kernel drivers for DDC/CI monitors") | |
1352 | (description "This package provides two Linux kernel drivers, ddcci and | |
1353 | ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs | |
1354 | interface. The ddcci module creates a character device for each DDC/CI | |
1355 | monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight | |
1356 | module allows the control of the backlight level or luminance property when | |
1357 | supported under @file{/sys/class/backlight/}.") | |
1358 | (license license:gpl2+))) | |
1359 | ||
1acf4c59 MS |
1360 | (define-public v4l2loopback-linux-module |
1361 | (package | |
1362 | (name "v4l2loopback-linux-module") | |
1363 | (version "0.12.5") | |
1364 | (source (origin | |
1365 | (method git-fetch) | |
1366 | (uri (git-reference | |
b0e7b699 | 1367 | (url "https://github.com/umlaeute/v4l2loopback") |
1acf4c59 MS |
1368 | (commit (string-append "v" version)))) |
1369 | (file-name (git-file-name name version)) | |
1370 | (sha256 | |
1371 | (base32 | |
1372 | "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn")))) | |
1373 | (build-system linux-module-build-system) | |
c34a7dc2 TGR |
1374 | (arguments |
1375 | `(#:tests? #f)) ; no test suite | |
1acf4c59 | 1376 | (home-page "https://github.com/umlaeute/v4l2loopback") |
ecb65812 TGR |
1377 | (synopsis "Linux kernel module to create virtual V4L2 video devices") |
1378 | (description | |
1379 | "This Linux module creates virtual video devices. @acronym{V4L2, Video | |
1380 | for Linux 2} applications will treat these as ordinary video devices but read | |
1381 | video data generated by another application, instead of a hardware device such | |
1382 | as a capture card. | |
1383 | ||
1384 | This lets you apply nifty effects to your Jitsi video, for example, but also | |
1385 | allows some more serious things like adding streaming capabilities to an | |
1386 | application by hooking GStreamer into the loopback device.") | |
1acf4c59 MS |
1387 | (license license:gpl2+))) |
1388 | ||
97121c2a | 1389 | \f |
c84d0eca LC |
1390 | ;;; |
1391 | ;;; Pluggable authentication modules (PAM). | |
1392 | ;;; | |
1393 | ||
fd76c904 LC |
1394 | (define-public linux-pam |
1395 | (package | |
1396 | (name "linux-pam") | |
a7755ba4 | 1397 | (version "1.5.1") |
fd76c904 LC |
1398 | (source |
1399 | (origin | |
eca24b2f TGR |
1400 | (method url-fetch) |
1401 | (uri (string-append | |
1402 | "https://github.com/linux-pam/linux-pam/releases/download/v" | |
1403 | version "/Linux-PAM-" version ".tar.xz")) | |
1404 | (sha256 | |
1405 | (base32 | |
a7755ba4 | 1406 | "1z4jayf69qyyxln1gl6ch4qxfd66ib1g42garnrv2d8i1drl0790")) |
eca24b2f | 1407 | (patches (search-patches "linux-pam-no-setfsuid.patch")))) |
411264c2 | 1408 | |
fd76c904 | 1409 | (build-system gnu-build-system) |
c4c4cc05 | 1410 | (native-inputs |
fd76c904 LC |
1411 | `(("flex" ,flex) |
1412 | ||
1413 | ;; TODO: optional dependencies | |
1414 | ;; ("libxcrypt" ,libxcrypt) | |
1415 | ;; ("cracklib" ,cracklib) | |
1416 | )) | |
1417 | (arguments | |
ed8111ea | 1418 | `(;; Most users, such as `shadow', expect the headers to be under |
c134056a LC |
1419 | ;; `security'. |
1420 | #:configure-flags (list (string-append "--includedir=" | |
1421 | (assoc-ref %outputs "out") | |
ed8111ea LC |
1422 | "/include/security") |
1423 | ||
1424 | ;; XXX: <rpc/rpc.h> is missing from glibc when | |
1425 | ;; cross-compiling, so we have to disable NIS | |
1426 | ;; support altogether. | |
1427 | ,@(if (%current-target-system) | |
1428 | '("--disable-nis") | |
1429 | '())) | |
c134056a LC |
1430 | |
1431 | ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d | |
1432 | ;; isn't available. | |
1433 | #:tests? #f)) | |
fd76c904 LC |
1434 | (home-page "http://www.linux-pam.org/") |
1435 | (synopsis "Pluggable authentication modules for Linux") | |
1436 | (description | |
1437 | "A *Free* project to implement OSF's RFC 86.0. | |
1438 | Pluggable authentication modules are small shared object files that can | |
1439 | be used through the PAM API to perform tasks, like authenticating a user | |
e881752c | 1440 | at login. Local and dynamic reconfiguration are its key features.") |
3ac73271 | 1441 | (license license:bsd-3))) |
686f14e8 | 1442 | |
4c93ce42 EF |
1443 | (define-public linux-pam-1.2 |
1444 | (package | |
1445 | (inherit linux-pam) | |
4c93ce42 EF |
1446 | (version "1.2.1") |
1447 | (source | |
1448 | (origin | |
1449 | (method url-fetch) | |
1450 | (uri (string-append | |
1451 | "http://www.linux-pam.org/library/" | |
1452 | "Linux-PAM-" version ".tar.bz2")) | |
1453 | (sha256 | |
1454 | (base32 | |
411264c2 RS |
1455 | "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl")) |
1456 | (patches (search-patches "linux-pam-no-setfsuid.patch")))))) | |
4c93ce42 | 1457 | |
e8f04331 EF |
1458 | (define-public python-pamela |
1459 | (package | |
1460 | (name "python-pamela") | |
1461 | (version "1.0.0") | |
1462 | (source | |
1463 | (origin | |
1464 | ;; Tests not distributed in pypi release. | |
1465 | (method git-fetch) | |
1466 | (uri (git-reference | |
8ed4c468 | 1467 | (url "https://github.com/minrk/pamela") |
e8f04331 EF |
1468 | (commit version))) |
1469 | (file-name (git-file-name name version)) | |
1470 | (sha256 | |
1471 | (base32 | |
1472 | "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr")))) | |
1473 | (build-system python-build-system) | |
1474 | (arguments | |
1475 | '(#:tests? #f ; Test suite isn't designed to be run inside a container. | |
1476 | #:phases | |
1477 | (modify-phases %standard-phases | |
1478 | (add-after 'unpack 'hardcode-pam.so | |
1479 | (lambda* (#:key inputs #:allow-other-keys) | |
1480 | (let ((pam (assoc-ref inputs "linux-pam"))) | |
1481 | (substitute* "pamela.py" | |
1482 | (("find_library\\(\"pam\")") | |
1483 | (string-append "'" pam "/lib/libpam.so'"))) | |
1484 | #t))) | |
1485 | (replace 'check | |
1486 | (lambda* (#:key tests? #:allow-other-keys) | |
1487 | (if tests? | |
1488 | (if (file-exists? "test_pamela.py") | |
1489 | (invoke "py.test" "--assert=plain" "test_pamela.py") | |
1490 | (invoke "python" "-m" "pamela" "-a" "`whoami`")) | |
1491 | #t)))))) | |
1492 | (inputs | |
1493 | `(("linux-pam" ,linux-pam))) | |
1494 | (native-inputs | |
1495 | `(("python-pytest" ,python-pytest))) | |
1496 | (home-page "https://github.com/minrk/pamela") | |
1497 | (synopsis "PAM interface using ctypes") | |
1498 | (description "This package provides a PAM interface using @code{ctypes}.") | |
1499 | (license license:expat))) | |
1500 | ||
53142109 | 1501 | |
c84d0eca LC |
1502 | ;;; |
1503 | ;;; Miscellaneous. | |
1504 | ;;; | |
1505 | ||
510a8eb1 TGR |
1506 | (define-public powerstat |
1507 | (package | |
1508 | (name "powerstat") | |
87609036 | 1509 | (version "0.02.25") |
510a8eb1 TGR |
1510 | (source |
1511 | (origin | |
1512 | (method url-fetch) | |
1513 | (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/" | |
1514 | "powerstat/powerstat-" version ".tar.gz")) | |
1515 | (sha256 | |
87609036 | 1516 | (base32 "0dmixbxm4qd08ds26i0wvxwyy8nrjzfjj2q9ylx35564g4wh58qb")))) |
510a8eb1 TGR |
1517 | (build-system gnu-build-system) |
1518 | (arguments | |
1519 | `(#:make-flags | |
1ca44ae3 MB |
1520 | (list (string-append "CC=" ,(cc-for-target)) |
1521 | (string-append "prefix=" (assoc-ref %outputs "out"))) | |
510a8eb1 TGR |
1522 | #:tests? #f ; no test suite |
1523 | #:phases | |
1524 | (modify-phases %standard-phases | |
1525 | (add-after 'unpack 'respect-$prefix | |
1526 | ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744 | |
1527 | (lambda _ | |
1528 | (substitute* "Makefile" | |
1529 | (("DIR=/usr/") "DIR=$(prefix)/")) | |
1530 | #t)) | |
1531 | (delete 'configure)))) ; no configure script | |
1532 | (home-page "https://kernel.ubuntu.com/~cking/powerstat/") | |
1533 | (synopsis "Measure system power consumption") | |
1534 | (description | |
1535 | "Powerstat measures and reports your computer's power consumption in real | |
1536 | time. On mobile PCs, it uses ACPI battery information to measure the power | |
1537 | drain of the entire system. | |
1538 | ||
1539 | Powerstat can also report @acronym{RAPL, Running Average Power Limit} power | |
1540 | domain measurements. These are available only on some hardware such as Intel | |
1541 | Sandybridge and newer, and cover only part of the machine's components such as | |
1542 | CPU, DRAM, and graphics. However, they provide accurate and immediate readings | |
1543 | and don't require a battery at all. | |
1544 | ||
1545 | The output is like @command{vmstat} but also shows power consumption statistics: | |
1546 | at the end of a run, @command{powerstat} will calculate the average, standard | |
1547 | deviation, and minimum and maximum values. It can show a nice histogram too.") | |
1548 | (license license:gpl2))) | |
1549 | ||
686f14e8 LC |
1550 | (define-public psmisc |
1551 | (package | |
1552 | (name "psmisc") | |
c96d4df9 | 1553 | (version "23.4") |
686f14e8 LC |
1554 | (source |
1555 | (origin | |
1556 | (method url-fetch) | |
03113e31 | 1557 | (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-" |
f42846b2 | 1558 | version ".tar.xz")) |
686f14e8 | 1559 | (sha256 |
c96d4df9 | 1560 | (base32 "0y8n1jd2dn4cvc5mh806d66qnq8xl0xmzczbycjwal10rvmcw33z")))) |
686f14e8 | 1561 | (build-system gnu-build-system) |
46429444 MO |
1562 | (arguments |
1563 | `(,@(if (%current-target-system) | |
1564 | '(#:configure-flags | |
1565 | (list | |
1566 | "ac_cv_func_malloc_0_nonnull=yes" | |
1567 | "ac_cv_func_realloc_0_nonnull=yes")) | |
1568 | '()))) | |
686f14e8 | 1569 | (inputs `(("ncurses" ,ncurses))) |
aa9c221f | 1570 | (home-page "https://gitlab.com/psmisc/psmisc") |
70a4fb6f | 1571 | (synopsis "Small utilities that use the proc file system") |
686f14e8 LC |
1572 | (description |
1573 | "This PSmisc package is a set of some small useful utilities that | |
8f65585b | 1574 | use the proc file system. We're not about changing the world, but |
686f14e8 | 1575 | providing the system administrator with some help in common tasks.") |
3ac73271 | 1576 | (license license:gpl2+))) |
02b80c3f NK |
1577 | |
1578 | (define-public util-linux | |
1579 | (package | |
1580 | (name "util-linux") | |
fef24361 | 1581 | (version "2.35.1") |
5a6a3ba4 LC |
1582 | (source (origin |
1583 | (method url-fetch) | |
1584 | (uri (string-append "mirror://kernel.org/linux/utils/" | |
80095bd3 TGR |
1585 | "util-linux/v" (version-major+minor version) "/" |
1586 | "util-linux-" version ".tar.xz")) | |
5a6a3ba4 LC |
1587 | (sha256 |
1588 | (base32 | |
fef24361 | 1589 | "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr")) |
ab0bdd54 | 1590 | (patches (search-patches "util-linux-tests.patch")) |
9d77da2a LC |
1591 | (modules '((guix build utils))) |
1592 | (snippet | |
0223db58 MB |
1593 | ;; We take 'nologin' from Shadow, the 'logger' program from |
1594 | ;; GNU Inetutils and 'kill' from GNU Coreutils. | |
8338c241 MW |
1595 | '(begin |
1596 | (substitute* "configure" | |
0223db58 | 1597 | (("build_nologin=yes") "build_nologin=no") |
8338c241 MW |
1598 | (("build_logger=yes") "build_logger=no") |
1599 | (("build_kill=yes") "build_kill=no")) | |
1600 | #t)))) | |
02b80c3f | 1601 | (build-system gnu-build-system) |
bb93042c MB |
1602 | (outputs '("out" ;6.4 MiB executables and documentation |
1603 | "lib" ;8.8 MiB shared libraries, headers and locales | |
1604 | "static")) ;2.9 MiB static .a libraries | |
02b80c3f | 1605 | (arguments |
29ec55ee | 1606 | `(#:configure-flags (list "--disable-use-tty-group" |
d9804e50 | 1607 | "--enable-fs-paths-default=/run/current-system/profile/sbin" |
db9107b9 EF |
1608 | ;; Don't try to chown root:root mount and umount |
1609 | "--disable-makeinstall-chown" | |
bb93042c MB |
1610 | "--localstatedir=/var" |
1611 | (string-append "--localedir=" | |
1612 | (assoc-ref %outputs "lib") | |
1613 | "/share/locale") | |
29ec55ee LC |
1614 | ;; Install completions where our |
1615 | ;; bash-completion package expects them. | |
1616 | (string-append "--with-bashcompletiondir=" | |
1617 | (assoc-ref %outputs "out") | |
1618 | "/etc/bash_completion.d")) | |
84feaca4 LC |
1619 | |
1620 | ;; FIXME: For now we cannot reliably run tests on GNU/Hurd: | |
1621 | ;; <https://bugs.gnu.org/47791>. | |
1622 | #:tests? ,(and (not (%current-target-system)) | |
1623 | (not (string-suffix? "-gnu" (%current-system)))) | |
1624 | ||
1b9cf4ad | 1625 | #:phases (modify-phases %standard-phases |
bb93042c MB |
1626 | (add-before 'configure 'patch-build-scripts |
1627 | (lambda* (#:key outputs #:allow-other-keys) | |
1628 | (substitute* "configure" | |
1629 | ;; The build system assumes that we want to install | |
1630 | ;; libraries below $exec_prefix when $libdir does not | |
1631 | ;; match any of the "usual" locations. Fix that. | |
1632 | (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir") | |
1633 | "usrlib_execdir=$libdir")) | |
1634 | #t)) | |
a4a70cc4 MB |
1635 | (add-before 'build 'set-umount-file-name |
1636 | (lambda* (#:key outputs #:allow-other-keys) | |
1637 | ;; Tell 'eject' the right file name of 'umount'. | |
1638 | (let ((out (assoc-ref outputs "out"))) | |
1639 | (substitute* "sys-utils/eject.c" | |
1640 | (("\"/bin/umount\"") | |
1641 | (string-append "\"" out "/bin/umount\""))) | |
1642 | #t))) | |
1643 | (add-before 'check 'pre-check | |
1644 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1645 | (let ((out (assoc-ref outputs "out")) | |
1646 | (net (assoc-ref inputs "net-base"))) | |
1647 | ;; Change the test to refer to the right file. | |
1648 | (substitute* "tests/ts/misc/mcookie" | |
1649 | (("/etc/services") | |
1650 | (string-append net "/etc/services"))) | |
f69a22ac MB |
1651 | |
1652 | ;; The C.UTF-8 locale does not exist in our libc. | |
1653 | (substitute* "tests/ts/column/invalid-multibyte" | |
1654 | (("C\\.UTF-8") "en_US.utf8")) | |
a4a70cc4 | 1655 | #t))) |
3e902bbb MB |
1656 | ;; TODO: Remove the conditional on the next rebuild cycle. |
1657 | ,@(if (string-prefix? "arm" (%current-system)) | |
1658 | '((add-before 'check 'disable-setarch-test | |
1659 | (lambda _ | |
1660 | ;; The setarch tests are unreliable in QEMU's | |
1661 | ;; user-mode emulation, which is our primary | |
1662 | ;; method of building ARMv7 packages. | |
1663 | ;; <https://github.com/karelzak/util-linux/issues/601> | |
1664 | (substitute* "tests/ts/misc/setarch" | |
1665 | (("ts_init_subtest.*" all) | |
1666 | (string-append | |
1667 | all "\n" | |
1668 | "ts_skip \"setarch tests are unreliable under QEMU\""))) | |
1669 | #t))) | |
1670 | '()) | |
a4a70cc4 MB |
1671 | (add-after 'install 'move-static-libraries |
1672 | (lambda* (#:key outputs #:allow-other-keys) | |
bb93042c | 1673 | (let ((lib (assoc-ref outputs "lib")) |
a4a70cc4 | 1674 | (static (assoc-ref outputs "static"))) |
bb93042c MB |
1675 | |
1676 | ;; Move static libraries to the "static" output. | |
a4a70cc4 | 1677 | (mkdir-p (string-append static "/lib")) |
bb93042c | 1678 | (with-directory-excursion lib |
a4a70cc4 MB |
1679 | (for-each (lambda (file) |
1680 | (rename-file file | |
1681 | (string-append static "/" | |
1682 | file))) | |
1683 | (find-files "lib" "\\.a$")) | |
1684 | ||
1685 | ;; Remove references to the static library from the '.la' | |
1686 | ;; files so that Libtool does the right thing when both | |
1687 | ;; the shared and static library is available. | |
1688 | (substitute* (find-files "lib" "\\.la$") | |
1689 | (("old_library=.*") "old_library=''\n"))) | |
1690 | ||
bb93042c MB |
1691 | #t))) |
1692 | (add-after 'install 'adjust-pkg-config-files | |
1693 | (lambda* (#:key outputs #:allow-other-keys) | |
1694 | (let ((lib (assoc-ref outputs "lib"))) | |
1695 | ;; Drop the unused "prefix=" and "exec_prefix=" variables from | |
1696 | ;; the pkg-config files to avoid a cyclic reference on "out". | |
1697 | (substitute* (find-files (string-append lib "/lib/pkgconfig") | |
1698 | "\\.pc$") | |
1699 | (("^(exec_)?prefix=.*") ""))) | |
1700 | #t))))) | |
f61e0e79 | 1701 | (inputs `(("zlib" ,zlib) |
ba4aca3a LC |
1702 | ("ncurses" ,ncurses) |
1703 | ||
1704 | ;; XXX: This is so that the 'pre-check' phase can find it. | |
1705 | ,@(if (%current-target-system) | |
1706 | `(("net-base" ,net-base)) | |
1707 | '()))) | |
c4c4cc05 | 1708 | (native-inputs |
9f533d60 | 1709 | `(("perl" ,perl) |
a4a70cc4 | 1710 | ("net-base" ,net-base))) ;for tests |
02b80c3f | 1711 | (home-page "https://www.kernel.org/pub/linux/utils/util-linux/") |
35ec07c7 | 1712 | (synopsis "Collection of utilities for the Linux kernel") |
437d7286 | 1713 | (description "Util-linux is a diverse collection of Linux kernel |
8f65585b | 1714 | utilities. It provides dmesg and includes tools for working with file systems, |
437d7286 | 1715 | block devices, UUIDs, TTYs, and many other tools.") |
fe8ccfcc | 1716 | |
02b80c3f | 1717 | ;; Note that util-linux doesn't use the same license for all the |
fe8ccfcc | 1718 | ;; code. GPLv2+ is the default license for a code without an |
02b80c3f | 1719 | ;; explicitly defined license. |
3ac73271 LC |
1720 | (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+ |
1721 | license:bsd-4 license:public-domain)))) | |
5d5c4278 | 1722 | |
71e0f1e9 MB |
1723 | ;; util-linux optionally supports udev, which allows lsblk to read file system |
1724 | ;; metadata without special privileges. Add it as a separate package to avoid | |
1725 | ;; a circular dependency, and to keep the size small. | |
1726 | (define-public util-linux+udev | |
1727 | (package/inherit | |
1728 | util-linux | |
60a366ec | 1729 | (name "util-linux-with-udev") |
71e0f1e9 MB |
1730 | (inputs |
1731 | `(("udev" ,eudev) | |
60a366ec | 1732 | ,@(package-inputs util-linux))))) |
71e0f1e9 | 1733 | |
3116c8b5 | 1734 | (define-public ddate |
1735 | (package | |
1736 | (name "ddate") | |
1737 | (version "0.2.2") | |
1738 | (source (origin | |
eb4cfec2 EF |
1739 | (method git-fetch) |
1740 | (uri (git-reference | |
1741 | (url "https://github.com/bo0ts/ddate") | |
1742 | (commit (string-append "v" version)))) | |
1743 | (file-name (git-file-name name version)) | |
3116c8b5 | 1744 | (sha256 |
eb4cfec2 | 1745 | (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f")))) |
3116c8b5 | 1746 | (build-system cmake-build-system) |
1747 | (arguments '(#:tests? #f)) | |
1748 | (home-page "https://github.com/bo0ts/ddate") | |
1749 | (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR") | |
1750 | (description | |
1751 | "ddate displays the Discordian date and holidays of a given date. | |
1752 | The Discordian calendar was made popular by the \"Illuminatus!\" trilogy | |
1753 | by Robert Shea and Robert Anton Wilson.") | |
1754 | (license license:public-domain))) | |
1755 | ||
96636e49 TGR |
1756 | (define-public fbset |
1757 | (package | |
1758 | (name "fbset") | |
1759 | (version "2.1") | |
1760 | (source | |
1761 | (origin | |
1762 | (method url-fetch) | |
1763 | (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-" | |
1764 | version ".tar.gz")) | |
1765 | (sha256 | |
1766 | (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0")))) | |
1767 | (build-system gnu-build-system) | |
1768 | (arguments | |
1769 | '(#:modules ((guix build gnu-build-system) | |
1770 | (guix build utils) | |
1771 | (srfi srfi-26)) | |
1772 | #:phases | |
1773 | (modify-phases %standard-phases | |
1774 | (delete 'configure) ; no configure script | |
1775 | (add-before 'install 'pre-install | |
1776 | (lambda* (#:key outputs #:allow-other-keys) | |
1777 | (let ((out (assoc-ref outputs "out"))) | |
1778 | (substitute* "Makefile" | |
1779 | (("mknod ") "true ") | |
1780 | ;; The Makefile doesn't honour PREFIX or similar. | |
1781 | (("/usr") out)) | |
1782 | (mkdir out) | |
1783 | (with-directory-excursion out | |
1784 | (for-each mkdir-p (list "sbin" | |
1785 | "man/man5" | |
1786 | "man/man8"))) | |
1787 | #t))) | |
1788 | (add-after 'install 'install-fb.modes | |
1789 | (lambda* (#:key outputs #:allow-other-keys) | |
1790 | (let* ((out (assoc-ref outputs "out")) | |
1791 | (etc (string-append out "/etc"))) | |
1792 | (for-each (cut install-file <> etc) | |
1793 | (find-files "etc" "^fb\\.modes")) | |
1794 | (symlink "fb.modes.ATI" | |
1795 | (string-append etc "/fb.modes")) | |
1796 | #t)))) | |
1797 | ;; Parallel building races to create modes.tab.c. | |
1798 | #:parallel-build? #f | |
1799 | #:tests? #f)) ; no test suite | |
1800 | (native-inputs | |
1801 | `(("bison" ,bison) | |
1802 | ("flex" ,flex))) | |
1803 | (home-page "http://users.telenet.be/geertu/Linux/fbdev/") | |
1804 | (synopsis "Show and modify Linux frame buffer settings") | |
1805 | (description | |
1806 | "The kernel Linux's @dfn{frame buffers} provide a simple interface to | |
1807 | different kinds of graphic displays. The @command{fbset} utility can query and | |
1808 | change various device settings such as depth, virtual resolution, and timing | |
1809 | parameters.") | |
1810 | (license license:gpl2))) | |
1811 | ||
e47e3eff LC |
1812 | (define-public procps |
1813 | (package | |
1814 | (name "procps") | |
89a6d2d1 | 1815 | (version "3.3.16") |
e47e3eff | 1816 | (source (origin |
0cc22848 SB |
1817 | (method url-fetch) |
1818 | (uri (string-append "mirror://sourceforge/procps-ng/Production/" | |
1819 | "procps-ng-" version ".tar.xz")) | |
1820 | (sha256 | |
1821 | (base32 | |
89a6d2d1 | 1822 | "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj")))) |
e47e3eff | 1823 | (build-system gnu-build-system) |
e47e3eff | 1824 | (arguments |
f0d5ce5a | 1825 | `(#:modules ((guix build utils) |
80393eed LC |
1826 | (guix build gnu-build-system) |
1827 | (srfi srfi-1) | |
1828 | (srfi srfi-26)) | |
f0d5ce5a MO |
1829 | ,@(if (%current-target-system) |
1830 | '(#:configure-flags | |
1831 | (list | |
1832 | "ac_cv_func_malloc_0_nonnull=yes" | |
1833 | "ac_cv_func_realloc_0_nonnull=yes")) | |
1834 | '()) | |
0cc22848 SB |
1835 | #:phases |
1836 | (modify-phases %standard-phases | |
1837 | (add-after | |
1838 | 'install 'post-install | |
1839 | ;; Remove commands and man pages redudant with | |
1840 | ;; Coreutils. | |
1841 | (lambda* (#:key outputs #:allow-other-keys) | |
1842 | (let* ((out (assoc-ref outputs "out")) | |
1843 | (dup (append-map (cut find-files out <>) | |
1844 | '("^kill" "^uptime")))) | |
1845 | (for-each delete-file dup) | |
1846 | #t)))))) | |
1847 | (inputs `(("ncurses" ,ncurses))) | |
1848 | (home-page "https://gitlab.com/procps-ng/procps/") | |
35ec07c7 | 1849 | (synopsis "Utilities that give information about processes") |
e47e3eff | 1850 | (description |
35b9e423 | 1851 | "Procps is the package that has a bunch of small useful utilities |
e47e3eff | 1852 | that give information about processes using the Linux /proc file system. |
b01d82a7 LLB |
1853 | The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx, |
1854 | slabtop, tload, top, vmstat, w, watch and sysctl.") | |
3ac73271 | 1855 | (license license:gpl2))) |
e47e3eff | 1856 | |
5d5c4278 NK |
1857 | (define-public usbutils |
1858 | (package | |
1859 | (name "usbutils") | |
6547296b | 1860 | (version "013") |
5d5c4278 NK |
1861 | (source |
1862 | (origin | |
1863 | (method url-fetch) | |
1864 | (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/" | |
1865 | "usbutils-" version ".tar.xz")) | |
1866 | (sha256 | |
6547296b | 1867 | (base32 "0f0klk6d3hmbpf6p4dcwa1qjzblmkhbxs1wsw87aidvqri7lj8wy")))) |
5d5c4278 | 1868 | (build-system gnu-build-system) |
429a38a0 | 1869 | (outputs (list "out" "python")) |
5b266358 TGR |
1870 | (arguments |
1871 | `(#:phases | |
1872 | (modify-phases %standard-phases | |
1873 | (add-before 'bootstrap 'patch-bootstrap-scripts | |
1874 | (lambda _ | |
1875 | (substitute* "usbhid-dump/bootstrap" | |
6547296b | 1876 | (("/bin/sh") (which "sh"))) |
5b266358 TGR |
1877 | |
1878 | ;; Don't let autogen.sh run configure with bogus options & CFLAGS. | |
1879 | (substitute* "autogen.sh" | |
1880 | (("^\\./configure.*") "")) | |
429a38a0 TGR |
1881 | #t)) |
1882 | (add-after 'install 'separate-python-output | |
1883 | ;; Separating one Python script shaves more than 106 MiB from :out. | |
1884 | (lambda* (#:key outputs #:allow-other-keys) | |
1885 | (let ((out (assoc-ref outputs "out")) | |
1886 | (out:python (assoc-ref outputs "python"))) | |
1887 | (for-each (lambda (file) | |
1888 | (let ((old (string-append out "/" file)) | |
1889 | (new (string-append out:python "/" file))) | |
1890 | (mkdir-p (dirname new)) | |
1891 | (rename-file old new))) | |
1892 | (list "bin/lsusb.py")) | |
1893 | #t)))))) | |
5d5c4278 | 1894 | (inputs |
a6592732 TGR |
1895 | `(("eudev" ,eudev) |
1896 | ("libusb" ,libusb) | |
1897 | ("python" ,python))) | |
c4c4cc05 | 1898 | (native-inputs |
5b266358 TGR |
1899 | `(("autoconf" ,autoconf) |
1900 | ("automake" ,automake) | |
1901 | ("libtool" ,libtool) | |
1902 | ("pkg-config" ,pkg-config))) | |
5d5c4278 NK |
1903 | (home-page "http://www.linux-usb.org/") |
1904 | (synopsis | |
1905 | "Tools for working with USB devices, such as lsusb") | |
1906 | (description | |
1907 | "Tools for working with USB devices, such as lsusb.") | |
3ac73271 | 1908 | (license license:gpl2+))) |
0750452a LC |
1909 | |
1910 | (define-public e2fsprogs | |
1911 | (package | |
1912 | (name "e2fsprogs") | |
5687fdb7 | 1913 | (version "1.45.6") |
0750452a LC |
1914 | (source (origin |
1915 | (method url-fetch) | |
7409c8d4 MW |
1916 | (uri (string-append |
1917 | "mirror://kernel.org/linux/kernel/people/tytso/" | |
5687fdb7 TGR |
1918 | "e2fsprogs/v" version "/" |
1919 | "e2fsprogs-" version ".tar.xz")) | |
0750452a LC |
1920 | (sha256 |
1921 | (base32 | |
5687fdb7 | 1922 | "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz")))) |
0750452a | 1923 | (build-system gnu-build-system) |
bb93042c | 1924 | (inputs `(("util-linux" ,util-linux "lib"))) |
f57d2639 | 1925 | (native-inputs `(("pkg-config" ,pkg-config) |
75f796bb MB |
1926 | ("texinfo" ,texinfo) ;for the libext2fs Info manual |
1927 | ||
1928 | ;; For tests. | |
1929 | ("perl" ,perl) | |
1930 | ("procps" ,procps))) | |
0750452a | 1931 | (arguments |
b047a86b | 1932 | '(;; util-linux is the preferred source for some of the libraries and |
c44ed26c | 1933 | ;; commands, so disable them (see, e.g., |
a124bbd2 | 1934 | ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.) |
b047a86b MB |
1935 | #:configure-flags (list "--disable-libblkid" |
1936 | "--disable-libuuid" "--disable-uuidd" | |
1937 | "--disable-fsck" | |
7c594a2c | 1938 | |
b047a86b MB |
1939 | ;; Use symlinks instead of hard links for |
1940 | ;; 'fsck.extN' etc. This makes the resulting nar | |
1941 | ;; smaller and is preserved across copies. | |
1942 | "--enable-symlink-install" | |
74d21291 | 1943 | |
b047a86b MB |
1944 | (string-append "LDFLAGS=-Wl,-rpath=" |
1945 | (assoc-ref %outputs "out") | |
1946 | "/lib") | |
7c594a2c | 1947 | |
b047a86b MB |
1948 | ;; Install libext2fs et al. |
1949 | "--enable-elf-shlibs") | |
ddfc2fd8 | 1950 | |
55acb372 MB |
1951 | #:phases |
1952 | (modify-phases %standard-phases | |
1953 | (add-before 'configure 'patch-shells | |
1954 | (lambda _ | |
1955 | (substitute* "configure" | |
1956 | (("/bin/sh (.*)parse-types.sh" _ dir) | |
1957 | (string-append (which "sh") " " dir | |
1958 | "parse-types.sh"))) | |
b047a86b MB |
1959 | (substitute* "MCONFIG.in" |
1960 | (("INSTALL_SYMLINK = /bin/sh") | |
1961 | "INSTALL_SYMLINK = sh")) | |
55acb372 MB |
1962 | (substitute* (find-files "." "^Makefile.in$") |
1963 | (("#!/bin/sh") | |
1964 | (string-append "#!" (which "sh")))) | |
1965 | #t)) | |
1966 | (add-after 'install 'install-libs | |
1967 | (lambda* (#:key outputs #:allow-other-keys) | |
1968 | (let* ((out (assoc-ref outputs "out")) | |
1969 | (lib (string-append out "/lib"))) | |
b132ad3a MW |
1970 | (invoke "make" "install-libs") |
1971 | ||
1972 | ;; Make the .a writable so that 'strip' works. | |
1973 | ;; Failing to do that, due to debug symbols, we | |
1974 | ;; retain a reference to the final | |
1975 | ;; linux-libre-headers, which refer to the | |
1976 | ;; bootstrap binaries. | |
1977 | (let ((archives (find-files lib "\\.a$"))) | |
1978 | (for-each (lambda (file) | |
1979 | (chmod file #o666)) | |
1980 | archives)) | |
1981 | #t)))))) | |
0750452a | 1982 | (home-page "http://e2fsprogs.sourceforge.net/") |
35ec07c7 | 1983 | (synopsis "Creating and checking ext2/ext3/ext4 file systems") |
0750452a LC |
1984 | (description |
1985 | "This package provides tools for manipulating ext2/ext3/ext4 file systems.") | |
3ac73271 LC |
1986 | (license (list license:gpl2 ;programs |
1987 | license:lgpl2.0 ;libext2fs | |
1988 | license:x11)))) ;libuuid | |
d8482ad0 | 1989 | |
e48977e7 LC |
1990 | (define e2fsprogs/static |
1991 | (static-package | |
1992 | (package (inherit e2fsprogs) | |
1993 | (arguments | |
1994 | ;; Do not build shared libraries. | |
1995 | (substitute-keyword-arguments (package-arguments e2fsprogs) | |
1996 | ((#:configure-flags _) | |
1997 | '(list "--disable-blkid")) | |
1998 | ((#:make-flags _) | |
1999 | '(list))))))) | |
2000 | ||
e102f940 LC |
2001 | (define-public e2fsck/static |
2002 | (package | |
2003 | (name "e2fsck-static") | |
0997771a | 2004 | (version (package-version e2fsprogs)) |
e102f940 LC |
2005 | (build-system trivial-build-system) |
2006 | (source #f) | |
313880c7 DC |
2007 | (inputs |
2008 | `(("e2fsprogs" ,e2fsprogs/static))) | |
e102f940 LC |
2009 | (arguments |
2010 | `(#:modules ((guix build utils)) | |
2011 | #:builder | |
2012 | (begin | |
2013 | (use-modules (guix build utils) | |
2014 | (ice-9 ftw) | |
2015 | (srfi srfi-26)) | |
2016 | ||
313880c7 DC |
2017 | (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs") |
2018 | "/sbin/e2fsck")) | |
e102f940 LC |
2019 | (bin (string-append (assoc-ref %outputs "out") "/sbin"))) |
2020 | (mkdir-p bin) | |
2021 | (with-directory-excursion bin | |
313880c7 DC |
2022 | (copy-file e2fsck "e2fsck") |
2023 | (remove-store-references "e2fsck") | |
e3cfef22 MW |
2024 | (chmod "e2fsck" #o555)) |
2025 | #t)))) | |
0997771a | 2026 | (home-page (package-home-page e2fsprogs)) |
313880c7 DC |
2027 | (synopsis "Statically-linked e2fsck command from e2fsprogs") |
2028 | (description "This package provides statically-linked e2fsck command taken | |
2029 | from the e2fsprogs package. It is meant to be used in initrds.") | |
0997771a | 2030 | (license (package-license e2fsprogs)))) |
e102f940 | 2031 | |
7c0a9104 LC |
2032 | (define-public extundelete |
2033 | (package | |
2034 | (name "extundelete") | |
2035 | (version "0.2.4") | |
76c888cb TGR |
2036 | (source |
2037 | (origin | |
2038 | (method url-fetch) | |
2039 | (uri (string-append "mirror://sourceforge/extundelete/" | |
2040 | "extundelete/" version "/extundelete-" | |
2041 | version ".tar.bz2")) | |
2042 | (sha256 | |
2043 | (base32 | |
2044 | "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1")) | |
2045 | (patches (search-patches "extundelete-e2fsprogs-1.44.patch")))) | |
7c0a9104 LC |
2046 | (build-system gnu-build-system) |
2047 | (inputs `(("e2fsprogs" ,e2fsprogs))) | |
2048 | (home-page "http://extundelete.sourceforge.net/") | |
2049 | (synopsis "Recover deleted files from ext2/3/4 partitions") | |
2050 | (description | |
2051 | "Extundelete is a set of tools that can recover deleted files from an | |
2052 | ext3 or ext4 partition.") | |
3ac73271 | 2053 | (license license:gpl2))) |
7c0a9104 | 2054 | |
1c975f60 LC |
2055 | (define-public zerofree |
2056 | (package | |
2057 | (name "zerofree") | |
5658b4ce | 2058 | (version "1.1.1") |
30ac4cc7 | 2059 | (home-page "https://frippery.org/uml/") |
1c975f60 LC |
2060 | (source (origin |
2061 | (method url-fetch) | |
2062 | (uri (string-append home-page name "-" version | |
2063 | ".tgz")) | |
2064 | (sha256 | |
2065 | (base32 | |
5658b4ce | 2066 | "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm")))) |
1c975f60 LC |
2067 | (build-system gnu-build-system) |
2068 | (arguments | |
0f08917d TGR |
2069 | '(#:phases |
2070 | (modify-phases %standard-phases | |
2071 | (delete 'configure) ; no configure script | |
2072 | (replace 'install | |
2073 | ;; The Makefile lacks an ‘install’ target. | |
2074 | (lambda* (#:key outputs #:allow-other-keys) | |
2075 | (let* ((out (assoc-ref outputs "out")) | |
2076 | (bin (string-append out "/bin"))) | |
7a068459 TGR |
2077 | (chmod "zerofree" #o555) |
2078 | (install-file "zerofree" bin) | |
0f08917d TGR |
2079 | #t)))) |
2080 | #:tests? #f)) ; no tests | |
1c975f60 LC |
2081 | (inputs `(("libext2fs" ,e2fsprogs))) |
2082 | (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems") | |
2083 | (description | |
4de4a1cf TGR |
2084 | "Zerofree finds the unallocated blocks with non-zero value content in an |
2085 | ext2, ext3, or ext4 file system and fills them with zeroes (or another value). | |
2086 | This is a simple way to make disk images more compressible. | |
2087 | Zerofree requires the file system to be unmounted or mounted read-only.") | |
3ac73271 | 2088 | (license license:gpl2))) |
1c975f60 | 2089 | |
d8482ad0 LC |
2090 | (define-public strace |
2091 | (package | |
2092 | (name "strace") | |
1bf6cdc4 | 2093 | (version "5.8") |
426284d8 | 2094 | (home-page "https://strace.io") |
d8482ad0 LC |
2095 | (source (origin |
2096 | (method url-fetch) | |
426284d8 MB |
2097 | (uri (string-append home-page "/files/" version |
2098 | "/strace-" version ".tar.xz")) | |
d8482ad0 LC |
2099 | (sha256 |
2100 | (base32 | |
1bf6cdc4 | 2101 | "1abs3svkg9985f4jrxx34sj1dcpsf95vv1a0g01c777zgygncjnz")))) |
d8482ad0 | 2102 | (build-system gnu-build-system) |
6983b8a8 MB |
2103 | (arguments |
2104 | '(#:phases | |
2105 | (modify-phases %standard-phases | |
2106 | (add-after 'unpack 'patch-/bin/sh | |
2107 | (lambda _ | |
2108 | (substitute* "strace.c" | |
2109 | (("/bin/sh") (which "sh"))) | |
53428597 TGR |
2110 | #t)) |
2111 | (add-after 'unpack 'disable-failing-tests | |
2112 | (lambda _ | |
2113 | ;; XXX These hang forever even if the test time-out is extended. | |
2114 | (substitute* "tests/Makefile.in" | |
2115 | (("^\tstrace-DD?D?\\.test \\\\.*") "")) | |
d1eb4234 | 2116 | #t))) |
1d437561 EF |
2117 | ;; Don't fail if the architecture doesn't support different personalities. |
2118 | #:configure-flags '("--enable-mpers=check") | |
72e782b2 TGR |
2119 | ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>. |
2120 | #:parallel-tests? #f)) ; undeterministic failures | |
c4c4cc05 | 2121 | (native-inputs `(("perl" ,perl))) |
d8482ad0 LC |
2122 | (synopsis "System call tracer for Linux") |
2123 | (description | |
2124 | "strace is a system call tracer, i.e. a debugging tool which prints out a | |
2125 | trace of all the system calls made by a another process/program.") | |
035f9161 | 2126 | (license license:lgpl2.1+))) |
ba04571a | 2127 | |
e1e27737 TUBK |
2128 | (define-public ltrace |
2129 | (package | |
2130 | (name "ltrace") | |
2131 | (version "0.7.3") | |
2132 | (source (origin | |
2133 | (method url-fetch) | |
2134 | (uri (string-append "http://www.ltrace.org/ltrace_" version | |
2135 | ".orig.tar.bz2")) | |
2136 | (sha256 | |
2137 | (base32 | |
2138 | "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf")))) | |
2139 | (build-system gnu-build-system) | |
20d35eac | 2140 | (inputs `(("libelf" ,elfutils))) |
e1e27737 TUBK |
2141 | (arguments |
2142 | ;; Compilation uses -Werror by default, but it fails. | |
2143 | '(#:configure-flags '("--disable-werror"))) | |
81e59e41 | 2144 | (home-page "https://www.ltrace.org/") |
e1e27737 TUBK |
2145 | (synopsis "Library call tracer for Linux") |
2146 | (description | |
2147 | "ltrace intercepts and records dynamic library calls which are called by | |
2148 | an executed process and the signals received by that process. It can also | |
2149 | intercept and print the system calls executed by the program.") | |
3ac73271 | 2150 | (license license:gpl2+))) |
e1e27737 | 2151 | |
ba04571a LC |
2152 | (define-public alsa-lib |
2153 | (package | |
2154 | (name "alsa-lib") | |
920c5822 | 2155 | (version "1.2.4") |
ba04571a LC |
2156 | (source (origin |
2157 | (method url-fetch) | |
2158 | (uri (string-append | |
2159 | "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-" | |
2160 | version ".tar.bz2")) | |
2161 | (sha256 | |
2162 | (base32 | |
920c5822 | 2163 | "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp")))) |
ba04571a | 2164 | (build-system gnu-build-system) |
ddf31e9a MB |
2165 | (arguments |
2166 | '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" | |
2167 | (assoc-ref %outputs "out") | |
2168 | "/lib")))) | |
5f3070a5 | 2169 | (home-page "https://www.alsa-project.org/") |
ba04571a LC |
2170 | (synopsis "The Advanced Linux Sound Architecture libraries") |
2171 | (description | |
2172 | "The Advanced Linux Sound Architecture (ALSA) provides audio and | |
2173 | MIDI functionality to the Linux-based operating system.") | |
3ac73271 | 2174 | (license license:lgpl2.1+))) |
10afdf50 | 2175 | |
17b293a0 LC |
2176 | (define-public alsa-utils |
2177 | (package | |
2178 | (name "alsa-utils") | |
f5138588 | 2179 | (version "1.2.4") |
17b293a0 LC |
2180 | (source (origin |
2181 | (method url-fetch) | |
992b527d EF |
2182 | (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/" |
2183 | name "-" version ".tar.bz2")) | |
17b293a0 LC |
2184 | (sha256 |
2185 | (base32 | |
f5138588 | 2186 | "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq")))) |
17b293a0 LC |
2187 | (build-system gnu-build-system) |
2188 | (arguments | |
2189 | ;; XXX: Disable man page creation until we have DocBook. | |
2190 | '(#:configure-flags (list "--disable-xmlto" | |
f2817d43 LC |
2191 | |
2192 | ;; The udev rule is responsible for restoring | |
2193 | ;; the volume. | |
17b293a0 LC |
2194 | (string-append "--with-udev-rules-dir=" |
2195 | (assoc-ref %outputs "out") | |
2196 | "/lib/udev/rules.d")) | |
49165145 EF |
2197 | #:phases |
2198 | (modify-phases %standard-phases | |
46bf8b2b MB |
2199 | (add-before 'check 'disable-broken-test |
2200 | (lambda _ | |
2201 | ;; XXX: The 1.1.8 release tarball is missing a header that's | |
2202 | ;; required for this test to work. Fixed in 1.1.9. | |
2203 | (substitute* "axfer/test/Makefile" | |
2204 | ((".*container-test.*") "")) | |
2205 | #t)) | |
49165145 EF |
2206 | (add-before |
2207 | 'install 'pre-install | |
2208 | (lambda _ | |
2209 | ;; Don't try to mkdir /var/lib/alsa. | |
2210 | (substitute* "Makefile" | |
2211 | (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*") | |
457d154f EF |
2212 | "true\n")) |
2213 | #t))))) | |
9b70f2c3 MO |
2214 | (native-inputs |
2215 | `(("gettext" ,gettext-minimal))) | |
17b293a0 LC |
2216 | (inputs |
2217 | `(("libsamplerate" ,libsamplerate) | |
2218 | ("ncurses" ,ncurses) | |
2219 | ("alsa-lib" ,alsa-lib) | |
9b70f2c3 | 2220 | ("xmlto" ,xmlto))) |
17b293a0 LC |
2221 | (home-page "http://www.alsa-project.org/") |
2222 | (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)") | |
2223 | (description | |
2224 | "The Advanced Linux Sound Architecture (ALSA) provides audio and | |
2225 | MIDI functionality to the Linux-based operating system.") | |
2226 | ||
2227 | ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are | |
2228 | ;; GPLv2-only. | |
3ac73271 | 2229 | (license license:gpl2))) |
17b293a0 | 2230 | |
7d2511bc | 2231 | (define-public alsa-plugins |
2232 | (package | |
2233 | (name "alsa-plugins") | |
c494e899 | 2234 | (version "1.2.2") |
7d2511bc | 2235 | (source (origin |
2236 | (method url-fetch) | |
2237 | (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/" | |
2238 | name "-" version ".tar.bz2")) | |
2239 | (sha256 | |
2240 | (base32 | |
c494e899 | 2241 | "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw")))) |
7d2511bc | 2242 | (build-system gnu-build-system) |
2243 | ;; TODO: Split libavcodec and speex if possible. It looks like they can not | |
2244 | ;; be split, there are references to both in files. | |
2245 | ;; TODO: Remove OSS related plugins, they add support to run native | |
2246 | ;; ALSA applications on OSS however we do not offer OSS and OSS is | |
2247 | ;; obsolete. | |
624ee211 | 2248 | (outputs '("out" "pulseaudio" "jack")) |
ed1c72c3 LF |
2249 | (native-search-paths |
2250 | (list (search-path-specification | |
2251 | (variable "ALSA_PLUGIN_DIR") | |
2252 | (files '("lib/alsa-lib")) | |
2253 | (separator #f)))) | |
7d2511bc | 2254 | (arguments |
10b96d29 | 2255 | `(#:configure-flags '(;; Do not install a "local" configuration targeted |
59e80445 | 2256 | ;; for /etc/alsa. On Guix System plugins are loaded from |
10b96d29 MB |
2257 | ;; the ALSA service, and other distributions likely |
2258 | ;; won't use these files. | |
2259 | "--with-alsalconfdir=/tmp/noop") | |
2260 | #:phases | |
7d2511bc | 2261 | (modify-phases %standard-phases |
2262 | (add-after 'install 'split | |
2263 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
2264 | ;; Distribute the binaries to the various outputs. | |
2265 | (let* ((out (assoc-ref outputs "out")) | |
624ee211 SB |
2266 | (jack (assoc-ref outputs "jack")) |
2267 | (jacklib (string-append jack "/lib/alsa-lib")) | |
7d2511bc | 2268 | (pua (assoc-ref outputs "pulseaudio")) |
10b96d29 | 2269 | (pualib (string-append pua "/lib/alsa-lib"))) |
624ee211 SB |
2270 | ;; For jack. |
2271 | (mkdir-p jacklib) | |
2272 | (for-each (lambda (file) | |
2273 | (rename-file file (string-append jacklib "/" (basename file)))) | |
2274 | (find-files out ".*jack\\.(la|so)")) | |
10b96d29 | 2275 | ;; For pulseaudio. |
7d2511bc | 2276 | (mkdir-p pualib) |
7d2511bc | 2277 | (for-each (lambda (file) |
2278 | (rename-file file (string-append pualib "/" (basename file)))) | |
2279 | (find-files out ".*pulse\\.(la|so)")) | |
7d2511bc | 2280 | #t)))))) |
2281 | (inputs | |
2282 | `(("alsa-lib" ,alsa-lib) | |
624ee211 | 2283 | ("jack" ,jack-1) |
7d2511bc | 2284 | ("speex" ,speex) ; libspeexdsp resampling plugin |
2285 | ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin | |
2286 | ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin | |
2287 | ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin | |
2288 | (native-inputs | |
2289 | `(("pkg-config" ,pkg-config))) | |
2290 | (home-page "http://www.alsa-project.org/") | |
2291 | (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)") | |
2292 | (description | |
2293 | "The Advanced Linux Sound Architecture (ALSA) provides audio and | |
2294 | MIDI functionality to the Linux-based operating system. This package enhances ALSA | |
2295 | by providing additional plugins which include: upmixing, downmixing, jackd and | |
2296 | pulseaudio support for native alsa applications, format conversion (s16 to a52), and | |
2297 | external rate conversion.") | |
2298 | (license (list license:gpl2+ | |
2299 | ;; `rate/rate_samplerate.c': LGPL v2.1 or later. | |
2300 | license:lgpl2.1+)))) | |
2301 | ||
10afdf50 LC |
2302 | (define-public iptables |
2303 | (package | |
2304 | (name "iptables") | |
ca16ca54 | 2305 | (version "1.8.7") |
0cafb90d TGR |
2306 | (source |
2307 | (origin | |
2308 | (method url-fetch) | |
2309 | (uri (list (string-append "mirror://netfilter.org/iptables/iptables-" | |
2310 | version ".tar.bz2") | |
2311 | (string-append "https://www.netfilter.org/projects/iptables/" | |
2312 | "files/iptables-" version ".tar.bz2"))) | |
2313 | (sha256 | |
ca16ca54 | 2314 | (base32 "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1")))) |
10afdf50 | 2315 | (build-system gnu-build-system) |
13223c8e LF |
2316 | (native-inputs |
2317 | `(("pkg-config" ,pkg-config) | |
2318 | ("flex" ,flex) | |
2319 | ("bison" ,bison))) | |
2320 | (inputs | |
2321 | `(("libmnl" ,libmnl) | |
2322 | ("libnftnl" ,libnftnl))) | |
50c26d9e SB |
2323 | (arguments |
2324 | '(#:tests? #f ; no test suite | |
2325 | #:configure-flags ; add $libdir to the RUNPATH of executables | |
d29f0007 | 2326 | (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")))) |
13223c8e | 2327 | (home-page "https://www.netfilter.org/projects/iptables/index.html") |
be5dc5fb | 2328 | (synopsis "Programs to configure Linux IP packet filtering rules") |
10afdf50 | 2329 | (description |
be5dc5fb TGR |
2330 | "@command{iptables} is the user-space command line program used to |
2331 | configure the Linux 2.4.x and later IPv4 packet filtering ruleset | |
2332 | (@dfn{firewall}), including @dfn{NAT} (Network Address Translation). | |
2333 | ||
2334 | This package also includes @command{ip6tables}, which is used to configure the | |
2335 | IPv6 packet filter. | |
2336 | ||
fadc5533 | 2337 | Both commands are targeted at system administrators.") |
3ac73271 | 2338 | (license license:gpl2+))) |
90a0048f | 2339 | |
c2354111 TGR |
2340 | (define-public jitterentropy-rngd |
2341 | (package | |
2342 | (name "jitterentropy-rngd") | |
2343 | (version "1.2.0") | |
2344 | (source | |
2345 | (origin | |
2346 | (method git-fetch) | |
2347 | (uri (git-reference | |
2348 | (url "https://github.com/smuellerDD/jitterentropy-rngd") | |
2349 | (commit (string-append "v" version)))) | |
2350 | (file-name (git-file-name name version)) | |
2351 | (sha256 | |
2352 | (base32 "1fb8zfwhwkl1d8n4cdn7rdv5rwd75qgc00d36pmkl7wgnj3c9xda")))) | |
2353 | (build-system gnu-build-system) | |
2354 | (arguments | |
2355 | `(#:tests? #f ; no test suite | |
2356 | #:make-flags | |
2357 | (list (string-append "CC=" ,(cc-for-target)) | |
2358 | (string-append "PREFIX=" (assoc-ref %outputs "out")) | |
2359 | "UNITDIR=$(PREFIX)/lib/systemd/system") | |
2360 | #:phases | |
2361 | (modify-phases %standard-phases | |
2362 | (delete 'configure)))) ; no ./configure script | |
2363 | (home-page "https://www.chronox.de/jent.html") | |
2364 | (synopsis "CPU jitter random number generator daemon") | |
2365 | (description | |
2366 | "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random | |
2367 | number generator} core to the kernel Linux's entropy estimator. This prevents | |
2368 | the @file{/dev/random} device from blocking and should benefit users of the | |
2369 | preferred @file{/dev/urandom} and @code{getrandom()} interfaces too. | |
2370 | ||
2371 | The CPU Jitter RNG itself is part of the kernel and claims to provide good | |
2372 | entropy by collecting and magnifying differences in CPU execution time as | |
2373 | measured by the high-resolution timer built into modern CPUs. It requires no | |
2374 | additional hardware or external entropy source. | |
2375 | ||
2376 | The random bit stream generated by @command{jitterentropy-rngd} is not processed | |
2377 | by a cryptographically secure whitening function. Nonetheless, its authors | |
2378 | believe it to be a suitable source of cryptographically secure key material or | |
2379 | other cryptographically sensitive data. | |
2380 | ||
2381 | If you agree with them, start this daemon as early as possible to provide | |
2382 | properly seeded random numbers to services like SSH or those using TLS during | |
2383 | early boot when entropy may be low, especially in virtualised environments.") | |
2384 | (license (list license:bsd-3 ; or | |
2385 | license:gpl2+)))) | |
2386 | ||
c06c7a3a VL |
2387 | (define-public lsscsi |
2388 | (package | |
2389 | (name "lsscsi") | |
1dfe984c | 2390 | (version "0.32") |
c06c7a3a VL |
2391 | (source (origin |
2392 | (method url-fetch) | |
2393 | (uri (string-append | |
2394 | "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz")) | |
2395 | (sha256 | |
2396 | (base32 | |
1dfe984c | 2397 | "0jp458m2b3wckr18qkln69i01152qlwz33zm49103lq8fgx0n6d4")))) |
c06c7a3a VL |
2398 | (build-system gnu-build-system) |
2399 | (synopsis "Lists information about SCSI or NVMe devices in Linux") | |
2400 | (home-page "http://sg.danny.cz/scsi/lsscsi.html") | |
2401 | (description | |
2402 | "@command{lsscsi} lists SCSI logical units or SCSI targets. It can | |
2403 | also list NVMe namespaces or controllers and show the relationship between a | |
2404 | device's primary node name, its SCSI generic (sg) node name and its kernel | |
2405 | name.") | |
2406 | (license license:gpl2))) | |
2407 | ||
6876a6fe SB |
2408 | (define-public ebtables |
2409 | (package | |
2410 | (name "ebtables") | |
b614a223 | 2411 | (version "2.0.11") |
6876a6fe SB |
2412 | (source (origin |
2413 | (method url-fetch) | |
2414 | (uri (string-append | |
b614a223 | 2415 | "mirror://netfilter.org/ebtables/ebtables-" |
6876a6fe SB |
2416 | version ".tar.gz")) |
2417 | (sha256 | |
2418 | (base32 | |
b614a223 | 2419 | "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp")))) |
6876a6fe | 2420 | (build-system gnu-build-system) |
6876a6fe SB |
2421 | (inputs |
2422 | `(("perl" ,perl) | |
2423 | ("iptables" ,iptables))) | |
2424 | (synopsis "Ethernet bridge frame table administration") | |
82c89ead | 2425 | (home-page "https://ebtables.netfilter.org/") |
6876a6fe SB |
2426 | (description |
2427 | "ebtables is an application program used to set up and maintain the | |
2428 | tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is | |
2429 | analogous to the iptables application, but less complicated, due to the fact | |
2430 | that the Ethernet protocol is much simpler than the IP protocol.") | |
2431 | (license license:gpl2+))) | |
2432 | ||
90a0048f LC |
2433 | (define-public iproute |
2434 | (package | |
2435 | (name "iproute2") | |
a8dde2fd | 2436 | (version "5.12.0") |
90a0048f | 2437 | (source (origin |
75cd4b05 AK |
2438 | (method url-fetch) |
2439 | (uri (string-append | |
2440 | "mirror://kernel.org/linux/utils/net/iproute2/iproute2-" | |
2441 | version ".tar.xz")) | |
2442 | (sha256 | |
2443 | (base32 | |
a8dde2fd | 2444 | "0vrjbzhwzcvaxyyhkr2ii89w2vznzwp2pfgk7w72mviniawqs9lx")))) |
90a0048f LC |
2445 | (build-system gnu-build-system) |
2446 | (arguments | |
54933202 TGR |
2447 | `( ;; There is a test suite, but it wants network namespaces and sudo. |
2448 | #:tests? #f | |
90a0048f LC |
2449 | #:make-flags (let ((out (assoc-ref %outputs "out"))) |
2450 | (list "DESTDIR=" | |
8c075150 EF |
2451 | (string-append "CC=" ,(cc-for-target)) |
2452 | "HOSTCC=gcc" | |
e777d07d LF |
2453 | (string-append "BASH_COMPDIR=" out |
2454 | "/etc/bash_completion.d") | |
90a0048f | 2455 | (string-append "LIBDIR=" out "/lib") |
61f78e72 | 2456 | (string-append "HDRDIR=" out "/include") |
90a0048f LC |
2457 | (string-append "SBINDIR=" out "/sbin") |
2458 | (string-append "CONFDIR=" out "/etc") | |
2459 | (string-append "DOCDIR=" out "/share/doc/" | |
2460 | ,name "-" ,version) | |
2461 | (string-append "MANDIR=" out "/share/man"))) | |
b53e44fb AK |
2462 | #:phases (modify-phases %standard-phases |
2463 | (add-before 'install 'pre-install | |
2464 | (lambda _ | |
2465 | ;; Don't attempt to create /var/lib/arpd. | |
2466 | (substitute* "Makefile" | |
9922278b | 2467 | (("^.*ARPDDIR.*$") "")) |
8c075150 EF |
2468 | #t)) |
2469 | (add-after 'unpack 'patch-configure | |
2470 | (lambda _ | |
2471 | (let ((target ,(%current-target-system))) | |
2472 | (substitute* "configure" | |
2473 | (("pkg-config") | |
2474 | (if target | |
2475 | (string-append target "-pkg-config") | |
2476 | "pkg-config"))) | |
2477 | #t)))))) | |
90a0048f | 2478 | (inputs |
54933202 | 2479 | `(("db4" ,bdb) |
3b636296 TGR |
2480 | ("iptables" ,iptables) |
2481 | ("libmnl" ,libmnl))) | |
c4c4cc05 | 2482 | (native-inputs |
54933202 | 2483 | `(("bison" ,bison) |
90a0048f | 2484 | ("flex" ,flex) |
54933202 TGR |
2485 | ("pkg-config" ,pkg-config))) |
2486 | ;; For tests. | |
2487 | ;; ("libmnl" ,libmnl) | |
2488 | ;; ("util-linux" ,util-linux) | |
90a0048f | 2489 | (home-page |
d7f84eab | 2490 | "https://wiki.linuxfoundation.org/networking/iproute2") |
90a0048f | 2491 | (synopsis |
9e771e3b | 2492 | "Utilities for controlling TCP/IP networking and traffic in Linux") |
90a0048f | 2493 | (description |
35a4fefc TGR |
2494 | "Iproute2 is a collection of utilities for controlling TCP/IP networking |
2495 | and traffic with the Linux kernel. The most important of these are | |
2496 | @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic | |
2497 | control. | |
90a0048f LC |
2498 | |
2499 | Most network configuration manuals still refer to ifconfig and route as the | |
2500 | primary network configuration tools, but ifconfig is known to behave | |
35a4fefc | 2501 | inadequately in modern network environments, and both should be deprecated.") |
3ac73271 | 2502 | (license license:gpl2+))) |
85e0dc6a LC |
2503 | |
2504 | (define-public net-tools | |
2505 | ;; XXX: This package is basically unmaintained, but it provides a few | |
2506 | ;; commands not yet provided by Inetutils, such as 'route', so we have to | |
2507 | ;; live with it. | |
6d31c175 LF |
2508 | (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b") |
2509 | (revision "0")) | |
2510 | (package | |
2511 | (name "net-tools") | |
2512 | (version (string-append "1.60-" revision "." (string-take commit 7))) | |
2513 | (source (origin | |
631c9f74 LF |
2514 | (method url-fetch) |
2515 | (uri (string-append "https://sourceforge.net/code-snapshots/git/" | |
2516 | "n/ne/net-tools/code.git/net-tools-code-" | |
2517 | commit ".zip")) | |
2518 | (file-name (string-append name "-" version ".zip")) | |
6d31c175 LF |
2519 | (sha256 |
2520 | (base32 | |
631c9f74 | 2521 | "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy")))) |
6d31c175 LF |
2522 | (home-page "http://net-tools.sourceforge.net/") |
2523 | (build-system gnu-build-system) | |
2524 | (arguments | |
898e8b52 | 2525 | `(#:modules ((guix build gnu-build-system) |
6d31c175 LF |
2526 | (guix build utils) |
2527 | (srfi srfi-1) | |
2528 | (srfi srfi-26)) | |
2529 | #:phases | |
2530 | (modify-phases %standard-phases | |
2531 | (replace 'configure | |
2532 | (lambda* (#:key outputs #:allow-other-keys) | |
2533 | (let ((out (assoc-ref outputs "out"))) | |
2534 | (mkdir-p (string-append out "/bin")) | |
2535 | (mkdir-p (string-append out "/sbin")) | |
2536 | ||
2537 | ;; Pretend we have everything... | |
2538 | (system "yes | make config") | |
2539 | ||
2540 | ;; ... except for the things we don't have. | |
2541 | ;; HAVE_AFDECnet requires libdnet, which we don't have. | |
2542 | ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers | |
2543 | ;; that have been removed. | |
2544 | ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should | |
2545 | ;; think about adding them later. | |
2546 | (substitute* '("config.make" "config.h") | |
2547 | (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$") | |
8ea5d868 MW |
2548 | "")) |
2549 | #t))) | |
6d31c175 LF |
2550 | (add-after 'install 'remove-redundant-commands |
2551 | (lambda* (#:key outputs #:allow-other-keys) | |
2552 | ;; Remove commands and man pages redundant with Inetutils. | |
2553 | (let* ((out (assoc-ref outputs "out")) | |
2554 | (dup (append-map (cut find-files out <>) | |
2555 | '("^hostname" | |
2556 | "^(yp|nis|dns)?domainname")))) | |
2557 | (for-each delete-file dup) | |
2558 | #t)))) | |
2559 | ;; Binaries that depend on libnet-tools.a don't declare that | |
2560 | ;; dependency, making it parallel-unsafe. | |
2561 | #:parallel-build? #f | |
2562 | ||
2563 | #:tests? #f ; no test suite | |
2564 | #:make-flags (let ((out (assoc-ref %outputs "out"))) | |
898e8b52 | 2565 | (list ,(string-append "CC=" (cc-for-target)) |
6d31c175 LF |
2566 | (string-append "BASEDIR=" out) |
2567 | (string-append "INSTALLNLSDIR=" out "/share/locale") | |
2568 | (string-append "mandir=/share/man"))))) | |
631c9f74 LF |
2569 | (native-inputs `(("gettext" ,gettext-minimal) |
2570 | ("unzip" ,unzip))) | |
3d3ca76f | 2571 | (supported-systems (delete "i586-gnu" %supported-systems)) |
6d31c175 LF |
2572 | (synopsis "Tools for controlling the network subsystem in Linux") |
2573 | (description | |
2574 | "This package includes the important tools for controlling the network | |
2575 | subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and | |
2576 | route. Additionally, this package contains utilities relating to particular | |
2577 | network hardware types (plipconfig, slattach) and advanced aspects of IP | |
2578 | configuration (iptunnel, ipmaddr).") | |
2579 | (license license:gpl2+)))) | |
2580 | ||
9e1f5a26 | 2581 | (define-public libcap-2.31 |
c762e82e LC |
2582 | (package |
2583 | (name "libcap") | |
e21b70ac | 2584 | (version "2.31") |
c762e82e LC |
2585 | (source (origin |
2586 | (method url-fetch) | |
c762e82e | 2587 | (uri (string-append |
f6c2d05c LC |
2588 | "mirror://kernel.org/linux/libs/security/linux-privs/" |
2589 | "libcap2/libcap-" version ".tar.xz")) | |
c762e82e LC |
2590 | (sha256 |
2591 | (base32 | |
e21b70ac | 2592 | "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266")))) |
c762e82e | 2593 | (build-system gnu-build-system) |
6d889daf SB |
2594 | (arguments '(#:phases |
2595 | (modify-phases %standard-phases | |
2596 | (replace 'configure | |
2597 | ;; Add $libdir to the RUNPATH of executables. | |
2598 | (lambda _ | |
2599 | (substitute* "Make.Rules" | |
2600 | (("LDFLAGS := #-g") | |
2601 | (string-append "LDFLAGS := -Wl,-rpath=" | |
d70d59d6 MW |
2602 | %output "/lib"))) |
2603 | #t))) | |
2a65cd8c | 2604 | #:test-target "test" |
c762e82e LC |
2605 | #:make-flags (list "lib=lib" |
2606 | (string-append "prefix=" | |
2607 | (assoc-ref %outputs "out")) | |
2608 | "RAISE_SETFCAP=no"))) | |
2609 | (native-inputs `(("perl" ,perl))) | |
11a5ffba | 2610 | (supported-systems (delete "i586-gnu" %supported-systems)) |
c762e82e LC |
2611 | (home-page "https://sites.google.com/site/fullycapable/") |
2612 | (synopsis "Library for working with POSIX capabilities") | |
2613 | (description | |
35b9e423 | 2614 | "Libcap2 provides a programming interface to POSIX capabilities on |
c762e82e LC |
2615 | Linux-based operating systems.") |
2616 | ||
2617 | ;; License is BSD-3 or GPLv2, at the user's choice. | |
3ac73271 | 2618 | (license license:gpl2))) |
215b6431 | 2619 | |
9e1f5a26 MB |
2620 | ;; libcap 2.31 has problems with newer kernels, so provide this newer variant. |
2621 | ;; Keep the old libcap around to avoid rebuilding 'coreutils' and 'avahi'. | |
7431553b | 2622 | ;; To be merged with libcap on the next rebuild cycle. |
9e1f5a26 | 2623 | (define-public libcap |
7431553b | 2624 | (package |
9e1f5a26 | 2625 | (inherit libcap-2.31) |
0ac61e69 | 2626 | (version "2.45") |
7431553b MB |
2627 | (source (origin |
2628 | (method url-fetch) | |
2629 | (uri (string-append | |
2630 | "mirror://kernel.org/linux/libs/security/linux-privs/" | |
2631 | "libcap2/libcap-" version ".tar.xz")) | |
2632 | (sha256 | |
2633 | (base32 | |
0ac61e69 | 2634 | "11ijmi7jik9iw6pdszc6bylhggghr8cza03bcrbhbqf0cpvkjrnn")))) |
5e5b664b MB |
2635 | (arguments |
2636 | (substitute-keyword-arguments (package-arguments libcap-2.31) | |
2637 | ((#:phases phases) | |
2638 | `(modify-phases ,phases | |
2639 | (replace 'configure | |
2640 | (lambda _ | |
2641 | ;; Add $libdir to the RUNPATH of executables. | |
2642 | (substitute* "Make.Rules" | |
2643 | (("LDFLAGS \\?= #-g") | |
2644 | (string-append "LDFLAGS ?= -Wl,-rpath=" | |
2645 | %output "/lib"))) | |
2646 | #t)))))))) | |
7431553b | 2647 | |
9e1f5a26 MB |
2648 | (define-deprecated libcap/next libcap) |
2649 | (export libcap/next) | |
2650 | ||
215b6431 LC |
2651 | (define-public bridge-utils |
2652 | (package | |
2653 | (name "bridge-utils") | |
78e624d7 | 2654 | (version "1.7") |
4863773e TGR |
2655 | (source |
2656 | (origin | |
2657 | (method url-fetch) | |
78e624d7 TGR |
2658 | (uri (string-append "mirror://kernel.org/linux/kernel/people/shemminger/" |
2659 | "bridge-utils/bridge-utils-" version ".tar.xz")) | |
4863773e | 2660 | (sha256 |
78e624d7 | 2661 | (base32 "0zlrigizac2nfwgvksm92v4wafrpgxlbci3gwimc795ib7k8g6ck")))) |
215b6431 LC |
2662 | (build-system gnu-build-system) |
2663 | ||
2664 | ;; The tarball lacks all the generated files. | |
2665 | (native-inputs `(("autoconf" ,autoconf) | |
2666 | ("automake" ,automake))) | |
2667 | (arguments | |
dc1d3cde KK |
2668 | '(#:phases |
2669 | (modify-phases %standard-phases | |
189be331 | 2670 | (add-before 'bootstrap 'patch-stuff |
dc1d3cde KK |
2671 | (lambda _ |
2672 | ;; Fix "field ‘ip6’ has incomplete type" errors. | |
2673 | (substitute* "libbridge/libbridge.h" | |
2674 | (("#include <linux/if_bridge.h>") | |
2675 | "#include <linux/in6.h>\n#include <linux/if_bridge.h>")) | |
2676 | ||
2677 | ;; Ensure that the entire build fails if one of the | |
2678 | ;; sub-Makefiles fails. | |
2679 | (substitute* "Makefile.in" | |
2680 | (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;") | |
2681 | "$(MAKE) $(MFLAGS) -C $$x || exit 1;")) | |
2682 | ||
189be331 | 2683 | #t))) |
215b6431 LC |
2684 | #:tests? #f)) ; no 'check' target |
2685 | ||
e496ee67 | 2686 | (home-page "https://wiki.linuxfoundation.org/networking/bridge") |
215b6431 LC |
2687 | (synopsis "Manipulate Ethernet bridges") |
2688 | (description | |
2689 | "Utilities for Linux's Ethernet bridging facilities. A bridge is a way | |
2690 | to connect two Ethernet segments together in a protocol independent way. | |
2691 | Packets are forwarded based on Ethernet address, rather than IP address (like | |
2692 | a router). Since forwarding is done at Layer 2, all protocols can go | |
2693 | transparently through a bridge.") | |
3ac73271 | 2694 | (license license:gpl2+))) |
3cc20675 LC |
2695 | |
2696 | (define-public libnl | |
2697 | (package | |
2698 | (name "libnl") | |
276e7739 | 2699 | (version "3.5.0") |
3cc20675 LC |
2700 | (source (origin |
2701 | (method url-fetch) | |
2702 | (uri (string-append | |
a2265ea3 MB |
2703 | "https://github.com/thom311/libnl/releases/download/" |
2704 | "libnl" (string-join (string-split version #\.) "_") | |
2705 | "/libnl-" version ".tar.gz")) | |
3cc20675 LC |
2706 | (sha256 |
2707 | (base32 | |
276e7739 | 2708 | "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m")))) |
3cc20675 | 2709 | (build-system gnu-build-system) |
d80a47f2 DL |
2710 | (native-inputs |
2711 | `(("bison" ,bison) | |
2712 | ("flex" ,flex) | |
3eb7c000 DL |
2713 | ("pkg-config" ,pkg-config) |
2714 | ("swig" ,swig) | |
d80a47f2 DL |
2715 | ("libnl3-doc" |
2716 | ,(origin | |
2717 | (method url-fetch) | |
2718 | (uri (string-append | |
2719 | "https://github.com/thom311/libnl/releases/download/libnl" | |
2720 | (string-join (string-split version #\.) "_") | |
2721 | "/libnl-doc-" version ".tar.gz")) | |
2722 | (sha256 | |
276e7739 | 2723 | (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h")))))) |
c41f8869 | 2724 | (outputs `("out" "doc")) |
d80a47f2 | 2725 | (arguments |
c41f8869 | 2726 | `(#:phases |
d80a47f2 DL |
2727 | (modify-phases %standard-phases |
2728 | (add-after 'install 'install-doc | |
c41f8869 | 2729 | (lambda* (#:key inputs native-inputs outputs #:allow-other-keys) |
d80a47f2 DL |
2730 | (let ((dest (string-append (assoc-ref outputs "doc") |
2731 | "/share/doc/libnl"))) | |
2732 | (mkdir-p dest) | |
c41f8869 MO |
2733 | (invoke "tar" "xf" (assoc-ref |
2734 | (or native-inputs inputs) | |
2735 | "libnl3-doc") | |
35faa006 | 2736 | "--strip-components=1" "-C" dest))))))) |
81e59e41 | 2737 | (home-page "https://www.infradead.org/~tgr/libnl/") |
3cc20675 LC |
2738 | (synopsis "NetLink protocol library suite") |
2739 | (description | |
2740 | "The libnl suite is a collection of libraries providing APIs to netlink | |
69b4ffcf | 2741 | protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily |
3cc20675 LC |
2742 | between the kernel and user space processes. It was designed to be a more |
2743 | flexible successor to ioctl to provide mainly networking related kernel | |
2744 | configuration and monitoring interfaces.") | |
2745 | ||
2746 | ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like | |
2747 | ;; 'nl-addr-add.c'), so the result is GPLv2-only. | |
3ac73271 | 2748 | (license license:gpl2))) |
023fef7d | 2749 | |
c41f8869 MO |
2750 | ;; libnl python extensions used to be outputs of libnl. However, as |
2751 | ;; cross-compiling python extensions is currently broken, create separate | |
2752 | ;; packages for libnl python extensions. | |
2753 | (define (libnl-python-package python) | |
2754 | (let ((name (string-append "libnl-" python))) | |
2755 | (package | |
2756 | (inherit libnl) | |
2757 | (name name) | |
2758 | (inputs `(,@(cond | |
2759 | ((string=? python "python2") | |
2760 | `(("python-2" ,python-2))) | |
2761 | ((string=? python "python3") | |
2762 | `(("python-3" ,python-3)))))) | |
2763 | (propagated-inputs `(("libnl" ,libnl))) | |
2764 | (outputs '("out")) | |
2765 | (arguments | |
2766 | `(#:modules ((guix build gnu-build-system) | |
2767 | (guix build utils) | |
2768 | (srfi srfi-1)) | |
2769 | #:phases | |
2770 | (modify-phases %standard-phases | |
2771 | (replace 'install | |
2772 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
2773 | (define (python-inst python) | |
2774 | (invoke python "setup.py" "build") | |
2775 | (invoke python "setup.py" "install" | |
2776 | (string-append "--prefix=" | |
2777 | (assoc-ref %outputs "out"))) | |
2778 | (invoke python "setup.py" "clean")) | |
2779 | (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib" | |
2780 | (assoc-ref inputs "libnl"))) | |
2781 | (with-directory-excursion "./python" (python-inst ,python)) | |
2782 | #t)))))))) | |
2783 | ||
2784 | (define-public libnl-python2 (libnl-python-package "python2")) | |
2785 | (define-public libnl-python3 (libnl-python-package "python3")) | |
2786 | ||
65cd77db MW |
2787 | (define-public iw |
2788 | (package | |
2789 | (name "iw") | |
4b0111a4 | 2790 | (version "4.14") |
65cd77db MW |
2791 | (source (origin |
2792 | (method url-fetch) | |
2793 | (uri (string-append | |
2f9e312a | 2794 | "mirror://kernel.org/software/network/iw/iw-" |
65cd77db MW |
2795 | version ".tar.xz")) |
2796 | (sha256 | |
2797 | (base32 | |
4b0111a4 | 2798 | "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph")))) |
65cd77db MW |
2799 | (build-system gnu-build-system) |
2800 | (native-inputs `(("pkg-config" ,pkg-config))) | |
2801 | (inputs `(("libnl" ,libnl))) | |
2802 | (arguments | |
88ca4029 MO |
2803 | `(#:make-flags |
2804 | (let* ((target ,(%current-target-system)) | |
88ca4029 MO |
2805 | (pkg-config (if target |
2806 | (string-append target "-pkg-config") | |
2807 | "pkg-config"))) | |
2808 | (list | |
56a9ef22 | 2809 | ,(string-append "CC=" (cc-for-target)) |
88ca4029 MO |
2810 | (string-append "PKG_CONFIG=" |
2811 | (assoc-ref %build-inputs "pkg-config") | |
2812 | "/bin/" pkg-config) | |
2813 | (string-append "PREFIX=" (assoc-ref %outputs "out")))) | |
dc1d3cde | 2814 | #:phases (modify-phases %standard-phases (delete 'configure)))) |
2f9e312a | 2815 | (home-page "https://wireless.wiki.kernel.org/") |
65cd77db MW |
2816 | (synopsis "Tool for configuring wireless devices") |
2817 | (description | |
2818 | "iw is a new nl80211 based CLI configuration utility for wireless | |
2f9e312a | 2819 | devices. It replaces @code{iwconfig}, which is deprecated.") |
3ac73271 | 2820 | (license license:isc))) |
65cd77db | 2821 | |
023fef7d LC |
2822 | (define-public powertop |
2823 | (package | |
2824 | (name "powertop") | |
763feb97 | 2825 | (version "2.14") |
023fef7d LC |
2826 | (source |
2827 | (origin | |
763feb97 TGR |
2828 | (method git-fetch) |
2829 | (uri (git-reference | |
2830 | (url "https://github.com/fenrus75/powertop") | |
2831 | (commit (string-append "v" version)))) | |
2832 | (file-name (git-file-name name version)) | |
023fef7d | 2833 | (sha256 |
763feb97 | 2834 | (base32 "1zkr2y5nb1nr22nq8a3zli87iyfasfq6489p7h1k428pv8k45w4f")))) |
023fef7d | 2835 | (build-system gnu-build-system) |
4c48bf55 | 2836 | (arguments |
763feb97 TGR |
2837 | '(#:configure-flags |
2838 | (list "LDFLAGS=-pthread") | |
2839 | #:phases | |
4c48bf55 ML |
2840 | (modify-phases %standard-phases |
2841 | ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to | |
59e80445 | 2842 | ;; allow calibrating the network interface in Guix System. |
4c48bf55 ML |
2843 | (add-after 'unpack 'patch-absolute-file-names |
2844 | (lambda* (#:key inputs #:allow-other-keys) | |
2845 | (let ((kmod (assoc-ref inputs "kmod"))) | |
2846 | (substitute* (find-files "src" "\\.cpp$") | |
2847 | ;; Give the right 'modprobe' file name so that essential | |
2848 | ;; modules such as msr.ko can be loaded. | |
2849 | (("/sbin/modprobe") (string-append kmod "/bin/modprobe")) | |
2850 | ;; These programs are only needed to calibrate, so using | |
2851 | ;; relative file names avoids adding extra inputs. When they | |
2852 | ;; are missing powertop gracefully handles it. | |
2853 | (("/usr/bin/hcitool") "hcitool") | |
2854 | (("/usr/bin/xset") "xset") | |
2855 | (("/usr/sbin/hciconfig") "hciconfig")) | |
2856 | #t)))))) | |
023fef7d | 2857 | (inputs |
4c48bf55 ML |
2858 | `(("kmod" ,kmod) |
2859 | ("libnl" ,libnl) | |
023fef7d | 2860 | ("ncurses" ,ncurses) |
4c48bf55 ML |
2861 | ("pciutils" ,pciutils) |
2862 | ("zlib" ,zlib))) | |
c4c4cc05 | 2863 | (native-inputs |
763feb97 TGR |
2864 | `(("autoconf" ,autoconf) |
2865 | ("automake" ,automake) | |
2866 | ("gettext" ,gettext-minimal) | |
2867 | ("libtool" ,libtool) | |
2868 | ("pkg-config" ,pkg-config))) | |
023fef7d LC |
2869 | (home-page "https://01.org/powertop/") |
2870 | (synopsis "Analyze power consumption on Intel-based laptops") | |
2871 | (description | |
2872 | "PowerTOP is a Linux tool to diagnose issues with power consumption and | |
2873 | power management. In addition to being a diagnostic tool, PowerTOP also has | |
2874 | an interactive mode where the user can experiment various power management | |
2875 | settings for cases where the operating system has not enabled these | |
2876 | settings.") | |
3ac73271 | 2877 | (license license:gpl2))) |
6869e5c9 LC |
2878 | |
2879 | (define-public aumix | |
2880 | (package | |
2881 | (name "aumix") | |
2882 | (version "2.9.1") | |
2883 | (source (origin | |
2884 | (method url-fetch) | |
2885 | (uri (string-append | |
2886 | "http://www.jpj.net/~trevor/aumix/releases/aumix-" | |
2887 | version ".tar.bz2")) | |
2888 | (sha256 | |
2889 | (base32 | |
2890 | "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj")))) | |
2891 | (build-system gnu-build-system) | |
2892 | (inputs `(("ncurses" ,ncurses))) | |
2893 | (home-page "http://www.jpj.net/~trevor/aumix.html") | |
2894 | (synopsis "Audio mixer for X and the console") | |
2895 | (description | |
2896 | "Aumix adjusts an audio mixer from X, the console, a terminal, | |
2897 | the command line or a script.") | |
3ac73271 | 2898 | (license license:gpl2+))) |
7c0dbe78 SHT |
2899 | |
2900 | (define-public iotop | |
2901 | (package | |
2902 | (name "iotop") | |
2903 | (version "0.6") | |
2904 | (source | |
2905 | (origin | |
2906 | (method url-fetch) | |
2907 | (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-" | |
2908 | version ".tar.gz")) | |
2909 | (sha256 (base32 | |
2910 | "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s")))) | |
2911 | (build-system python-build-system) | |
2912 | (arguments | |
d79db39d EF |
2913 | '(#:phases |
2914 | (modify-phases %standard-phases | |
2915 | (add-after 'unpack 'fix-build-with-python3 | |
2916 | (lambda _ | |
2917 | (substitute* "setup.py" | |
2918 | (("itervalues") "values")) | |
2919 | #t))) | |
35cebf01 | 2920 | ;; There are currently no checks in the package. |
7c0dbe78 | 2921 | #:tests? #f)) |
d79db39d | 2922 | (native-inputs `(("python" ,python))) |
7c0dbe78 SHT |
2923 | (home-page "http://guichaz.free.fr/iotop/") |
2924 | (synopsis | |
2925 | "Displays the IO activity of running processes") | |
2926 | (description | |
2927 | "Iotop is a Python program with a top like user interface to show the | |
2928 | processes currently causing I/O.") | |
3ac73271 | 2929 | (license license:gpl2+))) |
e30835e2 LC |
2930 | |
2931 | (define-public fuse | |
2932 | (package | |
2933 | (name "fuse") | |
e905c8d6 | 2934 | (version "2.9.9") |
e30835e2 LC |
2935 | (source (origin |
2936 | (method url-fetch) | |
0e9bc883 LF |
2937 | (uri (string-append "https://github.com/libfuse/libfuse/releases/" |
2938 | "download/fuse-" version | |
2939 | "/fuse-" version ".tar.gz")) | |
e30835e2 LC |
2940 | (sha256 |
2941 | (base32 | |
e905c8d6 | 2942 | "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh")) |
cd48a549 | 2943 | (patches (search-patches "fuse-overlapping-headers.patch")))) |
e30835e2 | 2944 | (build-system gnu-build-system) |
b148bd71 | 2945 | (inputs `(("util-linux" ,util-linux))) |
e30835e2 LC |
2946 | (arguments |
2947 | '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH=" | |
2948 | (assoc-ref %outputs "out") | |
2949 | "/sbin") | |
2950 | (string-append "INIT_D_PATH=" | |
2951 | (assoc-ref %outputs "out") | |
2952 | "/etc/init.d") | |
9a4efac9 LC |
2953 | |
2954 | ;; The rule makes /dev/fuse 666. | |
e30835e2 LC |
2955 | (string-append "UDEV_RULES_PATH=" |
2956 | (assoc-ref %outputs "out") | |
9a4efac9 | 2957 | "/lib/udev/rules.d")) |
dc1d3cde KK |
2958 | #:phases |
2959 | (modify-phases %standard-phases | |
2960 | (add-before 'build 'set-file-names | |
2961 | (lambda* (#:key inputs #:allow-other-keys) | |
2962 | ;; libfuse calls out to mount(8) and umount(8). Make sure | |
2963 | ;; it refers to the right ones. | |
2964 | (substitute* '("lib/mount_util.c" "util/mount_util.c") | |
2965 | (("/bin/(u?)mount" _ maybe-u) | |
2966 | (string-append (assoc-ref inputs "util-linux") | |
2967 | "/bin/" maybe-u "mount"))) | |
2968 | (substitute* '("util/mount.fuse.c") | |
2969 | (("/bin/sh") | |
2970 | (which "sh"))) | |
2971 | ||
2972 | ;; This hack leads libfuse to search for 'fusermount' in | |
2973 | ;; $PATH, where it may find a setuid-root binary, instead of | |
2974 | ;; trying solely $out/sbin/fusermount and failing because | |
2975 | ;; it's not setuid. | |
2976 | (substitute* "lib/Makefile" | |
2977 | (("-DFUSERMOUNT_DIR=[[:graph:]]+") | |
2978 | "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")) | |
2979 | #t))))) | |
654de94e | 2980 | (supported-systems (delete "i586-gnu" %supported-systems)) |
0e9bc883 | 2981 | (home-page "https://github.com/libfuse/libfuse") |
e30835e2 LC |
2982 | (synopsis "Support file systems implemented in user space") |
2983 | (description | |
2984 | "As a consequence of its monolithic design, file system code for Linux | |
2985 | normally goes into the kernel itself---which is not only a robustness issue, | |
2986 | but also an impediment to system extensibility. FUSE, for \"file systems in | |
2987 | user space\", is a kernel module and user-space library that tries to address | |
2988 | part of this problem by allowing users to run file system implementations as | |
2989 | user-space processes.") | |
3ac73271 LC |
2990 | (license (list license:lgpl2.1 ;library |
2991 | license:gpl2+)))) ;command-line utilities | |
220193ad LC |
2992 | |
2993 | (define-public unionfs-fuse | |
2994 | (package | |
2995 | (name "unionfs-fuse") | |
9af59b0d | 2996 | (version "2.1") |
220193ad | 2997 | (source (origin |
a428fdd4 EF |
2998 | (method git-fetch) |
2999 | (uri (git-reference | |
3000 | (url "https://github.com/rpodgorny/unionfs-fuse") | |
3001 | (commit (string-append "v" version)))) | |
3002 | (file-name (git-file-name name version)) | |
220193ad LC |
3003 | (sha256 |
3004 | (base32 | |
9af59b0d | 3005 | "0bwx70x834qgqh53vqp18bhbxbsny80hz922rbgj8k9wj7cbfilm")))) |
220193ad | 3006 | (build-system cmake-build-system) |
094f4b53 | 3007 | (native-inputs |
3ef27337 | 3008 | `(("python" ,python))) |
220193ad | 3009 | (inputs `(("fuse" ,fuse))) |
094f4b53 | 3010 | (arguments |
3ef27337 LF |
3011 | ;; The tests were never actually run ("collected 0 items"), but in recent |
3012 | ;; versions of pytest that causes an error. | |
3013 | '(#:tests? #f)) | |
2f861edf | 3014 | (home-page "https://github.com/rpodgorny/unionfs-fuse") |
220193ad LC |
3015 | (synopsis "User-space union file system") |
3016 | (description | |
3017 | "UnionFS-FUSE is a flexible union file system implementation in user | |
3018 | space, using the FUSE library. Mounting a union file system allows you to | |
3019 | \"aggregate\" the contents of several directories into a single mount point. | |
3020 | UnionFS-FUSE additionally supports copy-on-write.") | |
3ac73271 | 3021 | (license license:bsd-3))) |
ed748588 | 3022 | |
0b7a0c20 LC |
3023 | (define fuse-static |
3024 | (package (inherit fuse) | |
3025 | (name "fuse-static") | |
3026 | (source (origin (inherit (package-source fuse)) | |
3027 | (modules '((guix build utils))) | |
3028 | (snippet | |
6cbee49d MW |
3029 | '(begin |
3030 | ;; Normally libfuse invokes mount(8) so that /etc/mtab is | |
3031 | ;; updated. Change calls to 'mtab_needs_update' to 0 so | |
3032 | ;; that it doesn't do that, allowing us to remove the | |
3033 | ;; dependency on util-linux (something that is useful in | |
3034 | ;; initrds.) | |
3035 | (substitute* '("lib/mount_util.c" | |
3036 | "util/mount_util.c") | |
3037 | (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") | |
3038 | "0") | |
3039 | (("/bin/") | |
3040 | "")) | |
3041 | #t)))))) | |
0b7a0c20 | 3042 | |
ed748588 LC |
3043 | (define-public unionfs-fuse/static |
3044 | (package (inherit unionfs-fuse) | |
3045 | (synopsis "User-space union file system (statically linked)") | |
3046 | (name (string-append (package-name unionfs-fuse) "-static")) | |
3047 | (source (origin (inherit (package-source unionfs-fuse)) | |
3048 | (modules '((guix build utils))) | |
3049 | (snippet | |
6cbee49d MW |
3050 | '(begin |
3051 | ;; Add -ldl to the libraries, because libfuse.a needs that. | |
3052 | (substitute* "src/CMakeLists.txt" | |
3053 | (("target_link_libraries(.*)\\)" _ libs) | |
3054 | (string-append "target_link_libraries" | |
3055 | libs " dl)"))) | |
3056 | #t)))) | |
ed748588 LC |
3057 | (arguments |
3058 | '(#:tests? #f | |
1456cff1 | 3059 | #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static") |
dc1d3cde KK |
3060 | #:phases |
3061 | (modify-phases %standard-phases | |
3062 | (add-after 'install 'post-install | |
3063 | (lambda* (#:key outputs #:allow-other-keys) | |
3064 | (let* ((out (assoc-ref outputs "out")) | |
3065 | (exe (string-append out "/bin/unionfs"))) | |
3066 | ;; By default, 'unionfs' keeps references to | |
3067 | ;; $glibc/share/locale and similar stuff. Remove them. | |
3068 | (remove-store-references exe) | |
3069 | ||
3070 | ;; 'unionfsctl' has references to glibc as well. Since | |
3071 | ;; we don't need it, remove it. | |
3072 | (delete-file (string-append out "/bin/unionfsctl")) | |
3073 | #t)))))) | |
0b7a0c20 | 3074 | (inputs `(("fuse" ,fuse-static))))) |
67b66003 | 3075 | |
357b9f9d | 3076 | (define-public sshfs |
db288efa | 3077 | (package |
357b9f9d | 3078 | (name "sshfs") |
20f8d1dd | 3079 | (version "2.10") |
db288efa LC |
3080 | (source (origin |
3081 | (method url-fetch) | |
b58c1b2d | 3082 | (uri (string-append "https://github.com/libfuse/sshfs/releases/" |
f5c6edd6 TGR |
3083 | "download/sshfs-" version "/sshfs-" version |
3084 | ".tar.gz")) | |
db288efa LC |
3085 | (sha256 |
3086 | (base32 | |
20f8d1dd | 3087 | "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h")))) |
db288efa LC |
3088 | (build-system gnu-build-system) |
3089 | (inputs | |
3090 | `(("fuse" ,fuse) | |
3091 | ("glib" ,glib))) | |
3092 | (native-inputs | |
3093 | `(("pkg-config" ,pkg-config))) | |
f5c6edd6 | 3094 | (home-page "https://github.com/libfuse/sshfs") |
db288efa LC |
3095 | (synopsis "Mount remote file systems over SSH") |
3096 | (description | |
3097 | "This is a file system client based on the SSH File Transfer Protocol. | |
3098 | Since most SSH servers already support this protocol it is very easy to set | |
3099 | up: on the server side there's nothing to do; on the client side mounting the | |
3100 | file system is as easy as logging into the server with an SSH client.") | |
3ac73271 | 3101 | (license license:gpl2+))) |
db288efa | 3102 | |
357b9f9d | 3103 | (define-public sshfs-fuse |
3104 | (package (inherit sshfs) | |
3105 | (name "sshfs-fuse") | |
3106 | (properties `((superseded . ,sshfs))))) | |
3107 | ||
1eacffb9 RH |
3108 | (define-public archivemount |
3109 | (package | |
3110 | (name "archivemount") | |
32d72c4a | 3111 | (version "0.9.1") |
1eacffb9 RH |
3112 | (source |
3113 | (origin | |
3114 | (method url-fetch) | |
c6d8817e | 3115 | (uri (string-append "https://www.cybernoia.de/software/archivemount/" |
1eacffb9 RH |
3116 | "archivemount-" version ".tar.gz")) |
3117 | (sha256 | |
32d72c4a | 3118 | (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5")))) |
1eacffb9 | 3119 | (build-system gnu-build-system) |
c695fb76 TGR |
3120 | (inputs `(("fuse" ,fuse) |
3121 | ("libarchive" ,libarchive))) | |
3122 | (native-inputs `(("pkg-config" ,pkg-config))) | |
c6d8817e | 3123 | (home-page "https://www.cybernoia.de/software/archivemount.html") |
1eacffb9 RH |
3124 | (synopsis "Tool for mounting archive files with FUSE") |
3125 | (description "archivemount is a FUSE-based file system for Unix variants, | |
3126 | including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a | |
3127 | mount point where it can be read from or written to as with any other file | |
3128 | system. This makes accessing the contents of the archive, which may be | |
3129 | compressed, transparent to other programs, without decompressing them.") | |
3130 | (license license:lgpl2.0+))) | |
3131 | ||
67b66003 LC |
3132 | (define-public numactl |
3133 | (package | |
3134 | (name "numactl") | |
24b3666e | 3135 | (version "2.0.14") |
67b66003 LC |
3136 | (source (origin |
3137 | (method url-fetch) | |
3138 | (uri (string-append | |
0b4f8767 | 3139 | "https://github.com/numactl/numactl/releases/download/v" |
1ec29dff | 3140 | version "/numactl-" version ".tar.gz")) |
67b66003 LC |
3141 | (sha256 |
3142 | (base32 | |
24b3666e | 3143 | "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2")))) |
67b66003 LC |
3144 | (build-system gnu-build-system) |
3145 | (arguments | |
e35dff97 | 3146 | '(;; There's a 'test' target, but it requires NUMA support in the kernel |
67b66003 LC |
3147 | ;; to run, which we can't assume to have. |
3148 | #:tests? #f)) | |
b0015064 | 3149 | |
35dfcdd7 AE |
3150 | ;; NUMA is apparently not supported on armhf, see |
3151 | ;; http://www.spinics.net/lists/linux-numa/msg01157.html | |
3152 | (supported-systems (delete "armhf-linux" %supported-systems)) | |
0b4f8767 | 3153 | (home-page "https://github.com/numactl/numactl") |
67b66003 LC |
3154 | (synopsis "Tools for non-uniform memory access (NUMA) machines") |
3155 | (description | |
3156 | "NUMA stands for Non-Uniform Memory Access, in other words a system whose | |
79d5ac59 TGR |
3157 | memory is not all in one place. The @command{numactl} program allows you to |
3158 | run your application program on specific CPUs and memory nodes. It does this | |
3159 | by supplying a NUMA memory policy to the operating system before running your | |
67b66003 LC |
3160 | program. |
3161 | ||
79d5ac59 TGR |
3162 | The package contains other commands, such as @command{numastat}, |
3163 | @command{memhog}, and @command{numademo} which provides a quick overview of | |
3164 | NUMA performance on your system.") | |
3ac73271 LC |
3165 | (license (list license:gpl2 ;programs |
3166 | license:lgpl2.1)))) ;library | |
b10e9ff6 | 3167 | |
103b7e79 | 3168 | (define-public kbd-neo |
3169 | (package | |
3170 | (name "kbd-neo") | |
3171 | (version "2486") | |
3172 | (source | |
3173 | (origin | |
3174 | (method url-fetch) | |
3175 | (uri (string-append "https://svn.neo-layout.org/!svn/bc/" | |
3176 | version "/linux/console/neo.map")) | |
3177 | (file-name (string-append name "-" version ".map")) | |
3178 | (sha256 | |
3179 | (base32 | |
3180 | "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g")))) | |
3181 | (build-system trivial-build-system) | |
3182 | (arguments | |
3183 | `(#:modules ((guix build utils)) | |
3184 | #:builder (begin | |
3185 | (use-modules (guix build utils)) | |
3186 | (let ((out (string-append %output "/share/keymaps")) | |
3187 | (source (assoc-ref %build-inputs "source"))) | |
3188 | (mkdir-p out) | |
3189 | (copy-file source (string-append out "/neo.map")) | |
3190 | #t)))) | |
3191 | (home-page "https://neo-layout.org") | |
3192 | (synopsis "Neo2 console layout") | |
3193 | (description | |
3194 | "Kbd-neo provides the Neo2 keyboard layout for use with | |
3195 | @command{loadkeys(1)} from @code{kbd(4)}.") | |
3196 | ;; The file is located in an svn directory, the entire content of | |
3197 | ;; the directory is licensed as GPL3. | |
3198 | (license license:gpl3+))) | |
3199 | ||
b10e9ff6 LC |
3200 | (define-public kbd |
3201 | (package | |
3202 | (name "kbd") | |
6f20fa3b | 3203 | (version "2.4.0") |
b10e9ff6 LC |
3204 | (source (origin |
3205 | (method url-fetch) | |
3206 | (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-" | |
710b4928 | 3207 | version ".tar.xz")) |
b10e9ff6 LC |
3208 | (sha256 |
3209 | (base32 | |
6f20fa3b | 3210 | "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m")) |
c8f60748 LC |
3211 | (modules '((guix build utils))) |
3212 | (snippet | |
f2cdcafb | 3213 | '(begin |
f2cdcafb LC |
3214 | (substitute* '("src/unicode_start" "src/unicode_stop") |
3215 | ;; Assume the Coreutils are in $PATH. | |
3216 | (("/usr/bin/tty") | |
6f20fa3b | 3217 | "tty")))))) |
b10e9ff6 LC |
3218 | (build-system gnu-build-system) |
3219 | (arguments | |
5953d2b7 AK |
3220 | '(#:phases |
3221 | (modify-phases %standard-phases | |
3222 | (add-before 'build 'pre-build | |
3223 | (lambda* (#:key inputs #:allow-other-keys) | |
6f20fa3b MB |
3224 | (let ((bzip2 (assoc-ref inputs "bzip2")) |
3225 | (gzip (assoc-ref inputs "gzip")) | |
3226 | (xz (assoc-ref inputs "xz")) | |
3227 | (zstd (assoc-ref inputs "zstd"))) | |
3228 | (substitute* "src/libkbdfile/kbdfile.c" | |
3229 | (("bzip2") (string-append bzip2 "/bin/bzip2")) | |
3230 | (("gzip") (string-append gzip "/bin/gzip")) | |
3231 | (("xz -d") (string-append xz "/bin/xz -d")) | |
3232 | (("zstd") (string-append zstd "/bin/zstd")))))) | |
5953d2b7 AK |
3233 | (add-after 'install 'post-install |
3234 | (lambda* (#:key outputs #:allow-other-keys) | |
3235 | ;; Make sure these programs find their comrades. | |
3236 | (let* ((out (assoc-ref outputs "out")) | |
3237 | (bin (string-append out "/bin"))) | |
3238 | (for-each (lambda (prog) | |
3239 | (wrap-program (string-append bin "/" prog) | |
3240 | `("PATH" ":" prefix (,bin)))) | |
6f20fa3b MB |
3241 | '("unicode_start" "unicode_stop")))))))) |
3242 | (native-inputs | |
3243 | `(("autoconf" ,autoconf) | |
3244 | ("pkg-config" ,pkg-config))) | |
3245 | (inputs | |
3246 | `(("bzip2" ,bzip2) | |
3247 | ("gzip" ,gzip) | |
3248 | ("pam" ,linux-pam) | |
3249 | ("xz" ,xz) | |
3250 | ("zstd" ,zstd))) | |
fd7000fe | 3251 | (native-search-paths |
3252 | (list (search-path-specification | |
3253 | (variable "LOADKEYS_KEYMAP_PATH") | |
674d4e13 TGR |
3254 | ;; Append ‘/**’ to recursively search all directories. One can then |
3255 | ;; run (for example) ‘loadkeys en-latin9’ instead of having to find | |
3256 | ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard. | |
3257 | (files (list "share/keymaps/**"))))) | |
0ed81d04 | 3258 | (home-page "http://kbd-project.org/") |
b10e9ff6 LC |
3259 | (synopsis "Linux keyboard utilities and keyboard maps") |
3260 | (description | |
3261 | "This package contains keytable files and keyboard utilities compatible | |
3262 | for systems using the Linux kernel. This includes commands such as | |
36a4366d | 3263 | @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.") |
3ac73271 | 3264 | (license license:gpl2+))) |
de0b620e | 3265 | |
48e595b7 LC |
3266 | (define-public loadkeys-static |
3267 | (package | |
3268 | (inherit kbd) | |
3269 | (name "loadkeys-static") | |
3270 | (arguments | |
3271 | (substitute-keyword-arguments (package-arguments kbd) | |
3272 | ((#:configure-flags flags ''()) | |
3273 | `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls" | |
3274 | "--disable-vlock" ;so we don't need libpam | |
3275 | "--disable-libkeymap") | |
3276 | ,flags)) | |
3277 | ((#:make-flags flags ''()) | |
6f20fa3b | 3278 | `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags)) |
48e595b7 LC |
3279 | ((#:phases phases '%standard-phases) |
3280 | `(modify-phases ,phases | |
3281 | (replace 'install | |
3282 | (lambda* (#:key outputs #:allow-other-keys) | |
3283 | (let ((out (assoc-ref outputs "out"))) | |
3284 | ;; The binary keeps references to gzip, among other things, | |
3285 | ;; which we don't need in the initrd, so strip references. | |
3286 | (remove-store-references "src/loadkeys") | |
3287 | ||
3288 | (install-file "src/loadkeys" | |
6f20fa3b | 3289 | (string-append out "/bin"))))) |
48e595b7 LC |
3290 | (delete 'post-install))) |
3291 | ((#:strip-flags _ '()) | |
3292 | ''("--strip-all")) | |
3293 | ((#:allowed-references _ '()) | |
3294 | '()))) | |
3295 | ||
3296 | (synopsis "Statically-linked @command{loadkeys} program") | |
3297 | ||
3298 | ;; This package is meant to be used internally in the initrd so don't | |
3299 | ;; expose it. | |
3300 | (properties '((hidden? . #t))))) | |
3301 | ||
de0b620e LC |
3302 | (define-public inotify-tools |
3303 | (package | |
3304 | (name "inotify-tools") | |
7290477c | 3305 | (version "3.20.11.0") |
de0b620e | 3306 | (source (origin |
88f9fea7 RW |
3307 | (method git-fetch) |
3308 | (uri (git-reference | |
b0e7b699 | 3309 | (url "https://github.com/rvoicilas/inotify-tools") |
88f9fea7 RW |
3310 | (commit version))) |
3311 | (file-name (git-file-name name version)) | |
de0b620e LC |
3312 | (sha256 |
3313 | (base32 | |
7290477c | 3314 | "1m8avqccrhm38krlhp88a7v949f3hrzx060bbrr5dp5qw2nmw9j2")))) |
de0b620e | 3315 | (build-system gnu-build-system) |
fb5b359d MB |
3316 | (native-inputs |
3317 | `(("autoconf" ,autoconf) | |
3318 | ("automake" ,automake) | |
3319 | ("libtool" ,libtool))) | |
eb71ab46 TGR |
3320 | (arguments |
3321 | `(#:configure-flags | |
3322 | (list "--disable-static"))) | |
fb5b359d | 3323 | (home-page "https://github.com/rvoicilas/inotify-tools/wiki") |
de0b620e LC |
3324 | (synopsis "Monitor file accesses") |
3325 | (description | |
3326 | "The inotify-tools packages provides a C library and command-line tools | |
3327 | to use Linux' inotify mechanism, which allows file accesses to be monitored.") | |
3ac73271 | 3328 | (license license:gpl2+))) |
e062d542 AE |
3329 | |
3330 | (define-public kmod | |
3331 | (package | |
3332 | (name "kmod") | |
ddcfc467 | 3333 | (version "27") |
e062d542 AE |
3334 | (source (origin |
3335 | (method url-fetch) | |
3336 | (uri | |
3337 | (string-append "mirror://kernel.org/linux/utils/kernel/kmod/" | |
3338 | "kmod-" version ".tar.xz")) | |
3339 | (sha256 | |
3340 | (base32 | |
ddcfc467 | 3341 | "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1")) |
fc1adab1 | 3342 | (patches (search-patches "kmod-module-directory.patch")))) |
e062d542 AE |
3343 | (build-system gnu-build-system) |
3344 | (native-inputs | |
3345 | `(("pkg-config" ,pkg-config))) | |
3346 | (inputs | |
f61e0e79 LC |
3347 | `(("xz" ,xz) |
3348 | ("zlib" ,zlib))) | |
e062d542 | 3349 | (arguments |
ddcfc467 BW |
3350 | `(#:configure-flags '("--with-xz" "--with-zlib" |
3351 | "--disable-test-modules") | |
9f2eb4ff TGR |
3352 | #:phases |
3353 | (modify-phases %standard-phases | |
ddcfc467 BW |
3354 | (add-after 'unpack 'disable-tests |
3355 | (lambda _ | |
3356 | ;; XXX: These tests need '--sysconfdir=/etc' to pass. | |
312d9a33 | 3357 | (substitute* "Makefile.in" |
ddcfc467 BW |
3358 | (("testsuite/test-modprobe") "") |
3359 | (("testsuite/test-depmod") "") | |
3360 | (("testsuite/test-blacklist") "")) | |
3361 | #t)) | |
9f2eb4ff TGR |
3362 | (add-after 'install 'install-modprobe&co |
3363 | (lambda* (#:key outputs #:allow-other-keys) | |
3364 | (let* ((out (assoc-ref outputs "out")) | |
3365 | (bin (string-append out "/bin"))) | |
3366 | (for-each (lambda (tool) | |
3367 | (symlink "kmod" | |
3368 | (string-append bin "/" tool))) | |
3369 | '("insmod" "rmmod" "lsmod" "modprobe" | |
3370 | "modinfo" "depmod")) | |
3371 | #t)))))) | |
22ee7209 | 3372 | (supported-systems (delete "i586-gnu" %supported-systems)) |
e062d542 AE |
3373 | (home-page "https://www.kernel.org/") |
3374 | (synopsis "Kernel module tools") | |
35b9e423 | 3375 | (description "Kmod is a set of tools to handle common tasks with Linux |
e062d542 AE |
3376 | kernel modules like insert, remove, list, check properties, resolve |
3377 | dependencies and aliases. | |
3378 | ||
3379 | These tools are designed on top of libkmod, a library that is shipped with | |
3380 | kmod. The aim is to be compatible with tools, configurations and indices | |
3381 | from the module-init-tools project.") | |
3ac73271 | 3382 | (license license:gpl2+))) ; library under lgpl2.1+ |
d7d42d6b | 3383 | |
76f5428b MC |
3384 | (define-public earlyoom |
3385 | (package | |
3386 | (name "earlyoom") | |
c4d35da4 | 3387 | (version "1.6.2") |
76f5428b MC |
3388 | (source (origin |
3389 | (method git-fetch) | |
3390 | (uri (git-reference | |
b0e7b699 | 3391 | (url "https://github.com/rfjakob/earlyoom") |
76f5428b MC |
3392 | (commit (string-append "v" version)))) |
3393 | (file-name (git-file-name name version)) | |
3394 | (sha256 | |
3395 | (base32 | |
c4d35da4 | 3396 | "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq")))) |
76f5428b MC |
3397 | (build-system gnu-build-system) |
3398 | (arguments | |
c4d35da4 TGR |
3399 | `(#:phases |
3400 | (modify-phases %standard-phases | |
3401 | (delete 'configure) ; no configure script | |
3402 | (add-before 'check 'set-go-HOME | |
3403 | (lambda _ | |
3404 | (setenv "HOME" (getcwd)) | |
3405 | #t)) | |
3406 | (add-before 'check 'disable-failing-test | |
3407 | (lambda _ | |
3408 | ;; This test relies on writing to /proc/%d/oom_score_adj. | |
3409 | (substitute* "testsuite_cli_test.go" | |
3410 | (("TestI" match) | |
3411 | (string-append "skipped" match))) | |
3412 | #t))) | |
76f5428b | 3413 | #:make-flags (let* ((prefix (assoc-ref %outputs "out"))) |
15c8b172 | 3414 | (list ,(string-append "CC=" (cc-for-target)) |
76f5428b MC |
3415 | (string-append "VERSION=v" ,version) |
3416 | (string-append "PREFIX=" prefix) | |
3417 | (string-append "SYSCONFDIR=" prefix "/etc"))) | |
3418 | #:test-target "test")) | |
97aa6a07 RW |
3419 | (native-inputs `(("go" ,go) ;for the test suite |
3420 | ("pandoc" ,pandoc))) ;to generate the manpage | |
76f5428b MC |
3421 | (home-page "https://github.com/rfjakob/earlyoom") |
3422 | (synopsis "Simple out of memory (OOM) daemon for the Linux kernel") | |
3423 | (description "Early OOM is a minimalist out of memory (OOM) daemon that | |
3424 | runs in user space and provides a more responsive and configurable alternative | |
3425 | to the in-kernel OOM killer.") | |
3426 | (license license:expat))) | |
3427 | ||
7fa715e7 LC |
3428 | (define-public eudev |
3429 | ;; The post-systemd fork, maintained by Gentoo. | |
fe32c7f7 | 3430 | (package |
7fa715e7 | 3431 | (name "eudev") |
ed05d6b2 | 3432 | (version "3.2.9") |
7fa715e7 | 3433 | (source (origin |
ee2d63db MB |
3434 | (method git-fetch) |
3435 | (uri (git-reference (url "https://github.com/gentoo/eudev") | |
3436 | (commit (string-append "v" version)))) | |
3437 | (file-name (git-file-name name version)) | |
7fa715e7 LC |
3438 | (sha256 |
3439 | (base32 | |
ed05d6b2 | 3440 | "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7")) |
202342fd | 3441 | (patches (search-patches "eudev-rules-directory.patch")))) |
fe32c7f7 | 3442 | (build-system gnu-build-system) |
4e859e92 | 3443 | (arguments |
213e1764 | 3444 | `(#:phases |
172a9b44 | 3445 | (modify-phases %standard-phases |
ee2d63db MB |
3446 | (add-after 'unpack 'make-source-writable |
3447 | (lambda _ | |
3448 | ;; XXX: Git checkouts are read-only, but this package needs to | |
3449 | ;; modify some of its files. | |
3450 | (for-each make-file-writable (find-files ".")) | |
3451 | #t)) | |
189be331 | 3452 | (add-before 'bootstrap 'patch-file-names |
213e1764 | 3453 | (lambda* (#:key inputs native-inputs #:allow-other-keys) |
172a9b44 MC |
3454 | (substitute* "man/make.sh" |
3455 | (("/usr/bin/xsltproc") | |
213e1764 MO |
3456 | (string-append (assoc-ref |
3457 | (or native-inputs inputs) "xsltproc") | |
172a9b44 | 3458 | "/bin/xsltproc"))) |
189be331 | 3459 | #t)) |
d5949638 MB |
3460 | (add-before 'configure 'patch-bindir-in-btrfs-rules |
3461 | (lambda* (#:key outputs #:allow-other-keys) | |
3462 | ;; The "@bindir@" substitution incorrectly expands to a literal | |
3463 | ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work | |
3464 | ;; around it. | |
3465 | (let ((out (assoc-ref outputs "out"))) | |
3466 | (substitute* "rules/64-btrfs.rules.in" | |
3467 | (("@bindir@") | |
3468 | (string-append out "/bin"))) | |
3469 | #t))) | |
d85f8e46 MB |
3470 | (add-after 'install 'move-static-library |
3471 | (lambda* (#:key outputs #:allow-other-keys) | |
3472 | (let* ((out (assoc-ref outputs "out")) | |
3473 | (static (assoc-ref outputs "static")) | |
3474 | (source (string-append out "/lib/libudev.a")) | |
3475 | (target (string-append static "/lib/libudev.a"))) | |
3476 | (mkdir-p (dirname target)) | |
3477 | (link source target) | |
3478 | (delete-file source) | |
3479 | ;; Remove reference to the static library from the .la file | |
3480 | ;; such that Libtool looks for it in the usual places. | |
3481 | (substitute* (string-append out "/lib/libudev.la") | |
3482 | (("old_library=.*") | |
3483 | "old_library=''\n")) | |
3484 | #t))) | |
172a9b44 MC |
3485 | (add-after 'install 'build-hwdb |
3486 | (lambda* (#:key outputs #:allow-other-keys) | |
3487 | ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and | |
3488 | ;; similar tools to display product names. | |
213e1764 MO |
3489 | ;; |
3490 | ;; XXX: This can't be done when cross-compiling. Find another way | |
3491 | ;; to generate hwdb.bin for cross-built systems. | |
172a9b44 | 3492 | (let ((out (assoc-ref outputs "out"))) |
213e1764 MO |
3493 | ,@(if (%current-target-system) |
3494 | '(#t) | |
3495 | '((invoke (string-append out "/bin/udevadm") | |
3496 | "hwdb" "--update"))))))) | |
d85f8e46 | 3497 | #:configure-flags (list "--enable-manpages"))) |
fe32c7f7 | 3498 | (native-inputs |
172a9b44 MC |
3499 | `(("autoconf" ,autoconf) |
3500 | ("automake" ,automake) | |
3501 | ("gperf" ,gperf) | |
3502 | ("libtool" ,libtool) | |
3503 | ("pkg-config" ,pkg-config) | |
3504 | ;; For tests. | |
e75230c1 | 3505 | ("perl" ,perl) |
172a9b44 MC |
3506 | ("python" ,python-wrapper) |
3507 | ;; For documentation. | |
3508 | ("docbook-xml" ,docbook-xml-4.2) | |
3509 | ("docbook-xsl" ,docbook-xsl) | |
3510 | ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES | |
c695fb76 | 3511 | ("xsltproc" ,libxslt))) |
fe32c7f7 | 3512 | (inputs |
255f7308 LC |
3513 | ;; When linked against libblkid, eudev can populate /dev/disk/by-label |
3514 | ;; and similar; it also installs the '60-persistent-storage.rules' file, | |
3515 | ;; which contains the rules to do that. | |
bb93042c | 3516 | `(("util-linux" ,util-linux "lib") ;for blkid |
255f7308 | 3517 | ("kmod" ,kmod))) |
d85f8e46 | 3518 | (outputs '("out" "static")) |
e1921a38 | 3519 | (home-page "https://wiki.gentoo.org/wiki/Project:Eudev") |
fe32c7f7 MW |
3520 | (synopsis "Userspace device management") |
3521 | (description "Udev is a daemon which dynamically creates and removes | |
3522 | device nodes from /dev/, handles hotplug events and loads drivers at boot | |
3523 | time.") | |
3ac73271 | 3524 | (license license:gpl2+))) |
7fa715e7 | 3525 | |
e74b2c8e BT |
3526 | (define-public python-evdev |
3527 | (package | |
3528 | (name "python-evdev") | |
3529 | (version "1.3.0") | |
3530 | (source | |
3531 | (origin | |
3532 | (method url-fetch) | |
3533 | (uri (pypi-uri "evdev" version)) | |
3534 | (sha256 | |
3535 | (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi")))) | |
3536 | (build-system python-build-system) | |
3537 | (native-inputs | |
3538 | `(("kernel-headers" ,linux-libre-headers))) | |
3539 | (arguments | |
3540 | `(#:tests? #f ;no rule for tests | |
3541 | #:phases | |
3542 | (modify-phases %standard-phases | |
3543 | (add-before 'build 'fix-hard-coded-directory | |
3544 | (lambda* (#:key inputs #:allow-other-keys) | |
3545 | (substitute* "setup.py" | |
3546 | (("/usr/include/linux") | |
3547 | (string-append | |
3548 | (assoc-ref inputs "kernel-headers") "/include/linux"))) | |
3549 | #t))))) | |
3550 | (home-page "https://github.com/gvalkov/python-evdev") | |
3551 | (synopsis "Bindings to the Linux input handling subsystem") | |
3552 | (description | |
3553 | "Python-evdev provides bindings to the generic input event interface in | |
3554 | Linux. The @code{evdev} interface serves the purpose of passing events | |
3555 | generated in the kernel directly to userspace through character devices that | |
3556 | are typically located in @file{/dev/input/}. | |
3557 | ||
3558 | This package also comes with bindings to @code{uinput}, the userspace input | |
3559 | subsystem. @code{uinput} allows userspace programs to create and handle input | |
3560 | devices that can inject events directly into the input subsystem.") | |
3561 | (license license:bsd-3))) | |
3562 | ||
52d2c0b2 JL |
3563 | (define-public interception-tools |
3564 | (package | |
3565 | (name "interception-tools") | |
3566 | (version "0.6.4") | |
3567 | (home-page "https://gitlab.com/interception/linux/tools") | |
3568 | (source (origin | |
3569 | (method git-fetch) | |
3570 | (uri (git-reference | |
3571 | (url home-page) | |
3572 | (commit (string-append "v" version)))) | |
3573 | (file-name (git-file-name name version)) | |
3574 | (sha256 | |
3575 | (base32 | |
3576 | "121jy40ynkbzlqnx7g0dqwvkb7dm2ahcy6vwrz6ylsyd0jmi6s5a")))) | |
3577 | (build-system cmake-build-system) | |
3578 | (inputs | |
3579 | `(("boost" ,boost) | |
3580 | ("libevdev" ,libevdev) | |
3581 | ("libudev" ,eudev) | |
3582 | ("yaml-cpp" ,yaml-cpp))) | |
3583 | (arguments | |
3584 | `(#:phases | |
3585 | (modify-phases %standard-phases | |
3586 | (add-after 'unpack 'fix-libevdev-path | |
3587 | (lambda* (#:key inputs #:allow-other-keys) | |
3588 | (let ((libevdev (assoc-ref inputs "libevdev"))) | |
3589 | (substitute* "CMakeLists.txt" | |
3590 | (("/usr/include/libevdev-1.0") | |
3591 | (string-append libevdev "/include/libevdev-1.0"))) | |
3592 | #t)))) | |
3593 | ;; No tests are included. | |
3594 | #:tests? #f)) | |
3595 | (synopsis "Utilities for operating on input events of evdev devices") | |
3596 | (description | |
3597 | "Interception Tools provides a composable infrastructure on top of | |
3598 | @code{libudev} and @code{libevdev}. The following utilities are provided: | |
3599 | ||
3600 | @itemize | |
3601 | @item @command{udevmon} --- monitor input devices for launching tasks | |
3602 | @item @command{intercept} --- redirect device input events to stdout | |
3603 | @item @command{uinput} --- redirect device input events from stding to virtual device | |
3604 | @item @command{mux} --- mux streams of input events | |
3605 | @end itemize") | |
3606 | ;; Dual-licensed under GPLv3+ or "something else" on request, per | |
3607 | ;; 'README.md'. | |
3608 | (license license:gpl3+))) | |
3609 | ||
3b0ead1c JL |
3610 | (define-public interception-dual-function-keys |
3611 | (package | |
3612 | (name "interception-dual-function-keys") | |
3613 | (version "1.3.0") | |
3614 | (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys") | |
3615 | (source (origin | |
3616 | (method git-fetch) | |
3617 | (uri (git-reference | |
3618 | (url home-page) | |
3619 | (commit version))) | |
3620 | (file-name (git-file-name name version)) | |
3621 | (sha256 | |
3622 | (base32 | |
3623 | "1gvhkmwzl5fyyc7k8rc4rf2b9mzh05wa8wcybf9hz2x1mqkc7lmz")))) | |
3624 | (build-system gnu-build-system) | |
3625 | (inputs | |
3626 | `(("libevdev" ,libevdev) | |
3627 | ("yaml-cpp" ,yaml-cpp))) | |
3628 | (arguments | |
3629 | `(#:make-flags (list "CC=gcc" "CXX=g++" | |
3630 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
3631 | #:phases | |
3632 | (modify-phases %standard-phases | |
3633 | (add-after 'unpack 'fix-libevdev-path | |
3634 | (lambda* (#:key inputs #:allow-other-keys) | |
3635 | (let ((libevdev (assoc-ref inputs "libevdev"))) | |
3636 | (substitute* "config.mk" | |
3637 | (("/usr/include/libevdev-1.0") | |
3638 | (string-append libevdev "/include/libevdev-1.0"))) | |
3639 | #t))) | |
3640 | ;; No configure script | |
3641 | (delete 'configure) | |
3642 | ;; No target 'check' | |
3643 | (delete 'check)))) | |
3644 | (synopsis "Tap for one key, hold for another") | |
3645 | (description | |
3646 | "Dual Function Keys is a plugin for @code{interception-tools} that allows | |
3647 | one to send arbitrary keycodes when a given key is tapped or held.") | |
3648 | (license license:expat))) | |
3649 | ||
66269d47 LC |
3650 | (define-public lvm2 |
3651 | (package | |
3652 | (name "lvm2") | |
d15c0501 | 3653 | (version "2.03.11") |
66269d47 LC |
3654 | (source (origin |
3655 | (method url-fetch) | |
b06dc2bb | 3656 | (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2." |
57bd483f MB |
3657 | version ".tgz") |
3658 | (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2." | |
3659 | version ".tgz"))) | |
66269d47 LC |
3660 | (sha256 |
3661 | (base32 | |
d15c0501 | 3662 | "1m4xpda8vbyd89ca0w8nacvnl4j34yzsa625gn990fb5sh84ab44")) |
66269d47 LC |
3663 | (modules '((guix build utils))) |
3664 | (snippet | |
3665 | '(begin | |
3666 | (use-modules (guix build utils)) | |
3667 | ||
3668 | ;; Honor sysconfdir. | |
3669 | (substitute* "make.tmpl.in" | |
57bd483f | 3670 | (("^confdir = .*$") |
66269d47 LC |
3671 | "confdir = @sysconfdir@\n") |
3672 | (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@") | |
6cbee49d MW |
3673 | "DEFAULT_SYS_DIR = @sysconfdir@")) |
3674 | #t)) | |
01f94cca | 3675 | (patches (search-patches "lvm2-static-link.patch")))) |
66269d47 LC |
3676 | (build-system gnu-build-system) |
3677 | (native-inputs | |
3678 | `(("pkg-config" ,pkg-config) | |
3679 | ("procps" ,procps))) ;tests use 'pgrep' | |
3680 | (inputs | |
57bd483f MB |
3681 | `(("libaio" ,libaio) |
3682 | ("udev" ,eudev))) | |
66269d47 | 3683 | (arguments |
eff63325 | 3684 | `(#:phases |
3afbc6b3 LF |
3685 | (modify-phases %standard-phases |
3686 | (add-after 'configure 'set-makefile-shell | |
3687 | (lambda _ | |
3688 | ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as | |
3689 | ;; expected. | |
3690 | (setenv "SHELL" (which "sh")) | |
66269d47 | 3691 | |
3afbc6b3 LF |
3692 | ;; Replace /bin/sh with the right file name. |
3693 | (patch-makefile-SHELL "make.tmpl") | |
1ac18721 | 3694 | #t))) |
66269d47 LC |
3695 | |
3696 | #:configure-flags (list (string-append "--sysconfdir=" | |
3697 | (assoc-ref %outputs "out") | |
3698 | "/etc/lvm") | |
3699 | "--enable-udev_sync" | |
f2817d43 | 3700 | "--enable-udev_rules" |
9324d92e | 3701 | "--enable-pkgconfig" |
a3ed69b6 PN |
3702 | "--enable-cmdlib" |
3703 | "--enable-dmeventd" ; Requires '--enable-cmdlib'. | |
f2817d43 LC |
3704 | |
3705 | ;; Make sure programs such as 'dmsetup' can | |
3706 | ;; find libdevmapper.so. | |
3707 | (string-append "LDFLAGS=-Wl,-rpath=" | |
a3ed69b6 PN |
3708 | (assoc-ref %outputs "out") |
3709 | "/lib,-rpath=" | |
3710 | (assoc-ref %outputs "out") | |
a3ed69b6 | 3711 | "/lib/device-mapper") |
eff63325 MO |
3712 | ;; This is needed when cross-compiling. |
3713 | ,@(if (%current-target-system) | |
3714 | '("ac_cv_func_malloc_0_nonnull=yes" | |
3715 | "ac_cv_func_realloc_0_nonnull=yes") | |
3716 | '())) | |
66269d47 LC |
3717 | |
3718 | ;; The tests use 'mknod', which requires root access. | |
3719 | #:tests? #f)) | |
654de94e | 3720 | (supported-systems (delete "i586-gnu" %supported-systems)) |
62ec02bf | 3721 | (home-page "https://sourceware.org/lvm2/") |
66269d47 LC |
3722 | (synopsis "Logical volume management for Linux") |
3723 | (description | |
3724 | "LVM2 is the logical volume management tool set for Linux-based systems. | |
3725 | This package includes the user-space libraries and tools, including the device | |
3726 | mapper. Kernel components are part of Linux-libre.") | |
3727 | ||
3728 | ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1. | |
3729 | ;; Command-line tools are GPLv2. | |
3ac73271 | 3730 | (license (list license:gpl2 license:lgpl2.1)))) |
66269d47 | 3731 | |
01f94cca LC |
3732 | (define-public lvm2-static |
3733 | (package | |
3734 | (inherit lvm2) | |
3735 | (name "lvm2-static") | |
3736 | ||
3737 | ;; Propagate udev because libdevmapper.a depends on libudev. | |
d85f8e46 | 3738 | (propagated-inputs `(("udev:static" ,eudev "static"))) |
01f94cca LC |
3739 | |
3740 | (arguments | |
3741 | (substitute-keyword-arguments (package-arguments lvm2) | |
3742 | ((#:configure-flags flags '()) | |
3743 | ;; LVM2 doesn't use Libtool, hence the custom option. | |
57bd483f MB |
3744 | `(append '("--enable-static_link") |
3745 | ;; Building dmeventd statically is complicated due to a | |
3746 | ;; requirement on libdevmapper.a, which is being phased out | |
3747 | ;; in favor of libdevice-mapper.a, which in turn is is not | |
3748 | ;; easily made available at dmeventd build time. Just ignore | |
3749 | ;; it until the situation improves. | |
3750 | (delete "--enable-dmeventd" ,flags))) | |
3751 | ((#:phases phases) | |
3752 | `(modify-phases ,phases | |
3753 | (add-before 'configure 'adjust-Makefile | |
3754 | (lambda _ | |
3755 | ;; These fixes are related to the upstream libdm->device_mapper | |
3756 | ;; migration and will hopefully be fixed upstream in due time. | |
3757 | (substitute* "tools/Makefile.in" | |
3758 | ;; This variable is empty in a static configuration and causes | |
3759 | ;; an erroneous GCC command line. | |
3760 | (("-L\\$\\(interfacebuilddir\\)") "") | |
3761 | ;; Remove obsolete reference to libdevmapper.a. | |
3762 | (("-ldevmapper") "")) | |
3763 | #t)))))) | |
01f94cca LC |
3764 | (synopsis "Logical volume management for Linux (statically linked)"))) |
3765 | ||
a6843071 MR |
3766 | (define-public thin-provisioning-tools |
3767 | (package | |
3768 | (name "thin-provisioning-tools") | |
3769 | (version "0.8.5") | |
3770 | (source | |
3771 | (origin | |
3772 | (method git-fetch) | |
3773 | (uri (git-reference | |
b0e7b699 | 3774 | (url "https://github.com/jthornber/thin-provisioning-tools") |
a6843071 MR |
3775 | (commit (string-append "v" version)))) |
3776 | (file-name (git-file-name name version)) | |
3777 | (sha256 | |
3778 | (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19")))) | |
3779 | (build-system gnu-build-system) | |
3780 | (arguments | |
3781 | ;; Doesn't build with --enable-testing due to a function name collision | |
3782 | ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released. | |
3783 | `(#:tests? #f)) | |
3784 | (native-inputs | |
3785 | `(("automake" ,automake) | |
3786 | ("autoreconf" ,autoconf))) | |
3787 | (inputs | |
3788 | `(("boost" ,boost) | |
3789 | ("expat" ,expat) | |
3790 | ("libaio" ,libaio))) | |
3791 | (synopsis "Tools for manipulating the metadata of device-mapper targets") | |
3792 | (description "A suite of tools for manipulating the metadata of the | |
3793 | dm-thin, dm-cache and dm-era device-mapper targets.") | |
3794 | (home-page "https://github.com/jthornber/thin-provisioning-tools") | |
3795 | (license license:gpl3+))) | |
3796 | ||
000f7559 DT |
3797 | (define-public wireless-tools |
3798 | (package | |
3799 | (name "wireless-tools") | |
3800 | (version "30.pre9") | |
3801 | (source (origin | |
3802 | (method url-fetch) | |
3803 | (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools." | |
3804 | version ".tar.gz")) | |
3805 | (sha256 | |
3806 | (base32 | |
ec01f22d | 3807 | "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb")) |
ec01f22d | 3808 | (snippet |
c2099a4c MW |
3809 | '(begin |
3810 | ;; Remove the older header files that are not free software. | |
3811 | (for-each (lambda (n) | |
3812 | (delete-file (format #f "wireless.~a.h" n))) | |
3813 | '(10 11 12 13 14 15 16 17 18 19 20)) | |
3814 | #t)))) | |
000f7559 DT |
3815 | (build-system gnu-build-system) |
3816 | (arguments | |
c2099a4c MW |
3817 | `(#:make-flags |
3818 | (list (string-append "PREFIX=" %output) | |
3819 | (string-append "INSTALL_MAN=" %output "/share/man") | |
3820 | (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib") | |
3821 | "BUILD_STATIC=") | |
a21b88f1 MO |
3822 | #:phases |
3823 | (modify-phases %standard-phases | |
3824 | (replace 'configure | |
3825 | (lambda* (#:key target #:allow-other-keys) | |
3826 | (when ,(%current-target-system) | |
3827 | ;; Cross-compilation: use the cross tools. | |
3828 | (substitute* (find-files "." "Makefile") | |
3829 | (("CC = .*$") | |
3830 | (string-append "CC = " target "-gcc\n")) | |
3831 | (("AR = .*$") | |
3832 | (string-append "AR = " target "-ar\n")) | |
3833 | (("RANLIB = .*$") | |
3834 | (string-append "RANLIB = " target "-ranlib\n")))) | |
3835 | #t))) | |
000f7559 DT |
3836 | #:tests? #f)) |
3837 | (synopsis "Tools for manipulating Linux Wireless Extensions") | |
fb9b7ce2 | 3838 | (description "Wireless Tools are used to manipulate the now-deprecated |
36a4366d | 3839 | Linux Wireless Extensions; consider using @code{iw} instead. The Wireless |
fb9b7ce2 LC |
3840 | Extension was an interface allowing you to set Wireless LAN specific |
3841 | parameters and get the specific stats. It is deprecated in favor the nl80211 | |
3842 | interface.") | |
fe5ed0bb | 3843 | (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html") |
c2099a4c MW |
3844 | ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the |
3845 | ;; other files are distributed under gpl2. | |
3ac73271 | 3846 | (license (list license:gpl2 license:lgpl2.1+)))) |
30016044 | 3847 | |
cc205dac LC |
3848 | (define-public crda |
3849 | (package | |
3850 | (name "crda") | |
3851 | (version "3.18") | |
3852 | (source (origin | |
3853 | (method url-fetch) | |
3854 | (uri (string-append "mirror://kernel.org/software/network/crda/" | |
3855 | "crda-" version ".tar.xz")) | |
3856 | (sha256 | |
3857 | (base32 | |
3858 | "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23")) | |
fc1adab1 | 3859 | (patches (search-patches "crda-optional-gcrypt.patch")))) |
cc205dac LC |
3860 | (build-system gnu-build-system) |
3861 | (arguments | |
3403a420 | 3862 | `(#:phases (modify-phases %standard-phases |
cc205dac | 3863 | (delete 'configure) |
0bc7c2e4 MW |
3864 | (add-after 'unpack 'gzip-determinism |
3865 | (lambda _ | |
3866 | (substitute* "Makefile" | |
3867 | (("gzip") "gzip --no-name")) | |
3868 | #t)) | |
3403a420 PML |
3869 | ,@(if (%current-target-system) |
3870 | '((add-after | |
3871 | 'unpack 'fix-pkg-config | |
3872 | (lambda* (#:key target #:allow-other-keys) | |
3873 | (substitute* | |
3874 | "Makefile" | |
3875 | (("pkg-config") | |
3876 | (string-append target "-pkg-config"))) | |
3877 | #t))) | |
3878 | '()) | |
cc205dac LC |
3879 | (add-before |
3880 | 'build 'no-werror-no-ldconfig | |
3881 | (lambda _ | |
3882 | (substitute* "Makefile" | |
3883 | (("-Werror") "") | |
3884 | (("ldconfig") "true")) | |
3885 | #t)) | |
3886 | (add-before | |
3887 | 'build 'set-regulator-db-file-name | |
3403a420 | 3888 | (lambda* (#:key native-inputs inputs #:allow-other-keys) |
cc205dac | 3889 | ;; Tell CRDA where to find our database. |
3403a420 PML |
3890 | (let ((regdb (assoc-ref (or native-inputs inputs) |
3891 | "wireless-regdb"))) | |
cc205dac LC |
3892 | (substitute* "crda.c" |
3893 | (("\"/lib/crda/regulatory.bin\"") | |
3894 | (string-append "\"" regdb | |
3895 | "/lib/crda/regulatory.bin\""))) | |
3896 | #t)))) | |
3897 | #:test-target "verify" | |
3403a420 | 3898 | #:make-flags (let ((out (assoc-ref %outputs "out")) |
1ca44ae3 | 3899 | (regdb (assoc-ref %build-inputs "wireless-regdb"))) |
3403a420 | 3900 | (list |
1ca44ae3 | 3901 | (string-append "CC=" ,(cc-for-target)) |
3403a420 PML |
3902 | "V=1" |
3903 | ||
3904 | ;; Disable signature-checking on 'regulatory.bin'. | |
3905 | ;; The reason is that this simplifies maintenance | |
3906 | ;; on our side (no need to manage a distro key | |
3907 | ;; pair), and we can guarantee integrity of | |
3908 | ;; 'regulatory.bin' by other means anyway, such as | |
3909 | ;; 'guix gc --verify'. See | |
3910 | ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb> | |
3911 | ;; for a discssion. | |
3912 | "USE_OPENSSL=0" | |
3913 | ||
3914 | (string-append "PREFIX=" out) | |
3915 | (string-append "SBINDIR=" out "/sbin/") | |
3916 | (string-append "UDEV_RULE_DIR=" | |
3917 | out "/lib/udev/rules.d") | |
3918 | (string-append "LDFLAGS=-Wl,-rpath=" | |
3919 | out "/lib -L.") | |
3920 | (string-append "REG_BIN=" regdb | |
3921 | "/lib/crda/regulatory.bin") | |
3922 | "all_noverify")))) | |
cc205dac | 3923 | (native-inputs `(("pkg-config" ,pkg-config) |
cc205dac LC |
3924 | ("wireless-regdb" ,wireless-regdb))) |
3925 | (inputs `(("libnl" ,libnl))) | |
3926 | (home-page | |
3927 | "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA") | |
3928 | (synopsis "Central regulatory domain agent (CRDA) for WiFi") | |
3929 | (description | |
3930 | "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for | |
3931 | communication between the kernel Linux and user space for regulatory | |
3932 | compliance.") | |
3ac73271 | 3933 | (license license:copyleft-next))) |
cc205dac | 3934 | |
c80b4a3e LC |
3935 | (define-public wireless-regdb |
3936 | (package | |
3937 | (name "wireless-regdb") | |
ab616d44 | 3938 | (version "2020.11.20") |
c80b4a3e LC |
3939 | (source (origin |
3940 | (method url-fetch) | |
3941 | (uri (string-append | |
3942 | "mirror://kernel.org/software/network/wireless-regdb/" | |
3943 | "wireless-regdb-" version ".tar.xz")) | |
3944 | (sha256 | |
3945 | (base32 | |
ab616d44 | 3946 | "0liagyi6ppf5w474qk9j4jz5gbvvn8mc8al1dq4b1xrgv28485ml")) |
5568151f LC |
3947 | |
3948 | ;; We're building 'regulatory.bin' by ourselves. | |
6cbee49d MW |
3949 | (snippet '(begin |
3950 | (delete-file "regulatory.bin") | |
3951 | #t)))) | |
c80b4a3e LC |
3952 | (build-system gnu-build-system) |
3953 | (arguments | |
321292e1 TGR |
3954 | '(#:phases |
3955 | (modify-phases %standard-phases | |
3956 | (add-after 'unpack 'gzip-determinism | |
3957 | (lambda _ | |
3958 | (substitute* "Makefile" | |
3959 | (("gzip") "gzip --no-name")) | |
3960 | #t)) | |
3961 | (add-after 'unpack 'omit-signature | |
3962 | (lambda _ | |
3963 | (substitute* "Makefile" | |
3964 | ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we | |
3965 | ;; don't provide (see below). Disable it. | |
3966 | ((" regulatory\\.db\\.p7s") "") | |
3967 | ;; regulatory.db is built as a dependency of regulatory.db.p7s, | |
3968 | ;; but ‘make install’ depends only on the latter while installing | |
3969 | ;; both (and failing). Depend on it explicitly. | |
3970 | (("^install: " all) (string-append all "regulatory.db "))) | |
3971 | #t)) | |
3972 | (delete 'configure)) ; no configure script | |
5568151f LC |
3973 | |
3974 | ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which | |
3975 | ;; is computed and can be equal to 'maintainer-clean'; when that | |
3976 | ;; happens, we can end up deleting the 'regulatory.bin' file that we | |
3977 | ;; just built. Thus, build things sequentially. | |
3978 | #:parallel-build? #f | |
3979 | ||
321292e1 TGR |
3980 | #:tests? #f ; no tests |
3981 | #:make-flags | |
3982 | (let ((out (assoc-ref %outputs "out"))) | |
3983 | (list (string-append "PREFIX=" out) | |
3984 | (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware") | |
3985 | ||
3986 | ;; Leave this empty so that db2bin.py doesn't try to sign | |
3987 | ;; ‘regulatory.bin’. This allows us to avoid managing a key | |
3988 | ;; pair for the whole distribution. | |
3989 | (string-append "REGDB_PRIVKEY=") | |
3990 | ;; Don't generate a public key for the same reason. These are | |
3991 | ;; used as Makefile targets and can't be the empty string. | |
3992 | (string-append "REGDB_PUBCERT=/dev/null") | |
3993 | (string-append "REGDB_PUBKEY=/dev/null"))))) | |
3994 | (native-inputs | |
3995 | `(("python" ,python-wrapper))) | |
c80b4a3e LC |
3996 | (home-page |
3997 | "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb") | |
3998 | (synopsis "Wireless regulatory database") | |
3999 | (description | |
ab616d44 LF |
4000 | "This package contains the wireless regulatory database for the Central |
4001 | Regulatory Database Agent (CRDA). The database contains information on | |
c80b4a3e | 4002 | country-specific regulations for the wireless spectrum.") |
3ac73271 | 4003 | (license license:isc))) |
c80b4a3e | 4004 | |
30016044 MW |
4005 | (define-public lm-sensors |
4006 | (package | |
4007 | (name "lm-sensors") | |
3feae386 | 4008 | (version "3.6.0") |
b7448627 TGR |
4009 | (source |
4010 | (origin | |
4011 | (method git-fetch) | |
4012 | (uri (git-reference | |
b0e7b699 | 4013 | (url "https://github.com/groeck/lm-sensors") |
b7448627 TGR |
4014 | (commit (string-append "V" (string-join |
4015 | (string-split version #\.) "-"))))) | |
4016 | (file-name (git-file-name name version)) | |
4017 | (sha256 | |
3feae386 | 4018 | (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn")) |
b7448627 | 4019 | (patches (search-patches "lm-sensors-hwmon-attrs.patch")))) |
30016044 MW |
4020 | (build-system gnu-build-system) |
4021 | (inputs `(("rrdtool" ,rrdtool) | |
4022 | ("perl" ,perl) | |
4023 | ("kmod" ,kmod) | |
4024 | ("gnuplot" ,gnuplot))) | |
4025 | (native-inputs `(("pkg-config" ,pkg-config) | |
4026 | ("flex" ,flex) | |
4027 | ("bison" ,bison) | |
4028 | ("which" ,which))) | |
3feae386 | 4029 | (outputs '("lib" ; avoid perl in closure |
8ddf20b2 | 4030 | "out")) |
30016044 | 4031 | (arguments |
3feae386 | 4032 | `(#:tests? #f ; no 'check' target |
30016044 | 4033 | #:make-flags (list (string-append "PREFIX=" %output) |
8ddf20b2 DL |
4034 | (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc") |
4035 | (string-append "INCLUDEDIR=" | |
4036 | (assoc-ref %outputs "lib") "/include") | |
4037 | (string-append "MANDIR=" %output "/share/man") | |
4038 | (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib")) | |
30016044 | 4039 | #:phases |
dc1d3cde KK |
4040 | (modify-phases %standard-phases |
4041 | (delete 'configure) | |
4042 | (add-before 'build 'patch-exec-paths | |
4043 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
4044 | (substitute* "prog/detect/sensors-detect" | |
4045 | (("`uname") | |
4046 | (string-append "`" (assoc-ref inputs "coreutils") | |
4047 | "/bin/uname")) | |
4048 | (("(`|\")modprobe" all open-quote) | |
4049 | (string-append open-quote | |
4050 | (assoc-ref inputs "kmod") | |
4051 | "/bin/modprobe"))) | |
4052 | (substitute* '("prog/pwm/pwmconfig" | |
4053 | "prog/pwm/fancontrol") | |
4054 | (("gnuplot") | |
4055 | (string-append (assoc-ref inputs "gnuplot") | |
4056 | "/bin/gnuplot")) | |
4057 | (("cat ") | |
4058 | (string-append (assoc-ref inputs "coreutils") | |
4059 | "/bin/cat ")) | |
074cd595 | 4060 | (("e?grep " match) |
dc1d3cde | 4061 | (string-append (assoc-ref inputs "grep") |
074cd595 | 4062 | "/bin/" match)) |
dc1d3cde KK |
4063 | (("sed -e") |
4064 | (string-append (assoc-ref inputs "sed") | |
4065 | "/bin/sed -e")) | |
4066 | (("cut -d") | |
4067 | (string-append (assoc-ref inputs "coreutils") | |
4068 | "/bin/cut -d")) | |
4069 | (("sleep ") | |
4070 | (string-append (assoc-ref inputs "coreutils") | |
4071 | "/bin/sleep ")) | |
4072 | (("readlink -f") | |
4073 | (string-append (assoc-ref inputs "coreutils") | |
4074 | "/bin/readlink -f"))) | |
4075 | #t))))) | |
afab450c | 4076 | (home-page "https://hwmon.wiki.kernel.org/lm_sensors") |
30016044 MW |
4077 | (synopsis "Utilities to read temperature/voltage/fan sensors") |
4078 | (description | |
35b9e423 | 4079 | "Lm-sensors is a hardware health monitoring package for Linux. It allows |
30016044 MW |
4080 | you to access information from temperature, voltage, and fan speed sensors. |
4081 | It works with most newer systems.") | |
3ac73271 | 4082 | (license license:gpl2+))) |
b087d413 | 4083 | |
55e1d39b MB |
4084 | (define-public iucode-tool |
4085 | (package | |
4086 | (name "iucode-tool") | |
9eb7cde0 | 4087 | (version "2.3.1") |
55e1d39b MB |
4088 | (source (origin |
4089 | (method url-fetch) | |
4090 | (uri (string-append "https://gitlab.com/iucode-tool/releases" | |
4091 | "/raw/latest/iucode-tool_" version ".tar.xz")) | |
4092 | (sha256 | |
4093 | (base32 | |
9eb7cde0 | 4094 | "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j")))) |
55e1d39b MB |
4095 | (build-system gnu-build-system) |
4096 | (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home") | |
4097 | (synopsis "Manipulate Intel microcode bundles") | |
4098 | (description | |
4099 | "@command{iucode_tool} is a utility to work with microcode packages for | |
4100 | Intel processors. It can convert between formats, extract specific versions, | |
4101 | create a firmware image suitable for the Linux kernel, and more.") | |
513dc568 EF |
4102 | ;; cpuid.h is available for i686, x86_64, and ia64. |
4103 | (supported-systems '("i686-linux" "x86_64-linux")) | |
55e1d39b MB |
4104 | (license license:gpl2+))) |
4105 | ||
f5b2a53d RW |
4106 | (define-public i2c-tools |
4107 | (package | |
4108 | (name "i2c-tools") | |
4109 | (version "3.1.1") | |
4110 | (source (origin | |
4111 | (method url-fetch) | |
4112 | (uri (string-append | |
f32274a7 | 4113 | "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-" |
f5b2a53d RW |
4114 | version ".tar.bz2")) |
4115 | (sha256 | |
4116 | (base32 | |
4117 | "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l")))) | |
4118 | (build-system gnu-build-system) | |
4119 | (arguments | |
1f0e1c49 | 4120 | `(#:tests? #f ; no 'check' target |
f5b2a53d | 4121 | #:make-flags (list (string-append "prefix=" %output) |
1f0e1c49 TGR |
4122 | ,(string-append "CC=" (cc-for-target))) |
4123 | ;; No configure script. | |
dc1d3cde | 4124 | #:phases (modify-phases %standard-phases (delete 'configure)))) |
bccf27cb RW |
4125 | (inputs |
4126 | `(("perl" ,perl))) | |
f32274a7 | 4127 | (home-page "http://jdelvare.nerim.net/devel.html#i2ctools") |
f5b2a53d RW |
4128 | (synopsis "I2C tools for Linux") |
4129 | (description | |
4130 | "The i2c-tools package contains a heterogeneous set of I2C tools for | |
4131 | Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers, | |
4132 | EEPROM decoding scripts, EEPROM programming tools, and a python module for | |
4133 | SMBus access.") | |
3ac73271 | 4134 | (license license:gpl2+))) |
f5b2a53d | 4135 | |
b087d413 MW |
4136 | (define-public xsensors |
4137 | (package | |
4138 | (name "xsensors") | |
4139 | (version "0.70") | |
4140 | (source (origin | |
4141 | (method url-fetch) | |
4142 | (uri (string-append | |
4143 | "http://www.linuxhardware.org/xsensors/xsensors-" | |
4144 | version ".tar.gz")) | |
4145 | (sha256 | |
4146 | (base32 | |
4147 | "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh")))) | |
4148 | (build-system gnu-build-system) | |
8ddf20b2 | 4149 | (inputs `(("lm-sensors" ,lm-sensors "lib") |
b087d413 MW |
4150 | ("gtk" ,gtk+-2))) |
4151 | (native-inputs `(("pkg-config" ,pkg-config))) | |
4152 | (arguments | |
dc1d3cde KK |
4153 | `(#:phases |
4154 | (modify-phases %standard-phases | |
4155 | (add-before 'configure 'enable-deprecated | |
4156 | (lambda _ | |
4157 | (substitute* "src/Makefile.in" | |
4158 | (("-DGDK_DISABLE_DEPRECATED") "") | |
4159 | (("-DGTK_DISABLE_DEPRECATED") "")) | |
4160 | #t)) | |
4161 | (add-before 'configure 'remove-Werror | |
4162 | (lambda _ | |
4163 | (substitute* '("configure" "src/Makefile.in") | |
4164 | (("-Werror") "")) | |
4165 | #t))))) | |
b087d413 MW |
4166 | (home-page "http://www.linuxhardware.org/xsensors/") |
4167 | (synopsis "Hardware health information viewer") | |
4168 | (description | |
35b9e423 | 4169 | "Xsensors reads data from the libsensors library regarding hardware |
b087d413 MW |
4170 | health such as temperature, voltage and fan speed and displays the information |
4171 | in a digital read-out.") | |
3ac73271 | 4172 | (license license:gpl2+))) |
b62fe07f LC |
4173 | |
4174 | (define-public perf | |
4175 | (package | |
4176 | (name "perf") | |
4177 | (version (package-version linux-libre)) | |
fb76ef84 | 4178 | (source (package-source linux-libre)) |
b62fe07f LC |
4179 | (build-system gnu-build-system) |
4180 | (arguments | |
dc1d3cde KK |
4181 | '(#:phases |
4182 | (modify-phases %standard-phases | |
4183 | (replace 'configure | |
4184 | (lambda* (#:key inputs #:allow-other-keys) | |
4185 | (setenv "SHELL_PATH" (which "bash")) | |
4186 | (chdir "tools/perf") | |
4187 | #t))) | |
65dabe4e | 4188 | #:make-flags (list (string-append "prefix=" |
b62fe07f | 4189 | (assoc-ref %outputs "out")) |
ff30860b | 4190 | "CC=gcc" |
2af29d23 LC |
4191 | "WERROR=0" |
4192 | ||
4193 | ;; By default, 'config/Makefile' uses lib64 on | |
4194 | ;; x86_64. Work around that. | |
4195 | "lib=lib") | |
b62fe07f LC |
4196 | #:tests? #f)) ;no tests |
4197 | (native-inputs | |
4198 | `(("pkg-config" ,pkg-config) | |
4199 | ("bison" ,bison) | |
4200 | ("flex" ,flex) | |
4201 | ||
4202 | ;; There are build scripts written in these languages. | |
4203 | ("perl" ,perl) | |
d9a412bd JK |
4204 | ("python2" ,python-2) |
4205 | ("python3" ,python-3))) | |
b62fe07f | 4206 | (inputs |
b1fb4b23 | 4207 | `(("slang" ,slang) ;for the interactive TUI |
b62fe07f | 4208 | ;; ("newt" ,newt) |
6c030d10 | 4209 | ("python" ,python-2) ;'perf' links against libpython |
b62fe07f | 4210 | ("elfutils" ,elfutils) |
b25d3bd9 | 4211 | ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling |
1d484507 LC |
4212 | ("libunwind" ,libunwind) ;better stack walking |
4213 | ("numactl" ,numactl) ;for 'perf bench numa mem' | |
b62fe07f | 4214 | |
d7ece67a LC |
4215 | ;; Documentation. |
4216 | ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES | |
d7ece67a LC |
4217 | ("docbook-xsl" ,docbook-xsl) |
4218 | ("xmlto" ,xmlto) | |
4219 | ("asciidoc" ,asciidoc))) | |
b62fe07f LC |
4220 | (home-page "https://perf.wiki.kernel.org/") |
4221 | (synopsis "Linux profiling with performance counters") | |
4222 | (description | |
4223 | "perf is a tool suite for profiling using hardware performance counters, | |
4224 | with support in the Linux kernel. perf can instrument CPU performance | |
4225 | counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable | |
4226 | of lightweight profiling. This package contains the user-land tools and in | |
36a4366d | 4227 | particular the @code{perf} command.") |
b62fe07f | 4228 | (license (package-license linux-libre)))) |
c09e60e4 DT |
4229 | |
4230 | (define-public pflask | |
4231 | (package | |
4232 | (name "pflask") | |
4233 | (version "0.2") | |
4234 | (source (origin | |
8de37756 EF |
4235 | (method git-fetch) |
4236 | (uri (git-reference | |
4237 | (url "https://github.com/ghedo/pflask") | |
4238 | (commit (string-append "v" version)))) | |
4239 | (file-name (git-file-name name version)) | |
c09e60e4 DT |
4240 | (sha256 |
4241 | (base32 | |
8de37756 | 4242 | "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz")))) |
c09e60e4 DT |
4243 | (build-system cmake-build-system) |
4244 | (arguments | |
4245 | '(#:tests? #f)) ; no tests | |
81e59e41 | 4246 | (home-page "https://ghedo.github.io/pflask/") |
c09e60e4 DT |
4247 | (synopsis "Simple tool for creating Linux namespace containers") |
4248 | (description "pflask is a simple tool for creating Linux namespace | |
4249 | containers. It can be used for running a command or even booting an OS inside | |
4250 | an isolated container, created with the help of Linux namespaces. It is | |
4251 | similar in functionality to chroot, although pflask provides better isolation | |
4252 | thanks to the use of namespaces.") | |
3ac73271 | 4253 | (license license:bsd-2))) |
288084d5 | 4254 | |
3ec07ced RW |
4255 | (define-public singularity |
4256 | (package | |
4257 | (name "singularity") | |
edc6dd03 | 4258 | (version "2.6.1") |
3ec07ced RW |
4259 | (source (origin |
4260 | (method url-fetch) | |
4261 | (uri (string-append "https://github.com/singularityware/singularity/" | |
4262 | "releases/download/" version | |
4263 | "/singularity-" version ".tar.gz")) | |
4264 | (sha256 | |
4265 | (base32 | |
fbf26cbc LC |
4266 | "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk")) |
4267 | (modules '((guix build utils))) | |
4268 | (snippet | |
4269 | '(begin | |
4270 | ;; Do not create directories in /var. | |
4271 | (substitute* "Makefile.in" | |
4272 | (("\\$\\(MAKE\\) .*install-data-hook") "")) | |
af857579 LC |
4273 | |
4274 | ;; The original source overrides PATH so that it points to | |
4275 | ;; /bin, /usr/local/bin, etc., which obviously doesn't work | |
4276 | ;; on Guix System. Leave PATH unchanged so we refer to the | |
4277 | ;; installed Coreutils, grep, etc. | |
4278 | (substitute* "bin/singularity.in" | |
4279 | (("^PATH=.*" all) | |
4280 | (string-append "#" all "\n"))) | |
08814aec LC |
4281 | |
4282 | (substitute* (find-files "libexec/cli" "\\.exec$") | |
4283 | (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid" | |
4284 | _ program) | |
4285 | (string-append "/run/setuid-programs/singularity-" | |
4286 | program "-helper"))) | |
e0dbed64 LC |
4287 | |
4288 | ;; These squashfs mount options are apparently no longer | |
4289 | ;; supported since Linux-libre 5.4.5. | |
4290 | (substitute* "src/lib/image/squashfs/mount.c" | |
4291 | (("\"errors=remount-ro\"") | |
4292 | "NULL")) | |
fbf26cbc | 4293 | #t)))) |
3ec07ced RW |
4294 | (build-system gnu-build-system) |
4295 | (arguments | |
08814aec | 4296 | `(#:configure-flags '("--localstatedir=/var") |
3ec07ced RW |
4297 | #:phases |
4298 | (modify-phases %standard-phases | |
338f5428 | 4299 | (add-after 'unpack 'patch-references |
3ec07ced | 4300 | (lambda _ |
8e344e36 EF |
4301 | (substitute* "libexec/cli/build.exec.in" |
4302 | (("-mksquashfs") (string-append "-" (which "mksquashfs")))) | |
4303 | (substitute* (append | |
4304 | (find-files "libexec" "functions") | |
4305 | (find-files "libexec/bootstrap-scripts" ".*sh$") | |
4306 | (find-files "libexec/cli" ".*exec$")) | |
4ca80a2b RW |
4307 | (("\\| grep ") |
4308 | (string-append "| " (which "grep") " ")) | |
338f5428 | 4309 | (("egrep ") |
8e344e36 EF |
4310 | (string-append (which "egrep") " ")) |
4311 | ((" sed ") | |
4312 | (string-append " " (which "sed") " "))) | |
22464cf3 LC |
4313 | #t)) |
4314 | (add-after 'install 'set-PATH | |
4315 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
4316 | ;; Have the 'singularity' and 'run-singularity' self-sufficient. | |
4317 | (let ((out (assoc-ref outputs "out")) | |
4318 | (coreutils (assoc-ref inputs "coreutils"))) | |
4319 | (wrap-program (string-append out "/bin/singularity") | |
4320 | `("PATH" ":" = (,(string-append coreutils "/bin")))) | |
4321 | (substitute* (string-append out "/bin/run-singularity") | |
4322 | (("/usr/bin/env singularity") | |
4323 | (string-append (which "env") " " | |
4324 | out "/bin/singularity"))) | |
4325 | #t)))))) | |
3ec07ced RW |
4326 | (inputs |
4327 | `(("libarchive" ,libarchive) | |
4328 | ("python" ,python-wrapper) | |
3ec07ced RW |
4329 | ("zlib" ,zlib) |
4330 | ("squashfs-tools" ,squashfs-tools))) | |
4331 | (home-page "https://singularity.lbl.gov/") | |
4332 | (synopsis "Container platform") | |
4333 | (description "Singularity is a container platform supporting a number of | |
4334 | container image formats. It can build SquashFS container images or import | |
4335 | existing Docker images. Singularity requires kernel support for container | |
4336 | isolation or root privileges.") | |
4337 | (license license:bsd-3))) | |
4338 | ||
288084d5 MW |
4339 | (define-public hdparm |
4340 | (package | |
4341 | (name "hdparm") | |
f5d0e35b | 4342 | (version "9.62") |
288084d5 MW |
4343 | (source (origin |
4344 | (method url-fetch) | |
1b1ef87e TGR |
4345 | (uri (string-append "mirror://sourceforge/hdparm/hdparm/" |
4346 | "hdparm-" version ".tar.gz")) | |
288084d5 MW |
4347 | (sha256 |
4348 | (base32 | |
f5d0e35b | 4349 | "0zvppv8qw0y1shlhn34iq1g4883i1cywsa514n595nmyrmsrs3rc")))) |
288084d5 MW |
4350 | (build-system gnu-build-system) |
4351 | (arguments | |
7dd57cc0 TGR |
4352 | `(#:make-flags |
4353 | (let ((out (assoc-ref %outputs "out"))) | |
4354 | (list (string-append "binprefix=" out) | |
4355 | (string-append "manprefix=" out) | |
4356 | ,(string-append "CC=" (cc-for-target)) | |
4357 | ;; Let Guix strip the binaries and not break cross-compilation. | |
4358 | "STRIP=true")) | |
ec238332 TGR |
4359 | #:phases |
4360 | (modify-phases %standard-phases | |
4361 | (delete 'configure)) ; no configure script | |
4362 | #:tests? #f)) ; no test suite | |
3b3b60d0 | 4363 | (home-page "https://sourceforge.net/projects/hdparm/") |
02052b2c | 4364 | (synopsis "View and tune ATA disk drive parameters") |
288084d5 | 4365 | (description |
02052b2c TGR |
4366 | "@command{hdparm} is a command-line utility to control ATA controllers and |
4367 | disk drives. It can increase performance and/or reliability by careful tuning | |
4368 | of hardware settings like power and acoustic management, DMA modes, and caching. | |
4369 | It can also display detailed device information, or be used as a simple | |
4370 | performance benchmarking tool. | |
4371 | ||
4372 | @command{hdparm} provides a command line interface to various Linux kernel | |
4373 | interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older | |
d08be77a TGR |
4374 | IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command |
4375 | Translation (@dfn{SAT}) are also supported.") | |
3ac73271 | 4376 | (license (license:non-copyleft "file://LICENSE.TXT")))) |
288084d5 | 4377 | |
323841bd VL |
4378 | (define-public nvme-cli |
4379 | (package | |
4380 | (name "nvme-cli") | |
e4fb7b6e | 4381 | (version "1.14") |
323841bd VL |
4382 | (home-page "https://github.com/linux-nvme/nvme-cli") |
4383 | (source (origin | |
4384 | (method git-fetch) | |
4385 | (uri (git-reference | |
4386 | (url home-page) | |
4387 | (commit (string-append "v" version)))) | |
4388 | (sha256 | |
e4fb7b6e | 4389 | (base32 "0dpadz945482srqpsbfx1bh7rc499fgpyzz1flhk9g9xjbpapkzc")) |
323841bd VL |
4390 | (file-name (git-file-name name version)))) |
4391 | (build-system gnu-build-system) | |
4392 | (arguments | |
2b9ce100 TGR |
4393 | `(#:make-flags |
4394 | (list ,(string-append "CC=" (cc-for-target))) | |
323841bd | 4395 | #:phases (modify-phases %standard-phases |
2b9ce100 | 4396 | (delete 'configure) ; no ./configure script |
323841bd VL |
4397 | (replace 'install |
4398 | (lambda _ | |
4399 | (invoke "make" "install-spec" "PREFIX=" | |
4400 | (string-append "DESTDIR=" %output))))) | |
2b9ce100 TGR |
4401 | ;; The tests require sysfs, which is not accessible from from the build |
4402 | ;; environment | |
4403 | #:tests? #f)) | |
323841bd VL |
4404 | (synopsis "NVM-Express user space tooling for Linux") |
4405 | (description "Nvme-cli is a utility to provide standards compliant tooling | |
4406 | for NVM-Express drives. It was made specifically for Linux as it relies on the | |
4407 | IOCTLs defined by the mainline kernel driver.") | |
4408 | (license license:gpl2+))) | |
4409 | ||
c755c854 MW |
4410 | (define-public rfkill |
4411 | (package | |
4412 | (name "rfkill") | |
4413 | (version "0.5") | |
4414 | (source (origin | |
4415 | (method url-fetch) | |
4416 | (uri (string-append "mirror://kernel.org/software/network/" | |
4417 | name "/" name "-" version ".tar.xz")) | |
4418 | (sha256 | |
4419 | (base32 | |
4420 | "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0")))) | |
4421 | (build-system gnu-build-system) | |
4422 | (arguments | |
4423 | `(#:make-flags (list "CC=gcc" | |
4424 | (string-append "PREFIX=" %output)) | |
4425 | #:phases (modify-phases %standard-phases | |
4426 | (delete 'configure)) | |
4427 | #:tests? #f)) | |
4428 | (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill") | |
4429 | (synopsis "Tool for enabling and disabling wireless devices") | |
4430 | (description | |
4431 | "rfkill is a simple tool for accessing the rfkill device interface, | |
4432 | which is used to enable and disable wireless networking devices, typically | |
4433 | WLAN, Bluetooth and mobile broadband.") | |
3ac73271 | 4434 | (license (license:non-copyleft "file://COPYING" |
5146f22b EF |
4435 | "See COPYING in the distribution.")) |
4436 | ;; rfkill is part of util-linux as of 2.31. | |
4437 | (properties `((superseded . ,util-linux))))) | |
c755c854 | 4438 | |
dc9bdb1e ML |
4439 | (define-public acpi |
4440 | (package | |
4441 | (name "acpi") | |
4442 | (version "1.7") | |
4443 | (source (origin | |
4444 | (method url-fetch) | |
81e59e41 | 4445 | (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/" |
de67e922 | 4446 | version "/" name "-" version ".tar.gz")) |
dc9bdb1e ML |
4447 | (sha256 |
4448 | (base32 | |
4449 | "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp")))) | |
4450 | (build-system gnu-build-system) | |
4451 | (home-page "http://acpiclient.sourceforge.net") | |
4452 | (synopsis "Display information on ACPI devices") | |
4453 | (description "@code{acpi} attempts to replicate the functionality of the | |
4454 | \"old\" @code{apm} command on ACPI systems, including battery and thermal | |
4455 | information. It does not support ACPI suspending, only displays information | |
4456 | about ACPI devices.") | |
4457 | (license license:gpl2+))) | |
4458 | ||
57a516d3 LC |
4459 | (define-public acpid |
4460 | (package | |
4461 | (name "acpid") | |
b928c587 | 4462 | (version "2.0.32") |
57a516d3 LC |
4463 | (source (origin |
4464 | (method url-fetch) | |
4465 | (uri (string-append "mirror://sourceforge/acpid2/acpid-" | |
4466 | version ".tar.xz")) | |
4467 | (sha256 | |
4468 | (base32 | |
b928c587 | 4469 | "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj")))) |
57a516d3 | 4470 | (build-system gnu-build-system) |
3b3b60d0 | 4471 | (home-page "https://sourceforge.net/projects/acpid2/") |
57a516d3 LC |
4472 | (synopsis "Daemon for delivering ACPI events to user-space programs") |
4473 | (description | |
4474 | "acpid is designed to notify user-space programs of Advanced | |
4475 | Configuration and Power Interface (ACPI) events. acpid should be started | |
4476 | during the system boot, and will run as a background process. When an ACPI | |
4477 | event is received from the kernel, acpid will examine the list of rules | |
4478 | specified in /etc/acpi/events and execute the rules that match the event.") | |
3ac73271 | 4479 | (license license:gpl2+))) |
37f5caec TUBK |
4480 | |
4481 | (define-public sysfsutils | |
4482 | (package | |
4483 | (name "sysfsutils") | |
4484 | (version "2.1.0") | |
4485 | (source | |
4486 | (origin | |
4487 | (method url-fetch) | |
4488 | (uri | |
4489 | (string-append | |
4490 | "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-" | |
4491 | version ".tar.gz")) | |
4492 | (sha256 | |
4493 | (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8")))) | |
4494 | (build-system gnu-build-system) | |
4495 | (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html") | |
4496 | (synopsis "System utilities based on Linux sysfs") | |
4497 | (description | |
8f65585b | 4498 | "These are a set of utilities built upon sysfs, a virtual file system in |
37f5caec TUBK |
4499 | Linux kernel versions 2.5+ that exposes a system's device tree. The package |
4500 | also contains the libsysfs library.") | |
4501 | ;; The library is under lgpl2.1+ (all files say "or any later version"). | |
4502 | ;; The rest is mostly gpl2, with a few files indicating gpl2+. | |
3ac73271 | 4503 | (license (list license:gpl2 license:gpl2+ license:lgpl2.1+)))) |
a9a1a40b TUBK |
4504 | |
4505 | (define-public sysfsutils-1 | |
4506 | (package | |
4507 | (inherit sysfsutils) | |
4508 | (version "1.3.0") | |
4509 | (source | |
4510 | (origin | |
4511 | (method url-fetch) | |
4512 | (uri | |
4513 | (string-append | |
4514 | "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version | |
4515 | "/sysfsutils-" version ".tar.gz")) | |
4516 | (sha256 | |
4517 | (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3")) | |
4518 | (modules '((guix build utils))) | |
4519 | (snippet | |
4520 | '(begin | |
4521 | (substitute* "Makefile.in" | |
4522 | (("includedir = /usr/include/sysfs") | |
4523 | "includedir = @includedir@")) | |
4524 | (substitute* "configure" | |
4525 | (("includedir='(\\$\\{prefix\\}/include)'" all orig) | |
6cbee49d MW |
4526 | (string-append "includedir='" orig "/sysfs'"))) |
4527 | #t)))) | |
a9a1a40b | 4528 | (synopsis "System utilities based on Linux sysfs (version 1.x)"))) |
e6caa52d TUBK |
4529 | |
4530 | (define-public cpufrequtils | |
4531 | (package | |
4532 | (name "cpufrequtils") | |
4533 | (version "0.3") | |
4534 | (source | |
4535 | (origin | |
4536 | (method url-fetch) | |
18160c34 MB |
4537 | (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/" |
4538 | "cpufrequtils-" version ".tar.gz")) | |
e6caa52d TUBK |
4539 | (sha256 |
4540 | (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm")) | |
fc1adab1 | 4541 | (patches (search-patches "cpufrequtils-fix-aclocal.patch")))) |
e6caa52d TUBK |
4542 | (build-system gnu-build-system) |
4543 | (native-inputs | |
4544 | `(("sysfsutils" ,sysfsutils-1))) | |
4545 | (arguments | |
4546 | '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath=" | |
4547 | (assoc-ref %outputs "out") "/lib")))) | |
4548 | (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/") | |
4549 | (synopsis "Utilities to get and set CPU frequency on Linux") | |
4550 | (description | |
e881752c | 4551 | "The cpufrequtils suite contains utilities to retrieve CPU frequency |
e6caa52d TUBK |
4552 | information, and set the CPU frequency if supported, using the cpufreq |
4553 | capabilities of the Linux kernel.") | |
3ac73271 | 4554 | (license license:gpl2))) |
0a588bf9 SB |
4555 | |
4556 | (define-public libraw1394 | |
4557 | (package | |
4558 | (name "libraw1394") | |
7c58c852 | 4559 | (version "2.1.2") |
0a588bf9 SB |
4560 | (source (origin |
4561 | (method url-fetch) | |
4562 | (uri (string-append | |
4563 | "mirror://kernel.org/linux/libs/ieee1394/" | |
4564 | name "-" version ".tar.xz")) | |
4565 | (sha256 | |
4566 | (base32 | |
7c58c852 | 4567 | "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03")))) |
0a588bf9 SB |
4568 | (build-system gnu-build-system) |
4569 | (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page") | |
4570 | (synopsis "Interface library for the Linux IEEE1394 drivers") | |
4571 | (description | |
4572 | "Libraw1394 is the only supported interface to the kernel side raw1394 of | |
4573 | the Linux IEEE-1394 subsystem, which provides direct access to the connected | |
4574 | 1394 buses to user space. Through libraw1394/raw1394, applications can directly | |
4575 | send to and receive from other nodes without requiring a kernel driver for the | |
4576 | protocol in question.") | |
3ac73271 | 4577 | (license license:lgpl2.1+))) |
68e3c29d SB |
4578 | |
4579 | (define-public libavc1394 | |
4580 | (package | |
4581 | (name "libavc1394") | |
4582 | (version "0.5.4") | |
4583 | (source (origin | |
4584 | (method url-fetch) | |
de67e922 | 4585 | (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/" |
68e3c29d SB |
4586 | name "-" version ".tar.gz")) |
4587 | (sha256 | |
4588 | (base32 | |
4589 | "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw")))) | |
4590 | (build-system gnu-build-system) | |
4591 | (native-inputs | |
4592 | `(("pkg-config" ,pkg-config))) | |
4593 | (propagated-inputs | |
4594 | `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc | |
3b3b60d0 | 4595 | (home-page "https://sourceforge.net/projects/libavc1394/") |
68e3c29d SB |
4596 | (synopsis "AV/C protocol library for IEEE 1394") |
4597 | (description | |
4598 | "Libavc1394 is a programming interface to the AV/C specification from | |
69b4ffcf | 4599 | the 1394 Trade Association. AV/C stands for Audio/Video Control.") |
3ac73271 | 4600 | (license license:lgpl2.1+))) |
3f7bf86a SB |
4601 | |
4602 | (define-public libiec61883 | |
4603 | (package | |
4604 | (name "libiec61883") | |
4605 | (version "1.2.0") | |
4606 | (source (origin | |
4607 | (method url-fetch) | |
4608 | (uri (string-append | |
4609 | "mirror://kernel.org/linux/libs/ieee1394/" | |
4610 | name "-" version ".tar.xz")) | |
4611 | (sha256 | |
4612 | (base32 | |
4613 | "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i")))) | |
4614 | (build-system gnu-build-system) | |
4615 | (native-inputs | |
4616 | `(("pkg-config" ,pkg-config))) | |
4617 | (propagated-inputs | |
4618 | `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc | |
4619 | (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page") | |
4620 | (synopsis "Isochronous streaming media library for IEEE 1394") | |
4621 | (description | |
4622 | "The libiec61883 library provides a higher level API for streaming DV, | |
4623 | MPEG-2 and audio over Linux IEEE 1394.") | |
3ac73271 | 4624 | (license license:lgpl2.1+))) |
69159125 MW |
4625 | |
4626 | (define-public mdadm | |
4627 | (package | |
4628 | (name "mdadm") | |
30288ae5 | 4629 | (version "4.1") |
69159125 MW |
4630 | (source (origin |
4631 | (method url-fetch) | |
4632 | (uri (string-append | |
4633 | "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-" | |
4634 | version ".tar.xz")) | |
4635 | (sha256 | |
4636 | (base32 | |
30288ae5 | 4637 | "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb")))) |
69159125 MW |
4638 | (build-system gnu-build-system) |
4639 | (inputs | |
4640 | `(("udev" ,eudev))) | |
4641 | (arguments | |
4642 | `(#:make-flags (let ((out (assoc-ref %outputs "out"))) | |
3dec317f | 4643 | (list ,(string-append "CC=" (cc-for-target)) |
fae88ae8 | 4644 | "INSTALL=install" |
69159125 MW |
4645 | "CHECK_RUN_DIR=0" |
4646 | ;; TODO: tell it where to find 'sendmail' | |
4647 | ;; (string-append "MAILCMD=" <???> "/sbin/sendmail") | |
4648 | (string-append "BINDIR=" out "/sbin") | |
4649 | (string-append "MANDIR=" out "/share/man") | |
4650 | (string-append "UDEVDIR=" out "/lib/udev"))) | |
dc1d3cde KK |
4651 | #:phases |
4652 | (modify-phases %standard-phases | |
4653 | (add-before 'build 'patch-program-paths | |
7dbd3a8e MO |
4654 | (lambda* (#:key native-inputs inputs #:allow-other-keys) |
4655 | (let ((coreutils (assoc-ref (or native-inputs inputs) | |
4656 | "coreutils"))) | |
dc1d3cde KK |
4657 | (substitute* "udev-md-raid-arrays.rules" |
4658 | (("/usr/bin/(readlink|basename)" all program) | |
4659 | (string-append coreutils "/bin/" program)))) | |
4660 | #t)) | |
4661 | (add-before 'build 'remove-W-error | |
4662 | (lambda _ | |
4663 | ;; We cannot build with -Werror on i686 due to a | |
4664 | ;; 'sign-compare' warning in util.c. | |
4665 | (substitute* "Makefile" | |
4666 | (("-Werror") "")) | |
4667 | #t)) | |
4668 | (delete 'configure)) | |
69159125 MW |
4669 | ;;tests must be done as root |
4670 | #:tests? #f)) | |
654de94e | 4671 | (supported-systems (delete "i586-gnu" %supported-systems)) |
69159125 MW |
4672 | (home-page "http://neil.brown.name/blog/mdadm") |
4673 | (synopsis "Tool for managing Linux Software RAID arrays") | |
4674 | (description | |
4675 | "mdadm is a tool for managing Linux Software RAID arrays. It can create, | |
4676 | assemble, report on, and monitor arrays. It can also move spares between raid | |
4677 | arrays when needed.") | |
3ac73271 | 4678 | (license license:gpl2+))) |
01ccdfb6 | 4679 | |
631fda7e LC |
4680 | (define-public mdadm-static |
4681 | (package | |
4682 | (inherit mdadm) | |
4683 | (name "mdadm-static") | |
4684 | (arguments | |
4685 | (substitute-keyword-arguments (package-arguments mdadm) | |
4686 | ((#:make-flags flags) | |
4687 | `(cons "LDFLAGS = -static" ,flags)) | |
4688 | ((#:phases phases) | |
4689 | `(modify-phases ,phases | |
4690 | (add-after 'install 'remove-cruft | |
4691 | (lambda* (#:key outputs #:allow-other-keys) | |
4692 | (let* ((out (assoc-ref outputs "out")) | |
4693 | (precious? (lambda (file) | |
4694 | (member file '("." ".." "sbin")))) | |
4695 | (directories (scandir out (negate precious?)))) | |
4696 | (with-directory-excursion out | |
4697 | (for-each delete-file-recursively directories) | |
4698 | (remove-store-references "sbin/mdadm") | |
4699 | (delete-file "sbin/mdmon") | |
4700 | #t)))))) | |
4701 | ((#:modules modules %gnu-build-system-modules) | |
4702 | `((ice-9 ftw) ,@modules)) | |
4703 | ((#:strip-flags _ '()) | |
4704 | ''("--strip-all")) ;strip a few extra KiB | |
4705 | ((#:allowed-references _ '("out")) | |
4706 | '("out")))) ;refer only self | |
4707 | (synopsis "Statically-linked 'mdadm' command for use in an initrd"))) | |
4708 | ||
b3ed50e6 MB |
4709 | (define-public multipath-tools |
4710 | (package | |
4711 | (name "multipath-tools") | |
80817b50 | 4712 | (version "0.8.5") |
b3ed50e6 | 4713 | (source (origin |
d1ed1d75 MB |
4714 | (method git-fetch) |
4715 | (uri (git-reference | |
4716 | (url "https://git.opensvc.com/multipath-tools/.git") | |
4717 | (commit version))) | |
4718 | (file-name (git-file-name name version)) | |
b3ed50e6 MB |
4719 | (sha256 |
4720 | (base32 | |
80817b50 | 4721 | "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg")) |
b3ed50e6 MB |
4722 | (modules '((guix build utils))) |
4723 | (snippet | |
4724 | '(begin | |
4725 | ;; Drop bundled valgrind headers. | |
4726 | (delete-file-recursively "third-party") | |
4727 | (substitute* '("multipathd/main.c" | |
4728 | "libmultipath/debug.c") | |
4729 | (("#include \"../third-party/") | |
4730 | "#include \"")) | |
4731 | #t)))) | |
4732 | (build-system gnu-build-system) | |
4733 | (arguments | |
a43fe7ac | 4734 | '(#:test-target "test" |
cfdd023b | 4735 | #:parallel-build? #f ;XXX: broken in 0.8.4 |
bd835ff2 TGR |
4736 | #:make-flags (list "CC=gcc" |
4737 | (string-append "DESTDIR=" | |
b3ed50e6 | 4738 | (assoc-ref %outputs "out")) |
cfdd023b MB |
4739 | ;; Install Udev rules below this directory, relative |
4740 | ;; to the prefix. | |
b5fb9430 | 4741 | "SYSTEMDPATH=lib" |
b3ed50e6 MB |
4742 | (string-append "LDFLAGS=-Wl,-rpath=" |
4743 | (assoc-ref %outputs "out") | |
4744 | "/lib")) | |
4745 | #:phases | |
4746 | (modify-phases %standard-phases | |
b5fb9430 | 4747 | (add-after 'unpack 'patch-source |
7f412f33 MB |
4748 | (lambda* (#:key inputs #:allow-other-keys) |
4749 | (let ((lvm2 (assoc-ref inputs "lvm2")) | |
4750 | (udev (assoc-ref inputs "udev"))) | |
4751 | (substitute* "Makefile.inc" | |
a9e7d656 MO |
4752 | (("\\$\\(prefix\\)/usr") "$(prefix)") |
4753 | ;; Do not save timestamp to avoid gzip "timestamp | |
4754 | ;; out-of-range" warnings. | |
4755 | (("gzip -9") "gzip -9n")) | |
7f412f33 MB |
4756 | (substitute* '("kpartx/Makefile" "libmultipath/Makefile") |
4757 | (("/usr/include/libdevmapper.h") | |
4758 | (string-append lvm2 "/include/libdevmapper.h")) | |
4759 | (("/usr/include/libudev.h") | |
4760 | (string-append udev "/include/libudev.h"))) | |
4761 | #t))) | |
cfdd023b MB |
4762 | (add-after 'unpack 'fix-maybe-uninitialized-variable |
4763 | (lambda _ | |
4764 | ;; This variable gets initialized later if needed, but GCC 7 | |
4765 | ;; fails to notice. Should be fixed for > 0.8.4. | |
4766 | ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html | |
4767 | (substitute* "libmultipath/structs_vec.c" | |
4768 | (("bool is_queueing;") | |
4769 | "bool is_queueing = false;")) | |
4770 | #t)) | |
a43fe7ac MB |
4771 | (add-after 'unpack 'fix-linking-tests |
4772 | (lambda _ | |
4773 | ;; Add missing linker flag for -lmpathcmd. This should be fixed | |
4774 | ;; for versions > 0.8.4. | |
4775 | (substitute* "tests/Makefile" | |
4776 | (("-lmultipath -lcmocka") | |
4777 | "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka")) | |
4778 | #t)) | |
80817b50 TGR |
4779 | (add-after 'unpack 'skip-failing-tests |
4780 | (lambda _ | |
4781 | ;; This test and the module's setup() test an arbitrary block | |
4782 | ;; device node name, but the build environment has none. | |
4783 | (substitute* "tests/devt.c" | |
4784 | (("return get_one_devt.*") "return 0;\n") | |
4785 | (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") "")) | |
4786 | ;; The above triggers -Werror=unused-function. Ignore it. | |
4787 | (substitute* "tests/Makefile" | |
4788 | (("CFLAGS \\+= " match) | |
4789 | (string-append match "-Wno-error=unused-function "))) | |
4790 | #t)) | |
57e3f06b | 4791 | (delete 'configure)))) ; no configure script |
b3ed50e6 | 4792 | (native-inputs |
7f412f33 MB |
4793 | `(("perl" ,perl) |
4794 | ("pkg-config" ,pkg-config) | |
a43fe7ac MB |
4795 | ("valgrind" ,valgrind) |
4796 | ||
4797 | ;; For tests. | |
4798 | ("cmocka" ,cmocka))) | |
b3ed50e6 | 4799 | (inputs |
9e78ec5d | 4800 | `(("json-c" ,json-c) |
b3ed50e6 MB |
4801 | ("libaio" ,libaio) |
4802 | ("liburcu" ,liburcu) | |
4803 | ("lvm2" ,lvm2) | |
4804 | ("readline" ,readline) | |
4805 | ("udev" ,eudev))) | |
4806 | (home-page "http://christophe.varoqui.free.fr/") | |
4807 | (synopsis "Access block devices through multiple paths") | |
4808 | (description | |
4809 | "This package provides the following binaries to drive the | |
4810 | Linux Device Mapper multipathing driver: | |
4811 | @enumerate | |
4812 | @item @command{multipath} - Device mapper target autoconfig. | |
4813 | @item @command{multipathd} - Multipath daemon. | |
4814 | @item @command{mpathpersist} - Manages SCSI persistent reservations on | |
4815 | @code{dm} multipath devices. | |
4816 | @item @command{kpartx} - Create device maps from partition tables. | |
4817 | @end enumerate") | |
57e3f06b | 4818 | (license (list license:gpl2+ ; main distribution |
b3ed50e6 MB |
4819 | license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h |
4820 | ||
01ccdfb6 SB |
4821 | (define-public libaio |
4822 | (package | |
4823 | (name "libaio") | |
2fabf398 | 4824 | (version "0.3.112") |
01ccdfb6 SB |
4825 | (source (origin |
4826 | (method url-fetch) | |
87dc306b MB |
4827 | (uri (list |
4828 | (string-append "https://releases.pagure.org/libaio/" | |
4829 | name "-" version ".tar.gz"))) | |
4830 | (sha256 | |
4831 | (base32 | |
2fabf398 | 4832 | "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b")))) |
01ccdfb6 SB |
4833 | (build-system gnu-build-system) |
4834 | (arguments | |
f847d9dc MB |
4835 | `(#:make-flags |
4836 | (let ((target ,(%current-target-system))) | |
4837 | (list (string-append "prefix=" %output) | |
4838 | (string-append | |
4839 | "CC=" (if target | |
4840 | (string-append (assoc-ref %build-inputs "cross-gcc") | |
4841 | "/bin/" target "-gcc") | |
4842 | "gcc")))) | |
01ccdfb6 SB |
4843 | #:test-target "partcheck" ; need root for a full 'check' |
4844 | #:phases | |
21bdf383 | 4845 | (modify-phases %standard-phases (delete 'configure)))) ; no configure script |
87dc306b | 4846 | (home-page "https://pagure.io/libaio") |
01ccdfb6 SB |
4847 | (synopsis "Linux-native asynchronous I/O access library") |
4848 | (description | |
4849 | "This library enables userspace to use Linux kernel asynchronous I/O | |
4850 | system calls, important for the performance of databases and other advanced | |
4851 | applications.") | |
3ac73271 | 4852 | (license license:lgpl2.1+))) |
eb7c43c3 | 4853 | |
12eb7bb8 VL |
4854 | (define-public blktrace |
4855 | ;; Take a newer commit to get the fix for CVE-2018-10689. | |
93a267b7 VL |
4856 | (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58") |
4857 | (revision "1")) | |
12eb7bb8 VL |
4858 | (package |
4859 | (name "blktrace") | |
4860 | (version (git-version "1.2.0" revision commit)) | |
4861 | (home-page | |
4862 | "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git") | |
4863 | (source (origin | |
4864 | (method git-fetch) | |
4865 | (uri (git-reference | |
4866 | (url home-page) | |
4867 | (commit commit))) | |
4868 | (sha256 | |
93a267b7 VL |
4869 | (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp")) |
4870 | (file-name (git-file-name name version)))) | |
12eb7bb8 VL |
4871 | (build-system gnu-build-system) |
4872 | (arguments | |
ac68ab33 TGR |
4873 | `(#:make-flags |
4874 | (list ,(string-append "CC=" (cc-for-target)) | |
4875 | (string-append "prefix=" %output)) | |
4876 | #:tests? #f ; no tests | |
12eb7bb8 VL |
4877 | #:phases |
4878 | (modify-phases %standard-phases | |
ac68ab33 | 4879 | (delete 'configure) ; no configure script |
12eb7bb8 VL |
4880 | (add-after 'unpack 'fix-gnuplot-path |
4881 | (lambda* (#:key inputs #:allow-other-keys) | |
4882 | (let ((gnuplot (assoc-ref inputs "gnuplot"))) | |
4883 | (substitute* "btt/bno_plot.py" | |
4884 | (("gnuplot %s") | |
4885 | (string-append gnuplot "/bin/gnuplot %s"))) | |
4886 | #t)))))) | |
4887 | (inputs | |
4888 | `(("libaio" ,libaio) | |
4889 | ("gnuplot" ,gnuplot) | |
4890 | ("python" ,python-wrapper))) ;for 'bno_plot.py' | |
4891 | (synopsis "Block layer IO tracing mechanism") | |
4892 | (description "Blktrace is a block layer IO tracing mechanism which provides | |
4893 | detailed information about request queue operations to user space. It extracts | |
4894 | event traces from the kernel (via the relaying through the debug file system).") | |
4895 | (license license:gpl2)))) | |
4896 | ||
81b98756 RW |
4897 | (define-public sbc |
4898 | (package | |
4899 | (name "sbc") | |
0fdb7daf | 4900 | (version "1.5") |
81b98756 RW |
4901 | (source (origin |
4902 | (method url-fetch) | |
18160c34 MB |
4903 | (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-" |
4904 | version ".tar.xz")) | |
85ba5e93 | 4905 | (patches (search-patches "sbc-fix-build-non-x86.patch")) |
81b98756 RW |
4906 | (sha256 |
4907 | (base32 | |
0fdb7daf | 4908 | "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc")))) |
81b98756 RW |
4909 | (build-system gnu-build-system) |
4910 | (inputs | |
4911 | `(("libsndfile" ,libsndfile))) | |
4912 | (native-inputs | |
4913 | `(("pkg-config" ,pkg-config))) | |
4914 | (home-page "https://www.kernel.org/pub/linux/bluetooth/") | |
4915 | (synopsis "Bluetooth subband audio codec") | |
4916 | (description | |
4917 | "The SBC is a digital audio encoder and decoder used to transfer data to | |
4918 | Bluetooth audio output devices like headphones or loudspeakers.") | |
4919 | (license license:gpl2+))) | |
4920 | ||
eb7c43c3 DT |
4921 | (define-public bluez |
4922 | (package | |
4923 | (name "bluez") | |
069ddd99 | 4924 | (version "5.55") |
eb7c43c3 DT |
4925 | (source (origin |
4926 | (method url-fetch) | |
4927 | (uri (string-append | |
e9eb24b1 | 4928 | "mirror://kernel.org/linux/bluetooth/bluez-" |
eb7c43c3 DT |
4929 | version ".tar.xz")) |
4930 | (sha256 | |
4931 | (base32 | |
069ddd99 | 4932 | "124v9s4y1s7s6klx5vlmzpk1jlr4x84ch7r7scm7x2f42dqp2qw8")))) |
eb7c43c3 DT |
4933 | (build-system gnu-build-system) |
4934 | (arguments | |
90ea83ee | 4935 | `(#:configure-flags |
eb7c43c3 | 4936 | (let ((out (assoc-ref %outputs "out"))) |
f3dbc626 SB |
4937 | (list "--sysconfdir=/etc" |
4938 | "--localstatedir=/var" | |
4939 | "--enable-library" | |
53142109 | 4940 | "--disable-systemd" |
069ddd99 MB |
4941 | ;; TODO: is this needed? Not installed by default since 5.55. |
4942 | "--enable-hid2hci" | |
eb7c43c3 DT |
4943 | ;; Install dbus/udev files to the correct location. |
4944 | (string-append "--with-dbusconfdir=" out "/etc") | |
87a16de7 SB |
4945 | (string-append "--with-udevdir=" out "/lib/udev"))) |
4946 | #:phases | |
4947 | (modify-phases %standard-phases | |
fbea821a TD |
4948 | ;; Test unit/test-gatt fails unpredictably. Seems to be a timing |
4949 | ;; issue (discussion on upstream mailing list: | |
4950 | ;; https://marc.info/?t=149578476300002&r=1&w=2) | |
4951 | (add-before 'check 'skip-wonky-test | |
4952 | (lambda _ | |
4953 | (substitute* "unit/test-gatt.c" | |
4954 | (("tester_init\\(&argc, &argv\\);") "return 77;")) | |
4955 | #t)) | |
87a16de7 SB |
4956 | (add-after 'install 'post-install |
4957 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
4958 | (let* ((out (assoc-ref outputs "out")) | |
4959 | (servicedir (string-append out "/share/dbus-1/services")) | |
4960 | (service "obexd/src/org.bluez.obex.service") | |
4961 | (rule (string-append | |
4962 | out "/lib/udev/rules.d/97-hid2hci.rules"))) | |
4963 | ;; Install the obex dbus service file. | |
4964 | (substitute* service | |
4965 | (("/bin/false") | |
4966 | (string-append out "/libexec/bluetooth/obexd"))) | |
4967 | (install-file service servicedir) | |
4968 | ;; Fix paths in the udev rule. | |
4969 | (substitute* rule | |
4970 | (("hid2hci --method") | |
4971 | (string-append out "/lib/udev/hid2hci --method")) | |
4972 | (("/sbin/udevadm") | |
4973 | (string-append (assoc-ref inputs "eudev") "/bin/udevadm"))) | |
de47cfed | 4974 | #t)))))) |
eb7c43c3 DT |
4975 | (native-inputs |
4976 | `(("pkg-config" ,pkg-config) | |
b94a6ca0 | 4977 | ("gettext" ,gettext-minimal))) |
eb7c43c3 DT |
4978 | (inputs |
4979 | `(("glib" ,glib) | |
4980 | ("dbus" ,dbus) | |
4981 | ("eudev" ,eudev) | |
4982 | ("libical" ,libical) | |
4983 | ("readline" ,readline))) | |
4984 | (home-page "http://www.bluez.org/") | |
4985 | (synopsis "Linux Bluetooth protocol stack") | |
4986 | (description | |
4987 | "BlueZ provides support for the core Bluetooth layers and protocols. It | |
4988 | is flexible, efficient and uses a modular implementation.") | |
3ac73271 | 4989 | (license license:gpl2+))) |
3d890318 LC |
4990 | |
4991 | (define-public fuse-exfat | |
4992 | (package | |
4993 | (name "fuse-exfat") | |
1372754d | 4994 | (version "1.3.0") |
3d890318 LC |
4995 | (source (origin |
4996 | (method url-fetch) | |
c0cc805e TGR |
4997 | (uri (string-append |
4998 | "https://github.com/relan/exfat/releases/download/v" | |
4999 | version "/" name "-" version ".tar.gz")) | |
3d890318 LC |
5000 | (sha256 |
5001 | (base32 | |
1372754d | 5002 | "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87")))) |
3d890318 LC |
5003 | (build-system gnu-build-system) |
5004 | (native-inputs | |
c0cc805e | 5005 | `(("pkg-config" ,pkg-config))) |
3d890318 LC |
5006 | (inputs |
5007 | `(("fuse" ,fuse))) | |
c0cc805e | 5008 | (home-page "https://github.com/relan/exfat") |
3d890318 LC |
5009 | (synopsis "Mount exFAT file systems") |
5010 | (description | |
5011 | "This package provides a FUSE-based file system that provides read and | |
5012 | write access to exFAT devices.") | |
3ac73271 | 5013 | (license license:gpl2+))) |
53ec8d48 | 5014 | |
1564e0fe PN |
5015 | (define-public fuseiso |
5016 | (package | |
5017 | (name "fuseiso") | |
5018 | (version "20070708") | |
5019 | (source (origin | |
5020 | (method url-fetch) | |
5021 | (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/" | |
5022 | version "/fuseiso-" version ".tar.bz2")) | |
5023 | (sha256 | |
5024 | (base32 | |
5025 | "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b")))) | |
5026 | (build-system gnu-build-system) | |
5027 | (native-inputs | |
5028 | `(("pkg-config" ,pkg-config))) | |
5029 | (inputs | |
5030 | `(("fuse" ,fuse) | |
5031 | ("glib" ,glib) | |
5032 | ("zlib" ,zlib))) | |
5033 | (home-page "https://sourceforge.net/projects/fuseiso/") | |
dff79364 | 5034 | (synopsis "Mount ISO file system images") |
1564e0fe | 5035 | (description |
52beae7b | 5036 | "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg, |
b60e9fb8 PN |
5037 | .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock |
5038 | Ridge, Joliet, and zisofs.") | |
1564e0fe PN |
5039 | (license license:gpl2))) |
5040 | ||
53ec8d48 LC |
5041 | (define-public gpm |
5042 | (package | |
5043 | (name "gpm") | |
5044 | (version "1.20.7") | |
5045 | (source (origin | |
5046 | (method url-fetch) | |
5047 | (uri (string-append | |
a5374cde NG |
5048 | "https://www.nico.schottelius.org/software/gpm/archives/" |
5049 | "gpm-" version ".tar.bz2")) | |
fddb22ac | 5050 | (patches (search-patches "gpm-glibc-2.26.patch")) |
53ec8d48 LC |
5051 | (sha256 |
5052 | (base32 | |
708fc4a2 MB |
5053 | "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh")) |
5054 | (modules '((guix build utils))) | |
5055 | (snippet | |
5056 | '(begin | |
5057 | ;; Take a patch from upstream to fix building with -fno-common, | |
5058 | ;; which is default in GCC 10: | |
5059 | ;; https://github.com/telmich/gpm/pull/37 | |
5060 | (substitute* "src/headers/daemon.h" | |
5061 | (("^time_t[[:blank:]]+last_selection_time;") | |
5062 | "extern time_t last_selection_time;")))))) | |
53ec8d48 LC |
5063 | (build-system gnu-build-system) |
5064 | (arguments | |
5065 | '(#:phases (modify-phases %standard-phases | |
189be331 | 5066 | (replace 'bootstrap |
53ec8d48 LC |
5067 | (lambda _ |
5068 | ;; The tarball was not generated with 'make dist' so we | |
5069 | ;; need to bootstrap things ourselves. | |
77bb6c22 EF |
5070 | (substitute* "autogen.sh" |
5071 | (("/bin/sh") (which "sh"))) | |
90a54e36 MW |
5072 | (invoke "./autogen.sh") |
5073 | (patch-makefile-SHELL "Makefile.include.in") | |
5074 | #t))) | |
53ec8d48 LC |
5075 | |
5076 | ;; Make sure programs find libgpm.so. | |
5077 | #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" | |
5078 | (assoc-ref %outputs "out") | |
5079 | "/lib")))) | |
5080 | (native-inputs | |
5081 | `(("texinfo" ,texinfo) | |
5082 | ("bison" ,bison) | |
5083 | ("flex" ,flex) | |
5084 | ("autoconf" ,autoconf) | |
5085 | ("automake" ,automake) | |
5086 | ("libtool" ,libtool))) | |
a5374cde | 5087 | (home-page "https://www.nico.schottelius.org/software/gpm/") |
53ec8d48 LC |
5088 | (synopsis "Mouse support for the Linux console") |
5089 | (description | |
5090 | "The GPM (general-purpose mouse) daemon is a mouse server for | |
5091 | applications running on the Linux console. It allows users to select items | |
5092 | and copy/paste text in the console and in xterm.") | |
3ac73271 | 5093 | (license license:gpl2+))) |
fc686f9a TGR |
5094 | |
5095 | (define-public btrfs-progs | |
5096 | (package | |
5097 | (name "btrfs-progs") | |
f196d4fe | 5098 | (version "5.12.1") |
fc686f9a TGR |
5099 | (source (origin |
5100 | (method url-fetch) | |
5101 | (uri (string-append "mirror://kernel.org/linux/kernel/" | |
5102 | "people/kdave/btrfs-progs/" | |
5103 | "btrfs-progs-v" version ".tar.xz")) | |
5104 | (sha256 | |
5105 | (base32 | |
f196d4fe | 5106 | "0n9p8zaz4nrkgc20cp6zj7gp4ib4hd4lbyph74f4pysllkz4c24m")))) |
fc686f9a | 5107 | (build-system gnu-build-system) |
7cad981d | 5108 | (outputs '("out" |
c4b006ba | 5109 | "static")) ; static versions of the binaries in "out" |
fc686f9a | 5110 | (arguments |
7cad981d | 5111 | '(#:phases (modify-phases %standard-phases |
0c26e43e BW |
5112 | (add-after 'unpack 'patch-makefile |
5113 | (lambda* (#:key outputs #:allow-other-keys) | |
5114 | (substitute* "Makefile" | |
5115 | (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)") | |
5116 | (string-append (assoc-ref outputs "out") | |
5117 | "/lib/udev/rules.d"))) | |
5118 | #t)) | |
7cad981d | 5119 | (add-after 'build 'build-static |
caf4c7c8 | 5120 | (lambda _ (invoke "make" "static"))) |
9a1c4a98 MB |
5121 | (add-after 'install 'install-bash-completion |
5122 | (lambda* (#:key outputs #:allow-other-keys) | |
3ce4e265 MB |
5123 | (let* ((out (assoc-ref outputs "out")) |
5124 | (bashcomp (string-append out "/etc/bash_completion.d"))) | |
5125 | (mkdir-p bashcomp) | |
5126 | (copy-file "btrfs-completion" | |
5127 | (string-append bashcomp "/btrfs")) | |
5128 | #t))) | |
7cad981d TGR |
5129 | (add-after 'install 'install-static |
5130 | (let ((staticbin (string-append (assoc-ref %outputs "static") | |
5131 | "/bin"))) | |
5132 | (lambda _ | |
caf4c7c8 MW |
5133 | (invoke "make" |
5134 | (string-append "bindir=" staticbin) | |
5135 | "install-static"))))) | |
d6fb0985 | 5136 | #:tests? #f ; XXX: require the 'btrfs' kernel module. |
7cad981d | 5137 | #:test-target "test" |
fc686f9a | 5138 | #:parallel-tests? #f)) ; tests fail when run in parallel |
0c26e43e | 5139 | (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert |
e2937a55 | 5140 | ("lzo" ,lzo) |
bb93042c MB |
5141 | ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid |
5142 | ("util-linux:static" ,util-linux "static") ;ditto | |
fc686f9a | 5143 | ("zlib" ,zlib) |
029c2ba0 | 5144 | ("zlib:static" ,zlib "static") |
ec0de9d8 MB |
5145 | ("zstd" ,zstd "lib") |
5146 | ("zstd:static" ,zstd "static"))) | |
fc686f9a TGR |
5147 | (native-inputs `(("pkg-config" ,pkg-config) |
5148 | ("asciidoc" ,asciidoc) | |
1dfb14d2 | 5149 | ("python" ,python) |
fc686f9a | 5150 | ("xmlto" ,xmlto) |
6a724b02 TGR |
5151 | ;; Remove this input entirely when the default headers |
5152 | ;; version provides blk_zone.capacity (>= 5.9). | |
5153 | ("linux-libre-headers" ,linux-libre-headers-5.10) | |
41d23dd1 | 5154 | ;; For building documentation. |
fc686f9a | 5155 | ("libxml2" ,libxml2) |
48b7e4a6 | 5156 | ("docbook-xsl" ,docbook-xsl) |
41d23dd1 | 5157 | ;; For tests. |
bc64676c | 5158 | ("acl" ,acl) |
caf4c7c8 | 5159 | ("which" ,which) |
0c26e43e BW |
5160 | ("dmsetup" ,lvm2) |
5161 | ("udevadm" ,eudev) | |
caf4c7c8 MW |
5162 | ;; The tests need 'grep' with perl regexp support. |
5163 | ("grep" ,grep))) | |
fc83ca2b | 5164 | (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page") |
fc686f9a | 5165 | (synopsis "Create and manage btrfs copy-on-write file systems") |
039601e0 TGR |
5166 | (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux |
5167 | aimed at implementing advanced features while focusing on fault tolerance, | |
5168 | repair and easy administration.") | |
68bcac6b LF |
5169 | ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c. |
5170 | ;; GPL2: Everything else. | |
5171 | (license (list license:gpl2 license:gpl2+)))) | |
08e9daf5 | 5172 | |
f3e44f5c DC |
5173 | (define-public btrfs-progs/static |
5174 | (package | |
5175 | (name "btrfs-progs-static") | |
5176 | (version (package-version btrfs-progs)) | |
5177 | (source #f) | |
5178 | (build-system trivial-build-system) | |
5179 | (inputs | |
5180 | `(("btrfs-progs:static" ,btrfs-progs "static"))) | |
5181 | (arguments | |
5182 | `(#:modules ((guix build utils)) | |
5183 | #:builder | |
5184 | (begin | |
5185 | (use-modules (guix build utils) | |
5186 | (ice-9 ftw) | |
5187 | (srfi srfi-26)) | |
5188 | ||
5189 | (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static")) | |
5190 | (out (assoc-ref %outputs "out")) | |
5191 | (source (string-append btrfs "/bin/btrfs.static")) | |
5192 | (target (string-append out "/bin/btrfs"))) | |
5193 | (mkdir-p (dirname target)) | |
5194 | (copy-file source target) | |
5195 | (remove-store-references target) | |
e3cfef22 MW |
5196 | (chmod target #o555) |
5197 | #t)))) | |
f3e44f5c | 5198 | (home-page (package-home-page btrfs-progs)) |
ff797172 TGR |
5199 | (synopsis "Statically-linked btrfs command from btrfs-progs") |
5200 | (description "This package provides the statically-linked @command{btrfs} | |
5201 | from the btrfs-progs package. It is meant to be used in initrds.") | |
f3e44f5c DC |
5202 | (license (package-license btrfs-progs)))) |
5203 | ||
0f4be78f VL |
5204 | (define-public cramfs-tools |
5205 | (package | |
5206 | (name "cramfs-tools") | |
5207 | (home-page "https://github.com/npitre/cramfs-tools") | |
5208 | (version "2.1") | |
5209 | (source (origin | |
5210 | (method git-fetch) | |
5211 | (uri (git-reference | |
5212 | (url home-page) | |
5213 | (commit (string-append "v" version)))) | |
5214 | (sha256 | |
5215 | (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p")) | |
5216 | (file-name (git-file-name name version)))) | |
5217 | (build-system gnu-build-system) | |
5218 | (arguments | |
5219 | '(#:tests? #f ; No tests. | |
5220 | #:phases | |
5221 | (modify-phases %standard-phases | |
5222 | (delete 'configure) | |
5223 | (replace 'install | |
5224 | (lambda* (#:key outputs #:allow-other-keys) | |
5225 | (let ((out (assoc-ref outputs "out"))) | |
5226 | (install-file "mkcramfs" (string-append out "/sbin")) | |
5227 | (install-file "cramfsck" (string-append out "/sbin"))) | |
5228 | #t))))) | |
5229 | (inputs | |
5230 | `(("zlib" ,zlib))) | |
5231 | (synopsis "Tools to manage Cramfs file systems") | |
5232 | (description "Cramfs is a Linux file system designed to be simple, small, | |
5233 | and to compress things well. It is used on a number of embedded systems and | |
5234 | small devices. This version has additional features such as uncompressed | |
5235 | blocks and random block placement.") | |
5236 | (license license:gpl2+))) | |
5237 | ||
49b28a74 PN |
5238 | (define-public compsize |
5239 | (package | |
5240 | (name "compsize") | |
a5528684 | 5241 | (version "1.5") |
49b28a74 PN |
5242 | (home-page "https://github.com/kilobyte/compsize") |
5243 | (source (origin | |
5244 | (method git-fetch) | |
5245 | (uri (git-reference | |
5246 | (url home-page) | |
5247 | (commit (string-append "v" version)))) | |
5248 | (sha256 | |
a5528684 | 5249 | (base32 "0vqnrwgpv6pc1yjl0g4gl71xyl6v0xl3pyqjanjpwps73c53azir")) |
49b28a74 PN |
5250 | (file-name (git-file-name name version)))) |
5251 | (build-system gnu-build-system) | |
5252 | (inputs | |
5253 | `(("btrfs-progs" ,btrfs-progs))) | |
5254 | (arguments | |
5255 | `(#:tests? #f ; No tests. | |
e430433b TGR |
5256 | #:make-flags |
5257 | (list (string-append "CC=" ,(cc-for-target))) | |
49b28a74 PN |
5258 | #:phases |
5259 | (modify-phases %standard-phases | |
5260 | (delete 'configure) | |
5261 | (replace 'install | |
5262 | (lambda* (#:key outputs #:allow-other-keys) | |
5263 | (let ((out (assoc-ref outputs "out"))) | |
5264 | (install-file "compsize" (string-append out "/bin")) | |
5265 | (install-file "compsize.8" (string-append out "/share/man/man8")))))))) | |
5266 | (synopsis "Find compression type/ratio on Btrfs files") | |
5267 | (description "@command{compsize} takes a list of files (given as | |
5268 | arguments) on a Btrfs file system and measures used compression types and | |
5269 | effective compression ratio, producing a report. | |
5270 | ||
5271 | A directory has no extents but has a (recursive) list of files. A non-regular | |
5272 | file is silently ignored. | |
5273 | ||
5274 | As it makes no sense to talk about compression ratio of a partial extent, | |
5275 | every referenced extent is counted whole, exactly once -- no matter if you use | |
5276 | only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the | |
5277 | uncompressed size will not match the number given by @command{tar} or | |
5278 | @command{du}. On the other hand, the space used should be accurate (although | |
5279 | obviously it can be shared with files outside our set).") | |
5280 | (license license:gpl2+))) | |
5281 | ||
72aa295e | 5282 | (define-public f2fs-tools-1.7 |
2e456982 MB |
5283 | (package |
5284 | (name "f2fs-tools") | |
72aa295e | 5285 | (version "1.7.0") |
2e456982 MB |
5286 | (source (origin |
5287 | (method url-fetch) | |
5288 | (uri (string-append | |
5289 | "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk" | |
2d588f3c | 5290 | "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz")) |
2e456982 MB |
5291 | (sha256 |
5292 | (base32 | |
72aa295e DM |
5293 | "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k")))) |
5294 | ||
2e456982 MB |
5295 | (build-system gnu-build-system) |
5296 | (arguments | |
5297 | `(#:phases | |
5298 | (modify-phases %standard-phases | |
72aa295e DM |
5299 | (add-after 'install 'install-headers |
5300 | (lambda* (#:key outputs #:allow-other-keys) | |
5301 | (let* ((out (assoc-ref outputs "out")) | |
5302 | (out-include (string-append out "/include"))) | |
5303 | (install-file "include/f2fs_fs.h" out-include) | |
5304 | (install-file "mkfs/f2fs_format_utils.h" out-include) | |
5305 | #t)))))) | |
2e456982 MB |
5306 | (native-inputs |
5307 | `(("autoconf" ,autoconf) | |
5308 | ("automake" ,automake) | |
5309 | ("libtool" ,libtool) | |
5310 | ("pkg-config" ,pkg-config))) | |
5311 | (inputs | |
bb93042c | 5312 | `(("libuuid" ,util-linux "lib") |
72aa295e | 5313 | ("libselinux" ,libselinux))) |
2e456982 MB |
5314 | (home-page "https://f2fs.wiki.kernel.org/") |
5315 | (synopsis "Userland tools for f2fs") | |
5316 | (description | |
5317 | "F2FS, the Flash-Friendly File System, is a modern file system | |
5318 | designed to be fast and durable on flash devices such as solid-state | |
5319 | disks and SD cards. This package provides the userland utilities.") | |
5320 | ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual | |
5321 | ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'. | |
5322 | (license (list license:gpl2 license:lgpl2.1)))) | |
5323 | ||
72aa295e DM |
5324 | (define-public f2fs-tools |
5325 | (package | |
5326 | (inherit f2fs-tools-1.7) | |
5327 | (name "f2fs-tools") | |
ac45640a | 5328 | (version "1.14.0") |
72aa295e DM |
5329 | (source (origin |
5330 | (method url-fetch) | |
5331 | (uri (string-append | |
5332 | "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk" | |
2d588f3c | 5333 | "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz")) |
72aa295e DM |
5334 | (sha256 |
5335 | (base32 | |
ac45640a | 5336 | "1lab1446c78xsjwhpki7s85z4171m8p9279c8yhm4882wba674k1")))) |
72aa295e | 5337 | (inputs |
bb93042c | 5338 | `(("libuuid" ,util-linux "lib"))))) |
72aa295e | 5339 | |
807986a5 | 5340 | (define-public f2fs-tools/static |
5341 | (static-package | |
5342 | (package | |
5343 | (inherit f2fs-tools) | |
5344 | (name "f2fs-tools-static") | |
5345 | (arguments | |
5346 | `(#:configure-flags | |
5347 | (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static")) | |
5348 | (libuuid (assoc-ref %build-inputs "libuuid"))) | |
5349 | (list | |
a099d833 | 5350 | (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid") |
807986a5 | 5351 | (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid") |
a099d833 DM |
5352 | (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid " |
5353 | "-I" libuuid "/include/blkid") | |
807986a5 | 5354 | (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid"))) |
5355 | #:disallowed-references (,util-linux) | |
5356 | #:phases | |
5357 | (modify-phases %standard-phases ; TODO: f2fs phases. | |
5358 | (add-after 'unpack 'make-static | |
5359 | (lambda _ | |
5360 | (define (append-to-file name body) | |
5361 | (let ((file (open-file name "a"))) | |
5362 | (display body file) | |
5363 | (close-port file))) | |
5364 | (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n") | |
5365 | (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n") | |
5366 | (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n") | |
da09c63e DM |
5367 | #t)) |
5368 | (add-after 'install 'remove-store-references | |
5369 | (lambda* (#:key outputs #:allow-other-keys) | |
5370 | ;; Work around bug in our util-linux. | |
5371 | ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>. | |
5372 | (remove-store-references (string-append (assoc-ref outputs "out") | |
5373 | "/sbin/mkfs.f2fs")) | |
5374 | #t))))) | |
807986a5 | 5375 | (inputs |
5376 | `(("libuuid:static" ,util-linux "static") | |
50e6c1bf | 5377 | ("libuuid" ,util-linux "lib")))))) ; for include files |
807986a5 | 5378 | |
a5cf52d3 | 5379 | (define-public f2fs-fsck/static |
5380 | (package | |
5381 | (name "f2fs-fsck-static") | |
5382 | (version (package-version f2fs-tools/static)) | |
5383 | (source #f) | |
5384 | (build-system trivial-build-system) | |
5385 | (arguments | |
5386 | `(#:modules ((guix build utils)) | |
5387 | #:builder | |
5388 | (begin | |
5389 | (use-modules (guix build utils) | |
5390 | (ice-9 ftw) | |
5391 | (srfi srfi-26)) | |
5392 | (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static")) | |
5393 | (fsck "fsck.f2fs") | |
5394 | (out (assoc-ref %outputs "out")) | |
5395 | (sbin (string-append out "/sbin"))) | |
5396 | (mkdir-p sbin) | |
5397 | (with-directory-excursion sbin | |
5398 | (install-file (string-append f2fs-tools "/sbin/" fsck) | |
5399 | ".") | |
5400 | (remove-store-references fsck) | |
5401 | (chmod fsck #o555)) | |
5402 | #t)))) | |
5403 | (inputs | |
5404 | `(("f2fs-tools-static" ,f2fs-tools/static))) | |
5405 | (home-page (package-home-page f2fs-tools/static)) | |
5406 | (synopsis "Statically-linked fsck.f2fs command from f2fs-tools") | |
5407 | (description "This package provides statically-linked fsck.f2fs command taken | |
5408 | from the f2fs-tools package. It is meant to be used in initrds.") | |
5409 | (license (package-license f2fs-tools/static)))) | |
5410 | ||
08e9daf5 TGR |
5411 | (define-public freefall |
5412 | (package | |
5413 | (name "freefall") | |
5414 | (version (package-version linux-libre)) | |
5415 | (source (package-source linux-libre)) | |
5416 | (build-system gnu-build-system) | |
5417 | (arguments | |
5418 | '(#:phases (modify-phases %standard-phases | |
5419 | (add-after 'unpack 'enter-subdirectory | |
5420 | (lambda _ | |
2ee42f7e MW |
5421 | (chdir "tools/laptop/freefall") |
5422 | #t)) | |
08e9daf5 TGR |
5423 | (delete 'configure) |
5424 | (add-before 'build 'increase-timeout | |
5425 | (lambda _ | |
5426 | ;; The default of 2 seconds is too low: it assumes an | |
5427 | ;; open lid and AC power without actually checking. | |
5428 | (substitute* "freefall.c" | |
2ee42f7e MW |
5429 | (("alarm\\(2\\)") "alarm(5)")) |
5430 | #t))) | |
08e9daf5 | 5431 | #:make-flags (list (string-append "PREFIX=" |
c80629e7 EF |
5432 | (assoc-ref %outputs "out")) |
5433 | "CC=gcc") | |
08e9daf5 TGR |
5434 | #:tests? #f)) ;no tests |
5435 | (home-page (package-home-page linux-libre)) | |
5436 | (synopsis "Free-fall protection for spinning laptop hard drives") | |
5437 | (description | |
5438 | "Prevents shock damage to the internal spinning hard drive(s) of some | |
5439 | HP and Dell laptops. When sudden movement is detected, all input/output | |
5440 | operations on the drive are suspended and its heads are parked on the ramp, | |
5441 | where they are less likely to cause damage to the spinning disc. Requires a | |
5442 | drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload | |
5443 | feature, and a laptop with an accelerometer. It has no effect on SSDs.") | |
5444 | (license license:gpl2))) | |
d17ae8c0 NG |
5445 | |
5446 | (define-public thinkfan | |
5447 | (package | |
5448 | (name "thinkfan") | |
4ac70d02 | 5449 | (version "1.2.2") |
9a3d176e TGR |
5450 | (source |
5451 | (origin | |
5452 | (method git-fetch) | |
5453 | (uri (git-reference | |
b0e7b699 | 5454 | (url "https://github.com/vmatare/thinkfan") |
9a3d176e TGR |
5455 | (commit version))) |
5456 | (file-name (git-file-name name version)) | |
5457 | (sha256 | |
4ac70d02 | 5458 | (base32 "01l1pnj1cgy3dwgyys2s5iqzyv6kk47vlpy09qjafk8py21ijik3")))) |
d17ae8c0 NG |
5459 | (build-system cmake-build-system) |
5460 | (arguments | |
5461 | `(#:modules ((guix build cmake-build-system) | |
5462 | (guix build utils) | |
5463 | (srfi srfi-26)) | |
9a3d176e | 5464 | #:tests? #f ; no test target |
d17ae8c0 NG |
5465 | #:configure-flags |
5466 | ;; Enable reading temperatures from hard disks via S.M.A.R.T. | |
9a3d176e TGR |
5467 | ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly |
5468 | ;; inefficient’. | |
d17ae8c0 NG |
5469 | `("-DUSE_ATASMART:BOOL=ON") |
5470 | #:phases | |
5471 | (modify-phases %standard-phases | |
908a3f36 TGR |
5472 | (add-after 'unpack 'create-init-scripts |
5473 | ;; CMakeLists.txt relies on build-time symptoms of OpenRC and | |
5474 | ;; systemd to patch and install their service files. Fake their | |
5475 | ;; presence rather than duplicating the build system below. Leave | |
5476 | ;; things like ‘/bin/kill’ because they're not worth a dependency. | |
5477 | ;; The sysvinit needs manual patching, but since upstream doesn't | |
5478 | ;; even provide the option to install it: don't. | |
d17ae8c0 | 5479 | (lambda* (#:key outputs #:allow-other-keys) |
908a3f36 TGR |
5480 | (let* ((out (assoc-ref outputs "out")) |
5481 | (share (string-append out "/share/" ,name))) | |
5482 | (substitute* "CMakeLists.txt" | |
5483 | (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package) | |
f989dffd | 5484 | (format #f "option(~a_FOUND \"Faked\" ON)\n" package)) |
908a3f36 TGR |
5485 | ;; That was easy! Now we just need to fix the destinations. |
5486 | (("/etc" directory) | |
5487 | (string-append out directory))) | |
5488 | #t)))))) | |
9a3d176e TGR |
5489 | (native-inputs |
5490 | `(("pkg-config" ,pkg-config))) | |
d17ae8c0 | 5491 | (inputs |
9a3d176e TGR |
5492 | `(("libatasmart" ,libatasmart) |
5493 | ("yaml-cpp" ,yaml-cpp))) | |
a8c8b890 | 5494 | (home-page "https://github.com/vmatare/thinkfan") |
d17ae8c0 NG |
5495 | (synopsis "Simple fan control program") |
5496 | (description | |
5497 | "Thinkfan is a simple fan control program. It reads temperatures, | |
5498 | checks them against configured limits and switches to appropriate (also | |
5499 | pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any | |
5500 | other @code{hwmon} driver that enables temperature reading and fan control | |
5501 | from userspace.") | |
5502 | (license license:gpl3+))) | |
91231156 | 5503 | |
b313665f TGR |
5504 | (define-public tpacpi-bat |
5505 | (package | |
5506 | (name "tpacpi-bat") | |
5507 | (version "3.1") | |
5508 | (source | |
5509 | (origin | |
5510 | (method git-fetch) | |
5511 | (uri (git-reference | |
b0e7b699 | 5512 | (url "https://github.com/teleshoes/tpacpi-bat") |
b313665f TGR |
5513 | (commit (string-append "v" version)))) |
5514 | (file-name (git-file-name name version)) | |
5515 | (sha256 | |
5516 | (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5")))) | |
5517 | (build-system gnu-build-system) | |
5518 | (arguments | |
5519 | `(#:tests? #f ; no test target | |
5520 | #:phases | |
5521 | (modify-phases %standard-phases | |
5522 | (add-after 'unpack 'refer-to-inputs | |
5523 | (lambda _ | |
5524 | (substitute* "tpacpi-bat" | |
5525 | (("cat ") | |
05e3ed30 | 5526 | (format #f "~a " (which "cat"))) |
b313665f TGR |
5527 | ;; tpacpi-bat modprobes the acpi_call kernel module if it's not |
5528 | ;; loaded. That's the administrator's prerogative; disable it. | |
5529 | (("system \"(modprobe .*)\"" _ match) | |
05e3ed30 | 5530 | (format #f "die \"Please run ‘~a’ first.\\n\"" match))) |
b313665f TGR |
5531 | #t)) |
5532 | (delete 'configure) ; nothing to configure | |
5533 | (delete 'build) ; nothing to build | |
5534 | (replace 'install | |
5535 | (lambda* (#:key outputs #:allow-other-keys) | |
5536 | (let* ((out (assoc-ref outputs "out")) | |
5537 | (bin (string-append out "/bin")) | |
5538 | (doc (string-append out "/share/doc/" ,name "-" ,version))) | |
5539 | (install-file "tpacpi-bat" bin) | |
5540 | ||
5541 | ;; There's no man page. Install other forms of documentation. | |
5542 | (for-each (lambda (file) | |
5543 | (let ((target (string-append doc "/" file))) | |
5544 | (mkdir-p (dirname target)) | |
5545 | (copy-recursively file target))) | |
5546 | (list "battery_asl" "examples" "README.md")) | |
5547 | #t)))))) | |
5548 | (inputs | |
5549 | `(("perl" ,perl))) | |
5550 | (home-page "https://github.com/teleshoes/tpacpi-bat") | |
5551 | (synopsis "ThinkPad battery charge controller") | |
5552 | (description | |
5553 | "Tpacpi-bat is a command-line interface to control battery charging on | |
5554 | @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo | |
5555 | ThinkPad models released after 2011}, starting with the xx20 series. It can | |
5556 | query and set the thresholds at which one or both batteries will start and stop | |
5557 | charging, inhibit charging batteries for a set period of time, or force them to | |
5558 | discharge when they otherwise would not. | |
5559 | ||
5560 | This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux | |
5561 | kernel module provided by the @code{acpi-call-linux-module} package, which must | |
5562 | be installed and loaded separately. Only the original vendor firmware is | |
5563 | supported.") | |
5564 | (license license:gpl3+))) | |
5565 | ||
c8118181 TGR |
5566 | (define-public tmon |
5567 | (package | |
5568 | (name "tmon") | |
5569 | ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has. | |
5570 | (version (package-version linux-libre)) | |
5571 | (source (package-source linux-libre)) | |
5572 | (build-system gnu-build-system) | |
5573 | (arguments | |
5574 | `(#:tests? #f ; no test suite | |
5575 | #:make-flags | |
5576 | (list (string-append "CC=" ,(cc-for-target)) | |
5577 | (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out")) | |
5578 | "BINDIR=bin") | |
5579 | #:phases | |
5580 | (modify-phases %standard-phases | |
5581 | (add-after 'unpack 'enter-subdirectory | |
5582 | (lambda _ | |
5583 | (chdir "tools/thermal/tmon") | |
5584 | #t)) | |
5585 | (add-after 'install 'install-man-page | |
5586 | (lambda* (#:key outputs #:allow-other-keys) | |
5587 | (let* ((out (assoc-ref outputs "out")) | |
5588 | (man8 (string-append out "/share/man/man8"))) | |
5589 | (install-file "tmon.8" man8) | |
5590 | #t))) | |
5591 | (delete 'configure)))) ; no configure script | |
5592 | (inputs | |
5593 | `(("ncurses" ,ncurses))) | |
5594 | (home-page (package-home-page linux-libre)) | |
5595 | (synopsis "Monitor and test the Linux thermal subsystem in real time") | |
5596 | (description | |
5597 | "Tmon is a tool to interact with the complex thermal subsystem of the | |
5598 | kernel Linux. It helps visualize thermal relationships and real-time thermal | |
5599 | data, tune and test cooling devices and sensors, and collect thermal data for | |
5600 | further analysis. | |
5601 | ||
5602 | As computers become smaller and more thermally constrained, more sensors are | |
5603 | added and new cooling capabilities introduced. Thermal relationships can change | |
5604 | dynamically. Their complexity grows exponentially among cooling devices, zones, | |
5605 | sensors, and trip points. | |
5606 | ||
5607 | Linux exposes this relationship through @file{/sys/class/thermal} with a matrix | |
5608 | of symbolic links, trip point bindings, and device instances. To traverse it | |
5609 | by hand is no trivial task: @command{tmon} aims to make it understandable.") | |
333b9c81 TGR |
5610 | (license (list license:gpl2 ; the man page |
5611 | license:gpl2+)))) ; the actual rest | |
c8118181 | 5612 | |
acc87fae TGR |
5613 | (define-public turbostat |
5614 | (package | |
5615 | (name "turbostat") | |
5616 | ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would | |
5617 | ;; make it harder to benefit from ‘free’ linux-libre package updates. | |
5618 | (version (package-version linux-libre)) | |
5619 | (source (package-source linux-libre)) | |
5620 | (build-system gnu-build-system) | |
5621 | (arguments | |
5622 | `(#:tests? #f ; no test suite | |
5623 | #:make-flags | |
5624 | (list (string-append "CC=" ,(cc-for-target)) | |
5625 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
5626 | #:phases | |
5627 | (modify-phases %standard-phases | |
5628 | (add-after 'unpack 'enter-subdirectory | |
5629 | (lambda _ | |
5630 | (chdir "tools/power/x86/turbostat") | |
5631 | #t)) | |
5632 | (delete 'configure)))) ; no configure script | |
5633 | (inputs | |
5634 | `(("libcap" ,libcap))) | |
5635 | (supported-systems '("i686-linux" "x86_64-linux")) | |
5636 | (home-page (package-home-page linux-libre)) | |
5637 | (synopsis "Report x86 processor frequency and idle statistics") | |
5638 | (description | |
5639 | "Turbostat reports x86 processor topology, frequency, idle power state | |
5640 | statistics, temperature, and power consumption. Some information is unavailable | |
5641 | on older processors. | |
5642 | ||
5643 | It can be used to identify machines that are inefficient in terms of power usage | |
5644 | or idle time, report the rate of @acronym{SMI, system management interrupt}s | |
5645 | occurring on the system, or verify the effects of power management tuning. | |
5646 | ||
5647 | @command{turbostat} reads hardware counters but doesn't write to them, so it | |
5648 | won't interfere with the OS or other running processes---including multiple | |
5649 | invocations of itself.") | |
5650 | (license license:gpl2))) | |
5651 | ||
91231156 LC |
5652 | (define-public ntfs-3g |
5653 | (package | |
5654 | (name "ntfs-3g") | |
d8af4f6d | 5655 | (version "2017.3.23") |
91231156 LC |
5656 | (source (origin |
5657 | (method url-fetch) | |
5658 | (uri (string-append "https://tuxera.com/opensource/" | |
5659 | "ntfs-3g_ntfsprogs-" version ".tgz")) | |
6d01a7f4 | 5660 | (patches (search-patches "ntfs-3g-CVE-2019-9755.patch")) |
91231156 LC |
5661 | (sha256 |
5662 | (base32 | |
d8af4f6d | 5663 | "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy")) |
91231156 | 5664 | (modules '((guix build utils))) |
6cbee49d MW |
5665 | (snippet '(begin |
5666 | ;; Install under $prefix. | |
5667 | (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in") | |
5668 | (("/sbin") | |
5669 | "@sbindir@")) | |
5670 | #t)))) | |
91231156 LC |
5671 | (build-system gnu-build-system) |
5672 | (inputs `(("util-linux" ,util-linux) | |
5673 | ("fuse" ,fuse))) ;libuuid | |
5674 | (native-inputs `(("pkg-config" ,pkg-config))) | |
5675 | (arguments | |
f8c15d8f MC |
5676 | '(#:configure-flags (list "--disable-static" |
5677 | "--exec-prefix=${prefix}" | |
91231156 LC |
5678 | "--with-fuse=external" ;use our own FUSE |
5679 | "--enable-mount-helper" | |
5680 | "--enable-posix-acls" | |
91420521 PN |
5681 | "--enable-xattr-mappings") |
5682 | #:phases | |
5683 | (modify-phases %standard-phases | |
5684 | ;; If users install ntfs-3g, they probably want to make it the | |
5685 | ;; default driver as well, so we opt for sensible defaults and link | |
5686 | ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to | |
52beae7b | 5687 | ;; mount NTFS file systems.) |
91420521 PN |
5688 | (add-after 'install 'install-link |
5689 | (lambda* (#:key outputs #:allow-other-keys) | |
5690 | (let* ((out (assoc-ref outputs "out")) | |
5691 | (sbin (string-append out "/sbin"))) | |
5692 | (symlink "mount.ntfs-3g" | |
9922278b MW |
5693 | (string-append sbin "/mount.ntfs"))) |
5694 | #t))))) | |
8bad0c0b | 5695 | (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/") |
91231156 LC |
5696 | (synopsis "Read-write access to NTFS file systems") |
5697 | (description | |
5698 | "NTFS-3G provides read-write access to NTFS file systems, which are | |
5699 | commonly found on Microsoft Windows. It is implemented as a FUSE file system. | |
5700 | The package provides additional NTFS tools.") | |
5701 | (license license:gpl2+))) | |
9b0942c1 | 5702 | |
f8f44dd7 MB |
5703 | (define-public rdma-core |
5704 | (package | |
5705 | (name "rdma-core") | |
c2739c08 | 5706 | (version "33.1") |
f8f44dd7 MB |
5707 | (source (origin |
5708 | (method url-fetch) | |
5709 | (uri (string-append "https://github.com/linux-rdma/rdma-core" | |
5710 | "/releases/download/v" version "/rdma-core-" | |
5711 | version ".tar.gz")) | |
5712 | (sha256 | |
5713 | (base32 | |
c2739c08 | 5714 | "1rah0v9gq9rksqd2c17nmydsxcjz178n7m2y4ricwlf5pq1b2yfi")))) |
f8f44dd7 MB |
5715 | (build-system cmake-build-system) |
5716 | (arguments | |
e68f954e | 5717 | `(#:tests? #f ; no tests |
f8f44dd7 | 5718 | ;; Upstream uses the "ninja" build system and encourage distros |
93af2ac8 | 5719 | ;; to do the same for consistency. |
2b14c60d LC |
5720 | #:configure-flags (list "-GNinja" |
5721 | ||
e68f954e LC |
5722 | (string-append "-DRST2MAN_EXECUTABLE=" |
5723 | (assoc-ref %build-inputs | |
5724 | "python-docutils") | |
37e997bc | 5725 | "/bin/rst2man.py")) |
f8f44dd7 MB |
5726 | #:phases |
5727 | (modify-phases %standard-phases | |
5728 | (replace 'build | |
5729 | (lambda _ | |
8c3101b8 MW |
5730 | (invoke "ninja" |
5731 | "-j" (number->string (parallel-job-count))))) | |
f8f44dd7 MB |
5732 | (replace 'install |
5733 | (lambda _ | |
8c3101b8 | 5734 | (invoke "ninja" "install")))))) |
f8f44dd7 MB |
5735 | (native-inputs |
5736 | `(("ninja" ,ninja) | |
5737 | ("pkg-config" ,pkg-config) | |
e68f954e LC |
5738 | ("python" ,python-wrapper) |
5739 | ("python-docutils" ,python-docutils))) ;for 'rst2man' | |
f8f44dd7 MB |
5740 | (inputs |
5741 | `(("libnl" ,libnl) | |
5742 | ("udev" ,eudev))) | |
5743 | (home-page "https://github.com/linux-rdma/rdma-core") | |
5744 | (synopsis "Utilities and libraries for working with RDMA devices") | |
5745 | (description | |
5746 | "This package provides userspace components for the InfiniBand | |
5747 | subsystem of the Linux kernel. Specifically it contains userspace | |
5748 | libraries for the following device nodes: | |
5749 | ||
5750 | @enumerate | |
5751 | @item @file{/dev/infiniband/uverbsX} (@code{libibverbs}) | |
5752 | @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm}) | |
5753 | @item @file{/dev/infiniband/umadX} (@code{libibumad}) | |
5754 | @end enumerate | |
5755 | ||
5756 | The following service daemons are also provided: | |
5757 | @enumerate | |
5758 | @item @code{srp_daemon} (for the @code{ib_srp} kernel module) | |
5759 | @item @code{iwpmd} (for iWARP kernel providers) | |
5760 | @item @code{ibacm} (for InfiniBand communication management assistant) | |
5761 | @end enumerate") | |
5762 | ;; All library code is dual licensed under GPL2 and a custom MIT | |
5763 | ;; variant. The package also includes some components covered by | |
5764 | ;; other licenses. Consult COPYING.md for full details. | |
5765 | (license | |
5766 | (list license:gpl2 | |
5767 | (license:x11-style "See COPYING.BSD_MIT in the distribution") | |
5768 | license:bsd-2 ; Files referring to COPYING.BSD_FB | |
5769 | license:cc0 ; most files in ccan/ | |
5770 | license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3 | |
5771 | ||
a0a273c1 MG |
5772 | (define-public perftest |
5773 | (package | |
5774 | (name "perftest") | |
50298d4a | 5775 | (version "4.4-0.4") |
a0a273c1 MG |
5776 | (source |
5777 | (origin | |
5778 | (method url-fetch) | |
50298d4a TGR |
5779 | (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v" |
5780 | version "/perftest-" version ".g0927198.tar.gz")) | |
a0a273c1 | 5781 | (sha256 |
50298d4a | 5782 | (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq")))) |
a0a273c1 MG |
5783 | (build-system gnu-build-system) |
5784 | (arguments | |
5785 | `(#:phases | |
5786 | (modify-phases %standard-phases | |
5787 | (add-after 'unpack 'patch-header-paths | |
5788 | (lambda _ | |
5789 | (substitute* '("src/raw_ethernet_fs_rate.c" | |
5790 | "src/raw_ethernet_resources.c" | |
5791 | "src/raw_ethernet_resources.h" | |
5792 | "src/raw_ethernet_send_burst_lat.c" | |
5793 | "src/raw_ethernet_send_bw.c" | |
5794 | "src/raw_ethernet_send_lat.c") | |
5795 | (("/usr/include/netinet/ip.h") "netinet/ip.h")) | |
5796 | #t))))) | |
5797 | (inputs `(("rdma-core" ,rdma-core))) | |
5798 | (home-page "https://github.com/linux-rdma/perftest/") | |
5799 | (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests") | |
5800 | (description "This is a collection of tests written over uverbs intended for | |
5801 | use as a performance micro-benchmark. The tests may be used for hardware or | |
5802 | software tuning as well as for functional testing. | |
5803 | ||
5804 | The collection contains a set of bandwidth and latency benchmark such as: | |
5805 | @enumerate | |
5806 | @item Send - @code{ib_send_bw} and @code{ib_send_lat} | |
5807 | @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat} | |
5808 | @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat} | |
5809 | @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat} | |
5810 | @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat} | |
5811 | @end enumerate") | |
5812 | (license license:gpl2))) | |
5813 | ||
9b0942c1 DC |
5814 | (define-public rng-tools |
5815 | (package | |
5816 | (name "rng-tools") | |
c6b772a0 | 5817 | (home-page "https://github.com/nhorman/rng-tools") |
43ed8953 | 5818 | (version "6.12") |
9b0942c1 | 5819 | (source (origin |
f289820c MB |
5820 | (method git-fetch) |
5821 | (uri (git-reference (url home-page) | |
5822 | (commit (string-append "v" version)))) | |
5823 | (file-name (git-file-name name version)) | |
9b0942c1 DC |
5824 | (sha256 |
5825 | (base32 | |
43ed8953 | 5826 | "0z4j3kqh9k3zsrx6257hwh4fa51vqg79c6dnfrj6lhpcll0wh0hm")))) |
9b0942c1 | 5827 | (build-system gnu-build-system) |
8bc6956b | 5828 | (arguments |
fc66a560 MB |
5829 | `(;; Disable support for various hardware entropy sources as they need |
5830 | ;; dependencies that are not yet in Guix, and would significantly | |
5831 | ;; increase closure size. | |
ae67d70d | 5832 | #:configure-flags '("--without-nistbeacon" |
fc66a560 MB |
5833 | "--without-pkcs11" |
5834 | "--without-rtlsdr"))) | |
8bc6956b LF |
5835 | (native-inputs |
5836 | `(("autoconf" ,autoconf) | |
5837 | ("automake" ,automake) | |
5838 | ("pkg-config" ,pkg-config))) | |
5839 | (inputs | |
fc66a560 MB |
5840 | `(("libsysfs" ,sysfsutils) |
5841 | ("openssl" ,openssl))) | |
9b0942c1 DC |
5842 | (synopsis "Random number generator daemon") |
5843 | (description | |
5844 | "Monitor a hardware random number generator, and supply entropy | |
5845 | from that to the system kernel's @file{/dev/random} machinery.") | |
9b0942c1 DC |
5846 | ;; The source package is offered under the GPL2+, but the files |
5847 | ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2. | |
5848 | (license (list license:gpl2 license:gpl2+)))) | |
58d6a1f2 TGR |
5849 | |
5850 | (define-public cpupower | |
5851 | (package | |
5852 | (name "cpupower") | |
5853 | (version (package-version linux-libre)) | |
5854 | (source (package-source linux-libre)) | |
5855 | (build-system gnu-build-system) | |
5856 | (arguments | |
5857 | '(#:phases (modify-phases %standard-phases | |
5858 | (add-after 'unpack 'enter-subdirectory | |
5859 | (lambda _ | |
9922278b MW |
5860 | (chdir "tools/power/cpupower") |
5861 | #t)) | |
58d6a1f2 TGR |
5862 | (delete 'configure) |
5863 | (add-before 'build 'fix-makefiles | |
5864 | (lambda _ | |
5865 | (substitute* "Makefile" | |
5866 | (("/usr/") "/") | |
5867 | (("/bin/(install|pwd)" _ command) command)) | |
5868 | (substitute* "bench/Makefile" | |
9922278b MW |
5869 | (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")) |
5870 | #t))) | |
58d6a1f2 TGR |
5871 | #:make-flags (let ((out (assoc-ref %outputs "out"))) |
5872 | (list (string-append "DESTDIR=" out) | |
5873 | (string-append "LDFLAGS=-Wl,-rpath=" out "/lib") | |
cd7e6885 | 5874 | "libdir=/lib" |
58d6a1f2 TGR |
5875 | "docdir=/share/doc/cpupower" |
5876 | "confdir=$(docdir)/examples" | |
5877 | ;; The Makefile recommends the following changes | |
5878 | "DEBUG=false" | |
5879 | "PACKAGE_BUGREPORT=bug-guix@gnu.org")) | |
5880 | #:tests? #f)) ;no tests | |
b94a6ca0 | 5881 | (native-inputs `(("gettext" ,gettext-minimal))) |
58d6a1f2 TGR |
5882 | (inputs `(("pciutils" ,pciutils))) |
5883 | (home-page (package-home-page linux-libre)) | |
5884 | (synopsis "CPU frequency and voltage scaling tools for Linux") | |
5885 | (description | |
5886 | "cpupower is a set of user-space tools that use the cpufreq feature of the | |
5887 | Linux kernel to retrieve and control processor features related to power saving, | |
5888 | such as frequency and voltage scaling.") | |
5889 | (license license:gpl2))) | |
2b76f135 | 5890 | |
71bd55cb SS |
5891 | (define-public x86-energy-perf-policy |
5892 | (package | |
5893 | (name "x86-energy-perf-policy") | |
5894 | (version (package-version linux-libre)) | |
5895 | (source (package-source linux-libre)) | |
5896 | (build-system gnu-build-system) | |
5897 | (arguments | |
5898 | '(#:tests? #f | |
5899 | #:phases | |
5900 | (modify-phases %standard-phases | |
5901 | (add-after 'unpack 'enter-subdirectory | |
5902 | (lambda _ | |
5903 | (chdir "tools/power/x86/x86_energy_perf_policy") | |
5904 | #t)) | |
5905 | (delete 'configure) | |
5906 | (add-before 'build 'fix-makefile | |
5907 | (lambda _ | |
5908 | (substitute* "Makefile" (("/usr") "")) | |
5909 | #t))) | |
5910 | #:make-flags | |
5911 | (let ((out (assoc-ref %outputs "out"))) | |
5912 | (list (string-append "DESTDIR=" out) | |
5913 | (string-append "LDFLAGS=-Wl,-rpath=" out "/lib"))))) | |
5914 | (supported-systems '("i686-linux" "x86_64-linux")) | |
5915 | (home-page (package-home-page linux-libre)) | |
5916 | (synopsis "Display and update Intel-CPU energy-performance policy") | |
5917 | (description | |
5918 | "@command{x86_energy_perf_policy} displays and updates energy-performance | |
5919 | policy settings specific to Intel Architecture Processors. Settings are | |
5920 | accessed via Model Specific Register (MSR) updates, no matter if the Linux | |
5921 | cpufreq sub-system is enabled or not.") | |
5922 | (license license:gpl2))) | |
5923 | ||
2b76f135 TGR |
5924 | (define-public haveged |
5925 | (package | |
5926 | (name "haveged") | |
bba6d152 | 5927 | (version "1.9.14") |
2b76f135 TGR |
5928 | (source |
5929 | (origin | |
893c340c TGR |
5930 | (method git-fetch) |
5931 | (uri (git-reference | |
b0e7b699 | 5932 | (url "https://github.com/jirka-h/haveged") |
389cae8b | 5933 | (commit (string-append "v" version)))) |
893c340c | 5934 | (file-name (git-file-name name version)) |
2b76f135 | 5935 | (sha256 |
bba6d152 | 5936 | (base32 "050hmnh5s2s4mb83f4d1fk23mk27pprg840c1aagc6v1sz6x5dhq")))) |
2b76f135 | 5937 | (build-system gnu-build-system) |
6664ec0c | 5938 | (home-page "https://www.issihosts.com/haveged") |
2b76f135 TGR |
5939 | (synopsis "Entropy source for the Linux random number generator") |
5940 | (description | |
5941 | "haveged generates an unpredictable stream of random numbers for use by | |
5942 | Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's | |
5943 | standard mechanisms for filling the entropy pool may not be sufficient for | |
5944 | systems with high needs or limited user interaction, such as headless servers. | |
b71a3488 | 5945 | |
2b76f135 | 5946 | @command{haveged} runs as a privileged daemon, harvesting randomness from the |
8e42b087 TGR |
5947 | indirect effects of hardware events on hidden processor state using the |
5948 | @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm. | |
5949 | It tunes itself to its environment and provides the same built-in test suite | |
5950 | for the output stream as used on certified hardware security devices. | |
4a147986 TGR |
5951 | |
5952 | The quality of the randomness produced by this algorithm has not been proven. | |
5953 | It is recommended to run it together with another entropy source like rngd, and | |
5954 | not as a replacement for it.") | |
2b76f135 TGR |
5955 | (license (list (license:non-copyleft "file://nist/mconf.h") |
5956 | (license:non-copyleft "file://nist/packtest.c") | |
5957 | license:public-domain ; nist/dfft.c | |
5958 | license:gpl3+)))) ; everything else | |
e385e957 TGR |
5959 | |
5960 | (define-public ecryptfs-utils | |
5961 | (package | |
5962 | (name "ecryptfs-utils") | |
5963 | (version "111") | |
5964 | (source | |
5965 | (origin | |
5966 | (method url-fetch) | |
5967 | (uri (string-append "https://launchpad.net/ecryptfs/trunk/" | |
5968 | version "/+download/ecryptfs-utils_" | |
5969 | version ".orig.tar.gz")) | |
5970 | (sha256 | |
5971 | (base32 | |
5972 | "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i")))) | |
5973 | (build-system gnu-build-system) | |
5974 | (arguments | |
17a21bcf BT |
5975 | `(#:configure-flags (list "--disable-pywrap") |
5976 | #:phases | |
5977 | (modify-phases %standard-phases | |
5978 | (add-after 'patch-source-shebangs 'patch-hardcoded-paths | |
5979 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
5980 | (let ((out (assoc-ref outputs "out")) | |
5981 | (utils-linux (assoc-ref inputs "utils-linux")) | |
5982 | (cryptsetup (assoc-ref inputs "cryptsetup")) | |
5983 | (linux-pam (assoc-ref inputs "linux-pam")) | |
5984 | (lvm2 (assoc-ref inputs "lvm2"))) | |
5985 | (substitute* '("src/utils/ecryptfs-mount-private" | |
5986 | "src/utils/ecryptfs-umount-private" | |
5987 | "src/utils/ecryptfs-setup-private" | |
e8ec2dda | 5988 | "src/utils/ecryptfs-setup-swap" |
17a21bcf | 5989 | "src/utils/mount.ecryptfs.c" |
e8ec2dda | 5990 | "src/utils/umount.ecryptfs.c" |
17a21bcf BT |
5991 | "src/pam_ecryptfs/pam_ecryptfs.c" |
5992 | "src/desktop/ecryptfs-mount-private.desktop.in" | |
e8ec2dda | 5993 | "src/desktop/ecryptfs-setup-private.desktop.in") |
17a21bcf BT |
5994 | (("/bin/mount") |
5995 | (string-append utils-linux "/bin/mount")) | |
5996 | (("/bin/umount") | |
5997 | (string-append utils-linux "/bin/umount")) | |
5998 | (("/sbin/mount.ecryptfs_private") | |
5999 | (string-append out "/sbin/mount.ecryptfs_private")) | |
6000 | (("/sbin/umount.ecryptfs_private") | |
6001 | (string-append out "/sbin/umount.ecryptfs_private")) | |
6002 | (("/usr/bin/ecryptfs-mount-private") | |
6003 | (string-append out "/bin/ecryptfs-mount-private")) | |
6004 | (("/usr/bin/ecryptfs-rewrite-file") | |
6005 | (string-append out "/bin/ecryptfs-rewrite-file")) | |
6006 | (("/usr/bin/ecryptfs-setup-private") | |
6007 | (string-append out "/bin/ecryptfs-setup-private")) | |
6008 | (("/sbin/cryptsetup") | |
6009 | (string-append cryptsetup "/sbin/cryptsetup")) | |
6010 | (("/sbin/unix_chkpwd") | |
6011 | (string-append linux-pam "/sbin/unix_chkpwd")) | |
6012 | (("/sbin/dmsetup") | |
6013 | (string-append lvm2 "/sbin/dmsetup"))))))))) | |
e385e957 TGR |
6014 | (native-inputs |
6015 | `(("intltool" ,intltool) | |
6016 | ("perl" ,perl) ; for pod2man | |
6017 | ("pkg-config" ,pkg-config))) | |
6018 | (inputs | |
6019 | `(("keyutils" ,keyutils) | |
6020 | ("linux-pam" ,linux-pam) | |
17a21bcf BT |
6021 | ("utils-linux" ,util-linux) |
6022 | ("cryptsetup" ,cryptsetup) | |
6023 | ("lvm2" ,lvm2) | |
e385e957 | 6024 | ("nss" ,nss))) |
c04cbcf7 | 6025 | (home-page "https://ecryptfs.org/") |
e385e957 TGR |
6026 | (synopsis "eCryptfs cryptographic file system utilities") |
6027 | (description | |
6028 | "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux. | |
6029 | Each file's cryptographic meta-data is stored inside the file itself, along | |
6030 | with the encrypted contents. This allows individual encrypted files to be | |
6031 | copied between hosts and still be decrypted with the proper key. eCryptfs is a | |
6032 | native Linux file system, and has been part of the Linux kernel since version | |
6033 | 2.6.19. This package contains the userland utilities to manage it.") | |
6034 | ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c | |
6035 | ;; grant additional permission to link with OpenSSL. | |
6036 | (license license:gpl2+))) | |
cff0adec DC |
6037 | |
6038 | (define-public libnfsidmap | |
6039 | (package | |
6040 | (name "libnfsidmap") | |
4505369c TGR |
6041 | (version "0.27") |
6042 | (source | |
6043 | (origin | |
6044 | (method url-fetch) | |
6045 | (uri (string-append "https://fedorapeople.org/~steved/" | |
6046 | name "/" version "/" name "-" version ".tar.bz2")) | |
6047 | (sha256 | |
6048 | (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5")))) | |
cff0adec DC |
6049 | (build-system gnu-build-system) |
6050 | (arguments | |
6051 | `(#:configure-flags (list | |
6052 | (string-append "--with-pluginpath=" | |
6053 | (assoc-ref %outputs "out") | |
6054 | "/lib/libnfsidmap")))) | |
4505369c TGR |
6055 | (native-inputs |
6056 | `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader | |
cff0adec DC |
6057 | (home-page |
6058 | "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html") | |
4505369c | 6059 | (synopsis "NFSv4 support library for name/ID mapping") |
cff0adec DC |
6060 | (description "Libnfsidmap is a library holding mulitiple methods of |
6061 | mapping names to ids and visa versa, mainly for NFSv4. It provides an | |
6062 | extensible array of mapping functions, currently consisting of two choices: | |
6063 | the default @code{nsswitch} and the experimental @code{umich_ldap}.") | |
6064 | (license (license:non-copyleft "file://COPYING" | |
6065 | "See COPYING in the distribution.")))) | |
035d3593 DC |
6066 | |
6067 | (define-public module-init-tools | |
6068 | (package | |
6069 | (name "module-init-tools") | |
6070 | (version "3.16") | |
6071 | (source (origin | |
6072 | (method url-fetch) | |
6073 | (uri (string-append | |
6074 | "mirror://kernel.org/linux/utils/kernel/module-init-tools/" | |
6075 | "module-init-tools-" version ".tar.bz2")) | |
6076 | (sha256 | |
6077 | (base32 | |
6078 | "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1")) | |
6079 | (patches (search-patches "module-init-tools-moduledir.patch")))) | |
6080 | (build-system gnu-build-system) | |
6081 | (arguments | |
6082 | ;; FIXME: The upstream tarball lacks man pages, and building them would | |
6083 | ;; require DocBook & co. We used to use Gentoo's pre-built man pages, | |
6084 | ;; but they vanished. In the meantime, fake it. | |
dc1d3cde KK |
6085 | '(#:phases |
6086 | (modify-phases %standard-phases | |
6087 | (add-before 'configure 'fake-docbook | |
6088 | (lambda _ | |
6089 | (substitute* "Makefile.in" | |
6090 | (("^DOCBOOKTOMAN.*$") | |
6091 | "DOCBOOKTOMAN = true\n")) | |
6092 | #t))))) | |
81e59e41 | 6093 | (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/") |
035d3593 DC |
6094 | (synopsis "Tools for loading and managing Linux kernel modules") |
6095 | (description | |
36a4366d EF |
6096 | "Tools for loading and managing Linux kernel modules, such as |
6097 | @code{modprobe}, @code{insmod}, @code{lsmod}, and more.") | |
035d3593 | 6098 | (license license:gpl2+))) |
dd65f3b7 TGR |
6099 | |
6100 | (define-public mcelog | |
6101 | (package | |
6102 | (name "mcelog") | |
a70c0da7 | 6103 | (version "176") |
b226ccf3 TGR |
6104 | (source |
6105 | (origin | |
6106 | (method git-fetch) | |
6107 | (uri (git-reference | |
6108 | (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git") | |
6109 | (commit (string-append "v" version)))) | |
6110 | (file-name (git-file-name name version)) | |
6111 | (sha256 | |
a70c0da7 | 6112 | (base32 "1mlwn6ck9qiwqa2vg5wg1gvfva3jv7ygjr7p7bam0qszajs5pirk")) |
b226ccf3 TGR |
6113 | (modules '((guix build utils))) |
6114 | (snippet | |
6115 | `(begin | |
a70c0da7 | 6116 | ;; The checkout lacks a .git directory, breaking ‘git describe’. |
b226ccf3 TGR |
6117 | (substitute* "Makefile" |
6118 | (("\"unknown\"") (string-append "\"v" ,version "\""))) | |
6119 | #t)))) | |
dd65f3b7 TGR |
6120 | (build-system gnu-build-system) |
6121 | (arguments | |
6122 | `(#:phases (modify-phases %standard-phases | |
6123 | (delete 'configure)) ; no configure script | |
6124 | #:make-flags (let ((out (assoc-ref %outputs "out"))) | |
0463f7d7 | 6125 | (list (string-append "CC=" ,(cc-for-target)) |
dd65f3b7 | 6126 | (string-append "prefix=" out) |
df305cea TGR |
6127 | (string-append "DOCDIR=" out "/share/doc/" |
6128 | ,name "-" ,version) | |
dd65f3b7 TGR |
6129 | "etcprefix=$(DOCDIR)/examples")) |
6130 | ;; The tests will only run as root on certain supported CPU models. | |
6131 | #:tests? #f)) | |
6132 | (supported-systems (list "i686-linux" "x86_64-linux")) | |
71d60b96 | 6133 | (home-page "https://mcelog.org/") |
dd65f3b7 TGR |
6134 | (synopsis "Machine check monitor for x86 Linux systems") |
6135 | (description | |
de382528 TGR |
6136 | "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86 |
6137 | systems running the kernel Linux. It can also perform user-defined tasks, such | |
6138 | as bringing bad pages off-line, when configurable error thresholds are | |
6139 | exceeded.") | |
dd65f3b7 | 6140 | (license license:gpl2))) |
0c60cc53 DM |
6141 | |
6142 | (define-public mtd-utils | |
6143 | (package | |
6144 | (name "mtd-utils") | |
d0ff7e1c | 6145 | (version "2.1.2") |
0c60cc53 DM |
6146 | (source (origin |
6147 | (method url-fetch) | |
6148 | (uri (string-append | |
6149 | "ftp://ftp.infradead.org/pub/mtd-utils/" | |
6150 | "mtd-utils-" version ".tar.bz2")) | |
6151 | (sha256 | |
6152 | (base32 | |
d0ff7e1c | 6153 | "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a")))) |
e8b9aaf0 EF |
6154 | (arguments |
6155 | '(#:configure-flags '("--enable-unit-tests"))) | |
6156 | (native-inputs | |
6157 | `(("cmocka" ,cmocka) | |
6158 | ("pkg-config" ,pkg-config))) | |
0c60cc53 | 6159 | (inputs |
f8f2b048 | 6160 | `(("acl" ,acl) ; extended attributes (xattr) |
bb93042c | 6161 | ("libuuid" ,util-linux "lib") |
c695fb76 | 6162 | ("lzo" ,lzo) |
f8f2b048 | 6163 | ("openssl" ,openssl) ; optional crypto support |
9ea820a5 TGR |
6164 | ("zlib" ,zlib) |
6165 | ("zstd" ,zstd "lib"))) | |
0c60cc53 | 6166 | (build-system gnu-build-system) |
0c60cc53 DM |
6167 | (synopsis "MTD Flash Storage Utilities") |
6168 | (description "This package provides utilities for testing, partitioning, etc | |
6169 | of flash storage.") | |
6170 | (home-page "http://www.linux-mtd.infradead.org/") | |
6171 | (license | |
6172 | (list license:gpl2 ; Almost everything is gpl2 or gpl2+ | |
6173 | license:mpl1.1 ; All ftl* files | |
6174 | license:expat)))) ; libiniparser | |
def6213f LF |
6175 | |
6176 | (define-public libseccomp | |
6177 | (package | |
6178 | (name "libseccomp") | |
1aac30a4 | 6179 | (version "2.5.1") |
def6213f LF |
6180 | (source (origin |
6181 | (method url-fetch) | |
6182 | (uri (string-append "https://github.com/seccomp/libseccomp/" | |
6183 | "releases/download/v" version | |
6184 | "/libseccomp-" version ".tar.gz")) | |
6185 | (sha256 | |
6186 | (base32 | |
1aac30a4 | 6187 | "0m8dlg1v7kflcxvajs4p76p275qwsm2abbf5mfapkakp7hw7wc7f")))) |
def6213f | 6188 | (build-system gnu-build-system) |
819b8b27 | 6189 | (arguments |
7a9a27a0 MB |
6190 | '(#:configure-flags '("--disable-static") |
6191 | #:phases (modify-phases %standard-phases | |
6192 | (add-before 'check 'skip-load-test | |
6193 | (lambda _ | |
6194 | ;; This test does a native system call and fails when | |
6195 | ;; run under QEMU user-mode emulation. Just skip it. | |
6196 | (delete-file "tests/52-basic-load.tests") | |
6197 | #t))))) | |
def6213f | 6198 | (native-inputs |
56a1ffeb MB |
6199 | `(("gperf" ,gperf) |
6200 | ("which" ,which))) | |
def6213f LF |
6201 | (synopsis "Interface to Linux's seccomp syscall filtering mechanism") |
6202 | (description "The libseccomp library provides an easy to use, platform | |
6203 | independent, interface to the Linux Kernel's syscall filtering mechanism. The | |
6204 | libseccomp API is designed to abstract away the underlying BPF based syscall | |
6205 | filter language and present a more conventional function-call based filtering | |
6206 | interface that should be familiar to, and easily adopted by, application | |
6207 | developers.") | |
6208 | (home-page "https://github.com/seccomp/libseccomp") | |
6209 | (license license:lgpl2.1))) | |
58c4f11e TGR |
6210 | |
6211 | (define-public radeontop | |
6212 | (package | |
6213 | (name "radeontop") | |
af2fd7f3 | 6214 | (version "1.3") |
ee861a54 TGR |
6215 | (source |
6216 | (origin | |
6217 | (method git-fetch) | |
6218 | (uri (git-reference | |
b0e7b699 | 6219 | (url "https://github.com/clbr/radeontop") |
ee861a54 TGR |
6220 | (commit (string-append "v" version)))) |
6221 | (file-name (git-file-name name version)) | |
6222 | (sha256 | |
af2fd7f3 | 6223 | (base32 "0ay6vl9zsz9b2scy0fnsy482pzizj52i27syxwny4z4i9wrk2wmn")))) |
58c4f11e TGR |
6224 | (build-system gnu-build-system) |
6225 | (arguments | |
6226 | `(#:phases (modify-phases %standard-phases | |
6227 | ;; getver.sh uses ‘git --describe’, isn't worth an extra git | |
6228 | ;; dependency, and doesn't even work on release(!) tarballs. | |
6229 | (add-after 'unpack 'report-correct-version | |
9922278b MW |
6230 | (lambda _ |
6231 | (substitute* "getver.sh" | |
6232 | (("ver=unknown") | |
6233 | (string-append "ver=" ,version))) | |
6234 | #t)) | |
58c4f11e TGR |
6235 | (delete 'configure)) ; no configure script |
6236 | #:make-flags (list "CC=gcc" | |
6237 | (string-append "PREFIX=" %output)) | |
6238 | #:tests? #f)) ; no tests | |
6239 | (native-inputs | |
7c90d0f4 | 6240 | `(("gettext" ,gettext-minimal) |
58c4f11e TGR |
6241 | ("pkg-config" ,pkg-config))) |
6242 | (inputs | |
6243 | `(("libdrm" ,libdrm) | |
6244 | ("libpciaccess" ,libpciaccess) | |
a7c61512 | 6245 | ("libxcb" ,libxcb) |
58c4f11e | 6246 | ("ncurses" ,ncurses))) |
ee861a54 | 6247 | (home-page "https://github.com/clbr/radeontop/") |
58c4f11e TGR |
6248 | (synopsis "Usage monitor for AMD Radeon graphics") |
6249 | (description "RadeonTop monitors resource consumption on supported AMD | |
6250 | Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on | |
6251 | a terminal or saved to a file for further processing. It measures both the | |
6252 | activity of the GPU as a whole, which is also accurate during OpenCL | |
6253 | computations, as well as separate component statistics that are only meaningful | |
6254 | under OpenGL graphics workloads.") | |
6255 | (license license:gpl3))) | |
0d74462a MB |
6256 | |
6257 | (define-public efivar | |
6258 | (package | |
6259 | (name "efivar") | |
f19dfeeb | 6260 | (version "37") |
0d74462a MB |
6261 | (source (origin |
6262 | (method url-fetch) | |
c6dd2790 | 6263 | (uri (string-append "https://github.com/rhboot/" name |
0d74462a MB |
6264 | "/releases/download/" version "/" name |
6265 | "-" version ".tar.bz2")) | |
657aaa7b | 6266 | (patches (search-patches "efivar-gcc-compat.patch")) |
0d74462a MB |
6267 | (sha256 |
6268 | (base32 | |
657aaa7b MB |
6269 | "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw")) |
6270 | (modules '((guix build utils))) | |
6271 | (snippet | |
6272 | '(begin | |
6273 | ;; Compile everything within a single LTO partition | |
6274 | ;; to work around ordering issues in the code. Try | |
6275 | ;; removing this for versions > 37. | |
6276 | (substitute* "Make.defaults" | |
6277 | (("-flto") | |
6278 | "-flto -flto-partition=one")))))) | |
0d74462a MB |
6279 | (build-system gnu-build-system) |
6280 | (arguments | |
6281 | `(;; Tests require a UEFI system and is not detected in the chroot. | |
6282 | #:tests? #f | |
6283 | #:make-flags (list (string-append "prefix=" %output) | |
6284 | (string-append "libdir=" %output "/lib") | |
657aaa7b | 6285 | (string-append "CC_FOR_BUILD=" ,(cc-for-target)) |
0d74462a MB |
6286 | (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")) |
6287 | #:phases | |
6288 | (modify-phases %standard-phases | |
6388bed7 | 6289 | (delete 'configure)))) |
0d74462a MB |
6290 | (native-inputs |
6291 | `(("pkg-config" ,pkg-config))) | |
6292 | (inputs | |
6293 | `(("popt" ,popt))) | |
c6dd2790 | 6294 | (home-page "https://github.com/rhboot/efivar") |
0d74462a MB |
6295 | (synopsis "Tool and library to manipulate EFI variables") |
6296 | (description "This package provides a library and a command line | |
6297 | interface to the variable facility of UEFI boot firmware.") | |
6298 | (license license:lgpl2.1+))) | |
1581406e MB |
6299 | |
6300 | (define-public efibootmgr | |
6301 | (package | |
6302 | (name "efibootmgr") | |
46cac065 TGR |
6303 | (version "17") |
6304 | (source | |
6305 | (origin | |
6306 | (method git-fetch) | |
6307 | (uri (git-reference | |
6308 | (url "https://github.com/rhinstaller/efibootmgr") | |
6309 | (commit version))) | |
6310 | (file-name (git-file-name name version)) | |
6311 | (sha256 | |
6312 | (base32 "1niicijxg59rsmiw3rsjwy4bvi1n42dynvm01lnp9haixdzdpq03")) | |
6313 | (patches (search-patches "efibootmgr-remove-extra-decl.patch")))) | |
1581406e MB |
6314 | (build-system gnu-build-system) |
6315 | (arguments | |
82e7a51c | 6316 | `(#:tests? #f ;no tests |
1581406e MB |
6317 | #:make-flags (list (string-append "prefix=" %output) |
6318 | (string-append "libdir=" %output "/lib") | |
732825f3 MB |
6319 | ;; EFIDIR denotes a subdirectory relative to the |
6320 | ;; EFI System Partition where the loader will be | |
6321 | ;; installed (known as OS_VENDOR in the code). | |
6322 | ;; GRUB overrides this, as such it's only used if | |
6323 | ;; nothing else is specified on the command line. | |
87d3e94d | 6324 | "EFIDIR=gnu") |
732825f3 | 6325 | #:phases (modify-phases %standard-phases (delete 'configure)))) |
1581406e MB |
6326 | (native-inputs |
6327 | `(("pkg-config" ,pkg-config))) | |
6328 | (inputs | |
6329 | `(("efivar" ,efivar) | |
6330 | ("popt" ,popt))) | |
6331 | (home-page "https://github.com/rhinstaller/efibootmgr") | |
6332 | (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager") | |
6333 | (description | |
6334 | "@code{efibootmgr} is a user-space application to modify the Intel | |
6335 | Extensible Firmware Interface (EFI) Boot Manager. This application can | |
6336 | create and destroy boot entries, change the boot order, change the next | |
6337 | running boot option, and more.") | |
6338 | (license license:gpl2+))) | |
6d3e08d4 LF |
6339 | |
6340 | (define-public sysstat | |
6341 | (package | |
6342 | (name "sysstat") | |
8a69ae0c | 6343 | (version "12.4.3") |
cf492cd4 TGR |
6344 | (source |
6345 | (origin | |
6346 | (method url-fetch) | |
6347 | (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/" | |
6348 | "sysstat-" version ".tar.xz")) | |
6349 | (sha256 | |
8a69ae0c | 6350 | (base32 "1z8bdyj92q0capbrdscwzb51bqh54ng15gpvmjmvrb2syhqj8hxf")))) |
6d3e08d4 LF |
6351 | (build-system gnu-build-system) |
6352 | (arguments | |
eb86a442 | 6353 | `(#:tests? #f ; no test suite. |
6d3e08d4 LF |
6354 | ;; Without this flag, it tries to install the man pages with group 'root' |
6355 | ;; and fails because /etc/passwd lacks an entry for the root user. | |
6356 | #:configure-flags | |
6357 | (list "--disable-file-attr" | |
6358 | (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc")) | |
6359 | #:phases | |
6360 | (modify-phases %standard-phases | |
6361 | ;; The build process tries to create '/var/lib/sa', so we skip that | |
6362 | ;; instruction. | |
6363 | (add-after 'build 'skip-touching-var | |
6364 | (lambda _ | |
6365 | (substitute* "Makefile" | |
6366 | (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)") | |
6367 | "")) | |
6368 | #t))))) | |
6369 | (home-page "http://sebastien.godard.pagesperso-orange.fr/") | |
6370 | (synopsis "Performance monitoring tools for Linux") | |
6371 | (description "The sysstat utilities are a collection of performance | |
6372 | monitoring tools for Linux. These include @code{mpstat}, @code{iostat}, | |
6373 | @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc}, | |
6374 | @code{sadf} and @code{sa}.") | |
6375 | (license license:gpl2+))) | |
01be4f93 JMSG |
6376 | |
6377 | (define-public light | |
6378 | (package | |
6379 | (name "light") | |
e3fdc019 | 6380 | (version "1.2.2") |
664cb939 TGR |
6381 | (source |
6382 | (origin | |
6383 | (method git-fetch) | |
6384 | (uri (git-reference | |
b0e7b699 | 6385 | (url "https://github.com/haikarainen/light") |
664cb939 TGR |
6386 | (commit (string-append "v" version)))) |
6387 | (sha256 | |
e3fdc019 | 6388 | (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s")) |
664cb939 | 6389 | (file-name (git-file-name name version)))) |
01be4f93 | 6390 | (build-system gnu-build-system) |
fcb510c5 AB |
6391 | (arguments |
6392 | `(#:phases | |
6393 | (modify-phases %standard-phases | |
6394 | (add-after 'unpack 'patch-udev-rules-absolute-path-bins | |
6395 | (lambda* (#:key inputs #:allow-other-keys) | |
6396 | (substitute* "90-backlight.rules" | |
6397 | (("/bin/chgrp") (which "chgrp")) | |
6398 | (("/bin/chmod") (which "chmod"))) | |
6399 | #t)) | |
6400 | (add-after 'install 'install-udev-rules | |
6401 | (lambda* (#:key outputs #:allow-other-keys) | |
6402 | (let ((out (assoc-ref outputs "out"))) | |
6403 | (install-file | |
6404 | "90-backlight.rules" (string-append out "/lib/udev/rules.d")) | |
6405 | #t)))))) | |
01be4f93 | 6406 | (native-inputs |
ff598353 PL |
6407 | `(("autoconf" ,autoconf) |
6408 | ("automake" ,automake))) | |
6409 | (home-page "https://haikarainen.github.io/light/") | |
01be4f93 JMSG |
6410 | (synopsis "GNU/Linux application to control backlights") |
6411 | (description | |
6412 | "Light is a program to send commands to screen backlight controllers | |
6413 | under GNU/Linux. Features include: | |
6414 | ||
6415 | @itemize | |
6416 | @item It does not rely on X. | |
6417 | @item Light can automatically figure out the best controller to use, making | |
6418 | full use of underlying hardware. | |
6419 | @item It is possible to set a minimum brightness value, as some controllers | |
7230f6d5 TGR |
6420 | set the screen to be pitch black at a value of 0 (or higher). |
6421 | @end itemize\n") | |
01be4f93 | 6422 | (license license:gpl3+))) |
189d8422 | 6423 | |
ab7f1eb9 | 6424 | (define-public brightnessctl |
ae52ff1b MB |
6425 | (package |
6426 | (name "brightnessctl") | |
6427 | (version "0.5.1") | |
6428 | (home-page "https://github.com/Hummer12007/brightnessctl") | |
6429 | (source (origin | |
6430 | (method git-fetch) | |
6431 | (uri (git-reference (url home-page) (commit version))) | |
6432 | (file-name (git-file-name name version)) | |
6433 | (sha256 | |
6434 | (base32 | |
db87a223 BW |
6435 | "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq")) |
6436 | (patches (search-patches "brightnessctl-elogind-support.patch")))) | |
ae52ff1b MB |
6437 | (build-system gnu-build-system) |
6438 | (arguments | |
6439 | `(#:tests? #f ; no tests | |
6440 | #:make-flags (list (string-append "CC=" ,(cc-for-target)) | |
6441 | (string-append "PREFIX=" %output) | |
db87a223 BW |
6442 | (string-append "UDEVDIR=" %output "/lib/udev/rules.d/") |
6443 | "ENABLE_SYSTEMD=1") | |
ae52ff1b MB |
6444 | #:phases |
6445 | (modify-phases %standard-phases | |
6446 | (delete 'configure) | |
6447 | (add-after 'unpack 'adjust-udev-rules | |
6448 | (lambda _ | |
6449 | (substitute* "90-brightnessctl.rules" | |
6450 | (("/bin/") "/run/current-system/profile/bin/")) | |
6451 | #t))))) | |
db87a223 BW |
6452 | (native-inputs |
6453 | `(("pkg-config" ,pkg-config))) | |
6454 | (inputs | |
6455 | `(("elogind" ,elogind))) | |
ae52ff1b MB |
6456 | (synopsis "Backlight and LED brightness control") |
6457 | (description | |
6458 | "This program allows you read and control device brightness. Devices | |
ab7f1eb9 VC |
6459 | include backlight and LEDs. It can also preserve current brightness before |
6460 | applying the operation, such as on lid close. | |
6461 | ||
6462 | The appropriate permissions must be set on the backlight or LED control | |
6463 | interface in sysfs, which can be accomplished with the included udev rules.") | |
ae52ff1b | 6464 | (license license:expat))) |
ab7f1eb9 | 6465 | |
c7adafa7 MO |
6466 | (define-public tlp |
6467 | (package | |
6468 | (name "tlp") | |
0d4e780e | 6469 | (version "1.3.1") |
8a890f3c NG |
6470 | (source |
6471 | (origin | |
0d4e780e NG |
6472 | (method git-fetch) |
6473 | (uri (git-reference | |
b0e7b699 | 6474 | (url "https://github.com/linrunner/TLP") |
0d4e780e NG |
6475 | (commit version))) |
6476 | (file-name (git-file-name name version)) | |
8a890f3c | 6477 | (sha256 |
0d4e780e | 6478 | (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5")))) |
8a890f3c NG |
6479 | (native-inputs |
6480 | `(("shellcheck" ,shellcheck))) | |
6481 | (inputs | |
6482 | `(("bash" ,bash) | |
6483 | ("dbus" ,dbus) | |
6484 | ("ethtool" ,ethtool) | |
6485 | ("eudev" ,eudev) | |
6486 | ("grep" ,grep) | |
6487 | ("hdparm" ,hdparm) | |
6488 | ("inetutils" ,inetutils) | |
6489 | ("iw" ,iw) | |
6490 | ("kmod" ,kmod) | |
6491 | ("pciutils" ,pciutils) | |
6492 | ("perl" ,perl) | |
6493 | ("rfkill" ,rfkill) | |
6494 | ("sed" ,sed) | |
6495 | ("usbutils" ,usbutils) | |
6496 | ("util-linux" ,util-linux) | |
6497 | ("wireless-tools" ,wireless-tools) | |
6498 | ,@(if (let ((system (or (%current-target-system) | |
6499 | (%current-system)))) | |
6500 | (or (string-prefix? "i686-" system) | |
6501 | (string-prefix? "x86_64-" system))) | |
6502 | `(("x86-energy-perf-policy" ,x86-energy-perf-policy)) | |
6503 | '()))) | |
c7adafa7 MO |
6504 | (build-system gnu-build-system) |
6505 | (arguments | |
8a890f3c NG |
6506 | ;; XXX: The full test suite is run with "checkall" but it requires |
6507 | ;; "checkbashisms" and "perlcritic", not yet packaged in Guix. | |
6508 | `(#:test-target "shellcheck" | |
6509 | #:modules ((guix build gnu-build-system) | |
cf342a85 SS |
6510 | (guix build utils) |
6511 | (srfi srfi-1)) | |
6512 | #:phases | |
c7adafa7 | 6513 | (modify-phases %standard-phases |
cef3f146 | 6514 | (delete 'configure) ; no configure script |
c7adafa7 MO |
6515 | (add-before 'build 'setenv |
6516 | (lambda* (#:key outputs #:allow-other-keys) | |
6517 | (let ((out (assoc-ref outputs "out"))) | |
6518 | (setenv "TLP_WITH_SYSTEMD" "0") | |
6519 | (setenv "TLP_NO_INIT" "1") | |
6520 | (setenv "TLP_NO_PMUTILS" "1") | |
6521 | (setenv "TLP_SBIN" (string-append out "/bin")) | |
6522 | (setenv "TLP_BIN" (string-append out "/bin")) | |
c6e775a8 NG |
6523 | (setenv "TLP_TLIB" (string-append out "/share/tlp")) |
6524 | (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d")) | |
c7adafa7 | 6525 | (setenv "TLP_ULIB" (string-append out "/lib/udev")) |
8a890f3c NG |
6526 | (setenv "TLP_CONFDEF" |
6527 | (string-append out "/share/tlp/defaults.conf")) | |
6528 | (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d")) | |
5d51a977 NG |
6529 | (setenv "TLP_ELOD" |
6530 | (string-append out "/lib/elogind/system-sleep")) | |
c7adafa7 MO |
6531 | (setenv "TLP_SHCPL" |
6532 | (string-append out "/share/bash-completion/completions")) | |
6db6c3a9 | 6533 | (setenv "TLP_MAN" (string-append out "/share/man")) |
272fc9dc TGR |
6534 | (setenv "TLP_META" (string-append out "/share/metainfo")) |
6535 | #t))) | |
cef3f146 TGR |
6536 | (add-before 'install 'fix-installation |
6537 | (lambda _ | |
6538 | ;; Stop the Makefile from trying to create system directories. | |
5d51a977 | 6539 | (substitute* "Makefile" |
8a890f3c | 6540 | (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#") |
5d51a977 | 6541 | (("install -d -m 755 \\$\\(_VAR\\)") "#")) |
272fc9dc | 6542 | #t)) |
c7adafa7 | 6543 | (replace 'install |
8a890f3c | 6544 | (lambda _ (invoke "make" "install-tlp" "install-man-tlp"))) |
c7adafa7 MO |
6545 | (add-after 'install 'wrap |
6546 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
6547 | (let* ((bin (string-append (assoc-ref outputs "out") "/bin")) | |
6548 | (bin-files (find-files bin ".*"))) | |
6549 | (define (bin-directory input-name) | |
cf342a85 SS |
6550 | (let ((p (assoc-ref inputs input-name))) |
6551 | (and p (string-append p "/bin")))) | |
c7adafa7 MO |
6552 | (define (sbin-directory input-name) |
6553 | (string-append (assoc-ref inputs input-name) "/sbin")) | |
6554 | (for-each (lambda (program) | |
6555 | (wrap-program program | |
6556 | `("PATH" ":" prefix | |
6557 | ,(append | |
cf342a85 SS |
6558 | (filter-map bin-directory |
6559 | '("bash" | |
6560 | "coreutils" | |
6561 | "dbus" | |
6562 | "eudev" | |
6563 | "grep" | |
6564 | "inetutils" | |
6565 | "kmod" | |
6566 | "perl" | |
6567 | "sed" | |
6568 | "usbutils" | |
6569 | "util-linux" | |
6570 | "x86-energy-perf-policy")) | |
6571 | (filter-map sbin-directory | |
6572 | '("ethtool" | |
6573 | "hdparm" | |
6574 | "iw" | |
6575 | "pciutils" | |
6576 | "rfkill" | |
6577 | "wireless-tools")))))) | |
272fc9dc TGR |
6578 | bin-files) |
6579 | #t)))))) | |
e4c60dcf | 6580 | (home-page "https://linrunner.de/en/tlp/tlp.html") |
c7adafa7 MO |
6581 | (synopsis "Power management tool for Linux") |
6582 | (description "TLP is a power management tool for Linux. It comes with | |
6583 | a default configuration already optimized for battery life. Nevertheless, | |
6584 | TLP is customizable to fulfil system requirements. TLP settings are applied | |
6585 | every time the power supply source is changed.") | |
c7adafa7 MO |
6586 | ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the |
6587 | ;; rest is GPLv2+. | |
6588 | (license (list license:gpl2+ license:gpl3+)))) | |
6589 | ||
189d8422 BG |
6590 | (define-public lshw |
6591 | (package | |
6592 | (name "lshw") | |
5cdb0f4a | 6593 | (version "B.02.19.2") |
189d8422 BG |
6594 | (source (origin |
6595 | (method url-fetch) | |
6596 | (uri (string-append "https://www.ezix.org/software/" | |
6597 | "files/lshw-" version | |
6598 | ".tar.gz")) | |
6599 | (sha256 | |
6600 | (base32 | |
5cdb0f4a | 6601 | "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv")))) |
189d8422 BG |
6602 | (build-system gnu-build-system) |
6603 | (arguments | |
6604 | `(#:phases (modify-phases %standard-phases (delete 'configure)) | |
6605 | #:tests? #f ; no tests | |
6606 | #:make-flags | |
6607 | (list (string-append "PREFIX=" (assoc-ref %outputs "out"))))) | |
6608 | (synopsis "List hardware information") | |
6609 | (description | |
6610 | "@command{lshw} (Hardware Lister) is a small tool to provide | |
6611 | detailed information on the hardware configuration of the machine. | |
6612 | It can report exact memory configuration, firmware version, mainboard | |
6613 | configuration, CPU version and speed, cache configuration, bus speed, | |
6614 | and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC | |
6615 | machines (PowerMac G4 is known to work).") | |
6616 | (home-page "https://www.ezix.org/project/wiki/HardwareLiSter") | |
6617 | (license license:gpl2+))) | |
2f4a58b5 LF |
6618 | |
6619 | (define-public libmnl | |
6620 | (package | |
6621 | (name "libmnl") | |
6622 | (version "1.0.4") | |
6623 | (source | |
6624 | (origin | |
6625 | (method url-fetch) | |
f11ae44f | 6626 | (uri (string-append "mirror://netfilter.org/libmnl/" |
2f4a58b5 LF |
6627 | "libmnl-" version ".tar.bz2")) |
6628 | (sha256 | |
6629 | (base32 | |
6630 | "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp")))) | |
6631 | (build-system gnu-build-system) | |
6632 | (home-page "https://www.netfilter.org/projects/libmnl/") | |
6633 | (synopsis "Netlink utility library") | |
6634 | (description "Libmnl is a minimalistic user-space library oriented to | |
6635 | Netlink developers. There are a lot of common tasks in parsing, validating, | |
6636 | constructing of both the Netlink header and TLVs that are repetitive and easy to | |
6637 | get wrong. This library aims to provide simple helpers that allows you to | |
6638 | re-use code and to avoid re-inventing the wheel.") | |
6639 | (license license:lgpl2.1+))) | |
b754c612 LF |
6640 | |
6641 | (define-public libnftnl | |
6642 | (package | |
6643 | (name "libnftnl") | |
cedcab1d | 6644 | (version "1.2.0") |
b754c612 | 6645 | (source |
e569c772 TGR |
6646 | (origin |
6647 | (method url-fetch) | |
6648 | (uri (string-append "mirror://netfilter.org/libnftnl/" | |
6649 | "libnftnl-" version ".tar.bz2")) | |
6650 | (sha256 | |
cedcab1d | 6651 | (base32 "1xblq1cbcxhr6qmjpy98i1qdza148idgz99vbhjc7s4vzvfizc4h")))) |
b754c612 LF |
6652 | (build-system gnu-build-system) |
6653 | (native-inputs | |
6654 | `(("pkg-config" ,pkg-config))) | |
6655 | (inputs | |
6656 | `(("libmnl" ,libmnl))) | |
6657 | (home-page "https://www.netfilter.org/projects/libnftnl/index.html") | |
6658 | (synopsis "Netlink programming interface to the Linux nf_tables subsystem") | |
6659 | (description "Libnftnl is a userspace library providing a low-level netlink | |
6660 | programming interface to the in-kernel nf_tables subsystem. The library | |
6661 | libnftnl has been previously known as libnftables. This library is currently | |
6662 | used by nftables.") | |
6663 | (license license:gpl2+))) | |
62b28c0e | 6664 | |
dfe93c9a RH |
6665 | (define-public nftables |
6666 | (package | |
6667 | (name "nftables") | |
e2d3f8d4 | 6668 | (version "0.9.9") |
dfe93c9a RH |
6669 | (source |
6670 | (origin | |
6671 | (method url-fetch) | |
e221e9a7 TGR |
6672 | (uri (list (string-append "mirror://netfilter.org/nftables/nftables-" |
6673 | version ".tar.bz2") | |
6674 | (string-append "https://www.nftables.org/projects/nftables" | |
6675 | "/files/nftables-" version ".tar.bz2"))) | |
dfe93c9a | 6676 | (sha256 |
e2d3f8d4 | 6677 | (base32 "1d7iwc8xlyfsbgn6qx1sdfcq7jhpl8wpfj39hcd06y8dzp3jvvvn")))) |
dfe93c9a | 6678 | (build-system gnu-build-system) |
9cb4bda2 RH |
6679 | (arguments `(#:configure-flags |
6680 | '("--disable-man-doc"))) ; FIXME: Needs docbook2x. | |
5450e301 | 6681 | (inputs `(("gmp" ,gmp) |
c695fb76 TGR |
6682 | ("libmnl" ,libmnl) |
6683 | ("libnftnl" ,libnftnl) | |
6684 | ("readline" ,readline))) | |
5450e301 VL |
6685 | (native-inputs `(("pkg-config" ,pkg-config) |
6686 | ("bison" ,bison) | |
6687 | ("flex" ,flex))) | |
4a27b0f1 | 6688 | (home-page "https://www.nftables.org") |
dfe93c9a RH |
6689 | (synopsis "Userspace utility for Linux packet filtering") |
6690 | (description "nftables is the project that aims to replace the existing | |
6691 | {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet | |
6692 | filtering framework, a new userspace utility and also a compatibility layer for | |
6693 | {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter | |
6694 | infrastructure such as the existing hooks, the connection tracking system, the | |
6695 | userspace queueing component and the logging subsystem.") | |
6696 | (license license:gpl2))) | |
6697 | ||
62b28c0e LC |
6698 | (define-public proot |
6699 | (package | |
6700 | (name "proot") | |
6701 | (version "5.1.0") | |
674495b7 TGR |
6702 | (source |
6703 | (origin | |
6704 | (method git-fetch) | |
6705 | (uri (git-reference | |
b0e7b699 | 6706 | (url "https://github.com/proot-me/PRoot") |
674495b7 TGR |
6707 | (commit (string-append "v" version)))) |
6708 | (file-name (git-file-name name version)) | |
6709 | (sha256 | |
6710 | (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz")) | |
6711 | (patches (search-patches "proot-test-fhs.patch")))) | |
62b28c0e LC |
6712 | (build-system gnu-build-system) |
6713 | (arguments | |
6714 | '(#:make-flags '("-C" "src") | |
6715 | ||
6716 | #:phases (modify-phases %standard-phases | |
6717 | (delete 'configure) | |
6718 | (add-before 'build 'set-shell-file-name | |
6719 | (lambda* (#:key inputs #:allow-other-keys) | |
6720 | (substitute* (find-files "src" "\\.[ch]$") | |
6721 | (("\"/bin/sh\"") | |
6722 | (string-append "\"" | |
6723 | (assoc-ref inputs "bash") | |
6724 | "/bin/sh\""))) | |
6725 | #t)) | |
6726 | (add-before 'check 'fix-fhs-assumptions-in-tests | |
6727 | (lambda _ | |
6728 | (substitute* "tests/test-c6b77b77.mk" | |
6729 | (("/bin/bash") (which "bash")) | |
6730 | (("/usr/bin/test") (which "test"))) | |
6731 | (substitute* '("tests/test-16573e73.c") | |
6732 | (("/bin/([a-z-]+)" _ program) | |
6733 | (which program))) | |
6734 | ||
6735 | (substitute* (find-files "tests" "\\.sh$") | |
6736 | ;; Some of the tests try to "bind-mount" /bin/true. | |
6737 | (("-b /bin/true:") | |
6738 | (string-append "-b " (which "true") ":")) | |
6739 | ;; Likewise for /bin. | |
6740 | (("-b /bin:") "-b /gnu:") | |
6741 | ;; Others try to run /bin/sh. | |
6742 | (("/bin/sh") (which "sh")) | |
6743 | ;; Others assume /etc/fstab exists. | |
6744 | (("/etc/fstab") "/etc/passwd")) | |
6745 | ||
6746 | (substitute* "tests/GNUmakefile" | |
6747 | (("-b /bin:") "-b /gnu:")) | |
6748 | ||
6749 | ;; XXX: This test fails in an obscure corner case, just | |
6750 | ;; skip it. | |
6751 | (delete-file "tests/test-kkkkkkkk.c") | |
6752 | ||
6753 | #t)) | |
6754 | (replace 'check | |
6755 | (lambda _ | |
6756 | (let ((n (parallel-job-count))) | |
6757 | ;; For some reason we get lots of segfaults with | |
6758 | ;; seccomp support (x86_64, Linux-libre 4.11.0). | |
6759 | (setenv "PROOT_NO_SECCOMP" "1") | |
6760 | ||
6761 | ;; Most of the tests expect "/bin" to be in $PATH so | |
6762 | ;; they can run things that live in $ROOTFS/bin. | |
6763 | (setenv "PATH" | |
6764 | (string-append (getenv "PATH") ":/bin")) | |
6765 | ||
06153a30 MW |
6766 | (invoke "make" "check" "-C" "tests" |
6767 | ;;"V=1" | |
6768 | "-j" (number->string n))))) | |
62b28c0e LC |
6769 | (replace 'install |
6770 | (lambda* (#:key outputs #:allow-other-keys) | |
6771 | ;; The 'install' rule does nearly nothing. | |
06153a30 MW |
6772 | (let* ((out (assoc-ref outputs "out")) |
6773 | (man1 (string-append out "/share/man/man1"))) | |
6774 | ;; TODO: 'make install-care' (does not even | |
6775 | ;; build currently.) | |
6776 | (invoke "make" "-C" "src" "install" | |
6777 | (string-append "PREFIX=" out)) | |
6778 | ||
6779 | (mkdir-p man1) | |
6780 | (copy-file "doc/proot/man.1" | |
6781 | (string-append man1 "/proot.1")) | |
6782 | #t)))))) | |
62b28c0e LC |
6783 | (native-inputs `(("which" ,which) |
6784 | ||
6785 | ;; For 'mcookie', used by some of the tests. | |
cef0e08c LC |
6786 | ("util-linux" ,util-linux) |
6787 | ||
6788 | ;; XXX: Choose the old coreutils because its 'stat' | |
6789 | ;; program does not use statx(2) when running 'stat -c | |
6790 | ;; %a' or similar, which PRoot doesn't properly support. | |
6791 | ("coreutils-old" ,coreutils-8.30) | |
6792 | ||
6793 | ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads | |
6794 | ;; make 4.3 to segfault. | |
6795 | ("make-old" ,gnu-make-4.2))) | |
62b28c0e | 6796 | (inputs `(("talloc" ,talloc))) |
674495b7 | 6797 | (home-page "https://github.com/proot-me/PRoot") |
62b28c0e LC |
6798 | (synopsis "Unprivileged chroot, bind mount, and binfmt_misc") |
6799 | (description | |
6800 | "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind}, | |
6801 | and @code{binfmt_misc}. This means that users don't need any privileges or | |
6802 | setup to do things like using an arbitrary directory as the new root | |
162a1374 | 6803 | file system, making files accessible somewhere else in the file system |
62b28c0e LC |
6804 | hierarchy, or executing programs built for another CPU architecture |
6805 | transparently through QEMU user-mode. Also, developers can use PRoot as a | |
6806 | generic process instrumentation engine thanks to its extension mechanism. | |
6807 | Technically PRoot relies on @code{ptrace}, an unprivileged system-call | |
6808 | available in the kernel Linux.") | |
6809 | (license license:gpl2+))) | |
b9048a14 LC |
6810 | |
6811 | (define-public proot-static | |
6812 | (package | |
6813 | (inherit proot) | |
6814 | (name "proot-static") | |
6815 | (synopsis | |
6816 | "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)") | |
6817 | (inputs `(("talloc" ,talloc/static))) | |
6818 | (arguments | |
6819 | (substitute-keyword-arguments (package-arguments proot) | |
6820 | ((#:make-flags flags) | |
6821 | `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags)) | |
6822 | ((#:phases phases) | |
6823 | `(modify-phases ,phases | |
6824 | (add-after 'strip 'remove-store-references | |
6825 | (lambda* (#:key outputs #:allow-other-keys) | |
6826 | (let* ((out (assoc-ref outputs "out"))) | |
6827 | (with-directory-excursion out | |
6828 | (remove-store-references "bin/proot") | |
6829 | #t)))))) | |
6830 | ((#:allowed-references _ '("out")) | |
6831 | '("out")))))) | |
1113386b CL |
6832 | |
6833 | (define-public cpuid | |
6834 | (package | |
6835 | (name "cpuid") | |
ea36db33 | 6836 | (version "20201006") |
1113386b CL |
6837 | (source (origin |
6838 | (method url-fetch) | |
6839 | (uri (string-append "http://www.etallen.com/cpuid/cpuid-" | |
6840 | version ".src.tar.gz")) | |
6841 | (sha256 | |
6842 | (base32 | |
ea36db33 | 6843 | "19jnkh57f979b78ak5mpxmdvnkgc33r55cw9shgd2hc380b3zi8k")))) |
1113386b CL |
6844 | (build-system gnu-build-system) |
6845 | (arguments | |
7f73ca75 | 6846 | `(#:make-flags |
2bfe99b1 | 6847 | (list (string-append "CC=" ,(cc-for-target))) |
fb9232d7 | 6848 | #:tests? #f ; no tests |
1113386b | 6849 | #:phases (modify-phases %standard-phases |
fb9232d7 | 6850 | (delete 'configure) ; no configure script |
1113386b CL |
6851 | (add-before 'install 'fix-makefile |
6852 | (lambda* (#:key outputs #:allow-other-keys) | |
6853 | (substitute* "Makefile" | |
6854 | (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out"))) | |
6855 | ;; Make the compressed manpages writable so that the | |
6856 | ;; reset-gzip-timestamps phase does not error out. | |
6857 | (substitute* "Makefile" | |
6858 | (("-m 444") "-m 644")) | |
6859 | #t))))) | |
6860 | (inputs `(("perl" ,perl))) | |
6861 | (supported-systems '("i686-linux" "x86_64-linux")) | |
6862 | (home-page "http://www.etallen.com/cpuid.html") | |
6863 | (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)") | |
6864 | (description "cpuid dumps detailed information about the CPU(s) gathered | |
6865 | from the CPUID instruction, and also determines the exact model of CPU(s). It | |
6866 | supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC, | |
6867 | NexGen, Rise, and SiS CPUs.") | |
6868 | (license license:gpl2+))) | |
afc9d8ec LF |
6869 | |
6870 | (define-public jmtpfs | |
6871 | (package | |
6872 | (name "jmtpfs") | |
6873 | (version "0.5") | |
6874 | (source | |
6875 | (origin | |
d5c0b3fa EF |
6876 | (method git-fetch) |
6877 | (uri (git-reference | |
6878 | (url "https://github.com/JasonFerrara/jmtpfs") | |
6879 | (commit (string-append "v" version)))) | |
6880 | (file-name (git-file-name name version)) | |
afc9d8ec LF |
6881 | (sha256 |
6882 | (base32 | |
d5c0b3fa | 6883 | "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1")))) |
afc9d8ec LF |
6884 | (build-system gnu-build-system) |
6885 | (inputs | |
6886 | `(("file" ,file) | |
6887 | ("fuse" ,fuse) | |
6888 | ("libmtp" ,libmtp))) | |
6889 | (native-inputs | |
6890 | `(("pkg-config" ,pkg-config))) | |
6891 | (home-page "https://github.com/JasonFerrara/jmtpfs") | |
162a1374 TGR |
6892 | (synopsis "Use a FUSE file system to access data over MTP") |
6893 | (description "jmtpfs uses FUSE (file system in userspace) to provide access | |
afc9d8ec | 6894 | to data over the Media Transfer Protocol (MTP). Unprivileged users can mount |
162a1374 | 6895 | the MTP device as a file system.") |
afc9d8ec | 6896 | (license license:gpl3))) |
a73e7dd3 DL |
6897 | |
6898 | (define-public procenv | |
6899 | (package | |
6900 | (name "procenv") | |
3dc1c428 | 6901 | (version "0.55") |
a73e7dd3 DL |
6902 | (source |
6903 | (origin | |
cfaf5bcc EF |
6904 | (method git-fetch) |
6905 | (uri (git-reference | |
6906 | (url "https://github.com/jamesodhunt/procenv") | |
6907 | (commit version))) | |
6908 | (file-name (git-file-name name version)) | |
a73e7dd3 | 6909 | (sha256 |
3dc1c428 | 6910 | (base32 "13fnr4gfj2xlxghw93m5gsxzlwzv3s6jv9hja0w0pb23hlncbmhy")))) |
a73e7dd3 | 6911 | (build-system gnu-build-system) |
edce3b95 MB |
6912 | (native-inputs |
6913 | `(("pkg-config" ,pkg-config) | |
6914 | ||
6915 | ;; For tests. | |
6916 | ("check" ,check) | |
6917 | ("groff" ,groff))) | |
6918 | (inputs | |
6919 | `(("expat" ,expat) | |
6920 | ("libcap" ,libcap) | |
6921 | ("libselinux" ,libselinux))) | |
a73e7dd3 DL |
6922 | (synopsis "Utility to show process environment") |
6923 | (description "Procenv is a command-line tool that displays as much detail about | |
6924 | itself and its environment as possible. It can be used as a test | |
6925 | tool, to understand the type of environment a process runs in, and for | |
6926 | comparing system environments.") | |
702a1012 | 6927 | (home-page "https://github.com/jamesodhunt/procenv/") |
a73e7dd3 | 6928 | (license license:gpl3+))) |
ae5947b0 DL |
6929 | |
6930 | (define-public libfabric | |
6931 | (package | |
6932 | (name "libfabric") | |
aa108f27 | 6933 | (version "1.11.2") |
ae5947b0 DL |
6934 | (source |
6935 | (origin | |
6936 | (method url-fetch) | |
6937 | (uri | |
6938 | (string-append "https://github.com/ofiwg/libfabric/releases/download/v" | |
6939 | version "/libfabric-" version ".tar.bz2")) | |
6940 | (sha256 | |
aa108f27 | 6941 | (base32 "1nnpfkwxhim2nqjkb1vwrb4wj4j3l6w6yvvy69fqam2snlhshazz")))) |
ae5947b0 DL |
6942 | (build-system gnu-build-system) |
6943 | (inputs `(("rdma-core" ,rdma-core) | |
91298042 EF |
6944 | ,@(match (%current-system) |
6945 | ((member (package-supported-systems psm)) | |
6946 | `(("psm" ,psm))) | |
6947 | (_ `())) | |
ae5947b0 DL |
6948 | ("libnl" ,libnl))) |
6949 | (home-page "https://ofiwg.github.io/libfabric/") | |
6950 | (synopsis "Open Fabric Interfaces") | |
6951 | (description | |
6952 | "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric | |
6953 | communication services to applications. OFI is best described as a collection | |
6954 | of libraries and applications used to export fabric services. The key | |
6955 | components of OFI are: application interfaces, provider libraries, kernel | |
6956 | services, daemons, and test applications. | |
6957 | ||
6958 | Libfabric is a core component of OFI. It is the library that defines and | |
6959 | exports the user-space API of OFI, and is typically the only software that | |
6960 | applications deal with directly. It works in conjunction with provider | |
6961 | libraries, which are often integrated directly into libfabric.") | |
6962 | (license (list license:bsd-2 license:gpl2)))) ;dual | |
fd23d259 DL |
6963 | |
6964 | (define-public psm | |
6965 | (package | |
6966 | (name "psm") | |
6967 | (version "3.3.20170428") | |
b50a9cc0 | 6968 | (home-page "https://github.com/intel/psm") |
fd23d259 DL |
6969 | (source |
6970 | (origin | |
6971 | (method git-fetch) | |
b50a9cc0 | 6972 | (uri (git-reference (url home-page) |
fd23d259 DL |
6973 | (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b"))) |
6974 | (file-name (string-append "psm-" version ".tar.gz")) | |
6975 | (sha256 | |
6976 | (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85")) | |
6977 | (patches (search-patches | |
6978 | "psm-arch.patch" ; uname -p returns "unknown" on Debian 9 | |
6979 | "psm-ldflags.patch" ; build shared lib with LDFLAGS | |
d8f8adfe LC |
6980 | "psm-repro.patch" ; reproducibility |
6981 | "psm-disable-memory-stats.patch")))) | |
fd23d259 | 6982 | (build-system gnu-build-system) |
348caf3d | 6983 | (outputs '("out" "debug")) |
bb93042c | 6984 | (inputs `(("libuuid" ,util-linux "lib"))) |
fd23d259 DL |
6985 | (arguments |
6986 | '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR=" | |
6987 | ,(string-append "INSTALL_PREFIX=" %output) | |
6988 | ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")) | |
6989 | #:tests? #f | |
6990 | #:phases (modify-phases %standard-phases | |
6991 | (delete 'configure) | |
6992 | (add-after 'unpack 'patch-/usr/include | |
6993 | (lambda _ | |
6994 | (substitute* "Makefile" | |
6995 | (("\\$\\{DESTDIR}/usr/include") | |
6996 | (string-append %output "/include"))) | |
6997 | (substitute* "Makefile" | |
6998 | (("/lib64") "/lib")) | |
41313ace EB |
6999 | #t)) |
7000 | (add-after 'unpack 'patch-sysmacros | |
7001 | (lambda _ | |
7002 | (substitute* "ipath/ipath_proto.c" | |
7003 | (("#include <sys/poll.h>" m) | |
7004 | (string-append m "\n" | |
7005 | "#include <sys/sysmacros.h>"))) | |
fd23d259 | 7006 | #t))))) |
fd23d259 DL |
7007 | (synopsis "Intel Performance Scaled Messaging (PSM) Libraries") |
7008 | (description | |
7009 | "The PSM Messaging API, or PSM API, is Intel's low-level user-level | |
7010 | communications interface for the True Scale family of products. PSM users are | |
7011 | enabled with mechanisms necessary to implement higher level communications | |
7012 | interfaces in parallel environments.") | |
b516b780 EF |
7013 | ;; Only Intel-compatable processors are supported. |
7014 | (supported-systems '("i686-linux" "x86_64-linux")) | |
fd23d259 | 7015 | (license (list license:bsd-2 license:gpl2)))) ;dual |
c1c82584 TGR |
7016 | |
7017 | (define-public snapscreenshot | |
7018 | (package | |
7019 | (name "snapscreenshot") | |
7020 | (version "1.0.14.3") | |
7021 | (source | |
7022 | (origin | |
7023 | (method url-fetch) | |
7024 | (uri (string-append "http://bisqwit.iki.fi/src/arch/" | |
7025 | name "-" version ".tar.bz2")) | |
7026 | (sha256 | |
7027 | (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk")))) | |
7028 | (build-system gnu-build-system) | |
7029 | (arguments | |
7030 | `(#:make-flags | |
7031 | (let ((out (assoc-ref %outputs "out"))) | |
7032 | (list (string-append "BINDIR=" out "/bin") | |
7033 | (string-append "MANDIR=" out "/share/man"))) | |
7034 | #:tests? #f ; no test suite | |
7035 | #:phases | |
7036 | (modify-phases %standard-phases | |
7037 | (delete 'configure) ; ./configure is a snarky no-op | |
7038 | (add-before 'install 'fix-ownership | |
7039 | ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’. | |
7040 | (lambda _ | |
7041 | (substitute* "depfun.mak" | |
7042 | ((" -o bin -g bin ") " ")) | |
7043 | #t)) | |
7044 | (add-before 'install 'create-output-directories | |
7045 | (lambda* (#:key outputs #:allow-other-keys) | |
7046 | (let ((out (assoc-ref outputs "out"))) | |
7047 | (mkdir-p (string-append out "/share/man/man1")) | |
7048 | #t)))))) | |
81e59e41 | 7049 | (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html") |
c1c82584 TGR |
7050 | (synopsis "Take screenshots of one or more Linux text consoles") |
7051 | (description | |
7052 | "snapscreenshot saves a screenshot of one or more Linux text consoles as a | |
7053 | Targa (@dfn{.tga}) image. It can be used by anyone with read access to the | |
7054 | relevant @file{/dev/vcs*} file(s).") | |
7055 | (license license:gpl2))) | |
8d8d227b TGR |
7056 | |
7057 | (define-public fbcat | |
7058 | (package | |
7059 | (name "fbcat") | |
7f86e5e7 | 7060 | (version "0.5.1") |
8d8d227b TGR |
7061 | (source |
7062 | (origin | |
7063 | (method url-fetch) | |
7064 | (uri (string-append "https://github.com/jwilk/fbcat/releases/download/" | |
7065 | version "/" name "-" version ".tar.gz")) | |
7066 | (sha256 | |
7f86e5e7 | 7067 | (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7")))) |
8d8d227b | 7068 | (build-system gnu-build-system) |
8d8d227b TGR |
7069 | (inputs |
7070 | ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We | |
7071 | ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB | |
7072 | ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output. | |
7073 | `(("pnmtopng" ,netpbm))) | |
7074 | (outputs (list "out" "fbgrab")) | |
7075 | (arguments | |
7f86e5e7 TGR |
7076 | `(#:make-flags |
7077 | (list "CC=gcc" | |
7078 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
8d8d227b TGR |
7079 | #:tests? #f ; no tests |
7080 | #:phases | |
7081 | (modify-phases %standard-phases | |
8d8d227b | 7082 | (delete 'configure) ; no configure script |
8d8d227b TGR |
7083 | (add-after 'build 'qualify-references |
7084 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
7085 | (let* ((pnmtopng (assoc-ref inputs "pnmtopng")) | |
7086 | (out (assoc-ref outputs "out"))) | |
7087 | (substitute* "fbgrab" | |
7088 | (("fbcat" all) | |
7089 | (string-append out "/bin/" all)) | |
7090 | (("pnmtopng" all) | |
7091 | (string-append pnmtopng "/bin/" all))) | |
7092 | #t))) | |
7f86e5e7 | 7093 | (add-after 'install 'split-fbgrab-output |
8d8d227b TGR |
7094 | (lambda* (#:key outputs #:allow-other-keys) |
7095 | (let* ((out (assoc-ref outputs "out")) | |
7096 | (out:fbgrab (assoc-ref outputs "fbgrab"))) | |
7f86e5e7 TGR |
7097 | (for-each (lambda (file) |
7098 | (let ((old (string-append out "/" file)) | |
7099 | (new (string-append out:fbgrab "/" file))) | |
7100 | (mkdir-p (dirname new)) | |
7101 | (rename-file old new))) | |
7102 | (list "bin/fbgrab" | |
7103 | "share/man/man1/fbgrab.1")) | |
8d8d227b TGR |
7104 | #t)))))) |
7105 | (home-page "https://jwilk.net/software/fbcat") | |
7106 | (synopsis "Take a screenshot of the contents of the Linux framebuffer") | |
7107 | (description | |
7108 | "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or | |
7109 | a dump therof. It supports a wide range of drivers and pixel formats. | |
7110 | @command{fbcat} can take screenshots of virtually any application that can be | |
7111 | made to write its output to the framebuffer, including (but not limited to) | |
7112 | text-mode or graphical applications that don't use a display server. | |
7113 | ||
7114 | Also included is @command{fbgrab}, a wrapper around @command{fbcat} that | |
7115 | emulates the behaviour of Gunnar Monell's older fbgrab utility.") | |
7116 | (license license:gpl2))) | |
a69e0cf3 TČ |
7117 | |
7118 | (define-public libcgroup | |
7119 | (package | |
7120 | (name "libcgroup") | |
7121 | (version "0.41") | |
7122 | (source | |
7123 | (origin | |
7124 | (method url-fetch) | |
7125 | (uri (string-append | |
7126 | "mirror://sourceforge/libcg/" name "/" | |
7127 | version "/" name "-" version ".tar.bz2")) | |
7128 | (sha256 | |
7129 | (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4")))) | |
7130 | (build-system gnu-build-system) | |
7131 | (arguments | |
7132 | `(#:tests? #f)) | |
7133 | (native-inputs | |
7134 | `(("bison" ,bison) | |
7135 | ("flex" ,flex))) | |
7136 | (inputs | |
7137 | `(("linux-pam" ,linux-pam))) | |
7138 | (home-page "https://sourceforge.net/projects/libcg/") | |
7139 | (synopsis "Control groups management tools") | |
7140 | (description "Control groups is Linux kernel method for process resource | |
7141 | restriction, permission handling and more. This package provides userspace | |
7142 | interface to this kernel feature.") | |
7143 | (license license:lgpl2.1))) | |
5849c68a R |
7144 | |
7145 | (define-public mbpfan | |
7146 | (package | |
7147 | (name "mbpfan") | |
cf5a4b2e | 7148 | (version "2.2.1") |
5849c68a R |
7149 | (source |
7150 | (origin | |
5478ab1e TGR |
7151 | (method git-fetch) |
7152 | (uri (git-reference | |
b0e7b699 | 7153 | (url "https://github.com/dgraziotin/mbpfan") |
5478ab1e TGR |
7154 | (commit (string-append "v" version)))) |
7155 | (file-name (git-file-name name version)) | |
5849c68a | 7156 | (sha256 |
cf5a4b2e | 7157 | (base32 "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr")))) |
5849c68a R |
7158 | (build-system gnu-build-system) |
7159 | (arguments | |
e45f0c79 | 7160 | `(#:tests? #f ; tests ask to be run as root |
5849c68a R |
7161 | #:make-flags (let ((out (assoc-ref %outputs "out"))) |
7162 | (list (string-append "DESTDIR=" out) | |
e45f0c79 | 7163 | ,(string-append "CC=" (cc-for-target)))) |
5849c68a R |
7164 | #:phases |
7165 | (modify-phases %standard-phases | |
7166 | (add-after 'unpack 'patch-paths | |
7167 | (lambda _ | |
7168 | (substitute* "Makefile" | |
7169 | (("/usr") "")) | |
7170 | #t)) | |
697c5846 | 7171 | (delete 'configure)))) ; there's no configure phase |
5849c68a R |
7172 | (home-page "https://github.com/dgraziotin/mbpfan") |
7173 | (synopsis "Control fan speed on Macbooks") | |
7174 | (description | |
7175 | "mbpfan is a fan control daemon for Apple Macbooks. It uses input from | |
7176 | the @code{coretemp} module and sets the fan speed using the @code{applesmc} | |
7177 | module. It can be executed as a daemon or in the foreground with root | |
7178 | privileges.") | |
7179 | (license license:gpl3+))) | |
25637b77 PAR |
7180 | |
7181 | (define-public psm2 | |
7182 | (package | |
7183 | (name "psm2") | |
5e4ddfb5 | 7184 | (version "11.2.185") |
25637b77 PAR |
7185 | (source (origin |
7186 | (method git-fetch) | |
7187 | (uri (git-reference | |
b0e7b699 | 7188 | (url "https://github.com/intel/opa-psm2") |
25637b77 PAR |
7189 | (commit (string-append "PSM2_" version)))) |
7190 | (file-name (git-file-name name version)) | |
7191 | (sha256 | |
7192 | (base32 | |
5e4ddfb5 | 7193 | "062hg4r6gz7pla9df70nqs5i2a3mp1wszmp4l0g771fykhhrxsjg")))) |
25637b77 PAR |
7194 | (build-system gnu-build-system) |
7195 | (arguments | |
7196 | '(#:make-flags | |
7197 | `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")) | |
7198 | #:tests? #f | |
7199 | #:phases (modify-phases %standard-phases | |
7200 | (delete 'configure) | |
7201 | (add-after 'unpack 'patch-Makefiles | |
7202 | (lambda _ | |
7203 | (substitute* "Makefile" | |
7204 | (("/lib64") "/lib") | |
7205 | (("/usr") "")) | |
7206 | (substitute* "compat/Makefile" | |
7207 | (("/lib64") "/lib") | |
7208 | (("/usr") "")) | |
7209 | #t)) | |
7210 | (replace 'install | |
7211 | (lambda _ | |
7212 | (setenv "DESTDIR" %output) | |
7213 | (invoke "make" "install") | |
7214 | #t))))) | |
7215 | (inputs | |
7216 | `(("rdma-core" ,rdma-core) | |
7217 | ("numactl" ,numactl))) | |
7218 | (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library") | |
7219 | (description | |
7220 | "This package is low-level user-level Intel's communications interface. | |
7221 | The PSM2 API is a high-performance vendor-specific protocol that provides a | |
7222 | low-level communications interface for the Intel Omni-Path family of | |
7223 | high-speed networking devices.") | |
7224 | (home-page "https://github.com/intel/opa-psm2") | |
7225 | ;; Only the x86_64 architecure is supported. | |
7226 | (supported-systems '("x86_64-linux")) | |
7227 | (license (list license:bsd-3 license:gpl2)))) ; dual | |
2690b6ce PAR |
7228 | |
7229 | (define-public libpfm4 | |
7230 | (package | |
7231 | (name "libpfm4") | |
7232 | (version "4.9.0") | |
7233 | (source (origin | |
7234 | (method url-fetch) | |
7235 | (uri (string-append "mirror://sourceforge/perfmon2/" | |
7236 | name "/libpfm-" version ".tar.gz")) | |
7237 | (sha256 | |
7238 | (base32 | |
7239 | "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv")))) | |
7240 | (build-system gnu-build-system) | |
7241 | (arguments | |
7242 | '(#:modules ((guix build utils) | |
7243 | (guix build gnu-build-system)) | |
7244 | #:phases (modify-phases %standard-phases | |
7245 | (delete 'configure) | |
7246 | (delete 'check) | |
7247 | (replace 'build | |
7248 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
7249 | (let* ((out (assoc-ref outputs "out"))) | |
7250 | (setenv "CC" "gcc") | |
7251 | (invoke "make") | |
7252 | #t))) | |
7253 | (replace 'install | |
7254 | (lambda* (#:key outputs #:allow-other-keys) | |
7255 | (let* ((out (assoc-ref outputs "out"))) | |
7256 | (invoke "make" | |
7257 | (string-append "PREFIX=" out) | |
7258 | "install") | |
7259 | #t)))))) | |
7260 | (synopsis "Performance event monitoring library") | |
7261 | (description | |
7262 | "This package provides a library called libpfm4, which is used to develop | |
7263 | monitoring tools exploiting the performance monitoring events such as those | |
7264 | provided by the Performance Monitoring Unit (PMU) of modern processors. | |
7265 | ||
7266 | Libpfm4 helps convert from an event name, expressed as a string, to the event | |
7267 | encoding that is either the raw event as documented by the hardware vendor or | |
7268 | the OS-specific encoding. In the latter case, the library is able to prepare | |
7269 | the OS-specific data structures needed by the kernel to setup the event. | |
7270 | ||
7271 | libpfm4 provides support for the @code{perf_events} interface, which was | |
7272 | introduced in Linux 2.6.31.") | |
7273 | (home-page "http://perfmon2.sourceforge.net/") | |
7274 | (license license:expat))) | |
4dd1fb79 SB |
7275 | |
7276 | (define-public libnfnetlink | |
7277 | (package | |
7278 | (name "libnfnetlink") | |
7279 | (version "1.0.1") | |
7280 | (source (origin | |
7281 | (method url-fetch) | |
7282 | (uri (string-append | |
7283 | "https://www.netfilter.org/projects/libnfnetlink/files/" | |
7284 | "libnfnetlink-" version ".tar.bz2")) | |
7285 | (sha256 | |
7286 | (base32 | |
7287 | "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j")))) | |
7288 | (build-system gnu-build-system) | |
7289 | (home-page "https://www.netfilter.org/projects/libnfnetlink/") | |
7290 | (synopsis "Low-level netfilter netlink communication library") | |
7291 | (description | |
7292 | "@code{libnfnetlink} is the low-level library for netfilter related | |
7293 | kernel/userspace communication. It provides a generic messaging | |
7294 | infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log, | |
7295 | nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or | |
7296 | management tools in userspace.") | |
7297 | (license license:gpl2))) | |
e4231cfe | 7298 | |
626de0d1 MC |
7299 | (define-public go-netlink |
7300 | (package | |
7301 | (name "go-netlink") | |
7302 | (version "1.0.0") | |
7303 | (source (origin | |
7304 | (method git-fetch) | |
7305 | (uri (git-reference | |
b0e7b699 | 7306 | (url "https://github.com/vishvananda/netlink") |
626de0d1 MC |
7307 | (commit (string-append "v" version)))) |
7308 | (file-name (git-file-name name version)) | |
7309 | (sha256 | |
7310 | (base32 | |
7311 | "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0")))) | |
7312 | (build-system go-build-system) | |
7313 | (arguments | |
7314 | `(#:import-path "github.com/vishvananda/netlink")) | |
7315 | (native-inputs | |
561d391b | 7316 | `(("go-golang-org-x-sys" ,go-golang-org-x-sys) |
626de0d1 MC |
7317 | ("go-netns" ,go-netns))) |
7318 | (home-page "https://github.com/vishvananda/netlink") | |
7319 | (synopsis "Simple netlink library for Go") | |
7320 | (description "The netlink package provides a simple netlink library for | |
7321 | Go. Netlink is the interface a user-space program in Linux uses to | |
7322 | communicate with the kernel. It can be used to add and remove interfaces, set | |
7323 | IP addresses and routes, and configure IPsec.") | |
7324 | (license license:asl2.0))) | |
7325 | ||
fcdf4b4e VL |
7326 | (define-public libinih |
7327 | (package | |
7328 | (name "libinih") | |
ed6900f9 | 7329 | (version "53") |
fcdf4b4e VL |
7330 | (source (origin |
7331 | (method git-fetch) | |
7332 | (uri (git-reference | |
7333 | (url "https://github.com/benhoyt/inih") | |
7334 | (commit (string-append "r" version)))) | |
7335 | (file-name (git-file-name name version)) | |
7336 | (sha256 | |
7337 | (base32 | |
ed6900f9 | 7338 | "0dqf5j2sw4hq68rqvxbrsf44ygfzx9ypiyzipk4cvp9aimbvsbc6")))) |
fcdf4b4e VL |
7339 | (build-system meson-build-system) |
7340 | (arguments | |
7341 | '(#:configure-flags '("-Ddistro_install=true" "-Ddefault_library=shared"))) | |
7342 | (home-page "https://github.com/benhoyt/inih") | |
7343 | (synopsis "Simple .INI parser library for C") | |
7344 | (description "The inih (INI Not Invented Here) library is a simple .INI file | |
7345 | parser written in C. It's only a couple of pages of code, and it was designed to | |
7346 | be small and simple, so it's good for embedded systems. It's also more or less | |
7347 | compatible with Python's ConfigParser style of .INI files, including RFC | |
7348 | 822-style multi-line syntax and name: value entries.") | |
7349 | (license license:bsd-3))) | |
7350 | ||
e4231cfe DM |
7351 | (define-public xfsprogs |
7352 | (package | |
7353 | (name "xfsprogs") | |
e6eacc34 | 7354 | (version "5.12.0") |
e4231cfe DM |
7355 | (source (origin |
7356 | (method url-fetch) | |
7357 | (uri (string-append | |
7358 | "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/" | |
7359 | "xfsprogs-" version ".tar.gz")) | |
7360 | (sha256 | |
7361 | (base32 | |
e6eacc34 | 7362 | "0b5vvwq4rqw7kph23ycd518d31dx3wq7w61znixxpdljx0ig71qn")))) |
e4231cfe | 7363 | (build-system gnu-build-system) |
c78778e7 | 7364 | (outputs (list "out" "python")) |
e4231cfe | 7365 | (arguments |
c78778e7 TGR |
7366 | `(#:tests? #f ; kernel/user integration tests are in package "xfstests" |
7367 | #:phases | |
7368 | (modify-phases %standard-phases | |
7369 | (add-after 'install 'separate-python-output | |
7370 | (lambda* (#:key outputs #:allow-other-keys) | |
7371 | (let ((out (assoc-ref outputs "out")) | |
7372 | (python (assoc-ref outputs "python"))) | |
7373 | (for-each | |
7374 | (lambda (script) | |
7375 | (mkdir-p (string-append python (dirname script))) | |
7376 | (rename-file (string-append out script) | |
7377 | (string-append python script))) | |
7378 | (list "/sbin/xfs_scrub_all")) | |
7379 | #t))) | |
7380 | (add-after 'install 'install-headers | |
7381 | (lambda _ | |
7382 | (invoke "make" "install-dev")))))) | |
e4231cfe | 7383 | (native-inputs |
c148d2eb | 7384 | `(("gettext" ,gettext-minimal))) |
c78778e7 | 7385 | (inputs |
9325171d VL |
7386 | `(("libinih" ,libinih) |
7387 | ("libuuid" ,util-linux "lib") | |
c148d2eb | 7388 | ("python" ,python-wrapper))) |
e4231cfe DM |
7389 | (home-page "https://xfs.wiki.kernel.org/") |
7390 | (synopsis "XFS file system tools") | |
7391 | (description "This package provides commands to create and check XFS | |
7392 | file systems.") | |
7393 | ;; The library "libhandle" and the headers in "xfslibs-dev" are | |
7394 | ;; licensed under lgpl2.1. the other stuff is licensed under gpl2. | |
7395 | (license (list license:gpl2 license:lgpl2.1)))) | |
c63d7b79 DM |
7396 | |
7397 | (define-public genext2fs | |
7398 | (package | |
7399 | (name "genext2fs") | |
083639a5 | 7400 | (version "1.4.1-4") |
c63d7b79 DM |
7401 | (source (origin |
7402 | (method git-fetch) | |
7403 | (uri (git-reference | |
b0e7b699 | 7404 | (url "https://github.com/jeremie-koenig/genext2fs") |
083639a5 TGR |
7405 | ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't. |
7406 | (commit "9ee43894634998b0b2b309d636f25c64314c9421"))) | |
c63d7b79 DM |
7407 | (file-name (git-file-name name version)) |
7408 | (sha256 | |
083639a5 | 7409 | (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq")))) |
c63d7b79 | 7410 | (build-system gnu-build-system) |
083639a5 TGR |
7411 | (arguments |
7412 | `(#:phases | |
7413 | (modify-phases %standard-phases | |
7414 | (add-after 'unpack 'apply-debian-patches | |
7415 | ;; Debian changes (the revision after ‘-’ in VERSION) are | |
7416 | ;; maintained as separate patches. Apply those relevant to us. | |
7417 | (lambda _ | |
7418 | (for-each | |
7419 | (lambda (file-name) | |
7420 | (invoke "patch" "-p1" "-i" | |
7421 | (string-append "debian/patches/" file-name))) | |
7422 | (list "blocksize+creator.diff" ; add -B/-o options | |
7423 | "byteswap_fix.diff")) | |
7424 | #t))))) | |
7425 | (native-inputs | |
7426 | `(("autoconf" ,autoconf) | |
7427 | ("automake" ,automake))) | |
c63d7b79 | 7428 | (home-page "https://github.com/jeremie-koenig/genext2fs") |
52beae7b TGR |
7429 | (synopsis "Generate ext2 file system as a normal user") |
7430 | (description "This package provides a program to generate an ext2 | |
7431 | file system as a normal (non-root) user. It does not require you to mount | |
c63d7b79 DM |
7432 | the image file to copy files on it, nor does it require that you become |
7433 | the superuser to make device nodes.") | |
7434 | (license license:gpl2))) | |
d1dfcc7c DM |
7435 | |
7436 | (define-public fakeroot | |
7437 | (package | |
7438 | (name "fakeroot") | |
7f4a8154 | 7439 | (version "1.25.3") |
d1dfcc7c | 7440 | (source (origin |
0dc3649e | 7441 | ;; There are no tags in the repository, so take this snapshot. |
d1dfcc7c | 7442 | (method url-fetch) |
ae1bab3e TGR |
7443 | (uri (string-append "https://deb.debian.org/debian/pool/main/f/" |
7444 | "fakeroot/fakeroot_" version ".orig.tar.gz")) | |
d1dfcc7c DM |
7445 | (file-name (string-append name "-" version ".tar.gz")) |
7446 | (sha256 | |
7447 | (base32 | |
7f4a8154 | 7448 | "0v4m3v1bdqvblwj3vqsb3mllgbci6dsgsydq6765nzvz6n1kd44f")))) |
d1dfcc7c DM |
7449 | (build-system gnu-build-system) |
7450 | (arguments | |
7451 | `(#:phases | |
7452 | (modify-phases %standard-phases | |
0dc3649e MB |
7453 | (replace 'bootstrap |
7454 | (lambda _ | |
7455 | ;; The "preroll" script takes care of Autoconf and also | |
7456 | ;; prepares the translated manuals. | |
7457 | (invoke "sh" "./preroll"))) | |
d1dfcc7c DM |
7458 | (add-after 'configure 'patch-Makefile |
7459 | (lambda _ | |
7460 | ;; Note: The root of the problem is already in "Makefile.am". | |
7461 | (substitute* "Makefile" | |
7462 | (("/bin/sh") (which "sh"))) | |
7463 | #t)) | |
c29bb909 | 7464 | (add-after 'unpack 'patch-script |
d1dfcc7c DM |
7465 | (lambda* (#:key inputs #:allow-other-keys) |
7466 | (substitute* "scripts/fakeroot.in" | |
7467 | (("getopt") | |
7468 | (string-append (assoc-ref inputs "util-linux") | |
c29bb909 MO |
7469 | "/bin/getopt")) |
7470 | (("sed") | |
7471 | (string-append (assoc-ref inputs "sed") | |
7472 | "/bin/sed")) | |
7473 | (("cut") | |
7474 | (string-append (assoc-ref inputs "coreutils") | |
7475 | "/bin/cut")) ) | |
d1dfcc7c | 7476 | #t)) |
0d5c5b1b DM |
7477 | (add-before 'configure 'setenv |
7478 | (lambda _ | |
7479 | (setenv "LIBS" "-lacl") | |
7480 | #t)) | |
d1dfcc7c DM |
7481 | (add-before 'check 'prepare-check |
7482 | (lambda _ | |
7483 | (setenv "SHELL" (which "bash")) | |
7484 | (setenv "VERBOSE" "1") | |
7485 | (substitute* "test/t.touchinstall" | |
7486 | ;; We don't have the name of the root user, so use ID=0. | |
7487 | (("grep root") "grep \"\\<0\\>\"")) | |
7488 | (substitute* "test/tartest" | |
7489 | ;; We don't have the name of the root group, so use ID=0. | |
7490 | (("ROOTGROUP=root") "ROOTGROUP=0") | |
7491 | ;; We don't have the name of the daemon user, so use IDs. | |
7492 | (("daemon:sys") "1:3") | |
7493 | (("daemon:") "1:")) | |
7494 | ;; We don't have an /etc/passwd entry for "root" - use numeric IDs. | |
7495 | (substitute* "test/compare-tar" | |
7496 | (("tar -tvf") "tar --numeric-owner -tvf")) | |
7497 | #t))))) | |
7498 | (native-inputs | |
0dc3649e MB |
7499 | `(;; For bootstrapping the package. |
7500 | ("autoconf" ,autoconf) | |
7501 | ("automake" ,automake) | |
7502 | ("libtool" ,libtool) | |
7503 | ("gettext" ,gettext-minimal) | |
7504 | ("po4a" ,po4a) | |
7505 | ||
7506 | ;; For tests. | |
7507 | ("sharutils" ,sharutils) | |
7508 | ("xz" ,xz))) | |
d1dfcc7c | 7509 | (inputs |
0dc3649e | 7510 | `(("acl" ,acl) |
9e1f5a26 | 7511 | ("libcap" ,libcap) |
c29bb909 MO |
7512 | ("util-linux" ,util-linux) |
7513 | ("sed" ,sed) | |
7514 | ("coreutils" ,coreutils))) | |
d1dfcc7c DM |
7515 | (synopsis "Provides a fake root environment") |
7516 | (description "@command{fakeroot} runs a command in an environment where | |
7517 | it appears to have root privileges for file manipulation. This is useful | |
7518 | for allowing users to create archives (tar, ar, .deb etc.) with files in | |
7519 | them with root permissions/ownership. Without fakeroot one would have to | |
7520 | have root privileges to create the constituent files of the archives with | |
7521 | the correct permissions and ownership, and then pack them up, or one would | |
7522 | have to construct the archives directly, without using the archiver.") | |
7523 | (home-page "http://freshmeat.sourceforge.net/projects/fakeroot") | |
7524 | (license license:gpl3+))) | |
bf2a9969 | 7525 | |
4449e7c5 LC |
7526 | (define-public fakechroot |
7527 | (package | |
7528 | (name "fakechroot") | |
7529 | (version "2.20.1") | |
7530 | (source (origin | |
7531 | (method url-fetch) | |
7532 | (uri (string-append | |
7533 | "https://github.com/dex4er/fakechroot/releases/download/" | |
7534 | version "/fakechroot-" version ".tar.gz")) | |
7535 | (sha256 | |
7536 | (base32 | |
7537 | "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas")))) | |
7538 | (build-system gnu-build-system) | |
7539 | (arguments | |
7540 | ;; XXX: The tests heavily assume they run on an FHS system so for now | |
7541 | ;; skip them. | |
7542 | '(#:tests? #f | |
7543 | #:configure-flags '("--disable-static"))) | |
7544 | (synopsis "Emulate @code{chroot} by overriding file system calls") | |
7545 | (description | |
7546 | "@command{fakechroot} runs a command in an environment were is additional | |
7547 | possibility to use @code{chroot} command without root privileges. This is | |
7548 | useful for allowing users to create own chrooted environment with possibility | |
7549 | to install another packages without need for root privileges. | |
7550 | ||
7551 | It works by providing @file{libfakechroot.so}, a shared library meant to be | |
7552 | set as @code{LD_PRELOAD} to override the C library file system functions.") | |
7553 | (home-page "https://github.com/dex4er/fakechroot/") | |
7554 | (license license:lgpl2.1+))) | |
7555 | ||
bf2a9969 TG |
7556 | (define-public inputattach |
7557 | (package | |
7558 | (name "inputattach") | |
7559 | (version "0.42.0") | |
7560 | (source (origin | |
7561 | (method git-fetch) | |
7562 | (uri (git-reference | |
b0e7b699 | 7563 | (url "https://github.com/linuxwacom/input-wacom") |
bf2a9969 TG |
7564 | (commit (string-append "input-wacom-" version)))) |
7565 | (file-name (git-file-name name version)) | |
7566 | (sha256 | |
7567 | (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j")))) | |
7568 | (build-system gnu-build-system) | |
7569 | (arguments | |
7570 | `(#:phases | |
7571 | (modify-phases %standard-phases | |
7572 | (delete 'bootstrap) | |
7573 | (delete 'configure) | |
7574 | (replace 'build | |
7575 | (lambda* (#:key inputs #:allow-other-keys) | |
7576 | (with-directory-excursion "inputattach" | |
7577 | (invoke (string-append (assoc-ref inputs "gcc") | |
7578 | "/bin/gcc") | |
5ddf98da | 7579 | "-O2" "-o" "inputattach" "inputattach.c")) |
bf2a9969 TG |
7580 | #t)) |
7581 | (delete 'check) | |
7582 | (replace 'install | |
7583 | (lambda* (#:key outputs #:allow-other-keys) | |
7584 | (let ((target-dir (string-append | |
7585 | (assoc-ref outputs "out") | |
7586 | "/bin/"))) | |
7587 | (mkdir-p target-dir) | |
7588 | (copy-file "inputattach/inputattach" | |
7589 | (string-append target-dir | |
7590 | "inputattach")) | |
7591 | #t)))))) | |
7592 | (home-page "https://linuxwacom.github.io/") | |
7593 | (synopsis "Dispatch input peripherals events to a device file") | |
7594 | (description "inputattach dispatches input events from several device | |
7595 | types and interfaces and translates so that the X server can use them.") | |
7596 | (license license:gpl2+))) | |
de3896fb | 7597 | |
8c6c97de KK |
7598 | (define-public pipewire |
7599 | (package | |
7600 | (name "pipewire") | |
e7d710af | 7601 | (version "0.2.7") |
8c6c97de KK |
7602 | (source (origin |
7603 | (method git-fetch) | |
7604 | (uri (git-reference | |
7605 | (url "https://github.com/PipeWire/pipewire") | |
7606 | (commit version))) | |
7607 | (file-name (git-file-name name version)) | |
7608 | (sha256 | |
7609 | (base32 | |
e7d710af | 7610 | "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc")))) |
8c6c97de KK |
7611 | (build-system meson-build-system) |
7612 | (arguments | |
7613 | '(#:configure-flags '("-Dsystemd=false"))) | |
7614 | (native-inputs | |
7615 | `(("pkg-config" ,pkg-config))) | |
7616 | (inputs | |
7617 | `(("alsa-lib" ,alsa-lib) | |
7618 | ("dbus" ,dbus) | |
7619 | ("eudev" ,eudev) | |
7620 | ("ffmpeg" ,ffmpeg) | |
7621 | ("gstreamer" ,gstreamer) | |
7622 | ("gst-plugins-base" ,gst-plugins-base) | |
7623 | ("libva" ,libva) | |
7624 | ("sbc" ,sbc) | |
7625 | ("sdl2" ,sdl2))) | |
7626 | (home-page "https://pipewire.org/") | |
7627 | (synopsis "Server and user space API to deal with multimedia pipelines") | |
7628 | (description | |
7629 | "PipeWire is a project that aims to greatly improve handling of audio and | |
7630 | video under Linux. It aims to support the usecases currently handled by both | |
7631 | PulseAudio and Jack and at the same time provide same level of powerful handling | |
7632 | of Video input and output. It also introduces a security model that makes | |
7633 | interacting with audio and video devices from containerized applications easy, | |
7634 | with supporting Flatpak applications being the primary goal. Alongside Wayland | |
7635 | and Flatpak we expect PipeWire to provide a core building block for the future | |
7636 | of Linux application development.") | |
7637 | (license license:lgpl2.0+))) | |
7638 | ||
d888a9c9 AT |
7639 | (define-public pipewire-0.3 |
7640 | (package | |
7641 | (inherit pipewire) | |
7642 | (name "pipewire") | |
d0d948e3 | 7643 | (version "0.3.29") |
d888a9c9 AT |
7644 | (source (origin |
7645 | (method git-fetch) | |
7646 | (uri (git-reference | |
7647 | (url "https://github.com/PipeWire/pipewire") | |
7648 | (commit version))) | |
7649 | (file-name (git-file-name name version)) | |
7650 | (sha256 | |
7651 | (base32 | |
d0d948e3 | 7652 | "16jjxcnahxqfcawz77ywx837ybhwzcivn7hgqb9cmlp1y2syy8gk")))) |
d888a9c9 | 7653 | (arguments |
616fa14b TGR |
7654 | '(#:configure-flags |
7655 | (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out") | |
7656 | "/lib/udev/rules.d") | |
d0d948e3 | 7657 | "-Dsystemd=disabled") |
d888a9c9 AT |
7658 | #:phases |
7659 | (modify-phases %standard-phases | |
616fa14b | 7660 | ;; Skip shrink-runpath, otherwise validate-runpath fails. |
d888a9c9 AT |
7661 | (delete 'shrink-runpath)))) |
7662 | (inputs | |
7663 | (append (package-inputs pipewire) | |
7664 | `(("bluez" ,bluez) | |
7665 | ("jack" ,jack-2) | |
7666 | ("pulseaudio" ,pulseaudio) | |
7667 | ("vulkan-loader" ,vulkan-loader) | |
7668 | ("vulkan-headers" ,vulkan-headers)))))) | |
7669 | ||
de3896fb BW |
7670 | (define-public ell |
7671 | (package | |
7672 | (name "ell") | |
def0b7fc | 7673 | (version "0.40") |
de3896fb BW |
7674 | (source (origin |
7675 | (method git-fetch) | |
7676 | (uri (git-reference | |
7677 | (url "https://git.kernel.org/pub/scm/libs/ell/ell.git") | |
7678 | (commit version))) | |
7679 | (file-name (git-file-name name version)) | |
7680 | (sha256 | |
7681 | (base32 | |
def0b7fc | 7682 | "1zzpbfdpmfldd7w0h7mwbq0mfqgqwz54nqbq0rmbqlqqpwlkrgb2")))) |
de3896fb BW |
7683 | (build-system gnu-build-system) |
7684 | (arguments | |
7685 | `(#:phases | |
7686 | (modify-phases %standard-phases | |
7687 | (add-after 'unpack 'fix-dbus-tests | |
7688 | (lambda _ | |
7689 | (substitute* '("unit/test-dbus-message-fds.c" | |
7690 | "unit/test-dbus-properties.c" | |
7691 | "unit/test-dbus.c") | |
7692 | (("/usr/bin/dbus-daemon") (which "dbus-daemon"))) | |
7693 | #t))))) | |
7694 | (inputs | |
d6f1f607 | 7695 | `(("dbus" ,dbus))) |
de3896fb BW |
7696 | (native-inputs |
7697 | `(("autoconf" ,autoconf) | |
d6f1f607 | 7698 | ("libtool" ,libtool) |
de3896fb BW |
7699 | ("pkgconfig" ,pkg-config) |
7700 | ("automake" ,automake))) | |
7701 | (home-page "https://01.org/ell") | |
7702 | (synopsis "Embedded Linux Library") | |
7703 | (description "The Embedded Linux* Library (ELL) provides core, low-level | |
7704 | functionality for system daemons. It typically has no dependencies other than | |
7705 | the Linux kernel, C standard library, and libdl (for dynamic linking). While | |
7706 | ELL is designed to be efficient and compact enough for use on embedded Linux | |
7707 | platforms, it is not limited to resource-constrained systems.") | |
7708 | (license license:lgpl2.1+))) | |
a69bc738 PN |
7709 | |
7710 | (define-public lttng-ust | |
7711 | (package | |
7712 | (name "lttng-ust") | |
7713 | (version "2.11.0") | |
7714 | (source (origin | |
7715 | (method url-fetch) | |
7716 | (uri (string-append "https://lttng.org/files/lttng-ust/" | |
7717 | "lttng-ust-" version ".tar.bz2")) | |
7718 | (sha256 | |
7719 | (base32 | |
7720 | "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8")))) | |
7721 | (build-system gnu-build-system) | |
7722 | (inputs | |
7723 | `(("liburcu" ,liburcu) | |
7724 | ("numactl" ,numactl))) | |
7725 | (native-inputs | |
7726 | `(("python" ,python-3))) | |
7727 | (home-page "https://lttng.org/") | |
7728 | (synopsis "LTTng userspace tracer libraries") | |
7729 | (description "The user space tracing library, liblttng-ust, is the LTTng | |
7730 | user space tracer. It receives commands from a session daemon, for example to | |
7731 | enable and disable specific instrumentation points, and writes event records | |
7732 | to ring buffers shared with a consumer daemon.") | |
7733 | (license license:lgpl2.1+))) | |
dedbdacf CM |
7734 | |
7735 | (define-public kexec-tools | |
7736 | (package | |
7737 | (name "kexec-tools") | |
065d2cd6 | 7738 | (version "2.0.22") |
dedbdacf CM |
7739 | (source (origin |
7740 | (method url-fetch) | |
7741 | (uri (string-append "mirror://kernel.org/linux/utils/kernel" | |
7742 | "/kexec/kexec-tools-" version ".tar.xz")) | |
7743 | (sha256 | |
7744 | (base32 | |
065d2cd6 | 7745 | "1hj9mj6x3qs9c8x8mrri9xd3wsg3gwzbab3jfa5ry146xm4pzjcn")))) |
dedbdacf CM |
7746 | (build-system gnu-build-system) |
7747 | (arguments | |
7748 | ;; There are no automated tests. | |
7749 | '(#:tests? #f)) | |
7750 | (home-page "https://projects.horms.net/projects/kexec/") | |
7751 | (synopsis "Tools for booting directly into different kernels") | |
7752 | (description "This package provides the @code{kexec} program and ancillary | |
7753 | utilities. Using @code{kexec}, it is possible to boot directly into a new | |
7754 | kernel from the context of an already-running kernel, bypassing the normal | |
7755 | system boot process.") | |
7756 | (license license:gpl2))) | |
c0792d77 JBN |
7757 | |
7758 | (define-public cachefilesd | |
7759 | (package | |
7760 | (name "cachefilesd") | |
7761 | (version "0.10.10") | |
7762 | (source (origin | |
7763 | (method url-fetch) | |
7764 | (uri (string-append | |
7765 | "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells" | |
7766 | "/cachefilesd.git/snapshot/cachefilesd-" | |
7767 | version ".tar.gz")) | |
7768 | (sha256 | |
7769 | (base32 | |
7770 | "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi")))) | |
7771 | (build-system gnu-build-system) | |
7772 | (outputs '("out")) | |
7773 | (arguments | |
7774 | `(#:tests? #f ; there are no tests | |
7775 | #:make-flags | |
7776 | (let ((prefix-dir (lambda (var dir) | |
1ca44ae3 MB |
7777 | (string-append var "=" %output "/" dir)))) |
7778 | (list (string-append "CC=" ,(cc-for-target)) | |
c0792d77 JBN |
7779 | (prefix-dir "SBINDIR" "sbin/") |
7780 | (prefix-dir "ETCDIR" "etc/") | |
7781 | (prefix-dir "MANDIR" "share/man/"))) | |
7782 | #:phases (modify-phases %standard-phases (delete 'configure)))) | |
7783 | (home-page "https://people.redhat.com/~dhowells/cachefs/") | |
7784 | (synopsis "CacheFiles userspace management daemon") | |
7785 | (description "@code{cachefilesd} is a userspace daemon that manages the | |
7786 | cache data store that is used by network file systems such as @code{AFS} and | |
7787 | @code{NFS} to cache data locally on disk. The content of the cache is | |
7788 | persistent over reboots.") | |
7789 | (license license:gpl2+))) | |
b523b034 JS |
7790 | |
7791 | (define-public libbpf | |
7792 | (package | |
7793 | (name "libbpf") | |
c02cad6d | 7794 | (version "0.1.1") |
b523b034 JS |
7795 | (source |
7796 | (origin | |
7797 | (method git-fetch) | |
7798 | (uri (git-reference | |
7799 | (url "https://github.com/libbpf/libbpf") | |
7800 | (commit (string-append "v" version)))) | |
7801 | (file-name (git-file-name name version)) | |
7802 | (sha256 | |
7803 | (base32 | |
c02cad6d | 7804 | "0ilnnm4q22f8fagwp8kb37licy4ks861i2iqh2djsypqhnxvx3fv")))) |
b523b034 JS |
7805 | (build-system gnu-build-system) |
7806 | (native-inputs | |
7807 | `(("pkg-config" ,pkg-config))) | |
84e28531 TGR |
7808 | (propagated-inputs |
7809 | ;; In Requires.private of libbpf.pc. | |
b523b034 JS |
7810 | `(("libelf" ,libelf) |
7811 | ("zlib" ,zlib))) | |
7812 | (arguments | |
84e28531 | 7813 | `(#:tests? #f ; no tests |
b523b034 JS |
7814 | #:make-flags |
7815 | (list | |
36c737a9 TGR |
7816 | (string-append "PREFIX=" (assoc-ref %outputs "out")) |
7817 | (string-append "LIBDIR=$(PREFIX)/lib") | |
b523b034 JS |
7818 | (string-append |
7819 | "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc")) | |
7820 | #:phases | |
7821 | (modify-phases %standard-phases | |
7822 | (delete 'configure) | |
7823 | (add-before 'build 'pre-build | |
c02cad6d | 7824 | (lambda _ |
b523b034 JS |
7825 | (chdir "src") |
7826 | #t))))) | |
7827 | (home-page "https://github.com/libbpf/libbpf") | |
7828 | (synopsis "BPF CO-RE (Compile Once – Run Everywhere)") | |
7829 | (description | |
7830 | "Libbpf supports building BPF CO-RE-enabled applications, which, in | |
7831 | contrast to BCC, do not require the Clang/LLVM runtime or linux kernel | |
7832 | headers.") | |
7833 | (license `(,license:lgpl2.1 ,license:bsd-2)))) | |
cfd8daaf JS |
7834 | |
7835 | (define-public bcc | |
7836 | (package | |
7837 | (name "bcc") | |
c2538db5 | 7838 | (version "0.16.0") |
cfd8daaf JS |
7839 | (source |
7840 | (origin | |
7841 | (method git-fetch) | |
7842 | (uri (git-reference | |
7843 | (url "https://github.com/iovisor/bcc") | |
7844 | (commit (string-append "v" version)))) | |
7845 | (file-name (git-file-name name version)) | |
7846 | (sha256 | |
7847 | (base32 | |
c2538db5 | 7848 | "1367c0bzrpclvjvmk0sxgi49rh7j2f9izqk5a7g3yvawh1fmvvjh")))) |
cfd8daaf JS |
7849 | (build-system cmake-build-system) |
7850 | (native-inputs | |
7851 | `(("bison" ,bison) | |
7852 | ("flex" ,flex))) | |
7853 | (inputs | |
7854 | `(("clang-toolchain" ,clang-toolchain) | |
7855 | ("libbpf" ,(package-source libbpf)) | |
7856 | ;; LibElf required but libelf does not contain | |
7857 | ;; archives, only object files. | |
7858 | ;; https://github.com/iovisor/bcc/issues/504 | |
7859 | ("elfutils" ,elfutils) | |
7860 | ("linux-libre-headers" ,linux-libre-headers) | |
7861 | ("luajit" ,luajit) | |
7862 | ("python-wrapper" ,python-wrapper))) | |
7863 | (arguments | |
7864 | `(;; Tests all require root permissions and a "standard" file hierarchy. | |
7865 | #:tests? #f | |
7866 | #:configure-flags | |
7867 | (let ((revision ,version)) | |
7868 | `(,(string-append "-DREVISION=" revision))) | |
7869 | #:phases | |
7870 | (modify-phases %standard-phases | |
7871 | ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON". | |
7872 | (add-after 'unpack 'copy-libbpf | |
7873 | (lambda* (#:key inputs #:allow-other-keys) | |
7874 | (delete-file-recursively "src/cc/libbpf") | |
7875 | (copy-recursively | |
7876 | (assoc-ref inputs "libbpf") "src/cc/libbpf"))) | |
7877 | (add-after 'copy-libbpf 'substitute-libbc | |
7878 | (lambda* (#:key outputs #:allow-other-keys) | |
7879 | (substitute* "src/python/bcc/libbcc.py" | |
7880 | (("(libbcc\\.so.*)\\b" _ libbcc) | |
7881 | (string-append | |
7882 | (assoc-ref outputs "out") "/lib/" libbcc))))) | |
7883 | (add-after 'install 'wrap-tools | |
7884 | (lambda* (#:key outputs #:allow-other-keys) | |
7885 | (use-modules (ice-9 textual-ports)) | |
7886 | (let* ((out (assoc-ref outputs "out")) | |
7887 | (lib (string-append out "/lib")) | |
7888 | (tools (string-append out "/share/bcc/tools")) | |
7889 | (python-executable? | |
7890 | (lambda (filename _) | |
7891 | (call-with-input-file filename | |
7892 | (lambda (port) | |
7893 | (string-contains (get-line port) | |
7894 | "/bin/python")))))) | |
7895 | (for-each | |
7896 | (lambda (python-executable) | |
7897 | (format #t "Wrapping: ~A.~%" python-executable) | |
7898 | (wrap-program python-executable | |
7899 | `("PYTHONPATH" ":" prefix | |
7900 | (,(string-append lib | |
7901 | "/python" | |
7902 | ,(version-major+minor | |
7903 | (package-version python)) | |
7904 | "/site-packages"))))) | |
7905 | (find-files tools python-executable?)) | |
7906 | #t)))))) | |
7907 | (home-page "https://github.com/iovisor/bcc") | |
7908 | (synopsis "Tools for BPF on Linux") | |
7909 | (description | |
7910 | "BCC is a toolkit for creating efficient kernel tracing and manipulation | |
7911 | programs, and includes several useful tools and examples. It makes use of | |
7912 | extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature | |
7913 | that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1 | |
7914 | and above.") | |
7915 | (license license:asl2.0))) | |
c55acb07 JS |
7916 | |
7917 | (define-public bpftrace | |
7918 | (package | |
7919 | (name "bpftrace") | |
234558f4 | 7920 | (version "0.11.4") |
c55acb07 JS |
7921 | (source |
7922 | (origin | |
7923 | (method git-fetch) | |
7924 | (uri (git-reference | |
7925 | (url "https://github.com/iovisor/bpftrace") | |
7926 | (commit (string-append "v" version)))) | |
7927 | (file-name (git-file-name name version)) | |
7928 | (sha256 | |
234558f4 | 7929 | (base32 "0y4qgm2cpccrsm20rnh92hqplddqsc5q5zhw9nqn2igm3h9i0z7h")) |
c55acb07 JS |
7930 | (patches (search-patches "bpftrace-disable-bfd-disasm.patch")))) |
7931 | (build-system cmake-build-system) | |
7932 | (native-inputs | |
7933 | `(("bison" ,bison) | |
7934 | ("flex" ,flex))) | |
7935 | (inputs | |
7936 | `(("bcc" ,bcc) | |
7937 | ("clang-toolchain" ,clang-toolchain) | |
7938 | ("elfutils" ,elfutils) | |
7939 | ("libbpf" ,libbpf) | |
7940 | ("linux-libre-headers" ,linux-libre-headers))) | |
7941 | (arguments | |
7942 | `(#:tests? #f ;Tests require googletest sources. | |
7943 | #:configure-flags | |
7944 | '("-DBUILD_TESTING=OFF" | |
7945 | ;; FIXME: libbfd misses some link dependencies, when fixed, remove | |
7946 | ;; the associated patch. | |
7947 | "-DHAVE_BFD_DISASM=OFF"))) | |
7948 | (home-page "https://github.com/iovisor/bpftrace") | |
7949 | (synopsis "High-level tracing language for Linux eBPF") | |
7950 | (description | |
7951 | "bpftrace is a high-level tracing language for Linux enhanced Berkeley | |
7952 | Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses | |
7953 | LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for | |
7954 | interacting with the Linux BPF system, as well as existing Linux tracing | |
7955 | capabilities: kernel dynamic tracing (kprobes), user-level dynamic | |
7956 | tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk | |
7957 | and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was | |
7958 | created by Alastair Robertson.") | |
7959 | (license license:asl2.0))) | |
629982c0 DM |
7960 | |
7961 | (define-public ttyebus-linux-module | |
7962 | (let ((revision "0") | |
7963 | (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")) | |
7964 | (package | |
7965 | (name "ttyebus-linux-module") | |
7966 | (version (git-version "1.5" revision commit)) | |
7967 | (source | |
7968 | (origin | |
7969 | (method git-fetch) | |
7970 | (uri (git-reference | |
8ed4c468 | 7971 | (url "https://github.com/eBUS/ttyebus") |
629982c0 DM |
7972 | (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))) |
7973 | (file-name (git-file-name name version)) | |
7974 | (sha256 | |
7975 | (base32 | |
7976 | "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani")))) | |
7977 | (supported-systems '("armhf-linux" "aarch64-linux")) | |
7978 | (build-system linux-module-build-system) | |
7979 | (arguments | |
7980 | `(#:tests? #f)) | |
7981 | (home-page "https://github.com/eBUS/ttyebus") | |
7982 | (synopsis "Low-latency Raspberry Pi UART driver") | |
7983 | (description "This package provides a Linux kernel module that will | |
7984 | provide a serial device @code{/dev/ttyebus} with almost no latency upon | |
7985 | receiving. It is dedicated to the PL011 UART of the Raspberry Pi.") | |
7986 | (license license:gpl3+)))) | |
d868655a OP |
7987 | |
7988 | (define-public ipset | |
7989 | (package | |
7990 | (name "ipset") | |
ce62ca5b TGR |
7991 | (version "7.11") |
7992 | (source | |
7993 | (origin | |
7994 | (method url-fetch) | |
7995 | (uri (string-append "https://ipset.netfilter.org/" | |
7996 | "ipset-" version ".tar.bz2")) | |
7997 | (sha256 | |
7998 | (base32 "0zdzp9fhpp6hmirzxy7w27fb9xx9lxd2ykxbn8by7ngi62nvll9i")))) | |
d868655a OP |
7999 | (build-system gnu-build-system) |
8000 | (inputs | |
8001 | `(("libmnl" ,libmnl))) | |
8002 | (native-inputs | |
8003 | `(("pkg-config" ,pkg-config))) | |
8004 | (arguments | |
8005 | `(#:configure-flags '("--with-kmod=no"))) | |
079bdcdd | 8006 | (home-page "https://ipset.netfilter.org/") |
d868655a OP |
8007 | (synopsis "Administration tool for IP sets") |
8008 | (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which | |
8009 | can be administered by the ipset utility. Depending on the type, | |
8010 | currently an IP set may store IP addresses, (TCP/UDP) port numbers or | |
8011 | IP addresses with MAC addresses in a way which ensures lightning speed | |
8012 | when matching an entry against a set. | |
8013 | ||
8014 | If you want to | |
8015 | @itemize @bullet | |
8016 | @item store multiple IP addresses or port numbers and match against the entire | |
8017 | collection using a single iptables rule. | |
8018 | @item dynamically update iptables rules against IP addresses or ports without | |
8019 | performance penalty. | |
8020 | @item express complex IP address and ports based rulesets with a single | |
8021 | iptables rule and benefit from the speed of IP sets. | |
8022 | @end itemize\n | |
8023 | then IP sets may be the proper tool for you.") | |
8024 | (license license:gpl2+))) | |
350e61bc GH |
8025 | |
8026 | (define-public liburing | |
8027 | (package | |
8028 | (name "liburing") | |
8029 | (version "0.7") | |
8030 | (source (origin | |
8031 | (method git-fetch) | |
8032 | (uri (git-reference | |
8033 | (url "https://git.kernel.dk/liburing") | |
8034 | (commit (string-append "liburing-" version)))) | |
8035 | (file-name (git-file-name name version)) | |
8036 | (sha256 | |
8037 | (base32 | |
8038 | "15z44l7y4c6s6dlf7v8lq4znlsjbja2r4ifbni0l8cdcnq0w3zh3")))) | |
8039 | (build-system gnu-build-system) | |
8040 | (arguments | |
8041 | `(;; Tests are dependent on kernel version and features | |
8042 | #:tests? #f | |
8043 | #:phases | |
8044 | (modify-phases %standard-phases | |
8045 | (replace 'configure | |
8046 | ;; configure fails if it is followed by SHELL, CONFIG_SHELL, | |
8047 | ;; --enable-fast-install, and --build | |
8048 | (lambda* (#:key outputs #:allow-other-keys) | |
8049 | (let ((out (assoc-ref outputs "out"))) | |
8050 | (setenv "SHELL" (which "sh")) | |
8051 | (setenv "CONFIG_SHELL" (which "sh")) | |
8052 | (invoke "./configure" (string-append "--prefix=" out)))))))) | |
8053 | (home-page "https://github.com/axboe/liburing") | |
8054 | (synopsis "Interface to the Linux kernel @code{io_uring} interface") | |
8055 | (description "This is the io_uring library, liburing. liburing provides | |
8056 | helpers to setup and teardown io_uring instances, and also a simplified | |
8057 | interface for applications that don't need (or want) to deal with the full | |
8058 | kernel side implementation.") | |
8059 | (license license:expat))) | |
764fbd0a | 8060 | |
8061 | (define-public erofs-utils | |
8062 | (package | |
8063 | (name "erofs-utils") | |
26bd3dc9 | 8064 | (version "1.2.1") |
764fbd0a | 8065 | (source |
8066 | (origin | |
8067 | (method git-fetch) | |
8068 | (uri (git-reference | |
8069 | (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git") | |
8070 | (commit (string-append "v" version)))) | |
8071 | (file-name (git-file-name name version)) | |
8072 | (sha256 | |
26bd3dc9 | 8073 | (base32 "1vb4mxsb59g29x7l22cffsqa8x743sra4j5zbmx89hjwpwm9vvcg")))) |
764fbd0a | 8074 | (build-system gnu-build-system) |
8075 | (inputs | |
8076 | `(("lz4" ,lz4) | |
8077 | ("libuuid" ,util-linux "lib"))) | |
8078 | (native-inputs | |
8079 | `(("autoconf" ,autoconf) | |
8080 | ("automake" ,automake) | |
8081 | ("libtool" ,libtool) | |
8082 | ("pkg-config" ,pkg-config))) | |
8083 | (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/") | |
11e711f8 | 8084 | (synopsis "User-space tools for EROFS file system") |
764fbd0a | 8085 | (description "EROFS (Enhanced Read-Only File System) is a compressed, |
11e711f8 TGR |
8086 | read-only file system optimized for resource-scarce devices. This package |
8087 | provides user-space tools for creating EROFS file systems.") | |
764fbd0a | 8088 | (license license:gpl2+))) |
794e26fd W |
8089 | |
8090 | (define-public rasdaemon | |
8091 | (package | |
8092 | (name "rasdaemon") | |
38adfcd6 | 8093 | (version "0.6.7") |
794e26fd W |
8094 | (source |
8095 | (origin | |
8096 | (method git-fetch) | |
8097 | (uri (git-reference | |
8098 | (url "https://github.com/mchehab/rasdaemon") | |
8099 | (commit (string-append "v" version)))) | |
8100 | (file-name (git-file-name name version)) | |
8101 | (sha256 | |
38adfcd6 | 8102 | (base32 "12ih96jwmr7imp9zyckf9zjqqm5ra1kv5fj6kbw71y6yl31069dz")))) |
794e26fd W |
8103 | (native-inputs `(("autoconf" ,autoconf) |
8104 | ("automake" ,automake) | |
8105 | ("libtool" ,libtool))) | |
8106 | (inputs `(("sqlite" ,sqlite))) | |
8107 | (arguments | |
38adfcd6 TGR |
8108 | `(#:configure-flags |
8109 | (list "--enable-all" | |
8110 | ;; Don't install unused /etc/sysconfig/rasdaemon environment file. | |
8111 | "--with-sysconfdefdir=." | |
8112 | "--localstatedir=/var") | |
794e26fd W |
8113 | #:phases |
8114 | (modify-phases %standard-phases | |
8115 | (add-before 'configure 'munge-autotools | |
8116 | (lambda _ | |
8117 | ;; For some reason upstream forces sysconfdir=/etc. This results | |
8118 | ;; in EPERM during the install phase. Removing the offending | |
8119 | ;; line lets sysconfdir correctly pick up DESTDIR. | |
8120 | (substitute* "configure.ac" | |
8121 | (("^test .* sysconfdir=/etc\n$") "")) | |
8122 | ;; Upstream tries to create /var/lib/rasdaemon at install time. | |
8123 | ;; This results in EPERM on guix. Instead, the service should | |
8124 | ;; create this at activation time. | |
8125 | (substitute* "Makefile.am" | |
8126 | (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") ""))))))) | |
8127 | (build-system gnu-build-system) | |
8128 | (home-page "https://github.com/mchehab/rasdaemon") | |
14173cf4 TGR |
8129 | (synopsis "Platform Reliability, Availability, and Serviceability tools") |
8130 | (description | |
2fd903c7 AAG |
8131 | "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability |
8132 | Availability and Serviceability} reports from Linux kernel trace events. | |
14173cf4 TGR |
8133 | These trace events are logged in @file{/sys/kernel/debug/tracing} and reported |
8134 | through standard log mechanisms like syslog.") | |
794e26fd | 8135 | (license license:gpl2))) |