1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2021 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
12 ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
13 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
14 ;;; Copyright © 2016, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
19 ;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
22 ;;; Copyright © 2017, 2018, 2020 Leo Famulari <leo@famulari.name>
23 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
24 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
25 ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
26 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
27 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
30 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
31 ;;; Copyright © 2018, 2020 Brendan Tildesley <mail@brendan.scot>
32 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
33 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
34 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
35 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
36 ;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
37 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
38 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
39 ;;; Copyright © 2019, 2020 Brice Waegeneire <brice@waegenei.re>
40 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
41 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
42 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
43 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
44 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
45 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
46 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
47 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
48 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
49 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
50 ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
51 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
52 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
53 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
54 ;;; Copyright © 2020 David Dashyan <mail@davie.li>
55 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
56 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
58 ;;; This file is part of GNU Guix.
60 ;;; GNU Guix is free software; you can redistribute it and/or modify it
61 ;;; under the terms of the GNU General Public License as published by
62 ;;; the Free Software Foundation; either version 3 of the License, or (at
63 ;;; your option) any later version.
65 ;;; GNU Guix is distributed in the hope that it will be useful, but
66 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
67 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
68 ;;; GNU General Public License for more details.
70 ;;; You should have received a copy of the GNU General Public License
71 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
73 (define-module (gnu packages linux)
74 #:use-module (gnu packages)
75 #:use-module (gnu packages acl)
76 #:use-module (gnu packages admin)
77 #:use-module (gnu packages algebra)
78 #:use-module (gnu packages audio)
79 #:use-module (gnu packages autotools)
80 #:use-module (gnu packages backup)
81 #:use-module (gnu packages base)
82 #:use-module (gnu packages bash)
83 #:use-module (gnu packages bison)
84 #:use-module (gnu packages boost)
85 #:use-module (gnu packages calendar)
86 #:use-module (gnu packages check)
87 #:use-module (gnu packages cpio)
88 #:use-module (gnu packages crypto)
89 #:use-module (gnu packages cryptsetup)
90 #:use-module (gnu packages compression)
91 #:use-module (gnu packages dbm)
92 #:use-module (gnu packages datastructures)
93 #:use-module (gnu packages docbook)
94 #:use-module (gnu packages documentation)
95 #:use-module (gnu packages elf)
96 #:use-module (gnu packages flex)
97 #:use-module (gnu packages file)
98 #:use-module (gnu packages freedesktop)
99 #:use-module (gnu packages gawk)
100 #:use-module (gnu packages gcc)
101 #:use-module (gnu packages gettext)
102 #:use-module (gnu packages glib)
103 #:use-module (gnu packages golang)
104 #:use-module (gnu packages gperf)
105 #:use-module (gnu packages gstreamer)
106 #:use-module (gnu packages gtk)
107 #:use-module (gnu packages haskell-apps)
108 #:use-module (gnu packages haskell-xyz)
109 #:use-module (gnu packages libunwind)
110 #:use-module (gnu packages libusb)
111 #:use-module (gnu packages llvm)
112 #:use-module (gnu packages lua)
113 #:use-module (gnu packages man)
114 #:use-module (gnu packages maths)
115 #:use-module (gnu packages multiprecision)
116 #:use-module (gnu packages ncurses)
117 #:use-module (gnu packages netpbm)
118 #:use-module (gnu packages networking)
119 #:use-module (gnu packages ninja)
120 #:use-module (gnu packages nss)
121 #:use-module (gnu packages perl)
122 #:use-module (gnu packages pciutils)
123 #:use-module (gnu packages pkg-config)
124 #:use-module (gnu packages popt)
125 #:use-module (gnu packages pulseaudio)
126 #:use-module (gnu packages python)
127 #:use-module (gnu packages python-xyz)
128 #:use-module (gnu packages readline)
129 #:use-module (gnu packages rrdtool)
130 #:use-module (gnu packages samba)
131 #:use-module (gnu packages sdl)
132 #:use-module (gnu packages serialization)
133 #:use-module (gnu packages slang)
134 #:use-module (gnu packages sqlite)
135 #:use-module (gnu packages texinfo)
136 #:use-module (gnu packages tls)
137 #:use-module (gnu packages valgrind)
138 #:use-module (gnu packages video)
139 #:use-module (gnu packages vulkan)
140 #:use-module (gnu packages web)
141 #:use-module (gnu packages xiph)
142 #:use-module (gnu packages xml)
143 #:use-module (gnu packages xdisorg)
144 #:use-module (gnu packages xorg)
145 #:use-module (gnu packages groff)
146 #:use-module (gnu packages rsync)
147 #:use-module (gnu packages selinux)
148 #:use-module (gnu packages swig)
149 #:use-module (guix build-system cmake)
150 #:use-module (guix build-system gnu)
151 #:use-module (guix build-system go)
152 #:use-module (guix build-system meson)
153 #:use-module (guix build-system python)
154 #:use-module (guix build-system trivial)
155 #:use-module (guix build-system linux-module)
156 #:use-module (guix download)
157 #:use-module (guix git-download)
158 #:use-module ((guix licenses) #:prefix license:)
159 #:use-module (guix packages)
160 #:use-module (guix gexp)
161 #:use-module (guix store)
162 #:use-module (guix monads)
163 #:use-module (guix utils)
164 #:use-module (guix deprecation) ;for libcap/next
165 #:use-module (srfi srfi-1)
166 #:use-module (srfi srfi-2)
167 #:use-module (srfi srfi-26)
168 #:use-module (ice-9 match))
170 (define-public (system->linux-architecture arch)
171 "Return the Linux architecture name for ARCH, a Guix system name such as
172 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
173 (let ((arch (car (string-split arch #\-))))
174 (cond ((string=? arch "i686") "i386")
175 ((string-prefix? "mips" arch) "mips")
176 ((string-prefix? "arm" arch) "arm")
177 ((string-prefix? "aarch64" arch) "arm64")
178 ((string-prefix? "alpha" arch) "alpha")
179 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
180 ((string-prefix? "s390" arch) "s390")
181 ((string-prefix? "riscv" arch) "riscv")
184 (define-public (system->defconfig system)
185 "Some systems (notably powerpc-linux) require a special target for kernel
186 defconfig. Return the appropriate make target if applicable, otherwise return
188 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
189 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
190 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
195 ;;; Kernel source code deblobbing.
198 (define (linux-libre-deblob-scripts version
201 (list (version-major+minor version)
204 (uri (string-append "https://linux-libre.fsfla.org"
205 "/pub/linux-libre/releases/" version "-gnu/"
206 "deblob-" (version-major+minor version)))
207 (file-name (string-append "linux-libre-deblob-"
209 (sha256 deblob-hash))
212 (uri (string-append "https://linux-libre.fsfla.org"
213 "/pub/linux-libre/releases/" version "-gnu/"
215 (file-name (string-append "linux-libre-deblob-check-" version))
216 (sha256 deblob-check-hash))))
218 (define* (computed-origin-method gexp-promise hash-algo hash
219 #:optional (name "source")
220 #:key (system (%current-system))
221 (guile (default-guile)))
222 "Return a derivation that executes the G-expression that results
223 from forcing GEXP-PROMISE."
224 (mlet %store-monad ((guile (package->derivation guile system)))
225 (gexp->derivation (or name "computed-origin")
227 #:graft? #f ;nothing to graft
229 #:guile-for-build guile)))
231 (define (make-linux-libre-source version
234 "Return a 'computed' origin that generates a Linux-libre tarball from the
235 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
236 (match deblob-scripts
237 ((deblob-version (? origin? deblob) (? origin? deblob-check))
238 (unless (string=? deblob-version (version-major+minor version))
239 ;; The deblob script cannot be expected to work properly on a
240 ;; different version (major+minor) of Linux, even if no errors
241 ;; are signaled during execution.
242 (error "deblob major+minor version mismatch"))
244 (method computed-origin-method)
245 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
249 (with-imported-modules '((guix build utils))
251 (use-modules (guix build utils)
256 (setvbuf (current-output-port) 'line)
258 (let ((dir (string-append "linux-" #$version)))
261 (set-path-environment-variable
264 #+(canonical-package bash)
265 #+(canonical-package coreutils)
266 #+(canonical-package diffutils)
267 #+(canonical-package findutils)
268 #+(canonical-package patch)
269 #+(canonical-package xz)
270 #+(canonical-package sed)
271 #+(canonical-package grep)
272 #+(canonical-package bzip2)
273 #+(canonical-package gzip)
274 #+(canonical-package tar)
275 #+(canonical-package gawk)
278 (with-directory-excursion "/tmp/bin"
280 (copy-file #+deblob "deblob")
281 (chmod "deblob" #o755)
282 (substitute* "deblob"
283 (("/bin/sh") (which "sh")))
285 (copy-file #+deblob-check "deblob-check")
286 (chmod "deblob-check" #o755)
287 (substitute* "deblob-check"
288 (("/bin/sh") (which "sh"))
289 (("/bin/sed") (which "sed"))
290 (("/usr/bin/python") (which "python"))))
292 (if (file-is-directory? #+upstream-source)
294 (format #t "Copying upstream linux source...~%")
295 (invoke "cp" "--archive" #+upstream-source dir)
296 (invoke "chmod" "--recursive" "u+w" dir))
298 (format #t "Unpacking upstream linux tarball...~%")
299 (invoke "tar" "xf" #$upstream-source)
302 (and (not (member name '("." "..")))
303 (file-is-directory? name))))
305 (unless (string=? dir unpacked-dir)
306 (rename-file unpacked-dir dir)))
308 (error "multiple directories found" dirs)))))
310 (with-directory-excursion dir
311 (format #t "Running deblob script...~%")
312 (invoke "/tmp/bin/deblob"))
314 (format #t "~%Packing new Linux-libre tarball...~%")
315 (invoke "tar" "cvfa" #$output
316 ;; Avoid non-determinism in the archive.
324 (format #t "~%Scanning the generated tarball for blobs...~%")
325 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
333 (define (linux-libre-urls version)
334 "Return a list of URLs for Linux-Libre VERSION."
336 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
337 version "-gnu/linux-libre-" version "-gnu.tar.xz")
339 ;; XXX: Work around <http://bugs.gnu.org/14851>.
341 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
342 version "-gnu.tar.xz")
344 ;; Maybe this URL will become valid eventually.
346 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
347 version "-gnu.tar.xz")))
349 (define (%upstream-linux-source version hash)
352 (uri (string-append "mirror://kernel.org"
353 "/linux/kernel/v" (version-major version) ".x/"
354 "linux-" version ".tar.xz"))
357 ;; The current "stable" kernels. That is, the most recently released major
358 ;; versions that are still supported upstream.
359 (define-public linux-libre-5.12-version "5.12.7")
360 (define deblob-scripts-5.12
361 (linux-libre-deblob-scripts
362 linux-libre-5.12-version
363 (base32 "1vdsr9y4gckknrbqcjyfakwva3k0vb5zcivzk3k1s9mh7qp9dils")
364 (base32 "1qp25fd4wgjyk7dzdq9yirm1z5w68sd1p3wv8lch8259i51gwjnf")))
365 (define-public linux-libre-5.12-pristine-source
366 (let ((version linux-libre-5.12-version)
367 (hash (base32 "0ircrclggrbmm80vz7irhg73qvhjddsmf7zclw5cqnnmm3qfj8jk")))
368 (make-linux-libre-source version
369 (%upstream-linux-source version hash)
370 deblob-scripts-5.12)))
372 ;; The "longterm" kernels — the older releases with long-term upstream support.
373 ;; Here are the support timelines:
374 ;; <https://www.kernel.org/category/releases.html>
375 (define-public linux-libre-5.10-version "5.10.40")
376 (define deblob-scripts-5.10
377 (linux-libre-deblob-scripts
378 linux-libre-5.10-version
379 (base32 "1rmnx1px4sizs2lq831yd2g9dyflg0vmykz3cv9443x2a2vwy81f")
380 (base32 "0hh27ccqimagr3aij7ygwikxw66y63sqwd0xlf49bhpjd090r9a7")))
381 (define-public linux-libre-5.10-pristine-source
382 (let ((version linux-libre-5.10-version)
383 (hash (base32 "091g9g29m4vh66bxihiylyprb3cxr8cy4m494klb2lkirlx8103l")))
384 (make-linux-libre-source version
385 (%upstream-linux-source version hash)
386 deblob-scripts-5.10)))
388 (define-public linux-libre-5.4-version "5.4.122")
389 (define deblob-scripts-5.4
390 (linux-libre-deblob-scripts
391 linux-libre-5.4-version
392 (base32 "12g1wm7xvjvmjanbgg0ahxm4vs2n5bvicfnnnag4h35vl4q3lggg")
393 (base32 "1xghbbnaisjd0k1klbyn1p7r6r4x5a1bpmkm56a3gh2zvw4s7mj8")))
394 (define-public linux-libre-5.4-pristine-source
395 (let ((version linux-libre-5.4-version)
396 (hash (base32 "00g6s3ymriwddshy5sd458b1wfvw2ynxv6dr63ziykwfq50jlr9p")))
397 (make-linux-libre-source version
398 (%upstream-linux-source version hash)
399 deblob-scripts-5.4)))
401 (define-public linux-libre-4.19-version "4.19.191")
402 (define deblob-scripts-4.19
403 (linux-libre-deblob-scripts
404 linux-libre-4.19-version
405 (base32 "1jfcz4lnm44b3xzrkiipvw35kl0vvdvhr2pg7jfwf02f6qbvay18")
406 (base32 "1jiaw0as1ippkrjdpd52657w5mz9qczg3y2hlra7m9k0xawwiqlf")))
407 (define-public linux-libre-4.19-pristine-source
408 (let ((version linux-libre-4.19-version)
409 (hash (base32 "1jd97rzv900mnyzps4xmf6k166zrg391vcrbmr5zvcway5qbn9mm")))
410 (make-linux-libre-source version
411 (%upstream-linux-source version hash)
412 deblob-scripts-4.19)))
414 (define-public linux-libre-4.14-version "4.14.233")
415 (define deblob-scripts-4.14
416 (linux-libre-deblob-scripts
417 linux-libre-4.14-version
418 (base32 "07afckszdm4pq008i6ij0pxpw2rpgi5q931nxh6dxcczpicvwbc9")
419 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
420 (define-public linux-libre-4.14-pristine-source
421 (let ((version linux-libre-4.14-version)
422 (hash (base32 "0sqikz8cvrjfs46mcqx9gbdfkpdims0m5xxxzwr5vcfph5rdvj26")))
423 (make-linux-libre-source version
424 (%upstream-linux-source version hash)
425 deblob-scripts-4.14)))
427 (define-public linux-libre-4.9-version "4.9.269")
428 (define deblob-scripts-4.9
429 (linux-libre-deblob-scripts
430 linux-libre-4.9-version
431 (base32 "1w8cb8w1cpcwswc3rxq6vwjafw6yy0igib34rrm93ag5h6inncfv")
432 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
433 (define-public linux-libre-4.9-pristine-source
434 (let ((version linux-libre-4.9-version)
435 (hash (base32 "1pnggwc9i6hka21vvl4yd9pd38hpnym9z56m4mhl970ijl4zywbr")))
436 (make-linux-libre-source version
437 (%upstream-linux-source version hash)
438 deblob-scripts-4.9)))
440 (define-public linux-libre-4.4-version "4.4.269")
441 (define deblob-scripts-4.4
442 (linux-libre-deblob-scripts
443 linux-libre-4.4-version
444 (base32 "1lid4k7g947yi3hcjj0lz0fnssawbph3jsy67vrv57l5imrhv3zs")
445 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
446 (define-public linux-libre-4.4-pristine-source
447 (let ((version linux-libre-4.4-version)
448 (hash (base32 "0qx5zwi2ijwv9jwhs4cz91z7yxy6nd0g8ryzrlg1ar2xyk8w4yh4")))
449 (make-linux-libre-source version
450 (%upstream-linux-source version hash)
451 deblob-scripts-4.4)))
453 (define %boot-logo-patch
454 ;; Linux-Libre boot logo featuring Freedo and a gnu.
457 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
458 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
461 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
463 (define %linux-libre-arm-export-__sync_icache_dcache-patch
467 "https://salsa.debian.org/kernel-team/linux"
468 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
469 "/debian/patches/bugfix/arm/"
470 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
471 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
473 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
475 (define (source-with-patches source patches)
478 (patches (append (origin-patches source)
481 (define-public linux-libre-5.12-source
482 (source-with-patches linux-libre-5.12-pristine-source
483 (list %boot-logo-patch
484 %linux-libre-arm-export-__sync_icache_dcache-patch)))
486 (define-public linux-libre-5.10-source
487 (source-with-patches linux-libre-5.10-pristine-source
488 (list %boot-logo-patch
489 %linux-libre-arm-export-__sync_icache_dcache-patch
491 "linux-libre-arm64-generic-pinebook-lcd.patch"))))
493 (define-public linux-libre-5.4-source
494 (source-with-patches linux-libre-5.4-pristine-source
495 (list %boot-logo-patch
496 %linux-libre-arm-export-__sync_icache_dcache-patch
497 ;; Pinebook Pro patch from linux-next,
498 ;; can be dropped for linux-libre 5.7
500 "linux-libre-support-for-Pinebook-Pro.patch"))))
502 (define-public linux-libre-4.19-source
503 (source-with-patches linux-libre-4.19-pristine-source
504 (list %boot-logo-patch
505 %linux-libre-arm-export-__sync_icache_dcache-patch)))
507 (define-public linux-libre-4.14-source
508 (source-with-patches linux-libre-4.14-pristine-source
509 (list %boot-logo-patch)))
511 (define-public linux-libre-4.9-source
512 (source-with-patches linux-libre-4.9-pristine-source
513 (list %boot-logo-patch)))
515 (define-public linux-libre-4.4-source
516 (source-with-patches linux-libre-4.4-pristine-source
517 (list %boot-logo-patch)))
524 (define (make-linux-libre-headers version hash-string)
525 (make-linux-libre-headers* version
528 (uri (linux-libre-urls version))
529 (sha256 (base32 hash-string)))))
531 (define (make-linux-libre-headers* version source)
533 (name "linux-libre-headers")
536 (build-system gnu-build-system)
537 (native-inputs `(("perl" ,perl)
538 ,@(if (version>=? version "4.16")
542 ,@(if (version>=? version "5.3")
546 `(#:modules ((guix build gnu-build-system)
550 (modify-phases %standard-phases
554 (let ((arch ,(system->linux-architecture
555 (or (%current-target-system)
557 (defconfig ,(system->defconfig
558 (or (%current-target-system)
559 (%current-system)))))
561 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
562 (invoke "make" defconfig)
563 (invoke "make" "mrproper" "headers_check"))))
565 (lambda* (#:key outputs #:allow-other-keys)
566 (let ((out (assoc-ref outputs "out")))
568 (string-append "INSTALL_HDR_PATH=" out)
571 (mkdir (string-append out "/include/config"))
572 (call-with-output-file
574 "/include/config/kernel.release")
576 (format p "~a-default~%" ,version)))
578 ;; Remove the '.install' and '..install.cmd' files; the
579 ;; latter contains store paths, which pulls in bootstrap
580 ;; binaries in the build environment, and prevents bit
581 ;; reproducibility for the bootstrap binaries.
582 (for-each delete-file (find-files out "\\.install"))
585 #:allowed-references ()
587 (home-page "https://www.gnu.org/software/linux-libre/")
588 (synopsis "GNU Linux-Libre kernel headers")
589 (description "Headers of the Linux-Libre kernel.")
590 (license license:gpl2)))
592 (define-public linux-libre-headers-5.12
593 (make-linux-libre-headers* linux-libre-5.12-version
594 linux-libre-5.12-source))
596 (define-public linux-libre-headers-5.10
597 (make-linux-libre-headers* linux-libre-5.10-version
598 linux-libre-5.10-source))
600 (define-public linux-libre-headers-5.4
601 (make-linux-libre-headers* linux-libre-5.4-version
602 linux-libre-5.4-source))
604 (define-public linux-libre-headers-4.19
605 (make-linux-libre-headers* linux-libre-4.19-version
606 linux-libre-4.19-source))
608 (define-public linux-libre-headers-4.14
609 (make-linux-libre-headers* linux-libre-4.14-version
610 linux-libre-4.14-source))
612 (define-public linux-libre-headers-4.9
613 (make-linux-libre-headers* linux-libre-4.9-version
614 linux-libre-4.9-source))
616 (define-public linux-libre-headers-4.4
617 (make-linux-libre-headers* linux-libre-4.4-version
618 linux-libre-4.4-source))
620 ;; The following package is used in the early bootstrap, and thus must be kept
621 ;; stable and with minimal build requirements.
622 (define-public linux-libre-headers-5.4.20
623 (make-linux-libre-headers "5.4.20"
624 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
626 (define-public linux-libre-headers linux-libre-headers-5.4.20)
630 ;;; Kernel configurations.
633 (define* (kernel-config arch #:key variant)
634 "Return the absolute file name of the Linux-Libre build configuration file
635 for ARCH and optionally VARIANT, or #f if there is no such configuration."
636 (let* ((name (string-append (if variant (string-append variant "-") "")
637 (if (string=? "i386" arch) "i686" arch) ".conf"))
638 (file (string-append "linux-libre/" name)))
639 (search-auxiliary-file file)))
641 (define %default-extra-linux-options
642 `(;; Some very mild hardening.
643 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
644 ;; All kernels should have NAMESPACES options enabled
645 ("CONFIG_NAMESPACES" . #t)
646 ("CONFIG_UTS_NS" . #t)
647 ("CONFIG_IPC_NS" . #t)
648 ("CONFIG_USER_NS" . #t)
649 ("CONFIG_PID_NS" . #t)
650 ("CONFIG_NET_NS" . #t)
651 ;; Various options needed for elogind service:
652 ;; https://issues.guix.gnu.org/43078
653 ("CONFIG_CGROUP_FREEZER" . #t)
654 ("CONFIG_BLK_CGROUP" . #t)
655 ("CONFIG_CGROUP_WRITEBACK" . #t)
656 ("CONFIG_CGROUP_SCHED" . #t)
657 ("CONFIG_CGROUP_PIDS" . #t)
658 ("CONFIG_CGROUP_FREEZER" . #t)
659 ("CONFIG_CGROUP_DEVICE" . #t)
660 ("CONFIG_CGROUP_CPUACCT" . #t)
661 ("CONFIG_CGROUP_PERF" . #t)
662 ("CONFIG_SOCK_CGROUP_DATA" . #t)
663 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
664 ("CONFIG_CGROUP_NET_PRIO" . #t)
665 ("CONFIG_CGROUP_NET_CLASSID" . #t)
666 ("CONFIG_MEMCG" . #t)
667 ("CONFIG_MEMCG_SWAP" . #t)
668 ("CONFIG_MEMCG_KMEM" . #t)
669 ("CONFIG_CPUSETS" . #t)
670 ("CONFIG_PROC_PID_CPUSET" . #t)
671 ;; Allow disk encryption by default
672 ("CONFIG_DM_CRYPT" . m)
673 ;; Modules required for initrd:
674 ("CONFIG_NET_9P" . m)
675 ("CONFIG_NET_9P_VIRTIO" . m)
676 ("CONFIG_VIRTIO_BLK" . m)
677 ("CONFIG_VIRTIO_NET" . m)
678 ("CONFIG_VIRTIO_PCI" . m)
679 ("CONFIG_VIRTIO_BALLOON" . m)
680 ("CONFIG_VIRTIO_MMIO" . m)
681 ("CONFIG_FUSE_FS" . m)
683 ("CONFIG_9P_FS" . m)))
685 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
686 (define %bpf-extra-linux-options
687 `(;; Needed for probes
688 ("CONFIG_UPROBE_EVENTS" . #t)
689 ("CONFIG_KPROBE_EVENTS" . #t)
690 ;; kheaders module also helpful for tracing
691 ("CONFIG_IKHEADERS" . #t)
693 ("CONFIG_BPF_SYSCALL" . #t)
694 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
695 ;; optional, for tc filters
696 ("CONFIG_NET_CLS_BPF" . m)
697 ;; optional, for tc actions
698 ("CONFIG_NET_ACT_BPF" . m)
699 ("CONFIG_BPF_JIT" . #t)
700 ;; for Linux kernel versions 4.1 through 4.6
701 ;; ("CONFIG_HAVE_BPF_JIT" . y)
702 ;; for Linux kernel versions 4.7 and later
703 ("CONFIG_HAVE_EBPF_JIT" . #t)
704 ;; optional, for kprobes
705 ("CONFIG_BPF_EVENTS" . #t)
707 ("CONFIG_IKHEADERS" . #t)))
709 (define (config->string options)
710 (string-join (map (match-lambda
712 (string-append option "=m"))
714 (string-append option "=y"))
716 (string-append option "=n")))
722 ;;; Kernel package utilities.
725 (define* (make-linux-libre version hash-string supported-systems
727 ;; A function that takes an arch and a variant.
728 ;; See kernel-config for an example.
730 (configuration-file #f)
731 (defconfig "defconfig")
732 (extra-options %default-extra-linux-options)
733 (patches (list %boot-logo-patch)))
734 (make-linux-libre* version
737 (uri (linux-libre-urls version))
738 (sha256 (base32 hash-string))
741 #:extra-version extra-version
742 #:configuration-file configuration-file
743 #:defconfig defconfig
744 #:extra-options extra-options))
746 (define* (make-linux-libre* version source supported-systems
748 ;; A function that takes an arch and a variant.
749 ;; See kernel-config for an example.
751 (configuration-file #f)
752 (defconfig "defconfig")
753 (extra-options %default-extra-linux-options))
755 (name (if extra-version
756 (string-append "linux-libre-" extra-version)
760 (supported-systems supported-systems)
761 (build-system gnu-build-system)
766 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
770 ;; These are needed to compile the GCC plugins.
775 ,@(match (and configuration-file
777 (system->linux-architecture
778 (or (%current-target-system) (%current-system)))
779 #:variant (version-major+minor version)))
780 (#f ;no config for this platform
783 `(("kconfig" ,config))))))
785 `(#:modules ((guix build gnu-build-system)
792 (modify-phases %standard-phases
793 (add-after 'unpack 'patch-/bin/pwd
795 (substitute* (find-files "." "^Makefile(\\.include)?$")
796 (("/bin/pwd") "pwd"))
799 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
800 ;; Avoid introducing timestamps
801 (setenv "KCONFIG_NOTIMESTAMP" "1")
802 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
804 ;; Set ARCH and CROSS_COMPILE
805 (let ((arch ,(system->linux-architecture
806 (or (%current-target-system)
807 (%current-system)))))
809 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
812 (setenv "CROSS_COMPILE" (string-append target "-"))
813 (format #t "`CROSS_COMPILE' set to `~a'~%"
814 (getenv "CROSS_COMPILE"))))
816 (setenv "EXTRA_VERSION" ,extra-version)
818 (let ((build (assoc-ref %standard-phases 'build))
819 (config (assoc-ref (or native-inputs inputs) "kconfig")))
821 ;; Use a custom kernel configuration file or a default
822 ;; configuration file.
825 (copy-file config ".config")
826 (chmod ".config" #o666))
827 (invoke "make" ,defconfig))
829 ;; Appending works even when the option wasn't in the
830 ;; file. The last one prevails if duplicated.
831 (let ((port (open-file ".config" "a"))
832 (extra-configuration ,(config->string extra-options)))
833 (display extra-configuration port)
836 (invoke "make" "oldconfig"))))
838 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
839 (let* ((out (assoc-ref outputs "out"))
840 (moddir (string-append out "/lib/modules"))
841 (dtbdir (string-append out "/lib/dtbs")))
842 ;; Install kernel image, kernel configuration and link map.
843 (for-each (lambda (file) (install-file file out))
844 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
845 ;; Install device tree files
846 (unless (null? (find-files "." "\\.dtb$"))
848 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
850 ;; Install kernel modules
853 ;; Disable depmod because the Guix system's module directory
854 ;; is an union of potentially multiple packages. It is not
855 ;; possible to use depmod to usefully calculate a dependency
856 ;; graph while building only one of those packages.
858 (string-append "MODULE_DIR=" moddir)
859 (string-append "INSTALL_PATH=" out)
860 (string-append "INSTALL_MOD_PATH=" out)
861 "INSTALL_MOD_STRIP=1"
863 (let* ((versions (filter (lambda (name)
864 (not (string-prefix? "." name)))
866 (version (match versions
868 ;; There are symlinks to the build and source directory,
869 ;; both of which will point to target /tmp/guix-build*
870 ;; and thus not be useful in a profile. Delete the symlinks.
871 (false-if-file-not-found
872 (delete-file (string-append moddir "/" version "/build")))
873 (false-if-file-not-found
874 (delete-file (string-append moddir "/" version "/source"))))
877 (home-page "https://www.gnu.org/software/linux-libre/")
878 (synopsis "100% free redistribution of a cleaned Linux kernel")
880 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
881 It has been modified to remove all non-free binary blobs.")
882 (license license:gpl2)
883 (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.
887 ;;; Generic kernel packages.
890 (define-public linux-libre-5.12
891 (make-linux-libre* linux-libre-5.12-version
892 linux-libre-5.12-source
893 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
894 #:configuration-file kernel-config))
896 (define-public linux-libre-version linux-libre-5.12-version)
897 (define-public linux-libre-pristine-source linux-libre-5.12-pristine-source)
898 (define-public linux-libre-source linux-libre-5.12-source)
899 (define-public linux-libre linux-libre-5.12)
901 (define-public linux-libre-5.10
902 (make-linux-libre* linux-libre-5.10-version
903 linux-libre-5.10-source
904 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
905 #:configuration-file kernel-config))
907 (define-public linux-libre-5.4
908 (make-linux-libre* linux-libre-5.4-version
909 linux-libre-5.4-source
910 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
911 #:configuration-file kernel-config))
913 (define-public linux-libre-4.19
914 (make-linux-libre* linux-libre-4.19-version
915 linux-libre-4.19-source
916 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
917 #:configuration-file kernel-config))
919 (define-public linux-libre-4.14
920 (make-linux-libre* linux-libre-4.14-version
921 linux-libre-4.14-source
922 '("x86_64-linux" "i686-linux" "armhf-linux")
923 #:configuration-file kernel-config))
925 (define-public linux-libre-4.9
926 (make-linux-libre* linux-libre-4.9-version
927 linux-libre-4.9-source
928 '("x86_64-linux" "i686-linux")
929 #:configuration-file kernel-config))
931 (define-public linux-libre-4.4
932 (make-linux-libre* linux-libre-4.4-version
933 linux-libre-4.4-source
934 '("x86_64-linux" "i686-linux")
935 #:configuration-file kernel-config
938 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
939 ;; This option was removed upstream in version 4.7.
940 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
941 %default-extra-linux-options)))
943 ;; Linux-Libre-LTS points to the *newest* released long-term support version of
945 ;; Reference: https://jxself.org/linux-libre/
947 (define-public linux-libre-lts-version linux-libre-5.10-version)
948 (define-public linux-libre-lts-pristine-source linux-libre-5.10-pristine-source)
949 (define-public linux-libre-lts-source linux-libre-5.10-source)
950 (define-public linux-libre-lts linux-libre-5.10)
954 ;;; Specialized kernel variants.
957 (define-public linux-libre-arm-generic
958 (make-linux-libre* linux-libre-version
961 #:defconfig "multi_v7_defconfig"
962 #:extra-version "arm-generic"
965 `(;; needed to fix the RTC on rockchip platforms
966 ("CONFIG_RTC_DRV_RK808" . #t))
967 %default-extra-linux-options)))
969 (define-public linux-libre-arm-veyron
970 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
972 (define-public linux-libre-arm-generic-5.10
973 (make-linux-libre* linux-libre-5.10-version
974 linux-libre-5.10-source
976 #:defconfig "multi_v7_defconfig"
977 #:extra-version "arm-generic"
980 `(;; needed to fix the RTC on rockchip platforms
981 ("CONFIG_RTC_DRV_RK808" . #t))
982 %default-extra-linux-options)))
984 (define-public linux-libre-arm-generic-5.4
985 (make-linux-libre* linux-libre-5.4-version
986 linux-libre-5.4-source
988 #:defconfig "multi_v7_defconfig"
989 #:extra-version "arm-generic"
992 `(;; needed to fix the RTC on rockchip platforms
993 ("CONFIG_RTC_DRV_RK808" . #t))
994 %default-extra-linux-options)))
996 (define-public linux-libre-arm-generic-4.19
997 (make-linux-libre* linux-libre-4.19-version
998 linux-libre-4.19-source
1000 #:defconfig "multi_v7_defconfig"
1001 #:extra-version "arm-generic"))
1003 (define-public linux-libre-arm-generic-4.14
1004 (make-linux-libre* linux-libre-4.14-version
1005 linux-libre-4.14-source
1007 #:defconfig "multi_v7_defconfig"
1008 #:extra-version "arm-generic"))
1010 (define-public linux-libre-arm-omap2plus
1011 (make-linux-libre* linux-libre-version
1014 #:defconfig "omap2plus_defconfig"
1015 #:extra-version "arm-omap2plus"))
1017 (define-public linux-libre-arm-omap2plus-4.19
1018 (make-linux-libre* linux-libre-4.19-version
1019 linux-libre-4.19-source
1021 #:defconfig "omap2plus_defconfig"
1022 #:extra-version "arm-omap2plus"))
1024 (define-public linux-libre-arm-omap2plus-4.14
1025 (make-linux-libre* linux-libre-4.14-version
1026 linux-libre-4.14-source
1028 #:defconfig "omap2plus_defconfig"
1029 #:extra-version "arm-omap2plus"))
1031 (define-public linux-libre-arm64-generic
1032 (make-linux-libre* linux-libre-version
1035 #:defconfig "defconfig"
1036 #:extra-version "arm64-generic"
1039 `(;; needed to fix the RTC on rockchip platforms
1040 ("CONFIG_RTC_DRV_RK808" . #t)
1041 ;; Pinebook display, battery, charger and usb
1042 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1043 ("CONFIG_CHARGER_AXP20X" . m)
1044 ("CONFIG_INPUT_AXP20X_PEK" . m)
1045 ("CONFIG_CHARGER_AXP20X" . m)
1046 ("CONFIG_BATTERY_AXP20X" . m)
1047 ("CONFIG_PINCTRL_AXP209" . m)
1048 ("CONFIG_AXP20X_POWER" . m)
1049 ("CONFIG_AXP20X_ADC" . m)
1050 ;; Pinebook PRO battery and sound support
1051 ("CONFIG_BATTERY_CW2015" . m)
1052 ("CONFIG_CHARGER_GPIO" . m)
1053 ("CONFIG_SND_SOC_ES8316" . m))
1054 %default-extra-linux-options)))
1056 (define-public linux-libre-arm64-generic-5.10
1057 (make-linux-libre* linux-libre-5.10-version
1058 linux-libre-5.10-source
1060 #:defconfig "defconfig"
1061 #:extra-version "arm64-generic"
1064 `(;; needed to fix the RTC on rockchip platforms
1065 ("CONFIG_RTC_DRV_RK808" . #t)
1066 ;; Pinebook display, battery, charger and usb
1067 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1068 ("CONFIG_CHARGER_AXP20X" . m)
1069 ("CONFIG_INPUT_AXP20X_PEK" . m)
1070 ("CONFIG_CHARGER_AXP20X" . m)
1071 ("CONFIG_BATTERY_AXP20X" . m)
1072 ("CONFIG_PINCTRL_AXP209" . m)
1073 ("CONFIG_AXP20X_POWER" . m)
1074 ("CONFIG_AXP20X_ADC" . m)
1075 ;; Pinebook PRO battery and sound support
1076 ("CONFIG_BATTERY_CW2015" . m)
1077 ("CONFIG_CHARGER_GPIO" . m)
1078 ("CONFIG_SND_SOC_ES8316" . m))
1079 %default-extra-linux-options)))
1081 (define-public linux-libre-arm64-generic-5.4
1082 (make-linux-libre* linux-libre-5.4-version
1083 linux-libre-5.4-source
1085 #:defconfig "defconfig"
1086 #:extra-version "arm64-generic"
1089 `(;; needed to fix the RTC on rockchip platforms
1090 ("CONFIG_RTC_DRV_RK808" . #t))
1091 %default-extra-linux-options)))
1093 (define-public linux-libre-riscv64-generic
1094 (make-linux-libre* linux-libre-version
1097 #:extra-version "riscv64-generic"))
1099 (define-public linux-libre-mips64el-fuloong2e
1100 (make-linux-libre* linux-libre-version
1103 #:defconfig "fuloong2e_defconfig"
1104 #:extra-version "mips64el-fuloong2e"
1107 `(("CONFIG_OVERLAY_FS" . m))
1108 %default-extra-linux-options)))
1110 (define-public linux-libre-with-bpf
1111 (let ((base-linux-libre
1113 linux-libre-5.12-version
1114 linux-libre-5.12-source
1115 '("x86_64-linux" "i686-linux" "armhf-linux"
1116 "aarch64-linux" "riscv64-linux")
1117 #:extra-version "bpf"
1118 #:configuration-file kernel-config
1120 (append %bpf-extra-linux-options
1121 %default-extra-linux-options))))
1123 (inherit base-linux-libre)
1124 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
1129 ;;; Linux kernel modules.
1132 (define-public acpi-call-linux-module
1134 (name "acpi-call-linux-module")
1140 (url "https://github.com/nix-community/acpi_call")
1141 (commit (string-append "v" version))))
1142 (file-name (git-file-name name version))
1144 (base32 "0mr4rjbv6fj4phf038addrgv32940bphghw2v9n1z4awvw7wzkbg"))))
1145 (build-system linux-module-build-system)
1147 `(#:tests? #f ; no tests
1149 (modify-phases %standard-phases
1150 (add-before 'install 'patch-shebangs-harder
1151 ;; The (only) shebangs in examples/ don't justify a reference.
1152 ;; However, do substitute a more portable one than the original.
1154 (substitute* (find-files "examples" ".")
1155 (("^(#! *)/[^ ]*/" _ shebang)
1156 (string-append shebang "/usr/bin/env ")))
1158 (add-after 'install 'install-documentation
1159 (lambda* (#:key outputs #:allow-other-keys)
1160 (let* ((out (assoc-ref outputs "out"))
1161 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1162 (for-each (lambda (file)
1163 (let ((target (string-append doc "/" file)))
1164 (mkdir-p (dirname target))
1165 (copy-recursively file target)))
1166 (list "README.md" "examples"))
1168 (home-page "https://github.com/teleshoes/acpi_call")
1169 (synopsis "Linux kernel module to perform ACPI method calls")
1171 "This simple Linux kernel module allows calls from user space to any
1172 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1173 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1174 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1175 and @code{ACPI_BUFFER}.
1177 It grants direct and undocumented access to your hardware that may cause damage
1178 and should be used with caution, especially on untested models.")
1179 (license license:gpl3+))) ; see README.md (no licence headers)
1181 (define-public rtl8812au-aircrack-ng-linux-module
1182 (let ((commit "059e06a51be025fde5b2bec6565540b3d9981b0b")
1185 (name "rtl8812au-aircrack-ng-linux-module")
1186 (version (git-version "5.6.4.2" revision commit))
1191 (url "https://github.com/aircrack-ng/rtl8812au")
1193 (file-name (git-file-name name version))
1195 (base32 "0h6l2r3yj7j9zf11dw0zcdyn50ajnjw8yvv86dzlfj80dn75n98f"))
1196 (modules '((guix build utils)))
1199 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1200 ;; and other unnecessary unlicenced things.
1201 (for-each delete-file-recursively (list "android"
1205 (build-system linux-module-build-system)
1208 (list (string-append "KSRC="
1209 (assoc-ref %build-inputs "linux-module-builder")
1210 "/lib/modules/build"))
1212 (modify-phases %standard-phases
1214 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1215 (apply invoke "make" make-flags))))
1216 #:tests? #f)) ; no test suite
1217 (supported-systems '("x86_64-linux" "i686-linux"))
1218 (home-page "https://github.com/aircrack-ng/rtl8812au")
1219 (synopsis "Linux driver for Realtek USB wireless network adapters")
1221 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1222 network adapters, modified by the aircrack-ng project to support monitor mode
1223 and frame injection. It provides a @code{88XXau} kernel module that supports
1224 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1225 (license license:gpl2+))))
1227 (define-public rtl8821ce-linux-module
1228 (let ((commit "14b536f0c9ad2d0abbdab8afc7ade684900ca9cf")
1231 (name "rtl8821ce-linux-module")
1232 (version (git-version "0.0.0" revision commit))
1237 (url "https://github.com/tomaspinho/rtl8821ce")
1239 (file-name (git-file-name name version))
1242 "0z7r7spsgn22gwv9pcmkdjn9ingi8jj7xkxasph8118h46fw8ip2"))))
1243 (build-system linux-module-build-system)
1247 (string-append "KSRC="
1248 (assoc-ref %build-inputs "linux-module-builder")
1249 "/lib/modules/build"))
1251 (modify-phases %standard-phases
1253 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1254 (apply invoke "make" make-flags))))
1255 #:tests? #f)) ; no test suite
1256 (home-page "https://github.com/tomaspinho/rtl8821ce")
1257 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1258 (description "This is Realtek's RTL8821CE Linux driver for wireless
1260 (license license:gpl2))))
1262 (define-public vhba-module
1264 (name "vhba-module")
1265 (version "20200106")
1269 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1270 version ".tar.bz2"))
1273 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1274 (build-system linux-module-build-system)
1278 (home-page "https://cdemu.sourceforge.io/")
1279 (synopsis "Kernel module that emulates SCSI devices")
1280 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1281 between the CDemu userspace daemon and linux kernel.")
1282 (license license:gpl2+)))
1284 (define-public bbswitch-module
1285 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
1286 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
1287 (let ((commit "ddbd243638c7bc2baecf43a78aff46cdc12e9b2e"))
1289 (name "bbswitch-module")
1290 (version (git-version "0.8" "1" commit))
1294 (url "https://github.com/Bumblebee-Project/bbswitch")
1296 (file-name (git-file-name name version))
1299 "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb"))))
1300 (build-system linux-module-build-system)
1304 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1305 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1306 (description "The bbswitch module provides a way to toggle the Nvidia
1307 graphics card on Optimus laptops.")
1308 (license license:gpl2))))
1310 (define-public ddcci-driver-linux
1312 (name "ddcci-driver-linux")
1319 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1320 (commit (string-append "v" version))))
1321 (file-name (git-file-name name version))
1324 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1325 (build-system linux-module-build-system)
1327 `(#:tests? #f ; no tests
1329 (modify-phases %standard-phases
1334 (with-directory-excursion module
1335 (apply (assoc-ref %standard-phases 'build) args)))
1336 '("ddcci" "ddcci-backlight"))
1342 (with-directory-excursion module
1343 (apply (assoc-ref %standard-phases 'install) args)))
1344 '("ddcci" "ddcci-backlight"))
1346 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1347 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1348 (description "This package provides two Linux kernel drivers, ddcci and
1349 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1350 interface. The ddcci module creates a character device for each DDC/CI
1351 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1352 module allows the control of the backlight level or luminance property when
1353 supported under @file{/sys/class/backlight/}.")
1354 (license license:gpl2+)))
1356 (define-public v4l2loopback-linux-module
1358 (name "v4l2loopback-linux-module")
1363 (url "https://github.com/umlaeute/v4l2loopback")
1364 (commit (string-append "v" version))))
1365 (file-name (git-file-name name version))
1368 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1369 (build-system linux-module-build-system)
1371 `(#:tests? #f)) ; no test suite
1372 (home-page "https://github.com/umlaeute/v4l2loopback")
1373 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1375 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1376 for Linux 2} applications will treat these as ordinary video devices but read
1377 video data generated by another application, instead of a hardware device such
1380 This lets you apply nifty effects to your Jitsi video, for example, but also
1381 allows some more serious things like adding streaming capabilities to an
1382 application by hooking GStreamer into the loopback device.")
1383 (license license:gpl2+)))
1387 ;;; Pluggable authentication modules (PAM).
1390 (define-public linux-pam
1398 "https://github.com/linux-pam/linux-pam/releases/download/v"
1399 version "/Linux-PAM-" version ".tar.xz"))
1402 "1z4jayf69qyyxln1gl6ch4qxfd66ib1g42garnrv2d8i1drl0790"))
1403 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1405 (build-system gnu-build-system)
1409 ;; TODO: optional dependencies
1410 ;; ("libxcrypt" ,libxcrypt)
1411 ;; ("cracklib" ,cracklib)
1414 `(;; Most users, such as `shadow', expect the headers to be under
1416 #:configure-flags (list (string-append "--includedir="
1417 (assoc-ref %outputs "out")
1418 "/include/security")
1420 ;; XXX: <rpc/rpc.h> is missing from glibc when
1421 ;; cross-compiling, so we have to disable NIS
1422 ;; support altogether.
1423 ,@(if (%current-target-system)
1427 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1430 (home-page "http://www.linux-pam.org/")
1431 (synopsis "Pluggable authentication modules for Linux")
1433 "A *Free* project to implement OSF's RFC 86.0.
1434 Pluggable authentication modules are small shared object files that can
1435 be used through the PAM API to perform tasks, like authenticating a user
1436 at login. Local and dynamic reconfiguration are its key features.")
1437 (license license:bsd-3)))
1439 (define-public linux-pam-1.2
1447 "http://www.linux-pam.org/library/"
1448 "Linux-PAM-" version ".tar.bz2"))
1451 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1452 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1454 (define-public python-pamela
1456 (name "python-pamela")
1460 ;; Tests not distributed in pypi release.
1463 (url "https://github.com/minrk/pamela")
1465 (file-name (git-file-name name version))
1468 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
1469 (build-system python-build-system)
1471 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
1473 (modify-phases %standard-phases
1474 (add-after 'unpack 'hardcode-pam.so
1475 (lambda* (#:key inputs #:allow-other-keys)
1476 (let ((pam (assoc-ref inputs "linux-pam")))
1477 (substitute* "pamela.py"
1478 (("find_library\\(\"pam\")")
1479 (string-append "'" pam "/lib/libpam.so'")))
1482 (lambda* (#:key tests? #:allow-other-keys)
1484 (if (file-exists? "test_pamela.py")
1485 (invoke "py.test" "--assert=plain" "test_pamela.py")
1486 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
1489 `(("linux-pam" ,linux-pam)))
1491 `(("python-pytest" ,python-pytest)))
1492 (home-page "https://github.com/minrk/pamela")
1493 (synopsis "PAM interface using ctypes")
1494 (description "This package provides a PAM interface using @code{ctypes}.")
1495 (license license:expat)))
1502 (define-public powerstat
1509 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1510 "powerstat/powerstat-" version ".tar.gz"))
1512 (base32 "0dmixbxm4qd08ds26i0wvxwyy8nrjzfjj2q9ylx35564g4wh58qb"))))
1513 (build-system gnu-build-system)
1516 (list (string-append "CC=" ,(cc-for-target))
1517 (string-append "prefix=" (assoc-ref %outputs "out")))
1518 #:tests? #f ; no test suite
1520 (modify-phases %standard-phases
1521 (add-after 'unpack 'respect-$prefix
1522 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1524 (substitute* "Makefile"
1525 (("DIR=/usr/") "DIR=$(prefix)/"))
1527 (delete 'configure)))) ; no configure script
1528 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1529 (synopsis "Measure system power consumption")
1531 "Powerstat measures and reports your computer's power consumption in real
1532 time. On mobile PCs, it uses ACPI battery information to measure the power
1533 drain of the entire system.
1535 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1536 domain measurements. These are available only on some hardware such as Intel
1537 Sandybridge and newer, and cover only part of the machine's components such as
1538 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1539 and don't require a battery at all.
1541 The output is like @command{vmstat} but also shows power consumption statistics:
1542 at the end of a run, @command{powerstat} will calculate the average, standard
1543 deviation, and minimum and maximum values. It can show a nice histogram too.")
1544 (license license:gpl2)))
1546 (define-public psmisc
1553 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1556 (base32 "0y8n1jd2dn4cvc5mh806d66qnq8xl0xmzczbycjwal10rvmcw33z"))))
1557 (build-system gnu-build-system)
1559 `(,@(if (%current-target-system)
1562 "ac_cv_func_malloc_0_nonnull=yes"
1563 "ac_cv_func_realloc_0_nonnull=yes"))
1565 (inputs `(("ncurses" ,ncurses)))
1566 (home-page "https://gitlab.com/psmisc/psmisc")
1567 (synopsis "Small utilities that use the proc file system")
1569 "This PSmisc package is a set of some small useful utilities that
1570 use the proc file system. We're not about changing the world, but
1571 providing the system administrator with some help in common tasks.")
1572 (license license:gpl2+)))
1574 (define-public util-linux
1580 (uri (string-append "mirror://kernel.org/linux/utils/"
1581 "util-linux/v" (version-major+minor version) "/"
1582 "util-linux-" version ".tar.xz"))
1585 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1586 (patches (search-patches "util-linux-tests.patch"))
1587 (modules '((guix build utils)))
1589 ;; We take 'nologin' from Shadow, the 'logger' program from
1590 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1592 (substitute* "configure"
1593 (("build_nologin=yes") "build_nologin=no")
1594 (("build_logger=yes") "build_logger=no")
1595 (("build_kill=yes") "build_kill=no"))
1597 (build-system gnu-build-system)
1598 (outputs '("out" ;6.4 MiB executables and documentation
1599 "lib" ;8.8 MiB shared libraries, headers and locales
1600 "static")) ;2.9 MiB static .a libraries
1602 `(#:configure-flags (list "--disable-use-tty-group"
1603 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1604 ;; Don't try to chown root:root mount and umount
1605 "--disable-makeinstall-chown"
1606 "--localstatedir=/var"
1607 (string-append "--localedir="
1608 (assoc-ref %outputs "lib")
1610 ;; Install completions where our
1611 ;; bash-completion package expects them.
1612 (string-append "--with-bashcompletiondir="
1613 (assoc-ref %outputs "out")
1614 "/etc/bash_completion.d"))
1616 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
1617 ;; <https://bugs.gnu.org/47791>.
1618 #:tests? ,(and (not (%current-target-system))
1619 (not (string-suffix? "-gnu" (%current-system))))
1621 #:phases (modify-phases %standard-phases
1622 (add-before 'configure 'patch-build-scripts
1623 (lambda* (#:key outputs #:allow-other-keys)
1624 (substitute* "configure"
1625 ;; The build system assumes that we want to install
1626 ;; libraries below $exec_prefix when $libdir does not
1627 ;; match any of the "usual" locations. Fix that.
1628 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1629 "usrlib_execdir=$libdir"))
1631 (add-before 'build 'set-umount-file-name
1632 (lambda* (#:key outputs #:allow-other-keys)
1633 ;; Tell 'eject' the right file name of 'umount'.
1634 (let ((out (assoc-ref outputs "out")))
1635 (substitute* "sys-utils/eject.c"
1636 (("\"/bin/umount\"")
1637 (string-append "\"" out "/bin/umount\"")))
1639 (add-before 'check 'pre-check
1640 (lambda* (#:key inputs outputs #:allow-other-keys)
1641 (let ((out (assoc-ref outputs "out"))
1642 (net (assoc-ref inputs "net-base")))
1643 ;; Change the test to refer to the right file.
1644 (substitute* "tests/ts/misc/mcookie"
1646 (string-append net "/etc/services")))
1648 ;; The C.UTF-8 locale does not exist in our libc.
1649 (substitute* "tests/ts/column/invalid-multibyte"
1650 (("C\\.UTF-8") "en_US.utf8"))
1652 ;; TODO: Remove the conditional on the next rebuild cycle.
1653 ,@(if (string-prefix? "arm" (%current-system))
1654 '((add-before 'check 'disable-setarch-test
1656 ;; The setarch tests are unreliable in QEMU's
1657 ;; user-mode emulation, which is our primary
1658 ;; method of building ARMv7 packages.
1659 ;; <https://github.com/karelzak/util-linux/issues/601>
1660 (substitute* "tests/ts/misc/setarch"
1661 (("ts_init_subtest.*" all)
1664 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1667 (add-after 'install 'move-static-libraries
1668 (lambda* (#:key outputs #:allow-other-keys)
1669 (let ((lib (assoc-ref outputs "lib"))
1670 (static (assoc-ref outputs "static")))
1672 ;; Move static libraries to the "static" output.
1673 (mkdir-p (string-append static "/lib"))
1674 (with-directory-excursion lib
1675 (for-each (lambda (file)
1677 (string-append static "/"
1679 (find-files "lib" "\\.a$"))
1681 ;; Remove references to the static library from the '.la'
1682 ;; files so that Libtool does the right thing when both
1683 ;; the shared and static library is available.
1684 (substitute* (find-files "lib" "\\.la$")
1685 (("old_library=.*") "old_library=''\n")))
1688 (add-after 'install 'adjust-pkg-config-files
1689 (lambda* (#:key outputs #:allow-other-keys)
1690 (let ((lib (assoc-ref outputs "lib")))
1691 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1692 ;; the pkg-config files to avoid a cyclic reference on "out".
1693 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1695 (("^(exec_)?prefix=.*") "")))
1697 (inputs `(("zlib" ,zlib)
1698 ("ncurses" ,ncurses)
1700 ;; XXX: This is so that the 'pre-check' phase can find it.
1701 ,@(if (%current-target-system)
1702 `(("net-base" ,net-base))
1706 ("net-base" ,net-base))) ;for tests
1707 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1708 (synopsis "Collection of utilities for the Linux kernel")
1709 (description "Util-linux is a diverse collection of Linux kernel
1710 utilities. It provides dmesg and includes tools for working with file systems,
1711 block devices, UUIDs, TTYs, and many other tools.")
1713 ;; Note that util-linux doesn't use the same license for all the
1714 ;; code. GPLv2+ is the default license for a code without an
1715 ;; explicitly defined license.
1716 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1717 license:bsd-4 license:public-domain))))
1719 ;; util-linux optionally supports udev, which allows lsblk to read file system
1720 ;; metadata without special privileges. Add it as a separate package to avoid
1721 ;; a circular dependency, and to keep the size small.
1722 (define-public util-linux+udev
1725 (name "util-linux-with-udev")
1728 ,@(package-inputs util-linux)))))
1730 (define-public ddate
1737 (url "https://github.com/bo0ts/ddate")
1738 (commit (string-append "v" version))))
1739 (file-name (git-file-name name version))
1741 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1742 (build-system cmake-build-system)
1743 (arguments '(#:tests? #f))
1744 (home-page "https://github.com/bo0ts/ddate")
1745 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1747 "ddate displays the Discordian date and holidays of a given date.
1748 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1749 by Robert Shea and Robert Anton Wilson.")
1750 (license license:public-domain)))
1752 (define-public fbset
1759 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1762 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1763 (build-system gnu-build-system)
1765 '(#:modules ((guix build gnu-build-system)
1769 (modify-phases %standard-phases
1770 (delete 'configure) ; no configure script
1771 (add-before 'install 'pre-install
1772 (lambda* (#:key outputs #:allow-other-keys)
1773 (let ((out (assoc-ref outputs "out")))
1774 (substitute* "Makefile"
1775 (("mknod ") "true ")
1776 ;; The Makefile doesn't honour PREFIX or similar.
1779 (with-directory-excursion out
1780 (for-each mkdir-p (list "sbin"
1784 (add-after 'install 'install-fb.modes
1785 (lambda* (#:key outputs #:allow-other-keys)
1786 (let* ((out (assoc-ref outputs "out"))
1787 (etc (string-append out "/etc")))
1788 (for-each (cut install-file <> etc)
1789 (find-files "etc" "^fb\\.modes"))
1790 (symlink "fb.modes.ATI"
1791 (string-append etc "/fb.modes"))
1793 ;; Parallel building races to create modes.tab.c.
1794 #:parallel-build? #f
1795 #:tests? #f)) ; no test suite
1799 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1800 (synopsis "Show and modify Linux frame buffer settings")
1802 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1803 different kinds of graphic displays. The @command{fbset} utility can query and
1804 change various device settings such as depth, virtual resolution, and timing
1806 (license license:gpl2)))
1808 (define-public procps
1814 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1815 "procps-ng-" version ".tar.xz"))
1818 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1819 (build-system gnu-build-system)
1821 `(#:modules ((guix build utils)
1822 (guix build gnu-build-system)
1825 ,@(if (%current-target-system)
1828 "ac_cv_func_malloc_0_nonnull=yes"
1829 "ac_cv_func_realloc_0_nonnull=yes"))
1832 (modify-phases %standard-phases
1834 'install 'post-install
1835 ;; Remove commands and man pages redudant with
1837 (lambda* (#:key outputs #:allow-other-keys)
1838 (let* ((out (assoc-ref outputs "out"))
1839 (dup (append-map (cut find-files out <>)
1840 '("^kill" "^uptime"))))
1841 (for-each delete-file dup)
1843 (inputs `(("ncurses" ,ncurses)))
1844 (home-page "https://gitlab.com/procps-ng/procps/")
1845 (synopsis "Utilities that give information about processes")
1847 "Procps is the package that has a bunch of small useful utilities
1848 that give information about processes using the Linux /proc file system.
1849 The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
1850 slabtop, tload, top, vmstat, w, watch and sysctl.")
1851 (license license:gpl2)))
1853 (define-public usbutils
1860 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1861 "usbutils-" version ".tar.xz"))
1863 (base32 "0f0klk6d3hmbpf6p4dcwa1qjzblmkhbxs1wsw87aidvqri7lj8wy"))))
1864 (build-system gnu-build-system)
1865 (outputs (list "out" "python"))
1868 (modify-phases %standard-phases
1869 (add-before 'bootstrap 'patch-bootstrap-scripts
1871 (substitute* "usbhid-dump/bootstrap"
1872 (("/bin/sh") (which "sh")))
1874 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1875 (substitute* "autogen.sh"
1876 (("^\\./configure.*") ""))
1878 (add-after 'install 'separate-python-output
1879 ;; Separating one Python script shaves more than 106 MiB from :out.
1880 (lambda* (#:key outputs #:allow-other-keys)
1881 (let ((out (assoc-ref outputs "out"))
1882 (out:python (assoc-ref outputs "python")))
1883 (for-each (lambda (file)
1884 (let ((old (string-append out "/" file))
1885 (new (string-append out:python "/" file)))
1886 (mkdir-p (dirname new))
1887 (rename-file old new)))
1888 (list "bin/lsusb.py"))
1893 ("python" ,python)))
1895 `(("autoconf" ,autoconf)
1896 ("automake" ,automake)
1897 ("libtool" ,libtool)
1898 ("pkg-config" ,pkg-config)))
1899 (home-page "http://www.linux-usb.org/")
1901 "Tools for working with USB devices, such as lsusb")
1903 "Tools for working with USB devices, such as lsusb.")
1904 (license license:gpl2+)))
1906 (define-public e2fsprogs
1913 "mirror://kernel.org/linux/kernel/people/tytso/"
1914 "e2fsprogs/v" version "/"
1915 "e2fsprogs-" version ".tar.xz"))
1918 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1919 (build-system gnu-build-system)
1920 (inputs `(("util-linux" ,util-linux "lib")))
1921 (native-inputs `(("pkg-config" ,pkg-config)
1922 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1926 ("procps" ,procps)))
1928 '(;; util-linux is the preferred source for some of the libraries and
1929 ;; commands, so disable them (see, e.g.,
1930 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1931 #:configure-flags (list "--disable-libblkid"
1932 "--disable-libuuid" "--disable-uuidd"
1935 ;; Use symlinks instead of hard links for
1936 ;; 'fsck.extN' etc. This makes the resulting nar
1937 ;; smaller and is preserved across copies.
1938 "--enable-symlink-install"
1940 (string-append "LDFLAGS=-Wl,-rpath="
1941 (assoc-ref %outputs "out")
1944 ;; Install libext2fs et al.
1945 "--enable-elf-shlibs")
1948 (modify-phases %standard-phases
1949 (add-before 'configure 'patch-shells
1951 (substitute* "configure"
1952 (("/bin/sh (.*)parse-types.sh" _ dir)
1953 (string-append (which "sh") " " dir
1955 (substitute* "MCONFIG.in"
1956 (("INSTALL_SYMLINK = /bin/sh")
1957 "INSTALL_SYMLINK = sh"))
1958 (substitute* (find-files "." "^Makefile.in$")
1960 (string-append "#!" (which "sh"))))
1962 (add-after 'install 'install-libs
1963 (lambda* (#:key outputs #:allow-other-keys)
1964 (let* ((out (assoc-ref outputs "out"))
1965 (lib (string-append out "/lib")))
1966 (invoke "make" "install-libs")
1968 ;; Make the .a writable so that 'strip' works.
1969 ;; Failing to do that, due to debug symbols, we
1970 ;; retain a reference to the final
1971 ;; linux-libre-headers, which refer to the
1972 ;; bootstrap binaries.
1973 (let ((archives (find-files lib "\\.a$")))
1974 (for-each (lambda (file)
1978 (home-page "http://e2fsprogs.sourceforge.net/")
1979 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1981 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1982 (license (list license:gpl2 ;programs
1983 license:lgpl2.0 ;libext2fs
1984 license:x11)))) ;libuuid
1986 (define e2fsprogs/static
1988 (package (inherit e2fsprogs)
1990 ;; Do not build shared libraries.
1991 (substitute-keyword-arguments (package-arguments e2fsprogs)
1992 ((#:configure-flags _)
1993 '(list "--disable-blkid"))
1997 (define-public e2fsck/static
1999 (name "e2fsck-static")
2000 (version (package-version e2fsprogs))
2001 (build-system trivial-build-system)
2004 `(("e2fsprogs" ,e2fsprogs/static)))
2006 `(#:modules ((guix build utils))
2009 (use-modules (guix build utils)
2013 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
2015 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
2017 (with-directory-excursion bin
2018 (copy-file e2fsck "e2fsck")
2019 (remove-store-references "e2fsck")
2020 (chmod "e2fsck" #o555))
2022 (home-page (package-home-page e2fsprogs))
2023 (synopsis "Statically-linked e2fsck command from e2fsprogs")
2024 (description "This package provides statically-linked e2fsck command taken
2025 from the e2fsprogs package. It is meant to be used in initrds.")
2026 (license (package-license e2fsprogs))))
2028 (define-public extundelete
2030 (name "extundelete")
2035 (uri (string-append "mirror://sourceforge/extundelete/"
2036 "extundelete/" version "/extundelete-"
2037 version ".tar.bz2"))
2040 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
2041 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
2042 (build-system gnu-build-system)
2043 (inputs `(("e2fsprogs" ,e2fsprogs)))
2044 (home-page "http://extundelete.sourceforge.net/")
2045 (synopsis "Recover deleted files from ext2/3/4 partitions")
2047 "Extundelete is a set of tools that can recover deleted files from an
2048 ext3 or ext4 partition.")
2049 (license license:gpl2)))
2051 (define-public zerofree
2055 (home-page "https://frippery.org/uml/")
2058 (uri (string-append home-page name "-" version
2062 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
2063 (build-system gnu-build-system)
2066 (modify-phases %standard-phases
2067 (delete 'configure) ; no configure script
2069 ;; The Makefile lacks an ‘install’ target.
2070 (lambda* (#:key outputs #:allow-other-keys)
2071 (let* ((out (assoc-ref outputs "out"))
2072 (bin (string-append out "/bin")))
2073 (chmod "zerofree" #o555)
2074 (install-file "zerofree" bin)
2076 #:tests? #f)) ; no tests
2077 (inputs `(("libext2fs" ,e2fsprogs)))
2078 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
2080 "Zerofree finds the unallocated blocks with non-zero value content in an
2081 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
2082 This is a simple way to make disk images more compressible.
2083 Zerofree requires the file system to be unmounted or mounted read-only.")
2084 (license license:gpl2)))
2086 (define-public strace
2090 (home-page "https://strace.io")
2093 (uri (string-append home-page "/files/" version
2094 "/strace-" version ".tar.xz"))
2097 "1abs3svkg9985f4jrxx34sj1dcpsf95vv1a0g01c777zgygncjnz"))))
2098 (build-system gnu-build-system)
2101 (modify-phases %standard-phases
2102 (add-after 'unpack 'patch-/bin/sh
2104 (substitute* "strace.c"
2105 (("/bin/sh") (which "sh")))
2107 (add-after 'unpack 'disable-failing-tests
2109 ;; XXX These hang forever even if the test time-out is extended.
2110 (substitute* "tests/Makefile.in"
2111 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
2113 ;; Don't fail if the architecture doesn't support different personalities.
2114 #:configure-flags '("--enable-mpers=check")
2115 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
2116 #:parallel-tests? #f)) ; undeterministic failures
2117 (native-inputs `(("perl" ,perl)))
2118 (synopsis "System call tracer for Linux")
2120 "strace is a system call tracer, i.e. a debugging tool which prints out a
2121 trace of all the system calls made by a another process/program.")
2122 (license license:lgpl2.1+)))
2124 (define-public ltrace
2130 (uri (string-append "http://www.ltrace.org/ltrace_" version
2134 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
2135 (build-system gnu-build-system)
2136 (inputs `(("libelf" ,elfutils)))
2138 ;; Compilation uses -Werror by default, but it fails.
2139 '(#:configure-flags '("--disable-werror")))
2140 (home-page "https://www.ltrace.org/")
2141 (synopsis "Library call tracer for Linux")
2143 "ltrace intercepts and records dynamic library calls which are called by
2144 an executed process and the signals received by that process. It can also
2145 intercept and print the system calls executed by the program.")
2146 (license license:gpl2+)))
2148 (define-public alsa-lib
2155 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
2156 version ".tar.bz2"))
2159 "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp"))))
2160 (build-system gnu-build-system)
2162 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2163 (assoc-ref %outputs "out")
2165 (home-page "https://www.alsa-project.org/")
2166 (synopsis "The Advanced Linux Sound Architecture libraries")
2168 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2169 MIDI functionality to the Linux-based operating system.")
2170 (license license:lgpl2.1+)))
2172 (define-public alsa-utils
2178 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
2179 name "-" version ".tar.bz2"))
2182 "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq"))))
2183 (build-system gnu-build-system)
2185 ;; XXX: Disable man page creation until we have DocBook.
2186 '(#:configure-flags (list "--disable-xmlto"
2188 ;; The udev rule is responsible for restoring
2190 (string-append "--with-udev-rules-dir="
2191 (assoc-ref %outputs "out")
2192 "/lib/udev/rules.d"))
2194 (modify-phases %standard-phases
2195 (add-before 'check 'disable-broken-test
2197 ;; XXX: The 1.1.8 release tarball is missing a header that's
2198 ;; required for this test to work. Fixed in 1.1.9.
2199 (substitute* "axfer/test/Makefile"
2200 ((".*container-test.*") ""))
2203 'install 'pre-install
2205 ;; Don't try to mkdir /var/lib/alsa.
2206 (substitute* "Makefile"
2207 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2211 `(("gettext" ,gettext-minimal)))
2213 `(("libsamplerate" ,libsamplerate)
2214 ("ncurses" ,ncurses)
2215 ("alsa-lib" ,alsa-lib)
2217 (home-page "http://www.alsa-project.org/")
2218 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2220 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2221 MIDI functionality to the Linux-based operating system.")
2223 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2225 (license license:gpl2)))
2227 (define-public alsa-plugins
2229 (name "alsa-plugins")
2233 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2234 name "-" version ".tar.bz2"))
2237 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2238 (build-system gnu-build-system)
2239 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2240 ;; be split, there are references to both in files.
2241 ;; TODO: Remove OSS related plugins, they add support to run native
2242 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2244 (outputs '("out" "pulseaudio" "jack"))
2245 (native-search-paths
2246 (list (search-path-specification
2247 (variable "ALSA_PLUGIN_DIR")
2248 (files '("lib/alsa-lib"))
2251 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2252 ;; for /etc/alsa. On Guix System plugins are loaded from
2253 ;; the ALSA service, and other distributions likely
2254 ;; won't use these files.
2255 "--with-alsalconfdir=/tmp/noop")
2257 (modify-phases %standard-phases
2258 (add-after 'install 'split
2259 (lambda* (#:key inputs outputs #:allow-other-keys)
2260 ;; Distribute the binaries to the various outputs.
2261 (let* ((out (assoc-ref outputs "out"))
2262 (jack (assoc-ref outputs "jack"))
2263 (jacklib (string-append jack "/lib/alsa-lib"))
2264 (pua (assoc-ref outputs "pulseaudio"))
2265 (pualib (string-append pua "/lib/alsa-lib")))
2268 (for-each (lambda (file)
2269 (rename-file file (string-append jacklib "/" (basename file))))
2270 (find-files out ".*jack\\.(la|so)"))
2273 (for-each (lambda (file)
2274 (rename-file file (string-append pualib "/" (basename file))))
2275 (find-files out ".*pulse\\.(la|so)"))
2278 `(("alsa-lib" ,alsa-lib)
2280 ("speex" ,speex) ; libspeexdsp resampling plugin
2281 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2282 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2283 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2285 `(("pkg-config" ,pkg-config)))
2286 (home-page "http://www.alsa-project.org/")
2287 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2289 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2290 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2291 by providing additional plugins which include: upmixing, downmixing, jackd and
2292 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2293 external rate conversion.")
2294 (license (list license:gpl2+
2295 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2296 license:lgpl2.1+))))
2298 (define-public iptables
2305 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2307 (string-append "https://www.netfilter.org/projects/iptables/"
2308 "files/iptables-" version ".tar.bz2")))
2310 (base32 "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1"))))
2311 (build-system gnu-build-system)
2313 `(("pkg-config" ,pkg-config)
2317 `(("libmnl" ,libmnl)
2318 ("libnftnl" ,libnftnl)))
2320 '(#:tests? #f ; no test suite
2321 #:configure-flags ; add $libdir to the RUNPATH of executables
2322 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
2323 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2324 (synopsis "Programs to configure Linux IP packet filtering rules")
2326 "@command{iptables} is the user-space command line program used to
2327 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2328 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2330 This package also includes @command{ip6tables}, which is used to configure the
2333 Both commands are targeted at system administrators.")
2334 (license license:gpl2+)))
2336 (define-public jitterentropy-rngd
2338 (name "jitterentropy-rngd")
2344 (url "https://github.com/smuellerDD/jitterentropy-rngd")
2345 (commit (string-append "v" version))))
2346 (file-name (git-file-name name version))
2348 (base32 "1fb8zfwhwkl1d8n4cdn7rdv5rwd75qgc00d36pmkl7wgnj3c9xda"))))
2349 (build-system gnu-build-system)
2351 `(#:tests? #f ; no test suite
2353 (list (string-append "CC=" ,(cc-for-target))
2354 (string-append "PREFIX=" (assoc-ref %outputs "out"))
2355 "UNITDIR=$(PREFIX)/lib/systemd/system")
2357 (modify-phases %standard-phases
2358 (delete 'configure)))) ; no ./configure script
2359 (home-page "https://www.chronox.de/jent.html")
2360 (synopsis "CPU jitter random number generator daemon")
2362 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
2363 number generator} core to the kernel Linux's entropy estimator. This prevents
2364 the @file{/dev/random} device from blocking and should benefit users of the
2365 preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
2367 The CPU Jitter RNG itself is part of the kernel and claims to provide good
2368 entropy by collecting and magnifying differences in CPU execution time as
2369 measured by the high-resolution timer built into modern CPUs. It requires no
2370 additional hardware or external entropy source.
2372 The random bit stream generated by @command{jitterentropy-rngd} is not processed
2373 by a cryptographically secure whitening function. Nonetheless, its authors
2374 believe it to be a suitable source of cryptographically secure key material or
2375 other cryptographically sensitive data.
2377 If you agree with them, start this daemon as early as possible to provide
2378 properly seeded random numbers to services like SSH or those using TLS during
2379 early boot when entropy may be low, especially in virtualised environments.")
2380 (license (list license:bsd-3 ; or
2383 (define-public lsscsi
2390 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2393 "0jp458m2b3wckr18qkln69i01152qlwz33zm49103lq8fgx0n6d4"))))
2394 (build-system gnu-build-system)
2395 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2396 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2398 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2399 also list NVMe namespaces or controllers and show the relationship between a
2400 device's primary node name, its SCSI generic (sg) node name and its kernel
2402 (license license:gpl2)))
2404 (define-public ebtables
2411 "mirror://netfilter.org/ebtables/ebtables-"
2415 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2416 (build-system gnu-build-system)
2419 ("iptables" ,iptables)))
2420 (synopsis "Ethernet bridge frame table administration")
2421 (home-page "https://ebtables.netfilter.org/")
2423 "ebtables is an application program used to set up and maintain the
2424 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2425 analogous to the iptables application, but less complicated, due to the fact
2426 that the Ethernet protocol is much simpler than the IP protocol.")
2427 (license license:gpl2+)))
2429 (define-public iproute
2436 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2440 "0vrjbzhwzcvaxyyhkr2ii89w2vznzwp2pfgk7w72mviniawqs9lx"))))
2441 (build-system gnu-build-system)
2443 `( ;; There is a test suite, but it wants network namespaces and sudo.
2445 #:make-flags (let ((out (assoc-ref %outputs "out")))
2447 (string-append "CC=" ,(cc-for-target))
2449 (string-append "BASH_COMPDIR=" out
2450 "/etc/bash_completion.d")
2451 (string-append "LIBDIR=" out "/lib")
2452 (string-append "HDRDIR=" out "/include")
2453 (string-append "SBINDIR=" out "/sbin")
2454 (string-append "CONFDIR=" out "/etc")
2455 (string-append "DOCDIR=" out "/share/doc/"
2457 (string-append "MANDIR=" out "/share/man")))
2458 #:phases (modify-phases %standard-phases
2459 (add-before 'install 'pre-install
2461 ;; Don't attempt to create /var/lib/arpd.
2462 (substitute* "Makefile"
2463 (("^.*ARPDDIR.*$") ""))
2465 (add-after 'unpack 'patch-configure
2467 (let ((target ,(%current-target-system)))
2468 (substitute* "configure"
2471 (string-append target "-pkg-config")
2476 ("iptables" ,iptables)
2477 ("libmnl" ,libmnl)))
2481 ("pkg-config" ,pkg-config)))
2483 ;; ("libmnl" ,libmnl)
2484 ;; ("util-linux" ,util-linux)
2486 "https://wiki.linuxfoundation.org/networking/iproute2")
2488 "Utilities for controlling TCP/IP networking and traffic in Linux")
2490 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2491 and traffic with the Linux kernel. The most important of these are
2492 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2495 Most network configuration manuals still refer to ifconfig and route as the
2496 primary network configuration tools, but ifconfig is known to behave
2497 inadequately in modern network environments, and both should be deprecated.")
2498 (license license:gpl2+)))
2500 (define-public net-tools
2501 ;; XXX: This package is basically unmaintained, but it provides a few
2502 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2504 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2508 (version (string-append "1.60-" revision "." (string-take commit 7)))
2511 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2512 "n/ne/net-tools/code.git/net-tools-code-"
2514 (file-name (string-append name "-" version ".zip"))
2517 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2518 (home-page "http://net-tools.sourceforge.net/")
2519 (build-system gnu-build-system)
2521 `(#:modules ((guix build gnu-build-system)
2526 (modify-phases %standard-phases
2528 (lambda* (#:key outputs #:allow-other-keys)
2529 (let ((out (assoc-ref outputs "out")))
2530 (mkdir-p (string-append out "/bin"))
2531 (mkdir-p (string-append out "/sbin"))
2533 ;; Pretend we have everything...
2534 (system "yes | make config")
2536 ;; ... except for the things we don't have.
2537 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2538 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2539 ;; that have been removed.
2540 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2541 ;; think about adding them later.
2542 (substitute* '("config.make" "config.h")
2543 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2546 (add-after 'install 'remove-redundant-commands
2547 (lambda* (#:key outputs #:allow-other-keys)
2548 ;; Remove commands and man pages redundant with Inetutils.
2549 (let* ((out (assoc-ref outputs "out"))
2550 (dup (append-map (cut find-files out <>)
2552 "^(yp|nis|dns)?domainname"))))
2553 (for-each delete-file dup)
2555 ;; Binaries that depend on libnet-tools.a don't declare that
2556 ;; dependency, making it parallel-unsafe.
2557 #:parallel-build? #f
2559 #:tests? #f ; no test suite
2560 #:make-flags (let ((out (assoc-ref %outputs "out")))
2561 (list ,(string-append "CC=" (cc-for-target))
2562 (string-append "BASEDIR=" out)
2563 (string-append "INSTALLNLSDIR=" out "/share/locale")
2564 (string-append "mandir=/share/man")))))
2565 (native-inputs `(("gettext" ,gettext-minimal)
2567 (supported-systems (delete "i586-gnu" %supported-systems))
2568 (synopsis "Tools for controlling the network subsystem in Linux")
2570 "This package includes the important tools for controlling the network
2571 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2572 route. Additionally, this package contains utilities relating to particular
2573 network hardware types (plipconfig, slattach) and advanced aspects of IP
2574 configuration (iptunnel, ipmaddr).")
2575 (license license:gpl2+))))
2577 (define-public libcap-2.31
2584 "mirror://kernel.org/linux/libs/security/linux-privs/"
2585 "libcap2/libcap-" version ".tar.xz"))
2588 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2589 (build-system gnu-build-system)
2590 (arguments '(#:phases
2591 (modify-phases %standard-phases
2593 ;; Add $libdir to the RUNPATH of executables.
2595 (substitute* "Make.Rules"
2597 (string-append "LDFLAGS := -Wl,-rpath="
2600 #:test-target "test"
2601 #:make-flags (list "lib=lib"
2602 (string-append "prefix="
2603 (assoc-ref %outputs "out"))
2604 "RAISE_SETFCAP=no")))
2605 (native-inputs `(("perl" ,perl)))
2606 (supported-systems (delete "i586-gnu" %supported-systems))
2607 (home-page "https://sites.google.com/site/fullycapable/")
2608 (synopsis "Library for working with POSIX capabilities")
2610 "Libcap2 provides a programming interface to POSIX capabilities on
2611 Linux-based operating systems.")
2613 ;; License is BSD-3 or GPLv2, at the user's choice.
2614 (license license:gpl2)))
2616 ;; libcap 2.31 has problems with newer kernels, so provide this newer variant.
2617 ;; Keep the old libcap around to avoid rebuilding 'coreutils' and 'avahi'.
2618 ;; To be merged with libcap on the next rebuild cycle.
2619 (define-public libcap
2621 (inherit libcap-2.31)
2626 "mirror://kernel.org/linux/libs/security/linux-privs/"
2627 "libcap2/libcap-" version ".tar.xz"))
2630 "11ijmi7jik9iw6pdszc6bylhggghr8cza03bcrbhbqf0cpvkjrnn"))))
2632 (substitute-keyword-arguments (package-arguments libcap-2.31)
2634 `(modify-phases ,phases
2637 ;; Add $libdir to the RUNPATH of executables.
2638 (substitute* "Make.Rules"
2639 (("LDFLAGS \\?= #-g")
2640 (string-append "LDFLAGS ?= -Wl,-rpath="
2644 (define-deprecated libcap/next libcap)
2645 (export libcap/next)
2647 (define-public bridge-utils
2649 (name "bridge-utils")
2654 (uri (string-append "mirror://kernel.org/linux/kernel/people/shemminger/"
2655 "bridge-utils/bridge-utils-" version ".tar.xz"))
2657 (base32 "0zlrigizac2nfwgvksm92v4wafrpgxlbci3gwimc795ib7k8g6ck"))))
2658 (build-system gnu-build-system)
2660 ;; The tarball lacks all the generated files.
2661 (native-inputs `(("autoconf" ,autoconf)
2662 ("automake" ,automake)))
2665 (modify-phases %standard-phases
2666 (add-before 'bootstrap 'patch-stuff
2668 ;; Fix "field ‘ip6’ has incomplete type" errors.
2669 (substitute* "libbridge/libbridge.h"
2670 (("#include <linux/if_bridge.h>")
2671 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2673 ;; Ensure that the entire build fails if one of the
2674 ;; sub-Makefiles fails.
2675 (substitute* "Makefile.in"
2676 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2677 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2680 #:tests? #f)) ; no 'check' target
2682 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2683 (synopsis "Manipulate Ethernet bridges")
2685 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2686 to connect two Ethernet segments together in a protocol independent way.
2687 Packets are forwarded based on Ethernet address, rather than IP address (like
2688 a router). Since forwarding is done at Layer 2, all protocols can go
2689 transparently through a bridge.")
2690 (license license:gpl2+)))
2692 (define-public libnl
2699 "https://github.com/thom311/libnl/releases/download/"
2700 "libnl" (string-join (string-split version #\.) "_")
2701 "/libnl-" version ".tar.gz"))
2704 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2705 (build-system gnu-build-system)
2709 ("pkg-config" ,pkg-config)
2715 "https://github.com/thom311/libnl/releases/download/libnl"
2716 (string-join (string-split version #\.) "_")
2717 "/libnl-doc-" version ".tar.gz"))
2719 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2720 (outputs `("out" "doc"))
2723 (modify-phases %standard-phases
2724 (add-after 'install 'install-doc
2725 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2726 (let ((dest (string-append (assoc-ref outputs "doc")
2727 "/share/doc/libnl")))
2729 (invoke "tar" "xf" (assoc-ref
2730 (or native-inputs inputs)
2732 "--strip-components=1" "-C" dest)))))))
2733 (home-page "https://www.infradead.org/~tgr/libnl/")
2734 (synopsis "NetLink protocol library suite")
2736 "The libnl suite is a collection of libraries providing APIs to netlink
2737 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2738 between the kernel and user space processes. It was designed to be a more
2739 flexible successor to ioctl to provide mainly networking related kernel
2740 configuration and monitoring interfaces.")
2742 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2743 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2744 (license license:gpl2)))
2746 ;; libnl python extensions used to be outputs of libnl. However, as
2747 ;; cross-compiling python extensions is currently broken, create separate
2748 ;; packages for libnl python extensions.
2749 (define (libnl-python-package python)
2750 (let ((name (string-append "libnl-" python)))
2755 ((string=? python "python2")
2756 `(("python-2" ,python-2)))
2757 ((string=? python "python3")
2758 `(("python-3" ,python-3))))))
2759 (propagated-inputs `(("libnl" ,libnl)))
2762 `(#:modules ((guix build gnu-build-system)
2766 (modify-phases %standard-phases
2768 (lambda* (#:key inputs outputs #:allow-other-keys)
2769 (define (python-inst python)
2770 (invoke python "setup.py" "build")
2771 (invoke python "setup.py" "install"
2772 (string-append "--prefix="
2773 (assoc-ref %outputs "out")))
2774 (invoke python "setup.py" "clean"))
2775 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2776 (assoc-ref inputs "libnl")))
2777 (with-directory-excursion "./python" (python-inst ,python))
2780 (define-public libnl-python2 (libnl-python-package "python2"))
2781 (define-public libnl-python3 (libnl-python-package "python3"))
2790 "mirror://kernel.org/software/network/iw/iw-"
2794 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2795 (build-system gnu-build-system)
2796 (native-inputs `(("pkg-config" ,pkg-config)))
2797 (inputs `(("libnl" ,libnl)))
2800 (let* ((target ,(%current-target-system))
2801 (pkg-config (if target
2802 (string-append target "-pkg-config")
2805 ,(string-append "CC=" (cc-for-target))
2806 (string-append "PKG_CONFIG="
2807 (assoc-ref %build-inputs "pkg-config")
2809 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2810 #:phases (modify-phases %standard-phases (delete 'configure))))
2811 (home-page "https://wireless.wiki.kernel.org/")
2812 (synopsis "Tool for configuring wireless devices")
2814 "iw is a new nl80211 based CLI configuration utility for wireless
2815 devices. It replaces @code{iwconfig}, which is deprecated.")
2816 (license license:isc)))
2818 (define-public powertop
2826 (url "https://github.com/fenrus75/powertop")
2827 (commit (string-append "v" version))))
2828 (file-name (git-file-name name version))
2830 (base32 "1zkr2y5nb1nr22nq8a3zli87iyfasfq6489p7h1k428pv8k45w4f"))))
2831 (build-system gnu-build-system)
2834 (list "LDFLAGS=-pthread")
2836 (modify-phases %standard-phases
2837 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2838 ;; allow calibrating the network interface in Guix System.
2839 (add-after 'unpack 'patch-absolute-file-names
2840 (lambda* (#:key inputs #:allow-other-keys)
2841 (let ((kmod (assoc-ref inputs "kmod")))
2842 (substitute* (find-files "src" "\\.cpp$")
2843 ;; Give the right 'modprobe' file name so that essential
2844 ;; modules such as msr.ko can be loaded.
2845 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2846 ;; These programs are only needed to calibrate, so using
2847 ;; relative file names avoids adding extra inputs. When they
2848 ;; are missing powertop gracefully handles it.
2849 (("/usr/bin/hcitool") "hcitool")
2850 (("/usr/bin/xset") "xset")
2851 (("/usr/sbin/hciconfig") "hciconfig"))
2856 ("ncurses" ,ncurses)
2857 ("pciutils" ,pciutils)
2860 `(("autoconf" ,autoconf)
2861 ("automake" ,automake)
2862 ("gettext" ,gettext-minimal)
2863 ("libtool" ,libtool)
2864 ("pkg-config" ,pkg-config)))
2865 (home-page "https://01.org/powertop/")
2866 (synopsis "Analyze power consumption on Intel-based laptops")
2868 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2869 power management. In addition to being a diagnostic tool, PowerTOP also has
2870 an interactive mode where the user can experiment various power management
2871 settings for cases where the operating system has not enabled these
2873 (license license:gpl2)))
2875 (define-public aumix
2882 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2883 version ".tar.bz2"))
2886 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2887 (build-system gnu-build-system)
2888 (inputs `(("ncurses" ,ncurses)))
2889 (home-page "http://www.jpj.net/~trevor/aumix.html")
2890 (synopsis "Audio mixer for X and the console")
2892 "Aumix adjusts an audio mixer from X, the console, a terminal,
2893 the command line or a script.")
2894 (license license:gpl2+)))
2896 (define-public iotop
2903 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2906 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2907 (build-system python-build-system)
2910 (modify-phases %standard-phases
2911 (add-after 'unpack 'fix-build-with-python3
2913 (substitute* "setup.py"
2914 (("itervalues") "values"))
2916 ;; There are currently no checks in the package.
2918 (native-inputs `(("python" ,python)))
2919 (home-page "http://guichaz.free.fr/iotop/")
2921 "Displays the IO activity of running processes")
2923 "Iotop is a Python program with a top like user interface to show the
2924 processes currently causing I/O.")
2925 (license license:gpl2+)))
2933 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2934 "download/fuse-" version
2935 "/fuse-" version ".tar.gz"))
2938 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2939 (patches (search-patches "fuse-overlapping-headers.patch"))))
2940 (build-system gnu-build-system)
2941 (inputs `(("util-linux" ,util-linux)))
2943 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2944 (assoc-ref %outputs "out")
2946 (string-append "INIT_D_PATH="
2947 (assoc-ref %outputs "out")
2950 ;; The rule makes /dev/fuse 666.
2951 (string-append "UDEV_RULES_PATH="
2952 (assoc-ref %outputs "out")
2953 "/lib/udev/rules.d"))
2955 (modify-phases %standard-phases
2956 (add-before 'build 'set-file-names
2957 (lambda* (#:key inputs #:allow-other-keys)
2958 ;; libfuse calls out to mount(8) and umount(8). Make sure
2959 ;; it refers to the right ones.
2960 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2961 (("/bin/(u?)mount" _ maybe-u)
2962 (string-append (assoc-ref inputs "util-linux")
2963 "/bin/" maybe-u "mount")))
2964 (substitute* '("util/mount.fuse.c")
2968 ;; This hack leads libfuse to search for 'fusermount' in
2969 ;; $PATH, where it may find a setuid-root binary, instead of
2970 ;; trying solely $out/sbin/fusermount and failing because
2972 (substitute* "lib/Makefile"
2973 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2974 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2976 (supported-systems (delete "i586-gnu" %supported-systems))
2977 (home-page "https://github.com/libfuse/libfuse")
2978 (synopsis "Support file systems implemented in user space")
2980 "As a consequence of its monolithic design, file system code for Linux
2981 normally goes into the kernel itself---which is not only a robustness issue,
2982 but also an impediment to system extensibility. FUSE, for \"file systems in
2983 user space\", is a kernel module and user-space library that tries to address
2984 part of this problem by allowing users to run file system implementations as
2985 user-space processes.")
2986 (license (list license:lgpl2.1 ;library
2987 license:gpl2+)))) ;command-line utilities
2989 (define-public unionfs-fuse
2991 (name "unionfs-fuse")
2996 (url "https://github.com/rpodgorny/unionfs-fuse")
2997 (commit (string-append "v" version))))
2998 (file-name (git-file-name name version))
3001 "0bwx70x834qgqh53vqp18bhbxbsny80hz922rbgj8k9wj7cbfilm"))))
3002 (build-system cmake-build-system)
3004 `(("python" ,python)))
3005 (inputs `(("fuse" ,fuse)))
3007 ;; The tests were never actually run ("collected 0 items"), but in recent
3008 ;; versions of pytest that causes an error.
3010 (home-page "https://github.com/rpodgorny/unionfs-fuse")
3011 (synopsis "User-space union file system")
3013 "UnionFS-FUSE is a flexible union file system implementation in user
3014 space, using the FUSE library. Mounting a union file system allows you to
3015 \"aggregate\" the contents of several directories into a single mount point.
3016 UnionFS-FUSE additionally supports copy-on-write.")
3017 (license license:bsd-3)))
3020 (package (inherit fuse)
3021 (name "fuse-static")
3022 (source (origin (inherit (package-source fuse))
3023 (modules '((guix build utils)))
3026 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
3027 ;; updated. Change calls to 'mtab_needs_update' to 0 so
3028 ;; that it doesn't do that, allowing us to remove the
3029 ;; dependency on util-linux (something that is useful in
3031 (substitute* '("lib/mount_util.c"
3032 "util/mount_util.c")
3033 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
3039 (define-public unionfs-fuse/static
3040 (package (inherit unionfs-fuse)
3041 (synopsis "User-space union file system (statically linked)")
3042 (name (string-append (package-name unionfs-fuse) "-static"))
3043 (source (origin (inherit (package-source unionfs-fuse))
3044 (modules '((guix build utils)))
3047 ;; Add -ldl to the libraries, because libfuse.a needs that.
3048 (substitute* "src/CMakeLists.txt"
3049 (("target_link_libraries(.*)\\)" _ libs)
3050 (string-append "target_link_libraries"
3055 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
3057 (modify-phases %standard-phases
3058 (add-after 'install 'post-install
3059 (lambda* (#:key outputs #:allow-other-keys)
3060 (let* ((out (assoc-ref outputs "out"))
3061 (exe (string-append out "/bin/unionfs")))
3062 ;; By default, 'unionfs' keeps references to
3063 ;; $glibc/share/locale and similar stuff. Remove them.
3064 (remove-store-references exe)
3066 ;; 'unionfsctl' has references to glibc as well. Since
3067 ;; we don't need it, remove it.
3068 (delete-file (string-append out "/bin/unionfsctl"))
3070 (inputs `(("fuse" ,fuse-static)))))
3072 (define-public sshfs
3078 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
3079 "download/sshfs-" version "/sshfs-" version
3083 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
3084 (build-system gnu-build-system)
3089 `(("pkg-config" ,pkg-config)))
3090 (home-page "https://github.com/libfuse/sshfs")
3091 (synopsis "Mount remote file systems over SSH")
3093 "This is a file system client based on the SSH File Transfer Protocol.
3094 Since most SSH servers already support this protocol it is very easy to set
3095 up: on the server side there's nothing to do; on the client side mounting the
3096 file system is as easy as logging into the server with an SSH client.")
3097 (license license:gpl2+)))
3099 (define-public sshfs-fuse
3100 (package (inherit sshfs)
3102 (properties `((superseded . ,sshfs)))))
3104 (define-public archivemount
3106 (name "archivemount")
3111 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
3112 "archivemount-" version ".tar.gz"))
3114 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
3115 (build-system gnu-build-system)
3116 (inputs `(("fuse" ,fuse)
3117 ("libarchive" ,libarchive)))
3118 (native-inputs `(("pkg-config" ,pkg-config)))
3119 (home-page "https://www.cybernoia.de/software/archivemount.html")
3120 (synopsis "Tool for mounting archive files with FUSE")
3121 (description "archivemount is a FUSE-based file system for Unix variants,
3122 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
3123 mount point where it can be read from or written to as with any other file
3124 system. This makes accessing the contents of the archive, which may be
3125 compressed, transparent to other programs, without decompressing them.")
3126 (license license:lgpl2.0+)))
3128 (define-public numactl
3135 "https://github.com/numactl/numactl/releases/download/v"
3136 version "/numactl-" version ".tar.gz"))
3139 "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2"))))
3140 (build-system gnu-build-system)
3142 '(;; There's a 'test' target, but it requires NUMA support in the kernel
3143 ;; to run, which we can't assume to have.
3146 ;; NUMA is apparently not supported on armhf, see
3147 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
3148 (supported-systems (delete "armhf-linux" %supported-systems))
3149 (home-page "https://github.com/numactl/numactl")
3150 (synopsis "Tools for non-uniform memory access (NUMA) machines")
3152 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
3153 memory is not all in one place. The @command{numactl} program allows you to
3154 run your application program on specific CPUs and memory nodes. It does this
3155 by supplying a NUMA memory policy to the operating system before running your
3158 The package contains other commands, such as @command{numastat},
3159 @command{memhog}, and @command{numademo} which provides a quick overview of
3160 NUMA performance on your system.")
3161 (license (list license:gpl2 ;programs
3162 license:lgpl2.1)))) ;library
3164 (define-public kbd-neo
3171 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
3172 version "/linux/console/neo.map"))
3173 (file-name (string-append name "-" version ".map"))
3176 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
3177 (build-system trivial-build-system)
3179 `(#:modules ((guix build utils))
3181 (use-modules (guix build utils))
3182 (let ((out (string-append %output "/share/keymaps"))
3183 (source (assoc-ref %build-inputs "source")))
3185 (copy-file source (string-append out "/neo.map"))
3187 (home-page "https://neo-layout.org")
3188 (synopsis "Neo2 console layout")
3190 "Kbd-neo provides the Neo2 keyboard layout for use with
3191 @command{loadkeys(1)} from @code{kbd(4)}.")
3192 ;; The file is located in an svn directory, the entire content of
3193 ;; the directory is licensed as GPL3.
3194 (license license:gpl3+)))
3202 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
3206 "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m"))
3207 (modules '((guix build utils)))
3210 (substitute* '("src/unicode_start" "src/unicode_stop")
3211 ;; Assume the Coreutils are in $PATH.
3214 (build-system gnu-build-system)
3217 (modify-phases %standard-phases
3218 (add-before 'build 'pre-build
3219 (lambda* (#:key inputs #:allow-other-keys)
3220 (let ((bzip2 (assoc-ref inputs "bzip2"))
3221 (gzip (assoc-ref inputs "gzip"))
3222 (xz (assoc-ref inputs "xz"))
3223 (zstd (assoc-ref inputs "zstd")))
3224 (substitute* "src/libkbdfile/kbdfile.c"
3225 (("bzip2") (string-append bzip2 "/bin/bzip2"))
3226 (("gzip") (string-append gzip "/bin/gzip"))
3227 (("xz -d") (string-append xz "/bin/xz -d"))
3228 (("zstd") (string-append zstd "/bin/zstd"))))))
3229 (add-after 'install 'post-install
3230 (lambda* (#:key outputs #:allow-other-keys)
3231 ;; Make sure these programs find their comrades.
3232 (let* ((out (assoc-ref outputs "out"))
3233 (bin (string-append out "/bin")))
3234 (for-each (lambda (prog)
3235 (wrap-program (string-append bin "/" prog)
3236 `("PATH" ":" prefix (,bin))))
3237 '("unicode_start" "unicode_stop"))))))))
3239 `(("autoconf" ,autoconf)
3240 ("pkg-config" ,pkg-config)))
3247 (native-search-paths
3248 (list (search-path-specification
3249 (variable "LOADKEYS_KEYMAP_PATH")
3250 ;; Append ‘/**’ to recursively search all directories. One can then
3251 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
3252 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
3253 (files (list "share/keymaps/**")))))
3254 (home-page "http://kbd-project.org/")
3255 (synopsis "Linux keyboard utilities and keyboard maps")
3257 "This package contains keytable files and keyboard utilities compatible
3258 for systems using the Linux kernel. This includes commands such as
3259 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3260 (license license:gpl2+)))
3262 (define-public loadkeys-static
3265 (name "loadkeys-static")
3267 (substitute-keyword-arguments (package-arguments kbd)
3268 ((#:configure-flags flags ''())
3269 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
3270 "--disable-vlock" ;so we don't need libpam
3271 "--disable-libkeymap")
3273 ((#:make-flags flags ''())
3274 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
3275 ((#:phases phases '%standard-phases)
3276 `(modify-phases ,phases
3278 (lambda* (#:key outputs #:allow-other-keys)
3279 (let ((out (assoc-ref outputs "out")))
3280 ;; The binary keeps references to gzip, among other things,
3281 ;; which we don't need in the initrd, so strip references.
3282 (remove-store-references "src/loadkeys")
3284 (install-file "src/loadkeys"
3285 (string-append out "/bin")))))
3286 (delete 'post-install)))
3287 ((#:strip-flags _ '())
3289 ((#:allowed-references _ '())
3292 (synopsis "Statically-linked @command{loadkeys} program")
3294 ;; This package is meant to be used internally in the initrd so don't
3296 (properties '((hidden? . #t)))))
3298 (define-public inotify-tools
3300 (name "inotify-tools")
3301 (version "3.20.11.0")
3305 (url "https://github.com/rvoicilas/inotify-tools")
3307 (file-name (git-file-name name version))
3310 "1m8avqccrhm38krlhp88a7v949f3hrzx060bbrr5dp5qw2nmw9j2"))))
3311 (build-system gnu-build-system)
3313 `(("autoconf" ,autoconf)
3314 ("automake" ,automake)
3315 ("libtool" ,libtool)))
3318 (list "--disable-static")))
3319 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3320 (synopsis "Monitor file accesses")
3322 "The inotify-tools packages provides a C library and command-line tools
3323 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3324 (license license:gpl2+)))
3333 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3334 "kmod-" version ".tar.xz"))
3337 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3338 (patches (search-patches "kmod-module-directory.patch"))))
3339 (build-system gnu-build-system)
3341 `(("pkg-config" ,pkg-config)))
3346 `(#:configure-flags '("--with-xz" "--with-zlib"
3347 "--disable-test-modules")
3349 (modify-phases %standard-phases
3350 (add-after 'unpack 'disable-tests
3352 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3353 (substitute* "Makefile.in"
3354 (("testsuite/test-modprobe") "")
3355 (("testsuite/test-depmod") "")
3356 (("testsuite/test-blacklist") ""))
3358 (add-after 'install 'install-modprobe&co
3359 (lambda* (#:key outputs #:allow-other-keys)
3360 (let* ((out (assoc-ref outputs "out"))
3361 (bin (string-append out "/bin")))
3362 (for-each (lambda (tool)
3364 (string-append bin "/" tool)))
3365 '("insmod" "rmmod" "lsmod" "modprobe"
3366 "modinfo" "depmod"))
3368 (supported-systems (delete "i586-gnu" %supported-systems))
3369 (home-page "https://www.kernel.org/")
3370 (synopsis "Kernel module tools")
3371 (description "Kmod is a set of tools to handle common tasks with Linux
3372 kernel modules like insert, remove, list, check properties, resolve
3373 dependencies and aliases.
3375 These tools are designed on top of libkmod, a library that is shipped with
3376 kmod. The aim is to be compatible with tools, configurations and indices
3377 from the module-init-tools project.")
3378 (license license:gpl2+))) ; library under lgpl2.1+
3380 (define-public earlyoom
3387 (url "https://github.com/rfjakob/earlyoom")
3388 (commit (string-append "v" version))))
3389 (file-name (git-file-name name version))
3392 "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))))
3393 (build-system gnu-build-system)
3396 (modify-phases %standard-phases
3397 (delete 'configure) ; no configure script
3398 (add-before 'check 'set-go-HOME
3400 (setenv "HOME" (getcwd))
3402 (add-before 'check 'disable-failing-test
3404 ;; This test relies on writing to /proc/%d/oom_score_adj.
3405 (substitute* "testsuite_cli_test.go"
3407 (string-append "skipped" match)))
3409 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3410 (list ,(string-append "CC=" (cc-for-target))
3411 (string-append "VERSION=v" ,version)
3412 (string-append "PREFIX=" prefix)
3413 (string-append "SYSCONFDIR=" prefix "/etc")))
3414 #:test-target "test"))
3415 (native-inputs `(("go" ,go) ;for the test suite
3416 ("pandoc" ,pandoc))) ;to generate the manpage
3417 (home-page "https://github.com/rfjakob/earlyoom")
3418 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3419 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3420 runs in user space and provides a more responsive and configurable alternative
3421 to the in-kernel OOM killer.")
3422 (license license:expat)))
3424 (define-public eudev
3425 ;; The post-systemd fork, maintained by Gentoo.
3431 (uri (git-reference (url "https://github.com/gentoo/eudev")
3432 (commit (string-append "v" version))))
3433 (file-name (git-file-name name version))
3436 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3437 (patches (search-patches "eudev-rules-directory.patch"))))
3438 (build-system gnu-build-system)
3441 (modify-phases %standard-phases
3442 (add-after 'unpack 'make-source-writable
3444 ;; XXX: Git checkouts are read-only, but this package needs to
3445 ;; modify some of its files.
3446 (for-each make-file-writable (find-files "."))
3448 (add-before 'bootstrap 'patch-file-names
3449 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3450 (substitute* "man/make.sh"
3451 (("/usr/bin/xsltproc")
3452 (string-append (assoc-ref
3453 (or native-inputs inputs) "xsltproc")
3456 (add-before 'configure 'patch-bindir-in-btrfs-rules
3457 (lambda* (#:key outputs #:allow-other-keys)
3458 ;; The "@bindir@" substitution incorrectly expands to a literal
3459 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3461 (let ((out (assoc-ref outputs "out")))
3462 (substitute* "rules/64-btrfs.rules.in"
3464 (string-append out "/bin")))
3466 (add-after 'install 'move-static-library
3467 (lambda* (#:key outputs #:allow-other-keys)
3468 (let* ((out (assoc-ref outputs "out"))
3469 (static (assoc-ref outputs "static"))
3470 (source (string-append out "/lib/libudev.a"))
3471 (target (string-append static "/lib/libudev.a")))
3472 (mkdir-p (dirname target))
3473 (link source target)
3474 (delete-file source)
3475 ;; Remove reference to the static library from the .la file
3476 ;; such that Libtool looks for it in the usual places.
3477 (substitute* (string-append out "/lib/libudev.la")
3479 "old_library=''\n"))
3481 (add-after 'install 'build-hwdb
3482 (lambda* (#:key outputs #:allow-other-keys)
3483 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3484 ;; similar tools to display product names.
3486 ;; XXX: This can't be done when cross-compiling. Find another way
3487 ;; to generate hwdb.bin for cross-built systems.
3488 (let ((out (assoc-ref outputs "out")))
3489 ,@(if (%current-target-system)
3491 '((invoke (string-append out "/bin/udevadm")
3492 "hwdb" "--update")))))))
3493 #:configure-flags (list "--enable-manpages")))
3495 `(("autoconf" ,autoconf)
3496 ("automake" ,automake)
3498 ("libtool" ,libtool)
3499 ("pkg-config" ,pkg-config)
3502 ("python" ,python-wrapper)
3503 ;; For documentation.
3504 ("docbook-xml" ,docbook-xml-4.2)
3505 ("docbook-xsl" ,docbook-xsl)
3506 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3507 ("xsltproc" ,libxslt)))
3509 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3510 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3511 ;; which contains the rules to do that.
3512 `(("util-linux" ,util-linux "lib") ;for blkid
3514 (outputs '("out" "static"))
3515 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3516 (synopsis "Userspace device management")
3517 (description "Udev is a daemon which dynamically creates and removes
3518 device nodes from /dev/, handles hotplug events and loads drivers at boot
3520 (license license:gpl2+)))
3522 (define-public python-evdev
3524 (name "python-evdev")
3529 (uri (pypi-uri "evdev" version))
3531 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3532 (build-system python-build-system)
3534 `(("kernel-headers" ,linux-libre-headers)))
3536 `(#:tests? #f ;no rule for tests
3538 (modify-phases %standard-phases
3539 (add-before 'build 'fix-hard-coded-directory
3540 (lambda* (#:key inputs #:allow-other-keys)
3541 (substitute* "setup.py"
3542 (("/usr/include/linux")
3544 (assoc-ref inputs "kernel-headers") "/include/linux")))
3546 (home-page "https://github.com/gvalkov/python-evdev")
3547 (synopsis "Bindings to the Linux input handling subsystem")
3549 "Python-evdev provides bindings to the generic input event interface in
3550 Linux. The @code{evdev} interface serves the purpose of passing events
3551 generated in the kernel directly to userspace through character devices that
3552 are typically located in @file{/dev/input/}.
3554 This package also comes with bindings to @code{uinput}, the userspace input
3555 subsystem. @code{uinput} allows userspace programs to create and handle input
3556 devices that can inject events directly into the input subsystem.")
3557 (license license:bsd-3)))
3559 (define-public interception-tools
3561 (name "interception-tools")
3563 (home-page "https://gitlab.com/interception/linux/tools")
3568 (commit (string-append "v" version))))
3569 (file-name (git-file-name name version))
3572 "121jy40ynkbzlqnx7g0dqwvkb7dm2ahcy6vwrz6ylsyd0jmi6s5a"))))
3573 (build-system cmake-build-system)
3576 ("libevdev" ,libevdev)
3578 ("yaml-cpp" ,yaml-cpp)))
3581 (modify-phases %standard-phases
3582 (add-after 'unpack 'fix-libevdev-path
3583 (lambda* (#:key inputs #:allow-other-keys)
3584 (let ((libevdev (assoc-ref inputs "libevdev")))
3585 (substitute* "CMakeLists.txt"
3586 (("/usr/include/libevdev-1.0")
3587 (string-append libevdev "/include/libevdev-1.0")))
3589 ;; No tests are included.
3591 (synopsis "Utilities for operating on input events of evdev devices")
3593 "Interception Tools provides a composable infrastructure on top of
3594 @code{libudev} and @code{libevdev}. The following utilities are provided:
3597 @item @command{udevmon} --- monitor input devices for launching tasks
3598 @item @command{intercept} --- redirect device input events to stdout
3599 @item @command{uinput} --- redirect device input events from stding to virtual device
3600 @item @command{mux} --- mux streams of input events
3602 ;; Dual-licensed under GPLv3+ or "something else" on request, per
3604 (license license:gpl3+)))
3606 (define-public interception-dual-function-keys
3608 (name "interception-dual-function-keys")
3610 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
3616 (file-name (git-file-name name version))
3619 "1gvhkmwzl5fyyc7k8rc4rf2b9mzh05wa8wcybf9hz2x1mqkc7lmz"))))
3620 (build-system gnu-build-system)
3622 `(("libevdev" ,libevdev)
3623 ("yaml-cpp" ,yaml-cpp)))
3625 `(#:make-flags (list "CC=gcc" "CXX=g++"
3626 (string-append "PREFIX=" (assoc-ref %outputs "out")))
3628 (modify-phases %standard-phases
3629 (add-after 'unpack 'fix-libevdev-path
3630 (lambda* (#:key inputs #:allow-other-keys)
3631 (let ((libevdev (assoc-ref inputs "libevdev")))
3632 (substitute* "config.mk"
3633 (("/usr/include/libevdev-1.0")
3634 (string-append libevdev "/include/libevdev-1.0")))
3636 ;; No configure script
3638 ;; No target 'check'
3640 (synopsis "Tap for one key, hold for another")
3642 "Dual Function Keys is a plugin for @code{interception-tools} that allows
3643 one to send arbitrary keycodes when a given key is tapped or held.")
3644 (license license:expat)))
3652 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
3654 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3658 "1m4xpda8vbyd89ca0w8nacvnl4j34yzsa625gn990fb5sh84ab44"))
3659 (modules '((guix build utils)))
3662 (use-modules (guix build utils))
3664 ;; Honor sysconfdir.
3665 (substitute* "make.tmpl.in"
3667 "confdir = @sysconfdir@\n")
3668 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3669 "DEFAULT_SYS_DIR = @sysconfdir@"))
3671 (patches (search-patches "lvm2-static-link.patch"))))
3672 (build-system gnu-build-system)
3674 `(("pkg-config" ,pkg-config)
3675 ("procps" ,procps))) ;tests use 'pgrep'
3677 `(("libaio" ,libaio)
3681 (modify-phases %standard-phases
3682 (add-after 'configure 'set-makefile-shell
3684 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3686 (setenv "SHELL" (which "sh"))
3688 ;; Replace /bin/sh with the right file name.
3689 (patch-makefile-SHELL "make.tmpl")
3692 #:configure-flags (list (string-append "--sysconfdir="
3693 (assoc-ref %outputs "out")
3695 "--enable-udev_sync"
3696 "--enable-udev_rules"
3697 "--enable-pkgconfig"
3699 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3701 ;; Make sure programs such as 'dmsetup' can
3702 ;; find libdevmapper.so.
3703 (string-append "LDFLAGS=-Wl,-rpath="
3704 (assoc-ref %outputs "out")
3706 (assoc-ref %outputs "out")
3707 "/lib/device-mapper")
3708 ;; This is needed when cross-compiling.
3709 ,@(if (%current-target-system)
3710 '("ac_cv_func_malloc_0_nonnull=yes"
3711 "ac_cv_func_realloc_0_nonnull=yes")
3714 ;; The tests use 'mknod', which requires root access.
3716 (supported-systems (delete "i586-gnu" %supported-systems))
3717 (home-page "https://sourceware.org/lvm2/")
3718 (synopsis "Logical volume management for Linux")
3720 "LVM2 is the logical volume management tool set for Linux-based systems.
3721 This package includes the user-space libraries and tools, including the device
3722 mapper. Kernel components are part of Linux-libre.")
3724 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3725 ;; Command-line tools are GPLv2.
3726 (license (list license:gpl2 license:lgpl2.1))))
3728 (define-public lvm2-static
3731 (name "lvm2-static")
3733 ;; Propagate udev because libdevmapper.a depends on libudev.
3734 (propagated-inputs `(("udev:static" ,eudev "static")))
3737 (substitute-keyword-arguments (package-arguments lvm2)
3738 ((#:configure-flags flags '())
3739 ;; LVM2 doesn't use Libtool, hence the custom option.
3740 `(append '("--enable-static_link")
3741 ;; Building dmeventd statically is complicated due to a
3742 ;; requirement on libdevmapper.a, which is being phased out
3743 ;; in favor of libdevice-mapper.a, which in turn is is not
3744 ;; easily made available at dmeventd build time. Just ignore
3745 ;; it until the situation improves.
3746 (delete "--enable-dmeventd" ,flags)))
3748 `(modify-phases ,phases
3749 (add-before 'configure 'adjust-Makefile
3751 ;; These fixes are related to the upstream libdm->device_mapper
3752 ;; migration and will hopefully be fixed upstream in due time.
3753 (substitute* "tools/Makefile.in"
3754 ;; This variable is empty in a static configuration and causes
3755 ;; an erroneous GCC command line.
3756 (("-L\\$\\(interfacebuilddir\\)") "")
3757 ;; Remove obsolete reference to libdevmapper.a.
3758 (("-ldevmapper") ""))
3760 (synopsis "Logical volume management for Linux (statically linked)")))
3762 (define-public thin-provisioning-tools
3764 (name "thin-provisioning-tools")
3770 (url "https://github.com/jthornber/thin-provisioning-tools")
3771 (commit (string-append "v" version))))
3772 (file-name (git-file-name name version))
3774 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
3775 (build-system gnu-build-system)
3777 ;; Doesn't build with --enable-testing due to a function name collision
3778 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
3781 `(("automake" ,automake)
3782 ("autoreconf" ,autoconf)))
3786 ("libaio" ,libaio)))
3787 (synopsis "Tools for manipulating the metadata of device-mapper targets")
3788 (description "A suite of tools for manipulating the metadata of the
3789 dm-thin, dm-cache and dm-era device-mapper targets.")
3790 (home-page "https://github.com/jthornber/thin-provisioning-tools")
3791 (license license:gpl3+)))
3793 (define-public wireless-tools
3795 (name "wireless-tools")
3799 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3803 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3806 ;; Remove the older header files that are not free software.
3807 (for-each (lambda (n)
3808 (delete-file (format #f "wireless.~a.h" n)))
3809 '(10 11 12 13 14 15 16 17 18 19 20))
3811 (build-system gnu-build-system)
3814 (list (string-append "PREFIX=" %output)
3815 (string-append "INSTALL_MAN=" %output "/share/man")
3816 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3819 (modify-phases %standard-phases
3821 (lambda* (#:key target #:allow-other-keys)
3822 (when ,(%current-target-system)
3823 ;; Cross-compilation: use the cross tools.
3824 (substitute* (find-files "." "Makefile")
3826 (string-append "CC = " target "-gcc\n"))
3828 (string-append "AR = " target "-ar\n"))
3830 (string-append "RANLIB = " target "-ranlib\n"))))
3833 (synopsis "Tools for manipulating Linux Wireless Extensions")
3834 (description "Wireless Tools are used to manipulate the now-deprecated
3835 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3836 Extension was an interface allowing you to set Wireless LAN specific
3837 parameters and get the specific stats. It is deprecated in favor the nl80211
3839 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3840 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3841 ;; other files are distributed under gpl2.
3842 (license (list license:gpl2 license:lgpl2.1+))))
3850 (uri (string-append "mirror://kernel.org/software/network/crda/"
3851 "crda-" version ".tar.xz"))
3854 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3855 (patches (search-patches "crda-optional-gcrypt.patch"))))
3856 (build-system gnu-build-system)
3858 `(#:phases (modify-phases %standard-phases
3860 (add-after 'unpack 'gzip-determinism
3862 (substitute* "Makefile"
3863 (("gzip") "gzip --no-name"))
3865 ,@(if (%current-target-system)
3867 'unpack 'fix-pkg-config
3868 (lambda* (#:key target #:allow-other-keys)
3872 (string-append target "-pkg-config")))
3876 'build 'no-werror-no-ldconfig
3878 (substitute* "Makefile"
3880 (("ldconfig") "true"))
3883 'build 'set-regulator-db-file-name
3884 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3885 ;; Tell CRDA where to find our database.
3886 (let ((regdb (assoc-ref (or native-inputs inputs)
3888 (substitute* "crda.c"
3889 (("\"/lib/crda/regulatory.bin\"")
3890 (string-append "\"" regdb
3891 "/lib/crda/regulatory.bin\"")))
3893 #:test-target "verify"
3894 #:make-flags (let ((out (assoc-ref %outputs "out"))
3895 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3897 (string-append "CC=" ,(cc-for-target))
3900 ;; Disable signature-checking on 'regulatory.bin'.
3901 ;; The reason is that this simplifies maintenance
3902 ;; on our side (no need to manage a distro key
3903 ;; pair), and we can guarantee integrity of
3904 ;; 'regulatory.bin' by other means anyway, such as
3905 ;; 'guix gc --verify'. See
3906 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3910 (string-append "PREFIX=" out)
3911 (string-append "SBINDIR=" out "/sbin/")
3912 (string-append "UDEV_RULE_DIR="
3913 out "/lib/udev/rules.d")
3914 (string-append "LDFLAGS=-Wl,-rpath="
3916 (string-append "REG_BIN=" regdb
3917 "/lib/crda/regulatory.bin")
3919 (native-inputs `(("pkg-config" ,pkg-config)
3920 ("wireless-regdb" ,wireless-regdb)))
3921 (inputs `(("libnl" ,libnl)))
3923 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3924 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3926 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3927 communication between the kernel Linux and user space for regulatory
3929 (license license:copyleft-next)))
3931 (define-public wireless-regdb
3933 (name "wireless-regdb")
3934 (version "2020.11.20")
3938 "mirror://kernel.org/software/network/wireless-regdb/"
3939 "wireless-regdb-" version ".tar.xz"))
3942 "0liagyi6ppf5w474qk9j4jz5gbvvn8mc8al1dq4b1xrgv28485ml"))
3944 ;; We're building 'regulatory.bin' by ourselves.
3946 (delete-file "regulatory.bin")
3948 (build-system gnu-build-system)
3951 (modify-phases %standard-phases
3952 (add-after 'unpack 'gzip-determinism
3954 (substitute* "Makefile"
3955 (("gzip") "gzip --no-name"))
3957 (add-after 'unpack 'omit-signature
3959 (substitute* "Makefile"
3960 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3961 ;; don't provide (see below). Disable it.
3962 ((" regulatory\\.db\\.p7s") "")
3963 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3964 ;; but ‘make install’ depends only on the latter while installing
3965 ;; both (and failing). Depend on it explicitly.
3966 (("^install: " all) (string-append all "regulatory.db ")))
3968 (delete 'configure)) ; no configure script
3970 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3971 ;; is computed and can be equal to 'maintainer-clean'; when that
3972 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3973 ;; just built. Thus, build things sequentially.
3974 #:parallel-build? #f
3976 #:tests? #f ; no tests
3978 (let ((out (assoc-ref %outputs "out")))
3979 (list (string-append "PREFIX=" out)
3980 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3982 ;; Leave this empty so that db2bin.py doesn't try to sign
3983 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3984 ;; pair for the whole distribution.
3985 (string-append "REGDB_PRIVKEY=")
3986 ;; Don't generate a public key for the same reason. These are
3987 ;; used as Makefile targets and can't be the empty string.
3988 (string-append "REGDB_PUBCERT=/dev/null")
3989 (string-append "REGDB_PUBKEY=/dev/null")))))
3991 `(("python" ,python-wrapper)))
3993 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3994 (synopsis "Wireless regulatory database")
3996 "This package contains the wireless regulatory database for the Central
3997 Regulatory Database Agent (CRDA). The database contains information on
3998 country-specific regulations for the wireless spectrum.")
3999 (license license:isc)))
4001 (define-public lm-sensors
4009 (url "https://github.com/groeck/lm-sensors")
4010 (commit (string-append "V" (string-join
4011 (string-split version #\.) "-")))))
4012 (file-name (git-file-name name version))
4014 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
4015 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
4016 (build-system gnu-build-system)
4017 (inputs `(("rrdtool" ,rrdtool)
4020 ("gnuplot" ,gnuplot)))
4021 (native-inputs `(("pkg-config" ,pkg-config)
4025 (outputs '("lib" ; avoid perl in closure
4028 `(#:tests? #f ; no 'check' target
4029 #:make-flags (list (string-append "PREFIX=" %output)
4030 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
4031 (string-append "INCLUDEDIR="
4032 (assoc-ref %outputs "lib") "/include")
4033 (string-append "MANDIR=" %output "/share/man")
4034 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
4036 (modify-phases %standard-phases
4038 (add-before 'build 'patch-exec-paths
4039 (lambda* (#:key inputs outputs #:allow-other-keys)
4040 (substitute* "prog/detect/sensors-detect"
4042 (string-append "`" (assoc-ref inputs "coreutils")
4044 (("(`|\")modprobe" all open-quote)
4045 (string-append open-quote
4046 (assoc-ref inputs "kmod")
4048 (substitute* '("prog/pwm/pwmconfig"
4049 "prog/pwm/fancontrol")
4051 (string-append (assoc-ref inputs "gnuplot")
4054 (string-append (assoc-ref inputs "coreutils")
4057 (string-append (assoc-ref inputs "grep")
4060 (string-append (assoc-ref inputs "sed")
4063 (string-append (assoc-ref inputs "coreutils")
4066 (string-append (assoc-ref inputs "coreutils")
4069 (string-append (assoc-ref inputs "coreutils")
4070 "/bin/readlink -f")))
4072 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
4073 (synopsis "Utilities to read temperature/voltage/fan sensors")
4075 "Lm-sensors is a hardware health monitoring package for Linux. It allows
4076 you to access information from temperature, voltage, and fan speed sensors.
4077 It works with most newer systems.")
4078 (license license:gpl2+)))
4080 (define-public iucode-tool
4082 (name "iucode-tool")
4086 (uri (string-append "https://gitlab.com/iucode-tool/releases"
4087 "/raw/latest/iucode-tool_" version ".tar.xz"))
4090 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
4091 (build-system gnu-build-system)
4092 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
4093 (synopsis "Manipulate Intel microcode bundles")
4095 "@command{iucode_tool} is a utility to work with microcode packages for
4096 Intel processors. It can convert between formats, extract specific versions,
4097 create a firmware image suitable for the Linux kernel, and more.")
4098 ;; cpuid.h is available for i686, x86_64, and ia64.
4099 (supported-systems '("i686-linux" "x86_64-linux"))
4100 (license license:gpl2+)))
4102 (define-public i2c-tools
4109 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
4110 version ".tar.bz2"))
4113 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
4114 (build-system gnu-build-system)
4116 `(#:tests? #f ; no 'check' target
4117 #:make-flags (list (string-append "prefix=" %output)
4118 ,(string-append "CC=" (cc-for-target)))
4119 ;; No configure script.
4120 #:phases (modify-phases %standard-phases (delete 'configure))))
4123 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
4124 (synopsis "I2C tools for Linux")
4126 "The i2c-tools package contains a heterogeneous set of I2C tools for
4127 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
4128 EEPROM decoding scripts, EEPROM programming tools, and a python module for
4130 (license license:gpl2+)))
4132 (define-public xsensors
4139 "http://www.linuxhardware.org/xsensors/xsensors-"
4143 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
4144 (build-system gnu-build-system)
4145 (inputs `(("lm-sensors" ,lm-sensors "lib")
4147 (native-inputs `(("pkg-config" ,pkg-config)))
4150 (modify-phases %standard-phases
4151 (add-before 'configure 'enable-deprecated
4153 (substitute* "src/Makefile.in"
4154 (("-DGDK_DISABLE_DEPRECATED") "")
4155 (("-DGTK_DISABLE_DEPRECATED") ""))
4157 (add-before 'configure 'remove-Werror
4159 (substitute* '("configure" "src/Makefile.in")
4162 (home-page "http://www.linuxhardware.org/xsensors/")
4163 (synopsis "Hardware health information viewer")
4165 "Xsensors reads data from the libsensors library regarding hardware
4166 health such as temperature, voltage and fan speed and displays the information
4167 in a digital read-out.")
4168 (license license:gpl2+)))
4173 (version (package-version linux-libre))
4174 (source (package-source linux-libre))
4175 (build-system gnu-build-system)
4178 (modify-phases %standard-phases
4180 (lambda* (#:key inputs #:allow-other-keys)
4181 (setenv "SHELL_PATH" (which "bash"))
4182 (chdir "tools/perf")
4184 #:make-flags (list (string-append "prefix="
4185 (assoc-ref %outputs "out"))
4189 ;; By default, 'config/Makefile' uses lib64 on
4190 ;; x86_64. Work around that.
4192 #:tests? #f)) ;no tests
4194 `(("pkg-config" ,pkg-config)
4198 ;; There are build scripts written in these languages.
4200 ("python2" ,python-2)
4201 ("python3" ,python-3)))
4203 `(("slang" ,slang) ;for the interactive TUI
4205 ("python" ,python-2) ;'perf' links against libpython
4206 ("elfutils" ,elfutils)
4207 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
4208 ("libunwind" ,libunwind) ;better stack walking
4209 ("numactl" ,numactl) ;for 'perf bench numa mem'
4212 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
4213 ("docbook-xsl" ,docbook-xsl)
4215 ("asciidoc" ,asciidoc)))
4216 (home-page "https://perf.wiki.kernel.org/")
4217 (synopsis "Linux profiling with performance counters")
4219 "perf is a tool suite for profiling using hardware performance counters,
4220 with support in the Linux kernel. perf can instrument CPU performance
4221 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
4222 of lightweight profiling. This package contains the user-land tools and in
4223 particular the @code{perf} command.")
4224 (license (package-license linux-libre))))
4226 (define-public pflask
4233 (url "https://github.com/ghedo/pflask")
4234 (commit (string-append "v" version))))
4235 (file-name (git-file-name name version))
4238 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
4239 (build-system cmake-build-system)
4241 '(#:tests? #f)) ; no tests
4242 (home-page "https://ghedo.github.io/pflask/")
4243 (synopsis "Simple tool for creating Linux namespace containers")
4244 (description "pflask is a simple tool for creating Linux namespace
4245 containers. It can be used for running a command or even booting an OS inside
4246 an isolated container, created with the help of Linux namespaces. It is
4247 similar in functionality to chroot, although pflask provides better isolation
4248 thanks to the use of namespaces.")
4249 (license license:bsd-2)))
4251 (define-public singularity
4253 (name "singularity")
4257 (uri (string-append "https://github.com/singularityware/singularity/"
4258 "releases/download/" version
4259 "/singularity-" version ".tar.gz"))
4262 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
4263 (modules '((guix build utils)))
4266 ;; Do not create directories in /var.
4267 (substitute* "Makefile.in"
4268 (("\\$\\(MAKE\\) .*install-data-hook") ""))
4270 ;; The original source overrides PATH so that it points to
4271 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
4272 ;; on Guix System. Leave PATH unchanged so we refer to the
4273 ;; installed Coreutils, grep, etc.
4274 (substitute* "bin/singularity.in"
4276 (string-append "#" all "\n")))
4278 (substitute* (find-files "libexec/cli" "\\.exec$")
4279 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
4281 (string-append "/run/setuid-programs/singularity-"
4282 program "-helper")))
4284 ;; These squashfs mount options are apparently no longer
4285 ;; supported since Linux-libre 5.4.5.
4286 (substitute* "src/lib/image/squashfs/mount.c"
4287 (("\"errors=remount-ro\"")
4290 (build-system gnu-build-system)
4292 `(#:configure-flags '("--localstatedir=/var")
4294 (modify-phases %standard-phases
4295 (add-after 'unpack 'patch-references
4297 (substitute* "libexec/cli/build.exec.in"
4298 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
4299 (substitute* (append
4300 (find-files "libexec" "functions")
4301 (find-files "libexec/bootstrap-scripts" ".*sh$")
4302 (find-files "libexec/cli" ".*exec$"))
4304 (string-append "| " (which "grep") " "))
4306 (string-append (which "egrep") " "))
4308 (string-append " " (which "sed") " ")))
4310 (add-after 'install 'set-PATH
4311 (lambda* (#:key inputs outputs #:allow-other-keys)
4312 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
4313 (let ((out (assoc-ref outputs "out"))
4314 (coreutils (assoc-ref inputs "coreutils")))
4315 (wrap-program (string-append out "/bin/singularity")
4316 `("PATH" ":" = (,(string-append coreutils "/bin"))))
4317 (substitute* (string-append out "/bin/run-singularity")
4318 (("/usr/bin/env singularity")
4319 (string-append (which "env") " "
4320 out "/bin/singularity")))
4323 `(("libarchive" ,libarchive)
4324 ("python" ,python-wrapper)
4326 ("squashfs-tools" ,squashfs-tools)))
4327 (home-page "https://singularity.lbl.gov/")
4328 (synopsis "Container platform")
4329 (description "Singularity is a container platform supporting a number of
4330 container image formats. It can build SquashFS container images or import
4331 existing Docker images. Singularity requires kernel support for container
4332 isolation or root privileges.")
4333 (license license:bsd-3)))
4335 (define-public hdparm
4341 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
4342 "hdparm-" version ".tar.gz"))
4345 "0zvppv8qw0y1shlhn34iq1g4883i1cywsa514n595nmyrmsrs3rc"))))
4346 (build-system gnu-build-system)
4349 (let ((out (assoc-ref %outputs "out")))
4350 (list (string-append "binprefix=" out)
4351 (string-append "manprefix=" out)
4352 ,(string-append "CC=" (cc-for-target))
4353 ;; Let Guix strip the binaries and not break cross-compilation.
4356 (modify-phases %standard-phases
4357 (delete 'configure)) ; no configure script
4358 #:tests? #f)) ; no test suite
4359 (home-page "https://sourceforge.net/projects/hdparm/")
4360 (synopsis "View and tune ATA disk drive parameters")
4362 "@command{hdparm} is a command-line utility to control ATA controllers and
4363 disk drives. It can increase performance and/or reliability by careful tuning
4364 of hardware settings like power and acoustic management, DMA modes, and caching.
4365 It can also display detailed device information, or be used as a simple
4366 performance benchmarking tool.
4368 @command{hdparm} provides a command line interface to various Linux kernel
4369 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
4370 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4371 Translation (@dfn{SAT}) are also supported.")
4372 (license (license:non-copyleft "file://LICENSE.TXT"))))
4374 (define-public nvme-cli
4378 (home-page "https://github.com/linux-nvme/nvme-cli")
4383 (commit (string-append "v" version))))
4385 (base32 "0dpadz945482srqpsbfx1bh7rc499fgpyzz1flhk9g9xjbpapkzc"))
4386 (file-name (git-file-name name version))))
4387 (build-system gnu-build-system)
4390 (list ,(string-append "CC=" (cc-for-target)))
4391 #:phases (modify-phases %standard-phases
4392 (delete 'configure) ; no ./configure script
4395 (invoke "make" "install-spec" "PREFIX="
4396 (string-append "DESTDIR=" %output)))))
4397 ;; The tests require sysfs, which is not accessible from from the build
4400 (synopsis "NVM-Express user space tooling for Linux")
4401 (description "Nvme-cli is a utility to provide standards compliant tooling
4402 for NVM-Express drives. It was made specifically for Linux as it relies on the
4403 IOCTLs defined by the mainline kernel driver.")
4404 (license license:gpl2+)))
4406 (define-public rfkill
4412 (uri (string-append "mirror://kernel.org/software/network/"
4413 name "/" name "-" version ".tar.xz"))
4416 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4417 (build-system gnu-build-system)
4419 `(#:make-flags (list "CC=gcc"
4420 (string-append "PREFIX=" %output))
4421 #:phases (modify-phases %standard-phases
4422 (delete 'configure))
4424 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4425 (synopsis "Tool for enabling and disabling wireless devices")
4427 "rfkill is a simple tool for accessing the rfkill device interface,
4428 which is used to enable and disable wireless networking devices, typically
4429 WLAN, Bluetooth and mobile broadband.")
4430 (license (license:non-copyleft "file://COPYING"
4431 "See COPYING in the distribution."))
4432 ;; rfkill is part of util-linux as of 2.31.
4433 (properties `((superseded . ,util-linux)))))
4441 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4442 version "/" name "-" version ".tar.gz"))
4445 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4446 (build-system gnu-build-system)
4447 (home-page "http://acpiclient.sourceforge.net")
4448 (synopsis "Display information on ACPI devices")
4449 (description "@code{acpi} attempts to replicate the functionality of the
4450 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4451 information. It does not support ACPI suspending, only displays information
4452 about ACPI devices.")
4453 (license license:gpl2+)))
4455 (define-public acpid
4461 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4465 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4466 (build-system gnu-build-system)
4467 (home-page "https://sourceforge.net/projects/acpid2/")
4468 (synopsis "Daemon for delivering ACPI events to user-space programs")
4470 "acpid is designed to notify user-space programs of Advanced
4471 Configuration and Power Interface (ACPI) events. acpid should be started
4472 during the system boot, and will run as a background process. When an ACPI
4473 event is received from the kernel, acpid will examine the list of rules
4474 specified in /etc/acpi/events and execute the rules that match the event.")
4475 (license license:gpl2+)))
4477 (define-public sysfsutils
4486 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4489 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4490 (build-system gnu-build-system)
4491 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4492 (synopsis "System utilities based on Linux sysfs")
4494 "These are a set of utilities built upon sysfs, a virtual file system in
4495 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4496 also contains the libsysfs library.")
4497 ;; The library is under lgpl2.1+ (all files say "or any later version").
4498 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4499 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4501 (define-public sysfsutils-1
4503 (inherit sysfsutils)
4510 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4511 "/sysfsutils-" version ".tar.gz"))
4513 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4514 (modules '((guix build utils)))
4517 (substitute* "Makefile.in"
4518 (("includedir = /usr/include/sysfs")
4519 "includedir = @includedir@"))
4520 (substitute* "configure"
4521 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4522 (string-append "includedir='" orig "/sysfs'")))
4524 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4526 (define-public cpufrequtils
4528 (name "cpufrequtils")
4533 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4534 "cpufrequtils-" version ".tar.gz"))
4536 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4537 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4538 (build-system gnu-build-system)
4540 `(("sysfsutils" ,sysfsutils-1)))
4542 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4543 (assoc-ref %outputs "out") "/lib"))))
4544 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4545 (synopsis "Utilities to get and set CPU frequency on Linux")
4547 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4548 information, and set the CPU frequency if supported, using the cpufreq
4549 capabilities of the Linux kernel.")
4550 (license license:gpl2)))
4552 (define-public libraw1394
4559 "mirror://kernel.org/linux/libs/ieee1394/"
4560 name "-" version ".tar.xz"))
4563 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4564 (build-system gnu-build-system)
4565 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4566 (synopsis "Interface library for the Linux IEEE1394 drivers")
4568 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4569 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4570 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4571 send to and receive from other nodes without requiring a kernel driver for the
4572 protocol in question.")
4573 (license license:lgpl2.1+)))
4575 (define-public libavc1394
4581 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4582 name "-" version ".tar.gz"))
4585 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4586 (build-system gnu-build-system)
4588 `(("pkg-config" ,pkg-config)))
4590 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4591 (home-page "https://sourceforge.net/projects/libavc1394/")
4592 (synopsis "AV/C protocol library for IEEE 1394")
4594 "Libavc1394 is a programming interface to the AV/C specification from
4595 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4596 (license license:lgpl2.1+)))
4598 (define-public libiec61883
4600 (name "libiec61883")
4605 "mirror://kernel.org/linux/libs/ieee1394/"
4606 name "-" version ".tar.xz"))
4609 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4610 (build-system gnu-build-system)
4612 `(("pkg-config" ,pkg-config)))
4614 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4615 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4616 (synopsis "Isochronous streaming media library for IEEE 1394")
4618 "The libiec61883 library provides a higher level API for streaming DV,
4619 MPEG-2 and audio over Linux IEEE 1394.")
4620 (license license:lgpl2.1+)))
4622 (define-public mdadm
4629 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4633 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4634 (build-system gnu-build-system)
4638 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4639 (list ,(string-append "CC=" (cc-for-target))
4642 ;; TODO: tell it where to find 'sendmail'
4643 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4644 (string-append "BINDIR=" out "/sbin")
4645 (string-append "MANDIR=" out "/share/man")
4646 (string-append "UDEVDIR=" out "/lib/udev")))
4648 (modify-phases %standard-phases
4649 (add-before 'build 'patch-program-paths
4650 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4651 (let ((coreutils (assoc-ref (or native-inputs inputs)
4653 (substitute* "udev-md-raid-arrays.rules"
4654 (("/usr/bin/(readlink|basename)" all program)
4655 (string-append coreutils "/bin/" program))))
4657 (add-before 'build 'remove-W-error
4659 ;; We cannot build with -Werror on i686 due to a
4660 ;; 'sign-compare' warning in util.c.
4661 (substitute* "Makefile"
4664 (delete 'configure))
4665 ;;tests must be done as root
4667 (supported-systems (delete "i586-gnu" %supported-systems))
4668 (home-page "http://neil.brown.name/blog/mdadm")
4669 (synopsis "Tool for managing Linux Software RAID arrays")
4671 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4672 assemble, report on, and monitor arrays. It can also move spares between raid
4673 arrays when needed.")
4674 (license license:gpl2+)))
4676 (define-public mdadm-static
4679 (name "mdadm-static")
4681 (substitute-keyword-arguments (package-arguments mdadm)
4682 ((#:make-flags flags)
4683 `(cons "LDFLAGS = -static" ,flags))
4685 `(modify-phases ,phases
4686 (add-after 'install 'remove-cruft
4687 (lambda* (#:key outputs #:allow-other-keys)
4688 (let* ((out (assoc-ref outputs "out"))
4689 (precious? (lambda (file)
4690 (member file '("." ".." "sbin"))))
4691 (directories (scandir out (negate precious?))))
4692 (with-directory-excursion out
4693 (for-each delete-file-recursively directories)
4694 (remove-store-references "sbin/mdadm")
4695 (delete-file "sbin/mdmon")
4697 ((#:modules modules %gnu-build-system-modules)
4698 `((ice-9 ftw) ,@modules))
4699 ((#:strip-flags _ '())
4700 ''("--strip-all")) ;strip a few extra KiB
4701 ((#:allowed-references _ '("out"))
4702 '("out")))) ;refer only self
4703 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4705 (define-public multipath-tools
4707 (name "multipath-tools")
4712 (url "https://git.opensvc.com/multipath-tools/.git")
4714 (file-name (git-file-name name version))
4717 "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg"))
4718 (modules '((guix build utils)))
4721 ;; Drop bundled valgrind headers.
4722 (delete-file-recursively "third-party")
4723 (substitute* '("multipathd/main.c"
4724 "libmultipath/debug.c")
4725 (("#include \"../third-party/")
4728 (build-system gnu-build-system)
4730 '(#:test-target "test"
4731 #:parallel-build? #f ;XXX: broken in 0.8.4
4732 #:make-flags (list "CC=gcc"
4733 (string-append "DESTDIR="
4734 (assoc-ref %outputs "out"))
4735 ;; Install Udev rules below this directory, relative
4738 (string-append "LDFLAGS=-Wl,-rpath="
4739 (assoc-ref %outputs "out")
4742 (modify-phases %standard-phases
4743 (add-after 'unpack 'patch-source
4744 (lambda* (#:key inputs #:allow-other-keys)
4745 (let ((lvm2 (assoc-ref inputs "lvm2"))
4746 (udev (assoc-ref inputs "udev")))
4747 (substitute* "Makefile.inc"
4748 (("\\$\\(prefix\\)/usr") "$(prefix)")
4749 ;; Do not save timestamp to avoid gzip "timestamp
4750 ;; out-of-range" warnings.
4751 (("gzip -9") "gzip -9n"))
4752 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4753 (("/usr/include/libdevmapper.h")
4754 (string-append lvm2 "/include/libdevmapper.h"))
4755 (("/usr/include/libudev.h")
4756 (string-append udev "/include/libudev.h")))
4758 (add-after 'unpack 'fix-maybe-uninitialized-variable
4760 ;; This variable gets initialized later if needed, but GCC 7
4761 ;; fails to notice. Should be fixed for > 0.8.4.
4762 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4763 (substitute* "libmultipath/structs_vec.c"
4764 (("bool is_queueing;")
4765 "bool is_queueing = false;"))
4767 (add-after 'unpack 'fix-linking-tests
4769 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4770 ;; for versions > 0.8.4.
4771 (substitute* "tests/Makefile"
4772 (("-lmultipath -lcmocka")
4773 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4775 (add-after 'unpack 'skip-failing-tests
4777 ;; This test and the module's setup() test an arbitrary block
4778 ;; device node name, but the build environment has none.
4779 (substitute* "tests/devt.c"
4780 (("return get_one_devt.*") "return 0;\n")
4781 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
4782 ;; The above triggers -Werror=unused-function. Ignore it.
4783 (substitute* "tests/Makefile"
4784 (("CFLAGS \\+= " match)
4785 (string-append match "-Wno-error=unused-function ")))
4787 (delete 'configure)))) ; no configure script
4790 ("pkg-config" ,pkg-config)
4791 ("valgrind" ,valgrind)
4794 ("cmocka" ,cmocka)))
4796 `(("json-c" ,json-c)
4798 ("liburcu" ,liburcu)
4800 ("readline" ,readline)
4802 (home-page "http://christophe.varoqui.free.fr/")
4803 (synopsis "Access block devices through multiple paths")
4805 "This package provides the following binaries to drive the
4806 Linux Device Mapper multipathing driver:
4808 @item @command{multipath} - Device mapper target autoconfig.
4809 @item @command{multipathd} - Multipath daemon.
4810 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4811 @code{dm} multipath devices.
4812 @item @command{kpartx} - Create device maps from partition tables.
4814 (license (list license:gpl2+ ; main distribution
4815 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4817 (define-public libaio
4824 (string-append "https://releases.pagure.org/libaio/"
4825 name "-" version ".tar.gz")))
4828 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4829 (build-system gnu-build-system)
4832 (let ((target ,(%current-target-system)))
4833 (list (string-append "prefix=" %output)
4836 (string-append (assoc-ref %build-inputs "cross-gcc")
4837 "/bin/" target "-gcc")
4839 #:test-target "partcheck" ; need root for a full 'check'
4841 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4842 (home-page "https://pagure.io/libaio")
4843 (synopsis "Linux-native asynchronous I/O access library")
4845 "This library enables userspace to use Linux kernel asynchronous I/O
4846 system calls, important for the performance of databases and other advanced
4848 (license license:lgpl2.1+)))
4850 (define-public blktrace
4851 ;; Take a newer commit to get the fix for CVE-2018-10689.
4852 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4856 (version (git-version "1.2.0" revision commit))
4858 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4865 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4866 (file-name (git-file-name name version))))
4867 (build-system gnu-build-system)
4870 (list ,(string-append "CC=" (cc-for-target))
4871 (string-append "prefix=" %output))
4872 #:tests? #f ; no tests
4874 (modify-phases %standard-phases
4875 (delete 'configure) ; no configure script
4876 (add-after 'unpack 'fix-gnuplot-path
4877 (lambda* (#:key inputs #:allow-other-keys)
4878 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4879 (substitute* "btt/bno_plot.py"
4881 (string-append gnuplot "/bin/gnuplot %s")))
4884 `(("libaio" ,libaio)
4885 ("gnuplot" ,gnuplot)
4886 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4887 (synopsis "Block layer IO tracing mechanism")
4888 (description "Blktrace is a block layer IO tracing mechanism which provides
4889 detailed information about request queue operations to user space. It extracts
4890 event traces from the kernel (via the relaying through the debug file system).")
4891 (license license:gpl2))))
4899 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4901 (patches (search-patches "sbc-fix-build-non-x86.patch"))
4904 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
4905 (build-system gnu-build-system)
4907 `(("libsndfile" ,libsndfile)))
4909 `(("pkg-config" ,pkg-config)))
4910 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4911 (synopsis "Bluetooth subband audio codec")
4913 "The SBC is a digital audio encoder and decoder used to transfer data to
4914 Bluetooth audio output devices like headphones or loudspeakers.")
4915 (license license:gpl2+)))
4917 (define-public bluez
4924 "mirror://kernel.org/linux/bluetooth/bluez-"
4928 "124v9s4y1s7s6klx5vlmzpk1jlr4x84ch7r7scm7x2f42dqp2qw8"))))
4929 (build-system gnu-build-system)
4932 (let ((out (assoc-ref %outputs "out")))
4933 (list "--sysconfdir=/etc"
4934 "--localstatedir=/var"
4937 ;; TODO: is this needed? Not installed by default since 5.55.
4939 ;; Install dbus/udev files to the correct location.
4940 (string-append "--with-dbusconfdir=" out "/etc")
4941 (string-append "--with-udevdir=" out "/lib/udev")))
4943 (modify-phases %standard-phases
4944 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4945 ;; issue (discussion on upstream mailing list:
4946 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4947 (add-before 'check 'skip-wonky-test
4949 (substitute* "unit/test-gatt.c"
4950 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4952 (add-after 'install 'post-install
4953 (lambda* (#:key inputs outputs #:allow-other-keys)
4954 (let* ((out (assoc-ref outputs "out"))
4955 (servicedir (string-append out "/share/dbus-1/services"))
4956 (service "obexd/src/org.bluez.obex.service")
4957 (rule (string-append
4958 out "/lib/udev/rules.d/97-hid2hci.rules")))
4959 ;; Install the obex dbus service file.
4960 (substitute* service
4962 (string-append out "/libexec/bluetooth/obexd")))
4963 (install-file service servicedir)
4964 ;; Fix paths in the udev rule.
4966 (("hid2hci --method")
4967 (string-append out "/lib/udev/hid2hci --method"))
4969 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4972 `(("pkg-config" ,pkg-config)
4973 ("gettext" ,gettext-minimal)))
4978 ("libical" ,libical)
4979 ("readline" ,readline)))
4980 (home-page "http://www.bluez.org/")
4981 (synopsis "Linux Bluetooth protocol stack")
4983 "BlueZ provides support for the core Bluetooth layers and protocols. It
4984 is flexible, efficient and uses a modular implementation.")
4985 (license license:gpl2+)))
4987 (define-public fuse-exfat
4994 "https://github.com/relan/exfat/releases/download/v"
4995 version "/" name "-" version ".tar.gz"))
4998 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4999 (build-system gnu-build-system)
5001 `(("pkg-config" ,pkg-config)))
5004 (home-page "https://github.com/relan/exfat")
5005 (synopsis "Mount exFAT file systems")
5007 "This package provides a FUSE-based file system that provides read and
5008 write access to exFAT devices.")
5009 (license license:gpl2+)))
5011 (define-public fuseiso
5014 (version "20070708")
5017 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
5018 version "/fuseiso-" version ".tar.bz2"))
5021 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
5022 (build-system gnu-build-system)
5024 `(("pkg-config" ,pkg-config)))
5029 (home-page "https://sourceforge.net/projects/fuseiso/")
5030 (synopsis "Mount ISO file system images")
5032 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
5033 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
5034 Ridge, Joliet, and zisofs.")
5035 (license license:gpl2)))
5044 "https://www.nico.schottelius.org/software/gpm/archives/"
5045 "gpm-" version ".tar.bz2"))
5046 (patches (search-patches "gpm-glibc-2.26.patch"))
5049 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
5050 (build-system gnu-build-system)
5052 '(#:phases (modify-phases %standard-phases
5055 ;; The tarball was not generated with 'make dist' so we
5056 ;; need to bootstrap things ourselves.
5057 (substitute* "autogen.sh"
5058 (("/bin/sh") (which "sh")))
5059 (invoke "./autogen.sh")
5060 (patch-makefile-SHELL "Makefile.include.in")
5063 ;; Make sure programs find libgpm.so.
5064 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
5065 (assoc-ref %outputs "out")
5068 `(("texinfo" ,texinfo)
5071 ("autoconf" ,autoconf)
5072 ("automake" ,automake)
5073 ("libtool" ,libtool)))
5074 (home-page "https://www.nico.schottelius.org/software/gpm/")
5075 (synopsis "Mouse support for the Linux console")
5077 "The GPM (general-purpose mouse) daemon is a mouse server for
5078 applications running on the Linux console. It allows users to select items
5079 and copy/paste text in the console and in xterm.")
5080 (license license:gpl2+)))
5082 (define-public btrfs-progs
5084 (name "btrfs-progs")
5088 (uri (string-append "mirror://kernel.org/linux/kernel/"
5089 "people/kdave/btrfs-progs/"
5090 "btrfs-progs-v" version ".tar.xz"))
5093 "0n9p8zaz4nrkgc20cp6zj7gp4ib4hd4lbyph74f4pysllkz4c24m"))))
5094 (build-system gnu-build-system)
5096 "static")) ; static versions of the binaries in "out"
5098 '(#:phases (modify-phases %standard-phases
5099 (add-after 'unpack 'patch-makefile
5100 (lambda* (#:key outputs #:allow-other-keys)
5101 (substitute* "Makefile"
5102 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
5103 (string-append (assoc-ref outputs "out")
5104 "/lib/udev/rules.d")))
5106 (add-after 'build 'build-static
5107 (lambda _ (invoke "make" "static")))
5108 (add-after 'install 'install-bash-completion
5109 (lambda* (#:key outputs #:allow-other-keys)
5110 (let* ((out (assoc-ref outputs "out"))
5111 (bashcomp (string-append out "/etc/bash_completion.d")))
5113 (copy-file "btrfs-completion"
5114 (string-append bashcomp "/btrfs"))
5116 (add-after 'install 'install-static
5117 (let ((staticbin (string-append (assoc-ref %outputs "static")
5121 (string-append "bindir=" staticbin)
5122 "install-static")))))
5123 #:tests? #f ; XXX: require the 'btrfs' kernel module.
5124 #:test-target "test"
5125 #:parallel-tests? #f)) ; tests fail when run in parallel
5126 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
5128 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
5129 ("util-linux:static" ,util-linux "static") ;ditto
5131 ("zlib:static" ,zlib "static")
5132 ("zstd" ,zstd "lib")
5133 ("zstd:static" ,zstd "static")))
5134 (native-inputs `(("pkg-config" ,pkg-config)
5135 ("asciidoc" ,asciidoc)
5138 ;; Remove this input entirely when the default headers
5139 ;; version provides blk_zone.capacity (>= 5.9).
5140 ("linux-libre-headers" ,linux-libre-headers-5.10)
5141 ;; For building documentation.
5142 ("libxml2" ,libxml2)
5143 ("docbook-xsl" ,docbook-xsl)
5149 ;; The tests need 'grep' with perl regexp support.
5151 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
5152 (synopsis "Create and manage btrfs copy-on-write file systems")
5153 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
5154 aimed at implementing advanced features while focusing on fault tolerance,
5155 repair and easy administration.")
5156 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
5157 ;; GPL2: Everything else.
5158 (license (list license:gpl2 license:gpl2+))))
5160 (define-public btrfs-progs/static
5162 (name "btrfs-progs-static")
5163 (version (package-version btrfs-progs))
5165 (build-system trivial-build-system)
5167 `(("btrfs-progs:static" ,btrfs-progs "static")))
5169 `(#:modules ((guix build utils))
5172 (use-modules (guix build utils)
5176 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
5177 (out (assoc-ref %outputs "out"))
5178 (source (string-append btrfs "/bin/btrfs.static"))
5179 (target (string-append out "/bin/btrfs")))
5180 (mkdir-p (dirname target))
5181 (copy-file source target)
5182 (remove-store-references target)
5183 (chmod target #o555)
5185 (home-page (package-home-page btrfs-progs))
5186 (synopsis "Statically-linked btrfs command from btrfs-progs")
5187 (description "This package provides the statically-linked @command{btrfs}
5188 from the btrfs-progs package. It is meant to be used in initrds.")
5189 (license (package-license btrfs-progs))))
5191 (define-public cramfs-tools
5193 (name "cramfs-tools")
5194 (home-page "https://github.com/npitre/cramfs-tools")
5200 (commit (string-append "v" version))))
5202 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
5203 (file-name (git-file-name name version))))
5204 (build-system gnu-build-system)
5206 '(#:tests? #f ; No tests.
5208 (modify-phases %standard-phases
5211 (lambda* (#:key outputs #:allow-other-keys)
5212 (let ((out (assoc-ref outputs "out")))
5213 (install-file "mkcramfs" (string-append out "/sbin"))
5214 (install-file "cramfsck" (string-append out "/sbin")))
5218 (synopsis "Tools to manage Cramfs file systems")
5219 (description "Cramfs is a Linux file system designed to be simple, small,
5220 and to compress things well. It is used on a number of embedded systems and
5221 small devices. This version has additional features such as uncompressed
5222 blocks and random block placement.")
5223 (license license:gpl2+)))
5225 (define-public compsize
5229 (home-page "https://github.com/kilobyte/compsize")
5234 (commit (string-append "v" version))))
5236 (base32 "0vqnrwgpv6pc1yjl0g4gl71xyl6v0xl3pyqjanjpwps73c53azir"))
5237 (file-name (git-file-name name version))))
5238 (build-system gnu-build-system)
5240 `(("btrfs-progs" ,btrfs-progs)))
5242 `(#:tests? #f ; No tests.
5244 (list (string-append "CC=" ,(cc-for-target)))
5246 (modify-phases %standard-phases
5249 (lambda* (#:key outputs #:allow-other-keys)
5250 (let ((out (assoc-ref outputs "out")))
5251 (install-file "compsize" (string-append out "/bin"))
5252 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
5253 (synopsis "Find compression type/ratio on Btrfs files")
5254 (description "@command{compsize} takes a list of files (given as
5255 arguments) on a Btrfs file system and measures used compression types and
5256 effective compression ratio, producing a report.
5258 A directory has no extents but has a (recursive) list of files. A non-regular
5259 file is silently ignored.
5261 As it makes no sense to talk about compression ratio of a partial extent,
5262 every referenced extent is counted whole, exactly once -- no matter if you use
5263 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
5264 uncompressed size will not match the number given by @command{tar} or
5265 @command{du}. On the other hand, the space used should be accurate (although
5266 obviously it can be shared with files outside our set).")
5267 (license license:gpl2+)))
5269 (define-public f2fs-tools-1.7
5276 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5277 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5280 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
5282 (build-system gnu-build-system)
5285 (modify-phases %standard-phases
5286 (add-after 'install 'install-headers
5287 (lambda* (#:key outputs #:allow-other-keys)
5288 (let* ((out (assoc-ref outputs "out"))
5289 (out-include (string-append out "/include")))
5290 (install-file "include/f2fs_fs.h" out-include)
5291 (install-file "mkfs/f2fs_format_utils.h" out-include)
5294 `(("autoconf" ,autoconf)
5295 ("automake" ,automake)
5296 ("libtool" ,libtool)
5297 ("pkg-config" ,pkg-config)))
5299 `(("libuuid" ,util-linux "lib")
5300 ("libselinux" ,libselinux)))
5301 (home-page "https://f2fs.wiki.kernel.org/")
5302 (synopsis "Userland tools for f2fs")
5304 "F2FS, the Flash-Friendly File System, is a modern file system
5305 designed to be fast and durable on flash devices such as solid-state
5306 disks and SD cards. This package provides the userland utilities.")
5307 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
5308 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
5309 (license (list license:gpl2 license:lgpl2.1))))
5311 (define-public f2fs-tools
5313 (inherit f2fs-tools-1.7)
5319 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5320 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5323 "1lab1446c78xsjwhpki7s85z4171m8p9279c8yhm4882wba674k1"))))
5325 `(("libuuid" ,util-linux "lib")))))
5327 (define-public f2fs-tools/static
5330 (inherit f2fs-tools)
5331 (name "f2fs-tools-static")
5334 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
5335 (libuuid (assoc-ref %build-inputs "libuuid")))
5337 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
5338 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
5339 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
5340 "-I" libuuid "/include/blkid")
5341 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
5342 #:disallowed-references (,util-linux)
5344 (modify-phases %standard-phases ; TODO: f2fs phases.
5345 (add-after 'unpack 'make-static
5347 (define (append-to-file name body)
5348 (let ((file (open-file name "a")))
5351 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
5352 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
5353 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
5355 (add-after 'install 'remove-store-references
5356 (lambda* (#:key outputs #:allow-other-keys)
5357 ;; Work around bug in our util-linux.
5358 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
5359 (remove-store-references (string-append (assoc-ref outputs "out")
5363 `(("libuuid:static" ,util-linux "static")
5364 ("libuuid" ,util-linux "lib")))))) ; for include files
5366 (define-public f2fs-fsck/static
5368 (name "f2fs-fsck-static")
5369 (version (package-version f2fs-tools/static))
5371 (build-system trivial-build-system)
5373 `(#:modules ((guix build utils))
5376 (use-modules (guix build utils)
5379 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
5381 (out (assoc-ref %outputs "out"))
5382 (sbin (string-append out "/sbin")))
5384 (with-directory-excursion sbin
5385 (install-file (string-append f2fs-tools "/sbin/" fsck)
5387 (remove-store-references fsck)
5391 `(("f2fs-tools-static" ,f2fs-tools/static)))
5392 (home-page (package-home-page f2fs-tools/static))
5393 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5394 (description "This package provides statically-linked fsck.f2fs command taken
5395 from the f2fs-tools package. It is meant to be used in initrds.")
5396 (license (package-license f2fs-tools/static))))
5398 (define-public freefall
5401 (version (package-version linux-libre))
5402 (source (package-source linux-libre))
5403 (build-system gnu-build-system)
5405 '(#:phases (modify-phases %standard-phases
5406 (add-after 'unpack 'enter-subdirectory
5408 (chdir "tools/laptop/freefall")
5411 (add-before 'build 'increase-timeout
5413 ;; The default of 2 seconds is too low: it assumes an
5414 ;; open lid and AC power without actually checking.
5415 (substitute* "freefall.c"
5416 (("alarm\\(2\\)") "alarm(5)"))
5418 #:make-flags (list (string-append "PREFIX="
5419 (assoc-ref %outputs "out"))
5421 #:tests? #f)) ;no tests
5422 (home-page (package-home-page linux-libre))
5423 (synopsis "Free-fall protection for spinning laptop hard drives")
5425 "Prevents shock damage to the internal spinning hard drive(s) of some
5426 HP and Dell laptops. When sudden movement is detected, all input/output
5427 operations on the drive are suspended and its heads are parked on the ramp,
5428 where they are less likely to cause damage to the spinning disc. Requires a
5429 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5430 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5431 (license license:gpl2)))
5433 (define-public thinkfan
5441 (url "https://github.com/vmatare/thinkfan")
5443 (file-name (git-file-name name version))
5445 (base32 "18vgm5w5pjnpipa34j4x87q10695w2jnqwvc2f027afy7mnzw7kz"))))
5446 (build-system cmake-build-system)
5448 `(#:modules ((guix build cmake-build-system)
5451 #:tests? #f ; no test target
5453 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5454 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5456 `("-DUSE_ATASMART:BOOL=ON")
5458 (modify-phases %standard-phases
5459 (add-after 'unpack 'create-init-scripts
5460 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5461 ;; systemd to patch and install their service files. Fake their
5462 ;; presence rather than duplicating the build system below. Leave
5463 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5464 ;; The sysvinit needs manual patching, but since upstream doesn't
5465 ;; even provide the option to install it: don't.
5466 (lambda* (#:key outputs #:allow-other-keys)
5467 (let* ((out (assoc-ref outputs "out"))
5468 (share (string-append out "/share/" ,name)))
5469 (substitute* "CMakeLists.txt"
5470 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5471 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5472 ;; That was easy! Now we just need to fix the destinations.
5474 (string-append out directory)))
5477 `(("pkg-config" ,pkg-config)))
5479 `(("libatasmart" ,libatasmart)
5480 ("yaml-cpp" ,yaml-cpp)))
5481 (home-page "https://github.com/vmatare/thinkfan")
5482 (synopsis "Simple fan control program")
5484 "Thinkfan is a simple fan control program. It reads temperatures,
5485 checks them against configured limits and switches to appropriate (also
5486 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5487 other @code{hwmon} driver that enables temperature reading and fan control
5489 (license license:gpl3+)))
5491 (define-public tpacpi-bat
5499 (url "https://github.com/teleshoes/tpacpi-bat")
5500 (commit (string-append "v" version))))
5501 (file-name (git-file-name name version))
5503 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5504 (build-system gnu-build-system)
5506 `(#:tests? #f ; no test target
5508 (modify-phases %standard-phases
5509 (add-after 'unpack 'refer-to-inputs
5511 (substitute* "tpacpi-bat"
5513 (format #f "~a " (which "cat")))
5514 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5515 ;; loaded. That's the administrator's prerogative; disable it.
5516 (("system \"(modprobe .*)\"" _ match)
5517 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5519 (delete 'configure) ; nothing to configure
5520 (delete 'build) ; nothing to build
5522 (lambda* (#:key outputs #:allow-other-keys)
5523 (let* ((out (assoc-ref outputs "out"))
5524 (bin (string-append out "/bin"))
5525 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5526 (install-file "tpacpi-bat" bin)
5528 ;; There's no man page. Install other forms of documentation.
5529 (for-each (lambda (file)
5530 (let ((target (string-append doc "/" file)))
5531 (mkdir-p (dirname target))
5532 (copy-recursively file target)))
5533 (list "battery_asl" "examples" "README.md"))
5537 (home-page "https://github.com/teleshoes/tpacpi-bat")
5538 (synopsis "ThinkPad battery charge controller")
5540 "Tpacpi-bat is a command-line interface to control battery charging on
5541 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5542 ThinkPad models released after 2011}, starting with the xx20 series. It can
5543 query and set the thresholds at which one or both batteries will start and stop
5544 charging, inhibit charging batteries for a set period of time, or force them to
5545 discharge when they otherwise would not.
5547 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5548 kernel module provided by the @code{acpi-call-linux-module} package, which must
5549 be installed and loaded separately. Only the original vendor firmware is
5551 (license license:gpl3+)))
5556 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
5557 (version (package-version linux-libre))
5558 (source (package-source linux-libre))
5559 (build-system gnu-build-system)
5561 `(#:tests? #f ; no test suite
5563 (list (string-append "CC=" ,(cc-for-target))
5564 (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out"))
5567 (modify-phases %standard-phases
5568 (add-after 'unpack 'enter-subdirectory
5570 (chdir "tools/thermal/tmon")
5572 (add-after 'install 'install-man-page
5573 (lambda* (#:key outputs #:allow-other-keys)
5574 (let* ((out (assoc-ref outputs "out"))
5575 (man8 (string-append out "/share/man/man8")))
5576 (install-file "tmon.8" man8)
5578 (delete 'configure)))) ; no configure script
5580 `(("ncurses" ,ncurses)))
5581 (home-page (package-home-page linux-libre))
5582 (synopsis "Monitor and test the Linux thermal subsystem in real time")
5584 "Tmon is a tool to interact with the complex thermal subsystem of the
5585 kernel Linux. It helps visualize thermal relationships and real-time thermal
5586 data, tune and test cooling devices and sensors, and collect thermal data for
5589 As computers become smaller and more thermally constrained, more sensors are
5590 added and new cooling capabilities introduced. Thermal relationships can change
5591 dynamically. Their complexity grows exponentially among cooling devices, zones,
5592 sensors, and trip points.
5594 Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
5595 of symbolic links, trip point bindings, and device instances. To traverse it
5596 by hand is no trivial task: @command{tmon} aims to make it understandable.")
5597 (license (list license:gpl2 ; the man page
5598 license:gpl2+)))) ; the actual rest
5600 (define-public turbostat
5603 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
5604 ;; make it harder to benefit from ‘free’ linux-libre package updates.
5605 (version (package-version linux-libre))
5606 (source (package-source linux-libre))
5607 (build-system gnu-build-system)
5609 `(#:tests? #f ; no test suite
5611 (list (string-append "CC=" ,(cc-for-target))
5612 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5614 (modify-phases %standard-phases
5615 (add-after 'unpack 'enter-subdirectory
5617 (chdir "tools/power/x86/turbostat")
5619 (delete 'configure)))) ; no configure script
5621 `(("libcap" ,libcap)))
5622 (supported-systems '("i686-linux" "x86_64-linux"))
5623 (home-page (package-home-page linux-libre))
5624 (synopsis "Report x86 processor frequency and idle statistics")
5626 "Turbostat reports x86 processor topology, frequency, idle power state
5627 statistics, temperature, and power consumption. Some information is unavailable
5628 on older processors.
5630 It can be used to identify machines that are inefficient in terms of power usage
5631 or idle time, report the rate of @acronym{SMI, system management interrupt}s
5632 occurring on the system, or verify the effects of power management tuning.
5634 @command{turbostat} reads hardware counters but doesn't write to them, so it
5635 won't interfere with the OS or other running processes---including multiple
5636 invocations of itself.")
5637 (license license:gpl2)))
5639 (define-public ntfs-3g
5642 (version "2017.3.23")
5645 (uri (string-append "https://tuxera.com/opensource/"
5646 "ntfs-3g_ntfsprogs-" version ".tgz"))
5647 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5650 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5651 (modules '((guix build utils)))
5653 ;; Install under $prefix.
5654 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5658 (build-system gnu-build-system)
5659 (inputs `(("util-linux" ,util-linux)
5660 ("fuse" ,fuse))) ;libuuid
5661 (native-inputs `(("pkg-config" ,pkg-config)))
5663 '(#:configure-flags (list "--disable-static"
5664 "--exec-prefix=${prefix}"
5665 "--with-fuse=external" ;use our own FUSE
5666 "--enable-mount-helper"
5667 "--enable-posix-acls"
5668 "--enable-xattr-mappings")
5670 (modify-phases %standard-phases
5671 ;; If users install ntfs-3g, they probably want to make it the
5672 ;; default driver as well, so we opt for sensible defaults and link
5673 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5674 ;; mount NTFS file systems.)
5675 (add-after 'install 'install-link
5676 (lambda* (#:key outputs #:allow-other-keys)
5677 (let* ((out (assoc-ref outputs "out"))
5678 (sbin (string-append out "/sbin")))
5679 (symlink "mount.ntfs-3g"
5680 (string-append sbin "/mount.ntfs")))
5682 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5683 (synopsis "Read-write access to NTFS file systems")
5685 "NTFS-3G provides read-write access to NTFS file systems, which are
5686 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5687 The package provides additional NTFS tools.")
5688 (license license:gpl2+)))
5690 (define-public rdma-core
5696 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5697 "/releases/download/v" version "/rdma-core-"
5701 "1rah0v9gq9rksqd2c17nmydsxcjz178n7m2y4ricwlf5pq1b2yfi"))))
5702 (build-system cmake-build-system)
5704 `(#:tests? #f ; no tests
5705 ;; Upstream uses the "ninja" build system and encourage distros
5706 ;; to do the same for consistency.
5707 #:configure-flags (list "-GNinja"
5709 (string-append "-DRST2MAN_EXECUTABLE="
5710 (assoc-ref %build-inputs
5714 (modify-phases %standard-phases
5718 "-j" (number->string (parallel-job-count)))))
5721 (invoke "ninja" "install"))))))
5724 ("pkg-config" ,pkg-config)
5725 ("python" ,python-wrapper)
5726 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5730 (home-page "https://github.com/linux-rdma/rdma-core")
5731 (synopsis "Utilities and libraries for working with RDMA devices")
5733 "This package provides userspace components for the InfiniBand
5734 subsystem of the Linux kernel. Specifically it contains userspace
5735 libraries for the following device nodes:
5738 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5739 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5740 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5743 The following service daemons are also provided:
5745 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5746 @item @code{iwpmd} (for iWARP kernel providers)
5747 @item @code{ibacm} (for InfiniBand communication management assistant)
5749 ;; All library code is dual licensed under GPL2 and a custom MIT
5750 ;; variant. The package also includes some components covered by
5751 ;; other licenses. Consult COPYING.md for full details.
5754 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5755 license:bsd-2 ; Files referring to COPYING.BSD_FB
5756 license:cc0 ; most files in ccan/
5757 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5759 (define-public perftest
5766 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5767 version "/perftest-" version ".g0927198.tar.gz"))
5769 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5770 (build-system gnu-build-system)
5773 (modify-phases %standard-phases
5774 (add-after 'unpack 'patch-header-paths
5776 (substitute* '("src/raw_ethernet_fs_rate.c"
5777 "src/raw_ethernet_resources.c"
5778 "src/raw_ethernet_resources.h"
5779 "src/raw_ethernet_send_burst_lat.c"
5780 "src/raw_ethernet_send_bw.c"
5781 "src/raw_ethernet_send_lat.c")
5782 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5784 (inputs `(("rdma-core" ,rdma-core)))
5785 (home-page "https://github.com/linux-rdma/perftest/")
5786 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5787 (description "This is a collection of tests written over uverbs intended for
5788 use as a performance micro-benchmark. The tests may be used for hardware or
5789 software tuning as well as for functional testing.
5791 The collection contains a set of bandwidth and latency benchmark such as:
5793 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5794 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5795 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5796 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5797 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5799 (license license:gpl2)))
5801 (define-public rng-tools
5804 (home-page "https://github.com/nhorman/rng-tools")
5808 (uri (git-reference (url home-page)
5809 (commit (string-append "v" version))))
5810 (file-name (git-file-name name version))
5813 "0z4j3kqh9k3zsrx6257hwh4fa51vqg79c6dnfrj6lhpcll0wh0hm"))))
5814 (build-system gnu-build-system)
5816 `(;; Disable support for various hardware entropy sources as they need
5817 ;; dependencies that are not yet in Guix, and would significantly
5818 ;; increase closure size.
5819 #:configure-flags '("--without-nistbeacon"
5821 "--without-rtlsdr")))
5823 `(("autoconf" ,autoconf)
5824 ("automake" ,automake)
5825 ("pkg-config" ,pkg-config)))
5827 `(("libsysfs" ,sysfsutils)
5828 ("openssl" ,openssl)))
5829 (synopsis "Random number generator daemon")
5831 "Monitor a hardware random number generator, and supply entropy
5832 from that to the system kernel's @file{/dev/random} machinery.")
5833 ;; The source package is offered under the GPL2+, but the files
5834 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5835 (license (list license:gpl2 license:gpl2+))))
5837 (define-public cpupower
5840 (version (package-version linux-libre))
5841 (source (package-source linux-libre))
5842 (build-system gnu-build-system)
5844 '(#:phases (modify-phases %standard-phases
5845 (add-after 'unpack 'enter-subdirectory
5847 (chdir "tools/power/cpupower")
5850 (add-before 'build 'fix-makefiles
5852 (substitute* "Makefile"
5854 (("/bin/(install|pwd)" _ command) command))
5855 (substitute* "bench/Makefile"
5856 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5858 #:make-flags (let ((out (assoc-ref %outputs "out")))
5859 (list (string-append "DESTDIR=" out)
5860 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5862 "docdir=/share/doc/cpupower"
5863 "confdir=$(docdir)/examples"
5864 ;; The Makefile recommends the following changes
5866 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5867 #:tests? #f)) ;no tests
5868 (native-inputs `(("gettext" ,gettext-minimal)))
5869 (inputs `(("pciutils" ,pciutils)))
5870 (home-page (package-home-page linux-libre))
5871 (synopsis "CPU frequency and voltage scaling tools for Linux")
5873 "cpupower is a set of user-space tools that use the cpufreq feature of the
5874 Linux kernel to retrieve and control processor features related to power saving,
5875 such as frequency and voltage scaling.")
5876 (license license:gpl2)))
5878 (define-public x86-energy-perf-policy
5880 (name "x86-energy-perf-policy")
5881 (version (package-version linux-libre))
5882 (source (package-source linux-libre))
5883 (build-system gnu-build-system)
5887 (modify-phases %standard-phases
5888 (add-after 'unpack 'enter-subdirectory
5890 (chdir "tools/power/x86/x86_energy_perf_policy")
5893 (add-before 'build 'fix-makefile
5895 (substitute* "Makefile" (("/usr") ""))
5898 (let ((out (assoc-ref %outputs "out")))
5899 (list (string-append "DESTDIR=" out)
5900 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5901 (supported-systems '("i686-linux" "x86_64-linux"))
5902 (home-page (package-home-page linux-libre))
5903 (synopsis "Display and update Intel-CPU energy-performance policy")
5905 "@command{x86_energy_perf_policy} displays and updates energy-performance
5906 policy settings specific to Intel Architecture Processors. Settings are
5907 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5908 cpufreq sub-system is enabled or not.")
5909 (license license:gpl2)))
5911 (define-public haveged
5919 (url "https://github.com/jirka-h/haveged")
5920 (commit (string-append "v" version))))
5921 (file-name (git-file-name name version))
5923 (base32 "050hmnh5s2s4mb83f4d1fk23mk27pprg840c1aagc6v1sz6x5dhq"))))
5924 (build-system gnu-build-system)
5925 (home-page "https://www.issihosts.com/haveged")
5926 (synopsis "Entropy source for the Linux random number generator")
5928 "haveged generates an unpredictable stream of random numbers for use by
5929 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5930 standard mechanisms for filling the entropy pool may not be sufficient for
5931 systems with high needs or limited user interaction, such as headless servers.
5933 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5934 indirect effects of hardware events on hidden processor state using the
5935 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5936 It tunes itself to its environment and provides the same built-in test suite
5937 for the output stream as used on certified hardware security devices.
5939 The quality of the randomness produced by this algorithm has not been proven.
5940 It is recommended to run it together with another entropy source like rngd, and
5941 not as a replacement for it.")
5942 (license (list (license:non-copyleft "file://nist/mconf.h")
5943 (license:non-copyleft "file://nist/packtest.c")
5944 license:public-domain ; nist/dfft.c
5945 license:gpl3+)))) ; everything else
5947 (define-public ecryptfs-utils
5949 (name "ecryptfs-utils")
5954 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5955 version "/+download/ecryptfs-utils_"
5956 version ".orig.tar.gz"))
5959 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5960 (build-system gnu-build-system)
5962 `(#:configure-flags (list "--disable-pywrap")
5964 (modify-phases %standard-phases
5965 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5966 (lambda* (#:key inputs outputs #:allow-other-keys)
5967 (let ((out (assoc-ref outputs "out"))
5968 (utils-linux (assoc-ref inputs "utils-linux"))
5969 (cryptsetup (assoc-ref inputs "cryptsetup"))
5970 (linux-pam (assoc-ref inputs "linux-pam"))
5971 (lvm2 (assoc-ref inputs "lvm2")))
5972 (substitute* '("src/utils/ecryptfs-mount-private"
5973 "src/utils/ecryptfs-umount-private"
5974 "src/utils/ecryptfs-setup-private"
5975 "src/utils/ecryptfs-setup-swap"
5976 "src/utils/mount.ecryptfs.c"
5977 "src/utils/umount.ecryptfs.c"
5978 "src/pam_ecryptfs/pam_ecryptfs.c"
5979 "src/desktop/ecryptfs-mount-private.desktop.in"
5980 "src/desktop/ecryptfs-setup-private.desktop.in")
5982 (string-append utils-linux "/bin/mount"))
5984 (string-append utils-linux "/bin/umount"))
5985 (("/sbin/mount.ecryptfs_private")
5986 (string-append out "/sbin/mount.ecryptfs_private"))
5987 (("/sbin/umount.ecryptfs_private")
5988 (string-append out "/sbin/umount.ecryptfs_private"))
5989 (("/usr/bin/ecryptfs-mount-private")
5990 (string-append out "/bin/ecryptfs-mount-private"))
5991 (("/usr/bin/ecryptfs-rewrite-file")
5992 (string-append out "/bin/ecryptfs-rewrite-file"))
5993 (("/usr/bin/ecryptfs-setup-private")
5994 (string-append out "/bin/ecryptfs-setup-private"))
5995 (("/sbin/cryptsetup")
5996 (string-append cryptsetup "/sbin/cryptsetup"))
5997 (("/sbin/unix_chkpwd")
5998 (string-append linux-pam "/sbin/unix_chkpwd"))
6000 (string-append lvm2 "/sbin/dmsetup")))))))))
6002 `(("intltool" ,intltool)
6003 ("perl" ,perl) ; for pod2man
6004 ("pkg-config" ,pkg-config)))
6006 `(("keyutils" ,keyutils)
6007 ("linux-pam" ,linux-pam)
6008 ("utils-linux" ,util-linux)
6009 ("cryptsetup" ,cryptsetup)
6012 (home-page "https://ecryptfs.org/")
6013 (synopsis "eCryptfs cryptographic file system utilities")
6015 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
6016 Each file's cryptographic meta-data is stored inside the file itself, along
6017 with the encrypted contents. This allows individual encrypted files to be
6018 copied between hosts and still be decrypted with the proper key. eCryptfs is a
6019 native Linux file system, and has been part of the Linux kernel since version
6020 2.6.19. This package contains the userland utilities to manage it.")
6021 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
6022 ;; grant additional permission to link with OpenSSL.
6023 (license license:gpl2+)))
6025 (define-public libnfsidmap
6027 (name "libnfsidmap")
6032 (uri (string-append "https://fedorapeople.org/~steved/"
6033 name "/" version "/" name "-" version ".tar.bz2"))
6035 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
6036 (build-system gnu-build-system)
6038 `(#:configure-flags (list
6039 (string-append "--with-pluginpath="
6040 (assoc-ref %outputs "out")
6041 "/lib/libnfsidmap"))))
6043 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
6045 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
6046 (synopsis "NFSv4 support library for name/ID mapping")
6047 (description "Libnfsidmap is a library holding mulitiple methods of
6048 mapping names to ids and visa versa, mainly for NFSv4. It provides an
6049 extensible array of mapping functions, currently consisting of two choices:
6050 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
6051 (license (license:non-copyleft "file://COPYING"
6052 "See COPYING in the distribution."))))
6054 (define-public module-init-tools
6056 (name "module-init-tools")
6061 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
6062 "module-init-tools-" version ".tar.bz2"))
6065 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
6066 (patches (search-patches "module-init-tools-moduledir.patch"))))
6067 (build-system gnu-build-system)
6069 ;; FIXME: The upstream tarball lacks man pages, and building them would
6070 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
6071 ;; but they vanished. In the meantime, fake it.
6073 (modify-phases %standard-phases
6074 (add-before 'configure 'fake-docbook
6076 (substitute* "Makefile.in"
6077 (("^DOCBOOKTOMAN.*$")
6078 "DOCBOOKTOMAN = true\n"))
6080 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
6081 (synopsis "Tools for loading and managing Linux kernel modules")
6083 "Tools for loading and managing Linux kernel modules, such as
6084 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
6085 (license license:gpl2+)))
6087 (define-public mcelog
6095 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
6096 (commit (string-append "v" version))))
6097 (file-name (git-file-name name version))
6099 (base32 "1mlwn6ck9qiwqa2vg5wg1gvfva3jv7ygjr7p7bam0qszajs5pirk"))
6100 (modules '((guix build utils)))
6103 ;; The checkout lacks a .git directory, breaking ‘git describe’.
6104 (substitute* "Makefile"
6105 (("\"unknown\"") (string-append "\"v" ,version "\"")))
6107 (build-system gnu-build-system)
6109 `(#:phases (modify-phases %standard-phases
6110 (delete 'configure)) ; no configure script
6111 #:make-flags (let ((out (assoc-ref %outputs "out")))
6112 (list (string-append "CC=" ,(cc-for-target))
6113 (string-append "prefix=" out)
6114 (string-append "DOCDIR=" out "/share/doc/"
6116 "etcprefix=$(DOCDIR)/examples"))
6117 ;; The tests will only run as root on certain supported CPU models.
6119 (supported-systems (list "i686-linux" "x86_64-linux"))
6120 (home-page "https://mcelog.org/")
6121 (synopsis "Machine check monitor for x86 Linux systems")
6123 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
6124 systems running the kernel Linux. It can also perform user-defined tasks, such
6125 as bringing bad pages off-line, when configurable error thresholds are
6127 (license license:gpl2)))
6129 (define-public mtd-utils
6136 "ftp://ftp.infradead.org/pub/mtd-utils/"
6137 "mtd-utils-" version ".tar.bz2"))
6140 "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
6142 '(#:configure-flags '("--enable-unit-tests")))
6144 `(("cmocka" ,cmocka)
6145 ("pkg-config" ,pkg-config)))
6147 `(("acl" ,acl) ; extended attributes (xattr)
6148 ("libuuid" ,util-linux "lib")
6150 ("openssl" ,openssl) ; optional crypto support
6152 ("zstd" ,zstd "lib")))
6153 (build-system gnu-build-system)
6154 (synopsis "MTD Flash Storage Utilities")
6155 (description "This package provides utilities for testing, partitioning, etc
6157 (home-page "http://www.linux-mtd.infradead.org/")
6159 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
6160 license:mpl1.1 ; All ftl* files
6161 license:expat)))) ; libiniparser
6163 (define-public libseccomp
6169 (uri (string-append "https://github.com/seccomp/libseccomp/"
6170 "releases/download/v" version
6171 "/libseccomp-" version ".tar.gz"))
6174 "0m8dlg1v7kflcxvajs4p76p275qwsm2abbf5mfapkakp7hw7wc7f"))))
6175 (build-system gnu-build-system)
6177 '(#:configure-flags '("--disable-static")
6178 #:phases (modify-phases %standard-phases
6179 (add-before 'check 'skip-load-test
6181 ;; This test does a native system call and fails when
6182 ;; run under QEMU user-mode emulation. Just skip it.
6183 (delete-file "tests/52-basic-load.tests")
6188 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
6189 (description "The libseccomp library provides an easy to use, platform
6190 independent, interface to the Linux Kernel's syscall filtering mechanism. The
6191 libseccomp API is designed to abstract away the underlying BPF based syscall
6192 filter language and present a more conventional function-call based filtering
6193 interface that should be familiar to, and easily adopted by, application
6195 (home-page "https://github.com/seccomp/libseccomp")
6196 (license license:lgpl2.1)))
6198 (define-public radeontop
6206 (url "https://github.com/clbr/radeontop")
6207 (commit (string-append "v" version))))
6208 (file-name (git-file-name name version))
6210 (base32 "0ay6vl9zsz9b2scy0fnsy482pzizj52i27syxwny4z4i9wrk2wmn"))))
6211 (build-system gnu-build-system)
6213 `(#:phases (modify-phases %standard-phases
6214 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
6215 ;; dependency, and doesn't even work on release(!) tarballs.
6216 (add-after 'unpack 'report-correct-version
6218 (substitute* "getver.sh"
6220 (string-append "ver=" ,version)))
6222 (delete 'configure)) ; no configure script
6223 #:make-flags (list "CC=gcc"
6224 (string-append "PREFIX=" %output))
6225 #:tests? #f)) ; no tests
6227 `(("gettext" ,gettext-minimal)
6228 ("pkg-config" ,pkg-config)))
6230 `(("libdrm" ,libdrm)
6231 ("libpciaccess" ,libpciaccess)
6233 ("ncurses" ,ncurses)))
6234 (home-page "https://github.com/clbr/radeontop/")
6235 (synopsis "Usage monitor for AMD Radeon graphics")
6236 (description "RadeonTop monitors resource consumption on supported AMD
6237 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
6238 a terminal or saved to a file for further processing. It measures both the
6239 activity of the GPU as a whole, which is also accurate during OpenCL
6240 computations, as well as separate component statistics that are only meaningful
6241 under OpenGL graphics workloads.")
6242 (license license:gpl3)))
6244 (define-public efivar
6250 (uri (string-append "https://github.com/rhboot/" name
6251 "/releases/download/" version "/" name
6252 "-" version ".tar.bz2"))
6255 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
6256 (build-system gnu-build-system)
6258 `(;; Tests require a UEFI system and is not detected in the chroot.
6260 #:make-flags (list (string-append "prefix=" %output)
6261 (string-append "libdir=" %output "/lib")
6263 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6265 (modify-phases %standard-phases
6266 (delete 'configure))))
6268 `(("pkg-config" ,pkg-config)))
6271 (home-page "https://github.com/rhboot/efivar")
6272 (synopsis "Tool and library to manipulate EFI variables")
6273 (description "This package provides a library and a command line
6274 interface to the variable facility of UEFI boot firmware.")
6275 (license license:lgpl2.1+)))
6277 (define-public efibootmgr
6285 (url "https://github.com/rhinstaller/efibootmgr")
6287 (file-name (git-file-name name version))
6289 (base32 "1niicijxg59rsmiw3rsjwy4bvi1n42dynvm01lnp9haixdzdpq03"))
6290 (patches (search-patches "efibootmgr-remove-extra-decl.patch"))))
6291 (build-system gnu-build-system)
6293 `(#:tests? #f ;no tests
6294 #:make-flags (list (string-append "prefix=" %output)
6295 (string-append "libdir=" %output "/lib")
6296 ;; EFIDIR denotes a subdirectory relative to the
6297 ;; EFI System Partition where the loader will be
6298 ;; installed (known as OS_VENDOR in the code).
6299 ;; GRUB overrides this, as such it's only used if
6300 ;; nothing else is specified on the command line.
6302 #:phases (modify-phases %standard-phases (delete 'configure))))
6304 `(("pkg-config" ,pkg-config)))
6306 `(("efivar" ,efivar)
6308 (home-page "https://github.com/rhinstaller/efibootmgr")
6309 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
6311 "@code{efibootmgr} is a user-space application to modify the Intel
6312 Extensible Firmware Interface (EFI) Boot Manager. This application can
6313 create and destroy boot entries, change the boot order, change the next
6314 running boot option, and more.")
6315 (license license:gpl2+)))
6317 (define-public sysstat
6324 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6325 "sysstat-" version ".tar.xz"))
6327 (base32 "1z8bdyj92q0capbrdscwzb51bqh54ng15gpvmjmvrb2syhqj8hxf"))))
6328 (build-system gnu-build-system)
6330 `(#:tests? #f ; no test suite.
6331 ;; Without this flag, it tries to install the man pages with group 'root'
6332 ;; and fails because /etc/passwd lacks an entry for the root user.
6334 (list "--disable-file-attr"
6335 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
6337 (modify-phases %standard-phases
6338 ;; The build process tries to create '/var/lib/sa', so we skip that
6340 (add-after 'build 'skip-touching-var
6342 (substitute* "Makefile"
6343 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
6346 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
6347 (synopsis "Performance monitoring tools for Linux")
6348 (description "The sysstat utilities are a collection of performance
6349 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
6350 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
6351 @code{sadf} and @code{sa}.")
6352 (license license:gpl2+)))
6354 (define-public light
6362 (url "https://github.com/haikarainen/light")
6363 (commit (string-append "v" version))))
6365 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
6366 (file-name (git-file-name name version))))
6367 (build-system gnu-build-system)
6370 (modify-phases %standard-phases
6371 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
6372 (lambda* (#:key inputs #:allow-other-keys)
6373 (substitute* "90-backlight.rules"
6374 (("/bin/chgrp") (which "chgrp"))
6375 (("/bin/chmod") (which "chmod")))
6377 (add-after 'install 'install-udev-rules
6378 (lambda* (#:key outputs #:allow-other-keys)
6379 (let ((out (assoc-ref outputs "out")))
6381 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
6384 `(("autoconf" ,autoconf)
6385 ("automake" ,automake)))
6386 (home-page "https://haikarainen.github.io/light/")
6387 (synopsis "GNU/Linux application to control backlights")
6389 "Light is a program to send commands to screen backlight controllers
6390 under GNU/Linux. Features include:
6393 @item It does not rely on X.
6394 @item Light can automatically figure out the best controller to use, making
6395 full use of underlying hardware.
6396 @item It is possible to set a minimum brightness value, as some controllers
6397 set the screen to be pitch black at a value of 0 (or higher).
6399 (license license:gpl3+)))
6401 (define-public brightnessctl
6403 (name "brightnessctl")
6405 (home-page "https://github.com/Hummer12007/brightnessctl")
6408 (uri (git-reference (url home-page) (commit version)))
6409 (file-name (git-file-name name version))
6412 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))))
6413 (build-system gnu-build-system)
6415 `(#:tests? #f ; no tests
6416 #:make-flags (list (string-append "CC=" ,(cc-for-target))
6417 (string-append "PREFIX=" %output)
6418 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
6420 (modify-phases %standard-phases
6422 (add-after 'unpack 'adjust-udev-rules
6424 (substitute* "90-brightnessctl.rules"
6425 (("/bin/") "/run/current-system/profile/bin/"))
6427 (synopsis "Backlight and LED brightness control")
6429 "This program allows you read and control device brightness. Devices
6430 include backlight and LEDs. It can also preserve current brightness before
6431 applying the operation, such as on lid close.
6433 The appropriate permissions must be set on the backlight or LED control
6434 interface in sysfs, which can be accomplished with the included udev rules.")
6435 (license license:expat)))
6445 (url "https://github.com/linrunner/TLP")
6447 (file-name (git-file-name name version))
6449 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
6451 `(("shellcheck" ,shellcheck)))
6455 ("ethtool" ,ethtool)
6459 ("inetutils" ,inetutils)
6462 ("pciutils" ,pciutils)
6466 ("usbutils" ,usbutils)
6467 ("util-linux" ,util-linux)
6468 ("wireless-tools" ,wireless-tools)
6469 ,@(if (let ((system (or (%current-target-system)
6470 (%current-system))))
6471 (or (string-prefix? "i686-" system)
6472 (string-prefix? "x86_64-" system)))
6473 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
6475 (build-system gnu-build-system)
6477 ;; XXX: The full test suite is run with "checkall" but it requires
6478 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
6479 `(#:test-target "shellcheck"
6480 #:modules ((guix build gnu-build-system)
6484 (modify-phases %standard-phases
6485 (delete 'configure) ; no configure script
6486 (add-before 'build 'setenv
6487 (lambda* (#:key outputs #:allow-other-keys)
6488 (let ((out (assoc-ref outputs "out")))
6489 (setenv "TLP_WITH_SYSTEMD" "0")
6490 (setenv "TLP_NO_INIT" "1")
6491 (setenv "TLP_NO_PMUTILS" "1")
6492 (setenv "TLP_SBIN" (string-append out "/bin"))
6493 (setenv "TLP_BIN" (string-append out "/bin"))
6494 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
6495 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
6496 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
6497 (setenv "TLP_CONFDEF"
6498 (string-append out "/share/tlp/defaults.conf"))
6499 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
6501 (string-append out "/lib/elogind/system-sleep"))
6503 (string-append out "/share/bash-completion/completions"))
6504 (setenv "TLP_MAN" (string-append out "/share/man"))
6505 (setenv "TLP_META" (string-append out "/share/metainfo"))
6507 (add-before 'install 'fix-installation
6509 ;; Stop the Makefile from trying to create system directories.
6510 (substitute* "Makefile"
6511 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6512 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6515 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6516 (add-after 'install 'wrap
6517 (lambda* (#:key inputs outputs #:allow-other-keys)
6518 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6519 (bin-files (find-files bin ".*")))
6520 (define (bin-directory input-name)
6521 (let ((p (assoc-ref inputs input-name)))
6522 (and p (string-append p "/bin"))))
6523 (define (sbin-directory input-name)
6524 (string-append (assoc-ref inputs input-name) "/sbin"))
6525 (for-each (lambda (program)
6526 (wrap-program program
6529 (filter-map bin-directory
6541 "x86-energy-perf-policy"))
6542 (filter-map sbin-directory
6548 "wireless-tools"))))))
6551 (home-page "https://linrunner.de/en/tlp/tlp.html")
6552 (synopsis "Power management tool for Linux")
6553 (description "TLP is a power management tool for Linux. It comes with
6554 a default configuration already optimized for battery life. Nevertheless,
6555 TLP is customizable to fulfil system requirements. TLP settings are applied
6556 every time the power supply source is changed.")
6557 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6559 (license (list license:gpl2+ license:gpl3+))))
6564 (version "B.02.19.2")
6567 (uri (string-append "https://www.ezix.org/software/"
6568 "files/lshw-" version
6572 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
6573 (build-system gnu-build-system)
6575 `(#:phases (modify-phases %standard-phases (delete 'configure))
6576 #:tests? #f ; no tests
6578 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6579 (synopsis "List hardware information")
6581 "@command{lshw} (Hardware Lister) is a small tool to provide
6582 detailed information on the hardware configuration of the machine.
6583 It can report exact memory configuration, firmware version, mainboard
6584 configuration, CPU version and speed, cache configuration, bus speed,
6585 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6586 machines (PowerMac G4 is known to work).")
6587 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6588 (license license:gpl2+)))
6590 (define-public libmnl
6597 (uri (string-append "mirror://netfilter.org/libmnl/"
6598 "libmnl-" version ".tar.bz2"))
6601 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6602 (build-system gnu-build-system)
6603 (home-page "https://www.netfilter.org/projects/libmnl/")
6604 (synopsis "Netlink utility library")
6605 (description "Libmnl is a minimalistic user-space library oriented to
6606 Netlink developers. There are a lot of common tasks in parsing, validating,
6607 constructing of both the Netlink header and TLVs that are repetitive and easy to
6608 get wrong. This library aims to provide simple helpers that allows you to
6609 re-use code and to avoid re-inventing the wheel.")
6610 (license license:lgpl2.1+)))
6612 (define-public libnftnl
6619 (uri (string-append "mirror://netfilter.org/libnftnl/"
6620 "libnftnl-" version ".tar.bz2"))
6622 (base32 "16jbp4fs5dz2yf4c3bl1sb48x9x9wi1chv39zwmfgya1k9pimcp9"))))
6623 (build-system gnu-build-system)
6625 `(("pkg-config" ,pkg-config)))
6627 `(("libmnl" ,libmnl)))
6628 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6629 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6630 (description "Libnftnl is a userspace library providing a low-level netlink
6631 programming interface to the in-kernel nf_tables subsystem. The library
6632 libnftnl has been previously known as libnftables. This library is currently
6634 (license license:gpl2+)))
6636 (define-public nftables
6643 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6645 (string-append "https://www.nftables.org/projects/nftables"
6646 "/files/nftables-" version ".tar.bz2")))
6648 (base32 "1r4g22grhd4s1918wws9vggb8821sv4kkj8197ygxr6sar301z30"))))
6649 (build-system gnu-build-system)
6650 (arguments `(#:configure-flags
6651 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6652 (inputs `(("gmp" ,gmp)
6654 ("libnftnl" ,libnftnl)
6655 ("readline" ,readline)))
6656 (native-inputs `(("pkg-config" ,pkg-config)
6659 (home-page "https://www.nftables.org")
6660 (synopsis "Userspace utility for Linux packet filtering")
6661 (description "nftables is the project that aims to replace the existing
6662 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6663 filtering framework, a new userspace utility and also a compatibility layer for
6664 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6665 infrastructure such as the existing hooks, the connection tracking system, the
6666 userspace queueing component and the logging subsystem.")
6667 (license license:gpl2)))
6669 (define-public proot
6677 (url "https://github.com/proot-me/PRoot")
6678 (commit (string-append "v" version))))
6679 (file-name (git-file-name name version))
6681 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6682 (patches (search-patches "proot-test-fhs.patch"))))
6683 (build-system gnu-build-system)
6685 '(#:make-flags '("-C" "src")
6687 #:phases (modify-phases %standard-phases
6689 (add-before 'build 'set-shell-file-name
6690 (lambda* (#:key inputs #:allow-other-keys)
6691 (substitute* (find-files "src" "\\.[ch]$")
6694 (assoc-ref inputs "bash")
6697 (add-before 'check 'fix-fhs-assumptions-in-tests
6699 (substitute* "tests/test-c6b77b77.mk"
6700 (("/bin/bash") (which "bash"))
6701 (("/usr/bin/test") (which "test")))
6702 (substitute* '("tests/test-16573e73.c")
6703 (("/bin/([a-z-]+)" _ program)
6706 (substitute* (find-files "tests" "\\.sh$")
6707 ;; Some of the tests try to "bind-mount" /bin/true.
6709 (string-append "-b " (which "true") ":"))
6710 ;; Likewise for /bin.
6711 (("-b /bin:") "-b /gnu:")
6712 ;; Others try to run /bin/sh.
6713 (("/bin/sh") (which "sh"))
6714 ;; Others assume /etc/fstab exists.
6715 (("/etc/fstab") "/etc/passwd"))
6717 (substitute* "tests/GNUmakefile"
6718 (("-b /bin:") "-b /gnu:"))
6720 ;; XXX: This test fails in an obscure corner case, just
6722 (delete-file "tests/test-kkkkkkkk.c")
6727 (let ((n (parallel-job-count)))
6728 ;; For some reason we get lots of segfaults with
6729 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6730 (setenv "PROOT_NO_SECCOMP" "1")
6732 ;; Most of the tests expect "/bin" to be in $PATH so
6733 ;; they can run things that live in $ROOTFS/bin.
6735 (string-append (getenv "PATH") ":/bin"))
6737 (invoke "make" "check" "-C" "tests"
6739 "-j" (number->string n)))))
6741 (lambda* (#:key outputs #:allow-other-keys)
6742 ;; The 'install' rule does nearly nothing.
6743 (let* ((out (assoc-ref outputs "out"))
6744 (man1 (string-append out "/share/man/man1")))
6745 ;; TODO: 'make install-care' (does not even
6746 ;; build currently.)
6747 (invoke "make" "-C" "src" "install"
6748 (string-append "PREFIX=" out))
6751 (copy-file "doc/proot/man.1"
6752 (string-append man1 "/proot.1"))
6754 (native-inputs `(("which" ,which)
6756 ;; For 'mcookie', used by some of the tests.
6757 ("util-linux" ,util-linux)
6759 ;; XXX: Choose the old coreutils because its 'stat'
6760 ;; program does not use statx(2) when running 'stat -c
6761 ;; %a' or similar, which PRoot doesn't properly support.
6762 ("coreutils-old" ,coreutils-8.30)
6764 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6765 ;; make 4.3 to segfault.
6766 ("make-old" ,gnu-make-4.2)))
6767 (inputs `(("talloc" ,talloc)))
6768 (home-page "https://github.com/proot-me/PRoot")
6769 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6771 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6772 and @code{binfmt_misc}. This means that users don't need any privileges or
6773 setup to do things like using an arbitrary directory as the new root
6774 file system, making files accessible somewhere else in the file system
6775 hierarchy, or executing programs built for another CPU architecture
6776 transparently through QEMU user-mode. Also, developers can use PRoot as a
6777 generic process instrumentation engine thanks to its extension mechanism.
6778 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6779 available in the kernel Linux.")
6780 (license license:gpl2+)))
6782 (define-public proot-static
6785 (name "proot-static")
6787 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6788 (inputs `(("talloc" ,talloc/static)))
6790 (substitute-keyword-arguments (package-arguments proot)
6791 ((#:make-flags flags)
6792 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6794 `(modify-phases ,phases
6795 (add-after 'strip 'remove-store-references
6796 (lambda* (#:key outputs #:allow-other-keys)
6797 (let* ((out (assoc-ref outputs "out")))
6798 (with-directory-excursion out
6799 (remove-store-references "bin/proot")
6801 ((#:allowed-references _ '("out"))
6804 (define-public cpuid
6807 (version "20201006")
6810 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6811 version ".src.tar.gz"))
6814 "19jnkh57f979b78ak5mpxmdvnkgc33r55cw9shgd2hc380b3zi8k"))))
6815 (build-system gnu-build-system)
6818 (list (string-append "CC=" ,(cc-for-target)))
6819 #:tests? #f ; no tests
6820 #:phases (modify-phases %standard-phases
6821 (delete 'configure) ; no configure script
6822 (add-before 'install 'fix-makefile
6823 (lambda* (#:key outputs #:allow-other-keys)
6824 (substitute* "Makefile"
6825 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6826 ;; Make the compressed manpages writable so that the
6827 ;; reset-gzip-timestamps phase does not error out.
6828 (substitute* "Makefile"
6829 (("-m 444") "-m 644"))
6831 (inputs `(("perl" ,perl)))
6832 (supported-systems '("i686-linux" "x86_64-linux"))
6833 (home-page "http://www.etallen.com/cpuid.html")
6834 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6835 (description "cpuid dumps detailed information about the CPU(s) gathered
6836 from the CPUID instruction, and also determines the exact model of CPU(s). It
6837 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6838 NexGen, Rise, and SiS CPUs.")
6839 (license license:gpl2+)))
6841 (define-public jmtpfs
6849 (url "https://github.com/JasonFerrara/jmtpfs")
6850 (commit (string-append "v" version))))
6851 (file-name (git-file-name name version))
6854 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6855 (build-system gnu-build-system)
6859 ("libmtp" ,libmtp)))
6861 `(("pkg-config" ,pkg-config)))
6862 (home-page "https://github.com/JasonFerrara/jmtpfs")
6863 (synopsis "Use a FUSE file system to access data over MTP")
6864 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6865 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6866 the MTP device as a file system.")
6867 (license license:gpl3)))
6869 (define-public procenv
6877 (url "https://github.com/jamesodhunt/procenv")
6879 (file-name (git-file-name name version))
6881 (base32 "13fnr4gfj2xlxghw93m5gsxzlwzv3s6jv9hja0w0pb23hlncbmhy"))))
6882 (build-system gnu-build-system)
6884 `(("pkg-config" ,pkg-config)
6892 ("libselinux" ,libselinux)))
6893 (synopsis "Utility to show process environment")
6894 (description "Procenv is a command-line tool that displays as much detail about
6895 itself and its environment as possible. It can be used as a test
6896 tool, to understand the type of environment a process runs in, and for
6897 comparing system environments.")
6898 (home-page "https://github.com/jamesodhunt/procenv/")
6899 (license license:gpl3+)))
6901 (define-public libfabric
6909 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6910 version "/libfabric-" version ".tar.bz2"))
6912 (base32 "1nnpfkwxhim2nqjkb1vwrb4wj4j3l6w6yvvy69fqam2snlhshazz"))))
6913 (build-system gnu-build-system)
6914 (inputs `(("rdma-core" ,rdma-core)
6915 ,@(match (%current-system)
6916 ((member (package-supported-systems psm))
6920 (home-page "https://ofiwg.github.io/libfabric/")
6921 (synopsis "Open Fabric Interfaces")
6923 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6924 communication services to applications. OFI is best described as a collection
6925 of libraries and applications used to export fabric services. The key
6926 components of OFI are: application interfaces, provider libraries, kernel
6927 services, daemons, and test applications.
6929 Libfabric is a core component of OFI. It is the library that defines and
6930 exports the user-space API of OFI, and is typically the only software that
6931 applications deal with directly. It works in conjunction with provider
6932 libraries, which are often integrated directly into libfabric.")
6933 (license (list license:bsd-2 license:gpl2)))) ;dual
6938 (version "3.3.20170428")
6939 (home-page "https://github.com/intel/psm")
6943 (uri (git-reference (url home-page)
6944 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6945 (file-name (string-append "psm-" version ".tar.gz"))
6947 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6948 (patches (search-patches
6949 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6950 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6951 "psm-repro.patch" ; reproducibility
6952 "psm-disable-memory-stats.patch"))))
6953 (build-system gnu-build-system)
6954 (outputs '("out" "debug"))
6955 (inputs `(("libuuid" ,util-linux "lib")))
6957 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6958 ,(string-append "INSTALL_PREFIX=" %output)
6959 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6961 #:phases (modify-phases %standard-phases
6963 (add-after 'unpack 'patch-/usr/include
6965 (substitute* "Makefile"
6966 (("\\$\\{DESTDIR}/usr/include")
6967 (string-append %output "/include")))
6968 (substitute* "Makefile"
6969 (("/lib64") "/lib"))
6971 (add-after 'unpack 'patch-sysmacros
6973 (substitute* "ipath/ipath_proto.c"
6974 (("#include <sys/poll.h>" m)
6975 (string-append m "\n"
6976 "#include <sys/sysmacros.h>")))
6978 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6980 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6981 communications interface for the True Scale family of products. PSM users are
6982 enabled with mechanisms necessary to implement higher level communications
6983 interfaces in parallel environments.")
6984 ;; Only Intel-compatable processors are supported.
6985 (supported-systems '("i686-linux" "x86_64-linux"))
6986 (license (list license:bsd-2 license:gpl2)))) ;dual
6988 (define-public snapscreenshot
6990 (name "snapscreenshot")
6991 (version "1.0.14.3")
6995 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6996 name "-" version ".tar.bz2"))
6998 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6999 (build-system gnu-build-system)
7002 (let ((out (assoc-ref %outputs "out")))
7003 (list (string-append "BINDIR=" out "/bin")
7004 (string-append "MANDIR=" out "/share/man")))
7005 #:tests? #f ; no test suite
7007 (modify-phases %standard-phases
7008 (delete 'configure) ; ./configure is a snarky no-op
7009 (add-before 'install 'fix-ownership
7010 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
7012 (substitute* "depfun.mak"
7013 ((" -o bin -g bin ") " "))
7015 (add-before 'install 'create-output-directories
7016 (lambda* (#:key outputs #:allow-other-keys)
7017 (let ((out (assoc-ref outputs "out")))
7018 (mkdir-p (string-append out "/share/man/man1"))
7020 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
7021 (synopsis "Take screenshots of one or more Linux text consoles")
7023 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
7024 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
7025 relevant @file{/dev/vcs*} file(s).")
7026 (license license:gpl2)))
7028 (define-public fbcat
7035 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
7036 version "/" name "-" version ".tar.gz"))
7038 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
7039 (build-system gnu-build-system)
7041 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
7042 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
7043 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
7044 `(("pnmtopng" ,netpbm)))
7045 (outputs (list "out" "fbgrab"))
7049 (string-append "PREFIX=" (assoc-ref %outputs "out")))
7050 #:tests? #f ; no tests
7052 (modify-phases %standard-phases
7053 (delete 'configure) ; no configure script
7054 (add-after 'build 'qualify-references
7055 (lambda* (#:key inputs outputs #:allow-other-keys)
7056 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
7057 (out (assoc-ref outputs "out")))
7058 (substitute* "fbgrab"
7060 (string-append out "/bin/" all))
7062 (string-append pnmtopng "/bin/" all)))
7064 (add-after 'install 'split-fbgrab-output
7065 (lambda* (#:key outputs #:allow-other-keys)
7066 (let* ((out (assoc-ref outputs "out"))
7067 (out:fbgrab (assoc-ref outputs "fbgrab")))
7068 (for-each (lambda (file)
7069 (let ((old (string-append out "/" file))
7070 (new (string-append out:fbgrab "/" file)))
7071 (mkdir-p (dirname new))
7072 (rename-file old new)))
7074 "share/man/man1/fbgrab.1"))
7076 (home-page "https://jwilk.net/software/fbcat")
7077 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
7079 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
7080 a dump therof. It supports a wide range of drivers and pixel formats.
7081 @command{fbcat} can take screenshots of virtually any application that can be
7082 made to write its output to the framebuffer, including (but not limited to)
7083 text-mode or graphical applications that don't use a display server.
7085 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
7086 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
7087 (license license:gpl2)))
7089 (define-public libcgroup
7097 "mirror://sourceforge/libcg/" name "/"
7098 version "/" name "-" version ".tar.bz2"))
7100 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
7101 (build-system gnu-build-system)
7108 `(("linux-pam" ,linux-pam)))
7109 (home-page "https://sourceforge.net/projects/libcg/")
7110 (synopsis "Control groups management tools")
7111 (description "Control groups is Linux kernel method for process resource
7112 restriction, permission handling and more. This package provides userspace
7113 interface to this kernel feature.")
7114 (license license:lgpl2.1)))
7116 (define-public mbpfan
7124 (url "https://github.com/dgraziotin/mbpfan")
7125 (commit (string-append "v" version))))
7126 (file-name (git-file-name name version))
7128 (base32 "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr"))))
7129 (build-system gnu-build-system)
7131 `(#:tests? #f ; tests ask to be run as root
7132 #:make-flags (let ((out (assoc-ref %outputs "out")))
7133 (list (string-append "DESTDIR=" out)
7134 ,(string-append "CC=" (cc-for-target))))
7136 (modify-phases %standard-phases
7137 (add-after 'unpack 'patch-paths
7139 (substitute* "Makefile"
7142 (delete 'configure)))) ; there's no configure phase
7143 (home-page "https://github.com/dgraziotin/mbpfan")
7144 (synopsis "Control fan speed on Macbooks")
7146 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
7147 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
7148 module. It can be executed as a daemon or in the foreground with root
7150 (license license:gpl3+)))
7155 (version "11.2.185")
7159 (url "https://github.com/intel/opa-psm2")
7160 (commit (string-append "PSM2_" version))))
7161 (file-name (git-file-name name version))
7164 "062hg4r6gz7pla9df70nqs5i2a3mp1wszmp4l0g771fykhhrxsjg"))))
7165 (build-system gnu-build-system)
7168 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
7170 #:phases (modify-phases %standard-phases
7172 (add-after 'unpack 'patch-Makefiles
7174 (substitute* "Makefile"
7177 (substitute* "compat/Makefile"
7183 (setenv "DESTDIR" %output)
7184 (invoke "make" "install")
7187 `(("rdma-core" ,rdma-core)
7188 ("numactl" ,numactl)))
7189 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
7191 "This package is low-level user-level Intel's communications interface.
7192 The PSM2 API is a high-performance vendor-specific protocol that provides a
7193 low-level communications interface for the Intel Omni-Path family of
7194 high-speed networking devices.")
7195 (home-page "https://github.com/intel/opa-psm2")
7196 ;; Only the x86_64 architecure is supported.
7197 (supported-systems '("x86_64-linux"))
7198 (license (list license:bsd-3 license:gpl2)))) ; dual
7200 (define-public libpfm4
7206 (uri (string-append "mirror://sourceforge/perfmon2/"
7207 name "/libpfm-" version ".tar.gz"))
7210 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
7211 (build-system gnu-build-system)
7213 '(#:modules ((guix build utils)
7214 (guix build gnu-build-system))
7215 #:phases (modify-phases %standard-phases
7219 (lambda* (#:key inputs outputs #:allow-other-keys)
7220 (let* ((out (assoc-ref outputs "out")))
7225 (lambda* (#:key outputs #:allow-other-keys)
7226 (let* ((out (assoc-ref outputs "out")))
7228 (string-append "PREFIX=" out)
7231 (synopsis "Performance event monitoring library")
7233 "This package provides a library called libpfm4, which is used to develop
7234 monitoring tools exploiting the performance monitoring events such as those
7235 provided by the Performance Monitoring Unit (PMU) of modern processors.
7237 Libpfm4 helps convert from an event name, expressed as a string, to the event
7238 encoding that is either the raw event as documented by the hardware vendor or
7239 the OS-specific encoding. In the latter case, the library is able to prepare
7240 the OS-specific data structures needed by the kernel to setup the event.
7242 libpfm4 provides support for the @code{perf_events} interface, which was
7243 introduced in Linux 2.6.31.")
7244 (home-page "http://perfmon2.sourceforge.net/")
7245 (license license:expat)))
7247 (define-public libnfnetlink
7249 (name "libnfnetlink")
7254 "https://www.netfilter.org/projects/libnfnetlink/files/"
7255 "libnfnetlink-" version ".tar.bz2"))
7258 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
7259 (build-system gnu-build-system)
7260 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
7261 (synopsis "Low-level netfilter netlink communication library")
7263 "@code{libnfnetlink} is the low-level library for netfilter related
7264 kernel/userspace communication. It provides a generic messaging
7265 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
7266 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
7267 management tools in userspace.")
7268 (license license:gpl2)))
7270 (define-public go-netlink
7277 (url "https://github.com/vishvananda/netlink")
7278 (commit (string-append "v" version))))
7279 (file-name (git-file-name name version))
7282 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
7283 (build-system go-build-system)
7285 `(#:import-path "github.com/vishvananda/netlink"))
7287 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
7288 ("go-netns" ,go-netns)))
7289 (home-page "https://github.com/vishvananda/netlink")
7290 (synopsis "Simple netlink library for Go")
7291 (description "The netlink package provides a simple netlink library for
7292 Go. Netlink is the interface a user-space program in Linux uses to
7293 communicate with the kernel. It can be used to add and remove interfaces, set
7294 IP addresses and routes, and configure IPsec.")
7295 (license license:asl2.0)))
7297 (define-public libinih
7304 (url "https://github.com/benhoyt/inih")
7305 (commit (string-append "r" version))))
7306 (file-name (git-file-name name version))
7309 "0dqf5j2sw4hq68rqvxbrsf44ygfzx9ypiyzipk4cvp9aimbvsbc6"))))
7310 (build-system meson-build-system)
7312 '(#:configure-flags '("-Ddistro_install=true" "-Ddefault_library=shared")))
7313 (home-page "https://github.com/benhoyt/inih")
7314 (synopsis "Simple .INI parser library for C")
7315 (description "The inih (INI Not Invented Here) library is a simple .INI file
7316 parser written in C. It's only a couple of pages of code, and it was designed to
7317 be small and simple, so it's good for embedded systems. It's also more or less
7318 compatible with Python's ConfigParser style of .INI files, including RFC
7319 822-style multi-line syntax and name: value entries.")
7320 (license license:bsd-3)))
7322 (define-public xfsprogs
7329 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
7330 "xfsprogs-" version ".tar.gz"))
7333 "1byj53qdwsii35d0f11nz0dl618mpvwy5aa44pc9zg281g2r27ab"))))
7334 (build-system gnu-build-system)
7335 (outputs (list "out" "python"))
7337 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
7339 (modify-phases %standard-phases
7340 (add-after 'install 'separate-python-output
7341 (lambda* (#:key outputs #:allow-other-keys)
7342 (let ((out (assoc-ref outputs "out"))
7343 (python (assoc-ref outputs "python")))
7346 (mkdir-p (string-append python (dirname script)))
7347 (rename-file (string-append out script)
7348 (string-append python script)))
7349 (list "/sbin/xfs_scrub_all"))
7351 (add-after 'install 'install-headers
7353 (invoke "make" "install-dev"))))))
7355 `(("gettext" ,gettext-minimal)))
7357 `(("libinih" ,libinih)
7358 ("libuuid" ,util-linux "lib")
7359 ("python" ,python-wrapper)))
7360 (home-page "https://xfs.wiki.kernel.org/")
7361 (synopsis "XFS file system tools")
7362 (description "This package provides commands to create and check XFS
7364 ;; The library "libhandle" and the headers in "xfslibs-dev" are
7365 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
7366 (license (list license:gpl2 license:lgpl2.1))))
7368 (define-public genext2fs
7375 (url "https://github.com/jeremie-koenig/genext2fs")
7376 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
7377 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
7378 (file-name (git-file-name name version))
7380 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
7381 (build-system gnu-build-system)
7384 (modify-phases %standard-phases
7385 (add-after 'unpack 'apply-debian-patches
7386 ;; Debian changes (the revision after ‘-’ in VERSION) are
7387 ;; maintained as separate patches. Apply those relevant to us.
7391 (invoke "patch" "-p1" "-i"
7392 (string-append "debian/patches/" file-name)))
7393 (list "blocksize+creator.diff" ; add -B/-o options
7394 "byteswap_fix.diff"))
7397 `(("autoconf" ,autoconf)
7398 ("automake" ,automake)))
7399 (home-page "https://github.com/jeremie-koenig/genext2fs")
7400 (synopsis "Generate ext2 file system as a normal user")
7401 (description "This package provides a program to generate an ext2
7402 file system as a normal (non-root) user. It does not require you to mount
7403 the image file to copy files on it, nor does it require that you become
7404 the superuser to make device nodes.")
7405 (license license:gpl2)))
7407 (define-public fakeroot
7412 ;; There are no tags in the repository, so take this snapshot.
7414 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
7415 "fakeroot/fakeroot_" version ".orig.tar.gz"))
7416 (file-name (string-append name "-" version ".tar.gz"))
7419 "0v4m3v1bdqvblwj3vqsb3mllgbci6dsgsydq6765nzvz6n1kd44f"))))
7420 (build-system gnu-build-system)
7423 (modify-phases %standard-phases
7426 ;; The "preroll" script takes care of Autoconf and also
7427 ;; prepares the translated manuals.
7428 (invoke "sh" "./preroll")))
7429 (add-after 'configure 'patch-Makefile
7431 ;; Note: The root of the problem is already in "Makefile.am".
7432 (substitute* "Makefile"
7433 (("/bin/sh") (which "sh")))
7435 (add-after 'unpack 'patch-script
7436 (lambda* (#:key inputs #:allow-other-keys)
7437 (substitute* "scripts/fakeroot.in"
7439 (string-append (assoc-ref inputs "util-linux")
7442 (string-append (assoc-ref inputs "sed")
7445 (string-append (assoc-ref inputs "coreutils")
7448 (add-before 'configure 'setenv
7450 (setenv "LIBS" "-lacl")
7452 (add-before 'check 'prepare-check
7454 (setenv "SHELL" (which "bash"))
7455 (setenv "VERBOSE" "1")
7456 (substitute* "test/t.touchinstall"
7457 ;; We don't have the name of the root user, so use ID=0.
7458 (("grep root") "grep \"\\<0\\>\""))
7459 (substitute* "test/tartest"
7460 ;; We don't have the name of the root group, so use ID=0.
7461 (("ROOTGROUP=root") "ROOTGROUP=0")
7462 ;; We don't have the name of the daemon user, so use IDs.
7463 (("daemon:sys") "1:3")
7465 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
7466 (substitute* "test/compare-tar"
7467 (("tar -tvf") "tar --numeric-owner -tvf"))
7470 `(;; For bootstrapping the package.
7471 ("autoconf" ,autoconf)
7472 ("automake" ,automake)
7473 ("libtool" ,libtool)
7474 ("gettext" ,gettext-minimal)
7478 ("sharutils" ,sharutils)
7483 ("util-linux" ,util-linux)
7485 ("coreutils" ,coreutils)))
7486 (synopsis "Provides a fake root environment")
7487 (description "@command{fakeroot} runs a command in an environment where
7488 it appears to have root privileges for file manipulation. This is useful
7489 for allowing users to create archives (tar, ar, .deb etc.) with files in
7490 them with root permissions/ownership. Without fakeroot one would have to
7491 have root privileges to create the constituent files of the archives with
7492 the correct permissions and ownership, and then pack them up, or one would
7493 have to construct the archives directly, without using the archiver.")
7494 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
7495 (license license:gpl3+)))
7497 (define-public fakechroot
7504 "https://github.com/dex4er/fakechroot/releases/download/"
7505 version "/fakechroot-" version ".tar.gz"))
7508 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
7509 (build-system gnu-build-system)
7511 ;; XXX: The tests heavily assume they run on an FHS system so for now
7514 #:configure-flags '("--disable-static")))
7515 (synopsis "Emulate @code{chroot} by overriding file system calls")
7517 "@command{fakechroot} runs a command in an environment were is additional
7518 possibility to use @code{chroot} command without root privileges. This is
7519 useful for allowing users to create own chrooted environment with possibility
7520 to install another packages without need for root privileges.
7522 It works by providing @file{libfakechroot.so}, a shared library meant to be
7523 set as @code{LD_PRELOAD} to override the C library file system functions.")
7524 (home-page "https://github.com/dex4er/fakechroot/")
7525 (license license:lgpl2.1+)))
7527 (define-public inputattach
7529 (name "inputattach")
7534 (url "https://github.com/linuxwacom/input-wacom")
7535 (commit (string-append "input-wacom-" version))))
7536 (file-name (git-file-name name version))
7538 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
7539 (build-system gnu-build-system)
7542 (modify-phases %standard-phases
7546 (lambda* (#:key inputs #:allow-other-keys)
7547 (with-directory-excursion "inputattach"
7548 (invoke (string-append (assoc-ref inputs "gcc")
7550 "-O2" "-o" "inputattach" "inputattach.c"))
7554 (lambda* (#:key outputs #:allow-other-keys)
7555 (let ((target-dir (string-append
7556 (assoc-ref outputs "out")
7558 (mkdir-p target-dir)
7559 (copy-file "inputattach/inputattach"
7560 (string-append target-dir
7563 (home-page "https://linuxwacom.github.io/")
7564 (synopsis "Dispatch input peripherals events to a device file")
7565 (description "inputattach dispatches input events from several device
7566 types and interfaces and translates so that the X server can use them.")
7567 (license license:gpl2+)))
7569 (define-public pipewire
7576 (url "https://github.com/PipeWire/pipewire")
7578 (file-name (git-file-name name version))
7581 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
7582 (build-system meson-build-system)
7584 '(#:configure-flags '("-Dsystemd=false")))
7586 `(("pkg-config" ,pkg-config)))
7588 `(("alsa-lib" ,alsa-lib)
7592 ("gstreamer" ,gstreamer)
7593 ("gst-plugins-base" ,gst-plugins-base)
7597 (home-page "https://pipewire.org/")
7598 (synopsis "Server and user space API to deal with multimedia pipelines")
7600 "PipeWire is a project that aims to greatly improve handling of audio and
7601 video under Linux. It aims to support the usecases currently handled by both
7602 PulseAudio and Jack and at the same time provide same level of powerful handling
7603 of Video input and output. It also introduces a security model that makes
7604 interacting with audio and video devices from containerized applications easy,
7605 with supporting Flatpak applications being the primary goal. Alongside Wayland
7606 and Flatpak we expect PipeWire to provide a core building block for the future
7607 of Linux application development.")
7608 (license license:lgpl2.0+)))
7610 (define-public pipewire-0.3
7618 (url "https://github.com/PipeWire/pipewire")
7620 (file-name (git-file-name name version))
7623 "1ywna5f5v8s79ivrqfwwc8vy6sn3a2zvfwqyalf1fypj5d90w8g9"))))
7626 (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
7627 "/lib/udev/rules.d")
7630 (modify-phases %standard-phases
7631 ;; Skip shrink-runpath, otherwise validate-runpath fails.
7632 (delete 'shrink-runpath))))
7634 (append (package-inputs pipewire)
7637 ("pulseaudio" ,pulseaudio)
7638 ("vulkan-loader" ,vulkan-loader)
7639 ("vulkan-headers" ,vulkan-headers))))))
7648 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7650 (file-name (git-file-name name version))
7653 "1zzpbfdpmfldd7w0h7mwbq0mfqgqwz54nqbq0rmbqlqqpwlkrgb2"))))
7654 (build-system gnu-build-system)
7657 (modify-phases %standard-phases
7658 (add-after 'unpack 'fix-dbus-tests
7660 (substitute* '("unit/test-dbus-message-fds.c"
7661 "unit/test-dbus-properties.c"
7663 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7668 `(("autoconf" ,autoconf)
7669 ("libtool" ,libtool)
7670 ("pkgconfig" ,pkg-config)
7671 ("automake" ,automake)))
7672 (home-page "https://01.org/ell")
7673 (synopsis "Embedded Linux Library")
7674 (description "The Embedded Linux* Library (ELL) provides core, low-level
7675 functionality for system daemons. It typically has no dependencies other than
7676 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7677 ELL is designed to be efficient and compact enough for use on embedded Linux
7678 platforms, it is not limited to resource-constrained systems.")
7679 (license license:lgpl2.1+)))
7681 (define-public lttng-ust
7687 (uri (string-append "https://lttng.org/files/lttng-ust/"
7688 "lttng-ust-" version ".tar.bz2"))
7691 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7692 (build-system gnu-build-system)
7694 `(("liburcu" ,liburcu)
7695 ("numactl" ,numactl)))
7697 `(("python" ,python-3)))
7698 (home-page "https://lttng.org/")
7699 (synopsis "LTTng userspace tracer libraries")
7700 (description "The user space tracing library, liblttng-ust, is the LTTng
7701 user space tracer. It receives commands from a session daemon, for example to
7702 enable and disable specific instrumentation points, and writes event records
7703 to ring buffers shared with a consumer daemon.")
7704 (license license:lgpl2.1+)))
7706 (define-public kexec-tools
7708 (name "kexec-tools")
7712 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7713 "/kexec/kexec-tools-" version ".tar.xz"))
7716 "1hj9mj6x3qs9c8x8mrri9xd3wsg3gwzbab3jfa5ry146xm4pzjcn"))))
7717 (build-system gnu-build-system)
7719 ;; There are no automated tests.
7721 (home-page "https://projects.horms.net/projects/kexec/")
7722 (synopsis "Tools for booting directly into different kernels")
7723 (description "This package provides the @code{kexec} program and ancillary
7724 utilities. Using @code{kexec}, it is possible to boot directly into a new
7725 kernel from the context of an already-running kernel, bypassing the normal
7726 system boot process.")
7727 (license license:gpl2)))
7729 (define-public cachefilesd
7731 (name "cachefilesd")
7736 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7737 "/cachefilesd.git/snapshot/cachefilesd-"
7741 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7742 (build-system gnu-build-system)
7745 `(#:tests? #f ; there are no tests
7747 (let ((prefix-dir (lambda (var dir)
7748 (string-append var "=" %output "/" dir))))
7749 (list (string-append "CC=" ,(cc-for-target))
7750 (prefix-dir "SBINDIR" "sbin/")
7751 (prefix-dir "ETCDIR" "etc/")
7752 (prefix-dir "MANDIR" "share/man/")))
7753 #:phases (modify-phases %standard-phases (delete 'configure))))
7754 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7755 (synopsis "CacheFiles userspace management daemon")
7756 (description "@code{cachefilesd} is a userspace daemon that manages the
7757 cache data store that is used by network file systems such as @code{AFS} and
7758 @code{NFS} to cache data locally on disk. The content of the cache is
7759 persistent over reboots.")
7760 (license license:gpl2+)))
7762 (define-public libbpf
7770 (url "https://github.com/libbpf/libbpf")
7771 (commit (string-append "v" version))))
7772 (file-name (git-file-name name version))
7775 "0ilnnm4q22f8fagwp8kb37licy4ks861i2iqh2djsypqhnxvx3fv"))))
7776 (build-system gnu-build-system)
7778 `(("pkg-config" ,pkg-config)))
7780 ;; In Requires.private of libbpf.pc.
7781 `(("libelf" ,libelf)
7784 `(#:tests? #f ; no tests
7787 (string-append "PREFIX=" (assoc-ref %outputs "out"))
7788 (string-append "LIBDIR=$(PREFIX)/lib")
7790 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
7792 (modify-phases %standard-phases
7794 (add-before 'build 'pre-build
7798 (home-page "https://github.com/libbpf/libbpf")
7799 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
7801 "Libbpf supports building BPF CO-RE-enabled applications, which, in
7802 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
7804 (license `(,license:lgpl2.1 ,license:bsd-2))))
7814 (url "https://github.com/iovisor/bcc")
7815 (commit (string-append "v" version))))
7816 (file-name (git-file-name name version))
7819 "1367c0bzrpclvjvmk0sxgi49rh7j2f9izqk5a7g3yvawh1fmvvjh"))))
7820 (build-system cmake-build-system)
7825 `(("clang-toolchain" ,clang-toolchain)
7826 ("libbpf" ,(package-source libbpf))
7827 ;; LibElf required but libelf does not contain
7828 ;; archives, only object files.
7829 ;; https://github.com/iovisor/bcc/issues/504
7830 ("elfutils" ,elfutils)
7831 ("linux-libre-headers" ,linux-libre-headers)
7833 ("python-wrapper" ,python-wrapper)))
7835 `(;; Tests all require root permissions and a "standard" file hierarchy.
7838 (let ((revision ,version))
7839 `(,(string-append "-DREVISION=" revision)))
7841 (modify-phases %standard-phases
7842 ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
7843 (add-after 'unpack 'copy-libbpf
7844 (lambda* (#:key inputs #:allow-other-keys)
7845 (delete-file-recursively "src/cc/libbpf")
7847 (assoc-ref inputs "libbpf") "src/cc/libbpf")))
7848 (add-after 'copy-libbpf 'substitute-libbc
7849 (lambda* (#:key outputs #:allow-other-keys)
7850 (substitute* "src/python/bcc/libbcc.py"
7851 (("(libbcc\\.so.*)\\b" _ libbcc)
7853 (assoc-ref outputs "out") "/lib/" libbcc)))))
7854 (add-after 'install 'wrap-tools
7855 (lambda* (#:key outputs #:allow-other-keys)
7856 (use-modules (ice-9 textual-ports))
7857 (let* ((out (assoc-ref outputs "out"))
7858 (lib (string-append out "/lib"))
7859 (tools (string-append out "/share/bcc/tools"))
7861 (lambda (filename _)
7862 (call-with-input-file filename
7864 (string-contains (get-line port)
7867 (lambda (python-executable)
7868 (format #t "Wrapping: ~A.~%" python-executable)
7869 (wrap-program python-executable
7870 `("PYTHONPATH" ":" prefix
7871 (,(string-append lib
7873 ,(version-major+minor
7874 (package-version python))
7875 "/site-packages")))))
7876 (find-files tools python-executable?))
7878 (home-page "https://github.com/iovisor/bcc")
7879 (synopsis "Tools for BPF on Linux")
7881 "BCC is a toolkit for creating efficient kernel tracing and manipulation
7882 programs, and includes several useful tools and examples. It makes use of
7883 extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
7884 that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
7886 (license license:asl2.0)))
7888 (define-public bpftrace
7896 (url "https://github.com/iovisor/bpftrace")
7897 (commit (string-append "v" version))))
7898 (file-name (git-file-name name version))
7900 (base32 "0y4qgm2cpccrsm20rnh92hqplddqsc5q5zhw9nqn2igm3h9i0z7h"))
7901 (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
7902 (build-system cmake-build-system)
7908 ("clang-toolchain" ,clang-toolchain)
7909 ("elfutils" ,elfutils)
7911 ("linux-libre-headers" ,linux-libre-headers)))
7913 `(#:tests? #f ;Tests require googletest sources.
7915 '("-DBUILD_TESTING=OFF"
7916 ;; FIXME: libbfd misses some link dependencies, when fixed, remove
7917 ;; the associated patch.
7918 "-DHAVE_BFD_DISASM=OFF")))
7919 (home-page "https://github.com/iovisor/bpftrace")
7920 (synopsis "High-level tracing language for Linux eBPF")
7922 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
7923 Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
7924 LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
7925 interacting with the Linux BPF system, as well as existing Linux tracing
7926 capabilities: kernel dynamic tracing (kprobes), user-level dynamic
7927 tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
7928 and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
7929 created by Alastair Robertson.")
7930 (license license:asl2.0)))
7932 (define-public ttyebus-linux-module
7933 (let ((revision "0")
7934 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
7936 (name "ttyebus-linux-module")
7937 (version (git-version "1.5" revision commit))
7942 (url "https://github.com/eBUS/ttyebus")
7943 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
7944 (file-name (git-file-name name version))
7947 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
7948 (supported-systems '("armhf-linux" "aarch64-linux"))
7949 (build-system linux-module-build-system)
7952 (home-page "https://github.com/eBUS/ttyebus")
7953 (synopsis "Low-latency Raspberry Pi UART driver")
7954 (description "This package provides a Linux kernel module that will
7955 provide a serial device @code{/dev/ttyebus} with almost no latency upon
7956 receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
7957 (license license:gpl3+))))
7959 (define-public ipset
7966 (uri (string-append "https://ipset.netfilter.org/"
7967 "ipset-" version ".tar.bz2"))
7969 (base32 "0zdzp9fhpp6hmirzxy7w27fb9xx9lxd2ykxbn8by7ngi62nvll9i"))))
7970 (build-system gnu-build-system)
7972 `(("libmnl" ,libmnl)))
7974 `(("pkg-config" ,pkg-config)))
7976 `(#:configure-flags '("--with-kmod=no")))
7977 (home-page "https://ipset.netfilter.org/")
7978 (synopsis "Administration tool for IP sets")
7979 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
7980 can be administered by the ipset utility. Depending on the type,
7981 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
7982 IP addresses with MAC addresses in a way which ensures lightning speed
7983 when matching an entry against a set.
7987 @item store multiple IP addresses or port numbers and match against the entire
7988 collection using a single iptables rule.
7989 @item dynamically update iptables rules against IP addresses or ports without
7990 performance penalty.
7991 @item express complex IP address and ports based rulesets with a single
7992 iptables rule and benefit from the speed of IP sets.
7994 then IP sets may be the proper tool for you.")
7995 (license license:gpl2+)))
7997 (define-public liburing
8004 (url "https://git.kernel.dk/liburing")
8005 (commit (string-append "liburing-" version))))
8006 (file-name (git-file-name name version))
8009 "15z44l7y4c6s6dlf7v8lq4znlsjbja2r4ifbni0l8cdcnq0w3zh3"))))
8010 (build-system gnu-build-system)
8012 `(;; Tests are dependent on kernel version and features
8015 (modify-phases %standard-phases
8017 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
8018 ;; --enable-fast-install, and --build
8019 (lambda* (#:key outputs #:allow-other-keys)
8020 (let ((out (assoc-ref outputs "out")))
8021 (setenv "SHELL" (which "sh"))
8022 (setenv "CONFIG_SHELL" (which "sh"))
8023 (invoke "./configure" (string-append "--prefix=" out))))))))
8024 (home-page "https://github.com/axboe/liburing")
8025 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
8026 (description "This is the io_uring library, liburing. liburing provides
8027 helpers to setup and teardown io_uring instances, and also a simplified
8028 interface for applications that don't need (or want) to deal with the full
8029 kernel side implementation.")
8030 (license license:expat)))
8032 (define-public erofs-utils
8034 (name "erofs-utils")
8040 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
8041 (commit (string-append "v" version))))
8042 (file-name (git-file-name name version))
8044 (base32 "1vb4mxsb59g29x7l22cffsqa8x743sra4j5zbmx89hjwpwm9vvcg"))))
8045 (build-system gnu-build-system)
8048 ("libuuid" ,util-linux "lib")))
8050 `(("autoconf" ,autoconf)
8051 ("automake" ,automake)
8052 ("libtool" ,libtool)
8053 ("pkg-config" ,pkg-config)))
8054 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
8055 (synopsis "User-space tools for EROFS file system")
8056 (description "EROFS (Enhanced Read-Only File System) is a compressed,
8057 read-only file system optimized for resource-scarce devices. This package
8058 provides user-space tools for creating EROFS file systems.")
8059 (license license:gpl2+)))
8061 (define-public rasdaemon
8069 (url "https://github.com/mchehab/rasdaemon")
8070 (commit (string-append "v" version))))
8071 (file-name (git-file-name name version))
8073 (base32 "13g39x19lfjf9izdcb0nlyfjrgpliivhv4nw3ndgyzi59l3yqc0v"))))
8074 (native-inputs `(("autoconf" ,autoconf)
8075 ("automake" ,automake)
8076 ("libtool" ,libtool)))
8077 (inputs `(("sqlite" ,sqlite)))
8079 `(#:configure-flags '("--enable-all"
8080 "--localstatedir=/var")
8082 (modify-phases %standard-phases
8083 (add-before 'configure 'munge-autotools
8085 ;; For some reason upstream forces sysconfdir=/etc. This results
8086 ;; in EPERM during the install phase. Removing the offending
8087 ;; line lets sysconfdir correctly pick up DESTDIR.
8088 (substitute* "configure.ac"
8089 (("^test .* sysconfdir=/etc\n$") ""))
8090 ;; Upstream tries to create /var/lib/rasdaemon at install time.
8091 ;; This results in EPERM on guix. Instead, the service should
8092 ;; create this at activation time.
8093 (substitute* "Makefile.am"
8094 (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") "")))))))
8095 (build-system gnu-build-system)
8096 (home-page "https://github.com/mchehab/rasdaemon")
8097 (synopsis "Platform Reliability, Availability, and Serviceability tools")
8099 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
8100 Availability and Serviceability} reports from Linux kernel trace events.
8101 These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
8102 through standard log mechanisms like syslog.")
8103 (license license:gpl2)))