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 ng0 <ng0@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 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>
46 ;;; This file is part of GNU Guix.
48 ;;; GNU Guix is free software; you can redistribute it and/or modify it
49 ;;; under the terms of the GNU General Public License as published by
50 ;;; the Free Software Foundation; either version 3 of the License, or (at
51 ;;; your option) any later version.
53 ;;; GNU Guix is distributed in the hope that it will be useful, but
54 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
55 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56 ;;; GNU General Public License for more details.
58 ;;; You should have received a copy of the GNU General Public License
59 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
61 (define-module (gnu packages linux)
62 #:use-module (gnu packages)
63 #:use-module (gnu packages acl)
64 #:use-module (gnu packages admin)
65 #:use-module (gnu packages algebra)
66 #:use-module (gnu packages attr)
67 #:use-module (gnu packages audio)
68 #:use-module (gnu packages autotools)
69 #:use-module (gnu packages backup)
70 #:use-module (gnu packages base)
71 #:use-module (gnu packages bash)
72 #:use-module (gnu packages bison)
73 #:use-module (gnu packages calendar)
74 #:use-module (gnu packages check)
75 #:use-module (gnu packages crypto)
76 #:use-module (gnu packages cryptsetup)
77 #:use-module (gnu packages compression)
78 #:use-module (gnu packages dbm)
79 #:use-module (gnu packages datastructures)
80 #:use-module (gnu packages docbook)
81 #:use-module (gnu packages documentation)
82 #:use-module (gnu packages elf)
83 #:use-module (gnu packages flex)
84 #:use-module (gnu packages file)
85 #:use-module (gnu packages freedesktop)
86 #:use-module (gnu packages gcc)
87 #:use-module (gnu packages gettext)
88 #:use-module (gnu packages glib)
89 #:use-module (gnu packages golang)
90 #:use-module (gnu packages gperf)
91 #:use-module (gnu packages gstreamer)
92 #:use-module (gnu packages gtk)
93 #:use-module (gnu packages haskell-apps)
94 #:use-module (gnu packages haskell-xyz)
95 #:use-module (gnu packages libunwind)
96 #:use-module (gnu packages libusb)
97 #:use-module (gnu packages man)
98 #:use-module (gnu packages maths)
99 #:use-module (gnu packages multiprecision)
100 #:use-module (gnu packages ncurses)
101 #:use-module (gnu packages netpbm)
102 #:use-module (gnu packages networking)
103 #:use-module (gnu packages ninja)
104 #:use-module (gnu packages nss)
105 #:use-module (gnu packages perl)
106 #:use-module (gnu packages pciutils)
107 #:use-module (gnu packages pkg-config)
108 #:use-module (gnu packages popt)
109 #:use-module (gnu packages pulseaudio)
110 #:use-module (gnu packages python)
111 #:use-module (gnu packages python-xyz)
112 #:use-module (gnu packages readline)
113 #:use-module (gnu packages rrdtool)
114 #:use-module (gnu packages samba)
115 #:use-module (gnu packages sdl)
116 #:use-module (gnu packages serialization)
117 #:use-module (gnu packages slang)
118 #:use-module (gnu packages texinfo)
119 #:use-module (gnu packages tls)
120 #:use-module (gnu packages valgrind)
121 #:use-module (gnu packages video)
122 #:use-module (gnu packages web)
123 #:use-module (gnu packages xiph)
124 #:use-module (gnu packages xml)
125 #:use-module (gnu packages xdisorg)
126 #:use-module (gnu packages xorg)
127 #:use-module (gnu packages groff)
128 #:use-module (gnu packages rsync)
129 #:use-module (gnu packages selinux)
130 #:use-module (gnu packages swig)
131 #:use-module (guix build-system cmake)
132 #:use-module (guix build-system gnu)
133 #:use-module (guix build-system go)
134 #:use-module (guix build-system meson)
135 #:use-module (guix build-system python)
136 #:use-module (guix build-system trivial)
137 #:use-module (guix build-system linux-module)
138 #:use-module (guix download)
139 #:use-module (guix git-download)
140 #:use-module ((guix licenses) #:prefix license:)
141 #:use-module (guix packages)
142 #:use-module (guix gexp)
143 #:use-module (guix store)
144 #:use-module (guix monads)
145 #:use-module (guix utils)
146 #:use-module (srfi srfi-1)
147 #:use-module (srfi srfi-2)
148 #:use-module (srfi srfi-26)
149 #:use-module (ice-9 match))
151 (define-public (system->linux-architecture arch)
152 "Return the Linux architecture name for ARCH, a Guix system name such as
153 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
154 (let ((arch (car (string-split arch #\-))))
155 (cond ((string=? arch "i686") "i386")
156 ((string-prefix? "mips" arch) "mips")
157 ((string-prefix? "arm" arch) "arm")
158 ((string-prefix? "aarch64" arch) "arm64")
159 ((string-prefix? "alpha" arch) "alpha")
160 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
161 ((string-prefix? "s390" arch) "s390")
162 ((string-prefix? "riscv" arch) "riscv")
165 (define-public (system->defconfig system)
166 "Some systems (notably powerpc-linux) require a special target for kernel
167 defconfig. Return the appropriate make target if applicable, otherwise return
169 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
170 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
175 ;;; Kernel source code deblobbing.
178 (define (linux-libre-deblob-scripts version
181 (list (version-major+minor version)
184 (uri (string-append "https://linux-libre.fsfla.org"
185 "/pub/linux-libre/releases/" version "-gnu/"
186 "deblob-" (version-major+minor version)))
187 (sha256 deblob-hash))
190 (uri (string-append "https://linux-libre.fsfla.org"
191 "/pub/linux-libre/releases/" version "-gnu/"
193 (sha256 deblob-check-hash))))
195 (define deblob-scripts-5.6
196 (linux-libre-deblob-scripts
198 (base32 "196fdbfy1f8zbmnv0ik720snig2bacsh7hfyvgbmlsfk3cil2zgv")
199 (base32 "1g0bi3c8xzy1vz6w1xbpkb3a26bqn9d1yphcqz2ki4aikra81wid")))
201 (define deblob-scripts-5.4
202 (linux-libre-deblob-scripts
204 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
205 (base32 "10qb890is4z58vr8czh3xx69q62l3b3j38y410kgiw8nii3zx5lr")))
207 (define deblob-scripts-4.19
208 (linux-libre-deblob-scripts
210 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
211 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
213 (define deblob-scripts-4.14
214 (linux-libre-deblob-scripts
216 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
217 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
219 (define deblob-scripts-4.9
220 (linux-libre-deblob-scripts
222 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
223 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
225 (define deblob-scripts-4.4
226 (linux-libre-deblob-scripts
228 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
229 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
231 (define* (computed-origin-method gexp-promise hash-algo hash
232 #:optional (name "source")
233 #:key (system (%current-system))
234 (guile (default-guile)))
235 "Return a derivation that executes the G-expression that results
236 from forcing GEXP-PROMISE."
237 (mlet %store-monad ((guile (package->derivation guile system)))
238 (gexp->derivation (or name "computed-origin")
240 #:graft? #f ;nothing to graft
242 #:guile-for-build guile)))
244 (define (make-linux-libre-source version
247 "Return a 'computed' origin that generates a Linux-libre tarball from the
248 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
249 (match deblob-scripts
250 ((deblob-version (? origin? deblob) (? origin? deblob-check))
251 (unless (string=? deblob-version (version-major+minor version))
252 ;; The deblob script cannot be expected to work properly on a
253 ;; different version (major+minor) of Linux, even if no errors
254 ;; are signaled during execution.
255 (error "deblob major+minor version mismatch"))
257 (method computed-origin-method)
258 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
262 (with-imported-modules '((guix build utils))
264 (use-modules (guix build utils)
268 (let ((dir (string-append "linux-" #$version)))
271 (set-path-environment-variable
274 #+(canonical-package bash)
275 #+(canonical-package coreutils)
276 #+(canonical-package diffutils)
277 #+(canonical-package findutils)
278 #+(canonical-package patch)
279 #+(canonical-package xz)
280 #+(canonical-package sed)
281 #+(canonical-package grep)
282 #+(canonical-package bzip2)
283 #+(canonical-package gzip)
284 #+(canonical-package tar)
285 ;; The comments in the 'deblob-check' script
286 ;; claim that it supports Python 2 and 3, but
287 ;; in fact it fails when run in Python 3 as
291 (with-directory-excursion "/tmp/bin"
293 (copy-file #+deblob "deblob")
294 (chmod "deblob" #o755)
295 (substitute* "deblob"
296 (("/bin/sh") (which "sh")))
298 (copy-file #+deblob-check "deblob-check")
299 (chmod "deblob-check" #o755)
300 (substitute* "deblob-check"
301 (("/bin/sh") (which "sh"))
302 (("/bin/sed") (which "sed"))
303 (("/usr/bin/python") (which "python"))))
305 (if (file-is-directory? #+upstream-source)
307 (format #t "Copying upstream linux source...~%")
309 (invoke "cp" "--archive" #+upstream-source dir)
310 (invoke "chmod" "--recursive" "u+w" dir))
312 (format #t "Unpacking upstream linux tarball...~%")
314 (invoke "tar" "xf" #$upstream-source)
317 (and (not (member name '("." "..")))
318 (file-is-directory? name))))
320 (unless (string=? dir unpacked-dir)
321 (rename-file unpacked-dir dir)))
323 (error "multiple directories found" dirs)))))
325 (with-directory-excursion dir
326 (setenv "PYTHON" (which "python"))
327 (format #t "Running deblob script...~%")
329 (invoke "/tmp/bin/deblob"))
331 (format #t "~%Packing new Linux-libre tarball...~%")
333 (invoke "tar" "cvfa" #$output
334 ;; Avoid non-determinism in the archive.
347 (define (linux-libre-urls version)
348 "Return a list of URLs for Linux-Libre VERSION."
350 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
351 version "-gnu/linux-libre-" version "-gnu.tar.xz")
353 ;; XXX: Work around <http://bugs.gnu.org/14851>.
355 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
356 version "-gnu.tar.xz")
358 ;; Maybe this URL will become valid eventually.
360 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
361 version "-gnu.tar.xz")))
363 (define (%upstream-linux-source version hash)
366 (uri (string-append "mirror://kernel.org"
367 "/linux/kernel/v" (version-major version) ".x/"
368 "linux-" version ".tar.xz"))
372 (define-public linux-libre-5.6-version "5.6.11")
373 (define-public linux-libre-5.6-pristine-source
374 (let ((version linux-libre-5.6-version)
375 (hash (base32 "1ahv4a3mnszqs3qcnwmhbvjgis1jg37anj5jvn70i7s2k6z6rpfn")))
376 (make-linux-libre-source version
377 (%upstream-linux-source version hash)
378 deblob-scripts-5.6)))
380 (define-public linux-libre-5.4-version "5.4.39")
381 (define-public linux-libre-5.4-pristine-source
382 (let ((version linux-libre-5.4-version)
383 (hash (base32 "1j35yf1nilb9z7lw8w2drpww7q2zy8zfr0ip8hwcbcd7c5d9chai")))
384 (make-linux-libre-source version
385 (%upstream-linux-source version hash)
386 deblob-scripts-5.4)))
388 (define-public linux-libre-4.19-version "4.19.121")
389 (define-public linux-libre-4.19-pristine-source
390 (let ((version linux-libre-4.19-version)
391 (hash (base32 "11bhjdaihhc42xhf4qxdkkjznc0i6igh0ahjbzr3fb8bmq9sirgv")))
392 (make-linux-libre-source version
393 (%upstream-linux-source version hash)
394 deblob-scripts-4.19)))
396 (define-public linux-libre-4.14-version "4.14.179")
397 (define-public linux-libre-4.14-pristine-source
398 (let ((version linux-libre-4.14-version)
399 (hash (base32 "10arrj3ppbxkn15yxqpxlz4k8yp2afzbfpp2nwfy6klhjiffp9sx")))
400 (make-linux-libre-source version
401 (%upstream-linux-source version hash)
402 deblob-scripts-4.14)))
404 (define-public linux-libre-4.9-version "4.9.222")
405 (define-public linux-libre-4.9-pristine-source
406 (let ((version linux-libre-4.9-version)
407 (hash (base32 "0aajgflf96bj7chbd83rdmgcdwd025c6mz6li4cwbfx7xcb91kjc")))
408 (make-linux-libre-source version
409 (%upstream-linux-source version hash)
410 deblob-scripts-4.9)))
412 (define-public linux-libre-4.4-version "4.4.222")
413 (define-public linux-libre-4.4-pristine-source
414 (let ((version linux-libre-4.4-version)
415 (hash (base32 "02zxy5vjxgrqs0mkz5aj70v6pazhif7x5cm26rf8zh4idpmhk2zh")))
416 (make-linux-libre-source version
417 (%upstream-linux-source version hash)
418 deblob-scripts-4.4)))
420 (define %boot-logo-patch
421 ;; Linux-Libre boot logo featuring Freedo and a gnu.
424 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
425 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
428 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
430 (define %linux-libre-arm-export-__sync_icache_dcache-patch
434 "https://salsa.debian.org/kernel-team/linux"
435 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
436 "/debian/patches/bugfix/arm/"
437 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
438 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
440 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
442 (define (source-with-patches source patches)
445 (patches (append (origin-patches source)
448 (define-public linux-libre-5.6-source
449 (source-with-patches linux-libre-5.6-pristine-source
450 (list %boot-logo-patch
451 %linux-libre-arm-export-__sync_icache_dcache-patch
452 ;; Pinebook Pro patch from linux-next,
453 ;; can be dropped for linux-libre 5.7
455 "linux-libre-support-for-Pinebook-Pro.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.6
557 (make-linux-libre-headers* linux-libre-5.6-version
558 linux-libre-5.6-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-4.19.56
583 (make-linux-libre-headers "4.19.56"
584 "1zqiic55viy065lhnkmhn33sz3bbbr2ykbm5f92yzd8lpc9zl7yx"))
586 (define-public linux-libre-headers linux-libre-headers-4.19.56)
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 (define (config->string options)
624 (string-join (map (match-lambda
626 (string-append option "=m"))
628 (string-append option "=y"))
630 (string-append option "=n")))
636 ;;; Kernel package utilities.
639 (define* (make-linux-libre version hash-string supported-systems
641 ;; A function that takes an arch and a variant.
642 ;; See kernel-config for an example.
644 (configuration-file #f)
645 (defconfig "defconfig")
646 (extra-options %default-extra-linux-options)
647 (patches (list %boot-logo-patch)))
648 (make-linux-libre* version
651 (uri (linux-libre-urls version))
652 (sha256 (base32 hash-string))
655 #:extra-version extra-version
656 #:configuration-file configuration-file
657 #:defconfig defconfig
658 #:extra-options extra-options))
660 (define* (make-linux-libre* version source supported-systems
662 ;; A function that takes an arch and a variant.
663 ;; See kernel-config for an example.
665 (configuration-file #f)
666 (defconfig "defconfig")
667 (extra-options %default-extra-linux-options))
669 (name (if extra-version
670 (string-append "linux-libre-" extra-version)
674 (supported-systems supported-systems)
675 (build-system gnu-build-system)
680 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
684 ;; These are needed to compile the GCC plugins.
689 ,@(match (and configuration-file
691 (system->linux-architecture
692 (or (%current-target-system) (%current-system)))
693 #:variant (version-major+minor version)))
694 (#f ;no config for this platform
697 `(("kconfig" ,config))))))
699 `(#:modules ((guix build gnu-build-system)
706 (modify-phases %standard-phases
707 (add-after 'unpack 'patch-/bin/pwd
709 (substitute* (find-files "." "^Makefile(\\.include)?$")
710 (("/bin/pwd") "pwd"))
713 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
714 ;; On AArch64 (at least), we need to remove glibc headers from
715 ;; CPATH (they are still available as "system headers"), so that
716 ;; the kernel can override uint64_t. See
717 ;; <https://bugs.gnu.org/37593>. This is also true when
718 ;; cross-compiling, except in that case, cross-libc must be
719 ;; removed from CROSS_CPATH.
720 (let ((var ,(if (%current-target-system)
723 (libc ,(if (%current-target-system)
729 (cut string-prefix? (assoc-ref inputs libc) <>)
730 (string-split (getenv var) #\:))
732 (format #t "environment variable `~a' changed to `~a'~%"
735 ;; Avoid introducing timestamps
736 (setenv "KCONFIG_NOTIMESTAMP" "1")
737 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
739 ;; Set ARCH and CROSS_COMPILE
740 (let ((arch ,(system->linux-architecture
741 (or (%current-target-system)
742 (%current-system)))))
744 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
747 (setenv "CROSS_COMPILE" (string-append target "-"))
748 (format #t "`CROSS_COMPILE' set to `~a'~%"
749 (getenv "CROSS_COMPILE"))))
751 (setenv "EXTRA_VERSION" ,extra-version)
753 (let ((build (assoc-ref %standard-phases 'build))
754 (config (assoc-ref (or native-inputs inputs) "kconfig")))
756 ;; Use a custom kernel configuration file or a default
757 ;; configuration file.
760 (copy-file config ".config")
761 (chmod ".config" #o666))
762 (invoke "make" ,defconfig))
764 ;; Appending works even when the option wasn't in the
765 ;; file. The last one prevails if duplicated.
766 (let ((port (open-file ".config" "a"))
767 (extra-configuration ,(config->string extra-options)))
768 (display extra-configuration port)
771 (invoke "make" "oldconfig"))))
773 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
774 (let* ((out (assoc-ref outputs "out"))
775 (moddir (string-append out "/lib/modules"))
776 (dtbdir (string-append out "/lib/dtbs")))
777 ;; Install kernel image, kernel configuration and link map.
778 (for-each (lambda (file) (install-file file out))
779 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
780 ;; Install device tree files
781 (unless (null? (find-files "." "\\.dtb$"))
783 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
785 ;; Install kernel modules
788 ;; Disable depmod because the Guix system's module directory
789 ;; is an union of potentially multiple packages. It is not
790 ;; possible to use depmod to usefully calculate a dependency
791 ;; graph while building only one of those packages.
793 (string-append "MODULE_DIR=" moddir)
794 (string-append "INSTALL_PATH=" out)
795 (string-append "INSTALL_MOD_PATH=" out)
796 "INSTALL_MOD_STRIP=1"
798 (let* ((versions (filter (lambda (name)
799 (not (string-prefix? "." name)))
801 (version (match versions
803 ;; There are symlinks to the build and source directory,
804 ;; both of which will point to target /tmp/guix-build*
805 ;; and thus not be useful in a profile. Delete the symlinks.
806 (false-if-file-not-found
807 (delete-file (string-append moddir "/" version "/build")))
808 (false-if-file-not-found
809 (delete-file (string-append moddir "/" version "/source"))))
812 (home-page "https://www.gnu.org/software/linux-libre/")
813 (synopsis "100% free redistribution of a cleaned Linux kernel")
815 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
816 It has been modified to remove all non-free binary blobs.")
817 (license license:gpl2)))
821 ;;; Generic kernel packages.
824 (define-public linux-libre-5.4
825 (make-linux-libre* linux-libre-5.4-version
826 linux-libre-5.4-source
827 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
828 #:configuration-file kernel-config))
830 (define-public linux-libre-version linux-libre-5.4-version)
831 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
832 (define-public linux-libre-source linux-libre-5.4-source)
833 (define-public linux-libre linux-libre-5.4)
835 (define-public linux-libre-4.19
836 (make-linux-libre* linux-libre-4.19-version
837 linux-libre-4.19-source
838 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
839 #:configuration-file kernel-config))
841 (define-public linux-libre-4.14
842 (make-linux-libre* linux-libre-4.14-version
843 linux-libre-4.14-source
844 '("x86_64-linux" "i686-linux" "armhf-linux")
845 #:configuration-file kernel-config))
847 (define-public linux-libre-4.9
848 (make-linux-libre* linux-libre-4.9-version
849 linux-libre-4.9-source
850 '("x86_64-linux" "i686-linux")
851 #:configuration-file kernel-config))
853 (define-public linux-libre-4.4
854 (make-linux-libre* linux-libre-4.4-version
855 linux-libre-4.4-source
856 '("x86_64-linux" "i686-linux")
857 #:configuration-file kernel-config
860 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
861 ;; This option was removed upstream in version 4.7.
862 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
863 %default-extra-linux-options)))
867 ;;; Specialized kernel variants.
870 (define-public linux-libre-arm-generic
871 (make-linux-libre* linux-libre-version
874 #:defconfig "multi_v7_defconfig"
875 #:extra-version "arm-generic"
878 `(;; needed to fix the RTC on rockchip platforms
879 ("CONFIG_RTC_DRV_RK808" . #t))
880 %default-extra-linux-options)))
882 (define-public linux-libre-arm-generic-5.6
883 (make-linux-libre* linux-libre-5.6-version
884 linux-libre-5.6-source
886 #:defconfig "multi_v7_defconfig"
887 #:extra-version "arm-generic"
890 `(;; needed to fix the RTC on rockchip platforms
891 ("CONFIG_RTC_DRV_RK808" . #t))
892 %default-extra-linux-options)))
894 (define-public linux-libre-arm-veyron
895 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
897 (define-public linux-libre-arm-generic-4.19
898 (make-linux-libre* linux-libre-4.19-version
899 linux-libre-4.19-source
901 #:defconfig "multi_v7_defconfig"
902 #:extra-version "arm-generic"))
904 (define-public linux-libre-arm-generic-4.14
905 (make-linux-libre* linux-libre-4.14-version
906 linux-libre-4.14-source
908 #:defconfig "multi_v7_defconfig"
909 #:extra-version "arm-generic"))
911 (define-public linux-libre-arm-omap2plus
912 (make-linux-libre* linux-libre-version
915 #:defconfig "omap2plus_defconfig"
916 #:extra-version "arm-omap2plus"))
918 (define-public linux-libre-arm-omap2plus-4.19
919 (make-linux-libre* linux-libre-4.19-version
920 linux-libre-4.19-source
922 #:defconfig "omap2plus_defconfig"
923 #:extra-version "arm-omap2plus"))
925 (define-public linux-libre-arm-omap2plus-4.14
926 (make-linux-libre* linux-libre-4.14-version
927 linux-libre-4.14-source
929 #:defconfig "omap2plus_defconfig"
930 #:extra-version "arm-omap2plus"))
932 (define-public linux-libre-arm64-generic
933 (make-linux-libre* linux-libre-version
936 #:defconfig "defconfig"
937 #:extra-version "arm64-generic"
940 `(;; needed to fix the RTC on rockchip platforms
941 ("CONFIG_RTC_DRV_RK808" . #t))
942 %default-extra-linux-options)))
944 (define-public linux-libre-arm64-generic-5.6
945 (make-linux-libre* linux-libre-5.6-version
946 linux-libre-5.6-source
948 #:defconfig "defconfig"
949 #:extra-version "arm64-generic"
952 `(;; needed to fix the RTC on rockchip platforms
953 ("CONFIG_RTC_DRV_RK808" . #t))
954 %default-extra-linux-options)))
956 (define-public linux-libre-riscv64-generic
957 (make-linux-libre* linux-libre-version
960 #:extra-version "riscv64-generic"))
964 ;;; Linux kernel modules.
967 (define-public acpi-call-linux-module
968 (let ((commit "70b9c80bd700e6a4d10797eaac9fd34b7e8cbd4a")
971 (name "acpi-call-linux-module")
972 (version (git-version "3.17" revision commit))
977 (url "https://github.com/teleshoes/acpi_call.git")
979 (file-name (git-file-name name version))
981 (base32 "09c1vw6vcrkqxbwhpgfgpj4d1grzn4qq6ka8pwwzm7cvm405xj7x"))))
982 (build-system linux-module-build-system)
984 `(#:tests? #f ; no tests
986 (modify-phases %standard-phases
987 (add-after 'install 'install-documentation
988 (lambda* (#:key outputs #:allow-other-keys)
989 (let* ((out (assoc-ref outputs "out"))
990 (doc (string-append out "/share/doc/" ,name "-" ,version)))
991 (for-each (lambda (file)
992 (let ((target (string-append doc "/" file)))
993 (mkdir-p (dirname target))
994 (copy-recursively file target)))
995 (list "README.md" "examples"))
997 (home-page "https://github.com/teleshoes/acpi_call")
998 (synopsis "Linux kernel module to perform ACPI method calls")
1000 "This simple Linux kernel module allows calls from user space to any
1001 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1002 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1003 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1004 and @code{ACPI_BUFFER}.
1006 It grants direct and undocumented access to your hardware that may cause damage
1007 and should be used with caution, especially on untested models.")
1008 (license license:gpl3+)))) ; see README.md (no licence headers)
1010 (define-public rtl8812au-aircrack-ng-linux-module
1011 (let ((commit "945d6ed6505c32f0993b1dba576388e92e78101b")
1014 (name "rtl8812au-aircrack-ng-linux-module")
1015 (version (git-version "5.6.4.2" revision commit))
1020 (url "https://github.com/aircrack-ng/rtl8812au.git")
1022 (file-name (git-file-name name version))
1024 (base32 "1pjws7qb5l4z9k80vgz4zdxmqhbwxjjrmkpf0hijf821byyddvi7"))
1025 (modules '((guix build utils)))
1028 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1029 ;; and other unnecessary unlicenced things.
1030 (for-each delete-file-recursively (list "android"
1034 (build-system linux-module-build-system)
1037 (modify-phases %standard-phases
1039 (lambda* (#:key inputs make-flags #:allow-other-keys)
1040 (apply invoke "make"
1041 (string-append "KSRC="
1042 (assoc-ref inputs "linux-module-builder")
1043 "/lib/modules/build")
1044 (or make-flags '())))))
1045 #:tests? #f)) ; no test suite
1046 (supported-systems '("x86_64-linux" "i686-linux"))
1047 (home-page "https://github.com/aircrack-ng/rtl8812au")
1048 (synopsis "Linux driver for Realtek USB wireless network adapters")
1050 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1051 network adapters, modified by the aircrack-ng project to support monitor mode
1052 and frame injection. It provides a @code{88XXau} kernel module that supports
1053 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1054 (license license:gpl2+))))
1056 (define-public rtl8821ce-linux-module
1057 (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea")
1060 (name "rtl8821ce-linux-module")
1061 (version (git-version "0.0.0" revision commit))
1066 (url "https://github.com/tomaspinho/rtl8821ce.git")
1068 (file-name (git-file-name name version))
1071 "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))
1072 (build-system linux-module-build-system)
1075 (modify-phases %standard-phases
1077 (lambda* (#:key (make-flags '()) inputs #:allow-other-keys)
1080 (string-append "KSRC="
1081 (assoc-ref inputs "linux-module-builder")
1082 "/lib/modules/build")))))
1084 (home-page "https://github.com/tomaspinho/rtl8821ce")
1085 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1086 (description "This is Realtek's RTL8821CE Linux driver for wireless
1088 (license license:gpl2))))
1090 (define-public vhba-module
1092 (name "vhba-module")
1093 (version "20200106")
1097 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1098 version ".tar.bz2"))
1101 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1102 (build-system linux-module-build-system)
1106 (home-page "https://cdemu.sourceforge.io/")
1107 (synopsis "Kernel module that emulates SCSI devices")
1108 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1109 between the CDemu userspace daemon and linux kernel.")
1110 (license license:gpl2+)))
1112 (define-public ddcci-driver-linux
1114 (name "ddcci-driver-linux")
1121 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1122 (commit (string-append "v" version))))
1123 (file-name (git-file-name name version))
1126 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1127 (build-system linux-module-build-system)
1129 `(#:tests? #f ; no tests
1131 (modify-phases %standard-phases
1136 (with-directory-excursion module
1137 (apply (assoc-ref %standard-phases 'build) args)))
1138 '("ddcci" "ddcci-backlight"))
1144 (with-directory-excursion module
1145 (apply (assoc-ref %standard-phases 'install) args)))
1146 '("ddcci" "ddcci-backlight"))
1148 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1149 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1150 (description "This package provides two Linux kernel drivers, ddcci and
1151 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1152 interface. The ddcci module creates a character device for each DDC/CI
1153 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1154 module allows the control of the backlight level or luminance property when
1155 supported under @file{/sys/class/backlight/}.")
1156 (license license:gpl2+)))
1160 ;;; Pluggable authentication modules (PAM).
1163 (define-public linux-pam
1171 "https://github.com/linux-pam/linux-pam/releases/download/v"
1172 version "/Linux-PAM-" version ".tar.xz"))
1175 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1176 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1178 (build-system gnu-build-system)
1182 ;; TODO: optional dependencies
1183 ;; ("libxcrypt" ,libxcrypt)
1184 ;; ("cracklib" ,cracklib)
1187 `(;; Most users, such as `shadow', expect the headers to be under
1189 #:configure-flags (list (string-append "--includedir="
1190 (assoc-ref %outputs "out")
1191 "/include/security")
1193 ;; XXX: <rpc/rpc.h> is missing from glibc when
1194 ;; cross-compiling, so we have to disable NIS
1195 ;; support altogether.
1196 ,@(if (%current-target-system)
1200 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1203 (home-page "http://www.linux-pam.org/")
1204 (synopsis "Pluggable authentication modules for Linux")
1206 "A *Free* project to implement OSF's RFC 86.0.
1207 Pluggable authentication modules are small shared object files that can
1208 be used through the PAM API to perform tasks, like authenticating a user
1209 at login. Local and dynamic reconfiguration are its key features.")
1210 (license license:bsd-3)))
1212 (define-public linux-pam-1.2
1220 "http://www.linux-pam.org/library/"
1221 "Linux-PAM-" version ".tar.bz2"))
1224 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1225 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1232 (define-public psmisc
1239 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1242 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1243 (build-system gnu-build-system)
1245 `(,@(if (%current-target-system)
1248 "ac_cv_func_malloc_0_nonnull=yes"
1249 "ac_cv_func_realloc_0_nonnull=yes"))
1251 (inputs `(("ncurses" ,ncurses)))
1252 (home-page "https://gitlab.com/psmisc/psmisc")
1253 (synopsis "Small utilities that use the proc file system")
1255 "This PSmisc package is a set of some small useful utilities that
1256 use the proc file system. We're not about changing the world, but
1257 providing the system administrator with some help in common tasks.")
1258 (license license:gpl2+)))
1260 (define-public util-linux
1266 (uri (string-append "mirror://kernel.org/linux/utils/"
1267 "util-linux/v" (version-major+minor version) "/"
1268 "util-linux-" version ".tar.xz"))
1271 "1db2kydkwjmvgd1glkcba3adhidxw0f1x735dcjdpdjjf869sgvl"))
1272 (patches (search-patches "util-linux-tests.patch"))
1273 (modules '((guix build utils)))
1275 ;; We take 'nologin' from Shadow, the 'logger' program from
1276 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1278 (substitute* "configure"
1279 (("build_nologin=yes") "build_nologin=no")
1280 (("build_logger=yes") "build_logger=no")
1281 (("build_kill=yes") "build_kill=no"))
1283 (build-system gnu-build-system)
1285 "static")) ;>2 MiB of static .a libraries
1287 `(#:configure-flags (list "--disable-use-tty-group"
1288 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1289 ;; Don't try to chown root:root mount and umount
1290 "--disable-makeinstall-chown"
1291 ;; Install completions where our
1292 ;; bash-completion package expects them.
1293 (string-append "--with-bashcompletiondir="
1294 (assoc-ref %outputs "out")
1295 "/etc/bash_completion.d"))
1296 #:phases (modify-phases %standard-phases
1297 (add-before 'build 'set-umount-file-name
1298 (lambda* (#:key outputs #:allow-other-keys)
1299 ;; Tell 'eject' the right file name of 'umount'.
1300 (let ((out (assoc-ref outputs "out")))
1301 (substitute* "sys-utils/eject.c"
1302 (("\"/bin/umount\"")
1303 (string-append "\"" out "/bin/umount\"")))
1305 (add-before 'check 'pre-check
1306 (lambda* (#:key inputs outputs #:allow-other-keys)
1307 (let ((out (assoc-ref outputs "out"))
1308 (net (assoc-ref inputs "net-base")))
1309 ;; Change the test to refer to the right file.
1310 (substitute* "tests/ts/misc/mcookie"
1312 (string-append net "/etc/services")))
1314 (add-after 'install 'move-static-libraries
1315 (lambda* (#:key outputs #:allow-other-keys)
1316 (let ((out (assoc-ref outputs "out"))
1317 (static (assoc-ref outputs "static")))
1318 (mkdir-p (string-append static "/lib"))
1319 (with-directory-excursion out
1320 (for-each (lambda (file)
1322 (string-append static "/"
1324 (find-files "lib" "\\.a$"))
1326 ;; Remove references to the static library from the '.la'
1327 ;; files so that Libtool does the right thing when both
1328 ;; the shared and static library is available.
1329 (substitute* (find-files "lib" "\\.la$")
1330 (("old_library=.*") "old_library=''\n")))
1333 (inputs `(("zlib" ,zlib)
1334 ("ncurses" ,ncurses)
1336 ;; XXX: This is so that the 'pre-check' phase can find it.
1337 ,@(if (%current-target-system)
1338 `(("net-base" ,net-base))
1342 ("net-base" ,net-base))) ;for tests
1343 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1344 (synopsis "Collection of utilities for the Linux kernel")
1345 (description "Util-linux is a diverse collection of Linux kernel
1346 utilities. It provides dmesg and includes tools for working with file systems,
1347 block devices, UUIDs, TTYs, and many other tools.")
1349 ;; Note that util-linux doesn't use the same license for all the
1350 ;; code. GPLv2+ is the default license for a code without an
1351 ;; explicitly defined license.
1352 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1353 license:bsd-4 license:public-domain))))
1355 ;; util-linux optionally supports udev, which allows lsblk to read file system
1356 ;; metadata without special privileges. Add it as a separate package to avoid
1357 ;; a circular dependency, and to keep the size small.
1358 (define-public util-linux+udev
1361 (name "util-linux-with-udev")
1364 ,@(package-inputs util-linux)))))
1366 (define-public ddate
1372 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1374 (file-name (string-append name "-" version ".tar.gz"))
1376 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1377 (build-system cmake-build-system)
1378 (arguments '(#:tests? #f))
1379 (home-page "https://github.com/bo0ts/ddate")
1380 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1382 "ddate displays the Discordian date and holidays of a given date.
1383 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1384 by Robert Shea and Robert Anton Wilson.")
1385 (license license:public-domain)))
1387 (define-public fbset
1394 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1397 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1398 (build-system gnu-build-system)
1400 '(#:modules ((guix build gnu-build-system)
1404 (modify-phases %standard-phases
1405 (delete 'configure) ; no configure script
1406 (add-before 'install 'pre-install
1407 (lambda* (#:key outputs #:allow-other-keys)
1408 (let ((out (assoc-ref outputs "out")))
1409 (substitute* "Makefile"
1410 (("mknod ") "true ")
1411 ;; The Makefile doesn't honour PREFIX or similar.
1414 (with-directory-excursion out
1415 (for-each mkdir-p (list "sbin"
1419 (add-after 'install 'install-fb.modes
1420 (lambda* (#:key outputs #:allow-other-keys)
1421 (let* ((out (assoc-ref outputs "out"))
1422 (etc (string-append out "/etc")))
1423 (for-each (cut install-file <> etc)
1424 (find-files "etc" "^fb\\.modes"))
1425 (symlink "fb.modes.ATI"
1426 (string-append etc "/fb.modes"))
1428 ;; Parallel building races to create modes.tab.c.
1429 #:parallel-build? #f
1430 #:tests? #f)) ; no test suite
1434 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1435 (synopsis "Show and modify Linux frame buffer settings")
1437 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1438 different kinds of graphic displays. The @command{fbset} utility can query and
1439 change various device settings such as depth, virtual resolution, and timing
1441 (license license:gpl2)))
1443 (define-public procps
1449 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1450 "procps-ng-" version ".tar.xz"))
1453 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1454 (build-system gnu-build-system)
1456 '(#:modules ((guix build utils)
1457 (guix build gnu-build-system)
1461 (modify-phases %standard-phases
1463 'install 'post-install
1464 ;; Remove commands and man pages redudant with
1466 (lambda* (#:key outputs #:allow-other-keys)
1467 (let* ((out (assoc-ref outputs "out"))
1468 (dup (append-map (cut find-files out <>)
1469 '("^kill" "^uptime"))))
1470 (for-each delete-file dup)
1472 (inputs `(("ncurses" ,ncurses)))
1473 (home-page "https://gitlab.com/procps-ng/procps/")
1474 (synopsis "Utilities that give information about processes")
1476 "Procps is the package that has a bunch of small useful utilities
1477 that give information about processes using the Linux /proc file system.
1478 The package includes the programs ps, top, vmstat, w, kill, free,
1479 slabtop, and skill.")
1480 (license license:gpl2)))
1482 (define-public usbutils
1489 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1490 "usbutils-" version ".tar.xz"))
1492 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1493 (build-system gnu-build-system)
1494 (outputs (list "out" "python"))
1497 (modify-phases %standard-phases
1498 (add-before 'bootstrap 'patch-bootstrap-scripts
1500 (substitute* "usbhid-dump/bootstrap"
1501 (("/bin/bash") (which "bash")))
1503 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1504 (substitute* "autogen.sh"
1505 (("^\\./configure.*") ""))
1507 (add-after 'install 'separate-python-output
1508 ;; Separating one Python script shaves more than 106 MiB from :out.
1509 (lambda* (#:key outputs #:allow-other-keys)
1510 (let ((out (assoc-ref outputs "out"))
1511 (out:python (assoc-ref outputs "python")))
1512 (for-each (lambda (file)
1513 (let ((old (string-append out "/" file))
1514 (new (string-append out:python "/" file)))
1515 (mkdir-p (dirname new))
1516 (rename-file old new)))
1517 (list "bin/lsusb.py"))
1522 ("python" ,python)))
1524 `(("autoconf" ,autoconf)
1525 ("automake" ,automake)
1526 ("libtool" ,libtool)
1527 ("pkg-config" ,pkg-config)))
1528 (home-page "http://www.linux-usb.org/")
1530 "Tools for working with USB devices, such as lsusb")
1532 "Tools for working with USB devices, such as lsusb.")
1533 (license license:gpl2+)))
1535 (define-public e2fsprogs
1542 "mirror://kernel.org/linux/kernel/people/tytso/"
1543 "e2fsprogs/v" version "/"
1544 "e2fsprogs-" version ".tar.xz"))
1547 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1548 (build-system gnu-build-system)
1549 (inputs `(("util-linux" ,util-linux)))
1550 (native-inputs `(("pkg-config" ,pkg-config)
1551 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1555 ("procps" ,procps)))
1557 '(;; util-linux is the preferred source for some of the libraries and
1558 ;; commands, so disable them (see, e.g.,
1559 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1560 #:configure-flags (list "--disable-libblkid"
1561 "--disable-libuuid" "--disable-uuidd"
1564 ;; Use symlinks instead of hard links for
1565 ;; 'fsck.extN' etc. This makes the resulting nar
1566 ;; smaller and is preserved across copies.
1567 "--enable-symlink-install"
1569 (string-append "LDFLAGS=-Wl,-rpath="
1570 (assoc-ref %outputs "out")
1573 ;; Install libext2fs et al.
1574 "--enable-elf-shlibs")
1577 (modify-phases %standard-phases
1578 (add-before 'configure 'patch-shells
1580 (substitute* "configure"
1581 (("/bin/sh (.*)parse-types.sh" _ dir)
1582 (string-append (which "sh") " " dir
1584 (substitute* "MCONFIG.in"
1585 (("INSTALL_SYMLINK = /bin/sh")
1586 "INSTALL_SYMLINK = sh"))
1587 (substitute* (find-files "." "^Makefile.in$")
1589 (string-append "#!" (which "sh"))))
1591 (add-after 'install 'install-libs
1592 (lambda* (#:key outputs #:allow-other-keys)
1593 (let* ((out (assoc-ref outputs "out"))
1594 (lib (string-append out "/lib")))
1595 (invoke "make" "install-libs")
1597 ;; Make the .a writable so that 'strip' works.
1598 ;; Failing to do that, due to debug symbols, we
1599 ;; retain a reference to the final
1600 ;; linux-libre-headers, which refer to the
1601 ;; bootstrap binaries.
1602 (let ((archives (find-files lib "\\.a$")))
1603 (for-each (lambda (file)
1607 (home-page "http://e2fsprogs.sourceforge.net/")
1608 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1610 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1611 (license (list license:gpl2 ;programs
1612 license:lgpl2.0 ;libext2fs
1613 license:x11)))) ;libuuid
1615 (define e2fsprogs/static
1617 (package (inherit e2fsprogs)
1619 ;; Do not build shared libraries.
1620 (substitute-keyword-arguments (package-arguments e2fsprogs)
1621 ((#:configure-flags _)
1622 '(list "--disable-blkid"))
1626 (define-public e2fsck/static
1628 (name "e2fsck-static")
1629 (version (package-version e2fsprogs))
1630 (build-system trivial-build-system)
1633 `(("e2fsprogs" ,e2fsprogs/static)))
1635 `(#:modules ((guix build utils))
1638 (use-modules (guix build utils)
1642 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1644 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1646 (with-directory-excursion bin
1647 (copy-file e2fsck "e2fsck")
1648 (remove-store-references "e2fsck")
1649 (chmod "e2fsck" #o555))
1651 (home-page (package-home-page e2fsprogs))
1652 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1653 (description "This package provides statically-linked e2fsck command taken
1654 from the e2fsprogs package. It is meant to be used in initrds.")
1655 (license (package-license e2fsprogs))))
1657 (define-public extundelete
1659 (name "extundelete")
1664 (uri (string-append "mirror://sourceforge/extundelete/"
1665 "extundelete/" version "/extundelete-"
1666 version ".tar.bz2"))
1669 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1670 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1671 (build-system gnu-build-system)
1672 (inputs `(("e2fsprogs" ,e2fsprogs)))
1673 (home-page "http://extundelete.sourceforge.net/")
1674 (synopsis "Recover deleted files from ext2/3/4 partitions")
1676 "Extundelete is a set of tools that can recover deleted files from an
1677 ext3 or ext4 partition.")
1678 (license license:gpl2)))
1680 (define-public zerofree
1684 (home-page "https://frippery.org/uml/")
1687 (uri (string-append home-page name "-" version
1691 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1692 (build-system gnu-build-system)
1695 (modify-phases %standard-phases
1696 (delete 'configure) ; no configure script
1698 ;; The Makefile lacks an ‘install’ target.
1699 (lambda* (#:key outputs #:allow-other-keys)
1700 (let* ((out (assoc-ref outputs "out"))
1701 (bin (string-append out "/bin")))
1702 (chmod "zerofree" #o555)
1703 (install-file "zerofree" bin)
1705 #:tests? #f)) ; no tests
1706 (inputs `(("libext2fs" ,e2fsprogs)))
1707 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1709 "Zerofree finds the unallocated blocks with non-zero value content in an
1710 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1711 This is a simple way to make disk images more compressible.
1712 Zerofree requires the file system to be unmounted or mounted read-only.")
1713 (license license:gpl2)))
1715 (define-public strace
1719 (home-page "https://strace.io")
1722 (uri (string-append home-page "/files/" version
1723 "/strace-" version ".tar.xz"))
1726 "1zrhpzjlgfwfl8dd53llswmmharm5rbi0zch7lln5sjris69an4z"))))
1727 (build-system gnu-build-system)
1730 (modify-phases %standard-phases
1731 (add-after 'unpack 'patch-/bin/sh
1733 (substitute* "strace.c"
1734 (("/bin/sh") (which "sh")))
1736 ;; Don't fail if the architecture doesn't support different personalities.
1737 #:configure-flags '("--enable-mpers=check")
1738 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1739 #:parallel-tests? #f)) ; undeterministic failures
1740 (native-inputs `(("perl" ,perl)))
1741 (synopsis "System call tracer for Linux")
1743 "strace is a system call tracer, i.e. a debugging tool which prints out a
1744 trace of all the system calls made by a another process/program.")
1745 (license license:lgpl2.1+)))
1747 (define-public ltrace
1753 (uri (string-append "http://www.ltrace.org/ltrace_" version
1757 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1758 (build-system gnu-build-system)
1759 (inputs `(("libelf" ,libelf)))
1761 ;; Compilation uses -Werror by default, but it fails.
1762 '(#:configure-flags '("--disable-werror")))
1763 (home-page "https://www.ltrace.org/")
1764 (synopsis "Library call tracer for Linux")
1766 "ltrace intercepts and records dynamic library calls which are called by
1767 an executed process and the signals received by that process. It can also
1768 intercept and print the system calls executed by the program.")
1769 (license license:gpl2+)))
1771 (define-public alsa-lib
1778 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1779 version ".tar.bz2"))
1782 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
1783 (build-system gnu-build-system)
1785 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1786 (assoc-ref %outputs "out")
1788 (home-page "https://www.alsa-project.org/")
1789 (synopsis "The Advanced Linux Sound Architecture libraries")
1791 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1792 MIDI functionality to the Linux-based operating system.")
1793 (license license:lgpl2.1+)))
1795 (define-public alsa-utils
1801 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1802 name "-" version ".tar.bz2"))
1805 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
1806 (build-system gnu-build-system)
1808 ;; XXX: Disable man page creation until we have DocBook.
1809 '(#:configure-flags (list "--disable-xmlto"
1811 ;; The udev rule is responsible for restoring
1813 (string-append "--with-udev-rules-dir="
1814 (assoc-ref %outputs "out")
1815 "/lib/udev/rules.d"))
1817 (modify-phases %standard-phases
1818 (add-before 'check 'disable-broken-test
1820 ;; XXX: The 1.1.8 release tarball is missing a header that's
1821 ;; required for this test to work. Fixed in 1.1.9.
1822 (substitute* "axfer/test/Makefile"
1823 ((".*container-test.*") ""))
1826 'install 'pre-install
1828 ;; Don't try to mkdir /var/lib/alsa.
1829 (substitute* "Makefile"
1830 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1834 `(("libsamplerate" ,libsamplerate)
1835 ("ncurses" ,ncurses)
1836 ("alsa-lib" ,alsa-lib)
1838 ("gettext" ,gettext-minimal)))
1839 (home-page "http://www.alsa-project.org/")
1840 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1842 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1843 MIDI functionality to the Linux-based operating system.")
1845 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1847 (license license:gpl2)))
1849 (define-public alsa-plugins
1851 (name "alsa-plugins")
1855 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1856 name "-" version ".tar.bz2"))
1859 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
1860 (build-system gnu-build-system)
1861 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1862 ;; be split, there are references to both in files.
1863 ;; TODO: Remove OSS related plugins, they add support to run native
1864 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1866 (outputs '("out" "pulseaudio" "jack"))
1868 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1869 ;; for /etc/alsa. On Guix System plugins are loaded from
1870 ;; the ALSA service, and other distributions likely
1871 ;; won't use these files.
1872 "--with-alsalconfdir=/tmp/noop")
1874 (modify-phases %standard-phases
1875 (add-after 'install 'split
1876 (lambda* (#:key inputs outputs #:allow-other-keys)
1877 ;; Distribute the binaries to the various outputs.
1878 (let* ((out (assoc-ref outputs "out"))
1879 (jack (assoc-ref outputs "jack"))
1880 (jacklib (string-append jack "/lib/alsa-lib"))
1881 (pua (assoc-ref outputs "pulseaudio"))
1882 (pualib (string-append pua "/lib/alsa-lib")))
1885 (for-each (lambda (file)
1886 (rename-file file (string-append jacklib "/" (basename file))))
1887 (find-files out ".*jack\\.(la|so)"))
1890 (for-each (lambda (file)
1891 (rename-file file (string-append pualib "/" (basename file))))
1892 (find-files out ".*pulse\\.(la|so)"))
1895 `(("alsa-lib" ,alsa-lib)
1897 ("speex" ,speex) ; libspeexdsp resampling plugin
1898 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1899 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1900 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1902 `(("pkg-config" ,pkg-config)))
1903 (home-page "http://www.alsa-project.org/")
1904 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1906 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1907 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1908 by providing additional plugins which include: upmixing, downmixing, jackd and
1909 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1910 external rate conversion.")
1911 (license (list license:gpl2+
1912 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1913 license:lgpl2.1+))))
1915 (define-public iptables
1922 "mirror://netfilter.org/iptables/iptables-"
1923 version ".tar.bz2"))
1926 "0z0mgs1ghvn3slc868mgbf2g26njgrzcy5ggyb5w4i55j1a3lflr"))))
1927 (build-system gnu-build-system)
1929 `(("pkg-config" ,pkg-config)
1933 `(("libmnl" ,libmnl)
1934 ("libnftnl" ,libnftnl)))
1936 '(#:tests? #f ; no test suite
1937 #:configure-flags ; add $libdir to the RUNPATH of executables
1938 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1939 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1940 (synopsis "Programs to configure Linux IP packet filtering rules")
1942 "@command{iptables} is the user-space command line program used to
1943 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1944 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1946 This package also includes @command{ip6tables}, which is used to configure the
1949 Both commands are targeted at system administrators.")
1950 (license license:gpl2+)))
1952 (define-public lsscsi
1959 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
1962 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
1963 (build-system gnu-build-system)
1964 (synopsis "Lists information about SCSI or NVMe devices in Linux")
1965 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
1967 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
1968 also list NVMe namespaces or controllers and show the relationship between a
1969 device's primary node name, its SCSI generic (sg) node name and its kernel
1971 (license license:gpl2)))
1973 (define-public ebtables
1980 "mirror://netfilter.org/ebtables/ebtables-"
1984 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
1985 (build-system gnu-build-system)
1988 ("iptables" ,iptables)))
1989 (synopsis "Ethernet bridge frame table administration")
1990 (home-page "https://ebtables.netfilter.org/")
1992 "ebtables is an application program used to set up and maintain the
1993 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1994 analogous to the iptables application, but less complicated, due to the fact
1995 that the Ethernet protocol is much simpler than the IP protocol.")
1996 (license license:gpl2+)))
1998 (define-public iproute
2005 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2009 "0ywg70f98wgfai35jl47xzpjp45a6n7crja4vc8ql85cbi1l7ids"))))
2010 (build-system gnu-build-system)
2012 `( ;; There is a test suite, but it wants network namespaces and sudo.
2014 #:make-flags (let ((out (assoc-ref %outputs "out")))
2016 (string-append "BASH_COMPDIR=" out
2017 "/etc/bash_completion.d")
2018 (string-append "LIBDIR=" out "/lib")
2019 (string-append "HDRDIR=" out "/include")
2020 (string-append "SBINDIR=" out "/sbin")
2021 (string-append "CONFDIR=" out "/etc")
2022 (string-append "DOCDIR=" out "/share/doc/"
2024 (string-append "MANDIR=" out "/share/man")))
2025 #:phases (modify-phases %standard-phases
2026 (add-before 'install 'pre-install
2028 ;; Don't attempt to create /var/lib/arpd.
2029 (substitute* "Makefile"
2030 (("^.*ARPDDIR.*$") ""))
2034 ("iptables" ,iptables)
2035 ("libmnl" ,libmnl)))
2039 ("pkg-config" ,pkg-config)))
2041 ;; ("libmnl" ,libmnl)
2042 ;; ("util-linux" ,util-linux)
2044 "https://wiki.linuxfoundation.org/networking/iproute2")
2046 "Utilities for controlling TCP/IP networking and traffic in Linux")
2048 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2049 and traffic with the Linux kernel. The most important of these are
2050 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2053 Most network configuration manuals still refer to ifconfig and route as the
2054 primary network configuration tools, but ifconfig is known to behave
2055 inadequately in modern network environments, and both should be deprecated.")
2056 (license license:gpl2+)))
2058 (define-public net-tools
2059 ;; XXX: This package is basically unmaintained, but it provides a few
2060 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2062 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2066 (version (string-append "1.60-" revision "." (string-take commit 7)))
2069 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2070 "n/ne/net-tools/code.git/net-tools-code-"
2072 (file-name (string-append name "-" version ".zip"))
2075 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2076 (home-page "http://net-tools.sourceforge.net/")
2077 (build-system gnu-build-system)
2079 '(#:modules ((guix build gnu-build-system)
2084 (modify-phases %standard-phases
2086 (lambda* (#:key outputs #:allow-other-keys)
2087 (let ((out (assoc-ref outputs "out")))
2088 (mkdir-p (string-append out "/bin"))
2089 (mkdir-p (string-append out "/sbin"))
2091 ;; Pretend we have everything...
2092 (system "yes | make config")
2094 ;; ... except for the things we don't have.
2095 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2096 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2097 ;; that have been removed.
2098 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2099 ;; think about adding them later.
2100 (substitute* '("config.make" "config.h")
2101 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2104 (add-after 'install 'remove-redundant-commands
2105 (lambda* (#:key outputs #:allow-other-keys)
2106 ;; Remove commands and man pages redundant with Inetutils.
2107 (let* ((out (assoc-ref outputs "out"))
2108 (dup (append-map (cut find-files out <>)
2110 "^(yp|nis|dns)?domainname"))))
2111 (for-each delete-file dup)
2113 ;; Binaries that depend on libnet-tools.a don't declare that
2114 ;; dependency, making it parallel-unsafe.
2115 #:parallel-build? #f
2117 #:tests? #f ; no test suite
2118 #:make-flags (let ((out (assoc-ref %outputs "out")))
2120 (string-append "BASEDIR=" out)
2121 (string-append "INSTALLNLSDIR=" out "/share/locale")
2122 (string-append "mandir=/share/man")))))
2123 (native-inputs `(("gettext" ,gettext-minimal)
2125 (synopsis "Tools for controlling the network subsystem in Linux")
2127 "This package includes the important tools for controlling the network
2128 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2129 route. Additionally, this package contains utilities relating to particular
2130 network hardware types (plipconfig, slattach) and advanced aspects of IP
2131 configuration (iptunnel, ipmaddr).")
2132 (license license:gpl2+))))
2134 (define-public libcap
2141 "mirror://kernel.org/linux/libs/security/linux-privs/"
2142 "libcap2/libcap-" version ".tar.xz"))
2145 "0sj8kidl7qgf2qwxcbw1vadnlb30y4zvjzxswsmfdghq04npkhfs"))))
2146 (build-system gnu-build-system)
2147 (arguments '(#:phases
2148 (modify-phases %standard-phases
2150 ;; Add $libdir to the RUNPATH of executables.
2152 (substitute* "Make.Rules"
2154 (string-append "LDFLAGS := -Wl,-rpath="
2157 #:tests? #f ; no 'check' target
2158 #:make-flags (list "lib=lib"
2159 (string-append "prefix="
2160 (assoc-ref %outputs "out"))
2161 "RAISE_SETFCAP=no")))
2162 (native-inputs `(("perl" ,perl)))
2163 (inputs `(("attr" ,attr)))
2164 (home-page "https://sites.google.com/site/fullycapable/")
2165 (synopsis "Library for working with POSIX capabilities")
2167 "Libcap2 provides a programming interface to POSIX capabilities on
2168 Linux-based operating systems.")
2170 ;; License is BSD-3 or GPLv2, at the user's choice.
2171 (license license:gpl2)))
2173 (define-public bridge-utils
2175 (name "bridge-utils")
2180 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2181 "bridge-utils-" version ".tar.xz"))
2183 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
2184 (build-system gnu-build-system)
2186 ;; The tarball lacks all the generated files.
2187 (native-inputs `(("autoconf" ,autoconf)
2188 ("automake" ,automake)))
2191 (modify-phases %standard-phases
2192 (add-before 'bootstrap 'patch-stuff
2194 ;; Fix "field ‘ip6’ has incomplete type" errors.
2195 (substitute* "libbridge/libbridge.h"
2196 (("#include <linux/if_bridge.h>")
2197 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2199 ;; Ensure that the entire build fails if one of the
2200 ;; sub-Makefiles fails.
2201 (substitute* "Makefile.in"
2202 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2203 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2206 #:tests? #f)) ; no 'check' target
2208 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2209 (synopsis "Manipulate Ethernet bridges")
2211 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2212 to connect two Ethernet segments together in a protocol independent way.
2213 Packets are forwarded based on Ethernet address, rather than IP address (like
2214 a router). Since forwarding is done at Layer 2, all protocols can go
2215 transparently through a bridge.")
2216 (license license:gpl2+)))
2218 (define-public libnl
2225 "https://github.com/thom311/libnl/releases/download/"
2226 "libnl" (string-join (string-split version #\.) "_")
2227 "/libnl-" version ".tar.gz"))
2230 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2231 (build-system gnu-build-system)
2235 ("pkg-config" ,pkg-config)
2241 "https://github.com/thom311/libnl/releases/download/libnl"
2242 (string-join (string-split version #\.) "_")
2243 "/libnl-doc-" version ".tar.gz"))
2245 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2247 `(("python-2" ,python-2)
2248 ("python-3" ,python-3)))
2249 (outputs '("out" "doc" "python2" "python3"))
2251 `(#:modules ((guix build gnu-build-system)
2255 (modify-phases %standard-phases
2256 (add-after 'install 'install-python
2257 (lambda* (#:key outputs #:allow-other-keys)
2258 (define (python-inst python)
2259 (invoke python "setup.py" "build")
2260 (invoke python "setup.py" "install"
2261 (string-append "--prefix="
2262 (assoc-ref %outputs python)))
2263 (invoke python "setup.py" "clean"))
2264 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2265 (assoc-ref %outputs "out")))
2266 (with-directory-excursion "./python"
2267 (for-each python-inst '("python2" "python3")))
2269 (add-after 'install 'install-doc
2270 (lambda* (#:key inputs outputs #:allow-other-keys)
2271 (let ((dest (string-append (assoc-ref outputs "doc")
2272 "/share/doc/libnl")))
2274 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
2275 "--strip-components=1" "-C" dest)))))))
2276 (home-page "https://www.infradead.org/~tgr/libnl/")
2277 (synopsis "NetLink protocol library suite")
2279 "The libnl suite is a collection of libraries providing APIs to netlink
2280 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2281 between the kernel and user space processes. It was designed to be a more
2282 flexible successor to ioctl to provide mainly networking related kernel
2283 configuration and monitoring interfaces.")
2285 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2286 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2287 (license license:gpl2)))
2296 "mirror://kernel.org/software/network/iw/iw-"
2300 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2301 (build-system gnu-build-system)
2302 (native-inputs `(("pkg-config" ,pkg-config)))
2303 (inputs `(("libnl" ,libnl)))
2306 (let* ((target ,(%current-target-system))
2307 (gcc (if target (string-append target "-gcc") "gcc"))
2308 (pkg-config (if target
2309 (string-append target "-pkg-config")
2312 (string-append "CC=" gcc)
2313 (string-append "PKG_CONFIG="
2314 (assoc-ref %build-inputs "pkg-config")
2316 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2317 #:phases (modify-phases %standard-phases (delete 'configure))))
2318 (home-page "https://wireless.wiki.kernel.org/")
2319 (synopsis "Tool for configuring wireless devices")
2321 "iw is a new nl80211 based CLI configuration utility for wireless
2322 devices. It replaces @code{iwconfig}, which is deprecated.")
2323 (license license:isc)))
2325 (define-public powertop
2332 (uri (string-append "https://01.org/sites/default/files/downloads/"
2333 "powertop-" version ".tar.gz"))
2335 (base32 "1kiiwa5p2r7h1lzcf53xq61ckaa4wk565s9fs6vw4bfk84y3mfsw"))))
2336 (build-system gnu-build-system)
2339 (modify-phases %standard-phases
2340 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2341 ;; allow calibrating the network interface in Guix System.
2342 (add-after 'unpack 'patch-absolute-file-names
2343 (lambda* (#:key inputs #:allow-other-keys)
2344 (let ((kmod (assoc-ref inputs "kmod")))
2345 (substitute* (find-files "src" "\\.cpp$")
2346 ;; Give the right 'modprobe' file name so that essential
2347 ;; modules such as msr.ko can be loaded.
2348 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2349 ;; These programs are only needed to calibrate, so using
2350 ;; relative file names avoids adding extra inputs. When they
2351 ;; are missing powertop gracefully handles it.
2352 (("/usr/bin/hcitool") "hcitool")
2353 (("/usr/bin/xset") "xset")
2354 (("/usr/sbin/hciconfig") "hciconfig"))
2359 ("ncurses" ,ncurses)
2360 ("pciutils" ,pciutils)
2363 `(("pkg-config" ,pkg-config)))
2364 (home-page "https://01.org/powertop/")
2365 (synopsis "Analyze power consumption on Intel-based laptops")
2367 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2368 power management. In addition to being a diagnostic tool, PowerTOP also has
2369 an interactive mode where the user can experiment various power management
2370 settings for cases where the operating system has not enabled these
2372 (license license:gpl2)))
2374 (define-public aumix
2381 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2382 version ".tar.bz2"))
2385 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2386 (build-system gnu-build-system)
2387 (inputs `(("ncurses" ,ncurses)))
2388 (home-page "http://www.jpj.net/~trevor/aumix.html")
2389 (synopsis "Audio mixer for X and the console")
2391 "Aumix adjusts an audio mixer from X, the console, a terminal,
2392 the command line or a script.")
2393 (license license:gpl2+)))
2395 (define-public iotop
2402 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2405 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2406 (build-system python-build-system)
2409 (modify-phases %standard-phases
2410 (add-after 'unpack 'fix-build-with-python3
2412 (substitute* "setup.py"
2413 (("itervalues") "values"))
2415 ;; There are currently no checks in the package.
2417 (native-inputs `(("python" ,python)))
2418 (home-page "http://guichaz.free.fr/iotop/")
2420 "Displays the IO activity of running processes")
2422 "Iotop is a Python program with a top like user interface to show the
2423 processes currently causing I/O.")
2424 (license license:gpl2+)))
2432 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2433 "download/fuse-" version
2434 "/fuse-" version ".tar.gz"))
2437 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2438 (patches (search-patches "fuse-overlapping-headers.patch"))))
2439 (build-system gnu-build-system)
2440 (inputs `(("util-linux" ,util-linux)))
2442 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2443 (assoc-ref %outputs "out")
2445 (string-append "INIT_D_PATH="
2446 (assoc-ref %outputs "out")
2449 ;; The rule makes /dev/fuse 666.
2450 (string-append "UDEV_RULES_PATH="
2451 (assoc-ref %outputs "out")
2452 "/lib/udev/rules.d"))
2454 (modify-phases %standard-phases
2455 (add-before 'build 'set-file-names
2456 (lambda* (#:key inputs #:allow-other-keys)
2457 ;; libfuse calls out to mount(8) and umount(8). Make sure
2458 ;; it refers to the right ones.
2459 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2460 (("/bin/(u?)mount" _ maybe-u)
2461 (string-append (assoc-ref inputs "util-linux")
2462 "/bin/" maybe-u "mount")))
2463 (substitute* '("util/mount.fuse.c")
2467 ;; This hack leads libfuse to search for 'fusermount' in
2468 ;; $PATH, where it may find a setuid-root binary, instead of
2469 ;; trying solely $out/sbin/fusermount and failing because
2471 (substitute* "lib/Makefile"
2472 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2473 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2475 (home-page "https://github.com/libfuse/libfuse")
2476 (synopsis "Support file systems implemented in user space")
2478 "As a consequence of its monolithic design, file system code for Linux
2479 normally goes into the kernel itself---which is not only a robustness issue,
2480 but also an impediment to system extensibility. FUSE, for \"file systems in
2481 user space\", is a kernel module and user-space library that tries to address
2482 part of this problem by allowing users to run file system implementations as
2483 user-space processes.")
2484 (license (list license:lgpl2.1 ;library
2485 license:gpl2+)))) ;command-line utilities
2487 (define-public unionfs-fuse
2489 (name "unionfs-fuse")
2494 (url "https://github.com/rpodgorny/unionfs-fuse")
2495 (commit (string-append "v" version))))
2496 (file-name (git-file-name name version))
2499 "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6"))))
2500 (build-system cmake-build-system)
2502 `(("python" ,python)))
2503 (inputs `(("fuse" ,fuse)))
2505 ;; The tests were never actually run ("collected 0 items"), but in recent
2506 ;; versions of pytest that causes an error.
2508 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2509 (synopsis "User-space union file system")
2511 "UnionFS-FUSE is a flexible union file system implementation in user
2512 space, using the FUSE library. Mounting a union file system allows you to
2513 \"aggregate\" the contents of several directories into a single mount point.
2514 UnionFS-FUSE additionally supports copy-on-write.")
2515 (license license:bsd-3)))
2518 (package (inherit fuse)
2519 (name "fuse-static")
2520 (source (origin (inherit (package-source fuse))
2521 (modules '((guix build utils)))
2524 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2525 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2526 ;; that it doesn't do that, allowing us to remove the
2527 ;; dependency on util-linux (something that is useful in
2529 (substitute* '("lib/mount_util.c"
2530 "util/mount_util.c")
2531 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2537 (define-public unionfs-fuse/static
2538 (package (inherit unionfs-fuse)
2539 (synopsis "User-space union file system (statically linked)")
2540 (name (string-append (package-name unionfs-fuse) "-static"))
2541 (source (origin (inherit (package-source unionfs-fuse))
2542 (modules '((guix build utils)))
2545 ;; Add -ldl to the libraries, because libfuse.a needs that.
2546 (substitute* "src/CMakeLists.txt"
2547 (("target_link_libraries(.*)\\)" _ libs)
2548 (string-append "target_link_libraries"
2553 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2555 (modify-phases %standard-phases
2556 (add-after 'install 'post-install
2557 (lambda* (#:key outputs #:allow-other-keys)
2558 (let* ((out (assoc-ref outputs "out"))
2559 (exe (string-append out "/bin/unionfs")))
2560 ;; By default, 'unionfs' keeps references to
2561 ;; $glibc/share/locale and similar stuff. Remove them.
2562 (remove-store-references exe)
2564 ;; 'unionfsctl' has references to glibc as well. Since
2565 ;; we don't need it, remove it.
2566 (delete-file (string-append out "/bin/unionfsctl"))
2568 (inputs `(("fuse" ,fuse-static)))))
2570 (define-public sshfs
2576 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2577 "download/sshfs-" version "/sshfs-" version
2581 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2582 (build-system gnu-build-system)
2587 `(("pkg-config" ,pkg-config)))
2588 (home-page "https://github.com/libfuse/sshfs")
2589 (synopsis "Mount remote file systems over SSH")
2591 "This is a file system client based on the SSH File Transfer Protocol.
2592 Since most SSH servers already support this protocol it is very easy to set
2593 up: on the server side there's nothing to do; on the client side mounting the
2594 file system is as easy as logging into the server with an SSH client.")
2595 (license license:gpl2+)))
2597 (define-public sshfs-fuse
2598 (package (inherit sshfs)
2600 (properties `((superseded . ,sshfs)))))
2602 (define-public archivemount
2604 (name "archivemount")
2609 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2610 "archivemount-" version ".tar.gz"))
2612 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2613 (build-system gnu-build-system)
2614 (inputs `(("fuse" ,fuse)
2615 ("libarchive" ,libarchive)))
2616 (native-inputs `(("pkg-config" ,pkg-config)))
2617 (home-page "https://www.cybernoia.de/software/archivemount.html")
2618 (synopsis "Tool for mounting archive files with FUSE")
2619 (description "archivemount is a FUSE-based file system for Unix variants,
2620 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2621 mount point where it can be read from or written to as with any other file
2622 system. This makes accessing the contents of the archive, which may be
2623 compressed, transparent to other programs, without decompressing them.")
2624 (license license:lgpl2.0+)))
2626 (define-public numactl
2633 "https://github.com/numactl/numactl/releases/download/v"
2634 version "/numactl-" version ".tar.gz"))
2637 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2638 (build-system gnu-build-system)
2640 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2641 ;; to run, which we can't assume to have.
2644 ;; NUMA is apparently not supported on armhf, see
2645 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2646 (supported-systems (delete "armhf-linux" %supported-systems))
2647 (home-page "https://github.com/numactl/numactl")
2648 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2650 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2651 memory is not all in one place. The @command{numactl} program allows you to
2652 run your application program on specific CPUs and memory nodes. It does this
2653 by supplying a NUMA memory policy to the operating system before running your
2656 The package contains other commands, such as @command{numastat},
2657 @command{memhog}, and @command{numademo} which provides a quick overview of
2658 NUMA performance on your system.")
2659 (license (list license:gpl2 ;programs
2660 license:lgpl2.1)))) ;library
2662 (define-public kbd-neo
2669 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2670 version "/linux/console/neo.map"))
2671 (file-name (string-append name "-" version ".map"))
2674 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2675 (build-system trivial-build-system)
2677 `(#:modules ((guix build utils))
2679 (use-modules (guix build utils))
2680 (let ((out (string-append %output "/share/keymaps"))
2681 (source (assoc-ref %build-inputs "source")))
2683 (copy-file source (string-append out "/neo.map"))
2685 (home-page "https://neo-layout.org")
2686 (synopsis "Neo2 console layout")
2688 "Kbd-neo provides the Neo2 keyboard layout for use with
2689 @command{loadkeys(1)} from @code{kbd(4)}.")
2690 ;; The file is located in an svn directory, the entire content of
2691 ;; the directory is licensed as GPL3.
2692 (license license:gpl3+)))
2700 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2704 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2705 (modules '((guix build utils)))
2708 (substitute* "tests/Makefile.in"
2709 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2712 (substitute* '("src/unicode_start" "src/unicode_stop")
2713 ;; Assume the Coreutils are in $PATH.
2717 (build-system gnu-build-system)
2720 (modify-phases %standard-phases
2721 (add-before 'build 'pre-build
2722 (lambda* (#:key inputs #:allow-other-keys)
2723 (let ((gzip (assoc-ref %build-inputs "gzip"))
2724 (bzip2 (assoc-ref %build-inputs "bzip2")))
2725 (substitute* "src/libkeymap/findfile.c"
2727 (string-append gzip "/bin/gzip"))
2729 (string-append bzip2 "/bin/bzip2")))
2731 (add-after 'install 'post-install
2732 (lambda* (#:key outputs #:allow-other-keys)
2733 ;; Make sure these programs find their comrades.
2734 (let* ((out (assoc-ref outputs "out"))
2735 (bin (string-append out "/bin")))
2736 (for-each (lambda (prog)
2737 (wrap-program (string-append bin "/" prog)
2738 `("PATH" ":" prefix (,bin))))
2739 '("unicode_start" "unicode_stop"))
2741 (inputs `(("check" ,check)
2744 ("pam" ,linux-pam)))
2745 (native-search-paths
2746 (list (search-path-specification
2747 (variable "LOADKEYS_KEYMAP_PATH")
2748 ;; Append ‘/**’ to recursively search all directories. One can then
2749 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2750 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2751 (files (list "share/keymaps/**")))))
2752 (native-inputs `(("pkg-config" ,pkg-config)))
2753 (home-page "http://kbd-project.org/")
2754 (synopsis "Linux keyboard utilities and keyboard maps")
2756 "This package contains keytable files and keyboard utilities compatible
2757 for systems using the Linux kernel. This includes commands such as
2758 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2759 (license license:gpl2+)))
2761 (define-public loadkeys-static
2764 (name "loadkeys-static")
2766 (substitute-keyword-arguments (package-arguments kbd)
2767 ((#:configure-flags flags ''())
2768 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2769 "--disable-vlock" ;so we don't need libpam
2770 "--disable-libkeymap")
2772 ((#:make-flags flags ''())
2773 `(cons "LDFLAGS=-all-static" ,flags))
2774 ((#:phases phases '%standard-phases)
2775 `(modify-phases ,phases
2777 (lambda* (#:key outputs #:allow-other-keys)
2778 (let ((out (assoc-ref outputs "out")))
2779 ;; The binary keeps references to gzip, among other things,
2780 ;; which we don't need in the initrd, so strip references.
2781 (remove-store-references "src/loadkeys")
2783 (install-file "src/loadkeys"
2784 (string-append out "/bin"))
2786 (delete 'post-install)))
2787 ((#:strip-flags _ '())
2789 ((#:allowed-references _ '())
2792 (synopsis "Statically-linked @command{loadkeys} program")
2794 ;; This package is meant to be used internally in the initrd so don't
2796 (properties '((hidden? . #t)))))
2798 (define-public inotify-tools
2800 (name "inotify-tools")
2805 (url "https://github.com/rvoicilas/inotify-tools.git")
2807 (file-name (git-file-name name version))
2810 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2811 (build-system gnu-build-system)
2813 `(("autoconf" ,autoconf)
2814 ("automake" ,automake)
2815 ("libtool" ,libtool)))
2816 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2817 (synopsis "Monitor file accesses")
2819 "The inotify-tools packages provides a C library and command-line tools
2820 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2821 (license license:gpl2+)))
2830 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2831 "kmod-" version ".tar.xz"))
2834 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2835 (patches (search-patches "kmod-module-directory.patch"))))
2836 (build-system gnu-build-system)
2838 `(("pkg-config" ,pkg-config)))
2843 `(#:tests? #f ; FIXME: Investigate test failures
2844 #:configure-flags '("--with-xz" "--with-zlib")
2846 (modify-phases %standard-phases
2847 (add-after 'install 'install-modprobe&co
2848 (lambda* (#:key outputs #:allow-other-keys)
2849 (let* ((out (assoc-ref outputs "out"))
2850 (bin (string-append out "/bin")))
2851 (for-each (lambda (tool)
2853 (string-append bin "/" tool)))
2854 '("insmod" "rmmod" "lsmod" "modprobe"
2855 "modinfo" "depmod"))
2857 (home-page "https://www.kernel.org/")
2858 (synopsis "Kernel module tools")
2859 (description "Kmod is a set of tools to handle common tasks with Linux
2860 kernel modules like insert, remove, list, check properties, resolve
2861 dependencies and aliases.
2863 These tools are designed on top of libkmod, a library that is shipped with
2864 kmod. The aim is to be compatible with tools, configurations and indices
2865 from the module-init-tools project.")
2866 (license license:gpl2+))) ; library under lgpl2.1+
2868 (define-public earlyoom
2875 (url "https://github.com/rfjakob/earlyoom.git")
2876 (commit (string-append "v" version))))
2877 (file-name (git-file-name name version))
2880 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
2881 (build-system gnu-build-system)
2883 `(#:phases (modify-phases %standard-phases
2885 (add-before 'check 'set-home
2887 (setenv "HOME" (getcwd))
2889 (add-after 'build 'install-contribs
2890 ;; Install what seems useful from the contrib directory.
2891 (lambda* (#:key outputs #:allow-other-keys)
2892 (let* ((out (assoc-ref outputs "out"))
2893 (contrib (string-append
2894 out "/share/earlyoom/contrib")))
2895 (install-file "contrib/notify_all_users.py" contrib)
2897 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
2899 (string-append "VERSION=v" ,version)
2900 (string-append "PREFIX=" prefix)
2901 (string-append "SYSCONFDIR=" prefix "/etc")))
2902 #:test-target "test"))
2903 (native-inputs `(("go" ,go) ;for the test suite
2904 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
2905 (home-page "https://github.com/rfjakob/earlyoom")
2906 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
2907 (description "Early OOM is a minimalist out of memory (OOM) daemon that
2908 runs in user space and provides a more responsive and configurable alternative
2909 to the in-kernel OOM killer.")
2910 (license license:expat)))
2912 (define-public eudev
2913 ;; The post-systemd fork, maintained by Gentoo.
2919 (uri (git-reference (url "https://github.com/gentoo/eudev")
2920 (commit (string-append "v" version))))
2921 (file-name (git-file-name name version))
2924 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
2925 (patches (search-patches "eudev-rules-directory.patch"))))
2926 (build-system gnu-build-system)
2929 (modify-phases %standard-phases
2930 (add-after 'unpack 'make-source-writable
2932 ;; XXX: Git checkouts are read-only, but this package needs to
2933 ;; modify some of its files.
2934 (for-each make-file-writable (find-files "."))
2936 (add-before 'bootstrap 'patch-file-names
2937 (lambda* (#:key inputs #:allow-other-keys)
2938 (substitute* "man/make.sh"
2939 (("/usr/bin/xsltproc")
2940 (string-append (assoc-ref inputs "xsltproc")
2943 (add-after 'install 'move-static-library
2944 (lambda* (#:key outputs #:allow-other-keys)
2945 (let* ((out (assoc-ref outputs "out"))
2946 (static (assoc-ref outputs "static"))
2947 (source (string-append out "/lib/libudev.a"))
2948 (target (string-append static "/lib/libudev.a")))
2949 (mkdir-p (dirname target))
2950 (link source target)
2951 (delete-file source)
2952 ;; Remove reference to the static library from the .la file
2953 ;; such that Libtool looks for it in the usual places.
2954 (substitute* (string-append out "/lib/libudev.la")
2956 "old_library=''\n"))
2958 (add-after 'install 'build-hwdb
2959 (lambda* (#:key outputs #:allow-other-keys)
2960 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2961 ;; similar tools to display product names.
2962 (let ((out (assoc-ref outputs "out")))
2963 (invoke (string-append out "/bin/udevadm")
2964 "hwdb" "--update")))))
2965 #:configure-flags (list "--enable-manpages")))
2967 `(("autoconf" ,autoconf)
2968 ("automake" ,automake)
2970 ("libtool" ,libtool)
2971 ("pkg-config" ,pkg-config)
2974 ("python" ,python-wrapper)
2975 ;; For documentation.
2976 ("docbook-xml" ,docbook-xml-4.2)
2977 ("docbook-xsl" ,docbook-xsl)
2978 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2979 ("xsltproc" ,libxslt)))
2981 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2982 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2983 ;; which contains the rules to do that.
2984 `(("util-linux" ,util-linux) ;for blkid
2986 (outputs '("out" "static"))
2987 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2988 (synopsis "Userspace device management")
2989 (description "Udev is a daemon which dynamically creates and removes
2990 device nodes from /dev/, handles hotplug events and loads drivers at boot
2992 (license license:gpl2+)))
2994 ;; TODO: Merge with eudev on the next rebuild cycle.
2995 (define-public eudev/btrfs-fix
2998 (version (string-append (package-version eudev) "-1"))
3000 (substitute-keyword-arguments (package-arguments eudev)
3001 ((#:phases phases '%standard-phases)
3002 `(modify-phases ,phases
3003 (add-before 'configure 'patch-bindir-in-btrfs-rules
3004 (lambda* (#:key outputs #:allow-other-keys)
3005 ;; The "@bindir@" substitution incorrectly expands to a literal
3006 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3008 (let ((out (assoc-ref outputs "out")))
3009 (substitute* "rules/64-btrfs.rules.in"
3011 (string-append out "/bin")))
3014 (define-public python-evdev
3016 (name "python-evdev")
3021 (uri (pypi-uri "evdev" version))
3023 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3024 (build-system python-build-system)
3026 `(("kernel-headers" ,linux-libre-headers)))
3028 `(#:tests? #f ;no rule for tests
3030 (modify-phases %standard-phases
3031 (add-before 'build 'fix-hard-coded-directory
3032 (lambda* (#:key inputs #:allow-other-keys)
3033 (substitute* "setup.py"
3034 (("/usr/include/linux")
3036 (assoc-ref inputs "kernel-headers") "/include/linux")))
3038 (home-page "https://github.com/gvalkov/python-evdev")
3039 (synopsis "Bindings to the Linux input handling subsystem")
3041 "Python-evdev provides bindings to the generic input event interface in
3042 Linux. The @code{evdev} interface serves the purpose of passing events
3043 generated in the kernel directly to userspace through character devices that
3044 are typically located in @file{/dev/input/}.
3046 This package also comes with bindings to @code{uinput}, the userspace input
3047 subsystem. @code{uinput} allows userspace programs to create and handle input
3048 devices that can inject events directly into the input subsystem.")
3049 (license license:bsd-3)))
3057 (uri (list (string-append "ftp://sourceware.org/pub/lvm2/LVM2."
3059 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3063 "1j0yis658564rk1ddabkl8vbavp0fdd10gd6qhgyzc3akzf620kf"))
3064 (modules '((guix build utils)))
3067 (use-modules (guix build utils))
3069 ;; Honor sysconfdir.
3070 (substitute* "make.tmpl.in"
3072 "confdir = @sysconfdir@\n")
3073 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3074 "DEFAULT_SYS_DIR = @sysconfdir@"))
3076 (patches (search-patches "lvm2-static-link.patch"))))
3077 (build-system gnu-build-system)
3079 `(("pkg-config" ,pkg-config)
3080 ("procps" ,procps))) ;tests use 'pgrep'
3082 `(("libaio" ,libaio)
3086 (modify-phases %standard-phases
3087 (add-after 'configure 'set-makefile-shell
3089 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3091 (setenv "SHELL" (which "sh"))
3093 ;; Replace /bin/sh with the right file name.
3094 (patch-makefile-SHELL "make.tmpl")
3097 #:configure-flags (list (string-append "--sysconfdir="
3098 (assoc-ref %outputs "out")
3100 "--enable-udev_sync"
3101 "--enable-udev_rules"
3102 "--enable-pkgconfig"
3104 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3106 ;; Make sure programs such as 'dmsetup' can
3107 ;; find libdevmapper.so.
3108 (string-append "LDFLAGS=-Wl,-rpath="
3109 (assoc-ref %outputs "out")
3111 (assoc-ref %outputs "out")
3112 "/lib/device-mapper"))
3114 ;; The tests use 'mknod', which requires root access.
3116 (home-page "https://sourceware.org/lvm2/")
3117 (synopsis "Logical volume management for Linux")
3119 "LVM2 is the logical volume management tool set for Linux-based systems.
3120 This package includes the user-space libraries and tools, including the device
3121 mapper. Kernel components are part of Linux-libre.")
3123 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3124 ;; Command-line tools are GPLv2.
3125 (license (list license:gpl2 license:lgpl2.1))))
3127 (define-public lvm2-static
3130 (name "lvm2-static")
3132 ;; Propagate udev because libdevmapper.a depends on libudev.
3133 (propagated-inputs `(("udev:static" ,eudev "static")))
3136 (substitute-keyword-arguments (package-arguments lvm2)
3137 ((#:configure-flags flags '())
3138 ;; LVM2 doesn't use Libtool, hence the custom option.
3139 `(append '("--enable-static_link")
3140 ;; Building dmeventd statically is complicated due to a
3141 ;; requirement on libdevmapper.a, which is being phased out
3142 ;; in favor of libdevice-mapper.a, which in turn is is not
3143 ;; easily made available at dmeventd build time. Just ignore
3144 ;; it until the situation improves.
3145 (delete "--enable-dmeventd" ,flags)))
3147 `(modify-phases ,phases
3148 (add-before 'configure 'adjust-Makefile
3150 ;; These fixes are related to the upstream libdm->device_mapper
3151 ;; migration and will hopefully be fixed upstream in due time.
3152 (substitute* "tools/Makefile.in"
3153 ;; This variable is empty in a static configuration and causes
3154 ;; an erroneous GCC command line.
3155 (("-L\\$\\(interfacebuilddir\\)") "")
3156 ;; Remove obsolete reference to libdevmapper.a.
3157 (("-ldevmapper") ""))
3159 (synopsis "Logical volume management for Linux (statically linked)")))
3161 (define-public wireless-tools
3163 (name "wireless-tools")
3167 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3171 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3174 ;; Remove the older header files that are not free software.
3175 (for-each (lambda (n)
3176 (delete-file (format #f "wireless.~a.h" n)))
3177 '(10 11 12 13 14 15 16 17 18 19 20))
3179 (build-system gnu-build-system)
3182 (list (string-append "PREFIX=" %output)
3183 (string-append "INSTALL_MAN=" %output "/share/man")
3184 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3187 (modify-phases %standard-phases
3189 (lambda* (#:key target #:allow-other-keys)
3190 (when ,(%current-target-system)
3191 ;; Cross-compilation: use the cross tools.
3192 (substitute* (find-files "." "Makefile")
3194 (string-append "CC = " target "-gcc\n"))
3196 (string-append "AR = " target "-ar\n"))
3198 (string-append "RANLIB = " target "-ranlib\n"))))
3201 (synopsis "Tools for manipulating Linux Wireless Extensions")
3202 (description "Wireless Tools are used to manipulate the now-deprecated
3203 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3204 Extension was an interface allowing you to set Wireless LAN specific
3205 parameters and get the specific stats. It is deprecated in favor the nl80211
3207 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3208 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3209 ;; other files are distributed under gpl2.
3210 (license (list license:gpl2 license:lgpl2.1+))))
3218 (uri (string-append "mirror://kernel.org/software/network/crda/"
3219 "crda-" version ".tar.xz"))
3222 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3223 (patches (search-patches "crda-optional-gcrypt.patch"))))
3224 (build-system gnu-build-system)
3226 '(#:phases (modify-phases %standard-phases
3228 (add-after 'unpack 'gzip-determinism
3230 (substitute* "Makefile"
3231 (("gzip") "gzip --no-name"))
3234 'build 'no-werror-no-ldconfig
3236 (substitute* "Makefile"
3238 (("ldconfig") "true"))
3241 'build 'set-regulator-db-file-name
3242 (lambda* (#:key inputs #:allow-other-keys)
3243 ;; Tell CRDA where to find our database.
3244 (let ((regdb (assoc-ref inputs "wireless-regdb")))
3245 (substitute* "crda.c"
3246 (("\"/lib/crda/regulatory.bin\"")
3247 (string-append "\"" regdb
3248 "/lib/crda/regulatory.bin\"")))
3250 #:test-target "verify"
3251 #:make-flags (let ((out (assoc-ref %outputs "out"))
3252 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3253 (list "CC=gcc" "V=1"
3255 ;; Disable signature-checking on 'regulatory.bin'.
3256 ;; The reason is that this simplifies maintenance
3257 ;; on our side (no need to manage a distro key
3258 ;; pair), and we can guarantee integrity of
3259 ;; 'regulatory.bin' by other means anyway, such as
3260 ;; 'guix gc --verify'. See
3261 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3265 (string-append "PREFIX=" out)
3266 (string-append "SBINDIR=" out "/sbin/")
3267 (string-append "UDEV_RULE_DIR="
3268 out "/lib/udev/rules.d")
3269 (string-append "LDFLAGS=-Wl,-rpath="
3271 (string-append "REG_BIN=" regdb
3272 "/lib/crda/regulatory.bin")))))
3273 (native-inputs `(("pkg-config" ,pkg-config)
3274 ("wireless-regdb" ,wireless-regdb)))
3275 (inputs `(("libnl" ,libnl)))
3277 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3278 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3280 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3281 communication between the kernel Linux and user space for regulatory
3283 (license license:copyleft-next)))
3285 (define-public wireless-regdb
3287 (name "wireless-regdb")
3288 (version "2019.06.03")
3292 "mirror://kernel.org/software/network/wireless-regdb/"
3293 "wireless-regdb-" version ".tar.xz"))
3296 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
3298 ;; We're building 'regulatory.bin' by ourselves.
3300 (delete-file "regulatory.bin")
3302 (build-system gnu-build-system)
3305 (modify-phases %standard-phases
3306 (add-after 'unpack 'gzip-determinism
3308 (substitute* "Makefile"
3309 (("gzip") "gzip --no-name"))
3311 (add-after 'unpack 'omit-signature
3313 (substitute* "Makefile"
3314 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3315 ;; don't provide (see below). Disable it.
3316 ((" regulatory\\.db\\.p7s") "")
3317 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3318 ;; but ‘make install’ depends only on the latter while installing
3319 ;; both (and failing). Depend on it explicitly.
3320 (("^install: " all) (string-append all "regulatory.db ")))
3322 (delete 'configure)) ; no configure script
3324 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3325 ;; is computed and can be equal to 'maintainer-clean'; when that
3326 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3327 ;; just built. Thus, build things sequentially.
3328 #:parallel-build? #f
3330 #:tests? #f ; no tests
3332 (let ((out (assoc-ref %outputs "out")))
3333 (list (string-append "PREFIX=" out)
3334 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3336 ;; Leave this empty so that db2bin.py doesn't try to sign
3337 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3338 ;; pair for the whole distribution.
3339 (string-append "REGDB_PRIVKEY=")
3340 ;; Don't generate a public key for the same reason. These are
3341 ;; used as Makefile targets and can't be the empty string.
3342 (string-append "REGDB_PUBCERT=/dev/null")
3343 (string-append "REGDB_PUBKEY=/dev/null")))))
3345 `(("python" ,python-wrapper)))
3347 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3348 (synopsis "Wireless regulatory database")
3350 "This package contains the wireless regulatory database Central
3351 Regulatory Database Agent (CRDA) daemon. The database contains information on
3352 country-specific regulations for the wireless spectrum.")
3353 (license license:isc)))
3355 (define-public lm-sensors
3363 (url "https://github.com/groeck/lm-sensors.git")
3364 (commit (string-append "V" (string-join
3365 (string-split version #\.) "-")))))
3366 (file-name (git-file-name name version))
3368 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3369 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3370 (build-system gnu-build-system)
3371 (inputs `(("rrdtool" ,rrdtool)
3374 ("gnuplot" ,gnuplot)))
3375 (native-inputs `(("pkg-config" ,pkg-config)
3379 (outputs '("lib" ; avoid perl in closure
3382 `(#:tests? #f ; no 'check' target
3383 #:make-flags (list (string-append "PREFIX=" %output)
3384 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3385 (string-append "INCLUDEDIR="
3386 (assoc-ref %outputs "lib") "/include")
3387 (string-append "MANDIR=" %output "/share/man")
3388 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3390 (modify-phases %standard-phases
3392 (add-before 'build 'patch-exec-paths
3393 (lambda* (#:key inputs outputs #:allow-other-keys)
3394 (substitute* "prog/detect/sensors-detect"
3396 (string-append "`" (assoc-ref inputs "coreutils")
3398 (("(`|\")modprobe" all open-quote)
3399 (string-append open-quote
3400 (assoc-ref inputs "kmod")
3402 (substitute* '("prog/pwm/pwmconfig"
3403 "prog/pwm/fancontrol")
3405 (string-append (assoc-ref inputs "gnuplot")
3408 (string-append (assoc-ref inputs "coreutils")
3411 (string-append (assoc-ref inputs "grep")
3414 (string-append (assoc-ref inputs "sed")
3417 (string-append (assoc-ref inputs "coreutils")
3420 (string-append (assoc-ref inputs "coreutils")
3423 (string-append (assoc-ref inputs "coreutils")
3424 "/bin/readlink -f")))
3426 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3427 (synopsis "Utilities to read temperature/voltage/fan sensors")
3429 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3430 you to access information from temperature, voltage, and fan speed sensors.
3431 It works with most newer systems.")
3432 (license license:gpl2+)))
3434 (define-public iucode-tool
3436 (name "iucode-tool")
3440 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3441 "/raw/latest/iucode-tool_" version ".tar.xz"))
3444 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3445 (build-system gnu-build-system)
3446 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3447 (synopsis "Manipulate Intel microcode bundles")
3449 "@command{iucode_tool} is a utility to work with microcode packages for
3450 Intel processors. It can convert between formats, extract specific versions,
3451 create a firmware image suitable for the Linux kernel, and more.")
3452 ;; cpuid.h is available for i686, x86_64, and ia64.
3453 (supported-systems '("i686-linux" "x86_64-linux"))
3454 (license license:gpl2+)))
3456 (define-public i2c-tools
3463 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3464 version ".tar.bz2"))
3467 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3468 (build-system gnu-build-system)
3470 `(#:tests? #f ; no 'check' target
3471 #:make-flags (list (string-append "prefix=" %output)
3473 ;; no configure script
3474 #:phases (modify-phases %standard-phases (delete 'configure))))
3477 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3478 (synopsis "I2C tools for Linux")
3480 "The i2c-tools package contains a heterogeneous set of I2C tools for
3481 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3482 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3484 (license license:gpl2+)))
3486 (define-public xsensors
3493 "http://www.linuxhardware.org/xsensors/xsensors-"
3497 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3498 (build-system gnu-build-system)
3499 (inputs `(("lm-sensors" ,lm-sensors "lib")
3501 (native-inputs `(("pkg-config" ,pkg-config)))
3504 (modify-phases %standard-phases
3505 (add-before 'configure 'enable-deprecated
3507 (substitute* "src/Makefile.in"
3508 (("-DGDK_DISABLE_DEPRECATED") "")
3509 (("-DGTK_DISABLE_DEPRECATED") ""))
3511 (add-before 'configure 'remove-Werror
3513 (substitute* '("configure" "src/Makefile.in")
3516 (home-page "http://www.linuxhardware.org/xsensors/")
3517 (synopsis "Hardware health information viewer")
3519 "Xsensors reads data from the libsensors library regarding hardware
3520 health such as temperature, voltage and fan speed and displays the information
3521 in a digital read-out.")
3522 (license license:gpl2+)))
3527 (version (package-version linux-libre))
3528 (source (package-source linux-libre))
3529 (build-system gnu-build-system)
3532 (modify-phases %standard-phases
3534 (lambda* (#:key inputs #:allow-other-keys)
3535 (setenv "SHELL_PATH" (which "bash"))
3536 (chdir "tools/perf")
3538 #:make-flags (list (string-append "prefix="
3539 (assoc-ref %outputs "out"))
3540 ;; Make sure the kernel headers are treated as system
3541 ;; headers to suppress warnings from those.
3542 (string-append "C_INCLUDE_PATH="
3543 (assoc-ref %build-inputs "kernel-headers")
3547 ;; By default, 'config/Makefile' uses lib64 on
3548 ;; x86_64. Work around that.
3550 #:tests? #f)) ;no tests
3552 `(("pkg-config" ,pkg-config)
3556 ;; There are build scripts written in these languages.
3558 ("python" ,python-2)))
3560 `(("slang" ,slang) ;for the interactive TUI
3562 ("python" ,python-2) ;'perf' links against libpython
3563 ("elfutils" ,elfutils)
3564 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3565 ("libunwind" ,libunwind) ;better stack walking
3566 ("numactl" ,numactl) ;for 'perf bench numa mem'
3569 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3570 ("docbook-xsl" ,docbook-xsl)
3572 ("asciidoc" ,asciidoc)))
3573 (home-page "https://perf.wiki.kernel.org/")
3574 (synopsis "Linux profiling with performance counters")
3576 "perf is a tool suite for profiling using hardware performance counters,
3577 with support in the Linux kernel. perf can instrument CPU performance
3578 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3579 of lightweight profiling. This package contains the user-land tools and in
3580 particular the @code{perf} command.")
3581 (license (package-license linux-libre))))
3583 (define-public pflask
3589 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3591 (file-name (string-append name "-" version ".tar.gz"))
3594 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3595 (build-system cmake-build-system)
3597 '(#:tests? #f)) ; no tests
3598 (home-page "https://ghedo.github.io/pflask/")
3599 (synopsis "Simple tool for creating Linux namespace containers")
3600 (description "pflask is a simple tool for creating Linux namespace
3601 containers. It can be used for running a command or even booting an OS inside
3602 an isolated container, created with the help of Linux namespaces. It is
3603 similar in functionality to chroot, although pflask provides better isolation
3604 thanks to the use of namespaces.")
3605 (license license:bsd-2)))
3607 (define-public singularity
3609 (name "singularity")
3613 (uri (string-append "https://github.com/singularityware/singularity/"
3614 "releases/download/" version
3615 "/singularity-" version ".tar.gz"))
3618 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3619 (modules '((guix build utils)))
3622 ;; Do not create directories in /var.
3623 (substitute* "Makefile.in"
3624 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3626 ;; The original source overrides PATH so that it points to
3627 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3628 ;; on Guix System. Leave PATH unchanged so we refer to the
3629 ;; installed Coreutils, grep, etc.
3630 (substitute* "bin/singularity.in"
3632 (string-append "#" all "\n")))
3634 (substitute* (find-files "libexec/cli" "\\.exec$")
3635 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3637 (string-append "/run/setuid-programs/singularity-"
3638 program "-helper")))
3640 ;; These squashfs mount options are apparently no longer
3641 ;; supported since Linux-libre 5.4.5.
3642 (substitute* "src/lib/image/squashfs/mount.c"
3643 (("\"errors=remount-ro\"")
3646 (build-system gnu-build-system)
3648 `(#:configure-flags '("--localstatedir=/var")
3650 (modify-phases %standard-phases
3651 (add-after 'unpack 'patch-reference-to-squashfs-tools
3653 (substitute* "libexec/cli/build.exec"
3654 (("if ! singularity_which mksquashfs") "if 0")
3655 (("if ! mksquashfs")
3656 (string-append "if ! " (which "mksquashfs"))))
3658 (add-after 'install 'set-PATH
3659 (lambda* (#:key inputs outputs #:allow-other-keys)
3660 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
3661 (let ((out (assoc-ref outputs "out"))
3662 (coreutils (assoc-ref inputs "coreutils")))
3663 (wrap-program (string-append out "/bin/singularity")
3664 `("PATH" ":" = (,(string-append coreutils "/bin"))))
3665 (substitute* (string-append out "/bin/run-singularity")
3666 (("/usr/bin/env singularity")
3667 (string-append (which "env") " "
3668 out "/bin/singularity")))
3671 `(("libarchive" ,libarchive)
3672 ("python" ,python-wrapper)
3674 ("squashfs-tools" ,squashfs-tools)))
3675 (home-page "https://singularity.lbl.gov/")
3676 (synopsis "Container platform")
3677 (description "Singularity is a container platform supporting a number of
3678 container image formats. It can build SquashFS container images or import
3679 existing Docker images. Singularity requires kernel support for container
3680 isolation or root privileges.")
3681 (license license:bsd-3)))
3683 (define-public hdparm
3689 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3690 "hdparm-" version ".tar.gz"))
3693 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3694 (build-system gnu-build-system)
3696 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3697 (list (string-append "binprefix=" out)
3698 (string-append "manprefix=" out)
3701 (modify-phases %standard-phases
3702 (delete 'configure)) ; no configure script
3703 #:tests? #f)) ; no test suite
3704 (home-page "https://sourceforge.net/projects/hdparm/")
3705 (synopsis "View and tune ATA disk drive parameters")
3707 "@command{hdparm} is a command-line utility to control ATA controllers and
3708 disk drives. It can increase performance and/or reliability by careful tuning
3709 of hardware settings like power and acoustic management, DMA modes, and caching.
3710 It can also display detailed device information, or be used as a simple
3711 performance benchmarking tool.
3713 @command{hdparm} provides a command line interface to various Linux kernel
3714 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3715 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3716 Translation (@dfn{SAT}) are also supported.")
3717 (license (license:non-copyleft "file://LICENSE.TXT"))))
3719 (define-public nvme-cli
3723 (home-page "https://github.com/linux-nvme/nvme-cli")
3728 (commit (string-append "v" version))))
3730 (base32 "12wp2wxmsw2v8m9bhvwvdbhdgx1md8iilhbl19sfzz2araiwi2x8"))
3731 (file-name (git-file-name name version))))
3732 (build-system gnu-build-system)
3734 `(#:make-flags (list "CC=gcc")
3735 #:phases (modify-phases %standard-phases
3736 (delete 'configure) ; No ./configure script
3739 (invoke "make" "install-spec" "PREFIX="
3740 (string-append "DESTDIR=" %output)))))
3741 #:tests? #f)) ; The tests require sysfs, which is not accessible from
3742 ; the build environment
3743 (synopsis "NVM-Express user space tooling for Linux")
3744 (description "Nvme-cli is a utility to provide standards compliant tooling
3745 for NVM-Express drives. It was made specifically for Linux as it relies on the
3746 IOCTLs defined by the mainline kernel driver.")
3747 (license license:gpl2+)))
3749 (define-public rfkill
3755 (uri (string-append "mirror://kernel.org/software/network/"
3756 name "/" name "-" version ".tar.xz"))
3759 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3760 (build-system gnu-build-system)
3762 `(#:make-flags (list "CC=gcc"
3763 (string-append "PREFIX=" %output))
3764 #:phases (modify-phases %standard-phases
3765 (delete 'configure))
3767 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3768 (synopsis "Tool for enabling and disabling wireless devices")
3770 "rfkill is a simple tool for accessing the rfkill device interface,
3771 which is used to enable and disable wireless networking devices, typically
3772 WLAN, Bluetooth and mobile broadband.")
3773 (license (license:non-copyleft "file://COPYING"
3774 "See COPYING in the distribution."))
3775 ;; rfkill is part of util-linux as of 2.31.
3776 (properties `((superseded . ,util-linux)))))
3784 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3785 version "/" name "-" version ".tar.gz"))
3788 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3789 (build-system gnu-build-system)
3790 (home-page "http://acpiclient.sourceforge.net")
3791 (synopsis "Display information on ACPI devices")
3792 (description "@code{acpi} attempts to replicate the functionality of the
3793 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3794 information. It does not support ACPI suspending, only displays information
3795 about ACPI devices.")
3796 (license license:gpl2+)))
3798 (define-public acpid
3804 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3808 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
3809 (build-system gnu-build-system)
3810 (home-page "https://sourceforge.net/projects/acpid2/")
3811 (synopsis "Daemon for delivering ACPI events to user-space programs")
3813 "acpid is designed to notify user-space programs of Advanced
3814 Configuration and Power Interface (ACPI) events. acpid should be started
3815 during the system boot, and will run as a background process. When an ACPI
3816 event is received from the kernel, acpid will examine the list of rules
3817 specified in /etc/acpi/events and execute the rules that match the event.")
3818 (license license:gpl2+)))
3820 (define-public sysfsutils
3829 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3832 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3833 (build-system gnu-build-system)
3834 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3835 (synopsis "System utilities based on Linux sysfs")
3837 "These are a set of utilities built upon sysfs, a virtual file system in
3838 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3839 also contains the libsysfs library.")
3840 ;; The library is under lgpl2.1+ (all files say "or any later version").
3841 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3842 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3844 (define-public sysfsutils-1
3846 (inherit sysfsutils)
3853 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3854 "/sysfsutils-" version ".tar.gz"))
3856 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3857 (modules '((guix build utils)))
3860 (substitute* "Makefile.in"
3861 (("includedir = /usr/include/sysfs")
3862 "includedir = @includedir@"))
3863 (substitute* "configure"
3864 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3865 (string-append "includedir='" orig "/sysfs'")))
3867 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3869 (define-public cpufrequtils
3871 (name "cpufrequtils")
3876 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3877 "cpufrequtils-" version ".tar.gz"))
3879 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3880 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3881 (build-system gnu-build-system)
3883 `(("sysfsutils" ,sysfsutils-1)))
3885 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3886 (assoc-ref %outputs "out") "/lib"))))
3887 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3888 (synopsis "Utilities to get and set CPU frequency on Linux")
3890 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3891 information, and set the CPU frequency if supported, using the cpufreq
3892 capabilities of the Linux kernel.")
3893 (license license:gpl2)))
3895 (define-public libraw1394
3902 "mirror://kernel.org/linux/libs/ieee1394/"
3903 name "-" version ".tar.xz"))
3906 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3907 (build-system gnu-build-system)
3908 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3909 (synopsis "Interface library for the Linux IEEE1394 drivers")
3911 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3912 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3913 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3914 send to and receive from other nodes without requiring a kernel driver for the
3915 protocol in question.")
3916 (license license:lgpl2.1+)))
3918 (define-public libavc1394
3924 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3925 name "-" version ".tar.gz"))
3928 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3929 (build-system gnu-build-system)
3931 `(("pkg-config" ,pkg-config)))
3933 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3934 (home-page "https://sourceforge.net/projects/libavc1394/")
3935 (synopsis "AV/C protocol library for IEEE 1394")
3937 "Libavc1394 is a programming interface to the AV/C specification from
3938 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3939 (license license:lgpl2.1+)))
3941 (define-public libiec61883
3943 (name "libiec61883")
3948 "mirror://kernel.org/linux/libs/ieee1394/"
3949 name "-" version ".tar.xz"))
3952 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3953 (build-system gnu-build-system)
3955 `(("pkg-config" ,pkg-config)))
3957 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3958 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3959 (synopsis "Isochronous streaming media library for IEEE 1394")
3961 "The libiec61883 library provides a higher level API for streaming DV,
3962 MPEG-2 and audio over Linux IEEE 1394.")
3963 (license license:lgpl2.1+)))
3965 (define-public mdadm
3972 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3976 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3977 (build-system gnu-build-system)
3981 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3985 ;; TODO: tell it where to find 'sendmail'
3986 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3987 (string-append "BINDIR=" out "/sbin")
3988 (string-append "MANDIR=" out "/share/man")
3989 (string-append "UDEVDIR=" out "/lib/udev")))
3991 (modify-phases %standard-phases
3992 (add-before 'build 'patch-program-paths
3993 (lambda* (#:key inputs #:allow-other-keys)
3994 (let ((coreutils (assoc-ref inputs "coreutils")))
3995 (substitute* "udev-md-raid-arrays.rules"
3996 (("/usr/bin/(readlink|basename)" all program)
3997 (string-append coreutils "/bin/" program))))
3999 (add-before 'build 'remove-W-error
4001 ;; We cannot build with -Werror on i686 due to a
4002 ;; 'sign-compare' warning in util.c.
4003 (substitute* "Makefile"
4006 (delete 'configure))
4007 ;;tests must be done as root
4009 (home-page "http://neil.brown.name/blog/mdadm")
4010 (synopsis "Tool for managing Linux Software RAID arrays")
4012 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4013 assemble, report on, and monitor arrays. It can also move spares between raid
4014 arrays when needed.")
4015 (license license:gpl2+)))
4017 (define-public mdadm-static
4020 (name "mdadm-static")
4022 (substitute-keyword-arguments (package-arguments mdadm)
4023 ((#:make-flags flags)
4024 `(cons "LDFLAGS = -static" ,flags))
4026 `(modify-phases ,phases
4027 (add-after 'install 'remove-cruft
4028 (lambda* (#:key outputs #:allow-other-keys)
4029 (let* ((out (assoc-ref outputs "out"))
4030 (precious? (lambda (file)
4031 (member file '("." ".." "sbin"))))
4032 (directories (scandir out (negate precious?))))
4033 (with-directory-excursion out
4034 (for-each delete-file-recursively directories)
4035 (remove-store-references "sbin/mdadm")
4036 (delete-file "sbin/mdmon")
4038 ((#:modules modules %gnu-build-system-modules)
4039 `((ice-9 ftw) ,@modules))
4040 ((#:strip-flags _ '())
4041 ''("--strip-all")) ;strip a few extra KiB
4042 ((#:allowed-references _ '("out"))
4043 '("out")))) ;refer only self
4044 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4046 (define-public multipath-tools
4048 (name "multipath-tools")
4052 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
4053 ".git;a=snapshot;h=" version ";sf=tgz"))
4054 (file-name (string-append name "-" version ".tar.gz"))
4057 "1c6ay97wlfv1fl0y8hcfpxhkps14hlnw9gzmj7884micsp7pa9yv"))
4058 (modules '((guix build utils)))
4061 ;; Drop bundled valgrind headers.
4062 (delete-file-recursively "third-party")
4063 (substitute* '("multipathd/main.c"
4064 "libmultipath/debug.c")
4065 (("#include \"../third-party/")
4068 (build-system gnu-build-system)
4070 '(#:tests? #f ; no tests
4071 #:make-flags (list "CC=gcc"
4072 (string-append "DESTDIR="
4073 (assoc-ref %outputs "out"))
4075 ;; Add the libaio headers to GCCs system header
4076 ;; search path to suppress -Werror=cast-qual on
4077 ;; the included headers.
4078 (string-append "C_INCLUDE_PATH="
4079 (assoc-ref %build-inputs "libaio")
4081 (string-append "LDFLAGS=-Wl,-rpath="
4082 (assoc-ref %outputs "out")
4085 (modify-phases %standard-phases
4086 (add-after 'unpack 'patch-source
4087 (lambda* (#:key inputs #:allow-other-keys)
4088 (let ((lvm2 (assoc-ref inputs "lvm2"))
4089 (udev (assoc-ref inputs "udev")))
4090 (substitute* "Makefile.inc"
4091 (("\\$\\(prefix\\)/usr") "$(prefix)")
4092 ;; Do not save timestamp to avoid gzip "timestamp
4093 ;; out-of-range" warnings.
4094 (("gzip -9") "gzip -9n"))
4095 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4096 (("/usr/include/libdevmapper.h")
4097 (string-append lvm2 "/include/libdevmapper.h"))
4098 (("/usr/include/libudev.h")
4099 (string-append udev "/include/libudev.h")))
4101 (delete 'configure)))) ; no configure script
4104 ("pkg-config" ,pkg-config)
4105 ("valgrind" ,valgrind)))
4107 `(("json-c" ,json-c)
4109 ("liburcu" ,liburcu)
4111 ("readline" ,readline)
4113 (home-page "http://christophe.varoqui.free.fr/")
4114 (synopsis "Access block devices through multiple paths")
4116 "This package provides the following binaries to drive the
4117 Linux Device Mapper multipathing driver:
4119 @item @command{multipath} - Device mapper target autoconfig.
4120 @item @command{multipathd} - Multipath daemon.
4121 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4122 @code{dm} multipath devices.
4123 @item @command{kpartx} - Create device maps from partition tables.
4125 (license (list license:gpl2+ ; main distribution
4126 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4128 (define-public libaio
4135 (string-append "https://releases.pagure.org/libaio/"
4136 name "-" version ".tar.gz")))
4139 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4140 (build-system gnu-build-system)
4143 (list "CC=gcc" (string-append "prefix=" %output))
4144 #:test-target "partcheck" ; need root for a full 'check'
4146 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4147 (home-page "https://pagure.io/libaio")
4148 (synopsis "Linux-native asynchronous I/O access library")
4150 "This library enables userspace to use Linux kernel asynchronous I/O
4151 system calls, important for the performance of databases and other advanced
4153 (license license:lgpl2.1+)))
4155 (define-public blktrace
4156 ;; Take a newer commit to get the fix for CVE-2018-10689.
4157 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4161 (version (git-version "1.2.0" revision commit))
4163 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4170 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4171 (file-name (git-file-name name version))))
4172 (build-system gnu-build-system)
4175 (list "CC=gcc" (string-append "prefix=" %output))
4176 #:tests? #f ; no tests
4178 (modify-phases %standard-phases
4179 (delete 'configure) ; no configure script
4180 (add-after 'unpack 'fix-gnuplot-path
4181 (lambda* (#:key inputs #:allow-other-keys)
4182 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4183 (substitute* "btt/bno_plot.py"
4185 (string-append gnuplot "/bin/gnuplot %s")))
4188 `(("libaio" ,libaio)
4189 ("gnuplot" ,gnuplot)
4190 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4191 (synopsis "Block layer IO tracing mechanism")
4192 (description "Blktrace is a block layer IO tracing mechanism which provides
4193 detailed information about request queue operations to user space. It extracts
4194 event traces from the kernel (via the relaying through the debug file system).")
4195 (license license:gpl2))))
4203 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4207 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4208 (build-system gnu-build-system)
4210 `(("libsndfile" ,libsndfile)))
4212 `(("pkg-config" ,pkg-config)))
4213 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4214 (synopsis "Bluetooth subband audio codec")
4216 "The SBC is a digital audio encoder and decoder used to transfer data to
4217 Bluetooth audio output devices like headphones or loudspeakers.")
4218 (license license:gpl2+)))
4220 (define-public bluez
4223 (replacement bluez/fixed)
4228 "mirror://kernel.org/linux/bluetooth/bluez-"
4232 "1g1qg6dz6hl3csrmz75ixr12lwv836hq3ckb259svvrg62l2vaiq"))))
4233 (build-system gnu-build-system)
4236 (let ((out (assoc-ref %outputs "out")))
4237 (list "--sysconfdir=/etc"
4238 "--localstatedir=/var"
4241 ;; Install dbus/udev files to the correct location.
4242 (string-append "--with-dbusconfdir=" out "/etc")
4243 (string-append "--with-udevdir=" out "/lib/udev")))
4245 (modify-phases %standard-phases
4246 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4247 ;; issue (discussion on upstream mailing list:
4248 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4249 (add-before 'check 'skip-wonky-test
4251 (substitute* "unit/test-gatt.c"
4252 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4254 (add-after 'install 'post-install
4255 (lambda* (#:key inputs outputs #:allow-other-keys)
4256 (let* ((out (assoc-ref outputs "out"))
4257 (servicedir (string-append out "/share/dbus-1/services"))
4258 (service "obexd/src/org.bluez.obex.service")
4259 (rule (string-append
4260 out "/lib/udev/rules.d/97-hid2hci.rules")))
4261 ;; Install the obex dbus service file.
4262 (substitute* service
4264 (string-append out "/libexec/bluetooth/obexd")))
4265 (install-file service servicedir)
4266 ;; Fix paths in the udev rule.
4268 (("hid2hci --method")
4269 (string-append out "/lib/udev/hid2hci --method"))
4271 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4274 `(("pkg-config" ,pkg-config)
4275 ("gettext" ,gettext-minimal)))
4280 ("libical" ,libical)
4281 ("readline" ,readline)))
4282 (home-page "http://www.bluez.org/")
4283 (synopsis "Linux Bluetooth protocol stack")
4285 "BlueZ provides support for the core Bluetooth layers and protocols. It
4286 is flexible, efficient and uses a modular implementation.")
4287 (license license:gpl2+)))
4293 (inherit (package-source bluez))
4294 (patches (append (origin-patches (package-source bluez))
4295 (search-patches "bluez-CVE-2020-0556.patch")))))))
4297 (define-public fuse-exfat
4304 "https://github.com/relan/exfat/releases/download/v"
4305 version "/" name "-" version ".tar.gz"))
4308 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4309 (build-system gnu-build-system)
4311 `(("pkg-config" ,pkg-config)))
4314 (home-page "https://github.com/relan/exfat")
4315 (synopsis "Mount exFAT file systems")
4317 "This package provides a FUSE-based file system that provides read and
4318 write access to exFAT devices.")
4319 (license license:gpl2+)))
4321 (define-public fuseiso
4324 (version "20070708")
4327 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4328 version "/fuseiso-" version ".tar.bz2"))
4331 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4332 (build-system gnu-build-system)
4334 `(("pkg-config" ,pkg-config)))
4339 (home-page "https://sourceforge.net/projects/fuseiso/")
4340 (synopsis "Mount ISO file system images")
4342 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4343 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4344 Ridge, Joliet, and zisofs.")
4345 (license license:gpl2)))
4354 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
4355 version ".tar.bz2"))
4356 (patches (search-patches "gpm-glibc-2.26.patch"))
4359 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4360 (build-system gnu-build-system)
4362 '(#:phases (modify-phases %standard-phases
4365 ;; The tarball was not generated with 'make dist' so we
4366 ;; need to bootstrap things ourselves.
4367 (substitute* "autogen.sh"
4368 (("/bin/sh") (which "sh")))
4369 (invoke "./autogen.sh")
4370 (patch-makefile-SHELL "Makefile.include.in")
4373 ;; Make sure programs find libgpm.so.
4374 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4375 (assoc-ref %outputs "out")
4378 `(("texinfo" ,texinfo)
4381 ("autoconf" ,autoconf)
4382 ("automake" ,automake)
4383 ("libtool" ,libtool)))
4384 (home-page "http://www.nico.schottelius.org/software/gpm/")
4385 (synopsis "Mouse support for the Linux console")
4387 "The GPM (general-purpose mouse) daemon is a mouse server for
4388 applications running on the Linux console. It allows users to select items
4389 and copy/paste text in the console and in xterm.")
4390 (license license:gpl2+)))
4392 (define-public btrfs-progs
4394 (name "btrfs-progs")
4398 (uri (string-append "mirror://kernel.org/linux/kernel/"
4399 "people/kdave/btrfs-progs/"
4400 "btrfs-progs-v" version ".tar.xz"))
4403 "0srg276yccfmqz0skmmga3vbqx4wiqsk1l6h86n6ryhxa9viqcm1"))))
4404 (build-system gnu-build-system)
4406 "static")) ; static versions of the binaries in "out"
4408 '(#:phases (modify-phases %standard-phases
4409 (add-after 'unpack 'patch-makefile
4410 (lambda* (#:key outputs #:allow-other-keys)
4411 (substitute* "Makefile"
4412 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4413 (string-append (assoc-ref outputs "out")
4414 "/lib/udev/rules.d")))
4416 (add-after 'build 'build-static
4417 (lambda _ (invoke "make" "static")))
4418 (add-after 'install 'install-bash-completion
4419 (lambda* (#:key outputs #:allow-other-keys)
4420 (let* ((out (assoc-ref outputs "out"))
4421 (bashcomp (string-append out "/etc/bash_completion.d")))
4423 (copy-file "btrfs-completion"
4424 (string-append bashcomp "/btrfs"))
4426 (add-after 'install 'install-static
4427 (let ((staticbin (string-append (assoc-ref %outputs "static")
4431 (string-append "bindir=" staticbin)
4432 "install-static")))))
4433 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4434 #:test-target "test"
4435 #:parallel-tests? #f)) ; tests fail when run in parallel
4436 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4437 ("libblkid" ,util-linux)
4438 ("libblkid:static" ,util-linux "static")
4439 ("libuuid" ,util-linux)
4440 ("libuuid:static" ,util-linux "static")
4443 ("zlib:static" ,zlib "static")
4444 ("zstd" ,zstd "lib")
4445 ("zstd:static" ,zstd "static")))
4446 (native-inputs `(("pkg-config" ,pkg-config)
4447 ("asciidoc" ,asciidoc)
4450 ;; For building documentation.
4451 ("libxml2" ,libxml2)
4452 ("docbook-xsl" ,docbook-xsl)
4458 ;; The tests need 'grep' with perl regexp support.
4460 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4461 (synopsis "Create and manage btrfs copy-on-write file systems")
4462 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4463 aimed at implementing advanced features while focusing on fault tolerance,
4464 repair and easy administration.")
4465 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4466 ;; GPL2: Everything else.
4467 (license (list license:gpl2 license:gpl2+))))
4469 (define-public btrfs-progs/static
4471 (name "btrfs-progs-static")
4472 (version (package-version btrfs-progs))
4474 (build-system trivial-build-system)
4476 `(("btrfs-progs:static" ,btrfs-progs "static")))
4478 `(#:modules ((guix build utils))
4481 (use-modules (guix build utils)
4485 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4486 (out (assoc-ref %outputs "out"))
4487 (source (string-append btrfs "/bin/btrfs.static"))
4488 (target (string-append out "/bin/btrfs")))
4489 (mkdir-p (dirname target))
4490 (copy-file source target)
4491 (remove-store-references target)
4492 (chmod target #o555)
4494 (home-page (package-home-page btrfs-progs))
4495 (synopsis "Statically-linked btrfs command from btrfs-progs")
4496 (description "This package provides the statically-linked @command{btrfs}
4497 from the btrfs-progs package. It is meant to be used in initrds.")
4498 (license (package-license btrfs-progs))))
4500 (define-public cramfs-tools
4502 (name "cramfs-tools")
4503 (home-page "https://github.com/npitre/cramfs-tools")
4509 (commit (string-append "v" version))))
4511 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
4512 (file-name (git-file-name name version))))
4513 (build-system gnu-build-system)
4515 '(#:tests? #f ; No tests.
4517 (modify-phases %standard-phases
4520 (lambda* (#:key outputs #:allow-other-keys)
4521 (let ((out (assoc-ref outputs "out")))
4522 (install-file "mkcramfs" (string-append out "/sbin"))
4523 (install-file "cramfsck" (string-append out "/sbin")))
4527 (synopsis "Tools to manage Cramfs file systems")
4528 (description "Cramfs is a Linux file system designed to be simple, small,
4529 and to compress things well. It is used on a number of embedded systems and
4530 small devices. This version has additional features such as uncompressed
4531 blocks and random block placement.")
4532 (license license:gpl2+)))
4534 (define-public compsize
4538 (home-page "https://github.com/kilobyte/compsize")
4543 (commit (string-append "v" version))))
4545 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4546 (file-name (git-file-name name version))))
4547 (build-system gnu-build-system)
4549 `(("btrfs-progs" ,btrfs-progs)))
4551 `(#:tests? #f ; No tests.
4552 #:make-flags (list "CC=gcc")
4554 (modify-phases %standard-phases
4557 (lambda* (#:key outputs #:allow-other-keys)
4558 (let ((out (assoc-ref outputs "out")))
4559 (install-file "compsize" (string-append out "/bin"))
4560 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4561 (synopsis "Find compression type/ratio on Btrfs files")
4562 (description "@command{compsize} takes a list of files (given as
4563 arguments) on a Btrfs file system and measures used compression types and
4564 effective compression ratio, producing a report.
4566 A directory has no extents but has a (recursive) list of files. A non-regular
4567 file is silently ignored.
4569 As it makes no sense to talk about compression ratio of a partial extent,
4570 every referenced extent is counted whole, exactly once -- no matter if you use
4571 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4572 uncompressed size will not match the number given by @command{tar} or
4573 @command{du}. On the other hand, the space used should be accurate (although
4574 obviously it can be shared with files outside our set).")
4575 (license license:gpl2+)))
4577 (define-public f2fs-tools-1.7
4584 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4585 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4588 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4590 (build-system gnu-build-system)
4593 (modify-phases %standard-phases
4594 (add-after 'install 'install-headers
4595 (lambda* (#:key outputs #:allow-other-keys)
4596 (let* ((out (assoc-ref outputs "out"))
4597 (out-include (string-append out "/include")))
4598 (install-file "include/f2fs_fs.h" out-include)
4599 (install-file "mkfs/f2fs_format_utils.h" out-include)
4602 `(("autoconf" ,autoconf)
4603 ("automake" ,automake)
4604 ("libtool" ,libtool)
4605 ("pkg-config" ,pkg-config)))
4607 `(("libuuid" ,util-linux)
4608 ("libselinux" ,libselinux)))
4609 (home-page "https://f2fs.wiki.kernel.org/")
4610 (synopsis "Userland tools for f2fs")
4612 "F2FS, the Flash-Friendly File System, is a modern file system
4613 designed to be fast and durable on flash devices such as solid-state
4614 disks and SD cards. This package provides the userland utilities.")
4615 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4616 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4617 (license (list license:gpl2 license:lgpl2.1))))
4619 (define-public f2fs-tools
4621 (inherit f2fs-tools-1.7)
4627 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4628 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4631 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4633 `(("libuuid" ,util-linux)))))
4635 (define-public f2fs-tools/static
4638 (inherit f2fs-tools)
4639 (name "f2fs-tools-static")
4642 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
4643 (libuuid (assoc-ref %build-inputs "libuuid")))
4645 (string-append "libuuid_CFLAGS=-I" libuuid "/include")
4646 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
4647 (string-append "libblkid_CFLAGS=-I" libuuid "/include")
4648 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
4649 #:disallowed-references (,util-linux)
4651 (modify-phases %standard-phases ; TODO: f2fs phases.
4652 (add-after 'unpack 'make-static
4654 (define (append-to-file name body)
4655 (let ((file (open-file name "a")))
4658 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
4659 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
4660 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
4662 (add-after 'install 'remove-store-references
4663 (lambda* (#:key outputs #:allow-other-keys)
4664 ;; Work around bug in our util-linux.
4665 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
4666 (remove-store-references (string-append (assoc-ref outputs "out")
4670 `(("libuuid:static" ,util-linux "static")
4671 ("libuuid" ,util-linux)))))) ; for include files
4673 (define-public f2fs-fsck/static
4675 (name "f2fs-fsck-static")
4676 (version (package-version f2fs-tools/static))
4678 (build-system trivial-build-system)
4680 `(#:modules ((guix build utils))
4683 (use-modules (guix build utils)
4686 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
4688 (out (assoc-ref %outputs "out"))
4689 (sbin (string-append out "/sbin")))
4691 (with-directory-excursion sbin
4692 (install-file (string-append f2fs-tools "/sbin/" fsck)
4694 (remove-store-references fsck)
4698 `(("f2fs-tools-static" ,f2fs-tools/static)))
4699 (home-page (package-home-page f2fs-tools/static))
4700 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
4701 (description "This package provides statically-linked fsck.f2fs command taken
4702 from the f2fs-tools package. It is meant to be used in initrds.")
4703 (license (package-license f2fs-tools/static))))
4705 (define-public freefall
4708 (version (package-version linux-libre))
4709 (source (package-source linux-libre))
4710 (build-system gnu-build-system)
4712 '(#:phases (modify-phases %standard-phases
4713 (add-after 'unpack 'enter-subdirectory
4715 (chdir "tools/laptop/freefall")
4718 (add-before 'build 'increase-timeout
4720 ;; The default of 2 seconds is too low: it assumes an
4721 ;; open lid and AC power without actually checking.
4722 (substitute* "freefall.c"
4723 (("alarm\\(2\\)") "alarm(5)"))
4725 #:make-flags (list (string-append "PREFIX="
4726 (assoc-ref %outputs "out"))
4728 #:tests? #f)) ;no tests
4729 (home-page (package-home-page linux-libre))
4730 (synopsis "Free-fall protection for spinning laptop hard drives")
4732 "Prevents shock damage to the internal spinning hard drive(s) of some
4733 HP and Dell laptops. When sudden movement is detected, all input/output
4734 operations on the drive are suspended and its heads are parked on the ramp,
4735 where they are less likely to cause damage to the spinning disc. Requires a
4736 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4737 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4738 (license license:gpl2)))
4740 (define-public thinkfan
4748 (url "https://github.com/vmatare/thinkfan.git")
4750 (file-name (git-file-name name version))
4752 (base32 "1fxd1w3z65glw6y04myn7ihgswkx6sqnkky159mik4n96pfrsvr5"))))
4753 (build-system cmake-build-system)
4755 `(#:modules ((guix build cmake-build-system)
4758 #:tests? #f ; no test target
4760 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4761 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4763 `("-DUSE_ATASMART:BOOL=ON")
4765 (modify-phases %standard-phases
4766 (add-after 'unpack 'create-init-scripts
4767 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4768 ;; systemd to patch and install their service files. Fake their
4769 ;; presence rather than duplicating the build system below. Leave
4770 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4771 ;; The sysvinit needs manual patching, but since upstream doesn't
4772 ;; even provide the option to install it: don't.
4773 (lambda* (#:key outputs #:allow-other-keys)
4774 (let* ((out (assoc-ref outputs "out"))
4775 (share (string-append out "/share/" ,name)))
4776 (substitute* "CMakeLists.txt"
4777 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4778 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
4779 ;; That was easy! Now we just need to fix the destinations.
4781 (string-append out directory)))
4784 `(("pkg-config" ,pkg-config)))
4786 `(("libatasmart" ,libatasmart)
4787 ("yaml-cpp" ,yaml-cpp)))
4788 (home-page "http://thinkfan.sourceforge.net/")
4789 (synopsis "Simple fan control program")
4791 "Thinkfan is a simple fan control program. It reads temperatures,
4792 checks them against configured limits and switches to appropriate (also
4793 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4794 other @code{hwmon} driver that enables temperature reading and fan control
4796 (license license:gpl3+)))
4798 (define-public tpacpi-bat
4806 (url "https://github.com/teleshoes/tpacpi-bat.git")
4807 (commit (string-append "v" version))))
4808 (file-name (git-file-name name version))
4810 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4811 (build-system gnu-build-system)
4813 `(#:tests? #f ; no test target
4815 (modify-phases %standard-phases
4816 (add-after 'unpack 'refer-to-inputs
4818 (substitute* "tpacpi-bat"
4820 (format #f "~a " (which "cat")))
4821 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4822 ;; loaded. That's the administrator's prerogative; disable it.
4823 (("system \"(modprobe .*)\"" _ match)
4824 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
4826 (delete 'configure) ; nothing to configure
4827 (delete 'build) ; nothing to build
4829 (lambda* (#:key outputs #:allow-other-keys)
4830 (let* ((out (assoc-ref outputs "out"))
4831 (bin (string-append out "/bin"))
4832 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4833 (install-file "tpacpi-bat" bin)
4835 ;; There's no man page. Install other forms of documentation.
4836 (for-each (lambda (file)
4837 (let ((target (string-append doc "/" file)))
4838 (mkdir-p (dirname target))
4839 (copy-recursively file target)))
4840 (list "battery_asl" "examples" "README.md"))
4844 (home-page "https://github.com/teleshoes/tpacpi-bat")
4845 (synopsis "ThinkPad battery charge controller")
4847 "Tpacpi-bat is a command-line interface to control battery charging on
4848 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4849 ThinkPad models released after 2011}, starting with the xx20 series. It can
4850 query and set the thresholds at which one or both batteries will start and stop
4851 charging, inhibit charging batteries for a set period of time, or force them to
4852 discharge when they otherwise would not.
4854 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4855 kernel module provided by the @code{acpi-call-linux-module} package, which must
4856 be installed and loaded separately. Only the original vendor firmware is
4858 (license license:gpl3+)))
4860 (define-public ntfs-3g
4863 (version "2017.3.23")
4866 (uri (string-append "https://tuxera.com/opensource/"
4867 "ntfs-3g_ntfsprogs-" version ".tgz"))
4868 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
4871 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
4872 (modules '((guix build utils)))
4874 ;; Install under $prefix.
4875 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4879 (build-system gnu-build-system)
4880 (inputs `(("util-linux" ,util-linux)
4881 ("fuse" ,fuse))) ;libuuid
4882 (native-inputs `(("pkg-config" ,pkg-config)))
4884 '(#:configure-flags (list "--exec-prefix=${prefix}"
4885 "--with-fuse=external" ;use our own FUSE
4886 "--enable-mount-helper"
4887 "--enable-posix-acls"
4888 "--enable-xattr-mappings")
4890 (modify-phases %standard-phases
4891 ;; If users install ntfs-3g, they probably want to make it the
4892 ;; default driver as well, so we opt for sensible defaults and link
4893 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
4894 ;; mount NTFS file systems.)
4895 (add-after 'install 'install-link
4896 (lambda* (#:key outputs #:allow-other-keys)
4897 (let* ((out (assoc-ref outputs "out"))
4898 (sbin (string-append out "/sbin")))
4899 (symlink "mount.ntfs-3g"
4900 (string-append sbin "/mount.ntfs")))
4902 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
4903 (synopsis "Read-write access to NTFS file systems")
4905 "NTFS-3G provides read-write access to NTFS file systems, which are
4906 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4907 The package provides additional NTFS tools.")
4908 (license license:gpl2+)))
4910 (define-public rdma-core
4916 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4917 "/releases/download/v" version "/rdma-core-"
4921 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
4922 (build-system cmake-build-system)
4924 `(#:tests? #f ; no tests
4925 ;; Upstream uses the "ninja" build system and encourage distros
4926 ;; to do the same for consistency. They also recommend using the
4927 ;; "Release" build type.
4928 #:build-type "Release"
4929 #:configure-flags (list "-GNinja"
4931 (string-append "-DRST2MAN_EXECUTABLE="
4932 (assoc-ref %build-inputs
4936 ;; On some configurations, the
4937 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
4938 ;; used by default, would return ENODEV. To
4939 ;; avoid that, use 'write' instead of ioctls,
4940 ;; as suggested in 'CMakeList.txt'.
4941 "-DIOCTL_MODE=write")
4943 (modify-phases %standard-phases
4947 "-j" (number->string (parallel-job-count)))))
4950 (invoke "ninja" "install"))))))
4953 ("pkg-config" ,pkg-config)
4954 ("python" ,python-wrapper)
4955 ("python-docutils" ,python-docutils))) ;for 'rst2man'
4959 (home-page "https://github.com/linux-rdma/rdma-core")
4960 (synopsis "Utilities and libraries for working with RDMA devices")
4962 "This package provides userspace components for the InfiniBand
4963 subsystem of the Linux kernel. Specifically it contains userspace
4964 libraries for the following device nodes:
4967 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4968 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4969 @item @file{/dev/infiniband/umadX} (@code{libibumad})
4972 The following service daemons are also provided:
4974 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4975 @item @code{iwpmd} (for iWARP kernel providers)
4976 @item @code{ibacm} (for InfiniBand communication management assistant)
4978 ;; All library code is dual licensed under GPL2 and a custom MIT
4979 ;; variant. The package also includes some components covered by
4980 ;; other licenses. Consult COPYING.md for full details.
4983 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4984 license:bsd-2 ; Files referring to COPYING.BSD_FB
4985 license:cc0 ; most files in ccan/
4986 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4988 (define-public perftest
4995 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4996 version "/perftest-" version ".g0927198.tar.gz"))
4998 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
4999 (build-system gnu-build-system)
5002 (modify-phases %standard-phases
5003 (add-after 'unpack 'patch-header-paths
5005 (substitute* '("src/raw_ethernet_fs_rate.c"
5006 "src/raw_ethernet_resources.c"
5007 "src/raw_ethernet_resources.h"
5008 "src/raw_ethernet_send_burst_lat.c"
5009 "src/raw_ethernet_send_bw.c"
5010 "src/raw_ethernet_send_lat.c")
5011 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5013 (inputs `(("rdma-core" ,rdma-core)))
5014 (home-page "https://github.com/linux-rdma/perftest/")
5015 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5016 (description "This is a collection of tests written over uverbs intended for
5017 use as a performance micro-benchmark. The tests may be used for hardware or
5018 software tuning as well as for functional testing.
5020 The collection contains a set of bandwidth and latency benchmark such as:
5022 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5023 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5024 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5025 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5026 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5028 (license license:gpl2)))
5030 (define-public rng-tools
5033 (home-page "https://github.com/nhorman/rng-tools")
5037 (uri (git-reference (url home-page)
5038 (commit (string-append "v" version))))
5039 (file-name (git-file-name name version))
5042 "065jf26s8zkicb95zc9ilksjdq9gqrh5vcx3mhi6mypbnamn6w98"))))
5043 (build-system gnu-build-system)
5045 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
5046 #:configure-flags '("--without-nistbeacon"
5047 "--without-pkcs11")))
5049 `(("autoconf" ,autoconf)
5050 ("automake" ,automake)
5051 ("pkg-config" ,pkg-config)))
5053 `(("libsysfs" ,sysfsutils)))
5054 (synopsis "Random number generator daemon")
5056 "Monitor a hardware random number generator, and supply entropy
5057 from that to the system kernel's @file{/dev/random} machinery.")
5058 ;; The source package is offered under the GPL2+, but the files
5059 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5060 (license (list license:gpl2 license:gpl2+))))
5062 (define-public cpupower
5065 (version (package-version linux-libre))
5066 (source (package-source linux-libre))
5067 (build-system gnu-build-system)
5069 '(#:phases (modify-phases %standard-phases
5070 (add-after 'unpack 'enter-subdirectory
5072 (chdir "tools/power/cpupower")
5075 (add-before 'build 'fix-makefiles
5077 (substitute* "Makefile"
5079 (("/bin/(install|pwd)" _ command) command))
5080 (substitute* "bench/Makefile"
5081 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5083 #:make-flags (let ((out (assoc-ref %outputs "out")))
5084 (list (string-append "DESTDIR=" out)
5085 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5087 "docdir=/share/doc/cpupower"
5088 "confdir=$(docdir)/examples"
5089 ;; The Makefile recommends the following changes
5091 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5092 #:tests? #f)) ;no tests
5093 (native-inputs `(("gettext" ,gettext-minimal)))
5094 (inputs `(("pciutils" ,pciutils)))
5095 (home-page (package-home-page linux-libre))
5096 (synopsis "CPU frequency and voltage scaling tools for Linux")
5098 "cpupower is a set of user-space tools that use the cpufreq feature of the
5099 Linux kernel to retrieve and control processor features related to power saving,
5100 such as frequency and voltage scaling.")
5101 (license license:gpl2)))
5103 (define-public x86-energy-perf-policy
5105 (name "x86-energy-perf-policy")
5106 (version (package-version linux-libre))
5107 (source (package-source linux-libre))
5108 (build-system gnu-build-system)
5112 (modify-phases %standard-phases
5113 (add-after 'unpack 'enter-subdirectory
5115 (chdir "tools/power/x86/x86_energy_perf_policy")
5118 (add-before 'build 'fix-makefile
5120 (substitute* "Makefile" (("/usr") ""))
5123 (let ((out (assoc-ref %outputs "out")))
5124 (list (string-append "DESTDIR=" out)
5125 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5126 (supported-systems '("i686-linux" "x86_64-linux"))
5127 (home-page (package-home-page linux-libre))
5128 (synopsis "Display and update Intel-CPU energy-performance policy")
5130 "@command{x86_energy_perf_policy} displays and updates energy-performance
5131 policy settings specific to Intel Architecture Processors. Settings are
5132 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5133 cpufreq sub-system is enabled or not.")
5134 (license license:gpl2)))
5136 (define-public haveged
5144 (url "https://github.com/jirka-h/haveged.git")
5145 (commit (string-append "v" version))))
5146 (file-name (git-file-name name version))
5148 (base32 "1znr58fb3faq4nmrvc3c5whkc1f3chivm4vhicdwr9pdsyqqsd51"))))
5149 (build-system gnu-build-system)
5150 (home-page "https://www.issihosts.com/haveged")
5151 (synopsis "Entropy source for the Linux random number generator")
5153 "haveged generates an unpredictable stream of random numbers for use by
5154 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5155 standard mechanisms for filling the entropy pool may not be sufficient for
5156 systems with high needs or limited user interaction, such as headless servers.
5158 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5159 indirect effects of hardware events on hidden processor state using the
5160 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5161 It tunes itself to its environment and provides the same built-in test suite
5162 for the output stream as used on certified hardware security devices.
5164 The quality of the randomness produced by this algorithm has not been proven.
5165 It is recommended to run it together with another entropy source like rngd, and
5166 not as a replacement for it.")
5167 (license (list (license:non-copyleft "file://nist/mconf.h")
5168 (license:non-copyleft "file://nist/packtest.c")
5169 license:public-domain ; nist/dfft.c
5170 license:gpl3+)))) ; everything else
5172 (define-public ecryptfs-utils
5174 (name "ecryptfs-utils")
5179 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5180 version "/+download/ecryptfs-utils_"
5181 version ".orig.tar.gz"))
5184 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5185 (build-system gnu-build-system)
5187 `(#:configure-flags (list "--disable-pywrap")
5189 (modify-phases %standard-phases
5190 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5191 (lambda* (#:key inputs outputs #:allow-other-keys)
5192 (let ((out (assoc-ref outputs "out"))
5193 (utils-linux (assoc-ref inputs "utils-linux"))
5194 (cryptsetup (assoc-ref inputs "cryptsetup"))
5195 (linux-pam (assoc-ref inputs "linux-pam"))
5196 (lvm2 (assoc-ref inputs "lvm2")))
5197 (substitute* '("src/utils/ecryptfs-mount-private"
5198 "src/utils/ecryptfs-umount-private"
5199 "src/utils/ecryptfs-setup-private"
5200 "src/utils/ecryptfs-setup-swap"
5201 "src/utils/mount.ecryptfs.c"
5202 "src/utils/umount.ecryptfs.c"
5203 "src/pam_ecryptfs/pam_ecryptfs.c"
5204 "src/desktop/ecryptfs-mount-private.desktop.in"
5205 "src/desktop/ecryptfs-setup-private.desktop.in")
5207 (string-append utils-linux "/bin/mount"))
5209 (string-append utils-linux "/bin/umount"))
5210 (("/sbin/mount.ecryptfs_private")
5211 (string-append out "/sbin/mount.ecryptfs_private"))
5212 (("/sbin/umount.ecryptfs_private")
5213 (string-append out "/sbin/umount.ecryptfs_private"))
5214 (("/usr/bin/ecryptfs-mount-private")
5215 (string-append out "/bin/ecryptfs-mount-private"))
5216 (("/usr/bin/ecryptfs-rewrite-file")
5217 (string-append out "/bin/ecryptfs-rewrite-file"))
5218 (("/usr/bin/ecryptfs-setup-private")
5219 (string-append out "/bin/ecryptfs-setup-private"))
5220 (("/sbin/cryptsetup")
5221 (string-append cryptsetup "/sbin/cryptsetup"))
5222 (("/sbin/unix_chkpwd")
5223 (string-append linux-pam "/sbin/unix_chkpwd"))
5225 (string-append lvm2 "/sbin/dmsetup")))))))))
5227 `(("intltool" ,intltool)
5228 ("perl" ,perl) ; for pod2man
5229 ("pkg-config" ,pkg-config)))
5231 `(("keyutils" ,keyutils)
5232 ("linux-pam" ,linux-pam)
5233 ("utils-linux" ,util-linux)
5234 ("cryptsetup" ,cryptsetup)
5237 (home-page "https://ecryptfs.org/")
5238 (synopsis "eCryptfs cryptographic file system utilities")
5240 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5241 Each file's cryptographic meta-data is stored inside the file itself, along
5242 with the encrypted contents. This allows individual encrypted files to be
5243 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5244 native Linux file system, and has been part of the Linux kernel since version
5245 2.6.19. This package contains the userland utilities to manage it.")
5246 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5247 ;; grant additional permission to link with OpenSSL.
5248 (license license:gpl2+)))
5250 (define-public libnfsidmap
5252 (name "libnfsidmap")
5257 (uri (string-append "https://fedorapeople.org/~steved/"
5258 name "/" version "/" name "-" version ".tar.bz2"))
5260 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5261 (build-system gnu-build-system)
5263 `(#:configure-flags (list
5264 (string-append "--with-pluginpath="
5265 (assoc-ref %outputs "out")
5266 "/lib/libnfsidmap"))))
5268 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5270 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5271 (synopsis "NFSv4 support library for name/ID mapping")
5272 (description "Libnfsidmap is a library holding mulitiple methods of
5273 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5274 extensible array of mapping functions, currently consisting of two choices:
5275 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5276 (license (license:non-copyleft "file://COPYING"
5277 "See COPYING in the distribution."))))
5279 (define-public module-init-tools
5281 (name "module-init-tools")
5286 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5287 "module-init-tools-" version ".tar.bz2"))
5290 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5291 (patches (search-patches "module-init-tools-moduledir.patch"))))
5292 (build-system gnu-build-system)
5294 ;; FIXME: The upstream tarball lacks man pages, and building them would
5295 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5296 ;; but they vanished. In the meantime, fake it.
5298 (modify-phases %standard-phases
5299 (add-before 'configure 'fake-docbook
5301 (substitute* "Makefile.in"
5302 (("^DOCBOOKTOMAN.*$")
5303 "DOCBOOKTOMAN = true\n"))
5305 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5306 (synopsis "Tools for loading and managing Linux kernel modules")
5308 "Tools for loading and managing Linux kernel modules, such as
5309 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5310 (license license:gpl2+)))
5312 (define-public mcelog
5318 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5319 "mcelog.git/snapshot/v" version ".tar.gz"))
5322 "1c4faayg1gcm3002b2fdrfnv76z92mvfzccvx8w9crjp0d17sp24"))
5323 (file-name (string-append name "-" version ".tar.gz"))
5324 (modules '((guix build utils)))
5327 ;; The snapshots lack a .git directory,
5328 ;; breaking ‘git describe’.
5329 (substitute* "Makefile"
5330 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5332 (build-system gnu-build-system)
5334 `(#:phases (modify-phases %standard-phases
5335 (delete 'configure)) ; no configure script
5336 #:make-flags (let ((out (assoc-ref %outputs "out")))
5338 (string-append "prefix=" out)
5339 (string-append "DOCDIR=" out "/share/doc/mcelog")
5340 "etcprefix=$(DOCDIR)/examples"))
5341 ;; The tests will only run as root on certain supported CPU models.
5343 (supported-systems (list "i686-linux" "x86_64-linux"))
5344 (home-page "https://mcelog.org/")
5345 (synopsis "Machine check monitor for x86 Linux systems")
5347 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
5348 and other hardware errors on x86 systems. It can also perform user-defined
5349 tasks, such as bringing bad pages off-line, when configurable error thresholds
5351 (license license:gpl2)))
5353 (define-public mtd-utils
5360 "ftp://ftp.infradead.org/pub/mtd-utils/"
5361 "mtd-utils-" version ".tar.bz2"))
5364 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
5366 '(#:configure-flags '("--enable-unit-tests")))
5368 `(("cmocka" ,cmocka)
5369 ("pkg-config" ,pkg-config)))
5371 `(("acl" ,acl) ; extended attributes (xattr)
5372 ("libuuid" ,util-linux)
5374 ("openssl" ,openssl) ; optional crypto support
5376 ("zstd" ,zstd "lib")))
5377 (build-system gnu-build-system)
5378 (synopsis "MTD Flash Storage Utilities")
5379 (description "This package provides utilities for testing, partitioning, etc
5381 (home-page "http://www.linux-mtd.infradead.org/")
5383 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5384 license:mpl1.1 ; All ftl* files
5385 license:expat)))) ; libiniparser
5387 (define-public libseccomp
5393 (uri (string-append "https://github.com/seccomp/libseccomp/"
5394 "releases/download/v" version
5395 "/libseccomp-" version ".tar.gz"))
5398 "07crwxqzvl5k2b90a47ii9wgvi09s9hsy5b5jddw9ylp351d25fg"))))
5399 (build-system gnu-build-system)
5401 `(("which" ,which)))
5402 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5403 (description "The libseccomp library provides an easy to use, platform
5404 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5405 libseccomp API is designed to abstract away the underlying BPF based syscall
5406 filter language and present a more conventional function-call based filtering
5407 interface that should be familiar to, and easily adopted by, application
5409 (home-page "https://github.com/seccomp/libseccomp")
5410 (license license:lgpl2.1)))
5412 (define-public radeontop
5420 (url "https://github.com/clbr/radeontop.git")
5421 (commit (string-append "v" version))))
5422 (file-name (git-file-name name version))
5424 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5425 (build-system gnu-build-system)
5427 `(#:phases (modify-phases %standard-phases
5428 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5429 ;; dependency, and doesn't even work on release(!) tarballs.
5430 (add-after 'unpack 'report-correct-version
5432 (substitute* "getver.sh"
5434 (string-append "ver=" ,version)))
5436 (delete 'configure)) ; no configure script
5437 #:make-flags (list "CC=gcc"
5438 (string-append "PREFIX=" %output))
5439 #:tests? #f)) ; no tests
5441 `(("gettext" ,gettext-minimal)
5442 ("pkg-config" ,pkg-config)))
5444 `(("libdrm" ,libdrm)
5445 ("libpciaccess" ,libpciaccess)
5447 ("ncurses" ,ncurses)))
5448 (home-page "https://github.com/clbr/radeontop/")
5449 (synopsis "Usage monitor for AMD Radeon graphics")
5450 (description "RadeonTop monitors resource consumption on supported AMD
5451 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5452 a terminal or saved to a file for further processing. It measures both the
5453 activity of the GPU as a whole, which is also accurate during OpenCL
5454 computations, as well as separate component statistics that are only meaningful
5455 under OpenGL graphics workloads.")
5456 (license license:gpl3)))
5458 (define-public efivar
5464 (uri (string-append "https://github.com/rhboot/" name
5465 "/releases/download/" version "/" name
5466 "-" version ".tar.bz2"))
5469 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5470 (build-system gnu-build-system)
5472 `(;; Tests require a UEFI system and is not detected in the chroot.
5474 #:make-flags (list (string-append "prefix=" %output)
5475 (string-append "libdir=" %output "/lib")
5477 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5479 (modify-phases %standard-phases
5481 (add-before 'build 'kernel-headers-are-system-headers
5482 (lambda* (#:key inputs #:allow-other-keys)
5483 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
5484 ;; Make sure the kernel headers are treated as system headers
5485 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
5486 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
5489 `(("pkg-config" ,pkg-config)))
5492 (home-page "https://github.com/rhboot/efivar")
5493 (synopsis "Tool and library to manipulate EFI variables")
5494 (description "This package provides a library and a command line
5495 interface to the variable facility of UEFI boot firmware.")
5496 (license license:lgpl2.1+)))
5498 (define-public efibootmgr
5504 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5505 "/releases/download/" version "/efibootmgr"
5506 "-" version ".tar.bz2"))
5509 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5510 (build-system gnu-build-system)
5512 `(#:tests? #f ;no tests
5513 #:make-flags (list (string-append "prefix=" %output)
5514 (string-append "libdir=" %output "/lib")
5515 ;; EFIDIR denotes a subdirectory relative to the
5516 ;; EFI System Partition where the loader will be
5517 ;; installed (known as OS_VENDOR in the code).
5518 ;; GRUB overrides this, as such it's only used if
5519 ;; nothing else is specified on the command line.
5521 ;; Treat kernel headers as system headers to prevent
5522 ;; warnings about conflicting types.
5523 (string-append "C_INCLUDE_PATH="
5524 (assoc-ref %build-inputs "kernel-headers")
5526 #:phases (modify-phases %standard-phases (delete 'configure))))
5528 `(("pkg-config" ,pkg-config)))
5530 `(("efivar" ,efivar)
5532 (home-page "https://github.com/rhinstaller/efibootmgr")
5533 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5535 "@code{efibootmgr} is a user-space application to modify the Intel
5536 Extensible Firmware Interface (EFI) Boot Manager. This application can
5537 create and destroy boot entries, change the boot order, change the next
5538 running boot option, and more.")
5539 (license license:gpl2+)))
5541 (define-public sysstat
5547 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5548 "sysstat-" version ".tar.xz"))
5551 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
5552 (build-system gnu-build-system)
5554 `(#:tests? #f ; No test suite.
5555 ;; Without this flag, it tries to install the man pages with group 'root'
5556 ;; and fails because /etc/passwd lacks an entry for the root user.
5558 (list "--disable-file-attr"
5559 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5561 (modify-phases %standard-phases
5562 ;; The build process tries to create '/var/lib/sa', so we skip that
5564 (add-after 'build 'skip-touching-var
5566 (substitute* "Makefile"
5567 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5570 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5571 (synopsis "Performance monitoring tools for Linux")
5572 (description "The sysstat utilities are a collection of performance
5573 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5574 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5575 @code{sadf} and @code{sa}.")
5576 (license license:gpl2+)))
5578 (define-public light
5586 (url "https://github.com/haikarainen/light.git")
5587 (commit (string-append "v" version))))
5589 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
5590 (file-name (git-file-name name version))))
5591 (build-system gnu-build-system)
5594 (modify-phases %standard-phases
5595 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5596 (lambda* (#:key inputs #:allow-other-keys)
5597 (substitute* "90-backlight.rules"
5598 (("/bin/chgrp") (which "chgrp"))
5599 (("/bin/chmod") (which "chmod")))
5601 (add-after 'install 'install-udev-rules
5602 (lambda* (#:key outputs #:allow-other-keys)
5603 (let ((out (assoc-ref outputs "out")))
5605 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5608 `(("autoconf" ,autoconf)
5609 ("automake" ,automake)))
5610 (home-page "https://haikarainen.github.io/light/")
5611 (synopsis "GNU/Linux application to control backlights")
5613 "Light is a program to send commands to screen backlight controllers
5614 under GNU/Linux. Features include:
5617 @item It does not rely on X.
5618 @item Light can automatically figure out the best controller to use, making
5619 full use of underlying hardware.
5620 @item It is possible to set a minimum brightness value, as some controllers
5621 set the screen to be pitch black at a vaĺue of 0 (or higher).
5624 Light is the successor of lightscript.")
5625 (license license:gpl3+)))
5627 (define-public brightnessctl
5628 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5630 (name "brightnessctl")
5631 (version (git-version "0.4" "0" commit))
5635 (url "https://github.com/Hummer12007/brightnessctl/")
5637 (file-name (git-file-name name version))
5640 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5641 (build-system gnu-build-system)
5643 '(#:tests? #f ; no tests
5644 #:make-flags (list "CC=gcc"
5645 (string-append "PREFIX=" %output)
5646 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5648 (modify-phases %standard-phases
5650 (add-after 'unpack 'adjust-udev-rules
5652 (substitute* "90-brightnessctl.rules"
5653 (("/bin/") "/run/current-system/profile/bin/"))
5655 (home-page "https://github.com/Hummer12007/brightnessctl")
5656 (synopsis "Backlight and LED brightness control")
5658 "This program allows you read and control device brightness. Devices
5659 include backlight and LEDs. It can also preserve current brightness before
5660 applying the operation, such as on lid close.
5662 The appropriate permissions must be set on the backlight or LED control
5663 interface in sysfs, which can be accomplished with the included udev rules.")
5664 (license license:expat))))
5674 (url "https://github.com/linrunner/TLP.git")
5676 (file-name (git-file-name name version))
5678 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
5680 `(("shellcheck" ,shellcheck)))
5684 ("ethtool" ,ethtool)
5688 ("inetutils" ,inetutils)
5691 ("pciutils" ,pciutils)
5695 ("usbutils" ,usbutils)
5696 ("util-linux" ,util-linux)
5697 ("wireless-tools" ,wireless-tools)
5698 ,@(if (let ((system (or (%current-target-system)
5699 (%current-system))))
5700 (or (string-prefix? "i686-" system)
5701 (string-prefix? "x86_64-" system)))
5702 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5704 (build-system gnu-build-system)
5706 ;; XXX: The full test suite is run with "checkall" but it requires
5707 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
5708 `(#:test-target "shellcheck"
5709 #:modules ((guix build gnu-build-system)
5713 (modify-phases %standard-phases
5714 (delete 'configure) ; no configure script
5715 (add-before 'build 'setenv
5716 (lambda* (#:key outputs #:allow-other-keys)
5717 (let ((out (assoc-ref outputs "out")))
5718 (setenv "TLP_WITH_SYSTEMD" "0")
5719 (setenv "TLP_NO_INIT" "1")
5720 (setenv "TLP_NO_PMUTILS" "1")
5721 (setenv "TLP_SBIN" (string-append out "/bin"))
5722 (setenv "TLP_BIN" (string-append out "/bin"))
5723 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5724 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5725 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5726 (setenv "TLP_CONFDEF"
5727 (string-append out "/share/tlp/defaults.conf"))
5728 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
5730 (string-append out "/lib/elogind/system-sleep"))
5732 (string-append out "/share/bash-completion/completions"))
5733 (setenv "TLP_MAN" (string-append out "/share/man"))
5734 (setenv "TLP_META" (string-append out "/share/metainfo"))
5736 (add-before 'install 'fix-installation
5738 ;; Stop the Makefile from trying to create system directories.
5739 (substitute* "Makefile"
5740 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
5741 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5744 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
5745 (add-after 'install 'wrap
5746 (lambda* (#:key inputs outputs #:allow-other-keys)
5747 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5748 (bin-files (find-files bin ".*")))
5749 (define (bin-directory input-name)
5750 (let ((p (assoc-ref inputs input-name)))
5751 (and p (string-append p "/bin"))))
5752 (define (sbin-directory input-name)
5753 (string-append (assoc-ref inputs input-name) "/sbin"))
5754 (for-each (lambda (program)
5755 (wrap-program program
5758 (filter-map bin-directory
5770 "x86-energy-perf-policy"))
5771 (filter-map sbin-directory
5777 "wireless-tools"))))))
5780 (home-page "https://linrunner.de/en/tlp/tlp.html")
5781 (synopsis "Power management tool for Linux")
5782 (description "TLP is a power management tool for Linux. It comes with
5783 a default configuration already optimized for battery life. Nevertheless,
5784 TLP is customizable to fulfil system requirements. TLP settings are applied
5785 every time the power supply source is changed.")
5786 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5788 (license (list license:gpl2+ license:gpl3+))))
5796 (uri (string-append "https://www.ezix.org/software/"
5797 "files/lshw-" version
5801 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5802 (build-system gnu-build-system)
5804 `(#:phases (modify-phases %standard-phases (delete 'configure))
5805 #:tests? #f ; no tests
5807 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5808 (synopsis "List hardware information")
5810 "@command{lshw} (Hardware Lister) is a small tool to provide
5811 detailed information on the hardware configuration of the machine.
5812 It can report exact memory configuration, firmware version, mainboard
5813 configuration, CPU version and speed, cache configuration, bus speed,
5814 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5815 machines (PowerMac G4 is known to work).")
5816 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5817 (license license:gpl2+)))
5819 (define-public libmnl
5826 (uri (string-append "mirror://netfilter.org/libmnl/"
5827 "libmnl-" version ".tar.bz2"))
5830 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5831 (build-system gnu-build-system)
5832 (home-page "https://www.netfilter.org/projects/libmnl/")
5833 (synopsis "Netlink utility library")
5834 (description "Libmnl is a minimalistic user-space library oriented to
5835 Netlink developers. There are a lot of common tasks in parsing, validating,
5836 constructing of both the Netlink header and TLVs that are repetitive and easy to
5837 get wrong. This library aims to provide simple helpers that allows you to
5838 re-use code and to avoid re-inventing the wheel.")
5839 (license license:lgpl2.1+)))
5841 (define-public libnftnl
5848 (uri (string-append "mirror://netfilter.org/libnftnl/"
5849 "libnftnl-" version ".tar.bz2"))
5851 (base32 "1wqlxf76bkqf3qhka9sw32qhb2ni20q1k6rn3iril2kw482lvpk6"))
5853 (search-patches "libnftnl-dont-check-NFTNL_FLOWTABLE_SIZE.patch"))))
5854 (build-system gnu-build-system)
5856 `(("pkg-config" ,pkg-config)))
5858 `(("libmnl" ,libmnl)))
5859 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5860 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5861 (description "Libnftnl is a userspace library providing a low-level netlink
5862 programming interface to the in-kernel nf_tables subsystem. The library
5863 libnftnl has been previously known as libnftables. This library is currently
5865 (license license:gpl2+)))
5867 (define-public nftables
5874 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
5876 (string-append "https://www.nftables.org/projects/nftables"
5877 "/files/nftables-" version ".tar.bz2")))
5879 (base32 "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm"))))
5880 (build-system gnu-build-system)
5881 (arguments `(#:configure-flags
5882 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5883 (inputs `(("gmp" ,gmp)
5885 ("libnftnl" ,libnftnl)
5886 ("readline" ,readline)))
5887 (native-inputs `(("pkg-config" ,pkg-config)
5890 (home-page "https://www.nftables.org")
5891 (synopsis "Userspace utility for Linux packet filtering")
5892 (description "nftables is the project that aims to replace the existing
5893 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5894 filtering framework, a new userspace utility and also a compatibility layer for
5895 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5896 infrastructure such as the existing hooks, the connection tracking system, the
5897 userspace queueing component and the logging subsystem.")
5898 (license license:gpl2)))
5900 (define-public proot
5908 (url "https://github.com/proot-me/PRoot.git")
5909 (commit (string-append "v" version))))
5910 (file-name (git-file-name name version))
5912 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5913 (patches (search-patches "proot-test-fhs.patch"))))
5914 (build-system gnu-build-system)
5916 '(#:make-flags '("-C" "src")
5918 #:phases (modify-phases %standard-phases
5920 (add-before 'build 'set-shell-file-name
5921 (lambda* (#:key inputs #:allow-other-keys)
5922 (substitute* (find-files "src" "\\.[ch]$")
5925 (assoc-ref inputs "bash")
5928 (add-before 'check 'fix-fhs-assumptions-in-tests
5930 (substitute* "tests/test-c6b77b77.mk"
5931 (("/bin/bash") (which "bash"))
5932 (("/usr/bin/test") (which "test")))
5933 (substitute* '("tests/test-16573e73.c")
5934 (("/bin/([a-z-]+)" _ program)
5937 (substitute* (find-files "tests" "\\.sh$")
5938 ;; Some of the tests try to "bind-mount" /bin/true.
5940 (string-append "-b " (which "true") ":"))
5941 ;; Likewise for /bin.
5942 (("-b /bin:") "-b /gnu:")
5943 ;; Others try to run /bin/sh.
5944 (("/bin/sh") (which "sh"))
5945 ;; Others assume /etc/fstab exists.
5946 (("/etc/fstab") "/etc/passwd"))
5948 (substitute* "tests/GNUmakefile"
5949 (("-b /bin:") "-b /gnu:"))
5951 ;; XXX: This test fails in an obscure corner case, just
5953 (delete-file "tests/test-kkkkkkkk.c")
5958 (let ((n (parallel-job-count)))
5959 ;; For some reason we get lots of segfaults with
5960 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5961 (setenv "PROOT_NO_SECCOMP" "1")
5963 ;; Most of the tests expect "/bin" to be in $PATH so
5964 ;; they can run things that live in $ROOTFS/bin.
5966 (string-append (getenv "PATH") ":/bin"))
5968 (invoke "make" "check" "-C" "tests"
5970 "-j" (number->string n)))))
5972 (lambda* (#:key outputs #:allow-other-keys)
5973 ;; The 'install' rule does nearly nothing.
5974 (let* ((out (assoc-ref outputs "out"))
5975 (man1 (string-append out "/share/man/man1")))
5976 ;; TODO: 'make install-care' (does not even
5977 ;; build currently.)
5978 (invoke "make" "-C" "src" "install"
5979 (string-append "PREFIX=" out))
5982 (copy-file "doc/proot/man.1"
5983 (string-append man1 "/proot.1"))
5985 (native-inputs `(("which" ,which)
5987 ;; For 'mcookie', used by some of the tests.
5988 ("util-linux" ,util-linux)))
5989 (inputs `(("talloc" ,talloc)))
5990 (home-page "https://github.com/proot-me/PRoot")
5991 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5993 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5994 and @code{binfmt_misc}. This means that users don't need any privileges or
5995 setup to do things like using an arbitrary directory as the new root
5996 file system, making files accessible somewhere else in the file system
5997 hierarchy, or executing programs built for another CPU architecture
5998 transparently through QEMU user-mode. Also, developers can use PRoot as a
5999 generic process instrumentation engine thanks to its extension mechanism.
6000 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6001 available in the kernel Linux.")
6002 (license license:gpl2+)))
6004 (define-public proot-static
6007 (name "proot-static")
6009 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6010 (inputs `(("talloc" ,talloc/static)))
6012 (substitute-keyword-arguments (package-arguments proot)
6013 ((#:make-flags flags)
6014 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6016 `(modify-phases ,phases
6017 (add-after 'strip 'remove-store-references
6018 (lambda* (#:key outputs #:allow-other-keys)
6019 (let* ((out (assoc-ref outputs "out")))
6020 (with-directory-excursion out
6021 (remove-store-references "bin/proot")
6023 ((#:allowed-references _ '("out"))
6026 (define-public cpuid
6029 (version "20200211")
6032 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6033 version ".src.tar.gz"))
6036 "06sjbqqp80l7nhsp6khglkzdp9qy4vhbvjxbfilznhsmrqiwlw55"))))
6037 (build-system gnu-build-system)
6039 '(#:make-flags '("CC=gcc")
6040 #:tests? #f ; no tests
6041 #:phases (modify-phases %standard-phases
6042 (delete 'configure) ; no configure script
6043 (add-before 'install 'fix-makefile
6044 (lambda* (#:key outputs #:allow-other-keys)
6045 (substitute* "Makefile"
6046 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6047 ;; Make the compressed manpages writable so that the
6048 ;; reset-gzip-timestamps phase does not error out.
6049 (substitute* "Makefile"
6050 (("-m 444") "-m 644"))
6052 (inputs `(("perl" ,perl)))
6053 (supported-systems '("i686-linux" "x86_64-linux"))
6054 (home-page "http://www.etallen.com/cpuid.html")
6055 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6056 (description "cpuid dumps detailed information about the CPU(s) gathered
6057 from the CPUID instruction, and also determines the exact model of CPU(s). It
6058 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6059 NexGen, Rise, and SiS CPUs.")
6060 (license license:gpl2+)))
6062 (define-public jmtpfs
6069 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
6071 (file-name (string-append name "-" version ".tar.gz"))
6074 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
6075 (build-system gnu-build-system)
6079 ("libmtp" ,libmtp)))
6081 `(("pkg-config" ,pkg-config)))
6082 (home-page "https://github.com/JasonFerrara/jmtpfs")
6083 (synopsis "Use a FUSE file system to access data over MTP")
6084 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6085 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6086 the MTP device as a file system.")
6087 (license license:gpl3)))
6089 (define-public procenv
6096 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
6098 (file-name (string-append name "-" version ".tar.gz"))
6100 (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
6101 (build-system gnu-build-system)
6102 (arguments `(#:configure-flags '("--disable-silent-rules")))
6103 (native-inputs `(("groff" ,groff) ; for tests
6104 ("pkg-config" ,pkg-config)))
6105 (inputs `(("check" ,check)
6108 ("libselinux" ,libselinux)))
6109 (synopsis "Utility to show process environment")
6110 (description "Procenv is a command-line tool that displays as much detail about
6111 itself and its environment as possible. It can be used as a test
6112 tool, to understand the type of environment a process runs in, and for
6113 comparing system environments.")
6114 (home-page "http://github.com/jamesodhunt/procenv/")
6115 (license license:gpl3+)))
6117 (define-public libfabric
6125 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6126 version "/libfabric-" version ".tar.bz2"))
6128 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
6129 (build-system gnu-build-system)
6130 (inputs `(("rdma-core" ,rdma-core)
6131 ,@(match (%current-system)
6132 ((member (package-supported-systems psm))
6136 (home-page "https://ofiwg.github.io/libfabric/")
6137 (synopsis "Open Fabric Interfaces")
6139 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6140 communication services to applications. OFI is best described as a collection
6141 of libraries and applications used to export fabric services. The key
6142 components of OFI are: application interfaces, provider libraries, kernel
6143 services, daemons, and test applications.
6145 Libfabric is a core component of OFI. It is the library that defines and
6146 exports the user-space API of OFI, and is typically the only software that
6147 applications deal with directly. It works in conjunction with provider
6148 libraries, which are often integrated directly into libfabric.")
6149 (license (list license:bsd-2 license:gpl2)))) ;dual
6154 (version "3.3.20170428")
6155 (home-page "https://github.com/intel/psm")
6159 (uri (git-reference (url home-page)
6160 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6161 (file-name (string-append "psm-" version ".tar.gz"))
6163 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6164 (patches (search-patches
6165 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6166 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6167 "psm-repro.patch" ; reproducibility
6168 "psm-disable-memory-stats.patch"))))
6169 (build-system gnu-build-system)
6170 (outputs '("out" "debug"))
6171 (inputs `(("libuuid" ,util-linux)))
6173 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6174 ,(string-append "INSTALL_PREFIX=" %output)
6175 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6177 #:phases (modify-phases %standard-phases
6179 (add-after 'unpack 'patch-/usr/include
6181 (substitute* "Makefile"
6182 (("\\$\\{DESTDIR}/usr/include")
6183 (string-append %output "/include")))
6184 (substitute* "Makefile"
6185 (("/lib64") "/lib"))
6187 (add-after 'unpack 'patch-sysmacros
6189 (substitute* "ipath/ipath_proto.c"
6190 (("#include <sys/poll.h>" m)
6191 (string-append m "\n"
6192 "#include <sys/sysmacros.h>")))
6194 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6196 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6197 communications interface for the True Scale family of products. PSM users are
6198 enabled with mechanisms necessary to implement higher level communications
6199 interfaces in parallel environments.")
6200 ;; Only Intel-compatable processors are supported.
6201 (supported-systems '("i686-linux" "x86_64-linux"))
6202 (license (list license:bsd-2 license:gpl2)))) ;dual
6204 (define-public snapscreenshot
6206 (name "snapscreenshot")
6207 (version "1.0.14.3")
6211 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6212 name "-" version ".tar.bz2"))
6214 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6215 (build-system gnu-build-system)
6218 (let ((out (assoc-ref %outputs "out")))
6219 (list (string-append "BINDIR=" out "/bin")
6220 (string-append "MANDIR=" out "/share/man")))
6221 #:tests? #f ; no test suite
6223 (modify-phases %standard-phases
6224 (delete 'configure) ; ./configure is a snarky no-op
6225 (add-before 'install 'fix-ownership
6226 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6228 (substitute* "depfun.mak"
6229 ((" -o bin -g bin ") " "))
6231 (add-before 'install 'create-output-directories
6232 (lambda* (#:key outputs #:allow-other-keys)
6233 (let ((out (assoc-ref outputs "out")))
6234 (mkdir-p (string-append out "/share/man/man1"))
6236 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6237 (synopsis "Take screenshots of one or more Linux text consoles")
6239 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6240 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6241 relevant @file{/dev/vcs*} file(s).")
6242 (license license:gpl2)))
6244 (define-public fbcat
6251 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6252 version "/" name "-" version ".tar.gz"))
6254 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6255 (build-system gnu-build-system)
6257 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6258 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6259 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6260 `(("pnmtopng" ,netpbm)))
6261 (outputs (list "out" "fbgrab"))
6265 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6266 #:tests? #f ; no tests
6268 (modify-phases %standard-phases
6269 (delete 'configure) ; no configure script
6270 (add-after 'build 'qualify-references
6271 (lambda* (#:key inputs outputs #:allow-other-keys)
6272 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6273 (out (assoc-ref outputs "out")))
6274 (substitute* "fbgrab"
6276 (string-append out "/bin/" all))
6278 (string-append pnmtopng "/bin/" all)))
6280 (add-after 'install 'split-fbgrab-output
6281 (lambda* (#:key outputs #:allow-other-keys)
6282 (let* ((out (assoc-ref outputs "out"))
6283 (out:fbgrab (assoc-ref outputs "fbgrab")))
6284 (for-each (lambda (file)
6285 (let ((old (string-append out "/" file))
6286 (new (string-append out:fbgrab "/" file)))
6287 (mkdir-p (dirname new))
6288 (rename-file old new)))
6290 "share/man/man1/fbgrab.1"))
6292 (home-page "https://jwilk.net/software/fbcat")
6293 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6295 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6296 a dump therof. It supports a wide range of drivers and pixel formats.
6297 @command{fbcat} can take screenshots of virtually any application that can be
6298 made to write its output to the framebuffer, including (but not limited to)
6299 text-mode or graphical applications that don't use a display server.
6301 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6302 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6303 (license license:gpl2)))
6305 (define-public libcgroup
6313 "mirror://sourceforge/libcg/" name "/"
6314 version "/" name "-" version ".tar.bz2"))
6316 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6317 (build-system gnu-build-system)
6324 `(("linux-pam" ,linux-pam)))
6325 (home-page "https://sourceforge.net/projects/libcg/")
6326 (synopsis "Control groups management tools")
6327 (description "Control groups is Linux kernel method for process resource
6328 restriction, permission handling and more. This package provides userspace
6329 interface to this kernel feature.")
6330 (license license:lgpl2.1)))
6332 (define-public mbpfan
6340 (url "https://github.com/dgraziotin/mbpfan.git")
6341 (commit (string-append "v" version))))
6342 (file-name (git-file-name name version))
6344 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6345 (build-system gnu-build-system)
6347 '(#:tests? #f ; tests ask to be run as root
6348 #:make-flags (let ((out (assoc-ref %outputs "out")))
6349 (list (string-append "DESTDIR=" out)
6352 (modify-phases %standard-phases
6353 (add-after 'unpack 'patch-paths
6355 (substitute* "Makefile"
6358 (delete 'configure)))) ; there's no configure phase
6359 (home-page "https://github.com/dgraziotin/mbpfan")
6360 (synopsis "Control fan speed on Macbooks")
6362 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6363 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6364 module. It can be executed as a daemon or in the foreground with root
6366 (license license:gpl3+)))
6375 (url "https://github.com/intel/opa-psm2.git")
6376 (commit (string-append "PSM2_" version))))
6377 (file-name (git-file-name name version))
6380 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6381 (build-system gnu-build-system)
6384 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6386 #:phases (modify-phases %standard-phases
6388 (add-after 'unpack 'patch-Makefiles
6390 (substitute* "Makefile"
6393 (substitute* "compat/Makefile"
6399 (setenv "DESTDIR" %output)
6400 (invoke "make" "install")
6403 `(("rdma-core" ,rdma-core)
6404 ("numactl" ,numactl)))
6405 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6407 "This package is low-level user-level Intel's communications interface.
6408 The PSM2 API is a high-performance vendor-specific protocol that provides a
6409 low-level communications interface for the Intel Omni-Path family of
6410 high-speed networking devices.")
6411 (home-page "https://github.com/intel/opa-psm2")
6412 ;; Only the x86_64 architecure is supported.
6413 (supported-systems '("x86_64-linux"))
6414 (license (list license:bsd-3 license:gpl2)))) ; dual
6416 (define-public libpfm4
6422 (uri (string-append "mirror://sourceforge/perfmon2/"
6423 name "/libpfm-" version ".tar.gz"))
6426 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6427 (build-system gnu-build-system)
6429 '(#:modules ((guix build utils)
6430 (guix build gnu-build-system))
6431 #:phases (modify-phases %standard-phases
6435 (lambda* (#:key inputs outputs #:allow-other-keys)
6436 (let* ((out (assoc-ref outputs "out")))
6441 (lambda* (#:key outputs #:allow-other-keys)
6442 (let* ((out (assoc-ref outputs "out")))
6444 (string-append "PREFIX=" out)
6447 (synopsis "Performance event monitoring library")
6449 "This package provides a library called libpfm4, which is used to develop
6450 monitoring tools exploiting the performance monitoring events such as those
6451 provided by the Performance Monitoring Unit (PMU) of modern processors.
6453 Libpfm4 helps convert from an event name, expressed as a string, to the event
6454 encoding that is either the raw event as documented by the hardware vendor or
6455 the OS-specific encoding. In the latter case, the library is able to prepare
6456 the OS-specific data structures needed by the kernel to setup the event.
6458 libpfm4 provides support for the @code{perf_events} interface, which was
6459 introduced in Linux 2.6.31.")
6460 (home-page "http://perfmon2.sourceforge.net/")
6461 (license license:expat)))
6463 (define-public libnfnetlink
6465 (name "libnfnetlink")
6470 "https://www.netfilter.org/projects/libnfnetlink/files/"
6471 "libnfnetlink-" version ".tar.bz2"))
6474 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6475 (build-system gnu-build-system)
6476 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6477 (synopsis "Low-level netfilter netlink communication library")
6479 "@code{libnfnetlink} is the low-level library for netfilter related
6480 kernel/userspace communication. It provides a generic messaging
6481 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6482 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6483 management tools in userspace.")
6484 (license license:gpl2)))
6486 (define-public go-netlink
6493 (url "https://github.com/vishvananda/netlink.git")
6494 (commit (string-append "v" version))))
6495 (file-name (git-file-name name version))
6498 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6499 (build-system go-build-system)
6501 `(#:import-path "github.com/vishvananda/netlink"))
6503 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6504 ("go-netns" ,go-netns)))
6505 (home-page "https://github.com/vishvananda/netlink")
6506 (synopsis "Simple netlink library for Go")
6507 (description "The netlink package provides a simple netlink library for
6508 Go. Netlink is the interface a user-space program in Linux uses to
6509 communicate with the kernel. It can be used to add and remove interfaces, set
6510 IP addresses and routes, and configure IPsec.")
6511 (license license:asl2.0)))
6513 (define-public xfsprogs
6520 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6521 "xfsprogs-" version ".tar.gz"))
6524 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
6525 (build-system gnu-build-system)
6526 (outputs (list "out" "python"))
6528 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6530 (modify-phases %standard-phases
6531 (add-after 'install 'separate-python-output
6532 (lambda* (#:key outputs #:allow-other-keys)
6533 (let ((out (assoc-ref outputs "out"))
6534 (python (assoc-ref outputs "python")))
6537 (mkdir-p (string-append python (dirname script)))
6538 (rename-file (string-append out script)
6539 (string-append python script)))
6540 (list "/sbin/xfs_scrub_all"))
6542 (add-after 'install 'install-headers
6544 (invoke "make" "install-dev"))))))
6546 `(("gettext" ,gettext-minimal)))
6548 `(("libuuid" ,util-linux)
6549 ("python" ,python-wrapper)))
6550 (home-page "https://xfs.wiki.kernel.org/")
6551 (synopsis "XFS file system tools")
6552 (description "This package provides commands to create and check XFS
6554 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6555 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6556 (license (list license:gpl2 license:lgpl2.1))))
6558 (define-public genext2fs
6565 (url "https://github.com/jeremie-koenig/genext2fs.git")
6566 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6567 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6568 (file-name (git-file-name name version))
6570 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6571 (build-system gnu-build-system)
6574 (modify-phases %standard-phases
6575 (add-after 'unpack 'apply-debian-patches
6576 ;; Debian changes (the revision after ‘-’ in VERSION) are
6577 ;; maintained as separate patches. Apply those relevant to us.
6581 (invoke "patch" "-p1" "-i"
6582 (string-append "debian/patches/" file-name)))
6583 (list "blocksize+creator.diff" ; add -B/-o options
6584 "byteswap_fix.diff"))
6587 `(("autoconf" ,autoconf)
6588 ("automake" ,automake)))
6589 (home-page "https://github.com/jeremie-koenig/genext2fs")
6590 (synopsis "Generate ext2 file system as a normal user")
6591 (description "This package provides a program to generate an ext2
6592 file system as a normal (non-root) user. It does not require you to mount
6593 the image file to copy files on it, nor does it require that you become
6594 the superuser to make device nodes.")
6595 (license license:gpl2)))
6597 (define-public fakeroot
6603 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6604 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6605 (file-name (string-append name "-" version ".tar.gz"))
6608 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6609 (build-system gnu-build-system)
6612 (modify-phases %standard-phases
6613 (add-after 'configure 'patch-Makefile
6615 ;; Note: The root of the problem is already in "Makefile.am".
6616 (substitute* "Makefile"
6617 (("/bin/sh") (which "sh")))
6619 (add-after 'unpack 'patch-getopt
6620 (lambda* (#:key inputs #:allow-other-keys)
6621 (substitute* "scripts/fakeroot.in"
6623 (string-append (assoc-ref inputs "util-linux")
6626 (add-before 'configure 'setenv
6628 (setenv "LIBS" "-lacl")
6630 (add-before 'check 'prepare-check
6632 (setenv "SHELL" (which "bash"))
6633 (setenv "VERBOSE" "1")
6634 (substitute* "test/t.touchinstall"
6635 ;; We don't have the name of the root user, so use ID=0.
6636 (("grep root") "grep \"\\<0\\>\""))
6637 (substitute* "test/tartest"
6638 ;; We don't have the name of the root group, so use ID=0.
6639 (("ROOTGROUP=root") "ROOTGROUP=0")
6640 ;; We don't have the name of the daemon user, so use IDs.
6641 (("daemon:sys") "1:3")
6643 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6644 (substitute* "test/compare-tar"
6645 (("tar -tvf") "tar --numeric-owner -tvf"))
6649 ("sharutils" ,sharutils) ; for the tests
6650 ("xz" ,xz))) ; for the tests
6652 `(("libcap" ,libcap)
6653 ("util-linux" ,util-linux)))
6654 (synopsis "Provides a fake root environment")
6655 (description "@command{fakeroot} runs a command in an environment where
6656 it appears to have root privileges for file manipulation. This is useful
6657 for allowing users to create archives (tar, ar, .deb etc.) with files in
6658 them with root permissions/ownership. Without fakeroot one would have to
6659 have root privileges to create the constituent files of the archives with
6660 the correct permissions and ownership, and then pack them up, or one would
6661 have to construct the archives directly, without using the archiver.")
6662 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6663 (license license:gpl3+)))
6665 (define-public inputattach
6667 (name "inputattach")
6672 (url "https://github.com/linuxwacom/input-wacom.git")
6673 (commit (string-append "input-wacom-" version))))
6674 (file-name (git-file-name name version))
6676 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6677 (build-system gnu-build-system)
6680 (modify-phases %standard-phases
6684 (lambda* (#:key inputs #:allow-other-keys)
6685 (with-directory-excursion "inputattach"
6686 (invoke (string-append (assoc-ref inputs "gcc")
6688 "-O2" "-o" "inputattach" "inputattach.c"))
6692 (lambda* (#:key outputs #:allow-other-keys)
6693 (let ((target-dir (string-append
6694 (assoc-ref outputs "out")
6696 (mkdir-p target-dir)
6697 (copy-file "inputattach/inputattach"
6698 (string-append target-dir
6701 (home-page "https://linuxwacom.github.io/")
6702 (synopsis "Dispatch input peripherals events to a device file")
6703 (description "inputattach dispatches input events from several device
6704 types and interfaces and translates so that the X server can use them.")
6705 (license license:gpl2+)))
6707 (define-public pipewire
6714 (url "https://github.com/PipeWire/pipewire")
6716 (file-name (git-file-name name version))
6719 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
6720 (build-system meson-build-system)
6722 '(#:configure-flags '("-Dsystemd=false")))
6724 `(("pkg-config" ,pkg-config)))
6726 `(("alsa-lib" ,alsa-lib)
6730 ("gstreamer" ,gstreamer)
6731 ("gst-plugins-base" ,gst-plugins-base)
6735 (home-page "https://pipewire.org/")
6736 (synopsis "Server and user space API to deal with multimedia pipelines")
6738 "PipeWire is a project that aims to greatly improve handling of audio and
6739 video under Linux. It aims to support the usecases currently handled by both
6740 PulseAudio and Jack and at the same time provide same level of powerful handling
6741 of Video input and output. It also introduces a security model that makes
6742 interacting with audio and video devices from containerized applications easy,
6743 with supporting Flatpak applications being the primary goal. Alongside Wayland
6744 and Flatpak we expect PipeWire to provide a core building block for the future
6745 of Linux application development.")
6746 (license license:lgpl2.0+)))
6755 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6757 (file-name (git-file-name name version))
6760 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6761 (build-system gnu-build-system)
6764 (modify-phases %standard-phases
6765 (add-after 'unpack 'fix-dbus-tests
6767 (substitute* '("unit/test-dbus-message-fds.c"
6768 "unit/test-dbus-properties.c"
6770 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6775 `(("autoconf" ,autoconf)
6776 ("libtool" ,libtool)
6777 ("pkgconfig" ,pkg-config)
6778 ("automake" ,automake)))
6779 (home-page "https://01.org/ell")
6780 (synopsis "Embedded Linux Library")
6781 (description "The Embedded Linux* Library (ELL) provides core, low-level
6782 functionality for system daemons. It typically has no dependencies other than
6783 the Linux kernel, C standard library, and libdl (for dynamic linking). While
6784 ELL is designed to be efficient and compact enough for use on embedded Linux
6785 platforms, it is not limited to resource-constrained systems.")
6786 (license license:lgpl2.1+)))
6788 (define-public lttng-ust
6794 (uri (string-append "https://lttng.org/files/lttng-ust/"
6795 "lttng-ust-" version ".tar.bz2"))
6798 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
6799 (build-system gnu-build-system)
6801 `(("liburcu" ,liburcu)
6802 ("numactl" ,numactl)))
6804 `(("python" ,python-3)))
6805 (home-page "https://lttng.org/")
6806 (synopsis "LTTng userspace tracer libraries")
6807 (description "The user space tracing library, liblttng-ust, is the LTTng
6808 user space tracer. It receives commands from a session daemon, for example to
6809 enable and disable specific instrumentation points, and writes event records
6810 to ring buffers shared with a consumer daemon.")
6811 (license license:lgpl2.1+)))
6813 (define-public kexec-tools
6815 (name "kexec-tools")
6819 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
6820 "/kexec/kexec-tools-" version ".tar.xz"))
6823 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
6824 (build-system gnu-build-system)
6826 ;; There are no automated tests.
6828 (home-page "https://projects.horms.net/projects/kexec/")
6829 (synopsis "Tools for booting directly into different kernels")
6830 (description "This package provides the @code{kexec} program and ancillary
6831 utilities. Using @code{kexec}, it is possible to boot directly into a new
6832 kernel from the context of an already-running kernel, bypassing the normal
6833 system boot process.")
6834 (license license:gpl2)))