1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 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, 2017, 2018, 2019, 2020 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 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 Marius Bakke <mbakke@fastmail.com>
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 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>
49 ;;; This file is part of GNU Guix.
51 ;;; GNU Guix is free software; you can redistribute it and/or modify it
52 ;;; under the terms of the GNU General Public License as published by
53 ;;; the Free Software Foundation; either version 3 of the License, or (at
54 ;;; your option) any later version.
56 ;;; GNU Guix is distributed in the hope that it will be useful, but
57 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
58 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59 ;;; GNU General Public License for more details.
61 ;;; You should have received a copy of the GNU General Public License
62 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
64 (define-module (gnu packages linux)
65 #:use-module (gnu packages)
66 #:use-module (gnu packages acl)
67 #:use-module (gnu packages admin)
68 #:use-module (gnu packages algebra)
69 #:use-module (gnu packages audio)
70 #:use-module (gnu packages autotools)
71 #:use-module (gnu packages backup)
72 #:use-module (gnu packages base)
73 #:use-module (gnu packages bash)
74 #:use-module (gnu packages bison)
75 #:use-module (gnu packages calendar)
76 #:use-module (gnu packages check)
77 #:use-module (gnu packages crypto)
78 #:use-module (gnu packages cryptsetup)
79 #:use-module (gnu packages compression)
80 #:use-module (gnu packages dbm)
81 #:use-module (gnu packages datastructures)
82 #:use-module (gnu packages docbook)
83 #:use-module (gnu packages documentation)
84 #:use-module (gnu packages elf)
85 #:use-module (gnu packages flex)
86 #:use-module (gnu packages file)
87 #:use-module (gnu packages freedesktop)
88 #:use-module (gnu packages gcc)
89 #:use-module (gnu packages gettext)
90 #:use-module (gnu packages glib)
91 #:use-module (gnu packages golang)
92 #:use-module (gnu packages gperf)
93 #:use-module (gnu packages gstreamer)
94 #:use-module (gnu packages gtk)
95 #:use-module (gnu packages haskell-apps)
96 #:use-module (gnu packages haskell-xyz)
97 #:use-module (gnu packages libunwind)
98 #:use-module (gnu packages libusb)
99 #:use-module (gnu packages man)
100 #:use-module (gnu packages maths)
101 #:use-module (gnu packages multiprecision)
102 #:use-module (gnu packages ncurses)
103 #:use-module (gnu packages netpbm)
104 #:use-module (gnu packages networking)
105 #:use-module (gnu packages ninja)
106 #:use-module (gnu packages nss)
107 #:use-module (gnu packages perl)
108 #:use-module (gnu packages pciutils)
109 #:use-module (gnu packages pkg-config)
110 #:use-module (gnu packages popt)
111 #:use-module (gnu packages pulseaudio)
112 #:use-module (gnu packages python)
113 #:use-module (gnu packages python-xyz)
114 #:use-module (gnu packages readline)
115 #:use-module (gnu packages rrdtool)
116 #:use-module (gnu packages samba)
117 #:use-module (gnu packages sdl)
118 #:use-module (gnu packages serialization)
119 #:use-module (gnu packages slang)
120 #:use-module (gnu packages texinfo)
121 #:use-module (gnu packages tls)
122 #:use-module (gnu packages valgrind)
123 #:use-module (gnu packages video)
124 #:use-module (gnu packages web)
125 #:use-module (gnu packages xiph)
126 #:use-module (gnu packages xml)
127 #:use-module (gnu packages xdisorg)
128 #:use-module (gnu packages xorg)
129 #:use-module (gnu packages groff)
130 #:use-module (gnu packages rsync)
131 #:use-module (gnu packages selinux)
132 #:use-module (gnu packages swig)
133 #:use-module (guix build-system cmake)
134 #:use-module (guix build-system gnu)
135 #:use-module (guix build-system go)
136 #:use-module (guix build-system meson)
137 #:use-module (guix build-system python)
138 #:use-module (guix build-system trivial)
139 #:use-module (guix build-system linux-module)
140 #:use-module (guix download)
141 #:use-module (guix git-download)
142 #:use-module ((guix licenses) #:prefix license:)
143 #:use-module (guix packages)
144 #:use-module (guix gexp)
145 #:use-module (guix store)
146 #:use-module (guix monads)
147 #:use-module (guix utils)
148 #:use-module (srfi srfi-1)
149 #:use-module (srfi srfi-2)
150 #:use-module (srfi srfi-26)
151 #:use-module (ice-9 match))
153 (define-public (system->linux-architecture arch)
154 "Return the Linux architecture name for ARCH, a Guix system name such as
155 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
156 (let ((arch (car (string-split arch #\-))))
157 (cond ((string=? arch "i686") "i386")
158 ((string-prefix? "mips" arch) "mips")
159 ((string-prefix? "arm" arch) "arm")
160 ((string-prefix? "aarch64" arch) "arm64")
161 ((string-prefix? "alpha" arch) "alpha")
162 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
163 ((string-prefix? "s390" arch) "s390")
164 ((string-prefix? "riscv" arch) "riscv")
167 (define-public (system->defconfig system)
168 "Some systems (notably powerpc-linux) require a special target for kernel
169 defconfig. Return the appropriate make target if applicable, otherwise return
171 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
172 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
177 ;;; Kernel source code deblobbing.
180 (define (linux-libre-deblob-scripts version
183 (list (version-major+minor version)
186 (uri (string-append "https://linux-libre.fsfla.org"
187 "/pub/linux-libre/releases/" version "-gnu/"
188 "deblob-" (version-major+minor version)))
189 (sha256 deblob-hash))
192 (uri (string-append "https://linux-libre.fsfla.org"
193 "/pub/linux-libre/releases/" version "-gnu/"
195 (sha256 deblob-check-hash))))
197 (define deblob-scripts-5.7
198 (linux-libre-deblob-scripts
200 (base32 "1c0n39wg6xij4x63ppg0m80kfcffkn3iilm3chyiix09n9g7vb78")
201 (base32 "02is246xaql1br3kizqicrkp982nw4gdwpn7nlzjazvsmyd1hcv2")))
203 (define deblob-scripts-5.4
204 (linux-libre-deblob-scripts
206 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
207 (base32 "10qb890is4z58vr8czh3xx69q62l3b3j38y410kgiw8nii3zx5lr")))
209 (define deblob-scripts-4.19
210 (linux-libre-deblob-scripts
212 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
213 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
215 (define deblob-scripts-4.14
216 (linux-libre-deblob-scripts
218 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
219 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
221 (define deblob-scripts-4.9
222 (linux-libre-deblob-scripts
224 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
225 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
227 (define deblob-scripts-4.4
228 (linux-libre-deblob-scripts
230 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
231 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
233 (define* (computed-origin-method gexp-promise hash-algo hash
234 #:optional (name "source")
235 #:key (system (%current-system))
236 (guile (default-guile)))
237 "Return a derivation that executes the G-expression that results
238 from forcing GEXP-PROMISE."
239 (mlet %store-monad ((guile (package->derivation guile system)))
240 (gexp->derivation (or name "computed-origin")
242 #:graft? #f ;nothing to graft
244 #:guile-for-build guile)))
246 (define (make-linux-libre-source version
249 "Return a 'computed' origin that generates a Linux-libre tarball from the
250 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
251 (match deblob-scripts
252 ((deblob-version (? origin? deblob) (? origin? deblob-check))
253 (unless (string=? deblob-version (version-major+minor version))
254 ;; The deblob script cannot be expected to work properly on a
255 ;; different version (major+minor) of Linux, even if no errors
256 ;; are signaled during execution.
257 (error "deblob major+minor version mismatch"))
259 (method computed-origin-method)
260 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
264 (with-imported-modules '((guix build utils))
266 (use-modules (guix build utils)
270 (let ((dir (string-append "linux-" #$version)))
273 (set-path-environment-variable
276 #+(canonical-package bash)
277 #+(canonical-package coreutils)
278 #+(canonical-package diffutils)
279 #+(canonical-package findutils)
280 #+(canonical-package patch)
281 #+(canonical-package xz)
282 #+(canonical-package sed)
283 #+(canonical-package grep)
284 #+(canonical-package bzip2)
285 #+(canonical-package gzip)
286 #+(canonical-package tar)
287 ;; The comments in the 'deblob-check' script
288 ;; claim that it supports Python 2 and 3, but
289 ;; in fact it fails when run in Python 3 as
293 (with-directory-excursion "/tmp/bin"
295 (copy-file #+deblob "deblob")
296 (chmod "deblob" #o755)
297 (substitute* "deblob"
298 (("/bin/sh") (which "sh")))
300 (copy-file #+deblob-check "deblob-check")
301 (chmod "deblob-check" #o755)
302 (substitute* "deblob-check"
303 (("/bin/sh") (which "sh"))
304 (("/bin/sed") (which "sed"))
305 (("/usr/bin/python") (which "python"))))
307 (if (file-is-directory? #+upstream-source)
309 (format #t "Copying upstream linux source...~%")
311 (invoke "cp" "--archive" #+upstream-source dir)
312 (invoke "chmod" "--recursive" "u+w" dir))
314 (format #t "Unpacking upstream linux tarball...~%")
316 (invoke "tar" "xf" #$upstream-source)
319 (and (not (member name '("." "..")))
320 (file-is-directory? name))))
322 (unless (string=? dir unpacked-dir)
323 (rename-file unpacked-dir dir)))
325 (error "multiple directories found" dirs)))))
327 (with-directory-excursion dir
328 (setenv "PYTHON" (which "python"))
329 (format #t "Running deblob script...~%")
331 (invoke "/tmp/bin/deblob"))
333 (format #t "~%Packing new Linux-libre tarball...~%")
335 (invoke "tar" "cvfa" #$output
336 ;; Avoid non-determinism in the archive.
349 (define (linux-libre-urls version)
350 "Return a list of URLs for Linux-Libre VERSION."
352 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
353 version "-gnu/linux-libre-" version "-gnu.tar.xz")
355 ;; XXX: Work around <http://bugs.gnu.org/14851>.
357 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
358 version "-gnu.tar.xz")
360 ;; Maybe this URL will become valid eventually.
362 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
363 version "-gnu.tar.xz")))
365 (define (%upstream-linux-source version hash)
368 (uri (string-append "mirror://kernel.org"
369 "/linux/kernel/v" (version-major version) ".x/"
370 "linux-" version ".tar.xz"))
374 (define-public linux-libre-5.7-version "5.7.6")
375 (define-public linux-libre-5.7-pristine-source
376 (let ((version linux-libre-5.7-version)
377 (hash (base32 "1rhhys2fvfrfsc6lk0qkq59p83qhwvns4jhk0jlyylyzqqywkm4z")))
378 (make-linux-libre-source version
379 (%upstream-linux-source version hash)
380 deblob-scripts-5.7)))
382 (define-public linux-libre-5.4-version "5.4.49")
383 (define-public linux-libre-5.4-pristine-source
384 (let ((version linux-libre-5.4-version)
385 (hash (base32 "0g2psjf2q10mfc3vv6brjn6s2nkg73ll1s04gpshw907d9irpn2m")))
386 (make-linux-libre-source version
387 (%upstream-linux-source version hash)
388 deblob-scripts-5.4)))
390 (define-public linux-libre-4.19-version "4.19.130")
391 (define-public linux-libre-4.19-pristine-source
392 (let ((version linux-libre-4.19-version)
393 (hash (base32 "03zhsizj53ngwxn7d4mzix9xbxxd5lhbzrvawvbb91f83pkc14m6")))
394 (make-linux-libre-source version
395 (%upstream-linux-source version hash)
396 deblob-scripts-4.19)))
398 (define-public linux-libre-4.14-version "4.14.186")
399 (define-public linux-libre-4.14-pristine-source
400 (let ((version linux-libre-4.14-version)
401 (hash (base32 "0q52fmkiqa9hpdkf0wlpcqnc6wqssqz6cgfk1ix1anq0h5hl4ns4")))
402 (make-linux-libre-source version
403 (%upstream-linux-source version hash)
404 deblob-scripts-4.14)))
406 (define-public linux-libre-4.9-version "4.9.228")
407 (define-public linux-libre-4.9-pristine-source
408 (let ((version linux-libre-4.9-version)
409 (hash (base32 "0d7w2zzs79ywxzfrh4bmk5lw318qbkcb8mcsyyh3cc25qqlz9gwg")))
410 (make-linux-libre-source version
411 (%upstream-linux-source version hash)
412 deblob-scripts-4.9)))
414 (define-public linux-libre-4.4-version "4.4.229")
415 (define-public linux-libre-4.4-pristine-source
416 (let ((version linux-libre-4.4-version)
417 (hash (base32 "0crrawivri5i0ks7pg3snfjlxily4aimw5xzbzr5nlnsz0rjwhbq")))
418 (make-linux-libre-source version
419 (%upstream-linux-source version hash)
420 deblob-scripts-4.4)))
422 (define %boot-logo-patch
423 ;; Linux-Libre boot logo featuring Freedo and a gnu.
426 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
427 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
430 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
432 (define %linux-libre-arm-export-__sync_icache_dcache-patch
436 "https://salsa.debian.org/kernel-team/linux"
437 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
438 "/debian/patches/bugfix/arm/"
439 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
440 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
442 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
444 (define (source-with-patches source patches)
447 (patches (append (origin-patches source)
450 (define-public linux-libre-5.7-source
451 (source-with-patches linux-libre-5.7-pristine-source
452 (list %boot-logo-patch
453 %linux-libre-arm-export-__sync_icache_dcache-patch)))
455 (define-public linux-libre-5.4-source
456 (source-with-patches linux-libre-5.4-pristine-source
457 (list %boot-logo-patch
458 %linux-libre-arm-export-__sync_icache_dcache-patch
459 ;; Pinebook Pro patch from linux-next,
460 ;; can be dropped for linux-libre 5.7
462 "linux-libre-support-for-Pinebook-Pro.patch"))))
464 (define-public linux-libre-4.19-source
465 (source-with-patches linux-libre-4.19-pristine-source
466 (list %boot-logo-patch
467 %linux-libre-arm-export-__sync_icache_dcache-patch)))
469 (define-public linux-libre-4.14-source
470 (source-with-patches linux-libre-4.14-pristine-source
471 (list %boot-logo-patch)))
473 (define-public linux-libre-4.9-source
474 (source-with-patches linux-libre-4.9-pristine-source
475 (list %boot-logo-patch)))
477 (define-public linux-libre-4.4-source
478 (source-with-patches linux-libre-4.4-pristine-source
479 (list %boot-logo-patch)))
486 (define (make-linux-libre-headers version hash-string)
487 (make-linux-libre-headers* version
490 (uri (linux-libre-urls version))
491 (sha256 (base32 hash-string)))))
493 (define (make-linux-libre-headers* version source)
495 (name "linux-libre-headers")
498 (build-system gnu-build-system)
499 (native-inputs `(("perl" ,perl)
500 ,@(if (version>=? version "4.16")
504 ,@(if (version>=? version "5.3")
508 `(#:modules ((guix build gnu-build-system)
512 (modify-phases %standard-phases
516 (let ((arch ,(system->linux-architecture
517 (or (%current-target-system)
519 (defconfig ,(system->defconfig
520 (or (%current-target-system)
521 (%current-system)))))
523 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
524 (invoke "make" defconfig)
525 (invoke "make" "mrproper" "headers_check"))))
527 (lambda* (#:key outputs #:allow-other-keys)
528 (let ((out (assoc-ref outputs "out")))
530 (string-append "INSTALL_HDR_PATH=" out)
533 (mkdir (string-append out "/include/config"))
534 (call-with-output-file
536 "/include/config/kernel.release")
538 (format p "~a-default~%" ,version)))
540 ;; Remove the '.install' and '..install.cmd' files; the
541 ;; latter contains store paths, which pulls in bootstrap
542 ;; binaries in the build environment, and prevents bit
543 ;; reproducibility for the bootstrap binaries.
544 (for-each delete-file (find-files out "\\.install"))
547 #:allowed-references ()
549 (home-page "https://www.gnu.org/software/linux-libre/")
550 (synopsis "GNU Linux-Libre kernel headers")
551 (description "Headers of the Linux-Libre kernel.")
552 (license license:gpl2)))
554 (define-public linux-libre-headers-5.7
555 (make-linux-libre-headers* linux-libre-5.7-version
556 linux-libre-5.7-source))
558 (define-public linux-libre-headers-5.4
559 (make-linux-libre-headers* linux-libre-5.4-version
560 linux-libre-5.4-source))
562 (define-public linux-libre-headers-4.19
563 (make-linux-libre-headers* linux-libre-4.19-version
564 linux-libre-4.19-source))
566 (define-public linux-libre-headers-4.14
567 (make-linux-libre-headers* linux-libre-4.14-version
568 linux-libre-4.14-source))
570 (define-public linux-libre-headers-4.9
571 (make-linux-libre-headers* linux-libre-4.9-version
572 linux-libre-4.9-source))
574 (define-public linux-libre-headers-4.4
575 (make-linux-libre-headers* linux-libre-4.4-version
576 linux-libre-4.4-source))
578 ;; The following package is used in the early bootstrap, and thus must be kept
579 ;; stable and with minimal build requirements.
580 (define-public linux-libre-headers-5.4.20
581 (make-linux-libre-headers "5.4.20"
582 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
584 (define-public linux-libre-headers linux-libre-headers-5.4.20)
588 ;;; Kernel configurations.
591 (define* (kernel-config arch #:key variant)
592 "Return the absolute file name of the Linux-Libre build configuration file
593 for ARCH and optionally VARIANT, or #f if there is no such configuration."
594 (let* ((name (string-append (if variant (string-append variant "-") "")
595 (if (string=? "i386" arch) "i686" arch) ".conf"))
596 (file (string-append "linux-libre/" name)))
597 (search-auxiliary-file file)))
599 (define %default-extra-linux-options
600 `(;; Some very mild hardening.
601 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
602 ;; All kernels should have NAMESPACES options enabled
603 ("CONFIG_NAMESPACES" . #t)
604 ("CONFIG_UTS_NS" . #t)
605 ("CONFIG_IPC_NS" . #t)
606 ("CONFIG_USER_NS" . #t)
607 ("CONFIG_PID_NS" . #t)
608 ("CONFIG_NET_NS" . #t)
609 ;; Modules required for initrd:
610 ("CONFIG_NET_9P" . m)
611 ("CONFIG_NET_9P_VIRTIO" . m)
612 ("CONFIG_VIRTIO_BLK" . m)
613 ("CONFIG_VIRTIO_NET" . m)
614 ("CONFIG_VIRTIO_PCI" . m)
615 ("CONFIG_VIRTIO_BALLOON" . m)
616 ("CONFIG_VIRTIO_MMIO" . m)
617 ("CONFIG_FUSE_FS" . m)
619 ("CONFIG_9P_FS" . m)))
621 (define (config->string options)
622 (string-join (map (match-lambda
624 (string-append option "=m"))
626 (string-append option "=y"))
628 (string-append option "=n")))
634 ;;; Kernel package utilities.
637 (define* (make-linux-libre version hash-string supported-systems
639 ;; A function that takes an arch and a variant.
640 ;; See kernel-config for an example.
642 (configuration-file #f)
643 (defconfig "defconfig")
644 (extra-options %default-extra-linux-options)
645 (patches (list %boot-logo-patch)))
646 (make-linux-libre* version
649 (uri (linux-libre-urls version))
650 (sha256 (base32 hash-string))
653 #:extra-version extra-version
654 #:configuration-file configuration-file
655 #:defconfig defconfig
656 #:extra-options extra-options))
658 (define* (make-linux-libre* version source supported-systems
660 ;; A function that takes an arch and a variant.
661 ;; See kernel-config for an example.
663 (configuration-file #f)
664 (defconfig "defconfig")
665 (extra-options %default-extra-linux-options))
667 (name (if extra-version
668 (string-append "linux-libre-" extra-version)
672 (supported-systems supported-systems)
673 (build-system gnu-build-system)
678 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
682 ;; These are needed to compile the GCC plugins.
687 ,@(match (and configuration-file
689 (system->linux-architecture
690 (or (%current-target-system) (%current-system)))
691 #:variant (version-major+minor version)))
692 (#f ;no config for this platform
695 `(("kconfig" ,config))))))
697 `(#:modules ((guix build gnu-build-system)
704 (modify-phases %standard-phases
705 (add-after 'unpack 'patch-/bin/pwd
707 (substitute* (find-files "." "^Makefile(\\.include)?$")
708 (("/bin/pwd") "pwd"))
711 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
712 ;; Avoid introducing timestamps
713 (setenv "KCONFIG_NOTIMESTAMP" "1")
714 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
716 ;; Set ARCH and CROSS_COMPILE
717 (let ((arch ,(system->linux-architecture
718 (or (%current-target-system)
719 (%current-system)))))
721 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
724 (setenv "CROSS_COMPILE" (string-append target "-"))
725 (format #t "`CROSS_COMPILE' set to `~a'~%"
726 (getenv "CROSS_COMPILE"))))
728 (setenv "EXTRA_VERSION" ,extra-version)
730 (let ((build (assoc-ref %standard-phases 'build))
731 (config (assoc-ref (or native-inputs inputs) "kconfig")))
733 ;; Use a custom kernel configuration file or a default
734 ;; configuration file.
737 (copy-file config ".config")
738 (chmod ".config" #o666))
739 (invoke "make" ,defconfig))
741 ;; Appending works even when the option wasn't in the
742 ;; file. The last one prevails if duplicated.
743 (let ((port (open-file ".config" "a"))
744 (extra-configuration ,(config->string extra-options)))
745 (display extra-configuration port)
748 (invoke "make" "oldconfig"))))
750 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
751 (let* ((out (assoc-ref outputs "out"))
752 (moddir (string-append out "/lib/modules"))
753 (dtbdir (string-append out "/lib/dtbs")))
754 ;; Install kernel image, kernel configuration and link map.
755 (for-each (lambda (file) (install-file file out))
756 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
757 ;; Install device tree files
758 (unless (null? (find-files "." "\\.dtb$"))
760 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
762 ;; Install kernel modules
765 ;; Disable depmod because the Guix system's module directory
766 ;; is an union of potentially multiple packages. It is not
767 ;; possible to use depmod to usefully calculate a dependency
768 ;; graph while building only one of those packages.
770 (string-append "MODULE_DIR=" moddir)
771 (string-append "INSTALL_PATH=" out)
772 (string-append "INSTALL_MOD_PATH=" out)
773 "INSTALL_MOD_STRIP=1"
775 (let* ((versions (filter (lambda (name)
776 (not (string-prefix? "." name)))
778 (version (match versions
780 ;; There are symlinks to the build and source directory,
781 ;; both of which will point to target /tmp/guix-build*
782 ;; and thus not be useful in a profile. Delete the symlinks.
783 (false-if-file-not-found
784 (delete-file (string-append moddir "/" version "/build")))
785 (false-if-file-not-found
786 (delete-file (string-append moddir "/" version "/source"))))
789 (home-page "https://www.gnu.org/software/linux-libre/")
790 (synopsis "100% free redistribution of a cleaned Linux kernel")
792 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
793 It has been modified to remove all non-free binary blobs.")
794 (license license:gpl2)))
798 ;;; Generic kernel packages.
801 (define-public linux-libre-5.4
802 (make-linux-libre* linux-libre-5.4-version
803 linux-libre-5.4-source
804 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
805 #:configuration-file kernel-config))
807 (define-public linux-libre-version linux-libre-5.4-version)
808 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
809 (define-public linux-libre-source linux-libre-5.4-source)
810 (define-public linux-libre linux-libre-5.4)
812 (define-public linux-libre-4.19
813 (make-linux-libre* linux-libre-4.19-version
814 linux-libre-4.19-source
815 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
816 #:configuration-file kernel-config))
818 (define-public linux-libre-4.14
819 (make-linux-libre* linux-libre-4.14-version
820 linux-libre-4.14-source
821 '("x86_64-linux" "i686-linux" "armhf-linux")
822 #:configuration-file kernel-config))
824 (define-public linux-libre-4.9
825 (make-linux-libre* linux-libre-4.9-version
826 linux-libre-4.9-source
827 '("x86_64-linux" "i686-linux")
828 #:configuration-file kernel-config))
830 (define-public linux-libre-4.4
831 (make-linux-libre* linux-libre-4.4-version
832 linux-libre-4.4-source
833 '("x86_64-linux" "i686-linux")
834 #:configuration-file kernel-config
837 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
838 ;; This option was removed upstream in version 4.7.
839 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
840 %default-extra-linux-options)))
844 ;;; Specialized kernel variants.
847 (define-public linux-libre-arm-generic
848 (make-linux-libre* linux-libre-version
851 #:defconfig "multi_v7_defconfig"
852 #:extra-version "arm-generic"
855 `(;; needed to fix the RTC on rockchip platforms
856 ("CONFIG_RTC_DRV_RK808" . #t))
857 %default-extra-linux-options)))
859 (define-public linux-libre-arm-generic-5.7
860 (make-linux-libre* linux-libre-5.7-version
861 linux-libre-5.7-source
863 #:defconfig "multi_v7_defconfig"
864 #:extra-version "arm-generic"
867 `(;; needed to fix the RTC on rockchip platforms
868 ("CONFIG_RTC_DRV_RK808" . #t))
869 %default-extra-linux-options)))
871 (define-public linux-libre-arm-veyron
872 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
874 (define-public linux-libre-arm-generic-4.19
875 (make-linux-libre* linux-libre-4.19-version
876 linux-libre-4.19-source
878 #:defconfig "multi_v7_defconfig"
879 #:extra-version "arm-generic"))
881 (define-public linux-libre-arm-generic-4.14
882 (make-linux-libre* linux-libre-4.14-version
883 linux-libre-4.14-source
885 #:defconfig "multi_v7_defconfig"
886 #:extra-version "arm-generic"))
888 (define-public linux-libre-arm-omap2plus
889 (make-linux-libre* linux-libre-version
892 #:defconfig "omap2plus_defconfig"
893 #:extra-version "arm-omap2plus"))
895 (define-public linux-libre-arm-omap2plus-4.19
896 (make-linux-libre* linux-libre-4.19-version
897 linux-libre-4.19-source
899 #:defconfig "omap2plus_defconfig"
900 #:extra-version "arm-omap2plus"))
902 (define-public linux-libre-arm-omap2plus-4.14
903 (make-linux-libre* linux-libre-4.14-version
904 linux-libre-4.14-source
906 #:defconfig "omap2plus_defconfig"
907 #:extra-version "arm-omap2plus"))
909 (define-public linux-libre-arm64-generic
910 (make-linux-libre* linux-libre-version
913 #:defconfig "defconfig"
914 #:extra-version "arm64-generic"
917 `(;; needed to fix the RTC on rockchip platforms
918 ("CONFIG_RTC_DRV_RK808" . #t))
919 %default-extra-linux-options)))
921 (define-public linux-libre-arm64-generic-5.7
922 (make-linux-libre* linux-libre-5.7-version
923 linux-libre-5.7-source
925 #:defconfig "defconfig"
926 #:extra-version "arm64-generic"
929 `(;; needed to fix the RTC on rockchip platforms
930 ("CONFIG_RTC_DRV_RK808" . #t))
931 %default-extra-linux-options)))
933 (define-public linux-libre-riscv64-generic
934 (make-linux-libre* linux-libre-version
937 #:extra-version "riscv64-generic"))
941 ;;; Linux kernel modules.
944 (define-public acpi-call-linux-module
945 (let ((commit "70b9c80bd700e6a4d10797eaac9fd34b7e8cbd4a")
948 (name "acpi-call-linux-module")
949 (version (git-version "3.17" revision commit))
954 (url "https://github.com/teleshoes/acpi_call.git")
956 (file-name (git-file-name name version))
958 (base32 "09c1vw6vcrkqxbwhpgfgpj4d1grzn4qq6ka8pwwzm7cvm405xj7x"))))
959 (build-system linux-module-build-system)
961 `(#:tests? #f ; no tests
963 (modify-phases %standard-phases
964 (add-after 'install 'install-documentation
965 (lambda* (#:key outputs #:allow-other-keys)
966 (let* ((out (assoc-ref outputs "out"))
967 (doc (string-append out "/share/doc/" ,name "-" ,version)))
968 (for-each (lambda (file)
969 (let ((target (string-append doc "/" file)))
970 (mkdir-p (dirname target))
971 (copy-recursively file target)))
972 (list "README.md" "examples"))
974 (home-page "https://github.com/teleshoes/acpi_call")
975 (synopsis "Linux kernel module to perform ACPI method calls")
977 "This simple Linux kernel module allows calls from user space to any
978 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
979 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
980 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
981 and @code{ACPI_BUFFER}.
983 It grants direct and undocumented access to your hardware that may cause damage
984 and should be used with caution, especially on untested models.")
985 (license license:gpl3+)))) ; see README.md (no licence headers)
987 (define-public rtl8812au-aircrack-ng-linux-module
988 (let ((commit "df2b8dfd8cb7d9f6cfeb55abaeab8a5372011fc9")
991 (name "rtl8812au-aircrack-ng-linux-module")
992 (version (git-version "5.6.4.2" revision commit))
997 (url "https://github.com/aircrack-ng/rtl8812au.git")
999 (file-name (git-file-name name version))
1001 (base32 "1qcr0j8yhg8l9l0f5y55zcsk1mgf3qd46yh9xfqgg91szxa3yvca"))
1002 (modules '((guix build utils)))
1005 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1006 ;; and other unnecessary unlicenced things.
1007 (for-each delete-file-recursively (list "android"
1011 (build-system linux-module-build-system)
1014 (list (string-append "KSRC="
1015 (assoc-ref %build-inputs "linux-module-builder")
1016 "/lib/modules/build"))
1018 (modify-phases %standard-phases
1020 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1021 (apply invoke "make" make-flags))))
1022 #:tests? #f)) ; no test suite
1023 (supported-systems '("x86_64-linux" "i686-linux"))
1024 (home-page "https://github.com/aircrack-ng/rtl8812au")
1025 (synopsis "Linux driver for Realtek USB wireless network adapters")
1027 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1028 network adapters, modified by the aircrack-ng project to support monitor mode
1029 and frame injection. It provides a @code{88XXau} kernel module that supports
1030 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1031 (license license:gpl2+))))
1033 (define-public rtl8821ce-linux-module
1034 (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea")
1037 (name "rtl8821ce-linux-module")
1038 (version (git-version "0.0.0" revision commit))
1043 (url "https://github.com/tomaspinho/rtl8821ce.git")
1045 (file-name (git-file-name name version))
1048 "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))
1049 (build-system linux-module-build-system)
1053 (string-append "KSRC="
1054 (assoc-ref %build-inputs "linux-module-builder")
1055 "/lib/modules/build"))
1057 (modify-phases %standard-phases
1059 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1060 (apply invoke "make" make-flags))))
1061 #:tests? #f)) ; no test suite
1062 (home-page "https://github.com/tomaspinho/rtl8821ce")
1063 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1064 (description "This is Realtek's RTL8821CE Linux driver for wireless
1066 (license license:gpl2))))
1068 (define-public vhba-module
1070 (name "vhba-module")
1071 (version "20200106")
1075 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1076 version ".tar.bz2"))
1079 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1080 (build-system linux-module-build-system)
1084 (home-page "https://cdemu.sourceforge.io/")
1085 (synopsis "Kernel module that emulates SCSI devices")
1086 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1087 between the CDemu userspace daemon and linux kernel.")
1088 (license license:gpl2+)))
1090 (define-public bbswitch-module
1092 (name "bbswitch-module")
1097 (url "https://github.com/Bumblebee-Project/bbswitch")
1098 (commit (string-append "v" version))))
1099 (file-name (git-file-name name version))
1102 "1glch4j0x1dzlp2yrb67v2r5jg9609jb6p8m251y78m74advqw0l"))))
1103 (build-system linux-module-build-system)
1107 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1108 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1109 (description "The bbswitch module provides a way to toggle the Nvidia
1110 graphics card on Optimus laptops.")
1111 (license license:gpl2)))
1113 (define-public ddcci-driver-linux
1115 (name "ddcci-driver-linux")
1122 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1123 (commit (string-append "v" version))))
1124 (file-name (git-file-name name version))
1127 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1128 (build-system linux-module-build-system)
1130 `(#:tests? #f ; no tests
1132 (modify-phases %standard-phases
1137 (with-directory-excursion module
1138 (apply (assoc-ref %standard-phases 'build) args)))
1139 '("ddcci" "ddcci-backlight"))
1145 (with-directory-excursion module
1146 (apply (assoc-ref %standard-phases 'install) args)))
1147 '("ddcci" "ddcci-backlight"))
1149 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1150 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1151 (description "This package provides two Linux kernel drivers, ddcci and
1152 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1153 interface. The ddcci module creates a character device for each DDC/CI
1154 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1155 module allows the control of the backlight level or luminance property when
1156 supported under @file{/sys/class/backlight/}.")
1157 (license license:gpl2+)))
1159 (define-public v4l2loopback-linux-module
1161 (name "v4l2loopback-linux-module")
1166 (url "https://github.com/umlaeute/v4l2loopback.git")
1167 (commit (string-append "v" version))))
1168 (file-name (git-file-name name version))
1171 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1172 (build-system linux-module-build-system)
1174 `(#:tests? #f)) ; no test suite
1175 (home-page "https://github.com/umlaeute/v4l2loopback")
1176 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1178 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1179 for Linux 2} applications will treat these as ordinary video devices but read
1180 video data generated by another application, instead of a hardware device such
1183 This lets you apply nifty effects to your Jitsi video, for example, but also
1184 allows some more serious things like adding streaming capabilities to an
1185 application by hooking GStreamer into the loopback device.")
1186 (license license:gpl2+)))
1190 ;;; Pluggable authentication modules (PAM).
1193 (define-public linux-pam
1201 "https://github.com/linux-pam/linux-pam/releases/download/v"
1202 version "/Linux-PAM-" version ".tar.xz"))
1205 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1206 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1208 (build-system gnu-build-system)
1212 ;; TODO: optional dependencies
1213 ;; ("libxcrypt" ,libxcrypt)
1214 ;; ("cracklib" ,cracklib)
1217 `(;; Most users, such as `shadow', expect the headers to be under
1219 #:configure-flags (list (string-append "--includedir="
1220 (assoc-ref %outputs "out")
1221 "/include/security")
1223 ;; XXX: <rpc/rpc.h> is missing from glibc when
1224 ;; cross-compiling, so we have to disable NIS
1225 ;; support altogether.
1226 ,@(if (%current-target-system)
1230 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1233 (home-page "http://www.linux-pam.org/")
1234 (synopsis "Pluggable authentication modules for Linux")
1236 "A *Free* project to implement OSF's RFC 86.0.
1237 Pluggable authentication modules are small shared object files that can
1238 be used through the PAM API to perform tasks, like authenticating a user
1239 at login. Local and dynamic reconfiguration are its key features.")
1240 (license license:bsd-3)))
1242 (define-public linux-pam-1.2
1250 "http://www.linux-pam.org/library/"
1251 "Linux-PAM-" version ".tar.bz2"))
1254 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1255 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1262 (define-public powerstat
1269 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1270 "powerstat/powerstat-" version ".tar.gz"))
1272 (base32 "0r355b9syqa2nhfy8ksvxyy5d58v0isf983842js091s6liy0x7g"))))
1273 (build-system gnu-build-system)
1276 (list (string-append "CC=" ,(cc-for-target))
1277 (string-append "prefix=" (assoc-ref %outputs "out")))
1278 #:tests? #f ; no test suite
1280 (modify-phases %standard-phases
1281 (add-after 'unpack 'respect-$prefix
1282 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1284 (substitute* "Makefile"
1285 (("DIR=/usr/") "DIR=$(prefix)/"))
1287 (delete 'configure)))) ; no configure script
1288 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1289 (synopsis "Measure system power consumption")
1291 "Powerstat measures and reports your computer's power consumption in real
1292 time. On mobile PCs, it uses ACPI battery information to measure the power
1293 drain of the entire system.
1295 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1296 domain measurements. These are available only on some hardware such as Intel
1297 Sandybridge and newer, and cover only part of the machine's components such as
1298 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1299 and don't require a battery at all.
1301 The output is like @command{vmstat} but also shows power consumption statistics:
1302 at the end of a run, @command{powerstat} will calculate the average, standard
1303 deviation, and minimum and maximum values. It can show a nice histogram too.")
1304 (license license:gpl2)))
1306 (define-public psmisc
1313 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1316 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1317 (build-system gnu-build-system)
1319 `(,@(if (%current-target-system)
1322 "ac_cv_func_malloc_0_nonnull=yes"
1323 "ac_cv_func_realloc_0_nonnull=yes"))
1325 (inputs `(("ncurses" ,ncurses)))
1326 (home-page "https://gitlab.com/psmisc/psmisc")
1327 (synopsis "Small utilities that use the proc file system")
1329 "This PSmisc package is a set of some small useful utilities that
1330 use the proc file system. We're not about changing the world, but
1331 providing the system administrator with some help in common tasks.")
1332 (license license:gpl2+)))
1334 (define-public util-linux
1340 (uri (string-append "mirror://kernel.org/linux/utils/"
1341 "util-linux/v" (version-major+minor version) "/"
1342 "util-linux-" version ".tar.xz"))
1345 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1346 (patches (search-patches "util-linux-tests.patch"))
1347 (modules '((guix build utils)))
1349 ;; We take 'nologin' from Shadow, the 'logger' program from
1350 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1352 (substitute* "configure"
1353 (("build_nologin=yes") "build_nologin=no")
1354 (("build_logger=yes") "build_logger=no")
1355 (("build_kill=yes") "build_kill=no"))
1357 (build-system gnu-build-system)
1358 (outputs '("out" ;6.4 MiB executables and documentation
1359 "lib" ;8.8 MiB shared libraries, headers and locales
1360 "static")) ;2.9 MiB static .a libraries
1362 `(#:configure-flags (list "--disable-use-tty-group"
1363 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1364 ;; Don't try to chown root:root mount and umount
1365 "--disable-makeinstall-chown"
1366 "--localstatedir=/var"
1367 (string-append "--localedir="
1368 (assoc-ref %outputs "lib")
1370 ;; Install completions where our
1371 ;; bash-completion package expects them.
1372 (string-append "--with-bashcompletiondir="
1373 (assoc-ref %outputs "out")
1374 "/etc/bash_completion.d"))
1375 #:phases (modify-phases %standard-phases
1376 (add-before 'configure 'patch-build-scripts
1377 (lambda* (#:key outputs #:allow-other-keys)
1378 (substitute* "configure"
1379 ;; The build system assumes that we want to install
1380 ;; libraries below $exec_prefix when $libdir does not
1381 ;; match any of the "usual" locations. Fix that.
1382 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1383 "usrlib_execdir=$libdir"))
1385 (add-before 'build 'set-umount-file-name
1386 (lambda* (#:key outputs #:allow-other-keys)
1387 ;; Tell 'eject' the right file name of 'umount'.
1388 (let ((out (assoc-ref outputs "out")))
1389 (substitute* "sys-utils/eject.c"
1390 (("\"/bin/umount\"")
1391 (string-append "\"" out "/bin/umount\"")))
1393 (add-before 'check 'pre-check
1394 (lambda* (#:key inputs outputs #:allow-other-keys)
1395 (let ((out (assoc-ref outputs "out"))
1396 (net (assoc-ref inputs "net-base")))
1397 ;; Change the test to refer to the right file.
1398 (substitute* "tests/ts/misc/mcookie"
1400 (string-append net "/etc/services")))
1402 ;; The C.UTF-8 locale does not exist in our libc.
1403 (substitute* "tests/ts/column/invalid-multibyte"
1404 (("C\\.UTF-8") "en_US.utf8"))
1406 ;; TODO: Remove the conditional on the next rebuild cycle.
1407 ,@(if (string-prefix? "arm" (%current-system))
1408 '((add-before 'check 'disable-setarch-test
1410 ;; The setarch tests are unreliable in QEMU's
1411 ;; user-mode emulation, which is our primary
1412 ;; method of building ARMv7 packages.
1413 ;; <https://github.com/karelzak/util-linux/issues/601>
1414 (substitute* "tests/ts/misc/setarch"
1415 (("ts_init_subtest.*" all)
1418 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1421 (add-after 'install 'move-static-libraries
1422 (lambda* (#:key outputs #:allow-other-keys)
1423 (let ((lib (assoc-ref outputs "lib"))
1424 (static (assoc-ref outputs "static")))
1426 ;; Move static libraries to the "static" output.
1427 (mkdir-p (string-append static "/lib"))
1428 (with-directory-excursion lib
1429 (for-each (lambda (file)
1431 (string-append static "/"
1433 (find-files "lib" "\\.a$"))
1435 ;; Remove references to the static library from the '.la'
1436 ;; files so that Libtool does the right thing when both
1437 ;; the shared and static library is available.
1438 (substitute* (find-files "lib" "\\.la$")
1439 (("old_library=.*") "old_library=''\n")))
1442 (add-after 'install 'adjust-pkg-config-files
1443 (lambda* (#:key outputs #:allow-other-keys)
1444 (let ((lib (assoc-ref outputs "lib")))
1445 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1446 ;; the pkg-config files to avoid a cyclic reference on "out".
1447 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1449 (("^(exec_)?prefix=.*") "")))
1451 (inputs `(("zlib" ,zlib)
1452 ("ncurses" ,ncurses)
1454 ;; XXX: This is so that the 'pre-check' phase can find it.
1455 ,@(if (%current-target-system)
1456 `(("net-base" ,net-base))
1460 ("net-base" ,net-base))) ;for tests
1461 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1462 (synopsis "Collection of utilities for the Linux kernel")
1463 (description "Util-linux is a diverse collection of Linux kernel
1464 utilities. It provides dmesg and includes tools for working with file systems,
1465 block devices, UUIDs, TTYs, and many other tools.")
1467 ;; Note that util-linux doesn't use the same license for all the
1468 ;; code. GPLv2+ is the default license for a code without an
1469 ;; explicitly defined license.
1470 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1471 license:bsd-4 license:public-domain))))
1473 ;; util-linux optionally supports udev, which allows lsblk to read file system
1474 ;; metadata without special privileges. Add it as a separate package to avoid
1475 ;; a circular dependency, and to keep the size small.
1476 (define-public util-linux+udev
1479 (name "util-linux-with-udev")
1482 ,@(package-inputs util-linux)))))
1484 (define-public ddate
1491 (url "https://github.com/bo0ts/ddate")
1492 (commit (string-append "v" version))))
1493 (file-name (git-file-name name version))
1495 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1496 (build-system cmake-build-system)
1497 (arguments '(#:tests? #f))
1498 (home-page "https://github.com/bo0ts/ddate")
1499 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1501 "ddate displays the Discordian date and holidays of a given date.
1502 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1503 by Robert Shea and Robert Anton Wilson.")
1504 (license license:public-domain)))
1506 (define-public fbset
1513 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1516 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1517 (build-system gnu-build-system)
1519 '(#:modules ((guix build gnu-build-system)
1523 (modify-phases %standard-phases
1524 (delete 'configure) ; no configure script
1525 (add-before 'install 'pre-install
1526 (lambda* (#:key outputs #:allow-other-keys)
1527 (let ((out (assoc-ref outputs "out")))
1528 (substitute* "Makefile"
1529 (("mknod ") "true ")
1530 ;; The Makefile doesn't honour PREFIX or similar.
1533 (with-directory-excursion out
1534 (for-each mkdir-p (list "sbin"
1538 (add-after 'install 'install-fb.modes
1539 (lambda* (#:key outputs #:allow-other-keys)
1540 (let* ((out (assoc-ref outputs "out"))
1541 (etc (string-append out "/etc")))
1542 (for-each (cut install-file <> etc)
1543 (find-files "etc" "^fb\\.modes"))
1544 (symlink "fb.modes.ATI"
1545 (string-append etc "/fb.modes"))
1547 ;; Parallel building races to create modes.tab.c.
1548 #:parallel-build? #f
1549 #:tests? #f)) ; no test suite
1553 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1554 (synopsis "Show and modify Linux frame buffer settings")
1556 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1557 different kinds of graphic displays. The @command{fbset} utility can query and
1558 change various device settings such as depth, virtual resolution, and timing
1560 (license license:gpl2)))
1562 (define-public procps
1568 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1569 "procps-ng-" version ".tar.xz"))
1572 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1573 (build-system gnu-build-system)
1575 `(#:modules ((guix build utils)
1576 (guix build gnu-build-system)
1579 ,@(if (%current-target-system)
1582 "ac_cv_func_malloc_0_nonnull=yes"
1583 "ac_cv_func_realloc_0_nonnull=yes"))
1586 (modify-phases %standard-phases
1588 'install 'post-install
1589 ;; Remove commands and man pages redudant with
1591 (lambda* (#:key outputs #:allow-other-keys)
1592 (let* ((out (assoc-ref outputs "out"))
1593 (dup (append-map (cut find-files out <>)
1594 '("^kill" "^uptime"))))
1595 (for-each delete-file dup)
1597 (inputs `(("ncurses" ,ncurses)))
1598 (home-page "https://gitlab.com/procps-ng/procps/")
1599 (synopsis "Utilities that give information about processes")
1601 "Procps is the package that has a bunch of small useful utilities
1602 that give information about processes using the Linux /proc file system.
1603 The package includes the programs ps, top, vmstat, w, kill, free,
1604 slabtop, and skill.")
1605 (license license:gpl2)))
1607 (define-public usbutils
1614 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1615 "usbutils-" version ".tar.xz"))
1617 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1618 (build-system gnu-build-system)
1619 (outputs (list "out" "python"))
1622 (modify-phases %standard-phases
1623 (add-before 'bootstrap 'patch-bootstrap-scripts
1625 (substitute* "usbhid-dump/bootstrap"
1626 (("/bin/bash") (which "bash")))
1628 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1629 (substitute* "autogen.sh"
1630 (("^\\./configure.*") ""))
1632 (add-after 'install 'separate-python-output
1633 ;; Separating one Python script shaves more than 106 MiB from :out.
1634 (lambda* (#:key outputs #:allow-other-keys)
1635 (let ((out (assoc-ref outputs "out"))
1636 (out:python (assoc-ref outputs "python")))
1637 (for-each (lambda (file)
1638 (let ((old (string-append out "/" file))
1639 (new (string-append out:python "/" file)))
1640 (mkdir-p (dirname new))
1641 (rename-file old new)))
1642 (list "bin/lsusb.py"))
1647 ("python" ,python)))
1649 `(("autoconf" ,autoconf)
1650 ("automake" ,automake)
1651 ("libtool" ,libtool)
1652 ("pkg-config" ,pkg-config)))
1653 (home-page "http://www.linux-usb.org/")
1655 "Tools for working with USB devices, such as lsusb")
1657 "Tools for working with USB devices, such as lsusb.")
1658 (license license:gpl2+)))
1660 (define-public e2fsprogs
1667 "mirror://kernel.org/linux/kernel/people/tytso/"
1668 "e2fsprogs/v" version "/"
1669 "e2fsprogs-" version ".tar.xz"))
1672 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1673 (build-system gnu-build-system)
1674 (inputs `(("util-linux" ,util-linux "lib")))
1675 (native-inputs `(("pkg-config" ,pkg-config)
1676 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1680 ("procps" ,procps)))
1682 '(;; util-linux is the preferred source for some of the libraries and
1683 ;; commands, so disable them (see, e.g.,
1684 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1685 #:configure-flags (list "--disable-libblkid"
1686 "--disable-libuuid" "--disable-uuidd"
1689 ;; Use symlinks instead of hard links for
1690 ;; 'fsck.extN' etc. This makes the resulting nar
1691 ;; smaller and is preserved across copies.
1692 "--enable-symlink-install"
1694 (string-append "LDFLAGS=-Wl,-rpath="
1695 (assoc-ref %outputs "out")
1698 ;; Install libext2fs et al.
1699 "--enable-elf-shlibs")
1702 (modify-phases %standard-phases
1703 (add-before 'configure 'patch-shells
1705 (substitute* "configure"
1706 (("/bin/sh (.*)parse-types.sh" _ dir)
1707 (string-append (which "sh") " " dir
1709 (substitute* "MCONFIG.in"
1710 (("INSTALL_SYMLINK = /bin/sh")
1711 "INSTALL_SYMLINK = sh"))
1712 (substitute* (find-files "." "^Makefile.in$")
1714 (string-append "#!" (which "sh"))))
1716 (add-after 'install 'install-libs
1717 (lambda* (#:key outputs #:allow-other-keys)
1718 (let* ((out (assoc-ref outputs "out"))
1719 (lib (string-append out "/lib")))
1720 (invoke "make" "install-libs")
1722 ;; Make the .a writable so that 'strip' works.
1723 ;; Failing to do that, due to debug symbols, we
1724 ;; retain a reference to the final
1725 ;; linux-libre-headers, which refer to the
1726 ;; bootstrap binaries.
1727 (let ((archives (find-files lib "\\.a$")))
1728 (for-each (lambda (file)
1732 (home-page "http://e2fsprogs.sourceforge.net/")
1733 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1735 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1736 (license (list license:gpl2 ;programs
1737 license:lgpl2.0 ;libext2fs
1738 license:x11)))) ;libuuid
1740 (define e2fsprogs/static
1742 (package (inherit e2fsprogs)
1744 ;; Do not build shared libraries.
1745 (substitute-keyword-arguments (package-arguments e2fsprogs)
1746 ((#:configure-flags _)
1747 '(list "--disable-blkid"))
1751 (define-public e2fsck/static
1753 (name "e2fsck-static")
1754 (version (package-version e2fsprogs))
1755 (build-system trivial-build-system)
1758 `(("e2fsprogs" ,e2fsprogs/static)))
1760 `(#:modules ((guix build utils))
1763 (use-modules (guix build utils)
1767 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1769 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1771 (with-directory-excursion bin
1772 (copy-file e2fsck "e2fsck")
1773 (remove-store-references "e2fsck")
1774 (chmod "e2fsck" #o555))
1776 (home-page (package-home-page e2fsprogs))
1777 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1778 (description "This package provides statically-linked e2fsck command taken
1779 from the e2fsprogs package. It is meant to be used in initrds.")
1780 (license (package-license e2fsprogs))))
1782 (define-public extundelete
1784 (name "extundelete")
1789 (uri (string-append "mirror://sourceforge/extundelete/"
1790 "extundelete/" version "/extundelete-"
1791 version ".tar.bz2"))
1794 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1795 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1796 (build-system gnu-build-system)
1797 (inputs `(("e2fsprogs" ,e2fsprogs)))
1798 (home-page "http://extundelete.sourceforge.net/")
1799 (synopsis "Recover deleted files from ext2/3/4 partitions")
1801 "Extundelete is a set of tools that can recover deleted files from an
1802 ext3 or ext4 partition.")
1803 (license license:gpl2)))
1805 (define-public zerofree
1809 (home-page "https://frippery.org/uml/")
1812 (uri (string-append home-page name "-" version
1816 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1817 (build-system gnu-build-system)
1820 (modify-phases %standard-phases
1821 (delete 'configure) ; no configure script
1823 ;; The Makefile lacks an ‘install’ target.
1824 (lambda* (#:key outputs #:allow-other-keys)
1825 (let* ((out (assoc-ref outputs "out"))
1826 (bin (string-append out "/bin")))
1827 (chmod "zerofree" #o555)
1828 (install-file "zerofree" bin)
1830 #:tests? #f)) ; no tests
1831 (inputs `(("libext2fs" ,e2fsprogs)))
1832 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1834 "Zerofree finds the unallocated blocks with non-zero value content in an
1835 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1836 This is a simple way to make disk images more compressible.
1837 Zerofree requires the file system to be unmounted or mounted read-only.")
1838 (license license:gpl2)))
1840 (define-public strace
1844 (home-page "https://strace.io")
1847 (uri (string-append home-page "/files/" version
1848 "/strace-" version ".tar.xz"))
1851 "1n6cfz3i2krkyvxpdp3kmxhf7sy5xp0danzaiirbk5fdkfgvb15j"))))
1852 (build-system gnu-build-system)
1855 (modify-phases %standard-phases
1856 (add-after 'unpack 'patch-/bin/sh
1858 (substitute* "strace.c"
1859 (("/bin/sh") (which "sh")))
1861 (add-after 'unpack 'disable-failing-tests
1863 ;; XXX These hang forever even if the test time-out is extended.
1864 (substitute* "tests/Makefile.in"
1865 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
1867 ;; Don't fail if the architecture doesn't support different personalities.
1868 #:configure-flags '("--enable-mpers=check")
1869 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1870 #:parallel-tests? #f)) ; undeterministic failures
1871 (native-inputs `(("perl" ,perl)))
1872 (synopsis "System call tracer for Linux")
1874 "strace is a system call tracer, i.e. a debugging tool which prints out a
1875 trace of all the system calls made by a another process/program.")
1876 (license license:lgpl2.1+)))
1878 (define-public ltrace
1884 (uri (string-append "http://www.ltrace.org/ltrace_" version
1888 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1889 (build-system gnu-build-system)
1890 (inputs `(("libelf" ,libelf)))
1892 ;; Compilation uses -Werror by default, but it fails.
1893 '(#:configure-flags '("--disable-werror")))
1894 (home-page "https://www.ltrace.org/")
1895 (synopsis "Library call tracer for Linux")
1897 "ltrace intercepts and records dynamic library calls which are called by
1898 an executed process and the signals received by that process. It can also
1899 intercept and print the system calls executed by the program.")
1900 (license license:gpl2+)))
1902 (define-public alsa-lib
1909 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1910 version ".tar.bz2"))
1913 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
1914 (build-system gnu-build-system)
1916 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1917 (assoc-ref %outputs "out")
1919 (home-page "https://www.alsa-project.org/")
1920 (synopsis "The Advanced Linux Sound Architecture libraries")
1922 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1923 MIDI functionality to the Linux-based operating system.")
1924 (license license:lgpl2.1+)))
1926 (define-public alsa-utils
1932 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1933 name "-" version ".tar.bz2"))
1936 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
1937 (build-system gnu-build-system)
1939 ;; XXX: Disable man page creation until we have DocBook.
1940 '(#:configure-flags (list "--disable-xmlto"
1942 ;; The udev rule is responsible for restoring
1944 (string-append "--with-udev-rules-dir="
1945 (assoc-ref %outputs "out")
1946 "/lib/udev/rules.d"))
1948 (modify-phases %standard-phases
1949 (add-before 'check 'disable-broken-test
1951 ;; XXX: The 1.1.8 release tarball is missing a header that's
1952 ;; required for this test to work. Fixed in 1.1.9.
1953 (substitute* "axfer/test/Makefile"
1954 ((".*container-test.*") ""))
1957 'install 'pre-install
1959 ;; Don't try to mkdir /var/lib/alsa.
1960 (substitute* "Makefile"
1961 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1965 `(("gettext" ,gettext-minimal)))
1967 `(("libsamplerate" ,libsamplerate)
1968 ("ncurses" ,ncurses)
1969 ("alsa-lib" ,alsa-lib)
1971 (home-page "http://www.alsa-project.org/")
1972 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1974 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1975 MIDI functionality to the Linux-based operating system.")
1977 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1979 (license license:gpl2)))
1981 (define-public alsa-plugins
1983 (name "alsa-plugins")
1987 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1988 name "-" version ".tar.bz2"))
1991 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
1992 (build-system gnu-build-system)
1993 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1994 ;; be split, there are references to both in files.
1995 ;; TODO: Remove OSS related plugins, they add support to run native
1996 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1998 (outputs '("out" "pulseaudio" "jack"))
2000 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2001 ;; for /etc/alsa. On Guix System plugins are loaded from
2002 ;; the ALSA service, and other distributions likely
2003 ;; won't use these files.
2004 "--with-alsalconfdir=/tmp/noop")
2006 (modify-phases %standard-phases
2007 (add-after 'install 'split
2008 (lambda* (#:key inputs outputs #:allow-other-keys)
2009 ;; Distribute the binaries to the various outputs.
2010 (let* ((out (assoc-ref outputs "out"))
2011 (jack (assoc-ref outputs "jack"))
2012 (jacklib (string-append jack "/lib/alsa-lib"))
2013 (pua (assoc-ref outputs "pulseaudio"))
2014 (pualib (string-append pua "/lib/alsa-lib")))
2017 (for-each (lambda (file)
2018 (rename-file file (string-append jacklib "/" (basename file))))
2019 (find-files out ".*jack\\.(la|so)"))
2022 (for-each (lambda (file)
2023 (rename-file file (string-append pualib "/" (basename file))))
2024 (find-files out ".*pulse\\.(la|so)"))
2027 `(("alsa-lib" ,alsa-lib)
2029 ("speex" ,speex) ; libspeexdsp resampling plugin
2030 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2031 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2032 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2034 `(("pkg-config" ,pkg-config)))
2035 (home-page "http://www.alsa-project.org/")
2036 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2038 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2039 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2040 by providing additional plugins which include: upmixing, downmixing, jackd and
2041 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2042 external rate conversion.")
2043 (license (list license:gpl2+
2044 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2045 license:lgpl2.1+))))
2047 (define-public iptables
2050 ;; XXX When updating, remove the ‘install-missing-script’ phase.
2055 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2057 (string-append "https://www.netfilter.org/projects/iptables/"
2058 "files/iptables-" version ".tar.bz2")))
2060 (base32 "02a3575ypdpg6a2x752mhk3f7h1381ymkq1n0gss6fp6292xfmyl"))))
2061 (build-system gnu-build-system)
2063 `(("pkg-config" ,pkg-config)
2067 `(("libmnl" ,libmnl)
2068 ("libnftnl" ,libnftnl)))
2070 '(#:tests? #f ; no test suite
2071 #:configure-flags ; add $libdir to the RUNPATH of executables
2072 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
2074 (modify-phases %standard-phases
2075 (add-after 'install 'install-missing-script
2076 ;; A typo prevents installation of /sbin/iptables-apply. It's been
2077 ;; fixed upstream (d4ed0c741fc789bb09d977d74d30875fdd50d08b), but
2078 ;; a patch would require bootstrapping and more inputs. Simply copy
2079 ;; the file ourselves.
2080 (lambda* (#:key outputs #:allow-other-keys)
2081 (let* ((out (assoc-ref outputs "out"))
2082 (sbin (string-append out "/sbin")))
2083 (install-file "iptables/iptables-apply" sbin)
2085 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2086 (synopsis "Programs to configure Linux IP packet filtering rules")
2088 "@command{iptables} is the user-space command line program used to
2089 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2090 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2092 This package also includes @command{ip6tables}, which is used to configure the
2095 Both commands are targeted at system administrators.")
2096 (license license:gpl2+)))
2098 (define-public lsscsi
2105 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2108 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
2109 (build-system gnu-build-system)
2110 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2111 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2113 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2114 also list NVMe namespaces or controllers and show the relationship between a
2115 device's primary node name, its SCSI generic (sg) node name and its kernel
2117 (license license:gpl2)))
2119 (define-public ebtables
2126 "mirror://netfilter.org/ebtables/ebtables-"
2130 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2131 (build-system gnu-build-system)
2134 ("iptables" ,iptables)))
2135 (synopsis "Ethernet bridge frame table administration")
2136 (home-page "https://ebtables.netfilter.org/")
2138 "ebtables is an application program used to set up and maintain the
2139 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2140 analogous to the iptables application, but less complicated, due to the fact
2141 that the Ethernet protocol is much simpler than the IP protocol.")
2142 (license license:gpl2+)))
2144 (define-public iproute
2151 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2155 "088gs56iqhdlpw1iqjwrss4zxd4zbl2wl8s2implrrdajjxcfpbj"))))
2156 (build-system gnu-build-system)
2158 `( ;; There is a test suite, but it wants network namespaces and sudo.
2160 #:make-flags (let ((out (assoc-ref %outputs "out")))
2162 (string-append "BASH_COMPDIR=" out
2163 "/etc/bash_completion.d")
2164 (string-append "LIBDIR=" out "/lib")
2165 (string-append "HDRDIR=" out "/include")
2166 (string-append "SBINDIR=" out "/sbin")
2167 (string-append "CONFDIR=" out "/etc")
2168 (string-append "DOCDIR=" out "/share/doc/"
2170 (string-append "MANDIR=" out "/share/man")))
2171 #:phases (modify-phases %standard-phases
2172 (add-before 'install 'pre-install
2174 ;; Don't attempt to create /var/lib/arpd.
2175 (substitute* "Makefile"
2176 (("^.*ARPDDIR.*$") ""))
2180 ("iptables" ,iptables)
2181 ("libmnl" ,libmnl)))
2185 ("pkg-config" ,pkg-config)))
2187 ;; ("libmnl" ,libmnl)
2188 ;; ("util-linux" ,util-linux)
2190 "https://wiki.linuxfoundation.org/networking/iproute2")
2192 "Utilities for controlling TCP/IP networking and traffic in Linux")
2194 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2195 and traffic with the Linux kernel. The most important of these are
2196 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2199 Most network configuration manuals still refer to ifconfig and route as the
2200 primary network configuration tools, but ifconfig is known to behave
2201 inadequately in modern network environments, and both should be deprecated.")
2202 (license license:gpl2+)))
2204 (define-public net-tools
2205 ;; XXX: This package is basically unmaintained, but it provides a few
2206 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2208 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2212 (version (string-append "1.60-" revision "." (string-take commit 7)))
2215 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2216 "n/ne/net-tools/code.git/net-tools-code-"
2218 (file-name (string-append name "-" version ".zip"))
2221 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2222 (home-page "http://net-tools.sourceforge.net/")
2223 (build-system gnu-build-system)
2225 `(#:modules ((guix build gnu-build-system)
2230 (modify-phases %standard-phases
2232 (lambda* (#:key outputs #:allow-other-keys)
2233 (let ((out (assoc-ref outputs "out")))
2234 (mkdir-p (string-append out "/bin"))
2235 (mkdir-p (string-append out "/sbin"))
2237 ;; Pretend we have everything...
2238 (system "yes | make config")
2240 ;; ... except for the things we don't have.
2241 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2242 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2243 ;; that have been removed.
2244 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2245 ;; think about adding them later.
2246 (substitute* '("config.make" "config.h")
2247 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2250 (add-after 'install 'remove-redundant-commands
2251 (lambda* (#:key outputs #:allow-other-keys)
2252 ;; Remove commands and man pages redundant with Inetutils.
2253 (let* ((out (assoc-ref outputs "out"))
2254 (dup (append-map (cut find-files out <>)
2256 "^(yp|nis|dns)?domainname"))))
2257 (for-each delete-file dup)
2259 ;; Binaries that depend on libnet-tools.a don't declare that
2260 ;; dependency, making it parallel-unsafe.
2261 #:parallel-build? #f
2263 #:tests? #f ; no test suite
2264 #:make-flags (let ((out (assoc-ref %outputs "out")))
2265 (list ,(string-append "CC=" (cc-for-target))
2266 (string-append "BASEDIR=" out)
2267 (string-append "INSTALLNLSDIR=" out "/share/locale")
2268 (string-append "mandir=/share/man")))))
2269 (native-inputs `(("gettext" ,gettext-minimal)
2271 (supported-systems (delete "i586-gnu" %supported-systems))
2272 (synopsis "Tools for controlling the network subsystem in Linux")
2274 "This package includes the important tools for controlling the network
2275 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2276 route. Additionally, this package contains utilities relating to particular
2277 network hardware types (plipconfig, slattach) and advanced aspects of IP
2278 configuration (iptunnel, ipmaddr).")
2279 (license license:gpl2+))))
2281 (define-public libcap
2288 "mirror://kernel.org/linux/libs/security/linux-privs/"
2289 "libcap2/libcap-" version ".tar.xz"))
2292 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2293 (build-system gnu-build-system)
2294 (arguments '(#:phases
2295 (modify-phases %standard-phases
2297 ;; Add $libdir to the RUNPATH of executables.
2299 (substitute* "Make.Rules"
2301 (string-append "LDFLAGS := -Wl,-rpath="
2304 #:test-target "test"
2305 #:make-flags (list "lib=lib"
2306 (string-append "prefix="
2307 (assoc-ref %outputs "out"))
2308 "RAISE_SETFCAP=no")))
2309 (native-inputs `(("perl" ,perl)))
2310 (supported-systems (delete "i586-gnu" %supported-systems))
2311 (home-page "https://sites.google.com/site/fullycapable/")
2312 (synopsis "Library for working with POSIX capabilities")
2314 "Libcap2 provides a programming interface to POSIX capabilities on
2315 Linux-based operating systems.")
2317 ;; License is BSD-3 or GPLv2, at the user's choice.
2318 (license license:gpl2)))
2320 ;; libcap 2.31 causes problems for 'fakeroot', so provide this newer variant.
2321 ;; To be merged with libcap on the next rebuild cycle.
2322 (define-public libcap/next
2329 "mirror://kernel.org/linux/libs/security/linux-privs/"
2330 "libcap2/libcap-" version ".tar.xz"))
2333 "048n1gy2p48vl9hkrr9wymfxxcpwj2aslz2bv79nhl4m2lhd9kdf"))))))
2335 (define-public bridge-utils
2337 (name "bridge-utils")
2342 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2343 "bridge-utils-" version ".tar.xz"))
2345 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
2346 (build-system gnu-build-system)
2348 ;; The tarball lacks all the generated files.
2349 (native-inputs `(("autoconf" ,autoconf)
2350 ("automake" ,automake)))
2353 (modify-phases %standard-phases
2354 (add-before 'bootstrap 'patch-stuff
2356 ;; Fix "field ‘ip6’ has incomplete type" errors.
2357 (substitute* "libbridge/libbridge.h"
2358 (("#include <linux/if_bridge.h>")
2359 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2361 ;; Ensure that the entire build fails if one of the
2362 ;; sub-Makefiles fails.
2363 (substitute* "Makefile.in"
2364 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2365 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2368 #:tests? #f)) ; no 'check' target
2370 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2371 (synopsis "Manipulate Ethernet bridges")
2373 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2374 to connect two Ethernet segments together in a protocol independent way.
2375 Packets are forwarded based on Ethernet address, rather than IP address (like
2376 a router). Since forwarding is done at Layer 2, all protocols can go
2377 transparently through a bridge.")
2378 (license license:gpl2+)))
2380 (define-public libnl
2387 "https://github.com/thom311/libnl/releases/download/"
2388 "libnl" (string-join (string-split version #\.) "_")
2389 "/libnl-" version ".tar.gz"))
2392 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2393 (build-system gnu-build-system)
2397 ("pkg-config" ,pkg-config)
2403 "https://github.com/thom311/libnl/releases/download/libnl"
2404 (string-join (string-split version #\.) "_")
2405 "/libnl-doc-" version ".tar.gz"))
2407 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2408 (outputs `("out" "doc"))
2411 (modify-phases %standard-phases
2412 (add-after 'install 'install-doc
2413 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2414 (let ((dest (string-append (assoc-ref outputs "doc")
2415 "/share/doc/libnl")))
2417 (invoke "tar" "xf" (assoc-ref
2418 (or native-inputs inputs)
2420 "--strip-components=1" "-C" dest)))))))
2421 (home-page "https://www.infradead.org/~tgr/libnl/")
2422 (synopsis "NetLink protocol library suite")
2424 "The libnl suite is a collection of libraries providing APIs to netlink
2425 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2426 between the kernel and user space processes. It was designed to be a more
2427 flexible successor to ioctl to provide mainly networking related kernel
2428 configuration and monitoring interfaces.")
2430 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2431 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2432 (license license:gpl2)))
2434 ;; libnl python extensions used to be outputs of libnl. However, as
2435 ;; cross-compiling python extensions is currently broken, create separate
2436 ;; packages for libnl python extensions.
2437 (define (libnl-python-package python)
2438 (let ((name (string-append "libnl-" python)))
2443 ((string=? python "python2")
2444 `(("python-2" ,python-2)))
2445 ((string=? python "python3")
2446 `(("python-3" ,python-3))))))
2447 (propagated-inputs `(("libnl" ,libnl)))
2450 `(#:modules ((guix build gnu-build-system)
2454 (modify-phases %standard-phases
2456 (lambda* (#:key inputs outputs #:allow-other-keys)
2457 (define (python-inst python)
2458 (invoke python "setup.py" "build")
2459 (invoke python "setup.py" "install"
2460 (string-append "--prefix="
2461 (assoc-ref %outputs "out")))
2462 (invoke python "setup.py" "clean"))
2463 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2464 (assoc-ref inputs "libnl")))
2465 (with-directory-excursion "./python" (python-inst ,python))
2468 (define-public libnl-python2 (libnl-python-package "python2"))
2469 (define-public libnl-python3 (libnl-python-package "python3"))
2478 "mirror://kernel.org/software/network/iw/iw-"
2482 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2483 (build-system gnu-build-system)
2484 (native-inputs `(("pkg-config" ,pkg-config)))
2485 (inputs `(("libnl" ,libnl)))
2488 (let* ((target ,(%current-target-system))
2489 (pkg-config (if target
2490 (string-append target "-pkg-config")
2493 ,(string-append "CC=" (cc-for-target))
2494 (string-append "PKG_CONFIG="
2495 (assoc-ref %build-inputs "pkg-config")
2497 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2498 #:phases (modify-phases %standard-phases (delete 'configure))))
2499 (home-page "https://wireless.wiki.kernel.org/")
2500 (synopsis "Tool for configuring wireless devices")
2502 "iw is a new nl80211 based CLI configuration utility for wireless
2503 devices. It replaces @code{iwconfig}, which is deprecated.")
2504 (license license:isc)))
2506 (define-public powertop
2513 (uri (string-append "https://01.org/sites/default/files/downloads/"
2514 "powertop-" version ".tar.gz"))
2516 (base32 "0y1ixw8v17fdb1ima0zshrd0rh4zxdh10r93nrrvq6d4lhn9jpx6"))))
2517 (build-system gnu-build-system)
2520 (modify-phases %standard-phases
2521 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2522 ;; allow calibrating the network interface in Guix System.
2523 (add-after 'unpack 'patch-absolute-file-names
2524 (lambda* (#:key inputs #:allow-other-keys)
2525 (let ((kmod (assoc-ref inputs "kmod")))
2526 (substitute* (find-files "src" "\\.cpp$")
2527 ;; Give the right 'modprobe' file name so that essential
2528 ;; modules such as msr.ko can be loaded.
2529 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2530 ;; These programs are only needed to calibrate, so using
2531 ;; relative file names avoids adding extra inputs. When they
2532 ;; are missing powertop gracefully handles it.
2533 (("/usr/bin/hcitool") "hcitool")
2534 (("/usr/bin/xset") "xset")
2535 (("/usr/sbin/hciconfig") "hciconfig"))
2540 ("ncurses" ,ncurses)
2541 ("pciutils" ,pciutils)
2544 `(("pkg-config" ,pkg-config)))
2545 (home-page "https://01.org/powertop/")
2546 (synopsis "Analyze power consumption on Intel-based laptops")
2548 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2549 power management. In addition to being a diagnostic tool, PowerTOP also has
2550 an interactive mode where the user can experiment various power management
2551 settings for cases where the operating system has not enabled these
2553 (license license:gpl2)))
2555 (define-public aumix
2562 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2563 version ".tar.bz2"))
2566 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2567 (build-system gnu-build-system)
2568 (inputs `(("ncurses" ,ncurses)))
2569 (home-page "http://www.jpj.net/~trevor/aumix.html")
2570 (synopsis "Audio mixer for X and the console")
2572 "Aumix adjusts an audio mixer from X, the console, a terminal,
2573 the command line or a script.")
2574 (license license:gpl2+)))
2576 (define-public iotop
2583 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2586 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2587 (build-system python-build-system)
2590 (modify-phases %standard-phases
2591 (add-after 'unpack 'fix-build-with-python3
2593 (substitute* "setup.py"
2594 (("itervalues") "values"))
2596 ;; There are currently no checks in the package.
2598 (native-inputs `(("python" ,python)))
2599 (home-page "http://guichaz.free.fr/iotop/")
2601 "Displays the IO activity of running processes")
2603 "Iotop is a Python program with a top like user interface to show the
2604 processes currently causing I/O.")
2605 (license license:gpl2+)))
2613 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2614 "download/fuse-" version
2615 "/fuse-" version ".tar.gz"))
2618 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2619 (patches (search-patches "fuse-overlapping-headers.patch"))))
2620 (build-system gnu-build-system)
2621 (inputs `(("util-linux" ,util-linux)))
2623 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2624 (assoc-ref %outputs "out")
2626 (string-append "INIT_D_PATH="
2627 (assoc-ref %outputs "out")
2630 ;; The rule makes /dev/fuse 666.
2631 (string-append "UDEV_RULES_PATH="
2632 (assoc-ref %outputs "out")
2633 "/lib/udev/rules.d"))
2635 (modify-phases %standard-phases
2636 (add-before 'build 'set-file-names
2637 (lambda* (#:key inputs #:allow-other-keys)
2638 ;; libfuse calls out to mount(8) and umount(8). Make sure
2639 ;; it refers to the right ones.
2640 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2641 (("/bin/(u?)mount" _ maybe-u)
2642 (string-append (assoc-ref inputs "util-linux")
2643 "/bin/" maybe-u "mount")))
2644 (substitute* '("util/mount.fuse.c")
2648 ;; This hack leads libfuse to search for 'fusermount' in
2649 ;; $PATH, where it may find a setuid-root binary, instead of
2650 ;; trying solely $out/sbin/fusermount and failing because
2652 (substitute* "lib/Makefile"
2653 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2654 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2656 (supported-systems (delete "i586-gnu" %supported-systems))
2657 (home-page "https://github.com/libfuse/libfuse")
2658 (synopsis "Support file systems implemented in user space")
2660 "As a consequence of its monolithic design, file system code for Linux
2661 normally goes into the kernel itself---which is not only a robustness issue,
2662 but also an impediment to system extensibility. FUSE, for \"file systems in
2663 user space\", is a kernel module and user-space library that tries to address
2664 part of this problem by allowing users to run file system implementations as
2665 user-space processes.")
2666 (license (list license:lgpl2.1 ;library
2667 license:gpl2+)))) ;command-line utilities
2669 (define-public unionfs-fuse
2671 (name "unionfs-fuse")
2676 (url "https://github.com/rpodgorny/unionfs-fuse")
2677 (commit (string-append "v" version))))
2678 (file-name (git-file-name name version))
2681 "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6"))))
2682 (build-system cmake-build-system)
2684 `(("python" ,python)))
2685 (inputs `(("fuse" ,fuse)))
2687 ;; The tests were never actually run ("collected 0 items"), but in recent
2688 ;; versions of pytest that causes an error.
2690 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2691 (synopsis "User-space union file system")
2693 "UnionFS-FUSE is a flexible union file system implementation in user
2694 space, using the FUSE library. Mounting a union file system allows you to
2695 \"aggregate\" the contents of several directories into a single mount point.
2696 UnionFS-FUSE additionally supports copy-on-write.")
2697 (license license:bsd-3)))
2700 (package (inherit fuse)
2701 (name "fuse-static")
2702 (source (origin (inherit (package-source fuse))
2703 (modules '((guix build utils)))
2706 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2707 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2708 ;; that it doesn't do that, allowing us to remove the
2709 ;; dependency on util-linux (something that is useful in
2711 (substitute* '("lib/mount_util.c"
2712 "util/mount_util.c")
2713 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2719 (define-public unionfs-fuse/static
2720 (package (inherit unionfs-fuse)
2721 (synopsis "User-space union file system (statically linked)")
2722 (name (string-append (package-name unionfs-fuse) "-static"))
2723 (source (origin (inherit (package-source unionfs-fuse))
2724 (modules '((guix build utils)))
2727 ;; Add -ldl to the libraries, because libfuse.a needs that.
2728 (substitute* "src/CMakeLists.txt"
2729 (("target_link_libraries(.*)\\)" _ libs)
2730 (string-append "target_link_libraries"
2735 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2737 (modify-phases %standard-phases
2738 (add-after 'install 'post-install
2739 (lambda* (#:key outputs #:allow-other-keys)
2740 (let* ((out (assoc-ref outputs "out"))
2741 (exe (string-append out "/bin/unionfs")))
2742 ;; By default, 'unionfs' keeps references to
2743 ;; $glibc/share/locale and similar stuff. Remove them.
2744 (remove-store-references exe)
2746 ;; 'unionfsctl' has references to glibc as well. Since
2747 ;; we don't need it, remove it.
2748 (delete-file (string-append out "/bin/unionfsctl"))
2750 (inputs `(("fuse" ,fuse-static)))))
2752 (define-public sshfs
2758 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2759 "download/sshfs-" version "/sshfs-" version
2763 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2764 (build-system gnu-build-system)
2769 `(("pkg-config" ,pkg-config)))
2770 (home-page "https://github.com/libfuse/sshfs")
2771 (synopsis "Mount remote file systems over SSH")
2773 "This is a file system client based on the SSH File Transfer Protocol.
2774 Since most SSH servers already support this protocol it is very easy to set
2775 up: on the server side there's nothing to do; on the client side mounting the
2776 file system is as easy as logging into the server with an SSH client.")
2777 (license license:gpl2+)))
2779 (define-public sshfs-fuse
2780 (package (inherit sshfs)
2782 (properties `((superseded . ,sshfs)))))
2784 (define-public archivemount
2786 (name "archivemount")
2791 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2792 "archivemount-" version ".tar.gz"))
2794 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2795 (build-system gnu-build-system)
2796 (inputs `(("fuse" ,fuse)
2797 ("libarchive" ,libarchive)))
2798 (native-inputs `(("pkg-config" ,pkg-config)))
2799 (home-page "https://www.cybernoia.de/software/archivemount.html")
2800 (synopsis "Tool for mounting archive files with FUSE")
2801 (description "archivemount is a FUSE-based file system for Unix variants,
2802 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2803 mount point where it can be read from or written to as with any other file
2804 system. This makes accessing the contents of the archive, which may be
2805 compressed, transparent to other programs, without decompressing them.")
2806 (license license:lgpl2.0+)))
2808 (define-public numactl
2815 "https://github.com/numactl/numactl/releases/download/v"
2816 version "/numactl-" version ".tar.gz"))
2819 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2820 (build-system gnu-build-system)
2822 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2823 ;; to run, which we can't assume to have.
2826 ;; NUMA is apparently not supported on armhf, see
2827 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2828 (supported-systems (delete "armhf-linux" %supported-systems))
2829 (home-page "https://github.com/numactl/numactl")
2830 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2832 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2833 memory is not all in one place. The @command{numactl} program allows you to
2834 run your application program on specific CPUs and memory nodes. It does this
2835 by supplying a NUMA memory policy to the operating system before running your
2838 The package contains other commands, such as @command{numastat},
2839 @command{memhog}, and @command{numademo} which provides a quick overview of
2840 NUMA performance on your system.")
2841 (license (list license:gpl2 ;programs
2842 license:lgpl2.1)))) ;library
2844 (define-public kbd-neo
2851 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2852 version "/linux/console/neo.map"))
2853 (file-name (string-append name "-" version ".map"))
2856 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2857 (build-system trivial-build-system)
2859 `(#:modules ((guix build utils))
2861 (use-modules (guix build utils))
2862 (let ((out (string-append %output "/share/keymaps"))
2863 (source (assoc-ref %build-inputs "source")))
2865 (copy-file source (string-append out "/neo.map"))
2867 (home-page "https://neo-layout.org")
2868 (synopsis "Neo2 console layout")
2870 "Kbd-neo provides the Neo2 keyboard layout for use with
2871 @command{loadkeys(1)} from @code{kbd(4)}.")
2872 ;; The file is located in an svn directory, the entire content of
2873 ;; the directory is licensed as GPL3.
2874 (license license:gpl3+)))
2882 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2886 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2887 (modules '((guix build utils)))
2890 (substitute* "tests/Makefile.in"
2891 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2894 (substitute* '("src/unicode_start" "src/unicode_stop")
2895 ;; Assume the Coreutils are in $PATH.
2899 (build-system gnu-build-system)
2902 (modify-phases %standard-phases
2903 (add-before 'build 'pre-build
2904 (lambda* (#:key inputs #:allow-other-keys)
2905 (let ((gzip (assoc-ref %build-inputs "gzip"))
2906 (bzip2 (assoc-ref %build-inputs "bzip2")))
2907 (substitute* "src/libkeymap/findfile.c"
2909 (string-append gzip "/bin/gzip"))
2911 (string-append bzip2 "/bin/bzip2")))
2913 (add-after 'install 'post-install
2914 (lambda* (#:key outputs #:allow-other-keys)
2915 ;; Make sure these programs find their comrades.
2916 (let* ((out (assoc-ref outputs "out"))
2917 (bin (string-append out "/bin")))
2918 (for-each (lambda (prog)
2919 (wrap-program (string-append bin "/" prog)
2920 `("PATH" ":" prefix (,bin))))
2921 '("unicode_start" "unicode_stop"))
2923 (inputs `(("check" ,check)
2926 ("pam" ,linux-pam)))
2927 (native-search-paths
2928 (list (search-path-specification
2929 (variable "LOADKEYS_KEYMAP_PATH")
2930 ;; Append ‘/**’ to recursively search all directories. One can then
2931 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2932 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2933 (files (list "share/keymaps/**")))))
2934 (native-inputs `(("pkg-config" ,pkg-config)))
2935 (home-page "http://kbd-project.org/")
2936 (synopsis "Linux keyboard utilities and keyboard maps")
2938 "This package contains keytable files and keyboard utilities compatible
2939 for systems using the Linux kernel. This includes commands such as
2940 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2941 (license license:gpl2+)))
2943 (define-public loadkeys-static
2946 (name "loadkeys-static")
2948 (substitute-keyword-arguments (package-arguments kbd)
2949 ((#:configure-flags flags ''())
2950 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2951 "--disable-vlock" ;so we don't need libpam
2952 "--disable-libkeymap")
2954 ((#:make-flags flags ''())
2955 `(cons "LDFLAGS=-all-static" ,flags))
2956 ((#:phases phases '%standard-phases)
2957 `(modify-phases ,phases
2959 (lambda* (#:key outputs #:allow-other-keys)
2960 (let ((out (assoc-ref outputs "out")))
2961 ;; The binary keeps references to gzip, among other things,
2962 ;; which we don't need in the initrd, so strip references.
2963 (remove-store-references "src/loadkeys")
2965 (install-file "src/loadkeys"
2966 (string-append out "/bin"))
2968 (delete 'post-install)))
2969 ((#:strip-flags _ '())
2971 ((#:allowed-references _ '())
2974 (synopsis "Statically-linked @command{loadkeys} program")
2976 ;; This package is meant to be used internally in the initrd so don't
2978 (properties '((hidden? . #t)))))
2980 (define-public inotify-tools
2982 (name "inotify-tools")
2983 (version "3.20.2.2")
2987 (url "https://github.com/rvoicilas/inotify-tools.git")
2989 (file-name (git-file-name name version))
2992 "1r12bglkb0bkqff6kgxjm81hk6z20nrxq3m7iv15d4nrqf9pm7s0"))))
2993 (build-system gnu-build-system)
2995 `(("autoconf" ,autoconf)
2996 ("automake" ,automake)
2997 ("libtool" ,libtool)))
2998 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2999 (synopsis "Monitor file accesses")
3001 "The inotify-tools packages provides a C library and command-line tools
3002 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3003 (license license:gpl2+)))
3012 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3013 "kmod-" version ".tar.xz"))
3016 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3017 (patches (search-patches "kmod-module-directory.patch"))))
3018 (build-system gnu-build-system)
3020 `(("pkg-config" ,pkg-config)))
3025 `(#:configure-flags '("--with-xz" "--with-zlib"
3026 "--disable-test-modules")
3028 (modify-phases %standard-phases
3029 (add-after 'unpack 'disable-tests
3031 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3032 (substitute* "Makefile.in"
3033 (("testsuite/test-modprobe") "")
3034 (("testsuite/test-depmod") "")
3035 (("testsuite/test-blacklist") ""))
3037 (add-after 'install 'install-modprobe&co
3038 (lambda* (#:key outputs #:allow-other-keys)
3039 (let* ((out (assoc-ref outputs "out"))
3040 (bin (string-append out "/bin")))
3041 (for-each (lambda (tool)
3043 (string-append bin "/" tool)))
3044 '("insmod" "rmmod" "lsmod" "modprobe"
3045 "modinfo" "depmod"))
3047 (supported-systems (delete "i586-gnu" %supported-systems))
3048 (home-page "https://www.kernel.org/")
3049 (synopsis "Kernel module tools")
3050 (description "Kmod is a set of tools to handle common tasks with Linux
3051 kernel modules like insert, remove, list, check properties, resolve
3052 dependencies and aliases.
3054 These tools are designed on top of libkmod, a library that is shipped with
3055 kmod. The aim is to be compatible with tools, configurations and indices
3056 from the module-init-tools project.")
3057 (license license:gpl2+))) ; library under lgpl2.1+
3059 (define-public earlyoom
3066 (url "https://github.com/rfjakob/earlyoom.git")
3067 (commit (string-append "v" version))))
3068 (file-name (git-file-name name version))
3071 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
3072 (build-system gnu-build-system)
3074 `(#:phases (modify-phases %standard-phases
3076 (add-before 'check 'set-home
3078 (setenv "HOME" (getcwd))
3080 (add-after 'build 'install-contribs
3081 ;; Install what seems useful from the contrib directory.
3082 (lambda* (#:key outputs #:allow-other-keys)
3083 (let* ((out (assoc-ref outputs "out"))
3084 (contrib (string-append
3085 out "/share/earlyoom/contrib")))
3086 (install-file "contrib/notify_all_users.py" contrib)
3088 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3089 (list ,(string-append "CC=" (cc-for-target))
3090 (string-append "VERSION=v" ,version)
3091 (string-append "PREFIX=" prefix)
3092 (string-append "SYSCONFDIR=" prefix "/etc")))
3093 #:test-target "test"))
3094 (native-inputs `(("go" ,go) ;for the test suite
3095 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
3096 (home-page "https://github.com/rfjakob/earlyoom")
3097 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3098 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3099 runs in user space and provides a more responsive and configurable alternative
3100 to the in-kernel OOM killer.")
3101 (license license:expat)))
3103 (define-public eudev
3104 ;; The post-systemd fork, maintained by Gentoo.
3110 (uri (git-reference (url "https://github.com/gentoo/eudev")
3111 (commit (string-append "v" version))))
3112 (file-name (git-file-name name version))
3115 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3116 (patches (search-patches "eudev-rules-directory.patch"))))
3117 (build-system gnu-build-system)
3120 (modify-phases %standard-phases
3121 (add-after 'unpack 'make-source-writable
3123 ;; XXX: Git checkouts are read-only, but this package needs to
3124 ;; modify some of its files.
3125 (for-each make-file-writable (find-files "."))
3127 (add-before 'bootstrap 'patch-file-names
3128 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3129 (substitute* "man/make.sh"
3130 (("/usr/bin/xsltproc")
3131 (string-append (assoc-ref
3132 (or native-inputs inputs) "xsltproc")
3135 (add-before 'configure 'patch-bindir-in-btrfs-rules
3136 (lambda* (#:key outputs #:allow-other-keys)
3137 ;; The "@bindir@" substitution incorrectly expands to a literal
3138 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3140 (let ((out (assoc-ref outputs "out")))
3141 (substitute* "rules/64-btrfs.rules.in"
3143 (string-append out "/bin")))
3145 (add-after 'install 'move-static-library
3146 (lambda* (#:key outputs #:allow-other-keys)
3147 (let* ((out (assoc-ref outputs "out"))
3148 (static (assoc-ref outputs "static"))
3149 (source (string-append out "/lib/libudev.a"))
3150 (target (string-append static "/lib/libudev.a")))
3151 (mkdir-p (dirname target))
3152 (link source target)
3153 (delete-file source)
3154 ;; Remove reference to the static library from the .la file
3155 ;; such that Libtool looks for it in the usual places.
3156 (substitute* (string-append out "/lib/libudev.la")
3158 "old_library=''\n"))
3160 (add-after 'install 'build-hwdb
3161 (lambda* (#:key outputs #:allow-other-keys)
3162 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3163 ;; similar tools to display product names.
3165 ;; XXX: This can't be done when cross-compiling. Find another way
3166 ;; to generate hwdb.bin for cross-built systems.
3167 (let ((out (assoc-ref outputs "out")))
3168 ,@(if (%current-target-system)
3170 '((invoke (string-append out "/bin/udevadm")
3171 "hwdb" "--update")))))))
3172 #:configure-flags (list "--enable-manpages")))
3174 `(("autoconf" ,autoconf)
3175 ("automake" ,automake)
3177 ("libtool" ,libtool)
3178 ("pkg-config" ,pkg-config)
3181 ("python" ,python-wrapper)
3182 ;; For documentation.
3183 ("docbook-xml" ,docbook-xml-4.2)
3184 ("docbook-xsl" ,docbook-xsl)
3185 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3186 ("xsltproc" ,libxslt)))
3188 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3189 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3190 ;; which contains the rules to do that.
3191 `(("util-linux" ,util-linux "lib") ;for blkid
3193 (outputs '("out" "static"))
3194 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3195 (synopsis "Userspace device management")
3196 (description "Udev is a daemon which dynamically creates and removes
3197 device nodes from /dev/, handles hotplug events and loads drivers at boot
3199 (license license:gpl2+)))
3201 (define-public python-evdev
3203 (name "python-evdev")
3208 (uri (pypi-uri "evdev" version))
3210 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3211 (build-system python-build-system)
3213 `(("kernel-headers" ,linux-libre-headers)))
3215 `(#:tests? #f ;no rule for tests
3217 (modify-phases %standard-phases
3218 (add-before 'build 'fix-hard-coded-directory
3219 (lambda* (#:key inputs #:allow-other-keys)
3220 (substitute* "setup.py"
3221 (("/usr/include/linux")
3223 (assoc-ref inputs "kernel-headers") "/include/linux")))
3225 (home-page "https://github.com/gvalkov/python-evdev")
3226 (synopsis "Bindings to the Linux input handling subsystem")
3228 "Python-evdev provides bindings to the generic input event interface in
3229 Linux. The @code{evdev} interface serves the purpose of passing events
3230 generated in the kernel directly to userspace through character devices that
3231 are typically located in @file{/dev/input/}.
3233 This package also comes with bindings to @code{uinput}, the userspace input
3234 subsystem. @code{uinput} allows userspace programs to create and handle input
3235 devices that can inject events directly into the input subsystem.")
3236 (license license:bsd-3)))
3244 (uri (list (string-append "ftp://sourceware.org/pub/lvm2/LVM2."
3246 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3250 "0xdr9qbqw6kja267wmx6ajnfv1nhw056gpxx9v2qmfh3bj6qnfn0"))
3251 (modules '((guix build utils)))
3254 (use-modules (guix build utils))
3256 ;; Honor sysconfdir.
3257 (substitute* "make.tmpl.in"
3259 "confdir = @sysconfdir@\n")
3260 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3261 "DEFAULT_SYS_DIR = @sysconfdir@"))
3263 (patches (search-patches "lvm2-static-link.patch"))))
3264 (build-system gnu-build-system)
3266 `(("pkg-config" ,pkg-config)
3267 ("procps" ,procps))) ;tests use 'pgrep'
3269 `(("libaio" ,libaio)
3273 (modify-phases %standard-phases
3274 (add-after 'configure 'set-makefile-shell
3276 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3278 (setenv "SHELL" (which "sh"))
3280 ;; Replace /bin/sh with the right file name.
3281 (patch-makefile-SHELL "make.tmpl")
3284 #:configure-flags (list (string-append "--sysconfdir="
3285 (assoc-ref %outputs "out")
3287 "--enable-udev_sync"
3288 "--enable-udev_rules"
3289 "--enable-pkgconfig"
3291 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3293 ;; Make sure programs such as 'dmsetup' can
3294 ;; find libdevmapper.so.
3295 (string-append "LDFLAGS=-Wl,-rpath="
3296 (assoc-ref %outputs "out")
3298 (assoc-ref %outputs "out")
3299 "/lib/device-mapper")
3300 ;; This is needed when cross-compiling.
3301 ,@(if (%current-target-system)
3302 '("ac_cv_func_malloc_0_nonnull=yes"
3303 "ac_cv_func_realloc_0_nonnull=yes")
3306 ;; The tests use 'mknod', which requires root access.
3308 (supported-systems (delete "i586-gnu" %supported-systems))
3309 (home-page "https://sourceware.org/lvm2/")
3310 (synopsis "Logical volume management for Linux")
3312 "LVM2 is the logical volume management tool set for Linux-based systems.
3313 This package includes the user-space libraries and tools, including the device
3314 mapper. Kernel components are part of Linux-libre.")
3316 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3317 ;; Command-line tools are GPLv2.
3318 (license (list license:gpl2 license:lgpl2.1))))
3320 (define-public lvm2-static
3323 (name "lvm2-static")
3325 ;; Propagate udev because libdevmapper.a depends on libudev.
3326 (propagated-inputs `(("udev:static" ,eudev "static")))
3329 (substitute-keyword-arguments (package-arguments lvm2)
3330 ((#:configure-flags flags '())
3331 ;; LVM2 doesn't use Libtool, hence the custom option.
3332 `(append '("--enable-static_link")
3333 ;; Building dmeventd statically is complicated due to a
3334 ;; requirement on libdevmapper.a, which is being phased out
3335 ;; in favor of libdevice-mapper.a, which in turn is is not
3336 ;; easily made available at dmeventd build time. Just ignore
3337 ;; it until the situation improves.
3338 (delete "--enable-dmeventd" ,flags)))
3340 `(modify-phases ,phases
3341 (add-before 'configure 'adjust-Makefile
3343 ;; These fixes are related to the upstream libdm->device_mapper
3344 ;; migration and will hopefully be fixed upstream in due time.
3345 (substitute* "tools/Makefile.in"
3346 ;; This variable is empty in a static configuration and causes
3347 ;; an erroneous GCC command line.
3348 (("-L\\$\\(interfacebuilddir\\)") "")
3349 ;; Remove obsolete reference to libdevmapper.a.
3350 (("-ldevmapper") ""))
3352 (synopsis "Logical volume management for Linux (statically linked)")))
3354 (define-public wireless-tools
3356 (name "wireless-tools")
3360 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3364 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3367 ;; Remove the older header files that are not free software.
3368 (for-each (lambda (n)
3369 (delete-file (format #f "wireless.~a.h" n)))
3370 '(10 11 12 13 14 15 16 17 18 19 20))
3372 (build-system gnu-build-system)
3375 (list (string-append "PREFIX=" %output)
3376 (string-append "INSTALL_MAN=" %output "/share/man")
3377 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3380 (modify-phases %standard-phases
3382 (lambda* (#:key target #:allow-other-keys)
3383 (when ,(%current-target-system)
3384 ;; Cross-compilation: use the cross tools.
3385 (substitute* (find-files "." "Makefile")
3387 (string-append "CC = " target "-gcc\n"))
3389 (string-append "AR = " target "-ar\n"))
3391 (string-append "RANLIB = " target "-ranlib\n"))))
3394 (synopsis "Tools for manipulating Linux Wireless Extensions")
3395 (description "Wireless Tools are used to manipulate the now-deprecated
3396 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3397 Extension was an interface allowing you to set Wireless LAN specific
3398 parameters and get the specific stats. It is deprecated in favor the nl80211
3400 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3401 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3402 ;; other files are distributed under gpl2.
3403 (license (list license:gpl2 license:lgpl2.1+))))
3411 (uri (string-append "mirror://kernel.org/software/network/crda/"
3412 "crda-" version ".tar.xz"))
3415 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3416 (patches (search-patches "crda-optional-gcrypt.patch"))))
3417 (build-system gnu-build-system)
3419 `(#:phases (modify-phases %standard-phases
3421 (add-after 'unpack 'gzip-determinism
3423 (substitute* "Makefile"
3424 (("gzip") "gzip --no-name"))
3426 ,@(if (%current-target-system)
3428 'unpack 'fix-pkg-config
3429 (lambda* (#:key target #:allow-other-keys)
3433 (string-append target "-pkg-config")))
3437 'build 'no-werror-no-ldconfig
3439 (substitute* "Makefile"
3441 (("ldconfig") "true"))
3444 'build 'set-regulator-db-file-name
3445 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3446 ;; Tell CRDA where to find our database.
3447 (let ((regdb (assoc-ref (or native-inputs inputs)
3449 (substitute* "crda.c"
3450 (("\"/lib/crda/regulatory.bin\"")
3451 (string-append "\"" regdb
3452 "/lib/crda/regulatory.bin\"")))
3454 #:test-target "verify"
3455 #:make-flags (let ((out (assoc-ref %outputs "out"))
3456 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3458 (string-append "CC=" ,(cc-for-target))
3461 ;; Disable signature-checking on 'regulatory.bin'.
3462 ;; The reason is that this simplifies maintenance
3463 ;; on our side (no need to manage a distro key
3464 ;; pair), and we can guarantee integrity of
3465 ;; 'regulatory.bin' by other means anyway, such as
3466 ;; 'guix gc --verify'. See
3467 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3471 (string-append "PREFIX=" out)
3472 (string-append "SBINDIR=" out "/sbin/")
3473 (string-append "UDEV_RULE_DIR="
3474 out "/lib/udev/rules.d")
3475 (string-append "LDFLAGS=-Wl,-rpath="
3477 (string-append "REG_BIN=" regdb
3478 "/lib/crda/regulatory.bin")
3480 (native-inputs `(("pkg-config" ,pkg-config)
3481 ("wireless-regdb" ,wireless-regdb)))
3482 (inputs `(("libnl" ,libnl)))
3484 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3485 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3487 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3488 communication between the kernel Linux and user space for regulatory
3490 (license license:copyleft-next)))
3492 (define-public wireless-regdb
3494 (name "wireless-regdb")
3495 (version "2019.06.03")
3499 "mirror://kernel.org/software/network/wireless-regdb/"
3500 "wireless-regdb-" version ".tar.xz"))
3503 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
3505 ;; We're building 'regulatory.bin' by ourselves.
3507 (delete-file "regulatory.bin")
3509 (build-system gnu-build-system)
3512 (modify-phases %standard-phases
3513 (add-after 'unpack 'gzip-determinism
3515 (substitute* "Makefile"
3516 (("gzip") "gzip --no-name"))
3518 (add-after 'unpack 'omit-signature
3520 (substitute* "Makefile"
3521 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3522 ;; don't provide (see below). Disable it.
3523 ((" regulatory\\.db\\.p7s") "")
3524 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3525 ;; but ‘make install’ depends only on the latter while installing
3526 ;; both (and failing). Depend on it explicitly.
3527 (("^install: " all) (string-append all "regulatory.db ")))
3529 (delete 'configure)) ; no configure script
3531 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3532 ;; is computed and can be equal to 'maintainer-clean'; when that
3533 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3534 ;; just built. Thus, build things sequentially.
3535 #:parallel-build? #f
3537 #:tests? #f ; no tests
3539 (let ((out (assoc-ref %outputs "out")))
3540 (list (string-append "PREFIX=" out)
3541 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3543 ;; Leave this empty so that db2bin.py doesn't try to sign
3544 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3545 ;; pair for the whole distribution.
3546 (string-append "REGDB_PRIVKEY=")
3547 ;; Don't generate a public key for the same reason. These are
3548 ;; used as Makefile targets and can't be the empty string.
3549 (string-append "REGDB_PUBCERT=/dev/null")
3550 (string-append "REGDB_PUBKEY=/dev/null")))))
3552 `(("python" ,python-wrapper)))
3554 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3555 (synopsis "Wireless regulatory database")
3557 "This package contains the wireless regulatory database Central
3558 Regulatory Database Agent (CRDA) daemon. The database contains information on
3559 country-specific regulations for the wireless spectrum.")
3560 (license license:isc)))
3562 (define-public lm-sensors
3570 (url "https://github.com/groeck/lm-sensors.git")
3571 (commit (string-append "V" (string-join
3572 (string-split version #\.) "-")))))
3573 (file-name (git-file-name name version))
3575 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3576 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3577 (build-system gnu-build-system)
3578 (inputs `(("rrdtool" ,rrdtool)
3581 ("gnuplot" ,gnuplot)))
3582 (native-inputs `(("pkg-config" ,pkg-config)
3586 (outputs '("lib" ; avoid perl in closure
3589 `(#:tests? #f ; no 'check' target
3590 #:make-flags (list (string-append "PREFIX=" %output)
3591 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3592 (string-append "INCLUDEDIR="
3593 (assoc-ref %outputs "lib") "/include")
3594 (string-append "MANDIR=" %output "/share/man")
3595 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3597 (modify-phases %standard-phases
3599 (add-before 'build 'patch-exec-paths
3600 (lambda* (#:key inputs outputs #:allow-other-keys)
3601 (substitute* "prog/detect/sensors-detect"
3603 (string-append "`" (assoc-ref inputs "coreutils")
3605 (("(`|\")modprobe" all open-quote)
3606 (string-append open-quote
3607 (assoc-ref inputs "kmod")
3609 (substitute* '("prog/pwm/pwmconfig"
3610 "prog/pwm/fancontrol")
3612 (string-append (assoc-ref inputs "gnuplot")
3615 (string-append (assoc-ref inputs "coreutils")
3618 (string-append (assoc-ref inputs "grep")
3621 (string-append (assoc-ref inputs "sed")
3624 (string-append (assoc-ref inputs "coreutils")
3627 (string-append (assoc-ref inputs "coreutils")
3630 (string-append (assoc-ref inputs "coreutils")
3631 "/bin/readlink -f")))
3633 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3634 (synopsis "Utilities to read temperature/voltage/fan sensors")
3636 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3637 you to access information from temperature, voltage, and fan speed sensors.
3638 It works with most newer systems.")
3639 (license license:gpl2+)))
3641 (define-public iucode-tool
3643 (name "iucode-tool")
3647 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3648 "/raw/latest/iucode-tool_" version ".tar.xz"))
3651 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3652 (build-system gnu-build-system)
3653 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3654 (synopsis "Manipulate Intel microcode bundles")
3656 "@command{iucode_tool} is a utility to work with microcode packages for
3657 Intel processors. It can convert between formats, extract specific versions,
3658 create a firmware image suitable for the Linux kernel, and more.")
3659 ;; cpuid.h is available for i686, x86_64, and ia64.
3660 (supported-systems '("i686-linux" "x86_64-linux"))
3661 (license license:gpl2+)))
3663 (define-public i2c-tools
3670 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3671 version ".tar.bz2"))
3674 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3675 (build-system gnu-build-system)
3677 `(#:tests? #f ; no 'check' target
3678 #:make-flags (list (string-append "prefix=" %output)
3679 ,(string-append "CC=" (cc-for-target)))
3680 ;; No configure script.
3681 #:phases (modify-phases %standard-phases (delete 'configure))))
3684 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3685 (synopsis "I2C tools for Linux")
3687 "The i2c-tools package contains a heterogeneous set of I2C tools for
3688 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3689 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3691 (license license:gpl2+)))
3693 (define-public xsensors
3700 "http://www.linuxhardware.org/xsensors/xsensors-"
3704 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3705 (build-system gnu-build-system)
3706 (inputs `(("lm-sensors" ,lm-sensors "lib")
3708 (native-inputs `(("pkg-config" ,pkg-config)))
3711 (modify-phases %standard-phases
3712 (add-before 'configure 'enable-deprecated
3714 (substitute* "src/Makefile.in"
3715 (("-DGDK_DISABLE_DEPRECATED") "")
3716 (("-DGTK_DISABLE_DEPRECATED") ""))
3718 (add-before 'configure 'remove-Werror
3720 (substitute* '("configure" "src/Makefile.in")
3723 (home-page "http://www.linuxhardware.org/xsensors/")
3724 (synopsis "Hardware health information viewer")
3726 "Xsensors reads data from the libsensors library regarding hardware
3727 health such as temperature, voltage and fan speed and displays the information
3728 in a digital read-out.")
3729 (license license:gpl2+)))
3734 (version (package-version linux-libre))
3735 (source (package-source linux-libre))
3736 (build-system gnu-build-system)
3739 (modify-phases %standard-phases
3741 (lambda* (#:key inputs #:allow-other-keys)
3742 (setenv "SHELL_PATH" (which "bash"))
3743 (chdir "tools/perf")
3745 #:make-flags (list (string-append "prefix="
3746 (assoc-ref %outputs "out"))
3750 ;; By default, 'config/Makefile' uses lib64 on
3751 ;; x86_64. Work around that.
3753 #:tests? #f)) ;no tests
3755 `(("pkg-config" ,pkg-config)
3759 ;; There are build scripts written in these languages.
3761 ("python" ,python-2)))
3763 `(("slang" ,slang) ;for the interactive TUI
3765 ("python" ,python-2) ;'perf' links against libpython
3766 ("elfutils" ,elfutils)
3767 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3768 ("libunwind" ,libunwind) ;better stack walking
3769 ("numactl" ,numactl) ;for 'perf bench numa mem'
3772 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3773 ("docbook-xsl" ,docbook-xsl)
3775 ("asciidoc" ,asciidoc)))
3776 (home-page "https://perf.wiki.kernel.org/")
3777 (synopsis "Linux profiling with performance counters")
3779 "perf is a tool suite for profiling using hardware performance counters,
3780 with support in the Linux kernel. perf can instrument CPU performance
3781 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3782 of lightweight profiling. This package contains the user-land tools and in
3783 particular the @code{perf} command.")
3784 (license (package-license linux-libre))))
3786 (define-public pflask
3793 (url "https://github.com/ghedo/pflask")
3794 (commit (string-append "v" version))))
3795 (file-name (git-file-name name version))
3798 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
3799 (build-system cmake-build-system)
3801 '(#:tests? #f)) ; no tests
3802 (home-page "https://ghedo.github.io/pflask/")
3803 (synopsis "Simple tool for creating Linux namespace containers")
3804 (description "pflask is a simple tool for creating Linux namespace
3805 containers. It can be used for running a command or even booting an OS inside
3806 an isolated container, created with the help of Linux namespaces. It is
3807 similar in functionality to chroot, although pflask provides better isolation
3808 thanks to the use of namespaces.")
3809 (license license:bsd-2)))
3811 (define-public singularity
3813 (name "singularity")
3817 (uri (string-append "https://github.com/singularityware/singularity/"
3818 "releases/download/" version
3819 "/singularity-" version ".tar.gz"))
3822 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3823 (modules '((guix build utils)))
3826 ;; Do not create directories in /var.
3827 (substitute* "Makefile.in"
3828 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3830 ;; The original source overrides PATH so that it points to
3831 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3832 ;; on Guix System. Leave PATH unchanged so we refer to the
3833 ;; installed Coreutils, grep, etc.
3834 (substitute* "bin/singularity.in"
3836 (string-append "#" all "\n")))
3838 (substitute* (find-files "libexec/cli" "\\.exec$")
3839 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3841 (string-append "/run/setuid-programs/singularity-"
3842 program "-helper")))
3844 ;; These squashfs mount options are apparently no longer
3845 ;; supported since Linux-libre 5.4.5.
3846 (substitute* "src/lib/image/squashfs/mount.c"
3847 (("\"errors=remount-ro\"")
3850 (build-system gnu-build-system)
3852 `(#:configure-flags '("--localstatedir=/var")
3854 (modify-phases %standard-phases
3855 (add-after 'unpack 'patch-reference-to-squashfs-tools
3857 (substitute* "libexec/cli/build.exec"
3858 (("if ! singularity_which mksquashfs") "if 0")
3859 (("if ! mksquashfs")
3860 (string-append "if ! " (which "mksquashfs"))))
3862 (add-after 'install 'set-PATH
3863 (lambda* (#:key inputs outputs #:allow-other-keys)
3864 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
3865 (let ((out (assoc-ref outputs "out"))
3866 (coreutils (assoc-ref inputs "coreutils")))
3867 (wrap-program (string-append out "/bin/singularity")
3868 `("PATH" ":" = (,(string-append coreutils "/bin"))))
3869 (substitute* (string-append out "/bin/run-singularity")
3870 (("/usr/bin/env singularity")
3871 (string-append (which "env") " "
3872 out "/bin/singularity")))
3875 `(("libarchive" ,libarchive)
3876 ("python" ,python-wrapper)
3878 ("squashfs-tools" ,squashfs-tools)))
3879 (home-page "https://singularity.lbl.gov/")
3880 (synopsis "Container platform")
3881 (description "Singularity is a container platform supporting a number of
3882 container image formats. It can build SquashFS container images or import
3883 existing Docker images. Singularity requires kernel support for container
3884 isolation or root privileges.")
3885 (license license:bsd-3)))
3887 (define-public hdparm
3893 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3894 "hdparm-" version ".tar.gz"))
3897 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3898 (build-system gnu-build-system)
3901 (let ((out (assoc-ref %outputs "out")))
3902 (list (string-append "binprefix=" out)
3903 (string-append "manprefix=" out)
3904 ,(string-append "CC=" (cc-for-target))
3905 ;; Let Guix strip the binaries and not break cross-compilation.
3908 (modify-phases %standard-phases
3909 (delete 'configure)) ; no configure script
3910 #:tests? #f)) ; no test suite
3911 (home-page "https://sourceforge.net/projects/hdparm/")
3912 (synopsis "View and tune ATA disk drive parameters")
3914 "@command{hdparm} is a command-line utility to control ATA controllers and
3915 disk drives. It can increase performance and/or reliability by careful tuning
3916 of hardware settings like power and acoustic management, DMA modes, and caching.
3917 It can also display detailed device information, or be used as a simple
3918 performance benchmarking tool.
3920 @command{hdparm} provides a command line interface to various Linux kernel
3921 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3922 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3923 Translation (@dfn{SAT}) are also supported.")
3924 (license (license:non-copyleft "file://LICENSE.TXT"))))
3926 (define-public nvme-cli
3930 (home-page "https://github.com/linux-nvme/nvme-cli")
3935 (commit (string-append "v" version))))
3937 (base32 "0ldky34sn0m5c4hgiip0fkzm465nca69bhxicpd5dg8wxhzxqrp3"))
3938 (file-name (git-file-name name version))))
3939 (build-system gnu-build-system)
3942 (list ,(string-append "CC=" (cc-for-target)))
3943 #:phases (modify-phases %standard-phases
3944 (delete 'configure) ; no ./configure script
3947 (invoke "make" "install-spec" "PREFIX="
3948 (string-append "DESTDIR=" %output)))))
3949 ;; The tests require sysfs, which is not accessible from from the build
3952 (synopsis "NVM-Express user space tooling for Linux")
3953 (description "Nvme-cli is a utility to provide standards compliant tooling
3954 for NVM-Express drives. It was made specifically for Linux as it relies on the
3955 IOCTLs defined by the mainline kernel driver.")
3956 (license license:gpl2+)))
3958 (define-public rfkill
3964 (uri (string-append "mirror://kernel.org/software/network/"
3965 name "/" name "-" version ".tar.xz"))
3968 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3969 (build-system gnu-build-system)
3971 `(#:make-flags (list "CC=gcc"
3972 (string-append "PREFIX=" %output))
3973 #:phases (modify-phases %standard-phases
3974 (delete 'configure))
3976 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3977 (synopsis "Tool for enabling and disabling wireless devices")
3979 "rfkill is a simple tool for accessing the rfkill device interface,
3980 which is used to enable and disable wireless networking devices, typically
3981 WLAN, Bluetooth and mobile broadband.")
3982 (license (license:non-copyleft "file://COPYING"
3983 "See COPYING in the distribution."))
3984 ;; rfkill is part of util-linux as of 2.31.
3985 (properties `((superseded . ,util-linux)))))
3993 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3994 version "/" name "-" version ".tar.gz"))
3997 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3998 (build-system gnu-build-system)
3999 (home-page "http://acpiclient.sourceforge.net")
4000 (synopsis "Display information on ACPI devices")
4001 (description "@code{acpi} attempts to replicate the functionality of the
4002 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4003 information. It does not support ACPI suspending, only displays information
4004 about ACPI devices.")
4005 (license license:gpl2+)))
4007 (define-public acpid
4013 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4017 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4018 (build-system gnu-build-system)
4019 (home-page "https://sourceforge.net/projects/acpid2/")
4020 (synopsis "Daemon for delivering ACPI events to user-space programs")
4022 "acpid is designed to notify user-space programs of Advanced
4023 Configuration and Power Interface (ACPI) events. acpid should be started
4024 during the system boot, and will run as a background process. When an ACPI
4025 event is received from the kernel, acpid will examine the list of rules
4026 specified in /etc/acpi/events and execute the rules that match the event.")
4027 (license license:gpl2+)))
4029 (define-public sysfsutils
4038 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4041 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4042 (build-system gnu-build-system)
4043 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4044 (synopsis "System utilities based on Linux sysfs")
4046 "These are a set of utilities built upon sysfs, a virtual file system in
4047 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4048 also contains the libsysfs library.")
4049 ;; The library is under lgpl2.1+ (all files say "or any later version").
4050 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4051 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4053 (define-public sysfsutils-1
4055 (inherit sysfsutils)
4062 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4063 "/sysfsutils-" version ".tar.gz"))
4065 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4066 (modules '((guix build utils)))
4069 (substitute* "Makefile.in"
4070 (("includedir = /usr/include/sysfs")
4071 "includedir = @includedir@"))
4072 (substitute* "configure"
4073 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4074 (string-append "includedir='" orig "/sysfs'")))
4076 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4078 (define-public cpufrequtils
4080 (name "cpufrequtils")
4085 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4086 "cpufrequtils-" version ".tar.gz"))
4088 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4089 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4090 (build-system gnu-build-system)
4092 `(("sysfsutils" ,sysfsutils-1)))
4094 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4095 (assoc-ref %outputs "out") "/lib"))))
4096 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4097 (synopsis "Utilities to get and set CPU frequency on Linux")
4099 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4100 information, and set the CPU frequency if supported, using the cpufreq
4101 capabilities of the Linux kernel.")
4102 (license license:gpl2)))
4104 (define-public libraw1394
4111 "mirror://kernel.org/linux/libs/ieee1394/"
4112 name "-" version ".tar.xz"))
4115 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4116 (build-system gnu-build-system)
4117 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4118 (synopsis "Interface library for the Linux IEEE1394 drivers")
4120 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4121 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4122 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4123 send to and receive from other nodes without requiring a kernel driver for the
4124 protocol in question.")
4125 (license license:lgpl2.1+)))
4127 (define-public libavc1394
4133 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4134 name "-" version ".tar.gz"))
4137 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4138 (build-system gnu-build-system)
4140 `(("pkg-config" ,pkg-config)))
4142 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4143 (home-page "https://sourceforge.net/projects/libavc1394/")
4144 (synopsis "AV/C protocol library for IEEE 1394")
4146 "Libavc1394 is a programming interface to the AV/C specification from
4147 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4148 (license license:lgpl2.1+)))
4150 (define-public libiec61883
4152 (name "libiec61883")
4157 "mirror://kernel.org/linux/libs/ieee1394/"
4158 name "-" version ".tar.xz"))
4161 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4162 (build-system gnu-build-system)
4164 `(("pkg-config" ,pkg-config)))
4166 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4167 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4168 (synopsis "Isochronous streaming media library for IEEE 1394")
4170 "The libiec61883 library provides a higher level API for streaming DV,
4171 MPEG-2 and audio over Linux IEEE 1394.")
4172 (license license:lgpl2.1+)))
4174 (define-public mdadm
4181 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4185 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4186 (build-system gnu-build-system)
4190 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4191 (list ,(string-append "CC=" (cc-for-target))
4194 ;; TODO: tell it where to find 'sendmail'
4195 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4196 (string-append "BINDIR=" out "/sbin")
4197 (string-append "MANDIR=" out "/share/man")
4198 (string-append "UDEVDIR=" out "/lib/udev")))
4200 (modify-phases %standard-phases
4201 (add-before 'build 'patch-program-paths
4202 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4203 (let ((coreutils (assoc-ref (or native-inputs inputs)
4205 (substitute* "udev-md-raid-arrays.rules"
4206 (("/usr/bin/(readlink|basename)" all program)
4207 (string-append coreutils "/bin/" program))))
4209 (add-before 'build 'remove-W-error
4211 ;; We cannot build with -Werror on i686 due to a
4212 ;; 'sign-compare' warning in util.c.
4213 (substitute* "Makefile"
4216 (delete 'configure))
4217 ;;tests must be done as root
4219 (supported-systems (delete "i586-gnu" %supported-systems))
4220 (home-page "http://neil.brown.name/blog/mdadm")
4221 (synopsis "Tool for managing Linux Software RAID arrays")
4223 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4224 assemble, report on, and monitor arrays. It can also move spares between raid
4225 arrays when needed.")
4226 (license license:gpl2+)))
4228 (define-public mdadm-static
4231 (name "mdadm-static")
4233 (substitute-keyword-arguments (package-arguments mdadm)
4234 ((#:make-flags flags)
4235 `(cons "LDFLAGS = -static" ,flags))
4237 `(modify-phases ,phases
4238 (add-after 'install 'remove-cruft
4239 (lambda* (#:key outputs #:allow-other-keys)
4240 (let* ((out (assoc-ref outputs "out"))
4241 (precious? (lambda (file)
4242 (member file '("." ".." "sbin"))))
4243 (directories (scandir out (negate precious?))))
4244 (with-directory-excursion out
4245 (for-each delete-file-recursively directories)
4246 (remove-store-references "sbin/mdadm")
4247 (delete-file "sbin/mdmon")
4249 ((#:modules modules %gnu-build-system-modules)
4250 `((ice-9 ftw) ,@modules))
4251 ((#:strip-flags _ '())
4252 ''("--strip-all")) ;strip a few extra KiB
4253 ((#:allowed-references _ '("out"))
4254 '("out")))) ;refer only self
4255 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4257 (define-public multipath-tools
4259 (name "multipath-tools")
4264 (url "https://git.opensvc.com/multipath-tools/.git")
4266 (file-name (git-file-name name version))
4269 "14n8pcgnliicqxzc40xvjxk4cafm4qx7a3rsx5qva74r3ydzx8rn"))
4270 (patches (search-patches "multipath-tools-sans-systemd.patch"))
4271 (modules '((guix build utils)))
4274 ;; Drop bundled valgrind headers.
4275 (delete-file-recursively "third-party")
4276 (substitute* '("multipathd/main.c"
4277 "libmultipath/debug.c")
4278 (("#include \"../third-party/")
4281 (build-system gnu-build-system)
4283 '(#:test-target "test"
4284 #:parallel-build? #f ;XXX: broken in 0.8.4
4285 #:make-flags (list "CC=gcc"
4286 (string-append "DESTDIR="
4287 (assoc-ref %outputs "out"))
4288 ;; Install Udev rules below this directory, relative
4291 (string-append "LDFLAGS=-Wl,-rpath="
4292 (assoc-ref %outputs "out")
4295 (modify-phases %standard-phases
4296 (add-after 'unpack 'patch-source
4297 (lambda* (#:key inputs #:allow-other-keys)
4298 (let ((lvm2 (assoc-ref inputs "lvm2"))
4299 (udev (assoc-ref inputs "udev")))
4300 (substitute* "Makefile.inc"
4301 (("\\$\\(prefix\\)/usr") "$(prefix)")
4302 ;; Do not save timestamp to avoid gzip "timestamp
4303 ;; out-of-range" warnings.
4304 (("gzip -9") "gzip -9n"))
4305 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4306 (("/usr/include/libdevmapper.h")
4307 (string-append lvm2 "/include/libdevmapper.h"))
4308 (("/usr/include/libudev.h")
4309 (string-append udev "/include/libudev.h")))
4311 (add-after 'unpack 'fix-maybe-uninitialized-variable
4313 ;; This variable gets initialized later if needed, but GCC 7
4314 ;; fails to notice. Should be fixed for > 0.8.4.
4315 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4316 (substitute* "libmultipath/structs_vec.c"
4317 (("bool is_queueing;")
4318 "bool is_queueing = false;"))
4320 (add-after 'unpack 'fix-linking-tests
4322 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4323 ;; for versions > 0.8.4.
4324 (substitute* "tests/Makefile"
4325 (("-lmultipath -lcmocka")
4326 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4328 (delete 'configure)))) ; no configure script
4331 ("pkg-config" ,pkg-config)
4332 ("valgrind" ,valgrind)
4335 ("cmocka" ,cmocka)))
4337 `(("json-c" ,json-c-0.13)
4339 ("liburcu" ,liburcu)
4341 ("readline" ,readline)
4343 (home-page "http://christophe.varoqui.free.fr/")
4344 (synopsis "Access block devices through multiple paths")
4346 "This package provides the following binaries to drive the
4347 Linux Device Mapper multipathing driver:
4349 @item @command{multipath} - Device mapper target autoconfig.
4350 @item @command{multipathd} - Multipath daemon.
4351 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4352 @code{dm} multipath devices.
4353 @item @command{kpartx} - Create device maps from partition tables.
4355 (license (list license:gpl2+ ; main distribution
4356 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4358 (define-public libaio
4365 (string-append "https://releases.pagure.org/libaio/"
4366 name "-" version ".tar.gz")))
4369 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4370 (build-system gnu-build-system)
4373 (let ((target ,(%current-target-system)))
4374 (list (string-append "prefix=" %output)
4377 (string-append (assoc-ref %build-inputs "cross-gcc")
4378 "/bin/" target "-gcc")
4380 #:test-target "partcheck" ; need root for a full 'check'
4382 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4383 (home-page "https://pagure.io/libaio")
4384 (synopsis "Linux-native asynchronous I/O access library")
4386 "This library enables userspace to use Linux kernel asynchronous I/O
4387 system calls, important for the performance of databases and other advanced
4389 (license license:lgpl2.1+)))
4391 (define-public blktrace
4392 ;; Take a newer commit to get the fix for CVE-2018-10689.
4393 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4397 (version (git-version "1.2.0" revision commit))
4399 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4406 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4407 (file-name (git-file-name name version))))
4408 (build-system gnu-build-system)
4411 (list ,(string-append "CC=" (cc-for-target))
4412 (string-append "prefix=" %output))
4413 #:tests? #f ; no tests
4415 (modify-phases %standard-phases
4416 (delete 'configure) ; no configure script
4417 (add-after 'unpack 'fix-gnuplot-path
4418 (lambda* (#:key inputs #:allow-other-keys)
4419 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4420 (substitute* "btt/bno_plot.py"
4422 (string-append gnuplot "/bin/gnuplot %s")))
4425 `(("libaio" ,libaio)
4426 ("gnuplot" ,gnuplot)
4427 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4428 (synopsis "Block layer IO tracing mechanism")
4429 (description "Blktrace is a block layer IO tracing mechanism which provides
4430 detailed information about request queue operations to user space. It extracts
4431 event traces from the kernel (via the relaying through the debug file system).")
4432 (license license:gpl2))))
4440 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4444 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4445 (build-system gnu-build-system)
4447 `(("libsndfile" ,libsndfile)))
4449 `(("pkg-config" ,pkg-config)))
4450 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4451 (synopsis "Bluetooth subband audio codec")
4453 "The SBC is a digital audio encoder and decoder used to transfer data to
4454 Bluetooth audio output devices like headphones or loudspeakers.")
4455 (license license:gpl2+)))
4457 (define-public bluez
4464 "mirror://kernel.org/linux/bluetooth/bluez-"
4468 "1p2ncvjz6alr9n3l5wvq2arqgc7xjs6dqyar1l9jp0z8cfgapkb8"))))
4469 (build-system gnu-build-system)
4472 (let ((out (assoc-ref %outputs "out")))
4473 (list "--sysconfdir=/etc"
4474 "--localstatedir=/var"
4477 ;; Install dbus/udev files to the correct location.
4478 (string-append "--with-dbusconfdir=" out "/etc")
4479 (string-append "--with-udevdir=" out "/lib/udev")))
4481 (modify-phases %standard-phases
4482 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4483 ;; issue (discussion on upstream mailing list:
4484 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4485 (add-before 'check 'skip-wonky-test
4487 (substitute* "unit/test-gatt.c"
4488 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4490 (add-after 'install 'post-install
4491 (lambda* (#:key inputs outputs #:allow-other-keys)
4492 (let* ((out (assoc-ref outputs "out"))
4493 (servicedir (string-append out "/share/dbus-1/services"))
4494 (service "obexd/src/org.bluez.obex.service")
4495 (rule (string-append
4496 out "/lib/udev/rules.d/97-hid2hci.rules")))
4497 ;; Install the obex dbus service file.
4498 (substitute* service
4500 (string-append out "/libexec/bluetooth/obexd")))
4501 (install-file service servicedir)
4502 ;; Fix paths in the udev rule.
4504 (("hid2hci --method")
4505 (string-append out "/lib/udev/hid2hci --method"))
4507 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4510 `(("pkg-config" ,pkg-config)
4511 ("gettext" ,gettext-minimal)))
4516 ("libical" ,libical)
4517 ("readline" ,readline)))
4518 (home-page "http://www.bluez.org/")
4519 (synopsis "Linux Bluetooth protocol stack")
4521 "BlueZ provides support for the core Bluetooth layers and protocols. It
4522 is flexible, efficient and uses a modular implementation.")
4523 (license license:gpl2+)))
4525 (define-public fuse-exfat
4532 "https://github.com/relan/exfat/releases/download/v"
4533 version "/" name "-" version ".tar.gz"))
4536 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4537 (build-system gnu-build-system)
4539 `(("pkg-config" ,pkg-config)))
4542 (home-page "https://github.com/relan/exfat")
4543 (synopsis "Mount exFAT file systems")
4545 "This package provides a FUSE-based file system that provides read and
4546 write access to exFAT devices.")
4547 (license license:gpl2+)))
4549 (define-public fuseiso
4552 (version "20070708")
4555 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4556 version "/fuseiso-" version ".tar.bz2"))
4559 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4560 (build-system gnu-build-system)
4562 `(("pkg-config" ,pkg-config)))
4567 (home-page "https://sourceforge.net/projects/fuseiso/")
4568 (synopsis "Mount ISO file system images")
4570 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4571 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4572 Ridge, Joliet, and zisofs.")
4573 (license license:gpl2)))
4582 "https://www.nico.schottelius.org/software/gpm/archives/"
4583 "gpm-" version ".tar.bz2"))
4584 (patches (search-patches "gpm-glibc-2.26.patch"))
4587 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4588 (build-system gnu-build-system)
4590 '(#:phases (modify-phases %standard-phases
4593 ;; The tarball was not generated with 'make dist' so we
4594 ;; need to bootstrap things ourselves.
4595 (substitute* "autogen.sh"
4596 (("/bin/sh") (which "sh")))
4597 (invoke "./autogen.sh")
4598 (patch-makefile-SHELL "Makefile.include.in")
4601 ;; Make sure programs find libgpm.so.
4602 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4603 (assoc-ref %outputs "out")
4606 `(("texinfo" ,texinfo)
4609 ("autoconf" ,autoconf)
4610 ("automake" ,automake)
4611 ("libtool" ,libtool)))
4612 (home-page "https://www.nico.schottelius.org/software/gpm/")
4613 (synopsis "Mouse support for the Linux console")
4615 "The GPM (general-purpose mouse) daemon is a mouse server for
4616 applications running on the Linux console. It allows users to select items
4617 and copy/paste text in the console and in xterm.")
4618 (license license:gpl2+)))
4620 (define-public btrfs-progs
4622 (name "btrfs-progs")
4626 (uri (string-append "mirror://kernel.org/linux/kernel/"
4627 "people/kdave/btrfs-progs/"
4628 "btrfs-progs-v" version ".tar.xz"))
4631 "0srg276yccfmqz0skmmga3vbqx4wiqsk1l6h86n6ryhxa9viqcm1"))))
4632 (build-system gnu-build-system)
4634 "static")) ; static versions of the binaries in "out"
4636 '(#:phases (modify-phases %standard-phases
4637 (add-after 'unpack 'patch-makefile
4638 (lambda* (#:key outputs #:allow-other-keys)
4639 (substitute* "Makefile"
4640 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4641 (string-append (assoc-ref outputs "out")
4642 "/lib/udev/rules.d")))
4644 (add-after 'build 'build-static
4645 (lambda _ (invoke "make" "static")))
4646 (add-after 'install 'install-bash-completion
4647 (lambda* (#:key outputs #:allow-other-keys)
4648 (let* ((out (assoc-ref outputs "out"))
4649 (bashcomp (string-append out "/etc/bash_completion.d")))
4651 (copy-file "btrfs-completion"
4652 (string-append bashcomp "/btrfs"))
4654 (add-after 'install 'install-static
4655 (let ((staticbin (string-append (assoc-ref %outputs "static")
4659 (string-append "bindir=" staticbin)
4660 "install-static")))))
4661 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4662 #:test-target "test"
4663 #:parallel-tests? #f)) ; tests fail when run in parallel
4664 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4666 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
4667 ("util-linux:static" ,util-linux "static") ;ditto
4669 ("zlib:static" ,zlib "static")
4670 ("zstd" ,zstd "lib")
4671 ("zstd:static" ,zstd "static")))
4672 (native-inputs `(("pkg-config" ,pkg-config)
4673 ("asciidoc" ,asciidoc)
4676 ;; For building documentation.
4677 ("libxml2" ,libxml2)
4678 ("docbook-xsl" ,docbook-xsl)
4684 ;; The tests need 'grep' with perl regexp support.
4686 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4687 (synopsis "Create and manage btrfs copy-on-write file systems")
4688 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4689 aimed at implementing advanced features while focusing on fault tolerance,
4690 repair and easy administration.")
4691 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4692 ;; GPL2: Everything else.
4693 (license (list license:gpl2 license:gpl2+))))
4695 (define-public btrfs-progs/static
4697 (name "btrfs-progs-static")
4698 (version (package-version btrfs-progs))
4700 (build-system trivial-build-system)
4702 `(("btrfs-progs:static" ,btrfs-progs "static")))
4704 `(#:modules ((guix build utils))
4707 (use-modules (guix build utils)
4711 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4712 (out (assoc-ref %outputs "out"))
4713 (source (string-append btrfs "/bin/btrfs.static"))
4714 (target (string-append out "/bin/btrfs")))
4715 (mkdir-p (dirname target))
4716 (copy-file source target)
4717 (remove-store-references target)
4718 (chmod target #o555)
4720 (home-page (package-home-page btrfs-progs))
4721 (synopsis "Statically-linked btrfs command from btrfs-progs")
4722 (description "This package provides the statically-linked @command{btrfs}
4723 from the btrfs-progs package. It is meant to be used in initrds.")
4724 (license (package-license btrfs-progs))))
4726 (define-public cramfs-tools
4728 (name "cramfs-tools")
4729 (home-page "https://github.com/npitre/cramfs-tools")
4735 (commit (string-append "v" version))))
4737 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
4738 (file-name (git-file-name name version))))
4739 (build-system gnu-build-system)
4741 '(#:tests? #f ; No tests.
4743 (modify-phases %standard-phases
4746 (lambda* (#:key outputs #:allow-other-keys)
4747 (let ((out (assoc-ref outputs "out")))
4748 (install-file "mkcramfs" (string-append out "/sbin"))
4749 (install-file "cramfsck" (string-append out "/sbin")))
4753 (synopsis "Tools to manage Cramfs file systems")
4754 (description "Cramfs is a Linux file system designed to be simple, small,
4755 and to compress things well. It is used on a number of embedded systems and
4756 small devices. This version has additional features such as uncompressed
4757 blocks and random block placement.")
4758 (license license:gpl2+)))
4760 (define-public compsize
4764 (home-page "https://github.com/kilobyte/compsize")
4769 (commit (string-append "v" version))))
4771 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4772 (file-name (git-file-name name version))))
4773 (build-system gnu-build-system)
4775 `(("btrfs-progs" ,btrfs-progs)))
4777 `(#:tests? #f ; No tests.
4778 #:make-flags (list "CC=gcc")
4780 (modify-phases %standard-phases
4783 (lambda* (#:key outputs #:allow-other-keys)
4784 (let ((out (assoc-ref outputs "out")))
4785 (install-file "compsize" (string-append out "/bin"))
4786 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4787 (synopsis "Find compression type/ratio on Btrfs files")
4788 (description "@command{compsize} takes a list of files (given as
4789 arguments) on a Btrfs file system and measures used compression types and
4790 effective compression ratio, producing a report.
4792 A directory has no extents but has a (recursive) list of files. A non-regular
4793 file is silently ignored.
4795 As it makes no sense to talk about compression ratio of a partial extent,
4796 every referenced extent is counted whole, exactly once -- no matter if you use
4797 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4798 uncompressed size will not match the number given by @command{tar} or
4799 @command{du}. On the other hand, the space used should be accurate (although
4800 obviously it can be shared with files outside our set).")
4801 (license license:gpl2+)))
4803 (define-public f2fs-tools-1.7
4810 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4811 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4814 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4816 (build-system gnu-build-system)
4819 (modify-phases %standard-phases
4820 (add-after 'install 'install-headers
4821 (lambda* (#:key outputs #:allow-other-keys)
4822 (let* ((out (assoc-ref outputs "out"))
4823 (out-include (string-append out "/include")))
4824 (install-file "include/f2fs_fs.h" out-include)
4825 (install-file "mkfs/f2fs_format_utils.h" out-include)
4828 `(("autoconf" ,autoconf)
4829 ("automake" ,automake)
4830 ("libtool" ,libtool)
4831 ("pkg-config" ,pkg-config)))
4833 `(("libuuid" ,util-linux "lib")
4834 ("libselinux" ,libselinux)))
4835 (home-page "https://f2fs.wiki.kernel.org/")
4836 (synopsis "Userland tools for f2fs")
4838 "F2FS, the Flash-Friendly File System, is a modern file system
4839 designed to be fast and durable on flash devices such as solid-state
4840 disks and SD cards. This package provides the userland utilities.")
4841 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4842 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4843 (license (list license:gpl2 license:lgpl2.1))))
4845 (define-public f2fs-tools
4847 (inherit f2fs-tools-1.7)
4853 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4854 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4857 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4859 `(("libuuid" ,util-linux "lib")))))
4861 (define-public f2fs-tools/static
4864 (inherit f2fs-tools)
4865 (name "f2fs-tools-static")
4868 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
4869 (libuuid (assoc-ref %build-inputs "libuuid")))
4871 (string-append "libuuid_CFLAGS=-I" libuuid "/include")
4872 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
4873 (string-append "libblkid_CFLAGS=-I" libuuid "/include")
4874 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
4875 #:disallowed-references (,util-linux)
4877 (modify-phases %standard-phases ; TODO: f2fs phases.
4878 (add-after 'unpack 'make-static
4880 (define (append-to-file name body)
4881 (let ((file (open-file name "a")))
4884 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
4885 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
4886 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
4888 (add-after 'install 'remove-store-references
4889 (lambda* (#:key outputs #:allow-other-keys)
4890 ;; Work around bug in our util-linux.
4891 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
4892 (remove-store-references (string-append (assoc-ref outputs "out")
4896 `(("libuuid:static" ,util-linux "static")
4897 ("libuuid" ,util-linux "lib")))))) ; for include files
4899 (define-public f2fs-fsck/static
4901 (name "f2fs-fsck-static")
4902 (version (package-version f2fs-tools/static))
4904 (build-system trivial-build-system)
4906 `(#:modules ((guix build utils))
4909 (use-modules (guix build utils)
4912 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
4914 (out (assoc-ref %outputs "out"))
4915 (sbin (string-append out "/sbin")))
4917 (with-directory-excursion sbin
4918 (install-file (string-append f2fs-tools "/sbin/" fsck)
4920 (remove-store-references fsck)
4924 `(("f2fs-tools-static" ,f2fs-tools/static)))
4925 (home-page (package-home-page f2fs-tools/static))
4926 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
4927 (description "This package provides statically-linked fsck.f2fs command taken
4928 from the f2fs-tools package. It is meant to be used in initrds.")
4929 (license (package-license f2fs-tools/static))))
4931 (define-public freefall
4934 (version (package-version linux-libre))
4935 (source (package-source linux-libre))
4936 (build-system gnu-build-system)
4938 '(#:phases (modify-phases %standard-phases
4939 (add-after 'unpack 'enter-subdirectory
4941 (chdir "tools/laptop/freefall")
4944 (add-before 'build 'increase-timeout
4946 ;; The default of 2 seconds is too low: it assumes an
4947 ;; open lid and AC power without actually checking.
4948 (substitute* "freefall.c"
4949 (("alarm\\(2\\)") "alarm(5)"))
4951 #:make-flags (list (string-append "PREFIX="
4952 (assoc-ref %outputs "out"))
4954 #:tests? #f)) ;no tests
4955 (home-page (package-home-page linux-libre))
4956 (synopsis "Free-fall protection for spinning laptop hard drives")
4958 "Prevents shock damage to the internal spinning hard drive(s) of some
4959 HP and Dell laptops. When sudden movement is detected, all input/output
4960 operations on the drive are suspended and its heads are parked on the ramp,
4961 where they are less likely to cause damage to the spinning disc. Requires a
4962 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4963 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4964 (license license:gpl2)))
4966 (define-public thinkfan
4974 (url "https://github.com/vmatare/thinkfan.git")
4976 (file-name (git-file-name name version))
4978 (base32 "0vmkpj575a1w52zx1jn6kdrk8rc9vp0f1bldi1bajicpgbs6rjd3"))))
4979 (build-system cmake-build-system)
4981 `(#:modules ((guix build cmake-build-system)
4984 #:tests? #f ; no test target
4986 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4987 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4989 `("-DUSE_ATASMART:BOOL=ON")
4991 (modify-phases %standard-phases
4992 (add-after 'unpack 'create-init-scripts
4993 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4994 ;; systemd to patch and install their service files. Fake their
4995 ;; presence rather than duplicating the build system below. Leave
4996 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4997 ;; The sysvinit needs manual patching, but since upstream doesn't
4998 ;; even provide the option to install it: don't.
4999 (lambda* (#:key outputs #:allow-other-keys)
5000 (let* ((out (assoc-ref outputs "out"))
5001 (share (string-append out "/share/" ,name)))
5002 (substitute* "CMakeLists.txt"
5003 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5004 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5005 ;; That was easy! Now we just need to fix the destinations.
5007 (string-append out directory)))
5010 `(("pkg-config" ,pkg-config)))
5012 `(("libatasmart" ,libatasmart)
5013 ("yaml-cpp" ,yaml-cpp)))
5014 (home-page "https://github.com/vmatare/thinkfan")
5015 (synopsis "Simple fan control program")
5017 "Thinkfan is a simple fan control program. It reads temperatures,
5018 checks them against configured limits and switches to appropriate (also
5019 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5020 other @code{hwmon} driver that enables temperature reading and fan control
5022 (license license:gpl3+)))
5024 (define-public tpacpi-bat
5032 (url "https://github.com/teleshoes/tpacpi-bat.git")
5033 (commit (string-append "v" version))))
5034 (file-name (git-file-name name version))
5036 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5037 (build-system gnu-build-system)
5039 `(#:tests? #f ; no test target
5041 (modify-phases %standard-phases
5042 (add-after 'unpack 'refer-to-inputs
5044 (substitute* "tpacpi-bat"
5046 (format #f "~a " (which "cat")))
5047 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5048 ;; loaded. That's the administrator's prerogative; disable it.
5049 (("system \"(modprobe .*)\"" _ match)
5050 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5052 (delete 'configure) ; nothing to configure
5053 (delete 'build) ; nothing to build
5055 (lambda* (#:key outputs #:allow-other-keys)
5056 (let* ((out (assoc-ref outputs "out"))
5057 (bin (string-append out "/bin"))
5058 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5059 (install-file "tpacpi-bat" bin)
5061 ;; There's no man page. Install other forms of documentation.
5062 (for-each (lambda (file)
5063 (let ((target (string-append doc "/" file)))
5064 (mkdir-p (dirname target))
5065 (copy-recursively file target)))
5066 (list "battery_asl" "examples" "README.md"))
5070 (home-page "https://github.com/teleshoes/tpacpi-bat")
5071 (synopsis "ThinkPad battery charge controller")
5073 "Tpacpi-bat is a command-line interface to control battery charging on
5074 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5075 ThinkPad models released after 2011}, starting with the xx20 series. It can
5076 query and set the thresholds at which one or both batteries will start and stop
5077 charging, inhibit charging batteries for a set period of time, or force them to
5078 discharge when they otherwise would not.
5080 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5081 kernel module provided by the @code{acpi-call-linux-module} package, which must
5082 be installed and loaded separately. Only the original vendor firmware is
5084 (license license:gpl3+)))
5086 (define-public ntfs-3g
5089 (version "2017.3.23")
5092 (uri (string-append "https://tuxera.com/opensource/"
5093 "ntfs-3g_ntfsprogs-" version ".tgz"))
5094 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5097 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5098 (modules '((guix build utils)))
5100 ;; Install under $prefix.
5101 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5105 (build-system gnu-build-system)
5106 (inputs `(("util-linux" ,util-linux)
5107 ("fuse" ,fuse))) ;libuuid
5108 (native-inputs `(("pkg-config" ,pkg-config)))
5110 '(#:configure-flags (list "--exec-prefix=${prefix}"
5111 "--with-fuse=external" ;use our own FUSE
5112 "--enable-mount-helper"
5113 "--enable-posix-acls"
5114 "--enable-xattr-mappings")
5116 (modify-phases %standard-phases
5117 ;; If users install ntfs-3g, they probably want to make it the
5118 ;; default driver as well, so we opt for sensible defaults and link
5119 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5120 ;; mount NTFS file systems.)
5121 (add-after 'install 'install-link
5122 (lambda* (#:key outputs #:allow-other-keys)
5123 (let* ((out (assoc-ref outputs "out"))
5124 (sbin (string-append out "/sbin")))
5125 (symlink "mount.ntfs-3g"
5126 (string-append sbin "/mount.ntfs")))
5128 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5129 (synopsis "Read-write access to NTFS file systems")
5131 "NTFS-3G provides read-write access to NTFS file systems, which are
5132 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5133 The package provides additional NTFS tools.")
5134 (license license:gpl2+)))
5136 (define-public rdma-core
5142 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5143 "/releases/download/v" version "/rdma-core-"
5147 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
5148 (build-system cmake-build-system)
5150 `(#:tests? #f ; no tests
5151 ;; Upstream uses the "ninja" build system and encourage distros
5152 ;; to do the same for consistency. They also recommend using the
5153 ;; "Release" build type.
5154 #:build-type "Release"
5155 #:configure-flags (list "-GNinja"
5157 (string-append "-DRST2MAN_EXECUTABLE="
5158 (assoc-ref %build-inputs
5162 ;; On some configurations, the
5163 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
5164 ;; used by default, would return ENODEV. To
5165 ;; avoid that, use 'write' instead of ioctls,
5166 ;; as suggested in 'CMakeList.txt'.
5167 "-DIOCTL_MODE=write")
5169 (modify-phases %standard-phases
5173 "-j" (number->string (parallel-job-count)))))
5176 (invoke "ninja" "install"))))))
5179 ("pkg-config" ,pkg-config)
5180 ("python" ,python-wrapper)
5181 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5185 (home-page "https://github.com/linux-rdma/rdma-core")
5186 (synopsis "Utilities and libraries for working with RDMA devices")
5188 "This package provides userspace components for the InfiniBand
5189 subsystem of the Linux kernel. Specifically it contains userspace
5190 libraries for the following device nodes:
5193 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5194 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5195 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5198 The following service daemons are also provided:
5200 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5201 @item @code{iwpmd} (for iWARP kernel providers)
5202 @item @code{ibacm} (for InfiniBand communication management assistant)
5204 ;; All library code is dual licensed under GPL2 and a custom MIT
5205 ;; variant. The package also includes some components covered by
5206 ;; other licenses. Consult COPYING.md for full details.
5209 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5210 license:bsd-2 ; Files referring to COPYING.BSD_FB
5211 license:cc0 ; most files in ccan/
5212 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5214 (define-public perftest
5221 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5222 version "/perftest-" version ".g0927198.tar.gz"))
5224 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5225 (build-system gnu-build-system)
5228 (modify-phases %standard-phases
5229 (add-after 'unpack 'patch-header-paths
5231 (substitute* '("src/raw_ethernet_fs_rate.c"
5232 "src/raw_ethernet_resources.c"
5233 "src/raw_ethernet_resources.h"
5234 "src/raw_ethernet_send_burst_lat.c"
5235 "src/raw_ethernet_send_bw.c"
5236 "src/raw_ethernet_send_lat.c")
5237 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5239 (inputs `(("rdma-core" ,rdma-core)))
5240 (home-page "https://github.com/linux-rdma/perftest/")
5241 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5242 (description "This is a collection of tests written over uverbs intended for
5243 use as a performance micro-benchmark. The tests may be used for hardware or
5244 software tuning as well as for functional testing.
5246 The collection contains a set of bandwidth and latency benchmark such as:
5248 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5249 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5250 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5251 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5252 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5254 (license license:gpl2)))
5256 (define-public rng-tools
5259 (home-page "https://github.com/nhorman/rng-tools")
5263 (uri (git-reference (url home-page)
5264 (commit (string-append "v" version))))
5265 (file-name (git-file-name name version))
5268 "0hbml37yxs0fs69g7f2x4ixq61z0029swy99rn7ykma9mi6b7ni9"))))
5269 (build-system gnu-build-system)
5271 `(;; Disable support for various hardware entropy sources as they need
5272 ;; dependencies that are not yet in Guix, and would significantly
5273 ;; increase closure size.
5274 #:configure-flags '("--without-nistbeacon"
5276 "--without-rtlsdr")))
5278 `(("autoconf" ,autoconf)
5279 ("automake" ,automake)
5280 ("pkg-config" ,pkg-config)))
5282 `(("libsysfs" ,sysfsutils)
5283 ("openssl" ,openssl)))
5284 (synopsis "Random number generator daemon")
5286 "Monitor a hardware random number generator, and supply entropy
5287 from that to the system kernel's @file{/dev/random} machinery.")
5288 ;; The source package is offered under the GPL2+, but the files
5289 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5290 (license (list license:gpl2 license:gpl2+))))
5292 (define-public cpupower
5295 (version (package-version linux-libre))
5296 (source (package-source linux-libre))
5297 (build-system gnu-build-system)
5299 '(#:phases (modify-phases %standard-phases
5300 (add-after 'unpack 'enter-subdirectory
5302 (chdir "tools/power/cpupower")
5305 (add-before 'build 'fix-makefiles
5307 (substitute* "Makefile"
5309 (("/bin/(install|pwd)" _ command) command))
5310 (substitute* "bench/Makefile"
5311 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5313 #:make-flags (let ((out (assoc-ref %outputs "out")))
5314 (list (string-append "DESTDIR=" out)
5315 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5317 "docdir=/share/doc/cpupower"
5318 "confdir=$(docdir)/examples"
5319 ;; The Makefile recommends the following changes
5321 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5322 #:tests? #f)) ;no tests
5323 (native-inputs `(("gettext" ,gettext-minimal)))
5324 (inputs `(("pciutils" ,pciutils)))
5325 (home-page (package-home-page linux-libre))
5326 (synopsis "CPU frequency and voltage scaling tools for Linux")
5328 "cpupower is a set of user-space tools that use the cpufreq feature of the
5329 Linux kernel to retrieve and control processor features related to power saving,
5330 such as frequency and voltage scaling.")
5331 (license license:gpl2)))
5333 (define-public x86-energy-perf-policy
5335 (name "x86-energy-perf-policy")
5336 (version (package-version linux-libre))
5337 (source (package-source linux-libre))
5338 (build-system gnu-build-system)
5342 (modify-phases %standard-phases
5343 (add-after 'unpack 'enter-subdirectory
5345 (chdir "tools/power/x86/x86_energy_perf_policy")
5348 (add-before 'build 'fix-makefile
5350 (substitute* "Makefile" (("/usr") ""))
5353 (let ((out (assoc-ref %outputs "out")))
5354 (list (string-append "DESTDIR=" out)
5355 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5356 (supported-systems '("i686-linux" "x86_64-linux"))
5357 (home-page (package-home-page linux-libre))
5358 (synopsis "Display and update Intel-CPU energy-performance policy")
5360 "@command{x86_energy_perf_policy} displays and updates energy-performance
5361 policy settings specific to Intel Architecture Processors. Settings are
5362 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5363 cpufreq sub-system is enabled or not.")
5364 (license license:gpl2)))
5366 (define-public haveged
5374 (url "https://github.com/jirka-h/haveged.git")
5375 (commit (string-append "v" version))))
5376 (file-name (git-file-name name version))
5378 (base32 "0g3hcvpky76cabgcfqh65fay7nnjkms32sgmlf33q969833hijqz"))))
5379 (build-system gnu-build-system)
5380 (home-page "https://www.issihosts.com/haveged")
5381 (synopsis "Entropy source for the Linux random number generator")
5383 "haveged generates an unpredictable stream of random numbers for use by
5384 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5385 standard mechanisms for filling the entropy pool may not be sufficient for
5386 systems with high needs or limited user interaction, such as headless servers.
5388 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5389 indirect effects of hardware events on hidden processor state using the
5390 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5391 It tunes itself to its environment and provides the same built-in test suite
5392 for the output stream as used on certified hardware security devices.
5394 The quality of the randomness produced by this algorithm has not been proven.
5395 It is recommended to run it together with another entropy source like rngd, and
5396 not as a replacement for it.")
5397 (license (list (license:non-copyleft "file://nist/mconf.h")
5398 (license:non-copyleft "file://nist/packtest.c")
5399 license:public-domain ; nist/dfft.c
5400 license:gpl3+)))) ; everything else
5402 (define-public ecryptfs-utils
5404 (name "ecryptfs-utils")
5409 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5410 version "/+download/ecryptfs-utils_"
5411 version ".orig.tar.gz"))
5414 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5415 (build-system gnu-build-system)
5417 `(#:configure-flags (list "--disable-pywrap")
5419 (modify-phases %standard-phases
5420 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5421 (lambda* (#:key inputs outputs #:allow-other-keys)
5422 (let ((out (assoc-ref outputs "out"))
5423 (utils-linux (assoc-ref inputs "utils-linux"))
5424 (cryptsetup (assoc-ref inputs "cryptsetup"))
5425 (linux-pam (assoc-ref inputs "linux-pam"))
5426 (lvm2 (assoc-ref inputs "lvm2")))
5427 (substitute* '("src/utils/ecryptfs-mount-private"
5428 "src/utils/ecryptfs-umount-private"
5429 "src/utils/ecryptfs-setup-private"
5430 "src/utils/ecryptfs-setup-swap"
5431 "src/utils/mount.ecryptfs.c"
5432 "src/utils/umount.ecryptfs.c"
5433 "src/pam_ecryptfs/pam_ecryptfs.c"
5434 "src/desktop/ecryptfs-mount-private.desktop.in"
5435 "src/desktop/ecryptfs-setup-private.desktop.in")
5437 (string-append utils-linux "/bin/mount"))
5439 (string-append utils-linux "/bin/umount"))
5440 (("/sbin/mount.ecryptfs_private")
5441 (string-append out "/sbin/mount.ecryptfs_private"))
5442 (("/sbin/umount.ecryptfs_private")
5443 (string-append out "/sbin/umount.ecryptfs_private"))
5444 (("/usr/bin/ecryptfs-mount-private")
5445 (string-append out "/bin/ecryptfs-mount-private"))
5446 (("/usr/bin/ecryptfs-rewrite-file")
5447 (string-append out "/bin/ecryptfs-rewrite-file"))
5448 (("/usr/bin/ecryptfs-setup-private")
5449 (string-append out "/bin/ecryptfs-setup-private"))
5450 (("/sbin/cryptsetup")
5451 (string-append cryptsetup "/sbin/cryptsetup"))
5452 (("/sbin/unix_chkpwd")
5453 (string-append linux-pam "/sbin/unix_chkpwd"))
5455 (string-append lvm2 "/sbin/dmsetup")))))))))
5457 `(("intltool" ,intltool)
5458 ("perl" ,perl) ; for pod2man
5459 ("pkg-config" ,pkg-config)))
5461 `(("keyutils" ,keyutils)
5462 ("linux-pam" ,linux-pam)
5463 ("utils-linux" ,util-linux)
5464 ("cryptsetup" ,cryptsetup)
5467 (home-page "https://ecryptfs.org/")
5468 (synopsis "eCryptfs cryptographic file system utilities")
5470 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5471 Each file's cryptographic meta-data is stored inside the file itself, along
5472 with the encrypted contents. This allows individual encrypted files to be
5473 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5474 native Linux file system, and has been part of the Linux kernel since version
5475 2.6.19. This package contains the userland utilities to manage it.")
5476 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5477 ;; grant additional permission to link with OpenSSL.
5478 (license license:gpl2+)))
5480 (define-public libnfsidmap
5482 (name "libnfsidmap")
5487 (uri (string-append "https://fedorapeople.org/~steved/"
5488 name "/" version "/" name "-" version ".tar.bz2"))
5490 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5491 (build-system gnu-build-system)
5493 `(#:configure-flags (list
5494 (string-append "--with-pluginpath="
5495 (assoc-ref %outputs "out")
5496 "/lib/libnfsidmap"))))
5498 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5500 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5501 (synopsis "NFSv4 support library for name/ID mapping")
5502 (description "Libnfsidmap is a library holding mulitiple methods of
5503 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5504 extensible array of mapping functions, currently consisting of two choices:
5505 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5506 (license (license:non-copyleft "file://COPYING"
5507 "See COPYING in the distribution."))))
5509 (define-public module-init-tools
5511 (name "module-init-tools")
5516 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5517 "module-init-tools-" version ".tar.bz2"))
5520 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5521 (patches (search-patches "module-init-tools-moduledir.patch"))))
5522 (build-system gnu-build-system)
5524 ;; FIXME: The upstream tarball lacks man pages, and building them would
5525 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5526 ;; but they vanished. In the meantime, fake it.
5528 (modify-phases %standard-phases
5529 (add-before 'configure 'fake-docbook
5531 (substitute* "Makefile.in"
5532 (("^DOCBOOKTOMAN.*$")
5533 "DOCBOOKTOMAN = true\n"))
5535 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5536 (synopsis "Tools for loading and managing Linux kernel modules")
5538 "Tools for loading and managing Linux kernel modules, such as
5539 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5540 (license license:gpl2+)))
5542 (define-public mcelog
5548 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5549 "mcelog.git/snapshot/v" version ".tar.gz"))
5552 "1m11v1y7cvpm7hwsghj23z77ps1w5jzn8000iwiyxpb939h2km5l"))
5553 (file-name (string-append name "-" version ".tar.gz"))
5554 (modules '((guix build utils)))
5557 ;; The snapshots lack a .git directory,
5558 ;; breaking ‘git describe’.
5559 (substitute* "Makefile"
5560 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5562 (build-system gnu-build-system)
5564 `(#:phases (modify-phases %standard-phases
5565 (delete 'configure)) ; no configure script
5566 #:make-flags (let ((out (assoc-ref %outputs "out")))
5568 (string-append "prefix=" out)
5569 (string-append "DOCDIR=" out "/share/doc/"
5571 "etcprefix=$(DOCDIR)/examples"))
5572 ;; The tests will only run as root on certain supported CPU models.
5574 (supported-systems (list "i686-linux" "x86_64-linux"))
5575 (home-page "https://mcelog.org/")
5576 (synopsis "Machine check monitor for x86 Linux systems")
5578 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
5579 systems running the kernel Linux. It can also perform user-defined tasks, such
5580 as bringing bad pages off-line, when configurable error thresholds are
5582 (license license:gpl2)))
5584 (define-public mtd-utils
5591 "ftp://ftp.infradead.org/pub/mtd-utils/"
5592 "mtd-utils-" version ".tar.bz2"))
5595 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
5597 '(#:configure-flags '("--enable-unit-tests")))
5599 `(("cmocka" ,cmocka)
5600 ("pkg-config" ,pkg-config)))
5602 `(("acl" ,acl) ; extended attributes (xattr)
5603 ("libuuid" ,util-linux "lib")
5605 ("openssl" ,openssl) ; optional crypto support
5607 ("zstd" ,zstd "lib")))
5608 (build-system gnu-build-system)
5609 (synopsis "MTD Flash Storage Utilities")
5610 (description "This package provides utilities for testing, partitioning, etc
5612 (home-page "http://www.linux-mtd.infradead.org/")
5614 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5615 license:mpl1.1 ; All ftl* files
5616 license:expat)))) ; libiniparser
5618 (define-public libseccomp
5624 (uri (string-append "https://github.com/seccomp/libseccomp/"
5625 "releases/download/v" version
5626 "/libseccomp-" version ".tar.gz"))
5629 "07crwxqzvl5k2b90a47ii9wgvi09s9hsy5b5jddw9ylp351d25fg"))))
5630 (build-system gnu-build-system)
5632 `(("which" ,which)))
5633 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5634 (description "The libseccomp library provides an easy to use, platform
5635 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5636 libseccomp API is designed to abstract away the underlying BPF based syscall
5637 filter language and present a more conventional function-call based filtering
5638 interface that should be familiar to, and easily adopted by, application
5640 (home-page "https://github.com/seccomp/libseccomp")
5641 (license license:lgpl2.1)))
5643 (define-public radeontop
5651 (url "https://github.com/clbr/radeontop.git")
5652 (commit (string-append "v" version))))
5653 (file-name (git-file-name name version))
5655 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5656 (build-system gnu-build-system)
5658 `(#:phases (modify-phases %standard-phases
5659 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5660 ;; dependency, and doesn't even work on release(!) tarballs.
5661 (add-after 'unpack 'report-correct-version
5663 (substitute* "getver.sh"
5665 (string-append "ver=" ,version)))
5667 (delete 'configure)) ; no configure script
5668 #:make-flags (list "CC=gcc"
5669 (string-append "PREFIX=" %output))
5670 #:tests? #f)) ; no tests
5672 `(("gettext" ,gettext-minimal)
5673 ("pkg-config" ,pkg-config)))
5675 `(("libdrm" ,libdrm)
5676 ("libpciaccess" ,libpciaccess)
5678 ("ncurses" ,ncurses)))
5679 (home-page "https://github.com/clbr/radeontop/")
5680 (synopsis "Usage monitor for AMD Radeon graphics")
5681 (description "RadeonTop monitors resource consumption on supported AMD
5682 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5683 a terminal or saved to a file for further processing. It measures both the
5684 activity of the GPU as a whole, which is also accurate during OpenCL
5685 computations, as well as separate component statistics that are only meaningful
5686 under OpenGL graphics workloads.")
5687 (license license:gpl3)))
5689 (define-public efivar
5695 (uri (string-append "https://github.com/rhboot/" name
5696 "/releases/download/" version "/" name
5697 "-" version ".tar.bz2"))
5700 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5701 (build-system gnu-build-system)
5703 `(;; Tests require a UEFI system and is not detected in the chroot.
5705 #:make-flags (list (string-append "prefix=" %output)
5706 (string-append "libdir=" %output "/lib")
5708 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5710 (modify-phases %standard-phases
5711 (delete 'configure))))
5713 `(("pkg-config" ,pkg-config)))
5716 (home-page "https://github.com/rhboot/efivar")
5717 (synopsis "Tool and library to manipulate EFI variables")
5718 (description "This package provides a library and a command line
5719 interface to the variable facility of UEFI boot firmware.")
5720 (license license:lgpl2.1+)))
5722 (define-public efibootmgr
5728 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5729 "/releases/download/" version "/efibootmgr"
5730 "-" version ".tar.bz2"))
5733 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5734 (build-system gnu-build-system)
5736 `(#:tests? #f ;no tests
5737 #:make-flags (list (string-append "prefix=" %output)
5738 (string-append "libdir=" %output "/lib")
5739 ;; EFIDIR denotes a subdirectory relative to the
5740 ;; EFI System Partition where the loader will be
5741 ;; installed (known as OS_VENDOR in the code).
5742 ;; GRUB overrides this, as such it's only used if
5743 ;; nothing else is specified on the command line.
5745 #:phases (modify-phases %standard-phases (delete 'configure))))
5747 `(("pkg-config" ,pkg-config)))
5749 `(("efivar" ,efivar)
5751 (home-page "https://github.com/rhinstaller/efibootmgr")
5752 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5754 "@code{efibootmgr} is a user-space application to modify the Intel
5755 Extensible Firmware Interface (EFI) Boot Manager. This application can
5756 create and destroy boot entries, change the boot order, change the next
5757 running boot option, and more.")
5758 (license license:gpl2+)))
5760 (define-public sysstat
5766 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5767 "sysstat-" version ".tar.xz"))
5770 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
5771 (build-system gnu-build-system)
5773 `(#:tests? #f ; No test suite.
5774 ;; Without this flag, it tries to install the man pages with group 'root'
5775 ;; and fails because /etc/passwd lacks an entry for the root user.
5777 (list "--disable-file-attr"
5778 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5780 (modify-phases %standard-phases
5781 ;; The build process tries to create '/var/lib/sa', so we skip that
5783 (add-after 'build 'skip-touching-var
5785 (substitute* "Makefile"
5786 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5789 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5790 (synopsis "Performance monitoring tools for Linux")
5791 (description "The sysstat utilities are a collection of performance
5792 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5793 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5794 @code{sadf} and @code{sa}.")
5795 (license license:gpl2+)))
5797 (define-public light
5805 (url "https://github.com/haikarainen/light.git")
5806 (commit (string-append "v" version))))
5808 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
5809 (file-name (git-file-name name version))))
5810 (build-system gnu-build-system)
5813 (modify-phases %standard-phases
5814 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5815 (lambda* (#:key inputs #:allow-other-keys)
5816 (substitute* "90-backlight.rules"
5817 (("/bin/chgrp") (which "chgrp"))
5818 (("/bin/chmod") (which "chmod")))
5820 (add-after 'install 'install-udev-rules
5821 (lambda* (#:key outputs #:allow-other-keys)
5822 (let ((out (assoc-ref outputs "out")))
5824 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5827 `(("autoconf" ,autoconf)
5828 ("automake" ,automake)))
5829 (home-page "https://haikarainen.github.io/light/")
5830 (synopsis "GNU/Linux application to control backlights")
5832 "Light is a program to send commands to screen backlight controllers
5833 under GNU/Linux. Features include:
5836 @item It does not rely on X.
5837 @item Light can automatically figure out the best controller to use, making
5838 full use of underlying hardware.
5839 @item It is possible to set a minimum brightness value, as some controllers
5840 set the screen to be pitch black at a vaĺue of 0 (or higher).
5843 Light is the successor of lightscript.")
5844 (license license:gpl3+)))
5846 (define-public brightnessctl
5847 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5849 (name "brightnessctl")
5850 (version (git-version "0.4" "0" commit))
5854 (url "https://github.com/Hummer12007/brightnessctl/")
5856 (file-name (git-file-name name version))
5859 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5860 (build-system gnu-build-system)
5862 '(#:tests? #f ; no tests
5863 #:make-flags (list "CC=gcc"
5864 (string-append "PREFIX=" %output)
5865 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5867 (modify-phases %standard-phases
5869 (add-after 'unpack 'adjust-udev-rules
5871 (substitute* "90-brightnessctl.rules"
5872 (("/bin/") "/run/current-system/profile/bin/"))
5874 (home-page "https://github.com/Hummer12007/brightnessctl")
5875 (synopsis "Backlight and LED brightness control")
5877 "This program allows you read and control device brightness. Devices
5878 include backlight and LEDs. It can also preserve current brightness before
5879 applying the operation, such as on lid close.
5881 The appropriate permissions must be set on the backlight or LED control
5882 interface in sysfs, which can be accomplished with the included udev rules.")
5883 (license license:expat))))
5893 (url "https://github.com/linrunner/TLP.git")
5895 (file-name (git-file-name name version))
5897 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
5899 `(("shellcheck" ,shellcheck)))
5903 ("ethtool" ,ethtool)
5907 ("inetutils" ,inetutils)
5910 ("pciutils" ,pciutils)
5914 ("usbutils" ,usbutils)
5915 ("util-linux" ,util-linux)
5916 ("wireless-tools" ,wireless-tools)
5917 ,@(if (let ((system (or (%current-target-system)
5918 (%current-system))))
5919 (or (string-prefix? "i686-" system)
5920 (string-prefix? "x86_64-" system)))
5921 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5923 (build-system gnu-build-system)
5925 ;; XXX: The full test suite is run with "checkall" but it requires
5926 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
5927 `(#:test-target "shellcheck"
5928 #:modules ((guix build gnu-build-system)
5932 (modify-phases %standard-phases
5933 (delete 'configure) ; no configure script
5934 (add-before 'build 'setenv
5935 (lambda* (#:key outputs #:allow-other-keys)
5936 (let ((out (assoc-ref outputs "out")))
5937 (setenv "TLP_WITH_SYSTEMD" "0")
5938 (setenv "TLP_NO_INIT" "1")
5939 (setenv "TLP_NO_PMUTILS" "1")
5940 (setenv "TLP_SBIN" (string-append out "/bin"))
5941 (setenv "TLP_BIN" (string-append out "/bin"))
5942 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5943 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5944 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5945 (setenv "TLP_CONFDEF"
5946 (string-append out "/share/tlp/defaults.conf"))
5947 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
5949 (string-append out "/lib/elogind/system-sleep"))
5951 (string-append out "/share/bash-completion/completions"))
5952 (setenv "TLP_MAN" (string-append out "/share/man"))
5953 (setenv "TLP_META" (string-append out "/share/metainfo"))
5955 (add-before 'install 'fix-installation
5957 ;; Stop the Makefile from trying to create system directories.
5958 (substitute* "Makefile"
5959 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
5960 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5963 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
5964 (add-after 'install 'wrap
5965 (lambda* (#:key inputs outputs #:allow-other-keys)
5966 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5967 (bin-files (find-files bin ".*")))
5968 (define (bin-directory input-name)
5969 (let ((p (assoc-ref inputs input-name)))
5970 (and p (string-append p "/bin"))))
5971 (define (sbin-directory input-name)
5972 (string-append (assoc-ref inputs input-name) "/sbin"))
5973 (for-each (lambda (program)
5974 (wrap-program program
5977 (filter-map bin-directory
5989 "x86-energy-perf-policy"))
5990 (filter-map sbin-directory
5996 "wireless-tools"))))))
5999 (home-page "https://linrunner.de/en/tlp/tlp.html")
6000 (synopsis "Power management tool for Linux")
6001 (description "TLP is a power management tool for Linux. It comes with
6002 a default configuration already optimized for battery life. Nevertheless,
6003 TLP is customizable to fulfil system requirements. TLP settings are applied
6004 every time the power supply source is changed.")
6005 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6007 (license (list license:gpl2+ license:gpl3+))))
6015 (uri (string-append "https://www.ezix.org/software/"
6016 "files/lshw-" version
6020 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
6021 (build-system gnu-build-system)
6023 `(#:phases (modify-phases %standard-phases (delete 'configure))
6024 #:tests? #f ; no tests
6026 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6027 (synopsis "List hardware information")
6029 "@command{lshw} (Hardware Lister) is a small tool to provide
6030 detailed information on the hardware configuration of the machine.
6031 It can report exact memory configuration, firmware version, mainboard
6032 configuration, CPU version and speed, cache configuration, bus speed,
6033 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6034 machines (PowerMac G4 is known to work).")
6035 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6036 (license license:gpl2+)))
6038 (define-public libmnl
6045 (uri (string-append "mirror://netfilter.org/libmnl/"
6046 "libmnl-" version ".tar.bz2"))
6049 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6050 (build-system gnu-build-system)
6051 (home-page "https://www.netfilter.org/projects/libmnl/")
6052 (synopsis "Netlink utility library")
6053 (description "Libmnl is a minimalistic user-space library oriented to
6054 Netlink developers. There are a lot of common tasks in parsing, validating,
6055 constructing of both the Netlink header and TLVs that are repetitive and easy to
6056 get wrong. This library aims to provide simple helpers that allows you to
6057 re-use code and to avoid re-inventing the wheel.")
6058 (license license:lgpl2.1+)))
6060 (define-public libnftnl
6067 (uri (string-append "mirror://netfilter.org/libnftnl/"
6068 "libnftnl-" version ".tar.bz2"))
6070 (base32 "13zd90bfrr0q3j0l0cbc8kiizccw6n8gp727kqnfljh024zw3nr0"))))
6071 (build-system gnu-build-system)
6073 `(("pkg-config" ,pkg-config)))
6075 `(("libmnl" ,libmnl)))
6076 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6077 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6078 (description "Libnftnl is a userspace library providing a low-level netlink
6079 programming interface to the in-kernel nf_tables subsystem. The library
6080 libnftnl has been previously known as libnftables. This library is currently
6082 (license license:gpl2+)))
6084 (define-public nftables
6091 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6093 (string-append "https://www.nftables.org/projects/nftables"
6094 "/files/nftables-" version ".tar.bz2")))
6096 (base32 "0vmn6xwqa1nq6crfxshh049b199d0aj6hfgin7k068xhibzgvmk8"))))
6097 (build-system gnu-build-system)
6098 (arguments `(#:configure-flags
6099 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6100 (inputs `(("gmp" ,gmp)
6102 ("libnftnl" ,libnftnl)
6103 ("readline" ,readline)))
6104 (native-inputs `(("pkg-config" ,pkg-config)
6107 (home-page "https://www.nftables.org")
6108 (synopsis "Userspace utility for Linux packet filtering")
6109 (description "nftables is the project that aims to replace the existing
6110 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6111 filtering framework, a new userspace utility and also a compatibility layer for
6112 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6113 infrastructure such as the existing hooks, the connection tracking system, the
6114 userspace queueing component and the logging subsystem.")
6115 (license license:gpl2)))
6117 (define-public proot
6125 (url "https://github.com/proot-me/PRoot.git")
6126 (commit (string-append "v" version))))
6127 (file-name (git-file-name name version))
6129 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6130 (patches (search-patches "proot-test-fhs.patch"))))
6131 (build-system gnu-build-system)
6133 '(#:make-flags '("-C" "src")
6135 #:phases (modify-phases %standard-phases
6137 (add-before 'build 'set-shell-file-name
6138 (lambda* (#:key inputs #:allow-other-keys)
6139 (substitute* (find-files "src" "\\.[ch]$")
6142 (assoc-ref inputs "bash")
6145 (add-before 'check 'fix-fhs-assumptions-in-tests
6147 (substitute* "tests/test-c6b77b77.mk"
6148 (("/bin/bash") (which "bash"))
6149 (("/usr/bin/test") (which "test")))
6150 (substitute* '("tests/test-16573e73.c")
6151 (("/bin/([a-z-]+)" _ program)
6154 (substitute* (find-files "tests" "\\.sh$")
6155 ;; Some of the tests try to "bind-mount" /bin/true.
6157 (string-append "-b " (which "true") ":"))
6158 ;; Likewise for /bin.
6159 (("-b /bin:") "-b /gnu:")
6160 ;; Others try to run /bin/sh.
6161 (("/bin/sh") (which "sh"))
6162 ;; Others assume /etc/fstab exists.
6163 (("/etc/fstab") "/etc/passwd"))
6165 (substitute* "tests/GNUmakefile"
6166 (("-b /bin:") "-b /gnu:"))
6168 ;; XXX: This test fails in an obscure corner case, just
6170 (delete-file "tests/test-kkkkkkkk.c")
6175 (let ((n (parallel-job-count)))
6176 ;; For some reason we get lots of segfaults with
6177 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6178 (setenv "PROOT_NO_SECCOMP" "1")
6180 ;; Most of the tests expect "/bin" to be in $PATH so
6181 ;; they can run things that live in $ROOTFS/bin.
6183 (string-append (getenv "PATH") ":/bin"))
6185 (invoke "make" "check" "-C" "tests"
6187 "-j" (number->string n)))))
6189 (lambda* (#:key outputs #:allow-other-keys)
6190 ;; The 'install' rule does nearly nothing.
6191 (let* ((out (assoc-ref outputs "out"))
6192 (man1 (string-append out "/share/man/man1")))
6193 ;; TODO: 'make install-care' (does not even
6194 ;; build currently.)
6195 (invoke "make" "-C" "src" "install"
6196 (string-append "PREFIX=" out))
6199 (copy-file "doc/proot/man.1"
6200 (string-append man1 "/proot.1"))
6202 (native-inputs `(("which" ,which)
6204 ;; For 'mcookie', used by some of the tests.
6205 ("util-linux" ,util-linux)
6207 ;; XXX: Choose the old coreutils because its 'stat'
6208 ;; program does not use statx(2) when running 'stat -c
6209 ;; %a' or similar, which PRoot doesn't properly support.
6210 ("coreutils-old" ,coreutils-8.30)
6212 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6213 ;; make 4.3 to segfault.
6214 ("make-old" ,gnu-make-4.2)))
6215 (inputs `(("talloc" ,talloc)))
6216 (home-page "https://github.com/proot-me/PRoot")
6217 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6219 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6220 and @code{binfmt_misc}. This means that users don't need any privileges or
6221 setup to do things like using an arbitrary directory as the new root
6222 file system, making files accessible somewhere else in the file system
6223 hierarchy, or executing programs built for another CPU architecture
6224 transparently through QEMU user-mode. Also, developers can use PRoot as a
6225 generic process instrumentation engine thanks to its extension mechanism.
6226 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6227 available in the kernel Linux.")
6228 (license license:gpl2+)))
6230 (define-public proot-static
6233 (name "proot-static")
6235 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6236 (inputs `(("talloc" ,talloc/static)))
6238 (substitute-keyword-arguments (package-arguments proot)
6239 ((#:make-flags flags)
6240 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6242 `(modify-phases ,phases
6243 (add-after 'strip 'remove-store-references
6244 (lambda* (#:key outputs #:allow-other-keys)
6245 (let* ((out (assoc-ref outputs "out")))
6246 (with-directory-excursion out
6247 (remove-store-references "bin/proot")
6249 ((#:allowed-references _ '("out"))
6252 (define-public cpuid
6255 (version "20200211")
6258 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6259 version ".src.tar.gz"))
6262 "06sjbqqp80l7nhsp6khglkzdp9qy4vhbvjxbfilznhsmrqiwlw55"))))
6263 (build-system gnu-build-system)
6265 '(#:make-flags '("CC=gcc")
6266 #:tests? #f ; no tests
6267 #:phases (modify-phases %standard-phases
6268 (delete 'configure) ; no configure script
6269 (add-before 'install 'fix-makefile
6270 (lambda* (#:key outputs #:allow-other-keys)
6271 (substitute* "Makefile"
6272 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6273 ;; Make the compressed manpages writable so that the
6274 ;; reset-gzip-timestamps phase does not error out.
6275 (substitute* "Makefile"
6276 (("-m 444") "-m 644"))
6278 (inputs `(("perl" ,perl)))
6279 (supported-systems '("i686-linux" "x86_64-linux"))
6280 (home-page "http://www.etallen.com/cpuid.html")
6281 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6282 (description "cpuid dumps detailed information about the CPU(s) gathered
6283 from the CPUID instruction, and also determines the exact model of CPU(s). It
6284 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6285 NexGen, Rise, and SiS CPUs.")
6286 (license license:gpl2+)))
6288 (define-public jmtpfs
6296 (url "https://github.com/JasonFerrara/jmtpfs")
6297 (commit (string-append "v" version))))
6298 (file-name (git-file-name name version))
6301 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6302 (build-system gnu-build-system)
6306 ("libmtp" ,libmtp)))
6308 `(("pkg-config" ,pkg-config)))
6309 (home-page "https://github.com/JasonFerrara/jmtpfs")
6310 (synopsis "Use a FUSE file system to access data over MTP")
6311 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6312 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6313 the MTP device as a file system.")
6314 (license license:gpl3)))
6316 (define-public procenv
6324 (url "https://github.com/jamesodhunt/procenv")
6326 (file-name (git-file-name name version))
6328 (base32 "1ilrsw1rc85w29mkbkmm5n5w427gapv43yrjzvkb4kc9xhscgdjn"))))
6329 (build-system gnu-build-system)
6330 (arguments `(#:configure-flags '("--disable-silent-rules")))
6331 (native-inputs `(("groff" ,groff) ; for tests
6332 ("pkg-config" ,pkg-config)))
6333 (inputs `(("check" ,check)
6336 ("libselinux" ,libselinux)))
6337 (synopsis "Utility to show process environment")
6338 (description "Procenv is a command-line tool that displays as much detail about
6339 itself and its environment as possible. It can be used as a test
6340 tool, to understand the type of environment a process runs in, and for
6341 comparing system environments.")
6342 (home-page "http://github.com/jamesodhunt/procenv/")
6343 (license license:gpl3+)))
6345 (define-public libfabric
6353 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6354 version "/libfabric-" version ".tar.bz2"))
6356 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
6357 (build-system gnu-build-system)
6358 (inputs `(("rdma-core" ,rdma-core)
6359 ,@(match (%current-system)
6360 ((member (package-supported-systems psm))
6364 (home-page "https://ofiwg.github.io/libfabric/")
6365 (synopsis "Open Fabric Interfaces")
6367 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6368 communication services to applications. OFI is best described as a collection
6369 of libraries and applications used to export fabric services. The key
6370 components of OFI are: application interfaces, provider libraries, kernel
6371 services, daemons, and test applications.
6373 Libfabric is a core component of OFI. It is the library that defines and
6374 exports the user-space API of OFI, and is typically the only software that
6375 applications deal with directly. It works in conjunction with provider
6376 libraries, which are often integrated directly into libfabric.")
6377 (license (list license:bsd-2 license:gpl2)))) ;dual
6382 (version "3.3.20170428")
6383 (home-page "https://github.com/intel/psm")
6387 (uri (git-reference (url home-page)
6388 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6389 (file-name (string-append "psm-" version ".tar.gz"))
6391 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6392 (patches (search-patches
6393 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6394 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6395 "psm-repro.patch" ; reproducibility
6396 "psm-disable-memory-stats.patch"))))
6397 (build-system gnu-build-system)
6398 (outputs '("out" "debug"))
6399 (inputs `(("libuuid" ,util-linux "lib")))
6401 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6402 ,(string-append "INSTALL_PREFIX=" %output)
6403 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6405 #:phases (modify-phases %standard-phases
6407 (add-after 'unpack 'patch-/usr/include
6409 (substitute* "Makefile"
6410 (("\\$\\{DESTDIR}/usr/include")
6411 (string-append %output "/include")))
6412 (substitute* "Makefile"
6413 (("/lib64") "/lib"))
6415 (add-after 'unpack 'patch-sysmacros
6417 (substitute* "ipath/ipath_proto.c"
6418 (("#include <sys/poll.h>" m)
6419 (string-append m "\n"
6420 "#include <sys/sysmacros.h>")))
6422 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6424 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6425 communications interface for the True Scale family of products. PSM users are
6426 enabled with mechanisms necessary to implement higher level communications
6427 interfaces in parallel environments.")
6428 ;; Only Intel-compatable processors are supported.
6429 (supported-systems '("i686-linux" "x86_64-linux"))
6430 (license (list license:bsd-2 license:gpl2)))) ;dual
6432 (define-public snapscreenshot
6434 (name "snapscreenshot")
6435 (version "1.0.14.3")
6439 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6440 name "-" version ".tar.bz2"))
6442 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6443 (build-system gnu-build-system)
6446 (let ((out (assoc-ref %outputs "out")))
6447 (list (string-append "BINDIR=" out "/bin")
6448 (string-append "MANDIR=" out "/share/man")))
6449 #:tests? #f ; no test suite
6451 (modify-phases %standard-phases
6452 (delete 'configure) ; ./configure is a snarky no-op
6453 (add-before 'install 'fix-ownership
6454 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6456 (substitute* "depfun.mak"
6457 ((" -o bin -g bin ") " "))
6459 (add-before 'install 'create-output-directories
6460 (lambda* (#:key outputs #:allow-other-keys)
6461 (let ((out (assoc-ref outputs "out")))
6462 (mkdir-p (string-append out "/share/man/man1"))
6464 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6465 (synopsis "Take screenshots of one or more Linux text consoles")
6467 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6468 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6469 relevant @file{/dev/vcs*} file(s).")
6470 (license license:gpl2)))
6472 (define-public fbcat
6479 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6480 version "/" name "-" version ".tar.gz"))
6482 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6483 (build-system gnu-build-system)
6485 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6486 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6487 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6488 `(("pnmtopng" ,netpbm)))
6489 (outputs (list "out" "fbgrab"))
6493 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6494 #:tests? #f ; no tests
6496 (modify-phases %standard-phases
6497 (delete 'configure) ; no configure script
6498 (add-after 'build 'qualify-references
6499 (lambda* (#:key inputs outputs #:allow-other-keys)
6500 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6501 (out (assoc-ref outputs "out")))
6502 (substitute* "fbgrab"
6504 (string-append out "/bin/" all))
6506 (string-append pnmtopng "/bin/" all)))
6508 (add-after 'install 'split-fbgrab-output
6509 (lambda* (#:key outputs #:allow-other-keys)
6510 (let* ((out (assoc-ref outputs "out"))
6511 (out:fbgrab (assoc-ref outputs "fbgrab")))
6512 (for-each (lambda (file)
6513 (let ((old (string-append out "/" file))
6514 (new (string-append out:fbgrab "/" file)))
6515 (mkdir-p (dirname new))
6516 (rename-file old new)))
6518 "share/man/man1/fbgrab.1"))
6520 (home-page "https://jwilk.net/software/fbcat")
6521 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6523 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6524 a dump therof. It supports a wide range of drivers and pixel formats.
6525 @command{fbcat} can take screenshots of virtually any application that can be
6526 made to write its output to the framebuffer, including (but not limited to)
6527 text-mode or graphical applications that don't use a display server.
6529 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6530 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6531 (license license:gpl2)))
6533 (define-public libcgroup
6541 "mirror://sourceforge/libcg/" name "/"
6542 version "/" name "-" version ".tar.bz2"))
6544 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6545 (build-system gnu-build-system)
6552 `(("linux-pam" ,linux-pam)))
6553 (home-page "https://sourceforge.net/projects/libcg/")
6554 (synopsis "Control groups management tools")
6555 (description "Control groups is Linux kernel method for process resource
6556 restriction, permission handling and more. This package provides userspace
6557 interface to this kernel feature.")
6558 (license license:lgpl2.1)))
6560 (define-public mbpfan
6568 (url "https://github.com/dgraziotin/mbpfan.git")
6569 (commit (string-append "v" version))))
6570 (file-name (git-file-name name version))
6572 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6573 (build-system gnu-build-system)
6575 `(#:tests? #f ; tests ask to be run as root
6576 #:make-flags (let ((out (assoc-ref %outputs "out")))
6577 (list (string-append "DESTDIR=" out)
6578 ,(string-append "CC=" (cc-for-target))))
6580 (modify-phases %standard-phases
6581 (add-after 'unpack 'patch-paths
6583 (substitute* "Makefile"
6586 (delete 'configure)))) ; there's no configure phase
6587 (home-page "https://github.com/dgraziotin/mbpfan")
6588 (synopsis "Control fan speed on Macbooks")
6590 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6591 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6592 module. It can be executed as a daemon or in the foreground with root
6594 (license license:gpl3+)))
6603 (url "https://github.com/intel/opa-psm2.git")
6604 (commit (string-append "PSM2_" version))))
6605 (file-name (git-file-name name version))
6608 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6609 (build-system gnu-build-system)
6612 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6614 #:phases (modify-phases %standard-phases
6616 (add-after 'unpack 'patch-Makefiles
6618 (substitute* "Makefile"
6621 (substitute* "compat/Makefile"
6627 (setenv "DESTDIR" %output)
6628 (invoke "make" "install")
6631 `(("rdma-core" ,rdma-core)
6632 ("numactl" ,numactl)))
6633 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6635 "This package is low-level user-level Intel's communications interface.
6636 The PSM2 API is a high-performance vendor-specific protocol that provides a
6637 low-level communications interface for the Intel Omni-Path family of
6638 high-speed networking devices.")
6639 (home-page "https://github.com/intel/opa-psm2")
6640 ;; Only the x86_64 architecure is supported.
6641 (supported-systems '("x86_64-linux"))
6642 (license (list license:bsd-3 license:gpl2)))) ; dual
6644 (define-public libpfm4
6650 (uri (string-append "mirror://sourceforge/perfmon2/"
6651 name "/libpfm-" version ".tar.gz"))
6654 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6655 (build-system gnu-build-system)
6657 '(#:modules ((guix build utils)
6658 (guix build gnu-build-system))
6659 #:phases (modify-phases %standard-phases
6663 (lambda* (#:key inputs outputs #:allow-other-keys)
6664 (let* ((out (assoc-ref outputs "out")))
6669 (lambda* (#:key outputs #:allow-other-keys)
6670 (let* ((out (assoc-ref outputs "out")))
6672 (string-append "PREFIX=" out)
6675 (synopsis "Performance event monitoring library")
6677 "This package provides a library called libpfm4, which is used to develop
6678 monitoring tools exploiting the performance monitoring events such as those
6679 provided by the Performance Monitoring Unit (PMU) of modern processors.
6681 Libpfm4 helps convert from an event name, expressed as a string, to the event
6682 encoding that is either the raw event as documented by the hardware vendor or
6683 the OS-specific encoding. In the latter case, the library is able to prepare
6684 the OS-specific data structures needed by the kernel to setup the event.
6686 libpfm4 provides support for the @code{perf_events} interface, which was
6687 introduced in Linux 2.6.31.")
6688 (home-page "http://perfmon2.sourceforge.net/")
6689 (license license:expat)))
6691 (define-public libnfnetlink
6693 (name "libnfnetlink")
6698 "https://www.netfilter.org/projects/libnfnetlink/files/"
6699 "libnfnetlink-" version ".tar.bz2"))
6702 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6703 (build-system gnu-build-system)
6704 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6705 (synopsis "Low-level netfilter netlink communication library")
6707 "@code{libnfnetlink} is the low-level library for netfilter related
6708 kernel/userspace communication. It provides a generic messaging
6709 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6710 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6711 management tools in userspace.")
6712 (license license:gpl2)))
6714 (define-public go-netlink
6721 (url "https://github.com/vishvananda/netlink.git")
6722 (commit (string-append "v" version))))
6723 (file-name (git-file-name name version))
6726 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6727 (build-system go-build-system)
6729 `(#:import-path "github.com/vishvananda/netlink"))
6731 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6732 ("go-netns" ,go-netns)))
6733 (home-page "https://github.com/vishvananda/netlink")
6734 (synopsis "Simple netlink library for Go")
6735 (description "The netlink package provides a simple netlink library for
6736 Go. Netlink is the interface a user-space program in Linux uses to
6737 communicate with the kernel. It can be used to add and remove interfaces, set
6738 IP addresses and routes, and configure IPsec.")
6739 (license license:asl2.0)))
6741 (define-public xfsprogs
6748 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6749 "xfsprogs-" version ".tar.gz"))
6752 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
6753 (build-system gnu-build-system)
6754 (outputs (list "out" "python"))
6756 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6758 (modify-phases %standard-phases
6759 (add-after 'install 'separate-python-output
6760 (lambda* (#:key outputs #:allow-other-keys)
6761 (let ((out (assoc-ref outputs "out"))
6762 (python (assoc-ref outputs "python")))
6765 (mkdir-p (string-append python (dirname script)))
6766 (rename-file (string-append out script)
6767 (string-append python script)))
6768 (list "/sbin/xfs_scrub_all"))
6770 (add-after 'install 'install-headers
6772 (invoke "make" "install-dev"))))))
6774 `(("gettext" ,gettext-minimal)))
6776 `(("libuuid" ,util-linux "lib")
6777 ("python" ,python-wrapper)))
6778 (home-page "https://xfs.wiki.kernel.org/")
6779 (synopsis "XFS file system tools")
6780 (description "This package provides commands to create and check XFS
6782 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6783 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6784 (license (list license:gpl2 license:lgpl2.1))))
6786 (define-public genext2fs
6793 (url "https://github.com/jeremie-koenig/genext2fs.git")
6794 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6795 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6796 (file-name (git-file-name name version))
6798 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6799 (build-system gnu-build-system)
6802 (modify-phases %standard-phases
6803 (add-after 'unpack 'apply-debian-patches
6804 ;; Debian changes (the revision after ‘-’ in VERSION) are
6805 ;; maintained as separate patches. Apply those relevant to us.
6809 (invoke "patch" "-p1" "-i"
6810 (string-append "debian/patches/" file-name)))
6811 (list "blocksize+creator.diff" ; add -B/-o options
6812 "byteswap_fix.diff"))
6815 `(("autoconf" ,autoconf)
6816 ("automake" ,automake)))
6817 (home-page "https://github.com/jeremie-koenig/genext2fs")
6818 (synopsis "Generate ext2 file system as a normal user")
6819 (description "This package provides a program to generate an ext2
6820 file system as a normal (non-root) user. It does not require you to mount
6821 the image file to copy files on it, nor does it require that you become
6822 the superuser to make device nodes.")
6823 (license license:gpl2)))
6825 (define-public fakeroot
6831 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6832 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6833 (file-name (string-append name "-" version ".tar.gz"))
6836 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6837 (build-system gnu-build-system)
6840 (modify-phases %standard-phases
6841 (add-after 'configure 'patch-Makefile
6843 ;; Note: The root of the problem is already in "Makefile.am".
6844 (substitute* "Makefile"
6845 (("/bin/sh") (which "sh")))
6847 (add-after 'unpack 'patch-script
6848 (lambda* (#:key inputs #:allow-other-keys)
6849 (substitute* "scripts/fakeroot.in"
6851 (string-append (assoc-ref inputs "util-linux")
6854 (string-append (assoc-ref inputs "sed")
6857 (string-append (assoc-ref inputs "coreutils")
6860 (add-before 'configure 'setenv
6862 (setenv "LIBS" "-lacl")
6864 (add-before 'check 'prepare-check
6866 (setenv "SHELL" (which "bash"))
6867 (setenv "VERBOSE" "1")
6868 (substitute* "test/t.touchinstall"
6869 ;; We don't have the name of the root user, so use ID=0.
6870 (("grep root") "grep \"\\<0\\>\""))
6871 (substitute* "test/tartest"
6872 ;; We don't have the name of the root group, so use ID=0.
6873 (("ROOTGROUP=root") "ROOTGROUP=0")
6874 ;; We don't have the name of the daemon user, so use IDs.
6875 (("daemon:sys") "1:3")
6877 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6878 (substitute* "test/compare-tar"
6879 (("tar -tvf") "tar --numeric-owner -tvf"))
6881 ;; coreutils 8.32 changed 'ls' to use the statx() syscall instead
6882 ;; of lstat(). fakeroot 1.24 does not support the former, so
6883 ;; adjust these tests to use 'test -b' instead of 'ls' to test for
6884 ;; block device. See <https://bugs.gnu.org/41090>.
6885 (substitute* '("test/t.mknod" "test/t.chmod_dev")
6886 (("ls -ld? \\$tmp/hda3")
6887 "test -b $tmp/hda3 && echo block || echo fail"))
6891 ("sharutils" ,sharutils) ; for the tests
6892 ("xz" ,xz))) ; for the tests
6894 `(("libcap" ,libcap/next)
6895 ("util-linux" ,util-linux)
6897 ("coreutils" ,coreutils)))
6898 (synopsis "Provides a fake root environment")
6899 (description "@command{fakeroot} runs a command in an environment where
6900 it appears to have root privileges for file manipulation. This is useful
6901 for allowing users to create archives (tar, ar, .deb etc.) with files in
6902 them with root permissions/ownership. Without fakeroot one would have to
6903 have root privileges to create the constituent files of the archives with
6904 the correct permissions and ownership, and then pack them up, or one would
6905 have to construct the archives directly, without using the archiver.")
6906 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6907 (license license:gpl3+)))
6909 (define-public fakechroot
6916 "https://github.com/dex4er/fakechroot/releases/download/"
6917 version "/fakechroot-" version ".tar.gz"))
6920 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
6921 (build-system gnu-build-system)
6923 ;; XXX: The tests heavily assume they run on an FHS system so for now
6926 #:configure-flags '("--disable-static")))
6927 (synopsis "Emulate @code{chroot} by overriding file system calls")
6929 "@command{fakechroot} runs a command in an environment were is additional
6930 possibility to use @code{chroot} command without root privileges. This is
6931 useful for allowing users to create own chrooted environment with possibility
6932 to install another packages without need for root privileges.
6934 It works by providing @file{libfakechroot.so}, a shared library meant to be
6935 set as @code{LD_PRELOAD} to override the C library file system functions.")
6936 (home-page "https://github.com/dex4er/fakechroot/")
6937 (license license:lgpl2.1+)))
6939 (define-public inputattach
6941 (name "inputattach")
6946 (url "https://github.com/linuxwacom/input-wacom.git")
6947 (commit (string-append "input-wacom-" version))))
6948 (file-name (git-file-name name version))
6950 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6951 (build-system gnu-build-system)
6954 (modify-phases %standard-phases
6958 (lambda* (#:key inputs #:allow-other-keys)
6959 (with-directory-excursion "inputattach"
6960 (invoke (string-append (assoc-ref inputs "gcc")
6962 "-O2" "-o" "inputattach" "inputattach.c"))
6966 (lambda* (#:key outputs #:allow-other-keys)
6967 (let ((target-dir (string-append
6968 (assoc-ref outputs "out")
6970 (mkdir-p target-dir)
6971 (copy-file "inputattach/inputattach"
6972 (string-append target-dir
6975 (home-page "https://linuxwacom.github.io/")
6976 (synopsis "Dispatch input peripherals events to a device file")
6977 (description "inputattach dispatches input events from several device
6978 types and interfaces and translates so that the X server can use them.")
6979 (license license:gpl2+)))
6981 (define-public pipewire
6988 (url "https://github.com/PipeWire/pipewire")
6990 (file-name (git-file-name name version))
6993 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
6994 (build-system meson-build-system)
6996 '(#:configure-flags '("-Dsystemd=false")))
6998 `(("pkg-config" ,pkg-config)))
7000 `(("alsa-lib" ,alsa-lib)
7004 ("gstreamer" ,gstreamer)
7005 ("gst-plugins-base" ,gst-plugins-base)
7009 (home-page "https://pipewire.org/")
7010 (synopsis "Server and user space API to deal with multimedia pipelines")
7012 "PipeWire is a project that aims to greatly improve handling of audio and
7013 video under Linux. It aims to support the usecases currently handled by both
7014 PulseAudio and Jack and at the same time provide same level of powerful handling
7015 of Video input and output. It also introduces a security model that makes
7016 interacting with audio and video devices from containerized applications easy,
7017 with supporting Flatpak applications being the primary goal. Alongside Wayland
7018 and Flatpak we expect PipeWire to provide a core building block for the future
7019 of Linux application development.")
7020 (license license:lgpl2.0+)))
7029 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7031 (file-name (git-file-name name version))
7034 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
7035 (build-system gnu-build-system)
7038 (modify-phases %standard-phases
7039 (add-after 'unpack 'fix-dbus-tests
7041 (substitute* '("unit/test-dbus-message-fds.c"
7042 "unit/test-dbus-properties.c"
7044 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7049 `(("autoconf" ,autoconf)
7050 ("libtool" ,libtool)
7051 ("pkgconfig" ,pkg-config)
7052 ("automake" ,automake)))
7053 (home-page "https://01.org/ell")
7054 (synopsis "Embedded Linux Library")
7055 (description "The Embedded Linux* Library (ELL) provides core, low-level
7056 functionality for system daemons. It typically has no dependencies other than
7057 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7058 ELL is designed to be efficient and compact enough for use on embedded Linux
7059 platforms, it is not limited to resource-constrained systems.")
7060 (license license:lgpl2.1+)))
7062 (define-public lttng-ust
7068 (uri (string-append "https://lttng.org/files/lttng-ust/"
7069 "lttng-ust-" version ".tar.bz2"))
7072 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7073 (build-system gnu-build-system)
7075 `(("liburcu" ,liburcu)
7076 ("numactl" ,numactl)))
7078 `(("python" ,python-3)))
7079 (home-page "https://lttng.org/")
7080 (synopsis "LTTng userspace tracer libraries")
7081 (description "The user space tracing library, liblttng-ust, is the LTTng
7082 user space tracer. It receives commands from a session daemon, for example to
7083 enable and disable specific instrumentation points, and writes event records
7084 to ring buffers shared with a consumer daemon.")
7085 (license license:lgpl2.1+)))
7087 (define-public kexec-tools
7089 (name "kexec-tools")
7093 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7094 "/kexec/kexec-tools-" version ".tar.xz"))
7097 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
7098 (build-system gnu-build-system)
7100 ;; There are no automated tests.
7102 (home-page "https://projects.horms.net/projects/kexec/")
7103 (synopsis "Tools for booting directly into different kernels")
7104 (description "This package provides the @code{kexec} program and ancillary
7105 utilities. Using @code{kexec}, it is possible to boot directly into a new
7106 kernel from the context of an already-running kernel, bypassing the normal
7107 system boot process.")
7108 (license license:gpl2)))
7110 (define-public cachefilesd
7112 (name "cachefilesd")
7117 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7118 "/cachefilesd.git/snapshot/cachefilesd-"
7122 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7123 (build-system gnu-build-system)
7126 `(#:tests? #f ; there are no tests
7128 (let ((prefix-dir (lambda (var dir)
7129 (string-append var "=" %output "/" dir))))
7130 (list (string-append "CC=" ,(cc-for-target))
7131 (prefix-dir "SBINDIR" "sbin/")
7132 (prefix-dir "ETCDIR" "etc/")
7133 (prefix-dir "MANDIR" "share/man/")))
7134 #:phases (modify-phases %standard-phases (delete 'configure))))
7135 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7136 (synopsis "CacheFiles userspace management daemon")
7137 (description "@code{cachefilesd} is a userspace daemon that manages the
7138 cache data store that is used by network file systems such as @code{AFS} and
7139 @code{NFS} to cache data locally on disk. The content of the cache is
7140 persistent over reboots.")
7141 (license license:gpl2+)))