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 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 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.4
196 (linux-libre-deblob-scripts
198 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
199 (base32 "08ls4gx5vanyiq9rn0869nfq4piw4lx1dl8hh9w9xgkr4ypc1j4k")))
201 (define deblob-scripts-4.19
202 (linux-libre-deblob-scripts
204 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
205 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
207 (define deblob-scripts-4.14
208 (linux-libre-deblob-scripts
210 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
211 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
213 (define deblob-scripts-4.9
214 (linux-libre-deblob-scripts
216 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
217 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
219 (define deblob-scripts-4.4
220 (linux-libre-deblob-scripts
222 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
223 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
225 (define* (computed-origin-method gexp-promise hash-algo hash
226 #:optional (name "source")
227 #:key (system (%current-system))
228 (guile (default-guile)))
229 "Return a derivation that executes the G-expression that results
230 from forcing GEXP-PROMISE."
231 (mlet %store-monad ((guile (package->derivation guile system)))
232 (gexp->derivation (or name "computed-origin")
234 #:graft? #f ;nothing to graft
236 #:guile-for-build guile)))
238 (define (make-linux-libre-source version
241 "Return a 'computed' origin that generates a Linux-libre tarball from the
242 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
243 (match deblob-scripts
244 ((deblob-version (? origin? deblob) (? origin? deblob-check))
245 (unless (string=? deblob-version (version-major+minor version))
246 ;; The deblob script cannot be expected to work properly on a
247 ;; different version (major+minor) of Linux, even if no errors
248 ;; are signaled during execution.
249 (error "deblob major+minor version mismatch"))
251 (method computed-origin-method)
252 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
256 (with-imported-modules '((guix build utils))
258 (use-modules (guix build utils)
262 (let ((dir (string-append "linux-" #$version)))
265 (set-path-environment-variable
268 #+(canonical-package bash)
269 #+(canonical-package coreutils)
270 #+(canonical-package diffutils)
271 #+(canonical-package findutils)
272 #+(canonical-package patch)
273 #+(canonical-package xz)
274 #+(canonical-package sed)
275 #+(canonical-package grep)
276 #+(canonical-package bzip2)
277 #+(canonical-package gzip)
278 #+(canonical-package tar)
279 ;; The comments in the 'deblob-check' script
280 ;; claim that it supports Python 2 and 3, but
281 ;; in fact it fails when run in Python 3 as
285 (with-directory-excursion "/tmp/bin"
287 (copy-file #+deblob "deblob")
288 (chmod "deblob" #o755)
289 (substitute* "deblob"
290 (("/bin/sh") (which "sh")))
292 (copy-file #+deblob-check "deblob-check")
293 (chmod "deblob-check" #o755)
294 (substitute* "deblob-check"
295 (("/bin/sh") (which "sh"))
296 (("/bin/sed") (which "sed"))
297 (("/usr/bin/python") (which "python"))))
299 (if (file-is-directory? #+upstream-source)
301 (format #t "Copying upstream linux source...~%")
303 (invoke "cp" "--archive" #+upstream-source dir)
304 (invoke "chmod" "--recursive" "u+w" dir))
306 (format #t "Unpacking upstream linux tarball...~%")
308 (invoke "tar" "xf" #$upstream-source)
311 (and (not (member name '("." "..")))
312 (file-is-directory? name))))
314 (unless (string=? dir unpacked-dir)
315 (rename-file unpacked-dir dir)))
317 (error "multiple directories found" dirs)))))
319 (with-directory-excursion dir
320 (setenv "PYTHON" (which "python"))
321 (format #t "Running deblob script...~%")
323 (invoke "/tmp/bin/deblob"))
325 (format #t "~%Packing new Linux-libre tarball...~%")
327 (invoke "tar" "cvfa" #$output
328 ;; Avoid non-determinism in the archive.
341 (define (linux-libre-urls version)
342 "Return a list of URLs for Linux-Libre VERSION."
344 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
345 version "-gnu/linux-libre-" version "-gnu.tar.xz")
347 ;; XXX: Work around <http://bugs.gnu.org/14851>.
349 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
350 version "-gnu.tar.xz")
352 ;; Maybe this URL will become valid eventually.
354 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
355 version "-gnu.tar.xz")))
357 (define (%upstream-linux-source version hash)
360 (uri (string-append "mirror://kernel.org"
361 "/linux/kernel/v" (version-major version) ".x/"
362 "linux-" version ".tar.xz"))
365 (define-public linux-libre-5.4-version "5.4.28")
366 (define-public linux-libre-5.4-pristine-source
367 (let ((version linux-libre-5.4-version)
368 (hash (base32 "197p7rjmbs229ncj1y8s80f7n4bm8g9w0jrv1109m3rl8q9wqqy8")))
369 (make-linux-libre-source version
370 (%upstream-linux-source version hash)
371 deblob-scripts-5.4)))
373 (define-public linux-libre-4.19-version "4.19.113")
374 (define-public linux-libre-4.19-pristine-source
375 (let ((version linux-libre-4.19-version)
376 (hash (base32 "1rf0jz7r1f4rb4k0g3glssfa1hm2ka6vlbwjlkmsx1bybxnmg85m")))
377 (make-linux-libre-source version
378 (%upstream-linux-source version hash)
379 deblob-scripts-4.19)))
381 (define-public linux-libre-4.14-version "4.14.174")
382 (define-public linux-libre-4.14-pristine-source
383 (let ((version linux-libre-4.14-version)
384 (hash (base32 "12ai2lc2ny38s93d0m5ngrv030vwv1h2hhzp0fs6fhjxasikq8jc")))
385 (make-linux-libre-source version
386 (%upstream-linux-source version hash)
387 deblob-scripts-4.14)))
389 (define-public linux-libre-4.9-version "4.9.217")
390 (define-public linux-libre-4.9-pristine-source
391 (let ((version linux-libre-4.9-version)
392 (hash (base32 "06b8av9f9pk2yp95nzv4322k0d5wsg40sxd9kfim1xzb093abckg")))
393 (make-linux-libre-source version
394 (%upstream-linux-source version hash)
395 deblob-scripts-4.9)))
397 (define-public linux-libre-4.4-version "4.4.217")
398 (define-public linux-libre-4.4-pristine-source
399 (let ((version linux-libre-4.4-version)
400 (hash (base32 "0vsjchywznmjn01flgvm9vsja5zqni319rfwgy997afcbz0c9spx")))
401 (make-linux-libre-source version
402 (%upstream-linux-source version hash)
403 deblob-scripts-4.4)))
405 (define %boot-logo-patch
406 ;; Linux-Libre boot logo featuring Freedo and a gnu.
409 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
410 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
413 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
415 (define %linux-libre-arm-export-__sync_icache_dcache-patch
419 "https://salsa.debian.org/kernel-team/linux"
420 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
421 "/debian/patches/bugfix/arm/"
422 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
423 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
425 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
427 (define (source-with-patches source patches)
430 (patches (append (origin-patches source)
433 (define-public linux-libre-5.4-source
434 (source-with-patches linux-libre-5.4-pristine-source
435 (list %boot-logo-patch
436 %linux-libre-arm-export-__sync_icache_dcache-patch
437 ;; Pinebook Pro patch from linux-next,
438 ;; can be dropped for linux-libre 5.7
440 "linux-libre-support-for-Pinebook-Pro.patch"))))
442 (define-public linux-libre-4.19-source
443 (source-with-patches linux-libre-4.19-pristine-source
444 (list %boot-logo-patch
445 %linux-libre-arm-export-__sync_icache_dcache-patch)))
447 (define-public linux-libre-4.14-source
448 (source-with-patches linux-libre-4.14-pristine-source
449 (list %boot-logo-patch)))
451 (define-public linux-libre-4.9-source
452 (source-with-patches linux-libre-4.9-pristine-source
453 (list %boot-logo-patch)))
455 (define-public linux-libre-4.4-source
456 (source-with-patches linux-libre-4.4-pristine-source
457 (list %boot-logo-patch)))
464 (define (make-linux-libre-headers version hash-string)
465 (make-linux-libre-headers* version
468 (uri (linux-libre-urls version))
469 (sha256 (base32 hash-string)))))
471 (define (make-linux-libre-headers* version source)
473 (name "linux-libre-headers")
476 (build-system gnu-build-system)
477 (native-inputs `(("perl" ,perl)
478 ,@(if (version>=? version "4.16")
482 ,@(if (version>=? version "5.3")
486 `(#:modules ((guix build gnu-build-system)
490 (modify-phases %standard-phases
494 (let ((arch ,(system->linux-architecture
495 (or (%current-target-system)
497 (defconfig ,(system->defconfig
498 (or (%current-target-system)
499 (%current-system)))))
501 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
502 (invoke "make" defconfig)
503 (invoke "make" "mrproper" "headers_check"))))
505 (lambda* (#:key outputs #:allow-other-keys)
506 (let ((out (assoc-ref outputs "out")))
508 (string-append "INSTALL_HDR_PATH=" out)
511 (mkdir (string-append out "/include/config"))
512 (call-with-output-file
514 "/include/config/kernel.release")
516 (format p "~a-default~%" ,version)))
518 ;; Remove the '.install' and '..install.cmd' files; the
519 ;; latter contains store paths, which pulls in bootstrap
520 ;; binaries in the build environment, and prevents bit
521 ;; reproducibility for the bootstrap binaries.
522 (for-each delete-file (find-files out "\\.install"))
525 #:allowed-references ()
527 (home-page "https://www.gnu.org/software/linux-libre/")
528 (synopsis "GNU Linux-Libre kernel headers")
529 (description "Headers of the Linux-Libre kernel.")
530 (license license:gpl2)))
532 (define-public linux-libre-headers-5.4
533 (make-linux-libre-headers* linux-libre-5.4-version
534 linux-libre-5.4-source))
536 (define-public linux-libre-headers-4.19
537 (make-linux-libre-headers* linux-libre-4.19-version
538 linux-libre-4.19-source))
540 (define-public linux-libre-headers-4.14
541 (make-linux-libre-headers* linux-libre-4.14-version
542 linux-libre-4.14-source))
544 (define-public linux-libre-headers-4.9
545 (make-linux-libre-headers* linux-libre-4.9-version
546 linux-libre-4.9-source))
548 (define-public linux-libre-headers-4.4
549 (make-linux-libre-headers* linux-libre-4.4-version
550 linux-libre-4.4-source))
552 ;; The following package is used in the early bootstrap, and thus must be kept
553 ;; stable and with minimal build requirements.
554 (define-public linux-libre-headers-4.19.56
555 (make-linux-libre-headers "4.19.56"
556 "1zqiic55viy065lhnkmhn33sz3bbbr2ykbm5f92yzd8lpc9zl7yx"))
558 (define-public linux-libre-headers linux-libre-headers-4.19.56)
562 ;;; Kernel configurations.
565 (define* (kernel-config arch #:key variant)
566 "Return the absolute file name of the Linux-Libre build configuration file
567 for ARCH and optionally VARIANT, or #f if there is no such configuration."
568 (let* ((name (string-append (if variant (string-append variant "-") "")
569 (if (string=? "i386" arch) "i686" arch) ".conf"))
570 (file (string-append "linux-libre/" name)))
571 (search-auxiliary-file file)))
573 (define %default-extra-linux-options
574 `(;; Some very mild hardening.
575 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
576 ;; All kernels should have NAMESPACES options enabled
577 ("CONFIG_NAMESPACES" . #t)
578 ("CONFIG_UTS_NS" . #t)
579 ("CONFIG_IPC_NS" . #t)
580 ("CONFIG_USER_NS" . #t)
581 ("CONFIG_PID_NS" . #t)
582 ("CONFIG_NET_NS" . #t)
583 ;; Modules required for initrd:
584 ("CONFIG_NET_9P" . m)
585 ("CONFIG_NET_9P_VIRTIO" . m)
586 ("CONFIG_VIRTIO_BLK" . m)
587 ("CONFIG_VIRTIO_NET" . m)
588 ("CONFIG_VIRTIO_PCI" . m)
589 ("CONFIG_VIRTIO_BALLOON" . m)
590 ("CONFIG_VIRTIO_MMIO" . m)
591 ("CONFIG_FUSE_FS" . m)
593 ("CONFIG_9P_FS" . m)))
595 (define (config->string options)
596 (string-join (map (match-lambda
598 (string-append option "=m"))
600 (string-append option "=y"))
602 (string-append option "=n")))
608 ;;; Kernel package utilities.
611 (define* (make-linux-libre version hash-string supported-systems
613 ;; A function that takes an arch and a variant.
614 ;; See kernel-config for an example.
616 (configuration-file #f)
617 (defconfig "defconfig")
618 (extra-options %default-extra-linux-options)
619 (patches (list %boot-logo-patch)))
620 (make-linux-libre* version
623 (uri (linux-libre-urls version))
624 (sha256 (base32 hash-string))
627 #:extra-version extra-version
628 #:configuration-file configuration-file
629 #:defconfig defconfig
630 #:extra-options extra-options))
632 (define* (make-linux-libre* version source supported-systems
634 ;; A function that takes an arch and a variant.
635 ;; See kernel-config for an example.
637 (configuration-file #f)
638 (defconfig "defconfig")
639 (extra-options %default-extra-linux-options))
641 (name (if extra-version
642 (string-append "linux-libre-" extra-version)
646 (supported-systems supported-systems)
647 (build-system gnu-build-system)
652 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
656 ;; These are needed to compile the GCC plugins.
661 ,@(match (and configuration-file
663 (system->linux-architecture
664 (or (%current-target-system) (%current-system)))
665 #:variant (version-major+minor version)))
666 (#f ;no config for this platform
669 `(("kconfig" ,config))))))
671 `(#:modules ((guix build gnu-build-system)
678 (modify-phases %standard-phases
679 (add-after 'unpack 'patch-/bin/pwd
681 (substitute* (find-files "." "^Makefile(\\.include)?$")
682 (("/bin/pwd") "pwd"))
685 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
686 ;; On AArch64 (at least), we need to remove glibc headers from
687 ;; CPATH (they are still available as "system headers"), so that
688 ;; the kernel can override uint64_t. See
689 ;; <https://bugs.gnu.org/37593>. This is also true when
690 ;; cross-compiling, except in that case, cross-libc must be
691 ;; removed from CROSS_CPATH.
692 (let ((var ,(if (%current-target-system)
695 (libc ,(if (%current-target-system)
701 (cut string-prefix? (assoc-ref inputs libc) <>)
702 (string-split (getenv var) #\:))
704 (format #t "environment variable `~a' changed to `~a'~%"
707 ;; Avoid introducing timestamps
708 (setenv "KCONFIG_NOTIMESTAMP" "1")
709 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
711 ;; Set ARCH and CROSS_COMPILE
712 (let ((arch ,(system->linux-architecture
713 (or (%current-target-system)
714 (%current-system)))))
716 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
719 (setenv "CROSS_COMPILE" (string-append target "-"))
720 (format #t "`CROSS_COMPILE' set to `~a'~%"
721 (getenv "CROSS_COMPILE"))))
723 (setenv "EXTRA_VERSION" ,extra-version)
725 (let ((build (assoc-ref %standard-phases 'build))
726 (config (assoc-ref (or native-inputs inputs) "kconfig")))
728 ;; Use a custom kernel configuration file or a default
729 ;; configuration file.
732 (copy-file config ".config")
733 (chmod ".config" #o666))
734 (invoke "make" ,defconfig))
736 ;; Appending works even when the option wasn't in the
737 ;; file. The last one prevails if duplicated.
738 (let ((port (open-file ".config" "a"))
739 (extra-configuration ,(config->string extra-options)))
740 (display extra-configuration port)
743 (invoke "make" "oldconfig"))))
745 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
746 (let* ((out (assoc-ref outputs "out"))
747 (moddir (string-append out "/lib/modules"))
748 (dtbdir (string-append out "/lib/dtbs")))
749 ;; Install kernel image, kernel configuration and link map.
750 (for-each (lambda (file) (install-file file out))
751 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
752 ;; Install device tree files
753 (unless (null? (find-files "." "\\.dtb$"))
755 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
757 ;; Install kernel modules
760 ;; Disable depmod because the Guix system's module directory
761 ;; is an union of potentially multiple packages. It is not
762 ;; possible to use depmod to usefully calculate a dependency
763 ;; graph while building only one of those packages.
765 (string-append "MODULE_DIR=" moddir)
766 (string-append "INSTALL_PATH=" out)
767 (string-append "INSTALL_MOD_PATH=" out)
768 "INSTALL_MOD_STRIP=1"
770 (let* ((versions (filter (lambda (name)
771 (not (string-prefix? "." name)))
773 (version (match versions
775 ;; There are symlinks to the build and source directory,
776 ;; both of which will point to target /tmp/guix-build*
777 ;; and thus not be useful in a profile. Delete the symlinks.
778 (false-if-file-not-found
779 (delete-file (string-append moddir "/" version "/build")))
780 (false-if-file-not-found
781 (delete-file (string-append moddir "/" version "/source"))))
784 (home-page "https://www.gnu.org/software/linux-libre/")
785 (synopsis "100% free redistribution of a cleaned Linux kernel")
787 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
788 It has been modified to remove all non-free binary blobs.")
789 (license license:gpl2)))
793 ;;; Generic kernel packages.
796 (define-public linux-libre-5.4
797 (make-linux-libre* linux-libre-5.4-version
798 linux-libre-5.4-source
799 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
800 #:configuration-file kernel-config))
802 (define-public linux-libre-version linux-libre-5.4-version)
803 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
804 (define-public linux-libre-source linux-libre-5.4-source)
805 (define-public linux-libre linux-libre-5.4)
807 (define-public linux-libre-4.19
808 (make-linux-libre* linux-libre-4.19-version
809 linux-libre-4.19-source
810 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
811 #:configuration-file kernel-config))
813 (define-public linux-libre-4.14
814 (make-linux-libre* linux-libre-4.14-version
815 linux-libre-4.14-source
816 '("x86_64-linux" "i686-linux" "armhf-linux")
817 #:configuration-file kernel-config))
819 (define-public linux-libre-4.9
820 (make-linux-libre* linux-libre-4.9-version
821 linux-libre-4.9-source
822 '("x86_64-linux" "i686-linux")
823 #:configuration-file kernel-config))
825 (define-public linux-libre-4.4
826 (make-linux-libre* linux-libre-4.4-version
827 linux-libre-4.4-source
828 '("x86_64-linux" "i686-linux")
829 #:configuration-file kernel-config
832 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
833 ;; This option was removed upstream in version 4.7.
834 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
835 %default-extra-linux-options)))
839 ;;; Specialized kernel variants.
842 (define-public linux-libre-arm-generic
843 (make-linux-libre* linux-libre-version
846 #:defconfig "multi_v7_defconfig"
847 #:extra-version "arm-generic"))
849 (define-public linux-libre-arm-veyron
850 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
852 (define-public linux-libre-arm-generic-4.19
853 (make-linux-libre* linux-libre-4.19-version
854 linux-libre-4.19-source
856 #:defconfig "multi_v7_defconfig"
857 #:extra-version "arm-generic"))
859 (define-public linux-libre-arm-generic-4.14
860 (make-linux-libre* linux-libre-4.14-version
861 linux-libre-4.14-source
863 #:defconfig "multi_v7_defconfig"
864 #:extra-version "arm-generic"))
866 (define-public linux-libre-arm-omap2plus
867 (make-linux-libre* linux-libre-version
870 #:defconfig "omap2plus_defconfig"
871 #:extra-version "arm-omap2plus"))
873 (define-public linux-libre-arm-omap2plus-4.19
874 (make-linux-libre* linux-libre-4.19-version
875 linux-libre-4.19-source
877 #:defconfig "omap2plus_defconfig"
878 #:extra-version "arm-omap2plus"))
880 (define-public linux-libre-arm-omap2plus-4.14
881 (make-linux-libre* linux-libre-4.14-version
882 linux-libre-4.14-source
884 #:defconfig "omap2plus_defconfig"
885 #:extra-version "arm-omap2plus"))
887 (define-public linux-libre-arm64-generic
888 (make-linux-libre* linux-libre-version
891 #:defconfig "defconfig"
892 #:extra-version "arm64-generic"))
894 (define-public linux-libre-riscv64-generic
895 (make-linux-libre* linux-libre-version
898 #:extra-version "riscv64-generic"))
902 ;;; Linux kernel modules.
905 (define-public acpi-call-linux-module
907 (name "acpi-call-linux-module")
913 (url "https://github.com/teleshoes/acpi_call.git")
915 (file-name (git-file-name name version))
917 (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
918 (build-system linux-module-build-system)
920 `(#:tests? #f ; no tests
922 (modify-phases %standard-phases
923 (add-after 'unpack 'fix-for-linux-4.12
925 (substitute* "acpi_call.c"
929 (add-after 'install 'install-documentation
930 (lambda* (#:key outputs #:allow-other-keys)
931 (let* ((out (assoc-ref outputs "out"))
932 (doc (string-append out "/share/doc/" ,name "-" ,version)))
933 (for-each (lambda (file)
934 (let ((target (string-append doc "/" file)))
935 (mkdir-p (dirname target))
936 (copy-recursively file target)))
937 (list "README.md" "examples"))
939 (home-page "https://github.com/teleshoes/acpi_call")
940 (synopsis "Linux kernel module to perform ACPI method calls")
942 "This simple Linux kernel module allows calls from user space to any
943 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
944 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
945 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
946 and @code{ACPI_BUFFER}.
948 It grants direct and undocumented access to your hardware that may cause damage
949 and should be used with caution, especially on untested models.")
950 (license license:gpl3+))) ; see README.md (no licence headers)
952 (define-public rtl8812au-aircrack-ng-linux-module
953 (let ((commit "945d6ed6505c32f0993b1dba576388e92e78101b")
956 (name "rtl8812au-aircrack-ng-linux-module")
957 (version (git-version "5.6.4.2" revision commit))
962 (url "https://github.com/aircrack-ng/rtl8812au.git")
964 (file-name (git-file-name name version))
966 (base32 "1pjws7qb5l4z9k80vgz4zdxmqhbwxjjrmkpf0hijf821byyddvi7"))
967 (modules '((guix build utils)))
970 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
971 ;; and other unnecessary unlicenced things.
972 (for-each delete-file-recursively (list "android"
976 (build-system linux-module-build-system)
979 (modify-phases %standard-phases
981 (lambda* (#:key inputs make-flags #:allow-other-keys)
983 (string-append "KSRC="
984 (assoc-ref inputs "linux-module-builder")
985 "/lib/modules/build")
986 (or make-flags '())))))
987 #:tests? #f)) ; no test suite
988 (supported-systems '("x86_64-linux" "i686-linux"))
989 (home-page "https://github.com/aircrack-ng/rtl8812au")
990 (synopsis "Linux driver for Realtek USB wireless network adapters")
992 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
993 network adapters, modified by the aircrack-ng project to support monitor mode
994 and frame injection. It provides a @code{88XXau} kernel module that supports
995 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
996 (license license:gpl2+))))
998 (define-public vhba-module
1000 (name "vhba-module")
1001 (version "20200106")
1005 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1006 version ".tar.bz2"))
1009 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1010 (build-system linux-module-build-system)
1014 (home-page "https://cdemu.sourceforge.io/")
1015 (synopsis "Kernel module that emulates SCSI devices")
1016 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1017 between the CDemu userspace daemon and linux kernel.")
1018 (license license:gpl2+)))
1020 (define-public ddcci-driver-linux
1022 (name "ddcci-driver-linux")
1029 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1030 (commit (string-append "v" version))))
1031 (file-name (git-file-name name version))
1034 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1035 (build-system linux-module-build-system)
1037 `(#:tests? #f ; no tests
1039 (modify-phases %standard-phases
1044 (with-directory-excursion module
1045 (apply (assoc-ref %standard-phases 'build) args)))
1046 '("ddcci" "ddcci-backlight"))
1052 (with-directory-excursion module
1053 (apply (assoc-ref %standard-phases 'install) args)))
1054 '("ddcci" "ddcci-backlight"))
1056 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1057 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1058 (description "This package provides two Linux kernel drivers, ddcci and
1059 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1060 interface. The ddcci module creates a character device for each DDC/CI
1061 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1062 module allows the control of the backlight level or luminance property when
1063 supported under @file{/sys/class/backlight/}.")
1064 (license license:gpl2+)))
1068 ;;; Pluggable authentication modules (PAM).
1071 (define-public linux-pam
1079 "https://github.com/linux-pam/linux-pam/releases/download/v"
1080 version "/Linux-PAM-" version ".tar.xz"))
1083 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1084 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1086 (build-system gnu-build-system)
1090 ;; TODO: optional dependencies
1091 ;; ("libxcrypt" ,libxcrypt)
1092 ;; ("cracklib" ,cracklib)
1095 `(;; Most users, such as `shadow', expect the headers to be under
1097 #:configure-flags (list (string-append "--includedir="
1098 (assoc-ref %outputs "out")
1099 "/include/security")
1101 ;; XXX: <rpc/rpc.h> is missing from glibc when
1102 ;; cross-compiling, so we have to disable NIS
1103 ;; support altogether.
1104 ,@(if (%current-target-system)
1108 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1111 (home-page "http://www.linux-pam.org/")
1112 (synopsis "Pluggable authentication modules for Linux")
1114 "A *Free* project to implement OSF's RFC 86.0.
1115 Pluggable authentication modules are small shared object files that can
1116 be used through the PAM API to perform tasks, like authenticating a user
1117 at login. Local and dynamic reconfiguration are its key features.")
1118 (license license:bsd-3)))
1120 (define-public linux-pam-1.2
1128 "http://www.linux-pam.org/library/"
1129 "Linux-PAM-" version ".tar.bz2"))
1132 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1133 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1140 (define-public psmisc
1147 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1150 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1151 (build-system gnu-build-system)
1153 `(,@(if (%current-target-system)
1156 "ac_cv_func_malloc_0_nonnull=yes"
1157 "ac_cv_func_realloc_0_nonnull=yes"))
1159 (inputs `(("ncurses" ,ncurses)))
1160 (home-page "https://gitlab.com/psmisc/psmisc")
1161 (synopsis "Small utilities that use the proc file system")
1163 "This PSmisc package is a set of some small useful utilities that
1164 use the proc file system. We're not about changing the world, but
1165 providing the system administrator with some help in common tasks.")
1166 (license license:gpl2+)))
1168 (define-public util-linux
1174 (uri (string-append "mirror://kernel.org/linux/utils/"
1175 "util-linux/v" (version-major+minor version) "/"
1176 "util-linux-" version ".tar.xz"))
1179 "1db2kydkwjmvgd1glkcba3adhidxw0f1x735dcjdpdjjf869sgvl"))
1180 (patches (search-patches "util-linux-tests.patch"))
1181 (modules '((guix build utils)))
1183 ;; We take 'nologin' from Shadow, the 'logger' program from
1184 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1186 (substitute* "configure"
1187 (("build_nologin=yes") "build_nologin=no")
1188 (("build_logger=yes") "build_logger=no")
1189 (("build_kill=yes") "build_kill=no"))
1191 (build-system gnu-build-system)
1193 "static")) ;>2 MiB of static .a libraries
1195 `(#:configure-flags (list "--disable-use-tty-group"
1196 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1197 ;; Don't try to chown root:root mount and umount
1198 "--disable-makeinstall-chown"
1199 ;; Install completions where our
1200 ;; bash-completion package expects them.
1201 (string-append "--with-bashcompletiondir="
1202 (assoc-ref %outputs "out")
1203 "/etc/bash_completion.d"))
1204 #:phases (modify-phases %standard-phases
1205 (add-before 'build 'set-umount-file-name
1206 (lambda* (#:key outputs #:allow-other-keys)
1207 ;; Tell 'eject' the right file name of 'umount'.
1208 (let ((out (assoc-ref outputs "out")))
1209 (substitute* "sys-utils/eject.c"
1210 (("\"/bin/umount\"")
1211 (string-append "\"" out "/bin/umount\"")))
1213 (add-before 'check 'pre-check
1214 (lambda* (#:key inputs outputs #:allow-other-keys)
1215 (let ((out (assoc-ref outputs "out"))
1216 (net (assoc-ref inputs "net-base")))
1217 ;; Change the test to refer to the right file.
1218 (substitute* "tests/ts/misc/mcookie"
1220 (string-append net "/etc/services")))
1222 (add-after 'install 'move-static-libraries
1223 (lambda* (#:key outputs #:allow-other-keys)
1224 (let ((out (assoc-ref outputs "out"))
1225 (static (assoc-ref outputs "static")))
1226 (mkdir-p (string-append static "/lib"))
1227 (with-directory-excursion out
1228 (for-each (lambda (file)
1230 (string-append static "/"
1232 (find-files "lib" "\\.a$"))
1234 ;; Remove references to the static library from the '.la'
1235 ;; files so that Libtool does the right thing when both
1236 ;; the shared and static library is available.
1237 (substitute* (find-files "lib" "\\.la$")
1238 (("old_library=.*") "old_library=''\n")))
1241 (inputs `(("zlib" ,zlib)
1242 ("ncurses" ,ncurses)
1244 ;; XXX: This is so that the 'pre-check' phase can find it.
1245 ,@(if (%current-target-system)
1246 `(("net-base" ,net-base))
1250 ("net-base" ,net-base))) ;for tests
1251 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1252 (synopsis "Collection of utilities for the Linux kernel")
1253 (description "Util-linux is a diverse collection of Linux kernel
1254 utilities. It provides dmesg and includes tools for working with file systems,
1255 block devices, UUIDs, TTYs, and many other tools.")
1257 ;; Note that util-linux doesn't use the same license for all the
1258 ;; code. GPLv2+ is the default license for a code without an
1259 ;; explicitly defined license.
1260 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1261 license:bsd-4 license:public-domain))))
1263 ;; util-linux optionally supports udev, which allows lsblk to read file system
1264 ;; metadata without special privileges. Add it as a separate package to avoid
1265 ;; a circular dependency, and to keep the size small.
1266 (define-public util-linux+udev
1269 (name "util-linux-with-udev")
1272 ,@(package-inputs util-linux)))))
1274 (define-public ddate
1280 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1282 (file-name (string-append name "-" version ".tar.gz"))
1284 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1285 (build-system cmake-build-system)
1286 (arguments '(#:tests? #f))
1287 (home-page "https://github.com/bo0ts/ddate")
1288 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1290 "ddate displays the Discordian date and holidays of a given date.
1291 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1292 by Robert Shea and Robert Anton Wilson.")
1293 (license license:public-domain)))
1295 (define-public fbset
1302 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1305 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1306 (build-system gnu-build-system)
1308 '(#:modules ((guix build gnu-build-system)
1312 (modify-phases %standard-phases
1313 (delete 'configure) ; no configure script
1314 (add-before 'install 'pre-install
1315 (lambda* (#:key outputs #:allow-other-keys)
1316 (let ((out (assoc-ref outputs "out")))
1317 (substitute* "Makefile"
1318 (("mknod ") "true ")
1319 ;; The Makefile doesn't honour PREFIX or similar.
1322 (with-directory-excursion out
1323 (for-each mkdir-p (list "sbin"
1327 (add-after 'install 'install-fb.modes
1328 (lambda* (#:key outputs #:allow-other-keys)
1329 (let* ((out (assoc-ref outputs "out"))
1330 (etc (string-append out "/etc")))
1331 (for-each (cut install-file <> etc)
1332 (find-files "etc" "^fb\\.modes"))
1333 (symlink "fb.modes.ATI"
1334 (string-append etc "/fb.modes"))
1336 ;; Parallel building races to create modes.tab.c.
1337 #:parallel-build? #f
1338 #:tests? #f)) ; no test suite
1342 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1343 (synopsis "Show and modify Linux frame buffer settings")
1345 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1346 different kinds of graphic displays. The @command{fbset} utility can query and
1347 change various device settings such as depth, virtual resolution, and timing
1349 (license license:gpl2)))
1351 (define-public procps
1357 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1358 "procps-ng-" version ".tar.xz"))
1361 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1362 (build-system gnu-build-system)
1364 '(#:modules ((guix build utils)
1365 (guix build gnu-build-system)
1369 (modify-phases %standard-phases
1371 'install 'post-install
1372 ;; Remove commands and man pages redudant with
1374 (lambda* (#:key outputs #:allow-other-keys)
1375 (let* ((out (assoc-ref outputs "out"))
1376 (dup (append-map (cut find-files out <>)
1377 '("^kill" "^uptime"))))
1378 (for-each delete-file dup)
1380 (inputs `(("ncurses" ,ncurses)))
1381 (home-page "https://gitlab.com/procps-ng/procps/")
1382 (synopsis "Utilities that give information about processes")
1384 "Procps is the package that has a bunch of small useful utilities
1385 that give information about processes using the Linux /proc file system.
1386 The package includes the programs ps, top, vmstat, w, kill, free,
1387 slabtop, and skill.")
1388 (license license:gpl2)))
1390 (define-public usbutils
1397 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1398 "usbutils-" version ".tar.xz"))
1400 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1401 (build-system gnu-build-system)
1402 (outputs (list "out" "python"))
1405 (modify-phases %standard-phases
1406 (add-before 'bootstrap 'patch-bootstrap-scripts
1408 (substitute* "usbhid-dump/bootstrap"
1409 (("/bin/bash") (which "bash")))
1411 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1412 (substitute* "autogen.sh"
1413 (("^\\./configure.*") ""))
1415 (add-after 'install 'separate-python-output
1416 ;; Separating one Python script shaves more than 106 MiB from :out.
1417 (lambda* (#:key outputs #:allow-other-keys)
1418 (let ((out (assoc-ref outputs "out"))
1419 (out:python (assoc-ref outputs "python")))
1420 (for-each (lambda (file)
1421 (let ((old (string-append out "/" file))
1422 (new (string-append out:python "/" file)))
1423 (mkdir-p (dirname new))
1424 (rename-file old new)))
1425 (list "bin/lsusb.py"))
1430 ("python" ,python)))
1432 `(("autoconf" ,autoconf)
1433 ("automake" ,automake)
1434 ("libtool" ,libtool)
1435 ("pkg-config" ,pkg-config)))
1436 (home-page "http://www.linux-usb.org/")
1438 "Tools for working with USB devices, such as lsusb")
1440 "Tools for working with USB devices, such as lsusb.")
1441 (license license:gpl2+)))
1443 (define-public e2fsprogs
1450 "mirror://kernel.org/linux/kernel/people/tytso/"
1451 name "/v" version "/"
1452 name "-" version ".tar.xz"))
1455 "1pmf8inp736l587rqq7qsd8bv0mmg5cwrivxg5p5awqgv70crypr"))))
1456 (build-system gnu-build-system)
1457 (inputs `(("util-linux" ,util-linux)))
1458 (native-inputs `(("pkg-config" ,pkg-config)
1459 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1463 ("procps" ,procps)))
1465 '(;; util-linux is the preferred source for some of the libraries and
1466 ;; commands, so disable them (see, e.g.,
1467 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1468 #:configure-flags (list "--disable-libblkid"
1469 "--disable-libuuid" "--disable-uuidd"
1472 ;; Use symlinks instead of hard links for
1473 ;; 'fsck.extN' etc. This makes the resulting nar
1474 ;; smaller and is preserved across copies.
1475 "--enable-symlink-install"
1477 (string-append "LDFLAGS=-Wl,-rpath="
1478 (assoc-ref %outputs "out")
1481 ;; Install libext2fs et al.
1482 "--enable-elf-shlibs")
1485 (modify-phases %standard-phases
1486 (add-before 'configure 'patch-shells
1488 (substitute* "configure"
1489 (("/bin/sh (.*)parse-types.sh" _ dir)
1490 (string-append (which "sh") " " dir
1492 (substitute* "MCONFIG.in"
1493 (("INSTALL_SYMLINK = /bin/sh")
1494 "INSTALL_SYMLINK = sh"))
1495 (substitute* (find-files "." "^Makefile.in$")
1497 (string-append "#!" (which "sh"))))
1499 (add-after 'install 'install-libs
1500 (lambda* (#:key outputs #:allow-other-keys)
1501 (let* ((out (assoc-ref outputs "out"))
1502 (lib (string-append out "/lib")))
1503 (invoke "make" "install-libs")
1505 ;; Make the .a writable so that 'strip' works.
1506 ;; Failing to do that, due to debug symbols, we
1507 ;; retain a reference to the final
1508 ;; linux-libre-headers, which refer to the
1509 ;; bootstrap binaries.
1510 (let ((archives (find-files lib "\\.a$")))
1511 (for-each (lambda (file)
1515 (home-page "http://e2fsprogs.sourceforge.net/")
1516 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1518 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1519 (license (list license:gpl2 ;programs
1520 license:lgpl2.0 ;libext2fs
1521 license:x11)))) ;libuuid
1523 (define e2fsprogs/static
1525 (package (inherit e2fsprogs)
1527 ;; Do not build shared libraries.
1528 (substitute-keyword-arguments (package-arguments e2fsprogs)
1529 ((#:configure-flags _)
1530 '(list "--disable-blkid"))
1534 (define-public e2fsck/static
1536 (name "e2fsck-static")
1537 (version (package-version e2fsprogs))
1538 (build-system trivial-build-system)
1541 `(("e2fsprogs" ,e2fsprogs/static)))
1543 `(#:modules ((guix build utils))
1546 (use-modules (guix build utils)
1550 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1552 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1554 (with-directory-excursion bin
1555 (copy-file e2fsck "e2fsck")
1556 (remove-store-references "e2fsck")
1557 (chmod "e2fsck" #o555))
1559 (home-page (package-home-page e2fsprogs))
1560 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1561 (description "This package provides statically-linked e2fsck command taken
1562 from the e2fsprogs package. It is meant to be used in initrds.")
1563 (license (package-license e2fsprogs))))
1565 (define-public extundelete
1567 (name "extundelete")
1572 (uri (string-append "mirror://sourceforge/extundelete/"
1573 "extundelete/" version "/extundelete-"
1574 version ".tar.bz2"))
1577 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1578 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1579 (build-system gnu-build-system)
1580 (inputs `(("e2fsprogs" ,e2fsprogs)))
1581 (home-page "http://extundelete.sourceforge.net/")
1582 (synopsis "Recover deleted files from ext2/3/4 partitions")
1584 "Extundelete is a set of tools that can recover deleted files from an
1585 ext3 or ext4 partition.")
1586 (license license:gpl2)))
1588 (define-public zerofree
1592 (home-page "https://frippery.org/uml/")
1595 (uri (string-append home-page name "-" version
1599 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1600 (build-system gnu-build-system)
1603 (modify-phases %standard-phases
1604 (delete 'configure) ; no configure script
1606 ;; The Makefile lacks an ‘install’ target.
1607 (lambda* (#:key outputs #:allow-other-keys)
1608 (let* ((out (assoc-ref outputs "out"))
1609 (bin (string-append out "/bin")))
1610 (chmod "zerofree" #o555)
1611 (install-file "zerofree" bin)
1613 #:tests? #f)) ; no tests
1614 (inputs `(("libext2fs" ,e2fsprogs)))
1615 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1617 "Zerofree finds the unallocated blocks with non-zero value content in an
1618 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1619 This is a simple way to make disk images more compressible.
1620 Zerofree requires the file system to be unmounted or mounted read-only.")
1621 (license license:gpl2)))
1623 (define-public strace
1627 (home-page "https://strace.io")
1630 (uri (string-append home-page "/files/" version
1631 "/strace-" version ".tar.xz"))
1634 "1zrhpzjlgfwfl8dd53llswmmharm5rbi0zch7lln5sjris69an4z"))))
1635 (build-system gnu-build-system)
1638 (modify-phases %standard-phases
1639 (add-after 'unpack 'patch-/bin/sh
1641 (substitute* "strace.c"
1642 (("/bin/sh") (which "sh")))
1644 ;; Don't fail if the architecture doesn't support different personalities.
1645 #:configure-flags '("--enable-mpers=check")
1646 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1647 #:parallel-tests? #f)) ; undeterministic failures
1648 (native-inputs `(("perl" ,perl)))
1649 (synopsis "System call tracer for Linux")
1651 "strace is a system call tracer, i.e. a debugging tool which prints out a
1652 trace of all the system calls made by a another process/program.")
1653 (license license:lgpl2.1+)))
1655 (define-public ltrace
1661 (uri (string-append "http://www.ltrace.org/ltrace_" version
1665 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1666 (build-system gnu-build-system)
1667 (inputs `(("libelf" ,libelf)))
1669 ;; Compilation uses -Werror by default, but it fails.
1670 '(#:configure-flags '("--disable-werror")))
1671 (home-page "https://www.ltrace.org/")
1672 (synopsis "Library call tracer for Linux")
1674 "ltrace intercepts and records dynamic library calls which are called by
1675 an executed process and the signals received by that process. It can also
1676 intercept and print the system calls executed by the program.")
1677 (license license:gpl2+)))
1679 (define-public alsa-lib
1686 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1687 version ".tar.bz2"))
1690 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
1691 (build-system gnu-build-system)
1693 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1694 (assoc-ref %outputs "out")
1696 (home-page "https://www.alsa-project.org/")
1697 (synopsis "The Advanced Linux Sound Architecture libraries")
1699 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1700 MIDI functionality to the Linux-based operating system.")
1701 (license license:lgpl2.1+)))
1703 (define-public alsa-utils
1709 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1710 name "-" version ".tar.bz2"))
1713 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
1714 (build-system gnu-build-system)
1716 ;; XXX: Disable man page creation until we have DocBook.
1717 '(#:configure-flags (list "--disable-xmlto"
1719 ;; The udev rule is responsible for restoring
1721 (string-append "--with-udev-rules-dir="
1722 (assoc-ref %outputs "out")
1723 "/lib/udev/rules.d"))
1725 (modify-phases %standard-phases
1726 (add-before 'check 'disable-broken-test
1728 ;; XXX: The 1.1.8 release tarball is missing a header that's
1729 ;; required for this test to work. Fixed in 1.1.9.
1730 (substitute* "axfer/test/Makefile"
1731 ((".*container-test.*") ""))
1734 'install 'pre-install
1736 ;; Don't try to mkdir /var/lib/alsa.
1737 (substitute* "Makefile"
1738 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1742 `(("libsamplerate" ,libsamplerate)
1743 ("ncurses" ,ncurses)
1744 ("alsa-lib" ,alsa-lib)
1746 ("gettext" ,gettext-minimal)))
1747 (home-page "http://www.alsa-project.org/")
1748 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1750 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1751 MIDI functionality to the Linux-based operating system.")
1753 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1755 (license license:gpl2)))
1757 (define-public alsa-plugins
1759 (name "alsa-plugins")
1763 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1764 name "-" version ".tar.bz2"))
1767 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
1768 (build-system gnu-build-system)
1769 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1770 ;; be split, there are references to both in files.
1771 ;; TODO: Remove OSS related plugins, they add support to run native
1772 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1774 (outputs '("out" "pulseaudio" "jack"))
1776 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1777 ;; for /etc/alsa. On Guix System plugins are loaded from
1778 ;; the ALSA service, and other distributions likely
1779 ;; won't use these files.
1780 "--with-alsalconfdir=/tmp/noop")
1782 (modify-phases %standard-phases
1783 (add-after 'install 'split
1784 (lambda* (#:key inputs outputs #:allow-other-keys)
1785 ;; Distribute the binaries to the various outputs.
1786 (let* ((out (assoc-ref outputs "out"))
1787 (jack (assoc-ref outputs "jack"))
1788 (jacklib (string-append jack "/lib/alsa-lib"))
1789 (pua (assoc-ref outputs "pulseaudio"))
1790 (pualib (string-append pua "/lib/alsa-lib")))
1793 (for-each (lambda (file)
1794 (rename-file file (string-append jacklib "/" (basename file))))
1795 (find-files out ".*jack\\.(la|so)"))
1798 (for-each (lambda (file)
1799 (rename-file file (string-append pualib "/" (basename file))))
1800 (find-files out ".*pulse\\.(la|so)"))
1803 `(("alsa-lib" ,alsa-lib)
1805 ("speex" ,speex) ; libspeexdsp resampling plugin
1806 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1807 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1808 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1810 `(("pkg-config" ,pkg-config)))
1811 (home-page "http://www.alsa-project.org/")
1812 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1814 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1815 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1816 by providing additional plugins which include: upmixing, downmixing, jackd and
1817 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1818 external rate conversion.")
1819 (license (list license:gpl2+
1820 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1821 license:lgpl2.1+))))
1823 (define-public iptables
1830 "mirror://netfilter.org/iptables/iptables-"
1831 version ".tar.bz2"))
1834 "0z0mgs1ghvn3slc868mgbf2g26njgrzcy5ggyb5w4i55j1a3lflr"))))
1835 (build-system gnu-build-system)
1837 `(("pkg-config" ,pkg-config)
1841 `(("libmnl" ,libmnl)
1842 ("libnftnl" ,libnftnl)))
1844 '(#:tests? #f ; no test suite
1845 #:configure-flags ; add $libdir to the RUNPATH of executables
1846 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1847 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1848 (synopsis "Programs to configure Linux IP packet filtering rules")
1850 "@command{iptables} is the user-space command line program used to
1851 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1852 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1854 This package also includes @command{ip6tables}, which is used to configure the
1857 Both commands are targeted at system administrators.")
1858 (license license:gpl2+)))
1860 (define-public lsscsi
1867 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
1870 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
1871 (build-system gnu-build-system)
1872 (synopsis "Lists information about SCSI or NVMe devices in Linux")
1873 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
1875 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
1876 also list NVMe namespaces or controllers and show the relationship between a
1877 device's primary node name, its SCSI generic (sg) node name and its kernel
1879 (license license:gpl2)))
1881 (define-public ebtables
1888 "mirror://netfilter.org/ebtables/ebtables-"
1892 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
1893 (build-system gnu-build-system)
1896 ("iptables" ,iptables)))
1897 (synopsis "Ethernet bridge frame table administration")
1898 (home-page "https://ebtables.netfilter.org/")
1900 "ebtables is an application program used to set up and maintain the
1901 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1902 analogous to the iptables application, but less complicated, due to the fact
1903 that the Ethernet protocol is much simpler than the IP protocol.")
1904 (license license:gpl2+)))
1906 (define-public iproute
1913 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1917 "0ywg70f98wgfai35jl47xzpjp45a6n7crja4vc8ql85cbi1l7ids"))))
1918 (build-system gnu-build-system)
1920 `( ;; There is a test suite, but it wants network namespaces and sudo.
1922 #:make-flags (let ((out (assoc-ref %outputs "out")))
1924 (string-append "BASH_COMPDIR=" out
1925 "/etc/bash_completion.d")
1926 (string-append "LIBDIR=" out "/lib")
1927 (string-append "HDRDIR=" out "/include")
1928 (string-append "SBINDIR=" out "/sbin")
1929 (string-append "CONFDIR=" out "/etc")
1930 (string-append "DOCDIR=" out "/share/doc/"
1932 (string-append "MANDIR=" out "/share/man")))
1933 #:phases (modify-phases %standard-phases
1934 (add-before 'install 'pre-install
1936 ;; Don't attempt to create /var/lib/arpd.
1937 (substitute* "Makefile"
1938 (("^.*ARPDDIR.*$") ""))
1942 ("iptables" ,iptables)
1943 ("libmnl" ,libmnl)))
1947 ("pkg-config" ,pkg-config)))
1949 ;; ("libmnl" ,libmnl)
1950 ;; ("util-linux" ,util-linux)
1952 "https://wiki.linuxfoundation.org/networking/iproute2")
1954 "Utilities for controlling TCP/IP networking and traffic in Linux")
1956 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1957 and traffic with the Linux kernel. The most important of these are
1958 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1961 Most network configuration manuals still refer to ifconfig and route as the
1962 primary network configuration tools, but ifconfig is known to behave
1963 inadequately in modern network environments, and both should be deprecated.")
1964 (license license:gpl2+)))
1966 (define-public net-tools
1967 ;; XXX: This package is basically unmaintained, but it provides a few
1968 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1970 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1974 (version (string-append "1.60-" revision "." (string-take commit 7)))
1977 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1978 "n/ne/net-tools/code.git/net-tools-code-"
1980 (file-name (string-append name "-" version ".zip"))
1983 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1984 (home-page "http://net-tools.sourceforge.net/")
1985 (build-system gnu-build-system)
1987 '(#:modules ((guix build gnu-build-system)
1992 (modify-phases %standard-phases
1994 (lambda* (#:key outputs #:allow-other-keys)
1995 (let ((out (assoc-ref outputs "out")))
1996 (mkdir-p (string-append out "/bin"))
1997 (mkdir-p (string-append out "/sbin"))
1999 ;; Pretend we have everything...
2000 (system "yes | make config")
2002 ;; ... except for the things we don't have.
2003 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2004 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2005 ;; that have been removed.
2006 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2007 ;; think about adding them later.
2008 (substitute* '("config.make" "config.h")
2009 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2012 (add-after 'install 'remove-redundant-commands
2013 (lambda* (#:key outputs #:allow-other-keys)
2014 ;; Remove commands and man pages redundant with Inetutils.
2015 (let* ((out (assoc-ref outputs "out"))
2016 (dup (append-map (cut find-files out <>)
2018 "^(yp|nis|dns)?domainname"))))
2019 (for-each delete-file dup)
2021 ;; Binaries that depend on libnet-tools.a don't declare that
2022 ;; dependency, making it parallel-unsafe.
2023 #:parallel-build? #f
2025 #:tests? #f ; no test suite
2026 #:make-flags (let ((out (assoc-ref %outputs "out")))
2028 (string-append "BASEDIR=" out)
2029 (string-append "INSTALLNLSDIR=" out "/share/locale")
2030 (string-append "mandir=/share/man")))))
2031 (native-inputs `(("gettext" ,gettext-minimal)
2033 (synopsis "Tools for controlling the network subsystem in Linux")
2035 "This package includes the important tools for controlling the network
2036 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2037 route. Additionally, this package contains utilities relating to particular
2038 network hardware types (plipconfig, slattach) and advanced aspects of IP
2039 configuration (iptunnel, ipmaddr).")
2040 (license license:gpl2+))))
2042 (define-public libcap
2049 "mirror://kernel.org/linux/libs/security/linux-privs/"
2050 "libcap2/libcap-" version ".tar.xz"))
2053 "0sj8kidl7qgf2qwxcbw1vadnlb30y4zvjzxswsmfdghq04npkhfs"))))
2054 (build-system gnu-build-system)
2055 (arguments '(#:phases
2056 (modify-phases %standard-phases
2058 ;; Add $libdir to the RUNPATH of executables.
2060 (substitute* "Make.Rules"
2062 (string-append "LDFLAGS := -Wl,-rpath="
2065 #:tests? #f ; no 'check' target
2066 #:make-flags (list "lib=lib"
2067 (string-append "prefix="
2068 (assoc-ref %outputs "out"))
2069 "RAISE_SETFCAP=no")))
2070 (native-inputs `(("perl" ,perl)))
2071 (inputs `(("attr" ,attr)))
2072 (home-page "https://sites.google.com/site/fullycapable/")
2073 (synopsis "Library for working with POSIX capabilities")
2075 "Libcap2 provides a programming interface to POSIX capabilities on
2076 Linux-based operating systems.")
2078 ;; License is BSD-3 or GPLv2, at the user's choice.
2079 (license license:gpl2)))
2081 (define-public bridge-utils
2083 (name "bridge-utils")
2088 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2089 "bridge-utils-" version ".tar.xz"))
2091 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
2092 (build-system gnu-build-system)
2094 ;; The tarball lacks all the generated files.
2095 (native-inputs `(("autoconf" ,autoconf)
2096 ("automake" ,automake)))
2099 (modify-phases %standard-phases
2100 (add-before 'bootstrap 'patch-stuff
2102 ;; Fix "field ‘ip6’ has incomplete type" errors.
2103 (substitute* "libbridge/libbridge.h"
2104 (("#include <linux/if_bridge.h>")
2105 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2107 ;; Ensure that the entire build fails if one of the
2108 ;; sub-Makefiles fails.
2109 (substitute* "Makefile.in"
2110 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2111 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2114 #:tests? #f)) ; no 'check' target
2116 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2117 (synopsis "Manipulate Ethernet bridges")
2119 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2120 to connect two Ethernet segments together in a protocol independent way.
2121 Packets are forwarded based on Ethernet address, rather than IP address (like
2122 a router). Since forwarding is done at Layer 2, all protocols can go
2123 transparently through a bridge.")
2124 (license license:gpl2+)))
2126 (define-public libnl
2133 "https://github.com/thom311/libnl/releases/download/"
2134 "libnl" (string-join (string-split version #\.) "_")
2135 "/libnl-" version ".tar.gz"))
2138 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2139 (build-system gnu-build-system)
2143 ("pkg-config" ,pkg-config)
2149 "https://github.com/thom311/libnl/releases/download/libnl"
2150 (string-join (string-split version #\.) "_")
2151 "/libnl-doc-" version ".tar.gz"))
2153 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2155 `(("python-2" ,python-2)
2156 ("python-3" ,python-3)))
2157 (outputs '("out" "doc" "python2" "python3"))
2159 `(#:modules ((guix build gnu-build-system)
2163 (modify-phases %standard-phases
2164 (add-after 'install 'install-python
2165 (lambda* (#:key outputs #:allow-other-keys)
2166 (define (python-inst python)
2167 (invoke python "setup.py" "build")
2168 (invoke python "setup.py" "install"
2169 (string-append "--prefix="
2170 (assoc-ref %outputs python)))
2171 (invoke python "setup.py" "clean"))
2172 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2173 (assoc-ref %outputs "out")))
2174 (with-directory-excursion "./python"
2175 (for-each python-inst '("python2" "python3")))
2177 (add-after 'install 'install-doc
2178 (lambda* (#:key inputs outputs #:allow-other-keys)
2179 (let ((dest (string-append (assoc-ref outputs "doc")
2180 "/share/doc/libnl")))
2182 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
2183 "--strip-components=1" "-C" dest)))))))
2184 (home-page "https://www.infradead.org/~tgr/libnl/")
2185 (synopsis "NetLink protocol library suite")
2187 "The libnl suite is a collection of libraries providing APIs to netlink
2188 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2189 between the kernel and user space processes. It was designed to be a more
2190 flexible successor to ioctl to provide mainly networking related kernel
2191 configuration and monitoring interfaces.")
2193 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2194 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2195 (license license:gpl2)))
2204 "mirror://kernel.org/software/network/iw/iw-"
2208 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2209 (build-system gnu-build-system)
2210 (native-inputs `(("pkg-config" ,pkg-config)))
2211 (inputs `(("libnl" ,libnl)))
2214 (let* ((target ,(%current-target-system))
2215 (gcc (if target (string-append target "-gcc") "gcc"))
2216 (pkg-config (if target
2217 (string-append target "-pkg-config")
2220 (string-append "CC=" gcc)
2221 (string-append "PKG_CONFIG="
2222 (assoc-ref %build-inputs "pkg-config")
2224 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2225 #:phases (modify-phases %standard-phases (delete 'configure))))
2226 (home-page "https://wireless.wiki.kernel.org/")
2227 (synopsis "Tool for configuring wireless devices")
2229 "iw is a new nl80211 based CLI configuration utility for wireless
2230 devices. It replaces @code{iwconfig}, which is deprecated.")
2231 (license license:isc)))
2233 (define-public powertop
2240 (uri (string-append "https://01.org/sites/default/files/downloads/"
2241 "powertop-v" version "-1-g7ef7f79.tar_0.gz"))
2243 (base32 "0kynypj5cydfbma0ssblq1k4m1arixc1s2vf0ybv8y2gg09wjs5f"))))
2244 (build-system gnu-build-system)
2247 (modify-phases %standard-phases
2248 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2249 ;; allow calibrating the network interface in Guix System.
2250 (add-after 'unpack 'patch-absolute-file-names
2251 (lambda* (#:key inputs #:allow-other-keys)
2252 (let ((kmod (assoc-ref inputs "kmod")))
2253 (substitute* (find-files "src" "\\.cpp$")
2254 ;; Give the right 'modprobe' file name so that essential
2255 ;; modules such as msr.ko can be loaded.
2256 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2257 ;; These programs are only needed to calibrate, so using
2258 ;; relative file names avoids adding extra inputs. When they
2259 ;; are missing powertop gracefully handles it.
2260 (("/usr/bin/hcitool") "hcitool")
2261 (("/usr/bin/xset") "xset")
2262 (("/usr/sbin/hciconfig") "hciconfig"))
2267 ("ncurses" ,ncurses)
2268 ("pciutils" ,pciutils)
2271 `(("pkg-config" ,pkg-config)))
2272 (home-page "https://01.org/powertop/")
2273 (synopsis "Analyze power consumption on Intel-based laptops")
2275 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2276 power management. In addition to being a diagnostic tool, PowerTOP also has
2277 an interactive mode where the user can experiment various power management
2278 settings for cases where the operating system has not enabled these
2280 (license license:gpl2)))
2282 (define-public aumix
2289 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2290 version ".tar.bz2"))
2293 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2294 (build-system gnu-build-system)
2295 (inputs `(("ncurses" ,ncurses)))
2296 (home-page "http://www.jpj.net/~trevor/aumix.html")
2297 (synopsis "Audio mixer for X and the console")
2299 "Aumix adjusts an audio mixer from X, the console, a terminal,
2300 the command line or a script.")
2301 (license license:gpl2+)))
2303 (define-public iotop
2310 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2313 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2314 (build-system python-build-system)
2317 (modify-phases %standard-phases
2318 (add-after 'unpack 'fix-build-with-python3
2320 (substitute* "setup.py"
2321 (("itervalues") "values"))
2323 ;; There are currently no checks in the package.
2325 (native-inputs `(("python" ,python)))
2326 (home-page "http://guichaz.free.fr/iotop/")
2328 "Displays the IO activity of running processes")
2330 "Iotop is a Python program with a top like user interface to show the
2331 processes currently causing I/O.")
2332 (license license:gpl2+)))
2340 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2341 "download/fuse-" version
2342 "/fuse-" version ".tar.gz"))
2345 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2346 (patches (search-patches "fuse-overlapping-headers.patch"))))
2347 (build-system gnu-build-system)
2348 (inputs `(("util-linux" ,util-linux)))
2350 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2351 (assoc-ref %outputs "out")
2353 (string-append "INIT_D_PATH="
2354 (assoc-ref %outputs "out")
2357 ;; The rule makes /dev/fuse 666.
2358 (string-append "UDEV_RULES_PATH="
2359 (assoc-ref %outputs "out")
2360 "/lib/udev/rules.d"))
2362 (modify-phases %standard-phases
2363 (add-before 'build 'set-file-names
2364 (lambda* (#:key inputs #:allow-other-keys)
2365 ;; libfuse calls out to mount(8) and umount(8). Make sure
2366 ;; it refers to the right ones.
2367 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2368 (("/bin/(u?)mount" _ maybe-u)
2369 (string-append (assoc-ref inputs "util-linux")
2370 "/bin/" maybe-u "mount")))
2371 (substitute* '("util/mount.fuse.c")
2375 ;; This hack leads libfuse to search for 'fusermount' in
2376 ;; $PATH, where it may find a setuid-root binary, instead of
2377 ;; trying solely $out/sbin/fusermount and failing because
2379 (substitute* "lib/Makefile"
2380 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2381 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2383 (home-page "https://github.com/libfuse/libfuse")
2384 (synopsis "Support file systems implemented in user space")
2386 "As a consequence of its monolithic design, file system code for Linux
2387 normally goes into the kernel itself---which is not only a robustness issue,
2388 but also an impediment to system extensibility. FUSE, for \"file systems in
2389 user space\", is a kernel module and user-space library that tries to address
2390 part of this problem by allowing users to run file system implementations as
2391 user-space processes.")
2392 (license (list license:lgpl2.1 ;library
2393 license:gpl2+)))) ;command-line utilities
2395 (define-public unionfs-fuse
2397 (name "unionfs-fuse")
2402 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
2404 (file-name (string-append name "-" version ".tar.gz"))
2407 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
2408 (build-system cmake-build-system)
2410 `(("python" ,python)))
2411 (inputs `(("fuse" ,fuse)))
2413 ;; The tests were never actually run ("collected 0 items"), but in recent
2414 ;; versions of pytest that causes an error.
2416 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2417 (synopsis "User-space union file system")
2419 "UnionFS-FUSE is a flexible union file system implementation in user
2420 space, using the FUSE library. Mounting a union file system allows you to
2421 \"aggregate\" the contents of several directories into a single mount point.
2422 UnionFS-FUSE additionally supports copy-on-write.")
2423 (license license:bsd-3)))
2426 (package (inherit fuse)
2427 (name "fuse-static")
2428 (source (origin (inherit (package-source fuse))
2429 (modules '((guix build utils)))
2432 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2433 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2434 ;; that it doesn't do that, allowing us to remove the
2435 ;; dependency on util-linux (something that is useful in
2437 (substitute* '("lib/mount_util.c"
2438 "util/mount_util.c")
2439 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2445 (define-public unionfs-fuse/static
2446 (package (inherit unionfs-fuse)
2447 (synopsis "User-space union file system (statically linked)")
2448 (name (string-append (package-name unionfs-fuse) "-static"))
2449 (source (origin (inherit (package-source unionfs-fuse))
2450 (modules '((guix build utils)))
2453 ;; Add -ldl to the libraries, because libfuse.a needs that.
2454 (substitute* "src/CMakeLists.txt"
2455 (("target_link_libraries(.*)\\)" _ libs)
2456 (string-append "target_link_libraries"
2461 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2463 (modify-phases %standard-phases
2464 (add-after 'install 'post-install
2465 (lambda* (#:key outputs #:allow-other-keys)
2466 (let* ((out (assoc-ref outputs "out"))
2467 (exe (string-append out "/bin/unionfs")))
2468 ;; By default, 'unionfs' keeps references to
2469 ;; $glibc/share/locale and similar stuff. Remove them.
2470 (remove-store-references exe)
2472 ;; 'unionfsctl' has references to glibc as well. Since
2473 ;; we don't need it, remove it.
2474 (delete-file (string-append out "/bin/unionfsctl"))
2476 (inputs `(("fuse" ,fuse-static)))))
2478 (define-public sshfs
2484 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2485 "download/sshfs-" version "/sshfs-" version
2489 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2490 (build-system gnu-build-system)
2495 `(("pkg-config" ,pkg-config)))
2496 (home-page "https://github.com/libfuse/sshfs")
2497 (synopsis "Mount remote file systems over SSH")
2499 "This is a file system client based on the SSH File Transfer Protocol.
2500 Since most SSH servers already support this protocol it is very easy to set
2501 up: on the server side there's nothing to do; on the client side mounting the
2502 file system is as easy as logging into the server with an SSH client.")
2503 (license license:gpl2+)))
2505 (define-public sshfs-fuse
2506 (package (inherit sshfs)
2508 (properties `((superseded . ,sshfs)))))
2510 (define-public archivemount
2512 (name "archivemount")
2517 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2518 "archivemount-" version ".tar.gz"))
2520 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2521 (build-system gnu-build-system)
2522 (inputs `(("fuse" ,fuse)
2523 ("libarchive" ,libarchive)))
2524 (native-inputs `(("pkg-config" ,pkg-config)))
2525 (home-page "https://www.cybernoia.de/software/archivemount.html")
2526 (synopsis "Tool for mounting archive files with FUSE")
2527 (description "archivemount is a FUSE-based file system for Unix variants,
2528 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2529 mount point where it can be read from or written to as with any other file
2530 system. This makes accessing the contents of the archive, which may be
2531 compressed, transparent to other programs, without decompressing them.")
2532 (license license:lgpl2.0+)))
2534 (define-public numactl
2541 "https://github.com/numactl/numactl/releases/download/v"
2542 version "/numactl-" version ".tar.gz"))
2545 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2546 (build-system gnu-build-system)
2548 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2549 ;; to run, which we can't assume to have.
2552 ;; NUMA is apparently not supported on armhf, see
2553 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2554 (supported-systems (delete "armhf-linux" %supported-systems))
2555 (home-page "https://github.com/numactl/numactl")
2556 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2558 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2559 memory is not all in one place. The @command{numactl} program allows you to
2560 run your application program on specific CPUs and memory nodes. It does this
2561 by supplying a NUMA memory policy to the operating system before running your
2564 The package contains other commands, such as @command{numastat},
2565 @command{memhog}, and @command{numademo} which provides a quick overview of
2566 NUMA performance on your system.")
2567 (license (list license:gpl2 ;programs
2568 license:lgpl2.1)))) ;library
2570 (define-public kbd-neo
2577 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2578 version "/linux/console/neo.map"))
2579 (file-name (string-append name "-" version ".map"))
2582 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2583 (build-system trivial-build-system)
2585 `(#:modules ((guix build utils))
2587 (use-modules (guix build utils))
2588 (let ((out (string-append %output "/share/keymaps"))
2589 (source (assoc-ref %build-inputs "source")))
2591 (copy-file source (string-append out "/neo.map"))
2593 (home-page "https://neo-layout.org")
2594 (synopsis "Neo2 console layout")
2596 "Kbd-neo provides the Neo2 keyboard layout for use with
2597 @command{loadkeys(1)} from @code{kbd(4)}.")
2598 ;; The file is located in an svn directory, the entire content of
2599 ;; the directory is licensed as GPL3.
2600 (license license:gpl3+)))
2608 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2612 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2613 (modules '((guix build utils)))
2616 (substitute* "tests/Makefile.in"
2617 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2620 (substitute* '("src/unicode_start" "src/unicode_stop")
2621 ;; Assume the Coreutils are in $PATH.
2625 (build-system gnu-build-system)
2628 (modify-phases %standard-phases
2629 (add-before 'build 'pre-build
2630 (lambda* (#:key inputs #:allow-other-keys)
2631 (let ((gzip (assoc-ref %build-inputs "gzip"))
2632 (bzip2 (assoc-ref %build-inputs "bzip2")))
2633 (substitute* "src/libkeymap/findfile.c"
2635 (string-append gzip "/bin/gzip"))
2637 (string-append bzip2 "/bin/bzip2")))
2639 (add-after 'install 'post-install
2640 (lambda* (#:key outputs #:allow-other-keys)
2641 ;; Make sure these programs find their comrades.
2642 (let* ((out (assoc-ref outputs "out"))
2643 (bin (string-append out "/bin")))
2644 (for-each (lambda (prog)
2645 (wrap-program (string-append bin "/" prog)
2646 `("PATH" ":" prefix (,bin))))
2647 '("unicode_start" "unicode_stop"))
2649 (inputs `(("check" ,check)
2652 ("pam" ,linux-pam)))
2653 (native-search-paths
2654 (list (search-path-specification
2655 (variable "LOADKEYS_KEYMAP_PATH")
2656 ;; Append ‘/**’ to recursively search all directories. One can then
2657 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2658 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2659 (files (list "share/keymaps/**")))))
2660 (native-inputs `(("pkg-config" ,pkg-config)))
2661 (home-page "http://kbd-project.org/")
2662 (synopsis "Linux keyboard utilities and keyboard maps")
2664 "This package contains keytable files and keyboard utilities compatible
2665 for systems using the Linux kernel. This includes commands such as
2666 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2667 (license license:gpl2+)))
2669 (define-public loadkeys-static
2672 (name "loadkeys-static")
2674 (substitute-keyword-arguments (package-arguments kbd)
2675 ((#:configure-flags flags ''())
2676 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2677 "--disable-vlock" ;so we don't need libpam
2678 "--disable-libkeymap")
2680 ((#:make-flags flags ''())
2681 `(cons "LDFLAGS=-all-static" ,flags))
2682 ((#:phases phases '%standard-phases)
2683 `(modify-phases ,phases
2685 (lambda* (#:key outputs #:allow-other-keys)
2686 (let ((out (assoc-ref outputs "out")))
2687 ;; The binary keeps references to gzip, among other things,
2688 ;; which we don't need in the initrd, so strip references.
2689 (remove-store-references "src/loadkeys")
2691 (install-file "src/loadkeys"
2692 (string-append out "/bin"))
2694 (delete 'post-install)))
2695 ((#:strip-flags _ '())
2697 ((#:allowed-references _ '())
2700 (synopsis "Statically-linked @command{loadkeys} program")
2702 ;; This package is meant to be used internally in the initrd so don't
2704 (properties '((hidden? . #t)))))
2706 (define-public inotify-tools
2708 (name "inotify-tools")
2713 (url "https://github.com/rvoicilas/inotify-tools.git")
2715 (file-name (git-file-name name version))
2718 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2719 (build-system gnu-build-system)
2721 `(("autoconf" ,autoconf)
2722 ("automake" ,automake)
2723 ("libtool" ,libtool)))
2724 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2725 (synopsis "Monitor file accesses")
2727 "The inotify-tools packages provides a C library and command-line tools
2728 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2729 (license license:gpl2+)))
2738 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2739 "kmod-" version ".tar.xz"))
2742 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2743 (patches (search-patches "kmod-module-directory.patch"))))
2744 (build-system gnu-build-system)
2746 `(("pkg-config" ,pkg-config)))
2751 `(#:tests? #f ; FIXME: Investigate test failures
2752 #:configure-flags '("--with-xz" "--with-zlib")
2754 (modify-phases %standard-phases
2755 (add-after 'install 'install-modprobe&co
2756 (lambda* (#:key outputs #:allow-other-keys)
2757 (let* ((out (assoc-ref outputs "out"))
2758 (bin (string-append out "/bin")))
2759 (for-each (lambda (tool)
2761 (string-append bin "/" tool)))
2762 '("insmod" "rmmod" "lsmod" "modprobe"
2763 "modinfo" "depmod"))
2765 (home-page "https://www.kernel.org/")
2766 (synopsis "Kernel module tools")
2767 (description "Kmod is a set of tools to handle common tasks with Linux
2768 kernel modules like insert, remove, list, check properties, resolve
2769 dependencies and aliases.
2771 These tools are designed on top of libkmod, a library that is shipped with
2772 kmod. The aim is to be compatible with tools, configurations and indices
2773 from the module-init-tools project.")
2774 (license license:gpl2+))) ; library under lgpl2.1+
2776 (define-public earlyoom
2783 (url "https://github.com/rfjakob/earlyoom.git")
2784 (commit (string-append "v" version))))
2785 (file-name (git-file-name name version))
2788 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
2789 (build-system gnu-build-system)
2791 `(#:phases (modify-phases %standard-phases
2793 (add-before 'check 'set-home
2795 (setenv "HOME" (getcwd))
2797 (add-after 'build 'install-contribs
2798 ;; Install what seems useful from the contrib directory.
2799 (lambda* (#:key outputs #:allow-other-keys)
2800 (let* ((out (assoc-ref outputs "out"))
2801 (contrib (string-append
2802 out "/share/earlyoom/contrib")))
2803 (install-file "contrib/notify_all_users.py" contrib)
2805 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
2807 (string-append "VERSION=v" ,version)
2808 (string-append "PREFIX=" prefix)
2809 (string-append "SYSCONFDIR=" prefix "/etc")))
2810 #:test-target "test"))
2811 (native-inputs `(("go" ,go) ;for the test suite
2812 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
2813 (home-page "https://github.com/rfjakob/earlyoom")
2814 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
2815 (description "Early OOM is a minimalist out of memory (OOM) daemon that
2816 runs in user space and provides a more responsive and configurable alternative
2817 to the in-kernel OOM killer.")
2818 (license license:expat)))
2820 (define-public eudev
2821 ;; The post-systemd fork, maintained by Gentoo.
2827 (uri (git-reference (url "https://github.com/gentoo/eudev")
2828 (commit (string-append "v" version))))
2829 (file-name (git-file-name name version))
2832 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
2833 (patches (search-patches "eudev-rules-directory.patch"))))
2834 (build-system gnu-build-system)
2837 (modify-phases %standard-phases
2838 (add-after 'unpack 'make-source-writable
2840 ;; XXX: Git checkouts are read-only, but this package needs to
2841 ;; modify some of its files.
2842 (for-each make-file-writable (find-files "."))
2844 (add-before 'bootstrap 'patch-file-names
2845 (lambda* (#:key inputs #:allow-other-keys)
2846 (substitute* "man/make.sh"
2847 (("/usr/bin/xsltproc")
2848 (string-append (assoc-ref inputs "xsltproc")
2851 (add-after 'install 'move-static-library
2852 (lambda* (#:key outputs #:allow-other-keys)
2853 (let* ((out (assoc-ref outputs "out"))
2854 (static (assoc-ref outputs "static"))
2855 (source (string-append out "/lib/libudev.a"))
2856 (target (string-append static "/lib/libudev.a")))
2857 (mkdir-p (dirname target))
2858 (link source target)
2859 (delete-file source)
2860 ;; Remove reference to the static library from the .la file
2861 ;; such that Libtool looks for it in the usual places.
2862 (substitute* (string-append out "/lib/libudev.la")
2864 "old_library=''\n"))
2866 (add-after 'install 'build-hwdb
2867 (lambda* (#:key outputs #:allow-other-keys)
2868 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2869 ;; similar tools to display product names.
2870 (let ((out (assoc-ref outputs "out")))
2871 (invoke (string-append out "/bin/udevadm")
2872 "hwdb" "--update")))))
2873 #:configure-flags (list "--enable-manpages")))
2875 `(("autoconf" ,autoconf)
2876 ("automake" ,automake)
2878 ("libtool" ,libtool)
2879 ("pkg-config" ,pkg-config)
2882 ("python" ,python-wrapper)
2883 ;; For documentation.
2884 ("docbook-xml" ,docbook-xml-4.2)
2885 ("docbook-xsl" ,docbook-xsl)
2886 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2887 ("xsltproc" ,libxslt)))
2889 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2890 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2891 ;; which contains the rules to do that.
2892 `(("util-linux" ,util-linux) ;for blkid
2894 (outputs '("out" "static"))
2895 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2896 (synopsis "Userspace device management")
2897 (description "Udev is a daemon which dynamically creates and removes
2898 device nodes from /dev/, handles hotplug events and loads drivers at boot
2900 (license license:gpl2+)))
2902 ;; TODO: Merge with eudev on the next rebuild cycle.
2903 (define-public eudev/btrfs-fix
2906 (version (string-append (package-version eudev) "-1"))
2908 (substitute-keyword-arguments (package-arguments eudev)
2909 ((#:phases phases '%standard-phases)
2910 `(modify-phases ,phases
2911 (add-before 'configure 'patch-bindir-in-btrfs-rules
2912 (lambda* (#:key outputs #:allow-other-keys)
2913 ;; The "@bindir@" substitution incorrectly expands to a literal
2914 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
2916 (let ((out (assoc-ref outputs "out")))
2917 (substitute* "rules/64-btrfs.rules.in"
2919 (string-append out "/bin")))
2922 (define-public eudev-with-hwdb
2923 (deprecated-package "eudev-with-hwdb" eudev))
2931 (uri (list (string-append "ftp://sourceware.org/pub/lvm2/LVM2."
2933 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2937 "1j0yis658564rk1ddabkl8vbavp0fdd10gd6qhgyzc3akzf620kf"))
2938 (modules '((guix build utils)))
2941 (use-modules (guix build utils))
2943 ;; Honor sysconfdir.
2944 (substitute* "make.tmpl.in"
2946 "confdir = @sysconfdir@\n")
2947 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2948 "DEFAULT_SYS_DIR = @sysconfdir@"))
2950 (patches (search-patches "lvm2-static-link.patch"))))
2951 (build-system gnu-build-system)
2953 `(("pkg-config" ,pkg-config)
2954 ("procps" ,procps))) ;tests use 'pgrep'
2956 `(("libaio" ,libaio)
2960 (modify-phases %standard-phases
2961 (add-after 'configure 'set-makefile-shell
2963 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2965 (setenv "SHELL" (which "sh"))
2967 ;; Replace /bin/sh with the right file name.
2968 (patch-makefile-SHELL "make.tmpl")
2971 #:configure-flags (list (string-append "--sysconfdir="
2972 (assoc-ref %outputs "out")
2974 "--enable-udev_sync"
2975 "--enable-udev_rules"
2976 "--enable-pkgconfig"
2978 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
2980 ;; Make sure programs such as 'dmsetup' can
2981 ;; find libdevmapper.so.
2982 (string-append "LDFLAGS=-Wl,-rpath="
2983 (assoc-ref %outputs "out")
2985 (assoc-ref %outputs "out")
2986 "/lib/device-mapper"))
2988 ;; The tests use 'mknod', which requires root access.
2990 (home-page "https://sourceware.org/lvm2/")
2991 (synopsis "Logical volume management for Linux")
2993 "LVM2 is the logical volume management tool set for Linux-based systems.
2994 This package includes the user-space libraries and tools, including the device
2995 mapper. Kernel components are part of Linux-libre.")
2997 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2998 ;; Command-line tools are GPLv2.
2999 (license (list license:gpl2 license:lgpl2.1))))
3001 (define-public lvm2-static
3004 (name "lvm2-static")
3006 ;; Propagate udev because libdevmapper.a depends on libudev.
3007 (propagated-inputs `(("udev:static" ,eudev "static")))
3010 (substitute-keyword-arguments (package-arguments lvm2)
3011 ((#:configure-flags flags '())
3012 ;; LVM2 doesn't use Libtool, hence the custom option.
3013 `(append '("--enable-static_link")
3014 ;; Building dmeventd statically is complicated due to a
3015 ;; requirement on libdevmapper.a, which is being phased out
3016 ;; in favor of libdevice-mapper.a, which in turn is is not
3017 ;; easily made available at dmeventd build time. Just ignore
3018 ;; it until the situation improves.
3019 (delete "--enable-dmeventd" ,flags)))
3021 `(modify-phases ,phases
3022 (add-before 'configure 'adjust-Makefile
3024 ;; These fixes are related to the upstream libdm->device_mapper
3025 ;; migration and will hopefully be fixed upstream in due time.
3026 (substitute* "tools/Makefile.in"
3027 ;; This variable is empty in a static configuration and causes
3028 ;; an erroneous GCC command line.
3029 (("-L\\$\\(interfacebuilddir\\)") "")
3030 ;; Remove obsolete reference to libdevmapper.a.
3031 (("-ldevmapper") ""))
3033 (synopsis "Logical volume management for Linux (statically linked)")))
3035 (define-public wireless-tools
3037 (name "wireless-tools")
3041 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3045 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3048 ;; Remove the older header files that are not free software.
3049 (for-each (lambda (n)
3050 (delete-file (format #f "wireless.~a.h" n)))
3051 '(10 11 12 13 14 15 16 17 18 19 20))
3053 (build-system gnu-build-system)
3056 (list (string-append "PREFIX=" %output)
3057 (string-append "INSTALL_MAN=" %output "/share/man")
3058 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3061 (modify-phases %standard-phases
3063 (lambda* (#:key target #:allow-other-keys)
3064 (when ,(%current-target-system)
3065 ;; Cross-compilation: use the cross tools.
3066 (substitute* (find-files "." "Makefile")
3068 (string-append "CC = " target "-gcc\n"))
3070 (string-append "AR = " target "-ar\n"))
3072 (string-append "RANLIB = " target "-ranlib\n"))))
3075 (synopsis "Tools for manipulating Linux Wireless Extensions")
3076 (description "Wireless Tools are used to manipulate the now-deprecated
3077 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3078 Extension was an interface allowing you to set Wireless LAN specific
3079 parameters and get the specific stats. It is deprecated in favor the nl80211
3081 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3082 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3083 ;; other files are distributed under gpl2.
3084 (license (list license:gpl2 license:lgpl2.1+))))
3092 (uri (string-append "mirror://kernel.org/software/network/crda/"
3093 "crda-" version ".tar.xz"))
3096 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3097 (patches (search-patches "crda-optional-gcrypt.patch"))))
3098 (build-system gnu-build-system)
3100 '(#:phases (modify-phases %standard-phases
3102 (add-after 'unpack 'gzip-determinism
3104 (substitute* "Makefile"
3105 (("gzip") "gzip --no-name"))
3108 'build 'no-werror-no-ldconfig
3110 (substitute* "Makefile"
3112 (("ldconfig") "true"))
3115 'build 'set-regulator-db-file-name
3116 (lambda* (#:key inputs #:allow-other-keys)
3117 ;; Tell CRDA where to find our database.
3118 (let ((regdb (assoc-ref inputs "wireless-regdb")))
3119 (substitute* "crda.c"
3120 (("\"/lib/crda/regulatory.bin\"")
3121 (string-append "\"" regdb
3122 "/lib/crda/regulatory.bin\"")))
3124 #:test-target "verify"
3125 #:make-flags (let ((out (assoc-ref %outputs "out"))
3126 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3127 (list "CC=gcc" "V=1"
3129 ;; Disable signature-checking on 'regulatory.bin'.
3130 ;; The reason is that this simplifies maintenance
3131 ;; on our side (no need to manage a distro key
3132 ;; pair), and we can guarantee integrity of
3133 ;; 'regulatory.bin' by other means anyway, such as
3134 ;; 'guix gc --verify'. See
3135 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3139 (string-append "PREFIX=" out)
3140 (string-append "SBINDIR=" out "/sbin/")
3141 (string-append "UDEV_RULE_DIR="
3142 out "/lib/udev/rules.d")
3143 (string-append "LDFLAGS=-Wl,-rpath="
3145 (string-append "REG_BIN=" regdb
3146 "/lib/crda/regulatory.bin")))))
3147 (native-inputs `(("pkg-config" ,pkg-config)
3148 ("wireless-regdb" ,wireless-regdb)))
3149 (inputs `(("libnl" ,libnl)))
3151 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3152 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3154 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3155 communication between the kernel Linux and user space for regulatory
3157 (license license:copyleft-next)))
3159 (define-public wireless-regdb
3161 (name "wireless-regdb")
3162 (version "2019.06.03")
3166 "mirror://kernel.org/software/network/wireless-regdb/"
3167 "wireless-regdb-" version ".tar.xz"))
3170 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
3172 ;; We're building 'regulatory.bin' by ourselves.
3174 (delete-file "regulatory.bin")
3176 (build-system gnu-build-system)
3179 (modify-phases %standard-phases
3180 (add-after 'unpack 'gzip-determinism
3182 (substitute* "Makefile"
3183 (("gzip") "gzip --no-name"))
3185 (add-after 'unpack 'omit-signature
3187 (substitute* "Makefile"
3188 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3189 ;; don't provide (see below). Disable it.
3190 ((" regulatory\\.db\\.p7s") "")
3191 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3192 ;; but ‘make install’ depends only on the latter while installing
3193 ;; both (and failing). Depend on it explicitly.
3194 (("^install: " all) (string-append all "regulatory.db ")))
3196 (delete 'configure)) ; no configure script
3198 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3199 ;; is computed and can be equal to 'maintainer-clean'; when that
3200 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3201 ;; just built. Thus, build things sequentially.
3202 #:parallel-build? #f
3204 #:tests? #f ; no tests
3206 (let ((out (assoc-ref %outputs "out")))
3207 (list (string-append "PREFIX=" out)
3208 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3210 ;; Leave this empty so that db2bin.py doesn't try to sign
3211 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3212 ;; pair for the whole distribution.
3213 (string-append "REGDB_PRIVKEY=")
3214 ;; Don't generate a public key for the same reason. These are
3215 ;; used as Makefile targets and can't be the empty string.
3216 (string-append "REGDB_PUBCERT=/dev/null")
3217 (string-append "REGDB_PUBKEY=/dev/null")))))
3219 `(("python" ,python-wrapper)))
3221 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3222 (synopsis "Wireless regulatory database")
3224 "This package contains the wireless regulatory database Central
3225 Regulatory Database Agent (CRDA) daemon. The database contains information on
3226 country-specific regulations for the wireless spectrum.")
3227 (license license:isc)))
3229 (define-public lm-sensors
3237 (url "https://github.com/groeck/lm-sensors.git")
3238 (commit (string-append "V" (string-join
3239 (string-split version #\.) "-")))))
3240 (file-name (git-file-name name version))
3242 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3243 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3244 (build-system gnu-build-system)
3245 (inputs `(("rrdtool" ,rrdtool)
3248 ("gnuplot" ,gnuplot)))
3249 (native-inputs `(("pkg-config" ,pkg-config)
3253 (outputs '("lib" ; avoid perl in closure
3256 `(#:tests? #f ; no 'check' target
3257 #:make-flags (list (string-append "PREFIX=" %output)
3258 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3259 (string-append "INCLUDEDIR="
3260 (assoc-ref %outputs "lib") "/include")
3261 (string-append "MANDIR=" %output "/share/man")
3262 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3264 (modify-phases %standard-phases
3266 (add-before 'build 'patch-exec-paths
3267 (lambda* (#:key inputs outputs #:allow-other-keys)
3268 (substitute* "prog/detect/sensors-detect"
3270 (string-append "`" (assoc-ref inputs "coreutils")
3272 (("(`|\")modprobe" all open-quote)
3273 (string-append open-quote
3274 (assoc-ref inputs "kmod")
3276 (substitute* '("prog/pwm/pwmconfig"
3277 "prog/pwm/fancontrol")
3279 (string-append (assoc-ref inputs "gnuplot")
3282 (string-append (assoc-ref inputs "coreutils")
3285 (string-append (assoc-ref inputs "grep")
3288 (string-append (assoc-ref inputs "sed")
3291 (string-append (assoc-ref inputs "coreutils")
3294 (string-append (assoc-ref inputs "coreutils")
3297 (string-append (assoc-ref inputs "coreutils")
3298 "/bin/readlink -f")))
3300 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3301 (synopsis "Utilities to read temperature/voltage/fan sensors")
3303 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3304 you to access information from temperature, voltage, and fan speed sensors.
3305 It works with most newer systems.")
3306 (license license:gpl2+)))
3308 (define-public iucode-tool
3310 (name "iucode-tool")
3314 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3315 "/raw/latest/iucode-tool_" version ".tar.xz"))
3318 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3319 (build-system gnu-build-system)
3320 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3321 (synopsis "Manipulate Intel microcode bundles")
3323 "@command{iucode_tool} is a utility to work with microcode packages for
3324 Intel processors. It can convert between formats, extract specific versions,
3325 create a firmware image suitable for the Linux kernel, and more.")
3326 ;; cpuid.h is available for i686, x86_64, and ia64.
3327 (supported-systems '("i686-linux" "x86_64-linux"))
3328 (license license:gpl2+)))
3330 (define-public i2c-tools
3337 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3338 version ".tar.bz2"))
3341 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3342 (build-system gnu-build-system)
3344 `(#:tests? #f ; no 'check' target
3345 #:make-flags (list (string-append "prefix=" %output)
3347 ;; no configure script
3348 #:phases (modify-phases %standard-phases (delete 'configure))))
3351 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3352 (synopsis "I2C tools for Linux")
3354 "The i2c-tools package contains a heterogeneous set of I2C tools for
3355 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3356 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3358 (license license:gpl2+)))
3360 (define-public xsensors
3367 "http://www.linuxhardware.org/xsensors/xsensors-"
3371 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3372 (build-system gnu-build-system)
3373 (inputs `(("lm-sensors" ,lm-sensors "lib")
3375 (native-inputs `(("pkg-config" ,pkg-config)))
3378 (modify-phases %standard-phases
3379 (add-before 'configure 'enable-deprecated
3381 (substitute* "src/Makefile.in"
3382 (("-DGDK_DISABLE_DEPRECATED") "")
3383 (("-DGTK_DISABLE_DEPRECATED") ""))
3385 (add-before 'configure 'remove-Werror
3387 (substitute* '("configure" "src/Makefile.in")
3390 (home-page "http://www.linuxhardware.org/xsensors/")
3391 (synopsis "Hardware health information viewer")
3393 "Xsensors reads data from the libsensors library regarding hardware
3394 health such as temperature, voltage and fan speed and displays the information
3395 in a digital read-out.")
3396 (license license:gpl2+)))
3401 (version (package-version linux-libre))
3402 (source (package-source linux-libre))
3403 (build-system gnu-build-system)
3406 (modify-phases %standard-phases
3408 (lambda* (#:key inputs #:allow-other-keys)
3409 (setenv "SHELL_PATH" (which "bash"))
3410 (chdir "tools/perf")
3412 #:make-flags (list (string-append "prefix="
3413 (assoc-ref %outputs "out"))
3414 ;; Make sure the kernel headers are treated as system
3415 ;; headers to suppress warnings from those.
3416 (string-append "C_INCLUDE_PATH="
3417 (assoc-ref %build-inputs "kernel-headers")
3421 ;; By default, 'config/Makefile' uses lib64 on
3422 ;; x86_64. Work around that.
3424 #:tests? #f)) ;no tests
3426 `(("pkg-config" ,pkg-config)
3430 ;; There are build scripts written in these languages.
3432 ("python" ,python-2)))
3434 `(("slang" ,slang) ;for the interactive TUI
3436 ("python" ,python-2) ;'perf' links against libpython
3437 ("elfutils" ,elfutils)
3438 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3439 ("libunwind" ,libunwind) ;better stack walking
3440 ("numactl" ,numactl) ;for 'perf bench numa mem'
3443 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3444 ("docbook-xsl" ,docbook-xsl)
3446 ("asciidoc" ,asciidoc)))
3447 (home-page "https://perf.wiki.kernel.org/")
3448 (synopsis "Linux profiling with performance counters")
3450 "perf is a tool suite for profiling using hardware performance counters,
3451 with support in the Linux kernel. perf can instrument CPU performance
3452 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3453 of lightweight profiling. This package contains the user-land tools and in
3454 particular the @code{perf} command.")
3455 (license (package-license linux-libre))))
3457 (define-public pflask
3463 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3465 (file-name (string-append name "-" version ".tar.gz"))
3468 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3469 (build-system cmake-build-system)
3471 '(#:tests? #f)) ; no tests
3472 (home-page "https://ghedo.github.io/pflask/")
3473 (synopsis "Simple tool for creating Linux namespace containers")
3474 (description "pflask is a simple tool for creating Linux namespace
3475 containers. It can be used for running a command or even booting an OS inside
3476 an isolated container, created with the help of Linux namespaces. It is
3477 similar in functionality to chroot, although pflask provides better isolation
3478 thanks to the use of namespaces.")
3479 (license license:bsd-2)))
3481 (define-public singularity
3483 (name "singularity")
3487 (uri (string-append "https://github.com/singularityware/singularity/"
3488 "releases/download/" version
3489 "/singularity-" version ".tar.gz"))
3492 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3493 (modules '((guix build utils)))
3496 ;; Do not create directories in /var.
3497 (substitute* "Makefile.in"
3498 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3500 ;; The original source overrides PATH so that it points to
3501 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3502 ;; on Guix System. Leave PATH unchanged so we refer to the
3503 ;; installed Coreutils, grep, etc.
3504 (substitute* "bin/singularity.in"
3506 (string-append "#" all "\n")))
3508 (substitute* (find-files "libexec/cli" "\\.exec$")
3509 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3511 (string-append "/run/setuid-programs/singularity-"
3512 program "-helper")))
3514 ;; These squashfs mount options are apparently no longer
3515 ;; supported since Linux-libre 5.4.5.
3516 (substitute* "src/lib/image/squashfs/mount.c"
3517 (("\"errors=remount-ro\"")
3520 (build-system gnu-build-system)
3522 `(#:configure-flags '("--localstatedir=/var")
3524 (modify-phases %standard-phases
3525 (add-after 'unpack 'patch-reference-to-squashfs-tools
3527 (substitute* "libexec/cli/build.exec"
3528 (("if ! singularity_which mksquashfs") "if 0")
3529 (("if ! mksquashfs")
3530 (string-append "if ! " (which "mksquashfs"))))
3532 (add-after 'install 'set-PATH
3533 (lambda* (#:key inputs outputs #:allow-other-keys)
3534 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
3535 (let ((out (assoc-ref outputs "out"))
3536 (coreutils (assoc-ref inputs "coreutils")))
3537 (wrap-program (string-append out "/bin/singularity")
3538 `("PATH" ":" = (,(string-append coreutils "/bin"))))
3539 (substitute* (string-append out "/bin/run-singularity")
3540 (("/usr/bin/env singularity")
3541 (string-append (which "env") " "
3542 out "/bin/singularity")))
3545 `(("libarchive" ,libarchive)
3546 ("python" ,python-wrapper)
3548 ("squashfs-tools" ,squashfs-tools)))
3549 (home-page "https://singularity.lbl.gov/")
3550 (synopsis "Container platform")
3551 (description "Singularity is a container platform supporting a number of
3552 container image formats. It can build SquashFS container images or import
3553 existing Docker images. Singularity requires kernel support for container
3554 isolation or root privileges.")
3555 (license license:bsd-3)))
3557 (define-public hdparm
3563 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3564 "hdparm-" version ".tar.gz"))
3567 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3568 (build-system gnu-build-system)
3570 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3571 (list (string-append "binprefix=" out)
3572 (string-append "manprefix=" out)
3575 (modify-phases %standard-phases
3576 (delete 'configure)) ; no configure script
3577 #:tests? #f)) ; no test suite
3578 (home-page "https://sourceforge.net/projects/hdparm/")
3579 (synopsis "View and tune ATA disk drive parameters")
3581 "@command{hdparm} is a command-line utility to control ATA controllers and
3582 disk drives. It can increase performance and/or reliability by careful tuning
3583 of hardware settings like power and acoustic management, DMA modes, and caching.
3584 It can also display detailed device information, or be used as a simple
3585 performance benchmarking tool.
3587 @command{hdparm} provides a command line interface to various Linux kernel
3588 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3589 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3590 Translation (@dfn{SAT}) are also supported.")
3591 (license (license:non-copyleft "file://LICENSE.TXT"))))
3593 (define-public nvme-cli
3597 (home-page "https://github.com/linux-nvme/nvme-cli")
3602 (commit (string-append "v" version))))
3604 (base32 "12wp2wxmsw2v8m9bhvwvdbhdgx1md8iilhbl19sfzz2araiwi2x8"))
3605 (file-name (git-file-name name version))))
3606 (build-system gnu-build-system)
3608 `(#:make-flags (list "CC=gcc")
3609 #:phases (modify-phases %standard-phases
3610 (delete 'configure) ; No ./configure script
3613 (invoke "make" "install-spec" "PREFIX="
3614 (string-append "DESTDIR=" %output)))))
3615 #:tests? #f)) ; The tests require sysfs, which is not accessible from
3616 ; the build environment
3617 (synopsis "NVM-Express user space tooling for Linux")
3618 (description "Nvme-cli is a utility to provide standards compliant tooling
3619 for NVM-Express drives. It was made specifically for Linux as it relies on the
3620 IOCTLs defined by the mainline kernel driver.")
3621 (license license:gpl2+)))
3623 (define-public rfkill
3629 (uri (string-append "mirror://kernel.org/software/network/"
3630 name "/" name "-" version ".tar.xz"))
3633 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3634 (build-system gnu-build-system)
3636 `(#:make-flags (list "CC=gcc"
3637 (string-append "PREFIX=" %output))
3638 #:phases (modify-phases %standard-phases
3639 (delete 'configure))
3641 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3642 (synopsis "Tool for enabling and disabling wireless devices")
3644 "rfkill is a simple tool for accessing the rfkill device interface,
3645 which is used to enable and disable wireless networking devices, typically
3646 WLAN, Bluetooth and mobile broadband.")
3647 (license (license:non-copyleft "file://COPYING"
3648 "See COPYING in the distribution."))
3649 ;; rfkill is part of util-linux as of 2.31.
3650 (properties `((superseded . ,util-linux)))))
3658 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3659 version "/" name "-" version ".tar.gz"))
3662 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3663 (build-system gnu-build-system)
3664 (home-page "http://acpiclient.sourceforge.net")
3665 (synopsis "Display information on ACPI devices")
3666 (description "@code{acpi} attempts to replicate the functionality of the
3667 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3668 information. It does not support ACPI suspending, only displays information
3669 about ACPI devices.")
3670 (license license:gpl2+)))
3672 (define-public acpid
3678 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3682 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
3683 (build-system gnu-build-system)
3684 (home-page "https://sourceforge.net/projects/acpid2/")
3685 (synopsis "Daemon for delivering ACPI events to user-space programs")
3687 "acpid is designed to notify user-space programs of Advanced
3688 Configuration and Power Interface (ACPI) events. acpid should be started
3689 during the system boot, and will run as a background process. When an ACPI
3690 event is received from the kernel, acpid will examine the list of rules
3691 specified in /etc/acpi/events and execute the rules that match the event.")
3692 (license license:gpl2+)))
3694 (define-public sysfsutils
3703 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3706 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3707 (build-system gnu-build-system)
3708 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3709 (synopsis "System utilities based on Linux sysfs")
3711 "These are a set of utilities built upon sysfs, a virtual file system in
3712 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3713 also contains the libsysfs library.")
3714 ;; The library is under lgpl2.1+ (all files say "or any later version").
3715 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3716 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3718 (define-public sysfsutils-1
3720 (inherit sysfsutils)
3727 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3728 "/sysfsutils-" version ".tar.gz"))
3730 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3731 (modules '((guix build utils)))
3734 (substitute* "Makefile.in"
3735 (("includedir = /usr/include/sysfs")
3736 "includedir = @includedir@"))
3737 (substitute* "configure"
3738 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3739 (string-append "includedir='" orig "/sysfs'")))
3741 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3743 (define-public cpufrequtils
3745 (name "cpufrequtils")
3750 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3751 "cpufrequtils-" version ".tar.gz"))
3753 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3754 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3755 (build-system gnu-build-system)
3757 `(("sysfsutils" ,sysfsutils-1)))
3759 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3760 (assoc-ref %outputs "out") "/lib"))))
3761 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3762 (synopsis "Utilities to get and set CPU frequency on Linux")
3764 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3765 information, and set the CPU frequency if supported, using the cpufreq
3766 capabilities of the Linux kernel.")
3767 (license license:gpl2)))
3769 (define-public libraw1394
3776 "mirror://kernel.org/linux/libs/ieee1394/"
3777 name "-" version ".tar.xz"))
3780 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3781 (build-system gnu-build-system)
3782 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3783 (synopsis "Interface library for the Linux IEEE1394 drivers")
3785 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3786 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3787 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3788 send to and receive from other nodes without requiring a kernel driver for the
3789 protocol in question.")
3790 (license license:lgpl2.1+)))
3792 (define-public libavc1394
3798 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3799 name "-" version ".tar.gz"))
3802 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3803 (build-system gnu-build-system)
3805 `(("pkg-config" ,pkg-config)))
3807 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3808 (home-page "https://sourceforge.net/projects/libavc1394/")
3809 (synopsis "AV/C protocol library for IEEE 1394")
3811 "Libavc1394 is a programming interface to the AV/C specification from
3812 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3813 (license license:lgpl2.1+)))
3815 (define-public libiec61883
3817 (name "libiec61883")
3822 "mirror://kernel.org/linux/libs/ieee1394/"
3823 name "-" version ".tar.xz"))
3826 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3827 (build-system gnu-build-system)
3829 `(("pkg-config" ,pkg-config)))
3831 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3832 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3833 (synopsis "Isochronous streaming media library for IEEE 1394")
3835 "The libiec61883 library provides a higher level API for streaming DV,
3836 MPEG-2 and audio over Linux IEEE 1394.")
3837 (license license:lgpl2.1+)))
3839 (define-public mdadm
3846 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3850 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3851 (build-system gnu-build-system)
3855 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3859 ;; TODO: tell it where to find 'sendmail'
3860 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3861 (string-append "BINDIR=" out "/sbin")
3862 (string-append "MANDIR=" out "/share/man")
3863 (string-append "UDEVDIR=" out "/lib/udev")))
3865 (modify-phases %standard-phases
3866 (add-before 'build 'patch-program-paths
3867 (lambda* (#:key inputs #:allow-other-keys)
3868 (let ((coreutils (assoc-ref inputs "coreutils")))
3869 (substitute* "udev-md-raid-arrays.rules"
3870 (("/usr/bin/(readlink|basename)" all program)
3871 (string-append coreutils "/bin/" program))))
3873 (add-before 'build 'remove-W-error
3875 ;; We cannot build with -Werror on i686 due to a
3876 ;; 'sign-compare' warning in util.c.
3877 (substitute* "Makefile"
3880 (delete 'configure))
3881 ;;tests must be done as root
3883 (home-page "http://neil.brown.name/blog/mdadm")
3884 (synopsis "Tool for managing Linux Software RAID arrays")
3886 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3887 assemble, report on, and monitor arrays. It can also move spares between raid
3888 arrays when needed.")
3889 (license license:gpl2+)))
3891 (define-public mdadm-static
3894 (name "mdadm-static")
3896 (substitute-keyword-arguments (package-arguments mdadm)
3897 ((#:make-flags flags)
3898 `(cons "LDFLAGS = -static" ,flags))
3900 `(modify-phases ,phases
3901 (add-after 'install 'remove-cruft
3902 (lambda* (#:key outputs #:allow-other-keys)
3903 (let* ((out (assoc-ref outputs "out"))
3904 (precious? (lambda (file)
3905 (member file '("." ".." "sbin"))))
3906 (directories (scandir out (negate precious?))))
3907 (with-directory-excursion out
3908 (for-each delete-file-recursively directories)
3909 (remove-store-references "sbin/mdadm")
3910 (delete-file "sbin/mdmon")
3912 ((#:modules modules %gnu-build-system-modules)
3913 `((ice-9 ftw) ,@modules))
3914 ((#:strip-flags _ '())
3915 ''("--strip-all")) ;strip a few extra KiB
3916 ((#:allowed-references _ '("out"))
3917 '("out")))) ;refer only self
3918 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3920 (define-public multipath-tools
3922 (name "multipath-tools")
3926 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3927 ".git;a=snapshot;h=" version ";sf=tgz"))
3928 (file-name (string-append name "-" version ".tar.gz"))
3931 "1c6ay97wlfv1fl0y8hcfpxhkps14hlnw9gzmj7884micsp7pa9yv"))
3932 (modules '((guix build utils)))
3935 ;; Drop bundled valgrind headers.
3936 (delete-file-recursively "third-party")
3937 (substitute* '("multipathd/main.c"
3938 "libmultipath/debug.c")
3939 (("#include \"../third-party/")
3942 (build-system gnu-build-system)
3944 '(#:tests? #f ; no tests
3945 #:make-flags (list "CC=gcc"
3946 (string-append "DESTDIR="
3947 (assoc-ref %outputs "out"))
3949 ;; Add the libaio headers to GCCs system header
3950 ;; search path to suppress -Werror=cast-qual on
3951 ;; the included headers.
3952 (string-append "C_INCLUDE_PATH="
3953 (assoc-ref %build-inputs "libaio")
3955 (string-append "LDFLAGS=-Wl,-rpath="
3956 (assoc-ref %outputs "out")
3959 (modify-phases %standard-phases
3960 (add-after 'unpack 'patch-source
3961 (lambda* (#:key inputs #:allow-other-keys)
3962 (let ((lvm2 (assoc-ref inputs "lvm2"))
3963 (udev (assoc-ref inputs "udev")))
3964 (substitute* "Makefile.inc"
3965 (("\\$\\(prefix\\)/usr") "$(prefix)")
3966 ;; Do not save timestamp to avoid gzip "timestamp
3967 ;; out-of-range" warnings.
3968 (("gzip -9") "gzip -9n"))
3969 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3970 (("/usr/include/libdevmapper.h")
3971 (string-append lvm2 "/include/libdevmapper.h"))
3972 (("/usr/include/libudev.h")
3973 (string-append udev "/include/libudev.h")))
3975 (delete 'configure)))) ; no configure script
3978 ("pkg-config" ,pkg-config)
3979 ("valgrind" ,valgrind)))
3981 `(("json-c" ,json-c)
3983 ("liburcu" ,liburcu)
3985 ("readline" ,readline)
3987 (home-page "http://christophe.varoqui.free.fr/")
3988 (synopsis "Access block devices through multiple paths")
3990 "This package provides the following binaries to drive the
3991 Linux Device Mapper multipathing driver:
3993 @item @command{multipath} - Device mapper target autoconfig.
3994 @item @command{multipathd} - Multipath daemon.
3995 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3996 @code{dm} multipath devices.
3997 @item @command{kpartx} - Create device maps from partition tables.
3999 (license (list license:gpl2+ ; main distribution
4000 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4002 (define-public libaio
4009 (string-append "https://releases.pagure.org/libaio/"
4010 name "-" version ".tar.gz")))
4013 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4014 (build-system gnu-build-system)
4017 (list "CC=gcc" (string-append "prefix=" %output))
4018 #:test-target "partcheck" ; need root for a full 'check'
4020 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4021 (home-page "https://pagure.io/libaio")
4022 (synopsis "Linux-native asynchronous I/O access library")
4024 "This library enables userspace to use Linux kernel asynchronous I/O
4025 system calls, important for the performance of databases and other advanced
4027 (license license:lgpl2.1+)))
4029 (define-public blktrace
4030 ;; Take a newer commit to get the fix for CVE-2018-10689.
4031 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4035 (version (git-version "1.2.0" revision commit))
4037 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4044 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4045 (file-name (git-file-name name version))))
4046 (build-system gnu-build-system)
4049 (list "CC=gcc" (string-append "prefix=" %output))
4050 #:tests? #f ; no tests
4052 (modify-phases %standard-phases
4053 (delete 'configure) ; no configure script
4054 (add-after 'unpack 'fix-gnuplot-path
4055 (lambda* (#:key inputs #:allow-other-keys)
4056 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4057 (substitute* "btt/bno_plot.py"
4059 (string-append gnuplot "/bin/gnuplot %s")))
4062 `(("libaio" ,libaio)
4063 ("gnuplot" ,gnuplot)
4064 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4065 (synopsis "Block layer IO tracing mechanism")
4066 (description "Blktrace is a block layer IO tracing mechanism which provides
4067 detailed information about request queue operations to user space. It extracts
4068 event traces from the kernel (via the relaying through the debug file system).")
4069 (license license:gpl2))))
4077 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4081 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4082 (build-system gnu-build-system)
4084 `(("libsndfile" ,libsndfile)))
4086 `(("pkg-config" ,pkg-config)))
4087 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4088 (synopsis "Bluetooth subband audio codec")
4090 "The SBC is a digital audio encoder and decoder used to transfer data to
4091 Bluetooth audio output devices like headphones or loudspeakers.")
4092 (license license:gpl2+)))
4094 (define-public bluez
4097 (replacement bluez/fixed)
4102 "mirror://kernel.org/linux/bluetooth/bluez-"
4106 "1g1qg6dz6hl3csrmz75ixr12lwv836hq3ckb259svvrg62l2vaiq"))))
4107 (build-system gnu-build-system)
4110 (let ((out (assoc-ref %outputs "out")))
4111 (list "--sysconfdir=/etc"
4112 "--localstatedir=/var"
4115 ;; Install dbus/udev files to the correct location.
4116 (string-append "--with-dbusconfdir=" out "/etc")
4117 (string-append "--with-udevdir=" out "/lib/udev")))
4119 (modify-phases %standard-phases
4120 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4121 ;; issue (discussion on upstream mailing list:
4122 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4123 (add-before 'check 'skip-wonky-test
4125 (substitute* "unit/test-gatt.c"
4126 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4128 (add-after 'install 'post-install
4129 (lambda* (#:key inputs outputs #:allow-other-keys)
4130 (let* ((out (assoc-ref outputs "out"))
4131 (servicedir (string-append out "/share/dbus-1/services"))
4132 (service "obexd/src/org.bluez.obex.service")
4133 (rule (string-append
4134 out "/lib/udev/rules.d/97-hid2hci.rules")))
4135 ;; Install the obex dbus service file.
4136 (substitute* service
4138 (string-append out "/libexec/bluetooth/obexd")))
4139 (install-file service servicedir)
4140 ;; Fix paths in the udev rule.
4142 (("hid2hci --method")
4143 (string-append out "/lib/udev/hid2hci --method"))
4145 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4148 `(("pkg-config" ,pkg-config)
4149 ("gettext" ,gettext-minimal)))
4154 ("libical" ,libical)
4155 ("readline" ,readline)))
4156 (home-page "http://www.bluez.org/")
4157 (synopsis "Linux Bluetooth protocol stack")
4159 "BlueZ provides support for the core Bluetooth layers and protocols. It
4160 is flexible, efficient and uses a modular implementation.")
4161 (license license:gpl2+)))
4167 (inherit (package-source bluez))
4168 (patches (append (origin-patches (package-source bluez))
4169 (search-patches "bluez-CVE-2020-0556.patch")))))))
4171 (define-public fuse-exfat
4178 "https://github.com/relan/exfat/releases/download/v"
4179 version "/" name "-" version ".tar.gz"))
4182 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4183 (build-system gnu-build-system)
4185 `(("pkg-config" ,pkg-config)))
4188 (home-page "https://github.com/relan/exfat")
4189 (synopsis "Mount exFAT file systems")
4191 "This package provides a FUSE-based file system that provides read and
4192 write access to exFAT devices.")
4193 (license license:gpl2+)))
4195 (define-public fuseiso
4198 (version "20070708")
4201 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4202 version "/fuseiso-" version ".tar.bz2"))
4205 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4206 (build-system gnu-build-system)
4208 `(("pkg-config" ,pkg-config)))
4213 (home-page "https://sourceforge.net/projects/fuseiso/")
4214 (synopsis "Mount ISO file system images")
4216 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4217 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4218 Ridge, Joliet, and zisofs.")
4219 (license license:gpl2)))
4228 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
4229 version ".tar.bz2"))
4230 (patches (search-patches "gpm-glibc-2.26.patch"))
4233 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4234 (build-system gnu-build-system)
4236 '(#:phases (modify-phases %standard-phases
4239 ;; The tarball was not generated with 'make dist' so we
4240 ;; need to bootstrap things ourselves.
4241 (substitute* "autogen.sh"
4242 (("/bin/sh") (which "sh")))
4243 (invoke "./autogen.sh")
4244 (patch-makefile-SHELL "Makefile.include.in")
4247 ;; Make sure programs find libgpm.so.
4248 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4249 (assoc-ref %outputs "out")
4252 `(("texinfo" ,texinfo)
4255 ("autoconf" ,autoconf)
4256 ("automake" ,automake)
4257 ("libtool" ,libtool)))
4258 (home-page "http://www.nico.schottelius.org/software/gpm/")
4259 (synopsis "Mouse support for the Linux console")
4261 "The GPM (general-purpose mouse) daemon is a mouse server for
4262 applications running on the Linux console. It allows users to select items
4263 and copy/paste text in the console and in xterm.")
4264 (license license:gpl2+)))
4266 (define-public btrfs-progs
4268 (name "btrfs-progs")
4272 (uri (string-append "mirror://kernel.org/linux/kernel/"
4273 "people/kdave/btrfs-progs/"
4274 "btrfs-progs-v" version ".tar.xz"))
4277 "0scxg9p6z0wss92gmv5a8yxdmr8x449kb5v3bfnvs26n92r7zq7k"))))
4278 (build-system gnu-build-system)
4280 "static")) ; static versions of the binaries in "out"
4282 '(#:phases (modify-phases %standard-phases
4283 (add-after 'unpack 'patch-makefile
4284 (lambda* (#:key outputs #:allow-other-keys)
4285 (substitute* "Makefile"
4286 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4287 (string-append (assoc-ref outputs "out")
4288 "/lib/udev/rules.d")))
4290 (add-after 'build 'build-static
4291 (lambda _ (invoke "make" "static")))
4292 (add-after 'install 'install-bash-completion
4293 (lambda* (#:key outputs #:allow-other-keys)
4294 (let* ((out (assoc-ref outputs "out"))
4295 (bashcomp (string-append out "/etc/bash_completion.d")))
4297 (copy-file "btrfs-completion"
4298 (string-append bashcomp "/btrfs"))
4300 (add-after 'install 'install-static
4301 (let ((staticbin (string-append (assoc-ref %outputs "static")
4305 (string-append "bindir=" staticbin)
4306 "install-static")))))
4307 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4308 #:test-target "test"
4309 #:parallel-tests? #f)) ; tests fail when run in parallel
4310 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4311 ("libblkid" ,util-linux)
4312 ("libblkid:static" ,util-linux "static")
4313 ("libuuid" ,util-linux)
4314 ("libuuid:static" ,util-linux "static")
4317 ("zlib:static" ,zlib "static")
4318 ("zstd" ,zstd "lib")
4319 ("zstd:static" ,zstd "static")))
4320 (native-inputs `(("pkg-config" ,pkg-config)
4321 ("asciidoc" ,asciidoc)
4324 ;; For building documentation.
4325 ("libxml2" ,libxml2)
4326 ("docbook-xsl" ,docbook-xsl)
4332 ;; The tests need 'grep' with perl regexp support.
4334 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4335 (synopsis "Create and manage btrfs copy-on-write file systems")
4336 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4337 aimed at implementing advanced features while focusing on fault tolerance,
4338 repair and easy administration.")
4339 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4340 ;; GPL2: Everything else.
4341 (license (list license:gpl2 license:gpl2+))))
4343 (define-public btrfs-progs/static
4345 (name "btrfs-progs-static")
4346 (version (package-version btrfs-progs))
4348 (build-system trivial-build-system)
4350 `(("btrfs-progs:static" ,btrfs-progs "static")))
4352 `(#:modules ((guix build utils))
4355 (use-modules (guix build utils)
4359 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4360 (out (assoc-ref %outputs "out"))
4361 (source (string-append btrfs "/bin/btrfs.static"))
4362 (target (string-append out "/bin/btrfs")))
4363 (mkdir-p (dirname target))
4364 (copy-file source target)
4365 (remove-store-references target)
4366 (chmod target #o555)
4368 (home-page (package-home-page btrfs-progs))
4369 (synopsis "Statically-linked btrfs command from btrfs-progs")
4370 (description "This package provides the statically-linked @command{btrfs}
4371 from the btrfs-progs package. It is meant to be used in initrds.")
4372 (license (package-license btrfs-progs))))
4374 (define-public compsize
4378 (home-page "https://github.com/kilobyte/compsize")
4383 (commit (string-append "v" version))))
4385 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4386 (file-name (git-file-name name version))))
4387 (build-system gnu-build-system)
4389 `(("btrfs-progs" ,btrfs-progs)))
4391 `(#:tests? #f ; No tests.
4392 #:make-flags (list "CC=gcc")
4394 (modify-phases %standard-phases
4397 (lambda* (#:key outputs #:allow-other-keys)
4398 (let ((out (assoc-ref outputs "out")))
4399 (install-file "compsize" (string-append out "/bin"))
4400 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4401 (synopsis "Find compression type/ratio on Btrfs files")
4402 (description "@command{compsize} takes a list of files (given as
4403 arguments) on a Btrfs file system and measures used compression types and
4404 effective compression ratio, producing a report.
4406 A directory has no extents but has a (recursive) list of files. A non-regular
4407 file is silently ignored.
4409 As it makes no sense to talk about compression ratio of a partial extent,
4410 every referenced extent is counted whole, exactly once -- no matter if you use
4411 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4412 uncompressed size will not match the number given by @command{tar} or
4413 @command{du}. On the other hand, the space used should be accurate (although
4414 obviously it can be shared with files outside our set).")
4415 (license license:gpl2+)))
4417 (define-public f2fs-tools-1.7
4424 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4425 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4428 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4430 (build-system gnu-build-system)
4433 (modify-phases %standard-phases
4434 (add-after 'install 'install-headers
4435 (lambda* (#:key outputs #:allow-other-keys)
4436 (let* ((out (assoc-ref outputs "out"))
4437 (out-include (string-append out "/include")))
4438 (install-file "include/f2fs_fs.h" out-include)
4439 (install-file "mkfs/f2fs_format_utils.h" out-include)
4442 `(("autoconf" ,autoconf)
4443 ("automake" ,automake)
4444 ("libtool" ,libtool)
4445 ("pkg-config" ,pkg-config)))
4447 `(("libuuid" ,util-linux)
4448 ("libselinux" ,libselinux)))
4449 (home-page "https://f2fs.wiki.kernel.org/")
4450 (synopsis "Userland tools for f2fs")
4452 "F2FS, the Flash-Friendly File System, is a modern file system
4453 designed to be fast and durable on flash devices such as solid-state
4454 disks and SD cards. This package provides the userland utilities.")
4455 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4456 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4457 (license (list license:gpl2 license:lgpl2.1))))
4459 (define-public f2fs-tools
4461 (inherit f2fs-tools-1.7)
4467 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4468 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4471 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4473 `(("libuuid" ,util-linux)))))
4475 (define-public freefall
4478 (version (package-version linux-libre))
4479 (source (package-source linux-libre))
4480 (build-system gnu-build-system)
4482 '(#:phases (modify-phases %standard-phases
4483 (add-after 'unpack 'enter-subdirectory
4485 (chdir "tools/laptop/freefall")
4488 (add-before 'build 'increase-timeout
4490 ;; The default of 2 seconds is too low: it assumes an
4491 ;; open lid and AC power without actually checking.
4492 (substitute* "freefall.c"
4493 (("alarm\\(2\\)") "alarm(5)"))
4495 #:make-flags (list (string-append "PREFIX="
4496 (assoc-ref %outputs "out"))
4498 #:tests? #f)) ;no tests
4499 (home-page (package-home-page linux-libre))
4500 (synopsis "Free-fall protection for spinning laptop hard drives")
4502 "Prevents shock damage to the internal spinning hard drive(s) of some
4503 HP and Dell laptops. When sudden movement is detected, all input/output
4504 operations on the drive are suspended and its heads are parked on the ramp,
4505 where they are less likely to cause damage to the spinning disc. Requires a
4506 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4507 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4508 (license license:gpl2)))
4510 (define-public thinkfan
4518 (url "https://github.com/vmatare/thinkfan.git")
4520 (file-name (git-file-name name version))
4522 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
4523 (build-system cmake-build-system)
4525 `(#:modules ((guix build cmake-build-system)
4528 #:tests? #f ; no test target
4530 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4531 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4533 `("-DUSE_ATASMART:BOOL=ON")
4535 (modify-phases %standard-phases
4536 (add-after 'unpack 'create-init-scripts
4537 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4538 ;; systemd to patch and install their service files. Fake their
4539 ;; presence rather than duplicating the build system below. Leave
4540 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4541 ;; The sysvinit needs manual patching, but since upstream doesn't
4542 ;; even provide the option to install it: don't.
4543 (lambda* (#:key outputs #:allow-other-keys)
4544 (let* ((out (assoc-ref outputs "out"))
4545 (share (string-append out "/share/" ,name)))
4546 (substitute* "CMakeLists.txt"
4547 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4548 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4549 ;; That was easy! Now we just need to fix the destinations.
4551 (string-append out directory)))
4554 `(("pkg-config" ,pkg-config)))
4556 `(("libatasmart" ,libatasmart)
4557 ("yaml-cpp" ,yaml-cpp)))
4558 (home-page "http://thinkfan.sourceforge.net/")
4559 (synopsis "Simple fan control program")
4561 "Thinkfan is a simple fan control program. It reads temperatures,
4562 checks them against configured limits and switches to appropriate (also
4563 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4564 other @code{hwmon} driver that enables temperature reading and fan control
4566 (license license:gpl3+)))
4568 (define-public tpacpi-bat
4576 (url "https://github.com/teleshoes/tpacpi-bat.git")
4577 (commit (string-append "v" version))))
4578 (file-name (git-file-name name version))
4580 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4581 (build-system gnu-build-system)
4583 `(#:tests? #f ; no test target
4585 (modify-phases %standard-phases
4586 (add-after 'unpack 'refer-to-inputs
4588 (substitute* "tpacpi-bat"
4590 (format "~a " (which "cat")))
4591 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4592 ;; loaded. That's the administrator's prerogative; disable it.
4593 (("system \"(modprobe .*)\"" _ match)
4594 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4596 (delete 'configure) ; nothing to configure
4597 (delete 'build) ; nothing to build
4599 (lambda* (#:key outputs #:allow-other-keys)
4600 (let* ((out (assoc-ref outputs "out"))
4601 (bin (string-append out "/bin"))
4602 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4603 (install-file "tpacpi-bat" bin)
4605 ;; There's no man page. Install other forms of documentation.
4606 (for-each (lambda (file)
4607 (let ((target (string-append doc "/" file)))
4608 (mkdir-p (dirname target))
4609 (copy-recursively file target)))
4610 (list "battery_asl" "examples" "README.md"))
4614 (home-page "https://github.com/teleshoes/tpacpi-bat")
4615 (synopsis "ThinkPad battery charge controller")
4617 "Tpacpi-bat is a command-line interface to control battery charging on
4618 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4619 ThinkPad models released after 2011}, starting with the xx20 series. It can
4620 query and set the thresholds at which one or both batteries will start and stop
4621 charging, inhibit charging batteries for a set period of time, or force them to
4622 discharge when they otherwise would not.
4624 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4625 kernel module provided by the @code{acpi-call-linux-module} package, which must
4626 be installed and loaded separately. Only the original vendor firmware is
4628 (license license:gpl3+)))
4630 (define-public ntfs-3g
4633 (version "2017.3.23")
4636 (uri (string-append "https://tuxera.com/opensource/"
4637 "ntfs-3g_ntfsprogs-" version ".tgz"))
4638 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
4641 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
4642 (modules '((guix build utils)))
4644 ;; Install under $prefix.
4645 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4649 (build-system gnu-build-system)
4650 (inputs `(("util-linux" ,util-linux)
4651 ("fuse" ,fuse))) ;libuuid
4652 (native-inputs `(("pkg-config" ,pkg-config)))
4654 '(#:configure-flags (list "--exec-prefix=${prefix}"
4655 "--with-fuse=external" ;use our own FUSE
4656 "--enable-mount-helper"
4657 "--enable-posix-acls"
4658 "--enable-xattr-mappings")
4660 (modify-phases %standard-phases
4661 ;; If users install ntfs-3g, they probably want to make it the
4662 ;; default driver as well, so we opt for sensible defaults and link
4663 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
4664 ;; mount NTFS file systems.)
4665 (add-after 'install 'install-link
4666 (lambda* (#:key outputs #:allow-other-keys)
4667 (let* ((out (assoc-ref outputs "out"))
4668 (sbin (string-append out "/sbin")))
4669 (symlink "mount.ntfs-3g"
4670 (string-append sbin "/mount.ntfs")))
4672 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
4673 (synopsis "Read-write access to NTFS file systems")
4675 "NTFS-3G provides read-write access to NTFS file systems, which are
4676 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4677 The package provides additional NTFS tools.")
4678 (license license:gpl2+)))
4680 (define-public rdma-core
4686 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4687 "/releases/download/v" version "/rdma-core-"
4691 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
4692 (build-system cmake-build-system)
4694 `(#:tests? #f ; no tests
4695 ;; Upstream uses the "ninja" build system and encourage distros
4696 ;; to do the same for consistency. They also recommend using the
4697 ;; "Release" build type.
4698 #:build-type "Release"
4699 #:configure-flags (list "-GNinja"
4701 (string-append "-DRST2MAN_EXECUTABLE="
4702 (assoc-ref %build-inputs
4706 ;; On some configurations, the
4707 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
4708 ;; used by default, would return ENODEV. To
4709 ;; avoid that, use 'write' instead of ioctls,
4710 ;; as suggested in 'CMakeList.txt'.
4711 "-DIOCTL_MODE=write")
4713 (modify-phases %standard-phases
4717 "-j" (number->string (parallel-job-count)))))
4720 (invoke "ninja" "install"))))))
4723 ("pkg-config" ,pkg-config)
4724 ("python" ,python-wrapper)
4725 ("python-docutils" ,python-docutils))) ;for 'rst2man'
4729 (home-page "https://github.com/linux-rdma/rdma-core")
4730 (synopsis "Utilities and libraries for working with RDMA devices")
4732 "This package provides userspace components for the InfiniBand
4733 subsystem of the Linux kernel. Specifically it contains userspace
4734 libraries for the following device nodes:
4737 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4738 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4739 @item @file{/dev/infiniband/umadX} (@code{libibumad})
4742 The following service daemons are also provided:
4744 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4745 @item @code{iwpmd} (for iWARP kernel providers)
4746 @item @code{ibacm} (for InfiniBand communication management assistant)
4748 ;; All library code is dual licensed under GPL2 and a custom MIT
4749 ;; variant. The package also includes some components covered by
4750 ;; other licenses. Consult COPYING.md for full details.
4753 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4754 license:bsd-2 ; Files referring to COPYING.BSD_FB
4755 license:cc0 ; most files in ccan/
4756 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4758 (define-public perftest
4765 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4766 version "/perftest-" version ".g0927198.tar.gz"))
4768 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
4769 (build-system gnu-build-system)
4772 (modify-phases %standard-phases
4773 (add-after 'unpack 'patch-header-paths
4775 (substitute* '("src/raw_ethernet_fs_rate.c"
4776 "src/raw_ethernet_resources.c"
4777 "src/raw_ethernet_resources.h"
4778 "src/raw_ethernet_send_burst_lat.c"
4779 "src/raw_ethernet_send_bw.c"
4780 "src/raw_ethernet_send_lat.c")
4781 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4783 (inputs `(("rdma-core" ,rdma-core)))
4784 (home-page "https://github.com/linux-rdma/perftest/")
4785 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4786 (description "This is a collection of tests written over uverbs intended for
4787 use as a performance micro-benchmark. The tests may be used for hardware or
4788 software tuning as well as for functional testing.
4790 The collection contains a set of bandwidth and latency benchmark such as:
4792 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
4793 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4794 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4795 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4796 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4798 (license license:gpl2)))
4800 (define-public rng-tools
4803 (home-page "https://github.com/nhorman/rng-tools")
4807 (uri (git-reference (url home-page)
4808 (commit (string-append "v" version))))
4809 (file-name (git-file-name name version))
4812 "065jf26s8zkicb95zc9ilksjdq9gqrh5vcx3mhi6mypbnamn6w98"))))
4813 (build-system gnu-build-system)
4815 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
4816 #:configure-flags '("--without-nistbeacon"
4817 "--without-pkcs11")))
4819 `(("autoconf" ,autoconf)
4820 ("automake" ,automake)
4821 ("pkg-config" ,pkg-config)))
4823 `(("libsysfs" ,sysfsutils)))
4824 (synopsis "Random number generator daemon")
4826 "Monitor a hardware random number generator, and supply entropy
4827 from that to the system kernel's @file{/dev/random} machinery.")
4828 ;; The source package is offered under the GPL2+, but the files
4829 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4830 (license (list license:gpl2 license:gpl2+))))
4832 (define-public cpupower
4835 (version (package-version linux-libre))
4836 (source (package-source linux-libre))
4837 (build-system gnu-build-system)
4839 '(#:phases (modify-phases %standard-phases
4840 (add-after 'unpack 'enter-subdirectory
4842 (chdir "tools/power/cpupower")
4845 (add-before 'build 'fix-makefiles
4847 (substitute* "Makefile"
4849 (("/bin/(install|pwd)" _ command) command))
4850 (substitute* "bench/Makefile"
4851 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4853 #:make-flags (let ((out (assoc-ref %outputs "out")))
4854 (list (string-append "DESTDIR=" out)
4855 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4857 "docdir=/share/doc/cpupower"
4858 "confdir=$(docdir)/examples"
4859 ;; The Makefile recommends the following changes
4861 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4862 #:tests? #f)) ;no tests
4863 (native-inputs `(("gettext" ,gettext-minimal)))
4864 (inputs `(("pciutils" ,pciutils)))
4865 (home-page (package-home-page linux-libre))
4866 (synopsis "CPU frequency and voltage scaling tools for Linux")
4868 "cpupower is a set of user-space tools that use the cpufreq feature of the
4869 Linux kernel to retrieve and control processor features related to power saving,
4870 such as frequency and voltage scaling.")
4871 (license license:gpl2)))
4873 (define-public x86-energy-perf-policy
4875 (name "x86-energy-perf-policy")
4876 (version (package-version linux-libre))
4877 (source (package-source linux-libre))
4878 (build-system gnu-build-system)
4882 (modify-phases %standard-phases
4883 (add-after 'unpack 'enter-subdirectory
4885 (chdir "tools/power/x86/x86_energy_perf_policy")
4888 (add-before 'build 'fix-makefile
4890 (substitute* "Makefile" (("/usr") ""))
4893 (let ((out (assoc-ref %outputs "out")))
4894 (list (string-append "DESTDIR=" out)
4895 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4896 (supported-systems '("i686-linux" "x86_64-linux"))
4897 (home-page (package-home-page linux-libre))
4898 (synopsis "Display and update Intel-CPU energy-performance policy")
4900 "@command{x86_energy_perf_policy} displays and updates energy-performance
4901 policy settings specific to Intel Architecture Processors. Settings are
4902 accessed via Model Specific Register (MSR) updates, no matter if the Linux
4903 cpufreq sub-system is enabled or not.")
4904 (license license:gpl2)))
4906 (define-public haveged
4914 (url "https://github.com/jirka-h/haveged.git")
4915 (commit (string-append "v" version))))
4916 (file-name (git-file-name name version))
4918 (base32 "1znr58fb3faq4nmrvc3c5whkc1f3chivm4vhicdwr9pdsyqqsd51"))))
4919 (build-system gnu-build-system)
4920 (home-page "https://www.issihosts.com/haveged")
4921 (synopsis "Entropy source for the Linux random number generator")
4923 "haveged generates an unpredictable stream of random numbers for use by
4924 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4925 standard mechanisms for filling the entropy pool may not be sufficient for
4926 systems with high needs or limited user interaction, such as headless servers.
4928 @command{haveged} runs as a privileged daemon, harvesting randomness from the
4929 indirect effects of hardware events on hidden processor state using the
4930 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
4931 It tunes itself to its environment and provides the same built-in test suite
4932 for the output stream as used on certified hardware security devices.
4934 The quality of the randomness produced by this algorithm has not been proven.
4935 It is recommended to run it together with another entropy source like rngd, and
4936 not as a replacement for it.")
4937 (license (list (license:non-copyleft "file://nist/mconf.h")
4938 (license:non-copyleft "file://nist/packtest.c")
4939 license:public-domain ; nist/dfft.c
4940 license:gpl3+)))) ; everything else
4942 (define-public ecryptfs-utils
4944 (name "ecryptfs-utils")
4949 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4950 version "/+download/ecryptfs-utils_"
4951 version ".orig.tar.gz"))
4954 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4955 (build-system gnu-build-system)
4957 `(#:configure-flags (list "--disable-pywrap")
4959 (modify-phases %standard-phases
4960 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4961 (lambda* (#:key inputs outputs #:allow-other-keys)
4962 (let ((out (assoc-ref outputs "out"))
4963 (utils-linux (assoc-ref inputs "utils-linux"))
4964 (cryptsetup (assoc-ref inputs "cryptsetup"))
4965 (linux-pam (assoc-ref inputs "linux-pam"))
4966 (lvm2 (assoc-ref inputs "lvm2")))
4967 (substitute* '("src/utils/ecryptfs-mount-private"
4968 "src/utils/ecryptfs-umount-private"
4969 "src/utils/ecryptfs-setup-private"
4970 "src/utils/ecryptfs-setup-swap"
4971 "src/utils/mount.ecryptfs.c"
4972 "src/utils/umount.ecryptfs.c"
4973 "src/pam_ecryptfs/pam_ecryptfs.c"
4974 "src/desktop/ecryptfs-mount-private.desktop.in"
4975 "src/desktop/ecryptfs-setup-private.desktop.in")
4977 (string-append utils-linux "/bin/mount"))
4979 (string-append utils-linux "/bin/umount"))
4980 (("/sbin/mount.ecryptfs_private")
4981 (string-append out "/sbin/mount.ecryptfs_private"))
4982 (("/sbin/umount.ecryptfs_private")
4983 (string-append out "/sbin/umount.ecryptfs_private"))
4984 (("/usr/bin/ecryptfs-mount-private")
4985 (string-append out "/bin/ecryptfs-mount-private"))
4986 (("/usr/bin/ecryptfs-rewrite-file")
4987 (string-append out "/bin/ecryptfs-rewrite-file"))
4988 (("/usr/bin/ecryptfs-setup-private")
4989 (string-append out "/bin/ecryptfs-setup-private"))
4990 (("/sbin/cryptsetup")
4991 (string-append cryptsetup "/sbin/cryptsetup"))
4992 (("/sbin/unix_chkpwd")
4993 (string-append linux-pam "/sbin/unix_chkpwd"))
4995 (string-append lvm2 "/sbin/dmsetup")))))))))
4997 `(("intltool" ,intltool)
4998 ("perl" ,perl) ; for pod2man
4999 ("pkg-config" ,pkg-config)))
5001 `(("keyutils" ,keyutils)
5002 ("linux-pam" ,linux-pam)
5003 ("utils-linux" ,util-linux)
5004 ("cryptsetup" ,cryptsetup)
5007 (home-page "https://ecryptfs.org/")
5008 (synopsis "eCryptfs cryptographic file system utilities")
5010 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5011 Each file's cryptographic meta-data is stored inside the file itself, along
5012 with the encrypted contents. This allows individual encrypted files to be
5013 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5014 native Linux file system, and has been part of the Linux kernel since version
5015 2.6.19. This package contains the userland utilities to manage it.")
5016 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5017 ;; grant additional permission to link with OpenSSL.
5018 (license license:gpl2+)))
5020 (define-public libnfsidmap
5022 (name "libnfsidmap")
5027 (uri (string-append "https://fedorapeople.org/~steved/"
5028 name "/" version "/" name "-" version ".tar.bz2"))
5030 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5031 (build-system gnu-build-system)
5033 `(#:configure-flags (list
5034 (string-append "--with-pluginpath="
5035 (assoc-ref %outputs "out")
5036 "/lib/libnfsidmap"))))
5038 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5040 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5041 (synopsis "NFSv4 support library for name/ID mapping")
5042 (description "Libnfsidmap is a library holding mulitiple methods of
5043 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5044 extensible array of mapping functions, currently consisting of two choices:
5045 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5046 (license (license:non-copyleft "file://COPYING"
5047 "See COPYING in the distribution."))))
5049 (define-public module-init-tools
5051 (name "module-init-tools")
5056 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5057 "module-init-tools-" version ".tar.bz2"))
5060 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5061 (patches (search-patches "module-init-tools-moduledir.patch"))))
5062 (build-system gnu-build-system)
5064 ;; FIXME: The upstream tarball lacks man pages, and building them would
5065 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5066 ;; but they vanished. In the meantime, fake it.
5068 (modify-phases %standard-phases
5069 (add-before 'configure 'fake-docbook
5071 (substitute* "Makefile.in"
5072 (("^DOCBOOKTOMAN.*$")
5073 "DOCBOOKTOMAN = true\n"))
5075 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5076 (synopsis "Tools for loading and managing Linux kernel modules")
5078 "Tools for loading and managing Linux kernel modules, such as
5079 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5080 (license license:gpl2+)))
5082 (define-public mcelog
5088 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5089 "mcelog.git/snapshot/v" version ".tar.gz"))
5092 "1c4faayg1gcm3002b2fdrfnv76z92mvfzccvx8w9crjp0d17sp24"))
5093 (file-name (string-append name "-" version ".tar.gz"))
5094 (modules '((guix build utils)))
5097 ;; The snapshots lack a .git directory,
5098 ;; breaking ‘git describe’.
5099 (substitute* "Makefile"
5100 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5102 (build-system gnu-build-system)
5104 `(#:phases (modify-phases %standard-phases
5105 (delete 'configure)) ; no configure script
5106 #:make-flags (let ((out (assoc-ref %outputs "out")))
5108 (string-append "prefix=" out)
5109 (string-append "DOCDIR=" out "/share/doc/mcelog")
5110 "etcprefix=$(DOCDIR)/examples"))
5111 ;; The tests will only run as root on certain supported CPU models.
5113 (supported-systems (list "i686-linux" "x86_64-linux"))
5114 (home-page "https://mcelog.org/")
5115 (synopsis "Machine check monitor for x86 Linux systems")
5117 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
5118 and other hardware errors on x86 systems. It can also perform user-defined
5119 tasks, such as bringing bad pages off-line, when configurable error thresholds
5121 (license license:gpl2)))
5123 (define-public mtd-utils
5130 "ftp://ftp.infradead.org/pub/mtd-utils/"
5131 "mtd-utils-" version ".tar.bz2"))
5134 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
5136 '(#:configure-flags '("--enable-unit-tests")))
5138 `(("cmocka" ,cmocka)
5139 ("pkg-config" ,pkg-config)))
5141 `(("acl" ,acl) ; extended attributes (xattr)
5142 ("libuuid" ,util-linux)
5144 ("openssl" ,openssl) ; optional crypto support
5146 ("zstd" ,zstd "lib")))
5147 (build-system gnu-build-system)
5148 (synopsis "MTD Flash Storage Utilities")
5149 (description "This package provides utilities for testing, partitioning, etc
5151 (home-page "http://www.linux-mtd.infradead.org/")
5153 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5154 license:mpl1.1 ; All ftl* files
5155 license:expat)))) ; libiniparser
5157 (define-public libseccomp
5163 (uri (string-append "https://github.com/seccomp/libseccomp/"
5164 "releases/download/v" version
5165 "/libseccomp-" version ".tar.gz"))
5168 "07crwxqzvl5k2b90a47ii9wgvi09s9hsy5b5jddw9ylp351d25fg"))))
5169 (build-system gnu-build-system)
5171 `(("which" ,which)))
5172 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5173 (description "The libseccomp library provides an easy to use, platform
5174 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5175 libseccomp API is designed to abstract away the underlying BPF based syscall
5176 filter language and present a more conventional function-call based filtering
5177 interface that should be familiar to, and easily adopted by, application
5179 (home-page "https://github.com/seccomp/libseccomp")
5180 (license license:lgpl2.1)))
5182 (define-public radeontop
5190 (url "https://github.com/clbr/radeontop.git")
5191 (commit (string-append "v" version))))
5192 (file-name (git-file-name name version))
5194 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5195 (build-system gnu-build-system)
5197 `(#:phases (modify-phases %standard-phases
5198 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5199 ;; dependency, and doesn't even work on release(!) tarballs.
5200 (add-after 'unpack 'report-correct-version
5202 (substitute* "getver.sh"
5204 (string-append "ver=" ,version)))
5206 (delete 'configure)) ; no configure script
5207 #:make-flags (list "CC=gcc"
5208 (string-append "PREFIX=" %output))
5209 #:tests? #f)) ; no tests
5211 `(("gettext" ,gettext-minimal)
5212 ("pkg-config" ,pkg-config)))
5214 `(("libdrm" ,libdrm)
5215 ("libpciaccess" ,libpciaccess)
5217 ("ncurses" ,ncurses)))
5218 (home-page "https://github.com/clbr/radeontop/")
5219 (synopsis "Usage monitor for AMD Radeon graphics")
5220 (description "RadeonTop monitors resource consumption on supported AMD
5221 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5222 a terminal or saved to a file for further processing. It measures both the
5223 activity of the GPU as a whole, which is also accurate during OpenCL
5224 computations, as well as separate component statistics that are only meaningful
5225 under OpenGL graphics workloads.")
5226 (license license:gpl3)))
5228 (define-public efivar
5234 (uri (string-append "https://github.com/rhboot/" name
5235 "/releases/download/" version "/" name
5236 "-" version ".tar.bz2"))
5239 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5240 (build-system gnu-build-system)
5242 `(;; Tests require a UEFI system and is not detected in the chroot.
5244 #:make-flags (list (string-append "prefix=" %output)
5245 (string-append "libdir=" %output "/lib")
5247 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5249 (modify-phases %standard-phases
5251 (add-before 'build 'kernel-headers-are-system-headers
5252 (lambda* (#:key inputs #:allow-other-keys)
5253 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
5254 ;; Make sure the kernel headers are treated as system headers
5255 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
5256 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
5259 `(("pkg-config" ,pkg-config)))
5262 (home-page "https://github.com/rhboot/efivar")
5263 (synopsis "Tool and library to manipulate EFI variables")
5264 (description "This package provides a library and a command line
5265 interface to the variable facility of UEFI boot firmware.")
5266 (license license:lgpl2.1+)))
5268 (define-public efibootmgr
5274 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5275 "/releases/download/" version "/efibootmgr"
5276 "-" version ".tar.bz2"))
5279 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5280 (build-system gnu-build-system)
5282 `(#:tests? #f ;no tests
5283 #:make-flags (list (string-append "prefix=" %output)
5284 (string-append "libdir=" %output "/lib")
5285 ;; EFIDIR denotes a subdirectory relative to the
5286 ;; EFI System Partition where the loader will be
5287 ;; installed (known as OS_VENDOR in the code).
5288 ;; GRUB overrides this, as such it's only used if
5289 ;; nothing else is specified on the command line.
5291 ;; Treat kernel headers as system headers to prevent
5292 ;; warnings about conflicting types.
5293 (string-append "C_INCLUDE_PATH="
5294 (assoc-ref %build-inputs "kernel-headers")
5296 #:phases (modify-phases %standard-phases (delete 'configure))))
5298 `(("pkg-config" ,pkg-config)))
5300 `(("efivar" ,efivar)
5302 (home-page "https://github.com/rhinstaller/efibootmgr")
5303 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5305 "@code{efibootmgr} is a user-space application to modify the Intel
5306 Extensible Firmware Interface (EFI) Boot Manager. This application can
5307 create and destroy boot entries, change the boot order, change the next
5308 running boot option, and more.")
5309 (license license:gpl2+)))
5311 (define-public sysstat
5317 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5318 "sysstat-" version ".tar.xz"))
5321 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
5322 (build-system gnu-build-system)
5324 `(#:tests? #f ; No test suite.
5325 ;; Without this flag, it tries to install the man pages with group 'root'
5326 ;; and fails because /etc/passwd lacks an entry for the root user.
5328 (list "--disable-file-attr"
5329 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5331 (modify-phases %standard-phases
5332 ;; The build process tries to create '/var/lib/sa', so we skip that
5334 (add-after 'build 'skip-touching-var
5336 (substitute* "Makefile"
5337 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5340 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5341 (synopsis "Performance monitoring tools for Linux")
5342 (description "The sysstat utilities are a collection of performance
5343 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5344 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5345 @code{sadf} and @code{sa}.")
5346 (license license:gpl2+)))
5348 (define-public light
5356 (url "https://github.com/haikarainen/light.git")
5357 (commit (string-append "v" version))))
5359 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
5360 (file-name (git-file-name name version))))
5361 (build-system gnu-build-system)
5364 (modify-phases %standard-phases
5365 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5366 (lambda* (#:key inputs #:allow-other-keys)
5367 (substitute* "90-backlight.rules"
5368 (("/bin/chgrp") (which "chgrp"))
5369 (("/bin/chmod") (which "chmod")))
5371 (add-after 'install 'install-udev-rules
5372 (lambda* (#:key outputs #:allow-other-keys)
5373 (let ((out (assoc-ref outputs "out")))
5375 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5378 `(("autoconf" ,autoconf)
5379 ("automake" ,automake)))
5380 (home-page "https://haikarainen.github.io/light/")
5381 (synopsis "GNU/Linux application to control backlights")
5383 "Light is a program to send commands to screen backlight controllers
5384 under GNU/Linux. Features include:
5387 @item It does not rely on X.
5388 @item Light can automatically figure out the best controller to use, making
5389 full use of underlying hardware.
5390 @item It is possible to set a minimum brightness value, as some controllers
5391 set the screen to be pitch black at a vaĺue of 0 (or higher).
5394 Light is the successor of lightscript.")
5395 (license license:gpl3+)))
5397 (define-public brightnessctl
5398 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5400 (name "brightnessctl")
5401 (version (git-version "0.4" "0" commit))
5405 (url "https://github.com/Hummer12007/brightnessctl/")
5407 (file-name (git-file-name name version))
5410 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5411 (build-system gnu-build-system)
5413 '(#:tests? #f ; no tests
5414 #:make-flags (list "CC=gcc"
5415 (string-append "PREFIX=" %output)
5416 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5418 (modify-phases %standard-phases
5420 (add-after 'unpack 'adjust-udev-rules
5422 (substitute* "90-brightnessctl.rules"
5423 (("/bin/") "/run/current-system/profile/bin/"))
5425 (home-page "https://github.com/Hummer12007/brightnessctl")
5426 (synopsis "Backlight and LED brightness control")
5428 "This program allows you read and control device brightness. Devices
5429 include backlight and LEDs. It can also preserve current brightness before
5430 applying the operation, such as on lid close.
5432 The appropriate permissions must be set on the backlight or LED control
5433 interface in sysfs, which can be accomplished with the included udev rules.")
5434 (license license:expat))))
5444 (url "https://github.com/linrunner/TLP.git")
5446 (file-name (git-file-name name version))
5448 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
5450 `(("shellcheck" ,shellcheck)))
5454 ("ethtool" ,ethtool)
5458 ("inetutils" ,inetutils)
5461 ("pciutils" ,pciutils)
5465 ("usbutils" ,usbutils)
5466 ("util-linux" ,util-linux)
5467 ("wireless-tools" ,wireless-tools)
5468 ,@(if (let ((system (or (%current-target-system)
5469 (%current-system))))
5470 (or (string-prefix? "i686-" system)
5471 (string-prefix? "x86_64-" system)))
5472 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5474 (build-system gnu-build-system)
5476 ;; XXX: The full test suite is run with "checkall" but it requires
5477 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
5478 `(#:test-target "shellcheck"
5479 #:modules ((guix build gnu-build-system)
5483 (modify-phases %standard-phases
5484 (delete 'configure) ; no configure script
5485 (add-before 'build 'setenv
5486 (lambda* (#:key outputs #:allow-other-keys)
5487 (let ((out (assoc-ref outputs "out")))
5488 (setenv "TLP_WITH_SYSTEMD" "0")
5489 (setenv "TLP_NO_INIT" "1")
5490 (setenv "TLP_NO_PMUTILS" "1")
5491 (setenv "TLP_SBIN" (string-append out "/bin"))
5492 (setenv "TLP_BIN" (string-append out "/bin"))
5493 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5494 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5495 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5496 (setenv "TLP_CONFDEF"
5497 (string-append out "/share/tlp/defaults.conf"))
5498 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
5500 (string-append out "/lib/elogind/system-sleep"))
5502 (string-append out "/share/bash-completion/completions"))
5503 (setenv "TLP_MAN" (string-append out "/share/man"))
5504 (setenv "TLP_META" (string-append out "/share/metainfo"))
5506 (add-before 'install 'fix-installation
5508 ;; Stop the Makefile from trying to create system directories.
5509 (substitute* "Makefile"
5510 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
5511 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5514 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
5515 (add-after 'install 'wrap
5516 (lambda* (#:key inputs outputs #:allow-other-keys)
5517 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5518 (bin-files (find-files bin ".*")))
5519 (define (bin-directory input-name)
5520 (let ((p (assoc-ref inputs input-name)))
5521 (and p (string-append p "/bin"))))
5522 (define (sbin-directory input-name)
5523 (string-append (assoc-ref inputs input-name) "/sbin"))
5524 (for-each (lambda (program)
5525 (wrap-program program
5528 (filter-map bin-directory
5540 "x86-energy-perf-policy"))
5541 (filter-map sbin-directory
5547 "wireless-tools"))))))
5550 (home-page "https://linrunner.de/en/tlp/tlp.html")
5551 (synopsis "Power management tool for Linux")
5552 (description "TLP is a power management tool for Linux. It comes with
5553 a default configuration already optimized for battery life. Nevertheless,
5554 TLP is customizable to fulfil system requirements. TLP settings are applied
5555 every time the power supply source is changed.")
5556 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5558 (license (list license:gpl2+ license:gpl3+))))
5566 (uri (string-append "https://www.ezix.org/software/"
5567 "files/lshw-" version
5571 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5572 (build-system gnu-build-system)
5574 `(#:phases (modify-phases %standard-phases (delete 'configure))
5575 #:tests? #f ; no tests
5577 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5578 (synopsis "List hardware information")
5580 "@command{lshw} (Hardware Lister) is a small tool to provide
5581 detailed information on the hardware configuration of the machine.
5582 It can report exact memory configuration, firmware version, mainboard
5583 configuration, CPU version and speed, cache configuration, bus speed,
5584 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5585 machines (PowerMac G4 is known to work).")
5586 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5587 (license license:gpl2+)))
5589 (define-public libmnl
5596 (uri (string-append "mirror://netfilter.org/libmnl/"
5597 "libmnl-" version ".tar.bz2"))
5600 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5601 (build-system gnu-build-system)
5602 (home-page "https://www.netfilter.org/projects/libmnl/")
5603 (synopsis "Netlink utility library")
5604 (description "Libmnl is a minimalistic user-space library oriented to
5605 Netlink developers. There are a lot of common tasks in parsing, validating,
5606 constructing of both the Netlink header and TLVs that are repetitive and easy to
5607 get wrong. This library aims to provide simple helpers that allows you to
5608 re-use code and to avoid re-inventing the wheel.")
5609 (license license:lgpl2.1+)))
5611 (define-public libnftnl
5618 (uri (string-append "mirror://netfilter.org/libnftnl/"
5619 "libnftnl-" version ".tar.bz2"))
5621 (base32 "1wqlxf76bkqf3qhka9sw32qhb2ni20q1k6rn3iril2kw482lvpk6"))
5623 (search-patches "libnftnl-dont-check-NFTNL_FLOWTABLE_SIZE.patch"))))
5624 (build-system gnu-build-system)
5626 `(("pkg-config" ,pkg-config)))
5628 `(("libmnl" ,libmnl)))
5629 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5630 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5631 (description "Libnftnl is a userspace library providing a low-level netlink
5632 programming interface to the in-kernel nf_tables subsystem. The library
5633 libnftnl has been previously known as libnftables. This library is currently
5635 (license license:gpl2+)))
5637 (define-public nftables
5644 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
5646 (string-append "https://www.nftables.org/projects/nftables"
5647 "/files/nftables-" version ".tar.bz2")))
5649 (base32 "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm"))))
5650 (build-system gnu-build-system)
5651 (arguments `(#:configure-flags
5652 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5653 (inputs `(("bison" ,bison)
5657 ("libnftnl" ,libnftnl)
5658 ("readline" ,readline)))
5659 (native-inputs `(("pkg-config" ,pkg-config)))
5660 (home-page "https://www.nftables.org")
5661 (synopsis "Userspace utility for Linux packet filtering")
5662 (description "nftables is the project that aims to replace the existing
5663 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5664 filtering framework, a new userspace utility and also a compatibility layer for
5665 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5666 infrastructure such as the existing hooks, the connection tracking system, the
5667 userspace queueing component and the logging subsystem.")
5668 (license license:gpl2)))
5670 (define-public proot
5678 (url "https://github.com/proot-me/PRoot.git")
5679 (commit (string-append "v" version))))
5680 (file-name (git-file-name name version))
5682 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5683 (patches (search-patches "proot-test-fhs.patch"))))
5684 (build-system gnu-build-system)
5686 '(#:make-flags '("-C" "src")
5688 #:phases (modify-phases %standard-phases
5690 (add-before 'build 'set-shell-file-name
5691 (lambda* (#:key inputs #:allow-other-keys)
5692 (substitute* (find-files "src" "\\.[ch]$")
5695 (assoc-ref inputs "bash")
5698 (add-before 'check 'fix-fhs-assumptions-in-tests
5700 (substitute* "tests/test-c6b77b77.mk"
5701 (("/bin/bash") (which "bash"))
5702 (("/usr/bin/test") (which "test")))
5703 (substitute* '("tests/test-16573e73.c")
5704 (("/bin/([a-z-]+)" _ program)
5707 (substitute* (find-files "tests" "\\.sh$")
5708 ;; Some of the tests try to "bind-mount" /bin/true.
5710 (string-append "-b " (which "true") ":"))
5711 ;; Likewise for /bin.
5712 (("-b /bin:") "-b /gnu:")
5713 ;; Others try to run /bin/sh.
5714 (("/bin/sh") (which "sh"))
5715 ;; Others assume /etc/fstab exists.
5716 (("/etc/fstab") "/etc/passwd"))
5718 (substitute* "tests/GNUmakefile"
5719 (("-b /bin:") "-b /gnu:"))
5721 ;; XXX: This test fails in an obscure corner case, just
5723 (delete-file "tests/test-kkkkkkkk.c")
5728 (let ((n (parallel-job-count)))
5729 ;; For some reason we get lots of segfaults with
5730 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5731 (setenv "PROOT_NO_SECCOMP" "1")
5733 ;; Most of the tests expect "/bin" to be in $PATH so
5734 ;; they can run things that live in $ROOTFS/bin.
5736 (string-append (getenv "PATH") ":/bin"))
5738 (invoke "make" "check" "-C" "tests"
5740 "-j" (number->string n)))))
5742 (lambda* (#:key outputs #:allow-other-keys)
5743 ;; The 'install' rule does nearly nothing.
5744 (let* ((out (assoc-ref outputs "out"))
5745 (man1 (string-append out "/share/man/man1")))
5746 ;; TODO: 'make install-care' (does not even
5747 ;; build currently.)
5748 (invoke "make" "-C" "src" "install"
5749 (string-append "PREFIX=" out))
5752 (copy-file "doc/proot/man.1"
5753 (string-append man1 "/proot.1"))
5755 (native-inputs `(("which" ,which)
5757 ;; For 'mcookie', used by some of the tests.
5758 ("util-linux" ,util-linux)))
5759 (inputs `(("talloc" ,talloc)))
5760 (home-page "https://github.com/proot-me/PRoot")
5761 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5763 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5764 and @code{binfmt_misc}. This means that users don't need any privileges or
5765 setup to do things like using an arbitrary directory as the new root
5766 file system, making files accessible somewhere else in the file system
5767 hierarchy, or executing programs built for another CPU architecture
5768 transparently through QEMU user-mode. Also, developers can use PRoot as a
5769 generic process instrumentation engine thanks to its extension mechanism.
5770 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5771 available in the kernel Linux.")
5772 (license license:gpl2+)))
5774 (define-public proot-static
5777 (name "proot-static")
5779 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5780 (inputs `(("talloc" ,talloc/static)))
5782 (substitute-keyword-arguments (package-arguments proot)
5783 ((#:make-flags flags)
5784 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5786 `(modify-phases ,phases
5787 (add-after 'strip 'remove-store-references
5788 (lambda* (#:key outputs #:allow-other-keys)
5789 (let* ((out (assoc-ref outputs "out")))
5790 (with-directory-excursion out
5791 (remove-store-references "bin/proot")
5793 ((#:allowed-references _ '("out"))
5796 (define-public cpuid
5799 (version "20200211")
5802 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5803 version ".src.tar.gz"))
5806 "06sjbqqp80l7nhsp6khglkzdp9qy4vhbvjxbfilznhsmrqiwlw55"))))
5807 (build-system gnu-build-system)
5809 '(#:make-flags '("CC=gcc")
5810 #:tests? #f ; no tests
5811 #:phases (modify-phases %standard-phases
5812 (delete 'configure) ; no configure script
5813 (add-before 'install 'fix-makefile
5814 (lambda* (#:key outputs #:allow-other-keys)
5815 (substitute* "Makefile"
5816 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5817 ;; Make the compressed manpages writable so that the
5818 ;; reset-gzip-timestamps phase does not error out.
5819 (substitute* "Makefile"
5820 (("-m 444") "-m 644"))
5822 (inputs `(("perl" ,perl)))
5823 (supported-systems '("i686-linux" "x86_64-linux"))
5824 (home-page "http://www.etallen.com/cpuid.html")
5825 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5826 (description "cpuid dumps detailed information about the CPU(s) gathered
5827 from the CPUID instruction, and also determines the exact model of CPU(s). It
5828 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5829 NexGen, Rise, and SiS CPUs.")
5830 (license license:gpl2+)))
5832 (define-public jmtpfs
5839 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5841 (file-name (string-append name "-" version ".tar.gz"))
5844 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5845 (build-system gnu-build-system)
5849 ("libmtp" ,libmtp)))
5851 `(("pkg-config" ,pkg-config)))
5852 (home-page "https://github.com/JasonFerrara/jmtpfs")
5853 (synopsis "Use a FUSE file system to access data over MTP")
5854 (description "jmtpfs uses FUSE (file system in userspace) to provide access
5855 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
5856 the MTP device as a file system.")
5857 (license license:gpl3)))
5859 (define-public procenv
5866 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5868 (file-name (string-append name "-" version ".tar.gz"))
5870 (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
5871 (build-system gnu-build-system)
5872 (arguments `(#:configure-flags '("--disable-silent-rules")))
5873 (native-inputs `(("pkg-config" ,pkg-config)))
5874 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5875 ("groff" ,groff) ; for tests
5876 ("libselinux" ,libselinux)))
5877 (synopsis "Utility to show process environment")
5878 (description "Procenv is a command-line tool that displays as much detail about
5879 itself and its environment as possible. It can be used as a test
5880 tool, to understand the type of environment a process runs in, and for
5881 comparing system environments.")
5882 (home-page "http://github.com/jamesodhunt/procenv/")
5883 (license license:gpl3+)))
5885 (define-public libfabric
5893 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5894 version "/libfabric-" version ".tar.bz2"))
5896 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5897 (build-system gnu-build-system)
5898 (inputs `(("rdma-core" ,rdma-core)
5899 ,@(match (%current-system)
5900 ((member (package-supported-systems psm))
5904 (home-page "https://ofiwg.github.io/libfabric/")
5905 (synopsis "Open Fabric Interfaces")
5907 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5908 communication services to applications. OFI is best described as a collection
5909 of libraries and applications used to export fabric services. The key
5910 components of OFI are: application interfaces, provider libraries, kernel
5911 services, daemons, and test applications.
5913 Libfabric is a core component of OFI. It is the library that defines and
5914 exports the user-space API of OFI, and is typically the only software that
5915 applications deal with directly. It works in conjunction with provider
5916 libraries, which are often integrated directly into libfabric.")
5917 (license (list license:bsd-2 license:gpl2)))) ;dual
5922 (version "3.3.20170428")
5923 (home-page "https://github.com/intel/psm")
5927 (uri (git-reference (url home-page)
5928 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5929 (file-name (string-append "psm-" version ".tar.gz"))
5931 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5932 (patches (search-patches
5933 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5934 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5935 "psm-repro.patch" ; reproducibility
5936 "psm-disable-memory-stats.patch"))))
5937 (build-system gnu-build-system)
5938 (outputs '("out" "debug"))
5939 (inputs `(("libuuid" ,util-linux)))
5941 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5942 ,(string-append "INSTALL_PREFIX=" %output)
5943 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5945 #:phases (modify-phases %standard-phases
5947 (add-after 'unpack 'patch-/usr/include
5949 (substitute* "Makefile"
5950 (("\\$\\{DESTDIR}/usr/include")
5951 (string-append %output "/include")))
5952 (substitute* "Makefile"
5953 (("/lib64") "/lib"))
5955 (add-after 'unpack 'patch-sysmacros
5957 (substitute* "ipath/ipath_proto.c"
5958 (("#include <sys/poll.h>" m)
5959 (string-append m "\n"
5960 "#include <sys/sysmacros.h>")))
5962 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5964 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5965 communications interface for the True Scale family of products. PSM users are
5966 enabled with mechanisms necessary to implement higher level communications
5967 interfaces in parallel environments.")
5968 ;; Only Intel-compatable processors are supported.
5969 (supported-systems '("i686-linux" "x86_64-linux"))
5970 (license (list license:bsd-2 license:gpl2)))) ;dual
5972 (define-public snapscreenshot
5974 (name "snapscreenshot")
5975 (version "1.0.14.3")
5979 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5980 name "-" version ".tar.bz2"))
5982 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5983 (build-system gnu-build-system)
5986 (let ((out (assoc-ref %outputs "out")))
5987 (list (string-append "BINDIR=" out "/bin")
5988 (string-append "MANDIR=" out "/share/man")))
5989 #:tests? #f ; no test suite
5991 (modify-phases %standard-phases
5992 (delete 'configure) ; ./configure is a snarky no-op
5993 (add-before 'install 'fix-ownership
5994 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5996 (substitute* "depfun.mak"
5997 ((" -o bin -g bin ") " "))
5999 (add-before 'install 'create-output-directories
6000 (lambda* (#:key outputs #:allow-other-keys)
6001 (let ((out (assoc-ref outputs "out")))
6002 (mkdir-p (string-append out "/share/man/man1"))
6004 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6005 (synopsis "Take screenshots of one or more Linux text consoles")
6007 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6008 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6009 relevant @file{/dev/vcs*} file(s).")
6010 (license license:gpl2)))
6012 (define-public fbcat
6019 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6020 version "/" name "-" version ".tar.gz"))
6022 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6023 (build-system gnu-build-system)
6025 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6026 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6027 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6028 `(("pnmtopng" ,netpbm)))
6029 (outputs (list "out" "fbgrab"))
6033 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6034 #:tests? #f ; no tests
6036 (modify-phases %standard-phases
6037 (delete 'configure) ; no configure script
6038 (add-after 'build 'qualify-references
6039 (lambda* (#:key inputs outputs #:allow-other-keys)
6040 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6041 (out (assoc-ref outputs "out")))
6042 (substitute* "fbgrab"
6044 (string-append out "/bin/" all))
6046 (string-append pnmtopng "/bin/" all)))
6048 (add-after 'install 'split-fbgrab-output
6049 (lambda* (#:key outputs #:allow-other-keys)
6050 (let* ((out (assoc-ref outputs "out"))
6051 (out:fbgrab (assoc-ref outputs "fbgrab")))
6052 (for-each (lambda (file)
6053 (let ((old (string-append out "/" file))
6054 (new (string-append out:fbgrab "/" file)))
6055 (mkdir-p (dirname new))
6056 (rename-file old new)))
6058 "share/man/man1/fbgrab.1"))
6060 (home-page "https://jwilk.net/software/fbcat")
6061 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6063 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6064 a dump therof. It supports a wide range of drivers and pixel formats.
6065 @command{fbcat} can take screenshots of virtually any application that can be
6066 made to write its output to the framebuffer, including (but not limited to)
6067 text-mode or graphical applications that don't use a display server.
6069 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6070 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6071 (license license:gpl2)))
6073 (define-public libcgroup
6081 "mirror://sourceforge/libcg/" name "/"
6082 version "/" name "-" version ".tar.bz2"))
6084 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6085 (build-system gnu-build-system)
6092 `(("linux-pam" ,linux-pam)))
6093 (home-page "https://sourceforge.net/projects/libcg/")
6094 (synopsis "Control groups management tools")
6095 (description "Control groups is Linux kernel method for process resource
6096 restriction, permission handling and more. This package provides userspace
6097 interface to this kernel feature.")
6098 (license license:lgpl2.1)))
6100 (define-public mbpfan
6108 (url "https://github.com/dgraziotin/mbpfan.git")
6109 (commit (string-append "v" version))))
6110 (file-name (git-file-name name version))
6112 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6113 (build-system gnu-build-system)
6115 '(#:tests? #f ; tests ask to be run as root
6116 #:make-flags (let ((out (assoc-ref %outputs "out")))
6117 (list (string-append "DESTDIR=" out)
6120 (modify-phases %standard-phases
6121 (add-after 'unpack 'patch-paths
6123 (substitute* "Makefile"
6126 (delete 'configure)))) ; there's no configure phase
6127 (home-page "https://github.com/dgraziotin/mbpfan")
6128 (synopsis "Control fan speed on Macbooks")
6130 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6131 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6132 module. It can be executed as a daemon or in the foreground with root
6134 (license license:gpl3+)))
6143 (url "https://github.com/intel/opa-psm2.git")
6144 (commit (string-append "PSM2_" version))))
6145 (file-name (git-file-name name version))
6148 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6149 (build-system gnu-build-system)
6152 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6154 #:phases (modify-phases %standard-phases
6156 (add-after 'unpack 'patch-Makefiles
6158 (substitute* "Makefile"
6161 (substitute* "compat/Makefile"
6167 (setenv "DESTDIR" %output)
6168 (invoke "make" "install")
6171 `(("rdma-core" ,rdma-core)
6172 ("numactl" ,numactl)))
6173 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6175 "This package is low-level user-level Intel's communications interface.
6176 The PSM2 API is a high-performance vendor-specific protocol that provides a
6177 low-level communications interface for the Intel Omni-Path family of
6178 high-speed networking devices.")
6179 (home-page "https://github.com/intel/opa-psm2")
6180 ;; Only the x86_64 architecure is supported.
6181 (supported-systems '("x86_64-linux"))
6182 (license (list license:bsd-3 license:gpl2)))) ; dual
6184 (define-public libpfm4
6190 (uri (string-append "mirror://sourceforge/perfmon2/"
6191 name "/libpfm-" version ".tar.gz"))
6194 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6195 (build-system gnu-build-system)
6197 '(#:modules ((guix build utils)
6198 (guix build gnu-build-system))
6199 #:phases (modify-phases %standard-phases
6203 (lambda* (#:key inputs outputs #:allow-other-keys)
6204 (let* ((out (assoc-ref outputs "out")))
6209 (lambda* (#:key outputs #:allow-other-keys)
6210 (let* ((out (assoc-ref outputs "out")))
6212 (string-append "PREFIX=" out)
6215 (synopsis "Performance event monitoring library")
6217 "This package provides a library called libpfm4, which is used to develop
6218 monitoring tools exploiting the performance monitoring events such as those
6219 provided by the Performance Monitoring Unit (PMU) of modern processors.
6221 Libpfm4 helps convert from an event name, expressed as a string, to the event
6222 encoding that is either the raw event as documented by the hardware vendor or
6223 the OS-specific encoding. In the latter case, the library is able to prepare
6224 the OS-specific data structures needed by the kernel to setup the event.
6226 libpfm4 provides support for the @code{perf_events} interface, which was
6227 introduced in Linux 2.6.31.")
6228 (home-page "http://perfmon2.sourceforge.net/")
6229 (license license:expat)))
6231 (define-public libnfnetlink
6233 (name "libnfnetlink")
6238 "https://www.netfilter.org/projects/libnfnetlink/files/"
6239 "libnfnetlink-" version ".tar.bz2"))
6242 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6243 (build-system gnu-build-system)
6244 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6245 (synopsis "Low-level netfilter netlink communication library")
6247 "@code{libnfnetlink} is the low-level library for netfilter related
6248 kernel/userspace communication. It provides a generic messaging
6249 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6250 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6251 management tools in userspace.")
6252 (license license:gpl2)))
6254 (define-public go-netlink
6261 (url "https://github.com/vishvananda/netlink.git")
6262 (commit (string-append "v" version))))
6263 (file-name (git-file-name name version))
6266 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6267 (build-system go-build-system)
6269 `(#:import-path "github.com/vishvananda/netlink"))
6271 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6272 ("go-netns" ,go-netns)))
6273 (home-page "https://github.com/vishvananda/netlink")
6274 (synopsis "Simple netlink library for Go")
6275 (description "The netlink package provides a simple netlink library for
6276 Go. Netlink is the interface a user-space program in Linux uses to
6277 communicate with the kernel. It can be used to add and remove interfaces, set
6278 IP addresses and routes, and configure IPsec.")
6279 (license license:asl2.0)))
6281 (define-public xfsprogs
6288 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6289 "xfsprogs-" version ".tar.gz"))
6292 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
6293 (build-system gnu-build-system)
6294 (outputs (list "out" "python"))
6296 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6298 (modify-phases %standard-phases
6299 (add-after 'install 'separate-python-output
6300 (lambda* (#:key outputs #:allow-other-keys)
6301 (let ((out (assoc-ref outputs "out"))
6302 (python (assoc-ref outputs "python")))
6305 (mkdir-p (string-append python (dirname script)))
6306 (rename-file (string-append out script)
6307 (string-append python script)))
6308 (list "/sbin/xfs_scrub_all"))
6310 (add-after 'install 'install-headers
6312 (invoke "make" "install-dev"))))))
6314 `(("gettext" ,gettext-minimal)))
6316 `(("libuuid" ,util-linux)
6317 ("python" ,python-wrapper)))
6318 (home-page "https://xfs.wiki.kernel.org/")
6319 (synopsis "XFS file system tools")
6320 (description "This package provides commands to create and check XFS
6322 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6323 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6324 (license (list license:gpl2 license:lgpl2.1))))
6326 (define-public genext2fs
6333 (url "https://github.com/jeremie-koenig/genext2fs.git")
6334 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6335 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6336 (file-name (git-file-name name version))
6338 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6339 (build-system gnu-build-system)
6342 (modify-phases %standard-phases
6343 (add-after 'unpack 'apply-debian-patches
6344 ;; Debian changes (the revision after ‘-’ in VERSION) are
6345 ;; maintained as separate patches. Apply those relevant to us.
6349 (invoke "patch" "-p1" "-i"
6350 (string-append "debian/patches/" file-name)))
6351 (list "blocksize+creator.diff" ; add -B/-o options
6352 "byteswap_fix.diff"))
6355 `(("autoconf" ,autoconf)
6356 ("automake" ,automake)))
6357 (home-page "https://github.com/jeremie-koenig/genext2fs")
6358 (synopsis "Generate ext2 file system as a normal user")
6359 (description "This package provides a program to generate an ext2
6360 file system as a normal (non-root) user. It does not require you to mount
6361 the image file to copy files on it, nor does it require that you become
6362 the superuser to make device nodes.")
6363 (license license:gpl2)))
6365 (define-public fakeroot
6371 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6372 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6373 (file-name (string-append name "-" version ".tar.gz"))
6376 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6377 (build-system gnu-build-system)
6380 (modify-phases %standard-phases
6381 (add-after 'configure 'patch-Makefile
6383 ;; Note: The root of the problem is already in "Makefile.am".
6384 (substitute* "Makefile"
6385 (("/bin/sh") (which "sh")))
6387 (add-after 'unpack 'patch-getopt
6388 (lambda* (#:key inputs #:allow-other-keys)
6389 (substitute* "scripts/fakeroot.in"
6391 (string-append (assoc-ref inputs "util-linux")
6394 (add-before 'configure 'setenv
6396 (setenv "LIBS" "-lacl")
6398 (add-before 'check 'prepare-check
6400 (setenv "SHELL" (which "bash"))
6401 (setenv "VERBOSE" "1")
6402 (substitute* "test/t.touchinstall"
6403 ;; We don't have the name of the root user, so use ID=0.
6404 (("grep root") "grep \"\\<0\\>\""))
6405 (substitute* "test/tartest"
6406 ;; We don't have the name of the root group, so use ID=0.
6407 (("ROOTGROUP=root") "ROOTGROUP=0")
6408 ;; We don't have the name of the daemon user, so use IDs.
6409 (("daemon:sys") "1:3")
6411 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6412 (substitute* "test/compare-tar"
6413 (("tar -tvf") "tar --numeric-owner -tvf"))
6417 ("sharutils" ,sharutils) ; for the tests
6418 ("xz" ,xz))) ; for the tests
6420 `(("libcap" ,libcap)
6421 ("util-linux" ,util-linux)))
6422 (synopsis "Provides a fake root environment")
6423 (description "@command{fakeroot} runs a command in an environment where
6424 it appears to have root privileges for file manipulation. This is useful
6425 for allowing users to create archives (tar, ar, .deb etc.) with files in
6426 them with root permissions/ownership. Without fakeroot one would have to
6427 have root privileges to create the constituent files of the archives with
6428 the correct permissions and ownership, and then pack them up, or one would
6429 have to construct the archives directly, without using the archiver.")
6430 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6431 (license license:gpl3+)))
6433 (define-public inputattach
6435 (name "inputattach")
6440 (url "https://github.com/linuxwacom/input-wacom.git")
6441 (commit (string-append "input-wacom-" version))))
6442 (file-name (git-file-name name version))
6444 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6445 (build-system gnu-build-system)
6448 (modify-phases %standard-phases
6452 (lambda* (#:key inputs #:allow-other-keys)
6453 (with-directory-excursion "inputattach"
6454 (invoke (string-append (assoc-ref inputs "gcc")
6456 "-O2" "-o" "inputattach" "inputattach.c"))
6460 (lambda* (#:key outputs #:allow-other-keys)
6461 (let ((target-dir (string-append
6462 (assoc-ref outputs "out")
6464 (mkdir-p target-dir)
6465 (copy-file "inputattach/inputattach"
6466 (string-append target-dir
6469 (home-page "https://linuxwacom.github.io/")
6470 (synopsis "Dispatch input peripherals events to a device file")
6471 (description "inputattach dispatches input events from several device
6472 types and interfaces and translates so that the X server can use them.")
6473 (license license:gpl2+)))
6475 (define-public pipewire
6482 (url "https://github.com/PipeWire/pipewire")
6484 (file-name (git-file-name name version))
6487 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
6488 (build-system meson-build-system)
6490 '(#:configure-flags '("-Dsystemd=false")))
6492 `(("pkg-config" ,pkg-config)))
6494 `(("alsa-lib" ,alsa-lib)
6498 ("gstreamer" ,gstreamer)
6499 ("gst-plugins-base" ,gst-plugins-base)
6503 (home-page "https://pipewire.org/")
6504 (synopsis "Server and user space API to deal with multimedia pipelines")
6506 "PipeWire is a project that aims to greatly improve handling of audio and
6507 video under Linux. It aims to support the usecases currently handled by both
6508 PulseAudio and Jack and at the same time provide same level of powerful handling
6509 of Video input and output. It also introduces a security model that makes
6510 interacting with audio and video devices from containerized applications easy,
6511 with supporting Flatpak applications being the primary goal. Alongside Wayland
6512 and Flatpak we expect PipeWire to provide a core building block for the future
6513 of Linux application development.")
6514 (license license:lgpl2.0+)))
6523 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6525 (file-name (git-file-name name version))
6528 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6529 (build-system gnu-build-system)
6532 (modify-phases %standard-phases
6533 (add-after 'unpack 'fix-dbus-tests
6535 (substitute* '("unit/test-dbus-message-fds.c"
6536 "unit/test-dbus-properties.c"
6538 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6542 ("libtool" ,libtool)))
6544 `(("autoconf" ,autoconf)
6545 ("pkgconfig" ,pkg-config)
6546 ("automake" ,automake)))
6547 (home-page "https://01.org/ell")
6548 (synopsis "Embedded Linux Library")
6549 (description "The Embedded Linux* Library (ELL) provides core, low-level
6550 functionality for system daemons. It typically has no dependencies other than
6551 the Linux kernel, C standard library, and libdl (for dynamic linking). While
6552 ELL is designed to be efficient and compact enough for use on embedded Linux
6553 platforms, it is not limited to resource-constrained systems.")
6554 (license license:lgpl2.1+)))
6556 (define-public lttng-ust
6562 (uri (string-append "https://lttng.org/files/lttng-ust/"
6563 "lttng-ust-" version ".tar.bz2"))
6566 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
6567 (build-system gnu-build-system)
6569 `(("liburcu" ,liburcu)
6570 ("numactl" ,numactl)))
6572 `(("python" ,python-3)))
6573 (home-page "https://lttng.org/")
6574 (synopsis "LTTng userspace tracer libraries")
6575 (description "The user space tracing library, liblttng-ust, is the LTTng
6576 user space tracer. It receives commands from a session daemon, for example to
6577 enable and disable specific instrumentation points, and writes event records
6578 to ring buffers shared with a consumer daemon.")
6579 (license license:lgpl2.1+)))
6581 (define-public kexec-tools
6583 (name "kexec-tools")
6587 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
6588 "/kexec/kexec-tools-" version ".tar.xz"))
6591 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
6592 (build-system gnu-build-system)
6594 ;; There are no automated tests.
6596 (home-page "https://projects.horms.net/projects/kexec/")
6597 (synopsis "Tools for booting directly into different kernels")
6598 (description "This package provides the @code{kexec} program and ancillary
6599 utilities. Using @code{kexec}, it is possible to boot directly into a new
6600 kernel from the context of an already-running kernel, bypassing the normal
6601 system boot process.")
6602 (license license:gpl2)))