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, 2021 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, 2021 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 Morgan Smith <Morgan.J.Smith@outlook.com>
47 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
48 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
49 ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
50 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
51 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
52 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
53 ;;; Copyright © 2020 David Dashyan <mail@davie.li>
54 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
55 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
57 ;;; This file is part of GNU Guix.
59 ;;; GNU Guix is free software; you can redistribute it and/or modify it
60 ;;; under the terms of the GNU General Public License as published by
61 ;;; the Free Software Foundation; either version 3 of the License, or (at
62 ;;; your option) any later version.
64 ;;; GNU Guix is distributed in the hope that it will be useful, but
65 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
66 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67 ;;; GNU General Public License for more details.
69 ;;; You should have received a copy of the GNU General Public License
70 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
72 (define-module (gnu packages linux)
73 #:use-module (gnu packages)
74 #:use-module (gnu packages acl)
75 #:use-module (gnu packages admin)
76 #:use-module (gnu packages algebra)
77 #:use-module (gnu packages audio)
78 #:use-module (gnu packages autotools)
79 #:use-module (gnu packages backup)
80 #:use-module (gnu packages base)
81 #:use-module (gnu packages bash)
82 #:use-module (gnu packages bison)
83 #:use-module (gnu packages boost)
84 #:use-module (gnu packages calendar)
85 #:use-module (gnu packages check)
86 #:use-module (gnu packages cpio)
87 #:use-module (gnu packages crypto)
88 #:use-module (gnu packages cryptsetup)
89 #:use-module (gnu packages compression)
90 #:use-module (gnu packages dbm)
91 #:use-module (gnu packages datastructures)
92 #:use-module (gnu packages docbook)
93 #:use-module (gnu packages documentation)
94 #:use-module (gnu packages elf)
95 #:use-module (gnu packages flex)
96 #:use-module (gnu packages file)
97 #:use-module (gnu packages freedesktop)
98 #:use-module (gnu packages gawk)
99 #:use-module (gnu packages gcc)
100 #:use-module (gnu packages gettext)
101 #:use-module (gnu packages glib)
102 #:use-module (gnu packages golang)
103 #:use-module (gnu packages gperf)
104 #:use-module (gnu packages gstreamer)
105 #:use-module (gnu packages gtk)
106 #:use-module (gnu packages haskell-apps)
107 #:use-module (gnu packages haskell-xyz)
108 #:use-module (gnu packages libunwind)
109 #:use-module (gnu packages libusb)
110 #:use-module (gnu packages llvm)
111 #:use-module (gnu packages lua)
112 #:use-module (gnu packages man)
113 #:use-module (gnu packages maths)
114 #:use-module (gnu packages multiprecision)
115 #:use-module (gnu packages ncurses)
116 #:use-module (gnu packages netpbm)
117 #:use-module (gnu packages networking)
118 #:use-module (gnu packages ninja)
119 #:use-module (gnu packages nss)
120 #:use-module (gnu packages perl)
121 #:use-module (gnu packages pciutils)
122 #:use-module (gnu packages pkg-config)
123 #:use-module (gnu packages popt)
124 #:use-module (gnu packages pulseaudio)
125 #:use-module (gnu packages python)
126 #:use-module (gnu packages python-xyz)
127 #:use-module (gnu packages readline)
128 #:use-module (gnu packages rrdtool)
129 #:use-module (gnu packages samba)
130 #:use-module (gnu packages sdl)
131 #:use-module (gnu packages serialization)
132 #:use-module (gnu packages slang)
133 #:use-module (gnu packages sqlite)
134 #:use-module (gnu packages texinfo)
135 #:use-module (gnu packages tls)
136 #:use-module (gnu packages valgrind)
137 #:use-module (gnu packages video)
138 #:use-module (gnu packages vulkan)
139 #:use-module (gnu packages web)
140 #:use-module (gnu packages xiph)
141 #:use-module (gnu packages xml)
142 #:use-module (gnu packages xdisorg)
143 #:use-module (gnu packages xorg)
144 #:use-module (gnu packages groff)
145 #:use-module (gnu packages rsync)
146 #:use-module (gnu packages selinux)
147 #:use-module (gnu packages swig)
148 #:use-module (guix build-system cmake)
149 #:use-module (guix build-system gnu)
150 #:use-module (guix build-system go)
151 #:use-module (guix build-system meson)
152 #:use-module (guix build-system python)
153 #:use-module (guix build-system trivial)
154 #:use-module (guix build-system linux-module)
155 #:use-module (guix download)
156 #:use-module (guix git-download)
157 #:use-module ((guix licenses) #:prefix license:)
158 #:use-module (guix packages)
159 #:use-module (guix gexp)
160 #:use-module (guix store)
161 #:use-module (guix monads)
162 #:use-module (guix utils)
163 #:use-module (guix deprecation) ;for libcap/next
164 #:use-module (srfi srfi-1)
165 #:use-module (srfi srfi-2)
166 #:use-module (srfi srfi-26)
167 #:use-module (ice-9 match))
169 (define-public (system->linux-architecture arch)
170 "Return the Linux architecture name for ARCH, a Guix system name such as
171 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
172 (let ((arch (car (string-split arch #\-))))
173 (cond ((string=? arch "i686") "i386")
174 ((string-prefix? "mips" arch) "mips")
175 ((string-prefix? "arm" arch) "arm")
176 ((string-prefix? "aarch64" arch) "arm64")
177 ((string-prefix? "alpha" arch) "alpha")
178 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
179 ((string-prefix? "s390" arch) "s390")
180 ((string-prefix? "riscv" arch) "riscv")
183 (define-public (system->defconfig system)
184 "Some systems (notably powerpc-linux) require a special target for kernel
185 defconfig. Return the appropriate make target if applicable, otherwise return
187 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
188 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
189 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
194 ;;; Kernel source code deblobbing.
197 (define (linux-libre-deblob-scripts version
200 (list (version-major+minor version)
203 (uri (string-append "https://linux-libre.fsfla.org"
204 "/pub/linux-libre/releases/" version "-gnu/"
205 "deblob-" (version-major+minor version)))
206 (file-name (string-append "linux-libre-deblob-"
208 (sha256 deblob-hash))
211 (uri (string-append "https://linux-libre.fsfla.org"
212 "/pub/linux-libre/releases/" version "-gnu/"
214 (file-name (string-append "linux-libre-deblob-check-" version))
215 (sha256 deblob-check-hash))))
217 (define* (computed-origin-method gexp-promise hash-algo hash
218 #:optional (name "source")
219 #:key (system (%current-system))
220 (guile (default-guile)))
221 "Return a derivation that executes the G-expression that results
222 from forcing GEXP-PROMISE."
223 (mlet %store-monad ((guile (package->derivation guile system)))
224 (gexp->derivation (or name "computed-origin")
226 #:graft? #f ;nothing to graft
228 #:guile-for-build guile)))
230 (define (make-linux-libre-source version
233 "Return a 'computed' origin that generates a Linux-libre tarball from the
234 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
235 (match deblob-scripts
236 ((deblob-version (? origin? deblob) (? origin? deblob-check))
237 (unless (string=? deblob-version (version-major+minor version))
238 ;; The deblob script cannot be expected to work properly on a
239 ;; different version (major+minor) of Linux, even if no errors
240 ;; are signaled during execution.
241 (error "deblob major+minor version mismatch"))
243 (method computed-origin-method)
244 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
248 (with-imported-modules '((guix build utils))
250 (use-modules (guix build utils)
255 (setvbuf (current-output-port) 'line)
257 (let ((dir (string-append "linux-" #$version)))
260 (set-path-environment-variable
263 #+(canonical-package bash)
264 #+(canonical-package coreutils)
265 #+(canonical-package diffutils)
266 #+(canonical-package findutils)
267 #+(canonical-package patch)
268 #+(canonical-package xz)
269 #+(canonical-package sed)
270 #+(canonical-package grep)
271 #+(canonical-package bzip2)
272 #+(canonical-package gzip)
273 #+(canonical-package tar)
274 #+(canonical-package gawk)
277 (with-directory-excursion "/tmp/bin"
279 (copy-file #+deblob "deblob")
280 (chmod "deblob" #o755)
281 (substitute* "deblob"
282 (("/bin/sh") (which "sh")))
284 (copy-file #+deblob-check "deblob-check")
285 (chmod "deblob-check" #o755)
286 (substitute* "deblob-check"
287 (("/bin/sh") (which "sh"))
288 (("/bin/sed") (which "sed"))
289 (("/usr/bin/python") (which "python"))))
291 (if (file-is-directory? #+upstream-source)
293 (format #t "Copying upstream linux source...~%")
294 (invoke "cp" "--archive" #+upstream-source dir)
295 (invoke "chmod" "--recursive" "u+w" dir))
297 (format #t "Unpacking upstream linux tarball...~%")
298 (invoke "tar" "xf" #$upstream-source)
301 (and (not (member name '("." "..")))
302 (file-is-directory? name))))
304 (unless (string=? dir unpacked-dir)
305 (rename-file unpacked-dir dir)))
307 (error "multiple directories found" dirs)))))
309 (with-directory-excursion dir
310 (format #t "Running deblob script...~%")
311 (invoke "/tmp/bin/deblob"))
313 (format #t "~%Packing new Linux-libre tarball...~%")
314 (invoke "tar" "cvfa" #$output
315 ;; Avoid non-determinism in the archive.
323 (format #t "~%Scanning the generated tarball for blobs...~%")
324 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
332 (define (linux-libre-urls version)
333 "Return a list of URLs for Linux-Libre VERSION."
335 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
336 version "-gnu/linux-libre-" version "-gnu.tar.xz")
338 ;; XXX: Work around <http://bugs.gnu.org/14851>.
340 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
341 version "-gnu.tar.xz")
343 ;; Maybe this URL will become valid eventually.
345 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
346 version "-gnu.tar.xz")))
348 (define (%upstream-linux-source version hash)
351 (uri (string-append "mirror://kernel.org"
352 "/linux/kernel/v" (version-major version) ".x/"
353 "linux-" version ".tar.xz"))
356 ;; The current "stable" kernels. That is, the most recently released major
357 ;; versions that are still supported upstream.
358 (define-public linux-libre-5.12-version "5.12.12")
359 (define deblob-scripts-5.12
360 (linux-libre-deblob-scripts
361 linux-libre-5.12-version
362 (base32 "1vdsr9y4gckknrbqcjyfakwva3k0vb5zcivzk3k1s9mh7qp9dils")
363 (base32 "1p1jzrci97sipjdx3h0vmdnw35z2vyvczinxmp65xi1ja7ww0g14")))
364 (define-public linux-libre-5.12-pristine-source
365 (let ((version linux-libre-5.12-version)
366 (hash (base32 "1a1ymbgkp8ngrkf7cfjrn56zb9qz1mm1j1pmd60g85ln7nyb4ai1")))
367 (make-linux-libre-source version
368 (%upstream-linux-source version hash)
369 deblob-scripts-5.12)))
371 ;; The "longterm" kernels — the older releases with long-term upstream support.
372 ;; Here are the support timelines:
373 ;; <https://www.kernel.org/category/releases.html>
374 (define-public linux-libre-5.10-version "5.10.43")
375 (define deblob-scripts-5.10
376 (linux-libre-deblob-scripts
377 linux-libre-5.10-version
378 (base32 "1rmnx1px4sizs2lq831yd2g9dyflg0vmykz3cv9443x2a2vwy81f")
379 (base32 "1zsr02zmpx3968277sy8pfs2mdlgh86ifymwyj0r56wnhzf5q6hk")))
380 (define-public linux-libre-5.10-pristine-source
381 (let ((version linux-libre-5.10-version)
382 (hash (base32 "00yl1g6irpwy3sy0d43qvlk7x1gfk4v1dyv460afxy527d1ixf43")))
383 (make-linux-libre-source version
384 (%upstream-linux-source version hash)
385 deblob-scripts-5.10)))
387 (define-public linux-libre-5.4-version "5.4.125")
388 (define deblob-scripts-5.4
389 (linux-libre-deblob-scripts
390 linux-libre-5.4-version
391 (base32 "12g1wm7xvjvmjanbgg0ahxm4vs2n5bvicfnnnag4h35vl4q3lggg")
392 (base32 "1xghbbnaisjd0k1klbyn1p7r6r4x5a1bpmkm56a3gh2zvw4s7mj8")))
393 (define-public linux-libre-5.4-pristine-source
394 (let ((version linux-libre-5.4-version)
395 (hash (base32 "0g73xfkmj4sahrk7gx72hm2i4m98gqghswqyf8yqh77b9857bvhp")))
396 (make-linux-libre-source version
397 (%upstream-linux-source version hash)
398 deblob-scripts-5.4)))
400 (define-public linux-libre-4.19-version "4.19.195")
401 (define deblob-scripts-4.19
402 (linux-libre-deblob-scripts
403 linux-libre-4.19-version
404 (base32 "1jfcz4lnm44b3xzrkiipvw35kl0vvdvhr2pg7jfwf02f6qbvay18")
405 (base32 "1jiaw0as1ippkrjdpd52657w5mz9qczg3y2hlra7m9k0xawwiqlf")))
406 (define-public linux-libre-4.19-pristine-source
407 (let ((version linux-libre-4.19-version)
408 (hash (base32 "02rdy5mdmwxli0cin5n7ab492y9fs01hhqxrjq6b4idwv5baa42m")))
409 (make-linux-libre-source version
410 (%upstream-linux-source version hash)
411 deblob-scripts-4.19)))
413 (define-public linux-libre-4.14-version "4.14.237")
414 (define deblob-scripts-4.14
415 (linux-libre-deblob-scripts
416 linux-libre-4.14-version
417 (base32 "07afckszdm4pq008i6ij0pxpw2rpgi5q931nxh6dxcczpicvwbc9")
418 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
419 (define-public linux-libre-4.14-pristine-source
420 (let ((version linux-libre-4.14-version)
421 (hash (base32 "0kib9p61hhwjbr8zhir9aw86qik7k6bm95503n3k09ayyachajpq")))
422 (make-linux-libre-source version
423 (%upstream-linux-source version hash)
424 deblob-scripts-4.14)))
426 (define-public linux-libre-4.9-version "4.9.273")
427 (define deblob-scripts-4.9
428 (linux-libre-deblob-scripts
429 linux-libre-4.9-version
430 (base32 "1w8cb8w1cpcwswc3rxq6vwjafw6yy0igib34rrm93ag5h6inncfv")
431 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
432 (define-public linux-libre-4.9-pristine-source
433 (let ((version linux-libre-4.9-version)
434 (hash (base32 "0jjarv3xfkc21j1xhgch53w8wm6rq3xw1i03rjw9fv5i9k4x6qsw")))
435 (make-linux-libre-source version
436 (%upstream-linux-source version hash)
437 deblob-scripts-4.9)))
439 (define-public linux-libre-4.4-version "4.4.273")
440 (define deblob-scripts-4.4
441 (linux-libre-deblob-scripts
442 linux-libre-4.4-version
443 (base32 "1lid4k7g947yi3hcjj0lz0fnssawbph3jsy67vrv57l5imrhv3zs")
444 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
445 (define-public linux-libre-4.4-pristine-source
446 (let ((version linux-libre-4.4-version)
447 (hash (base32 "1pd39cak0zhda3m9nvn9yxgd070wxvckaha5wl8pi7c8i6jfpclb")))
448 (make-linux-libre-source version
449 (%upstream-linux-source version hash)
450 deblob-scripts-4.4)))
452 (define %boot-logo-patch
453 ;; Linux-Libre boot logo featuring Freedo and a gnu.
456 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
457 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
460 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
462 (define %linux-libre-arm-export-__sync_icache_dcache-patch
466 "https://salsa.debian.org/kernel-team/linux"
467 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
468 "/debian/patches/bugfix/arm/"
469 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
470 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
472 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
474 (define (source-with-patches source patches)
477 (patches (append (origin-patches source)
480 (define-public linux-libre-5.12-source
481 (source-with-patches linux-libre-5.12-pristine-source
482 (list %boot-logo-patch
483 %linux-libre-arm-export-__sync_icache_dcache-patch
484 ;; Pinebook Pro patch to fix LCD display
486 "linux-libre-arm64-generic-pinebook-lcd.patch"))))
488 (define-public linux-libre-5.10-source
489 (source-with-patches linux-libre-5.10-pristine-source
490 (list %boot-logo-patch
491 %linux-libre-arm-export-__sync_icache_dcache-patch
492 ;; Pinebook Pro patch to fix LCD display
494 "linux-libre-arm64-generic-pinebook-lcd.patch"))))
496 (define-public linux-libre-5.4-source
497 (source-with-patches linux-libre-5.4-pristine-source
498 (list %boot-logo-patch
499 %linux-libre-arm-export-__sync_icache_dcache-patch
500 ;; Pinebook Pro patch from linux-next,
501 ;; can be dropped for linux-libre 5.7
503 "linux-libre-support-for-Pinebook-Pro.patch"))))
505 (define-public linux-libre-4.19-source
506 (source-with-patches linux-libre-4.19-pristine-source
507 (list %boot-logo-patch
508 %linux-libre-arm-export-__sync_icache_dcache-patch)))
510 (define-public linux-libre-4.14-source
511 (source-with-patches linux-libre-4.14-pristine-source
512 (list %boot-logo-patch)))
514 (define-public linux-libre-4.9-source
515 (source-with-patches linux-libre-4.9-pristine-source
516 (list %boot-logo-patch)))
518 (define-public linux-libre-4.4-source
519 (source-with-patches linux-libre-4.4-pristine-source
520 (list %boot-logo-patch)))
527 (define (make-linux-libre-headers version hash-string)
528 (make-linux-libre-headers* version
531 (uri (linux-libre-urls version))
532 (sha256 (base32 hash-string)))))
534 (define (make-linux-libre-headers* version source)
536 (name "linux-libre-headers")
539 (build-system gnu-build-system)
540 (native-inputs `(("perl" ,perl)
541 ,@(if (version>=? version "4.16")
545 ,@(if (version>=? version "5.3")
549 `(#:modules ((guix build gnu-build-system)
553 (modify-phases %standard-phases
557 (let ((arch ,(system->linux-architecture
558 (or (%current-target-system)
560 (defconfig ,(system->defconfig
561 (or (%current-target-system)
562 (%current-system)))))
564 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
565 (invoke "make" defconfig)
566 (invoke "make" "mrproper" "headers_check"))))
568 (lambda* (#:key outputs #:allow-other-keys)
569 (let ((out (assoc-ref outputs "out")))
571 (string-append "INSTALL_HDR_PATH=" out)
574 (mkdir (string-append out "/include/config"))
575 (call-with-output-file
577 "/include/config/kernel.release")
579 (format p "~a-default~%" ,version)))
581 ;; Remove the '.install' and '..install.cmd' files; the
582 ;; latter contains store paths, which pulls in bootstrap
583 ;; binaries in the build environment, and prevents bit
584 ;; reproducibility for the bootstrap binaries.
585 (for-each delete-file (find-files out "\\.install"))
588 #:allowed-references ()
590 (home-page "https://www.gnu.org/software/linux-libre/")
591 (synopsis "GNU Linux-Libre kernel headers")
592 (description "Headers of the Linux-Libre kernel.")
593 (license license:gpl2)))
595 (define-public linux-libre-headers-5.12
596 (make-linux-libre-headers* linux-libre-5.12-version
597 linux-libre-5.12-source))
599 (define-public linux-libre-headers-5.10
600 (make-linux-libre-headers* linux-libre-5.10-version
601 linux-libre-5.10-source))
603 (define-public linux-libre-headers-5.4
604 (make-linux-libre-headers* linux-libre-5.4-version
605 linux-libre-5.4-source))
607 (define-public linux-libre-headers-4.19
608 (make-linux-libre-headers* linux-libre-4.19-version
609 linux-libre-4.19-source))
611 (define-public linux-libre-headers-4.14
612 (make-linux-libre-headers* linux-libre-4.14-version
613 linux-libre-4.14-source))
615 (define-public linux-libre-headers-4.9
616 (make-linux-libre-headers* linux-libre-4.9-version
617 linux-libre-4.9-source))
619 (define-public linux-libre-headers-4.4
620 (make-linux-libre-headers* linux-libre-4.4-version
621 linux-libre-4.4-source))
623 ;; The following package is used in the early bootstrap, and thus must be kept
624 ;; stable and with minimal build requirements.
625 (define-public linux-libre-headers-5.4.20
626 (make-linux-libre-headers "5.4.20"
627 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
629 (define-public linux-libre-headers linux-libre-headers-5.4.20)
633 ;;; Kernel configurations.
636 (define* (kernel-config arch #:key variant)
637 "Return the absolute file name of the Linux-Libre build configuration file
638 for ARCH and optionally VARIANT, or #f if there is no such configuration."
639 (let* ((name (string-append (if variant (string-append variant "-") "")
640 (if (string=? "i386" arch) "i686" arch) ".conf"))
641 (file (string-append "linux-libre/" name)))
642 (search-auxiliary-file file)))
644 (define %default-extra-linux-options
645 `(;; Some very mild hardening.
646 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
647 ;; All kernels should have NAMESPACES options enabled
648 ("CONFIG_NAMESPACES" . #t)
649 ("CONFIG_UTS_NS" . #t)
650 ("CONFIG_IPC_NS" . #t)
651 ("CONFIG_USER_NS" . #t)
652 ("CONFIG_PID_NS" . #t)
653 ("CONFIG_NET_NS" . #t)
654 ;; Various options needed for elogind service:
655 ;; https://issues.guix.gnu.org/43078
656 ("CONFIG_CGROUP_FREEZER" . #t)
657 ("CONFIG_BLK_CGROUP" . #t)
658 ("CONFIG_CGROUP_WRITEBACK" . #t)
659 ("CONFIG_CGROUP_SCHED" . #t)
660 ("CONFIG_CGROUP_PIDS" . #t)
661 ("CONFIG_CGROUP_FREEZER" . #t)
662 ("CONFIG_CGROUP_DEVICE" . #t)
663 ("CONFIG_CGROUP_CPUACCT" . #t)
664 ("CONFIG_CGROUP_PERF" . #t)
665 ("CONFIG_SOCK_CGROUP_DATA" . #t)
666 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
667 ("CONFIG_CGROUP_NET_PRIO" . #t)
668 ("CONFIG_CGROUP_NET_CLASSID" . #t)
669 ("CONFIG_MEMCG" . #t)
670 ("CONFIG_MEMCG_SWAP" . #t)
671 ("CONFIG_MEMCG_KMEM" . #t)
672 ("CONFIG_CPUSETS" . #t)
673 ("CONFIG_PROC_PID_CPUSET" . #t)
674 ;; Allow disk encryption by default
675 ("CONFIG_DM_CRYPT" . m)
676 ;; Modules required for initrd:
677 ("CONFIG_NET_9P" . m)
678 ("CONFIG_NET_9P_VIRTIO" . m)
679 ("CONFIG_VIRTIO_BLK" . m)
680 ("CONFIG_VIRTIO_NET" . m)
681 ("CONFIG_VIRTIO_PCI" . m)
682 ("CONFIG_VIRTIO_BALLOON" . m)
683 ("CONFIG_VIRTIO_MMIO" . m)
684 ("CONFIG_FUSE_FS" . m)
686 ("CONFIG_9P_FS" . m)))
688 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
689 (define %bpf-extra-linux-options
690 `(;; Needed for probes
691 ("CONFIG_UPROBE_EVENTS" . #t)
692 ("CONFIG_KPROBE_EVENTS" . #t)
693 ;; kheaders module also helpful for tracing
694 ("CONFIG_IKHEADERS" . #t)
696 ("CONFIG_BPF_SYSCALL" . #t)
697 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
698 ;; optional, for tc filters
699 ("CONFIG_NET_CLS_BPF" . m)
700 ;; optional, for tc actions
701 ("CONFIG_NET_ACT_BPF" . m)
702 ("CONFIG_BPF_JIT" . #t)
703 ;; for Linux kernel versions 4.1 through 4.6
704 ;; ("CONFIG_HAVE_BPF_JIT" . y)
705 ;; for Linux kernel versions 4.7 and later
706 ("CONFIG_HAVE_EBPF_JIT" . #t)
707 ;; optional, for kprobes
708 ("CONFIG_BPF_EVENTS" . #t)
710 ("CONFIG_IKHEADERS" . #t)))
712 (define (config->string options)
713 (string-join (map (match-lambda
715 (string-append option "=m"))
717 (string-append option "=y"))
719 (string-append option "=n")))
725 ;;; Kernel package utilities.
728 (define* (make-linux-libre version hash-string supported-systems
730 ;; A function that takes an arch and a variant.
731 ;; See kernel-config for an example.
733 (configuration-file #f)
734 (defconfig "defconfig")
735 (extra-options %default-extra-linux-options)
736 (patches (list %boot-logo-patch)))
737 (make-linux-libre* version
740 (uri (linux-libre-urls version))
741 (sha256 (base32 hash-string))
744 #:extra-version extra-version
745 #:configuration-file configuration-file
746 #:defconfig defconfig
747 #:extra-options extra-options))
749 (define* (make-linux-libre* version source supported-systems
751 ;; A function that takes an arch and a variant.
752 ;; See kernel-config for an example.
754 (configuration-file #f)
755 (defconfig "defconfig")
756 (extra-options %default-extra-linux-options))
758 (name (if extra-version
759 (string-append "linux-libre-" extra-version)
763 (supported-systems supported-systems)
764 (build-system gnu-build-system)
769 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
773 ;; These are needed to compile the GCC plugins.
778 ,@(match (and configuration-file
780 (system->linux-architecture
781 (or (%current-target-system) (%current-system)))
782 #:variant (version-major+minor version)))
783 (#f ;no config for this platform
786 `(("kconfig" ,config))))))
788 `(#:modules ((guix build gnu-build-system)
795 (modify-phases %standard-phases
796 (add-after 'unpack 'patch-/bin/pwd
798 (substitute* (find-files "." "^Makefile(\\.include)?$")
799 (("/bin/pwd") "pwd"))
802 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
803 ;; Avoid introducing timestamps
804 (setenv "KCONFIG_NOTIMESTAMP" "1")
805 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
807 ;; Set ARCH and CROSS_COMPILE
808 (let ((arch ,(system->linux-architecture
809 (or (%current-target-system)
810 (%current-system)))))
812 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
815 (setenv "CROSS_COMPILE" (string-append target "-"))
816 (format #t "`CROSS_COMPILE' set to `~a'~%"
817 (getenv "CROSS_COMPILE"))))
819 (setenv "EXTRA_VERSION" ,extra-version)
821 (let ((build (assoc-ref %standard-phases 'build))
822 (config (assoc-ref (or native-inputs inputs) "kconfig")))
824 ;; Use a custom kernel configuration file or a default
825 ;; configuration file.
828 (copy-file config ".config")
829 (chmod ".config" #o666))
830 (invoke "make" ,defconfig))
832 ;; Appending works even when the option wasn't in the
833 ;; file. The last one prevails if duplicated.
834 (let ((port (open-file ".config" "a"))
835 (extra-configuration ,(config->string extra-options)))
836 (display extra-configuration port)
839 (invoke "make" "oldconfig"))))
841 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
842 (let* ((out (assoc-ref outputs "out"))
843 (moddir (string-append out "/lib/modules"))
844 (dtbdir (string-append out "/lib/dtbs")))
845 ;; Install kernel image, kernel configuration and link map.
846 (for-each (lambda (file) (install-file file out))
847 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
848 ;; Install device tree files
849 (unless (null? (find-files "." "\\.dtb$"))
851 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
853 ;; Install kernel modules
856 ;; Disable depmod because the Guix system's module directory
857 ;; is an union of potentially multiple packages. It is not
858 ;; possible to use depmod to usefully calculate a dependency
859 ;; graph while building only one of those packages.
861 (string-append "MODULE_DIR=" moddir)
862 (string-append "INSTALL_PATH=" out)
863 (string-append "INSTALL_MOD_PATH=" out)
864 "INSTALL_MOD_STRIP=1"
866 (let* ((versions (filter (lambda (name)
867 (not (string-prefix? "." name)))
869 (version (match versions
871 ;; There are symlinks to the build and source directory,
872 ;; both of which will point to target /tmp/guix-build*
873 ;; and thus not be useful in a profile. Delete the symlinks.
874 (false-if-file-not-found
875 (delete-file (string-append moddir "/" version "/build")))
876 (false-if-file-not-found
877 (delete-file (string-append moddir "/" version "/source"))))
880 (home-page "https://www.gnu.org/software/linux-libre/")
881 (synopsis "100% free redistribution of a cleaned Linux kernel")
883 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
884 It has been modified to remove all non-free binary blobs.")
885 (license license:gpl2)
886 (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.
890 ;;; Generic kernel packages.
893 (define-public linux-libre-5.12
894 (make-linux-libre* linux-libre-5.12-version
895 linux-libre-5.12-source
896 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
897 #:configuration-file kernel-config))
899 (define-public linux-libre-version linux-libre-5.12-version)
900 (define-public linux-libre-pristine-source linux-libre-5.12-pristine-source)
901 (define-public linux-libre-source linux-libre-5.12-source)
902 (define-public linux-libre linux-libre-5.12)
904 (define-public linux-libre-5.10
905 (make-linux-libre* linux-libre-5.10-version
906 linux-libre-5.10-source
907 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
908 #:configuration-file kernel-config))
910 (define-public linux-libre-5.4
911 (make-linux-libre* linux-libre-5.4-version
912 linux-libre-5.4-source
913 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
914 #:configuration-file kernel-config))
916 (define-public linux-libre-4.19
917 (make-linux-libre* linux-libre-4.19-version
918 linux-libre-4.19-source
919 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
920 #:configuration-file kernel-config))
922 (define-public linux-libre-4.14
923 (make-linux-libre* linux-libre-4.14-version
924 linux-libre-4.14-source
925 '("x86_64-linux" "i686-linux" "armhf-linux")
926 #:configuration-file kernel-config))
928 (define-public linux-libre-4.9
929 (make-linux-libre* linux-libre-4.9-version
930 linux-libre-4.9-source
931 '("x86_64-linux" "i686-linux")
932 #:configuration-file kernel-config))
934 (define-public linux-libre-4.4
935 (make-linux-libre* linux-libre-4.4-version
936 linux-libre-4.4-source
937 '("x86_64-linux" "i686-linux")
938 #:configuration-file kernel-config
941 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
942 ;; This option was removed upstream in version 4.7.
943 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
944 %default-extra-linux-options)))
946 ;; Linux-Libre-LTS points to the *newest* released long-term support version of
948 ;; Reference: https://jxself.org/linux-libre/
950 (define-public linux-libre-lts-version linux-libre-5.10-version)
951 (define-public linux-libre-lts-pristine-source linux-libre-5.10-pristine-source)
952 (define-public linux-libre-lts-source linux-libre-5.10-source)
953 (define-public linux-libre-lts linux-libre-5.10)
957 ;;; Specialized kernel variants.
960 (define-public linux-libre-arm-generic
961 (make-linux-libre* linux-libre-version
964 #:defconfig "multi_v7_defconfig"
965 #:extra-version "arm-generic"
968 `(;; needed to fix the RTC on rockchip platforms
969 ("CONFIG_RTC_DRV_RK808" . #t))
970 %default-extra-linux-options)))
972 (define-public linux-libre-arm-veyron
973 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
975 (define-public linux-libre-arm-generic-5.10
976 (make-linux-libre* linux-libre-5.10-version
977 linux-libre-5.10-source
979 #:defconfig "multi_v7_defconfig"
980 #:extra-version "arm-generic"
983 `(;; needed to fix the RTC on rockchip platforms
984 ("CONFIG_RTC_DRV_RK808" . #t))
985 %default-extra-linux-options)))
987 (define-public linux-libre-arm-generic-5.4
988 (make-linux-libre* linux-libre-5.4-version
989 linux-libre-5.4-source
991 #:defconfig "multi_v7_defconfig"
992 #:extra-version "arm-generic"
995 `(;; needed to fix the RTC on rockchip platforms
996 ("CONFIG_RTC_DRV_RK808" . #t))
997 %default-extra-linux-options)))
999 (define-public linux-libre-arm-generic-4.19
1000 (make-linux-libre* linux-libre-4.19-version
1001 linux-libre-4.19-source
1003 #:defconfig "multi_v7_defconfig"
1004 #:extra-version "arm-generic"))
1006 (define-public linux-libre-arm-generic-4.14
1007 (make-linux-libre* linux-libre-4.14-version
1008 linux-libre-4.14-source
1010 #:defconfig "multi_v7_defconfig"
1011 #:extra-version "arm-generic"))
1013 (define-public linux-libre-arm-omap2plus
1014 (make-linux-libre* linux-libre-version
1017 #:defconfig "omap2plus_defconfig"
1018 #:extra-version "arm-omap2plus"))
1020 (define-public linux-libre-arm-omap2plus-4.19
1021 (make-linux-libre* linux-libre-4.19-version
1022 linux-libre-4.19-source
1024 #:defconfig "omap2plus_defconfig"
1025 #:extra-version "arm-omap2plus"))
1027 (define-public linux-libre-arm-omap2plus-4.14
1028 (make-linux-libre* linux-libre-4.14-version
1029 linux-libre-4.14-source
1031 #:defconfig "omap2plus_defconfig"
1032 #:extra-version "arm-omap2plus"))
1034 (define-public linux-libre-arm64-generic
1035 (make-linux-libre* linux-libre-version
1038 #:defconfig "defconfig"
1039 #:extra-version "arm64-generic"
1042 `(;; needed to fix the RTC on rockchip platforms
1043 ("CONFIG_RTC_DRV_RK808" . #t)
1044 ;; Pinebook display, battery, charger and usb
1045 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1046 ("CONFIG_CHARGER_AXP20X" . m)
1047 ("CONFIG_INPUT_AXP20X_PEK" . m)
1048 ("CONFIG_CHARGER_AXP20X" . m)
1049 ("CONFIG_BATTERY_AXP20X" . m)
1050 ("CONFIG_PINCTRL_AXP209" . m)
1051 ("CONFIG_AXP20X_POWER" . m)
1052 ("CONFIG_AXP20X_ADC" . m)
1053 ;; Pinebook PRO battery and sound support
1054 ("CONFIG_BATTERY_CW2015" . m)
1055 ("CONFIG_CHARGER_GPIO" . m)
1056 ("CONFIG_SND_SOC_ES8316" . m))
1057 %default-extra-linux-options)))
1059 (define-public linux-libre-arm64-generic-5.10
1060 (make-linux-libre* linux-libre-5.10-version
1061 linux-libre-5.10-source
1063 #:defconfig "defconfig"
1064 #:extra-version "arm64-generic"
1067 `(;; needed to fix the RTC on rockchip platforms
1068 ("CONFIG_RTC_DRV_RK808" . #t)
1069 ;; Pinebook display, battery, charger and usb
1070 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1071 ("CONFIG_CHARGER_AXP20X" . m)
1072 ("CONFIG_INPUT_AXP20X_PEK" . m)
1073 ("CONFIG_CHARGER_AXP20X" . m)
1074 ("CONFIG_BATTERY_AXP20X" . m)
1075 ("CONFIG_PINCTRL_AXP209" . m)
1076 ("CONFIG_AXP20X_POWER" . m)
1077 ("CONFIG_AXP20X_ADC" . m)
1078 ;; Pinebook PRO battery and sound support
1079 ("CONFIG_BATTERY_CW2015" . m)
1080 ("CONFIG_CHARGER_GPIO" . m)
1081 ("CONFIG_SND_SOC_ES8316" . m))
1082 %default-extra-linux-options)))
1084 (define-public linux-libre-arm64-generic-5.4
1085 (make-linux-libre* linux-libre-5.4-version
1086 linux-libre-5.4-source
1088 #:defconfig "defconfig"
1089 #:extra-version "arm64-generic"
1092 `(;; needed to fix the RTC on rockchip platforms
1093 ("CONFIG_RTC_DRV_RK808" . #t))
1094 %default-extra-linux-options)))
1096 (define-public linux-libre-riscv64-generic
1097 (make-linux-libre* linux-libre-version
1100 #:extra-version "riscv64-generic"))
1102 (define-public linux-libre-mips64el-fuloong2e
1103 (make-linux-libre* linux-libre-version
1106 #:defconfig "fuloong2e_defconfig"
1107 #:extra-version "mips64el-fuloong2e"
1110 `(("CONFIG_OVERLAY_FS" . m))
1111 %default-extra-linux-options)))
1113 (define-public linux-libre-with-bpf
1114 (let ((base-linux-libre
1116 linux-libre-5.12-version
1117 linux-libre-5.12-source
1118 '("x86_64-linux" "i686-linux" "armhf-linux"
1119 "aarch64-linux" "riscv64-linux")
1120 #:extra-version "bpf"
1121 #:configuration-file kernel-config
1123 (append %bpf-extra-linux-options
1124 %default-extra-linux-options))))
1126 (inherit base-linux-libre)
1127 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
1132 ;;; Linux kernel modules.
1135 (define-public acpi-call-linux-module
1137 (name "acpi-call-linux-module")
1143 (url "https://github.com/nix-community/acpi_call")
1144 (commit (string-append "v" version))))
1145 (file-name (git-file-name name version))
1147 (base32 "0mr4rjbv6fj4phf038addrgv32940bphghw2v9n1z4awvw7wzkbg"))))
1148 (build-system linux-module-build-system)
1150 `(#:tests? #f ; no tests
1152 (modify-phases %standard-phases
1153 (add-before 'install 'patch-shebangs-harder
1154 ;; The (only) shebangs in examples/ don't justify a reference.
1155 ;; However, do substitute a more portable one than the original.
1157 (substitute* (find-files "examples" ".")
1158 (("^(#! *)/[^ ]*/" _ shebang)
1159 (string-append shebang "/usr/bin/env ")))
1161 (add-after 'install 'install-documentation
1162 (lambda* (#:key outputs #:allow-other-keys)
1163 (let* ((out (assoc-ref outputs "out"))
1164 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1165 (for-each (lambda (file)
1166 (let ((target (string-append doc "/" file)))
1167 (mkdir-p (dirname target))
1168 (copy-recursively file target)))
1169 (list "README.md" "examples"))
1171 (home-page "https://github.com/teleshoes/acpi_call")
1172 (synopsis "Linux kernel module to perform ACPI method calls")
1174 "This simple Linux kernel module allows calls from user space to any
1175 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1176 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1177 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1178 and @code{ACPI_BUFFER}.
1180 It grants direct and undocumented access to your hardware that may cause damage
1181 and should be used with caution, especially on untested models.")
1182 (license license:gpl3+))) ; see README.md (no licence headers)
1184 (define-public rtl8812au-aircrack-ng-linux-module
1185 (let ((commit "059e06a51be025fde5b2bec6565540b3d9981b0b")
1188 (name "rtl8812au-aircrack-ng-linux-module")
1189 (version (git-version "5.6.4.2" revision commit))
1194 (url "https://github.com/aircrack-ng/rtl8812au")
1196 (file-name (git-file-name name version))
1198 (base32 "0h6l2r3yj7j9zf11dw0zcdyn50ajnjw8yvv86dzlfj80dn75n98f"))
1199 (modules '((guix build utils)))
1202 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1203 ;; and other unnecessary unlicenced things.
1204 (for-each delete-file-recursively (list "android"
1208 (build-system linux-module-build-system)
1211 (list (string-append "KSRC="
1212 (assoc-ref %build-inputs "linux-module-builder")
1213 "/lib/modules/build"))
1215 (modify-phases %standard-phases
1217 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1218 (apply invoke "make" make-flags))))
1219 #:tests? #f)) ; no test suite
1220 (supported-systems '("x86_64-linux" "i686-linux"))
1221 (home-page "https://github.com/aircrack-ng/rtl8812au")
1222 (synopsis "Linux driver for Realtek USB wireless network adapters")
1224 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1225 network adapters, modified by the aircrack-ng project to support monitor mode
1226 and frame injection. It provides a @code{88XXau} kernel module that supports
1227 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1228 (license license:gpl2+))))
1230 (define-public rtl8821ce-linux-module
1231 (let ((commit "897e7c4c15dd5a0a569745dc223d969a26ff5bfc")
1234 (name "rtl8821ce-linux-module")
1235 (version (git-version "0.0.0" revision commit))
1240 (url "https://github.com/tomaspinho/rtl8821ce")
1242 (file-name (git-file-name name version))
1245 "0935dzz0njxh78wfd17yqah1dxn6b3kaszvzclwwrwwhwcrdp80j"))))
1246 (build-system linux-module-build-system)
1250 (string-append "KSRC="
1251 (assoc-ref %build-inputs "linux-module-builder")
1252 "/lib/modules/build"))
1254 (modify-phases %standard-phases
1256 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1257 (apply invoke "make" make-flags))))
1258 #:tests? #f)) ; no test suite
1259 (home-page "https://github.com/tomaspinho/rtl8821ce")
1260 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1261 (description "This is Realtek's RTL8821CE Linux driver for wireless
1263 (license license:gpl2))))
1265 (define-public vhba-module
1267 (name "vhba-module")
1268 (version "20200106")
1272 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1273 version ".tar.bz2"))
1276 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1277 (build-system linux-module-build-system)
1281 (home-page "https://cdemu.sourceforge.io/")
1282 (synopsis "Kernel module that emulates SCSI devices")
1283 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1284 between the CDemu userspace daemon and linux kernel.")
1285 (license license:gpl2+)))
1287 (define-public bbswitch-module
1288 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
1289 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
1290 (let ((commit "ddbd243638c7bc2baecf43a78aff46cdc12e9b2e"))
1292 (name "bbswitch-module")
1293 (version (git-version "0.8" "1" commit))
1297 (url "https://github.com/Bumblebee-Project/bbswitch")
1299 (file-name (git-file-name name version))
1302 "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb"))))
1303 (build-system linux-module-build-system)
1307 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1308 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1309 (description "The bbswitch module provides a way to toggle the Nvidia
1310 graphics card on Optimus laptops.")
1311 (license license:gpl2))))
1313 (define-public ddcci-driver-linux
1315 (name "ddcci-driver-linux")
1322 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1323 (commit (string-append "v" version))))
1324 (file-name (git-file-name name version))
1327 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1328 (build-system linux-module-build-system)
1330 `(#:tests? #f ; no tests
1332 (modify-phases %standard-phases
1337 (with-directory-excursion module
1338 (apply (assoc-ref %standard-phases 'build) args)))
1339 '("ddcci" "ddcci-backlight"))
1345 (with-directory-excursion module
1346 (apply (assoc-ref %standard-phases 'install) args)))
1347 '("ddcci" "ddcci-backlight"))
1349 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1350 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1351 (description "This package provides two Linux kernel drivers, ddcci and
1352 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1353 interface. The ddcci module creates a character device for each DDC/CI
1354 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1355 module allows the control of the backlight level or luminance property when
1356 supported under @file{/sys/class/backlight/}.")
1357 (license license:gpl2+)))
1359 (define-public v4l2loopback-linux-module
1361 (name "v4l2loopback-linux-module")
1366 (url "https://github.com/umlaeute/v4l2loopback")
1367 (commit (string-append "v" version))))
1368 (file-name (git-file-name name version))
1371 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1372 (build-system linux-module-build-system)
1374 `(#:tests? #f)) ; no test suite
1375 (home-page "https://github.com/umlaeute/v4l2loopback")
1376 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1378 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1379 for Linux 2} applications will treat these as ordinary video devices but read
1380 video data generated by another application, instead of a hardware device such
1383 This lets you apply nifty effects to your Jitsi video, for example, but also
1384 allows some more serious things like adding streaming capabilities to an
1385 application by hooking GStreamer into the loopback device.")
1386 (license license:gpl2+)))
1390 ;;; Pluggable authentication modules (PAM).
1393 (define-public linux-pam
1401 "https://github.com/linux-pam/linux-pam/releases/download/v"
1402 version "/Linux-PAM-" version ".tar.xz"))
1405 "1z4jayf69qyyxln1gl6ch4qxfd66ib1g42garnrv2d8i1drl0790"))
1406 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1408 (build-system gnu-build-system)
1412 ;; TODO: optional dependencies
1413 ;; ("libxcrypt" ,libxcrypt)
1414 ;; ("cracklib" ,cracklib)
1417 `(;; Most users, such as `shadow', expect the headers to be under
1419 #:configure-flags (list (string-append "--includedir="
1420 (assoc-ref %outputs "out")
1421 "/include/security")
1423 ;; XXX: <rpc/rpc.h> is missing from glibc when
1424 ;; cross-compiling, so we have to disable NIS
1425 ;; support altogether.
1426 ,@(if (%current-target-system)
1430 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1433 (home-page "http://www.linux-pam.org/")
1434 (synopsis "Pluggable authentication modules for Linux")
1436 "A *Free* project to implement OSF's RFC 86.0.
1437 Pluggable authentication modules are small shared object files that can
1438 be used through the PAM API to perform tasks, like authenticating a user
1439 at login. Local and dynamic reconfiguration are its key features.")
1440 (license license:bsd-3)))
1442 (define-public linux-pam-1.2
1450 "http://www.linux-pam.org/library/"
1451 "Linux-PAM-" version ".tar.bz2"))
1454 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1455 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1457 (define-public python-pamela
1459 (name "python-pamela")
1463 ;; Tests not distributed in pypi release.
1466 (url "https://github.com/minrk/pamela")
1468 (file-name (git-file-name name version))
1471 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
1472 (build-system python-build-system)
1474 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
1476 (modify-phases %standard-phases
1477 (add-after 'unpack 'hardcode-pam.so
1478 (lambda* (#:key inputs #:allow-other-keys)
1479 (let ((pam (assoc-ref inputs "linux-pam")))
1480 (substitute* "pamela.py"
1481 (("find_library\\(\"pam\")")
1482 (string-append "'" pam "/lib/libpam.so'")))
1485 (lambda* (#:key tests? #:allow-other-keys)
1487 (if (file-exists? "test_pamela.py")
1488 (invoke "py.test" "--assert=plain" "test_pamela.py")
1489 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
1492 `(("linux-pam" ,linux-pam)))
1494 `(("python-pytest" ,python-pytest)))
1495 (home-page "https://github.com/minrk/pamela")
1496 (synopsis "PAM interface using ctypes")
1497 (description "This package provides a PAM interface using @code{ctypes}.")
1498 (license license:expat)))
1505 (define-public powerstat
1512 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1513 "powerstat/powerstat-" version ".tar.gz"))
1515 (base32 "0dmixbxm4qd08ds26i0wvxwyy8nrjzfjj2q9ylx35564g4wh58qb"))))
1516 (build-system gnu-build-system)
1519 (list (string-append "CC=" ,(cc-for-target))
1520 (string-append "prefix=" (assoc-ref %outputs "out")))
1521 #:tests? #f ; no test suite
1523 (modify-phases %standard-phases
1524 (add-after 'unpack 'respect-$prefix
1525 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1527 (substitute* "Makefile"
1528 (("DIR=/usr/") "DIR=$(prefix)/"))
1530 (delete 'configure)))) ; no configure script
1531 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1532 (synopsis "Measure system power consumption")
1534 "Powerstat measures and reports your computer's power consumption in real
1535 time. On mobile PCs, it uses ACPI battery information to measure the power
1536 drain of the entire system.
1538 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1539 domain measurements. These are available only on some hardware such as Intel
1540 Sandybridge and newer, and cover only part of the machine's components such as
1541 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1542 and don't require a battery at all.
1544 The output is like @command{vmstat} but also shows power consumption statistics:
1545 at the end of a run, @command{powerstat} will calculate the average, standard
1546 deviation, and minimum and maximum values. It can show a nice histogram too.")
1547 (license license:gpl2)))
1549 (define-public psmisc
1556 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1559 (base32 "0y8n1jd2dn4cvc5mh806d66qnq8xl0xmzczbycjwal10rvmcw33z"))))
1560 (build-system gnu-build-system)
1562 `(,@(if (%current-target-system)
1565 "ac_cv_func_malloc_0_nonnull=yes"
1566 "ac_cv_func_realloc_0_nonnull=yes"))
1568 (inputs `(("ncurses" ,ncurses)))
1569 (home-page "https://gitlab.com/psmisc/psmisc")
1570 (synopsis "Small utilities that use the proc file system")
1572 "This PSmisc package is a set of some small useful utilities that
1573 use the proc file system. We're not about changing the world, but
1574 providing the system administrator with some help in common tasks.")
1575 (license license:gpl2+)))
1577 (define-public util-linux
1583 (uri (string-append "mirror://kernel.org/linux/utils/"
1584 "util-linux/v" (version-major+minor version) "/"
1585 "util-linux-" version ".tar.xz"))
1588 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1589 (patches (search-patches "util-linux-tests.patch"))
1590 (modules '((guix build utils)))
1592 ;; We take 'nologin' from Shadow, the 'logger' program from
1593 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1595 (substitute* "configure"
1596 (("build_nologin=yes") "build_nologin=no")
1597 (("build_logger=yes") "build_logger=no")
1598 (("build_kill=yes") "build_kill=no"))
1600 (build-system gnu-build-system)
1601 (outputs '("out" ;6.4 MiB executables and documentation
1602 "lib" ;8.8 MiB shared libraries, headers and locales
1603 "static")) ;2.9 MiB static .a libraries
1605 `(#:configure-flags (list "--disable-use-tty-group"
1606 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1607 ;; Don't try to chown root:root mount and umount
1608 "--disable-makeinstall-chown"
1609 "--localstatedir=/var"
1610 (string-append "--localedir="
1611 (assoc-ref %outputs "lib")
1613 ;; Install completions where our
1614 ;; bash-completion package expects them.
1615 (string-append "--with-bashcompletiondir="
1616 (assoc-ref %outputs "out")
1617 "/etc/bash_completion.d"))
1619 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
1620 ;; <https://bugs.gnu.org/47791>.
1621 #:tests? ,(and (not (%current-target-system))
1622 (not (string-suffix? "-gnu" (%current-system))))
1624 #:phases (modify-phases %standard-phases
1625 (add-before 'configure 'patch-build-scripts
1626 (lambda* (#:key outputs #:allow-other-keys)
1627 (substitute* "configure"
1628 ;; The build system assumes that we want to install
1629 ;; libraries below $exec_prefix when $libdir does not
1630 ;; match any of the "usual" locations. Fix that.
1631 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1632 "usrlib_execdir=$libdir"))
1634 (add-before 'build 'set-umount-file-name
1635 (lambda* (#:key outputs #:allow-other-keys)
1636 ;; Tell 'eject' the right file name of 'umount'.
1637 (let ((out (assoc-ref outputs "out")))
1638 (substitute* "sys-utils/eject.c"
1639 (("\"/bin/umount\"")
1640 (string-append "\"" out "/bin/umount\"")))
1642 (add-before 'check 'pre-check
1643 (lambda* (#:key inputs outputs #:allow-other-keys)
1644 (let ((out (assoc-ref outputs "out"))
1645 (net (assoc-ref inputs "net-base")))
1646 ;; Change the test to refer to the right file.
1647 (substitute* "tests/ts/misc/mcookie"
1649 (string-append net "/etc/services")))
1651 ;; The C.UTF-8 locale does not exist in our libc.
1652 (substitute* "tests/ts/column/invalid-multibyte"
1653 (("C\\.UTF-8") "en_US.utf8"))
1655 ;; TODO: Remove the conditional on the next rebuild cycle.
1656 ,@(if (string-prefix? "arm" (%current-system))
1657 '((add-before 'check 'disable-setarch-test
1659 ;; The setarch tests are unreliable in QEMU's
1660 ;; user-mode emulation, which is our primary
1661 ;; method of building ARMv7 packages.
1662 ;; <https://github.com/karelzak/util-linux/issues/601>
1663 (substitute* "tests/ts/misc/setarch"
1664 (("ts_init_subtest.*" all)
1667 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1670 (add-after 'install 'move-static-libraries
1671 (lambda* (#:key outputs #:allow-other-keys)
1672 (let ((lib (assoc-ref outputs "lib"))
1673 (static (assoc-ref outputs "static")))
1675 ;; Move static libraries to the "static" output.
1676 (mkdir-p (string-append static "/lib"))
1677 (with-directory-excursion lib
1678 (for-each (lambda (file)
1680 (string-append static "/"
1682 (find-files "lib" "\\.a$"))
1684 ;; Remove references to the static library from the '.la'
1685 ;; files so that Libtool does the right thing when both
1686 ;; the shared and static library is available.
1687 (substitute* (find-files "lib" "\\.la$")
1688 (("old_library=.*") "old_library=''\n")))
1691 (add-after 'install 'adjust-pkg-config-files
1692 (lambda* (#:key outputs #:allow-other-keys)
1693 (let ((lib (assoc-ref outputs "lib")))
1694 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1695 ;; the pkg-config files to avoid a cyclic reference on "out".
1696 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1698 (("^(exec_)?prefix=.*") "")))
1700 (inputs `(("zlib" ,zlib)
1701 ("ncurses" ,ncurses)
1703 ;; XXX: This is so that the 'pre-check' phase can find it.
1704 ,@(if (%current-target-system)
1705 `(("net-base" ,net-base))
1709 ("net-base" ,net-base))) ;for tests
1710 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1711 (synopsis "Collection of utilities for the Linux kernel")
1712 (description "Util-linux is a diverse collection of Linux kernel
1713 utilities. It provides dmesg and includes tools for working with file systems,
1714 block devices, UUIDs, TTYs, and many other tools.")
1716 ;; Note that util-linux doesn't use the same license for all the
1717 ;; code. GPLv2+ is the default license for a code without an
1718 ;; explicitly defined license.
1719 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1720 license:bsd-4 license:public-domain))))
1722 ;; util-linux optionally supports udev, which allows lsblk to read file system
1723 ;; metadata without special privileges. Add it as a separate package to avoid
1724 ;; a circular dependency, and to keep the size small.
1725 (define-public util-linux+udev
1728 (name "util-linux-with-udev")
1731 ,@(package-inputs util-linux)))))
1733 (define-public ddate
1740 (url "https://github.com/bo0ts/ddate")
1741 (commit (string-append "v" version))))
1742 (file-name (git-file-name name version))
1744 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1745 (build-system cmake-build-system)
1746 (arguments '(#:tests? #f))
1747 (home-page "https://github.com/bo0ts/ddate")
1748 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1750 "ddate displays the Discordian date and holidays of a given date.
1751 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1752 by Robert Shea and Robert Anton Wilson.")
1753 (license license:public-domain)))
1755 (define-public fbset
1762 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1765 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1766 (build-system gnu-build-system)
1768 '(#:modules ((guix build gnu-build-system)
1772 (modify-phases %standard-phases
1773 (delete 'configure) ; no configure script
1774 (add-before 'install 'pre-install
1775 (lambda* (#:key outputs #:allow-other-keys)
1776 (let ((out (assoc-ref outputs "out")))
1777 (substitute* "Makefile"
1778 (("mknod ") "true ")
1779 ;; The Makefile doesn't honour PREFIX or similar.
1782 (with-directory-excursion out
1783 (for-each mkdir-p (list "sbin"
1787 (add-after 'install 'install-fb.modes
1788 (lambda* (#:key outputs #:allow-other-keys)
1789 (let* ((out (assoc-ref outputs "out"))
1790 (etc (string-append out "/etc")))
1791 (for-each (cut install-file <> etc)
1792 (find-files "etc" "^fb\\.modes"))
1793 (symlink "fb.modes.ATI"
1794 (string-append etc "/fb.modes"))
1796 ;; Parallel building races to create modes.tab.c.
1797 #:parallel-build? #f
1798 #:tests? #f)) ; no test suite
1802 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1803 (synopsis "Show and modify Linux frame buffer settings")
1805 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1806 different kinds of graphic displays. The @command{fbset} utility can query and
1807 change various device settings such as depth, virtual resolution, and timing
1809 (license license:gpl2)))
1811 (define-public procps
1817 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1818 "procps-ng-" version ".tar.xz"))
1821 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1822 (build-system gnu-build-system)
1824 `(#:modules ((guix build utils)
1825 (guix build gnu-build-system)
1828 ,@(if (%current-target-system)
1831 "ac_cv_func_malloc_0_nonnull=yes"
1832 "ac_cv_func_realloc_0_nonnull=yes"))
1835 (modify-phases %standard-phases
1837 'install 'post-install
1838 ;; Remove commands and man pages redudant with
1840 (lambda* (#:key outputs #:allow-other-keys)
1841 (let* ((out (assoc-ref outputs "out"))
1842 (dup (append-map (cut find-files out <>)
1843 '("^kill" "^uptime"))))
1844 (for-each delete-file dup)
1846 (inputs `(("ncurses" ,ncurses)))
1847 (home-page "https://gitlab.com/procps-ng/procps/")
1848 (synopsis "Utilities that give information about processes")
1850 "Procps is the package that has a bunch of small useful utilities
1851 that give information about processes using the Linux /proc file system.
1852 The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
1853 slabtop, tload, top, vmstat, w, watch and sysctl.")
1854 (license license:gpl2)))
1856 (define-public usbutils
1863 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1864 "usbutils-" version ".tar.xz"))
1866 (base32 "0f0klk6d3hmbpf6p4dcwa1qjzblmkhbxs1wsw87aidvqri7lj8wy"))))
1867 (build-system gnu-build-system)
1868 (outputs (list "out" "python"))
1871 (modify-phases %standard-phases
1872 (add-before 'bootstrap 'patch-bootstrap-scripts
1874 (substitute* "usbhid-dump/bootstrap"
1875 (("/bin/sh") (which "sh")))
1877 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1878 (substitute* "autogen.sh"
1879 (("^\\./configure.*") ""))
1881 (add-after 'install 'separate-python-output
1882 ;; Separating one Python script shaves more than 106 MiB from :out.
1883 (lambda* (#:key outputs #:allow-other-keys)
1884 (let ((out (assoc-ref outputs "out"))
1885 (out:python (assoc-ref outputs "python")))
1886 (for-each (lambda (file)
1887 (let ((old (string-append out "/" file))
1888 (new (string-append out:python "/" file)))
1889 (mkdir-p (dirname new))
1890 (rename-file old new)))
1891 (list "bin/lsusb.py"))
1896 ("python" ,python)))
1898 `(("autoconf" ,autoconf)
1899 ("automake" ,automake)
1900 ("libtool" ,libtool)
1901 ("pkg-config" ,pkg-config)))
1902 (home-page "http://www.linux-usb.org/")
1904 "Tools for working with USB devices, such as lsusb")
1906 "Tools for working with USB devices, such as lsusb.")
1907 (license license:gpl2+)))
1909 (define-public e2fsprogs
1916 "mirror://kernel.org/linux/kernel/people/tytso/"
1917 "e2fsprogs/v" version "/"
1918 "e2fsprogs-" version ".tar.xz"))
1921 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1922 (build-system gnu-build-system)
1923 (inputs `(("util-linux" ,util-linux "lib")))
1924 (native-inputs `(("pkg-config" ,pkg-config)
1925 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1929 ("procps" ,procps)))
1931 '(;; util-linux is the preferred source for some of the libraries and
1932 ;; commands, so disable them (see, e.g.,
1933 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1934 #:configure-flags (list "--disable-libblkid"
1935 "--disable-libuuid" "--disable-uuidd"
1938 ;; Use symlinks instead of hard links for
1939 ;; 'fsck.extN' etc. This makes the resulting nar
1940 ;; smaller and is preserved across copies.
1941 "--enable-symlink-install"
1943 (string-append "LDFLAGS=-Wl,-rpath="
1944 (assoc-ref %outputs "out")
1947 ;; Install libext2fs et al.
1948 "--enable-elf-shlibs")
1951 (modify-phases %standard-phases
1952 (add-before 'configure 'patch-shells
1954 (substitute* "configure"
1955 (("/bin/sh (.*)parse-types.sh" _ dir)
1956 (string-append (which "sh") " " dir
1958 (substitute* "MCONFIG.in"
1959 (("INSTALL_SYMLINK = /bin/sh")
1960 "INSTALL_SYMLINK = sh"))
1961 (substitute* (find-files "." "^Makefile.in$")
1963 (string-append "#!" (which "sh"))))
1965 (add-after 'install 'install-libs
1966 (lambda* (#:key outputs #:allow-other-keys)
1967 (let* ((out (assoc-ref outputs "out"))
1968 (lib (string-append out "/lib")))
1969 (invoke "make" "install-libs")
1971 ;; Make the .a writable so that 'strip' works.
1972 ;; Failing to do that, due to debug symbols, we
1973 ;; retain a reference to the final
1974 ;; linux-libre-headers, which refer to the
1975 ;; bootstrap binaries.
1976 (let ((archives (find-files lib "\\.a$")))
1977 (for-each (lambda (file)
1981 (home-page "http://e2fsprogs.sourceforge.net/")
1982 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1984 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1985 (license (list license:gpl2 ;programs
1986 license:lgpl2.0 ;libext2fs
1987 license:x11)))) ;libuuid
1989 (define e2fsprogs/static
1991 (package (inherit e2fsprogs)
1993 ;; Do not build shared libraries.
1994 (substitute-keyword-arguments (package-arguments e2fsprogs)
1995 ((#:configure-flags _)
1996 '(list "--disable-blkid"))
2000 (define-public e2fsck/static
2002 (name "e2fsck-static")
2003 (version (package-version e2fsprogs))
2004 (build-system trivial-build-system)
2007 `(("e2fsprogs" ,e2fsprogs/static)))
2009 `(#:modules ((guix build utils))
2012 (use-modules (guix build utils)
2016 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
2018 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
2020 (with-directory-excursion bin
2021 (copy-file e2fsck "e2fsck")
2022 (remove-store-references "e2fsck")
2023 (chmod "e2fsck" #o555))
2025 (home-page (package-home-page e2fsprogs))
2026 (synopsis "Statically-linked e2fsck command from e2fsprogs")
2027 (description "This package provides statically-linked e2fsck command taken
2028 from the e2fsprogs package. It is meant to be used in initrds.")
2029 (license (package-license e2fsprogs))))
2031 (define-public extundelete
2033 (name "extundelete")
2038 (uri (string-append "mirror://sourceforge/extundelete/"
2039 "extundelete/" version "/extundelete-"
2040 version ".tar.bz2"))
2043 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
2044 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
2045 (build-system gnu-build-system)
2046 (inputs `(("e2fsprogs" ,e2fsprogs)))
2047 (home-page "http://extundelete.sourceforge.net/")
2048 (synopsis "Recover deleted files from ext2/3/4 partitions")
2050 "Extundelete is a set of tools that can recover deleted files from an
2051 ext3 or ext4 partition.")
2052 (license license:gpl2)))
2054 (define-public zerofree
2058 (home-page "https://frippery.org/uml/")
2061 (uri (string-append home-page name "-" version
2065 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
2066 (build-system gnu-build-system)
2069 (modify-phases %standard-phases
2070 (delete 'configure) ; no configure script
2072 ;; The Makefile lacks an ‘install’ target.
2073 (lambda* (#:key outputs #:allow-other-keys)
2074 (let* ((out (assoc-ref outputs "out"))
2075 (bin (string-append out "/bin")))
2076 (chmod "zerofree" #o555)
2077 (install-file "zerofree" bin)
2079 #:tests? #f)) ; no tests
2080 (inputs `(("libext2fs" ,e2fsprogs)))
2081 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
2083 "Zerofree finds the unallocated blocks with non-zero value content in an
2084 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
2085 This is a simple way to make disk images more compressible.
2086 Zerofree requires the file system to be unmounted or mounted read-only.")
2087 (license license:gpl2)))
2089 (define-public strace
2093 (home-page "https://strace.io")
2096 (uri (string-append home-page "/files/" version
2097 "/strace-" version ".tar.xz"))
2100 "1abs3svkg9985f4jrxx34sj1dcpsf95vv1a0g01c777zgygncjnz"))))
2101 (build-system gnu-build-system)
2104 (modify-phases %standard-phases
2105 (add-after 'unpack 'patch-/bin/sh
2107 (substitute* "strace.c"
2108 (("/bin/sh") (which "sh")))
2110 (add-after 'unpack 'disable-failing-tests
2112 ;; XXX These hang forever even if the test time-out is extended.
2113 (substitute* "tests/Makefile.in"
2114 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
2116 ;; Don't fail if the architecture doesn't support different personalities.
2117 #:configure-flags '("--enable-mpers=check")
2118 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
2119 #:parallel-tests? #f)) ; undeterministic failures
2120 (native-inputs `(("perl" ,perl)))
2121 (synopsis "System call tracer for Linux")
2123 "strace is a system call tracer, i.e. a debugging tool which prints out a
2124 trace of all the system calls made by a another process/program.")
2125 (license license:lgpl2.1+)))
2127 (define-public ltrace
2133 (uri (string-append "http://www.ltrace.org/ltrace_" version
2137 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
2138 (build-system gnu-build-system)
2139 (inputs `(("libelf" ,elfutils)))
2141 ;; Compilation uses -Werror by default, but it fails.
2142 '(#:configure-flags '("--disable-werror")))
2143 (home-page "https://www.ltrace.org/")
2144 (synopsis "Library call tracer for Linux")
2146 "ltrace intercepts and records dynamic library calls which are called by
2147 an executed process and the signals received by that process. It can also
2148 intercept and print the system calls executed by the program.")
2149 (license license:gpl2+)))
2151 (define-public alsa-lib
2158 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
2159 version ".tar.bz2"))
2162 "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp"))))
2163 (build-system gnu-build-system)
2165 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2166 (assoc-ref %outputs "out")
2168 (home-page "https://www.alsa-project.org/")
2169 (synopsis "The Advanced Linux Sound Architecture libraries")
2171 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2172 MIDI functionality to the Linux-based operating system.")
2173 (license license:lgpl2.1+)))
2175 (define-public alsa-utils
2181 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
2182 name "-" version ".tar.bz2"))
2185 "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq"))))
2186 (build-system gnu-build-system)
2188 ;; XXX: Disable man page creation until we have DocBook.
2189 '(#:configure-flags (list "--disable-xmlto"
2191 ;; The udev rule is responsible for restoring
2193 (string-append "--with-udev-rules-dir="
2194 (assoc-ref %outputs "out")
2195 "/lib/udev/rules.d"))
2197 (modify-phases %standard-phases
2198 (add-before 'check 'disable-broken-test
2200 ;; XXX: The 1.1.8 release tarball is missing a header that's
2201 ;; required for this test to work. Fixed in 1.1.9.
2202 (substitute* "axfer/test/Makefile"
2203 ((".*container-test.*") ""))
2206 'install 'pre-install
2208 ;; Don't try to mkdir /var/lib/alsa.
2209 (substitute* "Makefile"
2210 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2214 `(("gettext" ,gettext-minimal)))
2216 `(("libsamplerate" ,libsamplerate)
2217 ("ncurses" ,ncurses)
2218 ("alsa-lib" ,alsa-lib)
2220 (home-page "http://www.alsa-project.org/")
2221 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2223 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2224 MIDI functionality to the Linux-based operating system.")
2226 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2228 (license license:gpl2)))
2230 (define-public alsa-plugins
2232 (name "alsa-plugins")
2236 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2237 name "-" version ".tar.bz2"))
2240 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2241 (build-system gnu-build-system)
2242 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2243 ;; be split, there are references to both in files.
2244 ;; TODO: Remove OSS related plugins, they add support to run native
2245 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2247 (outputs '("out" "pulseaudio" "jack"))
2248 (native-search-paths
2249 (list (search-path-specification
2250 (variable "ALSA_PLUGIN_DIR")
2251 (files '("lib/alsa-lib"))
2254 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2255 ;; for /etc/alsa. On Guix System plugins are loaded from
2256 ;; the ALSA service, and other distributions likely
2257 ;; won't use these files.
2258 "--with-alsalconfdir=/tmp/noop")
2260 (modify-phases %standard-phases
2261 (add-after 'install 'split
2262 (lambda* (#:key inputs outputs #:allow-other-keys)
2263 ;; Distribute the binaries to the various outputs.
2264 (let* ((out (assoc-ref outputs "out"))
2265 (jack (assoc-ref outputs "jack"))
2266 (jacklib (string-append jack "/lib/alsa-lib"))
2267 (pua (assoc-ref outputs "pulseaudio"))
2268 (pualib (string-append pua "/lib/alsa-lib")))
2271 (for-each (lambda (file)
2272 (rename-file file (string-append jacklib "/" (basename file))))
2273 (find-files out ".*jack\\.(la|so)"))
2276 (for-each (lambda (file)
2277 (rename-file file (string-append pualib "/" (basename file))))
2278 (find-files out ".*pulse\\.(la|so)"))
2281 `(("alsa-lib" ,alsa-lib)
2283 ("speex" ,speex) ; libspeexdsp resampling plugin
2284 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2285 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2286 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2288 `(("pkg-config" ,pkg-config)))
2289 (home-page "http://www.alsa-project.org/")
2290 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2292 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2293 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2294 by providing additional plugins which include: upmixing, downmixing, jackd and
2295 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2296 external rate conversion.")
2297 (license (list license:gpl2+
2298 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2299 license:lgpl2.1+))))
2301 (define-public iptables
2308 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2310 (string-append "https://www.netfilter.org/projects/iptables/"
2311 "files/iptables-" version ".tar.bz2")))
2313 (base32 "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1"))))
2314 (build-system gnu-build-system)
2316 `(("pkg-config" ,pkg-config)
2320 `(("libmnl" ,libmnl)
2321 ("libnftnl" ,libnftnl)))
2323 '(#:tests? #f ; no test suite
2324 #:configure-flags ; add $libdir to the RUNPATH of executables
2325 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
2326 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2327 (synopsis "Programs to configure Linux IP packet filtering rules")
2329 "@command{iptables} is the user-space command line program used to
2330 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2331 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2333 This package also includes @command{ip6tables}, which is used to configure the
2336 Both commands are targeted at system administrators.")
2337 (license license:gpl2+)))
2339 (define-public jitterentropy-rngd
2341 (name "jitterentropy-rngd")
2347 (url "https://github.com/smuellerDD/jitterentropy-rngd")
2348 (commit (string-append "v" version))))
2349 (file-name (git-file-name name version))
2351 (base32 "1fb8zfwhwkl1d8n4cdn7rdv5rwd75qgc00d36pmkl7wgnj3c9xda"))))
2352 (build-system gnu-build-system)
2354 `(#:tests? #f ; no test suite
2356 (list (string-append "CC=" ,(cc-for-target))
2357 (string-append "PREFIX=" (assoc-ref %outputs "out"))
2358 "UNITDIR=$(PREFIX)/lib/systemd/system")
2360 (modify-phases %standard-phases
2361 (delete 'configure)))) ; no ./configure script
2362 (home-page "https://www.chronox.de/jent.html")
2363 (synopsis "CPU jitter random number generator daemon")
2365 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
2366 number generator} core to the kernel Linux's entropy estimator. This prevents
2367 the @file{/dev/random} device from blocking and should benefit users of the
2368 preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
2370 The CPU Jitter RNG itself is part of the kernel and claims to provide good
2371 entropy by collecting and magnifying differences in CPU execution time as
2372 measured by the high-resolution timer built into modern CPUs. It requires no
2373 additional hardware or external entropy source.
2375 The random bit stream generated by @command{jitterentropy-rngd} is not processed
2376 by a cryptographically secure whitening function. Nonetheless, its authors
2377 believe it to be a suitable source of cryptographically secure key material or
2378 other cryptographically sensitive data.
2380 If you agree with them, start this daemon as early as possible to provide
2381 properly seeded random numbers to services like SSH or those using TLS during
2382 early boot when entropy may be low, especially in virtualised environments.")
2383 (license (list license:bsd-3 ; or
2386 (define-public lsscsi
2393 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2396 "0jp458m2b3wckr18qkln69i01152qlwz33zm49103lq8fgx0n6d4"))))
2397 (build-system gnu-build-system)
2398 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2399 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2401 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2402 also list NVMe namespaces or controllers and show the relationship between a
2403 device's primary node name, its SCSI generic (sg) node name and its kernel
2405 (license license:gpl2)))
2407 (define-public ebtables
2414 "mirror://netfilter.org/ebtables/ebtables-"
2418 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2419 (build-system gnu-build-system)
2422 ("iptables" ,iptables)))
2423 (synopsis "Ethernet bridge frame table administration")
2424 (home-page "https://ebtables.netfilter.org/")
2426 "ebtables is an application program used to set up and maintain the
2427 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2428 analogous to the iptables application, but less complicated, due to the fact
2429 that the Ethernet protocol is much simpler than the IP protocol.")
2430 (license license:gpl2+)))
2432 (define-public iproute
2439 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2443 "0vrjbzhwzcvaxyyhkr2ii89w2vznzwp2pfgk7w72mviniawqs9lx"))))
2444 (build-system gnu-build-system)
2446 `( ;; There is a test suite, but it wants network namespaces and sudo.
2448 #:make-flags (let ((out (assoc-ref %outputs "out")))
2450 (string-append "CC=" ,(cc-for-target))
2452 (string-append "BASH_COMPDIR=" out
2453 "/etc/bash_completion.d")
2454 (string-append "LIBDIR=" out "/lib")
2455 (string-append "HDRDIR=" out "/include")
2456 (string-append "SBINDIR=" out "/sbin")
2457 (string-append "CONFDIR=" out "/etc")
2458 (string-append "DOCDIR=" out "/share/doc/"
2460 (string-append "MANDIR=" out "/share/man")))
2461 #:phases (modify-phases %standard-phases
2462 (add-before 'install 'pre-install
2464 ;; Don't attempt to create /var/lib/arpd.
2465 (substitute* "Makefile"
2466 (("^.*ARPDDIR.*$") ""))
2468 (add-after 'unpack 'patch-configure
2470 (let ((target ,(%current-target-system)))
2471 (substitute* "configure"
2474 (string-append target "-pkg-config")
2479 ("iptables" ,iptables)
2480 ("libmnl" ,libmnl)))
2484 ("pkg-config" ,pkg-config)))
2486 ;; ("libmnl" ,libmnl)
2487 ;; ("util-linux" ,util-linux)
2489 "https://wiki.linuxfoundation.org/networking/iproute2")
2491 "Utilities for controlling TCP/IP networking and traffic in Linux")
2493 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2494 and traffic with the Linux kernel. The most important of these are
2495 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2498 Most network configuration manuals still refer to ifconfig and route as the
2499 primary network configuration tools, but ifconfig is known to behave
2500 inadequately in modern network environments, and both should be deprecated.")
2501 (license license:gpl2+)))
2503 (define-public net-tools
2504 ;; XXX: This package is basically unmaintained, but it provides a few
2505 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2507 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2511 (version (string-append "1.60-" revision "." (string-take commit 7)))
2514 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2515 "n/ne/net-tools/code.git/net-tools-code-"
2517 (file-name (string-append name "-" version ".zip"))
2520 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2521 (home-page "http://net-tools.sourceforge.net/")
2522 (build-system gnu-build-system)
2524 `(#:modules ((guix build gnu-build-system)
2529 (modify-phases %standard-phases
2531 (lambda* (#:key outputs #:allow-other-keys)
2532 (let ((out (assoc-ref outputs "out")))
2533 (mkdir-p (string-append out "/bin"))
2534 (mkdir-p (string-append out "/sbin"))
2536 ;; Pretend we have everything...
2537 (system "yes | make config")
2539 ;; ... except for the things we don't have.
2540 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2541 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2542 ;; that have been removed.
2543 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2544 ;; think about adding them later.
2545 (substitute* '("config.make" "config.h")
2546 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2549 (add-after 'install 'remove-redundant-commands
2550 (lambda* (#:key outputs #:allow-other-keys)
2551 ;; Remove commands and man pages redundant with Inetutils.
2552 (let* ((out (assoc-ref outputs "out"))
2553 (dup (append-map (cut find-files out <>)
2555 "^(yp|nis|dns)?domainname"))))
2556 (for-each delete-file dup)
2558 ;; Binaries that depend on libnet-tools.a don't declare that
2559 ;; dependency, making it parallel-unsafe.
2560 #:parallel-build? #f
2562 #:tests? #f ; no test suite
2563 #:make-flags (let ((out (assoc-ref %outputs "out")))
2564 (list ,(string-append "CC=" (cc-for-target))
2565 (string-append "BASEDIR=" out)
2566 (string-append "INSTALLNLSDIR=" out "/share/locale")
2567 (string-append "mandir=/share/man")))))
2568 (native-inputs `(("gettext" ,gettext-minimal)
2570 (supported-systems (delete "i586-gnu" %supported-systems))
2571 (synopsis "Tools for controlling the network subsystem in Linux")
2573 "This package includes the important tools for controlling the network
2574 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2575 route. Additionally, this package contains utilities relating to particular
2576 network hardware types (plipconfig, slattach) and advanced aspects of IP
2577 configuration (iptunnel, ipmaddr).")
2578 (license license:gpl2+))))
2580 (define-public libcap-2.31
2587 "mirror://kernel.org/linux/libs/security/linux-privs/"
2588 "libcap2/libcap-" version ".tar.xz"))
2591 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2592 (build-system gnu-build-system)
2593 (arguments '(#:phases
2594 (modify-phases %standard-phases
2596 ;; Add $libdir to the RUNPATH of executables.
2598 (substitute* "Make.Rules"
2600 (string-append "LDFLAGS := -Wl,-rpath="
2603 #:test-target "test"
2604 #:make-flags (list "lib=lib"
2605 (string-append "prefix="
2606 (assoc-ref %outputs "out"))
2607 "RAISE_SETFCAP=no")))
2608 (native-inputs `(("perl" ,perl)))
2609 (supported-systems (delete "i586-gnu" %supported-systems))
2610 (home-page "https://sites.google.com/site/fullycapable/")
2611 (synopsis "Library for working with POSIX capabilities")
2613 "Libcap2 provides a programming interface to POSIX capabilities on
2614 Linux-based operating systems.")
2616 ;; License is BSD-3 or GPLv2, at the user's choice.
2617 (license license:gpl2)))
2619 ;; libcap 2.31 has problems with newer kernels, so provide this newer variant.
2620 ;; Keep the old libcap around to avoid rebuilding 'coreutils' and 'avahi'.
2621 ;; To be merged with libcap on the next rebuild cycle.
2622 (define-public libcap
2624 (inherit libcap-2.31)
2629 "mirror://kernel.org/linux/libs/security/linux-privs/"
2630 "libcap2/libcap-" version ".tar.xz"))
2633 "11ijmi7jik9iw6pdszc6bylhggghr8cza03bcrbhbqf0cpvkjrnn"))))
2635 (substitute-keyword-arguments (package-arguments libcap-2.31)
2637 `(modify-phases ,phases
2640 ;; Add $libdir to the RUNPATH of executables.
2641 (substitute* "Make.Rules"
2642 (("LDFLAGS \\?= #-g")
2643 (string-append "LDFLAGS ?= -Wl,-rpath="
2647 (define-deprecated libcap/next libcap)
2648 (export libcap/next)
2650 (define-public bridge-utils
2652 (name "bridge-utils")
2657 (uri (string-append "mirror://kernel.org/linux/kernel/people/shemminger/"
2658 "bridge-utils/bridge-utils-" version ".tar.xz"))
2660 (base32 "0zlrigizac2nfwgvksm92v4wafrpgxlbci3gwimc795ib7k8g6ck"))))
2661 (build-system gnu-build-system)
2663 ;; The tarball lacks all the generated files.
2664 (native-inputs `(("autoconf" ,autoconf)
2665 ("automake" ,automake)))
2668 (modify-phases %standard-phases
2669 (add-before 'bootstrap 'patch-stuff
2671 ;; Fix "field ‘ip6’ has incomplete type" errors.
2672 (substitute* "libbridge/libbridge.h"
2673 (("#include <linux/if_bridge.h>")
2674 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2676 ;; Ensure that the entire build fails if one of the
2677 ;; sub-Makefiles fails.
2678 (substitute* "Makefile.in"
2679 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2680 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2683 #:tests? #f)) ; no 'check' target
2685 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2686 (synopsis "Manipulate Ethernet bridges")
2688 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2689 to connect two Ethernet segments together in a protocol independent way.
2690 Packets are forwarded based on Ethernet address, rather than IP address (like
2691 a router). Since forwarding is done at Layer 2, all protocols can go
2692 transparently through a bridge.")
2693 (license license:gpl2+)))
2695 (define-public libnl
2702 "https://github.com/thom311/libnl/releases/download/"
2703 "libnl" (string-join (string-split version #\.) "_")
2704 "/libnl-" version ".tar.gz"))
2707 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2708 (build-system gnu-build-system)
2712 ("pkg-config" ,pkg-config)
2718 "https://github.com/thom311/libnl/releases/download/libnl"
2719 (string-join (string-split version #\.) "_")
2720 "/libnl-doc-" version ".tar.gz"))
2722 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2723 (outputs `("out" "doc"))
2726 (modify-phases %standard-phases
2727 (add-after 'install 'install-doc
2728 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2729 (let ((dest (string-append (assoc-ref outputs "doc")
2730 "/share/doc/libnl")))
2732 (invoke "tar" "xf" (assoc-ref
2733 (or native-inputs inputs)
2735 "--strip-components=1" "-C" dest)))))))
2736 (home-page "https://www.infradead.org/~tgr/libnl/")
2737 (synopsis "NetLink protocol library suite")
2739 "The libnl suite is a collection of libraries providing APIs to netlink
2740 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2741 between the kernel and user space processes. It was designed to be a more
2742 flexible successor to ioctl to provide mainly networking related kernel
2743 configuration and monitoring interfaces.")
2745 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2746 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2747 (license license:gpl2)))
2749 ;; libnl python extensions used to be outputs of libnl. However, as
2750 ;; cross-compiling python extensions is currently broken, create separate
2751 ;; packages for libnl python extensions.
2752 (define (libnl-python-package python)
2753 (let ((name (string-append "libnl-" python)))
2758 ((string=? python "python2")
2759 `(("python-2" ,python-2)))
2760 ((string=? python "python3")
2761 `(("python-3" ,python-3))))))
2762 (propagated-inputs `(("libnl" ,libnl)))
2765 `(#:modules ((guix build gnu-build-system)
2769 (modify-phases %standard-phases
2771 (lambda* (#:key inputs outputs #:allow-other-keys)
2772 (define (python-inst python)
2773 (invoke python "setup.py" "build")
2774 (invoke python "setup.py" "install"
2775 (string-append "--prefix="
2776 (assoc-ref %outputs "out")))
2777 (invoke python "setup.py" "clean"))
2778 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2779 (assoc-ref inputs "libnl")))
2780 (with-directory-excursion "./python" (python-inst ,python))
2783 (define-public libnl-python2 (libnl-python-package "python2"))
2784 (define-public libnl-python3 (libnl-python-package "python3"))
2793 "mirror://kernel.org/software/network/iw/iw-"
2797 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2798 (build-system gnu-build-system)
2799 (native-inputs `(("pkg-config" ,pkg-config)))
2800 (inputs `(("libnl" ,libnl)))
2803 (let* ((target ,(%current-target-system))
2804 (pkg-config (if target
2805 (string-append target "-pkg-config")
2808 ,(string-append "CC=" (cc-for-target))
2809 (string-append "PKG_CONFIG="
2810 (assoc-ref %build-inputs "pkg-config")
2812 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2813 #:phases (modify-phases %standard-phases (delete 'configure))))
2814 (home-page "https://wireless.wiki.kernel.org/")
2815 (synopsis "Tool for configuring wireless devices")
2817 "iw is a new nl80211 based CLI configuration utility for wireless
2818 devices. It replaces @code{iwconfig}, which is deprecated.")
2819 (license license:isc)))
2821 (define-public powertop
2829 (url "https://github.com/fenrus75/powertop")
2830 (commit (string-append "v" version))))
2831 (file-name (git-file-name name version))
2833 (base32 "1zkr2y5nb1nr22nq8a3zli87iyfasfq6489p7h1k428pv8k45w4f"))))
2834 (build-system gnu-build-system)
2837 (list "LDFLAGS=-pthread")
2839 (modify-phases %standard-phases
2840 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2841 ;; allow calibrating the network interface in Guix System.
2842 (add-after 'unpack 'patch-absolute-file-names
2843 (lambda* (#:key inputs #:allow-other-keys)
2844 (let ((kmod (assoc-ref inputs "kmod")))
2845 (substitute* (find-files "src" "\\.cpp$")
2846 ;; Give the right 'modprobe' file name so that essential
2847 ;; modules such as msr.ko can be loaded.
2848 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2849 ;; These programs are only needed to calibrate, so using
2850 ;; relative file names avoids adding extra inputs. When they
2851 ;; are missing powertop gracefully handles it.
2852 (("/usr/bin/hcitool") "hcitool")
2853 (("/usr/bin/xset") "xset")
2854 (("/usr/sbin/hciconfig") "hciconfig"))
2859 ("ncurses" ,ncurses)
2860 ("pciutils" ,pciutils)
2863 `(("autoconf" ,autoconf)
2864 ("automake" ,automake)
2865 ("gettext" ,gettext-minimal)
2866 ("libtool" ,libtool)
2867 ("pkg-config" ,pkg-config)))
2868 (home-page "https://01.org/powertop/")
2869 (synopsis "Analyze power consumption on Intel-based laptops")
2871 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2872 power management. In addition to being a diagnostic tool, PowerTOP also has
2873 an interactive mode where the user can experiment various power management
2874 settings for cases where the operating system has not enabled these
2876 (license license:gpl2)))
2878 (define-public aumix
2885 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2886 version ".tar.bz2"))
2889 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2890 (build-system gnu-build-system)
2891 (inputs `(("ncurses" ,ncurses)))
2892 (home-page "http://www.jpj.net/~trevor/aumix.html")
2893 (synopsis "Audio mixer for X and the console")
2895 "Aumix adjusts an audio mixer from X, the console, a terminal,
2896 the command line or a script.")
2897 (license license:gpl2+)))
2899 (define-public iotop
2906 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2909 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2910 (build-system python-build-system)
2913 (modify-phases %standard-phases
2914 (add-after 'unpack 'fix-build-with-python3
2916 (substitute* "setup.py"
2917 (("itervalues") "values"))
2919 ;; There are currently no checks in the package.
2921 (native-inputs `(("python" ,python)))
2922 (home-page "http://guichaz.free.fr/iotop/")
2924 "Displays the IO activity of running processes")
2926 "Iotop is a Python program with a top like user interface to show the
2927 processes currently causing I/O.")
2928 (license license:gpl2+)))
2936 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2937 "download/fuse-" version
2938 "/fuse-" version ".tar.gz"))
2941 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2942 (patches (search-patches "fuse-overlapping-headers.patch"))))
2943 (build-system gnu-build-system)
2944 (inputs `(("util-linux" ,util-linux)))
2946 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2947 (assoc-ref %outputs "out")
2949 (string-append "INIT_D_PATH="
2950 (assoc-ref %outputs "out")
2953 ;; The rule makes /dev/fuse 666.
2954 (string-append "UDEV_RULES_PATH="
2955 (assoc-ref %outputs "out")
2956 "/lib/udev/rules.d"))
2958 (modify-phases %standard-phases
2959 (add-before 'build 'set-file-names
2960 (lambda* (#:key inputs #:allow-other-keys)
2961 ;; libfuse calls out to mount(8) and umount(8). Make sure
2962 ;; it refers to the right ones.
2963 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2964 (("/bin/(u?)mount" _ maybe-u)
2965 (string-append (assoc-ref inputs "util-linux")
2966 "/bin/" maybe-u "mount")))
2967 (substitute* '("util/mount.fuse.c")
2971 ;; This hack leads libfuse to search for 'fusermount' in
2972 ;; $PATH, where it may find a setuid-root binary, instead of
2973 ;; trying solely $out/sbin/fusermount and failing because
2975 (substitute* "lib/Makefile"
2976 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2977 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2979 (supported-systems (delete "i586-gnu" %supported-systems))
2980 (home-page "https://github.com/libfuse/libfuse")
2981 (synopsis "Support file systems implemented in user space")
2983 "As a consequence of its monolithic design, file system code for Linux
2984 normally goes into the kernel itself---which is not only a robustness issue,
2985 but also an impediment to system extensibility. FUSE, for \"file systems in
2986 user space\", is a kernel module and user-space library that tries to address
2987 part of this problem by allowing users to run file system implementations as
2988 user-space processes.")
2989 (license (list license:lgpl2.1 ;library
2990 license:gpl2+)))) ;command-line utilities
2992 (define-public unionfs-fuse
2994 (name "unionfs-fuse")
2999 (url "https://github.com/rpodgorny/unionfs-fuse")
3000 (commit (string-append "v" version))))
3001 (file-name (git-file-name name version))
3004 "0bwx70x834qgqh53vqp18bhbxbsny80hz922rbgj8k9wj7cbfilm"))))
3005 (build-system cmake-build-system)
3007 `(("python" ,python)))
3008 (inputs `(("fuse" ,fuse)))
3010 ;; The tests were never actually run ("collected 0 items"), but in recent
3011 ;; versions of pytest that causes an error.
3013 (home-page "https://github.com/rpodgorny/unionfs-fuse")
3014 (synopsis "User-space union file system")
3016 "UnionFS-FUSE is a flexible union file system implementation in user
3017 space, using the FUSE library. Mounting a union file system allows you to
3018 \"aggregate\" the contents of several directories into a single mount point.
3019 UnionFS-FUSE additionally supports copy-on-write.")
3020 (license license:bsd-3)))
3023 (package (inherit fuse)
3024 (name "fuse-static")
3025 (source (origin (inherit (package-source fuse))
3026 (modules '((guix build utils)))
3029 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
3030 ;; updated. Change calls to 'mtab_needs_update' to 0 so
3031 ;; that it doesn't do that, allowing us to remove the
3032 ;; dependency on util-linux (something that is useful in
3034 (substitute* '("lib/mount_util.c"
3035 "util/mount_util.c")
3036 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
3042 (define-public unionfs-fuse/static
3043 (package (inherit unionfs-fuse)
3044 (synopsis "User-space union file system (statically linked)")
3045 (name (string-append (package-name unionfs-fuse) "-static"))
3046 (source (origin (inherit (package-source unionfs-fuse))
3047 (modules '((guix build utils)))
3050 ;; Add -ldl to the libraries, because libfuse.a needs that.
3051 (substitute* "src/CMakeLists.txt"
3052 (("target_link_libraries(.*)\\)" _ libs)
3053 (string-append "target_link_libraries"
3058 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
3060 (modify-phases %standard-phases
3061 (add-after 'install 'post-install
3062 (lambda* (#:key outputs #:allow-other-keys)
3063 (let* ((out (assoc-ref outputs "out"))
3064 (exe (string-append out "/bin/unionfs")))
3065 ;; By default, 'unionfs' keeps references to
3066 ;; $glibc/share/locale and similar stuff. Remove them.
3067 (remove-store-references exe)
3069 ;; 'unionfsctl' has references to glibc as well. Since
3070 ;; we don't need it, remove it.
3071 (delete-file (string-append out "/bin/unionfsctl"))
3073 (inputs `(("fuse" ,fuse-static)))))
3075 (define-public sshfs
3081 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
3082 "download/sshfs-" version "/sshfs-" version
3086 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
3087 (build-system gnu-build-system)
3092 `(("pkg-config" ,pkg-config)))
3093 (home-page "https://github.com/libfuse/sshfs")
3094 (synopsis "Mount remote file systems over SSH")
3096 "This is a file system client based on the SSH File Transfer Protocol.
3097 Since most SSH servers already support this protocol it is very easy to set
3098 up: on the server side there's nothing to do; on the client side mounting the
3099 file system is as easy as logging into the server with an SSH client.")
3100 (license license:gpl2+)))
3102 (define-public sshfs-fuse
3103 (package (inherit sshfs)
3105 (properties `((superseded . ,sshfs)))))
3107 (define-public archivemount
3109 (name "archivemount")
3114 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
3115 "archivemount-" version ".tar.gz"))
3117 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
3118 (build-system gnu-build-system)
3119 (inputs `(("fuse" ,fuse)
3120 ("libarchive" ,libarchive)))
3121 (native-inputs `(("pkg-config" ,pkg-config)))
3122 (home-page "https://www.cybernoia.de/software/archivemount.html")
3123 (synopsis "Tool for mounting archive files with FUSE")
3124 (description "archivemount is a FUSE-based file system for Unix variants,
3125 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
3126 mount point where it can be read from or written to as with any other file
3127 system. This makes accessing the contents of the archive, which may be
3128 compressed, transparent to other programs, without decompressing them.")
3129 (license license:lgpl2.0+)))
3131 (define-public numactl
3138 "https://github.com/numactl/numactl/releases/download/v"
3139 version "/numactl-" version ".tar.gz"))
3142 "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2"))))
3143 (build-system gnu-build-system)
3145 '(;; There's a 'test' target, but it requires NUMA support in the kernel
3146 ;; to run, which we can't assume to have.
3149 ;; NUMA is apparently not supported on armhf, see
3150 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
3151 (supported-systems (delete "armhf-linux" %supported-systems))
3152 (home-page "https://github.com/numactl/numactl")
3153 (synopsis "Tools for non-uniform memory access (NUMA) machines")
3155 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
3156 memory is not all in one place. The @command{numactl} program allows you to
3157 run your application program on specific CPUs and memory nodes. It does this
3158 by supplying a NUMA memory policy to the operating system before running your
3161 The package contains other commands, such as @command{numastat},
3162 @command{memhog}, and @command{numademo} which provides a quick overview of
3163 NUMA performance on your system.")
3164 (license (list license:gpl2 ;programs
3165 license:lgpl2.1)))) ;library
3167 (define-public kbd-neo
3174 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
3175 version "/linux/console/neo.map"))
3176 (file-name (string-append name "-" version ".map"))
3179 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
3180 (build-system trivial-build-system)
3182 `(#:modules ((guix build utils))
3184 (use-modules (guix build utils))
3185 (let ((out (string-append %output "/share/keymaps"))
3186 (source (assoc-ref %build-inputs "source")))
3188 (copy-file source (string-append out "/neo.map"))
3190 (home-page "https://neo-layout.org")
3191 (synopsis "Neo2 console layout")
3193 "Kbd-neo provides the Neo2 keyboard layout for use with
3194 @command{loadkeys(1)} from @code{kbd(4)}.")
3195 ;; The file is located in an svn directory, the entire content of
3196 ;; the directory is licensed as GPL3.
3197 (license license:gpl3+)))
3205 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
3209 "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m"))
3210 (modules '((guix build utils)))
3213 (substitute* '("src/unicode_start" "src/unicode_stop")
3214 ;; Assume the Coreutils are in $PATH.
3217 (build-system gnu-build-system)
3220 (modify-phases %standard-phases
3221 (add-before 'build 'pre-build
3222 (lambda* (#:key inputs #:allow-other-keys)
3223 (let ((bzip2 (assoc-ref inputs "bzip2"))
3224 (gzip (assoc-ref inputs "gzip"))
3225 (xz (assoc-ref inputs "xz"))
3226 (zstd (assoc-ref inputs "zstd")))
3227 (substitute* "src/libkbdfile/kbdfile.c"
3228 (("bzip2") (string-append bzip2 "/bin/bzip2"))
3229 (("gzip") (string-append gzip "/bin/gzip"))
3230 (("xz -d") (string-append xz "/bin/xz -d"))
3231 (("zstd") (string-append zstd "/bin/zstd"))))))
3232 (add-after 'install 'post-install
3233 (lambda* (#:key outputs #:allow-other-keys)
3234 ;; Make sure these programs find their comrades.
3235 (let* ((out (assoc-ref outputs "out"))
3236 (bin (string-append out "/bin")))
3237 (for-each (lambda (prog)
3238 (wrap-program (string-append bin "/" prog)
3239 `("PATH" ":" prefix (,bin))))
3240 '("unicode_start" "unicode_stop"))))))))
3242 `(("autoconf" ,autoconf)
3243 ("pkg-config" ,pkg-config)))
3250 (native-search-paths
3251 (list (search-path-specification
3252 (variable "LOADKEYS_KEYMAP_PATH")
3253 ;; Append ‘/**’ to recursively search all directories. One can then
3254 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
3255 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
3256 (files (list "share/keymaps/**")))))
3257 (home-page "http://kbd-project.org/")
3258 (synopsis "Linux keyboard utilities and keyboard maps")
3260 "This package contains keytable files and keyboard utilities compatible
3261 for systems using the Linux kernel. This includes commands such as
3262 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3263 (license license:gpl2+)))
3265 (define-public loadkeys-static
3268 (name "loadkeys-static")
3270 (substitute-keyword-arguments (package-arguments kbd)
3271 ((#:configure-flags flags ''())
3272 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
3273 "--disable-vlock" ;so we don't need libpam
3274 "--disable-libkeymap")
3276 ((#:make-flags flags ''())
3277 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
3278 ((#:phases phases '%standard-phases)
3279 `(modify-phases ,phases
3281 (lambda* (#:key outputs #:allow-other-keys)
3282 (let ((out (assoc-ref outputs "out")))
3283 ;; The binary keeps references to gzip, among other things,
3284 ;; which we don't need in the initrd, so strip references.
3285 (remove-store-references "src/loadkeys")
3287 (install-file "src/loadkeys"
3288 (string-append out "/bin")))))
3289 (delete 'post-install)))
3290 ((#:strip-flags _ '())
3292 ((#:allowed-references _ '())
3295 (synopsis "Statically-linked @command{loadkeys} program")
3297 ;; This package is meant to be used internally in the initrd so don't
3299 (properties '((hidden? . #t)))))
3301 (define-public inotify-tools
3303 (name "inotify-tools")
3304 (version "3.20.11.0")
3308 (url "https://github.com/rvoicilas/inotify-tools")
3310 (file-name (git-file-name name version))
3313 "1m8avqccrhm38krlhp88a7v949f3hrzx060bbrr5dp5qw2nmw9j2"))))
3314 (build-system gnu-build-system)
3316 `(("autoconf" ,autoconf)
3317 ("automake" ,automake)
3318 ("libtool" ,libtool)))
3321 (list "--disable-static")))
3322 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3323 (synopsis "Monitor file accesses")
3325 "The inotify-tools packages provides a C library and command-line tools
3326 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3327 (license license:gpl2+)))
3336 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3337 "kmod-" version ".tar.xz"))
3340 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3341 (patches (search-patches "kmod-module-directory.patch"))))
3342 (build-system gnu-build-system)
3344 `(("pkg-config" ,pkg-config)))
3349 `(#:configure-flags '("--with-xz" "--with-zlib"
3350 "--disable-test-modules")
3352 (modify-phases %standard-phases
3353 (add-after 'unpack 'disable-tests
3355 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3356 (substitute* "Makefile.in"
3357 (("testsuite/test-modprobe") "")
3358 (("testsuite/test-depmod") "")
3359 (("testsuite/test-blacklist") ""))
3361 (add-after 'install 'install-modprobe&co
3362 (lambda* (#:key outputs #:allow-other-keys)
3363 (let* ((out (assoc-ref outputs "out"))
3364 (bin (string-append out "/bin")))
3365 (for-each (lambda (tool)
3367 (string-append bin "/" tool)))
3368 '("insmod" "rmmod" "lsmod" "modprobe"
3369 "modinfo" "depmod"))
3371 (supported-systems (delete "i586-gnu" %supported-systems))
3372 (home-page "https://www.kernel.org/")
3373 (synopsis "Kernel module tools")
3374 (description "Kmod is a set of tools to handle common tasks with Linux
3375 kernel modules like insert, remove, list, check properties, resolve
3376 dependencies and aliases.
3378 These tools are designed on top of libkmod, a library that is shipped with
3379 kmod. The aim is to be compatible with tools, configurations and indices
3380 from the module-init-tools project.")
3381 (license license:gpl2+))) ; library under lgpl2.1+
3383 (define-public earlyoom
3390 (url "https://github.com/rfjakob/earlyoom")
3391 (commit (string-append "v" version))))
3392 (file-name (git-file-name name version))
3395 "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))))
3396 (build-system gnu-build-system)
3399 (modify-phases %standard-phases
3400 (delete 'configure) ; no configure script
3401 (add-before 'check 'set-go-HOME
3403 (setenv "HOME" (getcwd))
3405 (add-before 'check 'disable-failing-test
3407 ;; This test relies on writing to /proc/%d/oom_score_adj.
3408 (substitute* "testsuite_cli_test.go"
3410 (string-append "skipped" match)))
3412 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3413 (list ,(string-append "CC=" (cc-for-target))
3414 (string-append "VERSION=v" ,version)
3415 (string-append "PREFIX=" prefix)
3416 (string-append "SYSCONFDIR=" prefix "/etc")))
3417 #:test-target "test"))
3418 (native-inputs `(("go" ,go) ;for the test suite
3419 ("pandoc" ,pandoc))) ;to generate the manpage
3420 (home-page "https://github.com/rfjakob/earlyoom")
3421 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3422 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3423 runs in user space and provides a more responsive and configurable alternative
3424 to the in-kernel OOM killer.")
3425 (license license:expat)))
3427 (define-public eudev
3428 ;; The post-systemd fork, maintained by Gentoo.
3434 (uri (git-reference (url "https://github.com/gentoo/eudev")
3435 (commit (string-append "v" version))))
3436 (file-name (git-file-name name version))
3439 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3440 (patches (search-patches "eudev-rules-directory.patch"))))
3441 (build-system gnu-build-system)
3444 (modify-phases %standard-phases
3445 (add-after 'unpack 'make-source-writable
3447 ;; XXX: Git checkouts are read-only, but this package needs to
3448 ;; modify some of its files.
3449 (for-each make-file-writable (find-files "."))
3451 (add-before 'bootstrap 'patch-file-names
3452 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3453 (substitute* "man/make.sh"
3454 (("/usr/bin/xsltproc")
3455 (string-append (assoc-ref
3456 (or native-inputs inputs) "xsltproc")
3459 (add-before 'configure 'patch-bindir-in-btrfs-rules
3460 (lambda* (#:key outputs #:allow-other-keys)
3461 ;; The "@bindir@" substitution incorrectly expands to a literal
3462 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3464 (let ((out (assoc-ref outputs "out")))
3465 (substitute* "rules/64-btrfs.rules.in"
3467 (string-append out "/bin")))
3469 (add-after 'install 'move-static-library
3470 (lambda* (#:key outputs #:allow-other-keys)
3471 (let* ((out (assoc-ref outputs "out"))
3472 (static (assoc-ref outputs "static"))
3473 (source (string-append out "/lib/libudev.a"))
3474 (target (string-append static "/lib/libudev.a")))
3475 (mkdir-p (dirname target))
3476 (link source target)
3477 (delete-file source)
3478 ;; Remove reference to the static library from the .la file
3479 ;; such that Libtool looks for it in the usual places.
3480 (substitute* (string-append out "/lib/libudev.la")
3482 "old_library=''\n"))
3484 (add-after 'install 'build-hwdb
3485 (lambda* (#:key outputs #:allow-other-keys)
3486 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3487 ;; similar tools to display product names.
3489 ;; XXX: This can't be done when cross-compiling. Find another way
3490 ;; to generate hwdb.bin for cross-built systems.
3491 (let ((out (assoc-ref outputs "out")))
3492 ,@(if (%current-target-system)
3494 '((invoke (string-append out "/bin/udevadm")
3495 "hwdb" "--update")))))))
3496 #:configure-flags (list "--enable-manpages")))
3498 `(("autoconf" ,autoconf)
3499 ("automake" ,automake)
3501 ("libtool" ,libtool)
3502 ("pkg-config" ,pkg-config)
3505 ("python" ,python-wrapper)
3506 ;; For documentation.
3507 ("docbook-xml" ,docbook-xml-4.2)
3508 ("docbook-xsl" ,docbook-xsl)
3509 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3510 ("xsltproc" ,libxslt)))
3512 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3513 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3514 ;; which contains the rules to do that.
3515 `(("util-linux" ,util-linux "lib") ;for blkid
3517 (outputs '("out" "static"))
3518 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3519 (synopsis "Userspace device management")
3520 (description "Udev is a daemon which dynamically creates and removes
3521 device nodes from /dev/, handles hotplug events and loads drivers at boot
3523 (license license:gpl2+)))
3525 (define-public python-evdev
3527 (name "python-evdev")
3532 (uri (pypi-uri "evdev" version))
3534 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3535 (build-system python-build-system)
3537 `(("kernel-headers" ,linux-libre-headers)))
3539 `(#:tests? #f ;no rule for tests
3541 (modify-phases %standard-phases
3542 (add-before 'build 'fix-hard-coded-directory
3543 (lambda* (#:key inputs #:allow-other-keys)
3544 (substitute* "setup.py"
3545 (("/usr/include/linux")
3547 (assoc-ref inputs "kernel-headers") "/include/linux")))
3549 (home-page "https://github.com/gvalkov/python-evdev")
3550 (synopsis "Bindings to the Linux input handling subsystem")
3552 "Python-evdev provides bindings to the generic input event interface in
3553 Linux. The @code{evdev} interface serves the purpose of passing events
3554 generated in the kernel directly to userspace through character devices that
3555 are typically located in @file{/dev/input/}.
3557 This package also comes with bindings to @code{uinput}, the userspace input
3558 subsystem. @code{uinput} allows userspace programs to create and handle input
3559 devices that can inject events directly into the input subsystem.")
3560 (license license:bsd-3)))
3562 (define-public interception-tools
3564 (name "interception-tools")
3566 (home-page "https://gitlab.com/interception/linux/tools")
3571 (commit (string-append "v" version))))
3572 (file-name (git-file-name name version))
3575 "121jy40ynkbzlqnx7g0dqwvkb7dm2ahcy6vwrz6ylsyd0jmi6s5a"))))
3576 (build-system cmake-build-system)
3579 ("libevdev" ,libevdev)
3581 ("yaml-cpp" ,yaml-cpp)))
3584 (modify-phases %standard-phases
3585 (add-after 'unpack 'fix-libevdev-path
3586 (lambda* (#:key inputs #:allow-other-keys)
3587 (let ((libevdev (assoc-ref inputs "libevdev")))
3588 (substitute* "CMakeLists.txt"
3589 (("/usr/include/libevdev-1.0")
3590 (string-append libevdev "/include/libevdev-1.0")))
3592 ;; No tests are included.
3594 (synopsis "Utilities for operating on input events of evdev devices")
3596 "Interception Tools provides a composable infrastructure on top of
3597 @code{libudev} and @code{libevdev}. The following utilities are provided:
3600 @item @command{udevmon} --- monitor input devices for launching tasks
3601 @item @command{intercept} --- redirect device input events to stdout
3602 @item @command{uinput} --- redirect device input events from stding to virtual device
3603 @item @command{mux} --- mux streams of input events
3605 ;; Dual-licensed under GPLv3+ or "something else" on request, per
3607 (license license:gpl3+)))
3609 (define-public interception-dual-function-keys
3611 (name "interception-dual-function-keys")
3613 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
3619 (file-name (git-file-name name version))
3622 "1gvhkmwzl5fyyc7k8rc4rf2b9mzh05wa8wcybf9hz2x1mqkc7lmz"))))
3623 (build-system gnu-build-system)
3625 `(("libevdev" ,libevdev)
3626 ("yaml-cpp" ,yaml-cpp)))
3628 `(#:make-flags (list "CC=gcc" "CXX=g++"
3629 (string-append "PREFIX=" (assoc-ref %outputs "out")))
3631 (modify-phases %standard-phases
3632 (add-after 'unpack 'fix-libevdev-path
3633 (lambda* (#:key inputs #:allow-other-keys)
3634 (let ((libevdev (assoc-ref inputs "libevdev")))
3635 (substitute* "config.mk"
3636 (("/usr/include/libevdev-1.0")
3637 (string-append libevdev "/include/libevdev-1.0")))
3639 ;; No configure script
3641 ;; No target 'check'
3643 (synopsis "Tap for one key, hold for another")
3645 "Dual Function Keys is a plugin for @code{interception-tools} that allows
3646 one to send arbitrary keycodes when a given key is tapped or held.")
3647 (license license:expat)))
3655 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
3657 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3661 "1m4xpda8vbyd89ca0w8nacvnl4j34yzsa625gn990fb5sh84ab44"))
3662 (modules '((guix build utils)))
3665 (use-modules (guix build utils))
3667 ;; Honor sysconfdir.
3668 (substitute* "make.tmpl.in"
3670 "confdir = @sysconfdir@\n")
3671 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3672 "DEFAULT_SYS_DIR = @sysconfdir@"))
3674 (patches (search-patches "lvm2-static-link.patch"))))
3675 (build-system gnu-build-system)
3677 `(("pkg-config" ,pkg-config)
3678 ("procps" ,procps))) ;tests use 'pgrep'
3680 `(("libaio" ,libaio)
3684 (modify-phases %standard-phases
3685 (add-after 'configure 'set-makefile-shell
3687 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3689 (setenv "SHELL" (which "sh"))
3691 ;; Replace /bin/sh with the right file name.
3692 (patch-makefile-SHELL "make.tmpl")
3695 #:configure-flags (list (string-append "--sysconfdir="
3696 (assoc-ref %outputs "out")
3698 "--enable-udev_sync"
3699 "--enable-udev_rules"
3700 "--enable-pkgconfig"
3702 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3704 ;; Make sure programs such as 'dmsetup' can
3705 ;; find libdevmapper.so.
3706 (string-append "LDFLAGS=-Wl,-rpath="
3707 (assoc-ref %outputs "out")
3709 (assoc-ref %outputs "out")
3710 "/lib/device-mapper")
3711 ;; This is needed when cross-compiling.
3712 ,@(if (%current-target-system)
3713 '("ac_cv_func_malloc_0_nonnull=yes"
3714 "ac_cv_func_realloc_0_nonnull=yes")
3717 ;; The tests use 'mknod', which requires root access.
3719 (supported-systems (delete "i586-gnu" %supported-systems))
3720 (home-page "https://sourceware.org/lvm2/")
3721 (synopsis "Logical volume management for Linux")
3723 "LVM2 is the logical volume management tool set for Linux-based systems.
3724 This package includes the user-space libraries and tools, including the device
3725 mapper. Kernel components are part of Linux-libre.")
3727 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3728 ;; Command-line tools are GPLv2.
3729 (license (list license:gpl2 license:lgpl2.1))))
3731 (define-public lvm2-static
3734 (name "lvm2-static")
3736 ;; Propagate udev because libdevmapper.a depends on libudev.
3737 (propagated-inputs `(("udev:static" ,eudev "static")))
3740 (substitute-keyword-arguments (package-arguments lvm2)
3741 ((#:configure-flags flags '())
3742 ;; LVM2 doesn't use Libtool, hence the custom option.
3743 `(append '("--enable-static_link")
3744 ;; Building dmeventd statically is complicated due to a
3745 ;; requirement on libdevmapper.a, which is being phased out
3746 ;; in favor of libdevice-mapper.a, which in turn is is not
3747 ;; easily made available at dmeventd build time. Just ignore
3748 ;; it until the situation improves.
3749 (delete "--enable-dmeventd" ,flags)))
3751 `(modify-phases ,phases
3752 (add-before 'configure 'adjust-Makefile
3754 ;; These fixes are related to the upstream libdm->device_mapper
3755 ;; migration and will hopefully be fixed upstream in due time.
3756 (substitute* "tools/Makefile.in"
3757 ;; This variable is empty in a static configuration and causes
3758 ;; an erroneous GCC command line.
3759 (("-L\\$\\(interfacebuilddir\\)") "")
3760 ;; Remove obsolete reference to libdevmapper.a.
3761 (("-ldevmapper") ""))
3763 (synopsis "Logical volume management for Linux (statically linked)")))
3765 (define-public thin-provisioning-tools
3767 (name "thin-provisioning-tools")
3773 (url "https://github.com/jthornber/thin-provisioning-tools")
3774 (commit (string-append "v" version))))
3775 (file-name (git-file-name name version))
3777 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
3778 (build-system gnu-build-system)
3780 ;; Doesn't build with --enable-testing due to a function name collision
3781 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
3784 `(("automake" ,automake)
3785 ("autoreconf" ,autoconf)))
3789 ("libaio" ,libaio)))
3790 (synopsis "Tools for manipulating the metadata of device-mapper targets")
3791 (description "A suite of tools for manipulating the metadata of the
3792 dm-thin, dm-cache and dm-era device-mapper targets.")
3793 (home-page "https://github.com/jthornber/thin-provisioning-tools")
3794 (license license:gpl3+)))
3796 (define-public wireless-tools
3798 (name "wireless-tools")
3802 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3806 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3809 ;; Remove the older header files that are not free software.
3810 (for-each (lambda (n)
3811 (delete-file (format #f "wireless.~a.h" n)))
3812 '(10 11 12 13 14 15 16 17 18 19 20))
3814 (build-system gnu-build-system)
3817 (list (string-append "PREFIX=" %output)
3818 (string-append "INSTALL_MAN=" %output "/share/man")
3819 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3822 (modify-phases %standard-phases
3824 (lambda* (#:key target #:allow-other-keys)
3825 (when ,(%current-target-system)
3826 ;; Cross-compilation: use the cross tools.
3827 (substitute* (find-files "." "Makefile")
3829 (string-append "CC = " target "-gcc\n"))
3831 (string-append "AR = " target "-ar\n"))
3833 (string-append "RANLIB = " target "-ranlib\n"))))
3836 (synopsis "Tools for manipulating Linux Wireless Extensions")
3837 (description "Wireless Tools are used to manipulate the now-deprecated
3838 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3839 Extension was an interface allowing you to set Wireless LAN specific
3840 parameters and get the specific stats. It is deprecated in favor the nl80211
3842 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3843 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3844 ;; other files are distributed under gpl2.
3845 (license (list license:gpl2 license:lgpl2.1+))))
3853 (uri (string-append "mirror://kernel.org/software/network/crda/"
3854 "crda-" version ".tar.xz"))
3857 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3858 (patches (search-patches "crda-optional-gcrypt.patch"))))
3859 (build-system gnu-build-system)
3861 `(#:phases (modify-phases %standard-phases
3863 (add-after 'unpack 'gzip-determinism
3865 (substitute* "Makefile"
3866 (("gzip") "gzip --no-name"))
3868 ,@(if (%current-target-system)
3870 'unpack 'fix-pkg-config
3871 (lambda* (#:key target #:allow-other-keys)
3875 (string-append target "-pkg-config")))
3879 'build 'no-werror-no-ldconfig
3881 (substitute* "Makefile"
3883 (("ldconfig") "true"))
3886 'build 'set-regulator-db-file-name
3887 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3888 ;; Tell CRDA where to find our database.
3889 (let ((regdb (assoc-ref (or native-inputs inputs)
3891 (substitute* "crda.c"
3892 (("\"/lib/crda/regulatory.bin\"")
3893 (string-append "\"" regdb
3894 "/lib/crda/regulatory.bin\"")))
3896 #:test-target "verify"
3897 #:make-flags (let ((out (assoc-ref %outputs "out"))
3898 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3900 (string-append "CC=" ,(cc-for-target))
3903 ;; Disable signature-checking on 'regulatory.bin'.
3904 ;; The reason is that this simplifies maintenance
3905 ;; on our side (no need to manage a distro key
3906 ;; pair), and we can guarantee integrity of
3907 ;; 'regulatory.bin' by other means anyway, such as
3908 ;; 'guix gc --verify'. See
3909 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3913 (string-append "PREFIX=" out)
3914 (string-append "SBINDIR=" out "/sbin/")
3915 (string-append "UDEV_RULE_DIR="
3916 out "/lib/udev/rules.d")
3917 (string-append "LDFLAGS=-Wl,-rpath="
3919 (string-append "REG_BIN=" regdb
3920 "/lib/crda/regulatory.bin")
3922 (native-inputs `(("pkg-config" ,pkg-config)
3923 ("wireless-regdb" ,wireless-regdb)))
3924 (inputs `(("libnl" ,libnl)))
3926 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3927 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3929 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3930 communication between the kernel Linux and user space for regulatory
3932 (license license:copyleft-next)))
3934 (define-public wireless-regdb
3936 (name "wireless-regdb")
3937 (version "2020.11.20")
3941 "mirror://kernel.org/software/network/wireless-regdb/"
3942 "wireless-regdb-" version ".tar.xz"))
3945 "0liagyi6ppf5w474qk9j4jz5gbvvn8mc8al1dq4b1xrgv28485ml"))
3947 ;; We're building 'regulatory.bin' by ourselves.
3949 (delete-file "regulatory.bin")
3951 (build-system gnu-build-system)
3954 (modify-phases %standard-phases
3955 (add-after 'unpack 'gzip-determinism
3957 (substitute* "Makefile"
3958 (("gzip") "gzip --no-name"))
3960 (add-after 'unpack 'omit-signature
3962 (substitute* "Makefile"
3963 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3964 ;; don't provide (see below). Disable it.
3965 ((" regulatory\\.db\\.p7s") "")
3966 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3967 ;; but ‘make install’ depends only on the latter while installing
3968 ;; both (and failing). Depend on it explicitly.
3969 (("^install: " all) (string-append all "regulatory.db ")))
3971 (delete 'configure)) ; no configure script
3973 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3974 ;; is computed and can be equal to 'maintainer-clean'; when that
3975 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3976 ;; just built. Thus, build things sequentially.
3977 #:parallel-build? #f
3979 #:tests? #f ; no tests
3981 (let ((out (assoc-ref %outputs "out")))
3982 (list (string-append "PREFIX=" out)
3983 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3985 ;; Leave this empty so that db2bin.py doesn't try to sign
3986 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3987 ;; pair for the whole distribution.
3988 (string-append "REGDB_PRIVKEY=")
3989 ;; Don't generate a public key for the same reason. These are
3990 ;; used as Makefile targets and can't be the empty string.
3991 (string-append "REGDB_PUBCERT=/dev/null")
3992 (string-append "REGDB_PUBKEY=/dev/null")))))
3994 `(("python" ,python-wrapper)))
3996 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3997 (synopsis "Wireless regulatory database")
3999 "This package contains the wireless regulatory database for the Central
4000 Regulatory Database Agent (CRDA). The database contains information on
4001 country-specific regulations for the wireless spectrum.")
4002 (license license:isc)))
4004 (define-public lm-sensors
4012 (url "https://github.com/groeck/lm-sensors")
4013 (commit (string-append "V" (string-join
4014 (string-split version #\.) "-")))))
4015 (file-name (git-file-name name version))
4017 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
4018 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
4019 (build-system gnu-build-system)
4020 (inputs `(("rrdtool" ,rrdtool)
4023 ("gnuplot" ,gnuplot)))
4024 (native-inputs `(("pkg-config" ,pkg-config)
4028 (outputs '("lib" ; avoid perl in closure
4031 `(#:tests? #f ; no 'check' target
4032 #:make-flags (list (string-append "PREFIX=" %output)
4033 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
4034 (string-append "INCLUDEDIR="
4035 (assoc-ref %outputs "lib") "/include")
4036 (string-append "MANDIR=" %output "/share/man")
4037 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
4039 (modify-phases %standard-phases
4041 (add-before 'build 'patch-exec-paths
4042 (lambda* (#:key inputs outputs #:allow-other-keys)
4043 (substitute* "prog/detect/sensors-detect"
4045 (string-append "`" (assoc-ref inputs "coreutils")
4047 (("(`|\")modprobe" all open-quote)
4048 (string-append open-quote
4049 (assoc-ref inputs "kmod")
4051 (substitute* '("prog/pwm/pwmconfig"
4052 "prog/pwm/fancontrol")
4054 (string-append (assoc-ref inputs "gnuplot")
4057 (string-append (assoc-ref inputs "coreutils")
4060 (string-append (assoc-ref inputs "grep")
4063 (string-append (assoc-ref inputs "sed")
4066 (string-append (assoc-ref inputs "coreutils")
4069 (string-append (assoc-ref inputs "coreutils")
4072 (string-append (assoc-ref inputs "coreutils")
4073 "/bin/readlink -f")))
4075 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
4076 (synopsis "Utilities to read temperature/voltage/fan sensors")
4078 "Lm-sensors is a hardware health monitoring package for Linux. It allows
4079 you to access information from temperature, voltage, and fan speed sensors.
4080 It works with most newer systems.")
4081 (license license:gpl2+)))
4083 (define-public iucode-tool
4085 (name "iucode-tool")
4089 (uri (string-append "https://gitlab.com/iucode-tool/releases"
4090 "/raw/latest/iucode-tool_" version ".tar.xz"))
4093 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
4094 (build-system gnu-build-system)
4095 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
4096 (synopsis "Manipulate Intel microcode bundles")
4098 "@command{iucode_tool} is a utility to work with microcode packages for
4099 Intel processors. It can convert between formats, extract specific versions,
4100 create a firmware image suitable for the Linux kernel, and more.")
4101 ;; cpuid.h is available for i686, x86_64, and ia64.
4102 (supported-systems '("i686-linux" "x86_64-linux"))
4103 (license license:gpl2+)))
4105 (define-public i2c-tools
4112 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
4113 version ".tar.bz2"))
4116 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
4117 (build-system gnu-build-system)
4119 `(#:tests? #f ; no 'check' target
4120 #:make-flags (list (string-append "prefix=" %output)
4121 ,(string-append "CC=" (cc-for-target)))
4122 ;; No configure script.
4123 #:phases (modify-phases %standard-phases (delete 'configure))))
4126 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
4127 (synopsis "I2C tools for Linux")
4129 "The i2c-tools package contains a heterogeneous set of I2C tools for
4130 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
4131 EEPROM decoding scripts, EEPROM programming tools, and a python module for
4133 (license license:gpl2+)))
4135 (define-public xsensors
4142 "http://www.linuxhardware.org/xsensors/xsensors-"
4146 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
4147 (build-system gnu-build-system)
4148 (inputs `(("lm-sensors" ,lm-sensors "lib")
4150 (native-inputs `(("pkg-config" ,pkg-config)))
4153 (modify-phases %standard-phases
4154 (add-before 'configure 'enable-deprecated
4156 (substitute* "src/Makefile.in"
4157 (("-DGDK_DISABLE_DEPRECATED") "")
4158 (("-DGTK_DISABLE_DEPRECATED") ""))
4160 (add-before 'configure 'remove-Werror
4162 (substitute* '("configure" "src/Makefile.in")
4165 (home-page "http://www.linuxhardware.org/xsensors/")
4166 (synopsis "Hardware health information viewer")
4168 "Xsensors reads data from the libsensors library regarding hardware
4169 health such as temperature, voltage and fan speed and displays the information
4170 in a digital read-out.")
4171 (license license:gpl2+)))
4176 (version (package-version linux-libre))
4177 (source (package-source linux-libre))
4178 (build-system gnu-build-system)
4181 (modify-phases %standard-phases
4183 (lambda* (#:key inputs #:allow-other-keys)
4184 (setenv "SHELL_PATH" (which "bash"))
4185 (chdir "tools/perf")
4187 #:make-flags (list (string-append "prefix="
4188 (assoc-ref %outputs "out"))
4192 ;; By default, 'config/Makefile' uses lib64 on
4193 ;; x86_64. Work around that.
4195 #:tests? #f)) ;no tests
4197 `(("pkg-config" ,pkg-config)
4201 ;; There are build scripts written in these languages.
4203 ("python2" ,python-2)
4204 ("python3" ,python-3)))
4206 `(("slang" ,slang) ;for the interactive TUI
4208 ("python" ,python-2) ;'perf' links against libpython
4209 ("elfutils" ,elfutils)
4210 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
4211 ("libunwind" ,libunwind) ;better stack walking
4212 ("numactl" ,numactl) ;for 'perf bench numa mem'
4215 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
4216 ("docbook-xsl" ,docbook-xsl)
4218 ("asciidoc" ,asciidoc)))
4219 (home-page "https://perf.wiki.kernel.org/")
4220 (synopsis "Linux profiling with performance counters")
4222 "perf is a tool suite for profiling using hardware performance counters,
4223 with support in the Linux kernel. perf can instrument CPU performance
4224 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
4225 of lightweight profiling. This package contains the user-land tools and in
4226 particular the @code{perf} command.")
4227 (license (package-license linux-libre))))
4229 (define-public pflask
4236 (url "https://github.com/ghedo/pflask")
4237 (commit (string-append "v" version))))
4238 (file-name (git-file-name name version))
4241 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
4242 (build-system cmake-build-system)
4244 '(#:tests? #f)) ; no tests
4245 (home-page "https://ghedo.github.io/pflask/")
4246 (synopsis "Simple tool for creating Linux namespace containers")
4247 (description "pflask is a simple tool for creating Linux namespace
4248 containers. It can be used for running a command or even booting an OS inside
4249 an isolated container, created with the help of Linux namespaces. It is
4250 similar in functionality to chroot, although pflask provides better isolation
4251 thanks to the use of namespaces.")
4252 (license license:bsd-2)))
4254 (define-public singularity
4256 (name "singularity")
4260 (uri (string-append "https://github.com/singularityware/singularity/"
4261 "releases/download/" version
4262 "/singularity-" version ".tar.gz"))
4265 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
4266 (modules '((guix build utils)))
4269 ;; Do not create directories in /var.
4270 (substitute* "Makefile.in"
4271 (("\\$\\(MAKE\\) .*install-data-hook") ""))
4273 ;; The original source overrides PATH so that it points to
4274 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
4275 ;; on Guix System. Leave PATH unchanged so we refer to the
4276 ;; installed Coreutils, grep, etc.
4277 (substitute* "bin/singularity.in"
4279 (string-append "#" all "\n")))
4281 (substitute* (find-files "libexec/cli" "\\.exec$")
4282 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
4284 (string-append "/run/setuid-programs/singularity-"
4285 program "-helper")))
4287 ;; These squashfs mount options are apparently no longer
4288 ;; supported since Linux-libre 5.4.5.
4289 (substitute* "src/lib/image/squashfs/mount.c"
4290 (("\"errors=remount-ro\"")
4293 (build-system gnu-build-system)
4295 `(#:configure-flags '("--localstatedir=/var")
4297 (modify-phases %standard-phases
4298 (add-after 'unpack 'patch-references
4300 (substitute* "libexec/cli/build.exec.in"
4301 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
4302 (substitute* (append
4303 (find-files "libexec" "functions")
4304 (find-files "libexec/bootstrap-scripts" ".*sh$")
4305 (find-files "libexec/cli" ".*exec$"))
4307 (string-append "| " (which "grep") " "))
4309 (string-append (which "egrep") " "))
4311 (string-append " " (which "sed") " ")))
4313 (add-after 'install 'set-PATH
4314 (lambda* (#:key inputs outputs #:allow-other-keys)
4315 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
4316 (let ((out (assoc-ref outputs "out"))
4317 (coreutils (assoc-ref inputs "coreutils")))
4318 (wrap-program (string-append out "/bin/singularity")
4319 `("PATH" ":" = (,(string-append coreutils "/bin"))))
4320 (substitute* (string-append out "/bin/run-singularity")
4321 (("/usr/bin/env singularity")
4322 (string-append (which "env") " "
4323 out "/bin/singularity")))
4326 `(("libarchive" ,libarchive)
4327 ("python" ,python-wrapper)
4329 ("squashfs-tools" ,squashfs-tools)))
4330 (home-page "https://singularity.lbl.gov/")
4331 (synopsis "Container platform")
4332 (description "Singularity is a container platform supporting a number of
4333 container image formats. It can build SquashFS container images or import
4334 existing Docker images. Singularity requires kernel support for container
4335 isolation or root privileges.")
4336 (license license:bsd-3)))
4338 (define-public hdparm
4344 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
4345 "hdparm-" version ".tar.gz"))
4348 "0zvppv8qw0y1shlhn34iq1g4883i1cywsa514n595nmyrmsrs3rc"))))
4349 (build-system gnu-build-system)
4352 (let ((out (assoc-ref %outputs "out")))
4353 (list (string-append "binprefix=" out)
4354 (string-append "manprefix=" out)
4355 ,(string-append "CC=" (cc-for-target))
4356 ;; Let Guix strip the binaries and not break cross-compilation.
4359 (modify-phases %standard-phases
4360 (delete 'configure)) ; no configure script
4361 #:tests? #f)) ; no test suite
4362 (home-page "https://sourceforge.net/projects/hdparm/")
4363 (synopsis "View and tune ATA disk drive parameters")
4365 "@command{hdparm} is a command-line utility to control ATA controllers and
4366 disk drives. It can increase performance and/or reliability by careful tuning
4367 of hardware settings like power and acoustic management, DMA modes, and caching.
4368 It can also display detailed device information, or be used as a simple
4369 performance benchmarking tool.
4371 @command{hdparm} provides a command line interface to various Linux kernel
4372 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
4373 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4374 Translation (@dfn{SAT}) are also supported.")
4375 (license (license:non-copyleft "file://LICENSE.TXT"))))
4377 (define-public nvme-cli
4381 (home-page "https://github.com/linux-nvme/nvme-cli")
4386 (commit (string-append "v" version))))
4388 (base32 "0dpadz945482srqpsbfx1bh7rc499fgpyzz1flhk9g9xjbpapkzc"))
4389 (file-name (git-file-name name version))))
4390 (build-system gnu-build-system)
4393 (list ,(string-append "CC=" (cc-for-target)))
4394 #:phases (modify-phases %standard-phases
4395 (delete 'configure) ; no ./configure script
4398 (invoke "make" "install-spec" "PREFIX="
4399 (string-append "DESTDIR=" %output)))))
4400 ;; The tests require sysfs, which is not accessible from from the build
4403 (synopsis "NVM-Express user space tooling for Linux")
4404 (description "Nvme-cli is a utility to provide standards compliant tooling
4405 for NVM-Express drives. It was made specifically for Linux as it relies on the
4406 IOCTLs defined by the mainline kernel driver.")
4407 (license license:gpl2+)))
4409 (define-public rfkill
4415 (uri (string-append "mirror://kernel.org/software/network/"
4416 name "/" name "-" version ".tar.xz"))
4419 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4420 (build-system gnu-build-system)
4422 `(#:make-flags (list "CC=gcc"
4423 (string-append "PREFIX=" %output))
4424 #:phases (modify-phases %standard-phases
4425 (delete 'configure))
4427 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4428 (synopsis "Tool for enabling and disabling wireless devices")
4430 "rfkill is a simple tool for accessing the rfkill device interface,
4431 which is used to enable and disable wireless networking devices, typically
4432 WLAN, Bluetooth and mobile broadband.")
4433 (license (license:non-copyleft "file://COPYING"
4434 "See COPYING in the distribution."))
4435 ;; rfkill is part of util-linux as of 2.31.
4436 (properties `((superseded . ,util-linux)))))
4444 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4445 version "/" name "-" version ".tar.gz"))
4448 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4449 (build-system gnu-build-system)
4450 (home-page "http://acpiclient.sourceforge.net")
4451 (synopsis "Display information on ACPI devices")
4452 (description "@code{acpi} attempts to replicate the functionality of the
4453 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4454 information. It does not support ACPI suspending, only displays information
4455 about ACPI devices.")
4456 (license license:gpl2+)))
4458 (define-public acpid
4464 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4468 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4469 (build-system gnu-build-system)
4470 (home-page "https://sourceforge.net/projects/acpid2/")
4471 (synopsis "Daemon for delivering ACPI events to user-space programs")
4473 "acpid is designed to notify user-space programs of Advanced
4474 Configuration and Power Interface (ACPI) events. acpid should be started
4475 during the system boot, and will run as a background process. When an ACPI
4476 event is received from the kernel, acpid will examine the list of rules
4477 specified in /etc/acpi/events and execute the rules that match the event.")
4478 (license license:gpl2+)))
4480 (define-public sysfsutils
4489 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4492 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4493 (build-system gnu-build-system)
4494 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4495 (synopsis "System utilities based on Linux sysfs")
4497 "These are a set of utilities built upon sysfs, a virtual file system in
4498 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4499 also contains the libsysfs library.")
4500 ;; The library is under lgpl2.1+ (all files say "or any later version").
4501 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4502 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4504 (define-public sysfsutils-1
4506 (inherit sysfsutils)
4513 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4514 "/sysfsutils-" version ".tar.gz"))
4516 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4517 (modules '((guix build utils)))
4520 (substitute* "Makefile.in"
4521 (("includedir = /usr/include/sysfs")
4522 "includedir = @includedir@"))
4523 (substitute* "configure"
4524 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4525 (string-append "includedir='" orig "/sysfs'")))
4527 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4529 (define-public cpufrequtils
4531 (name "cpufrequtils")
4536 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4537 "cpufrequtils-" version ".tar.gz"))
4539 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4540 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4541 (build-system gnu-build-system)
4543 `(("sysfsutils" ,sysfsutils-1)))
4545 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4546 (assoc-ref %outputs "out") "/lib"))))
4547 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4548 (synopsis "Utilities to get and set CPU frequency on Linux")
4550 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4551 information, and set the CPU frequency if supported, using the cpufreq
4552 capabilities of the Linux kernel.")
4553 (license license:gpl2)))
4555 (define-public libraw1394
4562 "mirror://kernel.org/linux/libs/ieee1394/"
4563 name "-" version ".tar.xz"))
4566 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4567 (build-system gnu-build-system)
4568 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4569 (synopsis "Interface library for the Linux IEEE1394 drivers")
4571 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4572 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4573 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4574 send to and receive from other nodes without requiring a kernel driver for the
4575 protocol in question.")
4576 (license license:lgpl2.1+)))
4578 (define-public libavc1394
4584 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4585 name "-" version ".tar.gz"))
4588 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4589 (build-system gnu-build-system)
4591 `(("pkg-config" ,pkg-config)))
4593 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4594 (home-page "https://sourceforge.net/projects/libavc1394/")
4595 (synopsis "AV/C protocol library for IEEE 1394")
4597 "Libavc1394 is a programming interface to the AV/C specification from
4598 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4599 (license license:lgpl2.1+)))
4601 (define-public libiec61883
4603 (name "libiec61883")
4608 "mirror://kernel.org/linux/libs/ieee1394/"
4609 name "-" version ".tar.xz"))
4612 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4613 (build-system gnu-build-system)
4615 `(("pkg-config" ,pkg-config)))
4617 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4618 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4619 (synopsis "Isochronous streaming media library for IEEE 1394")
4621 "The libiec61883 library provides a higher level API for streaming DV,
4622 MPEG-2 and audio over Linux IEEE 1394.")
4623 (license license:lgpl2.1+)))
4625 (define-public mdadm
4632 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4636 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4637 (build-system gnu-build-system)
4641 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4642 (list ,(string-append "CC=" (cc-for-target))
4645 ;; TODO: tell it where to find 'sendmail'
4646 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4647 (string-append "BINDIR=" out "/sbin")
4648 (string-append "MANDIR=" out "/share/man")
4649 (string-append "UDEVDIR=" out "/lib/udev")))
4651 (modify-phases %standard-phases
4652 (add-before 'build 'patch-program-paths
4653 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4654 (let ((coreutils (assoc-ref (or native-inputs inputs)
4656 (substitute* "udev-md-raid-arrays.rules"
4657 (("/usr/bin/(readlink|basename)" all program)
4658 (string-append coreutils "/bin/" program))))
4660 (add-before 'build 'remove-W-error
4662 ;; We cannot build with -Werror on i686 due to a
4663 ;; 'sign-compare' warning in util.c.
4664 (substitute* "Makefile"
4667 (delete 'configure))
4668 ;;tests must be done as root
4670 (supported-systems (delete "i586-gnu" %supported-systems))
4671 (home-page "http://neil.brown.name/blog/mdadm")
4672 (synopsis "Tool for managing Linux Software RAID arrays")
4674 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4675 assemble, report on, and monitor arrays. It can also move spares between raid
4676 arrays when needed.")
4677 (license license:gpl2+)))
4679 (define-public mdadm-static
4682 (name "mdadm-static")
4684 (substitute-keyword-arguments (package-arguments mdadm)
4685 ((#:make-flags flags)
4686 `(cons "LDFLAGS = -static" ,flags))
4688 `(modify-phases ,phases
4689 (add-after 'install 'remove-cruft
4690 (lambda* (#:key outputs #:allow-other-keys)
4691 (let* ((out (assoc-ref outputs "out"))
4692 (precious? (lambda (file)
4693 (member file '("." ".." "sbin"))))
4694 (directories (scandir out (negate precious?))))
4695 (with-directory-excursion out
4696 (for-each delete-file-recursively directories)
4697 (remove-store-references "sbin/mdadm")
4698 (delete-file "sbin/mdmon")
4700 ((#:modules modules %gnu-build-system-modules)
4701 `((ice-9 ftw) ,@modules))
4702 ((#:strip-flags _ '())
4703 ''("--strip-all")) ;strip a few extra KiB
4704 ((#:allowed-references _ '("out"))
4705 '("out")))) ;refer only self
4706 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4708 (define-public multipath-tools
4710 (name "multipath-tools")
4715 (url "https://git.opensvc.com/multipath-tools/.git")
4717 (file-name (git-file-name name version))
4720 "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg"))
4721 (modules '((guix build utils)))
4724 ;; Drop bundled valgrind headers.
4725 (delete-file-recursively "third-party")
4726 (substitute* '("multipathd/main.c"
4727 "libmultipath/debug.c")
4728 (("#include \"../third-party/")
4731 (build-system gnu-build-system)
4733 '(#:test-target "test"
4734 #:parallel-build? #f ;XXX: broken in 0.8.4
4735 #:make-flags (list "CC=gcc"
4736 (string-append "DESTDIR="
4737 (assoc-ref %outputs "out"))
4738 ;; Install Udev rules below this directory, relative
4741 (string-append "LDFLAGS=-Wl,-rpath="
4742 (assoc-ref %outputs "out")
4745 (modify-phases %standard-phases
4746 (add-after 'unpack 'patch-source
4747 (lambda* (#:key inputs #:allow-other-keys)
4748 (let ((lvm2 (assoc-ref inputs "lvm2"))
4749 (udev (assoc-ref inputs "udev")))
4750 (substitute* "Makefile.inc"
4751 (("\\$\\(prefix\\)/usr") "$(prefix)")
4752 ;; Do not save timestamp to avoid gzip "timestamp
4753 ;; out-of-range" warnings.
4754 (("gzip -9") "gzip -9n"))
4755 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4756 (("/usr/include/libdevmapper.h")
4757 (string-append lvm2 "/include/libdevmapper.h"))
4758 (("/usr/include/libudev.h")
4759 (string-append udev "/include/libudev.h")))
4761 (add-after 'unpack 'fix-maybe-uninitialized-variable
4763 ;; This variable gets initialized later if needed, but GCC 7
4764 ;; fails to notice. Should be fixed for > 0.8.4.
4765 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4766 (substitute* "libmultipath/structs_vec.c"
4767 (("bool is_queueing;")
4768 "bool is_queueing = false;"))
4770 (add-after 'unpack 'fix-linking-tests
4772 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4773 ;; for versions > 0.8.4.
4774 (substitute* "tests/Makefile"
4775 (("-lmultipath -lcmocka")
4776 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4778 (add-after 'unpack 'skip-failing-tests
4780 ;; This test and the module's setup() test an arbitrary block
4781 ;; device node name, but the build environment has none.
4782 (substitute* "tests/devt.c"
4783 (("return get_one_devt.*") "return 0;\n")
4784 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
4785 ;; The above triggers -Werror=unused-function. Ignore it.
4786 (substitute* "tests/Makefile"
4787 (("CFLAGS \\+= " match)
4788 (string-append match "-Wno-error=unused-function ")))
4790 (delete 'configure)))) ; no configure script
4793 ("pkg-config" ,pkg-config)
4794 ("valgrind" ,valgrind)
4797 ("cmocka" ,cmocka)))
4799 `(("json-c" ,json-c)
4801 ("liburcu" ,liburcu)
4803 ("readline" ,readline)
4805 (home-page "http://christophe.varoqui.free.fr/")
4806 (synopsis "Access block devices through multiple paths")
4808 "This package provides the following binaries to drive the
4809 Linux Device Mapper multipathing driver:
4811 @item @command{multipath} - Device mapper target autoconfig.
4812 @item @command{multipathd} - Multipath daemon.
4813 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4814 @code{dm} multipath devices.
4815 @item @command{kpartx} - Create device maps from partition tables.
4817 (license (list license:gpl2+ ; main distribution
4818 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4820 (define-public libaio
4827 (string-append "https://releases.pagure.org/libaio/"
4828 name "-" version ".tar.gz")))
4831 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4832 (build-system gnu-build-system)
4835 (let ((target ,(%current-target-system)))
4836 (list (string-append "prefix=" %output)
4839 (string-append (assoc-ref %build-inputs "cross-gcc")
4840 "/bin/" target "-gcc")
4842 #:test-target "partcheck" ; need root for a full 'check'
4844 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4845 (home-page "https://pagure.io/libaio")
4846 (synopsis "Linux-native asynchronous I/O access library")
4848 "This library enables userspace to use Linux kernel asynchronous I/O
4849 system calls, important for the performance of databases and other advanced
4851 (license license:lgpl2.1+)))
4853 (define-public blktrace
4854 ;; Take a newer commit to get the fix for CVE-2018-10689.
4855 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4859 (version (git-version "1.2.0" revision commit))
4861 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4868 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4869 (file-name (git-file-name name version))))
4870 (build-system gnu-build-system)
4873 (list ,(string-append "CC=" (cc-for-target))
4874 (string-append "prefix=" %output))
4875 #:tests? #f ; no tests
4877 (modify-phases %standard-phases
4878 (delete 'configure) ; no configure script
4879 (add-after 'unpack 'fix-gnuplot-path
4880 (lambda* (#:key inputs #:allow-other-keys)
4881 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4882 (substitute* "btt/bno_plot.py"
4884 (string-append gnuplot "/bin/gnuplot %s")))
4887 `(("libaio" ,libaio)
4888 ("gnuplot" ,gnuplot)
4889 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4890 (synopsis "Block layer IO tracing mechanism")
4891 (description "Blktrace is a block layer IO tracing mechanism which provides
4892 detailed information about request queue operations to user space. It extracts
4893 event traces from the kernel (via the relaying through the debug file system).")
4894 (license license:gpl2))))
4902 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4904 (patches (search-patches "sbc-fix-build-non-x86.patch"))
4907 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
4908 (build-system gnu-build-system)
4910 `(("libsndfile" ,libsndfile)))
4912 `(("pkg-config" ,pkg-config)))
4913 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4914 (synopsis "Bluetooth subband audio codec")
4916 "The SBC is a digital audio encoder and decoder used to transfer data to
4917 Bluetooth audio output devices like headphones or loudspeakers.")
4918 (license license:gpl2+)))
4920 (define-public bluez
4927 "mirror://kernel.org/linux/bluetooth/bluez-"
4931 "124v9s4y1s7s6klx5vlmzpk1jlr4x84ch7r7scm7x2f42dqp2qw8"))))
4932 (build-system gnu-build-system)
4935 (let ((out (assoc-ref %outputs "out")))
4936 (list "--sysconfdir=/etc"
4937 "--localstatedir=/var"
4940 ;; TODO: is this needed? Not installed by default since 5.55.
4942 ;; Install dbus/udev files to the correct location.
4943 (string-append "--with-dbusconfdir=" out "/etc")
4944 (string-append "--with-udevdir=" out "/lib/udev")))
4946 (modify-phases %standard-phases
4947 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4948 ;; issue (discussion on upstream mailing list:
4949 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4950 (add-before 'check 'skip-wonky-test
4952 (substitute* "unit/test-gatt.c"
4953 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4955 (add-after 'install 'post-install
4956 (lambda* (#:key inputs outputs #:allow-other-keys)
4957 (let* ((out (assoc-ref outputs "out"))
4958 (servicedir (string-append out "/share/dbus-1/services"))
4959 (service "obexd/src/org.bluez.obex.service")
4960 (rule (string-append
4961 out "/lib/udev/rules.d/97-hid2hci.rules")))
4962 ;; Install the obex dbus service file.
4963 (substitute* service
4965 (string-append out "/libexec/bluetooth/obexd")))
4966 (install-file service servicedir)
4967 ;; Fix paths in the udev rule.
4969 (("hid2hci --method")
4970 (string-append out "/lib/udev/hid2hci --method"))
4972 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4975 `(("pkg-config" ,pkg-config)
4976 ("gettext" ,gettext-minimal)))
4981 ("libical" ,libical)
4982 ("readline" ,readline)))
4983 (home-page "http://www.bluez.org/")
4984 (synopsis "Linux Bluetooth protocol stack")
4986 "BlueZ provides support for the core Bluetooth layers and protocols. It
4987 is flexible, efficient and uses a modular implementation.")
4988 (license license:gpl2+)))
4990 (define-public fuse-exfat
4997 "https://github.com/relan/exfat/releases/download/v"
4998 version "/" name "-" version ".tar.gz"))
5001 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
5002 (build-system gnu-build-system)
5004 `(("pkg-config" ,pkg-config)))
5007 (home-page "https://github.com/relan/exfat")
5008 (synopsis "Mount exFAT file systems")
5010 "This package provides a FUSE-based file system that provides read and
5011 write access to exFAT devices.")
5012 (license license:gpl2+)))
5014 (define-public fuseiso
5017 (version "20070708")
5020 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
5021 version "/fuseiso-" version ".tar.bz2"))
5024 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
5025 (build-system gnu-build-system)
5027 `(("pkg-config" ,pkg-config)))
5032 (home-page "https://sourceforge.net/projects/fuseiso/")
5033 (synopsis "Mount ISO file system images")
5035 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
5036 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
5037 Ridge, Joliet, and zisofs.")
5038 (license license:gpl2)))
5047 "https://www.nico.schottelius.org/software/gpm/archives/"
5048 "gpm-" version ".tar.bz2"))
5049 (patches (search-patches "gpm-glibc-2.26.patch"))
5052 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
5053 (build-system gnu-build-system)
5055 '(#:phases (modify-phases %standard-phases
5058 ;; The tarball was not generated with 'make dist' so we
5059 ;; need to bootstrap things ourselves.
5060 (substitute* "autogen.sh"
5061 (("/bin/sh") (which "sh")))
5062 (invoke "./autogen.sh")
5063 (patch-makefile-SHELL "Makefile.include.in")
5066 ;; Make sure programs find libgpm.so.
5067 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
5068 (assoc-ref %outputs "out")
5071 `(("texinfo" ,texinfo)
5074 ("autoconf" ,autoconf)
5075 ("automake" ,automake)
5076 ("libtool" ,libtool)))
5077 (home-page "https://www.nico.schottelius.org/software/gpm/")
5078 (synopsis "Mouse support for the Linux console")
5080 "The GPM (general-purpose mouse) daemon is a mouse server for
5081 applications running on the Linux console. It allows users to select items
5082 and copy/paste text in the console and in xterm.")
5083 (license license:gpl2+)))
5085 (define-public btrfs-progs
5087 (name "btrfs-progs")
5091 (uri (string-append "mirror://kernel.org/linux/kernel/"
5092 "people/kdave/btrfs-progs/"
5093 "btrfs-progs-v" version ".tar.xz"))
5096 "0n9p8zaz4nrkgc20cp6zj7gp4ib4hd4lbyph74f4pysllkz4c24m"))))
5097 (build-system gnu-build-system)
5099 "static")) ; static versions of the binaries in "out"
5101 '(#:phases (modify-phases %standard-phases
5102 (add-after 'unpack 'patch-makefile
5103 (lambda* (#:key outputs #:allow-other-keys)
5104 (substitute* "Makefile"
5105 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
5106 (string-append (assoc-ref outputs "out")
5107 "/lib/udev/rules.d")))
5109 (add-after 'build 'build-static
5110 (lambda _ (invoke "make" "static")))
5111 (add-after 'install 'install-bash-completion
5112 (lambda* (#:key outputs #:allow-other-keys)
5113 (let* ((out (assoc-ref outputs "out"))
5114 (bashcomp (string-append out "/etc/bash_completion.d")))
5116 (copy-file "btrfs-completion"
5117 (string-append bashcomp "/btrfs"))
5119 (add-after 'install 'install-static
5120 (let ((staticbin (string-append (assoc-ref %outputs "static")
5124 (string-append "bindir=" staticbin)
5125 "install-static")))))
5126 #:tests? #f ; XXX: require the 'btrfs' kernel module.
5127 #:test-target "test"
5128 #:parallel-tests? #f)) ; tests fail when run in parallel
5129 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
5131 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
5132 ("util-linux:static" ,util-linux "static") ;ditto
5134 ("zlib:static" ,zlib "static")
5135 ("zstd" ,zstd "lib")
5136 ("zstd:static" ,zstd "static")))
5137 (native-inputs `(("pkg-config" ,pkg-config)
5138 ("asciidoc" ,asciidoc)
5141 ;; Remove this input entirely when the default headers
5142 ;; version provides blk_zone.capacity (>= 5.9).
5143 ("linux-libre-headers" ,linux-libre-headers-5.10)
5144 ;; For building documentation.
5145 ("libxml2" ,libxml2)
5146 ("docbook-xsl" ,docbook-xsl)
5152 ;; The tests need 'grep' with perl regexp support.
5154 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
5155 (synopsis "Create and manage btrfs copy-on-write file systems")
5156 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
5157 aimed at implementing advanced features while focusing on fault tolerance,
5158 repair and easy administration.")
5159 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
5160 ;; GPL2: Everything else.
5161 (license (list license:gpl2 license:gpl2+))))
5163 (define-public btrfs-progs/static
5165 (name "btrfs-progs-static")
5166 (version (package-version btrfs-progs))
5168 (build-system trivial-build-system)
5170 `(("btrfs-progs:static" ,btrfs-progs "static")))
5172 `(#:modules ((guix build utils))
5175 (use-modules (guix build utils)
5179 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
5180 (out (assoc-ref %outputs "out"))
5181 (source (string-append btrfs "/bin/btrfs.static"))
5182 (target (string-append out "/bin/btrfs")))
5183 (mkdir-p (dirname target))
5184 (copy-file source target)
5185 (remove-store-references target)
5186 (chmod target #o555)
5188 (home-page (package-home-page btrfs-progs))
5189 (synopsis "Statically-linked btrfs command from btrfs-progs")
5190 (description "This package provides the statically-linked @command{btrfs}
5191 from the btrfs-progs package. It is meant to be used in initrds.")
5192 (license (package-license btrfs-progs))))
5194 (define-public cramfs-tools
5196 (name "cramfs-tools")
5197 (home-page "https://github.com/npitre/cramfs-tools")
5203 (commit (string-append "v" version))))
5205 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
5206 (file-name (git-file-name name version))))
5207 (build-system gnu-build-system)
5209 '(#:tests? #f ; No tests.
5211 (modify-phases %standard-phases
5214 (lambda* (#:key outputs #:allow-other-keys)
5215 (let ((out (assoc-ref outputs "out")))
5216 (install-file "mkcramfs" (string-append out "/sbin"))
5217 (install-file "cramfsck" (string-append out "/sbin")))
5221 (synopsis "Tools to manage Cramfs file systems")
5222 (description "Cramfs is a Linux file system designed to be simple, small,
5223 and to compress things well. It is used on a number of embedded systems and
5224 small devices. This version has additional features such as uncompressed
5225 blocks and random block placement.")
5226 (license license:gpl2+)))
5228 (define-public compsize
5232 (home-page "https://github.com/kilobyte/compsize")
5237 (commit (string-append "v" version))))
5239 (base32 "0vqnrwgpv6pc1yjl0g4gl71xyl6v0xl3pyqjanjpwps73c53azir"))
5240 (file-name (git-file-name name version))))
5241 (build-system gnu-build-system)
5243 `(("btrfs-progs" ,btrfs-progs)))
5245 `(#:tests? #f ; No tests.
5247 (list (string-append "CC=" ,(cc-for-target)))
5249 (modify-phases %standard-phases
5252 (lambda* (#:key outputs #:allow-other-keys)
5253 (let ((out (assoc-ref outputs "out")))
5254 (install-file "compsize" (string-append out "/bin"))
5255 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
5256 (synopsis "Find compression type/ratio on Btrfs files")
5257 (description "@command{compsize} takes a list of files (given as
5258 arguments) on a Btrfs file system and measures used compression types and
5259 effective compression ratio, producing a report.
5261 A directory has no extents but has a (recursive) list of files. A non-regular
5262 file is silently ignored.
5264 As it makes no sense to talk about compression ratio of a partial extent,
5265 every referenced extent is counted whole, exactly once -- no matter if you use
5266 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
5267 uncompressed size will not match the number given by @command{tar} or
5268 @command{du}. On the other hand, the space used should be accurate (although
5269 obviously it can be shared with files outside our set).")
5270 (license license:gpl2+)))
5272 (define-public f2fs-tools-1.7
5279 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5280 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5283 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
5285 (build-system gnu-build-system)
5288 (modify-phases %standard-phases
5289 (add-after 'install 'install-headers
5290 (lambda* (#:key outputs #:allow-other-keys)
5291 (let* ((out (assoc-ref outputs "out"))
5292 (out-include (string-append out "/include")))
5293 (install-file "include/f2fs_fs.h" out-include)
5294 (install-file "mkfs/f2fs_format_utils.h" out-include)
5297 `(("autoconf" ,autoconf)
5298 ("automake" ,automake)
5299 ("libtool" ,libtool)
5300 ("pkg-config" ,pkg-config)))
5302 `(("libuuid" ,util-linux "lib")
5303 ("libselinux" ,libselinux)))
5304 (home-page "https://f2fs.wiki.kernel.org/")
5305 (synopsis "Userland tools for f2fs")
5307 "F2FS, the Flash-Friendly File System, is a modern file system
5308 designed to be fast and durable on flash devices such as solid-state
5309 disks and SD cards. This package provides the userland utilities.")
5310 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
5311 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
5312 (license (list license:gpl2 license:lgpl2.1))))
5314 (define-public f2fs-tools
5316 (inherit f2fs-tools-1.7)
5322 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5323 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5326 "1lab1446c78xsjwhpki7s85z4171m8p9279c8yhm4882wba674k1"))))
5328 `(("libuuid" ,util-linux "lib")))))
5330 (define-public f2fs-tools/static
5333 (inherit f2fs-tools)
5334 (name "f2fs-tools-static")
5337 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
5338 (libuuid (assoc-ref %build-inputs "libuuid")))
5340 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
5341 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
5342 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
5343 "-I" libuuid "/include/blkid")
5344 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
5345 #:disallowed-references (,util-linux)
5347 (modify-phases %standard-phases ; TODO: f2fs phases.
5348 (add-after 'unpack 'make-static
5350 (define (append-to-file name body)
5351 (let ((file (open-file name "a")))
5354 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
5355 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
5356 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
5358 (add-after 'install 'remove-store-references
5359 (lambda* (#:key outputs #:allow-other-keys)
5360 ;; Work around bug in our util-linux.
5361 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
5362 (remove-store-references (string-append (assoc-ref outputs "out")
5366 `(("libuuid:static" ,util-linux "static")
5367 ("libuuid" ,util-linux "lib")))))) ; for include files
5369 (define-public f2fs-fsck/static
5371 (name "f2fs-fsck-static")
5372 (version (package-version f2fs-tools/static))
5374 (build-system trivial-build-system)
5376 `(#:modules ((guix build utils))
5379 (use-modules (guix build utils)
5382 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
5384 (out (assoc-ref %outputs "out"))
5385 (sbin (string-append out "/sbin")))
5387 (with-directory-excursion sbin
5388 (install-file (string-append f2fs-tools "/sbin/" fsck)
5390 (remove-store-references fsck)
5394 `(("f2fs-tools-static" ,f2fs-tools/static)))
5395 (home-page (package-home-page f2fs-tools/static))
5396 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5397 (description "This package provides statically-linked fsck.f2fs command taken
5398 from the f2fs-tools package. It is meant to be used in initrds.")
5399 (license (package-license f2fs-tools/static))))
5401 (define-public freefall
5404 (version (package-version linux-libre))
5405 (source (package-source linux-libre))
5406 (build-system gnu-build-system)
5408 '(#:phases (modify-phases %standard-phases
5409 (add-after 'unpack 'enter-subdirectory
5411 (chdir "tools/laptop/freefall")
5414 (add-before 'build 'increase-timeout
5416 ;; The default of 2 seconds is too low: it assumes an
5417 ;; open lid and AC power without actually checking.
5418 (substitute* "freefall.c"
5419 (("alarm\\(2\\)") "alarm(5)"))
5421 #:make-flags (list (string-append "PREFIX="
5422 (assoc-ref %outputs "out"))
5424 #:tests? #f)) ;no tests
5425 (home-page (package-home-page linux-libre))
5426 (synopsis "Free-fall protection for spinning laptop hard drives")
5428 "Prevents shock damage to the internal spinning hard drive(s) of some
5429 HP and Dell laptops. When sudden movement is detected, all input/output
5430 operations on the drive are suspended and its heads are parked on the ramp,
5431 where they are less likely to cause damage to the spinning disc. Requires a
5432 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5433 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5434 (license license:gpl2)))
5436 (define-public thinkfan
5444 (url "https://github.com/vmatare/thinkfan")
5446 (file-name (git-file-name name version))
5448 (base32 "01l1pnj1cgy3dwgyys2s5iqzyv6kk47vlpy09qjafk8py21ijik3"))))
5449 (build-system cmake-build-system)
5451 `(#:modules ((guix build cmake-build-system)
5454 #:tests? #f ; no test target
5456 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5457 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5459 `("-DUSE_ATASMART:BOOL=ON")
5461 (modify-phases %standard-phases
5462 (add-after 'unpack 'create-init-scripts
5463 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5464 ;; systemd to patch and install their service files. Fake their
5465 ;; presence rather than duplicating the build system below. Leave
5466 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5467 ;; The sysvinit needs manual patching, but since upstream doesn't
5468 ;; even provide the option to install it: don't.
5469 (lambda* (#:key outputs #:allow-other-keys)
5470 (let* ((out (assoc-ref outputs "out"))
5471 (share (string-append out "/share/" ,name)))
5472 (substitute* "CMakeLists.txt"
5473 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5474 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5475 ;; That was easy! Now we just need to fix the destinations.
5477 (string-append out directory)))
5480 `(("pkg-config" ,pkg-config)))
5482 `(("libatasmart" ,libatasmart)
5483 ("yaml-cpp" ,yaml-cpp)))
5484 (home-page "https://github.com/vmatare/thinkfan")
5485 (synopsis "Simple fan control program")
5487 "Thinkfan is a simple fan control program. It reads temperatures,
5488 checks them against configured limits and switches to appropriate (also
5489 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5490 other @code{hwmon} driver that enables temperature reading and fan control
5492 (license license:gpl3+)))
5494 (define-public tpacpi-bat
5502 (url "https://github.com/teleshoes/tpacpi-bat")
5503 (commit (string-append "v" version))))
5504 (file-name (git-file-name name version))
5506 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5507 (build-system gnu-build-system)
5509 `(#:tests? #f ; no test target
5511 (modify-phases %standard-phases
5512 (add-after 'unpack 'refer-to-inputs
5514 (substitute* "tpacpi-bat"
5516 (format #f "~a " (which "cat")))
5517 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5518 ;; loaded. That's the administrator's prerogative; disable it.
5519 (("system \"(modprobe .*)\"" _ match)
5520 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5522 (delete 'configure) ; nothing to configure
5523 (delete 'build) ; nothing to build
5525 (lambda* (#:key outputs #:allow-other-keys)
5526 (let* ((out (assoc-ref outputs "out"))
5527 (bin (string-append out "/bin"))
5528 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5529 (install-file "tpacpi-bat" bin)
5531 ;; There's no man page. Install other forms of documentation.
5532 (for-each (lambda (file)
5533 (let ((target (string-append doc "/" file)))
5534 (mkdir-p (dirname target))
5535 (copy-recursively file target)))
5536 (list "battery_asl" "examples" "README.md"))
5540 (home-page "https://github.com/teleshoes/tpacpi-bat")
5541 (synopsis "ThinkPad battery charge controller")
5543 "Tpacpi-bat is a command-line interface to control battery charging on
5544 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5545 ThinkPad models released after 2011}, starting with the xx20 series. It can
5546 query and set the thresholds at which one or both batteries will start and stop
5547 charging, inhibit charging batteries for a set period of time, or force them to
5548 discharge when they otherwise would not.
5550 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5551 kernel module provided by the @code{acpi-call-linux-module} package, which must
5552 be installed and loaded separately. Only the original vendor firmware is
5554 (license license:gpl3+)))
5559 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
5560 (version (package-version linux-libre))
5561 (source (package-source linux-libre))
5562 (build-system gnu-build-system)
5564 `(#:tests? #f ; no test suite
5566 (list (string-append "CC=" ,(cc-for-target))
5567 (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out"))
5570 (modify-phases %standard-phases
5571 (add-after 'unpack 'enter-subdirectory
5573 (chdir "tools/thermal/tmon")
5575 (add-after 'install 'install-man-page
5576 (lambda* (#:key outputs #:allow-other-keys)
5577 (let* ((out (assoc-ref outputs "out"))
5578 (man8 (string-append out "/share/man/man8")))
5579 (install-file "tmon.8" man8)
5581 (delete 'configure)))) ; no configure script
5583 `(("ncurses" ,ncurses)))
5584 (home-page (package-home-page linux-libre))
5585 (synopsis "Monitor and test the Linux thermal subsystem in real time")
5587 "Tmon is a tool to interact with the complex thermal subsystem of the
5588 kernel Linux. It helps visualize thermal relationships and real-time thermal
5589 data, tune and test cooling devices and sensors, and collect thermal data for
5592 As computers become smaller and more thermally constrained, more sensors are
5593 added and new cooling capabilities introduced. Thermal relationships can change
5594 dynamically. Their complexity grows exponentially among cooling devices, zones,
5595 sensors, and trip points.
5597 Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
5598 of symbolic links, trip point bindings, and device instances. To traverse it
5599 by hand is no trivial task: @command{tmon} aims to make it understandable.")
5600 (license (list license:gpl2 ; the man page
5601 license:gpl2+)))) ; the actual rest
5603 (define-public turbostat
5606 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
5607 ;; make it harder to benefit from ‘free’ linux-libre package updates.
5608 (version (package-version linux-libre))
5609 (source (package-source linux-libre))
5610 (build-system gnu-build-system)
5612 `(#:tests? #f ; no test suite
5614 (list (string-append "CC=" ,(cc-for-target))
5615 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5617 (modify-phases %standard-phases
5618 (add-after 'unpack 'enter-subdirectory
5620 (chdir "tools/power/x86/turbostat")
5622 (delete 'configure)))) ; no configure script
5624 `(("libcap" ,libcap)))
5625 (supported-systems '("i686-linux" "x86_64-linux"))
5626 (home-page (package-home-page linux-libre))
5627 (synopsis "Report x86 processor frequency and idle statistics")
5629 "Turbostat reports x86 processor topology, frequency, idle power state
5630 statistics, temperature, and power consumption. Some information is unavailable
5631 on older processors.
5633 It can be used to identify machines that are inefficient in terms of power usage
5634 or idle time, report the rate of @acronym{SMI, system management interrupt}s
5635 occurring on the system, or verify the effects of power management tuning.
5637 @command{turbostat} reads hardware counters but doesn't write to them, so it
5638 won't interfere with the OS or other running processes---including multiple
5639 invocations of itself.")
5640 (license license:gpl2)))
5642 (define-public ntfs-3g
5645 (version "2017.3.23")
5648 (uri (string-append "https://tuxera.com/opensource/"
5649 "ntfs-3g_ntfsprogs-" version ".tgz"))
5650 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5653 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5654 (modules '((guix build utils)))
5656 ;; Install under $prefix.
5657 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5661 (build-system gnu-build-system)
5662 (inputs `(("util-linux" ,util-linux)
5663 ("fuse" ,fuse))) ;libuuid
5664 (native-inputs `(("pkg-config" ,pkg-config)))
5666 '(#:configure-flags (list "--disable-static"
5667 "--exec-prefix=${prefix}"
5668 "--with-fuse=external" ;use our own FUSE
5669 "--enable-mount-helper"
5670 "--enable-posix-acls"
5671 "--enable-xattr-mappings")
5673 (modify-phases %standard-phases
5674 ;; If users install ntfs-3g, they probably want to make it the
5675 ;; default driver as well, so we opt for sensible defaults and link
5676 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5677 ;; mount NTFS file systems.)
5678 (add-after 'install 'install-link
5679 (lambda* (#:key outputs #:allow-other-keys)
5680 (let* ((out (assoc-ref outputs "out"))
5681 (sbin (string-append out "/sbin")))
5682 (symlink "mount.ntfs-3g"
5683 (string-append sbin "/mount.ntfs")))
5685 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5686 (synopsis "Read-write access to NTFS file systems")
5688 "NTFS-3G provides read-write access to NTFS file systems, which are
5689 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5690 The package provides additional NTFS tools.")
5691 (license license:gpl2+)))
5693 (define-public rdma-core
5699 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5700 "/releases/download/v" version "/rdma-core-"
5704 "1rah0v9gq9rksqd2c17nmydsxcjz178n7m2y4ricwlf5pq1b2yfi"))))
5705 (build-system cmake-build-system)
5707 `(#:tests? #f ; no tests
5708 ;; Upstream uses the "ninja" build system and encourage distros
5709 ;; to do the same for consistency.
5710 #:configure-flags (list "-GNinja"
5712 (string-append "-DRST2MAN_EXECUTABLE="
5713 (assoc-ref %build-inputs
5717 (modify-phases %standard-phases
5721 "-j" (number->string (parallel-job-count)))))
5724 (invoke "ninja" "install"))))))
5727 ("pkg-config" ,pkg-config)
5728 ("python" ,python-wrapper)
5729 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5733 (home-page "https://github.com/linux-rdma/rdma-core")
5734 (synopsis "Utilities and libraries for working with RDMA devices")
5736 "This package provides userspace components for the InfiniBand
5737 subsystem of the Linux kernel. Specifically it contains userspace
5738 libraries for the following device nodes:
5741 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5742 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5743 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5746 The following service daemons are also provided:
5748 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5749 @item @code{iwpmd} (for iWARP kernel providers)
5750 @item @code{ibacm} (for InfiniBand communication management assistant)
5752 ;; All library code is dual licensed under GPL2 and a custom MIT
5753 ;; variant. The package also includes some components covered by
5754 ;; other licenses. Consult COPYING.md for full details.
5757 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5758 license:bsd-2 ; Files referring to COPYING.BSD_FB
5759 license:cc0 ; most files in ccan/
5760 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5762 (define-public perftest
5769 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5770 version "/perftest-" version ".g0927198.tar.gz"))
5772 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5773 (build-system gnu-build-system)
5776 (modify-phases %standard-phases
5777 (add-after 'unpack 'patch-header-paths
5779 (substitute* '("src/raw_ethernet_fs_rate.c"
5780 "src/raw_ethernet_resources.c"
5781 "src/raw_ethernet_resources.h"
5782 "src/raw_ethernet_send_burst_lat.c"
5783 "src/raw_ethernet_send_bw.c"
5784 "src/raw_ethernet_send_lat.c")
5785 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5787 (inputs `(("rdma-core" ,rdma-core)))
5788 (home-page "https://github.com/linux-rdma/perftest/")
5789 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5790 (description "This is a collection of tests written over uverbs intended for
5791 use as a performance micro-benchmark. The tests may be used for hardware or
5792 software tuning as well as for functional testing.
5794 The collection contains a set of bandwidth and latency benchmark such as:
5796 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5797 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5798 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5799 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5800 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5802 (license license:gpl2)))
5804 (define-public rng-tools
5807 (home-page "https://github.com/nhorman/rng-tools")
5811 (uri (git-reference (url home-page)
5812 (commit (string-append "v" version))))
5813 (file-name (git-file-name name version))
5816 "0z4j3kqh9k3zsrx6257hwh4fa51vqg79c6dnfrj6lhpcll0wh0hm"))))
5817 (build-system gnu-build-system)
5819 `(;; Disable support for various hardware entropy sources as they need
5820 ;; dependencies that are not yet in Guix, and would significantly
5821 ;; increase closure size.
5822 #:configure-flags '("--without-nistbeacon"
5824 "--without-rtlsdr")))
5826 `(("autoconf" ,autoconf)
5827 ("automake" ,automake)
5828 ("pkg-config" ,pkg-config)))
5830 `(("libsysfs" ,sysfsutils)
5831 ("openssl" ,openssl)))
5832 (synopsis "Random number generator daemon")
5834 "Monitor a hardware random number generator, and supply entropy
5835 from that to the system kernel's @file{/dev/random} machinery.")
5836 ;; The source package is offered under the GPL2+, but the files
5837 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5838 (license (list license:gpl2 license:gpl2+))))
5840 (define-public cpupower
5843 (version (package-version linux-libre))
5844 (source (package-source linux-libre))
5845 (build-system gnu-build-system)
5847 '(#:phases (modify-phases %standard-phases
5848 (add-after 'unpack 'enter-subdirectory
5850 (chdir "tools/power/cpupower")
5853 (add-before 'build 'fix-makefiles
5855 (substitute* "Makefile"
5857 (("/bin/(install|pwd)" _ command) command))
5858 (substitute* "bench/Makefile"
5859 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5861 #:make-flags (let ((out (assoc-ref %outputs "out")))
5862 (list (string-append "DESTDIR=" out)
5863 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5865 "docdir=/share/doc/cpupower"
5866 "confdir=$(docdir)/examples"
5867 ;; The Makefile recommends the following changes
5869 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5870 #:tests? #f)) ;no tests
5871 (native-inputs `(("gettext" ,gettext-minimal)))
5872 (inputs `(("pciutils" ,pciutils)))
5873 (home-page (package-home-page linux-libre))
5874 (synopsis "CPU frequency and voltage scaling tools for Linux")
5876 "cpupower is a set of user-space tools that use the cpufreq feature of the
5877 Linux kernel to retrieve and control processor features related to power saving,
5878 such as frequency and voltage scaling.")
5879 (license license:gpl2)))
5881 (define-public x86-energy-perf-policy
5883 (name "x86-energy-perf-policy")
5884 (version (package-version linux-libre))
5885 (source (package-source linux-libre))
5886 (build-system gnu-build-system)
5890 (modify-phases %standard-phases
5891 (add-after 'unpack 'enter-subdirectory
5893 (chdir "tools/power/x86/x86_energy_perf_policy")
5896 (add-before 'build 'fix-makefile
5898 (substitute* "Makefile" (("/usr") ""))
5901 (let ((out (assoc-ref %outputs "out")))
5902 (list (string-append "DESTDIR=" out)
5903 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5904 (supported-systems '("i686-linux" "x86_64-linux"))
5905 (home-page (package-home-page linux-libre))
5906 (synopsis "Display and update Intel-CPU energy-performance policy")
5908 "@command{x86_energy_perf_policy} displays and updates energy-performance
5909 policy settings specific to Intel Architecture Processors. Settings are
5910 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5911 cpufreq sub-system is enabled or not.")
5912 (license license:gpl2)))
5914 (define-public haveged
5922 (url "https://github.com/jirka-h/haveged")
5923 (commit (string-append "v" version))))
5924 (file-name (git-file-name name version))
5926 (base32 "050hmnh5s2s4mb83f4d1fk23mk27pprg840c1aagc6v1sz6x5dhq"))))
5927 (build-system gnu-build-system)
5928 (home-page "https://www.issihosts.com/haveged")
5929 (synopsis "Entropy source for the Linux random number generator")
5931 "haveged generates an unpredictable stream of random numbers for use by
5932 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5933 standard mechanisms for filling the entropy pool may not be sufficient for
5934 systems with high needs or limited user interaction, such as headless servers.
5936 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5937 indirect effects of hardware events on hidden processor state using the
5938 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5939 It tunes itself to its environment and provides the same built-in test suite
5940 for the output stream as used on certified hardware security devices.
5942 The quality of the randomness produced by this algorithm has not been proven.
5943 It is recommended to run it together with another entropy source like rngd, and
5944 not as a replacement for it.")
5945 (license (list (license:non-copyleft "file://nist/mconf.h")
5946 (license:non-copyleft "file://nist/packtest.c")
5947 license:public-domain ; nist/dfft.c
5948 license:gpl3+)))) ; everything else
5950 (define-public ecryptfs-utils
5952 (name "ecryptfs-utils")
5957 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5958 version "/+download/ecryptfs-utils_"
5959 version ".orig.tar.gz"))
5962 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5963 (build-system gnu-build-system)
5965 `(#:configure-flags (list "--disable-pywrap")
5967 (modify-phases %standard-phases
5968 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5969 (lambda* (#:key inputs outputs #:allow-other-keys)
5970 (let ((out (assoc-ref outputs "out"))
5971 (utils-linux (assoc-ref inputs "utils-linux"))
5972 (cryptsetup (assoc-ref inputs "cryptsetup"))
5973 (linux-pam (assoc-ref inputs "linux-pam"))
5974 (lvm2 (assoc-ref inputs "lvm2")))
5975 (substitute* '("src/utils/ecryptfs-mount-private"
5976 "src/utils/ecryptfs-umount-private"
5977 "src/utils/ecryptfs-setup-private"
5978 "src/utils/ecryptfs-setup-swap"
5979 "src/utils/mount.ecryptfs.c"
5980 "src/utils/umount.ecryptfs.c"
5981 "src/pam_ecryptfs/pam_ecryptfs.c"
5982 "src/desktop/ecryptfs-mount-private.desktop.in"
5983 "src/desktop/ecryptfs-setup-private.desktop.in")
5985 (string-append utils-linux "/bin/mount"))
5987 (string-append utils-linux "/bin/umount"))
5988 (("/sbin/mount.ecryptfs_private")
5989 (string-append out "/sbin/mount.ecryptfs_private"))
5990 (("/sbin/umount.ecryptfs_private")
5991 (string-append out "/sbin/umount.ecryptfs_private"))
5992 (("/usr/bin/ecryptfs-mount-private")
5993 (string-append out "/bin/ecryptfs-mount-private"))
5994 (("/usr/bin/ecryptfs-rewrite-file")
5995 (string-append out "/bin/ecryptfs-rewrite-file"))
5996 (("/usr/bin/ecryptfs-setup-private")
5997 (string-append out "/bin/ecryptfs-setup-private"))
5998 (("/sbin/cryptsetup")
5999 (string-append cryptsetup "/sbin/cryptsetup"))
6000 (("/sbin/unix_chkpwd")
6001 (string-append linux-pam "/sbin/unix_chkpwd"))
6003 (string-append lvm2 "/sbin/dmsetup")))))))))
6005 `(("intltool" ,intltool)
6006 ("perl" ,perl) ; for pod2man
6007 ("pkg-config" ,pkg-config)))
6009 `(("keyutils" ,keyutils)
6010 ("linux-pam" ,linux-pam)
6011 ("utils-linux" ,util-linux)
6012 ("cryptsetup" ,cryptsetup)
6015 (home-page "https://ecryptfs.org/")
6016 (synopsis "eCryptfs cryptographic file system utilities")
6018 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
6019 Each file's cryptographic meta-data is stored inside the file itself, along
6020 with the encrypted contents. This allows individual encrypted files to be
6021 copied between hosts and still be decrypted with the proper key. eCryptfs is a
6022 native Linux file system, and has been part of the Linux kernel since version
6023 2.6.19. This package contains the userland utilities to manage it.")
6024 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
6025 ;; grant additional permission to link with OpenSSL.
6026 (license license:gpl2+)))
6028 (define-public libnfsidmap
6030 (name "libnfsidmap")
6035 (uri (string-append "https://fedorapeople.org/~steved/"
6036 name "/" version "/" name "-" version ".tar.bz2"))
6038 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
6039 (build-system gnu-build-system)
6041 `(#:configure-flags (list
6042 (string-append "--with-pluginpath="
6043 (assoc-ref %outputs "out")
6044 "/lib/libnfsidmap"))))
6046 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
6048 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
6049 (synopsis "NFSv4 support library for name/ID mapping")
6050 (description "Libnfsidmap is a library holding mulitiple methods of
6051 mapping names to ids and visa versa, mainly for NFSv4. It provides an
6052 extensible array of mapping functions, currently consisting of two choices:
6053 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
6054 (license (license:non-copyleft "file://COPYING"
6055 "See COPYING in the distribution."))))
6057 (define-public module-init-tools
6059 (name "module-init-tools")
6064 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
6065 "module-init-tools-" version ".tar.bz2"))
6068 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
6069 (patches (search-patches "module-init-tools-moduledir.patch"))))
6070 (build-system gnu-build-system)
6072 ;; FIXME: The upstream tarball lacks man pages, and building them would
6073 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
6074 ;; but they vanished. In the meantime, fake it.
6076 (modify-phases %standard-phases
6077 (add-before 'configure 'fake-docbook
6079 (substitute* "Makefile.in"
6080 (("^DOCBOOKTOMAN.*$")
6081 "DOCBOOKTOMAN = true\n"))
6083 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
6084 (synopsis "Tools for loading and managing Linux kernel modules")
6086 "Tools for loading and managing Linux kernel modules, such as
6087 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
6088 (license license:gpl2+)))
6090 (define-public mcelog
6098 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
6099 (commit (string-append "v" version))))
6100 (file-name (git-file-name name version))
6102 (base32 "1mlwn6ck9qiwqa2vg5wg1gvfva3jv7ygjr7p7bam0qszajs5pirk"))
6103 (modules '((guix build utils)))
6106 ;; The checkout lacks a .git directory, breaking ‘git describe’.
6107 (substitute* "Makefile"
6108 (("\"unknown\"") (string-append "\"v" ,version "\"")))
6110 (build-system gnu-build-system)
6112 `(#:phases (modify-phases %standard-phases
6113 (delete 'configure)) ; no configure script
6114 #:make-flags (let ((out (assoc-ref %outputs "out")))
6115 (list (string-append "CC=" ,(cc-for-target))
6116 (string-append "prefix=" out)
6117 (string-append "DOCDIR=" out "/share/doc/"
6119 "etcprefix=$(DOCDIR)/examples"))
6120 ;; The tests will only run as root on certain supported CPU models.
6122 (supported-systems (list "i686-linux" "x86_64-linux"))
6123 (home-page "https://mcelog.org/")
6124 (synopsis "Machine check monitor for x86 Linux systems")
6126 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
6127 systems running the kernel Linux. It can also perform user-defined tasks, such
6128 as bringing bad pages off-line, when configurable error thresholds are
6130 (license license:gpl2)))
6132 (define-public mtd-utils
6139 "ftp://ftp.infradead.org/pub/mtd-utils/"
6140 "mtd-utils-" version ".tar.bz2"))
6143 "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
6145 '(#:configure-flags '("--enable-unit-tests")))
6147 `(("cmocka" ,cmocka)
6148 ("pkg-config" ,pkg-config)))
6150 `(("acl" ,acl) ; extended attributes (xattr)
6151 ("libuuid" ,util-linux "lib")
6153 ("openssl" ,openssl) ; optional crypto support
6155 ("zstd" ,zstd "lib")))
6156 (build-system gnu-build-system)
6157 (synopsis "MTD Flash Storage Utilities")
6158 (description "This package provides utilities for testing, partitioning, etc
6160 (home-page "http://www.linux-mtd.infradead.org/")
6162 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
6163 license:mpl1.1 ; All ftl* files
6164 license:expat)))) ; libiniparser
6166 (define-public libseccomp
6172 (uri (string-append "https://github.com/seccomp/libseccomp/"
6173 "releases/download/v" version
6174 "/libseccomp-" version ".tar.gz"))
6177 "0m8dlg1v7kflcxvajs4p76p275qwsm2abbf5mfapkakp7hw7wc7f"))))
6178 (build-system gnu-build-system)
6180 '(#:configure-flags '("--disable-static")
6181 #:phases (modify-phases %standard-phases
6182 (add-before 'check 'skip-load-test
6184 ;; This test does a native system call and fails when
6185 ;; run under QEMU user-mode emulation. Just skip it.
6186 (delete-file "tests/52-basic-load.tests")
6191 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
6192 (description "The libseccomp library provides an easy to use, platform
6193 independent, interface to the Linux Kernel's syscall filtering mechanism. The
6194 libseccomp API is designed to abstract away the underlying BPF based syscall
6195 filter language and present a more conventional function-call based filtering
6196 interface that should be familiar to, and easily adopted by, application
6198 (home-page "https://github.com/seccomp/libseccomp")
6199 (license license:lgpl2.1)))
6201 (define-public radeontop
6209 (url "https://github.com/clbr/radeontop")
6210 (commit (string-append "v" version))))
6211 (file-name (git-file-name name version))
6213 (base32 "0ay6vl9zsz9b2scy0fnsy482pzizj52i27syxwny4z4i9wrk2wmn"))))
6214 (build-system gnu-build-system)
6216 `(#:phases (modify-phases %standard-phases
6217 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
6218 ;; dependency, and doesn't even work on release(!) tarballs.
6219 (add-after 'unpack 'report-correct-version
6221 (substitute* "getver.sh"
6223 (string-append "ver=" ,version)))
6225 (delete 'configure)) ; no configure script
6226 #:make-flags (list "CC=gcc"
6227 (string-append "PREFIX=" %output))
6228 #:tests? #f)) ; no tests
6230 `(("gettext" ,gettext-minimal)
6231 ("pkg-config" ,pkg-config)))
6233 `(("libdrm" ,libdrm)
6234 ("libpciaccess" ,libpciaccess)
6236 ("ncurses" ,ncurses)))
6237 (home-page "https://github.com/clbr/radeontop/")
6238 (synopsis "Usage monitor for AMD Radeon graphics")
6239 (description "RadeonTop monitors resource consumption on supported AMD
6240 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
6241 a terminal or saved to a file for further processing. It measures both the
6242 activity of the GPU as a whole, which is also accurate during OpenCL
6243 computations, as well as separate component statistics that are only meaningful
6244 under OpenGL graphics workloads.")
6245 (license license:gpl3)))
6247 (define-public efivar
6253 (uri (string-append "https://github.com/rhboot/" name
6254 "/releases/download/" version "/" name
6255 "-" version ".tar.bz2"))
6258 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
6259 (build-system gnu-build-system)
6261 `(;; Tests require a UEFI system and is not detected in the chroot.
6263 #:make-flags (list (string-append "prefix=" %output)
6264 (string-append "libdir=" %output "/lib")
6266 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6268 (modify-phases %standard-phases
6269 (delete 'configure))))
6271 `(("pkg-config" ,pkg-config)))
6274 (home-page "https://github.com/rhboot/efivar")
6275 (synopsis "Tool and library to manipulate EFI variables")
6276 (description "This package provides a library and a command line
6277 interface to the variable facility of UEFI boot firmware.")
6278 (license license:lgpl2.1+)))
6280 (define-public efibootmgr
6288 (url "https://github.com/rhinstaller/efibootmgr")
6290 (file-name (git-file-name name version))
6292 (base32 "1niicijxg59rsmiw3rsjwy4bvi1n42dynvm01lnp9haixdzdpq03"))
6293 (patches (search-patches "efibootmgr-remove-extra-decl.patch"))))
6294 (build-system gnu-build-system)
6296 `(#:tests? #f ;no tests
6297 #:make-flags (list (string-append "prefix=" %output)
6298 (string-append "libdir=" %output "/lib")
6299 ;; EFIDIR denotes a subdirectory relative to the
6300 ;; EFI System Partition where the loader will be
6301 ;; installed (known as OS_VENDOR in the code).
6302 ;; GRUB overrides this, as such it's only used if
6303 ;; nothing else is specified on the command line.
6305 #:phases (modify-phases %standard-phases (delete 'configure))))
6307 `(("pkg-config" ,pkg-config)))
6309 `(("efivar" ,efivar)
6311 (home-page "https://github.com/rhinstaller/efibootmgr")
6312 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
6314 "@code{efibootmgr} is a user-space application to modify the Intel
6315 Extensible Firmware Interface (EFI) Boot Manager. This application can
6316 create and destroy boot entries, change the boot order, change the next
6317 running boot option, and more.")
6318 (license license:gpl2+)))
6320 (define-public sysstat
6327 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6328 "sysstat-" version ".tar.xz"))
6330 (base32 "1z8bdyj92q0capbrdscwzb51bqh54ng15gpvmjmvrb2syhqj8hxf"))))
6331 (build-system gnu-build-system)
6333 `(#:tests? #f ; no test suite.
6334 ;; Without this flag, it tries to install the man pages with group 'root'
6335 ;; and fails because /etc/passwd lacks an entry for the root user.
6337 (list "--disable-file-attr"
6338 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
6340 (modify-phases %standard-phases
6341 ;; The build process tries to create '/var/lib/sa', so we skip that
6343 (add-after 'build 'skip-touching-var
6345 (substitute* "Makefile"
6346 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
6349 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
6350 (synopsis "Performance monitoring tools for Linux")
6351 (description "The sysstat utilities are a collection of performance
6352 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
6353 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
6354 @code{sadf} and @code{sa}.")
6355 (license license:gpl2+)))
6357 (define-public light
6365 (url "https://github.com/haikarainen/light")
6366 (commit (string-append "v" version))))
6368 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
6369 (file-name (git-file-name name version))))
6370 (build-system gnu-build-system)
6373 (modify-phases %standard-phases
6374 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
6375 (lambda* (#:key inputs #:allow-other-keys)
6376 (substitute* "90-backlight.rules"
6377 (("/bin/chgrp") (which "chgrp"))
6378 (("/bin/chmod") (which "chmod")))
6380 (add-after 'install 'install-udev-rules
6381 (lambda* (#:key outputs #:allow-other-keys)
6382 (let ((out (assoc-ref outputs "out")))
6384 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
6387 `(("autoconf" ,autoconf)
6388 ("automake" ,automake)))
6389 (home-page "https://haikarainen.github.io/light/")
6390 (synopsis "GNU/Linux application to control backlights")
6392 "Light is a program to send commands to screen backlight controllers
6393 under GNU/Linux. Features include:
6396 @item It does not rely on X.
6397 @item Light can automatically figure out the best controller to use, making
6398 full use of underlying hardware.
6399 @item It is possible to set a minimum brightness value, as some controllers
6400 set the screen to be pitch black at a value of 0 (or higher).
6402 (license license:gpl3+)))
6404 (define-public brightnessctl
6406 (name "brightnessctl")
6408 (home-page "https://github.com/Hummer12007/brightnessctl")
6411 (uri (git-reference (url home-page) (commit version)))
6412 (file-name (git-file-name name version))
6415 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
6416 (patches (search-patches "brightnessctl-elogind-support.patch"))))
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/")
6425 (modify-phases %standard-phases
6427 (add-after 'unpack 'adjust-udev-rules
6429 (substitute* "90-brightnessctl.rules"
6430 (("/bin/") "/run/current-system/profile/bin/"))
6433 `(("pkg-config" ,pkg-config)))
6435 `(("elogind" ,elogind)))
6436 (synopsis "Backlight and LED brightness control")
6438 "This program allows you read and control device brightness. Devices
6439 include backlight and LEDs. It can also preserve current brightness before
6440 applying the operation, such as on lid close.
6442 The appropriate permissions must be set on the backlight or LED control
6443 interface in sysfs, which can be accomplished with the included udev rules.")
6444 (license license:expat)))
6454 (url "https://github.com/linrunner/TLP")
6456 (file-name (git-file-name name version))
6458 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
6460 `(("shellcheck" ,shellcheck)))
6464 ("ethtool" ,ethtool)
6468 ("inetutils" ,inetutils)
6471 ("pciutils" ,pciutils)
6475 ("usbutils" ,usbutils)
6476 ("util-linux" ,util-linux)
6477 ("wireless-tools" ,wireless-tools)
6478 ,@(if (let ((system (or (%current-target-system)
6479 (%current-system))))
6480 (or (string-prefix? "i686-" system)
6481 (string-prefix? "x86_64-" system)))
6482 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
6484 (build-system gnu-build-system)
6486 ;; XXX: The full test suite is run with "checkall" but it requires
6487 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
6488 `(#:test-target "shellcheck"
6489 #:modules ((guix build gnu-build-system)
6493 (modify-phases %standard-phases
6494 (delete 'configure) ; no configure script
6495 (add-before 'build 'setenv
6496 (lambda* (#:key outputs #:allow-other-keys)
6497 (let ((out (assoc-ref outputs "out")))
6498 (setenv "TLP_WITH_SYSTEMD" "0")
6499 (setenv "TLP_NO_INIT" "1")
6500 (setenv "TLP_NO_PMUTILS" "1")
6501 (setenv "TLP_SBIN" (string-append out "/bin"))
6502 (setenv "TLP_BIN" (string-append out "/bin"))
6503 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
6504 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
6505 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
6506 (setenv "TLP_CONFDEF"
6507 (string-append out "/share/tlp/defaults.conf"))
6508 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
6510 (string-append out "/lib/elogind/system-sleep"))
6512 (string-append out "/share/bash-completion/completions"))
6513 (setenv "TLP_MAN" (string-append out "/share/man"))
6514 (setenv "TLP_META" (string-append out "/share/metainfo"))
6516 (add-before 'install 'fix-installation
6518 ;; Stop the Makefile from trying to create system directories.
6519 (substitute* "Makefile"
6520 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6521 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6524 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6525 (add-after 'install 'wrap
6526 (lambda* (#:key inputs outputs #:allow-other-keys)
6527 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6528 (bin-files (find-files bin ".*")))
6529 (define (bin-directory input-name)
6530 (let ((p (assoc-ref inputs input-name)))
6531 (and p (string-append p "/bin"))))
6532 (define (sbin-directory input-name)
6533 (string-append (assoc-ref inputs input-name) "/sbin"))
6534 (for-each (lambda (program)
6535 (wrap-program program
6538 (filter-map bin-directory
6550 "x86-energy-perf-policy"))
6551 (filter-map sbin-directory
6557 "wireless-tools"))))))
6560 (home-page "https://linrunner.de/en/tlp/tlp.html")
6561 (synopsis "Power management tool for Linux")
6562 (description "TLP is a power management tool for Linux. It comes with
6563 a default configuration already optimized for battery life. Nevertheless,
6564 TLP is customizable to fulfil system requirements. TLP settings are applied
6565 every time the power supply source is changed.")
6566 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6568 (license (list license:gpl2+ license:gpl3+))))
6573 (version "B.02.19.2")
6576 (uri (string-append "https://www.ezix.org/software/"
6577 "files/lshw-" version
6581 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
6582 (build-system gnu-build-system)
6584 `(#:phases (modify-phases %standard-phases (delete 'configure))
6585 #:tests? #f ; no tests
6587 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6588 (synopsis "List hardware information")
6590 "@command{lshw} (Hardware Lister) is a small tool to provide
6591 detailed information on the hardware configuration of the machine.
6592 It can report exact memory configuration, firmware version, mainboard
6593 configuration, CPU version and speed, cache configuration, bus speed,
6594 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6595 machines (PowerMac G4 is known to work).")
6596 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6597 (license license:gpl2+)))
6599 (define-public libmnl
6606 (uri (string-append "mirror://netfilter.org/libmnl/"
6607 "libmnl-" version ".tar.bz2"))
6610 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6611 (build-system gnu-build-system)
6612 (home-page "https://www.netfilter.org/projects/libmnl/")
6613 (synopsis "Netlink utility library")
6614 (description "Libmnl is a minimalistic user-space library oriented to
6615 Netlink developers. There are a lot of common tasks in parsing, validating,
6616 constructing of both the Netlink header and TLVs that are repetitive and easy to
6617 get wrong. This library aims to provide simple helpers that allows you to
6618 re-use code and to avoid re-inventing the wheel.")
6619 (license license:lgpl2.1+)))
6621 (define-public libnftnl
6628 (uri (string-append "mirror://netfilter.org/libnftnl/"
6629 "libnftnl-" version ".tar.bz2"))
6631 (base32 "1xblq1cbcxhr6qmjpy98i1qdza148idgz99vbhjc7s4vzvfizc4h"))))
6632 (build-system gnu-build-system)
6634 `(("pkg-config" ,pkg-config)))
6636 `(("libmnl" ,libmnl)))
6637 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6638 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6639 (description "Libnftnl is a userspace library providing a low-level netlink
6640 programming interface to the in-kernel nf_tables subsystem. The library
6641 libnftnl has been previously known as libnftables. This library is currently
6643 (license license:gpl2+)))
6645 (define-public nftables
6652 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6654 (string-append "https://www.nftables.org/projects/nftables"
6655 "/files/nftables-" version ".tar.bz2")))
6657 (base32 "1d7iwc8xlyfsbgn6qx1sdfcq7jhpl8wpfj39hcd06y8dzp3jvvvn"))))
6658 (build-system gnu-build-system)
6659 (arguments `(#:configure-flags
6660 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6661 (inputs `(("gmp" ,gmp)
6663 ("libnftnl" ,libnftnl)
6664 ("readline" ,readline)))
6665 (native-inputs `(("pkg-config" ,pkg-config)
6668 (home-page "https://www.nftables.org")
6669 (synopsis "Userspace utility for Linux packet filtering")
6670 (description "nftables is the project that aims to replace the existing
6671 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6672 filtering framework, a new userspace utility and also a compatibility layer for
6673 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6674 infrastructure such as the existing hooks, the connection tracking system, the
6675 userspace queueing component and the logging subsystem.")
6676 (license license:gpl2)))
6678 (define-public proot
6686 (url "https://github.com/proot-me/PRoot")
6687 (commit (string-append "v" version))))
6688 (file-name (git-file-name name version))
6690 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6691 (patches (search-patches "proot-test-fhs.patch"))))
6692 (build-system gnu-build-system)
6694 '(#:make-flags '("-C" "src")
6696 #:phases (modify-phases %standard-phases
6698 (add-before 'build 'set-shell-file-name
6699 (lambda* (#:key inputs #:allow-other-keys)
6700 (substitute* (find-files "src" "\\.[ch]$")
6703 (assoc-ref inputs "bash")
6706 (add-before 'check 'fix-fhs-assumptions-in-tests
6708 (substitute* "tests/test-c6b77b77.mk"
6709 (("/bin/bash") (which "bash"))
6710 (("/usr/bin/test") (which "test")))
6711 (substitute* '("tests/test-16573e73.c")
6712 (("/bin/([a-z-]+)" _ program)
6715 (substitute* (find-files "tests" "\\.sh$")
6716 ;; Some of the tests try to "bind-mount" /bin/true.
6718 (string-append "-b " (which "true") ":"))
6719 ;; Likewise for /bin.
6720 (("-b /bin:") "-b /gnu:")
6721 ;; Others try to run /bin/sh.
6722 (("/bin/sh") (which "sh"))
6723 ;; Others assume /etc/fstab exists.
6724 (("/etc/fstab") "/etc/passwd"))
6726 (substitute* "tests/GNUmakefile"
6727 (("-b /bin:") "-b /gnu:"))
6729 ;; XXX: This test fails in an obscure corner case, just
6731 (delete-file "tests/test-kkkkkkkk.c")
6736 (let ((n (parallel-job-count)))
6737 ;; For some reason we get lots of segfaults with
6738 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6739 (setenv "PROOT_NO_SECCOMP" "1")
6741 ;; Most of the tests expect "/bin" to be in $PATH so
6742 ;; they can run things that live in $ROOTFS/bin.
6744 (string-append (getenv "PATH") ":/bin"))
6746 (invoke "make" "check" "-C" "tests"
6748 "-j" (number->string n)))))
6750 (lambda* (#:key outputs #:allow-other-keys)
6751 ;; The 'install' rule does nearly nothing.
6752 (let* ((out (assoc-ref outputs "out"))
6753 (man1 (string-append out "/share/man/man1")))
6754 ;; TODO: 'make install-care' (does not even
6755 ;; build currently.)
6756 (invoke "make" "-C" "src" "install"
6757 (string-append "PREFIX=" out))
6760 (copy-file "doc/proot/man.1"
6761 (string-append man1 "/proot.1"))
6763 (native-inputs `(("which" ,which)
6765 ;; For 'mcookie', used by some of the tests.
6766 ("util-linux" ,util-linux)
6768 ;; XXX: Choose the old coreutils because its 'stat'
6769 ;; program does not use statx(2) when running 'stat -c
6770 ;; %a' or similar, which PRoot doesn't properly support.
6771 ("coreutils-old" ,coreutils-8.30)
6773 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6774 ;; make 4.3 to segfault.
6775 ("make-old" ,gnu-make-4.2)))
6776 (inputs `(("talloc" ,talloc)))
6777 (home-page "https://github.com/proot-me/PRoot")
6778 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6780 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6781 and @code{binfmt_misc}. This means that users don't need any privileges or
6782 setup to do things like using an arbitrary directory as the new root
6783 file system, making files accessible somewhere else in the file system
6784 hierarchy, or executing programs built for another CPU architecture
6785 transparently through QEMU user-mode. Also, developers can use PRoot as a
6786 generic process instrumentation engine thanks to its extension mechanism.
6787 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6788 available in the kernel Linux.")
6789 (license license:gpl2+)))
6791 (define-public proot-static
6794 (name "proot-static")
6796 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6797 (inputs `(("talloc" ,talloc/static)))
6799 (substitute-keyword-arguments (package-arguments proot)
6800 ((#:make-flags flags)
6801 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6803 `(modify-phases ,phases
6804 (add-after 'strip 'remove-store-references
6805 (lambda* (#:key outputs #:allow-other-keys)
6806 (let* ((out (assoc-ref outputs "out")))
6807 (with-directory-excursion out
6808 (remove-store-references "bin/proot")
6810 ((#:allowed-references _ '("out"))
6813 (define-public cpuid
6816 (version "20201006")
6819 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6820 version ".src.tar.gz"))
6823 "19jnkh57f979b78ak5mpxmdvnkgc33r55cw9shgd2hc380b3zi8k"))))
6824 (build-system gnu-build-system)
6827 (list (string-append "CC=" ,(cc-for-target)))
6828 #:tests? #f ; no tests
6829 #:phases (modify-phases %standard-phases
6830 (delete 'configure) ; no configure script
6831 (add-before 'install 'fix-makefile
6832 (lambda* (#:key outputs #:allow-other-keys)
6833 (substitute* "Makefile"
6834 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6835 ;; Make the compressed manpages writable so that the
6836 ;; reset-gzip-timestamps phase does not error out.
6837 (substitute* "Makefile"
6838 (("-m 444") "-m 644"))
6840 (inputs `(("perl" ,perl)))
6841 (supported-systems '("i686-linux" "x86_64-linux"))
6842 (home-page "http://www.etallen.com/cpuid.html")
6843 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6844 (description "cpuid dumps detailed information about the CPU(s) gathered
6845 from the CPUID instruction, and also determines the exact model of CPU(s). It
6846 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6847 NexGen, Rise, and SiS CPUs.")
6848 (license license:gpl2+)))
6850 (define-public jmtpfs
6858 (url "https://github.com/JasonFerrara/jmtpfs")
6859 (commit (string-append "v" version))))
6860 (file-name (git-file-name name version))
6863 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6864 (build-system gnu-build-system)
6868 ("libmtp" ,libmtp)))
6870 `(("pkg-config" ,pkg-config)))
6871 (home-page "https://github.com/JasonFerrara/jmtpfs")
6872 (synopsis "Use a FUSE file system to access data over MTP")
6873 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6874 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6875 the MTP device as a file system.")
6876 (license license:gpl3)))
6878 (define-public procenv
6886 (url "https://github.com/jamesodhunt/procenv")
6888 (file-name (git-file-name name version))
6890 (base32 "13fnr4gfj2xlxghw93m5gsxzlwzv3s6jv9hja0w0pb23hlncbmhy"))))
6891 (build-system gnu-build-system)
6893 `(("pkg-config" ,pkg-config)
6901 ("libselinux" ,libselinux)))
6902 (synopsis "Utility to show process environment")
6903 (description "Procenv is a command-line tool that displays as much detail about
6904 itself and its environment as possible. It can be used as a test
6905 tool, to understand the type of environment a process runs in, and for
6906 comparing system environments.")
6907 (home-page "https://github.com/jamesodhunt/procenv/")
6908 (license license:gpl3+)))
6910 (define-public libfabric
6918 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6919 version "/libfabric-" version ".tar.bz2"))
6921 (base32 "1nnpfkwxhim2nqjkb1vwrb4wj4j3l6w6yvvy69fqam2snlhshazz"))))
6922 (build-system gnu-build-system)
6923 (inputs `(("rdma-core" ,rdma-core)
6924 ,@(match (%current-system)
6925 ((member (package-supported-systems psm))
6929 (home-page "https://ofiwg.github.io/libfabric/")
6930 (synopsis "Open Fabric Interfaces")
6932 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6933 communication services to applications. OFI is best described as a collection
6934 of libraries and applications used to export fabric services. The key
6935 components of OFI are: application interfaces, provider libraries, kernel
6936 services, daemons, and test applications.
6938 Libfabric is a core component of OFI. It is the library that defines and
6939 exports the user-space API of OFI, and is typically the only software that
6940 applications deal with directly. It works in conjunction with provider
6941 libraries, which are often integrated directly into libfabric.")
6942 (license (list license:bsd-2 license:gpl2)))) ;dual
6947 (version "3.3.20170428")
6948 (home-page "https://github.com/intel/psm")
6952 (uri (git-reference (url home-page)
6953 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6954 (file-name (string-append "psm-" version ".tar.gz"))
6956 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6957 (patches (search-patches
6958 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6959 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6960 "psm-repro.patch" ; reproducibility
6961 "psm-disable-memory-stats.patch"))))
6962 (build-system gnu-build-system)
6963 (outputs '("out" "debug"))
6964 (inputs `(("libuuid" ,util-linux "lib")))
6966 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6967 ,(string-append "INSTALL_PREFIX=" %output)
6968 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6970 #:phases (modify-phases %standard-phases
6972 (add-after 'unpack 'patch-/usr/include
6974 (substitute* "Makefile"
6975 (("\\$\\{DESTDIR}/usr/include")
6976 (string-append %output "/include")))
6977 (substitute* "Makefile"
6978 (("/lib64") "/lib"))
6980 (add-after 'unpack 'patch-sysmacros
6982 (substitute* "ipath/ipath_proto.c"
6983 (("#include <sys/poll.h>" m)
6984 (string-append m "\n"
6985 "#include <sys/sysmacros.h>")))
6987 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6989 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6990 communications interface for the True Scale family of products. PSM users are
6991 enabled with mechanisms necessary to implement higher level communications
6992 interfaces in parallel environments.")
6993 ;; Only Intel-compatable processors are supported.
6994 (supported-systems '("i686-linux" "x86_64-linux"))
6995 (license (list license:bsd-2 license:gpl2)))) ;dual
6997 (define-public snapscreenshot
6999 (name "snapscreenshot")
7000 (version "1.0.14.3")
7004 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
7005 name "-" version ".tar.bz2"))
7007 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
7008 (build-system gnu-build-system)
7011 (let ((out (assoc-ref %outputs "out")))
7012 (list (string-append "BINDIR=" out "/bin")
7013 (string-append "MANDIR=" out "/share/man")))
7014 #:tests? #f ; no test suite
7016 (modify-phases %standard-phases
7017 (delete 'configure) ; ./configure is a snarky no-op
7018 (add-before 'install 'fix-ownership
7019 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
7021 (substitute* "depfun.mak"
7022 ((" -o bin -g bin ") " "))
7024 (add-before 'install 'create-output-directories
7025 (lambda* (#:key outputs #:allow-other-keys)
7026 (let ((out (assoc-ref outputs "out")))
7027 (mkdir-p (string-append out "/share/man/man1"))
7029 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
7030 (synopsis "Take screenshots of one or more Linux text consoles")
7032 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
7033 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
7034 relevant @file{/dev/vcs*} file(s).")
7035 (license license:gpl2)))
7037 (define-public fbcat
7044 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
7045 version "/" name "-" version ".tar.gz"))
7047 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
7048 (build-system gnu-build-system)
7050 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
7051 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
7052 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
7053 `(("pnmtopng" ,netpbm)))
7054 (outputs (list "out" "fbgrab"))
7058 (string-append "PREFIX=" (assoc-ref %outputs "out")))
7059 #:tests? #f ; no tests
7061 (modify-phases %standard-phases
7062 (delete 'configure) ; no configure script
7063 (add-after 'build 'qualify-references
7064 (lambda* (#:key inputs outputs #:allow-other-keys)
7065 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
7066 (out (assoc-ref outputs "out")))
7067 (substitute* "fbgrab"
7069 (string-append out "/bin/" all))
7071 (string-append pnmtopng "/bin/" all)))
7073 (add-after 'install 'split-fbgrab-output
7074 (lambda* (#:key outputs #:allow-other-keys)
7075 (let* ((out (assoc-ref outputs "out"))
7076 (out:fbgrab (assoc-ref outputs "fbgrab")))
7077 (for-each (lambda (file)
7078 (let ((old (string-append out "/" file))
7079 (new (string-append out:fbgrab "/" file)))
7080 (mkdir-p (dirname new))
7081 (rename-file old new)))
7083 "share/man/man1/fbgrab.1"))
7085 (home-page "https://jwilk.net/software/fbcat")
7086 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
7088 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
7089 a dump therof. It supports a wide range of drivers and pixel formats.
7090 @command{fbcat} can take screenshots of virtually any application that can be
7091 made to write its output to the framebuffer, including (but not limited to)
7092 text-mode or graphical applications that don't use a display server.
7094 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
7095 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
7096 (license license:gpl2)))
7098 (define-public libcgroup
7106 "mirror://sourceforge/libcg/" name "/"
7107 version "/" name "-" version ".tar.bz2"))
7109 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
7110 (build-system gnu-build-system)
7117 `(("linux-pam" ,linux-pam)))
7118 (home-page "https://sourceforge.net/projects/libcg/")
7119 (synopsis "Control groups management tools")
7120 (description "Control groups is Linux kernel method for process resource
7121 restriction, permission handling and more. This package provides userspace
7122 interface to this kernel feature.")
7123 (license license:lgpl2.1)))
7125 (define-public mbpfan
7133 (url "https://github.com/dgraziotin/mbpfan")
7134 (commit (string-append "v" version))))
7135 (file-name (git-file-name name version))
7137 (base32 "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr"))))
7138 (build-system gnu-build-system)
7140 `(#:tests? #f ; tests ask to be run as root
7141 #:make-flags (let ((out (assoc-ref %outputs "out")))
7142 (list (string-append "DESTDIR=" out)
7143 ,(string-append "CC=" (cc-for-target))))
7145 (modify-phases %standard-phases
7146 (add-after 'unpack 'patch-paths
7148 (substitute* "Makefile"
7151 (delete 'configure)))) ; there's no configure phase
7152 (home-page "https://github.com/dgraziotin/mbpfan")
7153 (synopsis "Control fan speed on Macbooks")
7155 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
7156 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
7157 module. It can be executed as a daemon or in the foreground with root
7159 (license license:gpl3+)))
7164 (version "11.2.185")
7168 (url "https://github.com/intel/opa-psm2")
7169 (commit (string-append "PSM2_" version))))
7170 (file-name (git-file-name name version))
7173 "062hg4r6gz7pla9df70nqs5i2a3mp1wszmp4l0g771fykhhrxsjg"))))
7174 (build-system gnu-build-system)
7177 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
7179 #:phases (modify-phases %standard-phases
7181 (add-after 'unpack 'patch-Makefiles
7183 (substitute* "Makefile"
7186 (substitute* "compat/Makefile"
7192 (setenv "DESTDIR" %output)
7193 (invoke "make" "install")
7196 `(("rdma-core" ,rdma-core)
7197 ("numactl" ,numactl)))
7198 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
7200 "This package is low-level user-level Intel's communications interface.
7201 The PSM2 API is a high-performance vendor-specific protocol that provides a
7202 low-level communications interface for the Intel Omni-Path family of
7203 high-speed networking devices.")
7204 (home-page "https://github.com/intel/opa-psm2")
7205 ;; Only the x86_64 architecure is supported.
7206 (supported-systems '("x86_64-linux"))
7207 (license (list license:bsd-3 license:gpl2)))) ; dual
7209 (define-public libpfm4
7215 (uri (string-append "mirror://sourceforge/perfmon2/"
7216 name "/libpfm-" version ".tar.gz"))
7219 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
7220 (build-system gnu-build-system)
7222 '(#:modules ((guix build utils)
7223 (guix build gnu-build-system))
7224 #:phases (modify-phases %standard-phases
7228 (lambda* (#:key inputs outputs #:allow-other-keys)
7229 (let* ((out (assoc-ref outputs "out")))
7234 (lambda* (#:key outputs #:allow-other-keys)
7235 (let* ((out (assoc-ref outputs "out")))
7237 (string-append "PREFIX=" out)
7240 (synopsis "Performance event monitoring library")
7242 "This package provides a library called libpfm4, which is used to develop
7243 monitoring tools exploiting the performance monitoring events such as those
7244 provided by the Performance Monitoring Unit (PMU) of modern processors.
7246 Libpfm4 helps convert from an event name, expressed as a string, to the event
7247 encoding that is either the raw event as documented by the hardware vendor or
7248 the OS-specific encoding. In the latter case, the library is able to prepare
7249 the OS-specific data structures needed by the kernel to setup the event.
7251 libpfm4 provides support for the @code{perf_events} interface, which was
7252 introduced in Linux 2.6.31.")
7253 (home-page "http://perfmon2.sourceforge.net/")
7254 (license license:expat)))
7256 (define-public libnfnetlink
7258 (name "libnfnetlink")
7263 "https://www.netfilter.org/projects/libnfnetlink/files/"
7264 "libnfnetlink-" version ".tar.bz2"))
7267 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
7268 (build-system gnu-build-system)
7269 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
7270 (synopsis "Low-level netfilter netlink communication library")
7272 "@code{libnfnetlink} is the low-level library for netfilter related
7273 kernel/userspace communication. It provides a generic messaging
7274 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
7275 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
7276 management tools in userspace.")
7277 (license license:gpl2)))
7279 (define-public go-netlink
7286 (url "https://github.com/vishvananda/netlink")
7287 (commit (string-append "v" version))))
7288 (file-name (git-file-name name version))
7291 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
7292 (build-system go-build-system)
7294 `(#:import-path "github.com/vishvananda/netlink"))
7296 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
7297 ("go-netns" ,go-netns)))
7298 (home-page "https://github.com/vishvananda/netlink")
7299 (synopsis "Simple netlink library for Go")
7300 (description "The netlink package provides a simple netlink library for
7301 Go. Netlink is the interface a user-space program in Linux uses to
7302 communicate with the kernel. It can be used to add and remove interfaces, set
7303 IP addresses and routes, and configure IPsec.")
7304 (license license:asl2.0)))
7306 (define-public libinih
7313 (url "https://github.com/benhoyt/inih")
7314 (commit (string-append "r" version))))
7315 (file-name (git-file-name name version))
7318 "0dqf5j2sw4hq68rqvxbrsf44ygfzx9ypiyzipk4cvp9aimbvsbc6"))))
7319 (build-system meson-build-system)
7321 '(#:configure-flags '("-Ddistro_install=true" "-Ddefault_library=shared")))
7322 (home-page "https://github.com/benhoyt/inih")
7323 (synopsis "Simple .INI parser library for C")
7324 (description "The inih (INI Not Invented Here) library is a simple .INI file
7325 parser written in C. It's only a couple of pages of code, and it was designed to
7326 be small and simple, so it's good for embedded systems. It's also more or less
7327 compatible with Python's ConfigParser style of .INI files, including RFC
7328 822-style multi-line syntax and name: value entries.")
7329 (license license:bsd-3)))
7331 (define-public xfsprogs
7338 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
7339 "xfsprogs-" version ".tar.gz"))
7342 "0b5vvwq4rqw7kph23ycd518d31dx3wq7w61znixxpdljx0ig71qn"))))
7343 (build-system gnu-build-system)
7344 (outputs (list "out" "python"))
7346 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
7348 (modify-phases %standard-phases
7349 (add-after 'install 'separate-python-output
7350 (lambda* (#:key outputs #:allow-other-keys)
7351 (let ((out (assoc-ref outputs "out"))
7352 (python (assoc-ref outputs "python")))
7355 (mkdir-p (string-append python (dirname script)))
7356 (rename-file (string-append out script)
7357 (string-append python script)))
7358 (list "/sbin/xfs_scrub_all"))
7360 (add-after 'install 'install-headers
7362 (invoke "make" "install-dev"))))))
7364 `(("gettext" ,gettext-minimal)))
7366 `(("libinih" ,libinih)
7367 ("libuuid" ,util-linux "lib")
7368 ("python" ,python-wrapper)))
7369 (home-page "https://xfs.wiki.kernel.org/")
7370 (synopsis "XFS file system tools")
7371 (description "This package provides commands to create and check XFS
7373 ;; The library "libhandle" and the headers in "xfslibs-dev" are
7374 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
7375 (license (list license:gpl2 license:lgpl2.1))))
7377 (define-public genext2fs
7384 (url "https://github.com/jeremie-koenig/genext2fs")
7385 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
7386 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
7387 (file-name (git-file-name name version))
7389 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
7390 (build-system gnu-build-system)
7393 (modify-phases %standard-phases
7394 (add-after 'unpack 'apply-debian-patches
7395 ;; Debian changes (the revision after ‘-’ in VERSION) are
7396 ;; maintained as separate patches. Apply those relevant to us.
7400 (invoke "patch" "-p1" "-i"
7401 (string-append "debian/patches/" file-name)))
7402 (list "blocksize+creator.diff" ; add -B/-o options
7403 "byteswap_fix.diff"))
7406 `(("autoconf" ,autoconf)
7407 ("automake" ,automake)))
7408 (home-page "https://github.com/jeremie-koenig/genext2fs")
7409 (synopsis "Generate ext2 file system as a normal user")
7410 (description "This package provides a program to generate an ext2
7411 file system as a normal (non-root) user. It does not require you to mount
7412 the image file to copy files on it, nor does it require that you become
7413 the superuser to make device nodes.")
7414 (license license:gpl2)))
7416 (define-public fakeroot
7421 ;; There are no tags in the repository, so take this snapshot.
7423 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
7424 "fakeroot/fakeroot_" version ".orig.tar.gz"))
7425 (file-name (string-append name "-" version ".tar.gz"))
7428 "0v4m3v1bdqvblwj3vqsb3mllgbci6dsgsydq6765nzvz6n1kd44f"))))
7429 (build-system gnu-build-system)
7432 (modify-phases %standard-phases
7435 ;; The "preroll" script takes care of Autoconf and also
7436 ;; prepares the translated manuals.
7437 (invoke "sh" "./preroll")))
7438 (add-after 'configure 'patch-Makefile
7440 ;; Note: The root of the problem is already in "Makefile.am".
7441 (substitute* "Makefile"
7442 (("/bin/sh") (which "sh")))
7444 (add-after 'unpack 'patch-script
7445 (lambda* (#:key inputs #:allow-other-keys)
7446 (substitute* "scripts/fakeroot.in"
7448 (string-append (assoc-ref inputs "util-linux")
7451 (string-append (assoc-ref inputs "sed")
7454 (string-append (assoc-ref inputs "coreutils")
7457 (add-before 'configure 'setenv
7459 (setenv "LIBS" "-lacl")
7461 (add-before 'check 'prepare-check
7463 (setenv "SHELL" (which "bash"))
7464 (setenv "VERBOSE" "1")
7465 (substitute* "test/t.touchinstall"
7466 ;; We don't have the name of the root user, so use ID=0.
7467 (("grep root") "grep \"\\<0\\>\""))
7468 (substitute* "test/tartest"
7469 ;; We don't have the name of the root group, so use ID=0.
7470 (("ROOTGROUP=root") "ROOTGROUP=0")
7471 ;; We don't have the name of the daemon user, so use IDs.
7472 (("daemon:sys") "1:3")
7474 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
7475 (substitute* "test/compare-tar"
7476 (("tar -tvf") "tar --numeric-owner -tvf"))
7479 `(;; For bootstrapping the package.
7480 ("autoconf" ,autoconf)
7481 ("automake" ,automake)
7482 ("libtool" ,libtool)
7483 ("gettext" ,gettext-minimal)
7487 ("sharutils" ,sharutils)
7492 ("util-linux" ,util-linux)
7494 ("coreutils" ,coreutils)))
7495 (synopsis "Provides a fake root environment")
7496 (description "@command{fakeroot} runs a command in an environment where
7497 it appears to have root privileges for file manipulation. This is useful
7498 for allowing users to create archives (tar, ar, .deb etc.) with files in
7499 them with root permissions/ownership. Without fakeroot one would have to
7500 have root privileges to create the constituent files of the archives with
7501 the correct permissions and ownership, and then pack them up, or one would
7502 have to construct the archives directly, without using the archiver.")
7503 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
7504 (license license:gpl3+)))
7506 (define-public fakechroot
7513 "https://github.com/dex4er/fakechroot/releases/download/"
7514 version "/fakechroot-" version ".tar.gz"))
7517 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
7518 (build-system gnu-build-system)
7520 ;; XXX: The tests heavily assume they run on an FHS system so for now
7523 #:configure-flags '("--disable-static")))
7524 (synopsis "Emulate @code{chroot} by overriding file system calls")
7526 "@command{fakechroot} runs a command in an environment were is additional
7527 possibility to use @code{chroot} command without root privileges. This is
7528 useful for allowing users to create own chrooted environment with possibility
7529 to install another packages without need for root privileges.
7531 It works by providing @file{libfakechroot.so}, a shared library meant to be
7532 set as @code{LD_PRELOAD} to override the C library file system functions.")
7533 (home-page "https://github.com/dex4er/fakechroot/")
7534 (license license:lgpl2.1+)))
7536 (define-public inputattach
7538 (name "inputattach")
7543 (url "https://github.com/linuxwacom/input-wacom")
7544 (commit (string-append "input-wacom-" version))))
7545 (file-name (git-file-name name version))
7547 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
7548 (build-system gnu-build-system)
7551 (modify-phases %standard-phases
7555 (lambda* (#:key inputs #:allow-other-keys)
7556 (with-directory-excursion "inputattach"
7557 (invoke (string-append (assoc-ref inputs "gcc")
7559 "-O2" "-o" "inputattach" "inputattach.c"))
7563 (lambda* (#:key outputs #:allow-other-keys)
7564 (let ((target-dir (string-append
7565 (assoc-ref outputs "out")
7567 (mkdir-p target-dir)
7568 (copy-file "inputattach/inputattach"
7569 (string-append target-dir
7572 (home-page "https://linuxwacom.github.io/")
7573 (synopsis "Dispatch input peripherals events to a device file")
7574 (description "inputattach dispatches input events from several device
7575 types and interfaces and translates so that the X server can use them.")
7576 (license license:gpl2+)))
7578 (define-public pipewire
7585 (url "https://github.com/PipeWire/pipewire")
7587 (file-name (git-file-name name version))
7590 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
7591 (build-system meson-build-system)
7593 '(#:configure-flags '("-Dsystemd=false")))
7595 `(("pkg-config" ,pkg-config)))
7597 `(("alsa-lib" ,alsa-lib)
7601 ("gstreamer" ,gstreamer)
7602 ("gst-plugins-base" ,gst-plugins-base)
7606 (home-page "https://pipewire.org/")
7607 (synopsis "Server and user space API to deal with multimedia pipelines")
7609 "PipeWire is a project that aims to greatly improve handling of audio and
7610 video under Linux. It aims to support the usecases currently handled by both
7611 PulseAudio and Jack and at the same time provide same level of powerful handling
7612 of Video input and output. It also introduces a security model that makes
7613 interacting with audio and video devices from containerized applications easy,
7614 with supporting Flatpak applications being the primary goal. Alongside Wayland
7615 and Flatpak we expect PipeWire to provide a core building block for the future
7616 of Linux application development.")
7617 (license license:lgpl2.0+)))
7619 (define-public pipewire-0.3
7627 (url "https://github.com/PipeWire/pipewire")
7629 (file-name (git-file-name name version))
7632 "16jjxcnahxqfcawz77ywx837ybhwzcivn7hgqb9cmlp1y2syy8gk"))))
7635 (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
7636 "/lib/udev/rules.d")
7637 "-Dsystemd=disabled")
7639 (modify-phases %standard-phases
7640 ;; Skip shrink-runpath, otherwise validate-runpath fails.
7641 (delete 'shrink-runpath))))
7643 (append (package-inputs pipewire)
7646 ("pulseaudio" ,pulseaudio)
7647 ("vulkan-loader" ,vulkan-loader)
7648 ("vulkan-headers" ,vulkan-headers))))))
7657 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7659 (file-name (git-file-name name version))
7662 "1zzpbfdpmfldd7w0h7mwbq0mfqgqwz54nqbq0rmbqlqqpwlkrgb2"))))
7663 (build-system gnu-build-system)
7666 (modify-phases %standard-phases
7667 (add-after 'unpack 'fix-dbus-tests
7669 (substitute* '("unit/test-dbus-message-fds.c"
7670 "unit/test-dbus-properties.c"
7672 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7677 `(("autoconf" ,autoconf)
7678 ("libtool" ,libtool)
7679 ("pkgconfig" ,pkg-config)
7680 ("automake" ,automake)))
7681 (home-page "https://01.org/ell")
7682 (synopsis "Embedded Linux Library")
7683 (description "The Embedded Linux* Library (ELL) provides core, low-level
7684 functionality for system daemons. It typically has no dependencies other than
7685 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7686 ELL is designed to be efficient and compact enough for use on embedded Linux
7687 platforms, it is not limited to resource-constrained systems.")
7688 (license license:lgpl2.1+)))
7690 (define-public lttng-ust
7696 (uri (string-append "https://lttng.org/files/lttng-ust/"
7697 "lttng-ust-" version ".tar.bz2"))
7700 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7701 (build-system gnu-build-system)
7703 `(("liburcu" ,liburcu)
7704 ("numactl" ,numactl)))
7706 `(("python" ,python-3)))
7707 (home-page "https://lttng.org/")
7708 (synopsis "LTTng userspace tracer libraries")
7709 (description "The user space tracing library, liblttng-ust, is the LTTng
7710 user space tracer. It receives commands from a session daemon, for example to
7711 enable and disable specific instrumentation points, and writes event records
7712 to ring buffers shared with a consumer daemon.")
7713 (license license:lgpl2.1+)))
7715 (define-public kexec-tools
7717 (name "kexec-tools")
7721 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7722 "/kexec/kexec-tools-" version ".tar.xz"))
7725 "1hj9mj6x3qs9c8x8mrri9xd3wsg3gwzbab3jfa5ry146xm4pzjcn"))))
7726 (build-system gnu-build-system)
7728 ;; There are no automated tests.
7730 (home-page "https://projects.horms.net/projects/kexec/")
7731 (synopsis "Tools for booting directly into different kernels")
7732 (description "This package provides the @code{kexec} program and ancillary
7733 utilities. Using @code{kexec}, it is possible to boot directly into a new
7734 kernel from the context of an already-running kernel, bypassing the normal
7735 system boot process.")
7736 (license license:gpl2)))
7738 (define-public cachefilesd
7740 (name "cachefilesd")
7745 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7746 "/cachefilesd.git/snapshot/cachefilesd-"
7750 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7751 (build-system gnu-build-system)
7754 `(#:tests? #f ; there are no tests
7756 (let ((prefix-dir (lambda (var dir)
7757 (string-append var "=" %output "/" dir))))
7758 (list (string-append "CC=" ,(cc-for-target))
7759 (prefix-dir "SBINDIR" "sbin/")
7760 (prefix-dir "ETCDIR" "etc/")
7761 (prefix-dir "MANDIR" "share/man/")))
7762 #:phases (modify-phases %standard-phases (delete 'configure))))
7763 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7764 (synopsis "CacheFiles userspace management daemon")
7765 (description "@code{cachefilesd} is a userspace daemon that manages the
7766 cache data store that is used by network file systems such as @code{AFS} and
7767 @code{NFS} to cache data locally on disk. The content of the cache is
7768 persistent over reboots.")
7769 (license license:gpl2+)))
7771 (define-public libbpf
7779 (url "https://github.com/libbpf/libbpf")
7780 (commit (string-append "v" version))))
7781 (file-name (git-file-name name version))
7784 "0ilnnm4q22f8fagwp8kb37licy4ks861i2iqh2djsypqhnxvx3fv"))))
7785 (build-system gnu-build-system)
7787 `(("pkg-config" ,pkg-config)))
7789 ;; In Requires.private of libbpf.pc.
7790 `(("libelf" ,libelf)
7793 `(#:tests? #f ; no tests
7796 (string-append "PREFIX=" (assoc-ref %outputs "out"))
7797 (string-append "LIBDIR=$(PREFIX)/lib")
7799 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
7801 (modify-phases %standard-phases
7803 (add-before 'build 'pre-build
7807 (home-page "https://github.com/libbpf/libbpf")
7808 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
7810 "Libbpf supports building BPF CO-RE-enabled applications, which, in
7811 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
7813 (license `(,license:lgpl2.1 ,license:bsd-2))))
7823 (url "https://github.com/iovisor/bcc")
7824 (commit (string-append "v" version))))
7825 (file-name (git-file-name name version))
7828 "1367c0bzrpclvjvmk0sxgi49rh7j2f9izqk5a7g3yvawh1fmvvjh"))))
7829 (build-system cmake-build-system)
7834 `(("clang-toolchain" ,clang-toolchain)
7835 ("libbpf" ,(package-source libbpf))
7836 ;; LibElf required but libelf does not contain
7837 ;; archives, only object files.
7838 ;; https://github.com/iovisor/bcc/issues/504
7839 ("elfutils" ,elfutils)
7840 ("linux-libre-headers" ,linux-libre-headers)
7842 ("python-wrapper" ,python-wrapper)))
7844 `(;; Tests all require root permissions and a "standard" file hierarchy.
7847 (let ((revision ,version))
7848 `(,(string-append "-DREVISION=" revision)))
7850 (modify-phases %standard-phases
7851 ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
7852 (add-after 'unpack 'copy-libbpf
7853 (lambda* (#:key inputs #:allow-other-keys)
7854 (delete-file-recursively "src/cc/libbpf")
7856 (assoc-ref inputs "libbpf") "src/cc/libbpf")))
7857 (add-after 'copy-libbpf 'substitute-libbc
7858 (lambda* (#:key outputs #:allow-other-keys)
7859 (substitute* "src/python/bcc/libbcc.py"
7860 (("(libbcc\\.so.*)\\b" _ libbcc)
7862 (assoc-ref outputs "out") "/lib/" libbcc)))))
7863 (add-after 'install 'wrap-tools
7864 (lambda* (#:key outputs #:allow-other-keys)
7865 (use-modules (ice-9 textual-ports))
7866 (let* ((out (assoc-ref outputs "out"))
7867 (lib (string-append out "/lib"))
7868 (tools (string-append out "/share/bcc/tools"))
7870 (lambda (filename _)
7871 (call-with-input-file filename
7873 (string-contains (get-line port)
7876 (lambda (python-executable)
7877 (format #t "Wrapping: ~A.~%" python-executable)
7878 (wrap-program python-executable
7879 `("PYTHONPATH" ":" prefix
7880 (,(string-append lib
7882 ,(version-major+minor
7883 (package-version python))
7884 "/site-packages")))))
7885 (find-files tools python-executable?))
7887 (home-page "https://github.com/iovisor/bcc")
7888 (synopsis "Tools for BPF on Linux")
7890 "BCC is a toolkit for creating efficient kernel tracing and manipulation
7891 programs, and includes several useful tools and examples. It makes use of
7892 extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
7893 that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
7895 (license license:asl2.0)))
7897 (define-public bpftrace
7905 (url "https://github.com/iovisor/bpftrace")
7906 (commit (string-append "v" version))))
7907 (file-name (git-file-name name version))
7909 (base32 "0y4qgm2cpccrsm20rnh92hqplddqsc5q5zhw9nqn2igm3h9i0z7h"))
7910 (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
7911 (build-system cmake-build-system)
7917 ("clang-toolchain" ,clang-toolchain)
7918 ("elfutils" ,elfutils)
7920 ("linux-libre-headers" ,linux-libre-headers)))
7922 `(#:tests? #f ;Tests require googletest sources.
7924 '("-DBUILD_TESTING=OFF"
7925 ;; FIXME: libbfd misses some link dependencies, when fixed, remove
7926 ;; the associated patch.
7927 "-DHAVE_BFD_DISASM=OFF")))
7928 (home-page "https://github.com/iovisor/bpftrace")
7929 (synopsis "High-level tracing language for Linux eBPF")
7931 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
7932 Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
7933 LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
7934 interacting with the Linux BPF system, as well as existing Linux tracing
7935 capabilities: kernel dynamic tracing (kprobes), user-level dynamic
7936 tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
7937 and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
7938 created by Alastair Robertson.")
7939 (license license:asl2.0)))
7941 (define-public ttyebus-linux-module
7942 (let ((revision "0")
7943 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
7945 (name "ttyebus-linux-module")
7946 (version (git-version "1.5" revision commit))
7951 (url "https://github.com/eBUS/ttyebus")
7952 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
7953 (file-name (git-file-name name version))
7956 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
7957 (supported-systems '("armhf-linux" "aarch64-linux"))
7958 (build-system linux-module-build-system)
7961 (home-page "https://github.com/eBUS/ttyebus")
7962 (synopsis "Low-latency Raspberry Pi UART driver")
7963 (description "This package provides a Linux kernel module that will
7964 provide a serial device @code{/dev/ttyebus} with almost no latency upon
7965 receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
7966 (license license:gpl3+))))
7968 (define-public ipset
7975 (uri (string-append "https://ipset.netfilter.org/"
7976 "ipset-" version ".tar.bz2"))
7978 (base32 "0zdzp9fhpp6hmirzxy7w27fb9xx9lxd2ykxbn8by7ngi62nvll9i"))))
7979 (build-system gnu-build-system)
7981 `(("libmnl" ,libmnl)))
7983 `(("pkg-config" ,pkg-config)))
7985 `(#:configure-flags '("--with-kmod=no")))
7986 (home-page "https://ipset.netfilter.org/")
7987 (synopsis "Administration tool for IP sets")
7988 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
7989 can be administered by the ipset utility. Depending on the type,
7990 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
7991 IP addresses with MAC addresses in a way which ensures lightning speed
7992 when matching an entry against a set.
7996 @item store multiple IP addresses or port numbers and match against the entire
7997 collection using a single iptables rule.
7998 @item dynamically update iptables rules against IP addresses or ports without
7999 performance penalty.
8000 @item express complex IP address and ports based rulesets with a single
8001 iptables rule and benefit from the speed of IP sets.
8003 then IP sets may be the proper tool for you.")
8004 (license license:gpl2+)))
8006 (define-public liburing
8013 (url "https://git.kernel.dk/liburing")
8014 (commit (string-append "liburing-" version))))
8015 (file-name (git-file-name name version))
8018 "15z44l7y4c6s6dlf7v8lq4znlsjbja2r4ifbni0l8cdcnq0w3zh3"))))
8019 (build-system gnu-build-system)
8021 `(;; Tests are dependent on kernel version and features
8024 (modify-phases %standard-phases
8026 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
8027 ;; --enable-fast-install, and --build
8028 (lambda* (#:key outputs #:allow-other-keys)
8029 (let ((out (assoc-ref outputs "out")))
8030 (setenv "SHELL" (which "sh"))
8031 (setenv "CONFIG_SHELL" (which "sh"))
8032 (invoke "./configure" (string-append "--prefix=" out))))))))
8033 (home-page "https://github.com/axboe/liburing")
8034 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
8035 (description "This is the io_uring library, liburing. liburing provides
8036 helpers to setup and teardown io_uring instances, and also a simplified
8037 interface for applications that don't need (or want) to deal with the full
8038 kernel side implementation.")
8039 (license license:expat)))
8041 (define-public erofs-utils
8043 (name "erofs-utils")
8049 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
8050 (commit (string-append "v" version))))
8051 (file-name (git-file-name name version))
8053 (base32 "1vb4mxsb59g29x7l22cffsqa8x743sra4j5zbmx89hjwpwm9vvcg"))))
8054 (build-system gnu-build-system)
8057 ("libuuid" ,util-linux "lib")))
8059 `(("autoconf" ,autoconf)
8060 ("automake" ,automake)
8061 ("libtool" ,libtool)
8062 ("pkg-config" ,pkg-config)))
8063 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
8064 (synopsis "User-space tools for EROFS file system")
8065 (description "EROFS (Enhanced Read-Only File System) is a compressed,
8066 read-only file system optimized for resource-scarce devices. This package
8067 provides user-space tools for creating EROFS file systems.")
8068 (license license:gpl2+)))
8070 (define-public rasdaemon
8078 (url "https://github.com/mchehab/rasdaemon")
8079 (commit (string-append "v" version))))
8080 (file-name (git-file-name name version))
8082 (base32 "12ih96jwmr7imp9zyckf9zjqqm5ra1kv5fj6kbw71y6yl31069dz"))))
8083 (native-inputs `(("autoconf" ,autoconf)
8084 ("automake" ,automake)
8085 ("libtool" ,libtool)))
8086 (inputs `(("sqlite" ,sqlite)))
8089 (list "--enable-all"
8090 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
8091 "--with-sysconfdefdir=."
8092 "--localstatedir=/var")
8094 (modify-phases %standard-phases
8095 (add-before 'configure 'munge-autotools
8097 ;; For some reason upstream forces sysconfdir=/etc. This results
8098 ;; in EPERM during the install phase. Removing the offending
8099 ;; line lets sysconfdir correctly pick up DESTDIR.
8100 (substitute* "configure.ac"
8101 (("^test .* sysconfdir=/etc\n$") ""))
8102 ;; Upstream tries to create /var/lib/rasdaemon at install time.
8103 ;; This results in EPERM on guix. Instead, the service should
8104 ;; create this at activation time.
8105 (substitute* "Makefile.am"
8106 (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") "")))))))
8107 (build-system gnu-build-system)
8108 (home-page "https://github.com/mchehab/rasdaemon")
8109 (synopsis "Platform Reliability, Availability, and Serviceability tools")
8111 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
8112 Availability and Serviceability} reports from Linux kernel trace events.
8113 These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
8114 through standard log mechanisms like syslog.")
8115 (license license:gpl2)))