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>
48 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
50 ;;; This file is part of GNU Guix.
52 ;;; GNU Guix is free software; you can redistribute it and/or modify it
53 ;;; under the terms of the GNU General Public License as published by
54 ;;; the Free Software Foundation; either version 3 of the License, or (at
55 ;;; your option) any later version.
57 ;;; GNU Guix is distributed in the hope that it will be useful, but
58 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
59 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
60 ;;; GNU General Public License for more details.
62 ;;; You should have received a copy of the GNU General Public License
63 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
65 (define-module (gnu packages linux)
66 #:use-module (gnu packages)
67 #:use-module (gnu packages acl)
68 #:use-module (gnu packages admin)
69 #:use-module (gnu packages algebra)
70 #:use-module (gnu packages audio)
71 #:use-module (gnu packages autotools)
72 #:use-module (gnu packages backup)
73 #:use-module (gnu packages base)
74 #:use-module (gnu packages bash)
75 #:use-module (gnu packages bison)
76 #:use-module (gnu packages calendar)
77 #:use-module (gnu packages check)
78 #:use-module (gnu packages cpio)
79 #:use-module (gnu packages crypto)
80 #:use-module (gnu packages cryptsetup)
81 #:use-module (gnu packages compression)
82 #:use-module (gnu packages dbm)
83 #:use-module (gnu packages datastructures)
84 #:use-module (gnu packages docbook)
85 #:use-module (gnu packages documentation)
86 #:use-module (gnu packages elf)
87 #:use-module (gnu packages flex)
88 #:use-module (gnu packages file)
89 #:use-module (gnu packages freedesktop)
90 #:use-module (gnu packages gcc)
91 #:use-module (gnu packages gettext)
92 #:use-module (gnu packages glib)
93 #:use-module (gnu packages golang)
94 #:use-module (gnu packages gperf)
95 #:use-module (gnu packages gstreamer)
96 #:use-module (gnu packages gtk)
97 #:use-module (gnu packages haskell-apps)
98 #:use-module (gnu packages haskell-xyz)
99 #:use-module (gnu packages libunwind)
100 #:use-module (gnu packages libusb)
101 #:use-module (gnu packages man)
102 #:use-module (gnu packages maths)
103 #:use-module (gnu packages multiprecision)
104 #:use-module (gnu packages ncurses)
105 #:use-module (gnu packages netpbm)
106 #:use-module (gnu packages networking)
107 #:use-module (gnu packages ninja)
108 #:use-module (gnu packages nss)
109 #:use-module (gnu packages perl)
110 #:use-module (gnu packages pciutils)
111 #:use-module (gnu packages pkg-config)
112 #:use-module (gnu packages popt)
113 #:use-module (gnu packages pulseaudio)
114 #:use-module (gnu packages python)
115 #:use-module (gnu packages python-xyz)
116 #:use-module (gnu packages readline)
117 #:use-module (gnu packages rrdtool)
118 #:use-module (gnu packages samba)
119 #:use-module (gnu packages sdl)
120 #:use-module (gnu packages serialization)
121 #:use-module (gnu packages slang)
122 #:use-module (gnu packages texinfo)
123 #:use-module (gnu packages tls)
124 #:use-module (gnu packages valgrind)
125 #:use-module (gnu packages video)
126 #:use-module (gnu packages web)
127 #:use-module (gnu packages xiph)
128 #:use-module (gnu packages xml)
129 #:use-module (gnu packages xdisorg)
130 #:use-module (gnu packages xorg)
131 #:use-module (gnu packages groff)
132 #:use-module (gnu packages rsync)
133 #:use-module (gnu packages selinux)
134 #:use-module (gnu packages swig)
135 #:use-module (guix build-system cmake)
136 #:use-module (guix build-system gnu)
137 #:use-module (guix build-system go)
138 #:use-module (guix build-system meson)
139 #:use-module (guix build-system python)
140 #:use-module (guix build-system trivial)
141 #:use-module (guix build-system linux-module)
142 #:use-module (guix download)
143 #:use-module (guix git-download)
144 #:use-module ((guix licenses) #:prefix license:)
145 #:use-module (guix packages)
146 #:use-module (guix gexp)
147 #:use-module (guix store)
148 #:use-module (guix monads)
149 #:use-module (guix utils)
150 #:use-module (srfi srfi-1)
151 #:use-module (srfi srfi-2)
152 #:use-module (srfi srfi-26)
153 #:use-module (ice-9 match))
155 (define-public (system->linux-architecture arch)
156 "Return the Linux architecture name for ARCH, a Guix system name such as
157 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
158 (let ((arch (car (string-split arch #\-))))
159 (cond ((string=? arch "i686") "i386")
160 ((string-prefix? "mips" arch) "mips")
161 ((string-prefix? "arm" arch) "arm")
162 ((string-prefix? "aarch64" arch) "arm64")
163 ((string-prefix? "alpha" arch) "alpha")
164 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
165 ((string-prefix? "s390" arch) "s390")
166 ((string-prefix? "riscv" arch) "riscv")
169 (define-public (system->defconfig system)
170 "Some systems (notably powerpc-linux) require a special target for kernel
171 defconfig. Return the appropriate make target if applicable, otherwise return
173 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
174 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
179 ;;; Kernel source code deblobbing.
182 (define (linux-libre-deblob-scripts version
185 (list (version-major+minor version)
188 (uri (string-append "https://linux-libre.fsfla.org"
189 "/pub/linux-libre/releases/" version "-gnu/"
190 "deblob-" (version-major+minor version)))
191 (sha256 deblob-hash))
194 (uri (string-append "https://linux-libre.fsfla.org"
195 "/pub/linux-libre/releases/" version "-gnu/"
197 (sha256 deblob-check-hash))))
199 (define deblob-scripts-5.7
200 (linux-libre-deblob-scripts
202 (base32 "1gharhw104wxp9dxjkzzvsqc2xn44mc9yvacc3v7jh7b6bb0a64a")
203 (base32 "1n198gx18rxc7xflgiwya43inkwayc91pgb129kngfza8sm6v8ks")))
205 (define deblob-scripts-5.4
206 (linux-libre-deblob-scripts
208 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
209 (base32 "10qb890is4z58vr8czh3xx69q62l3b3j38y410kgiw8nii3zx5lr")))
211 (define deblob-scripts-4.19
212 (linux-libre-deblob-scripts
214 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
215 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
217 (define deblob-scripts-4.14
218 (linux-libre-deblob-scripts
220 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
221 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
223 (define deblob-scripts-4.9
224 (linux-libre-deblob-scripts
226 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
227 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
229 (define deblob-scripts-4.4
230 (linux-libre-deblob-scripts
232 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
233 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
235 (define* (computed-origin-method gexp-promise hash-algo hash
236 #:optional (name "source")
237 #:key (system (%current-system))
238 (guile (default-guile)))
239 "Return a derivation that executes the G-expression that results
240 from forcing GEXP-PROMISE."
241 (mlet %store-monad ((guile (package->derivation guile system)))
242 (gexp->derivation (or name "computed-origin")
244 #:graft? #f ;nothing to graft
246 #:guile-for-build guile)))
248 (define (make-linux-libre-source version
251 "Return a 'computed' origin that generates a Linux-libre tarball from the
252 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
253 (match deblob-scripts
254 ((deblob-version (? origin? deblob) (? origin? deblob-check))
255 (unless (string=? deblob-version (version-major+minor version))
256 ;; The deblob script cannot be expected to work properly on a
257 ;; different version (major+minor) of Linux, even if no errors
258 ;; are signaled during execution.
259 (error "deblob major+minor version mismatch"))
261 (method computed-origin-method)
262 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
266 (with-imported-modules '((guix build utils))
268 (use-modules (guix build utils)
272 (let ((dir (string-append "linux-" #$version)))
275 (set-path-environment-variable
278 #+(canonical-package bash)
279 #+(canonical-package coreutils)
280 #+(canonical-package diffutils)
281 #+(canonical-package findutils)
282 #+(canonical-package patch)
283 #+(canonical-package xz)
284 #+(canonical-package sed)
285 #+(canonical-package grep)
286 #+(canonical-package bzip2)
287 #+(canonical-package gzip)
288 #+(canonical-package tar)
289 ;; The comments in the 'deblob-check' script
290 ;; claim that it supports Python 2 and 3, but
291 ;; in fact it fails when run in Python 3 as
295 (with-directory-excursion "/tmp/bin"
297 (copy-file #+deblob "deblob")
298 (chmod "deblob" #o755)
299 (substitute* "deblob"
300 (("/bin/sh") (which "sh")))
302 (copy-file #+deblob-check "deblob-check")
303 (chmod "deblob-check" #o755)
304 (substitute* "deblob-check"
305 (("/bin/sh") (which "sh"))
306 (("/bin/sed") (which "sed"))
307 (("/usr/bin/python") (which "python"))))
309 (if (file-is-directory? #+upstream-source)
311 (format #t "Copying upstream linux source...~%")
313 (invoke "cp" "--archive" #+upstream-source dir)
314 (invoke "chmod" "--recursive" "u+w" dir))
316 (format #t "Unpacking upstream linux tarball...~%")
318 (invoke "tar" "xf" #$upstream-source)
321 (and (not (member name '("." "..")))
322 (file-is-directory? name))))
324 (unless (string=? dir unpacked-dir)
325 (rename-file unpacked-dir dir)))
327 (error "multiple directories found" dirs)))))
329 (with-directory-excursion dir
330 (setenv "PYTHON" (which "python"))
331 (format #t "Running deblob script...~%")
333 (invoke "/tmp/bin/deblob"))
335 (format #t "~%Packing new Linux-libre tarball...~%")
337 (invoke "tar" "cvfa" #$output
338 ;; Avoid non-determinism in the archive.
351 (define (linux-libre-urls version)
352 "Return a list of URLs for Linux-Libre VERSION."
354 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
355 version "-gnu/linux-libre-" version "-gnu.tar.xz")
357 ;; XXX: Work around <http://bugs.gnu.org/14851>.
359 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
360 version "-gnu.tar.xz")
362 ;; Maybe this URL will become valid eventually.
364 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
365 version "-gnu.tar.xz")))
367 (define (%upstream-linux-source version hash)
370 (uri (string-append "mirror://kernel.org"
371 "/linux/kernel/v" (version-major version) ".x/"
372 "linux-" version ".tar.xz"))
376 (define-public linux-libre-5.7-version "5.7.8")
377 (define-public linux-libre-5.7-pristine-source
378 (let ((version linux-libre-5.7-version)
379 (hash (base32 "1ijdhjik5hlaj8w32qf5x4gigf2aa6xkg68hckm5h1s0isw7gddg")))
380 (make-linux-libre-source version
381 (%upstream-linux-source version hash)
382 deblob-scripts-5.7)))
384 (define-public linux-libre-5.4-version "5.4.51")
385 (define-public linux-libre-5.4-pristine-source
386 (let ((version linux-libre-5.4-version)
387 (hash (base32 "1786l83nwzjazr2rl5fwxpw9dzlggi33nnj9grmp4dnn9j5ym2wy")))
388 (make-linux-libre-source version
389 (%upstream-linux-source version hash)
390 deblob-scripts-5.4)))
392 (define-public linux-libre-4.19-version "4.19.132")
393 (define-public linux-libre-4.19-pristine-source
394 (let ((version linux-libre-4.19-version)
395 (hash (base32 "0i3xka0n26iqslvc8xzxlcig3gjwfprzgdwd1q3wrr1cjsafxmyp")))
396 (make-linux-libre-source version
397 (%upstream-linux-source version hash)
398 deblob-scripts-4.19)))
400 (define-public linux-libre-4.14-version "4.14.188")
401 (define-public linux-libre-4.14-pristine-source
402 (let ((version linux-libre-4.14-version)
403 (hash (base32 "0jq6cyxa0mxnvd33gi66a4x3xlfsih2aaifa6yyvgldihw9y0vvn")))
404 (make-linux-libre-source version
405 (%upstream-linux-source version hash)
406 deblob-scripts-4.14)))
408 (define-public linux-libre-4.9-version "4.9.230")
409 (define-public linux-libre-4.9-pristine-source
410 (let ((version linux-libre-4.9-version)
411 (hash (base32 "0z03djys7k3z6z55xrw8rj4mv5i4h763lckz2anwxwgbwdb95fnm")))
412 (make-linux-libre-source version
413 (%upstream-linux-source version hash)
414 deblob-scripts-4.9)))
416 (define-public linux-libre-4.4-version "4.4.230")
417 (define-public linux-libre-4.4-pristine-source
418 (let ((version linux-libre-4.4-version)
419 (hash (base32 "1qx74qli8yjc2rkb7kig79c1yv7pfqa8zi1wi0rndn4d4yk62cfa")))
420 (make-linux-libre-source version
421 (%upstream-linux-source version hash)
422 deblob-scripts-4.4)))
424 (define %boot-logo-patch
425 ;; Linux-Libre boot logo featuring Freedo and a gnu.
428 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
429 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
432 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
434 (define %linux-libre-arm-export-__sync_icache_dcache-patch
438 "https://salsa.debian.org/kernel-team/linux"
439 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
440 "/debian/patches/bugfix/arm/"
441 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
442 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
444 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
446 (define (source-with-patches source patches)
449 (patches (append (origin-patches source)
452 (define-public linux-libre-5.7-source
453 (source-with-patches linux-libre-5.7-pristine-source
454 (list %boot-logo-patch
455 %linux-libre-arm-export-__sync_icache_dcache-patch)))
457 (define-public linux-libre-5.4-source
458 (source-with-patches linux-libre-5.4-pristine-source
459 (list %boot-logo-patch
460 %linux-libre-arm-export-__sync_icache_dcache-patch
461 ;; Pinebook Pro patch from linux-next,
462 ;; can be dropped for linux-libre 5.7
464 "linux-libre-support-for-Pinebook-Pro.patch"))))
466 (define-public linux-libre-4.19-source
467 (source-with-patches linux-libre-4.19-pristine-source
468 (list %boot-logo-patch
469 %linux-libre-arm-export-__sync_icache_dcache-patch)))
471 (define-public linux-libre-4.14-source
472 (source-with-patches linux-libre-4.14-pristine-source
473 (list %boot-logo-patch)))
475 (define-public linux-libre-4.9-source
476 (source-with-patches linux-libre-4.9-pristine-source
477 (list %boot-logo-patch)))
479 (define-public linux-libre-4.4-source
480 (source-with-patches linux-libre-4.4-pristine-source
481 (list %boot-logo-patch)))
488 (define (make-linux-libre-headers version hash-string)
489 (make-linux-libre-headers* version
492 (uri (linux-libre-urls version))
493 (sha256 (base32 hash-string)))))
495 (define (make-linux-libre-headers* version source)
497 (name "linux-libre-headers")
500 (build-system gnu-build-system)
501 (native-inputs `(("perl" ,perl)
502 ,@(if (version>=? version "4.16")
506 ,@(if (version>=? version "5.3")
510 `(#:modules ((guix build gnu-build-system)
514 (modify-phases %standard-phases
518 (let ((arch ,(system->linux-architecture
519 (or (%current-target-system)
521 (defconfig ,(system->defconfig
522 (or (%current-target-system)
523 (%current-system)))))
525 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
526 (invoke "make" defconfig)
527 (invoke "make" "mrproper" "headers_check"))))
529 (lambda* (#:key outputs #:allow-other-keys)
530 (let ((out (assoc-ref outputs "out")))
532 (string-append "INSTALL_HDR_PATH=" out)
535 (mkdir (string-append out "/include/config"))
536 (call-with-output-file
538 "/include/config/kernel.release")
540 (format p "~a-default~%" ,version)))
542 ;; Remove the '.install' and '..install.cmd' files; the
543 ;; latter contains store paths, which pulls in bootstrap
544 ;; binaries in the build environment, and prevents bit
545 ;; reproducibility for the bootstrap binaries.
546 (for-each delete-file (find-files out "\\.install"))
549 #:allowed-references ()
551 (home-page "https://www.gnu.org/software/linux-libre/")
552 (synopsis "GNU Linux-Libre kernel headers")
553 (description "Headers of the Linux-Libre kernel.")
554 (license license:gpl2)))
556 (define-public linux-libre-headers-5.7
557 (make-linux-libre-headers* linux-libre-5.7-version
558 linux-libre-5.7-source))
560 (define-public linux-libre-headers-5.4
561 (make-linux-libre-headers* linux-libre-5.4-version
562 linux-libre-5.4-source))
564 (define-public linux-libre-headers-4.19
565 (make-linux-libre-headers* linux-libre-4.19-version
566 linux-libre-4.19-source))
568 (define-public linux-libre-headers-4.14
569 (make-linux-libre-headers* linux-libre-4.14-version
570 linux-libre-4.14-source))
572 (define-public linux-libre-headers-4.9
573 (make-linux-libre-headers* linux-libre-4.9-version
574 linux-libre-4.9-source))
576 (define-public linux-libre-headers-4.4
577 (make-linux-libre-headers* linux-libre-4.4-version
578 linux-libre-4.4-source))
580 ;; The following package is used in the early bootstrap, and thus must be kept
581 ;; stable and with minimal build requirements.
582 (define-public linux-libre-headers-5.4.20
583 (make-linux-libre-headers "5.4.20"
584 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
586 (define-public linux-libre-headers linux-libre-headers-5.4.20)
590 ;;; Kernel configurations.
593 (define* (kernel-config arch #:key variant)
594 "Return the absolute file name of the Linux-Libre build configuration file
595 for ARCH and optionally VARIANT, or #f if there is no such configuration."
596 (let* ((name (string-append (if variant (string-append variant "-") "")
597 (if (string=? "i386" arch) "i686" arch) ".conf"))
598 (file (string-append "linux-libre/" name)))
599 (search-auxiliary-file file)))
601 (define %default-extra-linux-options
602 `(;; Some very mild hardening.
603 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
604 ;; All kernels should have NAMESPACES options enabled
605 ("CONFIG_NAMESPACES" . #t)
606 ("CONFIG_UTS_NS" . #t)
607 ("CONFIG_IPC_NS" . #t)
608 ("CONFIG_USER_NS" . #t)
609 ("CONFIG_PID_NS" . #t)
610 ("CONFIG_NET_NS" . #t)
611 ;; Modules required for initrd:
612 ("CONFIG_NET_9P" . m)
613 ("CONFIG_NET_9P_VIRTIO" . m)
614 ("CONFIG_VIRTIO_BLK" . m)
615 ("CONFIG_VIRTIO_NET" . m)
616 ("CONFIG_VIRTIO_PCI" . m)
617 ("CONFIG_VIRTIO_BALLOON" . m)
618 ("CONFIG_VIRTIO_MMIO" . m)
619 ("CONFIG_FUSE_FS" . m)
621 ("CONFIG_9P_FS" . m)))
623 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
624 (define %bpf-extra-linux-options
625 `(;; Needed for probes
626 ("CONFIG_UPROBE_EVENTS" . #t)
627 ("CONFIG_KPROBE_EVENTS" . #t)
628 ;; kheaders module also helpful for tracing
629 ("CONFIG_IKHEADERS" . #t)
631 ("CONFIG_BPF_SYSCALL" . #t)
632 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
633 ;; optional, for tc filters
634 ("CONFIG_NET_CLS_BPF" . m)
635 ;; optional, for tc actions
636 ("CONFIG_NET_ACT_BPF" . m)
637 ("CONFIG_BPF_JIT" . #t)
638 ;; for Linux kernel versions 4.1 through 4.6
639 ;; ("CONFIG_HAVE_BPF_JIT" . y)
640 ;; for Linux kernel versions 4.7 and later
641 ("CONFIG_HAVE_EBPF_JIT" . #t)
642 ;; optional, for kprobes
643 ("CONFIG_BPF_EVENTS" . #t)
645 ("CONFIG_IKHEADERS" . #t)))
647 (define (config->string options)
648 (string-join (map (match-lambda
650 (string-append option "=m"))
652 (string-append option "=y"))
654 (string-append option "=n")))
660 ;;; Kernel package utilities.
663 (define* (make-linux-libre version hash-string supported-systems
665 ;; A function that takes an arch and a variant.
666 ;; See kernel-config for an example.
668 (configuration-file #f)
669 (defconfig "defconfig")
670 (extra-options %default-extra-linux-options)
671 (patches (list %boot-logo-patch)))
672 (make-linux-libre* version
675 (uri (linux-libre-urls version))
676 (sha256 (base32 hash-string))
679 #:extra-version extra-version
680 #:configuration-file configuration-file
681 #:defconfig defconfig
682 #:extra-options extra-options))
684 (define* (make-linux-libre* version source supported-systems
686 ;; A function that takes an arch and a variant.
687 ;; See kernel-config for an example.
689 (configuration-file #f)
690 (defconfig "defconfig")
691 (extra-options %default-extra-linux-options))
693 (name (if extra-version
694 (string-append "linux-libre-" extra-version)
698 (supported-systems supported-systems)
699 (build-system gnu-build-system)
704 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
708 ;; These are needed to compile the GCC plugins.
713 ,@(match (and configuration-file
715 (system->linux-architecture
716 (or (%current-target-system) (%current-system)))
717 #:variant (version-major+minor version)))
718 (#f ;no config for this platform
721 `(("kconfig" ,config))))))
723 `(#:modules ((guix build gnu-build-system)
730 (modify-phases %standard-phases
731 (add-after 'unpack 'patch-/bin/pwd
733 (substitute* (find-files "." "^Makefile(\\.include)?$")
734 (("/bin/pwd") "pwd"))
737 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
738 ;; Avoid introducing timestamps
739 (setenv "KCONFIG_NOTIMESTAMP" "1")
740 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
742 ;; Set ARCH and CROSS_COMPILE
743 (let ((arch ,(system->linux-architecture
744 (or (%current-target-system)
745 (%current-system)))))
747 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
750 (setenv "CROSS_COMPILE" (string-append target "-"))
751 (format #t "`CROSS_COMPILE' set to `~a'~%"
752 (getenv "CROSS_COMPILE"))))
754 (setenv "EXTRA_VERSION" ,extra-version)
756 (let ((build (assoc-ref %standard-phases 'build))
757 (config (assoc-ref (or native-inputs inputs) "kconfig")))
759 ;; Use a custom kernel configuration file or a default
760 ;; configuration file.
763 (copy-file config ".config")
764 (chmod ".config" #o666))
765 (invoke "make" ,defconfig))
767 ;; Appending works even when the option wasn't in the
768 ;; file. The last one prevails if duplicated.
769 (let ((port (open-file ".config" "a"))
770 (extra-configuration ,(config->string extra-options)))
771 (display extra-configuration port)
774 (invoke "make" "oldconfig"))))
776 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
777 (let* ((out (assoc-ref outputs "out"))
778 (moddir (string-append out "/lib/modules"))
779 (dtbdir (string-append out "/lib/dtbs")))
780 ;; Install kernel image, kernel configuration and link map.
781 (for-each (lambda (file) (install-file file out))
782 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
783 ;; Install device tree files
784 (unless (null? (find-files "." "\\.dtb$"))
786 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
788 ;; Install kernel modules
791 ;; Disable depmod because the Guix system's module directory
792 ;; is an union of potentially multiple packages. It is not
793 ;; possible to use depmod to usefully calculate a dependency
794 ;; graph while building only one of those packages.
796 (string-append "MODULE_DIR=" moddir)
797 (string-append "INSTALL_PATH=" out)
798 (string-append "INSTALL_MOD_PATH=" out)
799 "INSTALL_MOD_STRIP=1"
801 (let* ((versions (filter (lambda (name)
802 (not (string-prefix? "." name)))
804 (version (match versions
806 ;; There are symlinks to the build and source directory,
807 ;; both of which will point to target /tmp/guix-build*
808 ;; and thus not be useful in a profile. Delete the symlinks.
809 (false-if-file-not-found
810 (delete-file (string-append moddir "/" version "/build")))
811 (false-if-file-not-found
812 (delete-file (string-append moddir "/" version "/source"))))
815 (home-page "https://www.gnu.org/software/linux-libre/")
816 (synopsis "100% free redistribution of a cleaned Linux kernel")
818 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
819 It has been modified to remove all non-free binary blobs.")
820 (license license:gpl2)))
824 ;;; Generic kernel packages.
827 (define-public linux-libre-5.4
828 (make-linux-libre* linux-libre-5.4-version
829 linux-libre-5.4-source
830 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
831 #:configuration-file kernel-config))
833 (define-public linux-libre-version linux-libre-5.4-version)
834 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
835 (define-public linux-libre-source linux-libre-5.4-source)
836 (define-public linux-libre linux-libre-5.4)
838 (define-public linux-libre-4.19
839 (make-linux-libre* linux-libre-4.19-version
840 linux-libre-4.19-source
841 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
842 #:configuration-file kernel-config))
844 (define-public linux-libre-4.14
845 (make-linux-libre* linux-libre-4.14-version
846 linux-libre-4.14-source
847 '("x86_64-linux" "i686-linux" "armhf-linux")
848 #:configuration-file kernel-config))
850 (define-public linux-libre-4.9
851 (make-linux-libre* linux-libre-4.9-version
852 linux-libre-4.9-source
853 '("x86_64-linux" "i686-linux")
854 #:configuration-file kernel-config))
856 (define-public linux-libre-4.4
857 (make-linux-libre* linux-libre-4.4-version
858 linux-libre-4.4-source
859 '("x86_64-linux" "i686-linux")
860 #:configuration-file kernel-config
863 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
864 ;; This option was removed upstream in version 4.7.
865 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
866 %default-extra-linux-options)))
870 ;;; Specialized kernel variants.
873 (define-public linux-libre-arm-generic
874 (make-linux-libre* linux-libre-version
877 #:defconfig "multi_v7_defconfig"
878 #:extra-version "arm-generic"
881 `(;; needed to fix the RTC on rockchip platforms
882 ("CONFIG_RTC_DRV_RK808" . #t))
883 %default-extra-linux-options)))
885 (define-public linux-libre-arm-generic-5.7
886 (make-linux-libre* linux-libre-5.7-version
887 linux-libre-5.7-source
889 #:defconfig "multi_v7_defconfig"
890 #:extra-version "arm-generic"
893 `(;; needed to fix the RTC on rockchip platforms
894 ("CONFIG_RTC_DRV_RK808" . #t))
895 %default-extra-linux-options)))
897 (define-public linux-libre-arm-veyron
898 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
900 (define-public linux-libre-arm-generic-4.19
901 (make-linux-libre* linux-libre-4.19-version
902 linux-libre-4.19-source
904 #:defconfig "multi_v7_defconfig"
905 #:extra-version "arm-generic"))
907 (define-public linux-libre-arm-generic-4.14
908 (make-linux-libre* linux-libre-4.14-version
909 linux-libre-4.14-source
911 #:defconfig "multi_v7_defconfig"
912 #:extra-version "arm-generic"))
914 (define-public linux-libre-arm-omap2plus
915 (make-linux-libre* linux-libre-version
918 #:defconfig "omap2plus_defconfig"
919 #:extra-version "arm-omap2plus"))
921 (define-public linux-libre-arm-omap2plus-4.19
922 (make-linux-libre* linux-libre-4.19-version
923 linux-libre-4.19-source
925 #:defconfig "omap2plus_defconfig"
926 #:extra-version "arm-omap2plus"))
928 (define-public linux-libre-arm-omap2plus-4.14
929 (make-linux-libre* linux-libre-4.14-version
930 linux-libre-4.14-source
932 #:defconfig "omap2plus_defconfig"
933 #:extra-version "arm-omap2plus"))
935 (define-public linux-libre-arm64-generic
936 (make-linux-libre* linux-libre-version
939 #:defconfig "defconfig"
940 #:extra-version "arm64-generic"
943 `(;; needed to fix the RTC on rockchip platforms
944 ("CONFIG_RTC_DRV_RK808" . #t))
945 %default-extra-linux-options)))
947 (define-public linux-libre-arm64-generic-5.7
948 (make-linux-libre* linux-libre-5.7-version
949 linux-libre-5.7-source
951 #:defconfig "defconfig"
952 #:extra-version "arm64-generic"
955 `(;; needed to fix the RTC on rockchip platforms
956 ("CONFIG_RTC_DRV_RK808" . #t))
957 %default-extra-linux-options)))
959 (define-public linux-libre-riscv64-generic
960 (make-linux-libre* linux-libre-version
963 #:extra-version "riscv64-generic"))
965 (define-public linux-libre-with-bpf
966 (let ((base-linux-libre
968 linux-libre-5.4-version
969 linux-libre-5.4-source
970 '("x86_64-linux" "i686-linux" "armhf-linux"
971 "aarch64-linux" "riscv64-linux")
972 #:extra-version "bpf"
973 #:configuration-file kernel-config
975 (append %bpf-extra-linux-options
976 %default-extra-linux-options))))
978 (inherit base-linux-libre)
979 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
984 ;;; Linux kernel modules.
987 (define-public acpi-call-linux-module
988 (let ((commit "70b9c80bd700e6a4d10797eaac9fd34b7e8cbd4a")
991 (name "acpi-call-linux-module")
992 (version (git-version "3.17" revision commit))
997 (url "https://github.com/teleshoes/acpi_call.git")
999 (file-name (git-file-name name version))
1001 (base32 "09c1vw6vcrkqxbwhpgfgpj4d1grzn4qq6ka8pwwzm7cvm405xj7x"))))
1002 (build-system linux-module-build-system)
1004 `(#:tests? #f ; no tests
1006 (modify-phases %standard-phases
1007 (add-after 'install 'install-documentation
1008 (lambda* (#:key outputs #:allow-other-keys)
1009 (let* ((out (assoc-ref outputs "out"))
1010 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1011 (for-each (lambda (file)
1012 (let ((target (string-append doc "/" file)))
1013 (mkdir-p (dirname target))
1014 (copy-recursively file target)))
1015 (list "README.md" "examples"))
1017 (home-page "https://github.com/teleshoes/acpi_call")
1018 (synopsis "Linux kernel module to perform ACPI method calls")
1020 "This simple Linux kernel module allows calls from user space to any
1021 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1022 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1023 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1024 and @code{ACPI_BUFFER}.
1026 It grants direct and undocumented access to your hardware that may cause damage
1027 and should be used with caution, especially on untested models.")
1028 (license license:gpl3+)))) ; see README.md (no licence headers)
1030 (define-public rtl8812au-aircrack-ng-linux-module
1031 (let ((commit "df2b8dfd8cb7d9f6cfeb55abaeab8a5372011fc9")
1034 (name "rtl8812au-aircrack-ng-linux-module")
1035 (version (git-version "5.6.4.2" revision commit))
1040 (url "https://github.com/aircrack-ng/rtl8812au.git")
1042 (file-name (git-file-name name version))
1044 (base32 "1qcr0j8yhg8l9l0f5y55zcsk1mgf3qd46yh9xfqgg91szxa3yvca"))
1045 (modules '((guix build utils)))
1048 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1049 ;; and other unnecessary unlicenced things.
1050 (for-each delete-file-recursively (list "android"
1054 (build-system linux-module-build-system)
1057 (list (string-append "KSRC="
1058 (assoc-ref %build-inputs "linux-module-builder")
1059 "/lib/modules/build"))
1061 (modify-phases %standard-phases
1063 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1064 (apply invoke "make" make-flags))))
1065 #:tests? #f)) ; no test suite
1066 (supported-systems '("x86_64-linux" "i686-linux"))
1067 (home-page "https://github.com/aircrack-ng/rtl8812au")
1068 (synopsis "Linux driver for Realtek USB wireless network adapters")
1070 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1071 network adapters, modified by the aircrack-ng project to support monitor mode
1072 and frame injection. It provides a @code{88XXau} kernel module that supports
1073 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1074 (license license:gpl2+))))
1076 (define-public rtl8821ce-linux-module
1077 (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea")
1080 (name "rtl8821ce-linux-module")
1081 (version (git-version "0.0.0" revision commit))
1086 (url "https://github.com/tomaspinho/rtl8821ce.git")
1088 (file-name (git-file-name name version))
1091 "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))
1092 (build-system linux-module-build-system)
1096 (string-append "KSRC="
1097 (assoc-ref %build-inputs "linux-module-builder")
1098 "/lib/modules/build"))
1100 (modify-phases %standard-phases
1102 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1103 (apply invoke "make" make-flags))))
1104 #:tests? #f)) ; no test suite
1105 (home-page "https://github.com/tomaspinho/rtl8821ce")
1106 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1107 (description "This is Realtek's RTL8821CE Linux driver for wireless
1109 (license license:gpl2))))
1111 (define-public vhba-module
1113 (name "vhba-module")
1114 (version "20200106")
1118 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1119 version ".tar.bz2"))
1122 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1123 (build-system linux-module-build-system)
1127 (home-page "https://cdemu.sourceforge.io/")
1128 (synopsis "Kernel module that emulates SCSI devices")
1129 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1130 between the CDemu userspace daemon and linux kernel.")
1131 (license license:gpl2+)))
1133 (define-public bbswitch-module
1135 (name "bbswitch-module")
1140 (url "https://github.com/Bumblebee-Project/bbswitch")
1141 (commit (string-append "v" version))))
1142 (file-name (git-file-name name version))
1145 "1glch4j0x1dzlp2yrb67v2r5jg9609jb6p8m251y78m74advqw0l"))))
1146 (build-system linux-module-build-system)
1150 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1151 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1152 (description "The bbswitch module provides a way to toggle the Nvidia
1153 graphics card on Optimus laptops.")
1154 (license license:gpl2)))
1156 (define-public ddcci-driver-linux
1158 (name "ddcci-driver-linux")
1165 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1166 (commit (string-append "v" version))))
1167 (file-name (git-file-name name version))
1170 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1171 (build-system linux-module-build-system)
1173 `(#:tests? #f ; no tests
1175 (modify-phases %standard-phases
1180 (with-directory-excursion module
1181 (apply (assoc-ref %standard-phases 'build) args)))
1182 '("ddcci" "ddcci-backlight"))
1188 (with-directory-excursion module
1189 (apply (assoc-ref %standard-phases 'install) args)))
1190 '("ddcci" "ddcci-backlight"))
1192 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1193 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1194 (description "This package provides two Linux kernel drivers, ddcci and
1195 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1196 interface. The ddcci module creates a character device for each DDC/CI
1197 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1198 module allows the control of the backlight level or luminance property when
1199 supported under @file{/sys/class/backlight/}.")
1200 (license license:gpl2+)))
1202 (define-public v4l2loopback-linux-module
1204 (name "v4l2loopback-linux-module")
1209 (url "https://github.com/umlaeute/v4l2loopback.git")
1210 (commit (string-append "v" version))))
1211 (file-name (git-file-name name version))
1214 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1215 (build-system linux-module-build-system)
1217 `(#:tests? #f)) ; no test suite
1218 (home-page "https://github.com/umlaeute/v4l2loopback")
1219 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1221 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1222 for Linux 2} applications will treat these as ordinary video devices but read
1223 video data generated by another application, instead of a hardware device such
1226 This lets you apply nifty effects to your Jitsi video, for example, but also
1227 allows some more serious things like adding streaming capabilities to an
1228 application by hooking GStreamer into the loopback device.")
1229 (license license:gpl2+)))
1233 ;;; Pluggable authentication modules (PAM).
1236 (define-public linux-pam
1244 "https://github.com/linux-pam/linux-pam/releases/download/v"
1245 version "/Linux-PAM-" version ".tar.xz"))
1248 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1249 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1251 (build-system gnu-build-system)
1255 ;; TODO: optional dependencies
1256 ;; ("libxcrypt" ,libxcrypt)
1257 ;; ("cracklib" ,cracklib)
1260 `(;; Most users, such as `shadow', expect the headers to be under
1262 #:configure-flags (list (string-append "--includedir="
1263 (assoc-ref %outputs "out")
1264 "/include/security")
1266 ;; XXX: <rpc/rpc.h> is missing from glibc when
1267 ;; cross-compiling, so we have to disable NIS
1268 ;; support altogether.
1269 ,@(if (%current-target-system)
1273 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1276 (home-page "http://www.linux-pam.org/")
1277 (synopsis "Pluggable authentication modules for Linux")
1279 "A *Free* project to implement OSF's RFC 86.0.
1280 Pluggable authentication modules are small shared object files that can
1281 be used through the PAM API to perform tasks, like authenticating a user
1282 at login. Local and dynamic reconfiguration are its key features.")
1283 (license license:bsd-3)))
1285 (define-public linux-pam-1.2
1293 "http://www.linux-pam.org/library/"
1294 "Linux-PAM-" version ".tar.bz2"))
1297 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1298 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1305 (define-public powerstat
1312 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1313 "powerstat/powerstat-" version ".tar.gz"))
1315 (base32 "0r355b9syqa2nhfy8ksvxyy5d58v0isf983842js091s6liy0x7g"))))
1316 (build-system gnu-build-system)
1319 (list (string-append "CC=" ,(cc-for-target))
1320 (string-append "prefix=" (assoc-ref %outputs "out")))
1321 #:tests? #f ; no test suite
1323 (modify-phases %standard-phases
1324 (add-after 'unpack 'respect-$prefix
1325 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1327 (substitute* "Makefile"
1328 (("DIR=/usr/") "DIR=$(prefix)/"))
1330 (delete 'configure)))) ; no configure script
1331 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1332 (synopsis "Measure system power consumption")
1334 "Powerstat measures and reports your computer's power consumption in real
1335 time. On mobile PCs, it uses ACPI battery information to measure the power
1336 drain of the entire system.
1338 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1339 domain measurements. These are available only on some hardware such as Intel
1340 Sandybridge and newer, and cover only part of the machine's components such as
1341 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1342 and don't require a battery at all.
1344 The output is like @command{vmstat} but also shows power consumption statistics:
1345 at the end of a run, @command{powerstat} will calculate the average, standard
1346 deviation, and minimum and maximum values. It can show a nice histogram too.")
1347 (license license:gpl2)))
1349 (define-public psmisc
1356 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1359 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1360 (build-system gnu-build-system)
1362 `(,@(if (%current-target-system)
1365 "ac_cv_func_malloc_0_nonnull=yes"
1366 "ac_cv_func_realloc_0_nonnull=yes"))
1368 (inputs `(("ncurses" ,ncurses)))
1369 (home-page "https://gitlab.com/psmisc/psmisc")
1370 (synopsis "Small utilities that use the proc file system")
1372 "This PSmisc package is a set of some small useful utilities that
1373 use the proc file system. We're not about changing the world, but
1374 providing the system administrator with some help in common tasks.")
1375 (license license:gpl2+)))
1377 (define-public util-linux
1383 (uri (string-append "mirror://kernel.org/linux/utils/"
1384 "util-linux/v" (version-major+minor version) "/"
1385 "util-linux-" version ".tar.xz"))
1388 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1389 (patches (search-patches "util-linux-tests.patch"))
1390 (modules '((guix build utils)))
1392 ;; We take 'nologin' from Shadow, the 'logger' program from
1393 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1395 (substitute* "configure"
1396 (("build_nologin=yes") "build_nologin=no")
1397 (("build_logger=yes") "build_logger=no")
1398 (("build_kill=yes") "build_kill=no"))
1400 (build-system gnu-build-system)
1401 (outputs '("out" ;6.4 MiB executables and documentation
1402 "lib" ;8.8 MiB shared libraries, headers and locales
1403 "static")) ;2.9 MiB static .a libraries
1405 `(#:configure-flags (list "--disable-use-tty-group"
1406 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1407 ;; Don't try to chown root:root mount and umount
1408 "--disable-makeinstall-chown"
1409 "--localstatedir=/var"
1410 (string-append "--localedir="
1411 (assoc-ref %outputs "lib")
1413 ;; Install completions where our
1414 ;; bash-completion package expects them.
1415 (string-append "--with-bashcompletiondir="
1416 (assoc-ref %outputs "out")
1417 "/etc/bash_completion.d"))
1418 #:phases (modify-phases %standard-phases
1419 (add-before 'configure 'patch-build-scripts
1420 (lambda* (#:key outputs #:allow-other-keys)
1421 (substitute* "configure"
1422 ;; The build system assumes that we want to install
1423 ;; libraries below $exec_prefix when $libdir does not
1424 ;; match any of the "usual" locations. Fix that.
1425 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1426 "usrlib_execdir=$libdir"))
1428 (add-before 'build 'set-umount-file-name
1429 (lambda* (#:key outputs #:allow-other-keys)
1430 ;; Tell 'eject' the right file name of 'umount'.
1431 (let ((out (assoc-ref outputs "out")))
1432 (substitute* "sys-utils/eject.c"
1433 (("\"/bin/umount\"")
1434 (string-append "\"" out "/bin/umount\"")))
1436 (add-before 'check 'pre-check
1437 (lambda* (#:key inputs outputs #:allow-other-keys)
1438 (let ((out (assoc-ref outputs "out"))
1439 (net (assoc-ref inputs "net-base")))
1440 ;; Change the test to refer to the right file.
1441 (substitute* "tests/ts/misc/mcookie"
1443 (string-append net "/etc/services")))
1445 ;; The C.UTF-8 locale does not exist in our libc.
1446 (substitute* "tests/ts/column/invalid-multibyte"
1447 (("C\\.UTF-8") "en_US.utf8"))
1449 ;; TODO: Remove the conditional on the next rebuild cycle.
1450 ,@(if (string-prefix? "arm" (%current-system))
1451 '((add-before 'check 'disable-setarch-test
1453 ;; The setarch tests are unreliable in QEMU's
1454 ;; user-mode emulation, which is our primary
1455 ;; method of building ARMv7 packages.
1456 ;; <https://github.com/karelzak/util-linux/issues/601>
1457 (substitute* "tests/ts/misc/setarch"
1458 (("ts_init_subtest.*" all)
1461 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1464 (add-after 'install 'move-static-libraries
1465 (lambda* (#:key outputs #:allow-other-keys)
1466 (let ((lib (assoc-ref outputs "lib"))
1467 (static (assoc-ref outputs "static")))
1469 ;; Move static libraries to the "static" output.
1470 (mkdir-p (string-append static "/lib"))
1471 (with-directory-excursion lib
1472 (for-each (lambda (file)
1474 (string-append static "/"
1476 (find-files "lib" "\\.a$"))
1478 ;; Remove references to the static library from the '.la'
1479 ;; files so that Libtool does the right thing when both
1480 ;; the shared and static library is available.
1481 (substitute* (find-files "lib" "\\.la$")
1482 (("old_library=.*") "old_library=''\n")))
1485 (add-after 'install 'adjust-pkg-config-files
1486 (lambda* (#:key outputs #:allow-other-keys)
1487 (let ((lib (assoc-ref outputs "lib")))
1488 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1489 ;; the pkg-config files to avoid a cyclic reference on "out".
1490 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1492 (("^(exec_)?prefix=.*") "")))
1494 (inputs `(("zlib" ,zlib)
1495 ("ncurses" ,ncurses)
1497 ;; XXX: This is so that the 'pre-check' phase can find it.
1498 ,@(if (%current-target-system)
1499 `(("net-base" ,net-base))
1503 ("net-base" ,net-base))) ;for tests
1504 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1505 (synopsis "Collection of utilities for the Linux kernel")
1506 (description "Util-linux is a diverse collection of Linux kernel
1507 utilities. It provides dmesg and includes tools for working with file systems,
1508 block devices, UUIDs, TTYs, and many other tools.")
1510 ;; Note that util-linux doesn't use the same license for all the
1511 ;; code. GPLv2+ is the default license for a code without an
1512 ;; explicitly defined license.
1513 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1514 license:bsd-4 license:public-domain))))
1516 ;; util-linux optionally supports udev, which allows lsblk to read file system
1517 ;; metadata without special privileges. Add it as a separate package to avoid
1518 ;; a circular dependency, and to keep the size small.
1519 (define-public util-linux+udev
1522 (name "util-linux-with-udev")
1525 ,@(package-inputs util-linux)))))
1527 (define-public ddate
1534 (url "https://github.com/bo0ts/ddate")
1535 (commit (string-append "v" version))))
1536 (file-name (git-file-name name version))
1538 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1539 (build-system cmake-build-system)
1540 (arguments '(#:tests? #f))
1541 (home-page "https://github.com/bo0ts/ddate")
1542 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1544 "ddate displays the Discordian date and holidays of a given date.
1545 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1546 by Robert Shea and Robert Anton Wilson.")
1547 (license license:public-domain)))
1549 (define-public fbset
1556 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1559 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1560 (build-system gnu-build-system)
1562 '(#:modules ((guix build gnu-build-system)
1566 (modify-phases %standard-phases
1567 (delete 'configure) ; no configure script
1568 (add-before 'install 'pre-install
1569 (lambda* (#:key outputs #:allow-other-keys)
1570 (let ((out (assoc-ref outputs "out")))
1571 (substitute* "Makefile"
1572 (("mknod ") "true ")
1573 ;; The Makefile doesn't honour PREFIX or similar.
1576 (with-directory-excursion out
1577 (for-each mkdir-p (list "sbin"
1581 (add-after 'install 'install-fb.modes
1582 (lambda* (#:key outputs #:allow-other-keys)
1583 (let* ((out (assoc-ref outputs "out"))
1584 (etc (string-append out "/etc")))
1585 (for-each (cut install-file <> etc)
1586 (find-files "etc" "^fb\\.modes"))
1587 (symlink "fb.modes.ATI"
1588 (string-append etc "/fb.modes"))
1590 ;; Parallel building races to create modes.tab.c.
1591 #:parallel-build? #f
1592 #:tests? #f)) ; no test suite
1596 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1597 (synopsis "Show and modify Linux frame buffer settings")
1599 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1600 different kinds of graphic displays. The @command{fbset} utility can query and
1601 change various device settings such as depth, virtual resolution, and timing
1603 (license license:gpl2)))
1605 (define-public procps
1611 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1612 "procps-ng-" version ".tar.xz"))
1615 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1616 (build-system gnu-build-system)
1618 `(#:modules ((guix build utils)
1619 (guix build gnu-build-system)
1622 ,@(if (%current-target-system)
1625 "ac_cv_func_malloc_0_nonnull=yes"
1626 "ac_cv_func_realloc_0_nonnull=yes"))
1629 (modify-phases %standard-phases
1631 'install 'post-install
1632 ;; Remove commands and man pages redudant with
1634 (lambda* (#:key outputs #:allow-other-keys)
1635 (let* ((out (assoc-ref outputs "out"))
1636 (dup (append-map (cut find-files out <>)
1637 '("^kill" "^uptime"))))
1638 (for-each delete-file dup)
1640 (inputs `(("ncurses" ,ncurses)))
1641 (home-page "https://gitlab.com/procps-ng/procps/")
1642 (synopsis "Utilities that give information about processes")
1644 "Procps is the package that has a bunch of small useful utilities
1645 that give information about processes using the Linux /proc file system.
1646 The package includes the programs ps, top, vmstat, w, kill, free,
1647 slabtop, and skill.")
1648 (license license:gpl2)))
1650 (define-public usbutils
1657 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1658 "usbutils-" version ".tar.xz"))
1660 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1661 (build-system gnu-build-system)
1662 (outputs (list "out" "python"))
1665 (modify-phases %standard-phases
1666 (add-before 'bootstrap 'patch-bootstrap-scripts
1668 (substitute* "usbhid-dump/bootstrap"
1669 (("/bin/bash") (which "bash")))
1671 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1672 (substitute* "autogen.sh"
1673 (("^\\./configure.*") ""))
1675 (add-after 'install 'separate-python-output
1676 ;; Separating one Python script shaves more than 106 MiB from :out.
1677 (lambda* (#:key outputs #:allow-other-keys)
1678 (let ((out (assoc-ref outputs "out"))
1679 (out:python (assoc-ref outputs "python")))
1680 (for-each (lambda (file)
1681 (let ((old (string-append out "/" file))
1682 (new (string-append out:python "/" file)))
1683 (mkdir-p (dirname new))
1684 (rename-file old new)))
1685 (list "bin/lsusb.py"))
1690 ("python" ,python)))
1692 `(("autoconf" ,autoconf)
1693 ("automake" ,automake)
1694 ("libtool" ,libtool)
1695 ("pkg-config" ,pkg-config)))
1696 (home-page "http://www.linux-usb.org/")
1698 "Tools for working with USB devices, such as lsusb")
1700 "Tools for working with USB devices, such as lsusb.")
1701 (license license:gpl2+)))
1703 (define-public e2fsprogs
1710 "mirror://kernel.org/linux/kernel/people/tytso/"
1711 "e2fsprogs/v" version "/"
1712 "e2fsprogs-" version ".tar.xz"))
1715 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1716 (build-system gnu-build-system)
1717 (inputs `(("util-linux" ,util-linux "lib")))
1718 (native-inputs `(("pkg-config" ,pkg-config)
1719 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1723 ("procps" ,procps)))
1725 '(;; util-linux is the preferred source for some of the libraries and
1726 ;; commands, so disable them (see, e.g.,
1727 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1728 #:configure-flags (list "--disable-libblkid"
1729 "--disable-libuuid" "--disable-uuidd"
1732 ;; Use symlinks instead of hard links for
1733 ;; 'fsck.extN' etc. This makes the resulting nar
1734 ;; smaller and is preserved across copies.
1735 "--enable-symlink-install"
1737 (string-append "LDFLAGS=-Wl,-rpath="
1738 (assoc-ref %outputs "out")
1741 ;; Install libext2fs et al.
1742 "--enable-elf-shlibs")
1745 (modify-phases %standard-phases
1746 (add-before 'configure 'patch-shells
1748 (substitute* "configure"
1749 (("/bin/sh (.*)parse-types.sh" _ dir)
1750 (string-append (which "sh") " " dir
1752 (substitute* "MCONFIG.in"
1753 (("INSTALL_SYMLINK = /bin/sh")
1754 "INSTALL_SYMLINK = sh"))
1755 (substitute* (find-files "." "^Makefile.in$")
1757 (string-append "#!" (which "sh"))))
1759 (add-after 'install 'install-libs
1760 (lambda* (#:key outputs #:allow-other-keys)
1761 (let* ((out (assoc-ref outputs "out"))
1762 (lib (string-append out "/lib")))
1763 (invoke "make" "install-libs")
1765 ;; Make the .a writable so that 'strip' works.
1766 ;; Failing to do that, due to debug symbols, we
1767 ;; retain a reference to the final
1768 ;; linux-libre-headers, which refer to the
1769 ;; bootstrap binaries.
1770 (let ((archives (find-files lib "\\.a$")))
1771 (for-each (lambda (file)
1775 (home-page "http://e2fsprogs.sourceforge.net/")
1776 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1778 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1779 (license (list license:gpl2 ;programs
1780 license:lgpl2.0 ;libext2fs
1781 license:x11)))) ;libuuid
1783 (define e2fsprogs/static
1785 (package (inherit e2fsprogs)
1787 ;; Do not build shared libraries.
1788 (substitute-keyword-arguments (package-arguments e2fsprogs)
1789 ((#:configure-flags _)
1790 '(list "--disable-blkid"))
1794 (define-public e2fsck/static
1796 (name "e2fsck-static")
1797 (version (package-version e2fsprogs))
1798 (build-system trivial-build-system)
1801 `(("e2fsprogs" ,e2fsprogs/static)))
1803 `(#:modules ((guix build utils))
1806 (use-modules (guix build utils)
1810 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1812 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1814 (with-directory-excursion bin
1815 (copy-file e2fsck "e2fsck")
1816 (remove-store-references "e2fsck")
1817 (chmod "e2fsck" #o555))
1819 (home-page (package-home-page e2fsprogs))
1820 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1821 (description "This package provides statically-linked e2fsck command taken
1822 from the e2fsprogs package. It is meant to be used in initrds.")
1823 (license (package-license e2fsprogs))))
1825 (define-public extundelete
1827 (name "extundelete")
1832 (uri (string-append "mirror://sourceforge/extundelete/"
1833 "extundelete/" version "/extundelete-"
1834 version ".tar.bz2"))
1837 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1838 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1839 (build-system gnu-build-system)
1840 (inputs `(("e2fsprogs" ,e2fsprogs)))
1841 (home-page "http://extundelete.sourceforge.net/")
1842 (synopsis "Recover deleted files from ext2/3/4 partitions")
1844 "Extundelete is a set of tools that can recover deleted files from an
1845 ext3 or ext4 partition.")
1846 (license license:gpl2)))
1848 (define-public zerofree
1852 (home-page "https://frippery.org/uml/")
1855 (uri (string-append home-page name "-" version
1859 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1860 (build-system gnu-build-system)
1863 (modify-phases %standard-phases
1864 (delete 'configure) ; no configure script
1866 ;; The Makefile lacks an ‘install’ target.
1867 (lambda* (#:key outputs #:allow-other-keys)
1868 (let* ((out (assoc-ref outputs "out"))
1869 (bin (string-append out "/bin")))
1870 (chmod "zerofree" #o555)
1871 (install-file "zerofree" bin)
1873 #:tests? #f)) ; no tests
1874 (inputs `(("libext2fs" ,e2fsprogs)))
1875 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1877 "Zerofree finds the unallocated blocks with non-zero value content in an
1878 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1879 This is a simple way to make disk images more compressible.
1880 Zerofree requires the file system to be unmounted or mounted read-only.")
1881 (license license:gpl2)))
1883 (define-public strace
1887 (home-page "https://strace.io")
1890 (uri (string-append home-page "/files/" version
1891 "/strace-" version ".tar.xz"))
1894 "1n6cfz3i2krkyvxpdp3kmxhf7sy5xp0danzaiirbk5fdkfgvb15j"))))
1895 (build-system gnu-build-system)
1898 (modify-phases %standard-phases
1899 (add-after 'unpack 'patch-/bin/sh
1901 (substitute* "strace.c"
1902 (("/bin/sh") (which "sh")))
1904 (add-after 'unpack 'disable-failing-tests
1906 ;; XXX These hang forever even if the test time-out is extended.
1907 (substitute* "tests/Makefile.in"
1908 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
1910 ;; Don't fail if the architecture doesn't support different personalities.
1911 #:configure-flags '("--enable-mpers=check")
1912 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1913 #:parallel-tests? #f)) ; undeterministic failures
1914 (native-inputs `(("perl" ,perl)))
1915 (synopsis "System call tracer for Linux")
1917 "strace is a system call tracer, i.e. a debugging tool which prints out a
1918 trace of all the system calls made by a another process/program.")
1919 (license license:lgpl2.1+)))
1921 (define-public ltrace
1927 (uri (string-append "http://www.ltrace.org/ltrace_" version
1931 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1932 (build-system gnu-build-system)
1933 (inputs `(("libelf" ,libelf)))
1935 ;; Compilation uses -Werror by default, but it fails.
1936 '(#:configure-flags '("--disable-werror")))
1937 (home-page "https://www.ltrace.org/")
1938 (synopsis "Library call tracer for Linux")
1940 "ltrace intercepts and records dynamic library calls which are called by
1941 an executed process and the signals received by that process. It can also
1942 intercept and print the system calls executed by the program.")
1943 (license license:gpl2+)))
1945 (define-public alsa-lib
1952 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1953 version ".tar.bz2"))
1956 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
1957 (build-system gnu-build-system)
1959 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1960 (assoc-ref %outputs "out")
1962 (home-page "https://www.alsa-project.org/")
1963 (synopsis "The Advanced Linux Sound Architecture libraries")
1965 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1966 MIDI functionality to the Linux-based operating system.")
1967 (license license:lgpl2.1+)))
1969 (define-public alsa-utils
1975 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1976 name "-" version ".tar.bz2"))
1979 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
1980 (build-system gnu-build-system)
1982 ;; XXX: Disable man page creation until we have DocBook.
1983 '(#:configure-flags (list "--disable-xmlto"
1985 ;; The udev rule is responsible for restoring
1987 (string-append "--with-udev-rules-dir="
1988 (assoc-ref %outputs "out")
1989 "/lib/udev/rules.d"))
1991 (modify-phases %standard-phases
1992 (add-before 'check 'disable-broken-test
1994 ;; XXX: The 1.1.8 release tarball is missing a header that's
1995 ;; required for this test to work. Fixed in 1.1.9.
1996 (substitute* "axfer/test/Makefile"
1997 ((".*container-test.*") ""))
2000 'install 'pre-install
2002 ;; Don't try to mkdir /var/lib/alsa.
2003 (substitute* "Makefile"
2004 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2008 `(("gettext" ,gettext-minimal)))
2010 `(("libsamplerate" ,libsamplerate)
2011 ("ncurses" ,ncurses)
2012 ("alsa-lib" ,alsa-lib)
2014 (home-page "http://www.alsa-project.org/")
2015 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2017 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2018 MIDI functionality to the Linux-based operating system.")
2020 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2022 (license license:gpl2)))
2024 (define-public alsa-plugins
2026 (name "alsa-plugins")
2030 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2031 name "-" version ".tar.bz2"))
2034 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2035 (build-system gnu-build-system)
2036 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2037 ;; be split, there are references to both in files.
2038 ;; TODO: Remove OSS related plugins, they add support to run native
2039 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2041 (outputs '("out" "pulseaudio" "jack"))
2043 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2044 ;; for /etc/alsa. On Guix System plugins are loaded from
2045 ;; the ALSA service, and other distributions likely
2046 ;; won't use these files.
2047 "--with-alsalconfdir=/tmp/noop")
2049 (modify-phases %standard-phases
2050 (add-after 'install 'split
2051 (lambda* (#:key inputs outputs #:allow-other-keys)
2052 ;; Distribute the binaries to the various outputs.
2053 (let* ((out (assoc-ref outputs "out"))
2054 (jack (assoc-ref outputs "jack"))
2055 (jacklib (string-append jack "/lib/alsa-lib"))
2056 (pua (assoc-ref outputs "pulseaudio"))
2057 (pualib (string-append pua "/lib/alsa-lib")))
2060 (for-each (lambda (file)
2061 (rename-file file (string-append jacklib "/" (basename file))))
2062 (find-files out ".*jack\\.(la|so)"))
2065 (for-each (lambda (file)
2066 (rename-file file (string-append pualib "/" (basename file))))
2067 (find-files out ".*pulse\\.(la|so)"))
2070 `(("alsa-lib" ,alsa-lib)
2072 ("speex" ,speex) ; libspeexdsp resampling plugin
2073 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2074 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2075 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2077 `(("pkg-config" ,pkg-config)))
2078 (home-page "http://www.alsa-project.org/")
2079 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2081 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2082 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2083 by providing additional plugins which include: upmixing, downmixing, jackd and
2084 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2085 external rate conversion.")
2086 (license (list license:gpl2+
2087 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2088 license:lgpl2.1+))))
2090 (define-public iptables
2093 ;; XXX When updating, remove the ‘install-missing-script’ phase.
2098 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2100 (string-append "https://www.netfilter.org/projects/iptables/"
2101 "files/iptables-" version ".tar.bz2")))
2103 (base32 "02a3575ypdpg6a2x752mhk3f7h1381ymkq1n0gss6fp6292xfmyl"))))
2104 (build-system gnu-build-system)
2106 `(("pkg-config" ,pkg-config)
2110 `(("libmnl" ,libmnl)
2111 ("libnftnl" ,libnftnl)))
2113 '(#:tests? #f ; no test suite
2114 #:configure-flags ; add $libdir to the RUNPATH of executables
2115 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
2117 (modify-phases %standard-phases
2118 (add-after 'install 'install-missing-script
2119 ;; A typo prevents installation of /sbin/iptables-apply. It's been
2120 ;; fixed upstream (d4ed0c741fc789bb09d977d74d30875fdd50d08b), but
2121 ;; a patch would require bootstrapping and more inputs. Simply copy
2122 ;; the file ourselves.
2123 (lambda* (#:key outputs #:allow-other-keys)
2124 (let* ((out (assoc-ref outputs "out"))
2125 (sbin (string-append out "/sbin")))
2126 (install-file "iptables/iptables-apply" sbin)
2128 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2129 (synopsis "Programs to configure Linux IP packet filtering rules")
2131 "@command{iptables} is the user-space command line program used to
2132 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2133 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2135 This package also includes @command{ip6tables}, which is used to configure the
2138 Both commands are targeted at system administrators.")
2139 (license license:gpl2+)))
2141 (define-public lsscsi
2148 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2151 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
2152 (build-system gnu-build-system)
2153 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2154 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2156 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2157 also list NVMe namespaces or controllers and show the relationship between a
2158 device's primary node name, its SCSI generic (sg) node name and its kernel
2160 (license license:gpl2)))
2162 (define-public ebtables
2169 "mirror://netfilter.org/ebtables/ebtables-"
2173 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2174 (build-system gnu-build-system)
2177 ("iptables" ,iptables)))
2178 (synopsis "Ethernet bridge frame table administration")
2179 (home-page "https://ebtables.netfilter.org/")
2181 "ebtables is an application program used to set up and maintain the
2182 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2183 analogous to the iptables application, but less complicated, due to the fact
2184 that the Ethernet protocol is much simpler than the IP protocol.")
2185 (license license:gpl2+)))
2187 (define-public iproute
2194 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2198 "088gs56iqhdlpw1iqjwrss4zxd4zbl2wl8s2implrrdajjxcfpbj"))))
2199 (build-system gnu-build-system)
2201 `( ;; There is a test suite, but it wants network namespaces and sudo.
2203 #:make-flags (let ((out (assoc-ref %outputs "out")))
2205 (string-append "BASH_COMPDIR=" out
2206 "/etc/bash_completion.d")
2207 (string-append "LIBDIR=" out "/lib")
2208 (string-append "HDRDIR=" out "/include")
2209 (string-append "SBINDIR=" out "/sbin")
2210 (string-append "CONFDIR=" out "/etc")
2211 (string-append "DOCDIR=" out "/share/doc/"
2213 (string-append "MANDIR=" out "/share/man")))
2214 #:phases (modify-phases %standard-phases
2215 (add-before 'install 'pre-install
2217 ;; Don't attempt to create /var/lib/arpd.
2218 (substitute* "Makefile"
2219 (("^.*ARPDDIR.*$") ""))
2223 ("iptables" ,iptables)
2224 ("libmnl" ,libmnl)))
2228 ("pkg-config" ,pkg-config)))
2230 ;; ("libmnl" ,libmnl)
2231 ;; ("util-linux" ,util-linux)
2233 "https://wiki.linuxfoundation.org/networking/iproute2")
2235 "Utilities for controlling TCP/IP networking and traffic in Linux")
2237 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2238 and traffic with the Linux kernel. The most important of these are
2239 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2242 Most network configuration manuals still refer to ifconfig and route as the
2243 primary network configuration tools, but ifconfig is known to behave
2244 inadequately in modern network environments, and both should be deprecated.")
2245 (license license:gpl2+)))
2247 (define-public net-tools
2248 ;; XXX: This package is basically unmaintained, but it provides a few
2249 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2251 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2255 (version (string-append "1.60-" revision "." (string-take commit 7)))
2258 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2259 "n/ne/net-tools/code.git/net-tools-code-"
2261 (file-name (string-append name "-" version ".zip"))
2264 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2265 (home-page "http://net-tools.sourceforge.net/")
2266 (build-system gnu-build-system)
2268 `(#:modules ((guix build gnu-build-system)
2273 (modify-phases %standard-phases
2275 (lambda* (#:key outputs #:allow-other-keys)
2276 (let ((out (assoc-ref outputs "out")))
2277 (mkdir-p (string-append out "/bin"))
2278 (mkdir-p (string-append out "/sbin"))
2280 ;; Pretend we have everything...
2281 (system "yes | make config")
2283 ;; ... except for the things we don't have.
2284 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2285 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2286 ;; that have been removed.
2287 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2288 ;; think about adding them later.
2289 (substitute* '("config.make" "config.h")
2290 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2293 (add-after 'install 'remove-redundant-commands
2294 (lambda* (#:key outputs #:allow-other-keys)
2295 ;; Remove commands and man pages redundant with Inetutils.
2296 (let* ((out (assoc-ref outputs "out"))
2297 (dup (append-map (cut find-files out <>)
2299 "^(yp|nis|dns)?domainname"))))
2300 (for-each delete-file dup)
2302 ;; Binaries that depend on libnet-tools.a don't declare that
2303 ;; dependency, making it parallel-unsafe.
2304 #:parallel-build? #f
2306 #:tests? #f ; no test suite
2307 #:make-flags (let ((out (assoc-ref %outputs "out")))
2308 (list ,(string-append "CC=" (cc-for-target))
2309 (string-append "BASEDIR=" out)
2310 (string-append "INSTALLNLSDIR=" out "/share/locale")
2311 (string-append "mandir=/share/man")))))
2312 (native-inputs `(("gettext" ,gettext-minimal)
2314 (supported-systems (delete "i586-gnu" %supported-systems))
2315 (synopsis "Tools for controlling the network subsystem in Linux")
2317 "This package includes the important tools for controlling the network
2318 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2319 route. Additionally, this package contains utilities relating to particular
2320 network hardware types (plipconfig, slattach) and advanced aspects of IP
2321 configuration (iptunnel, ipmaddr).")
2322 (license license:gpl2+))))
2324 (define-public libcap
2331 "mirror://kernel.org/linux/libs/security/linux-privs/"
2332 "libcap2/libcap-" version ".tar.xz"))
2335 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2336 (build-system gnu-build-system)
2337 (arguments '(#:phases
2338 (modify-phases %standard-phases
2340 ;; Add $libdir to the RUNPATH of executables.
2342 (substitute* "Make.Rules"
2344 (string-append "LDFLAGS := -Wl,-rpath="
2347 #:test-target "test"
2348 #:make-flags (list "lib=lib"
2349 (string-append "prefix="
2350 (assoc-ref %outputs "out"))
2351 "RAISE_SETFCAP=no")))
2352 (native-inputs `(("perl" ,perl)))
2353 (supported-systems (delete "i586-gnu" %supported-systems))
2354 (home-page "https://sites.google.com/site/fullycapable/")
2355 (synopsis "Library for working with POSIX capabilities")
2357 "Libcap2 provides a programming interface to POSIX capabilities on
2358 Linux-based operating systems.")
2360 ;; License is BSD-3 or GPLv2, at the user's choice.
2361 (license license:gpl2)))
2363 ;; libcap 2.31 causes problems for 'fakeroot', so provide this newer variant.
2364 ;; To be merged with libcap on the next rebuild cycle.
2365 (define-public libcap/next
2372 "mirror://kernel.org/linux/libs/security/linux-privs/"
2373 "libcap2/libcap-" version ".tar.xz"))
2376 "048n1gy2p48vl9hkrr9wymfxxcpwj2aslz2bv79nhl4m2lhd9kdf"))))))
2378 (define-public bridge-utils
2380 (name "bridge-utils")
2385 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2386 "bridge-utils-" version ".tar.xz"))
2388 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
2389 (build-system gnu-build-system)
2391 ;; The tarball lacks all the generated files.
2392 (native-inputs `(("autoconf" ,autoconf)
2393 ("automake" ,automake)))
2396 (modify-phases %standard-phases
2397 (add-before 'bootstrap 'patch-stuff
2399 ;; Fix "field ‘ip6’ has incomplete type" errors.
2400 (substitute* "libbridge/libbridge.h"
2401 (("#include <linux/if_bridge.h>")
2402 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2404 ;; Ensure that the entire build fails if one of the
2405 ;; sub-Makefiles fails.
2406 (substitute* "Makefile.in"
2407 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2408 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2411 #:tests? #f)) ; no 'check' target
2413 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2414 (synopsis "Manipulate Ethernet bridges")
2416 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2417 to connect two Ethernet segments together in a protocol independent way.
2418 Packets are forwarded based on Ethernet address, rather than IP address (like
2419 a router). Since forwarding is done at Layer 2, all protocols can go
2420 transparently through a bridge.")
2421 (license license:gpl2+)))
2423 (define-public libnl
2430 "https://github.com/thom311/libnl/releases/download/"
2431 "libnl" (string-join (string-split version #\.) "_")
2432 "/libnl-" version ".tar.gz"))
2435 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2436 (build-system gnu-build-system)
2440 ("pkg-config" ,pkg-config)
2446 "https://github.com/thom311/libnl/releases/download/libnl"
2447 (string-join (string-split version #\.) "_")
2448 "/libnl-doc-" version ".tar.gz"))
2450 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2451 (outputs `("out" "doc"))
2454 (modify-phases %standard-phases
2455 (add-after 'install 'install-doc
2456 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2457 (let ((dest (string-append (assoc-ref outputs "doc")
2458 "/share/doc/libnl")))
2460 (invoke "tar" "xf" (assoc-ref
2461 (or native-inputs inputs)
2463 "--strip-components=1" "-C" dest)))))))
2464 (home-page "https://www.infradead.org/~tgr/libnl/")
2465 (synopsis "NetLink protocol library suite")
2467 "The libnl suite is a collection of libraries providing APIs to netlink
2468 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2469 between the kernel and user space processes. It was designed to be a more
2470 flexible successor to ioctl to provide mainly networking related kernel
2471 configuration and monitoring interfaces.")
2473 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2474 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2475 (license license:gpl2)))
2477 ;; libnl python extensions used to be outputs of libnl. However, as
2478 ;; cross-compiling python extensions is currently broken, create separate
2479 ;; packages for libnl python extensions.
2480 (define (libnl-python-package python)
2481 (let ((name (string-append "libnl-" python)))
2486 ((string=? python "python2")
2487 `(("python-2" ,python-2)))
2488 ((string=? python "python3")
2489 `(("python-3" ,python-3))))))
2490 (propagated-inputs `(("libnl" ,libnl)))
2493 `(#:modules ((guix build gnu-build-system)
2497 (modify-phases %standard-phases
2499 (lambda* (#:key inputs outputs #:allow-other-keys)
2500 (define (python-inst python)
2501 (invoke python "setup.py" "build")
2502 (invoke python "setup.py" "install"
2503 (string-append "--prefix="
2504 (assoc-ref %outputs "out")))
2505 (invoke python "setup.py" "clean"))
2506 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2507 (assoc-ref inputs "libnl")))
2508 (with-directory-excursion "./python" (python-inst ,python))
2511 (define-public libnl-python2 (libnl-python-package "python2"))
2512 (define-public libnl-python3 (libnl-python-package "python3"))
2521 "mirror://kernel.org/software/network/iw/iw-"
2525 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2526 (build-system gnu-build-system)
2527 (native-inputs `(("pkg-config" ,pkg-config)))
2528 (inputs `(("libnl" ,libnl)))
2531 (let* ((target ,(%current-target-system))
2532 (pkg-config (if target
2533 (string-append target "-pkg-config")
2536 ,(string-append "CC=" (cc-for-target))
2537 (string-append "PKG_CONFIG="
2538 (assoc-ref %build-inputs "pkg-config")
2540 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2541 #:phases (modify-phases %standard-phases (delete 'configure))))
2542 (home-page "https://wireless.wiki.kernel.org/")
2543 (synopsis "Tool for configuring wireless devices")
2545 "iw is a new nl80211 based CLI configuration utility for wireless
2546 devices. It replaces @code{iwconfig}, which is deprecated.")
2547 (license license:isc)))
2549 (define-public powertop
2556 (uri (string-append "https://01.org/sites/default/files/downloads/"
2557 "powertop-" version ".tar.gz"))
2559 (base32 "0y1ixw8v17fdb1ima0zshrd0rh4zxdh10r93nrrvq6d4lhn9jpx6"))))
2560 (build-system gnu-build-system)
2563 (modify-phases %standard-phases
2564 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2565 ;; allow calibrating the network interface in Guix System.
2566 (add-after 'unpack 'patch-absolute-file-names
2567 (lambda* (#:key inputs #:allow-other-keys)
2568 (let ((kmod (assoc-ref inputs "kmod")))
2569 (substitute* (find-files "src" "\\.cpp$")
2570 ;; Give the right 'modprobe' file name so that essential
2571 ;; modules such as msr.ko can be loaded.
2572 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2573 ;; These programs are only needed to calibrate, so using
2574 ;; relative file names avoids adding extra inputs. When they
2575 ;; are missing powertop gracefully handles it.
2576 (("/usr/bin/hcitool") "hcitool")
2577 (("/usr/bin/xset") "xset")
2578 (("/usr/sbin/hciconfig") "hciconfig"))
2583 ("ncurses" ,ncurses)
2584 ("pciutils" ,pciutils)
2587 `(("pkg-config" ,pkg-config)))
2588 (home-page "https://01.org/powertop/")
2589 (synopsis "Analyze power consumption on Intel-based laptops")
2591 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2592 power management. In addition to being a diagnostic tool, PowerTOP also has
2593 an interactive mode where the user can experiment various power management
2594 settings for cases where the operating system has not enabled these
2596 (license license:gpl2)))
2598 (define-public aumix
2605 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2606 version ".tar.bz2"))
2609 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2610 (build-system gnu-build-system)
2611 (inputs `(("ncurses" ,ncurses)))
2612 (home-page "http://www.jpj.net/~trevor/aumix.html")
2613 (synopsis "Audio mixer for X and the console")
2615 "Aumix adjusts an audio mixer from X, the console, a terminal,
2616 the command line or a script.")
2617 (license license:gpl2+)))
2619 (define-public iotop
2626 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2629 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2630 (build-system python-build-system)
2633 (modify-phases %standard-phases
2634 (add-after 'unpack 'fix-build-with-python3
2636 (substitute* "setup.py"
2637 (("itervalues") "values"))
2639 ;; There are currently no checks in the package.
2641 (native-inputs `(("python" ,python)))
2642 (home-page "http://guichaz.free.fr/iotop/")
2644 "Displays the IO activity of running processes")
2646 "Iotop is a Python program with a top like user interface to show the
2647 processes currently causing I/O.")
2648 (license license:gpl2+)))
2656 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2657 "download/fuse-" version
2658 "/fuse-" version ".tar.gz"))
2661 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2662 (patches (search-patches "fuse-overlapping-headers.patch"))))
2663 (build-system gnu-build-system)
2664 (inputs `(("util-linux" ,util-linux)))
2666 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2667 (assoc-ref %outputs "out")
2669 (string-append "INIT_D_PATH="
2670 (assoc-ref %outputs "out")
2673 ;; The rule makes /dev/fuse 666.
2674 (string-append "UDEV_RULES_PATH="
2675 (assoc-ref %outputs "out")
2676 "/lib/udev/rules.d"))
2678 (modify-phases %standard-phases
2679 (add-before 'build 'set-file-names
2680 (lambda* (#:key inputs #:allow-other-keys)
2681 ;; libfuse calls out to mount(8) and umount(8). Make sure
2682 ;; it refers to the right ones.
2683 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2684 (("/bin/(u?)mount" _ maybe-u)
2685 (string-append (assoc-ref inputs "util-linux")
2686 "/bin/" maybe-u "mount")))
2687 (substitute* '("util/mount.fuse.c")
2691 ;; This hack leads libfuse to search for 'fusermount' in
2692 ;; $PATH, where it may find a setuid-root binary, instead of
2693 ;; trying solely $out/sbin/fusermount and failing because
2695 (substitute* "lib/Makefile"
2696 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2697 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2699 (supported-systems (delete "i586-gnu" %supported-systems))
2700 (home-page "https://github.com/libfuse/libfuse")
2701 (synopsis "Support file systems implemented in user space")
2703 "As a consequence of its monolithic design, file system code for Linux
2704 normally goes into the kernel itself---which is not only a robustness issue,
2705 but also an impediment to system extensibility. FUSE, for \"file systems in
2706 user space\", is a kernel module and user-space library that tries to address
2707 part of this problem by allowing users to run file system implementations as
2708 user-space processes.")
2709 (license (list license:lgpl2.1 ;library
2710 license:gpl2+)))) ;command-line utilities
2712 (define-public unionfs-fuse
2714 (name "unionfs-fuse")
2719 (url "https://github.com/rpodgorny/unionfs-fuse")
2720 (commit (string-append "v" version))))
2721 (file-name (git-file-name name version))
2724 "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6"))))
2725 (build-system cmake-build-system)
2727 `(("python" ,python)))
2728 (inputs `(("fuse" ,fuse)))
2730 ;; The tests were never actually run ("collected 0 items"), but in recent
2731 ;; versions of pytest that causes an error.
2733 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2734 (synopsis "User-space union file system")
2736 "UnionFS-FUSE is a flexible union file system implementation in user
2737 space, using the FUSE library. Mounting a union file system allows you to
2738 \"aggregate\" the contents of several directories into a single mount point.
2739 UnionFS-FUSE additionally supports copy-on-write.")
2740 (license license:bsd-3)))
2743 (package (inherit fuse)
2744 (name "fuse-static")
2745 (source (origin (inherit (package-source fuse))
2746 (modules '((guix build utils)))
2749 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2750 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2751 ;; that it doesn't do that, allowing us to remove the
2752 ;; dependency on util-linux (something that is useful in
2754 (substitute* '("lib/mount_util.c"
2755 "util/mount_util.c")
2756 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2762 (define-public unionfs-fuse/static
2763 (package (inherit unionfs-fuse)
2764 (synopsis "User-space union file system (statically linked)")
2765 (name (string-append (package-name unionfs-fuse) "-static"))
2766 (source (origin (inherit (package-source unionfs-fuse))
2767 (modules '((guix build utils)))
2770 ;; Add -ldl to the libraries, because libfuse.a needs that.
2771 (substitute* "src/CMakeLists.txt"
2772 (("target_link_libraries(.*)\\)" _ libs)
2773 (string-append "target_link_libraries"
2778 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2780 (modify-phases %standard-phases
2781 (add-after 'install 'post-install
2782 (lambda* (#:key outputs #:allow-other-keys)
2783 (let* ((out (assoc-ref outputs "out"))
2784 (exe (string-append out "/bin/unionfs")))
2785 ;; By default, 'unionfs' keeps references to
2786 ;; $glibc/share/locale and similar stuff. Remove them.
2787 (remove-store-references exe)
2789 ;; 'unionfsctl' has references to glibc as well. Since
2790 ;; we don't need it, remove it.
2791 (delete-file (string-append out "/bin/unionfsctl"))
2793 (inputs `(("fuse" ,fuse-static)))))
2795 (define-public sshfs
2801 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2802 "download/sshfs-" version "/sshfs-" version
2806 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2807 (build-system gnu-build-system)
2812 `(("pkg-config" ,pkg-config)))
2813 (home-page "https://github.com/libfuse/sshfs")
2814 (synopsis "Mount remote file systems over SSH")
2816 "This is a file system client based on the SSH File Transfer Protocol.
2817 Since most SSH servers already support this protocol it is very easy to set
2818 up: on the server side there's nothing to do; on the client side mounting the
2819 file system is as easy as logging into the server with an SSH client.")
2820 (license license:gpl2+)))
2822 (define-public sshfs-fuse
2823 (package (inherit sshfs)
2825 (properties `((superseded . ,sshfs)))))
2827 (define-public archivemount
2829 (name "archivemount")
2834 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2835 "archivemount-" version ".tar.gz"))
2837 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2838 (build-system gnu-build-system)
2839 (inputs `(("fuse" ,fuse)
2840 ("libarchive" ,libarchive)))
2841 (native-inputs `(("pkg-config" ,pkg-config)))
2842 (home-page "https://www.cybernoia.de/software/archivemount.html")
2843 (synopsis "Tool for mounting archive files with FUSE")
2844 (description "archivemount is a FUSE-based file system for Unix variants,
2845 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2846 mount point where it can be read from or written to as with any other file
2847 system. This makes accessing the contents of the archive, which may be
2848 compressed, transparent to other programs, without decompressing them.")
2849 (license license:lgpl2.0+)))
2851 (define-public numactl
2858 "https://github.com/numactl/numactl/releases/download/v"
2859 version "/numactl-" version ".tar.gz"))
2862 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2863 (build-system gnu-build-system)
2865 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2866 ;; to run, which we can't assume to have.
2869 ;; NUMA is apparently not supported on armhf, see
2870 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2871 (supported-systems (delete "armhf-linux" %supported-systems))
2872 (home-page "https://github.com/numactl/numactl")
2873 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2875 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2876 memory is not all in one place. The @command{numactl} program allows you to
2877 run your application program on specific CPUs and memory nodes. It does this
2878 by supplying a NUMA memory policy to the operating system before running your
2881 The package contains other commands, such as @command{numastat},
2882 @command{memhog}, and @command{numademo} which provides a quick overview of
2883 NUMA performance on your system.")
2884 (license (list license:gpl2 ;programs
2885 license:lgpl2.1)))) ;library
2887 (define-public kbd-neo
2894 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2895 version "/linux/console/neo.map"))
2896 (file-name (string-append name "-" version ".map"))
2899 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2900 (build-system trivial-build-system)
2902 `(#:modules ((guix build utils))
2904 (use-modules (guix build utils))
2905 (let ((out (string-append %output "/share/keymaps"))
2906 (source (assoc-ref %build-inputs "source")))
2908 (copy-file source (string-append out "/neo.map"))
2910 (home-page "https://neo-layout.org")
2911 (synopsis "Neo2 console layout")
2913 "Kbd-neo provides the Neo2 keyboard layout for use with
2914 @command{loadkeys(1)} from @code{kbd(4)}.")
2915 ;; The file is located in an svn directory, the entire content of
2916 ;; the directory is licensed as GPL3.
2917 (license license:gpl3+)))
2925 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2929 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2930 (modules '((guix build utils)))
2933 (substitute* "tests/Makefile.in"
2934 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2937 (substitute* '("src/unicode_start" "src/unicode_stop")
2938 ;; Assume the Coreutils are in $PATH.
2942 (build-system gnu-build-system)
2945 (modify-phases %standard-phases
2946 (add-before 'build 'pre-build
2947 (lambda* (#:key inputs #:allow-other-keys)
2948 (let ((gzip (assoc-ref %build-inputs "gzip"))
2949 (bzip2 (assoc-ref %build-inputs "bzip2")))
2950 (substitute* "src/libkeymap/findfile.c"
2952 (string-append gzip "/bin/gzip"))
2954 (string-append bzip2 "/bin/bzip2")))
2956 (add-after 'install 'post-install
2957 (lambda* (#:key outputs #:allow-other-keys)
2958 ;; Make sure these programs find their comrades.
2959 (let* ((out (assoc-ref outputs "out"))
2960 (bin (string-append out "/bin")))
2961 (for-each (lambda (prog)
2962 (wrap-program (string-append bin "/" prog)
2963 `("PATH" ":" prefix (,bin))))
2964 '("unicode_start" "unicode_stop"))
2966 (inputs `(("check" ,check)
2969 ("pam" ,linux-pam)))
2970 (native-search-paths
2971 (list (search-path-specification
2972 (variable "LOADKEYS_KEYMAP_PATH")
2973 ;; Append ‘/**’ to recursively search all directories. One can then
2974 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2975 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2976 (files (list "share/keymaps/**")))))
2977 (native-inputs `(("pkg-config" ,pkg-config)))
2978 (home-page "http://kbd-project.org/")
2979 (synopsis "Linux keyboard utilities and keyboard maps")
2981 "This package contains keytable files and keyboard utilities compatible
2982 for systems using the Linux kernel. This includes commands such as
2983 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2984 (license license:gpl2+)))
2986 (define-public loadkeys-static
2989 (name "loadkeys-static")
2991 (substitute-keyword-arguments (package-arguments kbd)
2992 ((#:configure-flags flags ''())
2993 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2994 "--disable-vlock" ;so we don't need libpam
2995 "--disable-libkeymap")
2997 ((#:make-flags flags ''())
2998 `(cons "LDFLAGS=-all-static" ,flags))
2999 ((#:phases phases '%standard-phases)
3000 `(modify-phases ,phases
3002 (lambda* (#:key outputs #:allow-other-keys)
3003 (let ((out (assoc-ref outputs "out")))
3004 ;; The binary keeps references to gzip, among other things,
3005 ;; which we don't need in the initrd, so strip references.
3006 (remove-store-references "src/loadkeys")
3008 (install-file "src/loadkeys"
3009 (string-append out "/bin"))
3011 (delete 'post-install)))
3012 ((#:strip-flags _ '())
3014 ((#:allowed-references _ '())
3017 (synopsis "Statically-linked @command{loadkeys} program")
3019 ;; This package is meant to be used internally in the initrd so don't
3021 (properties '((hidden? . #t)))))
3023 (define-public inotify-tools
3025 (name "inotify-tools")
3026 (version "3.20.2.2")
3030 (url "https://github.com/rvoicilas/inotify-tools.git")
3032 (file-name (git-file-name name version))
3035 "1r12bglkb0bkqff6kgxjm81hk6z20nrxq3m7iv15d4nrqf9pm7s0"))))
3036 (build-system gnu-build-system)
3038 `(("autoconf" ,autoconf)
3039 ("automake" ,automake)
3040 ("libtool" ,libtool)))
3041 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3042 (synopsis "Monitor file accesses")
3044 "The inotify-tools packages provides a C library and command-line tools
3045 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3046 (license license:gpl2+)))
3055 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3056 "kmod-" version ".tar.xz"))
3059 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3060 (patches (search-patches "kmod-module-directory.patch"))))
3061 (build-system gnu-build-system)
3063 `(("pkg-config" ,pkg-config)))
3068 `(#:configure-flags '("--with-xz" "--with-zlib"
3069 "--disable-test-modules")
3071 (modify-phases %standard-phases
3072 (add-after 'unpack 'disable-tests
3074 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3075 (substitute* "Makefile.in"
3076 (("testsuite/test-modprobe") "")
3077 (("testsuite/test-depmod") "")
3078 (("testsuite/test-blacklist") ""))
3080 (add-after 'install 'install-modprobe&co
3081 (lambda* (#:key outputs #:allow-other-keys)
3082 (let* ((out (assoc-ref outputs "out"))
3083 (bin (string-append out "/bin")))
3084 (for-each (lambda (tool)
3086 (string-append bin "/" tool)))
3087 '("insmod" "rmmod" "lsmod" "modprobe"
3088 "modinfo" "depmod"))
3090 (supported-systems (delete "i586-gnu" %supported-systems))
3091 (home-page "https://www.kernel.org/")
3092 (synopsis "Kernel module tools")
3093 (description "Kmod is a set of tools to handle common tasks with Linux
3094 kernel modules like insert, remove, list, check properties, resolve
3095 dependencies and aliases.
3097 These tools are designed on top of libkmod, a library that is shipped with
3098 kmod. The aim is to be compatible with tools, configurations and indices
3099 from the module-init-tools project.")
3100 (license license:gpl2+))) ; library under lgpl2.1+
3102 (define-public earlyoom
3109 (url "https://github.com/rfjakob/earlyoom.git")
3110 (commit (string-append "v" version))))
3111 (file-name (git-file-name name version))
3114 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
3115 (build-system gnu-build-system)
3117 `(#:phases (modify-phases %standard-phases
3119 (add-before 'check 'set-home
3121 (setenv "HOME" (getcwd))
3123 (add-after 'build 'install-contribs
3124 ;; Install what seems useful from the contrib directory.
3125 (lambda* (#:key outputs #:allow-other-keys)
3126 (let* ((out (assoc-ref outputs "out"))
3127 (contrib (string-append
3128 out "/share/earlyoom/contrib")))
3129 (install-file "contrib/notify_all_users.py" contrib)
3131 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3132 (list ,(string-append "CC=" (cc-for-target))
3133 (string-append "VERSION=v" ,version)
3134 (string-append "PREFIX=" prefix)
3135 (string-append "SYSCONFDIR=" prefix "/etc")))
3136 #:test-target "test"))
3137 (native-inputs `(("go" ,go) ;for the test suite
3138 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
3139 (home-page "https://github.com/rfjakob/earlyoom")
3140 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3141 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3142 runs in user space and provides a more responsive and configurable alternative
3143 to the in-kernel OOM killer.")
3144 (license license:expat)))
3146 (define-public eudev
3147 ;; The post-systemd fork, maintained by Gentoo.
3153 (uri (git-reference (url "https://github.com/gentoo/eudev")
3154 (commit (string-append "v" version))))
3155 (file-name (git-file-name name version))
3158 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3159 (patches (search-patches "eudev-rules-directory.patch"))))
3160 (build-system gnu-build-system)
3163 (modify-phases %standard-phases
3164 (add-after 'unpack 'make-source-writable
3166 ;; XXX: Git checkouts are read-only, but this package needs to
3167 ;; modify some of its files.
3168 (for-each make-file-writable (find-files "."))
3170 (add-before 'bootstrap 'patch-file-names
3171 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3172 (substitute* "man/make.sh"
3173 (("/usr/bin/xsltproc")
3174 (string-append (assoc-ref
3175 (or native-inputs inputs) "xsltproc")
3178 (add-before 'configure 'patch-bindir-in-btrfs-rules
3179 (lambda* (#:key outputs #:allow-other-keys)
3180 ;; The "@bindir@" substitution incorrectly expands to a literal
3181 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3183 (let ((out (assoc-ref outputs "out")))
3184 (substitute* "rules/64-btrfs.rules.in"
3186 (string-append out "/bin")))
3188 (add-after 'install 'move-static-library
3189 (lambda* (#:key outputs #:allow-other-keys)
3190 (let* ((out (assoc-ref outputs "out"))
3191 (static (assoc-ref outputs "static"))
3192 (source (string-append out "/lib/libudev.a"))
3193 (target (string-append static "/lib/libudev.a")))
3194 (mkdir-p (dirname target))
3195 (link source target)
3196 (delete-file source)
3197 ;; Remove reference to the static library from the .la file
3198 ;; such that Libtool looks for it in the usual places.
3199 (substitute* (string-append out "/lib/libudev.la")
3201 "old_library=''\n"))
3203 (add-after 'install 'build-hwdb
3204 (lambda* (#:key outputs #:allow-other-keys)
3205 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3206 ;; similar tools to display product names.
3208 ;; XXX: This can't be done when cross-compiling. Find another way
3209 ;; to generate hwdb.bin for cross-built systems.
3210 (let ((out (assoc-ref outputs "out")))
3211 ,@(if (%current-target-system)
3213 '((invoke (string-append out "/bin/udevadm")
3214 "hwdb" "--update")))))))
3215 #:configure-flags (list "--enable-manpages")))
3217 `(("autoconf" ,autoconf)
3218 ("automake" ,automake)
3220 ("libtool" ,libtool)
3221 ("pkg-config" ,pkg-config)
3224 ("python" ,python-wrapper)
3225 ;; For documentation.
3226 ("docbook-xml" ,docbook-xml-4.2)
3227 ("docbook-xsl" ,docbook-xsl)
3228 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3229 ("xsltproc" ,libxslt)))
3231 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3232 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3233 ;; which contains the rules to do that.
3234 `(("util-linux" ,util-linux "lib") ;for blkid
3236 (outputs '("out" "static"))
3237 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3238 (synopsis "Userspace device management")
3239 (description "Udev is a daemon which dynamically creates and removes
3240 device nodes from /dev/, handles hotplug events and loads drivers at boot
3242 (license license:gpl2+)))
3244 (define-public python-evdev
3246 (name "python-evdev")
3251 (uri (pypi-uri "evdev" version))
3253 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3254 (build-system python-build-system)
3256 `(("kernel-headers" ,linux-libre-headers)))
3258 `(#:tests? #f ;no rule for tests
3260 (modify-phases %standard-phases
3261 (add-before 'build 'fix-hard-coded-directory
3262 (lambda* (#:key inputs #:allow-other-keys)
3263 (substitute* "setup.py"
3264 (("/usr/include/linux")
3266 (assoc-ref inputs "kernel-headers") "/include/linux")))
3268 (home-page "https://github.com/gvalkov/python-evdev")
3269 (synopsis "Bindings to the Linux input handling subsystem")
3271 "Python-evdev provides bindings to the generic input event interface in
3272 Linux. The @code{evdev} interface serves the purpose of passing events
3273 generated in the kernel directly to userspace through character devices that
3274 are typically located in @file{/dev/input/}.
3276 This package also comes with bindings to @code{uinput}, the userspace input
3277 subsystem. @code{uinput} allows userspace programs to create and handle input
3278 devices that can inject events directly into the input subsystem.")
3279 (license license:bsd-3)))
3287 (uri (list (string-append "ftp://sourceware.org/pub/lvm2/LVM2."
3289 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3293 "0xdr9qbqw6kja267wmx6ajnfv1nhw056gpxx9v2qmfh3bj6qnfn0"))
3294 (modules '((guix build utils)))
3297 (use-modules (guix build utils))
3299 ;; Honor sysconfdir.
3300 (substitute* "make.tmpl.in"
3302 "confdir = @sysconfdir@\n")
3303 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3304 "DEFAULT_SYS_DIR = @sysconfdir@"))
3306 (patches (search-patches "lvm2-static-link.patch"))))
3307 (build-system gnu-build-system)
3309 `(("pkg-config" ,pkg-config)
3310 ("procps" ,procps))) ;tests use 'pgrep'
3312 `(("libaio" ,libaio)
3316 (modify-phases %standard-phases
3317 (add-after 'configure 'set-makefile-shell
3319 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3321 (setenv "SHELL" (which "sh"))
3323 ;; Replace /bin/sh with the right file name.
3324 (patch-makefile-SHELL "make.tmpl")
3327 #:configure-flags (list (string-append "--sysconfdir="
3328 (assoc-ref %outputs "out")
3330 "--enable-udev_sync"
3331 "--enable-udev_rules"
3332 "--enable-pkgconfig"
3334 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3336 ;; Make sure programs such as 'dmsetup' can
3337 ;; find libdevmapper.so.
3338 (string-append "LDFLAGS=-Wl,-rpath="
3339 (assoc-ref %outputs "out")
3341 (assoc-ref %outputs "out")
3342 "/lib/device-mapper")
3343 ;; This is needed when cross-compiling.
3344 ,@(if (%current-target-system)
3345 '("ac_cv_func_malloc_0_nonnull=yes"
3346 "ac_cv_func_realloc_0_nonnull=yes")
3349 ;; The tests use 'mknod', which requires root access.
3351 (supported-systems (delete "i586-gnu" %supported-systems))
3352 (home-page "https://sourceware.org/lvm2/")
3353 (synopsis "Logical volume management for Linux")
3355 "LVM2 is the logical volume management tool set for Linux-based systems.
3356 This package includes the user-space libraries and tools, including the device
3357 mapper. Kernel components are part of Linux-libre.")
3359 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3360 ;; Command-line tools are GPLv2.
3361 (license (list license:gpl2 license:lgpl2.1))))
3363 (define-public lvm2-static
3366 (name "lvm2-static")
3368 ;; Propagate udev because libdevmapper.a depends on libudev.
3369 (propagated-inputs `(("udev:static" ,eudev "static")))
3372 (substitute-keyword-arguments (package-arguments lvm2)
3373 ((#:configure-flags flags '())
3374 ;; LVM2 doesn't use Libtool, hence the custom option.
3375 `(append '("--enable-static_link")
3376 ;; Building dmeventd statically is complicated due to a
3377 ;; requirement on libdevmapper.a, which is being phased out
3378 ;; in favor of libdevice-mapper.a, which in turn is is not
3379 ;; easily made available at dmeventd build time. Just ignore
3380 ;; it until the situation improves.
3381 (delete "--enable-dmeventd" ,flags)))
3383 `(modify-phases ,phases
3384 (add-before 'configure 'adjust-Makefile
3386 ;; These fixes are related to the upstream libdm->device_mapper
3387 ;; migration and will hopefully be fixed upstream in due time.
3388 (substitute* "tools/Makefile.in"
3389 ;; This variable is empty in a static configuration and causes
3390 ;; an erroneous GCC command line.
3391 (("-L\\$\\(interfacebuilddir\\)") "")
3392 ;; Remove obsolete reference to libdevmapper.a.
3393 (("-ldevmapper") ""))
3395 (synopsis "Logical volume management for Linux (statically linked)")))
3397 (define-public wireless-tools
3399 (name "wireless-tools")
3403 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3407 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3410 ;; Remove the older header files that are not free software.
3411 (for-each (lambda (n)
3412 (delete-file (format #f "wireless.~a.h" n)))
3413 '(10 11 12 13 14 15 16 17 18 19 20))
3415 (build-system gnu-build-system)
3418 (list (string-append "PREFIX=" %output)
3419 (string-append "INSTALL_MAN=" %output "/share/man")
3420 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3423 (modify-phases %standard-phases
3425 (lambda* (#:key target #:allow-other-keys)
3426 (when ,(%current-target-system)
3427 ;; Cross-compilation: use the cross tools.
3428 (substitute* (find-files "." "Makefile")
3430 (string-append "CC = " target "-gcc\n"))
3432 (string-append "AR = " target "-ar\n"))
3434 (string-append "RANLIB = " target "-ranlib\n"))))
3437 (synopsis "Tools for manipulating Linux Wireless Extensions")
3438 (description "Wireless Tools are used to manipulate the now-deprecated
3439 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3440 Extension was an interface allowing you to set Wireless LAN specific
3441 parameters and get the specific stats. It is deprecated in favor the nl80211
3443 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3444 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3445 ;; other files are distributed under gpl2.
3446 (license (list license:gpl2 license:lgpl2.1+))))
3454 (uri (string-append "mirror://kernel.org/software/network/crda/"
3455 "crda-" version ".tar.xz"))
3458 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3459 (patches (search-patches "crda-optional-gcrypt.patch"))))
3460 (build-system gnu-build-system)
3462 `(#:phases (modify-phases %standard-phases
3464 (add-after 'unpack 'gzip-determinism
3466 (substitute* "Makefile"
3467 (("gzip") "gzip --no-name"))
3469 ,@(if (%current-target-system)
3471 'unpack 'fix-pkg-config
3472 (lambda* (#:key target #:allow-other-keys)
3476 (string-append target "-pkg-config")))
3480 'build 'no-werror-no-ldconfig
3482 (substitute* "Makefile"
3484 (("ldconfig") "true"))
3487 'build 'set-regulator-db-file-name
3488 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3489 ;; Tell CRDA where to find our database.
3490 (let ((regdb (assoc-ref (or native-inputs inputs)
3492 (substitute* "crda.c"
3493 (("\"/lib/crda/regulatory.bin\"")
3494 (string-append "\"" regdb
3495 "/lib/crda/regulatory.bin\"")))
3497 #:test-target "verify"
3498 #:make-flags (let ((out (assoc-ref %outputs "out"))
3499 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3501 (string-append "CC=" ,(cc-for-target))
3504 ;; Disable signature-checking on 'regulatory.bin'.
3505 ;; The reason is that this simplifies maintenance
3506 ;; on our side (no need to manage a distro key
3507 ;; pair), and we can guarantee integrity of
3508 ;; 'regulatory.bin' by other means anyway, such as
3509 ;; 'guix gc --verify'. See
3510 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3514 (string-append "PREFIX=" out)
3515 (string-append "SBINDIR=" out "/sbin/")
3516 (string-append "UDEV_RULE_DIR="
3517 out "/lib/udev/rules.d")
3518 (string-append "LDFLAGS=-Wl,-rpath="
3520 (string-append "REG_BIN=" regdb
3521 "/lib/crda/regulatory.bin")
3523 (native-inputs `(("pkg-config" ,pkg-config)
3524 ("wireless-regdb" ,wireless-regdb)))
3525 (inputs `(("libnl" ,libnl)))
3527 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3528 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3530 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3531 communication between the kernel Linux and user space for regulatory
3533 (license license:copyleft-next)))
3535 (define-public wireless-regdb
3537 (name "wireless-regdb")
3538 (version "2019.06.03")
3542 "mirror://kernel.org/software/network/wireless-regdb/"
3543 "wireless-regdb-" version ".tar.xz"))
3546 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
3548 ;; We're building 'regulatory.bin' by ourselves.
3550 (delete-file "regulatory.bin")
3552 (build-system gnu-build-system)
3555 (modify-phases %standard-phases
3556 (add-after 'unpack 'gzip-determinism
3558 (substitute* "Makefile"
3559 (("gzip") "gzip --no-name"))
3561 (add-after 'unpack 'omit-signature
3563 (substitute* "Makefile"
3564 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3565 ;; don't provide (see below). Disable it.
3566 ((" regulatory\\.db\\.p7s") "")
3567 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3568 ;; but ‘make install’ depends only on the latter while installing
3569 ;; both (and failing). Depend on it explicitly.
3570 (("^install: " all) (string-append all "regulatory.db ")))
3572 (delete 'configure)) ; no configure script
3574 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3575 ;; is computed and can be equal to 'maintainer-clean'; when that
3576 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3577 ;; just built. Thus, build things sequentially.
3578 #:parallel-build? #f
3580 #:tests? #f ; no tests
3582 (let ((out (assoc-ref %outputs "out")))
3583 (list (string-append "PREFIX=" out)
3584 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3586 ;; Leave this empty so that db2bin.py doesn't try to sign
3587 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3588 ;; pair for the whole distribution.
3589 (string-append "REGDB_PRIVKEY=")
3590 ;; Don't generate a public key for the same reason. These are
3591 ;; used as Makefile targets and can't be the empty string.
3592 (string-append "REGDB_PUBCERT=/dev/null")
3593 (string-append "REGDB_PUBKEY=/dev/null")))))
3595 `(("python" ,python-wrapper)))
3597 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3598 (synopsis "Wireless regulatory database")
3600 "This package contains the wireless regulatory database Central
3601 Regulatory Database Agent (CRDA) daemon. The database contains information on
3602 country-specific regulations for the wireless spectrum.")
3603 (license license:isc)))
3605 (define-public lm-sensors
3613 (url "https://github.com/groeck/lm-sensors.git")
3614 (commit (string-append "V" (string-join
3615 (string-split version #\.) "-")))))
3616 (file-name (git-file-name name version))
3618 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3619 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3620 (build-system gnu-build-system)
3621 (inputs `(("rrdtool" ,rrdtool)
3624 ("gnuplot" ,gnuplot)))
3625 (native-inputs `(("pkg-config" ,pkg-config)
3629 (outputs '("lib" ; avoid perl in closure
3632 `(#:tests? #f ; no 'check' target
3633 #:make-flags (list (string-append "PREFIX=" %output)
3634 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3635 (string-append "INCLUDEDIR="
3636 (assoc-ref %outputs "lib") "/include")
3637 (string-append "MANDIR=" %output "/share/man")
3638 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3640 (modify-phases %standard-phases
3642 (add-before 'build 'patch-exec-paths
3643 (lambda* (#:key inputs outputs #:allow-other-keys)
3644 (substitute* "prog/detect/sensors-detect"
3646 (string-append "`" (assoc-ref inputs "coreutils")
3648 (("(`|\")modprobe" all open-quote)
3649 (string-append open-quote
3650 (assoc-ref inputs "kmod")
3652 (substitute* '("prog/pwm/pwmconfig"
3653 "prog/pwm/fancontrol")
3655 (string-append (assoc-ref inputs "gnuplot")
3658 (string-append (assoc-ref inputs "coreutils")
3661 (string-append (assoc-ref inputs "grep")
3664 (string-append (assoc-ref inputs "sed")
3667 (string-append (assoc-ref inputs "coreutils")
3670 (string-append (assoc-ref inputs "coreutils")
3673 (string-append (assoc-ref inputs "coreutils")
3674 "/bin/readlink -f")))
3676 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3677 (synopsis "Utilities to read temperature/voltage/fan sensors")
3679 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3680 you to access information from temperature, voltage, and fan speed sensors.
3681 It works with most newer systems.")
3682 (license license:gpl2+)))
3684 (define-public iucode-tool
3686 (name "iucode-tool")
3690 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3691 "/raw/latest/iucode-tool_" version ".tar.xz"))
3694 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3695 (build-system gnu-build-system)
3696 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3697 (synopsis "Manipulate Intel microcode bundles")
3699 "@command{iucode_tool} is a utility to work with microcode packages for
3700 Intel processors. It can convert between formats, extract specific versions,
3701 create a firmware image suitable for the Linux kernel, and more.")
3702 ;; cpuid.h is available for i686, x86_64, and ia64.
3703 (supported-systems '("i686-linux" "x86_64-linux"))
3704 (license license:gpl2+)))
3706 (define-public i2c-tools
3713 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3714 version ".tar.bz2"))
3717 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3718 (build-system gnu-build-system)
3720 `(#:tests? #f ; no 'check' target
3721 #:make-flags (list (string-append "prefix=" %output)
3722 ,(string-append "CC=" (cc-for-target)))
3723 ;; No configure script.
3724 #:phases (modify-phases %standard-phases (delete 'configure))))
3727 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3728 (synopsis "I2C tools for Linux")
3730 "The i2c-tools package contains a heterogeneous set of I2C tools for
3731 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3732 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3734 (license license:gpl2+)))
3736 (define-public xsensors
3743 "http://www.linuxhardware.org/xsensors/xsensors-"
3747 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3748 (build-system gnu-build-system)
3749 (inputs `(("lm-sensors" ,lm-sensors "lib")
3751 (native-inputs `(("pkg-config" ,pkg-config)))
3754 (modify-phases %standard-phases
3755 (add-before 'configure 'enable-deprecated
3757 (substitute* "src/Makefile.in"
3758 (("-DGDK_DISABLE_DEPRECATED") "")
3759 (("-DGTK_DISABLE_DEPRECATED") ""))
3761 (add-before 'configure 'remove-Werror
3763 (substitute* '("configure" "src/Makefile.in")
3766 (home-page "http://www.linuxhardware.org/xsensors/")
3767 (synopsis "Hardware health information viewer")
3769 "Xsensors reads data from the libsensors library regarding hardware
3770 health such as temperature, voltage and fan speed and displays the information
3771 in a digital read-out.")
3772 (license license:gpl2+)))
3777 (version (package-version linux-libre))
3778 (source (package-source linux-libre))
3779 (build-system gnu-build-system)
3782 (modify-phases %standard-phases
3784 (lambda* (#:key inputs #:allow-other-keys)
3785 (setenv "SHELL_PATH" (which "bash"))
3786 (chdir "tools/perf")
3788 #:make-flags (list (string-append "prefix="
3789 (assoc-ref %outputs "out"))
3793 ;; By default, 'config/Makefile' uses lib64 on
3794 ;; x86_64. Work around that.
3796 #:tests? #f)) ;no tests
3798 `(("pkg-config" ,pkg-config)
3802 ;; There are build scripts written in these languages.
3804 ("python" ,python-2)))
3806 `(("slang" ,slang) ;for the interactive TUI
3808 ("python" ,python-2) ;'perf' links against libpython
3809 ("elfutils" ,elfutils)
3810 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3811 ("libunwind" ,libunwind) ;better stack walking
3812 ("numactl" ,numactl) ;for 'perf bench numa mem'
3815 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3816 ("docbook-xsl" ,docbook-xsl)
3818 ("asciidoc" ,asciidoc)))
3819 (home-page "https://perf.wiki.kernel.org/")
3820 (synopsis "Linux profiling with performance counters")
3822 "perf is a tool suite for profiling using hardware performance counters,
3823 with support in the Linux kernel. perf can instrument CPU performance
3824 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3825 of lightweight profiling. This package contains the user-land tools and in
3826 particular the @code{perf} command.")
3827 (license (package-license linux-libre))))
3829 (define-public pflask
3836 (url "https://github.com/ghedo/pflask")
3837 (commit (string-append "v" version))))
3838 (file-name (git-file-name name version))
3841 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
3842 (build-system cmake-build-system)
3844 '(#:tests? #f)) ; no tests
3845 (home-page "https://ghedo.github.io/pflask/")
3846 (synopsis "Simple tool for creating Linux namespace containers")
3847 (description "pflask is a simple tool for creating Linux namespace
3848 containers. It can be used for running a command or even booting an OS inside
3849 an isolated container, created with the help of Linux namespaces. It is
3850 similar in functionality to chroot, although pflask provides better isolation
3851 thanks to the use of namespaces.")
3852 (license license:bsd-2)))
3854 (define-public singularity
3856 (name "singularity")
3860 (uri (string-append "https://github.com/singularityware/singularity/"
3861 "releases/download/" version
3862 "/singularity-" version ".tar.gz"))
3865 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3866 (modules '((guix build utils)))
3869 ;; Do not create directories in /var.
3870 (substitute* "Makefile.in"
3871 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3873 ;; The original source overrides PATH so that it points to
3874 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3875 ;; on Guix System. Leave PATH unchanged so we refer to the
3876 ;; installed Coreutils, grep, etc.
3877 (substitute* "bin/singularity.in"
3879 (string-append "#" all "\n")))
3881 (substitute* (find-files "libexec/cli" "\\.exec$")
3882 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3884 (string-append "/run/setuid-programs/singularity-"
3885 program "-helper")))
3887 ;; These squashfs mount options are apparently no longer
3888 ;; supported since Linux-libre 5.4.5.
3889 (substitute* "src/lib/image/squashfs/mount.c"
3890 (("\"errors=remount-ro\"")
3893 (build-system gnu-build-system)
3895 `(#:configure-flags '("--localstatedir=/var")
3897 (modify-phases %standard-phases
3898 (add-after 'unpack 'patch-reference-to-squashfs-tools
3900 (substitute* "libexec/cli/build.exec"
3901 (("if ! singularity_which mksquashfs") "if 0")
3902 (("if ! mksquashfs")
3903 (string-append "if ! " (which "mksquashfs"))))
3905 (add-after 'install 'set-PATH
3906 (lambda* (#:key inputs outputs #:allow-other-keys)
3907 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
3908 (let ((out (assoc-ref outputs "out"))
3909 (coreutils (assoc-ref inputs "coreutils")))
3910 (wrap-program (string-append out "/bin/singularity")
3911 `("PATH" ":" = (,(string-append coreutils "/bin"))))
3912 (substitute* (string-append out "/bin/run-singularity")
3913 (("/usr/bin/env singularity")
3914 (string-append (which "env") " "
3915 out "/bin/singularity")))
3918 `(("libarchive" ,libarchive)
3919 ("python" ,python-wrapper)
3921 ("squashfs-tools" ,squashfs-tools)))
3922 (home-page "https://singularity.lbl.gov/")
3923 (synopsis "Container platform")
3924 (description "Singularity is a container platform supporting a number of
3925 container image formats. It can build SquashFS container images or import
3926 existing Docker images. Singularity requires kernel support for container
3927 isolation or root privileges.")
3928 (license license:bsd-3)))
3930 (define-public hdparm
3936 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3937 "hdparm-" version ".tar.gz"))
3940 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3941 (build-system gnu-build-system)
3944 (let ((out (assoc-ref %outputs "out")))
3945 (list (string-append "binprefix=" out)
3946 (string-append "manprefix=" out)
3947 ,(string-append "CC=" (cc-for-target))
3948 ;; Let Guix strip the binaries and not break cross-compilation.
3951 (modify-phases %standard-phases
3952 (delete 'configure)) ; no configure script
3953 #:tests? #f)) ; no test suite
3954 (home-page "https://sourceforge.net/projects/hdparm/")
3955 (synopsis "View and tune ATA disk drive parameters")
3957 "@command{hdparm} is a command-line utility to control ATA controllers and
3958 disk drives. It can increase performance and/or reliability by careful tuning
3959 of hardware settings like power and acoustic management, DMA modes, and caching.
3960 It can also display detailed device information, or be used as a simple
3961 performance benchmarking tool.
3963 @command{hdparm} provides a command line interface to various Linux kernel
3964 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3965 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3966 Translation (@dfn{SAT}) are also supported.")
3967 (license (license:non-copyleft "file://LICENSE.TXT"))))
3969 (define-public nvme-cli
3973 (home-page "https://github.com/linux-nvme/nvme-cli")
3978 (commit (string-append "v" version))))
3980 (base32 "0ldky34sn0m5c4hgiip0fkzm465nca69bhxicpd5dg8wxhzxqrp3"))
3981 (file-name (git-file-name name version))))
3982 (build-system gnu-build-system)
3985 (list ,(string-append "CC=" (cc-for-target)))
3986 #:phases (modify-phases %standard-phases
3987 (delete 'configure) ; no ./configure script
3990 (invoke "make" "install-spec" "PREFIX="
3991 (string-append "DESTDIR=" %output)))))
3992 ;; The tests require sysfs, which is not accessible from from the build
3995 (synopsis "NVM-Express user space tooling for Linux")
3996 (description "Nvme-cli is a utility to provide standards compliant tooling
3997 for NVM-Express drives. It was made specifically for Linux as it relies on the
3998 IOCTLs defined by the mainline kernel driver.")
3999 (license license:gpl2+)))
4001 (define-public rfkill
4007 (uri (string-append "mirror://kernel.org/software/network/"
4008 name "/" name "-" version ".tar.xz"))
4011 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4012 (build-system gnu-build-system)
4014 `(#:make-flags (list "CC=gcc"
4015 (string-append "PREFIX=" %output))
4016 #:phases (modify-phases %standard-phases
4017 (delete 'configure))
4019 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4020 (synopsis "Tool for enabling and disabling wireless devices")
4022 "rfkill is a simple tool for accessing the rfkill device interface,
4023 which is used to enable and disable wireless networking devices, typically
4024 WLAN, Bluetooth and mobile broadband.")
4025 (license (license:non-copyleft "file://COPYING"
4026 "See COPYING in the distribution."))
4027 ;; rfkill is part of util-linux as of 2.31.
4028 (properties `((superseded . ,util-linux)))))
4036 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4037 version "/" name "-" version ".tar.gz"))
4040 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4041 (build-system gnu-build-system)
4042 (home-page "http://acpiclient.sourceforge.net")
4043 (synopsis "Display information on ACPI devices")
4044 (description "@code{acpi} attempts to replicate the functionality of the
4045 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4046 information. It does not support ACPI suspending, only displays information
4047 about ACPI devices.")
4048 (license license:gpl2+)))
4050 (define-public acpid
4056 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4060 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4061 (build-system gnu-build-system)
4062 (home-page "https://sourceforge.net/projects/acpid2/")
4063 (synopsis "Daemon for delivering ACPI events to user-space programs")
4065 "acpid is designed to notify user-space programs of Advanced
4066 Configuration and Power Interface (ACPI) events. acpid should be started
4067 during the system boot, and will run as a background process. When an ACPI
4068 event is received from the kernel, acpid will examine the list of rules
4069 specified in /etc/acpi/events and execute the rules that match the event.")
4070 (license license:gpl2+)))
4072 (define-public sysfsutils
4081 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4084 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4085 (build-system gnu-build-system)
4086 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4087 (synopsis "System utilities based on Linux sysfs")
4089 "These are a set of utilities built upon sysfs, a virtual file system in
4090 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4091 also contains the libsysfs library.")
4092 ;; The library is under lgpl2.1+ (all files say "or any later version").
4093 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4094 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4096 (define-public sysfsutils-1
4098 (inherit sysfsutils)
4105 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4106 "/sysfsutils-" version ".tar.gz"))
4108 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4109 (modules '((guix build utils)))
4112 (substitute* "Makefile.in"
4113 (("includedir = /usr/include/sysfs")
4114 "includedir = @includedir@"))
4115 (substitute* "configure"
4116 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4117 (string-append "includedir='" orig "/sysfs'")))
4119 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4121 (define-public cpufrequtils
4123 (name "cpufrequtils")
4128 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4129 "cpufrequtils-" version ".tar.gz"))
4131 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4132 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4133 (build-system gnu-build-system)
4135 `(("sysfsutils" ,sysfsutils-1)))
4137 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4138 (assoc-ref %outputs "out") "/lib"))))
4139 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4140 (synopsis "Utilities to get and set CPU frequency on Linux")
4142 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4143 information, and set the CPU frequency if supported, using the cpufreq
4144 capabilities of the Linux kernel.")
4145 (license license:gpl2)))
4147 (define-public libraw1394
4154 "mirror://kernel.org/linux/libs/ieee1394/"
4155 name "-" version ".tar.xz"))
4158 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4159 (build-system gnu-build-system)
4160 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4161 (synopsis "Interface library for the Linux IEEE1394 drivers")
4163 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4164 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4165 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4166 send to and receive from other nodes without requiring a kernel driver for the
4167 protocol in question.")
4168 (license license:lgpl2.1+)))
4170 (define-public libavc1394
4176 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4177 name "-" version ".tar.gz"))
4180 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4181 (build-system gnu-build-system)
4183 `(("pkg-config" ,pkg-config)))
4185 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4186 (home-page "https://sourceforge.net/projects/libavc1394/")
4187 (synopsis "AV/C protocol library for IEEE 1394")
4189 "Libavc1394 is a programming interface to the AV/C specification from
4190 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4191 (license license:lgpl2.1+)))
4193 (define-public libiec61883
4195 (name "libiec61883")
4200 "mirror://kernel.org/linux/libs/ieee1394/"
4201 name "-" version ".tar.xz"))
4204 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4205 (build-system gnu-build-system)
4207 `(("pkg-config" ,pkg-config)))
4209 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4210 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4211 (synopsis "Isochronous streaming media library for IEEE 1394")
4213 "The libiec61883 library provides a higher level API for streaming DV,
4214 MPEG-2 and audio over Linux IEEE 1394.")
4215 (license license:lgpl2.1+)))
4217 (define-public mdadm
4224 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4228 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4229 (build-system gnu-build-system)
4233 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4234 (list ,(string-append "CC=" (cc-for-target))
4237 ;; TODO: tell it where to find 'sendmail'
4238 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4239 (string-append "BINDIR=" out "/sbin")
4240 (string-append "MANDIR=" out "/share/man")
4241 (string-append "UDEVDIR=" out "/lib/udev")))
4243 (modify-phases %standard-phases
4244 (add-before 'build 'patch-program-paths
4245 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4246 (let ((coreutils (assoc-ref (or native-inputs inputs)
4248 (substitute* "udev-md-raid-arrays.rules"
4249 (("/usr/bin/(readlink|basename)" all program)
4250 (string-append coreutils "/bin/" program))))
4252 (add-before 'build 'remove-W-error
4254 ;; We cannot build with -Werror on i686 due to a
4255 ;; 'sign-compare' warning in util.c.
4256 (substitute* "Makefile"
4259 (delete 'configure))
4260 ;;tests must be done as root
4262 (supported-systems (delete "i586-gnu" %supported-systems))
4263 (home-page "http://neil.brown.name/blog/mdadm")
4264 (synopsis "Tool for managing Linux Software RAID arrays")
4266 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4267 assemble, report on, and monitor arrays. It can also move spares between raid
4268 arrays when needed.")
4269 (license license:gpl2+)))
4271 (define-public mdadm-static
4274 (name "mdadm-static")
4276 (substitute-keyword-arguments (package-arguments mdadm)
4277 ((#:make-flags flags)
4278 `(cons "LDFLAGS = -static" ,flags))
4280 `(modify-phases ,phases
4281 (add-after 'install 'remove-cruft
4282 (lambda* (#:key outputs #:allow-other-keys)
4283 (let* ((out (assoc-ref outputs "out"))
4284 (precious? (lambda (file)
4285 (member file '("." ".." "sbin"))))
4286 (directories (scandir out (negate precious?))))
4287 (with-directory-excursion out
4288 (for-each delete-file-recursively directories)
4289 (remove-store-references "sbin/mdadm")
4290 (delete-file "sbin/mdmon")
4292 ((#:modules modules %gnu-build-system-modules)
4293 `((ice-9 ftw) ,@modules))
4294 ((#:strip-flags _ '())
4295 ''("--strip-all")) ;strip a few extra KiB
4296 ((#:allowed-references _ '("out"))
4297 '("out")))) ;refer only self
4298 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4300 (define-public multipath-tools
4302 (name "multipath-tools")
4307 (url "https://git.opensvc.com/multipath-tools/.git")
4309 (file-name (git-file-name name version))
4312 "14n8pcgnliicqxzc40xvjxk4cafm4qx7a3rsx5qva74r3ydzx8rn"))
4313 (patches (search-patches "multipath-tools-sans-systemd.patch"))
4314 (modules '((guix build utils)))
4317 ;; Drop bundled valgrind headers.
4318 (delete-file-recursively "third-party")
4319 (substitute* '("multipathd/main.c"
4320 "libmultipath/debug.c")
4321 (("#include \"../third-party/")
4324 (build-system gnu-build-system)
4326 '(#:test-target "test"
4327 #:parallel-build? #f ;XXX: broken in 0.8.4
4328 #:make-flags (list "CC=gcc"
4329 (string-append "DESTDIR="
4330 (assoc-ref %outputs "out"))
4331 ;; Install Udev rules below this directory, relative
4334 (string-append "LDFLAGS=-Wl,-rpath="
4335 (assoc-ref %outputs "out")
4338 (modify-phases %standard-phases
4339 (add-after 'unpack 'patch-source
4340 (lambda* (#:key inputs #:allow-other-keys)
4341 (let ((lvm2 (assoc-ref inputs "lvm2"))
4342 (udev (assoc-ref inputs "udev")))
4343 (substitute* "Makefile.inc"
4344 (("\\$\\(prefix\\)/usr") "$(prefix)")
4345 ;; Do not save timestamp to avoid gzip "timestamp
4346 ;; out-of-range" warnings.
4347 (("gzip -9") "gzip -9n"))
4348 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4349 (("/usr/include/libdevmapper.h")
4350 (string-append lvm2 "/include/libdevmapper.h"))
4351 (("/usr/include/libudev.h")
4352 (string-append udev "/include/libudev.h")))
4354 (add-after 'unpack 'fix-maybe-uninitialized-variable
4356 ;; This variable gets initialized later if needed, but GCC 7
4357 ;; fails to notice. Should be fixed for > 0.8.4.
4358 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4359 (substitute* "libmultipath/structs_vec.c"
4360 (("bool is_queueing;")
4361 "bool is_queueing = false;"))
4363 (add-after 'unpack 'fix-linking-tests
4365 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4366 ;; for versions > 0.8.4.
4367 (substitute* "tests/Makefile"
4368 (("-lmultipath -lcmocka")
4369 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4371 (delete 'configure)))) ; no configure script
4374 ("pkg-config" ,pkg-config)
4375 ("valgrind" ,valgrind)
4378 ("cmocka" ,cmocka)))
4380 `(("json-c" ,json-c-0.13)
4382 ("liburcu" ,liburcu)
4384 ("readline" ,readline)
4386 (home-page "http://christophe.varoqui.free.fr/")
4387 (synopsis "Access block devices through multiple paths")
4389 "This package provides the following binaries to drive the
4390 Linux Device Mapper multipathing driver:
4392 @item @command{multipath} - Device mapper target autoconfig.
4393 @item @command{multipathd} - Multipath daemon.
4394 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4395 @code{dm} multipath devices.
4396 @item @command{kpartx} - Create device maps from partition tables.
4398 (license (list license:gpl2+ ; main distribution
4399 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4401 (define-public libaio
4408 (string-append "https://releases.pagure.org/libaio/"
4409 name "-" version ".tar.gz")))
4412 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4413 (build-system gnu-build-system)
4416 (let ((target ,(%current-target-system)))
4417 (list (string-append "prefix=" %output)
4420 (string-append (assoc-ref %build-inputs "cross-gcc")
4421 "/bin/" target "-gcc")
4423 #:test-target "partcheck" ; need root for a full 'check'
4425 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4426 (home-page "https://pagure.io/libaio")
4427 (synopsis "Linux-native asynchronous I/O access library")
4429 "This library enables userspace to use Linux kernel asynchronous I/O
4430 system calls, important for the performance of databases and other advanced
4432 (license license:lgpl2.1+)))
4434 (define-public blktrace
4435 ;; Take a newer commit to get the fix for CVE-2018-10689.
4436 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4440 (version (git-version "1.2.0" revision commit))
4442 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4449 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4450 (file-name (git-file-name name version))))
4451 (build-system gnu-build-system)
4454 (list ,(string-append "CC=" (cc-for-target))
4455 (string-append "prefix=" %output))
4456 #:tests? #f ; no tests
4458 (modify-phases %standard-phases
4459 (delete 'configure) ; no configure script
4460 (add-after 'unpack 'fix-gnuplot-path
4461 (lambda* (#:key inputs #:allow-other-keys)
4462 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4463 (substitute* "btt/bno_plot.py"
4465 (string-append gnuplot "/bin/gnuplot %s")))
4468 `(("libaio" ,libaio)
4469 ("gnuplot" ,gnuplot)
4470 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4471 (synopsis "Block layer IO tracing mechanism")
4472 (description "Blktrace is a block layer IO tracing mechanism which provides
4473 detailed information about request queue operations to user space. It extracts
4474 event traces from the kernel (via the relaying through the debug file system).")
4475 (license license:gpl2))))
4483 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4487 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4488 (build-system gnu-build-system)
4490 `(("libsndfile" ,libsndfile)))
4492 `(("pkg-config" ,pkg-config)))
4493 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4494 (synopsis "Bluetooth subband audio codec")
4496 "The SBC is a digital audio encoder and decoder used to transfer data to
4497 Bluetooth audio output devices like headphones or loudspeakers.")
4498 (license license:gpl2+)))
4500 (define-public bluez
4507 "mirror://kernel.org/linux/bluetooth/bluez-"
4511 "1p2ncvjz6alr9n3l5wvq2arqgc7xjs6dqyar1l9jp0z8cfgapkb8"))))
4512 (build-system gnu-build-system)
4515 (let ((out (assoc-ref %outputs "out")))
4516 (list "--sysconfdir=/etc"
4517 "--localstatedir=/var"
4520 ;; Install dbus/udev files to the correct location.
4521 (string-append "--with-dbusconfdir=" out "/etc")
4522 (string-append "--with-udevdir=" out "/lib/udev")))
4524 (modify-phases %standard-phases
4525 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4526 ;; issue (discussion on upstream mailing list:
4527 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4528 (add-before 'check 'skip-wonky-test
4530 (substitute* "unit/test-gatt.c"
4531 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4533 (add-after 'install 'post-install
4534 (lambda* (#:key inputs outputs #:allow-other-keys)
4535 (let* ((out (assoc-ref outputs "out"))
4536 (servicedir (string-append out "/share/dbus-1/services"))
4537 (service "obexd/src/org.bluez.obex.service")
4538 (rule (string-append
4539 out "/lib/udev/rules.d/97-hid2hci.rules")))
4540 ;; Install the obex dbus service file.
4541 (substitute* service
4543 (string-append out "/libexec/bluetooth/obexd")))
4544 (install-file service servicedir)
4545 ;; Fix paths in the udev rule.
4547 (("hid2hci --method")
4548 (string-append out "/lib/udev/hid2hci --method"))
4550 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4553 `(("pkg-config" ,pkg-config)
4554 ("gettext" ,gettext-minimal)))
4559 ("libical" ,libical)
4560 ("readline" ,readline)))
4561 (home-page "http://www.bluez.org/")
4562 (synopsis "Linux Bluetooth protocol stack")
4564 "BlueZ provides support for the core Bluetooth layers and protocols. It
4565 is flexible, efficient and uses a modular implementation.")
4566 (license license:gpl2+)))
4568 (define-public fuse-exfat
4575 "https://github.com/relan/exfat/releases/download/v"
4576 version "/" name "-" version ".tar.gz"))
4579 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4580 (build-system gnu-build-system)
4582 `(("pkg-config" ,pkg-config)))
4585 (home-page "https://github.com/relan/exfat")
4586 (synopsis "Mount exFAT file systems")
4588 "This package provides a FUSE-based file system that provides read and
4589 write access to exFAT devices.")
4590 (license license:gpl2+)))
4592 (define-public fuseiso
4595 (version "20070708")
4598 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4599 version "/fuseiso-" version ".tar.bz2"))
4602 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4603 (build-system gnu-build-system)
4605 `(("pkg-config" ,pkg-config)))
4610 (home-page "https://sourceforge.net/projects/fuseiso/")
4611 (synopsis "Mount ISO file system images")
4613 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4614 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4615 Ridge, Joliet, and zisofs.")
4616 (license license:gpl2)))
4625 "https://www.nico.schottelius.org/software/gpm/archives/"
4626 "gpm-" version ".tar.bz2"))
4627 (patches (search-patches "gpm-glibc-2.26.patch"))
4630 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4631 (build-system gnu-build-system)
4633 '(#:phases (modify-phases %standard-phases
4636 ;; The tarball was not generated with 'make dist' so we
4637 ;; need to bootstrap things ourselves.
4638 (substitute* "autogen.sh"
4639 (("/bin/sh") (which "sh")))
4640 (invoke "./autogen.sh")
4641 (patch-makefile-SHELL "Makefile.include.in")
4644 ;; Make sure programs find libgpm.so.
4645 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4646 (assoc-ref %outputs "out")
4649 `(("texinfo" ,texinfo)
4652 ("autoconf" ,autoconf)
4653 ("automake" ,automake)
4654 ("libtool" ,libtool)))
4655 (home-page "https://www.nico.schottelius.org/software/gpm/")
4656 (synopsis "Mouse support for the Linux console")
4658 "The GPM (general-purpose mouse) daemon is a mouse server for
4659 applications running on the Linux console. It allows users to select items
4660 and copy/paste text in the console and in xterm.")
4661 (license license:gpl2+)))
4663 (define-public btrfs-progs
4665 (name "btrfs-progs")
4669 (uri (string-append "mirror://kernel.org/linux/kernel/"
4670 "people/kdave/btrfs-progs/"
4671 "btrfs-progs-v" version ".tar.xz"))
4674 "0srg276yccfmqz0skmmga3vbqx4wiqsk1l6h86n6ryhxa9viqcm1"))))
4675 (build-system gnu-build-system)
4677 "static")) ; static versions of the binaries in "out"
4679 '(#:phases (modify-phases %standard-phases
4680 (add-after 'unpack 'patch-makefile
4681 (lambda* (#:key outputs #:allow-other-keys)
4682 (substitute* "Makefile"
4683 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4684 (string-append (assoc-ref outputs "out")
4685 "/lib/udev/rules.d")))
4687 (add-after 'build 'build-static
4688 (lambda _ (invoke "make" "static")))
4689 (add-after 'install 'install-bash-completion
4690 (lambda* (#:key outputs #:allow-other-keys)
4691 (let* ((out (assoc-ref outputs "out"))
4692 (bashcomp (string-append out "/etc/bash_completion.d")))
4694 (copy-file "btrfs-completion"
4695 (string-append bashcomp "/btrfs"))
4697 (add-after 'install 'install-static
4698 (let ((staticbin (string-append (assoc-ref %outputs "static")
4702 (string-append "bindir=" staticbin)
4703 "install-static")))))
4704 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4705 #:test-target "test"
4706 #:parallel-tests? #f)) ; tests fail when run in parallel
4707 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4709 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
4710 ("util-linux:static" ,util-linux "static") ;ditto
4712 ("zlib:static" ,zlib "static")
4713 ("zstd" ,zstd "lib")
4714 ("zstd:static" ,zstd "static")))
4715 (native-inputs `(("pkg-config" ,pkg-config)
4716 ("asciidoc" ,asciidoc)
4719 ;; For building documentation.
4720 ("libxml2" ,libxml2)
4721 ("docbook-xsl" ,docbook-xsl)
4727 ;; The tests need 'grep' with perl regexp support.
4729 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4730 (synopsis "Create and manage btrfs copy-on-write file systems")
4731 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4732 aimed at implementing advanced features while focusing on fault tolerance,
4733 repair and easy administration.")
4734 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4735 ;; GPL2: Everything else.
4736 (license (list license:gpl2 license:gpl2+))))
4738 (define-public btrfs-progs/static
4740 (name "btrfs-progs-static")
4741 (version (package-version btrfs-progs))
4743 (build-system trivial-build-system)
4745 `(("btrfs-progs:static" ,btrfs-progs "static")))
4747 `(#:modules ((guix build utils))
4750 (use-modules (guix build utils)
4754 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4755 (out (assoc-ref %outputs "out"))
4756 (source (string-append btrfs "/bin/btrfs.static"))
4757 (target (string-append out "/bin/btrfs")))
4758 (mkdir-p (dirname target))
4759 (copy-file source target)
4760 (remove-store-references target)
4761 (chmod target #o555)
4763 (home-page (package-home-page btrfs-progs))
4764 (synopsis "Statically-linked btrfs command from btrfs-progs")
4765 (description "This package provides the statically-linked @command{btrfs}
4766 from the btrfs-progs package. It is meant to be used in initrds.")
4767 (license (package-license btrfs-progs))))
4769 (define-public cramfs-tools
4771 (name "cramfs-tools")
4772 (home-page "https://github.com/npitre/cramfs-tools")
4778 (commit (string-append "v" version))))
4780 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
4781 (file-name (git-file-name name version))))
4782 (build-system gnu-build-system)
4784 '(#:tests? #f ; No tests.
4786 (modify-phases %standard-phases
4789 (lambda* (#:key outputs #:allow-other-keys)
4790 (let ((out (assoc-ref outputs "out")))
4791 (install-file "mkcramfs" (string-append out "/sbin"))
4792 (install-file "cramfsck" (string-append out "/sbin")))
4796 (synopsis "Tools to manage Cramfs file systems")
4797 (description "Cramfs is a Linux file system designed to be simple, small,
4798 and to compress things well. It is used on a number of embedded systems and
4799 small devices. This version has additional features such as uncompressed
4800 blocks and random block placement.")
4801 (license license:gpl2+)))
4803 (define-public compsize
4807 (home-page "https://github.com/kilobyte/compsize")
4812 (commit (string-append "v" version))))
4814 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4815 (file-name (git-file-name name version))))
4816 (build-system gnu-build-system)
4818 `(("btrfs-progs" ,btrfs-progs)))
4820 `(#:tests? #f ; No tests.
4821 #:make-flags (list "CC=gcc")
4823 (modify-phases %standard-phases
4826 (lambda* (#:key outputs #:allow-other-keys)
4827 (let ((out (assoc-ref outputs "out")))
4828 (install-file "compsize" (string-append out "/bin"))
4829 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4830 (synopsis "Find compression type/ratio on Btrfs files")
4831 (description "@command{compsize} takes a list of files (given as
4832 arguments) on a Btrfs file system and measures used compression types and
4833 effective compression ratio, producing a report.
4835 A directory has no extents but has a (recursive) list of files. A non-regular
4836 file is silently ignored.
4838 As it makes no sense to talk about compression ratio of a partial extent,
4839 every referenced extent is counted whole, exactly once -- no matter if you use
4840 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4841 uncompressed size will not match the number given by @command{tar} or
4842 @command{du}. On the other hand, the space used should be accurate (although
4843 obviously it can be shared with files outside our set).")
4844 (license license:gpl2+)))
4846 (define-public 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 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4859 (build-system gnu-build-system)
4862 (modify-phases %standard-phases
4863 (add-after 'install 'install-headers
4864 (lambda* (#:key outputs #:allow-other-keys)
4865 (let* ((out (assoc-ref outputs "out"))
4866 (out-include (string-append out "/include")))
4867 (install-file "include/f2fs_fs.h" out-include)
4868 (install-file "mkfs/f2fs_format_utils.h" out-include)
4871 `(("autoconf" ,autoconf)
4872 ("automake" ,automake)
4873 ("libtool" ,libtool)
4874 ("pkg-config" ,pkg-config)))
4876 `(("libuuid" ,util-linux "lib")
4877 ("libselinux" ,libselinux)))
4878 (home-page "https://f2fs.wiki.kernel.org/")
4879 (synopsis "Userland tools for f2fs")
4881 "F2FS, the Flash-Friendly File System, is a modern file system
4882 designed to be fast and durable on flash devices such as solid-state
4883 disks and SD cards. This package provides the userland utilities.")
4884 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4885 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4886 (license (list license:gpl2 license:lgpl2.1))))
4888 (define-public f2fs-tools
4890 (inherit f2fs-tools-1.7)
4896 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4897 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4900 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4902 `(("libuuid" ,util-linux "lib")))))
4904 (define-public f2fs-tools/static
4907 (inherit f2fs-tools)
4908 (name "f2fs-tools-static")
4911 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
4912 (libuuid (assoc-ref %build-inputs "libuuid")))
4914 (string-append "libuuid_CFLAGS=-I" libuuid "/include")
4915 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
4916 (string-append "libblkid_CFLAGS=-I" libuuid "/include")
4917 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
4918 #:disallowed-references (,util-linux)
4920 (modify-phases %standard-phases ; TODO: f2fs phases.
4921 (add-after 'unpack 'make-static
4923 (define (append-to-file name body)
4924 (let ((file (open-file name "a")))
4927 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
4928 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
4929 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
4931 (add-after 'install 'remove-store-references
4932 (lambda* (#:key outputs #:allow-other-keys)
4933 ;; Work around bug in our util-linux.
4934 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
4935 (remove-store-references (string-append (assoc-ref outputs "out")
4939 `(("libuuid:static" ,util-linux "static")
4940 ("libuuid" ,util-linux "lib")))))) ; for include files
4942 (define-public f2fs-fsck/static
4944 (name "f2fs-fsck-static")
4945 (version (package-version f2fs-tools/static))
4947 (build-system trivial-build-system)
4949 `(#:modules ((guix build utils))
4952 (use-modules (guix build utils)
4955 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
4957 (out (assoc-ref %outputs "out"))
4958 (sbin (string-append out "/sbin")))
4960 (with-directory-excursion sbin
4961 (install-file (string-append f2fs-tools "/sbin/" fsck)
4963 (remove-store-references fsck)
4967 `(("f2fs-tools-static" ,f2fs-tools/static)))
4968 (home-page (package-home-page f2fs-tools/static))
4969 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
4970 (description "This package provides statically-linked fsck.f2fs command taken
4971 from the f2fs-tools package. It is meant to be used in initrds.")
4972 (license (package-license f2fs-tools/static))))
4974 (define-public freefall
4977 (version (package-version linux-libre))
4978 (source (package-source linux-libre))
4979 (build-system gnu-build-system)
4981 '(#:phases (modify-phases %standard-phases
4982 (add-after 'unpack 'enter-subdirectory
4984 (chdir "tools/laptop/freefall")
4987 (add-before 'build 'increase-timeout
4989 ;; The default of 2 seconds is too low: it assumes an
4990 ;; open lid and AC power without actually checking.
4991 (substitute* "freefall.c"
4992 (("alarm\\(2\\)") "alarm(5)"))
4994 #:make-flags (list (string-append "PREFIX="
4995 (assoc-ref %outputs "out"))
4997 #:tests? #f)) ;no tests
4998 (home-page (package-home-page linux-libre))
4999 (synopsis "Free-fall protection for spinning laptop hard drives")
5001 "Prevents shock damage to the internal spinning hard drive(s) of some
5002 HP and Dell laptops. When sudden movement is detected, all input/output
5003 operations on the drive are suspended and its heads are parked on the ramp,
5004 where they are less likely to cause damage to the spinning disc. Requires a
5005 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5006 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5007 (license license:gpl2)))
5009 (define-public thinkfan
5017 (url "https://github.com/vmatare/thinkfan.git")
5019 (file-name (git-file-name name version))
5021 (base32 "0vmkpj575a1w52zx1jn6kdrk8rc9vp0f1bldi1bajicpgbs6rjd3"))))
5022 (build-system cmake-build-system)
5024 `(#:modules ((guix build cmake-build-system)
5027 #:tests? #f ; no test target
5029 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5030 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5032 `("-DUSE_ATASMART:BOOL=ON")
5034 (modify-phases %standard-phases
5035 (add-after 'unpack 'create-init-scripts
5036 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5037 ;; systemd to patch and install their service files. Fake their
5038 ;; presence rather than duplicating the build system below. Leave
5039 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5040 ;; The sysvinit needs manual patching, but since upstream doesn't
5041 ;; even provide the option to install it: don't.
5042 (lambda* (#:key outputs #:allow-other-keys)
5043 (let* ((out (assoc-ref outputs "out"))
5044 (share (string-append out "/share/" ,name)))
5045 (substitute* "CMakeLists.txt"
5046 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5047 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5048 ;; That was easy! Now we just need to fix the destinations.
5050 (string-append out directory)))
5053 `(("pkg-config" ,pkg-config)))
5055 `(("libatasmart" ,libatasmart)
5056 ("yaml-cpp" ,yaml-cpp)))
5057 (home-page "https://github.com/vmatare/thinkfan")
5058 (synopsis "Simple fan control program")
5060 "Thinkfan is a simple fan control program. It reads temperatures,
5061 checks them against configured limits and switches to appropriate (also
5062 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5063 other @code{hwmon} driver that enables temperature reading and fan control
5065 (license license:gpl3+)))
5067 (define-public tpacpi-bat
5075 (url "https://github.com/teleshoes/tpacpi-bat.git")
5076 (commit (string-append "v" version))))
5077 (file-name (git-file-name name version))
5079 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5080 (build-system gnu-build-system)
5082 `(#:tests? #f ; no test target
5084 (modify-phases %standard-phases
5085 (add-after 'unpack 'refer-to-inputs
5087 (substitute* "tpacpi-bat"
5089 (format #f "~a " (which "cat")))
5090 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5091 ;; loaded. That's the administrator's prerogative; disable it.
5092 (("system \"(modprobe .*)\"" _ match)
5093 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5095 (delete 'configure) ; nothing to configure
5096 (delete 'build) ; nothing to build
5098 (lambda* (#:key outputs #:allow-other-keys)
5099 (let* ((out (assoc-ref outputs "out"))
5100 (bin (string-append out "/bin"))
5101 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5102 (install-file "tpacpi-bat" bin)
5104 ;; There's no man page. Install other forms of documentation.
5105 (for-each (lambda (file)
5106 (let ((target (string-append doc "/" file)))
5107 (mkdir-p (dirname target))
5108 (copy-recursively file target)))
5109 (list "battery_asl" "examples" "README.md"))
5113 (home-page "https://github.com/teleshoes/tpacpi-bat")
5114 (synopsis "ThinkPad battery charge controller")
5116 "Tpacpi-bat is a command-line interface to control battery charging on
5117 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5118 ThinkPad models released after 2011}, starting with the xx20 series. It can
5119 query and set the thresholds at which one or both batteries will start and stop
5120 charging, inhibit charging batteries for a set period of time, or force them to
5121 discharge when they otherwise would not.
5123 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5124 kernel module provided by the @code{acpi-call-linux-module} package, which must
5125 be installed and loaded separately. Only the original vendor firmware is
5127 (license license:gpl3+)))
5129 (define-public ntfs-3g
5132 (version "2017.3.23")
5135 (uri (string-append "https://tuxera.com/opensource/"
5136 "ntfs-3g_ntfsprogs-" version ".tgz"))
5137 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5140 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5141 (modules '((guix build utils)))
5143 ;; Install under $prefix.
5144 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5148 (build-system gnu-build-system)
5149 (inputs `(("util-linux" ,util-linux)
5150 ("fuse" ,fuse))) ;libuuid
5151 (native-inputs `(("pkg-config" ,pkg-config)))
5153 '(#:configure-flags (list "--exec-prefix=${prefix}"
5154 "--with-fuse=external" ;use our own FUSE
5155 "--enable-mount-helper"
5156 "--enable-posix-acls"
5157 "--enable-xattr-mappings")
5159 (modify-phases %standard-phases
5160 ;; If users install ntfs-3g, they probably want to make it the
5161 ;; default driver as well, so we opt for sensible defaults and link
5162 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5163 ;; mount NTFS file systems.)
5164 (add-after 'install 'install-link
5165 (lambda* (#:key outputs #:allow-other-keys)
5166 (let* ((out (assoc-ref outputs "out"))
5167 (sbin (string-append out "/sbin")))
5168 (symlink "mount.ntfs-3g"
5169 (string-append sbin "/mount.ntfs")))
5171 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5172 (synopsis "Read-write access to NTFS file systems")
5174 "NTFS-3G provides read-write access to NTFS file systems, which are
5175 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5176 The package provides additional NTFS tools.")
5177 (license license:gpl2+)))
5179 (define-public rdma-core
5185 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5186 "/releases/download/v" version "/rdma-core-"
5190 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
5191 (build-system cmake-build-system)
5193 `(#:tests? #f ; no tests
5194 ;; Upstream uses the "ninja" build system and encourage distros
5195 ;; to do the same for consistency. They also recommend using the
5196 ;; "Release" build type.
5197 #:build-type "Release"
5198 #:configure-flags (list "-GNinja"
5200 (string-append "-DRST2MAN_EXECUTABLE="
5201 (assoc-ref %build-inputs
5205 ;; On some configurations, the
5206 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
5207 ;; used by default, would return ENODEV. To
5208 ;; avoid that, use 'write' instead of ioctls,
5209 ;; as suggested in 'CMakeList.txt'.
5210 "-DIOCTL_MODE=write")
5212 (modify-phases %standard-phases
5216 "-j" (number->string (parallel-job-count)))))
5219 (invoke "ninja" "install"))))))
5222 ("pkg-config" ,pkg-config)
5223 ("python" ,python-wrapper)
5224 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5228 (home-page "https://github.com/linux-rdma/rdma-core")
5229 (synopsis "Utilities and libraries for working with RDMA devices")
5231 "This package provides userspace components for the InfiniBand
5232 subsystem of the Linux kernel. Specifically it contains userspace
5233 libraries for the following device nodes:
5236 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5237 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5238 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5241 The following service daemons are also provided:
5243 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5244 @item @code{iwpmd} (for iWARP kernel providers)
5245 @item @code{ibacm} (for InfiniBand communication management assistant)
5247 ;; All library code is dual licensed under GPL2 and a custom MIT
5248 ;; variant. The package also includes some components covered by
5249 ;; other licenses. Consult COPYING.md for full details.
5252 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5253 license:bsd-2 ; Files referring to COPYING.BSD_FB
5254 license:cc0 ; most files in ccan/
5255 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5257 (define-public perftest
5264 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5265 version "/perftest-" version ".g0927198.tar.gz"))
5267 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5268 (build-system gnu-build-system)
5271 (modify-phases %standard-phases
5272 (add-after 'unpack 'patch-header-paths
5274 (substitute* '("src/raw_ethernet_fs_rate.c"
5275 "src/raw_ethernet_resources.c"
5276 "src/raw_ethernet_resources.h"
5277 "src/raw_ethernet_send_burst_lat.c"
5278 "src/raw_ethernet_send_bw.c"
5279 "src/raw_ethernet_send_lat.c")
5280 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5282 (inputs `(("rdma-core" ,rdma-core)))
5283 (home-page "https://github.com/linux-rdma/perftest/")
5284 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5285 (description "This is a collection of tests written over uverbs intended for
5286 use as a performance micro-benchmark. The tests may be used for hardware or
5287 software tuning as well as for functional testing.
5289 The collection contains a set of bandwidth and latency benchmark such as:
5291 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5292 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5293 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5294 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5295 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5297 (license license:gpl2)))
5299 (define-public rng-tools
5302 (home-page "https://github.com/nhorman/rng-tools")
5306 (uri (git-reference (url home-page)
5307 (commit (string-append "v" version))))
5308 (file-name (git-file-name name version))
5311 "0hbml37yxs0fs69g7f2x4ixq61z0029swy99rn7ykma9mi6b7ni9"))))
5312 (build-system gnu-build-system)
5314 `(;; Disable support for various hardware entropy sources as they need
5315 ;; dependencies that are not yet in Guix, and would significantly
5316 ;; increase closure size.
5317 #:configure-flags '("--without-nistbeacon"
5319 "--without-rtlsdr")))
5321 `(("autoconf" ,autoconf)
5322 ("automake" ,automake)
5323 ("pkg-config" ,pkg-config)))
5325 `(("libsysfs" ,sysfsutils)
5326 ("openssl" ,openssl)))
5327 (synopsis "Random number generator daemon")
5329 "Monitor a hardware random number generator, and supply entropy
5330 from that to the system kernel's @file{/dev/random} machinery.")
5331 ;; The source package is offered under the GPL2+, but the files
5332 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5333 (license (list license:gpl2 license:gpl2+))))
5335 (define-public cpupower
5338 (version (package-version linux-libre))
5339 (source (package-source linux-libre))
5340 (build-system gnu-build-system)
5342 '(#:phases (modify-phases %standard-phases
5343 (add-after 'unpack 'enter-subdirectory
5345 (chdir "tools/power/cpupower")
5348 (add-before 'build 'fix-makefiles
5350 (substitute* "Makefile"
5352 (("/bin/(install|pwd)" _ command) command))
5353 (substitute* "bench/Makefile"
5354 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5356 #:make-flags (let ((out (assoc-ref %outputs "out")))
5357 (list (string-append "DESTDIR=" out)
5358 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5360 "docdir=/share/doc/cpupower"
5361 "confdir=$(docdir)/examples"
5362 ;; The Makefile recommends the following changes
5364 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5365 #:tests? #f)) ;no tests
5366 (native-inputs `(("gettext" ,gettext-minimal)))
5367 (inputs `(("pciutils" ,pciutils)))
5368 (home-page (package-home-page linux-libre))
5369 (synopsis "CPU frequency and voltage scaling tools for Linux")
5371 "cpupower is a set of user-space tools that use the cpufreq feature of the
5372 Linux kernel to retrieve and control processor features related to power saving,
5373 such as frequency and voltage scaling.")
5374 (license license:gpl2)))
5376 (define-public x86-energy-perf-policy
5378 (name "x86-energy-perf-policy")
5379 (version (package-version linux-libre))
5380 (source (package-source linux-libre))
5381 (build-system gnu-build-system)
5385 (modify-phases %standard-phases
5386 (add-after 'unpack 'enter-subdirectory
5388 (chdir "tools/power/x86/x86_energy_perf_policy")
5391 (add-before 'build 'fix-makefile
5393 (substitute* "Makefile" (("/usr") ""))
5396 (let ((out (assoc-ref %outputs "out")))
5397 (list (string-append "DESTDIR=" out)
5398 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5399 (supported-systems '("i686-linux" "x86_64-linux"))
5400 (home-page (package-home-page linux-libre))
5401 (synopsis "Display and update Intel-CPU energy-performance policy")
5403 "@command{x86_energy_perf_policy} displays and updates energy-performance
5404 policy settings specific to Intel Architecture Processors. Settings are
5405 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5406 cpufreq sub-system is enabled or not.")
5407 (license license:gpl2)))
5409 (define-public haveged
5417 (url "https://github.com/jirka-h/haveged.git")
5418 (commit (string-append "v" version))))
5419 (file-name (git-file-name name version))
5421 (base32 "0g3hcvpky76cabgcfqh65fay7nnjkms32sgmlf33q969833hijqz"))))
5422 (build-system gnu-build-system)
5423 (home-page "https://www.issihosts.com/haveged")
5424 (synopsis "Entropy source for the Linux random number generator")
5426 "haveged generates an unpredictable stream of random numbers for use by
5427 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5428 standard mechanisms for filling the entropy pool may not be sufficient for
5429 systems with high needs or limited user interaction, such as headless servers.
5431 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5432 indirect effects of hardware events on hidden processor state using the
5433 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5434 It tunes itself to its environment and provides the same built-in test suite
5435 for the output stream as used on certified hardware security devices.
5437 The quality of the randomness produced by this algorithm has not been proven.
5438 It is recommended to run it together with another entropy source like rngd, and
5439 not as a replacement for it.")
5440 (license (list (license:non-copyleft "file://nist/mconf.h")
5441 (license:non-copyleft "file://nist/packtest.c")
5442 license:public-domain ; nist/dfft.c
5443 license:gpl3+)))) ; everything else
5445 (define-public ecryptfs-utils
5447 (name "ecryptfs-utils")
5452 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5453 version "/+download/ecryptfs-utils_"
5454 version ".orig.tar.gz"))
5457 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5458 (build-system gnu-build-system)
5460 `(#:configure-flags (list "--disable-pywrap")
5462 (modify-phases %standard-phases
5463 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5464 (lambda* (#:key inputs outputs #:allow-other-keys)
5465 (let ((out (assoc-ref outputs "out"))
5466 (utils-linux (assoc-ref inputs "utils-linux"))
5467 (cryptsetup (assoc-ref inputs "cryptsetup"))
5468 (linux-pam (assoc-ref inputs "linux-pam"))
5469 (lvm2 (assoc-ref inputs "lvm2")))
5470 (substitute* '("src/utils/ecryptfs-mount-private"
5471 "src/utils/ecryptfs-umount-private"
5472 "src/utils/ecryptfs-setup-private"
5473 "src/utils/ecryptfs-setup-swap"
5474 "src/utils/mount.ecryptfs.c"
5475 "src/utils/umount.ecryptfs.c"
5476 "src/pam_ecryptfs/pam_ecryptfs.c"
5477 "src/desktop/ecryptfs-mount-private.desktop.in"
5478 "src/desktop/ecryptfs-setup-private.desktop.in")
5480 (string-append utils-linux "/bin/mount"))
5482 (string-append utils-linux "/bin/umount"))
5483 (("/sbin/mount.ecryptfs_private")
5484 (string-append out "/sbin/mount.ecryptfs_private"))
5485 (("/sbin/umount.ecryptfs_private")
5486 (string-append out "/sbin/umount.ecryptfs_private"))
5487 (("/usr/bin/ecryptfs-mount-private")
5488 (string-append out "/bin/ecryptfs-mount-private"))
5489 (("/usr/bin/ecryptfs-rewrite-file")
5490 (string-append out "/bin/ecryptfs-rewrite-file"))
5491 (("/usr/bin/ecryptfs-setup-private")
5492 (string-append out "/bin/ecryptfs-setup-private"))
5493 (("/sbin/cryptsetup")
5494 (string-append cryptsetup "/sbin/cryptsetup"))
5495 (("/sbin/unix_chkpwd")
5496 (string-append linux-pam "/sbin/unix_chkpwd"))
5498 (string-append lvm2 "/sbin/dmsetup")))))))))
5500 `(("intltool" ,intltool)
5501 ("perl" ,perl) ; for pod2man
5502 ("pkg-config" ,pkg-config)))
5504 `(("keyutils" ,keyutils)
5505 ("linux-pam" ,linux-pam)
5506 ("utils-linux" ,util-linux)
5507 ("cryptsetup" ,cryptsetup)
5510 (home-page "https://ecryptfs.org/")
5511 (synopsis "eCryptfs cryptographic file system utilities")
5513 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5514 Each file's cryptographic meta-data is stored inside the file itself, along
5515 with the encrypted contents. This allows individual encrypted files to be
5516 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5517 native Linux file system, and has been part of the Linux kernel since version
5518 2.6.19. This package contains the userland utilities to manage it.")
5519 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5520 ;; grant additional permission to link with OpenSSL.
5521 (license license:gpl2+)))
5523 (define-public libnfsidmap
5525 (name "libnfsidmap")
5530 (uri (string-append "https://fedorapeople.org/~steved/"
5531 name "/" version "/" name "-" version ".tar.bz2"))
5533 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5534 (build-system gnu-build-system)
5536 `(#:configure-flags (list
5537 (string-append "--with-pluginpath="
5538 (assoc-ref %outputs "out")
5539 "/lib/libnfsidmap"))))
5541 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5543 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5544 (synopsis "NFSv4 support library for name/ID mapping")
5545 (description "Libnfsidmap is a library holding mulitiple methods of
5546 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5547 extensible array of mapping functions, currently consisting of two choices:
5548 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5549 (license (license:non-copyleft "file://COPYING"
5550 "See COPYING in the distribution."))))
5552 (define-public module-init-tools
5554 (name "module-init-tools")
5559 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5560 "module-init-tools-" version ".tar.bz2"))
5563 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5564 (patches (search-patches "module-init-tools-moduledir.patch"))))
5565 (build-system gnu-build-system)
5567 ;; FIXME: The upstream tarball lacks man pages, and building them would
5568 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5569 ;; but they vanished. In the meantime, fake it.
5571 (modify-phases %standard-phases
5572 (add-before 'configure 'fake-docbook
5574 (substitute* "Makefile.in"
5575 (("^DOCBOOKTOMAN.*$")
5576 "DOCBOOKTOMAN = true\n"))
5578 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5579 (synopsis "Tools for loading and managing Linux kernel modules")
5581 "Tools for loading and managing Linux kernel modules, such as
5582 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5583 (license license:gpl2+)))
5585 (define-public mcelog
5591 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5592 "mcelog.git/snapshot/v" version ".tar.gz"))
5595 "1m11v1y7cvpm7hwsghj23z77ps1w5jzn8000iwiyxpb939h2km5l"))
5596 (file-name (string-append name "-" version ".tar.gz"))
5597 (modules '((guix build utils)))
5600 ;; The snapshots lack a .git directory,
5601 ;; breaking ‘git describe’.
5602 (substitute* "Makefile"
5603 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5605 (build-system gnu-build-system)
5607 `(#:phases (modify-phases %standard-phases
5608 (delete 'configure)) ; no configure script
5609 #:make-flags (let ((out (assoc-ref %outputs "out")))
5611 (string-append "prefix=" out)
5612 (string-append "DOCDIR=" out "/share/doc/"
5614 "etcprefix=$(DOCDIR)/examples"))
5615 ;; The tests will only run as root on certain supported CPU models.
5617 (supported-systems (list "i686-linux" "x86_64-linux"))
5618 (home-page "https://mcelog.org/")
5619 (synopsis "Machine check monitor for x86 Linux systems")
5621 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
5622 systems running the kernel Linux. It can also perform user-defined tasks, such
5623 as bringing bad pages off-line, when configurable error thresholds are
5625 (license license:gpl2)))
5627 (define-public mtd-utils
5634 "ftp://ftp.infradead.org/pub/mtd-utils/"
5635 "mtd-utils-" version ".tar.bz2"))
5638 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
5640 '(#:configure-flags '("--enable-unit-tests")))
5642 `(("cmocka" ,cmocka)
5643 ("pkg-config" ,pkg-config)))
5645 `(("acl" ,acl) ; extended attributes (xattr)
5646 ("libuuid" ,util-linux "lib")
5648 ("openssl" ,openssl) ; optional crypto support
5650 ("zstd" ,zstd "lib")))
5651 (build-system gnu-build-system)
5652 (synopsis "MTD Flash Storage Utilities")
5653 (description "This package provides utilities for testing, partitioning, etc
5655 (home-page "http://www.linux-mtd.infradead.org/")
5657 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5658 license:mpl1.1 ; All ftl* files
5659 license:expat)))) ; libiniparser
5661 (define-public libseccomp
5667 (uri (string-append "https://github.com/seccomp/libseccomp/"
5668 "releases/download/v" version
5669 "/libseccomp-" version ".tar.gz"))
5672 "07crwxqzvl5k2b90a47ii9wgvi09s9hsy5b5jddw9ylp351d25fg"))))
5673 (build-system gnu-build-system)
5675 `(("which" ,which)))
5676 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5677 (description "The libseccomp library provides an easy to use, platform
5678 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5679 libseccomp API is designed to abstract away the underlying BPF based syscall
5680 filter language and present a more conventional function-call based filtering
5681 interface that should be familiar to, and easily adopted by, application
5683 (home-page "https://github.com/seccomp/libseccomp")
5684 (license license:lgpl2.1)))
5686 (define-public radeontop
5694 (url "https://github.com/clbr/radeontop.git")
5695 (commit (string-append "v" version))))
5696 (file-name (git-file-name name version))
5698 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5699 (build-system gnu-build-system)
5701 `(#:phases (modify-phases %standard-phases
5702 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5703 ;; dependency, and doesn't even work on release(!) tarballs.
5704 (add-after 'unpack 'report-correct-version
5706 (substitute* "getver.sh"
5708 (string-append "ver=" ,version)))
5710 (delete 'configure)) ; no configure script
5711 #:make-flags (list "CC=gcc"
5712 (string-append "PREFIX=" %output))
5713 #:tests? #f)) ; no tests
5715 `(("gettext" ,gettext-minimal)
5716 ("pkg-config" ,pkg-config)))
5718 `(("libdrm" ,libdrm)
5719 ("libpciaccess" ,libpciaccess)
5721 ("ncurses" ,ncurses)))
5722 (home-page "https://github.com/clbr/radeontop/")
5723 (synopsis "Usage monitor for AMD Radeon graphics")
5724 (description "RadeonTop monitors resource consumption on supported AMD
5725 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5726 a terminal or saved to a file for further processing. It measures both the
5727 activity of the GPU as a whole, which is also accurate during OpenCL
5728 computations, as well as separate component statistics that are only meaningful
5729 under OpenGL graphics workloads.")
5730 (license license:gpl3)))
5732 (define-public efivar
5738 (uri (string-append "https://github.com/rhboot/" name
5739 "/releases/download/" version "/" name
5740 "-" version ".tar.bz2"))
5743 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5744 (build-system gnu-build-system)
5746 `(;; Tests require a UEFI system and is not detected in the chroot.
5748 #:make-flags (list (string-append "prefix=" %output)
5749 (string-append "libdir=" %output "/lib")
5751 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5753 (modify-phases %standard-phases
5754 (delete 'configure))))
5756 `(("pkg-config" ,pkg-config)))
5759 (home-page "https://github.com/rhboot/efivar")
5760 (synopsis "Tool and library to manipulate EFI variables")
5761 (description "This package provides a library and a command line
5762 interface to the variable facility of UEFI boot firmware.")
5763 (license license:lgpl2.1+)))
5765 (define-public efibootmgr
5771 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5772 "/releases/download/" version "/efibootmgr"
5773 "-" version ".tar.bz2"))
5776 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5777 (build-system gnu-build-system)
5779 `(#:tests? #f ;no tests
5780 #:make-flags (list (string-append "prefix=" %output)
5781 (string-append "libdir=" %output "/lib")
5782 ;; EFIDIR denotes a subdirectory relative to the
5783 ;; EFI System Partition where the loader will be
5784 ;; installed (known as OS_VENDOR in the code).
5785 ;; GRUB overrides this, as such it's only used if
5786 ;; nothing else is specified on the command line.
5788 #:phases (modify-phases %standard-phases (delete 'configure))))
5790 `(("pkg-config" ,pkg-config)))
5792 `(("efivar" ,efivar)
5794 (home-page "https://github.com/rhinstaller/efibootmgr")
5795 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5797 "@code{efibootmgr} is a user-space application to modify the Intel
5798 Extensible Firmware Interface (EFI) Boot Manager. This application can
5799 create and destroy boot entries, change the boot order, change the next
5800 running boot option, and more.")
5801 (license license:gpl2+)))
5803 (define-public sysstat
5809 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5810 "sysstat-" version ".tar.xz"))
5813 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
5814 (build-system gnu-build-system)
5816 `(#:tests? #f ; No test suite.
5817 ;; Without this flag, it tries to install the man pages with group 'root'
5818 ;; and fails because /etc/passwd lacks an entry for the root user.
5820 (list "--disable-file-attr"
5821 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5823 (modify-phases %standard-phases
5824 ;; The build process tries to create '/var/lib/sa', so we skip that
5826 (add-after 'build 'skip-touching-var
5828 (substitute* "Makefile"
5829 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5832 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5833 (synopsis "Performance monitoring tools for Linux")
5834 (description "The sysstat utilities are a collection of performance
5835 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5836 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5837 @code{sadf} and @code{sa}.")
5838 (license license:gpl2+)))
5840 (define-public light
5848 (url "https://github.com/haikarainen/light.git")
5849 (commit (string-append "v" version))))
5851 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
5852 (file-name (git-file-name name version))))
5853 (build-system gnu-build-system)
5856 (modify-phases %standard-phases
5857 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5858 (lambda* (#:key inputs #:allow-other-keys)
5859 (substitute* "90-backlight.rules"
5860 (("/bin/chgrp") (which "chgrp"))
5861 (("/bin/chmod") (which "chmod")))
5863 (add-after 'install 'install-udev-rules
5864 (lambda* (#:key outputs #:allow-other-keys)
5865 (let ((out (assoc-ref outputs "out")))
5867 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5870 `(("autoconf" ,autoconf)
5871 ("automake" ,automake)))
5872 (home-page "https://haikarainen.github.io/light/")
5873 (synopsis "GNU/Linux application to control backlights")
5875 "Light is a program to send commands to screen backlight controllers
5876 under GNU/Linux. Features include:
5879 @item It does not rely on X.
5880 @item Light can automatically figure out the best controller to use, making
5881 full use of underlying hardware.
5882 @item It is possible to set a minimum brightness value, as some controllers
5883 set the screen to be pitch black at a vaĺue of 0 (or higher).
5886 Light is the successor of lightscript.")
5887 (license license:gpl3+)))
5889 (define-public brightnessctl
5890 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5892 (name "brightnessctl")
5893 (version (git-version "0.4" "0" commit))
5897 (url "https://github.com/Hummer12007/brightnessctl/")
5899 (file-name (git-file-name name version))
5902 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5903 (build-system gnu-build-system)
5905 '(#:tests? #f ; no tests
5906 #:make-flags (list "CC=gcc"
5907 (string-append "PREFIX=" %output)
5908 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5910 (modify-phases %standard-phases
5912 (add-after 'unpack 'adjust-udev-rules
5914 (substitute* "90-brightnessctl.rules"
5915 (("/bin/") "/run/current-system/profile/bin/"))
5917 (home-page "https://github.com/Hummer12007/brightnessctl")
5918 (synopsis "Backlight and LED brightness control")
5920 "This program allows you read and control device brightness. Devices
5921 include backlight and LEDs. It can also preserve current brightness before
5922 applying the operation, such as on lid close.
5924 The appropriate permissions must be set on the backlight or LED control
5925 interface in sysfs, which can be accomplished with the included udev rules.")
5926 (license license:expat))))
5936 (url "https://github.com/linrunner/TLP.git")
5938 (file-name (git-file-name name version))
5940 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
5942 `(("shellcheck" ,shellcheck)))
5946 ("ethtool" ,ethtool)
5950 ("inetutils" ,inetutils)
5953 ("pciutils" ,pciutils)
5957 ("usbutils" ,usbutils)
5958 ("util-linux" ,util-linux)
5959 ("wireless-tools" ,wireless-tools)
5960 ,@(if (let ((system (or (%current-target-system)
5961 (%current-system))))
5962 (or (string-prefix? "i686-" system)
5963 (string-prefix? "x86_64-" system)))
5964 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5966 (build-system gnu-build-system)
5968 ;; XXX: The full test suite is run with "checkall" but it requires
5969 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
5970 `(#:test-target "shellcheck"
5971 #:modules ((guix build gnu-build-system)
5975 (modify-phases %standard-phases
5976 (delete 'configure) ; no configure script
5977 (add-before 'build 'setenv
5978 (lambda* (#:key outputs #:allow-other-keys)
5979 (let ((out (assoc-ref outputs "out")))
5980 (setenv "TLP_WITH_SYSTEMD" "0")
5981 (setenv "TLP_NO_INIT" "1")
5982 (setenv "TLP_NO_PMUTILS" "1")
5983 (setenv "TLP_SBIN" (string-append out "/bin"))
5984 (setenv "TLP_BIN" (string-append out "/bin"))
5985 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5986 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5987 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5988 (setenv "TLP_CONFDEF"
5989 (string-append out "/share/tlp/defaults.conf"))
5990 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
5992 (string-append out "/lib/elogind/system-sleep"))
5994 (string-append out "/share/bash-completion/completions"))
5995 (setenv "TLP_MAN" (string-append out "/share/man"))
5996 (setenv "TLP_META" (string-append out "/share/metainfo"))
5998 (add-before 'install 'fix-installation
6000 ;; Stop the Makefile from trying to create system directories.
6001 (substitute* "Makefile"
6002 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6003 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6006 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6007 (add-after 'install 'wrap
6008 (lambda* (#:key inputs outputs #:allow-other-keys)
6009 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6010 (bin-files (find-files bin ".*")))
6011 (define (bin-directory input-name)
6012 (let ((p (assoc-ref inputs input-name)))
6013 (and p (string-append p "/bin"))))
6014 (define (sbin-directory input-name)
6015 (string-append (assoc-ref inputs input-name) "/sbin"))
6016 (for-each (lambda (program)
6017 (wrap-program program
6020 (filter-map bin-directory
6032 "x86-energy-perf-policy"))
6033 (filter-map sbin-directory
6039 "wireless-tools"))))))
6042 (home-page "https://linrunner.de/en/tlp/tlp.html")
6043 (synopsis "Power management tool for Linux")
6044 (description "TLP is a power management tool for Linux. It comes with
6045 a default configuration already optimized for battery life. Nevertheless,
6046 TLP is customizable to fulfil system requirements. TLP settings are applied
6047 every time the power supply source is changed.")
6048 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6050 (license (list license:gpl2+ license:gpl3+))))
6058 (uri (string-append "https://www.ezix.org/software/"
6059 "files/lshw-" version
6063 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
6064 (build-system gnu-build-system)
6066 `(#:phases (modify-phases %standard-phases (delete 'configure))
6067 #:tests? #f ; no tests
6069 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6070 (synopsis "List hardware information")
6072 "@command{lshw} (Hardware Lister) is a small tool to provide
6073 detailed information on the hardware configuration of the machine.
6074 It can report exact memory configuration, firmware version, mainboard
6075 configuration, CPU version and speed, cache configuration, bus speed,
6076 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6077 machines (PowerMac G4 is known to work).")
6078 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6079 (license license:gpl2+)))
6081 (define-public libmnl
6088 (uri (string-append "mirror://netfilter.org/libmnl/"
6089 "libmnl-" version ".tar.bz2"))
6092 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6093 (build-system gnu-build-system)
6094 (home-page "https://www.netfilter.org/projects/libmnl/")
6095 (synopsis "Netlink utility library")
6096 (description "Libmnl is a minimalistic user-space library oriented to
6097 Netlink developers. There are a lot of common tasks in parsing, validating,
6098 constructing of both the Netlink header and TLVs that are repetitive and easy to
6099 get wrong. This library aims to provide simple helpers that allows you to
6100 re-use code and to avoid re-inventing the wheel.")
6101 (license license:lgpl2.1+)))
6103 (define-public libnftnl
6110 (uri (string-append "mirror://netfilter.org/libnftnl/"
6111 "libnftnl-" version ".tar.bz2"))
6113 (base32 "13zd90bfrr0q3j0l0cbc8kiizccw6n8gp727kqnfljh024zw3nr0"))))
6114 (build-system gnu-build-system)
6116 `(("pkg-config" ,pkg-config)))
6118 `(("libmnl" ,libmnl)))
6119 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6120 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6121 (description "Libnftnl is a userspace library providing a low-level netlink
6122 programming interface to the in-kernel nf_tables subsystem. The library
6123 libnftnl has been previously known as libnftables. This library is currently
6125 (license license:gpl2+)))
6127 (define-public nftables
6134 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6136 (string-append "https://www.nftables.org/projects/nftables"
6137 "/files/nftables-" version ".tar.bz2")))
6139 (base32 "0vmn6xwqa1nq6crfxshh049b199d0aj6hfgin7k068xhibzgvmk8"))))
6140 (build-system gnu-build-system)
6141 (arguments `(#:configure-flags
6142 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6143 (inputs `(("gmp" ,gmp)
6145 ("libnftnl" ,libnftnl)
6146 ("readline" ,readline)))
6147 (native-inputs `(("pkg-config" ,pkg-config)
6150 (home-page "https://www.nftables.org")
6151 (synopsis "Userspace utility for Linux packet filtering")
6152 (description "nftables is the project that aims to replace the existing
6153 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6154 filtering framework, a new userspace utility and also a compatibility layer for
6155 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6156 infrastructure such as the existing hooks, the connection tracking system, the
6157 userspace queueing component and the logging subsystem.")
6158 (license license:gpl2)))
6160 (define-public proot
6168 (url "https://github.com/proot-me/PRoot.git")
6169 (commit (string-append "v" version))))
6170 (file-name (git-file-name name version))
6172 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6173 (patches (search-patches "proot-test-fhs.patch"))))
6174 (build-system gnu-build-system)
6176 '(#:make-flags '("-C" "src")
6178 #:phases (modify-phases %standard-phases
6180 (add-before 'build 'set-shell-file-name
6181 (lambda* (#:key inputs #:allow-other-keys)
6182 (substitute* (find-files "src" "\\.[ch]$")
6185 (assoc-ref inputs "bash")
6188 (add-before 'check 'fix-fhs-assumptions-in-tests
6190 (substitute* "tests/test-c6b77b77.mk"
6191 (("/bin/bash") (which "bash"))
6192 (("/usr/bin/test") (which "test")))
6193 (substitute* '("tests/test-16573e73.c")
6194 (("/bin/([a-z-]+)" _ program)
6197 (substitute* (find-files "tests" "\\.sh$")
6198 ;; Some of the tests try to "bind-mount" /bin/true.
6200 (string-append "-b " (which "true") ":"))
6201 ;; Likewise for /bin.
6202 (("-b /bin:") "-b /gnu:")
6203 ;; Others try to run /bin/sh.
6204 (("/bin/sh") (which "sh"))
6205 ;; Others assume /etc/fstab exists.
6206 (("/etc/fstab") "/etc/passwd"))
6208 (substitute* "tests/GNUmakefile"
6209 (("-b /bin:") "-b /gnu:"))
6211 ;; XXX: This test fails in an obscure corner case, just
6213 (delete-file "tests/test-kkkkkkkk.c")
6218 (let ((n (parallel-job-count)))
6219 ;; For some reason we get lots of segfaults with
6220 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6221 (setenv "PROOT_NO_SECCOMP" "1")
6223 ;; Most of the tests expect "/bin" to be in $PATH so
6224 ;; they can run things that live in $ROOTFS/bin.
6226 (string-append (getenv "PATH") ":/bin"))
6228 (invoke "make" "check" "-C" "tests"
6230 "-j" (number->string n)))))
6232 (lambda* (#:key outputs #:allow-other-keys)
6233 ;; The 'install' rule does nearly nothing.
6234 (let* ((out (assoc-ref outputs "out"))
6235 (man1 (string-append out "/share/man/man1")))
6236 ;; TODO: 'make install-care' (does not even
6237 ;; build currently.)
6238 (invoke "make" "-C" "src" "install"
6239 (string-append "PREFIX=" out))
6242 (copy-file "doc/proot/man.1"
6243 (string-append man1 "/proot.1"))
6245 (native-inputs `(("which" ,which)
6247 ;; For 'mcookie', used by some of the tests.
6248 ("util-linux" ,util-linux)
6250 ;; XXX: Choose the old coreutils because its 'stat'
6251 ;; program does not use statx(2) when running 'stat -c
6252 ;; %a' or similar, which PRoot doesn't properly support.
6253 ("coreutils-old" ,coreutils-8.30)
6255 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6256 ;; make 4.3 to segfault.
6257 ("make-old" ,gnu-make-4.2)))
6258 (inputs `(("talloc" ,talloc)))
6259 (home-page "https://github.com/proot-me/PRoot")
6260 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6262 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6263 and @code{binfmt_misc}. This means that users don't need any privileges or
6264 setup to do things like using an arbitrary directory as the new root
6265 file system, making files accessible somewhere else in the file system
6266 hierarchy, or executing programs built for another CPU architecture
6267 transparently through QEMU user-mode. Also, developers can use PRoot as a
6268 generic process instrumentation engine thanks to its extension mechanism.
6269 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6270 available in the kernel Linux.")
6271 (license license:gpl2+)))
6273 (define-public proot-static
6276 (name "proot-static")
6278 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6279 (inputs `(("talloc" ,talloc/static)))
6281 (substitute-keyword-arguments (package-arguments proot)
6282 ((#:make-flags flags)
6283 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6285 `(modify-phases ,phases
6286 (add-after 'strip 'remove-store-references
6287 (lambda* (#:key outputs #:allow-other-keys)
6288 (let* ((out (assoc-ref outputs "out")))
6289 (with-directory-excursion out
6290 (remove-store-references "bin/proot")
6292 ((#:allowed-references _ '("out"))
6295 (define-public cpuid
6298 (version "20200211")
6301 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6302 version ".src.tar.gz"))
6305 "06sjbqqp80l7nhsp6khglkzdp9qy4vhbvjxbfilznhsmrqiwlw55"))))
6306 (build-system gnu-build-system)
6308 '(#:make-flags '("CC=gcc")
6309 #:tests? #f ; no tests
6310 #:phases (modify-phases %standard-phases
6311 (delete 'configure) ; no configure script
6312 (add-before 'install 'fix-makefile
6313 (lambda* (#:key outputs #:allow-other-keys)
6314 (substitute* "Makefile"
6315 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6316 ;; Make the compressed manpages writable so that the
6317 ;; reset-gzip-timestamps phase does not error out.
6318 (substitute* "Makefile"
6319 (("-m 444") "-m 644"))
6321 (inputs `(("perl" ,perl)))
6322 (supported-systems '("i686-linux" "x86_64-linux"))
6323 (home-page "http://www.etallen.com/cpuid.html")
6324 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6325 (description "cpuid dumps detailed information about the CPU(s) gathered
6326 from the CPUID instruction, and also determines the exact model of CPU(s). It
6327 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6328 NexGen, Rise, and SiS CPUs.")
6329 (license license:gpl2+)))
6331 (define-public jmtpfs
6339 (url "https://github.com/JasonFerrara/jmtpfs")
6340 (commit (string-append "v" version))))
6341 (file-name (git-file-name name version))
6344 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6345 (build-system gnu-build-system)
6349 ("libmtp" ,libmtp)))
6351 `(("pkg-config" ,pkg-config)))
6352 (home-page "https://github.com/JasonFerrara/jmtpfs")
6353 (synopsis "Use a FUSE file system to access data over MTP")
6354 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6355 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6356 the MTP device as a file system.")
6357 (license license:gpl3)))
6359 (define-public procenv
6367 (url "https://github.com/jamesodhunt/procenv")
6369 (file-name (git-file-name name version))
6371 (base32 "1ilrsw1rc85w29mkbkmm5n5w427gapv43yrjzvkb4kc9xhscgdjn"))))
6372 (build-system gnu-build-system)
6373 (arguments `(#:configure-flags '("--disable-silent-rules")))
6374 (native-inputs `(("groff" ,groff) ; for tests
6375 ("pkg-config" ,pkg-config)))
6376 (inputs `(("check" ,check)
6379 ("libselinux" ,libselinux)))
6380 (synopsis "Utility to show process environment")
6381 (description "Procenv is a command-line tool that displays as much detail about
6382 itself and its environment as possible. It can be used as a test
6383 tool, to understand the type of environment a process runs in, and for
6384 comparing system environments.")
6385 (home-page "http://github.com/jamesodhunt/procenv/")
6386 (license license:gpl3+)))
6388 (define-public libfabric
6396 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6397 version "/libfabric-" version ".tar.bz2"))
6399 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
6400 (build-system gnu-build-system)
6401 (inputs `(("rdma-core" ,rdma-core)
6402 ,@(match (%current-system)
6403 ((member (package-supported-systems psm))
6407 (home-page "https://ofiwg.github.io/libfabric/")
6408 (synopsis "Open Fabric Interfaces")
6410 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6411 communication services to applications. OFI is best described as a collection
6412 of libraries and applications used to export fabric services. The key
6413 components of OFI are: application interfaces, provider libraries, kernel
6414 services, daemons, and test applications.
6416 Libfabric is a core component of OFI. It is the library that defines and
6417 exports the user-space API of OFI, and is typically the only software that
6418 applications deal with directly. It works in conjunction with provider
6419 libraries, which are often integrated directly into libfabric.")
6420 (license (list license:bsd-2 license:gpl2)))) ;dual
6425 (version "3.3.20170428")
6426 (home-page "https://github.com/intel/psm")
6430 (uri (git-reference (url home-page)
6431 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6432 (file-name (string-append "psm-" version ".tar.gz"))
6434 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6435 (patches (search-patches
6436 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6437 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6438 "psm-repro.patch" ; reproducibility
6439 "psm-disable-memory-stats.patch"))))
6440 (build-system gnu-build-system)
6441 (outputs '("out" "debug"))
6442 (inputs `(("libuuid" ,util-linux "lib")))
6444 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6445 ,(string-append "INSTALL_PREFIX=" %output)
6446 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6448 #:phases (modify-phases %standard-phases
6450 (add-after 'unpack 'patch-/usr/include
6452 (substitute* "Makefile"
6453 (("\\$\\{DESTDIR}/usr/include")
6454 (string-append %output "/include")))
6455 (substitute* "Makefile"
6456 (("/lib64") "/lib"))
6458 (add-after 'unpack 'patch-sysmacros
6460 (substitute* "ipath/ipath_proto.c"
6461 (("#include <sys/poll.h>" m)
6462 (string-append m "\n"
6463 "#include <sys/sysmacros.h>")))
6465 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6467 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6468 communications interface for the True Scale family of products. PSM users are
6469 enabled with mechanisms necessary to implement higher level communications
6470 interfaces in parallel environments.")
6471 ;; Only Intel-compatable processors are supported.
6472 (supported-systems '("i686-linux" "x86_64-linux"))
6473 (license (list license:bsd-2 license:gpl2)))) ;dual
6475 (define-public snapscreenshot
6477 (name "snapscreenshot")
6478 (version "1.0.14.3")
6482 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6483 name "-" version ".tar.bz2"))
6485 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6486 (build-system gnu-build-system)
6489 (let ((out (assoc-ref %outputs "out")))
6490 (list (string-append "BINDIR=" out "/bin")
6491 (string-append "MANDIR=" out "/share/man")))
6492 #:tests? #f ; no test suite
6494 (modify-phases %standard-phases
6495 (delete 'configure) ; ./configure is a snarky no-op
6496 (add-before 'install 'fix-ownership
6497 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6499 (substitute* "depfun.mak"
6500 ((" -o bin -g bin ") " "))
6502 (add-before 'install 'create-output-directories
6503 (lambda* (#:key outputs #:allow-other-keys)
6504 (let ((out (assoc-ref outputs "out")))
6505 (mkdir-p (string-append out "/share/man/man1"))
6507 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6508 (synopsis "Take screenshots of one or more Linux text consoles")
6510 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6511 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6512 relevant @file{/dev/vcs*} file(s).")
6513 (license license:gpl2)))
6515 (define-public fbcat
6522 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6523 version "/" name "-" version ".tar.gz"))
6525 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6526 (build-system gnu-build-system)
6528 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6529 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6530 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6531 `(("pnmtopng" ,netpbm)))
6532 (outputs (list "out" "fbgrab"))
6536 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6537 #:tests? #f ; no tests
6539 (modify-phases %standard-phases
6540 (delete 'configure) ; no configure script
6541 (add-after 'build 'qualify-references
6542 (lambda* (#:key inputs outputs #:allow-other-keys)
6543 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6544 (out (assoc-ref outputs "out")))
6545 (substitute* "fbgrab"
6547 (string-append out "/bin/" all))
6549 (string-append pnmtopng "/bin/" all)))
6551 (add-after 'install 'split-fbgrab-output
6552 (lambda* (#:key outputs #:allow-other-keys)
6553 (let* ((out (assoc-ref outputs "out"))
6554 (out:fbgrab (assoc-ref outputs "fbgrab")))
6555 (for-each (lambda (file)
6556 (let ((old (string-append out "/" file))
6557 (new (string-append out:fbgrab "/" file)))
6558 (mkdir-p (dirname new))
6559 (rename-file old new)))
6561 "share/man/man1/fbgrab.1"))
6563 (home-page "https://jwilk.net/software/fbcat")
6564 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6566 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6567 a dump therof. It supports a wide range of drivers and pixel formats.
6568 @command{fbcat} can take screenshots of virtually any application that can be
6569 made to write its output to the framebuffer, including (but not limited to)
6570 text-mode or graphical applications that don't use a display server.
6572 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6573 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6574 (license license:gpl2)))
6576 (define-public libcgroup
6584 "mirror://sourceforge/libcg/" name "/"
6585 version "/" name "-" version ".tar.bz2"))
6587 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6588 (build-system gnu-build-system)
6595 `(("linux-pam" ,linux-pam)))
6596 (home-page "https://sourceforge.net/projects/libcg/")
6597 (synopsis "Control groups management tools")
6598 (description "Control groups is Linux kernel method for process resource
6599 restriction, permission handling and more. This package provides userspace
6600 interface to this kernel feature.")
6601 (license license:lgpl2.1)))
6603 (define-public mbpfan
6611 (url "https://github.com/dgraziotin/mbpfan.git")
6612 (commit (string-append "v" version))))
6613 (file-name (git-file-name name version))
6615 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6616 (build-system gnu-build-system)
6618 `(#:tests? #f ; tests ask to be run as root
6619 #:make-flags (let ((out (assoc-ref %outputs "out")))
6620 (list (string-append "DESTDIR=" out)
6621 ,(string-append "CC=" (cc-for-target))))
6623 (modify-phases %standard-phases
6624 (add-after 'unpack 'patch-paths
6626 (substitute* "Makefile"
6629 (delete 'configure)))) ; there's no configure phase
6630 (home-page "https://github.com/dgraziotin/mbpfan")
6631 (synopsis "Control fan speed on Macbooks")
6633 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6634 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6635 module. It can be executed as a daemon or in the foreground with root
6637 (license license:gpl3+)))
6646 (url "https://github.com/intel/opa-psm2.git")
6647 (commit (string-append "PSM2_" version))))
6648 (file-name (git-file-name name version))
6651 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6652 (build-system gnu-build-system)
6655 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6657 #:phases (modify-phases %standard-phases
6659 (add-after 'unpack 'patch-Makefiles
6661 (substitute* "Makefile"
6664 (substitute* "compat/Makefile"
6670 (setenv "DESTDIR" %output)
6671 (invoke "make" "install")
6674 `(("rdma-core" ,rdma-core)
6675 ("numactl" ,numactl)))
6676 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6678 "This package is low-level user-level Intel's communications interface.
6679 The PSM2 API is a high-performance vendor-specific protocol that provides a
6680 low-level communications interface for the Intel Omni-Path family of
6681 high-speed networking devices.")
6682 (home-page "https://github.com/intel/opa-psm2")
6683 ;; Only the x86_64 architecure is supported.
6684 (supported-systems '("x86_64-linux"))
6685 (license (list license:bsd-3 license:gpl2)))) ; dual
6687 (define-public libpfm4
6693 (uri (string-append "mirror://sourceforge/perfmon2/"
6694 name "/libpfm-" version ".tar.gz"))
6697 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6698 (build-system gnu-build-system)
6700 '(#:modules ((guix build utils)
6701 (guix build gnu-build-system))
6702 #:phases (modify-phases %standard-phases
6706 (lambda* (#:key inputs outputs #:allow-other-keys)
6707 (let* ((out (assoc-ref outputs "out")))
6712 (lambda* (#:key outputs #:allow-other-keys)
6713 (let* ((out (assoc-ref outputs "out")))
6715 (string-append "PREFIX=" out)
6718 (synopsis "Performance event monitoring library")
6720 "This package provides a library called libpfm4, which is used to develop
6721 monitoring tools exploiting the performance monitoring events such as those
6722 provided by the Performance Monitoring Unit (PMU) of modern processors.
6724 Libpfm4 helps convert from an event name, expressed as a string, to the event
6725 encoding that is either the raw event as documented by the hardware vendor or
6726 the OS-specific encoding. In the latter case, the library is able to prepare
6727 the OS-specific data structures needed by the kernel to setup the event.
6729 libpfm4 provides support for the @code{perf_events} interface, which was
6730 introduced in Linux 2.6.31.")
6731 (home-page "http://perfmon2.sourceforge.net/")
6732 (license license:expat)))
6734 (define-public libnfnetlink
6736 (name "libnfnetlink")
6741 "https://www.netfilter.org/projects/libnfnetlink/files/"
6742 "libnfnetlink-" version ".tar.bz2"))
6745 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6746 (build-system gnu-build-system)
6747 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6748 (synopsis "Low-level netfilter netlink communication library")
6750 "@code{libnfnetlink} is the low-level library for netfilter related
6751 kernel/userspace communication. It provides a generic messaging
6752 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6753 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6754 management tools in userspace.")
6755 (license license:gpl2)))
6757 (define-public go-netlink
6764 (url "https://github.com/vishvananda/netlink.git")
6765 (commit (string-append "v" version))))
6766 (file-name (git-file-name name version))
6769 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6770 (build-system go-build-system)
6772 `(#:import-path "github.com/vishvananda/netlink"))
6774 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6775 ("go-netns" ,go-netns)))
6776 (home-page "https://github.com/vishvananda/netlink")
6777 (synopsis "Simple netlink library for Go")
6778 (description "The netlink package provides a simple netlink library for
6779 Go. Netlink is the interface a user-space program in Linux uses to
6780 communicate with the kernel. It can be used to add and remove interfaces, set
6781 IP addresses and routes, and configure IPsec.")
6782 (license license:asl2.0)))
6784 (define-public xfsprogs
6791 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6792 "xfsprogs-" version ".tar.gz"))
6795 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
6796 (build-system gnu-build-system)
6797 (outputs (list "out" "python"))
6799 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6801 (modify-phases %standard-phases
6802 (add-after 'install 'separate-python-output
6803 (lambda* (#:key outputs #:allow-other-keys)
6804 (let ((out (assoc-ref outputs "out"))
6805 (python (assoc-ref outputs "python")))
6808 (mkdir-p (string-append python (dirname script)))
6809 (rename-file (string-append out script)
6810 (string-append python script)))
6811 (list "/sbin/xfs_scrub_all"))
6813 (add-after 'install 'install-headers
6815 (invoke "make" "install-dev"))))))
6817 `(("gettext" ,gettext-minimal)))
6819 `(("libuuid" ,util-linux "lib")
6820 ("python" ,python-wrapper)))
6821 (home-page "https://xfs.wiki.kernel.org/")
6822 (synopsis "XFS file system tools")
6823 (description "This package provides commands to create and check XFS
6825 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6826 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6827 (license (list license:gpl2 license:lgpl2.1))))
6829 (define-public genext2fs
6836 (url "https://github.com/jeremie-koenig/genext2fs.git")
6837 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6838 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6839 (file-name (git-file-name name version))
6841 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6842 (build-system gnu-build-system)
6845 (modify-phases %standard-phases
6846 (add-after 'unpack 'apply-debian-patches
6847 ;; Debian changes (the revision after ‘-’ in VERSION) are
6848 ;; maintained as separate patches. Apply those relevant to us.
6852 (invoke "patch" "-p1" "-i"
6853 (string-append "debian/patches/" file-name)))
6854 (list "blocksize+creator.diff" ; add -B/-o options
6855 "byteswap_fix.diff"))
6858 `(("autoconf" ,autoconf)
6859 ("automake" ,automake)))
6860 (home-page "https://github.com/jeremie-koenig/genext2fs")
6861 (synopsis "Generate ext2 file system as a normal user")
6862 (description "This package provides a program to generate an ext2
6863 file system as a normal (non-root) user. It does not require you to mount
6864 the image file to copy files on it, nor does it require that you become
6865 the superuser to make device nodes.")
6866 (license license:gpl2)))
6868 (define-public fakeroot
6874 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6875 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6876 (file-name (string-append name "-" version ".tar.gz"))
6879 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6880 (build-system gnu-build-system)
6883 (modify-phases %standard-phases
6884 (add-after 'configure 'patch-Makefile
6886 ;; Note: The root of the problem is already in "Makefile.am".
6887 (substitute* "Makefile"
6888 (("/bin/sh") (which "sh")))
6890 (add-after 'unpack 'patch-script
6891 (lambda* (#:key inputs #:allow-other-keys)
6892 (substitute* "scripts/fakeroot.in"
6894 (string-append (assoc-ref inputs "util-linux")
6897 (string-append (assoc-ref inputs "sed")
6900 (string-append (assoc-ref inputs "coreutils")
6903 (add-before 'configure 'setenv
6905 (setenv "LIBS" "-lacl")
6907 (add-before 'check 'prepare-check
6909 (setenv "SHELL" (which "bash"))
6910 (setenv "VERBOSE" "1")
6911 (substitute* "test/t.touchinstall"
6912 ;; We don't have the name of the root user, so use ID=0.
6913 (("grep root") "grep \"\\<0\\>\""))
6914 (substitute* "test/tartest"
6915 ;; We don't have the name of the root group, so use ID=0.
6916 (("ROOTGROUP=root") "ROOTGROUP=0")
6917 ;; We don't have the name of the daemon user, so use IDs.
6918 (("daemon:sys") "1:3")
6920 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6921 (substitute* "test/compare-tar"
6922 (("tar -tvf") "tar --numeric-owner -tvf"))
6924 ;; coreutils 8.32 changed 'ls' to use the statx() syscall instead
6925 ;; of lstat(). fakeroot 1.24 does not support the former, so
6926 ;; adjust these tests to use 'test -b' instead of 'ls' to test for
6927 ;; block device. See <https://bugs.gnu.org/41090>.
6928 (substitute* '("test/t.mknod" "test/t.chmod_dev")
6929 (("ls -ld? \\$tmp/hda3")
6930 "test -b $tmp/hda3 && echo block || echo fail"))
6934 ("sharutils" ,sharutils) ; for the tests
6935 ("xz" ,xz))) ; for the tests
6937 `(("libcap" ,libcap/next)
6938 ("util-linux" ,util-linux)
6940 ("coreutils" ,coreutils)))
6941 (synopsis "Provides a fake root environment")
6942 (description "@command{fakeroot} runs a command in an environment where
6943 it appears to have root privileges for file manipulation. This is useful
6944 for allowing users to create archives (tar, ar, .deb etc.) with files in
6945 them with root permissions/ownership. Without fakeroot one would have to
6946 have root privileges to create the constituent files of the archives with
6947 the correct permissions and ownership, and then pack them up, or one would
6948 have to construct the archives directly, without using the archiver.")
6949 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6950 (license license:gpl3+)))
6952 (define-public fakechroot
6959 "https://github.com/dex4er/fakechroot/releases/download/"
6960 version "/fakechroot-" version ".tar.gz"))
6963 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
6964 (build-system gnu-build-system)
6966 ;; XXX: The tests heavily assume they run on an FHS system so for now
6969 #:configure-flags '("--disable-static")))
6970 (synopsis "Emulate @code{chroot} by overriding file system calls")
6972 "@command{fakechroot} runs a command in an environment were is additional
6973 possibility to use @code{chroot} command without root privileges. This is
6974 useful for allowing users to create own chrooted environment with possibility
6975 to install another packages without need for root privileges.
6977 It works by providing @file{libfakechroot.so}, a shared library meant to be
6978 set as @code{LD_PRELOAD} to override the C library file system functions.")
6979 (home-page "https://github.com/dex4er/fakechroot/")
6980 (license license:lgpl2.1+)))
6982 (define-public inputattach
6984 (name "inputattach")
6989 (url "https://github.com/linuxwacom/input-wacom.git")
6990 (commit (string-append "input-wacom-" version))))
6991 (file-name (git-file-name name version))
6993 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6994 (build-system gnu-build-system)
6997 (modify-phases %standard-phases
7001 (lambda* (#:key inputs #:allow-other-keys)
7002 (with-directory-excursion "inputattach"
7003 (invoke (string-append (assoc-ref inputs "gcc")
7005 "-O2" "-o" "inputattach" "inputattach.c"))
7009 (lambda* (#:key outputs #:allow-other-keys)
7010 (let ((target-dir (string-append
7011 (assoc-ref outputs "out")
7013 (mkdir-p target-dir)
7014 (copy-file "inputattach/inputattach"
7015 (string-append target-dir
7018 (home-page "https://linuxwacom.github.io/")
7019 (synopsis "Dispatch input peripherals events to a device file")
7020 (description "inputattach dispatches input events from several device
7021 types and interfaces and translates so that the X server can use them.")
7022 (license license:gpl2+)))
7024 (define-public pipewire
7031 (url "https://github.com/PipeWire/pipewire")
7033 (file-name (git-file-name name version))
7036 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
7037 (build-system meson-build-system)
7039 '(#:configure-flags '("-Dsystemd=false")))
7041 `(("pkg-config" ,pkg-config)))
7043 `(("alsa-lib" ,alsa-lib)
7047 ("gstreamer" ,gstreamer)
7048 ("gst-plugins-base" ,gst-plugins-base)
7052 (home-page "https://pipewire.org/")
7053 (synopsis "Server and user space API to deal with multimedia pipelines")
7055 "PipeWire is a project that aims to greatly improve handling of audio and
7056 video under Linux. It aims to support the usecases currently handled by both
7057 PulseAudio and Jack and at the same time provide same level of powerful handling
7058 of Video input and output. It also introduces a security model that makes
7059 interacting with audio and video devices from containerized applications easy,
7060 with supporting Flatpak applications being the primary goal. Alongside Wayland
7061 and Flatpak we expect PipeWire to provide a core building block for the future
7062 of Linux application development.")
7063 (license license:lgpl2.0+)))
7072 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7074 (file-name (git-file-name name version))
7077 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
7078 (build-system gnu-build-system)
7081 (modify-phases %standard-phases
7082 (add-after 'unpack 'fix-dbus-tests
7084 (substitute* '("unit/test-dbus-message-fds.c"
7085 "unit/test-dbus-properties.c"
7087 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7092 `(("autoconf" ,autoconf)
7093 ("libtool" ,libtool)
7094 ("pkgconfig" ,pkg-config)
7095 ("automake" ,automake)))
7096 (home-page "https://01.org/ell")
7097 (synopsis "Embedded Linux Library")
7098 (description "The Embedded Linux* Library (ELL) provides core, low-level
7099 functionality for system daemons. It typically has no dependencies other than
7100 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7101 ELL is designed to be efficient and compact enough for use on embedded Linux
7102 platforms, it is not limited to resource-constrained systems.")
7103 (license license:lgpl2.1+)))
7105 (define-public lttng-ust
7111 (uri (string-append "https://lttng.org/files/lttng-ust/"
7112 "lttng-ust-" version ".tar.bz2"))
7115 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7116 (build-system gnu-build-system)
7118 `(("liburcu" ,liburcu)
7119 ("numactl" ,numactl)))
7121 `(("python" ,python-3)))
7122 (home-page "https://lttng.org/")
7123 (synopsis "LTTng userspace tracer libraries")
7124 (description "The user space tracing library, liblttng-ust, is the LTTng
7125 user space tracer. It receives commands from a session daemon, for example to
7126 enable and disable specific instrumentation points, and writes event records
7127 to ring buffers shared with a consumer daemon.")
7128 (license license:lgpl2.1+)))
7130 (define-public kexec-tools
7132 (name "kexec-tools")
7136 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7137 "/kexec/kexec-tools-" version ".tar.xz"))
7140 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
7141 (build-system gnu-build-system)
7143 ;; There are no automated tests.
7145 (home-page "https://projects.horms.net/projects/kexec/")
7146 (synopsis "Tools for booting directly into different kernels")
7147 (description "This package provides the @code{kexec} program and ancillary
7148 utilities. Using @code{kexec}, it is possible to boot directly into a new
7149 kernel from the context of an already-running kernel, bypassing the normal
7150 system boot process.")
7151 (license license:gpl2)))
7153 (define-public cachefilesd
7155 (name "cachefilesd")
7160 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7161 "/cachefilesd.git/snapshot/cachefilesd-"
7165 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7166 (build-system gnu-build-system)
7169 `(#:tests? #f ; there are no tests
7171 (let ((prefix-dir (lambda (var dir)
7172 (string-append var "=" %output "/" dir))))
7173 (list (string-append "CC=" ,(cc-for-target))
7174 (prefix-dir "SBINDIR" "sbin/")
7175 (prefix-dir "ETCDIR" "etc/")
7176 (prefix-dir "MANDIR" "share/man/")))
7177 #:phases (modify-phases %standard-phases (delete 'configure))))
7178 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7179 (synopsis "CacheFiles userspace management daemon")
7180 (description "@code{cachefilesd} is a userspace daemon that manages the
7181 cache data store that is used by network file systems such as @code{AFS} and
7182 @code{NFS} to cache data locally on disk. The content of the cache is
7183 persistent over reboots.")
7184 (license license:gpl2+)))
7186 (define-public libbpf
7194 (url "https://github.com/libbpf/libbpf")
7195 (commit (string-append "v" version))))
7196 (file-name (git-file-name name version))
7199 "18l0gff7nm841mwhr7bc7x863xcyvwh58zl7mc0amnsjqlbrvqg7"))))
7200 (build-system gnu-build-system)
7202 `(("pkg-config" ,pkg-config)))
7204 `(("libelf" ,libelf)
7207 `(#:tests? #f ; No tests
7210 (string-append "PREFIX=''")
7211 (string-append "DESTDIR=" (assoc-ref %outputs "out"))
7212 (string-append "LIBDIR=/lib")
7214 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
7216 (modify-phases %standard-phases
7218 (add-before 'build 'pre-build
7219 (lambda* (#:key inputs #:allow-other-keys)
7220 (substitute* "scripts/check-reallocarray.sh"
7222 (string-append (assoc-ref inputs "coreutils") rm)))
7225 (home-page "https://github.com/libbpf/libbpf")
7226 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
7228 "Libbpf supports building BPF CO-RE-enabled applications, which, in
7229 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
7231 (license `(,license:lgpl2.1 ,license:bsd-2))))