1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2021 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
12 ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
13 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
14 ;;; Copyright © 2016, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
19 ;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
22 ;;; Copyright © 2017, 2018, 2020 Leo Famulari <leo@famulari.name>
23 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
24 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
25 ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
26 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
27 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
30 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
31 ;;; Copyright © 2018, 2020 Brendan Tildesley <mail@brendan.scot>
32 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
33 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
34 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
35 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
36 ;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
37 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
38 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
39 ;;; Copyright © 2019, 2020 Brice Waegeneire <brice@waegenei.re>
40 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
41 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
42 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
43 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
44 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
45 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
46 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
47 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
48 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
49 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
50 ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
51 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
52 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
53 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
54 ;;; Copyright © 2020 David Dashyan <mail@davie.li>
55 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
56 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
58 ;;; This file is part of GNU Guix.
60 ;;; GNU Guix is free software; you can redistribute it and/or modify it
61 ;;; under the terms of the GNU General Public License as published by
62 ;;; the Free Software Foundation; either version 3 of the License, or (at
63 ;;; your option) any later version.
65 ;;; GNU Guix is distributed in the hope that it will be useful, but
66 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
67 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
68 ;;; GNU General Public License for more details.
70 ;;; You should have received a copy of the GNU General Public License
71 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
73 (define-module (gnu packages linux)
74 #:use-module (gnu packages)
75 #:use-module (gnu packages acl)
76 #:use-module (gnu packages admin)
77 #:use-module (gnu packages algebra)
78 #:use-module (gnu packages audio)
79 #:use-module (gnu packages autotools)
80 #:use-module (gnu packages backup)
81 #:use-module (gnu packages base)
82 #:use-module (gnu packages bash)
83 #:use-module (gnu packages bison)
84 #:use-module (gnu packages boost)
85 #:use-module (gnu packages calendar)
86 #:use-module (gnu packages check)
87 #:use-module (gnu packages cpio)
88 #:use-module (gnu packages crypto)
89 #:use-module (gnu packages cryptsetup)
90 #:use-module (gnu packages compression)
91 #:use-module (gnu packages dbm)
92 #:use-module (gnu packages datastructures)
93 #:use-module (gnu packages docbook)
94 #:use-module (gnu packages documentation)
95 #:use-module (gnu packages elf)
96 #:use-module (gnu packages flex)
97 #:use-module (gnu packages file)
98 #:use-module (gnu packages freedesktop)
99 #:use-module (gnu packages gawk)
100 #:use-module (gnu packages gcc)
101 #:use-module (gnu packages gettext)
102 #:use-module (gnu packages glib)
103 #:use-module (gnu packages golang)
104 #:use-module (gnu packages gperf)
105 #:use-module (gnu packages gstreamer)
106 #:use-module (gnu packages gtk)
107 #:use-module (gnu packages haskell-apps)
108 #:use-module (gnu packages haskell-xyz)
109 #:use-module (gnu packages libunwind)
110 #:use-module (gnu packages libusb)
111 #:use-module (gnu packages llvm)
112 #:use-module (gnu packages lua)
113 #:use-module (gnu packages man)
114 #:use-module (gnu packages maths)
115 #:use-module (gnu packages multiprecision)
116 #:use-module (gnu packages ncurses)
117 #:use-module (gnu packages netpbm)
118 #:use-module (gnu packages networking)
119 #:use-module (gnu packages ninja)
120 #:use-module (gnu packages nss)
121 #:use-module (gnu packages perl)
122 #:use-module (gnu packages pciutils)
123 #:use-module (gnu packages pkg-config)
124 #:use-module (gnu packages popt)
125 #:use-module (gnu packages pulseaudio)
126 #:use-module (gnu packages python)
127 #:use-module (gnu packages python-xyz)
128 #:use-module (gnu packages readline)
129 #:use-module (gnu packages rrdtool)
130 #:use-module (gnu packages samba)
131 #:use-module (gnu packages sdl)
132 #:use-module (gnu packages serialization)
133 #:use-module (gnu packages slang)
134 #:use-module (gnu packages sqlite)
135 #:use-module (gnu packages texinfo)
136 #:use-module (gnu packages tls)
137 #:use-module (gnu packages valgrind)
138 #:use-module (gnu packages video)
139 #:use-module (gnu packages vulkan)
140 #:use-module (gnu packages web)
141 #:use-module (gnu packages xiph)
142 #:use-module (gnu packages xml)
143 #:use-module (gnu packages xdisorg)
144 #:use-module (gnu packages xorg)
145 #:use-module (gnu packages groff)
146 #:use-module (gnu packages rsync)
147 #:use-module (gnu packages selinux)
148 #:use-module (gnu packages swig)
149 #:use-module (guix build-system cmake)
150 #:use-module (guix build-system gnu)
151 #:use-module (guix build-system go)
152 #:use-module (guix build-system meson)
153 #:use-module (guix build-system python)
154 #:use-module (guix build-system trivial)
155 #:use-module (guix build-system linux-module)
156 #:use-module (guix download)
157 #:use-module (guix git-download)
158 #:use-module ((guix licenses) #:prefix license:)
159 #:use-module (guix packages)
160 #:use-module (guix gexp)
161 #:use-module (guix store)
162 #:use-module (guix monads)
163 #:use-module (guix utils)
164 #:use-module (guix deprecation) ;for libcap/next
165 #:use-module (srfi srfi-1)
166 #:use-module (srfi srfi-2)
167 #:use-module (srfi srfi-26)
168 #:use-module (ice-9 match))
170 (define-public (system->linux-architecture arch)
171 "Return the Linux architecture name for ARCH, a Guix system name such as
172 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
173 (let ((arch (car (string-split arch #\-))))
174 (cond ((string=? arch "i686") "i386")
175 ((string-prefix? "mips" arch) "mips")
176 ((string-prefix? "arm" arch) "arm")
177 ((string-prefix? "aarch64" arch) "arm64")
178 ((string-prefix? "alpha" arch) "alpha")
179 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
180 ((string-prefix? "s390" arch) "s390")
181 ((string-prefix? "riscv" arch) "riscv")
184 (define-public (system->defconfig system)
185 "Some systems (notably powerpc-linux) require a special target for kernel
186 defconfig. Return the appropriate make target if applicable, otherwise return
188 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
189 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
190 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
195 ;;; Kernel source code deblobbing.
198 (define (linux-libre-deblob-scripts version
201 (list (version-major+minor version)
204 (uri (string-append "https://linux-libre.fsfla.org"
205 "/pub/linux-libre/releases/" version "-gnu/"
206 "deblob-" (version-major+minor version)))
207 (file-name (string-append "linux-libre-deblob-"
209 (sha256 deblob-hash))
212 (uri (string-append "https://linux-libre.fsfla.org"
213 "/pub/linux-libre/releases/" version "-gnu/"
215 (file-name (string-append "linux-libre-deblob-check-" version))
216 (sha256 deblob-check-hash))))
218 (define* (computed-origin-method gexp-promise hash-algo hash
219 #:optional (name "source")
220 #:key (system (%current-system))
221 (guile (default-guile)))
222 "Return a derivation that executes the G-expression that results
223 from forcing GEXP-PROMISE."
224 (mlet %store-monad ((guile (package->derivation guile system)))
225 (gexp->derivation (or name "computed-origin")
227 #:graft? #f ;nothing to graft
229 #:guile-for-build guile)))
231 (define (make-linux-libre-source version
234 "Return a 'computed' origin that generates a Linux-libre tarball from the
235 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
236 (match deblob-scripts
237 ((deblob-version (? origin? deblob) (? origin? deblob-check))
238 (unless (string=? deblob-version (version-major+minor version))
239 ;; The deblob script cannot be expected to work properly on a
240 ;; different version (major+minor) of Linux, even if no errors
241 ;; are signaled during execution.
242 (error "deblob major+minor version mismatch"))
244 (method computed-origin-method)
245 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
249 (with-imported-modules '((guix build utils))
251 (use-modules (guix build utils)
256 (setvbuf (current-output-port) 'line)
258 (let ((dir (string-append "linux-" #$version)))
261 (set-path-environment-variable
264 #+(canonical-package bash)
265 #+(canonical-package coreutils)
266 #+(canonical-package diffutils)
267 #+(canonical-package findutils)
268 #+(canonical-package patch)
269 #+(canonical-package xz)
270 #+(canonical-package sed)
271 #+(canonical-package grep)
272 #+(canonical-package bzip2)
273 #+(canonical-package gzip)
274 #+(canonical-package tar)
275 #+(canonical-package gawk)
278 (with-directory-excursion "/tmp/bin"
280 (copy-file #+deblob "deblob")
281 (chmod "deblob" #o755)
282 (substitute* "deblob"
283 (("/bin/sh") (which "sh")))
285 (copy-file #+deblob-check "deblob-check")
286 (chmod "deblob-check" #o755)
287 (substitute* "deblob-check"
288 (("/bin/sh") (which "sh"))
289 (("/bin/sed") (which "sed"))
290 (("/usr/bin/python") (which "python"))))
292 (if (file-is-directory? #+upstream-source)
294 (format #t "Copying upstream linux source...~%")
295 (invoke "cp" "--archive" #+upstream-source dir)
296 (invoke "chmod" "--recursive" "u+w" dir))
298 (format #t "Unpacking upstream linux tarball...~%")
299 (invoke "tar" "xf" #$upstream-source)
302 (and (not (member name '("." "..")))
303 (file-is-directory? name))))
305 (unless (string=? dir unpacked-dir)
306 (rename-file unpacked-dir dir)))
308 (error "multiple directories found" dirs)))))
310 (with-directory-excursion dir
311 (format #t "Running deblob script...~%")
312 (invoke "/tmp/bin/deblob"))
314 (format #t "~%Packing new Linux-libre tarball...~%")
315 (invoke "tar" "cvfa" #$output
316 ;; Avoid non-determinism in the archive.
324 (format #t "~%Scanning the generated tarball for blobs...~%")
325 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
333 (define (linux-libre-urls version)
334 "Return a list of URLs for Linux-Libre VERSION."
336 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
337 version "-gnu/linux-libre-" version "-gnu.tar.xz")
339 ;; XXX: Work around <http://bugs.gnu.org/14851>.
341 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
342 version "-gnu.tar.xz")
344 ;; Maybe this URL will become valid eventually.
346 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
347 version "-gnu.tar.xz")))
349 (define (%upstream-linux-source version hash)
352 (uri (string-append "mirror://kernel.org"
353 "/linux/kernel/v" (version-major version) ".x/"
354 "linux-" version ".tar.xz"))
357 ;; The current "stable" kernels. That is, the most recently released major
358 ;; versions that are still supported upstream.
359 (define-public linux-libre-5.12-version "5.12.9")
360 (define deblob-scripts-5.12
361 (linux-libre-deblob-scripts
362 linux-libre-5.12-version
363 (base32 "1vdsr9y4gckknrbqcjyfakwva3k0vb5zcivzk3k1s9mh7qp9dils")
364 (base32 "1p1jzrci97sipjdx3h0vmdnw35z2vyvczinxmp65xi1ja7ww0g14")))
365 (define-public linux-libre-5.12-pristine-source
366 (let ((version linux-libre-5.12-version)
367 (hash (base32 "0vg71h8r90fl01a8khyf1776y76rgqisxafky89cswa2fpsvxyn7")))
368 (make-linux-libre-source version
369 (%upstream-linux-source version hash)
370 deblob-scripts-5.12)))
372 ;; The "longterm" kernels — the older releases with long-term upstream support.
373 ;; Here are the support timelines:
374 ;; <https://www.kernel.org/category/releases.html>
375 (define-public linux-libre-5.10-version "5.10.42")
376 (define deblob-scripts-5.10
377 (linux-libre-deblob-scripts
378 linux-libre-5.10-version
379 (base32 "1rmnx1px4sizs2lq831yd2g9dyflg0vmykz3cv9443x2a2vwy81f")
380 (base32 "1zsr02zmpx3968277sy8pfs2mdlgh86ifymwyj0r56wnhzf5q6hk")))
381 (define-public linux-libre-5.10-pristine-source
382 (let ((version linux-libre-5.10-version)
383 (hash (base32 "1r86v6q7ml7zv001f25w3h667nqqy39439s94vnqsyyn7g3jg84b")))
384 (make-linux-libre-source version
385 (%upstream-linux-source version hash)
386 deblob-scripts-5.10)))
388 (define-public linux-libre-5.4-version "5.4.123")
389 (define deblob-scripts-5.4
390 (linux-libre-deblob-scripts
391 linux-libre-5.4-version
392 (base32 "12g1wm7xvjvmjanbgg0ahxm4vs2n5bvicfnnnag4h35vl4q3lggg")
393 (base32 "1xghbbnaisjd0k1klbyn1p7r6r4x5a1bpmkm56a3gh2zvw4s7mj8")))
394 (define-public linux-libre-5.4-pristine-source
395 (let ((version linux-libre-5.4-version)
396 (hash (base32 "1pi223dls52piw65s3v4ml23wdyy73xpbdvp511187b6zgzk7zlf")))
397 (make-linux-libre-source version
398 (%upstream-linux-source version hash)
399 deblob-scripts-5.4)))
401 (define-public linux-libre-4.19-version "4.19.192")
402 (define deblob-scripts-4.19
403 (linux-libre-deblob-scripts
404 linux-libre-4.19-version
405 (base32 "1jfcz4lnm44b3xzrkiipvw35kl0vvdvhr2pg7jfwf02f6qbvay18")
406 (base32 "1jiaw0as1ippkrjdpd52657w5mz9qczg3y2hlra7m9k0xawwiqlf")))
407 (define-public linux-libre-4.19-pristine-source
408 (let ((version linux-libre-4.19-version)
409 (hash (base32 "1680dz4wjg721a8lqwh6ijd90zcr2f3wzcvhwgn3shbwgjkwsk87")))
410 (make-linux-libre-source version
411 (%upstream-linux-source version hash)
412 deblob-scripts-4.19)))
414 (define-public linux-libre-4.14-version "4.14.234")
415 (define deblob-scripts-4.14
416 (linux-libre-deblob-scripts
417 linux-libre-4.14-version
418 (base32 "07afckszdm4pq008i6ij0pxpw2rpgi5q931nxh6dxcczpicvwbc9")
419 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
420 (define-public linux-libre-4.14-pristine-source
421 (let ((version linux-libre-4.14-version)
422 (hash (base32 "1mwqb9sq6qd9angl3xysdsrfpgppf46g3kiwg1svqgpgrx7cqn1b")))
423 (make-linux-libre-source version
424 (%upstream-linux-source version hash)
425 deblob-scripts-4.14)))
427 (define-public linux-libre-4.9-version "4.9.270")
428 (define deblob-scripts-4.9
429 (linux-libre-deblob-scripts
430 linux-libre-4.9-version
431 (base32 "1w8cb8w1cpcwswc3rxq6vwjafw6yy0igib34rrm93ag5h6inncfv")
432 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
433 (define-public linux-libre-4.9-pristine-source
434 (let ((version linux-libre-4.9-version)
435 (hash (base32 "0ck5abzpla291gcxrxjindj5szgcvmb2fwfilvdnzc6pnqk00ay3")))
436 (make-linux-libre-source version
437 (%upstream-linux-source version hash)
438 deblob-scripts-4.9)))
440 (define-public linux-libre-4.4-version "4.4.270")
441 (define deblob-scripts-4.4
442 (linux-libre-deblob-scripts
443 linux-libre-4.4-version
444 (base32 "1lid4k7g947yi3hcjj0lz0fnssawbph3jsy67vrv57l5imrhv3zs")
445 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
446 (define-public linux-libre-4.4-pristine-source
447 (let ((version linux-libre-4.4-version)
448 (hash (base32 "1lz48gv1v3wvw9xvd3y9q4py7ii1g9fj4dwyvvjdzbipyw7s21pq")))
449 (make-linux-libre-source version
450 (%upstream-linux-source version hash)
451 deblob-scripts-4.4)))
453 (define %boot-logo-patch
454 ;; Linux-Libre boot logo featuring Freedo and a gnu.
457 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
458 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
461 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
463 (define %linux-libre-arm-export-__sync_icache_dcache-patch
467 "https://salsa.debian.org/kernel-team/linux"
468 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
469 "/debian/patches/bugfix/arm/"
470 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
471 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
473 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
475 (define (source-with-patches source patches)
478 (patches (append (origin-patches source)
481 (define-public linux-libre-5.12-source
482 (source-with-patches linux-libre-5.12-pristine-source
483 (list %boot-logo-patch
484 %linux-libre-arm-export-__sync_icache_dcache-patch
485 ;; Pinebook Pro patch to fix LCD display
487 "linux-libre-arm64-generic-pinebook-lcd.patch"))))
489 (define-public linux-libre-5.10-source
490 (source-with-patches linux-libre-5.10-pristine-source
491 (list %boot-logo-patch
492 %linux-libre-arm-export-__sync_icache_dcache-patch
493 ;; Pinebook Pro patch to fix LCD display
495 "linux-libre-arm64-generic-pinebook-lcd.patch"))))
497 (define-public linux-libre-5.4-source
498 (source-with-patches linux-libre-5.4-pristine-source
499 (list %boot-logo-patch
500 %linux-libre-arm-export-__sync_icache_dcache-patch
501 ;; Pinebook Pro patch from linux-next,
502 ;; can be dropped for linux-libre 5.7
504 "linux-libre-support-for-Pinebook-Pro.patch"))))
506 (define-public linux-libre-4.19-source
507 (source-with-patches linux-libre-4.19-pristine-source
508 (list %boot-logo-patch
509 %linux-libre-arm-export-__sync_icache_dcache-patch)))
511 (define-public linux-libre-4.14-source
512 (source-with-patches linux-libre-4.14-pristine-source
513 (list %boot-logo-patch)))
515 (define-public linux-libre-4.9-source
516 (source-with-patches linux-libre-4.9-pristine-source
517 (list %boot-logo-patch)))
519 (define-public linux-libre-4.4-source
520 (source-with-patches linux-libre-4.4-pristine-source
521 (list %boot-logo-patch)))
528 (define (make-linux-libre-headers version hash-string)
529 (make-linux-libre-headers* version
532 (uri (linux-libre-urls version))
533 (sha256 (base32 hash-string)))))
535 (define (make-linux-libre-headers* version source)
537 (name "linux-libre-headers")
540 (build-system gnu-build-system)
541 (native-inputs `(("perl" ,perl)
542 ,@(if (version>=? version "4.16")
546 ,@(if (version>=? version "5.3")
550 `(#:modules ((guix build gnu-build-system)
554 (modify-phases %standard-phases
558 (let ((arch ,(system->linux-architecture
559 (or (%current-target-system)
561 (defconfig ,(system->defconfig
562 (or (%current-target-system)
563 (%current-system)))))
565 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
566 (invoke "make" defconfig)
567 (invoke "make" "mrproper" "headers_check"))))
569 (lambda* (#:key outputs #:allow-other-keys)
570 (let ((out (assoc-ref outputs "out")))
572 (string-append "INSTALL_HDR_PATH=" out)
575 (mkdir (string-append out "/include/config"))
576 (call-with-output-file
578 "/include/config/kernel.release")
580 (format p "~a-default~%" ,version)))
582 ;; Remove the '.install' and '..install.cmd' files; the
583 ;; latter contains store paths, which pulls in bootstrap
584 ;; binaries in the build environment, and prevents bit
585 ;; reproducibility for the bootstrap binaries.
586 (for-each delete-file (find-files out "\\.install"))
589 #:allowed-references ()
591 (home-page "https://www.gnu.org/software/linux-libre/")
592 (synopsis "GNU Linux-Libre kernel headers")
593 (description "Headers of the Linux-Libre kernel.")
594 (license license:gpl2)))
596 (define-public linux-libre-headers-5.12
597 (make-linux-libre-headers* linux-libre-5.12-version
598 linux-libre-5.12-source))
600 (define-public linux-libre-headers-5.10
601 (make-linux-libre-headers* linux-libre-5.10-version
602 linux-libre-5.10-source))
604 (define-public linux-libre-headers-5.4
605 (make-linux-libre-headers* linux-libre-5.4-version
606 linux-libre-5.4-source))
608 (define-public linux-libre-headers-4.19
609 (make-linux-libre-headers* linux-libre-4.19-version
610 linux-libre-4.19-source))
612 (define-public linux-libre-headers-4.14
613 (make-linux-libre-headers* linux-libre-4.14-version
614 linux-libre-4.14-source))
616 (define-public linux-libre-headers-4.9
617 (make-linux-libre-headers* linux-libre-4.9-version
618 linux-libre-4.9-source))
620 (define-public linux-libre-headers-4.4
621 (make-linux-libre-headers* linux-libre-4.4-version
622 linux-libre-4.4-source))
624 ;; The following package is used in the early bootstrap, and thus must be kept
625 ;; stable and with minimal build requirements.
626 (define-public linux-libre-headers-5.4.20
627 (make-linux-libre-headers "5.4.20"
628 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
630 (define-public linux-libre-headers linux-libre-headers-5.4.20)
634 ;;; Kernel configurations.
637 (define* (kernel-config arch #:key variant)
638 "Return the absolute file name of the Linux-Libre build configuration file
639 for ARCH and optionally VARIANT, or #f if there is no such configuration."
640 (let* ((name (string-append (if variant (string-append variant "-") "")
641 (if (string=? "i386" arch) "i686" arch) ".conf"))
642 (file (string-append "linux-libre/" name)))
643 (search-auxiliary-file file)))
645 (define %default-extra-linux-options
646 `(;; Some very mild hardening.
647 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
648 ;; All kernels should have NAMESPACES options enabled
649 ("CONFIG_NAMESPACES" . #t)
650 ("CONFIG_UTS_NS" . #t)
651 ("CONFIG_IPC_NS" . #t)
652 ("CONFIG_USER_NS" . #t)
653 ("CONFIG_PID_NS" . #t)
654 ("CONFIG_NET_NS" . #t)
655 ;; Various options needed for elogind service:
656 ;; https://issues.guix.gnu.org/43078
657 ("CONFIG_CGROUP_FREEZER" . #t)
658 ("CONFIG_BLK_CGROUP" . #t)
659 ("CONFIG_CGROUP_WRITEBACK" . #t)
660 ("CONFIG_CGROUP_SCHED" . #t)
661 ("CONFIG_CGROUP_PIDS" . #t)
662 ("CONFIG_CGROUP_FREEZER" . #t)
663 ("CONFIG_CGROUP_DEVICE" . #t)
664 ("CONFIG_CGROUP_CPUACCT" . #t)
665 ("CONFIG_CGROUP_PERF" . #t)
666 ("CONFIG_SOCK_CGROUP_DATA" . #t)
667 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
668 ("CONFIG_CGROUP_NET_PRIO" . #t)
669 ("CONFIG_CGROUP_NET_CLASSID" . #t)
670 ("CONFIG_MEMCG" . #t)
671 ("CONFIG_MEMCG_SWAP" . #t)
672 ("CONFIG_MEMCG_KMEM" . #t)
673 ("CONFIG_CPUSETS" . #t)
674 ("CONFIG_PROC_PID_CPUSET" . #t)
675 ;; Allow disk encryption by default
676 ("CONFIG_DM_CRYPT" . m)
677 ;; Modules required for initrd:
678 ("CONFIG_NET_9P" . m)
679 ("CONFIG_NET_9P_VIRTIO" . m)
680 ("CONFIG_VIRTIO_BLK" . m)
681 ("CONFIG_VIRTIO_NET" . m)
682 ("CONFIG_VIRTIO_PCI" . m)
683 ("CONFIG_VIRTIO_BALLOON" . m)
684 ("CONFIG_VIRTIO_MMIO" . m)
685 ("CONFIG_FUSE_FS" . m)
687 ("CONFIG_9P_FS" . m)))
689 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
690 (define %bpf-extra-linux-options
691 `(;; Needed for probes
692 ("CONFIG_UPROBE_EVENTS" . #t)
693 ("CONFIG_KPROBE_EVENTS" . #t)
694 ;; kheaders module also helpful for tracing
695 ("CONFIG_IKHEADERS" . #t)
697 ("CONFIG_BPF_SYSCALL" . #t)
698 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
699 ;; optional, for tc filters
700 ("CONFIG_NET_CLS_BPF" . m)
701 ;; optional, for tc actions
702 ("CONFIG_NET_ACT_BPF" . m)
703 ("CONFIG_BPF_JIT" . #t)
704 ;; for Linux kernel versions 4.1 through 4.6
705 ;; ("CONFIG_HAVE_BPF_JIT" . y)
706 ;; for Linux kernel versions 4.7 and later
707 ("CONFIG_HAVE_EBPF_JIT" . #t)
708 ;; optional, for kprobes
709 ("CONFIG_BPF_EVENTS" . #t)
711 ("CONFIG_IKHEADERS" . #t)))
713 (define (config->string options)
714 (string-join (map (match-lambda
716 (string-append option "=m"))
718 (string-append option "=y"))
720 (string-append option "=n")))
726 ;;; Kernel package utilities.
729 (define* (make-linux-libre version hash-string supported-systems
731 ;; A function that takes an arch and a variant.
732 ;; See kernel-config for an example.
734 (configuration-file #f)
735 (defconfig "defconfig")
736 (extra-options %default-extra-linux-options)
737 (patches (list %boot-logo-patch)))
738 (make-linux-libre* version
741 (uri (linux-libre-urls version))
742 (sha256 (base32 hash-string))
745 #:extra-version extra-version
746 #:configuration-file configuration-file
747 #:defconfig defconfig
748 #:extra-options extra-options))
750 (define* (make-linux-libre* version source supported-systems
752 ;; A function that takes an arch and a variant.
753 ;; See kernel-config for an example.
755 (configuration-file #f)
756 (defconfig "defconfig")
757 (extra-options %default-extra-linux-options))
759 (name (if extra-version
760 (string-append "linux-libre-" extra-version)
764 (supported-systems supported-systems)
765 (build-system gnu-build-system)
770 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
774 ;; These are needed to compile the GCC plugins.
779 ,@(match (and configuration-file
781 (system->linux-architecture
782 (or (%current-target-system) (%current-system)))
783 #:variant (version-major+minor version)))
784 (#f ;no config for this platform
787 `(("kconfig" ,config))))))
789 `(#:modules ((guix build gnu-build-system)
796 (modify-phases %standard-phases
797 (add-after 'unpack 'patch-/bin/pwd
799 (substitute* (find-files "." "^Makefile(\\.include)?$")
800 (("/bin/pwd") "pwd"))
803 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
804 ;; Avoid introducing timestamps
805 (setenv "KCONFIG_NOTIMESTAMP" "1")
806 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
808 ;; Set ARCH and CROSS_COMPILE
809 (let ((arch ,(system->linux-architecture
810 (or (%current-target-system)
811 (%current-system)))))
813 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
816 (setenv "CROSS_COMPILE" (string-append target "-"))
817 (format #t "`CROSS_COMPILE' set to `~a'~%"
818 (getenv "CROSS_COMPILE"))))
820 (setenv "EXTRA_VERSION" ,extra-version)
822 (let ((build (assoc-ref %standard-phases 'build))
823 (config (assoc-ref (or native-inputs inputs) "kconfig")))
825 ;; Use a custom kernel configuration file or a default
826 ;; configuration file.
829 (copy-file config ".config")
830 (chmod ".config" #o666))
831 (invoke "make" ,defconfig))
833 ;; Appending works even when the option wasn't in the
834 ;; file. The last one prevails if duplicated.
835 (let ((port (open-file ".config" "a"))
836 (extra-configuration ,(config->string extra-options)))
837 (display extra-configuration port)
840 (invoke "make" "oldconfig"))))
842 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
843 (let* ((out (assoc-ref outputs "out"))
844 (moddir (string-append out "/lib/modules"))
845 (dtbdir (string-append out "/lib/dtbs")))
846 ;; Install kernel image, kernel configuration and link map.
847 (for-each (lambda (file) (install-file file out))
848 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
849 ;; Install device tree files
850 (unless (null? (find-files "." "\\.dtb$"))
852 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
854 ;; Install kernel modules
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.
862 (string-append "MODULE_DIR=" moddir)
863 (string-append "INSTALL_PATH=" out)
864 (string-append "INSTALL_MOD_PATH=" out)
865 "INSTALL_MOD_STRIP=1"
867 (let* ((versions (filter (lambda (name)
868 (not (string-prefix? "." name)))
870 (version (match versions
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"))))
881 (home-page "https://www.gnu.org/software/linux-libre/")
882 (synopsis "100% free redistribution of a cleaned Linux kernel")
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.")
886 (license license:gpl2)
887 (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.
891 ;;; Generic kernel packages.
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))
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)
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))
911 (define-public linux-libre-5.4
912 (make-linux-libre* linux-libre-5.4-version
913 linux-libre-5.4-source
914 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
915 #:configuration-file kernel-config))
917 (define-public linux-libre-4.19
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))
923 (define-public linux-libre-4.14
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))
929 (define-public linux-libre-4.9
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))
935 (define-public linux-libre-4.4
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
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)))
947 ;; Linux-Libre-LTS points to the *newest* released long-term support version of
949 ;; Reference: https://jxself.org/linux-libre/
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)
958 ;;; Specialized kernel variants.
961 (define-public linux-libre-arm-generic
962 (make-linux-libre* linux-libre-version
965 #:defconfig "multi_v7_defconfig"
966 #:extra-version "arm-generic"
969 `(;; needed to fix the RTC on rockchip platforms
970 ("CONFIG_RTC_DRV_RK808" . #t))
971 %default-extra-linux-options)))
973 (define-public linux-libre-arm-veyron
974 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
976 (define-public linux-libre-arm-generic-5.10
977 (make-linux-libre* linux-libre-5.10-version
978 linux-libre-5.10-source
980 #:defconfig "multi_v7_defconfig"
981 #:extra-version "arm-generic"
984 `(;; needed to fix the RTC on rockchip platforms
985 ("CONFIG_RTC_DRV_RK808" . #t))
986 %default-extra-linux-options)))
988 (define-public linux-libre-arm-generic-5.4
989 (make-linux-libre* linux-libre-5.4-version
990 linux-libre-5.4-source
992 #:defconfig "multi_v7_defconfig"
993 #:extra-version "arm-generic"
996 `(;; needed to fix the RTC on rockchip platforms
997 ("CONFIG_RTC_DRV_RK808" . #t))
998 %default-extra-linux-options)))
1000 (define-public linux-libre-arm-generic-4.19
1001 (make-linux-libre* linux-libre-4.19-version
1002 linux-libre-4.19-source
1004 #:defconfig "multi_v7_defconfig"
1005 #:extra-version "arm-generic"))
1007 (define-public linux-libre-arm-generic-4.14
1008 (make-linux-libre* linux-libre-4.14-version
1009 linux-libre-4.14-source
1011 #:defconfig "multi_v7_defconfig"
1012 #:extra-version "arm-generic"))
1014 (define-public linux-libre-arm-omap2plus
1015 (make-linux-libre* linux-libre-version
1018 #:defconfig "omap2plus_defconfig"
1019 #:extra-version "arm-omap2plus"))
1021 (define-public linux-libre-arm-omap2plus-4.19
1022 (make-linux-libre* linux-libre-4.19-version
1023 linux-libre-4.19-source
1025 #:defconfig "omap2plus_defconfig"
1026 #:extra-version "arm-omap2plus"))
1028 (define-public linux-libre-arm-omap2plus-4.14
1029 (make-linux-libre* linux-libre-4.14-version
1030 linux-libre-4.14-source
1032 #:defconfig "omap2plus_defconfig"
1033 #:extra-version "arm-omap2plus"))
1035 (define-public linux-libre-arm64-generic
1036 (make-linux-libre* linux-libre-version
1039 #:defconfig "defconfig"
1040 #:extra-version "arm64-generic"
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)
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))
1058 %default-extra-linux-options)))
1060 (define-public linux-libre-arm64-generic-5.10
1061 (make-linux-libre* linux-libre-5.10-version
1062 linux-libre-5.10-source
1064 #:defconfig "defconfig"
1065 #:extra-version "arm64-generic"
1068 `(;; needed to fix the RTC on rockchip platforms
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)
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))
1083 %default-extra-linux-options)))
1085 (define-public linux-libre-arm64-generic-5.4
1086 (make-linux-libre* linux-libre-5.4-version
1087 linux-libre-5.4-source
1089 #:defconfig "defconfig"
1090 #:extra-version "arm64-generic"
1093 `(;; needed to fix the RTC on rockchip platforms
1094 ("CONFIG_RTC_DRV_RK808" . #t))
1095 %default-extra-linux-options)))
1097 (define-public linux-libre-riscv64-generic
1098 (make-linux-libre* linux-libre-version
1101 #:extra-version "riscv64-generic"))
1103 (define-public linux-libre-mips64el-fuloong2e
1104 (make-linux-libre* linux-libre-version
1107 #:defconfig "fuloong2e_defconfig"
1108 #:extra-version "mips64el-fuloong2e"
1111 `(("CONFIG_OVERLAY_FS" . m))
1112 %default-extra-linux-options)))
1114 (define-public linux-libre-with-bpf
1115 (let ((base-linux-libre
1117 linux-libre-5.12-version
1118 linux-libre-5.12-source
1119 '("x86_64-linux" "i686-linux" "armhf-linux"
1120 "aarch64-linux" "riscv64-linux")
1121 #:extra-version "bpf"
1122 #:configuration-file kernel-config
1124 (append %bpf-extra-linux-options
1125 %default-extra-linux-options))))
1127 (inherit base-linux-libre)
1128 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
1133 ;;; Linux kernel modules.
1136 (define-public acpi-call-linux-module
1138 (name "acpi-call-linux-module")
1144 (url "https://github.com/nix-community/acpi_call")
1145 (commit (string-append "v" version))))
1146 (file-name (git-file-name name version))
1148 (base32 "0mr4rjbv6fj4phf038addrgv32940bphghw2v9n1z4awvw7wzkbg"))))
1149 (build-system linux-module-build-system)
1151 `(#:tests? #f ; no tests
1153 (modify-phases %standard-phases
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.
1158 (substitute* (find-files "examples" ".")
1159 (("^(#! *)/[^ ]*/" _ shebang)
1160 (string-append shebang "/usr/bin/env ")))
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"))
1172 (home-page "https://github.com/teleshoes/acpi_call")
1173 (synopsis "Linux kernel module to perform ACPI method calls")
1175 "This simple Linux kernel module allows calls from user space to any
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
1178 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1179 and @code{ACPI_BUFFER}.
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.")
1183 (license license:gpl3+))) ; see README.md (no licence headers)
1185 (define-public rtl8812au-aircrack-ng-linux-module
1186 (let ((commit "059e06a51be025fde5b2bec6565540b3d9981b0b")
1189 (name "rtl8812au-aircrack-ng-linux-module")
1190 (version (git-version "5.6.4.2" revision commit))
1195 (url "https://github.com/aircrack-ng/rtl8812au")
1197 (file-name (git-file-name name version))
1199 (base32 "0h6l2r3yj7j9zf11dw0zcdyn50ajnjw8yvv86dzlfj80dn75n98f"))
1200 (modules '((guix build utils)))
1203 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1204 ;; and other unnecessary unlicenced things.
1205 (for-each delete-file-recursively (list "android"
1209 (build-system linux-module-build-system)
1212 (list (string-append "KSRC="
1213 (assoc-ref %build-inputs "linux-module-builder")
1214 "/lib/modules/build"))
1216 (modify-phases %standard-phases
1218 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1219 (apply invoke "make" make-flags))))
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")
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+))))
1231 (define-public rtl8821ce-linux-module
1232 (let ((commit "897e7c4c15dd5a0a569745dc223d969a26ff5bfc")
1235 (name "rtl8821ce-linux-module")
1236 (version (git-version "0.0.0" revision commit))
1241 (url "https://github.com/tomaspinho/rtl8821ce")
1243 (file-name (git-file-name name version))
1246 "0935dzz0njxh78wfd17yqah1dxn6b3kaszvzclwwrwwhwcrdp80j"))))
1247 (build-system linux-module-build-system)
1251 (string-append "KSRC="
1252 (assoc-ref %build-inputs "linux-module-builder")
1253 "/lib/modules/build"))
1255 (modify-phases %standard-phases
1257 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1258 (apply invoke "make" make-flags))))
1259 #:tests? #f)) ; no test suite
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
1264 (license license:gpl2))))
1266 (define-public vhba-module
1268 (name "vhba-module")
1269 (version "20200106")
1273 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1274 version ".tar.bz2"))
1277 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1278 (build-system linux-module-build-system)
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+)))
1288 (define-public bbswitch-module
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"))
1293 (name "bbswitch-module")
1294 (version (git-version "0.8" "1" commit))
1298 (url "https://github.com/Bumblebee-Project/bbswitch")
1300 (file-name (git-file-name name version))
1303 "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb"))))
1304 (build-system linux-module-build-system)
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
1311 graphics card on Optimus laptops.")
1312 (license license:gpl2))))
1314 (define-public ddcci-driver-linux
1316 (name "ddcci-driver-linux")
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))
1328 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1329 (build-system linux-module-build-system)
1331 `(#:tests? #f ; no tests
1333 (modify-phases %standard-phases
1338 (with-directory-excursion module
1339 (apply (assoc-ref %standard-phases 'build) args)))
1340 '("ddcci" "ddcci-backlight"))
1346 (with-directory-excursion module
1347 (apply (assoc-ref %standard-phases 'install) args)))
1348 '("ddcci" "ddcci-backlight"))
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+)))
1360 (define-public v4l2loopback-linux-module
1362 (name "v4l2loopback-linux-module")
1367 (url "https://github.com/umlaeute/v4l2loopback")
1368 (commit (string-append "v" version))))
1369 (file-name (git-file-name name version))
1372 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1373 (build-system linux-module-build-system)
1375 `(#:tests? #f)) ; no test suite
1376 (home-page "https://github.com/umlaeute/v4l2loopback")
1377 (synopsis "Linux kernel module to create virtual V4L2 video devices")
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
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.")
1387 (license license:gpl2+)))
1391 ;;; Pluggable authentication modules (PAM).
1394 (define-public linux-pam
1402 "https://github.com/linux-pam/linux-pam/releases/download/v"
1403 version "/Linux-PAM-" version ".tar.xz"))
1406 "1z4jayf69qyyxln1gl6ch4qxfd66ib1g42garnrv2d8i1drl0790"))
1407 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1409 (build-system gnu-build-system)
1413 ;; TODO: optional dependencies
1414 ;; ("libxcrypt" ,libxcrypt)
1415 ;; ("cracklib" ,cracklib)
1418 `(;; Most users, such as `shadow', expect the headers to be under
1420 #:configure-flags (list (string-append "--includedir="
1421 (assoc-ref %outputs "out")
1422 "/include/security")
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)
1431 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1434 (home-page "http://www.linux-pam.org/")
1435 (synopsis "Pluggable authentication modules for Linux")
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
1440 at login. Local and dynamic reconfiguration are its key features.")
1441 (license license:bsd-3)))
1443 (define-public linux-pam-1.2
1451 "http://www.linux-pam.org/library/"
1452 "Linux-PAM-" version ".tar.bz2"))
1455 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1456 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1458 (define-public python-pamela
1460 (name "python-pamela")
1464 ;; Tests not distributed in pypi release.
1467 (url "https://github.com/minrk/pamela")
1469 (file-name (git-file-name name version))
1472 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
1473 (build-system python-build-system)
1475 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
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'")))
1486 (lambda* (#:key tests? #:allow-other-keys)
1488 (if (file-exists? "test_pamela.py")
1489 (invoke "py.test" "--assert=plain" "test_pamela.py")
1490 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
1493 `(("linux-pam" ,linux-pam)))
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)))
1506 (define-public powerstat
1513 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1514 "powerstat/powerstat-" version ".tar.gz"))
1516 (base32 "0dmixbxm4qd08ds26i0wvxwyy8nrjzfjj2q9ylx35564g4wh58qb"))))
1517 (build-system gnu-build-system)
1520 (list (string-append "CC=" ,(cc-for-target))
1521 (string-append "prefix=" (assoc-ref %outputs "out")))
1522 #:tests? #f ; no test suite
1524 (modify-phases %standard-phases
1525 (add-after 'unpack 'respect-$prefix
1526 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1528 (substitute* "Makefile"
1529 (("DIR=/usr/") "DIR=$(prefix)/"))
1531 (delete 'configure)))) ; no configure script
1532 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1533 (synopsis "Measure system power consumption")
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.
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.
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)))
1550 (define-public psmisc
1557 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1560 (base32 "0y8n1jd2dn4cvc5mh806d66qnq8xl0xmzczbycjwal10rvmcw33z"))))
1561 (build-system gnu-build-system)
1563 `(,@(if (%current-target-system)
1566 "ac_cv_func_malloc_0_nonnull=yes"
1567 "ac_cv_func_realloc_0_nonnull=yes"))
1569 (inputs `(("ncurses" ,ncurses)))
1570 (home-page "https://gitlab.com/psmisc/psmisc")
1571 (synopsis "Small utilities that use the proc file system")
1573 "This PSmisc package is a set of some small useful utilities that
1574 use the proc file system. We're not about changing the world, but
1575 providing the system administrator with some help in common tasks.")
1576 (license license:gpl2+)))
1578 (define-public util-linux
1584 (uri (string-append "mirror://kernel.org/linux/utils/"
1585 "util-linux/v" (version-major+minor version) "/"
1586 "util-linux-" version ".tar.xz"))
1589 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1590 (patches (search-patches "util-linux-tests.patch"))
1591 (modules '((guix build utils)))
1593 ;; We take 'nologin' from Shadow, the 'logger' program from
1594 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1596 (substitute* "configure"
1597 (("build_nologin=yes") "build_nologin=no")
1598 (("build_logger=yes") "build_logger=no")
1599 (("build_kill=yes") "build_kill=no"))
1601 (build-system gnu-build-system)
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
1606 `(#:configure-flags (list "--disable-use-tty-group"
1607 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1608 ;; Don't try to chown root:root mount and umount
1609 "--disable-makeinstall-chown"
1610 "--localstatedir=/var"
1611 (string-append "--localedir="
1612 (assoc-ref %outputs "lib")
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"))
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))))
1625 #:phases (modify-phases %standard-phases
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"))
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\"")))
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"
1650 (string-append net "/etc/services")))
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"))
1656 ;; TODO: Remove the conditional on the next rebuild cycle.
1657 ,@(if (string-prefix? "arm" (%current-system))
1658 '((add-before 'check 'disable-setarch-test
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)
1668 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1671 (add-after 'install 'move-static-libraries
1672 (lambda* (#:key outputs #:allow-other-keys)
1673 (let ((lib (assoc-ref outputs "lib"))
1674 (static (assoc-ref outputs "static")))
1676 ;; Move static libraries to the "static" output.
1677 (mkdir-p (string-append static "/lib"))
1678 (with-directory-excursion lib
1679 (for-each (lambda (file)
1681 (string-append static "/"
1683 (find-files "lib" "\\.a$"))
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")))
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")
1699 (("^(exec_)?prefix=.*") "")))
1701 (inputs `(("zlib" ,zlib)
1702 ("ncurses" ,ncurses)
1704 ;; XXX: This is so that the 'pre-check' phase can find it.
1705 ,@(if (%current-target-system)
1706 `(("net-base" ,net-base))
1710 ("net-base" ,net-base))) ;for tests
1711 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1712 (synopsis "Collection of utilities for the Linux kernel")
1713 (description "Util-linux is a diverse collection of Linux kernel
1714 utilities. It provides dmesg and includes tools for working with file systems,
1715 block devices, UUIDs, TTYs, and many other tools.")
1717 ;; Note that util-linux doesn't use the same license for all the
1718 ;; code. GPLv2+ is the default license for a code without an
1719 ;; explicitly defined license.
1720 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1721 license:bsd-4 license:public-domain))))
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
1729 (name "util-linux-with-udev")
1732 ,@(package-inputs util-linux)))))
1734 (define-public ddate
1741 (url "https://github.com/bo0ts/ddate")
1742 (commit (string-append "v" version))))
1743 (file-name (git-file-name name version))
1745 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
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")
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)))
1756 (define-public fbset
1763 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1766 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1767 (build-system gnu-build-system)
1769 '(#:modules ((guix build gnu-build-system)
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.
1783 (with-directory-excursion out
1784 (for-each mkdir-p (list "sbin"
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"))
1797 ;; Parallel building races to create modes.tab.c.
1798 #:parallel-build? #f
1799 #:tests? #f)) ; no test suite
1803 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1804 (synopsis "Show and modify Linux frame buffer settings")
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
1810 (license license:gpl2)))
1812 (define-public procps
1818 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1819 "procps-ng-" version ".tar.xz"))
1822 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1823 (build-system gnu-build-system)
1825 `(#:modules ((guix build utils)
1826 (guix build gnu-build-system)
1829 ,@(if (%current-target-system)
1832 "ac_cv_func_malloc_0_nonnull=yes"
1833 "ac_cv_func_realloc_0_nonnull=yes"))
1836 (modify-phases %standard-phases
1838 'install 'post-install
1839 ;; Remove commands and man pages redudant with
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)
1847 (inputs `(("ncurses" ,ncurses)))
1848 (home-page "https://gitlab.com/procps-ng/procps/")
1849 (synopsis "Utilities that give information about processes")
1851 "Procps is the package that has a bunch of small useful utilities
1852 that give information about processes using the Linux /proc file system.
1853 The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
1854 slabtop, tload, top, vmstat, w, watch and sysctl.")
1855 (license license:gpl2)))
1857 (define-public usbutils
1864 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1865 "usbutils-" version ".tar.xz"))
1867 (base32 "0f0klk6d3hmbpf6p4dcwa1qjzblmkhbxs1wsw87aidvqri7lj8wy"))))
1868 (build-system gnu-build-system)
1869 (outputs (list "out" "python"))
1872 (modify-phases %standard-phases
1873 (add-before 'bootstrap 'patch-bootstrap-scripts
1875 (substitute* "usbhid-dump/bootstrap"
1876 (("/bin/sh") (which "sh")))
1878 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1879 (substitute* "autogen.sh"
1880 (("^\\./configure.*") ""))
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"))
1897 ("python" ,python)))
1899 `(("autoconf" ,autoconf)
1900 ("automake" ,automake)
1901 ("libtool" ,libtool)
1902 ("pkg-config" ,pkg-config)))
1903 (home-page "http://www.linux-usb.org/")
1905 "Tools for working with USB devices, such as lsusb")
1907 "Tools for working with USB devices, such as lsusb.")
1908 (license license:gpl2+)))
1910 (define-public e2fsprogs
1917 "mirror://kernel.org/linux/kernel/people/tytso/"
1918 "e2fsprogs/v" version "/"
1919 "e2fsprogs-" version ".tar.xz"))
1922 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1923 (build-system gnu-build-system)
1924 (inputs `(("util-linux" ,util-linux "lib")))
1925 (native-inputs `(("pkg-config" ,pkg-config)
1926 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1930 ("procps" ,procps)))
1932 '(;; util-linux is the preferred source for some of the libraries and
1933 ;; commands, so disable them (see, e.g.,
1934 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1935 #:configure-flags (list "--disable-libblkid"
1936 "--disable-libuuid" "--disable-uuidd"
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"
1944 (string-append "LDFLAGS=-Wl,-rpath="
1945 (assoc-ref %outputs "out")
1948 ;; Install libext2fs et al.
1949 "--enable-elf-shlibs")
1952 (modify-phases %standard-phases
1953 (add-before 'configure 'patch-shells
1955 (substitute* "configure"
1956 (("/bin/sh (.*)parse-types.sh" _ dir)
1957 (string-append (which "sh") " " dir
1959 (substitute* "MCONFIG.in"
1960 (("INSTALL_SYMLINK = /bin/sh")
1961 "INSTALL_SYMLINK = sh"))
1962 (substitute* (find-files "." "^Makefile.in$")
1964 (string-append "#!" (which "sh"))))
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")))
1970 (invoke "make" "install-libs")
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)
1982 (home-page "http://e2fsprogs.sourceforge.net/")
1983 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1985 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1986 (license (list license:gpl2 ;programs
1987 license:lgpl2.0 ;libext2fs
1988 license:x11)))) ;libuuid
1990 (define e2fsprogs/static
1992 (package (inherit e2fsprogs)
1994 ;; Do not build shared libraries.
1995 (substitute-keyword-arguments (package-arguments e2fsprogs)
1996 ((#:configure-flags _)
1997 '(list "--disable-blkid"))
2001 (define-public e2fsck/static
2003 (name "e2fsck-static")
2004 (version (package-version e2fsprogs))
2005 (build-system trivial-build-system)
2008 `(("e2fsprogs" ,e2fsprogs/static)))
2010 `(#:modules ((guix build utils))
2013 (use-modules (guix build utils)
2017 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
2019 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
2021 (with-directory-excursion bin
2022 (copy-file e2fsck "e2fsck")
2023 (remove-store-references "e2fsck")
2024 (chmod "e2fsck" #o555))
2026 (home-page (package-home-page e2fsprogs))
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.")
2030 (license (package-license e2fsprogs))))
2032 (define-public extundelete
2034 (name "extundelete")
2039 (uri (string-append "mirror://sourceforge/extundelete/"
2040 "extundelete/" version "/extundelete-"
2041 version ".tar.bz2"))
2044 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
2045 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
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")
2051 "Extundelete is a set of tools that can recover deleted files from an
2052 ext3 or ext4 partition.")
2053 (license license:gpl2)))
2055 (define-public zerofree
2059 (home-page "https://frippery.org/uml/")
2062 (uri (string-append home-page name "-" version
2066 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
2067 (build-system gnu-build-system)
2070 (modify-phases %standard-phases
2071 (delete 'configure) ; no configure script
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")))
2077 (chmod "zerofree" #o555)
2078 (install-file "zerofree" bin)
2080 #:tests? #f)) ; no tests
2081 (inputs `(("libext2fs" ,e2fsprogs)))
2082 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
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.")
2088 (license license:gpl2)))
2090 (define-public strace
2094 (home-page "https://strace.io")
2097 (uri (string-append home-page "/files/" version
2098 "/strace-" version ".tar.xz"))
2101 "1abs3svkg9985f4jrxx34sj1dcpsf95vv1a0g01c777zgygncjnz"))))
2102 (build-system gnu-build-system)
2105 (modify-phases %standard-phases
2106 (add-after 'unpack 'patch-/bin/sh
2108 (substitute* "strace.c"
2109 (("/bin/sh") (which "sh")))
2111 (add-after 'unpack 'disable-failing-tests
2113 ;; XXX These hang forever even if the test time-out is extended.
2114 (substitute* "tests/Makefile.in"
2115 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
2117 ;; Don't fail if the architecture doesn't support different personalities.
2118 #:configure-flags '("--enable-mpers=check")
2119 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
2120 #:parallel-tests? #f)) ; undeterministic failures
2121 (native-inputs `(("perl" ,perl)))
2122 (synopsis "System call tracer for Linux")
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.")
2126 (license license:lgpl2.1+)))
2128 (define-public ltrace
2134 (uri (string-append "http://www.ltrace.org/ltrace_" version
2138 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
2139 (build-system gnu-build-system)
2140 (inputs `(("libelf" ,elfutils)))
2142 ;; Compilation uses -Werror by default, but it fails.
2143 '(#:configure-flags '("--disable-werror")))
2144 (home-page "https://www.ltrace.org/")
2145 (synopsis "Library call tracer for Linux")
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.")
2150 (license license:gpl2+)))
2152 (define-public alsa-lib
2159 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
2160 version ".tar.bz2"))
2163 "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp"))))
2164 (build-system gnu-build-system)
2166 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2167 (assoc-ref %outputs "out")
2169 (home-page "https://www.alsa-project.org/")
2170 (synopsis "The Advanced Linux Sound Architecture libraries")
2172 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2173 MIDI functionality to the Linux-based operating system.")
2174 (license license:lgpl2.1+)))
2176 (define-public alsa-utils
2182 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
2183 name "-" version ".tar.bz2"))
2186 "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq"))))
2187 (build-system gnu-build-system)
2189 ;; XXX: Disable man page creation until we have DocBook.
2190 '(#:configure-flags (list "--disable-xmlto"
2192 ;; The udev rule is responsible for restoring
2194 (string-append "--with-udev-rules-dir="
2195 (assoc-ref %outputs "out")
2196 "/lib/udev/rules.d"))
2198 (modify-phases %standard-phases
2199 (add-before 'check 'disable-broken-test
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.*") ""))
2207 'install 'pre-install
2209 ;; Don't try to mkdir /var/lib/alsa.
2210 (substitute* "Makefile"
2211 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2215 `(("gettext" ,gettext-minimal)))
2217 `(("libsamplerate" ,libsamplerate)
2218 ("ncurses" ,ncurses)
2219 ("alsa-lib" ,alsa-lib)
2221 (home-page "http://www.alsa-project.org/")
2222 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2224 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2225 MIDI functionality to the Linux-based operating system.")
2227 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2229 (license license:gpl2)))
2231 (define-public alsa-plugins
2233 (name "alsa-plugins")
2237 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2238 name "-" version ".tar.bz2"))
2241 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
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
2248 (outputs '("out" "pulseaudio" "jack"))
2249 (native-search-paths
2250 (list (search-path-specification
2251 (variable "ALSA_PLUGIN_DIR")
2252 (files '("lib/alsa-lib"))
2255 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2256 ;; for /etc/alsa. On Guix System plugins are loaded from
2257 ;; the ALSA service, and other distributions likely
2258 ;; won't use these files.
2259 "--with-alsalconfdir=/tmp/noop")
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"))
2266 (jack (assoc-ref outputs "jack"))
2267 (jacklib (string-append jack "/lib/alsa-lib"))
2268 (pua (assoc-ref outputs "pulseaudio"))
2269 (pualib (string-append pua "/lib/alsa-lib")))
2272 (for-each (lambda (file)
2273 (rename-file file (string-append jacklib "/" (basename file))))
2274 (find-files out ".*jack\\.(la|so)"))
2277 (for-each (lambda (file)
2278 (rename-file file (string-append pualib "/" (basename file))))
2279 (find-files out ".*pulse\\.(la|so)"))
2282 `(("alsa-lib" ,alsa-lib)
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
2289 `(("pkg-config" ,pkg-config)))
2290 (home-page "http://www.alsa-project.org/")
2291 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
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+))))
2302 (define-public iptables
2309 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2311 (string-append "https://www.netfilter.org/projects/iptables/"
2312 "files/iptables-" version ".tar.bz2")))
2314 (base32 "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1"))))
2315 (build-system gnu-build-system)
2317 `(("pkg-config" ,pkg-config)
2321 `(("libmnl" ,libmnl)
2322 ("libnftnl" ,libnftnl)))
2324 '(#:tests? #f ; no test suite
2325 #:configure-flags ; add $libdir to the RUNPATH of executables
2326 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
2327 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2328 (synopsis "Programs to configure Linux IP packet filtering rules")
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).
2334 This package also includes @command{ip6tables}, which is used to configure the
2337 Both commands are targeted at system administrators.")
2338 (license license:gpl2+)))
2340 (define-public jitterentropy-rngd
2342 (name "jitterentropy-rngd")
2348 (url "https://github.com/smuellerDD/jitterentropy-rngd")
2349 (commit (string-append "v" version))))
2350 (file-name (git-file-name name version))
2352 (base32 "1fb8zfwhwkl1d8n4cdn7rdv5rwd75qgc00d36pmkl7wgnj3c9xda"))))
2353 (build-system gnu-build-system)
2355 `(#:tests? #f ; no test suite
2357 (list (string-append "CC=" ,(cc-for-target))
2358 (string-append "PREFIX=" (assoc-ref %outputs "out"))
2359 "UNITDIR=$(PREFIX)/lib/systemd/system")
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")
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.
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.
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.
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
2387 (define-public lsscsi
2394 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2397 "0jp458m2b3wckr18qkln69i01152qlwz33zm49103lq8fgx0n6d4"))))
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")
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
2406 (license license:gpl2)))
2408 (define-public ebtables
2415 "mirror://netfilter.org/ebtables/ebtables-"
2419 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2420 (build-system gnu-build-system)
2423 ("iptables" ,iptables)))
2424 (synopsis "Ethernet bridge frame table administration")
2425 (home-page "https://ebtables.netfilter.org/")
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+)))
2433 (define-public iproute
2440 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2444 "0vrjbzhwzcvaxyyhkr2ii89w2vznzwp2pfgk7w72mviniawqs9lx"))))
2445 (build-system gnu-build-system)
2447 `( ;; There is a test suite, but it wants network namespaces and sudo.
2449 #:make-flags (let ((out (assoc-ref %outputs "out")))
2451 (string-append "CC=" ,(cc-for-target))
2453 (string-append "BASH_COMPDIR=" out
2454 "/etc/bash_completion.d")
2455 (string-append "LIBDIR=" out "/lib")
2456 (string-append "HDRDIR=" out "/include")
2457 (string-append "SBINDIR=" out "/sbin")
2458 (string-append "CONFDIR=" out "/etc")
2459 (string-append "DOCDIR=" out "/share/doc/"
2461 (string-append "MANDIR=" out "/share/man")))
2462 #:phases (modify-phases %standard-phases
2463 (add-before 'install 'pre-install
2465 ;; Don't attempt to create /var/lib/arpd.
2466 (substitute* "Makefile"
2467 (("^.*ARPDDIR.*$") ""))
2469 (add-after 'unpack 'patch-configure
2471 (let ((target ,(%current-target-system)))
2472 (substitute* "configure"
2475 (string-append target "-pkg-config")
2480 ("iptables" ,iptables)
2481 ("libmnl" ,libmnl)))
2485 ("pkg-config" ,pkg-config)))
2487 ;; ("libmnl" ,libmnl)
2488 ;; ("util-linux" ,util-linux)
2490 "https://wiki.linuxfoundation.org/networking/iproute2")
2492 "Utilities for controlling TCP/IP networking and traffic in Linux")
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
2499 Most network configuration manuals still refer to ifconfig and route as the
2500 primary network configuration tools, but ifconfig is known to behave
2501 inadequately in modern network environments, and both should be deprecated.")
2502 (license license:gpl2+)))
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
2508 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2512 (version (string-append "1.60-" revision "." (string-take commit 7)))
2515 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2516 "n/ne/net-tools/code.git/net-tools-code-"
2518 (file-name (string-append name "-" version ".zip"))
2521 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2522 (home-page "http://net-tools.sourceforge.net/")
2523 (build-system gnu-build-system)
2525 `(#:modules ((guix build gnu-build-system)
2530 (modify-phases %standard-phases
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"))
2537 ;; Pretend we have everything...
2538 (system "yes | make config")
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.*$")
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 <>)
2556 "^(yp|nis|dns)?domainname"))))
2557 (for-each delete-file dup)
2559 ;; Binaries that depend on libnet-tools.a don't declare that
2560 ;; dependency, making it parallel-unsafe.
2561 #:parallel-build? #f
2563 #:tests? #f ; no test suite
2564 #:make-flags (let ((out (assoc-ref %outputs "out")))
2565 (list ,(string-append "CC=" (cc-for-target))
2566 (string-append "BASEDIR=" out)
2567 (string-append "INSTALLNLSDIR=" out "/share/locale")
2568 (string-append "mandir=/share/man")))))
2569 (native-inputs `(("gettext" ,gettext-minimal)
2571 (supported-systems (delete "i586-gnu" %supported-systems))
2572 (synopsis "Tools for controlling the network subsystem in Linux")
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+))))
2581 (define-public libcap-2.31
2588 "mirror://kernel.org/linux/libs/security/linux-privs/"
2589 "libcap2/libcap-" version ".tar.xz"))
2592 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2593 (build-system gnu-build-system)
2594 (arguments '(#:phases
2595 (modify-phases %standard-phases
2597 ;; Add $libdir to the RUNPATH of executables.
2599 (substitute* "Make.Rules"
2601 (string-append "LDFLAGS := -Wl,-rpath="
2604 #:test-target "test"
2605 #:make-flags (list "lib=lib"
2606 (string-append "prefix="
2607 (assoc-ref %outputs "out"))
2608 "RAISE_SETFCAP=no")))
2609 (native-inputs `(("perl" ,perl)))
2610 (supported-systems (delete "i586-gnu" %supported-systems))
2611 (home-page "https://sites.google.com/site/fullycapable/")
2612 (synopsis "Library for working with POSIX capabilities")
2614 "Libcap2 provides a programming interface to POSIX capabilities on
2615 Linux-based operating systems.")
2617 ;; License is BSD-3 or GPLv2, at the user's choice.
2618 (license license:gpl2)))
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'.
2622 ;; To be merged with libcap on the next rebuild cycle.
2623 (define-public libcap
2625 (inherit libcap-2.31)
2630 "mirror://kernel.org/linux/libs/security/linux-privs/"
2631 "libcap2/libcap-" version ".tar.xz"))
2634 "11ijmi7jik9iw6pdszc6bylhggghr8cza03bcrbhbqf0cpvkjrnn"))))
2636 (substitute-keyword-arguments (package-arguments libcap-2.31)
2638 `(modify-phases ,phases
2641 ;; Add $libdir to the RUNPATH of executables.
2642 (substitute* "Make.Rules"
2643 (("LDFLAGS \\?= #-g")
2644 (string-append "LDFLAGS ?= -Wl,-rpath="
2648 (define-deprecated libcap/next libcap)
2649 (export libcap/next)
2651 (define-public bridge-utils
2653 (name "bridge-utils")
2658 (uri (string-append "mirror://kernel.org/linux/kernel/people/shemminger/"
2659 "bridge-utils/bridge-utils-" version ".tar.xz"))
2661 (base32 "0zlrigizac2nfwgvksm92v4wafrpgxlbci3gwimc795ib7k8g6ck"))))
2662 (build-system gnu-build-system)
2664 ;; The tarball lacks all the generated files.
2665 (native-inputs `(("autoconf" ,autoconf)
2666 ("automake" ,automake)))
2669 (modify-phases %standard-phases
2670 (add-before 'bootstrap 'patch-stuff
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>"))
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;"))
2684 #:tests? #f)) ; no 'check' target
2686 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2687 (synopsis "Manipulate Ethernet bridges")
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.")
2694 (license license:gpl2+)))
2696 (define-public libnl
2703 "https://github.com/thom311/libnl/releases/download/"
2704 "libnl" (string-join (string-split version #\.) "_")
2705 "/libnl-" version ".tar.gz"))
2708 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2709 (build-system gnu-build-system)
2713 ("pkg-config" ,pkg-config)
2719 "https://github.com/thom311/libnl/releases/download/libnl"
2720 (string-join (string-split version #\.) "_")
2721 "/libnl-doc-" version ".tar.gz"))
2723 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2724 (outputs `("out" "doc"))
2727 (modify-phases %standard-phases
2728 (add-after 'install 'install-doc
2729 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2730 (let ((dest (string-append (assoc-ref outputs "doc")
2731 "/share/doc/libnl")))
2733 (invoke "tar" "xf" (assoc-ref
2734 (or native-inputs inputs)
2736 "--strip-components=1" "-C" dest)))))))
2737 (home-page "https://www.infradead.org/~tgr/libnl/")
2738 (synopsis "NetLink protocol library suite")
2740 "The libnl suite is a collection of libraries providing APIs to netlink
2741 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
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.")
2746 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2747 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2748 (license license:gpl2)))
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)))
2759 ((string=? python "python2")
2760 `(("python-2" ,python-2)))
2761 ((string=? python "python3")
2762 `(("python-3" ,python-3))))))
2763 (propagated-inputs `(("libnl" ,libnl)))
2766 `(#:modules ((guix build gnu-build-system)
2770 (modify-phases %standard-phases
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))
2784 (define-public libnl-python2 (libnl-python-package "python2"))
2785 (define-public libnl-python3 (libnl-python-package "python3"))
2794 "mirror://kernel.org/software/network/iw/iw-"
2798 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2799 (build-system gnu-build-system)
2800 (native-inputs `(("pkg-config" ,pkg-config)))
2801 (inputs `(("libnl" ,libnl)))
2804 (let* ((target ,(%current-target-system))
2805 (pkg-config (if target
2806 (string-append target "-pkg-config")
2809 ,(string-append "CC=" (cc-for-target))
2810 (string-append "PKG_CONFIG="
2811 (assoc-ref %build-inputs "pkg-config")
2813 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2814 #:phases (modify-phases %standard-phases (delete 'configure))))
2815 (home-page "https://wireless.wiki.kernel.org/")
2816 (synopsis "Tool for configuring wireless devices")
2818 "iw is a new nl80211 based CLI configuration utility for wireless
2819 devices. It replaces @code{iwconfig}, which is deprecated.")
2820 (license license:isc)))
2822 (define-public powertop
2830 (url "https://github.com/fenrus75/powertop")
2831 (commit (string-append "v" version))))
2832 (file-name (git-file-name name version))
2834 (base32 "1zkr2y5nb1nr22nq8a3zli87iyfasfq6489p7h1k428pv8k45w4f"))))
2835 (build-system gnu-build-system)
2838 (list "LDFLAGS=-pthread")
2840 (modify-phases %standard-phases
2841 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2842 ;; allow calibrating the network interface in Guix System.
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"))
2860 ("ncurses" ,ncurses)
2861 ("pciutils" ,pciutils)
2864 `(("autoconf" ,autoconf)
2865 ("automake" ,automake)
2866 ("gettext" ,gettext-minimal)
2867 ("libtool" ,libtool)
2868 ("pkg-config" ,pkg-config)))
2869 (home-page "https://01.org/powertop/")
2870 (synopsis "Analyze power consumption on Intel-based laptops")
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
2877 (license license:gpl2)))
2879 (define-public aumix
2886 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2887 version ".tar.bz2"))
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")
2896 "Aumix adjusts an audio mixer from X, the console, a terminal,
2897 the command line or a script.")
2898 (license license:gpl2+)))
2900 (define-public iotop
2907 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2910 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2911 (build-system python-build-system)
2914 (modify-phases %standard-phases
2915 (add-after 'unpack 'fix-build-with-python3
2917 (substitute* "setup.py"
2918 (("itervalues") "values"))
2920 ;; There are currently no checks in the package.
2922 (native-inputs `(("python" ,python)))
2923 (home-page "http://guichaz.free.fr/iotop/")
2925 "Displays the IO activity of running processes")
2927 "Iotop is a Python program with a top like user interface to show the
2928 processes currently causing I/O.")
2929 (license license:gpl2+)))
2937 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2938 "download/fuse-" version
2939 "/fuse-" version ".tar.gz"))
2942 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2943 (patches (search-patches "fuse-overlapping-headers.patch"))))
2944 (build-system gnu-build-system)
2945 (inputs `(("util-linux" ,util-linux)))
2947 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2948 (assoc-ref %outputs "out")
2950 (string-append "INIT_D_PATH="
2951 (assoc-ref %outputs "out")
2954 ;; The rule makes /dev/fuse 666.
2955 (string-append "UDEV_RULES_PATH="
2956 (assoc-ref %outputs "out")
2957 "/lib/udev/rules.d"))
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")
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
2976 (substitute* "lib/Makefile"
2977 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2978 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2980 (supported-systems (delete "i586-gnu" %supported-systems))
2981 (home-page "https://github.com/libfuse/libfuse")
2982 (synopsis "Support file systems implemented in user space")
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.")
2990 (license (list license:lgpl2.1 ;library
2991 license:gpl2+)))) ;command-line utilities
2993 (define-public unionfs-fuse
2995 (name "unionfs-fuse")
3000 (url "https://github.com/rpodgorny/unionfs-fuse")
3001 (commit (string-append "v" version))))
3002 (file-name (git-file-name name version))
3005 "0bwx70x834qgqh53vqp18bhbxbsny80hz922rbgj8k9wj7cbfilm"))))
3006 (build-system cmake-build-system)
3008 `(("python" ,python)))
3009 (inputs `(("fuse" ,fuse)))
3011 ;; The tests were never actually run ("collected 0 items"), but in recent
3012 ;; versions of pytest that causes an error.
3014 (home-page "https://github.com/rpodgorny/unionfs-fuse")
3015 (synopsis "User-space union file system")
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.")
3021 (license license:bsd-3)))
3024 (package (inherit fuse)
3025 (name "fuse-static")
3026 (source (origin (inherit (package-source fuse))
3027 (modules '((guix build utils)))
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
3035 (substitute* '("lib/mount_util.c"
3036 "util/mount_util.c")
3037 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
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)))
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"
3059 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
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)
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"))
3074 (inputs `(("fuse" ,fuse-static)))))
3076 (define-public sshfs
3082 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
3083 "download/sshfs-" version "/sshfs-" version
3087 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
3088 (build-system gnu-build-system)
3093 `(("pkg-config" ,pkg-config)))
3094 (home-page "https://github.com/libfuse/sshfs")
3095 (synopsis "Mount remote file systems over SSH")
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.")
3101 (license license:gpl2+)))
3103 (define-public sshfs-fuse
3104 (package (inherit sshfs)
3106 (properties `((superseded . ,sshfs)))))
3108 (define-public archivemount
3110 (name "archivemount")
3115 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
3116 "archivemount-" version ".tar.gz"))
3118 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
3119 (build-system gnu-build-system)
3120 (inputs `(("fuse" ,fuse)
3121 ("libarchive" ,libarchive)))
3122 (native-inputs `(("pkg-config" ,pkg-config)))
3123 (home-page "https://www.cybernoia.de/software/archivemount.html")
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+)))
3132 (define-public numactl
3139 "https://github.com/numactl/numactl/releases/download/v"
3140 version "/numactl-" version ".tar.gz"))
3143 "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2"))))
3144 (build-system gnu-build-system)
3146 '(;; There's a 'test' target, but it requires NUMA support in the kernel
3147 ;; to run, which we can't assume to have.
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))
3153 (home-page "https://github.com/numactl/numactl")
3154 (synopsis "Tools for non-uniform memory access (NUMA) machines")
3156 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
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
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.")
3165 (license (list license:gpl2 ;programs
3166 license:lgpl2.1)))) ;library
3168 (define-public kbd-neo
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"))
3180 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
3181 (build-system trivial-build-system)
3183 `(#:modules ((guix build utils))
3185 (use-modules (guix build utils))
3186 (let ((out (string-append %output "/share/keymaps"))
3187 (source (assoc-ref %build-inputs "source")))
3189 (copy-file source (string-append out "/neo.map"))
3191 (home-page "https://neo-layout.org")
3192 (synopsis "Neo2 console layout")
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+)))
3206 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
3210 "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m"))
3211 (modules '((guix build utils)))
3214 (substitute* '("src/unicode_start" "src/unicode_stop")
3215 ;; Assume the Coreutils are in $PATH.
3218 (build-system gnu-build-system)
3221 (modify-phases %standard-phases
3222 (add-before 'build 'pre-build
3223 (lambda* (#:key inputs #:allow-other-keys)
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"))))))
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))))
3241 '("unicode_start" "unicode_stop"))))))))
3243 `(("autoconf" ,autoconf)
3244 ("pkg-config" ,pkg-config)))
3251 (native-search-paths
3252 (list (search-path-specification
3253 (variable "LOADKEYS_KEYMAP_PATH")
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/**")))))
3258 (home-page "http://kbd-project.org/")
3259 (synopsis "Linux keyboard utilities and keyboard maps")
3261 "This package contains keytable files and keyboard utilities compatible
3262 for systems using the Linux kernel. This includes commands such as
3263 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3264 (license license:gpl2+)))
3266 (define-public loadkeys-static
3269 (name "loadkeys-static")
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")
3277 ((#:make-flags flags ''())
3278 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
3279 ((#:phases phases '%standard-phases)
3280 `(modify-phases ,phases
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")
3288 (install-file "src/loadkeys"
3289 (string-append out "/bin")))))
3290 (delete 'post-install)))
3291 ((#:strip-flags _ '())
3293 ((#:allowed-references _ '())
3296 (synopsis "Statically-linked @command{loadkeys} program")
3298 ;; This package is meant to be used internally in the initrd so don't
3300 (properties '((hidden? . #t)))))
3302 (define-public inotify-tools
3304 (name "inotify-tools")
3305 (version "3.20.11.0")
3309 (url "https://github.com/rvoicilas/inotify-tools")
3311 (file-name (git-file-name name version))
3314 "1m8avqccrhm38krlhp88a7v949f3hrzx060bbrr5dp5qw2nmw9j2"))))
3315 (build-system gnu-build-system)
3317 `(("autoconf" ,autoconf)
3318 ("automake" ,automake)
3319 ("libtool" ,libtool)))
3322 (list "--disable-static")))
3323 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3324 (synopsis "Monitor file accesses")
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.")
3328 (license license:gpl2+)))
3337 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3338 "kmod-" version ".tar.xz"))
3341 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3342 (patches (search-patches "kmod-module-directory.patch"))))
3343 (build-system gnu-build-system)
3345 `(("pkg-config" ,pkg-config)))
3350 `(#:configure-flags '("--with-xz" "--with-zlib"
3351 "--disable-test-modules")
3353 (modify-phases %standard-phases
3354 (add-after 'unpack 'disable-tests
3356 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3357 (substitute* "Makefile.in"
3358 (("testsuite/test-modprobe") "")
3359 (("testsuite/test-depmod") "")
3360 (("testsuite/test-blacklist") ""))
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)
3368 (string-append bin "/" tool)))
3369 '("insmod" "rmmod" "lsmod" "modprobe"
3370 "modinfo" "depmod"))
3372 (supported-systems (delete "i586-gnu" %supported-systems))
3373 (home-page "https://www.kernel.org/")
3374 (synopsis "Kernel module tools")
3375 (description "Kmod is a set of tools to handle common tasks with Linux
3376 kernel modules like insert, remove, list, check properties, resolve
3377 dependencies and aliases.
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.")
3382 (license license:gpl2+))) ; library under lgpl2.1+
3384 (define-public earlyoom
3391 (url "https://github.com/rfjakob/earlyoom")
3392 (commit (string-append "v" version))))
3393 (file-name (git-file-name name version))
3396 "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))))
3397 (build-system gnu-build-system)
3400 (modify-phases %standard-phases
3401 (delete 'configure) ; no configure script
3402 (add-before 'check 'set-go-HOME
3404 (setenv "HOME" (getcwd))
3406 (add-before 'check 'disable-failing-test
3408 ;; This test relies on writing to /proc/%d/oom_score_adj.
3409 (substitute* "testsuite_cli_test.go"
3411 (string-append "skipped" match)))
3413 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3414 (list ,(string-append "CC=" (cc-for-target))
3415 (string-append "VERSION=v" ,version)
3416 (string-append "PREFIX=" prefix)
3417 (string-append "SYSCONFDIR=" prefix "/etc")))
3418 #:test-target "test"))
3419 (native-inputs `(("go" ,go) ;for the test suite
3420 ("pandoc" ,pandoc))) ;to generate the manpage
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)))
3428 (define-public eudev
3429 ;; The post-systemd fork, maintained by Gentoo.
3435 (uri (git-reference (url "https://github.com/gentoo/eudev")
3436 (commit (string-append "v" version))))
3437 (file-name (git-file-name name version))
3440 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3441 (patches (search-patches "eudev-rules-directory.patch"))))
3442 (build-system gnu-build-system)
3445 (modify-phases %standard-phases
3446 (add-after 'unpack 'make-source-writable
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 "."))
3452 (add-before 'bootstrap 'patch-file-names
3453 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3454 (substitute* "man/make.sh"
3455 (("/usr/bin/xsltproc")
3456 (string-append (assoc-ref
3457 (or native-inputs inputs) "xsltproc")
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
3465 (let ((out (assoc-ref outputs "out")))
3466 (substitute* "rules/64-btrfs.rules.in"
3468 (string-append out "/bin")))
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")
3483 "old_library=''\n"))
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.
3490 ;; XXX: This can't be done when cross-compiling. Find another way
3491 ;; to generate hwdb.bin for cross-built systems.
3492 (let ((out (assoc-ref outputs "out")))
3493 ,@(if (%current-target-system)
3495 '((invoke (string-append out "/bin/udevadm")
3496 "hwdb" "--update")))))))
3497 #:configure-flags (list "--enable-manpages")))
3499 `(("autoconf" ,autoconf)
3500 ("automake" ,automake)
3502 ("libtool" ,libtool)
3503 ("pkg-config" ,pkg-config)
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
3511 ("xsltproc" ,libxslt)))
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.
3516 `(("util-linux" ,util-linux "lib") ;for blkid
3518 (outputs '("out" "static"))
3519 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
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
3524 (license license:gpl2+)))
3526 (define-public python-evdev
3528 (name "python-evdev")
3533 (uri (pypi-uri "evdev" version))
3535 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3536 (build-system python-build-system)
3538 `(("kernel-headers" ,linux-libre-headers)))
3540 `(#:tests? #f ;no rule for tests
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")
3548 (assoc-ref inputs "kernel-headers") "/include/linux")))
3550 (home-page "https://github.com/gvalkov/python-evdev")
3551 (synopsis "Bindings to the Linux input handling subsystem")
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/}.
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)))
3563 (define-public interception-tools
3565 (name "interception-tools")
3567 (home-page "https://gitlab.com/interception/linux/tools")
3572 (commit (string-append "v" version))))
3573 (file-name (git-file-name name version))
3576 "121jy40ynkbzlqnx7g0dqwvkb7dm2ahcy6vwrz6ylsyd0jmi6s5a"))))
3577 (build-system cmake-build-system)
3580 ("libevdev" ,libevdev)
3582 ("yaml-cpp" ,yaml-cpp)))
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")))
3593 ;; No tests are included.
3595 (synopsis "Utilities for operating on input events of evdev devices")
3597 "Interception Tools provides a composable infrastructure on top of
3598 @code{libudev} and @code{libevdev}. The following utilities are provided:
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
3606 ;; Dual-licensed under GPLv3+ or "something else" on request, per
3608 (license license:gpl3+)))
3610 (define-public interception-dual-function-keys
3612 (name "interception-dual-function-keys")
3614 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
3620 (file-name (git-file-name name version))
3623 "1gvhkmwzl5fyyc7k8rc4rf2b9mzh05wa8wcybf9hz2x1mqkc7lmz"))))
3624 (build-system gnu-build-system)
3626 `(("libevdev" ,libevdev)
3627 ("yaml-cpp" ,yaml-cpp)))
3629 `(#:make-flags (list "CC=gcc" "CXX=g++"
3630 (string-append "PREFIX=" (assoc-ref %outputs "out")))
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")))
3640 ;; No configure script
3642 ;; No target 'check'
3644 (synopsis "Tap for one key, hold for another")
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)))
3656 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
3658 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3662 "1m4xpda8vbyd89ca0w8nacvnl4j34yzsa625gn990fb5sh84ab44"))
3663 (modules '((guix build utils)))
3666 (use-modules (guix build utils))
3668 ;; Honor sysconfdir.
3669 (substitute* "make.tmpl.in"
3671 "confdir = @sysconfdir@\n")
3672 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3673 "DEFAULT_SYS_DIR = @sysconfdir@"))
3675 (patches (search-patches "lvm2-static-link.patch"))))
3676 (build-system gnu-build-system)
3678 `(("pkg-config" ,pkg-config)
3679 ("procps" ,procps))) ;tests use 'pgrep'
3681 `(("libaio" ,libaio)
3685 (modify-phases %standard-phases
3686 (add-after 'configure 'set-makefile-shell
3688 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3690 (setenv "SHELL" (which "sh"))
3692 ;; Replace /bin/sh with the right file name.
3693 (patch-makefile-SHELL "make.tmpl")
3696 #:configure-flags (list (string-append "--sysconfdir="
3697 (assoc-ref %outputs "out")
3699 "--enable-udev_sync"
3700 "--enable-udev_rules"
3701 "--enable-pkgconfig"
3703 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3705 ;; Make sure programs such as 'dmsetup' can
3706 ;; find libdevmapper.so.
3707 (string-append "LDFLAGS=-Wl,-rpath="
3708 (assoc-ref %outputs "out")
3710 (assoc-ref %outputs "out")
3711 "/lib/device-mapper")
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")
3718 ;; The tests use 'mknod', which requires root access.
3720 (supported-systems (delete "i586-gnu" %supported-systems))
3721 (home-page "https://sourceware.org/lvm2/")
3722 (synopsis "Logical volume management for Linux")
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.")
3728 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3729 ;; Command-line tools are GPLv2.
3730 (license (list license:gpl2 license:lgpl2.1))))
3732 (define-public lvm2-static
3735 (name "lvm2-static")
3737 ;; Propagate udev because libdevmapper.a depends on libudev.
3738 (propagated-inputs `(("udev:static" ,eudev "static")))
3741 (substitute-keyword-arguments (package-arguments lvm2)
3742 ((#:configure-flags flags '())
3743 ;; LVM2 doesn't use Libtool, hence the custom option.
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)))
3752 `(modify-phases ,phases
3753 (add-before 'configure 'adjust-Makefile
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") ""))
3764 (synopsis "Logical volume management for Linux (statically linked)")))
3766 (define-public thin-provisioning-tools
3768 (name "thin-provisioning-tools")
3774 (url "https://github.com/jthornber/thin-provisioning-tools")
3775 (commit (string-append "v" version))))
3776 (file-name (git-file-name name version))
3778 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
3779 (build-system gnu-build-system)
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.
3785 `(("automake" ,automake)
3786 ("autoreconf" ,autoconf)))
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+)))
3797 (define-public wireless-tools
3799 (name "wireless-tools")
3803 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3807 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
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))
3815 (build-system gnu-build-system)
3818 (list (string-append "PREFIX=" %output)
3819 (string-append "INSTALL_MAN=" %output "/share/man")
3820 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3823 (modify-phases %standard-phases
3825 (lambda* (#:key target #:allow-other-keys)
3826 (when ,(%current-target-system)
3827 ;; Cross-compilation: use the cross tools.
3828 (substitute* (find-files "." "Makefile")
3830 (string-append "CC = " target "-gcc\n"))
3832 (string-append "AR = " target "-ar\n"))
3834 (string-append "RANLIB = " target "-ranlib\n"))))
3837 (synopsis "Tools for manipulating Linux Wireless Extensions")
3838 (description "Wireless Tools are used to manipulate the now-deprecated
3839 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
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
3843 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3844 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3845 ;; other files are distributed under gpl2.
3846 (license (list license:gpl2 license:lgpl2.1+))))
3854 (uri (string-append "mirror://kernel.org/software/network/crda/"
3855 "crda-" version ".tar.xz"))
3858 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3859 (patches (search-patches "crda-optional-gcrypt.patch"))))
3860 (build-system gnu-build-system)
3862 `(#:phases (modify-phases %standard-phases
3864 (add-after 'unpack 'gzip-determinism
3866 (substitute* "Makefile"
3867 (("gzip") "gzip --no-name"))
3869 ,@(if (%current-target-system)
3871 'unpack 'fix-pkg-config
3872 (lambda* (#:key target #:allow-other-keys)
3876 (string-append target "-pkg-config")))
3880 'build 'no-werror-no-ldconfig
3882 (substitute* "Makefile"
3884 (("ldconfig") "true"))
3887 'build 'set-regulator-db-file-name
3888 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3889 ;; Tell CRDA where to find our database.
3890 (let ((regdb (assoc-ref (or native-inputs inputs)
3892 (substitute* "crda.c"
3893 (("\"/lib/crda/regulatory.bin\"")
3894 (string-append "\"" regdb
3895 "/lib/crda/regulatory.bin\"")))
3897 #:test-target "verify"
3898 #:make-flags (let ((out (assoc-ref %outputs "out"))
3899 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3901 (string-append "CC=" ,(cc-for-target))
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>
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="
3920 (string-append "REG_BIN=" regdb
3921 "/lib/crda/regulatory.bin")
3923 (native-inputs `(("pkg-config" ,pkg-config)
3924 ("wireless-regdb" ,wireless-regdb)))
3925 (inputs `(("libnl" ,libnl)))
3927 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3928 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3930 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3931 communication between the kernel Linux and user space for regulatory
3933 (license license:copyleft-next)))
3935 (define-public wireless-regdb
3937 (name "wireless-regdb")
3938 (version "2020.11.20")
3942 "mirror://kernel.org/software/network/wireless-regdb/"
3943 "wireless-regdb-" version ".tar.xz"))
3946 "0liagyi6ppf5w474qk9j4jz5gbvvn8mc8al1dq4b1xrgv28485ml"))
3948 ;; We're building 'regulatory.bin' by ourselves.
3950 (delete-file "regulatory.bin")
3952 (build-system gnu-build-system)
3955 (modify-phases %standard-phases
3956 (add-after 'unpack 'gzip-determinism
3958 (substitute* "Makefile"
3959 (("gzip") "gzip --no-name"))
3961 (add-after 'unpack 'omit-signature
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 ")))
3972 (delete 'configure)) ; no configure script
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
3980 #:tests? #f ; no tests
3982 (let ((out (assoc-ref %outputs "out")))
3983 (list (string-append "PREFIX=" out)
3984 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
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")))))
3995 `(("python" ,python-wrapper)))
3997 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3998 (synopsis "Wireless regulatory database")
4000 "This package contains the wireless regulatory database for the Central
4001 Regulatory Database Agent (CRDA). The database contains information on
4002 country-specific regulations for the wireless spectrum.")
4003 (license license:isc)))
4005 (define-public lm-sensors
4013 (url "https://github.com/groeck/lm-sensors")
4014 (commit (string-append "V" (string-join
4015 (string-split version #\.) "-")))))
4016 (file-name (git-file-name name version))
4018 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
4019 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
4020 (build-system gnu-build-system)
4021 (inputs `(("rrdtool" ,rrdtool)
4024 ("gnuplot" ,gnuplot)))
4025 (native-inputs `(("pkg-config" ,pkg-config)
4029 (outputs '("lib" ; avoid perl in closure
4032 `(#:tests? #f ; no 'check' target
4033 #:make-flags (list (string-append "PREFIX=" %output)
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"))
4040 (modify-phases %standard-phases
4042 (add-before 'build 'patch-exec-paths
4043 (lambda* (#:key inputs outputs #:allow-other-keys)
4044 (substitute* "prog/detect/sensors-detect"
4046 (string-append "`" (assoc-ref inputs "coreutils")
4048 (("(`|\")modprobe" all open-quote)
4049 (string-append open-quote
4050 (assoc-ref inputs "kmod")
4052 (substitute* '("prog/pwm/pwmconfig"
4053 "prog/pwm/fancontrol")
4055 (string-append (assoc-ref inputs "gnuplot")
4058 (string-append (assoc-ref inputs "coreutils")
4061 (string-append (assoc-ref inputs "grep")
4064 (string-append (assoc-ref inputs "sed")
4067 (string-append (assoc-ref inputs "coreutils")
4070 (string-append (assoc-ref inputs "coreutils")
4073 (string-append (assoc-ref inputs "coreutils")
4074 "/bin/readlink -f")))
4076 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
4077 (synopsis "Utilities to read temperature/voltage/fan sensors")
4079 "Lm-sensors is a hardware health monitoring package for Linux. It allows
4080 you to access information from temperature, voltage, and fan speed sensors.
4081 It works with most newer systems.")
4082 (license license:gpl2+)))
4084 (define-public iucode-tool
4086 (name "iucode-tool")
4090 (uri (string-append "https://gitlab.com/iucode-tool/releases"
4091 "/raw/latest/iucode-tool_" version ".tar.xz"))
4094 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
4095 (build-system gnu-build-system)
4096 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
4097 (synopsis "Manipulate Intel microcode bundles")
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.")
4102 ;; cpuid.h is available for i686, x86_64, and ia64.
4103 (supported-systems '("i686-linux" "x86_64-linux"))
4104 (license license:gpl2+)))
4106 (define-public i2c-tools
4113 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
4114 version ".tar.bz2"))
4117 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
4118 (build-system gnu-build-system)
4120 `(#:tests? #f ; no 'check' target
4121 #:make-flags (list (string-append "prefix=" %output)
4122 ,(string-append "CC=" (cc-for-target)))
4123 ;; No configure script.
4124 #:phases (modify-phases %standard-phases (delete 'configure))))
4127 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
4128 (synopsis "I2C tools for Linux")
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
4134 (license license:gpl2+)))
4136 (define-public xsensors
4143 "http://www.linuxhardware.org/xsensors/xsensors-"
4147 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
4148 (build-system gnu-build-system)
4149 (inputs `(("lm-sensors" ,lm-sensors "lib")
4151 (native-inputs `(("pkg-config" ,pkg-config)))
4154 (modify-phases %standard-phases
4155 (add-before 'configure 'enable-deprecated
4157 (substitute* "src/Makefile.in"
4158 (("-DGDK_DISABLE_DEPRECATED") "")
4159 (("-DGTK_DISABLE_DEPRECATED") ""))
4161 (add-before 'configure 'remove-Werror
4163 (substitute* '("configure" "src/Makefile.in")
4166 (home-page "http://www.linuxhardware.org/xsensors/")
4167 (synopsis "Hardware health information viewer")
4169 "Xsensors reads data from the libsensors library regarding hardware
4170 health such as temperature, voltage and fan speed and displays the information
4171 in a digital read-out.")
4172 (license license:gpl2+)))
4177 (version (package-version linux-libre))
4178 (source (package-source linux-libre))
4179 (build-system gnu-build-system)
4182 (modify-phases %standard-phases
4184 (lambda* (#:key inputs #:allow-other-keys)
4185 (setenv "SHELL_PATH" (which "bash"))
4186 (chdir "tools/perf")
4188 #:make-flags (list (string-append "prefix="
4189 (assoc-ref %outputs "out"))
4193 ;; By default, 'config/Makefile' uses lib64 on
4194 ;; x86_64. Work around that.
4196 #:tests? #f)) ;no tests
4198 `(("pkg-config" ,pkg-config)
4202 ;; There are build scripts written in these languages.
4204 ("python2" ,python-2)
4205 ("python3" ,python-3)))
4207 `(("slang" ,slang) ;for the interactive TUI
4209 ("python" ,python-2) ;'perf' links against libpython
4210 ("elfutils" ,elfutils)
4211 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
4212 ("libunwind" ,libunwind) ;better stack walking
4213 ("numactl" ,numactl) ;for 'perf bench numa mem'
4216 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
4217 ("docbook-xsl" ,docbook-xsl)
4219 ("asciidoc" ,asciidoc)))
4220 (home-page "https://perf.wiki.kernel.org/")
4221 (synopsis "Linux profiling with performance counters")
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
4227 particular the @code{perf} command.")
4228 (license (package-license linux-libre))))
4230 (define-public pflask
4237 (url "https://github.com/ghedo/pflask")
4238 (commit (string-append "v" version))))
4239 (file-name (git-file-name name version))
4242 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
4243 (build-system cmake-build-system)
4245 '(#:tests? #f)) ; no tests
4246 (home-page "https://ghedo.github.io/pflask/")
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.")
4253 (license license:bsd-2)))
4255 (define-public singularity
4257 (name "singularity")
4261 (uri (string-append "https://github.com/singularityware/singularity/"
4262 "releases/download/" version
4263 "/singularity-" version ".tar.gz"))
4266 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
4267 (modules '((guix build utils)))
4270 ;; Do not create directories in /var.
4271 (substitute* "Makefile.in"
4272 (("\\$\\(MAKE\\) .*install-data-hook") ""))
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"
4280 (string-append "#" all "\n")))
4282 (substitute* (find-files "libexec/cli" "\\.exec$")
4283 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
4285 (string-append "/run/setuid-programs/singularity-"
4286 program "-helper")))
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\"")
4294 (build-system gnu-build-system)
4296 `(#:configure-flags '("--localstatedir=/var")
4298 (modify-phases %standard-phases
4299 (add-after 'unpack 'patch-references
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$"))
4308 (string-append "| " (which "grep") " "))
4310 (string-append (which "egrep") " "))
4312 (string-append " " (which "sed") " ")))
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")))
4327 `(("libarchive" ,libarchive)
4328 ("python" ,python-wrapper)
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)))
4339 (define-public hdparm
4345 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
4346 "hdparm-" version ".tar.gz"))
4349 "0zvppv8qw0y1shlhn34iq1g4883i1cywsa514n595nmyrmsrs3rc"))))
4350 (build-system gnu-build-system)
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.
4360 (modify-phases %standard-phases
4361 (delete 'configure)) ; no configure script
4362 #:tests? #f)) ; no test suite
4363 (home-page "https://sourceforge.net/projects/hdparm/")
4364 (synopsis "View and tune ATA disk drive parameters")
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.
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
4374 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4375 Translation (@dfn{SAT}) are also supported.")
4376 (license (license:non-copyleft "file://LICENSE.TXT"))))
4378 (define-public nvme-cli
4382 (home-page "https://github.com/linux-nvme/nvme-cli")
4387 (commit (string-append "v" version))))
4389 (base32 "0dpadz945482srqpsbfx1bh7rc499fgpyzz1flhk9g9xjbpapkzc"))
4390 (file-name (git-file-name name version))))
4391 (build-system gnu-build-system)
4394 (list ,(string-append "CC=" (cc-for-target)))
4395 #:phases (modify-phases %standard-phases
4396 (delete 'configure) ; no ./configure script
4399 (invoke "make" "install-spec" "PREFIX="
4400 (string-append "DESTDIR=" %output)))))
4401 ;; The tests require sysfs, which is not accessible from from the build
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+)))
4410 (define-public rfkill
4416 (uri (string-append "mirror://kernel.org/software/network/"
4417 name "/" name "-" version ".tar.xz"))
4420 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4421 (build-system gnu-build-system)
4423 `(#:make-flags (list "CC=gcc"
4424 (string-append "PREFIX=" %output))
4425 #:phases (modify-phases %standard-phases
4426 (delete 'configure))
4428 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4429 (synopsis "Tool for enabling and disabling wireless devices")
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.")
4434 (license (license:non-copyleft "file://COPYING"
4435 "See COPYING in the distribution."))
4436 ;; rfkill is part of util-linux as of 2.31.
4437 (properties `((superseded . ,util-linux)))))
4445 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4446 version "/" name "-" version ".tar.gz"))
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+)))
4459 (define-public acpid
4465 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4469 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4470 (build-system gnu-build-system)
4471 (home-page "https://sourceforge.net/projects/acpid2/")
4472 (synopsis "Daemon for delivering ACPI events to user-space programs")
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.")
4479 (license license:gpl2+)))
4481 (define-public sysfsutils
4490 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
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")
4498 "These are a set of utilities built upon sysfs, a virtual file system in
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+.
4503 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4505 (define-public sysfsutils-1
4507 (inherit sysfsutils)
4514 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4515 "/sysfsutils-" version ".tar.gz"))
4517 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4518 (modules '((guix build utils)))
4521 (substitute* "Makefile.in"
4522 (("includedir = /usr/include/sysfs")
4523 "includedir = @includedir@"))
4524 (substitute* "configure"
4525 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4526 (string-append "includedir='" orig "/sysfs'")))
4528 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4530 (define-public cpufrequtils
4532 (name "cpufrequtils")
4537 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4538 "cpufrequtils-" version ".tar.gz"))
4540 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4541 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4542 (build-system gnu-build-system)
4544 `(("sysfsutils" ,sysfsutils-1)))
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")
4551 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4552 information, and set the CPU frequency if supported, using the cpufreq
4553 capabilities of the Linux kernel.")
4554 (license license:gpl2)))
4556 (define-public libraw1394
4563 "mirror://kernel.org/linux/libs/ieee1394/"
4564 name "-" version ".tar.xz"))
4567 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
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")
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.")
4577 (license license:lgpl2.1+)))
4579 (define-public libavc1394
4585 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4586 name "-" version ".tar.gz"))
4589 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4590 (build-system gnu-build-system)
4592 `(("pkg-config" ,pkg-config)))
4594 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4595 (home-page "https://sourceforge.net/projects/libavc1394/")
4596 (synopsis "AV/C protocol library for IEEE 1394")
4598 "Libavc1394 is a programming interface to the AV/C specification from
4599 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4600 (license license:lgpl2.1+)))
4602 (define-public libiec61883
4604 (name "libiec61883")
4609 "mirror://kernel.org/linux/libs/ieee1394/"
4610 name "-" version ".tar.xz"))
4613 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4614 (build-system gnu-build-system)
4616 `(("pkg-config" ,pkg-config)))
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")
4622 "The libiec61883 library provides a higher level API for streaming DV,
4623 MPEG-2 and audio over Linux IEEE 1394.")
4624 (license license:lgpl2.1+)))
4626 (define-public mdadm
4633 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4637 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4638 (build-system gnu-build-system)
4642 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4643 (list ,(string-append "CC=" (cc-for-target))
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")))
4652 (modify-phases %standard-phases
4653 (add-before 'build 'patch-program-paths
4654 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4655 (let ((coreutils (assoc-ref (or native-inputs inputs)
4657 (substitute* "udev-md-raid-arrays.rules"
4658 (("/usr/bin/(readlink|basename)" all program)
4659 (string-append coreutils "/bin/" program))))
4661 (add-before 'build 'remove-W-error
4663 ;; We cannot build with -Werror on i686 due to a
4664 ;; 'sign-compare' warning in util.c.
4665 (substitute* "Makefile"
4668 (delete 'configure))
4669 ;;tests must be done as root
4671 (supported-systems (delete "i586-gnu" %supported-systems))
4672 (home-page "http://neil.brown.name/blog/mdadm")
4673 (synopsis "Tool for managing Linux Software RAID arrays")
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.")
4678 (license license:gpl2+)))
4680 (define-public mdadm-static
4683 (name "mdadm-static")
4685 (substitute-keyword-arguments (package-arguments mdadm)
4686 ((#:make-flags flags)
4687 `(cons "LDFLAGS = -static" ,flags))
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")
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")))
4709 (define-public multipath-tools
4711 (name "multipath-tools")
4716 (url "https://git.opensvc.com/multipath-tools/.git")
4718 (file-name (git-file-name name version))
4721 "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg"))
4722 (modules '((guix build utils)))
4725 ;; Drop bundled valgrind headers.
4726 (delete-file-recursively "third-party")
4727 (substitute* '("multipathd/main.c"
4728 "libmultipath/debug.c")
4729 (("#include \"../third-party/")
4732 (build-system gnu-build-system)
4734 '(#:test-target "test"
4735 #:parallel-build? #f ;XXX: broken in 0.8.4
4736 #:make-flags (list "CC=gcc"
4737 (string-append "DESTDIR="
4738 (assoc-ref %outputs "out"))
4739 ;; Install Udev rules below this directory, relative
4742 (string-append "LDFLAGS=-Wl,-rpath="
4743 (assoc-ref %outputs "out")
4746 (modify-phases %standard-phases
4747 (add-after 'unpack 'patch-source
4748 (lambda* (#:key inputs #:allow-other-keys)
4749 (let ((lvm2 (assoc-ref inputs "lvm2"))
4750 (udev (assoc-ref inputs "udev")))
4751 (substitute* "Makefile.inc"
4752 (("\\$\\(prefix\\)/usr") "$(prefix)")
4753 ;; Do not save timestamp to avoid gzip "timestamp
4754 ;; out-of-range" warnings.
4755 (("gzip -9") "gzip -9n"))
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")))
4762 (add-after 'unpack 'fix-maybe-uninitialized-variable
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;"))
4771 (add-after 'unpack 'fix-linking-tests
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"))
4779 (add-after 'unpack 'skip-failing-tests
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 ")))
4791 (delete 'configure)))) ; no configure script
4794 ("pkg-config" ,pkg-config)
4795 ("valgrind" ,valgrind)
4798 ("cmocka" ,cmocka)))
4800 `(("json-c" ,json-c)
4802 ("liburcu" ,liburcu)
4804 ("readline" ,readline)
4806 (home-page "http://christophe.varoqui.free.fr/")
4807 (synopsis "Access block devices through multiple paths")
4809 "This package provides the following binaries to drive the
4810 Linux Device Mapper multipathing driver:
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.
4818 (license (list license:gpl2+ ; main distribution
4819 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4821 (define-public libaio
4828 (string-append "https://releases.pagure.org/libaio/"
4829 name "-" version ".tar.gz")))
4832 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4833 (build-system gnu-build-system)
4836 (let ((target ,(%current-target-system)))
4837 (list (string-append "prefix=" %output)
4840 (string-append (assoc-ref %build-inputs "cross-gcc")
4841 "/bin/" target "-gcc")
4843 #:test-target "partcheck" ; need root for a full 'check'
4845 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4846 (home-page "https://pagure.io/libaio")
4847 (synopsis "Linux-native asynchronous I/O access library")
4849 "This library enables userspace to use Linux kernel asynchronous I/O
4850 system calls, important for the performance of databases and other advanced
4852 (license license:lgpl2.1+)))
4854 (define-public blktrace
4855 ;; Take a newer commit to get the fix for CVE-2018-10689.
4856 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4860 (version (git-version "1.2.0" revision commit))
4862 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4869 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4870 (file-name (git-file-name name version))))
4871 (build-system gnu-build-system)
4874 (list ,(string-append "CC=" (cc-for-target))
4875 (string-append "prefix=" %output))
4876 #:tests? #f ; no tests
4878 (modify-phases %standard-phases
4879 (delete 'configure) ; no configure script
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"
4885 (string-append gnuplot "/bin/gnuplot %s")))
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))))
4903 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4905 (patches (search-patches "sbc-fix-build-non-x86.patch"))
4908 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
4909 (build-system gnu-build-system)
4911 `(("libsndfile" ,libsndfile)))
4913 `(("pkg-config" ,pkg-config)))
4914 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4915 (synopsis "Bluetooth subband audio codec")
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+)))
4921 (define-public bluez
4928 "mirror://kernel.org/linux/bluetooth/bluez-"
4932 "124v9s4y1s7s6klx5vlmzpk1jlr4x84ch7r7scm7x2f42dqp2qw8"))))
4933 (build-system gnu-build-system)
4936 (let ((out (assoc-ref %outputs "out")))
4937 (list "--sysconfdir=/etc"
4938 "--localstatedir=/var"
4941 ;; TODO: is this needed? Not installed by default since 5.55.
4943 ;; Install dbus/udev files to the correct location.
4944 (string-append "--with-dbusconfdir=" out "/etc")
4945 (string-append "--with-udevdir=" out "/lib/udev")))
4947 (modify-phases %standard-phases
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
4953 (substitute* "unit/test-gatt.c"
4954 (("tester_init\\(&argc, &argv\\);") "return 77;"))
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
4966 (string-append out "/libexec/bluetooth/obexd")))
4967 (install-file service servicedir)
4968 ;; Fix paths in the udev rule.
4970 (("hid2hci --method")
4971 (string-append out "/lib/udev/hid2hci --method"))
4973 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4976 `(("pkg-config" ,pkg-config)
4977 ("gettext" ,gettext-minimal)))
4982 ("libical" ,libical)
4983 ("readline" ,readline)))
4984 (home-page "http://www.bluez.org/")
4985 (synopsis "Linux Bluetooth protocol stack")
4987 "BlueZ provides support for the core Bluetooth layers and protocols. It
4988 is flexible, efficient and uses a modular implementation.")
4989 (license license:gpl2+)))
4991 (define-public fuse-exfat
4998 "https://github.com/relan/exfat/releases/download/v"
4999 version "/" name "-" version ".tar.gz"))
5002 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
5003 (build-system gnu-build-system)
5005 `(("pkg-config" ,pkg-config)))
5008 (home-page "https://github.com/relan/exfat")
5009 (synopsis "Mount exFAT file systems")
5011 "This package provides a FUSE-based file system that provides read and
5012 write access to exFAT devices.")
5013 (license license:gpl2+)))
5015 (define-public fuseiso
5018 (version "20070708")
5021 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
5022 version "/fuseiso-" version ".tar.bz2"))
5025 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
5026 (build-system gnu-build-system)
5028 `(("pkg-config" ,pkg-config)))
5033 (home-page "https://sourceforge.net/projects/fuseiso/")
5034 (synopsis "Mount ISO file system images")
5036 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
5037 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
5038 Ridge, Joliet, and zisofs.")
5039 (license license:gpl2)))
5048 "https://www.nico.schottelius.org/software/gpm/archives/"
5049 "gpm-" version ".tar.bz2"))
5050 (patches (search-patches "gpm-glibc-2.26.patch"))
5053 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
5054 (build-system gnu-build-system)
5056 '(#:phases (modify-phases %standard-phases
5059 ;; The tarball was not generated with 'make dist' so we
5060 ;; need to bootstrap things ourselves.
5061 (substitute* "autogen.sh"
5062 (("/bin/sh") (which "sh")))
5063 (invoke "./autogen.sh")
5064 (patch-makefile-SHELL "Makefile.include.in")
5067 ;; Make sure programs find libgpm.so.
5068 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
5069 (assoc-ref %outputs "out")
5072 `(("texinfo" ,texinfo)
5075 ("autoconf" ,autoconf)
5076 ("automake" ,automake)
5077 ("libtool" ,libtool)))
5078 (home-page "https://www.nico.schottelius.org/software/gpm/")
5079 (synopsis "Mouse support for the Linux console")
5081 "The GPM (general-purpose mouse) daemon is a mouse server for
5082 applications running on the Linux console. It allows users to select items
5083 and copy/paste text in the console and in xterm.")
5084 (license license:gpl2+)))
5086 (define-public btrfs-progs
5088 (name "btrfs-progs")
5092 (uri (string-append "mirror://kernel.org/linux/kernel/"
5093 "people/kdave/btrfs-progs/"
5094 "btrfs-progs-v" version ".tar.xz"))
5097 "0n9p8zaz4nrkgc20cp6zj7gp4ib4hd4lbyph74f4pysllkz4c24m"))))
5098 (build-system gnu-build-system)
5100 "static")) ; static versions of the binaries in "out"
5102 '(#:phases (modify-phases %standard-phases
5103 (add-after 'unpack 'patch-makefile
5104 (lambda* (#:key outputs #:allow-other-keys)
5105 (substitute* "Makefile"
5106 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
5107 (string-append (assoc-ref outputs "out")
5108 "/lib/udev/rules.d")))
5110 (add-after 'build 'build-static
5111 (lambda _ (invoke "make" "static")))
5112 (add-after 'install 'install-bash-completion
5113 (lambda* (#:key outputs #:allow-other-keys)
5114 (let* ((out (assoc-ref outputs "out"))
5115 (bashcomp (string-append out "/etc/bash_completion.d")))
5117 (copy-file "btrfs-completion"
5118 (string-append bashcomp "/btrfs"))
5120 (add-after 'install 'install-static
5121 (let ((staticbin (string-append (assoc-ref %outputs "static")
5125 (string-append "bindir=" staticbin)
5126 "install-static")))))
5127 #:tests? #f ; XXX: require the 'btrfs' kernel module.
5128 #:test-target "test"
5129 #:parallel-tests? #f)) ; tests fail when run in parallel
5130 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
5132 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
5133 ("util-linux:static" ,util-linux "static") ;ditto
5135 ("zlib:static" ,zlib "static")
5136 ("zstd" ,zstd "lib")
5137 ("zstd:static" ,zstd "static")))
5138 (native-inputs `(("pkg-config" ,pkg-config)
5139 ("asciidoc" ,asciidoc)
5142 ;; Remove this input entirely when the default headers
5143 ;; version provides blk_zone.capacity (>= 5.9).
5144 ("linux-libre-headers" ,linux-libre-headers-5.10)
5145 ;; For building documentation.
5146 ("libxml2" ,libxml2)
5147 ("docbook-xsl" ,docbook-xsl)
5153 ;; The tests need 'grep' with perl regexp support.
5155 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
5156 (synopsis "Create and manage btrfs copy-on-write file systems")
5157 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
5158 aimed at implementing advanced features while focusing on fault tolerance,
5159 repair and easy administration.")
5160 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
5161 ;; GPL2: Everything else.
5162 (license (list license:gpl2 license:gpl2+))))
5164 (define-public btrfs-progs/static
5166 (name "btrfs-progs-static")
5167 (version (package-version btrfs-progs))
5169 (build-system trivial-build-system)
5171 `(("btrfs-progs:static" ,btrfs-progs "static")))
5173 `(#:modules ((guix build utils))
5176 (use-modules (guix build utils)
5180 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
5181 (out (assoc-ref %outputs "out"))
5182 (source (string-append btrfs "/bin/btrfs.static"))
5183 (target (string-append out "/bin/btrfs")))
5184 (mkdir-p (dirname target))
5185 (copy-file source target)
5186 (remove-store-references target)
5187 (chmod target #o555)
5189 (home-page (package-home-page btrfs-progs))
5190 (synopsis "Statically-linked btrfs command from btrfs-progs")
5191 (description "This package provides the statically-linked @command{btrfs}
5192 from the btrfs-progs package. It is meant to be used in initrds.")
5193 (license (package-license btrfs-progs))))
5195 (define-public cramfs-tools
5197 (name "cramfs-tools")
5198 (home-page "https://github.com/npitre/cramfs-tools")
5204 (commit (string-append "v" version))))
5206 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
5207 (file-name (git-file-name name version))))
5208 (build-system gnu-build-system)
5210 '(#:tests? #f ; No tests.
5212 (modify-phases %standard-phases
5215 (lambda* (#:key outputs #:allow-other-keys)
5216 (let ((out (assoc-ref outputs "out")))
5217 (install-file "mkcramfs" (string-append out "/sbin"))
5218 (install-file "cramfsck" (string-append out "/sbin")))
5222 (synopsis "Tools to manage Cramfs file systems")
5223 (description "Cramfs is a Linux file system designed to be simple, small,
5224 and to compress things well. It is used on a number of embedded systems and
5225 small devices. This version has additional features such as uncompressed
5226 blocks and random block placement.")
5227 (license license:gpl2+)))
5229 (define-public compsize
5233 (home-page "https://github.com/kilobyte/compsize")
5238 (commit (string-append "v" version))))
5240 (base32 "0vqnrwgpv6pc1yjl0g4gl71xyl6v0xl3pyqjanjpwps73c53azir"))
5241 (file-name (git-file-name name version))))
5242 (build-system gnu-build-system)
5244 `(("btrfs-progs" ,btrfs-progs)))
5246 `(#:tests? #f ; No tests.
5248 (list (string-append "CC=" ,(cc-for-target)))
5250 (modify-phases %standard-phases
5253 (lambda* (#:key outputs #:allow-other-keys)
5254 (let ((out (assoc-ref outputs "out")))
5255 (install-file "compsize" (string-append out "/bin"))
5256 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
5257 (synopsis "Find compression type/ratio on Btrfs files")
5258 (description "@command{compsize} takes a list of files (given as
5259 arguments) on a Btrfs file system and measures used compression types and
5260 effective compression ratio, producing a report.
5262 A directory has no extents but has a (recursive) list of files. A non-regular
5263 file is silently ignored.
5265 As it makes no sense to talk about compression ratio of a partial extent,
5266 every referenced extent is counted whole, exactly once -- no matter if you use
5267 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
5268 uncompressed size will not match the number given by @command{tar} or
5269 @command{du}. On the other hand, the space used should be accurate (although
5270 obviously it can be shared with files outside our set).")
5271 (license license:gpl2+)))
5273 (define-public f2fs-tools-1.7
5280 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5281 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5284 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
5286 (build-system gnu-build-system)
5289 (modify-phases %standard-phases
5290 (add-after 'install 'install-headers
5291 (lambda* (#:key outputs #:allow-other-keys)
5292 (let* ((out (assoc-ref outputs "out"))
5293 (out-include (string-append out "/include")))
5294 (install-file "include/f2fs_fs.h" out-include)
5295 (install-file "mkfs/f2fs_format_utils.h" out-include)
5298 `(("autoconf" ,autoconf)
5299 ("automake" ,automake)
5300 ("libtool" ,libtool)
5301 ("pkg-config" ,pkg-config)))
5303 `(("libuuid" ,util-linux "lib")
5304 ("libselinux" ,libselinux)))
5305 (home-page "https://f2fs.wiki.kernel.org/")
5306 (synopsis "Userland tools for f2fs")
5308 "F2FS, the Flash-Friendly File System, is a modern file system
5309 designed to be fast and durable on flash devices such as solid-state
5310 disks and SD cards. This package provides the userland utilities.")
5311 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
5312 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
5313 (license (list license:gpl2 license:lgpl2.1))))
5315 (define-public f2fs-tools
5317 (inherit f2fs-tools-1.7)
5323 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5324 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5327 "1lab1446c78xsjwhpki7s85z4171m8p9279c8yhm4882wba674k1"))))
5329 `(("libuuid" ,util-linux "lib")))))
5331 (define-public f2fs-tools/static
5334 (inherit f2fs-tools)
5335 (name "f2fs-tools-static")
5338 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
5339 (libuuid (assoc-ref %build-inputs "libuuid")))
5341 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
5342 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
5343 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
5344 "-I" libuuid "/include/blkid")
5345 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
5346 #:disallowed-references (,util-linux)
5348 (modify-phases %standard-phases ; TODO: f2fs phases.
5349 (add-after 'unpack 'make-static
5351 (define (append-to-file name body)
5352 (let ((file (open-file name "a")))
5355 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
5356 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
5357 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
5359 (add-after 'install 'remove-store-references
5360 (lambda* (#:key outputs #:allow-other-keys)
5361 ;; Work around bug in our util-linux.
5362 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
5363 (remove-store-references (string-append (assoc-ref outputs "out")
5367 `(("libuuid:static" ,util-linux "static")
5368 ("libuuid" ,util-linux "lib")))))) ; for include files
5370 (define-public f2fs-fsck/static
5372 (name "f2fs-fsck-static")
5373 (version (package-version f2fs-tools/static))
5375 (build-system trivial-build-system)
5377 `(#:modules ((guix build utils))
5380 (use-modules (guix build utils)
5383 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
5385 (out (assoc-ref %outputs "out"))
5386 (sbin (string-append out "/sbin")))
5388 (with-directory-excursion sbin
5389 (install-file (string-append f2fs-tools "/sbin/" fsck)
5391 (remove-store-references fsck)
5395 `(("f2fs-tools-static" ,f2fs-tools/static)))
5396 (home-page (package-home-page f2fs-tools/static))
5397 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5398 (description "This package provides statically-linked fsck.f2fs command taken
5399 from the f2fs-tools package. It is meant to be used in initrds.")
5400 (license (package-license f2fs-tools/static))))
5402 (define-public freefall
5405 (version (package-version linux-libre))
5406 (source (package-source linux-libre))
5407 (build-system gnu-build-system)
5409 '(#:phases (modify-phases %standard-phases
5410 (add-after 'unpack 'enter-subdirectory
5412 (chdir "tools/laptop/freefall")
5415 (add-before 'build 'increase-timeout
5417 ;; The default of 2 seconds is too low: it assumes an
5418 ;; open lid and AC power without actually checking.
5419 (substitute* "freefall.c"
5420 (("alarm\\(2\\)") "alarm(5)"))
5422 #:make-flags (list (string-append "PREFIX="
5423 (assoc-ref %outputs "out"))
5425 #:tests? #f)) ;no tests
5426 (home-page (package-home-page linux-libre))
5427 (synopsis "Free-fall protection for spinning laptop hard drives")
5429 "Prevents shock damage to the internal spinning hard drive(s) of some
5430 HP and Dell laptops. When sudden movement is detected, all input/output
5431 operations on the drive are suspended and its heads are parked on the ramp,
5432 where they are less likely to cause damage to the spinning disc. Requires a
5433 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5434 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5435 (license license:gpl2)))
5437 (define-public thinkfan
5445 (url "https://github.com/vmatare/thinkfan")
5447 (file-name (git-file-name name version))
5449 (base32 "18vgm5w5pjnpipa34j4x87q10695w2jnqwvc2f027afy7mnzw7kz"))))
5450 (build-system cmake-build-system)
5452 `(#:modules ((guix build cmake-build-system)
5455 #:tests? #f ; no test target
5457 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5458 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5460 `("-DUSE_ATASMART:BOOL=ON")
5462 (modify-phases %standard-phases
5463 (add-after 'unpack 'create-init-scripts
5464 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5465 ;; systemd to patch and install their service files. Fake their
5466 ;; presence rather than duplicating the build system below. Leave
5467 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5468 ;; The sysvinit needs manual patching, but since upstream doesn't
5469 ;; even provide the option to install it: don't.
5470 (lambda* (#:key outputs #:allow-other-keys)
5471 (let* ((out (assoc-ref outputs "out"))
5472 (share (string-append out "/share/" ,name)))
5473 (substitute* "CMakeLists.txt"
5474 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5475 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5476 ;; That was easy! Now we just need to fix the destinations.
5478 (string-append out directory)))
5481 `(("pkg-config" ,pkg-config)))
5483 `(("libatasmart" ,libatasmart)
5484 ("yaml-cpp" ,yaml-cpp)))
5485 (home-page "https://github.com/vmatare/thinkfan")
5486 (synopsis "Simple fan control program")
5488 "Thinkfan is a simple fan control program. It reads temperatures,
5489 checks them against configured limits and switches to appropriate (also
5490 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5491 other @code{hwmon} driver that enables temperature reading and fan control
5493 (license license:gpl3+)))
5495 (define-public tpacpi-bat
5503 (url "https://github.com/teleshoes/tpacpi-bat")
5504 (commit (string-append "v" version))))
5505 (file-name (git-file-name name version))
5507 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5508 (build-system gnu-build-system)
5510 `(#:tests? #f ; no test target
5512 (modify-phases %standard-phases
5513 (add-after 'unpack 'refer-to-inputs
5515 (substitute* "tpacpi-bat"
5517 (format #f "~a " (which "cat")))
5518 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5519 ;; loaded. That's the administrator's prerogative; disable it.
5520 (("system \"(modprobe .*)\"" _ match)
5521 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5523 (delete 'configure) ; nothing to configure
5524 (delete 'build) ; nothing to build
5526 (lambda* (#:key outputs #:allow-other-keys)
5527 (let* ((out (assoc-ref outputs "out"))
5528 (bin (string-append out "/bin"))
5529 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5530 (install-file "tpacpi-bat" bin)
5532 ;; There's no man page. Install other forms of documentation.
5533 (for-each (lambda (file)
5534 (let ((target (string-append doc "/" file)))
5535 (mkdir-p (dirname target))
5536 (copy-recursively file target)))
5537 (list "battery_asl" "examples" "README.md"))
5541 (home-page "https://github.com/teleshoes/tpacpi-bat")
5542 (synopsis "ThinkPad battery charge controller")
5544 "Tpacpi-bat is a command-line interface to control battery charging on
5545 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5546 ThinkPad models released after 2011}, starting with the xx20 series. It can
5547 query and set the thresholds at which one or both batteries will start and stop
5548 charging, inhibit charging batteries for a set period of time, or force them to
5549 discharge when they otherwise would not.
5551 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5552 kernel module provided by the @code{acpi-call-linux-module} package, which must
5553 be installed and loaded separately. Only the original vendor firmware is
5555 (license license:gpl3+)))
5560 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
5561 (version (package-version linux-libre))
5562 (source (package-source linux-libre))
5563 (build-system gnu-build-system)
5565 `(#:tests? #f ; no test suite
5567 (list (string-append "CC=" ,(cc-for-target))
5568 (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out"))
5571 (modify-phases %standard-phases
5572 (add-after 'unpack 'enter-subdirectory
5574 (chdir "tools/thermal/tmon")
5576 (add-after 'install 'install-man-page
5577 (lambda* (#:key outputs #:allow-other-keys)
5578 (let* ((out (assoc-ref outputs "out"))
5579 (man8 (string-append out "/share/man/man8")))
5580 (install-file "tmon.8" man8)
5582 (delete 'configure)))) ; no configure script
5584 `(("ncurses" ,ncurses)))
5585 (home-page (package-home-page linux-libre))
5586 (synopsis "Monitor and test the Linux thermal subsystem in real time")
5588 "Tmon is a tool to interact with the complex thermal subsystem of the
5589 kernel Linux. It helps visualize thermal relationships and real-time thermal
5590 data, tune and test cooling devices and sensors, and collect thermal data for
5593 As computers become smaller and more thermally constrained, more sensors are
5594 added and new cooling capabilities introduced. Thermal relationships can change
5595 dynamically. Their complexity grows exponentially among cooling devices, zones,
5596 sensors, and trip points.
5598 Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
5599 of symbolic links, trip point bindings, and device instances. To traverse it
5600 by hand is no trivial task: @command{tmon} aims to make it understandable.")
5601 (license (list license:gpl2 ; the man page
5602 license:gpl2+)))) ; the actual rest
5604 (define-public turbostat
5607 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
5608 ;; make it harder to benefit from ‘free’ linux-libre package updates.
5609 (version (package-version linux-libre))
5610 (source (package-source linux-libre))
5611 (build-system gnu-build-system)
5613 `(#:tests? #f ; no test suite
5615 (list (string-append "CC=" ,(cc-for-target))
5616 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5618 (modify-phases %standard-phases
5619 (add-after 'unpack 'enter-subdirectory
5621 (chdir "tools/power/x86/turbostat")
5623 (delete 'configure)))) ; no configure script
5625 `(("libcap" ,libcap)))
5626 (supported-systems '("i686-linux" "x86_64-linux"))
5627 (home-page (package-home-page linux-libre))
5628 (synopsis "Report x86 processor frequency and idle statistics")
5630 "Turbostat reports x86 processor topology, frequency, idle power state
5631 statistics, temperature, and power consumption. Some information is unavailable
5632 on older processors.
5634 It can be used to identify machines that are inefficient in terms of power usage
5635 or idle time, report the rate of @acronym{SMI, system management interrupt}s
5636 occurring on the system, or verify the effects of power management tuning.
5638 @command{turbostat} reads hardware counters but doesn't write to them, so it
5639 won't interfere with the OS or other running processes---including multiple
5640 invocations of itself.")
5641 (license license:gpl2)))
5643 (define-public ntfs-3g
5646 (version "2017.3.23")
5649 (uri (string-append "https://tuxera.com/opensource/"
5650 "ntfs-3g_ntfsprogs-" version ".tgz"))
5651 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5654 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5655 (modules '((guix build utils)))
5657 ;; Install under $prefix.
5658 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5662 (build-system gnu-build-system)
5663 (inputs `(("util-linux" ,util-linux)
5664 ("fuse" ,fuse))) ;libuuid
5665 (native-inputs `(("pkg-config" ,pkg-config)))
5667 '(#:configure-flags (list "--disable-static"
5668 "--exec-prefix=${prefix}"
5669 "--with-fuse=external" ;use our own FUSE
5670 "--enable-mount-helper"
5671 "--enable-posix-acls"
5672 "--enable-xattr-mappings")
5674 (modify-phases %standard-phases
5675 ;; If users install ntfs-3g, they probably want to make it the
5676 ;; default driver as well, so we opt for sensible defaults and link
5677 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5678 ;; mount NTFS file systems.)
5679 (add-after 'install 'install-link
5680 (lambda* (#:key outputs #:allow-other-keys)
5681 (let* ((out (assoc-ref outputs "out"))
5682 (sbin (string-append out "/sbin")))
5683 (symlink "mount.ntfs-3g"
5684 (string-append sbin "/mount.ntfs")))
5686 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5687 (synopsis "Read-write access to NTFS file systems")
5689 "NTFS-3G provides read-write access to NTFS file systems, which are
5690 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5691 The package provides additional NTFS tools.")
5692 (license license:gpl2+)))
5694 (define-public rdma-core
5700 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5701 "/releases/download/v" version "/rdma-core-"
5705 "1rah0v9gq9rksqd2c17nmydsxcjz178n7m2y4ricwlf5pq1b2yfi"))))
5706 (build-system cmake-build-system)
5708 `(#:tests? #f ; no tests
5709 ;; Upstream uses the "ninja" build system and encourage distros
5710 ;; to do the same for consistency.
5711 #:configure-flags (list "-GNinja"
5713 (string-append "-DRST2MAN_EXECUTABLE="
5714 (assoc-ref %build-inputs
5718 (modify-phases %standard-phases
5722 "-j" (number->string (parallel-job-count)))))
5725 (invoke "ninja" "install"))))))
5728 ("pkg-config" ,pkg-config)
5729 ("python" ,python-wrapper)
5730 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5734 (home-page "https://github.com/linux-rdma/rdma-core")
5735 (synopsis "Utilities and libraries for working with RDMA devices")
5737 "This package provides userspace components for the InfiniBand
5738 subsystem of the Linux kernel. Specifically it contains userspace
5739 libraries for the following device nodes:
5742 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5743 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5744 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5747 The following service daemons are also provided:
5749 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5750 @item @code{iwpmd} (for iWARP kernel providers)
5751 @item @code{ibacm} (for InfiniBand communication management assistant)
5753 ;; All library code is dual licensed under GPL2 and a custom MIT
5754 ;; variant. The package also includes some components covered by
5755 ;; other licenses. Consult COPYING.md for full details.
5758 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5759 license:bsd-2 ; Files referring to COPYING.BSD_FB
5760 license:cc0 ; most files in ccan/
5761 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5763 (define-public perftest
5770 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5771 version "/perftest-" version ".g0927198.tar.gz"))
5773 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5774 (build-system gnu-build-system)
5777 (modify-phases %standard-phases
5778 (add-after 'unpack 'patch-header-paths
5780 (substitute* '("src/raw_ethernet_fs_rate.c"
5781 "src/raw_ethernet_resources.c"
5782 "src/raw_ethernet_resources.h"
5783 "src/raw_ethernet_send_burst_lat.c"
5784 "src/raw_ethernet_send_bw.c"
5785 "src/raw_ethernet_send_lat.c")
5786 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5788 (inputs `(("rdma-core" ,rdma-core)))
5789 (home-page "https://github.com/linux-rdma/perftest/")
5790 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5791 (description "This is a collection of tests written over uverbs intended for
5792 use as a performance micro-benchmark. The tests may be used for hardware or
5793 software tuning as well as for functional testing.
5795 The collection contains a set of bandwidth and latency benchmark such as:
5797 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5798 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5799 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5800 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5801 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5803 (license license:gpl2)))
5805 (define-public rng-tools
5808 (home-page "https://github.com/nhorman/rng-tools")
5812 (uri (git-reference (url home-page)
5813 (commit (string-append "v" version))))
5814 (file-name (git-file-name name version))
5817 "0z4j3kqh9k3zsrx6257hwh4fa51vqg79c6dnfrj6lhpcll0wh0hm"))))
5818 (build-system gnu-build-system)
5820 `(;; Disable support for various hardware entropy sources as they need
5821 ;; dependencies that are not yet in Guix, and would significantly
5822 ;; increase closure size.
5823 #:configure-flags '("--without-nistbeacon"
5825 "--without-rtlsdr")))
5827 `(("autoconf" ,autoconf)
5828 ("automake" ,automake)
5829 ("pkg-config" ,pkg-config)))
5831 `(("libsysfs" ,sysfsutils)
5832 ("openssl" ,openssl)))
5833 (synopsis "Random number generator daemon")
5835 "Monitor a hardware random number generator, and supply entropy
5836 from that to the system kernel's @file{/dev/random} machinery.")
5837 ;; The source package is offered under the GPL2+, but the files
5838 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5839 (license (list license:gpl2 license:gpl2+))))
5841 (define-public cpupower
5844 (version (package-version linux-libre))
5845 (source (package-source linux-libre))
5846 (build-system gnu-build-system)
5848 '(#:phases (modify-phases %standard-phases
5849 (add-after 'unpack 'enter-subdirectory
5851 (chdir "tools/power/cpupower")
5854 (add-before 'build 'fix-makefiles
5856 (substitute* "Makefile"
5858 (("/bin/(install|pwd)" _ command) command))
5859 (substitute* "bench/Makefile"
5860 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5862 #:make-flags (let ((out (assoc-ref %outputs "out")))
5863 (list (string-append "DESTDIR=" out)
5864 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5866 "docdir=/share/doc/cpupower"
5867 "confdir=$(docdir)/examples"
5868 ;; The Makefile recommends the following changes
5870 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5871 #:tests? #f)) ;no tests
5872 (native-inputs `(("gettext" ,gettext-minimal)))
5873 (inputs `(("pciutils" ,pciutils)))
5874 (home-page (package-home-page linux-libre))
5875 (synopsis "CPU frequency and voltage scaling tools for Linux")
5877 "cpupower is a set of user-space tools that use the cpufreq feature of the
5878 Linux kernel to retrieve and control processor features related to power saving,
5879 such as frequency and voltage scaling.")
5880 (license license:gpl2)))
5882 (define-public x86-energy-perf-policy
5884 (name "x86-energy-perf-policy")
5885 (version (package-version linux-libre))
5886 (source (package-source linux-libre))
5887 (build-system gnu-build-system)
5891 (modify-phases %standard-phases
5892 (add-after 'unpack 'enter-subdirectory
5894 (chdir "tools/power/x86/x86_energy_perf_policy")
5897 (add-before 'build 'fix-makefile
5899 (substitute* "Makefile" (("/usr") ""))
5902 (let ((out (assoc-ref %outputs "out")))
5903 (list (string-append "DESTDIR=" out)
5904 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5905 (supported-systems '("i686-linux" "x86_64-linux"))
5906 (home-page (package-home-page linux-libre))
5907 (synopsis "Display and update Intel-CPU energy-performance policy")
5909 "@command{x86_energy_perf_policy} displays and updates energy-performance
5910 policy settings specific to Intel Architecture Processors. Settings are
5911 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5912 cpufreq sub-system is enabled or not.")
5913 (license license:gpl2)))
5915 (define-public haveged
5923 (url "https://github.com/jirka-h/haveged")
5924 (commit (string-append "v" version))))
5925 (file-name (git-file-name name version))
5927 (base32 "050hmnh5s2s4mb83f4d1fk23mk27pprg840c1aagc6v1sz6x5dhq"))))
5928 (build-system gnu-build-system)
5929 (home-page "https://www.issihosts.com/haveged")
5930 (synopsis "Entropy source for the Linux random number generator")
5932 "haveged generates an unpredictable stream of random numbers for use by
5933 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5934 standard mechanisms for filling the entropy pool may not be sufficient for
5935 systems with high needs or limited user interaction, such as headless servers.
5937 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5938 indirect effects of hardware events on hidden processor state using the
5939 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5940 It tunes itself to its environment and provides the same built-in test suite
5941 for the output stream as used on certified hardware security devices.
5943 The quality of the randomness produced by this algorithm has not been proven.
5944 It is recommended to run it together with another entropy source like rngd, and
5945 not as a replacement for it.")
5946 (license (list (license:non-copyleft "file://nist/mconf.h")
5947 (license:non-copyleft "file://nist/packtest.c")
5948 license:public-domain ; nist/dfft.c
5949 license:gpl3+)))) ; everything else
5951 (define-public ecryptfs-utils
5953 (name "ecryptfs-utils")
5958 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5959 version "/+download/ecryptfs-utils_"
5960 version ".orig.tar.gz"))
5963 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5964 (build-system gnu-build-system)
5966 `(#:configure-flags (list "--disable-pywrap")
5968 (modify-phases %standard-phases
5969 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5970 (lambda* (#:key inputs outputs #:allow-other-keys)
5971 (let ((out (assoc-ref outputs "out"))
5972 (utils-linux (assoc-ref inputs "utils-linux"))
5973 (cryptsetup (assoc-ref inputs "cryptsetup"))
5974 (linux-pam (assoc-ref inputs "linux-pam"))
5975 (lvm2 (assoc-ref inputs "lvm2")))
5976 (substitute* '("src/utils/ecryptfs-mount-private"
5977 "src/utils/ecryptfs-umount-private"
5978 "src/utils/ecryptfs-setup-private"
5979 "src/utils/ecryptfs-setup-swap"
5980 "src/utils/mount.ecryptfs.c"
5981 "src/utils/umount.ecryptfs.c"
5982 "src/pam_ecryptfs/pam_ecryptfs.c"
5983 "src/desktop/ecryptfs-mount-private.desktop.in"
5984 "src/desktop/ecryptfs-setup-private.desktop.in")
5986 (string-append utils-linux "/bin/mount"))
5988 (string-append utils-linux "/bin/umount"))
5989 (("/sbin/mount.ecryptfs_private")
5990 (string-append out "/sbin/mount.ecryptfs_private"))
5991 (("/sbin/umount.ecryptfs_private")
5992 (string-append out "/sbin/umount.ecryptfs_private"))
5993 (("/usr/bin/ecryptfs-mount-private")
5994 (string-append out "/bin/ecryptfs-mount-private"))
5995 (("/usr/bin/ecryptfs-rewrite-file")
5996 (string-append out "/bin/ecryptfs-rewrite-file"))
5997 (("/usr/bin/ecryptfs-setup-private")
5998 (string-append out "/bin/ecryptfs-setup-private"))
5999 (("/sbin/cryptsetup")
6000 (string-append cryptsetup "/sbin/cryptsetup"))
6001 (("/sbin/unix_chkpwd")
6002 (string-append linux-pam "/sbin/unix_chkpwd"))
6004 (string-append lvm2 "/sbin/dmsetup")))))))))
6006 `(("intltool" ,intltool)
6007 ("perl" ,perl) ; for pod2man
6008 ("pkg-config" ,pkg-config)))
6010 `(("keyutils" ,keyutils)
6011 ("linux-pam" ,linux-pam)
6012 ("utils-linux" ,util-linux)
6013 ("cryptsetup" ,cryptsetup)
6016 (home-page "https://ecryptfs.org/")
6017 (synopsis "eCryptfs cryptographic file system utilities")
6019 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
6020 Each file's cryptographic meta-data is stored inside the file itself, along
6021 with the encrypted contents. This allows individual encrypted files to be
6022 copied between hosts and still be decrypted with the proper key. eCryptfs is a
6023 native Linux file system, and has been part of the Linux kernel since version
6024 2.6.19. This package contains the userland utilities to manage it.")
6025 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
6026 ;; grant additional permission to link with OpenSSL.
6027 (license license:gpl2+)))
6029 (define-public libnfsidmap
6031 (name "libnfsidmap")
6036 (uri (string-append "https://fedorapeople.org/~steved/"
6037 name "/" version "/" name "-" version ".tar.bz2"))
6039 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
6040 (build-system gnu-build-system)
6042 `(#:configure-flags (list
6043 (string-append "--with-pluginpath="
6044 (assoc-ref %outputs "out")
6045 "/lib/libnfsidmap"))))
6047 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
6049 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
6050 (synopsis "NFSv4 support library for name/ID mapping")
6051 (description "Libnfsidmap is a library holding mulitiple methods of
6052 mapping names to ids and visa versa, mainly for NFSv4. It provides an
6053 extensible array of mapping functions, currently consisting of two choices:
6054 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
6055 (license (license:non-copyleft "file://COPYING"
6056 "See COPYING in the distribution."))))
6058 (define-public module-init-tools
6060 (name "module-init-tools")
6065 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
6066 "module-init-tools-" version ".tar.bz2"))
6069 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
6070 (patches (search-patches "module-init-tools-moduledir.patch"))))
6071 (build-system gnu-build-system)
6073 ;; FIXME: The upstream tarball lacks man pages, and building them would
6074 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
6075 ;; but they vanished. In the meantime, fake it.
6077 (modify-phases %standard-phases
6078 (add-before 'configure 'fake-docbook
6080 (substitute* "Makefile.in"
6081 (("^DOCBOOKTOMAN.*$")
6082 "DOCBOOKTOMAN = true\n"))
6084 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
6085 (synopsis "Tools for loading and managing Linux kernel modules")
6087 "Tools for loading and managing Linux kernel modules, such as
6088 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
6089 (license license:gpl2+)))
6091 (define-public mcelog
6099 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
6100 (commit (string-append "v" version))))
6101 (file-name (git-file-name name version))
6103 (base32 "1mlwn6ck9qiwqa2vg5wg1gvfva3jv7ygjr7p7bam0qszajs5pirk"))
6104 (modules '((guix build utils)))
6107 ;; The checkout lacks a .git directory, breaking ‘git describe’.
6108 (substitute* "Makefile"
6109 (("\"unknown\"") (string-append "\"v" ,version "\"")))
6111 (build-system gnu-build-system)
6113 `(#:phases (modify-phases %standard-phases
6114 (delete 'configure)) ; no configure script
6115 #:make-flags (let ((out (assoc-ref %outputs "out")))
6116 (list (string-append "CC=" ,(cc-for-target))
6117 (string-append "prefix=" out)
6118 (string-append "DOCDIR=" out "/share/doc/"
6120 "etcprefix=$(DOCDIR)/examples"))
6121 ;; The tests will only run as root on certain supported CPU models.
6123 (supported-systems (list "i686-linux" "x86_64-linux"))
6124 (home-page "https://mcelog.org/")
6125 (synopsis "Machine check monitor for x86 Linux systems")
6127 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
6128 systems running the kernel Linux. It can also perform user-defined tasks, such
6129 as bringing bad pages off-line, when configurable error thresholds are
6131 (license license:gpl2)))
6133 (define-public mtd-utils
6140 "ftp://ftp.infradead.org/pub/mtd-utils/"
6141 "mtd-utils-" version ".tar.bz2"))
6144 "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
6146 '(#:configure-flags '("--enable-unit-tests")))
6148 `(("cmocka" ,cmocka)
6149 ("pkg-config" ,pkg-config)))
6151 `(("acl" ,acl) ; extended attributes (xattr)
6152 ("libuuid" ,util-linux "lib")
6154 ("openssl" ,openssl) ; optional crypto support
6156 ("zstd" ,zstd "lib")))
6157 (build-system gnu-build-system)
6158 (synopsis "MTD Flash Storage Utilities")
6159 (description "This package provides utilities for testing, partitioning, etc
6161 (home-page "http://www.linux-mtd.infradead.org/")
6163 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
6164 license:mpl1.1 ; All ftl* files
6165 license:expat)))) ; libiniparser
6167 (define-public libseccomp
6173 (uri (string-append "https://github.com/seccomp/libseccomp/"
6174 "releases/download/v" version
6175 "/libseccomp-" version ".tar.gz"))
6178 "0m8dlg1v7kflcxvajs4p76p275qwsm2abbf5mfapkakp7hw7wc7f"))))
6179 (build-system gnu-build-system)
6181 '(#:configure-flags '("--disable-static")
6182 #:phases (modify-phases %standard-phases
6183 (add-before 'check 'skip-load-test
6185 ;; This test does a native system call and fails when
6186 ;; run under QEMU user-mode emulation. Just skip it.
6187 (delete-file "tests/52-basic-load.tests")
6192 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
6193 (description "The libseccomp library provides an easy to use, platform
6194 independent, interface to the Linux Kernel's syscall filtering mechanism. The
6195 libseccomp API is designed to abstract away the underlying BPF based syscall
6196 filter language and present a more conventional function-call based filtering
6197 interface that should be familiar to, and easily adopted by, application
6199 (home-page "https://github.com/seccomp/libseccomp")
6200 (license license:lgpl2.1)))
6202 (define-public radeontop
6210 (url "https://github.com/clbr/radeontop")
6211 (commit (string-append "v" version))))
6212 (file-name (git-file-name name version))
6214 (base32 "0ay6vl9zsz9b2scy0fnsy482pzizj52i27syxwny4z4i9wrk2wmn"))))
6215 (build-system gnu-build-system)
6217 `(#:phases (modify-phases %standard-phases
6218 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
6219 ;; dependency, and doesn't even work on release(!) tarballs.
6220 (add-after 'unpack 'report-correct-version
6222 (substitute* "getver.sh"
6224 (string-append "ver=" ,version)))
6226 (delete 'configure)) ; no configure script
6227 #:make-flags (list "CC=gcc"
6228 (string-append "PREFIX=" %output))
6229 #:tests? #f)) ; no tests
6231 `(("gettext" ,gettext-minimal)
6232 ("pkg-config" ,pkg-config)))
6234 `(("libdrm" ,libdrm)
6235 ("libpciaccess" ,libpciaccess)
6237 ("ncurses" ,ncurses)))
6238 (home-page "https://github.com/clbr/radeontop/")
6239 (synopsis "Usage monitor for AMD Radeon graphics")
6240 (description "RadeonTop monitors resource consumption on supported AMD
6241 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
6242 a terminal or saved to a file for further processing. It measures both the
6243 activity of the GPU as a whole, which is also accurate during OpenCL
6244 computations, as well as separate component statistics that are only meaningful
6245 under OpenGL graphics workloads.")
6246 (license license:gpl3)))
6248 (define-public efivar
6254 (uri (string-append "https://github.com/rhboot/" name
6255 "/releases/download/" version "/" name
6256 "-" version ".tar.bz2"))
6259 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
6260 (build-system gnu-build-system)
6262 `(;; Tests require a UEFI system and is not detected in the chroot.
6264 #:make-flags (list (string-append "prefix=" %output)
6265 (string-append "libdir=" %output "/lib")
6267 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6269 (modify-phases %standard-phases
6270 (delete 'configure))))
6272 `(("pkg-config" ,pkg-config)))
6275 (home-page "https://github.com/rhboot/efivar")
6276 (synopsis "Tool and library to manipulate EFI variables")
6277 (description "This package provides a library and a command line
6278 interface to the variable facility of UEFI boot firmware.")
6279 (license license:lgpl2.1+)))
6281 (define-public efibootmgr
6289 (url "https://github.com/rhinstaller/efibootmgr")
6291 (file-name (git-file-name name version))
6293 (base32 "1niicijxg59rsmiw3rsjwy4bvi1n42dynvm01lnp9haixdzdpq03"))
6294 (patches (search-patches "efibootmgr-remove-extra-decl.patch"))))
6295 (build-system gnu-build-system)
6297 `(#:tests? #f ;no tests
6298 #:make-flags (list (string-append "prefix=" %output)
6299 (string-append "libdir=" %output "/lib")
6300 ;; EFIDIR denotes a subdirectory relative to the
6301 ;; EFI System Partition where the loader will be
6302 ;; installed (known as OS_VENDOR in the code).
6303 ;; GRUB overrides this, as such it's only used if
6304 ;; nothing else is specified on the command line.
6306 #:phases (modify-phases %standard-phases (delete 'configure))))
6308 `(("pkg-config" ,pkg-config)))
6310 `(("efivar" ,efivar)
6312 (home-page "https://github.com/rhinstaller/efibootmgr")
6313 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
6315 "@code{efibootmgr} is a user-space application to modify the Intel
6316 Extensible Firmware Interface (EFI) Boot Manager. This application can
6317 create and destroy boot entries, change the boot order, change the next
6318 running boot option, and more.")
6319 (license license:gpl2+)))
6321 (define-public sysstat
6328 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6329 "sysstat-" version ".tar.xz"))
6331 (base32 "1z8bdyj92q0capbrdscwzb51bqh54ng15gpvmjmvrb2syhqj8hxf"))))
6332 (build-system gnu-build-system)
6334 `(#:tests? #f ; no test suite.
6335 ;; Without this flag, it tries to install the man pages with group 'root'
6336 ;; and fails because /etc/passwd lacks an entry for the root user.
6338 (list "--disable-file-attr"
6339 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
6341 (modify-phases %standard-phases
6342 ;; The build process tries to create '/var/lib/sa', so we skip that
6344 (add-after 'build 'skip-touching-var
6346 (substitute* "Makefile"
6347 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
6350 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
6351 (synopsis "Performance monitoring tools for Linux")
6352 (description "The sysstat utilities are a collection of performance
6353 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
6354 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
6355 @code{sadf} and @code{sa}.")
6356 (license license:gpl2+)))
6358 (define-public light
6366 (url "https://github.com/haikarainen/light")
6367 (commit (string-append "v" version))))
6369 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
6370 (file-name (git-file-name name version))))
6371 (build-system gnu-build-system)
6374 (modify-phases %standard-phases
6375 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
6376 (lambda* (#:key inputs #:allow-other-keys)
6377 (substitute* "90-backlight.rules"
6378 (("/bin/chgrp") (which "chgrp"))
6379 (("/bin/chmod") (which "chmod")))
6381 (add-after 'install 'install-udev-rules
6382 (lambda* (#:key outputs #:allow-other-keys)
6383 (let ((out (assoc-ref outputs "out")))
6385 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
6388 `(("autoconf" ,autoconf)
6389 ("automake" ,automake)))
6390 (home-page "https://haikarainen.github.io/light/")
6391 (synopsis "GNU/Linux application to control backlights")
6393 "Light is a program to send commands to screen backlight controllers
6394 under GNU/Linux. Features include:
6397 @item It does not rely on X.
6398 @item Light can automatically figure out the best controller to use, making
6399 full use of underlying hardware.
6400 @item It is possible to set a minimum brightness value, as some controllers
6401 set the screen to be pitch black at a value of 0 (or higher).
6403 (license license:gpl3+)))
6405 (define-public brightnessctl
6407 (name "brightnessctl")
6409 (home-page "https://github.com/Hummer12007/brightnessctl")
6412 (uri (git-reference (url home-page) (commit version)))
6413 (file-name (git-file-name name version))
6416 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))))
6417 (build-system gnu-build-system)
6419 `(#:tests? #f ; no tests
6420 #:make-flags (list (string-append "CC=" ,(cc-for-target))
6421 (string-append "PREFIX=" %output)
6422 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
6424 (modify-phases %standard-phases
6426 (add-after 'unpack 'adjust-udev-rules
6428 (substitute* "90-brightnessctl.rules"
6429 (("/bin/") "/run/current-system/profile/bin/"))
6431 (synopsis "Backlight and LED brightness control")
6433 "This program allows you read and control device brightness. Devices
6434 include backlight and LEDs. It can also preserve current brightness before
6435 applying the operation, such as on lid close.
6437 The appropriate permissions must be set on the backlight or LED control
6438 interface in sysfs, which can be accomplished with the included udev rules.")
6439 (license license:expat)))
6449 (url "https://github.com/linrunner/TLP")
6451 (file-name (git-file-name name version))
6453 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
6455 `(("shellcheck" ,shellcheck)))
6459 ("ethtool" ,ethtool)
6463 ("inetutils" ,inetutils)
6466 ("pciutils" ,pciutils)
6470 ("usbutils" ,usbutils)
6471 ("util-linux" ,util-linux)
6472 ("wireless-tools" ,wireless-tools)
6473 ,@(if (let ((system (or (%current-target-system)
6474 (%current-system))))
6475 (or (string-prefix? "i686-" system)
6476 (string-prefix? "x86_64-" system)))
6477 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
6479 (build-system gnu-build-system)
6481 ;; XXX: The full test suite is run with "checkall" but it requires
6482 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
6483 `(#:test-target "shellcheck"
6484 #:modules ((guix build gnu-build-system)
6488 (modify-phases %standard-phases
6489 (delete 'configure) ; no configure script
6490 (add-before 'build 'setenv
6491 (lambda* (#:key outputs #:allow-other-keys)
6492 (let ((out (assoc-ref outputs "out")))
6493 (setenv "TLP_WITH_SYSTEMD" "0")
6494 (setenv "TLP_NO_INIT" "1")
6495 (setenv "TLP_NO_PMUTILS" "1")
6496 (setenv "TLP_SBIN" (string-append out "/bin"))
6497 (setenv "TLP_BIN" (string-append out "/bin"))
6498 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
6499 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
6500 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
6501 (setenv "TLP_CONFDEF"
6502 (string-append out "/share/tlp/defaults.conf"))
6503 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
6505 (string-append out "/lib/elogind/system-sleep"))
6507 (string-append out "/share/bash-completion/completions"))
6508 (setenv "TLP_MAN" (string-append out "/share/man"))
6509 (setenv "TLP_META" (string-append out "/share/metainfo"))
6511 (add-before 'install 'fix-installation
6513 ;; Stop the Makefile from trying to create system directories.
6514 (substitute* "Makefile"
6515 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6516 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6519 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6520 (add-after 'install 'wrap
6521 (lambda* (#:key inputs outputs #:allow-other-keys)
6522 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6523 (bin-files (find-files bin ".*")))
6524 (define (bin-directory input-name)
6525 (let ((p (assoc-ref inputs input-name)))
6526 (and p (string-append p "/bin"))))
6527 (define (sbin-directory input-name)
6528 (string-append (assoc-ref inputs input-name) "/sbin"))
6529 (for-each (lambda (program)
6530 (wrap-program program
6533 (filter-map bin-directory
6545 "x86-energy-perf-policy"))
6546 (filter-map sbin-directory
6552 "wireless-tools"))))))
6555 (home-page "https://linrunner.de/en/tlp/tlp.html")
6556 (synopsis "Power management tool for Linux")
6557 (description "TLP is a power management tool for Linux. It comes with
6558 a default configuration already optimized for battery life. Nevertheless,
6559 TLP is customizable to fulfil system requirements. TLP settings are applied
6560 every time the power supply source is changed.")
6561 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6563 (license (list license:gpl2+ license:gpl3+))))
6568 (version "B.02.19.2")
6571 (uri (string-append "https://www.ezix.org/software/"
6572 "files/lshw-" version
6576 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
6577 (build-system gnu-build-system)
6579 `(#:phases (modify-phases %standard-phases (delete 'configure))
6580 #:tests? #f ; no tests
6582 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6583 (synopsis "List hardware information")
6585 "@command{lshw} (Hardware Lister) is a small tool to provide
6586 detailed information on the hardware configuration of the machine.
6587 It can report exact memory configuration, firmware version, mainboard
6588 configuration, CPU version and speed, cache configuration, bus speed,
6589 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6590 machines (PowerMac G4 is known to work).")
6591 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6592 (license license:gpl2+)))
6594 (define-public libmnl
6601 (uri (string-append "mirror://netfilter.org/libmnl/"
6602 "libmnl-" version ".tar.bz2"))
6605 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6606 (build-system gnu-build-system)
6607 (home-page "https://www.netfilter.org/projects/libmnl/")
6608 (synopsis "Netlink utility library")
6609 (description "Libmnl is a minimalistic user-space library oriented to
6610 Netlink developers. There are a lot of common tasks in parsing, validating,
6611 constructing of both the Netlink header and TLVs that are repetitive and easy to
6612 get wrong. This library aims to provide simple helpers that allows you to
6613 re-use code and to avoid re-inventing the wheel.")
6614 (license license:lgpl2.1+)))
6616 (define-public libnftnl
6623 (uri (string-append "mirror://netfilter.org/libnftnl/"
6624 "libnftnl-" version ".tar.bz2"))
6626 (base32 "1xblq1cbcxhr6qmjpy98i1qdza148idgz99vbhjc7s4vzvfizc4h"))))
6627 (build-system gnu-build-system)
6629 `(("pkg-config" ,pkg-config)))
6631 `(("libmnl" ,libmnl)))
6632 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6633 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6634 (description "Libnftnl is a userspace library providing a low-level netlink
6635 programming interface to the in-kernel nf_tables subsystem. The library
6636 libnftnl has been previously known as libnftables. This library is currently
6638 (license license:gpl2+)))
6640 (define-public nftables
6647 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6649 (string-append "https://www.nftables.org/projects/nftables"
6650 "/files/nftables-" version ".tar.bz2")))
6652 (base32 "1d7iwc8xlyfsbgn6qx1sdfcq7jhpl8wpfj39hcd06y8dzp3jvvvn"))))
6653 (build-system gnu-build-system)
6654 (arguments `(#:configure-flags
6655 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6656 (inputs `(("gmp" ,gmp)
6658 ("libnftnl" ,libnftnl)
6659 ("readline" ,readline)))
6660 (native-inputs `(("pkg-config" ,pkg-config)
6663 (home-page "https://www.nftables.org")
6664 (synopsis "Userspace utility for Linux packet filtering")
6665 (description "nftables is the project that aims to replace the existing
6666 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6667 filtering framework, a new userspace utility and also a compatibility layer for
6668 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6669 infrastructure such as the existing hooks, the connection tracking system, the
6670 userspace queueing component and the logging subsystem.")
6671 (license license:gpl2)))
6673 (define-public proot
6681 (url "https://github.com/proot-me/PRoot")
6682 (commit (string-append "v" version))))
6683 (file-name (git-file-name name version))
6685 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6686 (patches (search-patches "proot-test-fhs.patch"))))
6687 (build-system gnu-build-system)
6689 '(#:make-flags '("-C" "src")
6691 #:phases (modify-phases %standard-phases
6693 (add-before 'build 'set-shell-file-name
6694 (lambda* (#:key inputs #:allow-other-keys)
6695 (substitute* (find-files "src" "\\.[ch]$")
6698 (assoc-ref inputs "bash")
6701 (add-before 'check 'fix-fhs-assumptions-in-tests
6703 (substitute* "tests/test-c6b77b77.mk"
6704 (("/bin/bash") (which "bash"))
6705 (("/usr/bin/test") (which "test")))
6706 (substitute* '("tests/test-16573e73.c")
6707 (("/bin/([a-z-]+)" _ program)
6710 (substitute* (find-files "tests" "\\.sh$")
6711 ;; Some of the tests try to "bind-mount" /bin/true.
6713 (string-append "-b " (which "true") ":"))
6714 ;; Likewise for /bin.
6715 (("-b /bin:") "-b /gnu:")
6716 ;; Others try to run /bin/sh.
6717 (("/bin/sh") (which "sh"))
6718 ;; Others assume /etc/fstab exists.
6719 (("/etc/fstab") "/etc/passwd"))
6721 (substitute* "tests/GNUmakefile"
6722 (("-b /bin:") "-b /gnu:"))
6724 ;; XXX: This test fails in an obscure corner case, just
6726 (delete-file "tests/test-kkkkkkkk.c")
6731 (let ((n (parallel-job-count)))
6732 ;; For some reason we get lots of segfaults with
6733 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6734 (setenv "PROOT_NO_SECCOMP" "1")
6736 ;; Most of the tests expect "/bin" to be in $PATH so
6737 ;; they can run things that live in $ROOTFS/bin.
6739 (string-append (getenv "PATH") ":/bin"))
6741 (invoke "make" "check" "-C" "tests"
6743 "-j" (number->string n)))))
6745 (lambda* (#:key outputs #:allow-other-keys)
6746 ;; The 'install' rule does nearly nothing.
6747 (let* ((out (assoc-ref outputs "out"))
6748 (man1 (string-append out "/share/man/man1")))
6749 ;; TODO: 'make install-care' (does not even
6750 ;; build currently.)
6751 (invoke "make" "-C" "src" "install"
6752 (string-append "PREFIX=" out))
6755 (copy-file "doc/proot/man.1"
6756 (string-append man1 "/proot.1"))
6758 (native-inputs `(("which" ,which)
6760 ;; For 'mcookie', used by some of the tests.
6761 ("util-linux" ,util-linux)
6763 ;; XXX: Choose the old coreutils because its 'stat'
6764 ;; program does not use statx(2) when running 'stat -c
6765 ;; %a' or similar, which PRoot doesn't properly support.
6766 ("coreutils-old" ,coreutils-8.30)
6768 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6769 ;; make 4.3 to segfault.
6770 ("make-old" ,gnu-make-4.2)))
6771 (inputs `(("talloc" ,talloc)))
6772 (home-page "https://github.com/proot-me/PRoot")
6773 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6775 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6776 and @code{binfmt_misc}. This means that users don't need any privileges or
6777 setup to do things like using an arbitrary directory as the new root
6778 file system, making files accessible somewhere else in the file system
6779 hierarchy, or executing programs built for another CPU architecture
6780 transparently through QEMU user-mode. Also, developers can use PRoot as a
6781 generic process instrumentation engine thanks to its extension mechanism.
6782 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6783 available in the kernel Linux.")
6784 (license license:gpl2+)))
6786 (define-public proot-static
6789 (name "proot-static")
6791 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6792 (inputs `(("talloc" ,talloc/static)))
6794 (substitute-keyword-arguments (package-arguments proot)
6795 ((#:make-flags flags)
6796 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6798 `(modify-phases ,phases
6799 (add-after 'strip 'remove-store-references
6800 (lambda* (#:key outputs #:allow-other-keys)
6801 (let* ((out (assoc-ref outputs "out")))
6802 (with-directory-excursion out
6803 (remove-store-references "bin/proot")
6805 ((#:allowed-references _ '("out"))
6808 (define-public cpuid
6811 (version "20201006")
6814 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6815 version ".src.tar.gz"))
6818 "19jnkh57f979b78ak5mpxmdvnkgc33r55cw9shgd2hc380b3zi8k"))))
6819 (build-system gnu-build-system)
6822 (list (string-append "CC=" ,(cc-for-target)))
6823 #:tests? #f ; no tests
6824 #:phases (modify-phases %standard-phases
6825 (delete 'configure) ; no configure script
6826 (add-before 'install 'fix-makefile
6827 (lambda* (#:key outputs #:allow-other-keys)
6828 (substitute* "Makefile"
6829 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6830 ;; Make the compressed manpages writable so that the
6831 ;; reset-gzip-timestamps phase does not error out.
6832 (substitute* "Makefile"
6833 (("-m 444") "-m 644"))
6835 (inputs `(("perl" ,perl)))
6836 (supported-systems '("i686-linux" "x86_64-linux"))
6837 (home-page "http://www.etallen.com/cpuid.html")
6838 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6839 (description "cpuid dumps detailed information about the CPU(s) gathered
6840 from the CPUID instruction, and also determines the exact model of CPU(s). It
6841 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6842 NexGen, Rise, and SiS CPUs.")
6843 (license license:gpl2+)))
6845 (define-public jmtpfs
6853 (url "https://github.com/JasonFerrara/jmtpfs")
6854 (commit (string-append "v" version))))
6855 (file-name (git-file-name name version))
6858 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6859 (build-system gnu-build-system)
6863 ("libmtp" ,libmtp)))
6865 `(("pkg-config" ,pkg-config)))
6866 (home-page "https://github.com/JasonFerrara/jmtpfs")
6867 (synopsis "Use a FUSE file system to access data over MTP")
6868 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6869 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6870 the MTP device as a file system.")
6871 (license license:gpl3)))
6873 (define-public procenv
6881 (url "https://github.com/jamesodhunt/procenv")
6883 (file-name (git-file-name name version))
6885 (base32 "13fnr4gfj2xlxghw93m5gsxzlwzv3s6jv9hja0w0pb23hlncbmhy"))))
6886 (build-system gnu-build-system)
6888 `(("pkg-config" ,pkg-config)
6896 ("libselinux" ,libselinux)))
6897 (synopsis "Utility to show process environment")
6898 (description "Procenv is a command-line tool that displays as much detail about
6899 itself and its environment as possible. It can be used as a test
6900 tool, to understand the type of environment a process runs in, and for
6901 comparing system environments.")
6902 (home-page "https://github.com/jamesodhunt/procenv/")
6903 (license license:gpl3+)))
6905 (define-public libfabric
6913 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6914 version "/libfabric-" version ".tar.bz2"))
6916 (base32 "1nnpfkwxhim2nqjkb1vwrb4wj4j3l6w6yvvy69fqam2snlhshazz"))))
6917 (build-system gnu-build-system)
6918 (inputs `(("rdma-core" ,rdma-core)
6919 ,@(match (%current-system)
6920 ((member (package-supported-systems psm))
6924 (home-page "https://ofiwg.github.io/libfabric/")
6925 (synopsis "Open Fabric Interfaces")
6927 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6928 communication services to applications. OFI is best described as a collection
6929 of libraries and applications used to export fabric services. The key
6930 components of OFI are: application interfaces, provider libraries, kernel
6931 services, daemons, and test applications.
6933 Libfabric is a core component of OFI. It is the library that defines and
6934 exports the user-space API of OFI, and is typically the only software that
6935 applications deal with directly. It works in conjunction with provider
6936 libraries, which are often integrated directly into libfabric.")
6937 (license (list license:bsd-2 license:gpl2)))) ;dual
6942 (version "3.3.20170428")
6943 (home-page "https://github.com/intel/psm")
6947 (uri (git-reference (url home-page)
6948 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6949 (file-name (string-append "psm-" version ".tar.gz"))
6951 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6952 (patches (search-patches
6953 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6954 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6955 "psm-repro.patch" ; reproducibility
6956 "psm-disable-memory-stats.patch"))))
6957 (build-system gnu-build-system)
6958 (outputs '("out" "debug"))
6959 (inputs `(("libuuid" ,util-linux "lib")))
6961 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6962 ,(string-append "INSTALL_PREFIX=" %output)
6963 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6965 #:phases (modify-phases %standard-phases
6967 (add-after 'unpack 'patch-/usr/include
6969 (substitute* "Makefile"
6970 (("\\$\\{DESTDIR}/usr/include")
6971 (string-append %output "/include")))
6972 (substitute* "Makefile"
6973 (("/lib64") "/lib"))
6975 (add-after 'unpack 'patch-sysmacros
6977 (substitute* "ipath/ipath_proto.c"
6978 (("#include <sys/poll.h>" m)
6979 (string-append m "\n"
6980 "#include <sys/sysmacros.h>")))
6982 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6984 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6985 communications interface for the True Scale family of products. PSM users are
6986 enabled with mechanisms necessary to implement higher level communications
6987 interfaces in parallel environments.")
6988 ;; Only Intel-compatable processors are supported.
6989 (supported-systems '("i686-linux" "x86_64-linux"))
6990 (license (list license:bsd-2 license:gpl2)))) ;dual
6992 (define-public snapscreenshot
6994 (name "snapscreenshot")
6995 (version "1.0.14.3")
6999 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
7000 name "-" version ".tar.bz2"))
7002 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
7003 (build-system gnu-build-system)
7006 (let ((out (assoc-ref %outputs "out")))
7007 (list (string-append "BINDIR=" out "/bin")
7008 (string-append "MANDIR=" out "/share/man")))
7009 #:tests? #f ; no test suite
7011 (modify-phases %standard-phases
7012 (delete 'configure) ; ./configure is a snarky no-op
7013 (add-before 'install 'fix-ownership
7014 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
7016 (substitute* "depfun.mak"
7017 ((" -o bin -g bin ") " "))
7019 (add-before 'install 'create-output-directories
7020 (lambda* (#:key outputs #:allow-other-keys)
7021 (let ((out (assoc-ref outputs "out")))
7022 (mkdir-p (string-append out "/share/man/man1"))
7024 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
7025 (synopsis "Take screenshots of one or more Linux text consoles")
7027 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
7028 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
7029 relevant @file{/dev/vcs*} file(s).")
7030 (license license:gpl2)))
7032 (define-public fbcat
7039 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
7040 version "/" name "-" version ".tar.gz"))
7042 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
7043 (build-system gnu-build-system)
7045 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
7046 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
7047 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
7048 `(("pnmtopng" ,netpbm)))
7049 (outputs (list "out" "fbgrab"))
7053 (string-append "PREFIX=" (assoc-ref %outputs "out")))
7054 #:tests? #f ; no tests
7056 (modify-phases %standard-phases
7057 (delete 'configure) ; no configure script
7058 (add-after 'build 'qualify-references
7059 (lambda* (#:key inputs outputs #:allow-other-keys)
7060 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
7061 (out (assoc-ref outputs "out")))
7062 (substitute* "fbgrab"
7064 (string-append out "/bin/" all))
7066 (string-append pnmtopng "/bin/" all)))
7068 (add-after 'install 'split-fbgrab-output
7069 (lambda* (#:key outputs #:allow-other-keys)
7070 (let* ((out (assoc-ref outputs "out"))
7071 (out:fbgrab (assoc-ref outputs "fbgrab")))
7072 (for-each (lambda (file)
7073 (let ((old (string-append out "/" file))
7074 (new (string-append out:fbgrab "/" file)))
7075 (mkdir-p (dirname new))
7076 (rename-file old new)))
7078 "share/man/man1/fbgrab.1"))
7080 (home-page "https://jwilk.net/software/fbcat")
7081 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
7083 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
7084 a dump therof. It supports a wide range of drivers and pixel formats.
7085 @command{fbcat} can take screenshots of virtually any application that can be
7086 made to write its output to the framebuffer, including (but not limited to)
7087 text-mode or graphical applications that don't use a display server.
7089 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
7090 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
7091 (license license:gpl2)))
7093 (define-public libcgroup
7101 "mirror://sourceforge/libcg/" name "/"
7102 version "/" name "-" version ".tar.bz2"))
7104 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
7105 (build-system gnu-build-system)
7112 `(("linux-pam" ,linux-pam)))
7113 (home-page "https://sourceforge.net/projects/libcg/")
7114 (synopsis "Control groups management tools")
7115 (description "Control groups is Linux kernel method for process resource
7116 restriction, permission handling and more. This package provides userspace
7117 interface to this kernel feature.")
7118 (license license:lgpl2.1)))
7120 (define-public mbpfan
7128 (url "https://github.com/dgraziotin/mbpfan")
7129 (commit (string-append "v" version))))
7130 (file-name (git-file-name name version))
7132 (base32 "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr"))))
7133 (build-system gnu-build-system)
7135 `(#:tests? #f ; tests ask to be run as root
7136 #:make-flags (let ((out (assoc-ref %outputs "out")))
7137 (list (string-append "DESTDIR=" out)
7138 ,(string-append "CC=" (cc-for-target))))
7140 (modify-phases %standard-phases
7141 (add-after 'unpack 'patch-paths
7143 (substitute* "Makefile"
7146 (delete 'configure)))) ; there's no configure phase
7147 (home-page "https://github.com/dgraziotin/mbpfan")
7148 (synopsis "Control fan speed on Macbooks")
7150 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
7151 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
7152 module. It can be executed as a daemon or in the foreground with root
7154 (license license:gpl3+)))
7159 (version "11.2.185")
7163 (url "https://github.com/intel/opa-psm2")
7164 (commit (string-append "PSM2_" version))))
7165 (file-name (git-file-name name version))
7168 "062hg4r6gz7pla9df70nqs5i2a3mp1wszmp4l0g771fykhhrxsjg"))))
7169 (build-system gnu-build-system)
7172 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
7174 #:phases (modify-phases %standard-phases
7176 (add-after 'unpack 'patch-Makefiles
7178 (substitute* "Makefile"
7181 (substitute* "compat/Makefile"
7187 (setenv "DESTDIR" %output)
7188 (invoke "make" "install")
7191 `(("rdma-core" ,rdma-core)
7192 ("numactl" ,numactl)))
7193 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
7195 "This package is low-level user-level Intel's communications interface.
7196 The PSM2 API is a high-performance vendor-specific protocol that provides a
7197 low-level communications interface for the Intel Omni-Path family of
7198 high-speed networking devices.")
7199 (home-page "https://github.com/intel/opa-psm2")
7200 ;; Only the x86_64 architecure is supported.
7201 (supported-systems '("x86_64-linux"))
7202 (license (list license:bsd-3 license:gpl2)))) ; dual
7204 (define-public libpfm4
7210 (uri (string-append "mirror://sourceforge/perfmon2/"
7211 name "/libpfm-" version ".tar.gz"))
7214 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
7215 (build-system gnu-build-system)
7217 '(#:modules ((guix build utils)
7218 (guix build gnu-build-system))
7219 #:phases (modify-phases %standard-phases
7223 (lambda* (#:key inputs outputs #:allow-other-keys)
7224 (let* ((out (assoc-ref outputs "out")))
7229 (lambda* (#:key outputs #:allow-other-keys)
7230 (let* ((out (assoc-ref outputs "out")))
7232 (string-append "PREFIX=" out)
7235 (synopsis "Performance event monitoring library")
7237 "This package provides a library called libpfm4, which is used to develop
7238 monitoring tools exploiting the performance monitoring events such as those
7239 provided by the Performance Monitoring Unit (PMU) of modern processors.
7241 Libpfm4 helps convert from an event name, expressed as a string, to the event
7242 encoding that is either the raw event as documented by the hardware vendor or
7243 the OS-specific encoding. In the latter case, the library is able to prepare
7244 the OS-specific data structures needed by the kernel to setup the event.
7246 libpfm4 provides support for the @code{perf_events} interface, which was
7247 introduced in Linux 2.6.31.")
7248 (home-page "http://perfmon2.sourceforge.net/")
7249 (license license:expat)))
7251 (define-public libnfnetlink
7253 (name "libnfnetlink")
7258 "https://www.netfilter.org/projects/libnfnetlink/files/"
7259 "libnfnetlink-" version ".tar.bz2"))
7262 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
7263 (build-system gnu-build-system)
7264 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
7265 (synopsis "Low-level netfilter netlink communication library")
7267 "@code{libnfnetlink} is the low-level library for netfilter related
7268 kernel/userspace communication. It provides a generic messaging
7269 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
7270 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
7271 management tools in userspace.")
7272 (license license:gpl2)))
7274 (define-public go-netlink
7281 (url "https://github.com/vishvananda/netlink")
7282 (commit (string-append "v" version))))
7283 (file-name (git-file-name name version))
7286 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
7287 (build-system go-build-system)
7289 `(#:import-path "github.com/vishvananda/netlink"))
7291 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
7292 ("go-netns" ,go-netns)))
7293 (home-page "https://github.com/vishvananda/netlink")
7294 (synopsis "Simple netlink library for Go")
7295 (description "The netlink package provides a simple netlink library for
7296 Go. Netlink is the interface a user-space program in Linux uses to
7297 communicate with the kernel. It can be used to add and remove interfaces, set
7298 IP addresses and routes, and configure IPsec.")
7299 (license license:asl2.0)))
7301 (define-public libinih
7308 (url "https://github.com/benhoyt/inih")
7309 (commit (string-append "r" version))))
7310 (file-name (git-file-name name version))
7313 "0dqf5j2sw4hq68rqvxbrsf44ygfzx9ypiyzipk4cvp9aimbvsbc6"))))
7314 (build-system meson-build-system)
7316 '(#:configure-flags '("-Ddistro_install=true" "-Ddefault_library=shared")))
7317 (home-page "https://github.com/benhoyt/inih")
7318 (synopsis "Simple .INI parser library for C")
7319 (description "The inih (INI Not Invented Here) library is a simple .INI file
7320 parser written in C. It's only a couple of pages of code, and it was designed to
7321 be small and simple, so it's good for embedded systems. It's also more or less
7322 compatible with Python's ConfigParser style of .INI files, including RFC
7323 822-style multi-line syntax and name: value entries.")
7324 (license license:bsd-3)))
7326 (define-public xfsprogs
7333 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
7334 "xfsprogs-" version ".tar.gz"))
7337 "0b5vvwq4rqw7kph23ycd518d31dx3wq7w61znixxpdljx0ig71qn"))))
7338 (build-system gnu-build-system)
7339 (outputs (list "out" "python"))
7341 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
7343 (modify-phases %standard-phases
7344 (add-after 'install 'separate-python-output
7345 (lambda* (#:key outputs #:allow-other-keys)
7346 (let ((out (assoc-ref outputs "out"))
7347 (python (assoc-ref outputs "python")))
7350 (mkdir-p (string-append python (dirname script)))
7351 (rename-file (string-append out script)
7352 (string-append python script)))
7353 (list "/sbin/xfs_scrub_all"))
7355 (add-after 'install 'install-headers
7357 (invoke "make" "install-dev"))))))
7359 `(("gettext" ,gettext-minimal)))
7361 `(("libinih" ,libinih)
7362 ("libuuid" ,util-linux "lib")
7363 ("python" ,python-wrapper)))
7364 (home-page "https://xfs.wiki.kernel.org/")
7365 (synopsis "XFS file system tools")
7366 (description "This package provides commands to create and check XFS
7368 ;; The library "libhandle" and the headers in "xfslibs-dev" are
7369 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
7370 (license (list license:gpl2 license:lgpl2.1))))
7372 (define-public genext2fs
7379 (url "https://github.com/jeremie-koenig/genext2fs")
7380 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
7381 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
7382 (file-name (git-file-name name version))
7384 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
7385 (build-system gnu-build-system)
7388 (modify-phases %standard-phases
7389 (add-after 'unpack 'apply-debian-patches
7390 ;; Debian changes (the revision after ‘-’ in VERSION) are
7391 ;; maintained as separate patches. Apply those relevant to us.
7395 (invoke "patch" "-p1" "-i"
7396 (string-append "debian/patches/" file-name)))
7397 (list "blocksize+creator.diff" ; add -B/-o options
7398 "byteswap_fix.diff"))
7401 `(("autoconf" ,autoconf)
7402 ("automake" ,automake)))
7403 (home-page "https://github.com/jeremie-koenig/genext2fs")
7404 (synopsis "Generate ext2 file system as a normal user")
7405 (description "This package provides a program to generate an ext2
7406 file system as a normal (non-root) user. It does not require you to mount
7407 the image file to copy files on it, nor does it require that you become
7408 the superuser to make device nodes.")
7409 (license license:gpl2)))
7411 (define-public fakeroot
7416 ;; There are no tags in the repository, so take this snapshot.
7418 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
7419 "fakeroot/fakeroot_" version ".orig.tar.gz"))
7420 (file-name (string-append name "-" version ".tar.gz"))
7423 "0v4m3v1bdqvblwj3vqsb3mllgbci6dsgsydq6765nzvz6n1kd44f"))))
7424 (build-system gnu-build-system)
7427 (modify-phases %standard-phases
7430 ;; The "preroll" script takes care of Autoconf and also
7431 ;; prepares the translated manuals.
7432 (invoke "sh" "./preroll")))
7433 (add-after 'configure 'patch-Makefile
7435 ;; Note: The root of the problem is already in "Makefile.am".
7436 (substitute* "Makefile"
7437 (("/bin/sh") (which "sh")))
7439 (add-after 'unpack 'patch-script
7440 (lambda* (#:key inputs #:allow-other-keys)
7441 (substitute* "scripts/fakeroot.in"
7443 (string-append (assoc-ref inputs "util-linux")
7446 (string-append (assoc-ref inputs "sed")
7449 (string-append (assoc-ref inputs "coreutils")
7452 (add-before 'configure 'setenv
7454 (setenv "LIBS" "-lacl")
7456 (add-before 'check 'prepare-check
7458 (setenv "SHELL" (which "bash"))
7459 (setenv "VERBOSE" "1")
7460 (substitute* "test/t.touchinstall"
7461 ;; We don't have the name of the root user, so use ID=0.
7462 (("grep root") "grep \"\\<0\\>\""))
7463 (substitute* "test/tartest"
7464 ;; We don't have the name of the root group, so use ID=0.
7465 (("ROOTGROUP=root") "ROOTGROUP=0")
7466 ;; We don't have the name of the daemon user, so use IDs.
7467 (("daemon:sys") "1:3")
7469 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
7470 (substitute* "test/compare-tar"
7471 (("tar -tvf") "tar --numeric-owner -tvf"))
7474 `(;; For bootstrapping the package.
7475 ("autoconf" ,autoconf)
7476 ("automake" ,automake)
7477 ("libtool" ,libtool)
7478 ("gettext" ,gettext-minimal)
7482 ("sharutils" ,sharutils)
7487 ("util-linux" ,util-linux)
7489 ("coreutils" ,coreutils)))
7490 (synopsis "Provides a fake root environment")
7491 (description "@command{fakeroot} runs a command in an environment where
7492 it appears to have root privileges for file manipulation. This is useful
7493 for allowing users to create archives (tar, ar, .deb etc.) with files in
7494 them with root permissions/ownership. Without fakeroot one would have to
7495 have root privileges to create the constituent files of the archives with
7496 the correct permissions and ownership, and then pack them up, or one would
7497 have to construct the archives directly, without using the archiver.")
7498 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
7499 (license license:gpl3+)))
7501 (define-public fakechroot
7508 "https://github.com/dex4er/fakechroot/releases/download/"
7509 version "/fakechroot-" version ".tar.gz"))
7512 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
7513 (build-system gnu-build-system)
7515 ;; XXX: The tests heavily assume they run on an FHS system so for now
7518 #:configure-flags '("--disable-static")))
7519 (synopsis "Emulate @code{chroot} by overriding file system calls")
7521 "@command{fakechroot} runs a command in an environment were is additional
7522 possibility to use @code{chroot} command without root privileges. This is
7523 useful for allowing users to create own chrooted environment with possibility
7524 to install another packages without need for root privileges.
7526 It works by providing @file{libfakechroot.so}, a shared library meant to be
7527 set as @code{LD_PRELOAD} to override the C library file system functions.")
7528 (home-page "https://github.com/dex4er/fakechroot/")
7529 (license license:lgpl2.1+)))
7531 (define-public inputattach
7533 (name "inputattach")
7538 (url "https://github.com/linuxwacom/input-wacom")
7539 (commit (string-append "input-wacom-" version))))
7540 (file-name (git-file-name name version))
7542 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
7543 (build-system gnu-build-system)
7546 (modify-phases %standard-phases
7550 (lambda* (#:key inputs #:allow-other-keys)
7551 (with-directory-excursion "inputattach"
7552 (invoke (string-append (assoc-ref inputs "gcc")
7554 "-O2" "-o" "inputattach" "inputattach.c"))
7558 (lambda* (#:key outputs #:allow-other-keys)
7559 (let ((target-dir (string-append
7560 (assoc-ref outputs "out")
7562 (mkdir-p target-dir)
7563 (copy-file "inputattach/inputattach"
7564 (string-append target-dir
7567 (home-page "https://linuxwacom.github.io/")
7568 (synopsis "Dispatch input peripherals events to a device file")
7569 (description "inputattach dispatches input events from several device
7570 types and interfaces and translates so that the X server can use them.")
7571 (license license:gpl2+)))
7573 (define-public pipewire
7580 (url "https://github.com/PipeWire/pipewire")
7582 (file-name (git-file-name name version))
7585 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
7586 (build-system meson-build-system)
7588 '(#:configure-flags '("-Dsystemd=false")))
7590 `(("pkg-config" ,pkg-config)))
7592 `(("alsa-lib" ,alsa-lib)
7596 ("gstreamer" ,gstreamer)
7597 ("gst-plugins-base" ,gst-plugins-base)
7601 (home-page "https://pipewire.org/")
7602 (synopsis "Server and user space API to deal with multimedia pipelines")
7604 "PipeWire is a project that aims to greatly improve handling of audio and
7605 video under Linux. It aims to support the usecases currently handled by both
7606 PulseAudio and Jack and at the same time provide same level of powerful handling
7607 of Video input and output. It also introduces a security model that makes
7608 interacting with audio and video devices from containerized applications easy,
7609 with supporting Flatpak applications being the primary goal. Alongside Wayland
7610 and Flatpak we expect PipeWire to provide a core building block for the future
7611 of Linux application development.")
7612 (license license:lgpl2.0+)))
7614 (define-public pipewire-0.3
7622 (url "https://github.com/PipeWire/pipewire")
7624 (file-name (git-file-name name version))
7627 "1ywna5f5v8s79ivrqfwwc8vy6sn3a2zvfwqyalf1fypj5d90w8g9"))))
7630 (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
7631 "/lib/udev/rules.d")
7634 (modify-phases %standard-phases
7635 ;; Skip shrink-runpath, otherwise validate-runpath fails.
7636 (delete 'shrink-runpath))))
7638 (append (package-inputs pipewire)
7641 ("pulseaudio" ,pulseaudio)
7642 ("vulkan-loader" ,vulkan-loader)
7643 ("vulkan-headers" ,vulkan-headers))))))
7652 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7654 (file-name (git-file-name name version))
7657 "1zzpbfdpmfldd7w0h7mwbq0mfqgqwz54nqbq0rmbqlqqpwlkrgb2"))))
7658 (build-system gnu-build-system)
7661 (modify-phases %standard-phases
7662 (add-after 'unpack 'fix-dbus-tests
7664 (substitute* '("unit/test-dbus-message-fds.c"
7665 "unit/test-dbus-properties.c"
7667 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7672 `(("autoconf" ,autoconf)
7673 ("libtool" ,libtool)
7674 ("pkgconfig" ,pkg-config)
7675 ("automake" ,automake)))
7676 (home-page "https://01.org/ell")
7677 (synopsis "Embedded Linux Library")
7678 (description "The Embedded Linux* Library (ELL) provides core, low-level
7679 functionality for system daemons. It typically has no dependencies other than
7680 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7681 ELL is designed to be efficient and compact enough for use on embedded Linux
7682 platforms, it is not limited to resource-constrained systems.")
7683 (license license:lgpl2.1+)))
7685 (define-public lttng-ust
7691 (uri (string-append "https://lttng.org/files/lttng-ust/"
7692 "lttng-ust-" version ".tar.bz2"))
7695 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7696 (build-system gnu-build-system)
7698 `(("liburcu" ,liburcu)
7699 ("numactl" ,numactl)))
7701 `(("python" ,python-3)))
7702 (home-page "https://lttng.org/")
7703 (synopsis "LTTng userspace tracer libraries")
7704 (description "The user space tracing library, liblttng-ust, is the LTTng
7705 user space tracer. It receives commands from a session daemon, for example to
7706 enable and disable specific instrumentation points, and writes event records
7707 to ring buffers shared with a consumer daemon.")
7708 (license license:lgpl2.1+)))
7710 (define-public kexec-tools
7712 (name "kexec-tools")
7716 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7717 "/kexec/kexec-tools-" version ".tar.xz"))
7720 "1hj9mj6x3qs9c8x8mrri9xd3wsg3gwzbab3jfa5ry146xm4pzjcn"))))
7721 (build-system gnu-build-system)
7723 ;; There are no automated tests.
7725 (home-page "https://projects.horms.net/projects/kexec/")
7726 (synopsis "Tools for booting directly into different kernels")
7727 (description "This package provides the @code{kexec} program and ancillary
7728 utilities. Using @code{kexec}, it is possible to boot directly into a new
7729 kernel from the context of an already-running kernel, bypassing the normal
7730 system boot process.")
7731 (license license:gpl2)))
7733 (define-public cachefilesd
7735 (name "cachefilesd")
7740 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7741 "/cachefilesd.git/snapshot/cachefilesd-"
7745 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7746 (build-system gnu-build-system)
7749 `(#:tests? #f ; there are no tests
7751 (let ((prefix-dir (lambda (var dir)
7752 (string-append var "=" %output "/" dir))))
7753 (list (string-append "CC=" ,(cc-for-target))
7754 (prefix-dir "SBINDIR" "sbin/")
7755 (prefix-dir "ETCDIR" "etc/")
7756 (prefix-dir "MANDIR" "share/man/")))
7757 #:phases (modify-phases %standard-phases (delete 'configure))))
7758 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7759 (synopsis "CacheFiles userspace management daemon")
7760 (description "@code{cachefilesd} is a userspace daemon that manages the
7761 cache data store that is used by network file systems such as @code{AFS} and
7762 @code{NFS} to cache data locally on disk. The content of the cache is
7763 persistent over reboots.")
7764 (license license:gpl2+)))
7766 (define-public libbpf
7774 (url "https://github.com/libbpf/libbpf")
7775 (commit (string-append "v" version))))
7776 (file-name (git-file-name name version))
7779 "0ilnnm4q22f8fagwp8kb37licy4ks861i2iqh2djsypqhnxvx3fv"))))
7780 (build-system gnu-build-system)
7782 `(("pkg-config" ,pkg-config)))
7784 ;; In Requires.private of libbpf.pc.
7785 `(("libelf" ,libelf)
7788 `(#:tests? #f ; no tests
7791 (string-append "PREFIX=" (assoc-ref %outputs "out"))
7792 (string-append "LIBDIR=$(PREFIX)/lib")
7794 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
7796 (modify-phases %standard-phases
7798 (add-before 'build 'pre-build
7802 (home-page "https://github.com/libbpf/libbpf")
7803 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
7805 "Libbpf supports building BPF CO-RE-enabled applications, which, in
7806 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
7808 (license `(,license:lgpl2.1 ,license:bsd-2))))
7818 (url "https://github.com/iovisor/bcc")
7819 (commit (string-append "v" version))))
7820 (file-name (git-file-name name version))
7823 "1367c0bzrpclvjvmk0sxgi49rh7j2f9izqk5a7g3yvawh1fmvvjh"))))
7824 (build-system cmake-build-system)
7829 `(("clang-toolchain" ,clang-toolchain)
7830 ("libbpf" ,(package-source libbpf))
7831 ;; LibElf required but libelf does not contain
7832 ;; archives, only object files.
7833 ;; https://github.com/iovisor/bcc/issues/504
7834 ("elfutils" ,elfutils)
7835 ("linux-libre-headers" ,linux-libre-headers)
7837 ("python-wrapper" ,python-wrapper)))
7839 `(;; Tests all require root permissions and a "standard" file hierarchy.
7842 (let ((revision ,version))
7843 `(,(string-append "-DREVISION=" revision)))
7845 (modify-phases %standard-phases
7846 ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
7847 (add-after 'unpack 'copy-libbpf
7848 (lambda* (#:key inputs #:allow-other-keys)
7849 (delete-file-recursively "src/cc/libbpf")
7851 (assoc-ref inputs "libbpf") "src/cc/libbpf")))
7852 (add-after 'copy-libbpf 'substitute-libbc
7853 (lambda* (#:key outputs #:allow-other-keys)
7854 (substitute* "src/python/bcc/libbcc.py"
7855 (("(libbcc\\.so.*)\\b" _ libbcc)
7857 (assoc-ref outputs "out") "/lib/" libbcc)))))
7858 (add-after 'install 'wrap-tools
7859 (lambda* (#:key outputs #:allow-other-keys)
7860 (use-modules (ice-9 textual-ports))
7861 (let* ((out (assoc-ref outputs "out"))
7862 (lib (string-append out "/lib"))
7863 (tools (string-append out "/share/bcc/tools"))
7865 (lambda (filename _)
7866 (call-with-input-file filename
7868 (string-contains (get-line port)
7871 (lambda (python-executable)
7872 (format #t "Wrapping: ~A.~%" python-executable)
7873 (wrap-program python-executable
7874 `("PYTHONPATH" ":" prefix
7875 (,(string-append lib
7877 ,(version-major+minor
7878 (package-version python))
7879 "/site-packages")))))
7880 (find-files tools python-executable?))
7882 (home-page "https://github.com/iovisor/bcc")
7883 (synopsis "Tools for BPF on Linux")
7885 "BCC is a toolkit for creating efficient kernel tracing and manipulation
7886 programs, and includes several useful tools and examples. It makes use of
7887 extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
7888 that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
7890 (license license:asl2.0)))
7892 (define-public bpftrace
7900 (url "https://github.com/iovisor/bpftrace")
7901 (commit (string-append "v" version))))
7902 (file-name (git-file-name name version))
7904 (base32 "0y4qgm2cpccrsm20rnh92hqplddqsc5q5zhw9nqn2igm3h9i0z7h"))
7905 (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
7906 (build-system cmake-build-system)
7912 ("clang-toolchain" ,clang-toolchain)
7913 ("elfutils" ,elfutils)
7915 ("linux-libre-headers" ,linux-libre-headers)))
7917 `(#:tests? #f ;Tests require googletest sources.
7919 '("-DBUILD_TESTING=OFF"
7920 ;; FIXME: libbfd misses some link dependencies, when fixed, remove
7921 ;; the associated patch.
7922 "-DHAVE_BFD_DISASM=OFF")))
7923 (home-page "https://github.com/iovisor/bpftrace")
7924 (synopsis "High-level tracing language for Linux eBPF")
7926 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
7927 Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
7928 LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
7929 interacting with the Linux BPF system, as well as existing Linux tracing
7930 capabilities: kernel dynamic tracing (kprobes), user-level dynamic
7931 tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
7932 and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
7933 created by Alastair Robertson.")
7934 (license license:asl2.0)))
7936 (define-public ttyebus-linux-module
7937 (let ((revision "0")
7938 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
7940 (name "ttyebus-linux-module")
7941 (version (git-version "1.5" revision commit))
7946 (url "https://github.com/eBUS/ttyebus")
7947 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
7948 (file-name (git-file-name name version))
7951 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
7952 (supported-systems '("armhf-linux" "aarch64-linux"))
7953 (build-system linux-module-build-system)
7956 (home-page "https://github.com/eBUS/ttyebus")
7957 (synopsis "Low-latency Raspberry Pi UART driver")
7958 (description "This package provides a Linux kernel module that will
7959 provide a serial device @code{/dev/ttyebus} with almost no latency upon
7960 receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
7961 (license license:gpl3+))))
7963 (define-public ipset
7970 (uri (string-append "https://ipset.netfilter.org/"
7971 "ipset-" version ".tar.bz2"))
7973 (base32 "0zdzp9fhpp6hmirzxy7w27fb9xx9lxd2ykxbn8by7ngi62nvll9i"))))
7974 (build-system gnu-build-system)
7976 `(("libmnl" ,libmnl)))
7978 `(("pkg-config" ,pkg-config)))
7980 `(#:configure-flags '("--with-kmod=no")))
7981 (home-page "https://ipset.netfilter.org/")
7982 (synopsis "Administration tool for IP sets")
7983 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
7984 can be administered by the ipset utility. Depending on the type,
7985 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
7986 IP addresses with MAC addresses in a way which ensures lightning speed
7987 when matching an entry against a set.
7991 @item store multiple IP addresses or port numbers and match against the entire
7992 collection using a single iptables rule.
7993 @item dynamically update iptables rules against IP addresses or ports without
7994 performance penalty.
7995 @item express complex IP address and ports based rulesets with a single
7996 iptables rule and benefit from the speed of IP sets.
7998 then IP sets may be the proper tool for you.")
7999 (license license:gpl2+)))
8001 (define-public liburing
8008 (url "https://git.kernel.dk/liburing")
8009 (commit (string-append "liburing-" version))))
8010 (file-name (git-file-name name version))
8013 "15z44l7y4c6s6dlf7v8lq4znlsjbja2r4ifbni0l8cdcnq0w3zh3"))))
8014 (build-system gnu-build-system)
8016 `(;; Tests are dependent on kernel version and features
8019 (modify-phases %standard-phases
8021 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
8022 ;; --enable-fast-install, and --build
8023 (lambda* (#:key outputs #:allow-other-keys)
8024 (let ((out (assoc-ref outputs "out")))
8025 (setenv "SHELL" (which "sh"))
8026 (setenv "CONFIG_SHELL" (which "sh"))
8027 (invoke "./configure" (string-append "--prefix=" out))))))))
8028 (home-page "https://github.com/axboe/liburing")
8029 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
8030 (description "This is the io_uring library, liburing. liburing provides
8031 helpers to setup and teardown io_uring instances, and also a simplified
8032 interface for applications that don't need (or want) to deal with the full
8033 kernel side implementation.")
8034 (license license:expat)))
8036 (define-public erofs-utils
8038 (name "erofs-utils")
8044 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
8045 (commit (string-append "v" version))))
8046 (file-name (git-file-name name version))
8048 (base32 "1vb4mxsb59g29x7l22cffsqa8x743sra4j5zbmx89hjwpwm9vvcg"))))
8049 (build-system gnu-build-system)
8052 ("libuuid" ,util-linux "lib")))
8054 `(("autoconf" ,autoconf)
8055 ("automake" ,automake)
8056 ("libtool" ,libtool)
8057 ("pkg-config" ,pkg-config)))
8058 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
8059 (synopsis "User-space tools for EROFS file system")
8060 (description "EROFS (Enhanced Read-Only File System) is a compressed,
8061 read-only file system optimized for resource-scarce devices. This package
8062 provides user-space tools for creating EROFS file systems.")
8063 (license license:gpl2+)))
8065 (define-public rasdaemon
8073 (url "https://github.com/mchehab/rasdaemon")
8074 (commit (string-append "v" version))))
8075 (file-name (git-file-name name version))
8077 (base32 "12ih96jwmr7imp9zyckf9zjqqm5ra1kv5fj6kbw71y6yl31069dz"))))
8078 (native-inputs `(("autoconf" ,autoconf)
8079 ("automake" ,automake)
8080 ("libtool" ,libtool)))
8081 (inputs `(("sqlite" ,sqlite)))
8084 (list "--enable-all"
8085 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
8086 "--with-sysconfdefdir=."
8087 "--localstatedir=/var")
8089 (modify-phases %standard-phases
8090 (add-before 'configure 'munge-autotools
8092 ;; For some reason upstream forces sysconfdir=/etc. This results
8093 ;; in EPERM during the install phase. Removing the offending
8094 ;; line lets sysconfdir correctly pick up DESTDIR.
8095 (substitute* "configure.ac"
8096 (("^test .* sysconfdir=/etc\n$") ""))
8097 ;; Upstream tries to create /var/lib/rasdaemon at install time.
8098 ;; This results in EPERM on guix. Instead, the service should
8099 ;; create this at activation time.
8100 (substitute* "Makefile.am"
8101 (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") "")))))))
8102 (build-system gnu-build-system)
8103 (home-page "https://github.com/mchehab/rasdaemon")
8104 (synopsis "Platform Reliability, Availability, and Serviceability tools")
8106 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
8107 Availability and Serviceability} reports from Linux kernel trace events.
8108 These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
8109 through standard log mechanisms like syslog.")
8110 (license license:gpl2)))