1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 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 Brice Waegeneire <brice@waegenei.re>
40 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
41 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
43 ;;; This file is part of GNU Guix.
45 ;;; GNU Guix is free software; you can redistribute it and/or modify it
46 ;;; under the terms of the GNU General Public License as published by
47 ;;; the Free Software Foundation; either version 3 of the License, or (at
48 ;;; your option) any later version.
50 ;;; GNU Guix is distributed in the hope that it will be useful, but
51 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
52 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53 ;;; GNU General Public License for more details.
55 ;;; You should have received a copy of the GNU General Public License
56 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
58 (define-module (gnu packages linux)
59 #:use-module (gnu packages)
60 #:use-module (gnu packages acl)
61 #:use-module (gnu packages admin)
62 #:use-module (gnu packages algebra)
63 #:use-module (gnu packages attr)
64 #:use-module (gnu packages audio)
65 #:use-module (gnu packages autotools)
66 #:use-module (gnu packages backup)
67 #:use-module (gnu packages base)
68 #:use-module (gnu packages bash)
69 #:use-module (gnu packages bison)
70 #:use-module (gnu packages calendar)
71 #:use-module (gnu packages check)
72 #:use-module (gnu packages crypto)
73 #:use-module (gnu packages cryptsetup)
74 #:use-module (gnu packages compression)
75 #:use-module (gnu packages dbm)
76 #:use-module (gnu packages datastructures)
77 #:use-module (gnu packages docbook)
78 #:use-module (gnu packages documentation)
79 #:use-module (gnu packages elf)
80 #:use-module (gnu packages flex)
81 #:use-module (gnu packages file)
82 #:use-module (gnu packages freedesktop)
83 #:use-module (gnu packages gcc)
84 #:use-module (gnu packages gettext)
85 #:use-module (gnu packages glib)
86 #:use-module (gnu packages golang)
87 #:use-module (gnu packages gperf)
88 #:use-module (gnu packages gstreamer)
89 #:use-module (gnu packages gtk)
90 #:use-module (gnu packages haskell-apps)
91 #:use-module (gnu packages haskell-xyz)
92 #:use-module (gnu packages libunwind)
93 #:use-module (gnu packages libusb)
94 #:use-module (gnu packages man)
95 #:use-module (gnu packages maths)
96 #:use-module (gnu packages multiprecision)
97 #:use-module (gnu packages ncurses)
98 #:use-module (gnu packages netpbm)
99 #:use-module (gnu packages networking)
100 #:use-module (gnu packages ninja)
101 #:use-module (gnu packages nss)
102 #:use-module (gnu packages perl)
103 #:use-module (gnu packages pciutils)
104 #:use-module (gnu packages pkg-config)
105 #:use-module (gnu packages popt)
106 #:use-module (gnu packages pulseaudio)
107 #:use-module (gnu packages python)
108 #:use-module (gnu packages python-xyz)
109 #:use-module (gnu packages readline)
110 #:use-module (gnu packages rrdtool)
111 #:use-module (gnu packages samba)
112 #:use-module (gnu packages sdl)
113 #:use-module (gnu packages serialization)
114 #:use-module (gnu packages slang)
115 #:use-module (gnu packages texinfo)
116 #:use-module (gnu packages tls)
117 #:use-module (gnu packages valgrind)
118 #:use-module (gnu packages video)
119 #:use-module (gnu packages web)
120 #:use-module (gnu packages xiph)
121 #:use-module (gnu packages xml)
122 #:use-module (gnu packages xdisorg)
123 #:use-module (gnu packages xorg)
124 #:use-module (gnu packages groff)
125 #:use-module (gnu packages rsync)
126 #:use-module (gnu packages selinux)
127 #:use-module (gnu packages swig)
128 #:use-module (guix build-system cmake)
129 #:use-module (guix build-system gnu)
130 #:use-module (guix build-system go)
131 #:use-module (guix build-system meson)
132 #:use-module (guix build-system python)
133 #:use-module (guix build-system trivial)
134 #:use-module (guix build-system linux-module)
135 #:use-module (guix download)
136 #:use-module (guix git-download)
137 #:use-module ((guix licenses) #:prefix license:)
138 #:use-module (guix packages)
139 #:use-module (guix gexp)
140 #:use-module (guix store)
141 #:use-module (guix monads)
142 #:use-module (guix utils)
143 #:use-module (srfi srfi-1)
144 #:use-module (srfi srfi-2)
145 #:use-module (srfi srfi-26)
146 #:use-module (ice-9 match))
148 (define-public (system->linux-architecture arch)
149 "Return the Linux architecture name for ARCH, a Guix system name such as
150 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
151 (let ((arch (car (string-split arch #\-))))
152 (cond ((string=? arch "i686") "i386")
153 ((string-prefix? "mips" arch) "mips")
154 ((string-prefix? "arm" arch) "arm")
155 ((string-prefix? "aarch64" arch) "arm64")
156 ((string-prefix? "alpha" arch) "alpha")
157 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
158 ((string-prefix? "s390" arch) "s390")
159 ((string-prefix? "riscv" arch) "riscv")
162 (define-public (system->defconfig system)
163 "Some systems (notably powerpc-linux) require a special target for kernel
164 defconfig. Return the appropriate make target if applicable, otherwise return
166 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
167 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
172 ;;; Kernel source code deblobbing.
175 (define (linux-libre-deblob-scripts version
178 (list (version-major+minor version)
181 (uri (string-append "https://linux-libre.fsfla.org"
182 "/pub/linux-libre/releases/" version "-gnu/"
183 "deblob-" (version-major+minor version)))
184 (sha256 deblob-hash))
187 (uri (string-append "https://linux-libre.fsfla.org"
188 "/pub/linux-libre/releases/" version "-gnu/"
190 (sha256 deblob-check-hash))))
192 (define deblob-scripts-5.4
193 (linux-libre-deblob-scripts
195 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
196 (base32 "121px6030s89jh975sw0whwq315al6px1s7ildz3asql97bjdgc8")))
198 (define deblob-scripts-4.19
199 (linux-libre-deblob-scripts
201 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
202 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
204 (define deblob-scripts-4.14
205 (linux-libre-deblob-scripts
207 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
208 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
210 (define deblob-scripts-4.9
211 (linux-libre-deblob-scripts
213 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
214 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
216 (define deblob-scripts-4.4
217 (linux-libre-deblob-scripts
219 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
220 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
222 (define* (computed-origin-method gexp-promise hash-algo hash
223 #:optional (name "source")
224 #:key (system (%current-system))
225 (guile (default-guile)))
226 "Return a derivation that executes the G-expression that results
227 from forcing GEXP-PROMISE."
228 (mlet %store-monad ((guile (package->derivation guile system)))
229 (gexp->derivation (or name "computed-origin")
231 #:graft? #f ;nothing to graft
233 #:guile-for-build guile)))
235 (define (make-linux-libre-source version
238 "Return a 'computed' origin that generates a Linux-libre tarball from the
239 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
240 (match deblob-scripts
241 ((deblob-version (? origin? deblob) (? origin? deblob-check))
242 (unless (string=? deblob-version (version-major+minor version))
243 ;; The deblob script cannot be expected to work properly on a
244 ;; different version (major+minor) of Linux, even if no errors
245 ;; are signaled during execution.
246 (error "deblob major+minor version mismatch"))
248 (method computed-origin-method)
249 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
253 (with-imported-modules '((guix build utils))
255 (use-modules (guix build utils)
259 (let ((dir (string-append "linux-" #$version)))
262 (set-path-environment-variable
265 #+(canonical-package bash)
266 #+(canonical-package coreutils)
267 #+(canonical-package diffutils)
268 #+(canonical-package findutils)
269 #+(canonical-package patch)
270 #+(canonical-package xz)
271 #+(canonical-package sed)
272 #+(canonical-package grep)
273 #+(canonical-package bzip2)
274 #+(canonical-package gzip)
275 #+(canonical-package tar)
276 ;; The comments in the 'deblob-check' script
277 ;; claim that it supports Python 2 and 3, but
278 ;; in fact it fails when run in Python 3 as
282 (with-directory-excursion "/tmp/bin"
284 (copy-file #+deblob "deblob")
285 (chmod "deblob" #o755)
286 (substitute* "deblob"
287 (("/bin/sh") (which "sh")))
289 (copy-file #+deblob-check "deblob-check")
290 (chmod "deblob-check" #o755)
291 (substitute* "deblob-check"
292 (("/bin/sh") (which "sh"))
293 (("/bin/sed") (which "sed"))
294 (("/usr/bin/python") (which "python"))))
296 (if (file-is-directory? #+upstream-source)
298 (format #t "Copying upstream linux source...~%")
300 (invoke "cp" "--archive" #+upstream-source dir)
301 (invoke "chmod" "--recursive" "u+w" dir))
303 (format #t "Unpacking upstream linux tarball...~%")
305 (invoke "tar" "xf" #$upstream-source)
308 (and (not (member name '("." "..")))
309 (file-is-directory? name))))
311 (unless (string=? dir unpacked-dir)
312 (rename-file unpacked-dir dir)))
314 (error "multiple directories found" dirs)))))
316 (with-directory-excursion dir
317 (setenv "PYTHON" (which "python"))
318 (format #t "Running deblob script...~%")
320 (invoke "/tmp/bin/deblob"))
322 (format #t "~%Packing new Linux-libre tarball...~%")
324 (invoke "tar" "cvfa" #$output
325 ;; Avoid non-determinism in the archive.
338 (define (linux-libre-urls version)
339 "Return a list of URLs for Linux-Libre VERSION."
341 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
342 version "-gnu/linux-libre-" version "-gnu.tar.xz")
344 ;; XXX: Work around <http://bugs.gnu.org/14851>.
346 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
347 version "-gnu.tar.xz")
349 ;; Maybe this URL will become valid eventually.
351 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
352 version "-gnu.tar.xz")))
354 (define (%upstream-linux-source version hash)
357 (uri (string-append "mirror://kernel.org"
358 "/linux/kernel/v" (version-major version) ".x/"
359 "linux-" version ".tar.xz"))
362 (define-public linux-libre-5.4-version "5.4.17")
363 (define-public linux-libre-5.4-pristine-source
364 (let ((version linux-libre-5.4-version)
365 (hash (base32 "1fbl5knf6pini9lsx8mqkdmf3qbsydqvaxggh6nd1vk9mzv2npwl")))
366 (make-linux-libre-source version
367 (%upstream-linux-source version hash)
368 deblob-scripts-5.4)))
370 (define-public linux-libre-4.19-version "4.19.102")
371 (define-public linux-libre-4.19-pristine-source
372 (let ((version linux-libre-4.19-version)
373 (hash (base32 "05g0gkwvlwfx1wlinnwm3ryq7fblmxjzhp12g6vx2jbvvn486bih")))
374 (make-linux-libre-source version
375 (%upstream-linux-source version hash)
376 deblob-scripts-4.19)))
378 (define-public linux-libre-4.14-version "4.14.170")
379 (define-public linux-libre-4.14-pristine-source
380 (let ((version linux-libre-4.14-version)
381 (hash (base32 "1hqp3spi4cqgkqkzx5g2nbp6isz0kdcsj56ilsp6siqiglj662ll")))
382 (make-linux-libre-source version
383 (%upstream-linux-source version hash)
384 deblob-scripts-4.14)))
386 (define-public linux-libre-4.9-version "4.9.213")
387 (define-public linux-libre-4.9-pristine-source
388 (let ((version linux-libre-4.9-version)
389 (hash (base32 "0r7bqpvbpiiniwsm338b38mv6flfgm1r09avxqsakhkh8rvgz1dg")))
390 (make-linux-libre-source version
391 (%upstream-linux-source version hash)
392 deblob-scripts-4.9)))
394 (define-public linux-libre-4.4-version "4.4.213")
395 (define-public linux-libre-4.4-pristine-source
396 (let ((version linux-libre-4.4-version)
397 (hash (base32 "1cmwn9zvz14jqjy6qkszglhs2p5h6yh82b2269cbzvibg8y3rxq0")))
398 (make-linux-libre-source version
399 (%upstream-linux-source version hash)
400 deblob-scripts-4.4)))
402 (define %boot-logo-patch
403 ;; Linux-Libre boot logo featuring Freedo and a gnu.
406 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
407 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
410 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
412 (define %linux-libre-arm-export-__sync_icache_dcache-patch
416 "https://salsa.debian.org/kernel-team/linux"
417 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
418 "/debian/patches/bugfix/arm/"
419 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
420 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
422 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
424 (define (source-with-patches source patches)
427 (patches (append (origin-patches source)
430 (define-public linux-libre-5.4-source
431 (source-with-patches linux-libre-5.4-pristine-source
432 (list %boot-logo-patch
433 %linux-libre-arm-export-__sync_icache_dcache-patch)))
435 (define-public linux-libre-4.19-source
436 (source-with-patches linux-libre-4.19-pristine-source
437 (list %boot-logo-patch
438 %linux-libre-arm-export-__sync_icache_dcache-patch)))
440 (define-public linux-libre-4.14-source
441 (source-with-patches linux-libre-4.14-pristine-source
442 (list %boot-logo-patch)))
444 (define-public linux-libre-4.9-source
445 (source-with-patches linux-libre-4.9-pristine-source
446 (list %boot-logo-patch)))
448 (define-public linux-libre-4.4-source
449 (source-with-patches linux-libre-4.4-pristine-source
450 (list %boot-logo-patch)))
457 (define (make-linux-libre-headers version hash-string)
458 (make-linux-libre-headers* version
461 (uri (linux-libre-urls version))
462 (sha256 (base32 hash-string)))))
464 (define (make-linux-libre-headers* version source)
466 (name "linux-libre-headers")
469 (build-system gnu-build-system)
470 (native-inputs `(("perl" ,perl)
471 ,@(if (version>=? version "4.16")
475 ,@(if (version>=? version "5.3")
479 `(#:modules ((guix build gnu-build-system)
483 (modify-phases %standard-phases
487 (let ((arch ,(system->linux-architecture
488 (or (%current-target-system)
490 (defconfig ,(system->defconfig
491 (or (%current-target-system)
492 (%current-system)))))
494 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
495 (invoke "make" defconfig)
496 (invoke "make" "mrproper" "headers_check"))))
498 (lambda* (#:key outputs #:allow-other-keys)
499 (let ((out (assoc-ref outputs "out")))
501 (string-append "INSTALL_HDR_PATH=" out)
504 (mkdir (string-append out "/include/config"))
505 (call-with-output-file
507 "/include/config/kernel.release")
509 (format p "~a-default~%" ,version)))
511 ;; Remove the '.install' and '..install.cmd' files; the
512 ;; latter contains store paths, which pulls in bootstrap
513 ;; binaries in the build environment, and prevents bit
514 ;; reproducibility for the bootstrap binaries.
515 (for-each delete-file (find-files out "\\.install"))
518 #:allowed-references ()
520 (home-page "https://www.gnu.org/software/linux-libre/")
521 (synopsis "GNU Linux-Libre kernel headers")
522 (description "Headers of the Linux-Libre kernel.")
523 (license license:gpl2)))
525 (define-public linux-libre-headers-5.4
526 (make-linux-libre-headers* linux-libre-5.4-version
527 linux-libre-5.4-source))
529 (define-public linux-libre-headers-4.19
530 (make-linux-libre-headers* linux-libre-4.19-version
531 linux-libre-4.19-source))
533 (define-public linux-libre-headers-4.14
534 (make-linux-libre-headers* linux-libre-4.14-version
535 linux-libre-4.14-source))
537 (define-public linux-libre-headers-4.9
538 (make-linux-libre-headers* linux-libre-4.9-version
539 linux-libre-4.9-source))
541 (define-public linux-libre-headers-4.4
542 (make-linux-libre-headers* linux-libre-4.4-version
543 linux-libre-4.4-source))
545 ;; The following package is used in the early bootstrap, and thus must be kept
546 ;; stable and with minimal build requirements.
547 (define-public linux-libre-headers-4.19.56
548 (make-linux-libre-headers "4.19.56"
549 "1zqiic55viy065lhnkmhn33sz3bbbr2ykbm5f92yzd8lpc9zl7yx"))
551 (define-public linux-libre-headers linux-libre-headers-4.19.56)
555 ;;; Kernel configurations.
558 (define* (kernel-config arch #:key variant)
559 "Return the absolute file name of the Linux-Libre build configuration file
560 for ARCH and optionally VARIANT, or #f if there is no such configuration."
561 (let* ((name (string-append (if variant (string-append variant "-") "")
562 (if (string=? "i386" arch) "i686" arch) ".conf"))
563 (file (string-append "linux-libre/" name)))
564 (search-auxiliary-file file)))
566 ;; FIXME: merge into kernel-config
567 (define* (kernel-config-veyron arch #:key variant)
568 "Return the absolute file name of the Linux-Libre build configuration file
569 for ARCH and optionally VARIANT, or #f if there is no such configuration."
570 (let* ((name (string-append (if variant (string-append variant "-") "")
571 (if (string=? "i386" arch) "i686" arch) "-veyron.conf"))
572 (file (string-append "linux-libre/" name)))
573 (search-auxiliary-file file)))
575 (define %default-extra-linux-options
576 `(;; Some very mild hardening.
577 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
578 ;; All kernels should have NAMESPACES options enabled
579 ("CONFIG_NAMESPACES" . #t)
580 ("CONFIG_UTS_NS" . #t)
581 ("CONFIG_IPC_NS" . #t)
582 ("CONFIG_USER_NS" . #t)
583 ("CONFIG_PID_NS" . #t)
584 ("CONFIG_NET_NS" . #t)
585 ;; Modules required for initrd:
586 ("CONFIG_NET_9P" . m)
587 ("CONFIG_NET_9P_VIRTIO" . m)
588 ("CONFIG_VIRTIO_BLK" . m)
589 ("CONFIG_VIRTIO_NET" . m)
590 ("CONFIG_VIRTIO_PCI" . m)
591 ("CONFIG_VIRTIO_BALLOON" . m)
592 ("CONFIG_VIRTIO_MMIO" . m)
593 ("CONFIG_FUSE_FS" . m)
595 ("CONFIG_9P_FS" . m)))
597 (define (config->string options)
598 (string-join (map (match-lambda
600 (string-append option "=m"))
602 (string-append option "=y"))
604 (string-append option "=n")))
610 ;;; Kernel package utilities.
613 (define* (make-linux-libre version hash-string supported-systems
615 ;; A function that takes an arch and a variant.
616 ;; See kernel-config for an example.
618 (configuration-file #f)
619 (defconfig "defconfig")
620 (extra-options %default-extra-linux-options)
621 (patches (list %boot-logo-patch)))
622 (make-linux-libre* version
625 (uri (linux-libre-urls version))
626 (sha256 (base32 hash-string))
629 #:extra-version extra-version
630 #:configuration-file configuration-file
631 #:defconfig defconfig
632 #:extra-options extra-options))
634 (define* (make-linux-libre* version source supported-systems
636 ;; A function that takes an arch and a variant.
637 ;; See kernel-config for an example.
639 (configuration-file #f)
640 (defconfig "defconfig")
641 (extra-options %default-extra-linux-options))
643 (name (if extra-version
644 (string-append "linux-libre-" extra-version)
648 (supported-systems supported-systems)
649 (build-system gnu-build-system)
655 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
659 ;; These are needed to compile the GCC plugins.
664 ,@(match (and configuration-file
666 (system->linux-architecture
667 (or (%current-target-system) (%current-system)))
668 #:variant (version-major+minor version)))
669 (#f ;no config for this platform
672 `(("kconfig" ,config))))))
674 `(#:modules ((guix build gnu-build-system)
680 (modify-phases %standard-phases
681 (add-after 'unpack 'patch-/bin/pwd
683 (substitute* (find-files "." "^Makefile(\\.include)?$")
684 (("/bin/pwd") "pwd"))
687 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
688 ;; On AArch64 (at least), we need to remove glibc headers from
689 ;; CPATH (they are still available as "system headers"), so that
690 ;; the kernel can override uint64_t. See
691 ;; <https://bugs.gnu.org/37593>. This is also true when
692 ;; cross-compiling, except in that case, cross-libc must be
693 ;; removed from CROSS_CPATH.
694 (let ((var ,(if (%current-target-system)
697 (libc ,(if (%current-target-system)
703 (cut string-prefix? (assoc-ref inputs libc) <>)
704 (string-split (getenv var) #\:))
706 (format #t "environment variable `~a' changed to `~a'~%"
709 ;; Avoid introducing timestamps
710 (setenv "KCONFIG_NOTIMESTAMP" "1")
711 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
713 ;; Set ARCH and CROSS_COMPILE
714 (let ((arch ,(system->linux-architecture
715 (or (%current-target-system)
716 (%current-system)))))
718 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
721 (setenv "CROSS_COMPILE" (string-append target "-"))
722 (format #t "`CROSS_COMPILE' set to `~a'~%"
723 (getenv "CROSS_COMPILE"))))
725 (setenv "EXTRA_VERSION" ,extra-version)
727 (let ((build (assoc-ref %standard-phases 'build))
728 (config (assoc-ref (or native-inputs inputs) "kconfig")))
730 ;; Use a custom kernel configuration file or a default
731 ;; configuration file.
734 (copy-file config ".config")
735 (chmod ".config" #o666))
736 (invoke "make" ,defconfig))
738 ;; Appending works even when the option wasn't in the
739 ;; file. The last one prevails if duplicated.
740 (let ((port (open-file ".config" "a"))
741 (extra-configuration ,(config->string extra-options)))
742 (display extra-configuration port)
745 (invoke "make" "oldconfig"))))
747 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
748 (let* ((out (assoc-ref outputs "out"))
749 (moddir (string-append out "/lib/modules"))
750 (dtbdir (string-append out "/lib/dtbs"))
751 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
752 ;; Install kernel image, kernel configuration and link map.
753 (for-each (lambda (file) (install-file file out))
754 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
755 ;; Install device tree files
756 (unless (null? (find-files "." "\\.dtb$"))
758 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
760 ;; Install kernel modules
763 (string-append "DEPMOD=" kmod "/bin/depmod")
764 (string-append "MODULE_DIR=" moddir)
765 (string-append "INSTALL_PATH=" out)
766 (string-append "INSTALL_MOD_PATH=" out)
767 "INSTALL_MOD_STRIP=1"
768 "modules_install")))))
770 (home-page "https://www.gnu.org/software/linux-libre/")
771 (synopsis "100% free redistribution of a cleaned Linux kernel")
773 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
774 It has been modified to remove all non-free binary blobs.")
775 (license license:gpl2)))
779 ;;; Generic kernel packages.
782 (define-public linux-libre-5.4
783 (make-linux-libre* linux-libre-5.4-version
784 linux-libre-5.4-source
785 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
786 #:configuration-file kernel-config))
788 (define-public linux-libre-version linux-libre-5.4-version)
789 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
790 (define-public linux-libre-source linux-libre-5.4-source)
791 (define-public linux-libre linux-libre-5.4)
793 (define-public linux-libre-4.19
794 (make-linux-libre* linux-libre-4.19-version
795 linux-libre-4.19-source
796 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
797 #:configuration-file kernel-config))
799 (define-public linux-libre-4.14
800 (make-linux-libre* linux-libre-4.14-version
801 linux-libre-4.14-source
802 '("x86_64-linux" "i686-linux" "armhf-linux")
803 #:configuration-file kernel-config))
805 (define-public linux-libre-4.9
806 (make-linux-libre* linux-libre-4.9-version
807 linux-libre-4.9-source
808 '("x86_64-linux" "i686-linux")
809 #:configuration-file kernel-config))
811 (define-public linux-libre-4.4
812 (make-linux-libre* linux-libre-4.4-version
813 linux-libre-4.4-source
814 '("x86_64-linux" "i686-linux")
815 #:configuration-file kernel-config
818 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
819 ;; This option was removed upstream in version 4.7.
820 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
821 %default-extra-linux-options)))
825 ;;; Specialized kernel variants.
828 (define-public linux-libre-arm-veyron
829 (make-linux-libre* linux-libre-version
832 #:configuration-file kernel-config-veyron
833 #:extra-version "arm-veyron"))
835 (define-public linux-libre-arm-generic
836 (make-linux-libre* linux-libre-version
839 #:defconfig "multi_v7_defconfig"
840 #:extra-version "arm-generic"))
842 (define-public linux-libre-arm-generic-4.19
843 (make-linux-libre* linux-libre-4.19-version
844 linux-libre-4.19-source
846 #:defconfig "multi_v7_defconfig"
847 #:extra-version "arm-generic"))
849 (define-public linux-libre-arm-generic-4.14
850 (make-linux-libre* linux-libre-4.14-version
851 linux-libre-4.14-source
853 #:defconfig "multi_v7_defconfig"
854 #:extra-version "arm-generic"))
856 (define-public linux-libre-arm-omap2plus
857 (make-linux-libre* linux-libre-version
860 #:defconfig "omap2plus_defconfig"
861 #:extra-version "arm-omap2plus"))
863 (define-public linux-libre-arm-omap2plus-4.19
864 (make-linux-libre* linux-libre-4.19-version
865 linux-libre-4.19-source
867 #:defconfig "omap2plus_defconfig"
868 #:extra-version "arm-omap2plus"))
870 (define-public linux-libre-arm-omap2plus-4.14
871 (make-linux-libre* linux-libre-4.14-version
872 linux-libre-4.14-source
874 #:defconfig "omap2plus_defconfig"
875 #:extra-version "arm-omap2plus"))
877 (define-public linux-libre-riscv64-generic
878 (make-linux-libre* linux-libre-version
881 #:extra-version "riscv64-generic"))
885 ;;; Linux kernel modules.
888 (define-public acpi-call-linux-module
890 (name "acpi-call-linux-module")
896 (url "https://github.com/teleshoes/acpi_call.git")
898 (file-name (git-file-name name version))
900 (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
901 (build-system linux-module-build-system)
903 `(#:tests? #f ; no tests
905 (modify-phases %standard-phases
906 (add-after 'unpack 'fix-for-linux-4.12
908 (substitute* "acpi_call.c"
912 (add-after 'install 'install-documentation
913 (lambda* (#:key outputs #:allow-other-keys)
914 (let* ((out (assoc-ref outputs "out"))
915 (doc (string-append out "/share/doc/" ,name "-" ,version)))
916 (for-each (lambda (file)
917 (let ((target (string-append doc "/" file)))
918 (mkdir-p (dirname target))
919 (copy-recursively file target)))
920 (list "README.md" "examples"))
922 (home-page "https://github.com/teleshoes/acpi_call")
923 (synopsis "Linux kernel module to perform ACPI method calls")
925 "This simple Linux kernel module allows calls from user space to any
926 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
927 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
928 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
929 and @code{ACPI_BUFFER}.
931 It grants direct and undocumented access to your hardware that may cause damage
932 and should be used with caution, especially on untested models.")
933 (license license:gpl3+))) ; see README.md (no licence headers)
935 (define-public vhba-module
942 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
946 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
947 (build-system linux-module-build-system)
951 (home-page "https://cdemu.sourceforge.io/")
952 (synopsis "Kernel module that emulates SCSI devices")
953 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
954 between the CDemu userspace daemon and linux kernel.")
955 (license license:gpl2+)))
957 (define-public ddcci-driver-linux
959 (name "ddcci-driver-linux")
966 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
967 (commit (string-append "v" version))))
968 (file-name (git-file-name name version))
971 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
972 (build-system linux-module-build-system)
974 `(#:tests? #f ; no tests
976 (modify-phases %standard-phases
981 (with-directory-excursion module
982 (apply (assoc-ref %standard-phases 'build) args)))
983 '("ddcci" "ddcci-backlight"))
989 (with-directory-excursion module
990 (apply (assoc-ref %standard-phases 'install) args)))
991 '("ddcci" "ddcci-backlight"))
993 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
994 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
995 (description "This package provides two Linux kernel drivers, ddcci and
996 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
997 interface. The ddcci module creates a character device for each DDC/CI
998 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
999 module allows the control of the backlight level or luminance property when
1000 supported under @file{/sys/class/backlight/}.")
1001 (license license:gpl2+)))
1005 ;;; Pluggable authentication modules (PAM).
1008 (define-public linux-pam
1016 "https://github.com/linux-pam/linux-pam/releases/download/v"
1017 version "/Linux-PAM-" version ".tar.xz"))
1020 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1021 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1023 (build-system gnu-build-system)
1027 ;; TODO: optional dependencies
1028 ;; ("libxcrypt" ,libxcrypt)
1029 ;; ("cracklib" ,cracklib)
1032 `(;; Most users, such as `shadow', expect the headers to be under
1034 #:configure-flags (list (string-append "--includedir="
1035 (assoc-ref %outputs "out")
1036 "/include/security")
1038 ;; XXX: <rpc/rpc.h> is missing from glibc when
1039 ;; cross-compiling, so we have to disable NIS
1040 ;; support altogether.
1041 ,@(if (%current-target-system)
1045 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1048 (home-page "http://www.linux-pam.org/")
1049 (synopsis "Pluggable authentication modules for Linux")
1051 "A *Free* project to implement OSF's RFC 86.0.
1052 Pluggable authentication modules are small shared object files that can
1053 be used through the PAM API to perform tasks, like authenticating a user
1054 at login. Local and dynamic reconfiguration are its key features.")
1055 (license license:bsd-3)))
1057 (define-public linux-pam-1.2
1065 "http://www.linux-pam.org/library/"
1066 "Linux-PAM-" version ".tar.bz2"))
1069 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1070 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1077 (define-public psmisc
1084 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1087 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1088 (build-system gnu-build-system)
1090 `(,@(if (%current-target-system)
1093 "ac_cv_func_malloc_0_nonnull=yes"
1094 "ac_cv_func_realloc_0_nonnull=yes"))
1096 (inputs `(("ncurses" ,ncurses)))
1097 (home-page "https://gitlab.com/psmisc/psmisc")
1098 (synopsis "Small utilities that use the proc file system")
1100 "This PSmisc package is a set of some small useful utilities that
1101 use the proc file system. We're not about changing the world, but
1102 providing the system administrator with some help in common tasks.")
1103 (license license:gpl2+)))
1105 (define-public util-linux
1111 (uri (string-append "mirror://kernel.org/linux/utils/"
1112 "util-linux/v" (version-major+minor version) "/"
1113 "util-linux-" version ".tar.xz"))
1116 "1db2kydkwjmvgd1glkcba3adhidxw0f1x735dcjdpdjjf869sgvl"))
1117 (patches (search-patches "util-linux-tests.patch"))
1118 (modules '((guix build utils)))
1120 ;; We take 'nologin' from Shadow, the 'logger' program from
1121 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1123 (substitute* "configure"
1124 (("build_nologin=yes") "build_nologin=no")
1125 (("build_logger=yes") "build_logger=no")
1126 (("build_kill=yes") "build_kill=no"))
1128 (build-system gnu-build-system)
1130 "static")) ;>2 MiB of static .a libraries
1132 `(#:configure-flags (list "--disable-use-tty-group"
1133 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1134 ;; Don't try to chown root:root mount and umount
1135 "--disable-makeinstall-chown"
1136 ;; Install completions where our
1137 ;; bash-completion package expects them.
1138 (string-append "--with-bashcompletiondir="
1139 (assoc-ref %outputs "out")
1140 "/etc/bash_completion.d"))
1141 #:phases (modify-phases %standard-phases
1142 (add-before 'build 'set-umount-file-name
1143 (lambda* (#:key outputs #:allow-other-keys)
1144 ;; Tell 'eject' the right file name of 'umount'.
1145 (let ((out (assoc-ref outputs "out")))
1146 (substitute* "sys-utils/eject.c"
1147 (("\"/bin/umount\"")
1148 (string-append "\"" out "/bin/umount\"")))
1150 (add-before 'check 'pre-check
1151 (lambda* (#:key inputs outputs #:allow-other-keys)
1152 (let ((out (assoc-ref outputs "out"))
1153 (net (assoc-ref inputs "net-base")))
1154 ;; Change the test to refer to the right file.
1155 (substitute* "tests/ts/misc/mcookie"
1157 (string-append net "/etc/services")))
1159 (add-after 'install 'move-static-libraries
1160 (lambda* (#:key outputs #:allow-other-keys)
1161 (let ((out (assoc-ref outputs "out"))
1162 (static (assoc-ref outputs "static")))
1163 (mkdir-p (string-append static "/lib"))
1164 (with-directory-excursion out
1165 (for-each (lambda (file)
1167 (string-append static "/"
1169 (find-files "lib" "\\.a$"))
1171 ;; Remove references to the static library from the '.la'
1172 ;; files so that Libtool does the right thing when both
1173 ;; the shared and static library is available.
1174 (substitute* (find-files "lib" "\\.la$")
1175 (("old_library=.*") "old_library=''\n")))
1178 (inputs `(("zlib" ,zlib)
1179 ("ncurses" ,ncurses)
1181 ;; XXX: This is so that the 'pre-check' phase can find it.
1182 ,@(if (%current-target-system)
1183 `(("net-base" ,net-base))
1187 ("net-base" ,net-base))) ;for tests
1188 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1189 (synopsis "Collection of utilities for the Linux kernel")
1190 (description "Util-linux is a diverse collection of Linux kernel
1191 utilities. It provides dmesg and includes tools for working with file systems,
1192 block devices, UUIDs, TTYs, and many other tools.")
1194 ;; Note that util-linux doesn't use the same license for all the
1195 ;; code. GPLv2+ is the default license for a code without an
1196 ;; explicitly defined license.
1197 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1198 license:bsd-4 license:public-domain))))
1200 ;; util-linux optionally supports udev, which allows lsblk to read file system
1201 ;; metadata without special privileges. Add it as a separate package to avoid
1202 ;; a circular dependency, and to keep the size small.
1203 (define-public util-linux+udev
1206 (name "util-linux-with-udev")
1209 ,@(package-inputs util-linux)))))
1211 (define-public ddate
1217 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1219 (file-name (string-append name "-" version ".tar.gz"))
1221 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1222 (build-system cmake-build-system)
1223 (arguments '(#:tests? #f))
1224 (home-page "https://github.com/bo0ts/ddate")
1225 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1227 "ddate displays the Discordian date and holidays of a given date.
1228 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1229 by Robert Shea and Robert Anton Wilson.")
1230 (license license:public-domain)))
1232 (define-public procps
1238 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1239 "procps-ng-" version ".tar.xz"))
1242 "0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
1243 (build-system gnu-build-system)
1245 '(#:modules ((guix build utils)
1246 (guix build gnu-build-system)
1250 (modify-phases %standard-phases
1252 'install 'post-install
1253 ;; Remove commands and man pages redudant with
1255 (lambda* (#:key outputs #:allow-other-keys)
1256 (let* ((out (assoc-ref outputs "out"))
1257 (dup (append-map (cut find-files out <>)
1258 '("^kill" "^uptime"))))
1259 (for-each delete-file dup)
1261 (inputs `(("ncurses" ,ncurses)))
1262 (home-page "https://gitlab.com/procps-ng/procps/")
1263 (synopsis "Utilities that give information about processes")
1265 "Procps is the package that has a bunch of small useful utilities
1266 that give information about processes using the Linux /proc file system.
1267 The package includes the programs ps, top, vmstat, w, kill, free,
1268 slabtop, and skill.")
1269 (license license:gpl2)))
1271 (define-public usbutils
1278 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1279 "usbutils-" version ".tar.xz"))
1281 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1282 (build-system gnu-build-system)
1283 (outputs (list "out" "python"))
1286 (modify-phases %standard-phases
1287 (add-before 'bootstrap 'patch-bootstrap-scripts
1289 (substitute* "usbhid-dump/bootstrap"
1290 (("/bin/bash") (which "bash")))
1292 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1293 (substitute* "autogen.sh"
1294 (("^\\./configure.*") ""))
1296 (add-after 'install 'separate-python-output
1297 ;; Separating one Python script shaves more than 106 MiB from :out.
1298 (lambda* (#:key outputs #:allow-other-keys)
1299 (let ((out (assoc-ref outputs "out"))
1300 (out:python (assoc-ref outputs "python")))
1301 (for-each (lambda (file)
1302 (let ((old (string-append out "/" file))
1303 (new (string-append out:python "/" file)))
1304 (mkdir-p (dirname new))
1305 (rename-file old new)))
1306 (list "bin/lsusb.py"))
1311 ("python" ,python)))
1313 `(("autoconf" ,autoconf)
1314 ("automake" ,automake)
1315 ("libtool" ,libtool)
1316 ("pkg-config" ,pkg-config)))
1317 (home-page "http://www.linux-usb.org/")
1319 "Tools for working with USB devices, such as lsusb")
1321 "Tools for working with USB devices, such as lsusb.")
1322 (license license:gpl2+)))
1324 (define-public e2fsprogs
1331 "mirror://kernel.org/linux/kernel/people/tytso/"
1332 name "/v" version "/"
1333 name "-" version ".tar.xz"))
1336 "1pmf8inp736l587rqq7qsd8bv0mmg5cwrivxg5p5awqgv70crypr"))))
1337 (build-system gnu-build-system)
1338 (inputs `(("util-linux" ,util-linux)))
1339 (native-inputs `(("pkg-config" ,pkg-config)
1340 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1344 ("procps" ,procps)))
1346 '(;; util-linux is the preferred source for some of the libraries and
1347 ;; commands, so disable them (see, e.g.,
1348 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1349 #:configure-flags (list "--disable-libblkid"
1350 "--disable-libuuid" "--disable-uuidd"
1353 ;; Use symlinks instead of hard links for
1354 ;; 'fsck.extN' etc. This makes the resulting nar
1355 ;; smaller and is preserved across copies.
1356 "--enable-symlink-install"
1358 (string-append "LDFLAGS=-Wl,-rpath="
1359 (assoc-ref %outputs "out")
1362 ;; Install libext2fs et al.
1363 "--enable-elf-shlibs")
1366 (modify-phases %standard-phases
1367 (add-before 'configure 'patch-shells
1369 (substitute* "configure"
1370 (("/bin/sh (.*)parse-types.sh" _ dir)
1371 (string-append (which "sh") " " dir
1373 (substitute* "MCONFIG.in"
1374 (("INSTALL_SYMLINK = /bin/sh")
1375 "INSTALL_SYMLINK = sh"))
1376 (substitute* (find-files "." "^Makefile.in$")
1378 (string-append "#!" (which "sh"))))
1380 (add-after 'install 'install-libs
1381 (lambda* (#:key outputs #:allow-other-keys)
1382 (let* ((out (assoc-ref outputs "out"))
1383 (lib (string-append out "/lib")))
1384 (invoke "make" "install-libs")
1386 ;; Make the .a writable so that 'strip' works.
1387 ;; Failing to do that, due to debug symbols, we
1388 ;; retain a reference to the final
1389 ;; linux-libre-headers, which refer to the
1390 ;; bootstrap binaries.
1391 (let ((archives (find-files lib "\\.a$")))
1392 (for-each (lambda (file)
1396 (home-page "http://e2fsprogs.sourceforge.net/")
1397 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1399 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1400 (license (list license:gpl2 ;programs
1401 license:lgpl2.0 ;libext2fs
1402 license:x11)))) ;libuuid
1404 (define e2fsprogs/static
1406 (package (inherit e2fsprogs)
1408 ;; Do not build shared libraries.
1409 (substitute-keyword-arguments (package-arguments e2fsprogs)
1410 ((#:configure-flags _)
1411 '(list "--disable-blkid"))
1415 (define-public e2fsck/static
1417 (name "e2fsck-static")
1418 (version (package-version e2fsprogs))
1419 (build-system trivial-build-system)
1422 `(("e2fsprogs" ,e2fsprogs/static)))
1424 `(#:modules ((guix build utils))
1427 (use-modules (guix build utils)
1431 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1433 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1435 (with-directory-excursion bin
1436 (copy-file e2fsck "e2fsck")
1437 (remove-store-references "e2fsck")
1438 (chmod "e2fsck" #o555))
1440 (home-page (package-home-page e2fsprogs))
1441 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1442 (description "This package provides statically-linked e2fsck command taken
1443 from the e2fsprogs package. It is meant to be used in initrds.")
1444 (license (package-license e2fsprogs))))
1446 (define-public extundelete
1448 (name "extundelete")
1453 (uri (string-append "mirror://sourceforge/extundelete/"
1454 "extundelete/" version "/extundelete-"
1455 version ".tar.bz2"))
1458 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1459 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1460 (build-system gnu-build-system)
1461 (inputs `(("e2fsprogs" ,e2fsprogs)))
1462 (home-page "http://extundelete.sourceforge.net/")
1463 (synopsis "Recover deleted files from ext2/3/4 partitions")
1465 "Extundelete is a set of tools that can recover deleted files from an
1466 ext3 or ext4 partition.")
1467 (license license:gpl2)))
1469 (define-public zerofree
1473 (home-page "https://frippery.org/uml/")
1476 (uri (string-append home-page name "-" version
1480 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1481 (build-system gnu-build-system)
1484 (modify-phases %standard-phases
1485 (delete 'configure) ; no configure script
1487 ;; The Makefile lacks an ‘install’ target.
1488 (lambda* (#:key outputs #:allow-other-keys)
1489 (let* ((out (assoc-ref outputs "out"))
1490 (bin (string-append out "/bin")))
1491 (chmod "zerofree" #o555)
1492 (install-file "zerofree" bin)
1494 #:tests? #f)) ; no tests
1495 (inputs `(("libext2fs" ,e2fsprogs)))
1496 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1498 "Zerofree finds the unallocated blocks with non-zero value content in an
1499 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1500 This is a simple way to make disk images more compressible.
1501 Zerofree requires the file system to be unmounted or mounted read-only.")
1502 (license license:gpl2)))
1504 (define-public strace
1508 (home-page "https://strace.io")
1511 (uri (string-append home-page "/files/" version
1512 "/strace-" version ".tar.xz"))
1515 "0hd7sb7l99y9rcj8jjc1b6m3ryds17krsymdg3dvd40jsla0bl7p"))))
1516 (build-system gnu-build-system)
1519 (modify-phases %standard-phases
1520 (add-after 'unpack 'patch-/bin/sh
1522 (substitute* "strace.c"
1523 (("/bin/sh") (which "sh")))
1525 ;; Don't fail if the architecture doesn't support different personalities.
1526 #:configure-flags '("--enable-mpers=check")
1527 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1528 #:parallel-tests? #f)) ; undeterministic failures
1529 (native-inputs `(("perl" ,perl)))
1530 (synopsis "System call tracer for Linux")
1532 "strace is a system call tracer, i.e. a debugging tool which prints out a
1533 trace of all the system calls made by a another process/program.")
1534 (license license:lgpl2.1+)))
1536 (define-public ltrace
1542 (uri (string-append "http://www.ltrace.org/ltrace_" version
1546 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1547 (build-system gnu-build-system)
1548 (inputs `(("libelf" ,libelf)))
1550 ;; Compilation uses -Werror by default, but it fails.
1551 '(#:configure-flags '("--disable-werror")))
1552 (home-page "https://www.ltrace.org/")
1553 (synopsis "Library call tracer for Linux")
1555 "ltrace intercepts and records dynamic library calls which are called by
1556 an executed process and the signals received by that process. It can also
1557 intercept and print the system calls executed by the program.")
1558 (license license:gpl2+)))
1560 (define-public alsa-lib
1567 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1568 version ".tar.bz2"))
1571 "0hvrx0ipzqbcx4y1cmr9bgm9niifzkrhsb1ddgzzdwbk6q72d3lm"))))
1572 (build-system gnu-build-system)
1574 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1575 (assoc-ref %outputs "out")
1577 (home-page "https://www.alsa-project.org/")
1578 (synopsis "The Advanced Linux Sound Architecture libraries")
1580 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1581 MIDI functionality to the Linux-based operating system.")
1582 (license license:lgpl2.1+)))
1584 (define-public alsa-utils
1590 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1591 name "-" version ".tar.bz2"))
1594 "039c19b7091is0czl9jlrfczp7pp1jpdri0vvc4k07gl3skhn48b"))))
1595 (build-system gnu-build-system)
1597 ;; XXX: Disable man page creation until we have DocBook.
1598 '(#:configure-flags (list "--disable-xmlto"
1600 ;; The udev rule is responsible for restoring
1602 (string-append "--with-udev-rules-dir="
1603 (assoc-ref %outputs "out")
1604 "/lib/udev/rules.d"))
1606 (modify-phases %standard-phases
1607 (add-before 'check 'disable-broken-test
1609 ;; XXX: The 1.1.8 release tarball is missing a header that's
1610 ;; required for this test to work. Fixed in 1.1.9.
1611 (substitute* "axfer/test/Makefile"
1612 ((".*container-test.*") ""))
1615 'install 'pre-install
1617 ;; Don't try to mkdir /var/lib/alsa.
1618 (substitute* "Makefile"
1619 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1623 `(("libsamplerate" ,libsamplerate)
1624 ("ncurses" ,ncurses)
1625 ("alsa-lib" ,alsa-lib)
1627 ("gettext" ,gettext-minimal)))
1628 (home-page "http://www.alsa-project.org/")
1629 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1631 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1632 MIDI functionality to the Linux-based operating system.")
1634 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1636 (license license:gpl2)))
1638 (define-public alsa-plugins
1640 (name "alsa-plugins")
1644 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1645 name "-" version ".tar.bz2"))
1648 "1nj8cpbi05rb62yzs01c1k7lymdn1ch229b599hbhd0psixdx52d"))))
1649 (build-system gnu-build-system)
1650 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1651 ;; be split, there are references to both in files.
1652 ;; TODO: Remove OSS related plugins, they add support to run native
1653 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1655 (outputs '("out" "pulseaudio" "jack"))
1657 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1658 ;; for /etc/alsa. On Guix System plugins are loaded from
1659 ;; the ALSA service, and other distributions likely
1660 ;; won't use these files.
1661 "--with-alsalconfdir=/tmp/noop")
1663 (modify-phases %standard-phases
1664 (add-after 'install 'split
1665 (lambda* (#:key inputs outputs #:allow-other-keys)
1666 ;; Distribute the binaries to the various outputs.
1667 (let* ((out (assoc-ref outputs "out"))
1668 (jack (assoc-ref outputs "jack"))
1669 (jacklib (string-append jack "/lib/alsa-lib"))
1670 (pua (assoc-ref outputs "pulseaudio"))
1671 (pualib (string-append pua "/lib/alsa-lib")))
1674 (for-each (lambda (file)
1675 (rename-file file (string-append jacklib "/" (basename file))))
1676 (find-files out ".*jack\\.(la|so)"))
1679 (for-each (lambda (file)
1680 (rename-file file (string-append pualib "/" (basename file))))
1681 (find-files out ".*pulse\\.(la|so)"))
1684 `(("alsa-lib" ,alsa-lib)
1686 ("speex" ,speex) ; libspeexdsp resampling plugin
1687 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1688 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1689 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1691 `(("pkg-config" ,pkg-config)))
1692 (home-page "http://www.alsa-project.org/")
1693 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1695 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1696 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1697 by providing additional plugins which include: upmixing, downmixing, jackd and
1698 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1699 external rate conversion.")
1700 (license (list license:gpl2+
1701 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1702 license:lgpl2.1+))))
1704 (define-public iptables
1711 "mirror://netfilter.org/iptables/iptables-"
1712 version ".tar.bz2"))
1715 "0z0mgs1ghvn3slc868mgbf2g26njgrzcy5ggyb5w4i55j1a3lflr"))))
1716 (build-system gnu-build-system)
1718 `(("pkg-config" ,pkg-config)
1722 `(("libmnl" ,libmnl)
1723 ("libnftnl" ,libnftnl)))
1725 '(#:tests? #f ; no test suite
1726 #:configure-flags ; add $libdir to the RUNPATH of executables
1727 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1728 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1729 (synopsis "Programs to configure Linux IP packet filtering rules")
1731 "@command{iptables} is the user-space command line program used to
1732 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1733 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1735 This package also includes @command{ip6tables}, which is used to configure the
1738 Both commands are targeted at system administrators.")
1739 (license license:gpl2+)))
1741 (define-public ebtables
1744 (version "2.0.10-4")
1748 "mirror://netfilter.org/ebtables/ebtables-v"
1752 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1753 (build-system gnu-build-system)
1755 '(#:tests? #f ; no test suite
1757 (let* ((out (assoc-ref %outputs "out"))
1758 (bin (string-append out "/sbin"))
1759 (lib (string-append out "/lib"))
1760 (man (string-append out "/share/man"))
1761 (iptables (assoc-ref %build-inputs "iptables"))
1762 (ethertypes (string-append iptables "/etc/ethertypes")))
1763 (list (string-append "LIBDIR=" lib)
1764 (string-append "MANDIR=" man)
1765 (string-append "BINDIR=" bin)
1766 (string-append "ETHERTYPESFILE=" ethertypes)
1767 ;; With the default CFLAGS, it falis with:
1768 ;; communication.c:259:58: error: variable ‘ret’ set but not
1769 ;; used [-Werror=unused-but-set-variable]
1772 (modify-phases %standard-phases
1774 ;; no configure script
1776 (substitute* "Makefile"
1777 ;; Remove user and group options from install commands,
1778 ;; otherwise it fails with: invalid user 'root'.
1779 (("-o root -g root") "")
1780 ;; Remove 'ethertypes' from the install target.
1782 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1786 ("iptables" ,iptables)))
1787 (synopsis "Ethernet bridge frame table administration")
1788 (home-page "http://ebtables.netfilter.org/")
1790 "ebtables is an application program used to set up and maintain the
1791 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1792 analogous to the iptables application, but less complicated, due to the fact
1793 that the Ethernet protocol is much simpler than the IP protocol.")
1794 (license license:gpl2+)))
1796 (define-public iproute
1803 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1807 "0ywg70f98wgfai35jl47xzpjp45a6n7crja4vc8ql85cbi1l7ids"))))
1808 (build-system gnu-build-system)
1810 `( ;; There is a test suite, but it wants network namespaces and sudo.
1812 #:make-flags (let ((out (assoc-ref %outputs "out")))
1814 (string-append "BASH_COMPDIR=" out
1815 "/etc/bash_completion.d")
1816 (string-append "LIBDIR=" out "/lib")
1817 (string-append "HDRDIR=" out "/include")
1818 (string-append "SBINDIR=" out "/sbin")
1819 (string-append "CONFDIR=" out "/etc")
1820 (string-append "DOCDIR=" out "/share/doc/"
1822 (string-append "MANDIR=" out "/share/man")))
1823 #:phases (modify-phases %standard-phases
1824 (add-before 'install 'pre-install
1826 ;; Don't attempt to create /var/lib/arpd.
1827 (substitute* "Makefile"
1828 (("^.*ARPDDIR.*$") ""))
1832 ("iptables" ,iptables)
1833 ("libmnl" ,libmnl)))
1837 ("pkg-config" ,pkg-config)))
1839 ;; ("libmnl" ,libmnl)
1840 ;; ("util-linux" ,util-linux)
1842 "https://wiki.linuxfoundation.org/networking/iproute2")
1844 "Utilities for controlling TCP/IP networking and traffic in Linux")
1846 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1847 and traffic with the Linux kernel. The most important of these are
1848 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1851 Most network configuration manuals still refer to ifconfig and route as the
1852 primary network configuration tools, but ifconfig is known to behave
1853 inadequately in modern network environments, and both should be deprecated.")
1854 (license license:gpl2+)))
1856 (define-public net-tools
1857 ;; XXX: This package is basically unmaintained, but it provides a few
1858 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1860 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1864 (version (string-append "1.60-" revision "." (string-take commit 7)))
1867 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1868 "n/ne/net-tools/code.git/net-tools-code-"
1870 (file-name (string-append name "-" version ".zip"))
1873 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1874 (home-page "http://net-tools.sourceforge.net/")
1875 (build-system gnu-build-system)
1877 '(#:modules ((guix build gnu-build-system)
1882 (modify-phases %standard-phases
1884 (lambda* (#:key outputs #:allow-other-keys)
1885 (let ((out (assoc-ref outputs "out")))
1886 (mkdir-p (string-append out "/bin"))
1887 (mkdir-p (string-append out "/sbin"))
1889 ;; Pretend we have everything...
1890 (system "yes | make config")
1892 ;; ... except for the things we don't have.
1893 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1894 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1895 ;; that have been removed.
1896 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1897 ;; think about adding them later.
1898 (substitute* '("config.make" "config.h")
1899 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1902 (add-after 'install 'remove-redundant-commands
1903 (lambda* (#:key outputs #:allow-other-keys)
1904 ;; Remove commands and man pages redundant with Inetutils.
1905 (let* ((out (assoc-ref outputs "out"))
1906 (dup (append-map (cut find-files out <>)
1908 "^(yp|nis|dns)?domainname"))))
1909 (for-each delete-file dup)
1911 ;; Binaries that depend on libnet-tools.a don't declare that
1912 ;; dependency, making it parallel-unsafe.
1913 #:parallel-build? #f
1915 #:tests? #f ; no test suite
1916 #:make-flags (let ((out (assoc-ref %outputs "out")))
1918 (string-append "BASEDIR=" out)
1919 (string-append "INSTALLNLSDIR=" out "/share/locale")
1920 (string-append "mandir=/share/man")))))
1921 (native-inputs `(("gettext" ,gettext-minimal)
1923 (synopsis "Tools for controlling the network subsystem in Linux")
1925 "This package includes the important tools for controlling the network
1926 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1927 route. Additionally, this package contains utilities relating to particular
1928 network hardware types (plipconfig, slattach) and advanced aspects of IP
1929 configuration (iptunnel, ipmaddr).")
1930 (license license:gpl2+))))
1932 (define-public libcap
1939 "mirror://kernel.org/linux/libs/security/linux-privs/"
1940 "libcap2/libcap-" version ".tar.xz"))
1943 "0sj8kidl7qgf2qwxcbw1vadnlb30y4zvjzxswsmfdghq04npkhfs"))))
1944 (build-system gnu-build-system)
1945 (arguments '(#:phases
1946 (modify-phases %standard-phases
1948 ;; Add $libdir to the RUNPATH of executables.
1950 (substitute* "Make.Rules"
1952 (string-append "LDFLAGS := -Wl,-rpath="
1955 #:tests? #f ; no 'check' target
1956 #:make-flags (list "lib=lib"
1957 (string-append "prefix="
1958 (assoc-ref %outputs "out"))
1959 "RAISE_SETFCAP=no")))
1960 (native-inputs `(("perl" ,perl)))
1961 (inputs `(("attr" ,attr)))
1962 (home-page "https://sites.google.com/site/fullycapable/")
1963 (synopsis "Library for working with POSIX capabilities")
1965 "Libcap2 provides a programming interface to POSIX capabilities on
1966 Linux-based operating systems.")
1968 ;; License is BSD-3 or GPLv2, at the user's choice.
1969 (license license:gpl2)))
1971 (define-public bridge-utils
1973 (name "bridge-utils")
1978 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
1979 "bridge-utils-" version ".tar.xz"))
1981 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
1982 (build-system gnu-build-system)
1984 ;; The tarball lacks all the generated files.
1985 (native-inputs `(("autoconf" ,autoconf)
1986 ("automake" ,automake)))
1989 (modify-phases %standard-phases
1990 (add-before 'bootstrap 'patch-stuff
1992 ;; Fix "field ‘ip6’ has incomplete type" errors.
1993 (substitute* "libbridge/libbridge.h"
1994 (("#include <linux/if_bridge.h>")
1995 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1997 ;; Ensure that the entire build fails if one of the
1998 ;; sub-Makefiles fails.
1999 (substitute* "Makefile.in"
2000 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2001 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2004 #:tests? #f)) ; no 'check' target
2007 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
2008 (synopsis "Manipulate Ethernet bridges")
2010 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2011 to connect two Ethernet segments together in a protocol independent way.
2012 Packets are forwarded based on Ethernet address, rather than IP address (like
2013 a router). Since forwarding is done at Layer 2, all protocols can go
2014 transparently through a bridge.")
2015 (license license:gpl2+)))
2017 (define-public libnl
2024 "https://github.com/thom311/libnl/releases/download/"
2025 "libnl" (string-join (string-split version #\.) "_")
2026 "/libnl-" version ".tar.gz"))
2029 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2030 (build-system gnu-build-system)
2034 ("pkg-config" ,pkg-config)
2040 "https://github.com/thom311/libnl/releases/download/libnl"
2041 (string-join (string-split version #\.) "_")
2042 "/libnl-doc-" version ".tar.gz"))
2044 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2046 `(("python-2" ,python-2)
2047 ("python-3" ,python-3)))
2048 (outputs '("out" "doc" "python2" "python3"))
2050 `(#:modules ((guix build gnu-build-system)
2054 (modify-phases %standard-phases
2055 (add-after 'install 'install-python
2056 (lambda* (#:key outputs #:allow-other-keys)
2057 (define (python-inst python)
2058 (invoke python "setup.py" "build")
2059 (invoke python "setup.py" "install"
2060 (string-append "--prefix="
2061 (assoc-ref %outputs python)))
2062 (invoke python "setup.py" "clean"))
2063 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2064 (assoc-ref %outputs "out")))
2065 (with-directory-excursion "./python"
2066 (for-each python-inst '("python2" "python3")))
2068 (add-after 'install 'install-doc
2069 (lambda* (#:key inputs outputs #:allow-other-keys)
2070 (let ((dest (string-append (assoc-ref outputs "doc")
2071 "/share/doc/libnl")))
2073 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
2074 "--strip-components=1" "-C" dest)))))))
2075 (home-page "https://www.infradead.org/~tgr/libnl/")
2076 (synopsis "NetLink protocol library suite")
2078 "The libnl suite is a collection of libraries providing APIs to netlink
2079 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2080 between the kernel and user space processes. It was designed to be a more
2081 flexible successor to ioctl to provide mainly networking related kernel
2082 configuration and monitoring interfaces.")
2084 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2085 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2086 (license license:gpl2)))
2095 "mirror://kernel.org/software/network/iw/iw-"
2099 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2100 (build-system gnu-build-system)
2101 (native-inputs `(("pkg-config" ,pkg-config)))
2102 (inputs `(("libnl" ,libnl)))
2105 (let* ((target ,(%current-target-system))
2106 (gcc (if target (string-append target "-gcc") "gcc"))
2107 (pkg-config (if target
2108 (string-append target "-pkg-config")
2111 (string-append "CC=" gcc)
2112 (string-append "PKG_CONFIG="
2113 (assoc-ref %build-inputs "pkg-config")
2115 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2116 #:phases (modify-phases %standard-phases (delete 'configure))))
2117 (home-page "https://wireless.wiki.kernel.org/")
2118 (synopsis "Tool for configuring wireless devices")
2120 "iw is a new nl80211 based CLI configuration utility for wireless
2121 devices. It replaces @code{iwconfig}, which is deprecated.")
2122 (license license:isc)))
2124 (define-public powertop
2131 (uri (string-append "https://01.org/sites/default/files/downloads/"
2132 "powertop-v" version "-1-g7ef7f79.tar_0.gz"))
2134 (base32 "0kynypj5cydfbma0ssblq1k4m1arixc1s2vf0ybv8y2gg09wjs5f"))))
2135 (build-system gnu-build-system)
2138 (modify-phases %standard-phases
2139 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2140 ;; allow calibrating the network interface in Guix System.
2141 (add-after 'unpack 'patch-absolute-file-names
2142 (lambda* (#:key inputs #:allow-other-keys)
2143 (let ((kmod (assoc-ref inputs "kmod")))
2144 (substitute* (find-files "src" "\\.cpp$")
2145 ;; Give the right 'modprobe' file name so that essential
2146 ;; modules such as msr.ko can be loaded.
2147 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2148 ;; These programs are only needed to calibrate, so using
2149 ;; relative file names avoids adding extra inputs. When they
2150 ;; are missing powertop gracefully handles it.
2151 (("/usr/bin/hcitool") "hcitool")
2152 (("/usr/bin/xset") "xset")
2153 (("/usr/sbin/hciconfig") "hciconfig"))
2158 ("ncurses" ,ncurses)
2159 ("pciutils" ,pciutils)
2162 `(("pkg-config" ,pkg-config)))
2163 (home-page "https://01.org/powertop/")
2164 (synopsis "Analyze power consumption on Intel-based laptops")
2166 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2167 power management. In addition to being a diagnostic tool, PowerTOP also has
2168 an interactive mode where the user can experiment various power management
2169 settings for cases where the operating system has not enabled these
2171 (license license:gpl2)))
2173 (define-public aumix
2180 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2181 version ".tar.bz2"))
2184 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2185 (build-system gnu-build-system)
2186 (inputs `(("ncurses" ,ncurses)))
2187 (home-page "http://www.jpj.net/~trevor/aumix.html")
2188 (synopsis "Audio mixer for X and the console")
2190 "Aumix adjusts an audio mixer from X, the console, a terminal,
2191 the command line or a script.")
2192 (license license:gpl2+)))
2194 (define-public iotop
2201 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2204 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2205 (build-system python-build-system)
2208 (modify-phases %standard-phases
2209 (add-after 'unpack 'fix-build-with-python3
2211 (substitute* "setup.py"
2212 (("itervalues") "values"))
2214 ;; There are currently no checks in the package.
2216 (native-inputs `(("python" ,python)))
2217 (home-page "http://guichaz.free.fr/iotop/")
2219 "Displays the IO activity of running processes")
2221 "Iotop is a Python program with a top like user interface to show the
2222 processes currently causing I/O.")
2223 (license license:gpl2+)))
2231 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2232 "download/fuse-" version
2233 "/fuse-" version ".tar.gz"))
2236 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2237 (patches (search-patches "fuse-overlapping-headers.patch"))))
2238 (build-system gnu-build-system)
2239 (inputs `(("util-linux" ,util-linux)))
2241 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2242 (assoc-ref %outputs "out")
2244 (string-append "INIT_D_PATH="
2245 (assoc-ref %outputs "out")
2248 ;; The rule makes /dev/fuse 666.
2249 (string-append "UDEV_RULES_PATH="
2250 (assoc-ref %outputs "out")
2251 "/lib/udev/rules.d"))
2253 (modify-phases %standard-phases
2254 (add-before 'build 'set-file-names
2255 (lambda* (#:key inputs #:allow-other-keys)
2256 ;; libfuse calls out to mount(8) and umount(8). Make sure
2257 ;; it refers to the right ones.
2258 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2259 (("/bin/(u?)mount" _ maybe-u)
2260 (string-append (assoc-ref inputs "util-linux")
2261 "/bin/" maybe-u "mount")))
2262 (substitute* '("util/mount.fuse.c")
2266 ;; This hack leads libfuse to search for 'fusermount' in
2267 ;; $PATH, where it may find a setuid-root binary, instead of
2268 ;; trying solely $out/sbin/fusermount and failing because
2270 (substitute* "lib/Makefile"
2271 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2272 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2274 (home-page "https://github.com/libfuse/libfuse")
2275 (synopsis "Support file systems implemented in user space")
2277 "As a consequence of its monolithic design, file system code for Linux
2278 normally goes into the kernel itself---which is not only a robustness issue,
2279 but also an impediment to system extensibility. FUSE, for \"file systems in
2280 user space\", is a kernel module and user-space library that tries to address
2281 part of this problem by allowing users to run file system implementations as
2282 user-space processes.")
2283 (license (list license:lgpl2.1 ;library
2284 license:gpl2+)))) ;command-line utilities
2286 (define-public unionfs-fuse
2288 (name "unionfs-fuse")
2293 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
2295 (file-name (string-append name "-" version ".tar.gz"))
2298 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
2299 (build-system cmake-build-system)
2301 `(("python" ,python)))
2302 (inputs `(("fuse" ,fuse)))
2304 ;; The tests were never actually run ("collected 0 items"), but in recent
2305 ;; versions of pytest that causes an error.
2307 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2308 (synopsis "User-space union file system")
2310 "UnionFS-FUSE is a flexible union file system implementation in user
2311 space, using the FUSE library. Mounting a union file system allows you to
2312 \"aggregate\" the contents of several directories into a single mount point.
2313 UnionFS-FUSE additionally supports copy-on-write.")
2314 (license license:bsd-3)))
2317 (package (inherit fuse)
2318 (name "fuse-static")
2319 (source (origin (inherit (package-source fuse))
2320 (modules '((guix build utils)))
2323 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2324 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2325 ;; that it doesn't do that, allowing us to remove the
2326 ;; dependency on util-linux (something that is useful in
2328 (substitute* '("lib/mount_util.c"
2329 "util/mount_util.c")
2330 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2336 (define-public unionfs-fuse/static
2337 (package (inherit unionfs-fuse)
2338 (synopsis "User-space union file system (statically linked)")
2339 (name (string-append (package-name unionfs-fuse) "-static"))
2340 (source (origin (inherit (package-source unionfs-fuse))
2341 (modules '((guix build utils)))
2344 ;; Add -ldl to the libraries, because libfuse.a needs that.
2345 (substitute* "src/CMakeLists.txt"
2346 (("target_link_libraries(.*)\\)" _ libs)
2347 (string-append "target_link_libraries"
2352 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2354 (modify-phases %standard-phases
2355 (add-after 'install 'post-install
2356 (lambda* (#:key outputs #:allow-other-keys)
2357 (let* ((out (assoc-ref outputs "out"))
2358 (exe (string-append out "/bin/unionfs")))
2359 ;; By default, 'unionfs' keeps references to
2360 ;; $glibc/share/locale and similar stuff. Remove them.
2361 (remove-store-references exe)
2363 ;; 'unionfsctl' has references to glibc as well. Since
2364 ;; we don't need it, remove it.
2365 (delete-file (string-append out "/bin/unionfsctl"))
2367 (inputs `(("fuse" ,fuse-static)))))
2369 (define-public sshfs
2375 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2376 "download/sshfs-" version "/sshfs-" version
2380 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2381 (build-system gnu-build-system)
2386 `(("pkg-config" ,pkg-config)))
2387 (home-page "https://github.com/libfuse/sshfs")
2388 (synopsis "Mount remote file systems over SSH")
2390 "This is a file system client based on the SSH File Transfer Protocol.
2391 Since most SSH servers already support this protocol it is very easy to set
2392 up: on the server side there's nothing to do; on the client side mounting the
2393 file system is as easy as logging into the server with an SSH client.")
2394 (license license:gpl2+)))
2396 (define-public sshfs-fuse
2397 (package (inherit sshfs)
2399 (properties `((superseded . ,sshfs)))))
2401 (define-public archivemount
2403 (name "archivemount")
2408 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2409 "archivemount-" version ".tar.gz"))
2411 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2412 (build-system gnu-build-system)
2413 (inputs `(("fuse" ,fuse)
2414 ("libarchive" ,libarchive)))
2415 (native-inputs `(("pkg-config" ,pkg-config)))
2416 (home-page "https://www.cybernoia.de/software/archivemount.html")
2417 (synopsis "Tool for mounting archive files with FUSE")
2418 (description "archivemount is a FUSE-based file system for Unix variants,
2419 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2420 mount point where it can be read from or written to as with any other file
2421 system. This makes accessing the contents of the archive, which may be
2422 compressed, transparent to other programs, without decompressing them.")
2423 (license license:lgpl2.0+)))
2425 (define-public numactl
2432 "https://github.com/numactl/numactl/releases/download/v"
2433 version "/numactl-" version ".tar.gz"))
2436 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2437 (build-system gnu-build-system)
2439 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2440 ;; to run, which we can't assume to have.
2443 ;; NUMA is apparently not supported on armhf, see
2444 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2445 (supported-systems (delete "armhf-linux" %supported-systems))
2446 (home-page "https://github.com/numactl/numactl")
2447 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2449 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2450 memory is not all in one place. The @command{numactl} program allows you to
2451 run your application program on specific CPUs and memory nodes. It does this
2452 by supplying a NUMA memory policy to the operating system before running your
2455 The package contains other commands, such as @command{numastat},
2456 @command{memhog}, and @command{numademo} which provides a quick overview of
2457 NUMA performance on your system.")
2458 (license (list license:gpl2 ;programs
2459 license:lgpl2.1)))) ;library
2461 (define-public kbd-neo
2468 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2469 version "/linux/console/neo.map"))
2470 (file-name (string-append name "-" version ".map"))
2473 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2474 (build-system trivial-build-system)
2476 `(#:modules ((guix build utils))
2478 (use-modules (guix build utils))
2479 (let ((out (string-append %output "/share/keymaps"))
2480 (source (assoc-ref %build-inputs "source")))
2482 (copy-file source (string-append out "/neo.map"))
2484 (home-page "https://neo-layout.org")
2485 (synopsis "Neo2 console layout")
2487 "Kbd-neo provides the Neo2 keyboard layout for use with
2488 @command{loadkeys(1)} from @code{kbd(4)}.")
2489 ;; The file is located in an svn directory, the entire content of
2490 ;; the directory is licensed as GPL3.
2491 (license license:gpl3+)))
2499 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2503 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2504 (modules '((guix build utils)))
2507 (substitute* "tests/Makefile.in"
2508 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2511 (substitute* '("src/unicode_start" "src/unicode_stop")
2512 ;; Assume the Coreutils are in $PATH.
2516 (build-system gnu-build-system)
2519 (modify-phases %standard-phases
2520 (add-before 'build 'pre-build
2521 (lambda* (#:key inputs #:allow-other-keys)
2522 (let ((gzip (assoc-ref %build-inputs "gzip"))
2523 (bzip2 (assoc-ref %build-inputs "bzip2")))
2524 (substitute* "src/libkeymap/findfile.c"
2526 (string-append gzip "/bin/gzip"))
2528 (string-append bzip2 "/bin/bzip2")))
2530 (add-after 'install 'post-install
2531 (lambda* (#:key outputs #:allow-other-keys)
2532 ;; Make sure these programs find their comrades.
2533 (let* ((out (assoc-ref outputs "out"))
2534 (bin (string-append out "/bin")))
2535 (for-each (lambda (prog)
2536 (wrap-program (string-append bin "/" prog)
2537 `("PATH" ":" prefix (,bin))))
2538 '("unicode_start" "unicode_stop"))
2540 (inputs `(("check" ,check)
2543 ("pam" ,linux-pam)))
2544 (native-search-paths
2545 (list (search-path-specification
2546 (variable "LOADKEYS_KEYMAP_PATH")
2547 ;; Append ‘/**’ to recursively search all directories. One can then
2548 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2549 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2550 (files (list "share/keymaps/**")))))
2551 (native-inputs `(("pkg-config" ,pkg-config)))
2552 (home-page "http://kbd-project.org/")
2553 (synopsis "Linux keyboard utilities and keyboard maps")
2555 "This package contains keytable files and keyboard utilities compatible
2556 for systems using the Linux kernel. This includes commands such as
2557 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2558 (license license:gpl2+)))
2560 (define-public loadkeys-static
2563 (name "loadkeys-static")
2565 (substitute-keyword-arguments (package-arguments kbd)
2566 ((#:configure-flags flags ''())
2567 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2568 "--disable-vlock" ;so we don't need libpam
2569 "--disable-libkeymap")
2571 ((#:make-flags flags ''())
2572 `(cons "LDFLAGS=-all-static" ,flags))
2573 ((#:phases phases '%standard-phases)
2574 `(modify-phases ,phases
2576 (lambda* (#:key outputs #:allow-other-keys)
2577 (let ((out (assoc-ref outputs "out")))
2578 ;; The binary keeps references to gzip, among other things,
2579 ;; which we don't need in the initrd, so strip references.
2580 (remove-store-references "src/loadkeys")
2582 (install-file "src/loadkeys"
2583 (string-append out "/bin"))
2585 (delete 'post-install)))
2586 ((#:strip-flags _ '())
2588 ((#:allowed-references _ '())
2591 (synopsis "Statically-linked @command{loadkeys} program")
2593 ;; This package is meant to be used internally in the initrd so don't
2595 (properties '((hidden? . #t)))))
2597 (define-public inotify-tools
2599 (name "inotify-tools")
2604 (url "https://github.com/rvoicilas/inotify-tools.git")
2606 (file-name (git-file-name name version))
2609 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2610 (build-system gnu-build-system)
2612 `(("autoconf" ,autoconf)
2613 ("automake" ,automake)
2614 ("libtool" ,libtool)))
2615 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2616 (synopsis "Monitor file accesses")
2618 "The inotify-tools packages provides a C library and command-line tools
2619 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2620 (license license:gpl2+)))
2629 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2630 "kmod-" version ".tar.xz"))
2633 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2634 (patches (search-patches "kmod-module-directory.patch"))))
2635 (build-system gnu-build-system)
2637 `(("pkg-config" ,pkg-config)))
2642 `(#:tests? #f ; FIXME: Investigate test failures
2643 #:configure-flags '("--with-xz" "--with-zlib")
2645 (modify-phases %standard-phases
2646 (add-after 'install 'install-modprobe&co
2647 (lambda* (#:key outputs #:allow-other-keys)
2648 (let* ((out (assoc-ref outputs "out"))
2649 (bin (string-append out "/bin")))
2650 (for-each (lambda (tool)
2652 (string-append bin "/" tool)))
2653 '("insmod" "rmmod" "lsmod" "modprobe"
2654 "modinfo" "depmod"))
2656 (home-page "https://www.kernel.org/")
2657 (synopsis "Kernel module tools")
2658 (description "Kmod is a set of tools to handle common tasks with Linux
2659 kernel modules like insert, remove, list, check properties, resolve
2660 dependencies and aliases.
2662 These tools are designed on top of libkmod, a library that is shipped with
2663 kmod. The aim is to be compatible with tools, configurations and indices
2664 from the module-init-tools project.")
2665 (license license:gpl2+))) ; library under lgpl2.1+
2667 (define-public earlyoom
2674 (url "https://github.com/rfjakob/earlyoom.git")
2675 (commit (string-append "v" version))))
2676 (file-name (git-file-name name version))
2679 "0fwbx0y80nqgkxrc9kf9j3iwa0wbps2jmqir3pgqbc2cj0wjh0lr"))))
2680 (build-system gnu-build-system)
2682 `(#:phases (modify-phases %standard-phases
2684 (add-before 'check 'set-home
2686 (setenv "HOME" (getcwd))
2688 (add-after 'build 'install-contribs
2689 ;; Install what seems useful from the contrib directory.
2690 (lambda* (#:key outputs #:allow-other-keys)
2691 (let* ((out (assoc-ref outputs "out"))
2692 (contrib (string-append
2693 out "/share/earlyoom/contrib")))
2694 (install-file "contrib/notify_all_users.py" contrib)
2696 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
2698 (string-append "VERSION=v" ,version)
2699 (string-append "PREFIX=" prefix)
2700 (string-append "SYSCONFDIR=" prefix "/etc")))
2701 #:test-target "test"))
2702 (native-inputs `(("go" ,go) ;for the test suite
2703 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
2704 (home-page "https://github.com/rfjakob/earlyoom")
2705 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
2706 (description "Early OOM is a minimalist out of memory (OOM) daemon that
2707 runs in user space and provides a more responsive and configurable alternative
2708 to the in-kernel OOM killer.")
2709 (license license:expat)))
2711 (define-public eudev
2712 ;; The post-systemd fork, maintained by Gentoo.
2718 (uri (git-reference (url "https://github.com/gentoo/eudev")
2719 (commit (string-append "v" version))))
2720 (file-name (git-file-name name version))
2723 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
2724 (patches (search-patches "eudev-rules-directory.patch"))))
2725 (build-system gnu-build-system)
2728 (modify-phases %standard-phases
2729 (add-after 'unpack 'make-source-writable
2731 ;; XXX: Git checkouts are read-only, but this package needs to
2732 ;; modify some of its files.
2733 (for-each make-file-writable (find-files "."))
2735 (add-before 'bootstrap 'patch-file-names
2736 (lambda* (#:key inputs #:allow-other-keys)
2737 (substitute* "man/make.sh"
2738 (("/usr/bin/xsltproc")
2739 (string-append (assoc-ref inputs "xsltproc")
2742 (add-after 'install 'build-hwdb
2743 (lambda* (#:key outputs #:allow-other-keys)
2744 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2745 ;; similar tools to display product names.
2746 (let ((out (assoc-ref outputs "out")))
2747 (invoke (string-append out "/bin/udevadm")
2748 "hwdb" "--update")))))
2749 #:configure-flags (list "--enable-manpages")))
2751 `(("autoconf" ,autoconf)
2752 ("automake" ,automake)
2754 ("libtool" ,libtool)
2755 ("pkg-config" ,pkg-config)
2758 ("python" ,python-wrapper)
2759 ;; For documentation.
2760 ("docbook-xml" ,docbook-xml-4.2)
2761 ("docbook-xsl" ,docbook-xsl)
2762 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2763 ("xsltproc" ,libxslt)))
2765 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2766 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2767 ;; which contains the rules to do that.
2768 `(("util-linux" ,util-linux) ;for blkid
2770 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2771 (synopsis "Userspace device management")
2772 (description "Udev is a daemon which dynamically creates and removes
2773 device nodes from /dev/, handles hotplug events and loads drivers at boot
2775 (license license:gpl2+)))
2777 (define-public eudev-with-hwdb
2778 (deprecated-package "eudev-with-hwdb" eudev))
2783 (version "2.02.177")
2786 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2790 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2791 (modules '((guix build utils)))
2794 (use-modules (guix build utils))
2796 ;; Honor sysconfdir.
2797 (substitute* "make.tmpl.in"
2799 "confdir = @sysconfdir@\n")
2800 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2801 "DEFAULT_SYS_DIR = @sysconfdir@"))
2803 (patches (search-patches "lvm2-static-link.patch"))))
2804 (build-system gnu-build-system)
2806 `(("pkg-config" ,pkg-config)
2807 ("procps" ,procps))) ;tests use 'pgrep'
2812 (modify-phases %standard-phases
2813 (add-after 'configure 'set-makefile-shell
2815 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2817 (setenv "SHELL" (which "sh"))
2819 ;; Replace /bin/sh with the right file name.
2820 (patch-makefile-SHELL "make.tmpl")
2823 #:configure-flags (list (string-append "--sysconfdir="
2824 (assoc-ref %outputs "out")
2826 "--enable-udev_sync"
2827 "--enable-udev_rules"
2828 "--enable-pkgconfig"
2830 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
2832 ;; Make sure programs such as 'dmsetup' can
2833 ;; find libdevmapper.so.
2834 (string-append "LDFLAGS=-Wl,-rpath="
2835 (assoc-ref %outputs "out")
2837 (assoc-ref %outputs "out")
2838 "/lib/device-mapper")
2839 ;; TODO: Patch make.tmpl.in to take LDFLAGS
2840 ;; into account so that we don't need to also
2842 (string-append "CLDFLAGS=-Wl,-rpath="
2843 (assoc-ref %outputs "out")
2845 (assoc-ref %outputs "out")
2846 "/lib/device-mapper"))
2848 ;; The tests use 'mknod', which requires root access.
2850 (home-page "https://sourceware.org/lvm2/")
2851 (synopsis "Logical volume management for Linux")
2853 "LVM2 is the logical volume management tool set for Linux-based systems.
2854 This package includes the user-space libraries and tools, including the device
2855 mapper. Kernel components are part of Linux-libre.")
2857 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2858 ;; Command-line tools are GPLv2.
2859 (license (list license:gpl2 license:lgpl2.1))))
2861 (define-public lvm2-static
2864 (name "lvm2-static")
2866 ;; Propagate udev because libdevmapper.a depends on libudev.
2867 (inputs (alist-delete "udev" (package-inputs lvm2)))
2868 (propagated-inputs `(("udev" ,eudev)))
2871 (substitute-keyword-arguments (package-arguments lvm2)
2872 ((#:configure-flags flags '())
2873 ;; LVM2 doesn't use Libtool, hence the custom option.
2874 `(cons "--enable-static_link" ,flags))))
2875 (synopsis "Logical volume management for Linux (statically linked)")))
2877 (define-public wireless-tools
2879 (name "wireless-tools")
2883 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2887 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2890 ;; Remove the older header files that are not free software.
2891 (for-each (lambda (n)
2892 (delete-file (format #f "wireless.~a.h" n)))
2893 '(10 11 12 13 14 15 16 17 18 19 20))
2895 (build-system gnu-build-system)
2898 (list (string-append "PREFIX=" %output)
2899 (string-append "INSTALL_MAN=" %output "/share/man")
2900 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2903 (modify-phases %standard-phases
2905 (lambda* (#:key target #:allow-other-keys)
2906 (when ,(%current-target-system)
2907 ;; Cross-compilation: use the cross tools.
2908 (substitute* (find-files "." "Makefile")
2910 (string-append "CC = " target "-gcc\n"))
2912 (string-append "AR = " target "-ar\n"))
2914 (string-append "RANLIB = " target "-ranlib\n"))))
2917 (synopsis "Tools for manipulating Linux Wireless Extensions")
2918 (description "Wireless Tools are used to manipulate the now-deprecated
2919 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
2920 Extension was an interface allowing you to set Wireless LAN specific
2921 parameters and get the specific stats. It is deprecated in favor the nl80211
2923 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2924 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2925 ;; other files are distributed under gpl2.
2926 (license (list license:gpl2 license:lgpl2.1+))))
2934 (uri (string-append "mirror://kernel.org/software/network/crda/"
2935 "crda-" version ".tar.xz"))
2938 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2939 (patches (search-patches "crda-optional-gcrypt.patch"))))
2940 (build-system gnu-build-system)
2942 '(#:phases (modify-phases %standard-phases
2944 (add-after 'unpack 'gzip-determinism
2946 (substitute* "Makefile"
2947 (("gzip") "gzip --no-name"))
2950 'build 'no-werror-no-ldconfig
2952 (substitute* "Makefile"
2954 (("ldconfig") "true"))
2957 'build 'set-regulator-db-file-name
2958 (lambda* (#:key inputs #:allow-other-keys)
2959 ;; Tell CRDA where to find our database.
2960 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2961 (substitute* "crda.c"
2962 (("\"/lib/crda/regulatory.bin\"")
2963 (string-append "\"" regdb
2964 "/lib/crda/regulatory.bin\"")))
2966 #:test-target "verify"
2967 #:make-flags (let ((out (assoc-ref %outputs "out"))
2968 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2969 (list "CC=gcc" "V=1"
2971 ;; Disable signature-checking on 'regulatory.bin'.
2972 ;; The reason is that this simplifies maintenance
2973 ;; on our side (no need to manage a distro key
2974 ;; pair), and we can guarantee integrity of
2975 ;; 'regulatory.bin' by other means anyway, such as
2976 ;; 'guix gc --verify'. See
2977 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2981 (string-append "PREFIX=" out)
2982 (string-append "SBINDIR=" out "/sbin/")
2983 (string-append "UDEV_RULE_DIR="
2984 out "/lib/udev/rules.d")
2985 (string-append "LDFLAGS=-Wl,-rpath="
2987 (string-append "REG_BIN=" regdb
2988 "/lib/crda/regulatory.bin")))))
2989 (native-inputs `(("pkg-config" ,pkg-config)
2990 ("wireless-regdb" ,wireless-regdb)))
2991 (inputs `(("libnl" ,libnl)))
2993 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2994 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2996 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2997 communication between the kernel Linux and user space for regulatory
2999 (license license:copyleft-next)))
3001 (define-public wireless-regdb
3003 (name "wireless-regdb")
3004 (version "2019.06.03")
3008 "mirror://kernel.org/software/network/wireless-regdb/"
3009 "wireless-regdb-" version ".tar.xz"))
3012 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
3014 ;; We're building 'regulatory.bin' by ourselves.
3016 (delete-file "regulatory.bin")
3018 (build-system gnu-build-system)
3021 (modify-phases %standard-phases
3022 (add-after 'unpack 'gzip-determinism
3024 (substitute* "Makefile"
3025 (("gzip") "gzip --no-name"))
3027 (add-after 'unpack 'omit-signature
3029 (substitute* "Makefile"
3030 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3031 ;; don't provide (see below). Disable it.
3032 ((" regulatory\\.db\\.p7s") "")
3033 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3034 ;; but ‘make install’ depends only on the latter while installing
3035 ;; both (and failing). Depend on it explicitly.
3036 (("^install: " all) (string-append all "regulatory.db ")))
3038 (delete 'configure)) ; no configure script
3040 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3041 ;; is computed and can be equal to 'maintainer-clean'; when that
3042 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3043 ;; just built. Thus, build things sequentially.
3044 #:parallel-build? #f
3046 #:tests? #f ; no tests
3048 (let ((out (assoc-ref %outputs "out")))
3049 (list (string-append "PREFIX=" out)
3050 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3052 ;; Leave this empty so that db2bin.py doesn't try to sign
3053 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3054 ;; pair for the whole distribution.
3055 (string-append "REGDB_PRIVKEY=")
3056 ;; Don't generate a public key for the same reason. These are
3057 ;; used as Makefile targets and can't be the empty string.
3058 (string-append "REGDB_PUBCERT=/dev/null")
3059 (string-append "REGDB_PUBKEY=/dev/null")))))
3061 `(("python" ,python-wrapper)))
3063 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3064 (synopsis "Wireless regulatory database")
3066 "This package contains the wireless regulatory database Central
3067 Regulatory Database Agent (CRDA) daemon. The database contains information on
3068 country-specific regulations for the wireless spectrum.")
3069 (license license:isc)))
3071 (define-public lm-sensors
3079 (url "https://github.com/groeck/lm-sensors.git")
3080 (commit (string-append "V" (string-join
3081 (string-split version #\.) "-")))))
3082 (file-name (git-file-name name version))
3084 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3085 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3086 (build-system gnu-build-system)
3087 (inputs `(("rrdtool" ,rrdtool)
3090 ("gnuplot" ,gnuplot)))
3091 (native-inputs `(("pkg-config" ,pkg-config)
3095 (outputs '("lib" ; avoid perl in closure
3098 `(#:tests? #f ; no 'check' target
3099 #:make-flags (list (string-append "PREFIX=" %output)
3100 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3101 (string-append "INCLUDEDIR="
3102 (assoc-ref %outputs "lib") "/include")
3103 (string-append "MANDIR=" %output "/share/man")
3104 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3106 (modify-phases %standard-phases
3108 (add-before 'build 'patch-exec-paths
3109 (lambda* (#:key inputs outputs #:allow-other-keys)
3110 (substitute* "prog/detect/sensors-detect"
3112 (string-append "`" (assoc-ref inputs "coreutils")
3114 (("(`|\")modprobe" all open-quote)
3115 (string-append open-quote
3116 (assoc-ref inputs "kmod")
3118 (substitute* '("prog/pwm/pwmconfig"
3119 "prog/pwm/fancontrol")
3121 (string-append (assoc-ref inputs "gnuplot")
3124 (string-append (assoc-ref inputs "coreutils")
3127 (string-append (assoc-ref inputs "grep")
3130 (string-append (assoc-ref inputs "sed")
3133 (string-append (assoc-ref inputs "coreutils")
3136 (string-append (assoc-ref inputs "coreutils")
3139 (string-append (assoc-ref inputs "coreutils")
3140 "/bin/readlink -f")))
3142 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3143 (synopsis "Utilities to read temperature/voltage/fan sensors")
3145 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3146 you to access information from temperature, voltage, and fan speed sensors.
3147 It works with most newer systems.")
3148 (license license:gpl2+)))
3150 (define-public iucode-tool
3152 (name "iucode-tool")
3156 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3157 "/raw/latest/iucode-tool_" version ".tar.xz"))
3160 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3161 (build-system gnu-build-system)
3162 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3163 (synopsis "Manipulate Intel microcode bundles")
3165 "@command{iucode_tool} is a utility to work with microcode packages for
3166 Intel processors. It can convert between formats, extract specific versions,
3167 create a firmware image suitable for the Linux kernel, and more.")
3168 ;; cpuid.h is available for i686, x86_64, and ia64.
3169 (supported-systems '("i686-linux" "x86_64-linux"))
3170 (license license:gpl2+)))
3172 (define-public i2c-tools
3179 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3180 version ".tar.bz2"))
3183 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3184 (build-system gnu-build-system)
3186 `(#:tests? #f ; no 'check' target
3187 #:make-flags (list (string-append "prefix=" %output)
3189 ;; no configure script
3190 #:phases (modify-phases %standard-phases (delete 'configure))))
3193 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3194 (synopsis "I2C tools for Linux")
3196 "The i2c-tools package contains a heterogeneous set of I2C tools for
3197 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3198 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3200 (license license:gpl2+)))
3202 (define-public xsensors
3209 "http://www.linuxhardware.org/xsensors/xsensors-"
3213 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3214 (build-system gnu-build-system)
3215 (inputs `(("lm-sensors" ,lm-sensors "lib")
3217 (native-inputs `(("pkg-config" ,pkg-config)))
3220 (modify-phases %standard-phases
3221 (add-before 'configure 'enable-deprecated
3223 (substitute* "src/Makefile.in"
3224 (("-DGDK_DISABLE_DEPRECATED") "")
3225 (("-DGTK_DISABLE_DEPRECATED") ""))
3227 (add-before 'configure 'remove-Werror
3229 (substitute* '("configure" "src/Makefile.in")
3232 (home-page "http://www.linuxhardware.org/xsensors/")
3233 (synopsis "Hardware health information viewer")
3235 "Xsensors reads data from the libsensors library regarding hardware
3236 health such as temperature, voltage and fan speed and displays the information
3237 in a digital read-out.")
3238 (license license:gpl2+)))
3243 (version (package-version linux-libre))
3244 (source (package-source linux-libre))
3245 (build-system gnu-build-system)
3248 (modify-phases %standard-phases
3250 (lambda* (#:key inputs #:allow-other-keys)
3251 (setenv "SHELL_PATH" (which "bash"))
3252 (chdir "tools/perf")
3254 #:make-flags (list (string-append "prefix="
3255 (assoc-ref %outputs "out"))
3256 ;; Make sure the kernel headers are treated as system
3257 ;; headers to suppress warnings from those.
3258 (string-append "C_INCLUDE_PATH="
3259 (assoc-ref %build-inputs "kernel-headers")
3263 ;; By default, 'config/Makefile' uses lib64 on
3264 ;; x86_64. Work around that.
3266 #:tests? #f)) ;no tests
3268 `(("pkg-config" ,pkg-config)
3272 ;; There are build scripts written in these languages.
3274 ("python" ,python-2)))
3276 `(("slang" ,slang) ;for the interactive TUI
3278 ("python" ,python-2) ;'perf' links against libpython
3279 ("elfutils" ,elfutils)
3280 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3281 ("libunwind" ,libunwind) ;better stack walking
3282 ("numactl" ,numactl) ;for 'perf bench numa mem'
3285 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3286 ("docbook-xsl" ,docbook-xsl)
3288 ("asciidoc" ,asciidoc)))
3289 (home-page "https://perf.wiki.kernel.org/")
3290 (synopsis "Linux profiling with performance counters")
3292 "perf is a tool suite for profiling using hardware performance counters,
3293 with support in the Linux kernel. perf can instrument CPU performance
3294 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3295 of lightweight profiling. This package contains the user-land tools and in
3296 particular the @code{perf} command.")
3297 (license (package-license linux-libre))))
3299 (define-public pflask
3305 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3307 (file-name (string-append name "-" version ".tar.gz"))
3310 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3311 (build-system cmake-build-system)
3313 '(#:tests? #f)) ; no tests
3314 (home-page "https://ghedo.github.io/pflask/")
3315 (synopsis "Simple tool for creating Linux namespace containers")
3316 (description "pflask is a simple tool for creating Linux namespace
3317 containers. It can be used for running a command or even booting an OS inside
3318 an isolated container, created with the help of Linux namespaces. It is
3319 similar in functionality to chroot, although pflask provides better isolation
3320 thanks to the use of namespaces.")
3321 (license license:bsd-2)))
3323 (define-public singularity
3325 (name "singularity")
3329 (uri (string-append "https://github.com/singularityware/singularity/"
3330 "releases/download/" version
3331 "/singularity-" version ".tar.gz"))
3334 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3335 (modules '((guix build utils)))
3338 ;; Do not create directories in /var.
3339 (substitute* "Makefile.in"
3340 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3342 ;; The original source overrides PATH so that it points to
3343 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3344 ;; on Guix System. Leave PATH unchanged so we refer to the
3345 ;; installed Coreutils, grep, etc.
3346 (substitute* "bin/singularity.in"
3348 (string-append "#" all "\n")))
3350 (substitute* (find-files "libexec/cli" "\\.exec$")
3351 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3353 (string-append "/run/setuid-programs/singularity-"
3354 program "-helper")))
3356 (build-system gnu-build-system)
3358 `(#:configure-flags '("--localstatedir=/var")
3360 (modify-phases %standard-phases
3361 (add-after 'unpack 'patch-reference-to-squashfs-tools
3363 (substitute* "libexec/cli/build.exec"
3364 (("if ! singularity_which mksquashfs") "if 0")
3365 (("if ! mksquashfs")
3366 (string-append "if ! " (which "mksquashfs"))))
3369 `(("libarchive" ,libarchive)
3370 ("python" ,python-wrapper)
3372 ("squashfs-tools" ,squashfs-tools)))
3373 (home-page "https://singularity.lbl.gov/")
3374 (synopsis "Container platform")
3375 (description "Singularity is a container platform supporting a number of
3376 container image formats. It can build SquashFS container images or import
3377 existing Docker images. Singularity requires kernel support for container
3378 isolation or root privileges.")
3379 (license license:bsd-3)))
3381 (define-public hdparm
3387 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3388 "hdparm-" version ".tar.gz"))
3391 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3392 (build-system gnu-build-system)
3394 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3395 (list (string-append "binprefix=" out)
3396 (string-append "manprefix=" out)
3399 (modify-phases %standard-phases
3400 (delete 'configure)) ; no configure script
3401 #:tests? #f)) ; no test suite
3402 (home-page "https://sourceforge.net/projects/hdparm/")
3403 (synopsis "View and tune ATA disk drive parameters")
3405 "@command{hdparm} is a command-line utility to control ATA controllers and
3406 disk drives. It can increase performance and/or reliability by careful tuning
3407 of hardware settings like power and acoustic management, DMA modes, and caching.
3408 It can also display detailed device information, or be used as a simple
3409 performance benchmarking tool.
3411 @command{hdparm} provides a command line interface to various Linux kernel
3412 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3413 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3414 Translation (@dfn{SAT}) are also supported.")
3415 (license (license:non-copyleft "file://LICENSE.TXT"))))
3417 (define-public rfkill
3423 (uri (string-append "mirror://kernel.org/software/network/"
3424 name "/" name "-" version ".tar.xz"))
3427 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3428 (build-system gnu-build-system)
3430 `(#:make-flags (list "CC=gcc"
3431 (string-append "PREFIX=" %output))
3432 #:phases (modify-phases %standard-phases
3433 (delete 'configure))
3435 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3436 (synopsis "Tool for enabling and disabling wireless devices")
3438 "rfkill is a simple tool for accessing the rfkill device interface,
3439 which is used to enable and disable wireless networking devices, typically
3440 WLAN, Bluetooth and mobile broadband.")
3441 (license (license:non-copyleft "file://COPYING"
3442 "See COPYING in the distribution."))
3443 ;; rfkill is part of util-linux as of 2.31.
3444 (properties `((superseded . ,util-linux)))))
3452 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3453 version "/" name "-" version ".tar.gz"))
3456 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3457 (build-system gnu-build-system)
3458 (home-page "http://acpiclient.sourceforge.net")
3459 (synopsis "Display information on ACPI devices")
3460 (description "@code{acpi} attempts to replicate the functionality of the
3461 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3462 information. It does not support ACPI suspending, only displays information
3463 about ACPI devices.")
3464 (license license:gpl2+)))
3466 (define-public acpid
3472 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3476 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
3477 (build-system gnu-build-system)
3478 (home-page "https://sourceforge.net/projects/acpid2/")
3479 (synopsis "Daemon for delivering ACPI events to user-space programs")
3481 "acpid is designed to notify user-space programs of Advanced
3482 Configuration and Power Interface (ACPI) events. acpid should be started
3483 during the system boot, and will run as a background process. When an ACPI
3484 event is received from the kernel, acpid will examine the list of rules
3485 specified in /etc/acpi/events and execute the rules that match the event.")
3486 (license license:gpl2+)))
3488 (define-public sysfsutils
3497 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3500 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3501 (build-system gnu-build-system)
3502 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3503 (synopsis "System utilities based on Linux sysfs")
3505 "These are a set of utilities built upon sysfs, a virtual file system in
3506 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3507 also contains the libsysfs library.")
3508 ;; The library is under lgpl2.1+ (all files say "or any later version").
3509 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3510 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3512 (define-public sysfsutils-1
3514 (inherit sysfsutils)
3521 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3522 "/sysfsutils-" version ".tar.gz"))
3524 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3525 (modules '((guix build utils)))
3528 (substitute* "Makefile.in"
3529 (("includedir = /usr/include/sysfs")
3530 "includedir = @includedir@"))
3531 (substitute* "configure"
3532 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3533 (string-append "includedir='" orig "/sysfs'")))
3535 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3537 (define-public cpufrequtils
3539 (name "cpufrequtils")
3544 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3545 "cpufrequtils-" version ".tar.gz"))
3547 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3548 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3549 (build-system gnu-build-system)
3551 `(("sysfsutils" ,sysfsutils-1)))
3553 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3554 (assoc-ref %outputs "out") "/lib"))))
3555 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3556 (synopsis "Utilities to get and set CPU frequency on Linux")
3558 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3559 information, and set the CPU frequency if supported, using the cpufreq
3560 capabilities of the Linux kernel.")
3561 (license license:gpl2)))
3563 (define-public libraw1394
3570 "mirror://kernel.org/linux/libs/ieee1394/"
3571 name "-" version ".tar.xz"))
3574 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3575 (build-system gnu-build-system)
3576 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3577 (synopsis "Interface library for the Linux IEEE1394 drivers")
3579 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3580 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3581 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3582 send to and receive from other nodes without requiring a kernel driver for the
3583 protocol in question.")
3584 (license license:lgpl2.1+)))
3586 (define-public libavc1394
3592 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3593 name "-" version ".tar.gz"))
3596 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3597 (build-system gnu-build-system)
3599 `(("pkg-config" ,pkg-config)))
3601 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3602 (home-page "https://sourceforge.net/projects/libavc1394/")
3603 (synopsis "AV/C protocol library for IEEE 1394")
3605 "Libavc1394 is a programming interface to the AV/C specification from
3606 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3607 (license license:lgpl2.1+)))
3609 (define-public libiec61883
3611 (name "libiec61883")
3616 "mirror://kernel.org/linux/libs/ieee1394/"
3617 name "-" version ".tar.xz"))
3620 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3621 (build-system gnu-build-system)
3623 `(("pkg-config" ,pkg-config)))
3625 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3626 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3627 (synopsis "Isochronous streaming media library for IEEE 1394")
3629 "The libiec61883 library provides a higher level API for streaming DV,
3630 MPEG-2 and audio over Linux IEEE 1394.")
3631 (license license:lgpl2.1+)))
3633 (define-public mdadm
3640 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3644 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3645 (build-system gnu-build-system)
3649 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3653 ;; TODO: tell it where to find 'sendmail'
3654 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3655 (string-append "BINDIR=" out "/sbin")
3656 (string-append "MANDIR=" out "/share/man")
3657 (string-append "UDEVDIR=" out "/lib/udev")))
3659 (modify-phases %standard-phases
3660 (add-before 'build 'patch-program-paths
3661 (lambda* (#:key inputs #:allow-other-keys)
3662 (let ((coreutils (assoc-ref inputs "coreutils")))
3663 (substitute* "udev-md-raid-arrays.rules"
3664 (("/usr/bin/(readlink|basename)" all program)
3665 (string-append coreutils "/bin/" program))))
3667 (add-before 'build 'remove-W-error
3669 ;; We cannot build with -Werror on i686 due to a
3670 ;; 'sign-compare' warning in util.c.
3671 (substitute* "Makefile"
3674 (delete 'configure))
3675 ;;tests must be done as root
3677 (home-page "http://neil.brown.name/blog/mdadm")
3678 (synopsis "Tool for managing Linux Software RAID arrays")
3680 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3681 assemble, report on, and monitor arrays. It can also move spares between raid
3682 arrays when needed.")
3683 (license license:gpl2+)))
3685 (define-public mdadm-static
3688 (name "mdadm-static")
3690 (substitute-keyword-arguments (package-arguments mdadm)
3691 ((#:make-flags flags)
3692 `(cons "LDFLAGS = -static" ,flags))
3694 `(modify-phases ,phases
3695 (add-after 'install 'remove-cruft
3696 (lambda* (#:key outputs #:allow-other-keys)
3697 (let* ((out (assoc-ref outputs "out"))
3698 (precious? (lambda (file)
3699 (member file '("." ".." "sbin"))))
3700 (directories (scandir out (negate precious?))))
3701 (with-directory-excursion out
3702 (for-each delete-file-recursively directories)
3703 (remove-store-references "sbin/mdadm")
3704 (delete-file "sbin/mdmon")
3706 ((#:modules modules %gnu-build-system-modules)
3707 `((ice-9 ftw) ,@modules))
3708 ((#:strip-flags _ '())
3709 ''("--strip-all")) ;strip a few extra KiB
3710 ((#:allowed-references _ '("out"))
3711 '("out")))) ;refer only self
3712 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3714 (define-public multipath-tools
3716 (name "multipath-tools")
3720 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3721 ".git;a=snapshot;h=" version ";sf=tgz"))
3722 (file-name (string-append name "-" version ".tar.gz"))
3725 "1c6ay97wlfv1fl0y8hcfpxhkps14hlnw9gzmj7884micsp7pa9yv"))
3726 (modules '((guix build utils)))
3729 ;; Drop bundled valgrind headers.
3730 (delete-file-recursively "third-party")
3731 (substitute* '("multipathd/main.c"
3732 "libmultipath/debug.c")
3733 (("#include \"../third-party/")
3736 (build-system gnu-build-system)
3738 '(#:tests? #f ; no tests
3739 #:make-flags (list "CC=gcc"
3740 (string-append "DESTDIR="
3741 (assoc-ref %outputs "out"))
3743 ;; Add the libaio headers to GCCs system header
3744 ;; search path to suppress -Werror=cast-qual on
3745 ;; the included headers.
3746 (string-append "C_INCLUDE_PATH="
3747 (assoc-ref %build-inputs "libaio")
3749 (string-append "LDFLAGS=-Wl,-rpath="
3750 (assoc-ref %outputs "out")
3753 (modify-phases %standard-phases
3754 (add-after 'unpack 'patch-source
3755 (lambda* (#:key inputs #:allow-other-keys)
3756 (let ((lvm2 (assoc-ref inputs "lvm2"))
3757 (udev (assoc-ref inputs "udev")))
3758 (substitute* "Makefile.inc"
3759 (("\\$\\(prefix\\)/usr") "$(prefix)")
3760 ;; Do not save timestamp to avoid gzip "timestamp
3761 ;; out-of-range" warnings.
3762 (("gzip -9") "gzip -9n"))
3763 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3764 (("/usr/include/libdevmapper.h")
3765 (string-append lvm2 "/include/libdevmapper.h"))
3766 (("/usr/include/libudev.h")
3767 (string-append udev "/include/libudev.h")))
3769 (delete 'configure)))) ; no configure script
3772 ("pkg-config" ,pkg-config)
3773 ("valgrind" ,valgrind)))
3775 `(("json-c" ,json-c)
3777 ("liburcu" ,liburcu)
3779 ("readline" ,readline)
3781 (home-page "http://christophe.varoqui.free.fr/")
3782 (synopsis "Access block devices through multiple paths")
3784 "This package provides the following binaries to drive the
3785 Linux Device Mapper multipathing driver:
3787 @item @command{multipath} - Device mapper target autoconfig.
3788 @item @command{multipathd} - Multipath daemon.
3789 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3790 @code{dm} multipath devices.
3791 @item @command{kpartx} - Create device maps from partition tables.
3793 (license (list license:gpl2+ ; main distribution
3794 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3796 (define-public libaio
3803 (string-append "https://releases.pagure.org/libaio/"
3804 name "-" version ".tar.gz")))
3807 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
3808 (build-system gnu-build-system)
3811 (list "CC=gcc" (string-append "prefix=" %output))
3812 #:test-target "partcheck" ; need root for a full 'check'
3814 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
3815 (home-page "https://pagure.io/libaio")
3816 (synopsis "Linux-native asynchronous I/O access library")
3818 "This library enables userspace to use Linux kernel asynchronous I/O
3819 system calls, important for the performance of databases and other advanced
3821 (license license:lgpl2.1+)))
3829 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
3833 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
3834 (build-system gnu-build-system)
3836 `(("libsndfile" ,libsndfile)))
3838 `(("pkg-config" ,pkg-config)))
3839 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3840 (synopsis "Bluetooth subband audio codec")
3842 "The SBC is a digital audio encoder and decoder used to transfer data to
3843 Bluetooth audio output devices like headphones or loudspeakers.")
3844 (license license:gpl2+)))
3846 (define-public bluez
3853 "mirror://kernel.org/linux/bluetooth/bluez-"
3857 "02jng21lp6fb3c2bh6vf9y7cj4gaxwk29dfc32ncy0lj0gi4q57p"))))
3858 (build-system gnu-build-system)
3861 (let ((out (assoc-ref %outputs "out")))
3862 (list "--sysconfdir=/etc"
3863 "--localstatedir=/var"
3866 ;; Install dbus/udev files to the correct location.
3867 (string-append "--with-dbusconfdir=" out "/etc")
3868 (string-append "--with-udevdir=" out "/lib/udev")))
3870 (modify-phases %standard-phases
3871 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3872 ;; issue (discussion on upstream mailing list:
3873 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3874 (add-before 'check 'skip-wonky-test
3876 (substitute* "unit/test-gatt.c"
3877 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3879 (add-after 'install 'post-install
3880 (lambda* (#:key inputs outputs #:allow-other-keys)
3881 (let* ((out (assoc-ref outputs "out"))
3882 (servicedir (string-append out "/share/dbus-1/services"))
3883 (service "obexd/src/org.bluez.obex.service")
3884 (rule (string-append
3885 out "/lib/udev/rules.d/97-hid2hci.rules")))
3886 ;; Install the obex dbus service file.
3887 (substitute* service
3889 (string-append out "/libexec/bluetooth/obexd")))
3890 (install-file service servicedir)
3891 ;; Fix paths in the udev rule.
3893 (("hid2hci --method")
3894 (string-append out "/lib/udev/hid2hci --method"))
3896 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3899 `(("pkg-config" ,pkg-config)
3900 ("gettext" ,gettext-minimal)))
3905 ("libical" ,libical)
3906 ("readline" ,readline)))
3907 (home-page "http://www.bluez.org/")
3908 (synopsis "Linux Bluetooth protocol stack")
3910 "BlueZ provides support for the core Bluetooth layers and protocols. It
3911 is flexible, efficient and uses a modular implementation.")
3912 (license license:gpl2+)))
3914 (define-public fuse-exfat
3921 "https://github.com/relan/exfat/releases/download/v"
3922 version "/" name "-" version ".tar.gz"))
3925 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3926 (build-system gnu-build-system)
3928 `(("pkg-config" ,pkg-config)))
3931 (home-page "https://github.com/relan/exfat")
3932 (synopsis "Mount exFAT file systems")
3934 "This package provides a FUSE-based file system that provides read and
3935 write access to exFAT devices.")
3936 (license license:gpl2+)))
3938 (define-public fuseiso
3941 (version "20070708")
3944 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
3945 version "/fuseiso-" version ".tar.bz2"))
3948 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
3949 (build-system gnu-build-system)
3951 `(("pkg-config" ,pkg-config)))
3956 (home-page "https://sourceforge.net/projects/fuseiso/")
3957 (synopsis "Mount ISO file system images")
3959 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
3960 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
3961 Ridge, Joliet, and zisofs.")
3962 (license license:gpl2)))
3971 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3972 version ".tar.bz2"))
3973 (patches (search-patches "gpm-glibc-2.26.patch"))
3976 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3977 (build-system gnu-build-system)
3979 '(#:phases (modify-phases %standard-phases
3982 ;; The tarball was not generated with 'make dist' so we
3983 ;; need to bootstrap things ourselves.
3984 (substitute* "autogen.sh"
3985 (("/bin/sh") (which "sh")))
3986 (invoke "./autogen.sh")
3987 (patch-makefile-SHELL "Makefile.include.in")
3990 ;; Make sure programs find libgpm.so.
3991 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3992 (assoc-ref %outputs "out")
3995 `(("texinfo" ,texinfo)
3998 ("autoconf" ,autoconf)
3999 ("automake" ,automake)
4000 ("libtool" ,libtool)))
4001 (home-page "http://www.nico.schottelius.org/software/gpm/")
4002 (synopsis "Mouse support for the Linux console")
4004 "The GPM (general-purpose mouse) daemon is a mouse server for
4005 applications running on the Linux console. It allows users to select items
4006 and copy/paste text in the console and in xterm.")
4007 (license license:gpl2+)))
4009 (define-public btrfs-progs
4011 (name "btrfs-progs")
4015 (uri (string-append "mirror://kernel.org/linux/kernel/"
4016 "people/kdave/btrfs-progs/"
4017 "btrfs-progs-v" version ".tar.xz"))
4020 "1ykhasv0jc3qi3xrm5841mzkmlbkjw6rm70gl4aww90jj6ak55qg"))))
4021 (build-system gnu-build-system)
4023 "static")) ; static versions of the binaries in "out"
4025 '(#:phases (modify-phases %standard-phases
4026 (add-after 'build 'build-static
4027 (lambda _ (invoke "make" "static")))
4028 (add-after 'install 'install-bash-completion
4029 (lambda* (#:key outputs #:allow-other-keys)
4030 (let* ((out (assoc-ref outputs "out"))
4031 (bashcomp (string-append out "/etc/bash_completion.d")))
4033 (copy-file "btrfs-completion"
4034 (string-append bashcomp "/btrfs"))
4036 (add-after 'install 'install-static
4037 (let ((staticbin (string-append (assoc-ref %outputs "static")
4041 (string-append "bindir=" staticbin)
4042 "install-static")))))
4043 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4044 #:test-target "test"
4045 #:parallel-tests? #f)) ; tests fail when run in parallel
4046 (inputs `(("e2fsprogs" ,e2fsprogs)
4047 ("libblkid" ,util-linux)
4048 ("libblkid:static" ,util-linux "static")
4049 ("libuuid" ,util-linux)
4050 ("libuuid:static" ,util-linux "static")
4053 ("zlib:static" ,zlib "static")
4054 ("zstd" ,zstd "lib")
4055 ("zstd:static" ,zstd "static")))
4056 (native-inputs `(("pkg-config" ,pkg-config)
4057 ("asciidoc" ,asciidoc)
4060 ;; For building documentation.
4061 ("libxml2" ,libxml2)
4062 ("docbook-xsl" ,docbook-xsl)
4066 ;; The tests need 'grep' with perl regexp support.
4068 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4069 (synopsis "Create and manage btrfs copy-on-write file systems")
4070 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4071 aimed at implementing advanced features while focusing on fault tolerance,
4072 repair and easy administration.")
4073 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4074 ;; GPL2: Everything else.
4075 (license (list license:gpl2 license:gpl2+))))
4077 (define-public btrfs-progs/static
4079 (name "btrfs-progs-static")
4080 (version (package-version btrfs-progs))
4082 (build-system trivial-build-system)
4084 `(("btrfs-progs:static" ,btrfs-progs "static")))
4086 `(#:modules ((guix build utils))
4089 (use-modules (guix build utils)
4093 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4094 (out (assoc-ref %outputs "out"))
4095 (source (string-append btrfs "/bin/btrfs.static"))
4096 (target (string-append out "/bin/btrfs")))
4097 (mkdir-p (dirname target))
4098 (copy-file source target)
4099 (remove-store-references target)
4100 (chmod target #o555)
4102 (home-page (package-home-page btrfs-progs))
4103 (synopsis "Statically-linked btrfs command from btrfs-progs")
4104 (description "This package provides the statically-linked @command{btrfs}
4105 from the btrfs-progs package. It is meant to be used in initrds.")
4106 (license (package-license btrfs-progs))))
4108 (define-public compsize
4112 (home-page "https://github.com/kilobyte/compsize")
4117 (commit (string-append "v" version))))
4119 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4120 (file-name (git-file-name name version))))
4121 (build-system gnu-build-system)
4123 `(("btrfs-progs" ,btrfs-progs)))
4125 `(#:tests? #f ; No tests.
4126 #:make-flags (list "CC=gcc")
4128 (modify-phases %standard-phases
4131 (lambda* (#:key outputs #:allow-other-keys)
4132 (let ((out (assoc-ref outputs "out")))
4133 (install-file "compsize" (string-append out "/bin"))
4134 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4135 (synopsis "Find compression type/ratio on Btrfs files")
4136 (description "@command{compsize} takes a list of files (given as
4137 arguments) on a Btrfs file system and measures used compression types and
4138 effective compression ratio, producing a report.
4140 A directory has no extents but has a (recursive) list of files. A non-regular
4141 file is silently ignored.
4143 As it makes no sense to talk about compression ratio of a partial extent,
4144 every referenced extent is counted whole, exactly once -- no matter if you use
4145 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4146 uncompressed size will not match the number given by @command{tar} or
4147 @command{du}. On the other hand, the space used should be accurate (although
4148 obviously it can be shared with files outside our set).")
4149 (license license:gpl2+)))
4151 (define-public f2fs-tools-1.7
4158 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4159 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4162 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4164 (build-system gnu-build-system)
4167 (modify-phases %standard-phases
4168 (add-after 'install 'install-headers
4169 (lambda* (#:key outputs #:allow-other-keys)
4170 (let* ((out (assoc-ref outputs "out"))
4171 (out-include (string-append out "/include")))
4172 (install-file "include/f2fs_fs.h" out-include)
4173 (install-file "mkfs/f2fs_format_utils.h" out-include)
4176 `(("autoconf" ,autoconf)
4177 ("automake" ,automake)
4178 ("libtool" ,libtool)
4179 ("pkg-config" ,pkg-config)))
4181 `(("libuuid" ,util-linux)
4182 ("libselinux" ,libselinux)))
4183 (home-page "https://f2fs.wiki.kernel.org/")
4184 (synopsis "Userland tools for f2fs")
4186 "F2FS, the Flash-Friendly File System, is a modern file system
4187 designed to be fast and durable on flash devices such as solid-state
4188 disks and SD cards. This package provides the userland utilities.")
4189 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4190 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4191 (license (list license:gpl2 license:lgpl2.1))))
4193 (define-public f2fs-tools
4195 (inherit f2fs-tools-1.7)
4201 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4202 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4205 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4207 `(("libuuid" ,util-linux)))))
4209 (define-public freefall
4212 (version (package-version linux-libre))
4213 (source (package-source linux-libre))
4214 (build-system gnu-build-system)
4216 '(#:phases (modify-phases %standard-phases
4217 (add-after 'unpack 'enter-subdirectory
4219 (chdir "tools/laptop/freefall")
4222 (add-before 'build 'increase-timeout
4224 ;; The default of 2 seconds is too low: it assumes an
4225 ;; open lid and AC power without actually checking.
4226 (substitute* "freefall.c"
4227 (("alarm\\(2\\)") "alarm(5)"))
4229 #:make-flags (list (string-append "PREFIX="
4230 (assoc-ref %outputs "out"))
4232 #:tests? #f)) ;no tests
4233 (home-page (package-home-page linux-libre))
4234 (synopsis "Free-fall protection for spinning laptop hard drives")
4236 "Prevents shock damage to the internal spinning hard drive(s) of some
4237 HP and Dell laptops. When sudden movement is detected, all input/output
4238 operations on the drive are suspended and its heads are parked on the ramp,
4239 where they are less likely to cause damage to the spinning disc. Requires a
4240 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4241 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4242 (license license:gpl2)))
4244 (define-public thinkfan
4252 (url "https://github.com/vmatare/thinkfan.git")
4254 (file-name (git-file-name name version))
4256 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
4257 (build-system cmake-build-system)
4259 `(#:modules ((guix build cmake-build-system)
4262 #:tests? #f ; no test target
4264 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4265 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4267 `("-DUSE_ATASMART:BOOL=ON")
4269 (modify-phases %standard-phases
4270 (add-after 'unpack 'create-init-scripts
4271 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4272 ;; systemd to patch and install their service files. Fake their
4273 ;; presence rather than duplicating the build system below. Leave
4274 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4275 ;; The sysvinit needs manual patching, but since upstream doesn't
4276 ;; even provide the option to install it: don't.
4277 (lambda* (#:key outputs #:allow-other-keys)
4278 (let* ((out (assoc-ref outputs "out"))
4279 (share (string-append out "/share/" ,name)))
4280 (substitute* "CMakeLists.txt"
4281 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4282 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4283 ;; That was easy! Now we just need to fix the destinations.
4285 (string-append out directory)))
4288 `(("pkg-config" ,pkg-config)))
4290 `(("libatasmart" ,libatasmart)
4291 ("yaml-cpp" ,yaml-cpp)))
4292 (home-page "http://thinkfan.sourceforge.net/")
4293 (synopsis "Simple fan control program")
4295 "Thinkfan is a simple fan control program. It reads temperatures,
4296 checks them against configured limits and switches to appropriate (also
4297 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4298 other @code{hwmon} driver that enables temperature reading and fan control
4300 (license license:gpl3+)))
4302 (define-public tpacpi-bat
4310 (url "https://github.com/teleshoes/tpacpi-bat.git")
4311 (commit (string-append "v" version))))
4312 (file-name (git-file-name name version))
4314 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4315 (build-system gnu-build-system)
4317 `(#:tests? #f ; no test target
4319 (modify-phases %standard-phases
4320 (add-after 'unpack 'refer-to-inputs
4322 (substitute* "tpacpi-bat"
4324 (format "~a " (which "cat")))
4325 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4326 ;; loaded. That's the administrator's prerogative; disable it.
4327 (("system \"(modprobe .*)\"" _ match)
4328 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4330 (delete 'configure) ; nothing to configure
4331 (delete 'build) ; nothing to build
4333 (lambda* (#:key outputs #:allow-other-keys)
4334 (let* ((out (assoc-ref outputs "out"))
4335 (bin (string-append out "/bin"))
4336 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4337 (install-file "tpacpi-bat" bin)
4339 ;; There's no man page. Install other forms of documentation.
4340 (for-each (lambda (file)
4341 (let ((target (string-append doc "/" file)))
4342 (mkdir-p (dirname target))
4343 (copy-recursively file target)))
4344 (list "battery_asl" "examples" "README.md"))
4348 (home-page "https://github.com/teleshoes/tpacpi-bat")
4349 (synopsis "ThinkPad battery charge controller")
4351 "Tpacpi-bat is a command-line interface to control battery charging on
4352 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4353 ThinkPad models released after 2011}, starting with the xx20 series. It can
4354 query and set the thresholds at which one or both batteries will start and stop
4355 charging, inhibit charging batteries for a set period of time, or force them to
4356 discharge when they otherwise would not.
4358 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4359 kernel module provided by the @code{acpi-call-linux-module} package, which must
4360 be installed and loaded separately. Only the original vendor firmware is
4362 (license license:gpl3+)))
4364 (define-public ntfs-3g
4367 (version "2017.3.23")
4370 (uri (string-append "https://tuxera.com/opensource/"
4371 "ntfs-3g_ntfsprogs-" version ".tgz"))
4372 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
4375 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
4376 (modules '((guix build utils)))
4378 ;; Install under $prefix.
4379 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4383 (build-system gnu-build-system)
4384 (inputs `(("util-linux" ,util-linux)
4385 ("fuse" ,fuse))) ;libuuid
4386 (native-inputs `(("pkg-config" ,pkg-config)))
4388 '(#:configure-flags (list "--exec-prefix=${prefix}"
4389 "--with-fuse=external" ;use our own FUSE
4390 "--enable-mount-helper"
4391 "--enable-posix-acls"
4392 "--enable-xattr-mappings")
4394 (modify-phases %standard-phases
4395 ;; If users install ntfs-3g, they probably want to make it the
4396 ;; default driver as well, so we opt for sensible defaults and link
4397 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
4398 ;; mount NTFS file systems.)
4399 (add-after 'install 'install-link
4400 (lambda* (#:key outputs #:allow-other-keys)
4401 (let* ((out (assoc-ref outputs "out"))
4402 (sbin (string-append out "/sbin")))
4403 (symlink "mount.ntfs-3g"
4404 (string-append sbin "/mount.ntfs")))
4406 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
4407 (synopsis "Read-write access to NTFS file systems")
4409 "NTFS-3G provides read-write access to NTFS file systems, which are
4410 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4411 The package provides additional NTFS tools.")
4412 (license license:gpl2+)))
4414 (define-public rdma-core
4420 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4421 "/releases/download/v" version "/rdma-core-"
4425 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
4426 (build-system cmake-build-system)
4428 `(#:tests? #f ; no tests
4429 ;; Upstream uses the "ninja" build system and encourage distros
4430 ;; to do the same for consistency. They also recommend using the
4431 ;; "Release" build type.
4432 #:build-type "Release"
4433 #:configure-flags (list "-GNinja"
4435 (string-append "-DRST2MAN_EXECUTABLE="
4436 (assoc-ref %build-inputs
4440 ;; On some configurations, the
4441 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
4442 ;; used by default, would return ENODEV. To
4443 ;; avoid that, use 'write' instead of ioctls,
4444 ;; as suggested in 'CMakeList.txt'.
4445 "-DIOCTL_MODE=write")
4447 (modify-phases %standard-phases
4451 "-j" (number->string (parallel-job-count)))))
4454 (invoke "ninja" "install"))))))
4457 ("pkg-config" ,pkg-config)
4458 ("python" ,python-wrapper)
4459 ("python-docutils" ,python-docutils))) ;for 'rst2man'
4463 (home-page "https://github.com/linux-rdma/rdma-core")
4464 (synopsis "Utilities and libraries for working with RDMA devices")
4466 "This package provides userspace components for the InfiniBand
4467 subsystem of the Linux kernel. Specifically it contains userspace
4468 libraries for the following device nodes:
4471 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4472 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4473 @item @file{/dev/infiniband/umadX} (@code{libibumad})
4476 The following service daemons are also provided:
4478 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4479 @item @code{iwpmd} (for iWARP kernel providers)
4480 @item @code{ibacm} (for InfiniBand communication management assistant)
4482 ;; All library code is dual licensed under GPL2 and a custom MIT
4483 ;; variant. The package also includes some components covered by
4484 ;; other licenses. Consult COPYING.md for full details.
4487 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4488 license:bsd-2 ; Files referring to COPYING.BSD_FB
4489 license:cc0 ; most files in ccan/
4490 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4492 (define-public perftest
4499 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4500 version "/perftest-" version ".g0927198.tar.gz"))
4502 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
4503 (build-system gnu-build-system)
4506 (modify-phases %standard-phases
4507 (add-after 'unpack 'patch-header-paths
4509 (substitute* '("src/raw_ethernet_fs_rate.c"
4510 "src/raw_ethernet_resources.c"
4511 "src/raw_ethernet_resources.h"
4512 "src/raw_ethernet_send_burst_lat.c"
4513 "src/raw_ethernet_send_bw.c"
4514 "src/raw_ethernet_send_lat.c")
4515 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4517 (inputs `(("rdma-core" ,rdma-core)))
4518 (home-page "https://github.com/linux-rdma/perftest/")
4519 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4520 (description "This is a collection of tests written over uverbs intended for
4521 use as a performance micro-benchmark. The tests may be used for hardware or
4522 software tuning as well as for functional testing.
4524 The collection contains a set of bandwidth and latency benchmark such as:
4526 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
4527 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4528 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4529 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4530 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4532 (license license:gpl2)))
4534 (define-public rng-tools
4537 (home-page "https://github.com/nhorman/rng-tools")
4541 (uri (git-reference (url home-page)
4542 (commit (string-append "v" version))))
4543 (file-name (git-file-name name version))
4546 "065jf26s8zkicb95zc9ilksjdq9gqrh5vcx3mhi6mypbnamn6w98"))))
4547 (build-system gnu-build-system)
4549 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
4550 #:configure-flags '("--without-nistbeacon"
4551 "--without-pkcs11")))
4553 `(("autoconf" ,autoconf)
4554 ("automake" ,automake)
4555 ("pkg-config" ,pkg-config)))
4557 `(("libsysfs" ,sysfsutils)))
4558 (synopsis "Random number generator daemon")
4560 "Monitor a hardware random number generator, and supply entropy
4561 from that to the system kernel's @file{/dev/random} machinery.")
4562 ;; The source package is offered under the GPL2+, but the files
4563 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4564 (license (list license:gpl2 license:gpl2+))))
4566 (define-public cpupower
4569 (version (package-version linux-libre))
4570 (source (package-source linux-libre))
4571 (build-system gnu-build-system)
4573 '(#:phases (modify-phases %standard-phases
4574 (add-after 'unpack 'enter-subdirectory
4576 (chdir "tools/power/cpupower")
4579 (add-before 'build 'fix-makefiles
4581 (substitute* "Makefile"
4583 (("/bin/(install|pwd)" _ command) command))
4584 (substitute* "bench/Makefile"
4585 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4587 #:make-flags (let ((out (assoc-ref %outputs "out")))
4588 (list (string-append "DESTDIR=" out)
4589 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4591 "docdir=/share/doc/cpupower"
4592 "confdir=$(docdir)/examples"
4593 ;; The Makefile recommends the following changes
4595 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4596 #:tests? #f)) ;no tests
4597 (native-inputs `(("gettext" ,gettext-minimal)))
4598 (inputs `(("pciutils" ,pciutils)))
4599 (home-page (package-home-page linux-libre))
4600 (synopsis "CPU frequency and voltage scaling tools for Linux")
4602 "cpupower is a set of user-space tools that use the cpufreq feature of the
4603 Linux kernel to retrieve and control processor features related to power saving,
4604 such as frequency and voltage scaling.")
4605 (license license:gpl2)))
4607 (define-public x86-energy-perf-policy
4609 (name "x86-energy-perf-policy")
4610 (version (package-version linux-libre))
4611 (source (package-source linux-libre))
4612 (build-system gnu-build-system)
4616 (modify-phases %standard-phases
4617 (add-after 'unpack 'enter-subdirectory
4619 (chdir "tools/power/x86/x86_energy_perf_policy")
4622 (add-before 'build 'fix-makefile
4624 (substitute* "Makefile" (("/usr") ""))
4627 (let ((out (assoc-ref %outputs "out")))
4628 (list (string-append "DESTDIR=" out)
4629 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4630 (supported-systems '("i686-linux" "x86_64-linux"))
4631 (home-page (package-home-page linux-libre))
4632 (synopsis "Display and update Intel-CPU energy-performance policy")
4634 "@command{x86_energy_perf_policy} displays and updates energy-performance
4635 policy settings specific to Intel Architecture Processors. Settings are
4636 accessed via Model Specific Register (MSR) updates, no matter if the Linux
4637 cpufreq sub-system is enabled or not.")
4638 (license license:gpl2)))
4640 (define-public haveged
4648 (url "https://github.com/jirka-h/haveged.git")
4649 (commit (string-append "v" version))))
4650 (file-name (git-file-name name version))
4652 (base32 "11kr19n2f87izsj341lv5amhd1wc2ckfmqr9pq5fxix8pkbs94rh"))))
4653 (build-system gnu-build-system)
4654 (home-page "https://www.issihosts.com/haveged")
4655 (synopsis "Entropy source for the Linux random number generator")
4657 "haveged generates an unpredictable stream of random numbers for use by
4658 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4659 standard mechanisms for filling the entropy pool may not be sufficient for
4660 systems with high needs or limited user interaction, such as headless servers.
4662 @command{haveged} runs as a privileged daemon, harvesting randomness from the
4663 indirect effects of hardware events on hidden processor state using the
4664 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
4665 It tunes itself to its environment and provides the same built-in test suite
4666 for the output stream as used on certified hardware security devices.
4668 The quality of the randomness produced by this algorithm has not been proven.
4669 It is recommended to run it together with another entropy source like rngd, and
4670 not as a replacement for it.")
4671 (license (list (license:non-copyleft "file://nist/mconf.h")
4672 (license:non-copyleft "file://nist/packtest.c")
4673 license:public-domain ; nist/dfft.c
4674 license:gpl3+)))) ; everything else
4676 (define-public ecryptfs-utils
4678 (name "ecryptfs-utils")
4683 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4684 version "/+download/ecryptfs-utils_"
4685 version ".orig.tar.gz"))
4688 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4689 (build-system gnu-build-system)
4691 `(#:configure-flags (list "--disable-pywrap")
4693 (modify-phases %standard-phases
4694 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4695 (lambda* (#:key inputs outputs #:allow-other-keys)
4696 (let ((out (assoc-ref outputs "out"))
4697 (utils-linux (assoc-ref inputs "utils-linux"))
4698 (cryptsetup (assoc-ref inputs "cryptsetup"))
4699 (linux-pam (assoc-ref inputs "linux-pam"))
4700 (lvm2 (assoc-ref inputs "lvm2")))
4701 (substitute* '("src/utils/ecryptfs-mount-private"
4702 "src/utils/ecryptfs-umount-private"
4703 "src/utils/ecryptfs-setup-private"
4704 "src/utils/ecryptfs-setup-swap"
4705 "src/utils/mount.ecryptfs.c"
4706 "src/utils/umount.ecryptfs.c"
4707 "src/pam_ecryptfs/pam_ecryptfs.c"
4708 "src/desktop/ecryptfs-mount-private.desktop.in"
4709 "src/desktop/ecryptfs-setup-private.desktop.in")
4711 (string-append utils-linux "/bin/mount"))
4713 (string-append utils-linux "/bin/umount"))
4714 (("/sbin/mount.ecryptfs_private")
4715 (string-append out "/sbin/mount.ecryptfs_private"))
4716 (("/sbin/umount.ecryptfs_private")
4717 (string-append out "/sbin/umount.ecryptfs_private"))
4718 (("/usr/bin/ecryptfs-mount-private")
4719 (string-append out "/bin/ecryptfs-mount-private"))
4720 (("/usr/bin/ecryptfs-rewrite-file")
4721 (string-append out "/bin/ecryptfs-rewrite-file"))
4722 (("/usr/bin/ecryptfs-setup-private")
4723 (string-append out "/bin/ecryptfs-setup-private"))
4724 (("/sbin/cryptsetup")
4725 (string-append cryptsetup "/sbin/cryptsetup"))
4726 (("/sbin/unix_chkpwd")
4727 (string-append linux-pam "/sbin/unix_chkpwd"))
4729 (string-append lvm2 "/sbin/dmsetup")))))))))
4731 `(("intltool" ,intltool)
4732 ("perl" ,perl) ; for pod2man
4733 ("pkg-config" ,pkg-config)))
4735 `(("keyutils" ,keyutils)
4736 ("linux-pam" ,linux-pam)
4737 ("utils-linux" ,util-linux)
4738 ("cryptsetup" ,cryptsetup)
4741 (home-page "https://ecryptfs.org/")
4742 (synopsis "eCryptfs cryptographic file system utilities")
4744 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4745 Each file's cryptographic meta-data is stored inside the file itself, along
4746 with the encrypted contents. This allows individual encrypted files to be
4747 copied between hosts and still be decrypted with the proper key. eCryptfs is a
4748 native Linux file system, and has been part of the Linux kernel since version
4749 2.6.19. This package contains the userland utilities to manage it.")
4750 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4751 ;; grant additional permission to link with OpenSSL.
4752 (license license:gpl2+)))
4754 (define-public libnfsidmap
4756 (name "libnfsidmap")
4761 (uri (string-append "https://fedorapeople.org/~steved/"
4762 name "/" version "/" name "-" version ".tar.bz2"))
4764 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
4765 (build-system gnu-build-system)
4767 `(#:configure-flags (list
4768 (string-append "--with-pluginpath="
4769 (assoc-ref %outputs "out")
4770 "/lib/libnfsidmap"))))
4772 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
4774 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4775 (synopsis "NFSv4 support library for name/ID mapping")
4776 (description "Libnfsidmap is a library holding mulitiple methods of
4777 mapping names to ids and visa versa, mainly for NFSv4. It provides an
4778 extensible array of mapping functions, currently consisting of two choices:
4779 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4780 (license (license:non-copyleft "file://COPYING"
4781 "See COPYING in the distribution."))))
4783 (define-public module-init-tools
4785 (name "module-init-tools")
4790 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
4791 "module-init-tools-" version ".tar.bz2"))
4794 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
4795 (patches (search-patches "module-init-tools-moduledir.patch"))))
4796 (build-system gnu-build-system)
4798 ;; FIXME: The upstream tarball lacks man pages, and building them would
4799 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
4800 ;; but they vanished. In the meantime, fake it.
4802 (modify-phases %standard-phases
4803 (add-before 'configure 'fake-docbook
4805 (substitute* "Makefile.in"
4806 (("^DOCBOOKTOMAN.*$")
4807 "DOCBOOKTOMAN = true\n"))
4809 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
4810 (synopsis "Tools for loading and managing Linux kernel modules")
4812 "Tools for loading and managing Linux kernel modules, such as
4813 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
4814 (license license:gpl2+)))
4816 (define-public mcelog
4822 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
4823 "mcelog.git/snapshot/v" version ".tar.gz"))
4826 "1c4faayg1gcm3002b2fdrfnv76z92mvfzccvx8w9crjp0d17sp24"))
4827 (file-name (string-append name "-" version ".tar.gz"))
4828 (modules '((guix build utils)))
4831 ;; The snapshots lack a .git directory,
4832 ;; breaking ‘git describe’.
4833 (substitute* "Makefile"
4834 (("\"unknown\"") (string-append "\"v" ,version "\"")))
4836 (build-system gnu-build-system)
4838 `(#:phases (modify-phases %standard-phases
4839 (delete 'configure)) ; no configure script
4840 #:make-flags (let ((out (assoc-ref %outputs "out")))
4842 (string-append "prefix=" out)
4843 (string-append "DOCDIR=" out "/share/doc/mcelog")
4844 "etcprefix=$(DOCDIR)/examples"))
4845 ;; The tests will only run as root on certain supported CPU models.
4847 (supported-systems (list "i686-linux" "x86_64-linux"))
4848 (home-page "https://mcelog.org/")
4849 (synopsis "Machine check monitor for x86 Linux systems")
4851 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
4852 and other hardware errors on x86 systems. It can also perform user-defined
4853 tasks, such as bringing bad pages off-line, when configurable error thresholds
4855 (license license:gpl2)))
4857 (define-public mtd-utils
4864 "ftp://ftp.infradead.org/pub/mtd-utils/"
4865 "mtd-utils-" version ".tar.bz2"))
4868 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
4870 '(#:configure-flags '("--enable-unit-tests")))
4872 `(("cmocka" ,cmocka)
4873 ("pkg-config" ,pkg-config)))
4875 `(("acl" ,acl) ; extended attributes (xattr)
4876 ("libuuid" ,util-linux)
4878 ("openssl" ,openssl) ; optional crypto support
4880 ("zstd" ,zstd "lib")))
4881 (build-system gnu-build-system)
4882 (synopsis "MTD Flash Storage Utilities")
4883 (description "This package provides utilities for testing, partitioning, etc
4885 (home-page "http://www.linux-mtd.infradead.org/")
4887 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
4888 license:mpl1.1 ; All ftl* files
4889 license:expat)))) ; libiniparser
4891 (define-public libseccomp
4897 (uri (string-append "https://github.com/seccomp/libseccomp/"
4898 "releases/download/v" version
4899 "/libseccomp-" version ".tar.gz"))
4902 "0nsq81acrbkdr8zairxbwa33bj2a6126npp76b4srjl472sjfkxm"))
4903 (patches (search-patches "libseccomp-open-aarch64.patch"))))
4904 (build-system gnu-build-system)
4906 `(("which" ,which)))
4907 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
4908 (description "The libseccomp library provides an easy to use, platform
4909 independent, interface to the Linux Kernel's syscall filtering mechanism. The
4910 libseccomp API is designed to abstract away the underlying BPF based syscall
4911 filter language and present a more conventional function-call based filtering
4912 interface that should be familiar to, and easily adopted by, application
4914 (home-page "https://github.com/seccomp/libseccomp")
4915 (license license:lgpl2.1)))
4917 (define-public radeontop
4925 (url "https://github.com/clbr/radeontop.git")
4926 (commit (string-append "v" version))))
4927 (file-name (git-file-name name version))
4929 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
4930 (build-system gnu-build-system)
4932 `(#:phases (modify-phases %standard-phases
4933 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4934 ;; dependency, and doesn't even work on release(!) tarballs.
4935 (add-after 'unpack 'report-correct-version
4937 (substitute* "getver.sh"
4939 (string-append "ver=" ,version)))
4941 (delete 'configure)) ; no configure script
4942 #:make-flags (list "CC=gcc"
4943 (string-append "PREFIX=" %output))
4944 #:tests? #f)) ; no tests
4946 `(("gettext" ,gettext-minimal)
4947 ("pkg-config" ,pkg-config)))
4949 `(("libdrm" ,libdrm)
4950 ("libpciaccess" ,libpciaccess)
4952 ("ncurses" ,ncurses)))
4953 (home-page "https://github.com/clbr/radeontop/")
4954 (synopsis "Usage monitor for AMD Radeon graphics")
4955 (description "RadeonTop monitors resource consumption on supported AMD
4956 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4957 a terminal or saved to a file for further processing. It measures both the
4958 activity of the GPU as a whole, which is also accurate during OpenCL
4959 computations, as well as separate component statistics that are only meaningful
4960 under OpenGL graphics workloads.")
4961 (license license:gpl3)))
4963 (define-public efivar
4969 (uri (string-append "https://github.com/rhboot/" name
4970 "/releases/download/" version "/" name
4971 "-" version ".tar.bz2"))
4974 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
4975 (build-system gnu-build-system)
4977 `(;; Tests require a UEFI system and is not detected in the chroot.
4979 #:make-flags (list (string-append "prefix=" %output)
4980 (string-append "libdir=" %output "/lib")
4982 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4984 (modify-phases %standard-phases
4986 (add-before 'build 'kernel-headers-are-system-headers
4987 (lambda* (#:key inputs #:allow-other-keys)
4988 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
4989 ;; Make sure the kernel headers are treated as system headers
4990 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
4991 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
4994 `(("pkg-config" ,pkg-config)))
4997 (home-page "https://github.com/rhboot/efivar")
4998 (synopsis "Tool and library to manipulate EFI variables")
4999 (description "This package provides a library and a command line
5000 interface to the variable facility of UEFI boot firmware.")
5001 (license license:lgpl2.1+)))
5003 (define-public efibootmgr
5009 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5010 "/releases/download/" version "/efibootmgr"
5011 "-" version ".tar.bz2"))
5014 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5015 (build-system gnu-build-system)
5017 `(#:tests? #f ;no tests
5018 #:make-flags (list (string-append "prefix=" %output)
5019 (string-append "libdir=" %output "/lib")
5020 ;; EFIDIR denotes a subdirectory relative to the
5021 ;; EFI System Partition where the loader will be
5022 ;; installed (known as OS_VENDOR in the code).
5023 ;; GRUB overrides this, as such it's only used if
5024 ;; nothing else is specified on the command line.
5026 ;; Treat kernel headers as system headers to prevent
5027 ;; warnings about conflicting types.
5028 (string-append "C_INCLUDE_PATH="
5029 (assoc-ref %build-inputs "kernel-headers")
5031 #:phases (modify-phases %standard-phases (delete 'configure))))
5033 `(("pkg-config" ,pkg-config)))
5035 `(("efivar" ,efivar)
5037 (home-page "https://github.com/rhinstaller/efibootmgr")
5038 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5040 "@code{efibootmgr} is a user-space application to modify the Intel
5041 Extensible Firmware Interface (EFI) Boot Manager. This application can
5042 create and destroy boot entries, change the boot order, change the next
5043 running boot option, and more.")
5044 (license license:gpl2+)))
5046 (define-public sysstat
5052 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5053 "sysstat-" version ".tar.xz"))
5056 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
5057 (build-system gnu-build-system)
5059 `(#:tests? #f ; No test suite.
5060 ;; Without this flag, it tries to install the man pages with group 'root'
5061 ;; and fails because /etc/passwd lacks an entry for the root user.
5063 (list "--disable-file-attr"
5064 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5066 (modify-phases %standard-phases
5067 ;; The build process tries to create '/var/lib/sa', so we skip that
5069 (add-after 'build 'skip-touching-var
5071 (substitute* "Makefile"
5072 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5075 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5076 (synopsis "Performance monitoring tools for Linux")
5077 (description "The sysstat utilities are a collection of performance
5078 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5079 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5080 @code{sadf} and @code{sa}.")
5081 (license license:gpl2+)))
5083 (define-public light
5091 (url "https://github.com/haikarainen/light.git")
5092 (commit (string-append "v" version))))
5094 (base32 "0zrjipd392bzjvxx0rjrb0cgi0ix1d83fwgw1mcy8kc4d16cgyjg"))
5095 (file-name (git-file-name name version))))
5096 (build-system gnu-build-system)
5099 (modify-phases %standard-phases
5100 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5101 (lambda* (#:key inputs #:allow-other-keys)
5102 (substitute* "90-backlight.rules"
5103 (("/bin/chgrp") (which "chgrp"))
5104 (("/bin/chmod") (which "chmod")))
5106 (add-after 'install 'install-udev-rules
5107 (lambda* (#:key outputs #:allow-other-keys)
5108 (let ((out (assoc-ref outputs "out")))
5110 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5113 `(("autoconf" ,autoconf)
5114 ("automake" ,automake)))
5115 (home-page "https://haikarainen.github.io/light/")
5116 (synopsis "GNU/Linux application to control backlights")
5118 "Light is a program to send commands to screen backlight controllers
5119 under GNU/Linux. Features include:
5122 @item It does not rely on X.
5123 @item Light can automatically figure out the best controller to use, making
5124 full use of underlying hardware.
5125 @item It is possible to set a minimum brightness value, as some controllers
5126 set the screen to be pitch black at a vaĺue of 0 (or higher).
5129 Light is the successor of lightscript.")
5130 (license license:gpl3+)))
5132 (define-public brightnessctl
5133 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5135 (name "brightnessctl")
5136 (version (git-version "0.4" "0" commit))
5140 (url "https://github.com/Hummer12007/brightnessctl/")
5142 (file-name (git-file-name name version))
5145 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5146 (build-system gnu-build-system)
5148 '(#:tests? #f ; no tests
5149 #:make-flags (list "CC=gcc"
5150 (string-append "PREFIX=" %output)
5151 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5153 (modify-phases %standard-phases
5155 (add-after 'unpack 'adjust-udev-rules
5157 (substitute* "90-brightnessctl.rules"
5158 (("/bin/") "/run/current-system/profile/bin/"))
5160 (home-page "https://github.com/Hummer12007/brightnessctl")
5161 (synopsis "Backlight and LED brightness control")
5163 "This program allows you read and control device brightness. Devices
5164 include backlight and LEDs. It can also preserve current brightness before
5165 applying the operation, such as on lid close.
5167 The appropriate permissions must be set on the backlight or LED control
5168 interface in sysfs, which can be accomplished with the included udev rules.")
5169 (license license:expat))))
5178 (uri (string-append "https://github.com/linrunner/TLP/archive/"
5180 (file-name (string-append name "-" version ".tar.gz"))
5182 (base32 "169k3xypq5rq0xiggrlpr73yr2r2x7b2d9vcr9ac96qrgph7sk7r"))))
5184 `(("shellcheck" ,shellcheck)))
5188 ("ethtool" ,ethtool)
5192 ("inetutils" ,inetutils)
5195 ("pciutils" ,pciutils)
5199 ("usbutils" ,usbutils)
5200 ("util-linux" ,util-linux)
5201 ("wireless-tools" ,wireless-tools)
5202 ,@(if (let ((system (or (%current-target-system)
5203 (%current-system))))
5204 (or (string-prefix? "i686-" system)
5205 (string-prefix? "x86_64-" system)))
5206 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5208 (build-system gnu-build-system)
5210 ;; XXX: The full test suite is run with "checkall" but it requires
5211 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
5212 `(#:test-target "shellcheck"
5213 #:modules ((guix build gnu-build-system)
5217 (modify-phases %standard-phases
5218 (delete 'configure) ; no configure script
5219 (add-before 'build 'setenv
5220 (lambda* (#:key outputs #:allow-other-keys)
5221 (let ((out (assoc-ref outputs "out")))
5222 (setenv "TLP_WITH_SYSTEMD" "0")
5223 (setenv "TLP_NO_INIT" "1")
5224 (setenv "TLP_NO_PMUTILS" "1")
5225 (setenv "TLP_SBIN" (string-append out "/bin"))
5226 (setenv "TLP_BIN" (string-append out "/bin"))
5227 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5228 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5229 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5230 (setenv "TLP_CONFDEF"
5231 (string-append out "/share/tlp/defaults.conf"))
5232 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
5234 (string-append out "/lib/elogind/system-sleep"))
5236 (string-append out "/share/bash-completion/completions"))
5237 (setenv "TLP_MAN" (string-append out "/share/man"))
5238 (setenv "TLP_META" (string-append out "/share/metainfo"))
5240 (add-before 'install 'fix-installation
5242 ;; Stop the Makefile from trying to create system directories.
5243 (substitute* "Makefile"
5244 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
5245 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5248 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
5249 (add-after 'install 'wrap
5250 (lambda* (#:key inputs outputs #:allow-other-keys)
5251 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5252 (bin-files (find-files bin ".*")))
5253 (define (bin-directory input-name)
5254 (let ((p (assoc-ref inputs input-name)))
5255 (and p (string-append p "/bin"))))
5256 (define (sbin-directory input-name)
5257 (string-append (assoc-ref inputs input-name) "/sbin"))
5258 (for-each (lambda (program)
5259 (wrap-program program
5262 (filter-map bin-directory
5274 "x86-energy-perf-policy"))
5275 (filter-map sbin-directory
5281 "wireless-tools"))))))
5284 (home-page "http://linrunner.de/en/tlp/tlp.html")
5285 (synopsis "Power management tool for Linux")
5286 (description "TLP is a power management tool for Linux. It comes with
5287 a default configuration already optimized for battery life. Nevertheless,
5288 TLP is customizable to fulfil system requirements. TLP settings are applied
5289 every time the power supply source is changed.")
5290 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5292 (license (list license:gpl2+ license:gpl3+))))
5300 (uri (string-append "https://www.ezix.org/software/"
5301 "files/lshw-" version
5305 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5306 (build-system gnu-build-system)
5308 `(#:phases (modify-phases %standard-phases (delete 'configure))
5309 #:tests? #f ; no tests
5311 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5312 (synopsis "List hardware information")
5314 "@command{lshw} (Hardware Lister) is a small tool to provide
5315 detailed information on the hardware configuration of the machine.
5316 It can report exact memory configuration, firmware version, mainboard
5317 configuration, CPU version and speed, cache configuration, bus speed,
5318 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5319 machines (PowerMac G4 is known to work).")
5320 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5321 (license license:gpl2+)))
5323 (define-public libmnl
5330 (uri (string-append "mirror://netfilter.org/libmnl/"
5331 "libmnl-" version ".tar.bz2"))
5334 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5335 (build-system gnu-build-system)
5336 (home-page "https://www.netfilter.org/projects/libmnl/")
5337 (synopsis "Netlink utility library")
5338 (description "Libmnl is a minimalistic user-space library oriented to
5339 Netlink developers. There are a lot of common tasks in parsing, validating,
5340 constructing of both the Netlink header and TLVs that are repetitive and easy to
5341 get wrong. This library aims to provide simple helpers that allows you to
5342 re-use code and to avoid re-inventing the wheel.")
5343 (license license:lgpl2.1+)))
5345 (define-public libnftnl
5352 (uri (string-append "mirror://netfilter.org/libnftnl/"
5353 "libnftnl-" version ".tar.bz2"))
5355 (base32 "1wqlxf76bkqf3qhka9sw32qhb2ni20q1k6rn3iril2kw482lvpk6"))
5357 (search-patches "libnftnl-dont-check-NFTNL_FLOWTABLE_SIZE.patch"))))
5358 (build-system gnu-build-system)
5360 `(("pkg-config" ,pkg-config)))
5362 `(("libmnl" ,libmnl)))
5363 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5364 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5365 (description "Libnftnl is a userspace library providing a low-level netlink
5366 programming interface to the in-kernel nf_tables subsystem. The library
5367 libnftnl has been previously known as libnftables. This library is currently
5369 (license license:gpl2+)))
5371 (define-public nftables
5378 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
5380 (string-append "https://www.nftables.org/projects/nftables"
5381 "/files/nftables-" version ".tar.bz2")))
5383 (base32 "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm"))))
5384 (build-system gnu-build-system)
5385 (arguments `(#:configure-flags
5386 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5387 (inputs `(("bison" ,bison)
5391 ("libnftnl" ,libnftnl)
5392 ("readline" ,readline)))
5393 (native-inputs `(("pkg-config" ,pkg-config)))
5394 (home-page "https://www.nftables.org")
5395 (synopsis "Userspace utility for Linux packet filtering")
5396 (description "nftables is the project that aims to replace the existing
5397 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5398 filtering framework, a new userspace utility and also a compatibility layer for
5399 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5400 infrastructure such as the existing hooks, the connection tracking system, the
5401 userspace queueing component and the logging subsystem.")
5402 (license license:gpl2)))
5404 (define-public proot
5412 (url "https://github.com/proot-me/PRoot.git")
5413 (commit (string-append "v" version))))
5414 (file-name (git-file-name name version))
5416 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5417 (patches (search-patches "proot-test-fhs.patch"))))
5418 (build-system gnu-build-system)
5420 '(#:make-flags '("-C" "src")
5422 #:phases (modify-phases %standard-phases
5424 (add-before 'build 'set-shell-file-name
5425 (lambda* (#:key inputs #:allow-other-keys)
5426 (substitute* (find-files "src" "\\.[ch]$")
5429 (assoc-ref inputs "bash")
5432 (add-before 'check 'fix-fhs-assumptions-in-tests
5434 (substitute* "tests/test-c6b77b77.mk"
5435 (("/bin/bash") (which "bash"))
5436 (("/usr/bin/test") (which "test")))
5437 (substitute* '("tests/test-16573e73.c")
5438 (("/bin/([a-z-]+)" _ program)
5441 (substitute* (find-files "tests" "\\.sh$")
5442 ;; Some of the tests try to "bind-mount" /bin/true.
5444 (string-append "-b " (which "true") ":"))
5445 ;; Likewise for /bin.
5446 (("-b /bin:") "-b /gnu:")
5447 ;; Others try to run /bin/sh.
5448 (("/bin/sh") (which "sh"))
5449 ;; Others assume /etc/fstab exists.
5450 (("/etc/fstab") "/etc/passwd"))
5452 (substitute* "tests/GNUmakefile"
5453 (("-b /bin:") "-b /gnu:"))
5455 ;; XXX: This test fails in an obscure corner case, just
5457 (delete-file "tests/test-kkkkkkkk.c")
5462 (let ((n (parallel-job-count)))
5463 ;; For some reason we get lots of segfaults with
5464 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5465 (setenv "PROOT_NO_SECCOMP" "1")
5467 ;; Most of the tests expect "/bin" to be in $PATH so
5468 ;; they can run things that live in $ROOTFS/bin.
5470 (string-append (getenv "PATH") ":/bin"))
5472 (invoke "make" "check" "-C" "tests"
5474 "-j" (number->string n)))))
5476 (lambda* (#:key outputs #:allow-other-keys)
5477 ;; The 'install' rule does nearly nothing.
5478 (let* ((out (assoc-ref outputs "out"))
5479 (man1 (string-append out "/share/man/man1")))
5480 ;; TODO: 'make install-care' (does not even
5481 ;; build currently.)
5482 (invoke "make" "-C" "src" "install"
5483 (string-append "PREFIX=" out))
5486 (copy-file "doc/proot/man.1"
5487 (string-append man1 "/proot.1"))
5489 (native-inputs `(("which" ,which)
5491 ;; For 'mcookie', used by some of the tests.
5492 ("util-linux" ,util-linux)))
5493 (inputs `(("talloc" ,talloc)))
5494 (home-page "https://github.com/proot-me/PRoot")
5495 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5497 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5498 and @code{binfmt_misc}. This means that users don't need any privileges or
5499 setup to do things like using an arbitrary directory as the new root
5500 file system, making files accessible somewhere else in the file system
5501 hierarchy, or executing programs built for another CPU architecture
5502 transparently through QEMU user-mode. Also, developers can use PRoot as a
5503 generic process instrumentation engine thanks to its extension mechanism.
5504 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5505 available in the kernel Linux.")
5506 (license license:gpl2+)))
5508 (define-public proot-static
5511 (name "proot-static")
5513 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5514 (inputs `(("talloc" ,talloc/static)))
5516 (substitute-keyword-arguments (package-arguments proot)
5517 ((#:make-flags flags)
5518 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5520 `(modify-phases ,phases
5521 (add-after 'strip 'remove-store-references
5522 (lambda* (#:key outputs #:allow-other-keys)
5523 (let* ((out (assoc-ref outputs "out")))
5524 (with-directory-excursion out
5525 (remove-store-references "bin/proot")
5527 ((#:allowed-references _ '("out"))
5530 (define-public cpuid
5533 (version "20200116")
5536 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5537 version ".src.tar.gz"))
5540 "1gxi4iwy6j366l6bkj1yyxhrk1rxmwfp498gikfxn8xwhij9dn0a"))))
5541 (build-system gnu-build-system)
5543 '(#:make-flags '("CC=gcc")
5544 #:tests? #f ; no tests
5545 #:phases (modify-phases %standard-phases
5546 (delete 'configure) ; no configure script
5547 (add-before 'install 'fix-makefile
5548 (lambda* (#:key outputs #:allow-other-keys)
5549 (substitute* "Makefile"
5550 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5551 ;; Make the compressed manpages writable so that the
5552 ;; reset-gzip-timestamps phase does not error out.
5553 (substitute* "Makefile"
5554 (("-m 444") "-m 644"))
5556 (inputs `(("perl" ,perl)))
5557 (supported-systems '("i686-linux" "x86_64-linux"))
5558 (home-page "http://www.etallen.com/cpuid.html")
5559 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5560 (description "cpuid dumps detailed information about the CPU(s) gathered
5561 from the CPUID instruction, and also determines the exact model of CPU(s). It
5562 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5563 NexGen, Rise, and SiS CPUs.")
5564 (license license:gpl2+)))
5566 (define-public jmtpfs
5573 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5575 (file-name (string-append name "-" version ".tar.gz"))
5578 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5579 (build-system gnu-build-system)
5583 ("libmtp" ,libmtp)))
5585 `(("pkg-config" ,pkg-config)))
5586 (home-page "https://github.com/JasonFerrara/jmtpfs")
5587 (synopsis "Use a FUSE file system to access data over MTP")
5588 (description "jmtpfs uses FUSE (file system in userspace) to provide access
5589 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
5590 the MTP device as a file system.")
5591 (license license:gpl3)))
5593 (define-public procenv
5600 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5602 (file-name (string-append name "-" version ".tar.gz"))
5604 (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
5605 (build-system gnu-build-system)
5606 (arguments `(#:configure-flags '("--disable-silent-rules")))
5607 (native-inputs `(("pkg-config" ,pkg-config)))
5608 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5609 ("groff" ,groff) ; for tests
5610 ("libselinux" ,libselinux)))
5611 (synopsis "Utility to show process environment")
5612 (description "Procenv is a command-line tool that displays as much detail about
5613 itself and its environment as possible. It can be used as a test
5614 tool, to understand the type of environment a process runs in, and for
5615 comparing system environments.")
5616 (home-page "http://github.com/jamesodhunt/procenv/")
5617 (license license:gpl3+)))
5619 (define-public libfabric
5627 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5628 version "/libfabric-" version ".tar.bz2"))
5630 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5631 (build-system gnu-build-system)
5632 (inputs `(("rdma-core" ,rdma-core)
5633 ,@(match (%current-system)
5634 ((member (package-supported-systems psm))
5638 (home-page "https://ofiwg.github.io/libfabric/")
5639 (synopsis "Open Fabric Interfaces")
5641 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5642 communication services to applications. OFI is best described as a collection
5643 of libraries and applications used to export fabric services. The key
5644 components of OFI are: application interfaces, provider libraries, kernel
5645 services, daemons, and test applications.
5647 Libfabric is a core component of OFI. It is the library that defines and
5648 exports the user-space API of OFI, and is typically the only software that
5649 applications deal with directly. It works in conjunction with provider
5650 libraries, which are often integrated directly into libfabric.")
5651 (license (list license:bsd-2 license:gpl2)))) ;dual
5656 (version "3.3.20170428")
5657 (home-page "https://github.com/intel/psm")
5661 (uri (git-reference (url home-page)
5662 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5663 (file-name (string-append "psm-" version ".tar.gz"))
5665 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5666 (patches (search-patches
5667 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5668 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5669 "psm-repro.patch" ; reproducibility
5670 "psm-disable-memory-stats.patch"))))
5671 (build-system gnu-build-system)
5672 (outputs '("out" "debug"))
5673 (inputs `(("libuuid" ,util-linux)))
5675 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5676 ,(string-append "INSTALL_PREFIX=" %output)
5677 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5679 #:phases (modify-phases %standard-phases
5681 (add-after 'unpack 'patch-/usr/include
5683 (substitute* "Makefile"
5684 (("\\$\\{DESTDIR}/usr/include")
5685 (string-append %output "/include")))
5686 (substitute* "Makefile"
5687 (("/lib64") "/lib"))
5689 (add-after 'unpack 'patch-sysmacros
5691 (substitute* "ipath/ipath_proto.c"
5692 (("#include <sys/poll.h>" m)
5693 (string-append m "\n"
5694 "#include <sys/sysmacros.h>")))
5696 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5698 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5699 communications interface for the True Scale family of products. PSM users are
5700 enabled with mechanisms necessary to implement higher level communications
5701 interfaces in parallel environments.")
5702 ;; Only Intel-compatable processors are supported.
5703 (supported-systems '("i686-linux" "x86_64-linux"))
5704 (license (list license:bsd-2 license:gpl2)))) ;dual
5706 (define-public snapscreenshot
5708 (name "snapscreenshot")
5709 (version "1.0.14.3")
5713 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5714 name "-" version ".tar.bz2"))
5716 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5717 (build-system gnu-build-system)
5720 (let ((out (assoc-ref %outputs "out")))
5721 (list (string-append "BINDIR=" out "/bin")
5722 (string-append "MANDIR=" out "/share/man")))
5723 #:tests? #f ; no test suite
5725 (modify-phases %standard-phases
5726 (delete 'configure) ; ./configure is a snarky no-op
5727 (add-before 'install 'fix-ownership
5728 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5730 (substitute* "depfun.mak"
5731 ((" -o bin -g bin ") " "))
5733 (add-before 'install 'create-output-directories
5734 (lambda* (#:key outputs #:allow-other-keys)
5735 (let ((out (assoc-ref outputs "out")))
5736 (mkdir-p (string-append out "/share/man/man1"))
5738 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
5739 (synopsis "Take screenshots of one or more Linux text consoles")
5741 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
5742 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
5743 relevant @file{/dev/vcs*} file(s).")
5744 (license license:gpl2)))
5746 (define-public fbcat
5753 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
5754 version "/" name "-" version ".tar.gz"))
5756 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
5757 (build-system gnu-build-system)
5759 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
5760 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
5761 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
5762 `(("pnmtopng" ,netpbm)))
5763 (outputs (list "out" "fbgrab"))
5767 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5768 #:tests? #f ; no tests
5770 (modify-phases %standard-phases
5771 (delete 'configure) ; no configure script
5772 (add-after 'build 'qualify-references
5773 (lambda* (#:key inputs outputs #:allow-other-keys)
5774 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5775 (out (assoc-ref outputs "out")))
5776 (substitute* "fbgrab"
5778 (string-append out "/bin/" all))
5780 (string-append pnmtopng "/bin/" all)))
5782 (add-after 'install 'split-fbgrab-output
5783 (lambda* (#:key outputs #:allow-other-keys)
5784 (let* ((out (assoc-ref outputs "out"))
5785 (out:fbgrab (assoc-ref outputs "fbgrab")))
5786 (for-each (lambda (file)
5787 (let ((old (string-append out "/" file))
5788 (new (string-append out:fbgrab "/" file)))
5789 (mkdir-p (dirname new))
5790 (rename-file old new)))
5792 "share/man/man1/fbgrab.1"))
5794 (home-page "https://jwilk.net/software/fbcat")
5795 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
5797 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
5798 a dump therof. It supports a wide range of drivers and pixel formats.
5799 @command{fbcat} can take screenshots of virtually any application that can be
5800 made to write its output to the framebuffer, including (but not limited to)
5801 text-mode or graphical applications that don't use a display server.
5803 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
5804 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
5805 (license license:gpl2)))
5807 (define-public libcgroup
5815 "mirror://sourceforge/libcg/" name "/"
5816 version "/" name "-" version ".tar.bz2"))
5818 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
5819 (build-system gnu-build-system)
5826 `(("linux-pam" ,linux-pam)))
5827 (home-page "https://sourceforge.net/projects/libcg/")
5828 (synopsis "Control groups management tools")
5829 (description "Control groups is Linux kernel method for process resource
5830 restriction, permission handling and more. This package provides userspace
5831 interface to this kernel feature.")
5832 (license license:lgpl2.1)))
5834 (define-public mbpfan
5842 (url "https://github.com/dgraziotin/mbpfan.git")
5843 (commit (string-append "v" version))))
5844 (file-name (git-file-name name version))
5846 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5847 (build-system gnu-build-system)
5849 '(#:tests? #f ; tests ask to be run as root
5850 #:make-flags (let ((out (assoc-ref %outputs "out")))
5851 (list (string-append "DESTDIR=" out)
5854 (modify-phases %standard-phases
5855 (add-after 'unpack 'patch-paths
5857 (substitute* "Makefile"
5860 (delete 'configure)))) ; there's no configure phase
5861 (home-page "https://github.com/dgraziotin/mbpfan")
5862 (synopsis "Control fan speed on Macbooks")
5864 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
5865 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
5866 module. It can be executed as a daemon or in the foreground with root
5868 (license license:gpl3+)))
5877 (url "https://github.com/intel/opa-psm2.git")
5878 (commit (string-append "PSM2_" version))))
5879 (file-name (git-file-name name version))
5882 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
5883 (build-system gnu-build-system)
5886 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5888 #:phases (modify-phases %standard-phases
5890 (add-after 'unpack 'patch-Makefiles
5892 (substitute* "Makefile"
5895 (substitute* "compat/Makefile"
5901 (setenv "DESTDIR" %output)
5902 (invoke "make" "install")
5905 `(("rdma-core" ,rdma-core)
5906 ("numactl" ,numactl)))
5907 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
5909 "This package is low-level user-level Intel's communications interface.
5910 The PSM2 API is a high-performance vendor-specific protocol that provides a
5911 low-level communications interface for the Intel Omni-Path family of
5912 high-speed networking devices.")
5913 (home-page "https://github.com/intel/opa-psm2")
5914 ;; Only the x86_64 architecure is supported.
5915 (supported-systems '("x86_64-linux"))
5916 (license (list license:bsd-3 license:gpl2)))) ; dual
5918 (define-public libpfm4
5924 (uri (string-append "mirror://sourceforge/perfmon2/"
5925 name "/libpfm-" version ".tar.gz"))
5928 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
5929 (build-system gnu-build-system)
5931 '(#:modules ((guix build utils)
5932 (guix build gnu-build-system))
5933 #:phases (modify-phases %standard-phases
5937 (lambda* (#:key inputs outputs #:allow-other-keys)
5938 (let* ((out (assoc-ref outputs "out")))
5943 (lambda* (#:key outputs #:allow-other-keys)
5944 (let* ((out (assoc-ref outputs "out")))
5946 (string-append "PREFIX=" out)
5949 (synopsis "Performance event monitoring library")
5951 "This package provides a library called libpfm4, which is used to develop
5952 monitoring tools exploiting the performance monitoring events such as those
5953 provided by the Performance Monitoring Unit (PMU) of modern processors.
5955 Libpfm4 helps convert from an event name, expressed as a string, to the event
5956 encoding that is either the raw event as documented by the hardware vendor or
5957 the OS-specific encoding. In the latter case, the library is able to prepare
5958 the OS-specific data structures needed by the kernel to setup the event.
5960 libpfm4 provides support for the @code{perf_events} interface, which was
5961 introduced in Linux 2.6.31.")
5962 (home-page "http://perfmon2.sourceforge.net/")
5963 (license license:expat)))
5965 (define-public libnfnetlink
5967 (name "libnfnetlink")
5972 "https://www.netfilter.org/projects/libnfnetlink/files/"
5973 "libnfnetlink-" version ".tar.bz2"))
5976 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
5977 (build-system gnu-build-system)
5978 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
5979 (synopsis "Low-level netfilter netlink communication library")
5981 "@code{libnfnetlink} is the low-level library for netfilter related
5982 kernel/userspace communication. It provides a generic messaging
5983 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
5984 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
5985 management tools in userspace.")
5986 (license license:gpl2)))
5988 (define-public go-netlink
5995 (url "https://github.com/vishvananda/netlink.git")
5996 (commit (string-append "v" version))))
5997 (file-name (git-file-name name version))
6000 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6001 (build-system go-build-system)
6003 `(#:import-path "github.com/vishvananda/netlink"))
6005 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6006 ("go-netns" ,go-netns)))
6007 (home-page "https://github.com/vishvananda/netlink")
6008 (synopsis "Simple netlink library for Go")
6009 (description "The netlink package provides a simple netlink library for
6010 Go. Netlink is the interface a user-space program in Linux uses to
6011 communicate with the kernel. It can be used to add and remove interfaces, set
6012 IP addresses and routes, and configure IPsec.")
6013 (license license:asl2.0)))
6015 (define-public xfsprogs
6022 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6023 "xfsprogs-" version ".tar.gz"))
6026 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
6027 (build-system gnu-build-system)
6028 (outputs (list "out" "python"))
6030 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6032 (modify-phases %standard-phases
6033 (add-after 'install 'separate-python-output
6034 (lambda* (#:key outputs #:allow-other-keys)
6035 (let ((out (assoc-ref outputs "out"))
6036 (python (assoc-ref outputs "python")))
6039 (mkdir-p (string-append python (dirname script)))
6040 (rename-file (string-append out script)
6041 (string-append python script)))
6042 (list "/sbin/xfs_scrub_all"))
6044 (add-after 'install 'install-headers
6046 (invoke "make" "install-dev"))))))
6048 `(("gettext" ,gettext-minimal)))
6050 `(("libuuid" ,util-linux)
6051 ("python" ,python-wrapper)))
6052 (home-page "https://xfs.wiki.kernel.org/")
6053 (synopsis "XFS file system tools")
6054 (description "This package provides commands to create and check XFS
6056 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6057 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6058 (license (list license:gpl2 license:lgpl2.1))))
6060 (define-public genext2fs
6067 (url "https://github.com/jeremie-koenig/genext2fs.git")
6068 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6069 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6070 (file-name (git-file-name name version))
6072 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6073 (build-system gnu-build-system)
6076 (modify-phases %standard-phases
6077 (add-after 'unpack 'apply-debian-patches
6078 ;; Debian changes (the revision after ‘-’ in VERSION) are
6079 ;; maintained as separate patches. Apply those relevant to us.
6083 (invoke "patch" "-p1" "-i"
6084 (string-append "debian/patches/" file-name)))
6085 (list "blocksize+creator.diff" ; add -B/-o options
6086 "byteswap_fix.diff"))
6089 `(("autoconf" ,autoconf)
6090 ("automake" ,automake)))
6091 (home-page "https://github.com/jeremie-koenig/genext2fs")
6092 (synopsis "Generate ext2 file system as a normal user")
6093 (description "This package provides a program to generate an ext2
6094 file system as a normal (non-root) user. It does not require you to mount
6095 the image file to copy files on it, nor does it require that you become
6096 the superuser to make device nodes.")
6097 (license license:gpl2)))
6099 (define-public fakeroot
6105 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6106 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6107 (file-name (string-append name "-" version ".tar.gz"))
6110 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6111 (build-system gnu-build-system)
6114 (modify-phases %standard-phases
6115 (add-after 'configure 'patch-Makefile
6117 ;; Note: The root of the problem is already in "Makefile.am".
6118 (substitute* "Makefile"
6119 (("/bin/sh") (which "sh")))
6121 (add-after 'unpack 'patch-getopt
6122 (lambda* (#:key inputs #:allow-other-keys)
6123 (substitute* "scripts/fakeroot.in"
6125 (string-append (assoc-ref inputs "util-linux")
6128 (add-before 'configure 'setenv
6130 (setenv "LIBS" "-lacl")
6132 (add-before 'check 'prepare-check
6134 (setenv "SHELL" (which "bash"))
6135 (setenv "VERBOSE" "1")
6136 (substitute* "test/t.touchinstall"
6137 ;; We don't have the name of the root user, so use ID=0.
6138 (("grep root") "grep \"\\<0\\>\""))
6139 (substitute* "test/tartest"
6140 ;; We don't have the name of the root group, so use ID=0.
6141 (("ROOTGROUP=root") "ROOTGROUP=0")
6142 ;; We don't have the name of the daemon user, so use IDs.
6143 (("daemon:sys") "1:3")
6145 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6146 (substitute* "test/compare-tar"
6147 (("tar -tvf") "tar --numeric-owner -tvf"))
6151 ("sharutils" ,sharutils) ; for the tests
6152 ("xz" ,xz))) ; for the tests
6154 `(("libcap" ,libcap)
6155 ("util-linux" ,util-linux)))
6156 (synopsis "Provides a fake root environment")
6157 (description "@command{fakeroot} runs a command in an environment where
6158 it appears to have root privileges for file manipulation. This is useful
6159 for allowing users to create archives (tar, ar, .deb etc.) with files in
6160 them with root permissions/ownership. Without fakeroot one would have to
6161 have root privileges to create the constituent files of the archives with
6162 the correct permissions and ownership, and then pack them up, or one would
6163 have to construct the archives directly, without using the archiver.")
6164 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6165 (license license:gpl3+)))
6167 (define-public inputattach
6169 (name "inputattach")
6174 (url "https://github.com/linuxwacom/input-wacom.git")
6175 (commit (string-append "input-wacom-" version))))
6176 (file-name (git-file-name name version))
6178 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6179 (build-system gnu-build-system)
6182 (modify-phases %standard-phases
6186 (lambda* (#:key inputs #:allow-other-keys)
6187 (with-directory-excursion "inputattach"
6188 (invoke (string-append (assoc-ref inputs "gcc")
6190 "-O2" "-o" "inputattach" "inputattach.c"))
6194 (lambda* (#:key outputs #:allow-other-keys)
6195 (let ((target-dir (string-append
6196 (assoc-ref outputs "out")
6198 (mkdir-p target-dir)
6199 (copy-file "inputattach/inputattach"
6200 (string-append target-dir
6203 (home-page "https://linuxwacom.github.io/")
6204 (synopsis "Dispatch input peripherals events to a device file")
6205 (description "inputattach dispatches input events from several device
6206 types and interfaces and translates so that the X server can use them.")
6207 (license license:gpl2+)))
6209 (define-public pipewire
6216 (url "https://github.com/PipeWire/pipewire")
6218 (file-name (git-file-name name version))
6221 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
6222 (build-system meson-build-system)
6224 '(#:configure-flags '("-Dsystemd=false")))
6226 `(("pkg-config" ,pkg-config)))
6228 `(("alsa-lib" ,alsa-lib)
6232 ("gstreamer" ,gstreamer)
6233 ("gst-plugins-base" ,gst-plugins-base)
6237 (home-page "https://pipewire.org/")
6238 (synopsis "Server and user space API to deal with multimedia pipelines")
6240 "PipeWire is a project that aims to greatly improve handling of audio and
6241 video under Linux. It aims to support the usecases currently handled by both
6242 PulseAudio and Jack and at the same time provide same level of powerful handling
6243 of Video input and output. It also introduces a security model that makes
6244 interacting with audio and video devices from containerized applications easy,
6245 with supporting Flatpak applications being the primary goal. Alongside Wayland
6246 and Flatpak we expect PipeWire to provide a core building block for the future
6247 of Linux application development.")
6248 (license license:lgpl2.0+)))
6257 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6259 (file-name (git-file-name name version))
6262 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6263 (build-system gnu-build-system)
6266 (modify-phases %standard-phases
6267 (add-after 'unpack 'fix-dbus-tests
6269 (substitute* '("unit/test-dbus-message-fds.c"
6270 "unit/test-dbus-properties.c"
6272 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6276 ("libtool" ,libtool)))
6278 `(("autoconf" ,autoconf)
6279 ("pkgconfig" ,pkg-config)
6280 ("automake" ,automake)))
6281 (home-page "https://01.org/ell")
6282 (synopsis "Embedded Linux Library")
6283 (description "The Embedded Linux* Library (ELL) provides core, low-level
6284 functionality for system daemons. It typically has no dependencies other than
6285 the Linux kernel, C standard library, and libdl (for dynamic linking). While
6286 ELL is designed to be efficient and compact enough for use on embedded Linux
6287 platforms, it is not limited to resource-constrained systems.")
6288 (license license:lgpl2.1+)))