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 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-xyz)
91 #:use-module (gnu packages libunwind)
92 #:use-module (gnu packages libusb)
93 #:use-module (gnu packages man)
94 #:use-module (gnu packages maths)
95 #:use-module (gnu packages multiprecision)
96 #:use-module (gnu packages ncurses)
97 #:use-module (gnu packages netpbm)
98 #:use-module (gnu packages networking)
99 #:use-module (gnu packages ninja)
100 #:use-module (gnu packages nss)
101 #:use-module (gnu packages perl)
102 #:use-module (gnu packages pciutils)
103 #:use-module (gnu packages pkg-config)
104 #:use-module (gnu packages popt)
105 #:use-module (gnu packages pulseaudio)
106 #:use-module (gnu packages python)
107 #:use-module (gnu packages python-xyz)
108 #:use-module (gnu packages readline)
109 #:use-module (gnu packages rrdtool)
110 #:use-module (gnu packages samba)
111 #:use-module (gnu packages sdl)
112 #:use-module (gnu packages serialization)
113 #:use-module (gnu packages slang)
114 #:use-module (gnu packages texinfo)
115 #:use-module (gnu packages tls)
116 #:use-module (gnu packages valgrind)
117 #:use-module (gnu packages video)
118 #:use-module (gnu packages web)
119 #:use-module (gnu packages xiph)
120 #:use-module (gnu packages xml)
121 #:use-module (gnu packages xdisorg)
122 #:use-module (gnu packages xorg)
123 #:use-module (gnu packages groff)
124 #:use-module (gnu packages rsync)
125 #:use-module (gnu packages selinux)
126 #:use-module (gnu packages swig)
127 #:use-module (guix build-system cmake)
128 #:use-module (guix build-system gnu)
129 #:use-module (guix build-system go)
130 #:use-module (guix build-system meson)
131 #:use-module (guix build-system python)
132 #:use-module (guix build-system trivial)
133 #:use-module (guix build-system linux-module)
134 #:use-module (guix download)
135 #:use-module (guix git-download)
136 #:use-module ((guix licenses) #:prefix license:)
137 #:use-module (guix packages)
138 #:use-module (guix gexp)
139 #:use-module (guix store)
140 #:use-module (guix monads)
141 #:use-module (guix utils)
142 #:use-module (srfi srfi-1)
143 #:use-module (srfi srfi-2)
144 #:use-module (srfi srfi-26)
145 #:use-module (ice-9 match))
147 (define-public (system->linux-architecture arch)
148 "Return the Linux architecture name for ARCH, a Guix system name such as
149 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
150 (let ((arch (car (string-split arch #\-))))
151 (cond ((string=? arch "i686") "i386")
152 ((string-prefix? "mips" arch) "mips")
153 ((string-prefix? "arm" arch) "arm")
154 ((string-prefix? "aarch64" arch) "arm64")
155 ((string-prefix? "alpha" arch) "alpha")
156 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
157 ((string-prefix? "s390" arch) "s390")
158 ((string-prefix? "riscv" arch) "riscv")
161 (define-public (system->defconfig system)
162 "Some systems (notably powerpc-linux) require a special target for kernel
163 defconfig. Return the appropriate make target if applicable, otherwise return
165 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
166 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
171 ;;; Kernel source code deblobbing.
174 (define (linux-libre-deblob-scripts version
177 (list (version-major+minor version)
180 (uri (string-append "https://linux-libre.fsfla.org"
181 "/pub/linux-libre/releases/" version "-gnu/"
182 "deblob-" (version-major+minor version)))
183 (sha256 deblob-hash))
186 (uri (string-append "https://linux-libre.fsfla.org"
187 "/pub/linux-libre/releases/" version "-gnu/"
189 (sha256 deblob-check-hash))))
191 (define deblob-scripts-5.4
192 (linux-libre-deblob-scripts
194 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
195 (base32 "121px6030s89jh975sw0whwq315al6px1s7ildz3asql97bjdgc8")))
197 (define deblob-scripts-4.19
198 (linux-libre-deblob-scripts
200 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
201 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
203 (define deblob-scripts-4.14
204 (linux-libre-deblob-scripts
206 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
207 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
209 (define deblob-scripts-4.9
210 (linux-libre-deblob-scripts
212 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
213 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
215 (define deblob-scripts-4.4
216 (linux-libre-deblob-scripts
218 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
219 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
221 (define* (computed-origin-method gexp-promise hash-algo hash
222 #:optional (name "source")
223 #:key (system (%current-system))
224 (guile (default-guile)))
225 "Return a derivation that executes the G-expression that results
226 from forcing GEXP-PROMISE."
227 (mlet %store-monad ((guile (package->derivation guile system)))
228 (gexp->derivation (or name "computed-origin")
230 #:graft? #f ;nothing to graft
232 #:guile-for-build guile)))
234 (define (make-linux-libre-source version
237 "Return a 'computed' origin that generates a Linux-libre tarball from the
238 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
239 (match deblob-scripts
240 ((deblob-version (? origin? deblob) (? origin? deblob-check))
241 (unless (string=? deblob-version (version-major+minor version))
242 ;; The deblob script cannot be expected to work properly on a
243 ;; different version (major+minor) of Linux, even if no errors
244 ;; are signaled during execution.
245 (error "deblob major+minor version mismatch"))
247 (method computed-origin-method)
248 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
252 (with-imported-modules '((guix build utils))
254 (use-modules (guix build utils)
258 (let ((dir (string-append "linux-" #$version)))
261 (set-path-environment-variable
264 #+(canonical-package bash)
265 #+(canonical-package coreutils)
266 #+(canonical-package diffutils)
267 #+(canonical-package findutils)
268 #+(canonical-package patch)
269 #+(canonical-package xz)
270 #+(canonical-package sed)
271 #+(canonical-package grep)
272 #+(canonical-package bzip2)
273 #+(canonical-package gzip)
274 #+(canonical-package tar)
275 ;; The comments in the 'deblob-check' script
276 ;; claim that it supports Python 2 and 3, but
277 ;; in fact it fails when run in Python 3 as
281 (with-directory-excursion "/tmp/bin"
283 (copy-file #+deblob "deblob")
284 (chmod "deblob" #o755)
285 (substitute* "deblob"
286 (("/bin/sh") (which "sh")))
288 (copy-file #+deblob-check "deblob-check")
289 (chmod "deblob-check" #o755)
290 (substitute* "deblob-check"
291 (("/bin/sh") (which "sh"))
292 (("/bin/sed") (which "sed"))
293 (("/usr/bin/python") (which "python"))))
295 (if (file-is-directory? #+upstream-source)
297 (format #t "Copying upstream linux source...~%")
299 (invoke "cp" "--archive" #+upstream-source dir)
300 (invoke "chmod" "--recursive" "u+w" dir))
302 (format #t "Unpacking upstream linux tarball...~%")
304 (invoke "tar" "xf" #$upstream-source)
307 (and (not (member name '("." "..")))
308 (file-is-directory? name))))
310 (unless (string=? dir unpacked-dir)
311 (rename-file unpacked-dir dir)))
313 (error "multiple directories found" dirs)))))
315 (with-directory-excursion dir
316 (setenv "PYTHON" (which "python"))
317 (format #t "Running deblob script...~%")
319 (invoke "/tmp/bin/deblob"))
321 (format #t "~%Packing new Linux-libre tarball...~%")
323 (invoke "tar" "cvfa" #$output
324 ;; Avoid non-determinism in the archive.
337 (define (linux-libre-urls version)
338 "Return a list of URLs for Linux-Libre VERSION."
340 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
341 version "-gnu/linux-libre-" version "-gnu.tar.xz")
343 ;; XXX: Work around <http://bugs.gnu.org/14851>.
345 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
346 version "-gnu.tar.xz")
348 ;; Maybe this URL will become valid eventually.
350 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
351 version "-gnu.tar.xz")))
353 (define (%upstream-linux-source version hash)
356 (uri (string-append "mirror://kernel.org"
357 "/linux/kernel/v" (version-major version) ".x/"
358 "linux-" version ".tar.xz"))
361 (define-public linux-libre-5.4-version "5.4.16")
362 (define-public linux-libre-5.4-pristine-source
363 (let ((version linux-libre-5.4-version)
364 (hash (base32 "0ynspac26hn7pj8fahacvdlyq8kqin0hmfjiymi20y3l57gl25ci")))
365 (make-linux-libre-source version
366 (%upstream-linux-source version hash)
367 deblob-scripts-5.4)))
369 (define-public linux-libre-4.19-version "4.19.101")
370 (define-public linux-libre-4.19-pristine-source
371 (let ((version linux-libre-4.19-version)
372 (hash (base32 "1i4bkwankl5q95kgqmmyzdkwmf3b8ppkb8ild9bw12mkpmm1a9my")))
373 (make-linux-libre-source version
374 (%upstream-linux-source version hash)
375 deblob-scripts-4.19)))
377 (define-public linux-libre-4.14-version "4.14.169")
378 (define-public linux-libre-4.14-pristine-source
379 (let ((version linux-libre-4.14-version)
380 (hash (base32 "0jc24zvqz3vsv65xxcivzkj6nv27vsy62l50n2h1ysy5jdwsk3nq")))
381 (make-linux-libre-source version
382 (%upstream-linux-source version hash)
383 deblob-scripts-4.14)))
385 (define-public linux-libre-4.9-version "4.9.212")
386 (define-public linux-libre-4.9-pristine-source
387 (let ((version linux-libre-4.9-version)
388 (hash (base32 "0c5yjilaq86j6i2hzlxbp2ia7jhnf7kv952ffv7jxdf90sk3irxd")))
389 (make-linux-libre-source version
390 (%upstream-linux-source version hash)
391 deblob-scripts-4.9)))
393 (define-public linux-libre-4.4-version "4.4.212")
394 (define-public linux-libre-4.4-pristine-source
395 (let ((version linux-libre-4.4-version)
396 (hash (base32 "0mx3qyj6w6h7gw7drsfsgl4iyz1695sjnf9hqh4kczci48kw5rj7")))
397 (make-linux-libre-source version
398 (%upstream-linux-source version hash)
399 deblob-scripts-4.4)))
401 (define %boot-logo-patch
402 ;; Linux-Libre boot logo featuring Freedo and a gnu.
405 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
406 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
409 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
411 (define %linux-libre-arm-export-__sync_icache_dcache-patch
415 "https://salsa.debian.org/kernel-team/linux"
416 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
417 "/debian/patches/bugfix/arm/"
418 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
419 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
421 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
423 (define (source-with-patches source patches)
426 (patches (append (origin-patches source)
429 (define-public linux-libre-5.4-source
430 (source-with-patches linux-libre-5.4-pristine-source
431 (list %boot-logo-patch
432 %linux-libre-arm-export-__sync_icache_dcache-patch)))
434 (define-public linux-libre-4.19-source
435 (source-with-patches linux-libre-4.19-pristine-source
436 (list %boot-logo-patch
437 %linux-libre-arm-export-__sync_icache_dcache-patch)))
439 (define-public linux-libre-4.14-source
440 (source-with-patches linux-libre-4.14-pristine-source
441 (list %boot-logo-patch)))
443 (define-public linux-libre-4.9-source
444 (source-with-patches linux-libre-4.9-pristine-source
445 (list %boot-logo-patch)))
447 (define-public linux-libre-4.4-source
448 (source-with-patches linux-libre-4.4-pristine-source
449 (list %boot-logo-patch)))
456 (define (make-linux-libre-headers version hash-string)
457 (make-linux-libre-headers* version
460 (uri (linux-libre-urls version))
461 (sha256 (base32 hash-string)))))
463 (define (make-linux-libre-headers* version source)
465 (name "linux-libre-headers")
468 (build-system gnu-build-system)
469 (native-inputs `(("perl" ,perl)
470 ,@(if (version>=? version "4.16")
474 ,@(if (version>=? version "5.3")
478 `(#:modules ((guix build gnu-build-system)
482 (modify-phases %standard-phases
486 (let ((arch ,(system->linux-architecture
487 (or (%current-target-system)
489 (defconfig ,(system->defconfig
490 (or (%current-target-system)
491 (%current-system)))))
493 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
494 (invoke "make" defconfig)
495 (invoke "make" "mrproper" "headers_check"))))
497 (lambda* (#:key outputs #:allow-other-keys)
498 (let ((out (assoc-ref outputs "out")))
500 (string-append "INSTALL_HDR_PATH=" out)
503 (mkdir (string-append out "/include/config"))
504 (call-with-output-file
506 "/include/config/kernel.release")
508 (format p "~a-default~%" ,version)))
510 ;; Remove the '.install' and '..install.cmd' files; the
511 ;; latter contains store paths, which pulls in bootstrap
512 ;; binaries in the build environment, and prevents bit
513 ;; reproducibility for the bootstrap binaries.
514 (for-each delete-file (find-files out "\\.install"))
517 #:allowed-references ()
519 (home-page "https://www.gnu.org/software/linux-libre/")
520 (synopsis "GNU Linux-Libre kernel headers")
521 (description "Headers of the Linux-Libre kernel.")
522 (license license:gpl2)))
524 (define-public linux-libre-headers-5.4
525 (make-linux-libre-headers* linux-libre-5.4-version
526 linux-libre-5.4-source))
528 (define-public linux-libre-headers-4.19
529 (make-linux-libre-headers* linux-libre-4.19-version
530 linux-libre-4.19-source))
532 (define-public linux-libre-headers-4.14
533 (make-linux-libre-headers* linux-libre-4.14-version
534 linux-libre-4.14-source))
536 (define-public linux-libre-headers-4.9
537 (make-linux-libre-headers* linux-libre-4.9-version
538 linux-libre-4.9-source))
540 (define-public linux-libre-headers-4.4
541 (make-linux-libre-headers* linux-libre-4.4-version
542 linux-libre-4.4-source))
544 ;; The following package is used in the early bootstrap, and thus must be kept
545 ;; stable and with minimal build requirements.
546 (define-public linux-libre-headers-4.19.56
547 (make-linux-libre-headers "4.19.56"
548 "1zqiic55viy065lhnkmhn33sz3bbbr2ykbm5f92yzd8lpc9zl7yx"))
550 (define-public linux-libre-headers linux-libre-headers-4.19.56)
554 ;;; Kernel configurations.
557 (define* (kernel-config arch #:key variant)
558 "Return the absolute file name of the Linux-Libre build configuration file
559 for ARCH and optionally VARIANT, or #f if there is no such configuration."
560 (let* ((name (string-append (if variant (string-append variant "-") "")
561 (if (string=? "i386" arch) "i686" arch) ".conf"))
562 (file (string-append "linux-libre/" name)))
563 (search-auxiliary-file file)))
565 ;; FIXME: merge into kernel-config
566 (define* (kernel-config-veyron arch #:key variant)
567 "Return the absolute file name of the Linux-Libre build configuration file
568 for ARCH and optionally VARIANT, or #f if there is no such configuration."
569 (let* ((name (string-append (if variant (string-append variant "-") "")
570 (if (string=? "i386" arch) "i686" arch) "-veyron.conf"))
571 (file (string-append "linux-libre/" name)))
572 (search-auxiliary-file file)))
574 (define %default-extra-linux-options
575 `(;; Some very mild hardening.
576 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
577 ;; All kernels should have NAMESPACES options enabled
578 ("CONFIG_NAMESPACES" . #t)
579 ("CONFIG_UTS_NS" . #t)
580 ("CONFIG_IPC_NS" . #t)
581 ("CONFIG_USER_NS" . #t)
582 ("CONFIG_PID_NS" . #t)
583 ("CONFIG_NET_NS" . #t)
584 ;; Modules required for initrd:
585 ("CONFIG_NET_9P" . m)
586 ("CONFIG_NET_9P_VIRTIO" . m)
587 ("CONFIG_VIRTIO_BLK" . m)
588 ("CONFIG_VIRTIO_NET" . m)
589 ("CONFIG_VIRTIO_PCI" . m)
590 ("CONFIG_VIRTIO_BALLOON" . m)
591 ("CONFIG_VIRTIO_MMIO" . m)
592 ("CONFIG_FUSE_FS" . m)
594 ("CONFIG_9P_FS" . m)))
596 (define (config->string options)
597 (string-join (map (match-lambda
599 (string-append option "=m"))
601 (string-append option "=y"))
603 (string-append option "=n")))
609 ;;; Kernel package utilities.
612 (define* (make-linux-libre version hash-string supported-systems
614 ;; A function that takes an arch and a variant.
615 ;; See kernel-config for an example.
617 (configuration-file #f)
618 (defconfig "defconfig")
619 (extra-options %default-extra-linux-options)
620 (patches (list %boot-logo-patch)))
621 (make-linux-libre* version
624 (uri (linux-libre-urls version))
625 (sha256 (base32 hash-string))
628 #:extra-version extra-version
629 #:configuration-file configuration-file
630 #:defconfig defconfig
631 #:extra-options extra-options))
633 (define* (make-linux-libre* version source supported-systems
635 ;; A function that takes an arch and a variant.
636 ;; See kernel-config for an example.
638 (configuration-file #f)
639 (defconfig "defconfig")
640 (extra-options %default-extra-linux-options))
642 (name (if extra-version
643 (string-append "linux-libre-" extra-version)
647 (supported-systems supported-systems)
648 (build-system gnu-build-system)
654 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
658 ;; These are needed to compile the GCC plugins.
663 ,@(match (and configuration-file
665 (system->linux-architecture
666 (or (%current-target-system) (%current-system)))
667 #:variant (version-major+minor version)))
668 (#f ;no config for this platform
671 `(("kconfig" ,config))))))
673 `(#:modules ((guix build gnu-build-system)
679 (modify-phases %standard-phases
680 (add-after 'unpack 'patch-/bin/pwd
682 (substitute* (find-files "." "^Makefile(\\.include)?$")
683 (("/bin/pwd") "pwd"))
686 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
687 ;; On AArch64 (at least), we need to remove glibc headers from
688 ;; CPATH (they are still available as "system headers"), so that
689 ;; the kernel can override uint64_t. See
690 ;; <https://bugs.gnu.org/37593>. This is also true when
691 ;; cross-compiling, except in that case, cross-libc must be
692 ;; removed from CROSS_CPATH.
693 (let ((var ,(if (%current-target-system)
696 (libc ,(if (%current-target-system)
702 (cut string-prefix? (assoc-ref inputs libc) <>)
703 (string-split (getenv var) #\:))
705 (format #t "environment variable `~a' changed to `~a'~%"
708 ;; Avoid introducing timestamps
709 (setenv "KCONFIG_NOTIMESTAMP" "1")
710 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
712 ;; Set ARCH and CROSS_COMPILE
713 (let ((arch ,(system->linux-architecture
714 (or (%current-target-system)
715 (%current-system)))))
717 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
720 (setenv "CROSS_COMPILE" (string-append target "-"))
721 (format #t "`CROSS_COMPILE' set to `~a'~%"
722 (getenv "CROSS_COMPILE"))))
724 (setenv "EXTRA_VERSION" ,extra-version)
726 (let ((build (assoc-ref %standard-phases 'build))
727 (config (assoc-ref (or native-inputs inputs) "kconfig")))
729 ;; Use a custom kernel configuration file or a default
730 ;; configuration file.
733 (copy-file config ".config")
734 (chmod ".config" #o666))
735 (invoke "make" ,defconfig))
737 ;; Appending works even when the option wasn't in the
738 ;; file. The last one prevails if duplicated.
739 (let ((port (open-file ".config" "a"))
740 (extra-configuration ,(config->string extra-options)))
741 (display extra-configuration port)
744 (invoke "make" "oldconfig"))))
746 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
747 (let* ((out (assoc-ref outputs "out"))
748 (moddir (string-append out "/lib/modules"))
749 (dtbdir (string-append out "/lib/dtbs"))
750 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
751 ;; Install kernel image, kernel configuration and link map.
752 (for-each (lambda (file) (install-file file out))
753 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
754 ;; Install device tree files
755 (unless (null? (find-files "." "\\.dtb$"))
757 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
759 ;; Install kernel modules
762 (string-append "DEPMOD=" kmod "/bin/depmod")
763 (string-append "MODULE_DIR=" moddir)
764 (string-append "INSTALL_PATH=" out)
765 (string-append "INSTALL_MOD_PATH=" out)
766 "INSTALL_MOD_STRIP=1"
767 "modules_install")))))
769 (home-page "https://www.gnu.org/software/linux-libre/")
770 (synopsis "100% free redistribution of a cleaned Linux kernel")
772 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
773 It has been modified to remove all non-free binary blobs.")
774 (license license:gpl2)))
778 ;;; Generic kernel packages.
781 (define-public linux-libre-5.4
782 (make-linux-libre* linux-libre-5.4-version
783 linux-libre-5.4-source
784 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
785 #:configuration-file kernel-config))
787 (define-public linux-libre-version linux-libre-5.4-version)
788 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
789 (define-public linux-libre-source linux-libre-5.4-source)
790 (define-public linux-libre linux-libre-5.4)
792 (define-public linux-libre-4.19
793 (make-linux-libre* linux-libre-4.19-version
794 linux-libre-4.19-source
795 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
796 #:configuration-file kernel-config))
798 (define-public linux-libre-4.14
799 (make-linux-libre* linux-libre-4.14-version
800 linux-libre-4.14-source
801 '("x86_64-linux" "i686-linux" "armhf-linux")
802 #:configuration-file kernel-config))
804 (define-public linux-libre-4.9
805 (make-linux-libre* linux-libre-4.9-version
806 linux-libre-4.9-source
807 '("x86_64-linux" "i686-linux")
808 #:configuration-file kernel-config))
810 (define-public linux-libre-4.4
811 (make-linux-libre* linux-libre-4.4-version
812 linux-libre-4.4-source
813 '("x86_64-linux" "i686-linux")
814 #:configuration-file kernel-config
817 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
818 ;; This option was removed upstream in version 4.7.
819 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
820 %default-extra-linux-options)))
824 ;;; Specialized kernel variants.
827 (define-public linux-libre-arm-veyron
828 (make-linux-libre* linux-libre-version
831 #:configuration-file kernel-config-veyron
832 #:extra-version "arm-veyron"))
834 (define-public linux-libre-arm-generic
835 (make-linux-libre* linux-libre-version
838 #:defconfig "multi_v7_defconfig"
839 #:extra-version "arm-generic"))
841 (define-public linux-libre-arm-generic-4.19
842 (make-linux-libre* linux-libre-4.19-version
843 linux-libre-4.19-source
845 #:defconfig "multi_v7_defconfig"
846 #:extra-version "arm-generic"))
848 (define-public linux-libre-arm-generic-4.14
849 (make-linux-libre* linux-libre-4.14-version
850 linux-libre-4.14-source
852 #:defconfig "multi_v7_defconfig"
853 #:extra-version "arm-generic"))
855 (define-public linux-libre-arm-omap2plus
856 (make-linux-libre* linux-libre-version
859 #:defconfig "omap2plus_defconfig"
860 #:extra-version "arm-omap2plus"))
862 (define-public linux-libre-arm-omap2plus-4.19
863 (make-linux-libre* linux-libre-4.19-version
864 linux-libre-4.19-source
866 #:defconfig "omap2plus_defconfig"
867 #:extra-version "arm-omap2plus"))
869 (define-public linux-libre-arm-omap2plus-4.14
870 (make-linux-libre* linux-libre-4.14-version
871 linux-libre-4.14-source
873 #:defconfig "omap2plus_defconfig"
874 #:extra-version "arm-omap2plus"))
878 ;;; Linux kernel modules.
881 (define-public acpi-call-linux-module
883 (name "acpi-call-linux-module")
889 (url "https://github.com/teleshoes/acpi_call.git")
891 (file-name (git-file-name name version))
893 (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
894 (build-system linux-module-build-system)
896 `(#:tests? #f ; no tests
898 (modify-phases %standard-phases
899 (add-after 'unpack 'fix-for-linux-4.12
901 (substitute* "acpi_call.c"
905 (add-after 'install 'install-documentation
906 (lambda* (#:key outputs #:allow-other-keys)
907 (let* ((out (assoc-ref outputs "out"))
908 (doc (string-append out "/share/doc/" ,name "-" ,version)))
909 (for-each (lambda (file)
910 (let ((target (string-append doc "/" file)))
911 (mkdir-p (dirname target))
912 (copy-recursively file target)))
913 (list "README.md" "examples"))
915 (home-page "https://github.com/teleshoes/acpi_call")
916 (synopsis "Linux kernel module to perform ACPI method calls")
918 "This simple Linux kernel module allows calls from user space to any
919 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
920 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
921 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
922 and @code{ACPI_BUFFER}.
924 It grants direct and undocumented access to your hardware that may cause damage
925 and should be used with caution, especially on untested models.")
926 (license license:gpl3+))) ; see README.md (no licence headers)
928 (define-public vhba-module
935 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
939 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
940 (build-system linux-module-build-system)
944 (home-page "https://cdemu.sourceforge.io/")
945 (synopsis "Kernel module that emulates SCSI devices")
946 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
947 between the CDemu userspace daemon and linux kernel.")
948 (license license:gpl2+)))
950 (define-public ddcci-driver-linux
952 (name "ddcci-driver-linux")
959 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
960 (commit (string-append "v" version))))
961 (file-name (git-file-name name version))
964 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
965 (build-system linux-module-build-system)
967 `(#:tests? #f ; no tests
969 (modify-phases %standard-phases
974 (with-directory-excursion module
975 (apply (assoc-ref %standard-phases 'build) args)))
976 '("ddcci" "ddcci-backlight"))
982 (with-directory-excursion module
983 (apply (assoc-ref %standard-phases 'install) args)))
984 '("ddcci" "ddcci-backlight"))
986 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
987 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
988 (description "This package provides two Linux kernel drivers, ddcci and
989 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
990 interface. The ddcci module creates a character device for each DDC/CI
991 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
992 module allows the control of the backlight level or luminance property when
993 supported under @file{/sys/class/backlight/}.")
994 (license license:gpl2+)))
998 ;;; Pluggable authentication modules (PAM).
1001 (define-public linux-pam
1009 "https://github.com/linux-pam/linux-pam/releases/download/v"
1010 version "/Linux-PAM-" version ".tar.xz"))
1013 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1014 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1016 (build-system gnu-build-system)
1020 ;; TODO: optional dependencies
1021 ;; ("libxcrypt" ,libxcrypt)
1022 ;; ("cracklib" ,cracklib)
1025 `(;; Most users, such as `shadow', expect the headers to be under
1027 #:configure-flags (list (string-append "--includedir="
1028 (assoc-ref %outputs "out")
1029 "/include/security")
1031 ;; XXX: <rpc/rpc.h> is missing from glibc when
1032 ;; cross-compiling, so we have to disable NIS
1033 ;; support altogether.
1034 ,@(if (%current-target-system)
1038 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1041 (home-page "http://www.linux-pam.org/")
1042 (synopsis "Pluggable authentication modules for Linux")
1044 "A *Free* project to implement OSF's RFC 86.0.
1045 Pluggable authentication modules are small shared object files that can
1046 be used through the PAM API to perform tasks, like authenticating a user
1047 at login. Local and dynamic reconfiguration are its key features.")
1048 (license license:bsd-3)))
1050 (define-public linux-pam-1.2
1058 "http://www.linux-pam.org/library/"
1059 "Linux-PAM-" version ".tar.bz2"))
1062 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1063 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1070 (define-public psmisc
1077 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1080 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1081 (build-system gnu-build-system)
1083 `(,@(if (%current-target-system)
1086 "ac_cv_func_malloc_0_nonnull=yes"
1087 "ac_cv_func_realloc_0_nonnull=yes"))
1089 (inputs `(("ncurses" ,ncurses)))
1090 (home-page "https://gitlab.com/psmisc/psmisc")
1091 (synopsis "Small utilities that use the proc file system")
1093 "This PSmisc package is a set of some small useful utilities that
1094 use the proc file system. We're not about changing the world, but
1095 providing the system administrator with some help in common tasks.")
1096 (license license:gpl2+)))
1098 (define-public util-linux
1104 (uri (string-append "mirror://kernel.org/linux/utils/"
1105 "util-linux/v" (version-major+minor version) "/"
1106 "util-linux-" version ".tar.xz"))
1109 "1db2kydkwjmvgd1glkcba3adhidxw0f1x735dcjdpdjjf869sgvl"))
1110 (patches (search-patches "util-linux-tests.patch"))
1111 (modules '((guix build utils)))
1113 ;; We take 'nologin' from Shadow, the 'logger' program from
1114 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1116 (substitute* "configure"
1117 (("build_nologin=yes") "build_nologin=no")
1118 (("build_logger=yes") "build_logger=no")
1119 (("build_kill=yes") "build_kill=no"))
1121 (build-system gnu-build-system)
1123 "static")) ;>2 MiB of static .a libraries
1125 `(#:configure-flags (list "--disable-use-tty-group"
1126 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1127 ;; Don't try to chown root:root mount and umount
1128 "--disable-makeinstall-chown"
1129 ;; Install completions where our
1130 ;; bash-completion package expects them.
1131 (string-append "--with-bashcompletiondir="
1132 (assoc-ref %outputs "out")
1133 "/etc/bash_completion.d"))
1134 #:phases (modify-phases %standard-phases
1135 (add-before 'build 'set-umount-file-name
1136 (lambda* (#:key outputs #:allow-other-keys)
1137 ;; Tell 'eject' the right file name of 'umount'.
1138 (let ((out (assoc-ref outputs "out")))
1139 (substitute* "sys-utils/eject.c"
1140 (("\"/bin/umount\"")
1141 (string-append "\"" out "/bin/umount\"")))
1143 (add-before 'check 'pre-check
1144 (lambda* (#:key inputs outputs #:allow-other-keys)
1145 (let ((out (assoc-ref outputs "out"))
1146 (net (assoc-ref inputs "net-base")))
1147 ;; Change the test to refer to the right file.
1148 (substitute* "tests/ts/misc/mcookie"
1150 (string-append net "/etc/services")))
1152 (add-after 'install 'move-static-libraries
1153 (lambda* (#:key outputs #:allow-other-keys)
1154 (let ((out (assoc-ref outputs "out"))
1155 (static (assoc-ref outputs "static")))
1156 (mkdir-p (string-append static "/lib"))
1157 (with-directory-excursion out
1158 (for-each (lambda (file)
1160 (string-append static "/"
1162 (find-files "lib" "\\.a$"))
1164 ;; Remove references to the static library from the '.la'
1165 ;; files so that Libtool does the right thing when both
1166 ;; the shared and static library is available.
1167 (substitute* (find-files "lib" "\\.la$")
1168 (("old_library=.*") "old_library=''\n")))
1171 (inputs `(("zlib" ,zlib)
1172 ("ncurses" ,ncurses)
1174 ;; XXX: This is so that the 'pre-check' phase can find it.
1175 ,@(if (%current-target-system)
1176 `(("net-base" ,net-base))
1180 ("net-base" ,net-base))) ;for tests
1181 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1182 (synopsis "Collection of utilities for the Linux kernel")
1183 (description "Util-linux is a diverse collection of Linux kernel
1184 utilities. It provides dmesg and includes tools for working with file systems,
1185 block devices, UUIDs, TTYs, and many other tools.")
1187 ;; Note that util-linux doesn't use the same license for all the
1188 ;; code. GPLv2+ is the default license for a code without an
1189 ;; explicitly defined license.
1190 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1191 license:bsd-4 license:public-domain))))
1193 ;; util-linux optionally supports udev, which allows lsblk to read file system
1194 ;; metadata without special privileges. Add it as a separate package to avoid
1195 ;; a circular dependency, and to keep the size small.
1196 (define-public util-linux+udev
1199 (name "util-linux-with-udev")
1202 ,@(package-inputs util-linux)))))
1204 (define-public ddate
1210 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1212 (file-name (string-append name "-" version ".tar.gz"))
1214 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1215 (build-system cmake-build-system)
1216 (arguments '(#:tests? #f))
1217 (home-page "https://github.com/bo0ts/ddate")
1218 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1220 "ddate displays the Discordian date and holidays of a given date.
1221 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1222 by Robert Shea and Robert Anton Wilson.")
1223 (license license:public-domain)))
1225 (define-public procps
1231 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1232 "procps-ng-" version ".tar.xz"))
1235 "0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
1236 (build-system gnu-build-system)
1238 '(#:modules ((guix build utils)
1239 (guix build gnu-build-system)
1243 (modify-phases %standard-phases
1245 'install 'post-install
1246 ;; Remove commands and man pages redudant with
1248 (lambda* (#:key outputs #:allow-other-keys)
1249 (let* ((out (assoc-ref outputs "out"))
1250 (dup (append-map (cut find-files out <>)
1251 '("^kill" "^uptime"))))
1252 (for-each delete-file dup)
1254 (inputs `(("ncurses" ,ncurses)))
1255 (home-page "https://gitlab.com/procps-ng/procps/")
1256 (synopsis "Utilities that give information about processes")
1258 "Procps is the package that has a bunch of small useful utilities
1259 that give information about processes using the Linux /proc file system.
1260 The package includes the programs ps, top, vmstat, w, kill, free,
1261 slabtop, and skill.")
1262 (license license:gpl2)))
1264 (define-public usbutils
1271 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1272 "usbutils-" version ".tar.xz"))
1274 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1275 (build-system gnu-build-system)
1276 (outputs (list "out" "python"))
1279 (modify-phases %standard-phases
1280 (add-before 'bootstrap 'patch-bootstrap-scripts
1282 (substitute* "usbhid-dump/bootstrap"
1283 (("/bin/bash") (which "bash")))
1285 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1286 (substitute* "autogen.sh"
1287 (("^\\./configure.*") ""))
1289 (add-after 'install 'separate-python-output
1290 ;; Separating one Python script shaves more than 106 MiB from :out.
1291 (lambda* (#:key outputs #:allow-other-keys)
1292 (let ((out (assoc-ref outputs "out"))
1293 (out:python (assoc-ref outputs "python")))
1294 (for-each (lambda (file)
1295 (let ((old (string-append out "/" file))
1296 (new (string-append out:python "/" file)))
1297 (mkdir-p (dirname new))
1298 (rename-file old new)))
1299 (list "bin/lsusb.py"))
1304 ("python" ,python)))
1306 `(("autoconf" ,autoconf)
1307 ("automake" ,automake)
1308 ("libtool" ,libtool)
1309 ("pkg-config" ,pkg-config)))
1310 (home-page "http://www.linux-usb.org/")
1312 "Tools for working with USB devices, such as lsusb")
1314 "Tools for working with USB devices, such as lsusb.")
1315 (license license:gpl2+)))
1317 (define-public e2fsprogs
1324 "mirror://kernel.org/linux/kernel/people/tytso/"
1325 name "/v" version "/"
1326 name "-" version ".tar.xz"))
1329 "1pmf8inp736l587rqq7qsd8bv0mmg5cwrivxg5p5awqgv70crypr"))))
1330 (build-system gnu-build-system)
1331 (inputs `(("util-linux" ,util-linux)))
1332 (native-inputs `(("pkg-config" ,pkg-config)
1333 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1337 ("procps" ,procps)))
1339 '(;; util-linux is the preferred source for some of the libraries and
1340 ;; commands, so disable them (see, e.g.,
1341 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1342 #:configure-flags (list "--disable-libblkid"
1343 "--disable-libuuid" "--disable-uuidd"
1346 ;; Use symlinks instead of hard links for
1347 ;; 'fsck.extN' etc. This makes the resulting nar
1348 ;; smaller and is preserved across copies.
1349 "--enable-symlink-install"
1351 (string-append "LDFLAGS=-Wl,-rpath="
1352 (assoc-ref %outputs "out")
1355 ;; Install libext2fs et al.
1356 "--enable-elf-shlibs")
1359 (modify-phases %standard-phases
1360 (add-before 'configure 'patch-shells
1362 (substitute* "configure"
1363 (("/bin/sh (.*)parse-types.sh" _ dir)
1364 (string-append (which "sh") " " dir
1366 (substitute* "MCONFIG.in"
1367 (("INSTALL_SYMLINK = /bin/sh")
1368 "INSTALL_SYMLINK = sh"))
1369 (substitute* (find-files "." "^Makefile.in$")
1371 (string-append "#!" (which "sh"))))
1373 (add-after 'install 'install-libs
1374 (lambda* (#:key outputs #:allow-other-keys)
1375 (let* ((out (assoc-ref outputs "out"))
1376 (lib (string-append out "/lib")))
1377 (invoke "make" "install-libs")
1379 ;; Make the .a writable so that 'strip' works.
1380 ;; Failing to do that, due to debug symbols, we
1381 ;; retain a reference to the final
1382 ;; linux-libre-headers, which refer to the
1383 ;; bootstrap binaries.
1384 (let ((archives (find-files lib "\\.a$")))
1385 (for-each (lambda (file)
1389 (home-page "http://e2fsprogs.sourceforge.net/")
1390 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1392 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1393 (license (list license:gpl2 ;programs
1394 license:lgpl2.0 ;libext2fs
1395 license:x11)))) ;libuuid
1397 (define e2fsprogs/static
1399 (package (inherit e2fsprogs)
1401 ;; Do not build shared libraries.
1402 (substitute-keyword-arguments (package-arguments e2fsprogs)
1403 ((#:configure-flags _)
1404 '(list "--disable-blkid"))
1408 (define-public e2fsck/static
1410 (name "e2fsck-static")
1411 (version (package-version e2fsprogs))
1412 (build-system trivial-build-system)
1415 `(("e2fsprogs" ,e2fsprogs/static)))
1417 `(#:modules ((guix build utils))
1420 (use-modules (guix build utils)
1424 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1426 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1428 (with-directory-excursion bin
1429 (copy-file e2fsck "e2fsck")
1430 (remove-store-references "e2fsck")
1431 (chmod "e2fsck" #o555))
1433 (home-page (package-home-page e2fsprogs))
1434 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1435 (description "This package provides statically-linked e2fsck command taken
1436 from the e2fsprogs package. It is meant to be used in initrds.")
1437 (license (package-license e2fsprogs))))
1439 (define-public extundelete
1441 (name "extundelete")
1446 (uri (string-append "mirror://sourceforge/extundelete/"
1447 "extundelete/" version "/extundelete-"
1448 version ".tar.bz2"))
1451 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1452 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1453 (build-system gnu-build-system)
1454 (inputs `(("e2fsprogs" ,e2fsprogs)))
1455 (home-page "http://extundelete.sourceforge.net/")
1456 (synopsis "Recover deleted files from ext2/3/4 partitions")
1458 "Extundelete is a set of tools that can recover deleted files from an
1459 ext3 or ext4 partition.")
1460 (license license:gpl2)))
1462 (define-public zerofree
1466 (home-page "https://frippery.org/uml/")
1469 (uri (string-append home-page name "-" version
1473 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1474 (build-system gnu-build-system)
1477 (modify-phases %standard-phases
1478 (delete 'configure) ; no configure script
1480 ;; The Makefile lacks an ‘install’ target.
1481 (lambda* (#:key outputs #:allow-other-keys)
1482 (let* ((out (assoc-ref outputs "out"))
1483 (bin (string-append out "/bin")))
1484 (chmod "zerofree" #o555)
1485 (install-file "zerofree" bin)
1487 #:tests? #f)) ; no tests
1488 (inputs `(("libext2fs" ,e2fsprogs)))
1489 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1491 "Zerofree finds the unallocated blocks with non-zero value content in an
1492 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1493 This is a simple way to make disk images more compressible.
1494 Zerofree requires the file system to be unmounted or mounted read-only.")
1495 (license license:gpl2)))
1497 (define-public strace
1501 (home-page "https://strace.io")
1504 (uri (string-append home-page "/files/" version
1505 "/strace-" version ".tar.xz"))
1508 "0hd7sb7l99y9rcj8jjc1b6m3ryds17krsymdg3dvd40jsla0bl7p"))))
1509 (build-system gnu-build-system)
1512 (modify-phases %standard-phases
1513 (add-after 'unpack 'patch-/bin/sh
1515 (substitute* "strace.c"
1516 (("/bin/sh") (which "sh")))
1518 ;; Don't fail if the architecture doesn't support different personalities.
1519 #:configure-flags '("--enable-mpers=check")
1520 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1521 #:parallel-tests? #f)) ; undeterministic failures
1522 (native-inputs `(("perl" ,perl)))
1523 (synopsis "System call tracer for Linux")
1525 "strace is a system call tracer, i.e. a debugging tool which prints out a
1526 trace of all the system calls made by a another process/program.")
1527 (license license:lgpl2.1+)))
1529 (define-public ltrace
1535 (uri (string-append "http://www.ltrace.org/ltrace_" version
1539 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1540 (build-system gnu-build-system)
1541 (inputs `(("libelf" ,libelf)))
1543 ;; Compilation uses -Werror by default, but it fails.
1544 '(#:configure-flags '("--disable-werror")))
1545 (home-page "https://www.ltrace.org/")
1546 (synopsis "Library call tracer for Linux")
1548 "ltrace intercepts and records dynamic library calls which are called by
1549 an executed process and the signals received by that process. It can also
1550 intercept and print the system calls executed by the program.")
1551 (license license:gpl2+)))
1553 (define-public alsa-lib
1560 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1561 version ".tar.bz2"))
1564 "0hvrx0ipzqbcx4y1cmr9bgm9niifzkrhsb1ddgzzdwbk6q72d3lm"))))
1565 (build-system gnu-build-system)
1567 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1568 (assoc-ref %outputs "out")
1570 (home-page "https://www.alsa-project.org/")
1571 (synopsis "The Advanced Linux Sound Architecture libraries")
1573 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1574 MIDI functionality to the Linux-based operating system.")
1575 (license license:lgpl2.1+)))
1577 (define-public alsa-utils
1583 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1584 name "-" version ".tar.bz2"))
1587 "039c19b7091is0czl9jlrfczp7pp1jpdri0vvc4k07gl3skhn48b"))))
1588 (build-system gnu-build-system)
1590 ;; XXX: Disable man page creation until we have DocBook.
1591 '(#:configure-flags (list "--disable-xmlto"
1593 ;; The udev rule is responsible for restoring
1595 (string-append "--with-udev-rules-dir="
1596 (assoc-ref %outputs "out")
1597 "/lib/udev/rules.d"))
1599 (modify-phases %standard-phases
1600 (add-before 'check 'disable-broken-test
1602 ;; XXX: The 1.1.8 release tarball is missing a header that's
1603 ;; required for this test to work. Fixed in 1.1.9.
1604 (substitute* "axfer/test/Makefile"
1605 ((".*container-test.*") ""))
1608 'install 'pre-install
1610 ;; Don't try to mkdir /var/lib/alsa.
1611 (substitute* "Makefile"
1612 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1616 `(("libsamplerate" ,libsamplerate)
1617 ("ncurses" ,ncurses)
1618 ("alsa-lib" ,alsa-lib)
1620 ("gettext" ,gettext-minimal)))
1621 (home-page "http://www.alsa-project.org/")
1622 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1624 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1625 MIDI functionality to the Linux-based operating system.")
1627 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1629 (license license:gpl2)))
1631 (define-public alsa-plugins
1633 (name "alsa-plugins")
1637 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1638 name "-" version ".tar.bz2"))
1641 "1nj8cpbi05rb62yzs01c1k7lymdn1ch229b599hbhd0psixdx52d"))))
1642 (build-system gnu-build-system)
1643 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1644 ;; be split, there are references to both in files.
1645 ;; TODO: Remove OSS related plugins, they add support to run native
1646 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1648 (outputs '("out" "pulseaudio" "jack"))
1650 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1651 ;; for /etc/alsa. On Guix System plugins are loaded from
1652 ;; the ALSA service, and other distributions likely
1653 ;; won't use these files.
1654 "--with-alsalconfdir=/tmp/noop")
1656 (modify-phases %standard-phases
1657 (add-after 'install 'split
1658 (lambda* (#:key inputs outputs #:allow-other-keys)
1659 ;; Distribute the binaries to the various outputs.
1660 (let* ((out (assoc-ref outputs "out"))
1661 (jack (assoc-ref outputs "jack"))
1662 (jacklib (string-append jack "/lib/alsa-lib"))
1663 (pua (assoc-ref outputs "pulseaudio"))
1664 (pualib (string-append pua "/lib/alsa-lib")))
1667 (for-each (lambda (file)
1668 (rename-file file (string-append jacklib "/" (basename file))))
1669 (find-files out ".*jack\\.(la|so)"))
1672 (for-each (lambda (file)
1673 (rename-file file (string-append pualib "/" (basename file))))
1674 (find-files out ".*pulse\\.(la|so)"))
1677 `(("alsa-lib" ,alsa-lib)
1679 ("speex" ,speex) ; libspeexdsp resampling plugin
1680 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1681 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1682 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1684 `(("pkg-config" ,pkg-config)))
1685 (home-page "http://www.alsa-project.org/")
1686 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1688 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1689 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1690 by providing additional plugins which include: upmixing, downmixing, jackd and
1691 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1692 external rate conversion.")
1693 (license (list license:gpl2+
1694 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1695 license:lgpl2.1+))))
1697 (define-public iptables
1704 "mirror://netfilter.org/iptables/iptables-"
1705 version ".tar.bz2"))
1708 "0z0mgs1ghvn3slc868mgbf2g26njgrzcy5ggyb5w4i55j1a3lflr"))))
1709 (build-system gnu-build-system)
1711 `(("pkg-config" ,pkg-config)
1715 `(("libmnl" ,libmnl)
1716 ("libnftnl" ,libnftnl)))
1718 '(#:tests? #f ; no test suite
1719 #:configure-flags ; add $libdir to the RUNPATH of executables
1720 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1721 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1722 (synopsis "Programs to configure Linux IP packet filtering rules")
1724 "@command{iptables} is the user-space command line program used to
1725 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1726 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1728 This package also includes @command{ip6tables}, which is used to configure the
1731 Both commands are targeted at system administrators.")
1732 (license license:gpl2+)))
1734 (define-public ebtables
1737 (version "2.0.10-4")
1741 "mirror://netfilter.org/ebtables/ebtables-v"
1745 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1746 (build-system gnu-build-system)
1748 '(#:tests? #f ; no test suite
1750 (let* ((out (assoc-ref %outputs "out"))
1751 (bin (string-append out "/sbin"))
1752 (lib (string-append out "/lib"))
1753 (man (string-append out "/share/man"))
1754 (iptables (assoc-ref %build-inputs "iptables"))
1755 (ethertypes (string-append iptables "/etc/ethertypes")))
1756 (list (string-append "LIBDIR=" lib)
1757 (string-append "MANDIR=" man)
1758 (string-append "BINDIR=" bin)
1759 (string-append "ETHERTYPESFILE=" ethertypes)
1760 ;; With the default CFLAGS, it falis with:
1761 ;; communication.c:259:58: error: variable ‘ret’ set but not
1762 ;; used [-Werror=unused-but-set-variable]
1765 (modify-phases %standard-phases
1767 ;; no configure script
1769 (substitute* "Makefile"
1770 ;; Remove user and group options from install commands,
1771 ;; otherwise it fails with: invalid user 'root'.
1772 (("-o root -g root") "")
1773 ;; Remove 'ethertypes' from the install target.
1775 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1779 ("iptables" ,iptables)))
1780 (synopsis "Ethernet bridge frame table administration")
1781 (home-page "http://ebtables.netfilter.org/")
1783 "ebtables is an application program used to set up and maintain the
1784 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1785 analogous to the iptables application, but less complicated, due to the fact
1786 that the Ethernet protocol is much simpler than the IP protocol.")
1787 (license license:gpl2+)))
1789 (define-public iproute
1796 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1800 "0ywg70f98wgfai35jl47xzpjp45a6n7crja4vc8ql85cbi1l7ids"))))
1801 (build-system gnu-build-system)
1803 `( ;; There is a test suite, but it wants network namespaces and sudo.
1805 #:make-flags (let ((out (assoc-ref %outputs "out")))
1807 (string-append "BASH_COMPDIR=" out
1808 "/etc/bash_completion.d")
1809 (string-append "LIBDIR=" out "/lib")
1810 (string-append "HDRDIR=" out "/include")
1811 (string-append "SBINDIR=" out "/sbin")
1812 (string-append "CONFDIR=" out "/etc")
1813 (string-append "DOCDIR=" out "/share/doc/"
1815 (string-append "MANDIR=" out "/share/man")))
1816 #:phases (modify-phases %standard-phases
1817 (add-before 'install 'pre-install
1819 ;; Don't attempt to create /var/lib/arpd.
1820 (substitute* "Makefile"
1821 (("^.*ARPDDIR.*$") ""))
1825 ("iptables" ,iptables)
1826 ("libmnl" ,libmnl)))
1830 ("pkg-config" ,pkg-config)))
1832 ;; ("libmnl" ,libmnl)
1833 ;; ("util-linux" ,util-linux)
1835 "https://wiki.linuxfoundation.org/networking/iproute2")
1837 "Utilities for controlling TCP/IP networking and traffic in Linux")
1839 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1840 and traffic with the Linux kernel. The most important of these are
1841 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1844 Most network configuration manuals still refer to ifconfig and route as the
1845 primary network configuration tools, but ifconfig is known to behave
1846 inadequately in modern network environments, and both should be deprecated.")
1847 (license license:gpl2+)))
1849 (define-public net-tools
1850 ;; XXX: This package is basically unmaintained, but it provides a few
1851 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1853 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1857 (version (string-append "1.60-" revision "." (string-take commit 7)))
1860 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1861 "n/ne/net-tools/code.git/net-tools-code-"
1863 (file-name (string-append name "-" version ".zip"))
1866 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1867 (home-page "http://net-tools.sourceforge.net/")
1868 (build-system gnu-build-system)
1870 '(#:modules ((guix build gnu-build-system)
1875 (modify-phases %standard-phases
1877 (lambda* (#:key outputs #:allow-other-keys)
1878 (let ((out (assoc-ref outputs "out")))
1879 (mkdir-p (string-append out "/bin"))
1880 (mkdir-p (string-append out "/sbin"))
1882 ;; Pretend we have everything...
1883 (system "yes | make config")
1885 ;; ... except for the things we don't have.
1886 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1887 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1888 ;; that have been removed.
1889 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1890 ;; think about adding them later.
1891 (substitute* '("config.make" "config.h")
1892 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1895 (add-after 'install 'remove-redundant-commands
1896 (lambda* (#:key outputs #:allow-other-keys)
1897 ;; Remove commands and man pages redundant with Inetutils.
1898 (let* ((out (assoc-ref outputs "out"))
1899 (dup (append-map (cut find-files out <>)
1901 "^(yp|nis|dns)?domainname"))))
1902 (for-each delete-file dup)
1904 ;; Binaries that depend on libnet-tools.a don't declare that
1905 ;; dependency, making it parallel-unsafe.
1906 #:parallel-build? #f
1908 #:tests? #f ; no test suite
1909 #:make-flags (let ((out (assoc-ref %outputs "out")))
1911 (string-append "BASEDIR=" out)
1912 (string-append "INSTALLNLSDIR=" out "/share/locale")
1913 (string-append "mandir=/share/man")))))
1914 (native-inputs `(("gettext" ,gettext-minimal)
1916 (synopsis "Tools for controlling the network subsystem in Linux")
1918 "This package includes the important tools for controlling the network
1919 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1920 route. Additionally, this package contains utilities relating to particular
1921 network hardware types (plipconfig, slattach) and advanced aspects of IP
1922 configuration (iptunnel, ipmaddr).")
1923 (license license:gpl2+))))
1925 (define-public libcap
1932 "mirror://kernel.org/linux/libs/security/linux-privs/"
1933 "libcap2/libcap-" version ".tar.xz"))
1936 "0sj8kidl7qgf2qwxcbw1vadnlb30y4zvjzxswsmfdghq04npkhfs"))))
1937 (build-system gnu-build-system)
1938 (arguments '(#:phases
1939 (modify-phases %standard-phases
1941 ;; Add $libdir to the RUNPATH of executables.
1943 (substitute* "Make.Rules"
1945 (string-append "LDFLAGS := -Wl,-rpath="
1948 #:tests? #f ; no 'check' target
1949 #:make-flags (list "lib=lib"
1950 (string-append "prefix="
1951 (assoc-ref %outputs "out"))
1952 "RAISE_SETFCAP=no")))
1953 (native-inputs `(("perl" ,perl)))
1954 (inputs `(("attr" ,attr)))
1955 (home-page "https://sites.google.com/site/fullycapable/")
1956 (synopsis "Library for working with POSIX capabilities")
1958 "Libcap2 provides a programming interface to POSIX capabilities on
1959 Linux-based operating systems.")
1961 ;; License is BSD-3 or GPLv2, at the user's choice.
1962 (license license:gpl2)))
1964 (define-public bridge-utils
1966 (name "bridge-utils")
1971 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
1972 "bridge-utils-" version ".tar.xz"))
1974 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
1975 (build-system gnu-build-system)
1977 ;; The tarball lacks all the generated files.
1978 (native-inputs `(("autoconf" ,autoconf)
1979 ("automake" ,automake)))
1982 (modify-phases %standard-phases
1983 (add-before 'bootstrap 'patch-stuff
1985 ;; Fix "field ‘ip6’ has incomplete type" errors.
1986 (substitute* "libbridge/libbridge.h"
1987 (("#include <linux/if_bridge.h>")
1988 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1990 ;; Ensure that the entire build fails if one of the
1991 ;; sub-Makefiles fails.
1992 (substitute* "Makefile.in"
1993 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1994 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1997 #:tests? #f)) ; no 'check' target
2000 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
2001 (synopsis "Manipulate Ethernet bridges")
2003 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2004 to connect two Ethernet segments together in a protocol independent way.
2005 Packets are forwarded based on Ethernet address, rather than IP address (like
2006 a router). Since forwarding is done at Layer 2, all protocols can go
2007 transparently through a bridge.")
2008 (license license:gpl2+)))
2010 (define-public libnl
2017 "https://github.com/thom311/libnl/releases/download/"
2018 "libnl" (string-join (string-split version #\.) "_")
2019 "/libnl-" version ".tar.gz"))
2022 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2023 (build-system gnu-build-system)
2027 ("pkg-config" ,pkg-config)
2033 "https://github.com/thom311/libnl/releases/download/libnl"
2034 (string-join (string-split version #\.) "_")
2035 "/libnl-doc-" version ".tar.gz"))
2037 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2039 `(("python-2" ,python-2)
2040 ("python-3" ,python-3)))
2041 (outputs '("out" "doc" "python2" "python3"))
2043 `(#:modules ((guix build gnu-build-system)
2047 (modify-phases %standard-phases
2048 (add-after 'install 'install-python
2049 (lambda* (#:key outputs #:allow-other-keys)
2050 (define (python-inst python)
2051 (invoke python "setup.py" "build")
2052 (invoke python "setup.py" "install"
2053 (string-append "--prefix="
2054 (assoc-ref %outputs python)))
2055 (invoke python "setup.py" "clean"))
2056 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2057 (assoc-ref %outputs "out")))
2058 (with-directory-excursion "./python"
2059 (for-each python-inst '("python2" "python3")))
2061 (add-after 'install 'install-doc
2062 (lambda* (#:key inputs outputs #:allow-other-keys)
2063 (let ((dest (string-append (assoc-ref outputs "doc")
2064 "/share/doc/libnl")))
2066 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
2067 "--strip-components=1" "-C" dest)))))))
2068 (home-page "https://www.infradead.org/~tgr/libnl/")
2069 (synopsis "NetLink protocol library suite")
2071 "The libnl suite is a collection of libraries providing APIs to netlink
2072 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2073 between the kernel and user space processes. It was designed to be a more
2074 flexible successor to ioctl to provide mainly networking related kernel
2075 configuration and monitoring interfaces.")
2077 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2078 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2079 (license license:gpl2)))
2088 "mirror://kernel.org/software/network/iw/iw-"
2092 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2093 (build-system gnu-build-system)
2094 (native-inputs `(("pkg-config" ,pkg-config)))
2095 (inputs `(("libnl" ,libnl)))
2098 (let* ((target ,(%current-target-system))
2099 (gcc (if target (string-append target "-gcc") "gcc"))
2100 (pkg-config (if target
2101 (string-append target "-pkg-config")
2104 (string-append "CC=" gcc)
2105 (string-append "PKG_CONFIG="
2106 (assoc-ref %build-inputs "pkg-config")
2108 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2109 #:phases (modify-phases %standard-phases (delete 'configure))))
2110 (home-page "https://wireless.wiki.kernel.org/")
2111 (synopsis "Tool for configuring wireless devices")
2113 "iw is a new nl80211 based CLI configuration utility for wireless
2114 devices. It replaces @code{iwconfig}, which is deprecated.")
2115 (license license:isc)))
2117 (define-public powertop
2124 (uri (string-append "https://01.org/sites/default/files/downloads/"
2125 "powertop-v" version "-1-g7ef7f79.tar_0.gz"))
2127 (base32 "0kynypj5cydfbma0ssblq1k4m1arixc1s2vf0ybv8y2gg09wjs5f"))))
2128 (build-system gnu-build-system)
2131 (modify-phases %standard-phases
2132 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2133 ;; allow calibrating the network interface in Guix System.
2134 (add-after 'unpack 'patch-absolute-file-names
2135 (lambda* (#:key inputs #:allow-other-keys)
2136 (let ((kmod (assoc-ref inputs "kmod")))
2137 (substitute* (find-files "src" "\\.cpp$")
2138 ;; Give the right 'modprobe' file name so that essential
2139 ;; modules such as msr.ko can be loaded.
2140 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2141 ;; These programs are only needed to calibrate, so using
2142 ;; relative file names avoids adding extra inputs. When they
2143 ;; are missing powertop gracefully handles it.
2144 (("/usr/bin/hcitool") "hcitool")
2145 (("/usr/bin/xset") "xset")
2146 (("/usr/sbin/hciconfig") "hciconfig"))
2151 ("ncurses" ,ncurses)
2152 ("pciutils" ,pciutils)
2155 `(("pkg-config" ,pkg-config)))
2156 (home-page "https://01.org/powertop/")
2157 (synopsis "Analyze power consumption on Intel-based laptops")
2159 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2160 power management. In addition to being a diagnostic tool, PowerTOP also has
2161 an interactive mode where the user can experiment various power management
2162 settings for cases where the operating system has not enabled these
2164 (license license:gpl2)))
2166 (define-public aumix
2173 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2174 version ".tar.bz2"))
2177 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2178 (build-system gnu-build-system)
2179 (inputs `(("ncurses" ,ncurses)))
2180 (home-page "http://www.jpj.net/~trevor/aumix.html")
2181 (synopsis "Audio mixer for X and the console")
2183 "Aumix adjusts an audio mixer from X, the console, a terminal,
2184 the command line or a script.")
2185 (license license:gpl2+)))
2187 (define-public iotop
2194 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2197 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2198 (build-system python-build-system)
2201 (modify-phases %standard-phases
2202 (add-after 'unpack 'fix-build-with-python3
2204 (substitute* "setup.py"
2205 (("itervalues") "values"))
2207 ;; There are currently no checks in the package.
2209 (native-inputs `(("python" ,python)))
2210 (home-page "http://guichaz.free.fr/iotop/")
2212 "Displays the IO activity of running processes")
2214 "Iotop is a Python program with a top like user interface to show the
2215 processes currently causing I/O.")
2216 (license license:gpl2+)))
2224 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2225 "download/fuse-" version
2226 "/fuse-" version ".tar.gz"))
2229 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2230 (patches (search-patches "fuse-overlapping-headers.patch"))))
2231 (build-system gnu-build-system)
2232 (inputs `(("util-linux" ,util-linux)))
2234 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2235 (assoc-ref %outputs "out")
2237 (string-append "INIT_D_PATH="
2238 (assoc-ref %outputs "out")
2241 ;; The rule makes /dev/fuse 666.
2242 (string-append "UDEV_RULES_PATH="
2243 (assoc-ref %outputs "out")
2244 "/lib/udev/rules.d"))
2246 (modify-phases %standard-phases
2247 (add-before 'build 'set-file-names
2248 (lambda* (#:key inputs #:allow-other-keys)
2249 ;; libfuse calls out to mount(8) and umount(8). Make sure
2250 ;; it refers to the right ones.
2251 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2252 (("/bin/(u?)mount" _ maybe-u)
2253 (string-append (assoc-ref inputs "util-linux")
2254 "/bin/" maybe-u "mount")))
2255 (substitute* '("util/mount.fuse.c")
2259 ;; This hack leads libfuse to search for 'fusermount' in
2260 ;; $PATH, where it may find a setuid-root binary, instead of
2261 ;; trying solely $out/sbin/fusermount and failing because
2263 (substitute* "lib/Makefile"
2264 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2265 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2267 (home-page "https://github.com/libfuse/libfuse")
2268 (synopsis "Support file systems implemented in user space")
2270 "As a consequence of its monolithic design, file system code for Linux
2271 normally goes into the kernel itself---which is not only a robustness issue,
2272 but also an impediment to system extensibility. FUSE, for \"file systems in
2273 user space\", is a kernel module and user-space library that tries to address
2274 part of this problem by allowing users to run file system implementations as
2275 user-space processes.")
2276 (license (list license:lgpl2.1 ;library
2277 license:gpl2+)))) ;command-line utilities
2279 (define-public unionfs-fuse
2281 (name "unionfs-fuse")
2286 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
2288 (file-name (string-append name "-" version ".tar.gz"))
2291 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
2292 (build-system cmake-build-system)
2294 `(("python" ,python)))
2295 (inputs `(("fuse" ,fuse)))
2297 ;; The tests were never actually run ("collected 0 items"), but in recent
2298 ;; versions of pytest that causes an error.
2300 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2301 (synopsis "User-space union file system")
2303 "UnionFS-FUSE is a flexible union file system implementation in user
2304 space, using the FUSE library. Mounting a union file system allows you to
2305 \"aggregate\" the contents of several directories into a single mount point.
2306 UnionFS-FUSE additionally supports copy-on-write.")
2307 (license license:bsd-3)))
2310 (package (inherit fuse)
2311 (name "fuse-static")
2312 (source (origin (inherit (package-source fuse))
2313 (modules '((guix build utils)))
2316 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2317 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2318 ;; that it doesn't do that, allowing us to remove the
2319 ;; dependency on util-linux (something that is useful in
2321 (substitute* '("lib/mount_util.c"
2322 "util/mount_util.c")
2323 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2329 (define-public unionfs-fuse/static
2330 (package (inherit unionfs-fuse)
2331 (synopsis "User-space union file system (statically linked)")
2332 (name (string-append (package-name unionfs-fuse) "-static"))
2333 (source (origin (inherit (package-source unionfs-fuse))
2334 (modules '((guix build utils)))
2337 ;; Add -ldl to the libraries, because libfuse.a needs that.
2338 (substitute* "src/CMakeLists.txt"
2339 (("target_link_libraries(.*)\\)" _ libs)
2340 (string-append "target_link_libraries"
2345 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2347 (modify-phases %standard-phases
2348 (add-after 'install 'post-install
2349 (lambda* (#:key outputs #:allow-other-keys)
2350 (let* ((out (assoc-ref outputs "out"))
2351 (exe (string-append out "/bin/unionfs")))
2352 ;; By default, 'unionfs' keeps references to
2353 ;; $glibc/share/locale and similar stuff. Remove them.
2354 (remove-store-references exe)
2356 ;; 'unionfsctl' has references to glibc as well. Since
2357 ;; we don't need it, remove it.
2358 (delete-file (string-append out "/bin/unionfsctl"))
2360 (inputs `(("fuse" ,fuse-static)))))
2362 (define-public sshfs
2368 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2369 "download/sshfs-" version "/sshfs-" version
2373 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2374 (build-system gnu-build-system)
2379 `(("pkg-config" ,pkg-config)))
2380 (home-page "https://github.com/libfuse/sshfs")
2381 (synopsis "Mount remote file systems over SSH")
2383 "This is a file system client based on the SSH File Transfer Protocol.
2384 Since most SSH servers already support this protocol it is very easy to set
2385 up: on the server side there's nothing to do; on the client side mounting the
2386 file system is as easy as logging into the server with an SSH client.")
2387 (license license:gpl2+)))
2389 (define-public sshfs-fuse
2390 (package (inherit sshfs)
2392 (properties `((superseded . ,sshfs)))))
2394 (define-public archivemount
2396 (name "archivemount")
2401 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2402 "archivemount-" version ".tar.gz"))
2404 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2405 (build-system gnu-build-system)
2406 (inputs `(("fuse" ,fuse)
2407 ("libarchive" ,libarchive)))
2408 (native-inputs `(("pkg-config" ,pkg-config)))
2409 (home-page "https://www.cybernoia.de/software/archivemount.html")
2410 (synopsis "Tool for mounting archive files with FUSE")
2411 (description "archivemount is a FUSE-based file system for Unix variants,
2412 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2413 mount point where it can be read from or written to as with any other file
2414 system. This makes accessing the contents of the archive, which may be
2415 compressed, transparent to other programs, without decompressing them.")
2416 (license license:lgpl2.0+)))
2418 (define-public numactl
2425 "https://github.com/numactl/numactl/releases/download/v"
2426 version "/numactl-" version ".tar.gz"))
2429 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2430 (build-system gnu-build-system)
2432 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2433 ;; to run, which we can't assume to have.
2436 ;; NUMA is apparently not supported on armhf, see
2437 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2438 (supported-systems (delete "armhf-linux" %supported-systems))
2439 (home-page "https://github.com/numactl/numactl")
2440 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2442 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2443 memory is not all in one place. The @command{numactl} program allows you to
2444 run your application program on specific CPUs and memory nodes. It does this
2445 by supplying a NUMA memory policy to the operating system before running your
2448 The package contains other commands, such as @command{numastat},
2449 @command{memhog}, and @command{numademo} which provides a quick overview of
2450 NUMA performance on your system.")
2451 (license (list license:gpl2 ;programs
2452 license:lgpl2.1)))) ;library
2454 (define-public kbd-neo
2461 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2462 version "/linux/console/neo.map"))
2463 (file-name (string-append name "-" version ".map"))
2466 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2467 (build-system trivial-build-system)
2469 `(#:modules ((guix build utils))
2471 (use-modules (guix build utils))
2472 (let ((out (string-append %output "/share/keymaps"))
2473 (source (assoc-ref %build-inputs "source")))
2475 (copy-file source (string-append out "/neo.map"))
2477 (home-page "https://neo-layout.org")
2478 (synopsis "Neo2 console layout")
2480 "Kbd-neo provides the Neo2 keyboard layout for use with
2481 @command{loadkeys(1)} from @code{kbd(4)}.")
2482 ;; The file is located in an svn directory, the entire content of
2483 ;; the directory is licensed as GPL3.
2484 (license license:gpl3+)))
2492 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2496 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2497 (modules '((guix build utils)))
2500 (substitute* "tests/Makefile.in"
2501 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2504 (substitute* '("src/unicode_start" "src/unicode_stop")
2505 ;; Assume the Coreutils are in $PATH.
2509 (build-system gnu-build-system)
2512 (modify-phases %standard-phases
2513 (add-before 'build 'pre-build
2514 (lambda* (#:key inputs #:allow-other-keys)
2515 (let ((gzip (assoc-ref %build-inputs "gzip"))
2516 (bzip2 (assoc-ref %build-inputs "bzip2")))
2517 (substitute* "src/libkeymap/findfile.c"
2519 (string-append gzip "/bin/gzip"))
2521 (string-append bzip2 "/bin/bzip2")))
2523 (add-after 'install 'post-install
2524 (lambda* (#:key outputs #:allow-other-keys)
2525 ;; Make sure these programs find their comrades.
2526 (let* ((out (assoc-ref outputs "out"))
2527 (bin (string-append out "/bin")))
2528 (for-each (lambda (prog)
2529 (wrap-program (string-append bin "/" prog)
2530 `("PATH" ":" prefix (,bin))))
2531 '("unicode_start" "unicode_stop"))
2533 (inputs `(("check" ,check)
2536 ("pam" ,linux-pam)))
2537 (native-search-paths
2538 (list (search-path-specification
2539 (variable "LOADKEYS_KEYMAP_PATH")
2540 ;; Append ‘/**’ to recursively search all directories. One can then
2541 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2542 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2543 (files (list "share/keymaps/**")))))
2544 (native-inputs `(("pkg-config" ,pkg-config)))
2545 (home-page "http://kbd-project.org/")
2546 (synopsis "Linux keyboard utilities and keyboard maps")
2548 "This package contains keytable files and keyboard utilities compatible
2549 for systems using the Linux kernel. This includes commands such as
2550 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2551 (license license:gpl2+)))
2553 (define-public loadkeys-static
2556 (name "loadkeys-static")
2558 (substitute-keyword-arguments (package-arguments kbd)
2559 ((#:configure-flags flags ''())
2560 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2561 "--disable-vlock" ;so we don't need libpam
2562 "--disable-libkeymap")
2564 ((#:make-flags flags ''())
2565 `(cons "LDFLAGS=-all-static" ,flags))
2566 ((#:phases phases '%standard-phases)
2567 `(modify-phases ,phases
2569 (lambda* (#:key outputs #:allow-other-keys)
2570 (let ((out (assoc-ref outputs "out")))
2571 ;; The binary keeps references to gzip, among other things,
2572 ;; which we don't need in the initrd, so strip references.
2573 (remove-store-references "src/loadkeys")
2575 (install-file "src/loadkeys"
2576 (string-append out "/bin"))
2578 (delete 'post-install)))
2579 ((#:strip-flags _ '())
2581 ((#:allowed-references _ '())
2584 (synopsis "Statically-linked @command{loadkeys} program")
2586 ;; This package is meant to be used internally in the initrd so don't
2588 (properties '((hidden? . #t)))))
2590 (define-public inotify-tools
2592 (name "inotify-tools")
2597 (url "https://github.com/rvoicilas/inotify-tools.git")
2599 (file-name (git-file-name name version))
2602 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2603 (build-system gnu-build-system)
2605 `(("autoconf" ,autoconf)
2606 ("automake" ,automake)
2607 ("libtool" ,libtool)))
2608 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2609 (synopsis "Monitor file accesses")
2611 "The inotify-tools packages provides a C library and command-line tools
2612 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2613 (license license:gpl2+)))
2622 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2623 "kmod-" version ".tar.xz"))
2626 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2627 (patches (search-patches "kmod-module-directory.patch"))))
2628 (build-system gnu-build-system)
2630 `(("pkg-config" ,pkg-config)))
2635 `(#:tests? #f ; FIXME: Investigate test failures
2636 #:configure-flags '("--with-xz" "--with-zlib")
2638 (modify-phases %standard-phases
2639 (add-after 'install 'install-modprobe&co
2640 (lambda* (#:key outputs #:allow-other-keys)
2641 (let* ((out (assoc-ref outputs "out"))
2642 (bin (string-append out "/bin")))
2643 (for-each (lambda (tool)
2645 (string-append bin "/" tool)))
2646 '("insmod" "rmmod" "lsmod" "modprobe"
2647 "modinfo" "depmod"))
2649 (home-page "https://www.kernel.org/")
2650 (synopsis "Kernel module tools")
2651 (description "Kmod is a set of tools to handle common tasks with Linux
2652 kernel modules like insert, remove, list, check properties, resolve
2653 dependencies and aliases.
2655 These tools are designed on top of libkmod, a library that is shipped with
2656 kmod. The aim is to be compatible with tools, configurations and indices
2657 from the module-init-tools project.")
2658 (license license:gpl2+))) ; library under lgpl2.1+
2660 (define-public earlyoom
2667 (url "https://github.com/rfjakob/earlyoom.git")
2668 (commit (string-append "v" version))))
2669 (file-name (git-file-name name version))
2672 "0fwbx0y80nqgkxrc9kf9j3iwa0wbps2jmqir3pgqbc2cj0wjh0lr"))))
2673 (build-system gnu-build-system)
2675 `(#:phases (modify-phases %standard-phases
2677 (add-before 'check 'set-home
2679 (setenv "HOME" (getcwd))
2681 (add-after 'build 'install-contribs
2682 ;; Install what seems useful from the contrib directory.
2683 (lambda* (#:key outputs #:allow-other-keys)
2684 (let* ((out (assoc-ref outputs "out"))
2685 (contrib (string-append
2686 out "/share/earlyoom/contrib")))
2687 (install-file "contrib/notify_all_users.py" contrib)
2689 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
2691 (string-append "VERSION=v" ,version)
2692 (string-append "PREFIX=" prefix)
2693 (string-append "SYSCONFDIR=" prefix "/etc")))
2694 #:test-target "test"))
2695 (native-inputs `(("go" ,go) ;for the test suite
2696 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
2697 (home-page "https://github.com/rfjakob/earlyoom")
2698 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
2699 (description "Early OOM is a minimalist out of memory (OOM) daemon that
2700 runs in user space and provides a more responsive and configurable alternative
2701 to the in-kernel OOM killer.")
2702 (license license:expat)))
2704 (define-public eudev
2705 ;; The post-systemd fork, maintained by Gentoo.
2711 (uri (git-reference (url "https://github.com/gentoo/eudev")
2712 (commit (string-append "v" version))))
2713 (file-name (git-file-name name version))
2716 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
2717 (patches (search-patches "eudev-rules-directory.patch"))))
2718 (build-system gnu-build-system)
2721 (modify-phases %standard-phases
2722 (add-after 'unpack 'make-source-writable
2724 ;; XXX: Git checkouts are read-only, but this package needs to
2725 ;; modify some of its files.
2726 (for-each make-file-writable (find-files "."))
2728 (add-before 'bootstrap 'patch-file-names
2729 (lambda* (#:key inputs #:allow-other-keys)
2730 (substitute* "man/make.sh"
2731 (("/usr/bin/xsltproc")
2732 (string-append (assoc-ref inputs "xsltproc")
2735 (add-after 'install 'build-hwdb
2736 (lambda* (#:key outputs #:allow-other-keys)
2737 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2738 ;; similar tools to display product names.
2739 (let ((out (assoc-ref outputs "out")))
2740 (invoke (string-append out "/bin/udevadm")
2741 "hwdb" "--update")))))
2742 #:configure-flags (list "--enable-manpages")))
2744 `(("autoconf" ,autoconf)
2745 ("automake" ,automake)
2747 ("libtool" ,libtool)
2748 ("pkg-config" ,pkg-config)
2751 ("python" ,python-wrapper)
2752 ;; For documentation.
2753 ("docbook-xml" ,docbook-xml-4.2)
2754 ("docbook-xsl" ,docbook-xsl)
2755 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2756 ("xsltproc" ,libxslt)))
2758 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2759 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2760 ;; which contains the rules to do that.
2761 `(("util-linux" ,util-linux) ;for blkid
2763 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2764 (synopsis "Userspace device management")
2765 (description "Udev is a daemon which dynamically creates and removes
2766 device nodes from /dev/, handles hotplug events and loads drivers at boot
2768 (license license:gpl2+)))
2770 (define-public eudev-with-hwdb
2771 (deprecated-package "eudev-with-hwdb" eudev))
2776 (version "2.02.177")
2779 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2783 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2784 (modules '((guix build utils)))
2787 (use-modules (guix build utils))
2789 ;; Honor sysconfdir.
2790 (substitute* "make.tmpl.in"
2792 "confdir = @sysconfdir@\n")
2793 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2794 "DEFAULT_SYS_DIR = @sysconfdir@"))
2796 (patches (search-patches "lvm2-static-link.patch"))))
2797 (build-system gnu-build-system)
2799 `(("pkg-config" ,pkg-config)
2800 ("procps" ,procps))) ;tests use 'pgrep'
2805 (modify-phases %standard-phases
2806 (add-after 'configure 'set-makefile-shell
2808 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2810 (setenv "SHELL" (which "sh"))
2812 ;; Replace /bin/sh with the right file name.
2813 (patch-makefile-SHELL "make.tmpl")
2816 #:configure-flags (list (string-append "--sysconfdir="
2817 (assoc-ref %outputs "out")
2819 "--enable-udev_sync"
2820 "--enable-udev_rules"
2821 "--enable-pkgconfig"
2823 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
2825 ;; Make sure programs such as 'dmsetup' can
2826 ;; find libdevmapper.so.
2827 (string-append "LDFLAGS=-Wl,-rpath="
2828 (assoc-ref %outputs "out")
2830 (assoc-ref %outputs "out")
2831 "/lib/device-mapper")
2832 ;; TODO: Patch make.tmpl.in to take LDFLAGS
2833 ;; into account so that we don't need to also
2835 (string-append "CLDFLAGS=-Wl,-rpath="
2836 (assoc-ref %outputs "out")
2838 (assoc-ref %outputs "out")
2839 "/lib/device-mapper"))
2841 ;; The tests use 'mknod', which requires root access.
2843 (home-page "https://sourceware.org/lvm2/")
2844 (synopsis "Logical volume management for Linux")
2846 "LVM2 is the logical volume management tool set for Linux-based systems.
2847 This package includes the user-space libraries and tools, including the device
2848 mapper. Kernel components are part of Linux-libre.")
2850 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2851 ;; Command-line tools are GPLv2.
2852 (license (list license:gpl2 license:lgpl2.1))))
2854 (define-public lvm2-static
2857 (name "lvm2-static")
2859 ;; Propagate udev because libdevmapper.a depends on libudev.
2860 (inputs (alist-delete "udev" (package-inputs lvm2)))
2861 (propagated-inputs `(("udev" ,eudev)))
2864 (substitute-keyword-arguments (package-arguments lvm2)
2865 ((#:configure-flags flags '())
2866 ;; LVM2 doesn't use Libtool, hence the custom option.
2867 `(cons "--enable-static_link" ,flags))))
2868 (synopsis "Logical volume management for Linux (statically linked)")))
2870 (define-public wireless-tools
2872 (name "wireless-tools")
2876 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2880 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2883 ;; Remove the older header files that are not free software.
2884 (for-each (lambda (n)
2885 (delete-file (format #f "wireless.~a.h" n)))
2886 '(10 11 12 13 14 15 16 17 18 19 20))
2888 (build-system gnu-build-system)
2891 (list (string-append "PREFIX=" %output)
2892 (string-append "INSTALL_MAN=" %output "/share/man")
2893 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2896 (modify-phases %standard-phases
2898 (lambda* (#:key target #:allow-other-keys)
2899 (when ,(%current-target-system)
2900 ;; Cross-compilation: use the cross tools.
2901 (substitute* (find-files "." "Makefile")
2903 (string-append "CC = " target "-gcc\n"))
2905 (string-append "AR = " target "-ar\n"))
2907 (string-append "RANLIB = " target "-ranlib\n"))))
2910 (synopsis "Tools for manipulating Linux Wireless Extensions")
2911 (description "Wireless Tools are used to manipulate the now-deprecated
2912 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
2913 Extension was an interface allowing you to set Wireless LAN specific
2914 parameters and get the specific stats. It is deprecated in favor the nl80211
2916 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2917 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2918 ;; other files are distributed under gpl2.
2919 (license (list license:gpl2 license:lgpl2.1+))))
2927 (uri (string-append "mirror://kernel.org/software/network/crda/"
2928 "crda-" version ".tar.xz"))
2931 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2932 (patches (search-patches "crda-optional-gcrypt.patch"))))
2933 (build-system gnu-build-system)
2935 '(#:phases (modify-phases %standard-phases
2937 (add-after 'unpack 'gzip-determinism
2939 (substitute* "Makefile"
2940 (("gzip") "gzip --no-name"))
2943 'build 'no-werror-no-ldconfig
2945 (substitute* "Makefile"
2947 (("ldconfig") "true"))
2950 'build 'set-regulator-db-file-name
2951 (lambda* (#:key inputs #:allow-other-keys)
2952 ;; Tell CRDA where to find our database.
2953 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2954 (substitute* "crda.c"
2955 (("\"/lib/crda/regulatory.bin\"")
2956 (string-append "\"" regdb
2957 "/lib/crda/regulatory.bin\"")))
2959 #:test-target "verify"
2960 #:make-flags (let ((out (assoc-ref %outputs "out"))
2961 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2962 (list "CC=gcc" "V=1"
2964 ;; Disable signature-checking on 'regulatory.bin'.
2965 ;; The reason is that this simplifies maintenance
2966 ;; on our side (no need to manage a distro key
2967 ;; pair), and we can guarantee integrity of
2968 ;; 'regulatory.bin' by other means anyway, such as
2969 ;; 'guix gc --verify'. See
2970 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2974 (string-append "PREFIX=" out)
2975 (string-append "SBINDIR=" out "/sbin/")
2976 (string-append "UDEV_RULE_DIR="
2977 out "/lib/udev/rules.d")
2978 (string-append "LDFLAGS=-Wl,-rpath="
2980 (string-append "REG_BIN=" regdb
2981 "/lib/crda/regulatory.bin")))))
2982 (native-inputs `(("pkg-config" ,pkg-config)
2983 ("wireless-regdb" ,wireless-regdb)))
2984 (inputs `(("libnl" ,libnl)))
2986 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2987 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2989 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2990 communication between the kernel Linux and user space for regulatory
2992 (license license:copyleft-next)))
2994 (define-public wireless-regdb
2996 (name "wireless-regdb")
2997 (version "2019.06.03")
3001 "mirror://kernel.org/software/network/wireless-regdb/"
3002 "wireless-regdb-" version ".tar.xz"))
3005 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
3007 ;; We're building 'regulatory.bin' by ourselves.
3009 (delete-file "regulatory.bin")
3011 (build-system gnu-build-system)
3014 (modify-phases %standard-phases
3015 (add-after 'unpack 'gzip-determinism
3017 (substitute* "Makefile"
3018 (("gzip") "gzip --no-name"))
3020 (add-after 'unpack 'omit-signature
3022 (substitute* "Makefile"
3023 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3024 ;; don't provide (see below). Disable it.
3025 ((" regulatory\\.db\\.p7s") "")
3026 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3027 ;; but ‘make install’ depends only on the latter while installing
3028 ;; both (and failing). Depend on it explicitly.
3029 (("^install: " all) (string-append all "regulatory.db ")))
3031 (delete 'configure)) ; no configure script
3033 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3034 ;; is computed and can be equal to 'maintainer-clean'; when that
3035 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3036 ;; just built. Thus, build things sequentially.
3037 #:parallel-build? #f
3039 #:tests? #f ; no tests
3041 (let ((out (assoc-ref %outputs "out")))
3042 (list (string-append "PREFIX=" out)
3043 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3045 ;; Leave this empty so that db2bin.py doesn't try to sign
3046 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3047 ;; pair for the whole distribution.
3048 (string-append "REGDB_PRIVKEY=")
3049 ;; Don't generate a public key for the same reason. These are
3050 ;; used as Makefile targets and can't be the empty string.
3051 (string-append "REGDB_PUBCERT=/dev/null")
3052 (string-append "REGDB_PUBKEY=/dev/null")))))
3054 `(("python" ,python-wrapper)))
3056 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3057 (synopsis "Wireless regulatory database")
3059 "This package contains the wireless regulatory database Central
3060 Regulatory Database Agent (CRDA) daemon. The database contains information on
3061 country-specific regulations for the wireless spectrum.")
3062 (license license:isc)))
3064 (define-public lm-sensors
3072 (url "https://github.com/groeck/lm-sensors.git")
3073 (commit (string-append "V" (string-join
3074 (string-split version #\.) "-")))))
3075 (file-name (git-file-name name version))
3077 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3078 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3079 (build-system gnu-build-system)
3080 (inputs `(("rrdtool" ,rrdtool)
3083 ("gnuplot" ,gnuplot)))
3084 (native-inputs `(("pkg-config" ,pkg-config)
3088 (outputs '("lib" ; avoid perl in closure
3091 `(#:tests? #f ; no 'check' target
3092 #:make-flags (list (string-append "PREFIX=" %output)
3093 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3094 (string-append "INCLUDEDIR="
3095 (assoc-ref %outputs "lib") "/include")
3096 (string-append "MANDIR=" %output "/share/man")
3097 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3099 (modify-phases %standard-phases
3101 (add-before 'build 'patch-exec-paths
3102 (lambda* (#:key inputs outputs #:allow-other-keys)
3103 (substitute* "prog/detect/sensors-detect"
3105 (string-append "`" (assoc-ref inputs "coreutils")
3107 (("(`|\")modprobe" all open-quote)
3108 (string-append open-quote
3109 (assoc-ref inputs "kmod")
3111 (substitute* '("prog/pwm/pwmconfig"
3112 "prog/pwm/fancontrol")
3114 (string-append (assoc-ref inputs "gnuplot")
3117 (string-append (assoc-ref inputs "coreutils")
3120 (string-append (assoc-ref inputs "grep")
3123 (string-append (assoc-ref inputs "sed")
3126 (string-append (assoc-ref inputs "coreutils")
3129 (string-append (assoc-ref inputs "coreutils")
3132 (string-append (assoc-ref inputs "coreutils")
3133 "/bin/readlink -f")))
3135 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3136 (synopsis "Utilities to read temperature/voltage/fan sensors")
3138 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3139 you to access information from temperature, voltage, and fan speed sensors.
3140 It works with most newer systems.")
3141 (license license:gpl2+)))
3143 (define-public iucode-tool
3145 (name "iucode-tool")
3149 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3150 "/raw/latest/iucode-tool_" version ".tar.xz"))
3153 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3154 (build-system gnu-build-system)
3155 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3156 (synopsis "Manipulate Intel microcode bundles")
3158 "@command{iucode_tool} is a utility to work with microcode packages for
3159 Intel processors. It can convert between formats, extract specific versions,
3160 create a firmware image suitable for the Linux kernel, and more.")
3161 ;; cpuid.h is available for i686, x86_64, and ia64.
3162 (supported-systems '("i686-linux" "x86_64-linux"))
3163 (license license:gpl2+)))
3165 (define-public i2c-tools
3172 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3173 version ".tar.bz2"))
3176 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3177 (build-system gnu-build-system)
3179 `(#:tests? #f ; no 'check' target
3180 #:make-flags (list (string-append "prefix=" %output)
3182 ;; no configure script
3183 #:phases (modify-phases %standard-phases (delete 'configure))))
3186 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3187 (synopsis "I2C tools for Linux")
3189 "The i2c-tools package contains a heterogeneous set of I2C tools for
3190 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3191 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3193 (license license:gpl2+)))
3195 (define-public xsensors
3202 "http://www.linuxhardware.org/xsensors/xsensors-"
3206 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3207 (build-system gnu-build-system)
3208 (inputs `(("lm-sensors" ,lm-sensors "lib")
3210 (native-inputs `(("pkg-config" ,pkg-config)))
3213 (modify-phases %standard-phases
3214 (add-before 'configure 'enable-deprecated
3216 (substitute* "src/Makefile.in"
3217 (("-DGDK_DISABLE_DEPRECATED") "")
3218 (("-DGTK_DISABLE_DEPRECATED") ""))
3220 (add-before 'configure 'remove-Werror
3222 (substitute* '("configure" "src/Makefile.in")
3225 (home-page "http://www.linuxhardware.org/xsensors/")
3226 (synopsis "Hardware health information viewer")
3228 "Xsensors reads data from the libsensors library regarding hardware
3229 health such as temperature, voltage and fan speed and displays the information
3230 in a digital read-out.")
3231 (license license:gpl2+)))
3236 (version (package-version linux-libre))
3237 (source (package-source linux-libre))
3238 (build-system gnu-build-system)
3241 (modify-phases %standard-phases
3243 (lambda* (#:key inputs #:allow-other-keys)
3244 (setenv "SHELL_PATH" (which "bash"))
3245 (chdir "tools/perf")
3247 #:make-flags (list (string-append "prefix="
3248 (assoc-ref %outputs "out"))
3249 ;; Make sure the kernel headers are treated as system
3250 ;; headers to suppress warnings from those.
3251 (string-append "C_INCLUDE_PATH="
3252 (assoc-ref %build-inputs "kernel-headers")
3256 ;; By default, 'config/Makefile' uses lib64 on
3257 ;; x86_64. Work around that.
3259 #:tests? #f)) ;no tests
3261 `(("pkg-config" ,pkg-config)
3265 ;; There are build scripts written in these languages.
3267 ("python" ,python-2)))
3269 `(("slang" ,slang) ;for the interactive TUI
3271 ("python" ,python-2) ;'perf' links against libpython
3272 ("elfutils" ,elfutils)
3273 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3274 ("libunwind" ,libunwind) ;better stack walking
3275 ("numactl" ,numactl) ;for 'perf bench numa mem'
3278 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3279 ("docbook-xsl" ,docbook-xsl)
3281 ("asciidoc" ,asciidoc)))
3282 (home-page "https://perf.wiki.kernel.org/")
3283 (synopsis "Linux profiling with performance counters")
3285 "perf is a tool suite for profiling using hardware performance counters,
3286 with support in the Linux kernel. perf can instrument CPU performance
3287 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3288 of lightweight profiling. This package contains the user-land tools and in
3289 particular the @code{perf} command.")
3290 (license (package-license linux-libre))))
3292 (define-public pflask
3298 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3300 (file-name (string-append name "-" version ".tar.gz"))
3303 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3304 (build-system cmake-build-system)
3306 '(#:tests? #f)) ; no tests
3307 (home-page "https://ghedo.github.io/pflask/")
3308 (synopsis "Simple tool for creating Linux namespace containers")
3309 (description "pflask is a simple tool for creating Linux namespace
3310 containers. It can be used for running a command or even booting an OS inside
3311 an isolated container, created with the help of Linux namespaces. It is
3312 similar in functionality to chroot, although pflask provides better isolation
3313 thanks to the use of namespaces.")
3314 (license license:bsd-2)))
3316 (define-public singularity
3318 (name "singularity")
3322 (uri (string-append "https://github.com/singularityware/singularity/"
3323 "releases/download/" version
3324 "/singularity-" version ".tar.gz"))
3327 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3328 (modules '((guix build utils)))
3331 ;; Do not create directories in /var.
3332 (substitute* "Makefile.in"
3333 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3335 ;; The original source overrides PATH so that it points to
3336 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3337 ;; on Guix System. Leave PATH unchanged so we refer to the
3338 ;; installed Coreutils, grep, etc.
3339 (substitute* "bin/singularity.in"
3341 (string-append "#" all "\n")))
3343 (substitute* (find-files "libexec/cli" "\\.exec$")
3344 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3346 (string-append "/run/setuid-programs/singularity-"
3347 program "-helper")))
3349 (build-system gnu-build-system)
3351 `(#:configure-flags '("--localstatedir=/var")
3353 (modify-phases %standard-phases
3354 (add-after 'unpack 'patch-reference-to-squashfs-tools
3356 (substitute* "libexec/cli/build.exec"
3357 (("if ! singularity_which mksquashfs") "if 0")
3358 (("if ! mksquashfs")
3359 (string-append "if ! " (which "mksquashfs"))))
3362 `(("libarchive" ,libarchive)
3363 ("python" ,python-wrapper)
3365 ("squashfs-tools" ,squashfs-tools)))
3366 (home-page "https://singularity.lbl.gov/")
3367 (synopsis "Container platform")
3368 (description "Singularity is a container platform supporting a number of
3369 container image formats. It can build SquashFS container images or import
3370 existing Docker images. Singularity requires kernel support for container
3371 isolation or root privileges.")
3372 (license license:bsd-3)))
3374 (define-public hdparm
3380 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3381 "hdparm-" version ".tar.gz"))
3384 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3385 (build-system gnu-build-system)
3387 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3388 (list (string-append "binprefix=" out)
3389 (string-append "manprefix=" out)
3392 (modify-phases %standard-phases
3393 (delete 'configure)) ; no configure script
3394 #:tests? #f)) ; no test suite
3395 (home-page "https://sourceforge.net/projects/hdparm/")
3396 (synopsis "View and tune ATA disk drive parameters")
3398 "@command{hdparm} is a command-line utility to control ATA controllers and
3399 disk drives. It can increase performance and/or reliability by careful tuning
3400 of hardware settings like power and acoustic management, DMA modes, and caching.
3401 It can also display detailed device information, or be used as a simple
3402 performance benchmarking tool.
3404 @command{hdparm} provides a command line interface to various Linux kernel
3405 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3406 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3407 Translation (@dfn{SAT}) are also supported.")
3408 (license (license:non-copyleft "file://LICENSE.TXT"))))
3410 (define-public rfkill
3416 (uri (string-append "mirror://kernel.org/software/network/"
3417 name "/" name "-" version ".tar.xz"))
3420 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3421 (build-system gnu-build-system)
3423 `(#:make-flags (list "CC=gcc"
3424 (string-append "PREFIX=" %output))
3425 #:phases (modify-phases %standard-phases
3426 (delete 'configure))
3428 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3429 (synopsis "Tool for enabling and disabling wireless devices")
3431 "rfkill is a simple tool for accessing the rfkill device interface,
3432 which is used to enable and disable wireless networking devices, typically
3433 WLAN, Bluetooth and mobile broadband.")
3434 (license (license:non-copyleft "file://COPYING"
3435 "See COPYING in the distribution."))
3436 ;; rfkill is part of util-linux as of 2.31.
3437 (properties `((superseded . ,util-linux)))))
3445 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3446 version "/" name "-" version ".tar.gz"))
3449 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3450 (build-system gnu-build-system)
3451 (home-page "http://acpiclient.sourceforge.net")
3452 (synopsis "Display information on ACPI devices")
3453 (description "@code{acpi} attempts to replicate the functionality of the
3454 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3455 information. It does not support ACPI suspending, only displays information
3456 about ACPI devices.")
3457 (license license:gpl2+)))
3459 (define-public acpid
3465 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3469 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
3470 (build-system gnu-build-system)
3471 (home-page "https://sourceforge.net/projects/acpid2/")
3472 (synopsis "Daemon for delivering ACPI events to user-space programs")
3474 "acpid is designed to notify user-space programs of Advanced
3475 Configuration and Power Interface (ACPI) events. acpid should be started
3476 during the system boot, and will run as a background process. When an ACPI
3477 event is received from the kernel, acpid will examine the list of rules
3478 specified in /etc/acpi/events and execute the rules that match the event.")
3479 (license license:gpl2+)))
3481 (define-public sysfsutils
3490 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3493 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3494 (build-system gnu-build-system)
3495 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3496 (synopsis "System utilities based on Linux sysfs")
3498 "These are a set of utilities built upon sysfs, a virtual file system in
3499 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3500 also contains the libsysfs library.")
3501 ;; The library is under lgpl2.1+ (all files say "or any later version").
3502 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3503 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3505 (define-public sysfsutils-1
3507 (inherit sysfsutils)
3514 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3515 "/sysfsutils-" version ".tar.gz"))
3517 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3518 (modules '((guix build utils)))
3521 (substitute* "Makefile.in"
3522 (("includedir = /usr/include/sysfs")
3523 "includedir = @includedir@"))
3524 (substitute* "configure"
3525 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3526 (string-append "includedir='" orig "/sysfs'")))
3528 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3530 (define-public cpufrequtils
3532 (name "cpufrequtils")
3537 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3538 "cpufrequtils-" version ".tar.gz"))
3540 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3541 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3542 (build-system gnu-build-system)
3544 `(("sysfsutils" ,sysfsutils-1)))
3546 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3547 (assoc-ref %outputs "out") "/lib"))))
3548 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3549 (synopsis "Utilities to get and set CPU frequency on Linux")
3551 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3552 information, and set the CPU frequency if supported, using the cpufreq
3553 capabilities of the Linux kernel.")
3554 (license license:gpl2)))
3556 (define-public libraw1394
3563 "mirror://kernel.org/linux/libs/ieee1394/"
3564 name "-" version ".tar.xz"))
3567 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3568 (build-system gnu-build-system)
3569 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3570 (synopsis "Interface library for the Linux IEEE1394 drivers")
3572 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3573 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3574 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3575 send to and receive from other nodes without requiring a kernel driver for the
3576 protocol in question.")
3577 (license license:lgpl2.1+)))
3579 (define-public libavc1394
3585 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3586 name "-" version ".tar.gz"))
3589 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3590 (build-system gnu-build-system)
3592 `(("pkg-config" ,pkg-config)))
3594 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3595 (home-page "https://sourceforge.net/projects/libavc1394/")
3596 (synopsis "AV/C protocol library for IEEE 1394")
3598 "Libavc1394 is a programming interface to the AV/C specification from
3599 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3600 (license license:lgpl2.1+)))
3602 (define-public libiec61883
3604 (name "libiec61883")
3609 "mirror://kernel.org/linux/libs/ieee1394/"
3610 name "-" version ".tar.xz"))
3613 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3614 (build-system gnu-build-system)
3616 `(("pkg-config" ,pkg-config)))
3618 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3619 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3620 (synopsis "Isochronous streaming media library for IEEE 1394")
3622 "The libiec61883 library provides a higher level API for streaming DV,
3623 MPEG-2 and audio over Linux IEEE 1394.")
3624 (license license:lgpl2.1+)))
3626 (define-public mdadm
3633 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3637 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3638 (build-system gnu-build-system)
3642 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3646 ;; TODO: tell it where to find 'sendmail'
3647 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3648 (string-append "BINDIR=" out "/sbin")
3649 (string-append "MANDIR=" out "/share/man")
3650 (string-append "UDEVDIR=" out "/lib/udev")))
3652 (modify-phases %standard-phases
3653 (add-before 'build 'patch-program-paths
3654 (lambda* (#:key inputs #:allow-other-keys)
3655 (let ((coreutils (assoc-ref inputs "coreutils")))
3656 (substitute* "udev-md-raid-arrays.rules"
3657 (("/usr/bin/(readlink|basename)" all program)
3658 (string-append coreutils "/bin/" program))))
3660 (add-before 'build 'remove-W-error
3662 ;; We cannot build with -Werror on i686 due to a
3663 ;; 'sign-compare' warning in util.c.
3664 (substitute* "Makefile"
3667 (delete 'configure))
3668 ;;tests must be done as root
3670 (home-page "http://neil.brown.name/blog/mdadm")
3671 (synopsis "Tool for managing Linux Software RAID arrays")
3673 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3674 assemble, report on, and monitor arrays. It can also move spares between raid
3675 arrays when needed.")
3676 (license license:gpl2+)))
3678 (define-public mdadm-static
3681 (name "mdadm-static")
3683 (substitute-keyword-arguments (package-arguments mdadm)
3684 ((#:make-flags flags)
3685 `(cons "LDFLAGS = -static" ,flags))
3687 `(modify-phases ,phases
3688 (add-after 'install 'remove-cruft
3689 (lambda* (#:key outputs #:allow-other-keys)
3690 (let* ((out (assoc-ref outputs "out"))
3691 (precious? (lambda (file)
3692 (member file '("." ".." "sbin"))))
3693 (directories (scandir out (negate precious?))))
3694 (with-directory-excursion out
3695 (for-each delete-file-recursively directories)
3696 (remove-store-references "sbin/mdadm")
3697 (delete-file "sbin/mdmon")
3699 ((#:modules modules %gnu-build-system-modules)
3700 `((ice-9 ftw) ,@modules))
3701 ((#:strip-flags _ '())
3702 ''("--strip-all")) ;strip a few extra KiB
3703 ((#:allowed-references _ '("out"))
3704 '("out")))) ;refer only self
3705 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3707 (define-public multipath-tools
3709 (name "multipath-tools")
3713 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3714 ".git;a=snapshot;h=" version ";sf=tgz"))
3715 (file-name (string-append name "-" version ".tar.gz"))
3718 "1c6ay97wlfv1fl0y8hcfpxhkps14hlnw9gzmj7884micsp7pa9yv"))
3719 (modules '((guix build utils)))
3722 ;; Drop bundled valgrind headers.
3723 (delete-file-recursively "third-party")
3724 (substitute* '("multipathd/main.c"
3725 "libmultipath/debug.c")
3726 (("#include \"../third-party/")
3729 (build-system gnu-build-system)
3731 '(#:tests? #f ; no tests
3732 #:make-flags (list "CC=gcc"
3733 (string-append "DESTDIR="
3734 (assoc-ref %outputs "out"))
3736 ;; Add the libaio headers to GCCs system header
3737 ;; search path to suppress -Werror=cast-qual on
3738 ;; the included headers.
3739 (string-append "C_INCLUDE_PATH="
3740 (assoc-ref %build-inputs "libaio")
3742 (string-append "LDFLAGS=-Wl,-rpath="
3743 (assoc-ref %outputs "out")
3746 (modify-phases %standard-phases
3747 (add-after 'unpack 'patch-source
3748 (lambda* (#:key inputs #:allow-other-keys)
3749 (let ((lvm2 (assoc-ref inputs "lvm2"))
3750 (udev (assoc-ref inputs "udev")))
3751 (substitute* "Makefile.inc"
3752 (("\\$\\(prefix\\)/usr") "$(prefix)")
3753 ;; Do not save timestamp to avoid gzip "timestamp
3754 ;; out-of-range" warnings.
3755 (("gzip -9") "gzip -9n"))
3756 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3757 (("/usr/include/libdevmapper.h")
3758 (string-append lvm2 "/include/libdevmapper.h"))
3759 (("/usr/include/libudev.h")
3760 (string-append udev "/include/libudev.h")))
3762 (delete 'configure)))) ; no configure script
3765 ("pkg-config" ,pkg-config)
3766 ("valgrind" ,valgrind)))
3768 `(("json-c" ,json-c)
3770 ("liburcu" ,liburcu)
3772 ("readline" ,readline)
3774 (home-page "http://christophe.varoqui.free.fr/")
3775 (synopsis "Access block devices through multiple paths")
3777 "This package provides the following binaries to drive the
3778 Linux Device Mapper multipathing driver:
3780 @item @command{multipath} - Device mapper target autoconfig.
3781 @item @command{multipathd} - Multipath daemon.
3782 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3783 @code{dm} multipath devices.
3784 @item @command{kpartx} - Create device maps from partition tables.
3786 (license (list license:gpl2+ ; main distribution
3787 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3789 (define-public libaio
3796 (string-append "https://releases.pagure.org/libaio/"
3797 name "-" version ".tar.gz")))
3800 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
3801 (build-system gnu-build-system)
3804 (list "CC=gcc" (string-append "prefix=" %output))
3805 #:test-target "partcheck" ; need root for a full 'check'
3807 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
3808 (home-page "https://pagure.io/libaio")
3809 (synopsis "Linux-native asynchronous I/O access library")
3811 "This library enables userspace to use Linux kernel asynchronous I/O
3812 system calls, important for the performance of databases and other advanced
3814 (license license:lgpl2.1+)))
3822 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
3826 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
3827 (build-system gnu-build-system)
3829 `(("libsndfile" ,libsndfile)))
3831 `(("pkg-config" ,pkg-config)))
3832 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3833 (synopsis "Bluetooth subband audio codec")
3835 "The SBC is a digital audio encoder and decoder used to transfer data to
3836 Bluetooth audio output devices like headphones or loudspeakers.")
3837 (license license:gpl2+)))
3839 (define-public bluez
3846 "mirror://kernel.org/linux/bluetooth/bluez-"
3850 "02jng21lp6fb3c2bh6vf9y7cj4gaxwk29dfc32ncy0lj0gi4q57p"))))
3851 (build-system gnu-build-system)
3854 (let ((out (assoc-ref %outputs "out")))
3855 (list "--sysconfdir=/etc"
3856 "--localstatedir=/var"
3859 ;; Install dbus/udev files to the correct location.
3860 (string-append "--with-dbusconfdir=" out "/etc")
3861 (string-append "--with-udevdir=" out "/lib/udev")))
3863 (modify-phases %standard-phases
3864 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3865 ;; issue (discussion on upstream mailing list:
3866 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3867 (add-before 'check 'skip-wonky-test
3869 (substitute* "unit/test-gatt.c"
3870 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3872 (add-after 'install 'post-install
3873 (lambda* (#:key inputs outputs #:allow-other-keys)
3874 (let* ((out (assoc-ref outputs "out"))
3875 (servicedir (string-append out "/share/dbus-1/services"))
3876 (service "obexd/src/org.bluez.obex.service")
3877 (rule (string-append
3878 out "/lib/udev/rules.d/97-hid2hci.rules")))
3879 ;; Install the obex dbus service file.
3880 (substitute* service
3882 (string-append out "/libexec/bluetooth/obexd")))
3883 (install-file service servicedir)
3884 ;; Fix paths in the udev rule.
3886 (("hid2hci --method")
3887 (string-append out "/lib/udev/hid2hci --method"))
3889 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3892 `(("pkg-config" ,pkg-config)
3893 ("gettext" ,gettext-minimal)))
3898 ("libical" ,libical)
3899 ("readline" ,readline)))
3900 (home-page "http://www.bluez.org/")
3901 (synopsis "Linux Bluetooth protocol stack")
3903 "BlueZ provides support for the core Bluetooth layers and protocols. It
3904 is flexible, efficient and uses a modular implementation.")
3905 (license license:gpl2+)))
3907 (define-public fuse-exfat
3914 "https://github.com/relan/exfat/releases/download/v"
3915 version "/" name "-" version ".tar.gz"))
3918 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3919 (build-system gnu-build-system)
3921 `(("pkg-config" ,pkg-config)))
3924 (home-page "https://github.com/relan/exfat")
3925 (synopsis "Mount exFAT file systems")
3927 "This package provides a FUSE-based file system that provides read and
3928 write access to exFAT devices.")
3929 (license license:gpl2+)))
3931 (define-public fuseiso
3934 (version "20070708")
3937 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
3938 version "/fuseiso-" version ".tar.bz2"))
3941 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
3942 (build-system gnu-build-system)
3944 `(("pkg-config" ,pkg-config)))
3949 (home-page "https://sourceforge.net/projects/fuseiso/")
3950 (synopsis "Mount ISO file system images")
3952 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
3953 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
3954 Ridge, Joliet, and zisofs.")
3955 (license license:gpl2)))
3964 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3965 version ".tar.bz2"))
3966 (patches (search-patches "gpm-glibc-2.26.patch"))
3969 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3970 (build-system gnu-build-system)
3972 '(#:phases (modify-phases %standard-phases
3975 ;; The tarball was not generated with 'make dist' so we
3976 ;; need to bootstrap things ourselves.
3977 (substitute* "autogen.sh"
3978 (("/bin/sh") (which "sh")))
3979 (invoke "./autogen.sh")
3980 (patch-makefile-SHELL "Makefile.include.in")
3983 ;; Make sure programs find libgpm.so.
3984 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3985 (assoc-ref %outputs "out")
3988 `(("texinfo" ,texinfo)
3991 ("autoconf" ,autoconf)
3992 ("automake" ,automake)
3993 ("libtool" ,libtool)))
3994 (home-page "http://www.nico.schottelius.org/software/gpm/")
3995 (synopsis "Mouse support for the Linux console")
3997 "The GPM (general-purpose mouse) daemon is a mouse server for
3998 applications running on the Linux console. It allows users to select items
3999 and copy/paste text in the console and in xterm.")
4000 (license license:gpl2+)))
4002 (define-public btrfs-progs
4004 (name "btrfs-progs")
4008 (uri (string-append "mirror://kernel.org/linux/kernel/"
4009 "people/kdave/btrfs-progs/"
4010 "btrfs-progs-v" version ".tar.xz"))
4013 "1ykhasv0jc3qi3xrm5841mzkmlbkjw6rm70gl4aww90jj6ak55qg"))))
4014 (build-system gnu-build-system)
4016 "static")) ; static versions of the binaries in "out"
4018 '(#:phases (modify-phases %standard-phases
4019 (add-after 'build 'build-static
4020 (lambda _ (invoke "make" "static")))
4021 (add-after 'install 'install-bash-completion
4022 (lambda* (#:key outputs #:allow-other-keys)
4023 (let* ((out (assoc-ref outputs "out"))
4024 (bashcomp (string-append out "/etc/bash_completion.d")))
4026 (copy-file "btrfs-completion"
4027 (string-append bashcomp "/btrfs"))
4029 (add-after 'install 'install-static
4030 (let ((staticbin (string-append (assoc-ref %outputs "static")
4034 (string-append "bindir=" staticbin)
4035 "install-static")))))
4036 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4037 #:test-target "test"
4038 #:parallel-tests? #f)) ; tests fail when run in parallel
4039 (inputs `(("e2fsprogs" ,e2fsprogs)
4040 ("libblkid" ,util-linux)
4041 ("libblkid:static" ,util-linux "static")
4042 ("libuuid" ,util-linux)
4043 ("libuuid:static" ,util-linux "static")
4046 ("zlib:static" ,zlib "static")
4047 ("zstd" ,zstd "lib")
4048 ("zstd:static" ,zstd "static")))
4049 (native-inputs `(("pkg-config" ,pkg-config)
4050 ("asciidoc" ,asciidoc)
4053 ;; For building documentation.
4054 ("libxml2" ,libxml2)
4055 ("docbook-xsl" ,docbook-xsl)
4059 ;; The tests need 'grep' with perl regexp support.
4061 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4062 (synopsis "Create and manage btrfs copy-on-write file systems")
4063 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4064 aimed at implementing advanced features while focusing on fault tolerance,
4065 repair and easy administration.")
4066 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4067 ;; GPL2: Everything else.
4068 (license (list license:gpl2 license:gpl2+))))
4070 (define-public btrfs-progs/static
4072 (name "btrfs-progs-static")
4073 (version (package-version btrfs-progs))
4075 (build-system trivial-build-system)
4077 `(("btrfs-progs:static" ,btrfs-progs "static")))
4079 `(#:modules ((guix build utils))
4082 (use-modules (guix build utils)
4086 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4087 (out (assoc-ref %outputs "out"))
4088 (source (string-append btrfs "/bin/btrfs.static"))
4089 (target (string-append out "/bin/btrfs")))
4090 (mkdir-p (dirname target))
4091 (copy-file source target)
4092 (remove-store-references target)
4093 (chmod target #o555)
4095 (home-page (package-home-page btrfs-progs))
4096 (synopsis "Statically-linked btrfs command from btrfs-progs")
4097 (description "This package provides the statically-linked @command{btrfs}
4098 from the btrfs-progs package. It is meant to be used in initrds.")
4099 (license (package-license btrfs-progs))))
4101 (define-public compsize
4105 (home-page "https://github.com/kilobyte/compsize")
4110 (commit (string-append "v" version))))
4112 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4113 (file-name (git-file-name name version))))
4114 (build-system gnu-build-system)
4116 `(("btrfs-progs" ,btrfs-progs)))
4118 `(#:tests? #f ; No tests.
4119 #:make-flags (list "CC=gcc")
4121 (modify-phases %standard-phases
4124 (lambda* (#:key outputs #:allow-other-keys)
4125 (let ((out (assoc-ref outputs "out")))
4126 (install-file "compsize" (string-append out "/bin"))
4127 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4128 (synopsis "Find compression type/ratio on Btrfs files")
4129 (description "@command{compsize} takes a list of files (given as
4130 arguments) on a Btrfs file system and measures used compression types and
4131 effective compression ratio, producing a report.
4133 A directory has no extents but has a (recursive) list of files. A non-regular
4134 file is silently ignored.
4136 As it makes no sense to talk about compression ratio of a partial extent,
4137 every referenced extent is counted whole, exactly once -- no matter if you use
4138 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4139 uncompressed size will not match the number given by @command{tar} or
4140 @command{du}. On the other hand, the space used should be accurate (although
4141 obviously it can be shared with files outside our set).")
4142 (license license:gpl2+)))
4144 (define-public f2fs-tools-1.7
4151 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4152 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4155 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4157 (build-system gnu-build-system)
4160 (modify-phases %standard-phases
4161 (add-after 'install 'install-headers
4162 (lambda* (#:key outputs #:allow-other-keys)
4163 (let* ((out (assoc-ref outputs "out"))
4164 (out-include (string-append out "/include")))
4165 (install-file "include/f2fs_fs.h" out-include)
4166 (install-file "mkfs/f2fs_format_utils.h" out-include)
4169 `(("autoconf" ,autoconf)
4170 ("automake" ,automake)
4171 ("libtool" ,libtool)
4172 ("pkg-config" ,pkg-config)))
4174 `(("libuuid" ,util-linux)
4175 ("libselinux" ,libselinux)))
4176 (home-page "https://f2fs.wiki.kernel.org/")
4177 (synopsis "Userland tools for f2fs")
4179 "F2FS, the Flash-Friendly File System, is a modern file system
4180 designed to be fast and durable on flash devices such as solid-state
4181 disks and SD cards. This package provides the userland utilities.")
4182 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4183 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4184 (license (list license:gpl2 license:lgpl2.1))))
4186 (define-public f2fs-tools
4188 (inherit f2fs-tools-1.7)
4194 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4195 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4198 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4200 `(("libuuid" ,util-linux)))))
4202 (define-public freefall
4205 (version (package-version linux-libre))
4206 (source (package-source linux-libre))
4207 (build-system gnu-build-system)
4209 '(#:phases (modify-phases %standard-phases
4210 (add-after 'unpack 'enter-subdirectory
4212 (chdir "tools/laptop/freefall")
4215 (add-before 'build 'increase-timeout
4217 ;; The default of 2 seconds is too low: it assumes an
4218 ;; open lid and AC power without actually checking.
4219 (substitute* "freefall.c"
4220 (("alarm\\(2\\)") "alarm(5)"))
4222 #:make-flags (list (string-append "PREFIX="
4223 (assoc-ref %outputs "out"))
4225 #:tests? #f)) ;no tests
4226 (home-page (package-home-page linux-libre))
4227 (synopsis "Free-fall protection for spinning laptop hard drives")
4229 "Prevents shock damage to the internal spinning hard drive(s) of some
4230 HP and Dell laptops. When sudden movement is detected, all input/output
4231 operations on the drive are suspended and its heads are parked on the ramp,
4232 where they are less likely to cause damage to the spinning disc. Requires a
4233 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4234 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4235 (license license:gpl2)))
4237 (define-public thinkfan
4245 (url "https://github.com/vmatare/thinkfan.git")
4247 (file-name (git-file-name name version))
4249 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
4250 (build-system cmake-build-system)
4252 `(#:modules ((guix build cmake-build-system)
4255 #:tests? #f ; no test target
4257 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4258 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4260 `("-DUSE_ATASMART:BOOL=ON")
4262 (modify-phases %standard-phases
4263 (add-after 'unpack 'create-init-scripts
4264 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4265 ;; systemd to patch and install their service files. Fake their
4266 ;; presence rather than duplicating the build system below. Leave
4267 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4268 ;; The sysvinit needs manual patching, but since upstream doesn't
4269 ;; even provide the option to install it: don't.
4270 (lambda* (#:key outputs #:allow-other-keys)
4271 (let* ((out (assoc-ref outputs "out"))
4272 (share (string-append out "/share/" ,name)))
4273 (substitute* "CMakeLists.txt"
4274 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4275 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4276 ;; That was easy! Now we just need to fix the destinations.
4278 (string-append out directory)))
4281 `(("pkg-config" ,pkg-config)))
4283 `(("libatasmart" ,libatasmart)
4284 ("yaml-cpp" ,yaml-cpp)))
4285 (home-page "http://thinkfan.sourceforge.net/")
4286 (synopsis "Simple fan control program")
4288 "Thinkfan is a simple fan control program. It reads temperatures,
4289 checks them against configured limits and switches to appropriate (also
4290 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4291 other @code{hwmon} driver that enables temperature reading and fan control
4293 (license license:gpl3+)))
4295 (define-public tpacpi-bat
4303 (url "https://github.com/teleshoes/tpacpi-bat.git")
4304 (commit (string-append "v" version))))
4305 (file-name (git-file-name name version))
4307 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4308 (build-system gnu-build-system)
4310 `(#:tests? #f ; no test target
4312 (modify-phases %standard-phases
4313 (add-after 'unpack 'refer-to-inputs
4315 (substitute* "tpacpi-bat"
4317 (format "~a " (which "cat")))
4318 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4319 ;; loaded. That's the administrator's prerogative; disable it.
4320 (("system \"(modprobe .*)\"" _ match)
4321 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4323 (delete 'configure) ; nothing to configure
4324 (delete 'build) ; nothing to build
4326 (lambda* (#:key outputs #:allow-other-keys)
4327 (let* ((out (assoc-ref outputs "out"))
4328 (bin (string-append out "/bin"))
4329 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4330 (install-file "tpacpi-bat" bin)
4332 ;; There's no man page. Install other forms of documentation.
4333 (for-each (lambda (file)
4334 (let ((target (string-append doc "/" file)))
4335 (mkdir-p (dirname target))
4336 (copy-recursively file target)))
4337 (list "battery_asl" "examples" "README.md"))
4341 (home-page "https://github.com/teleshoes/tpacpi-bat")
4342 (synopsis "ThinkPad battery charge controller")
4344 "Tpacpi-bat is a command-line interface to control battery charging on
4345 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4346 ThinkPad models released after 2011}, starting with the xx20 series. It can
4347 query and set the thresholds at which one or both batteries will start and stop
4348 charging, inhibit charging batteries for a set period of time, or force them to
4349 discharge when they otherwise would not.
4351 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4352 kernel module provided by the @code{acpi-call-linux-module} package, which must
4353 be installed and loaded separately. Only the original vendor firmware is
4355 (license license:gpl3+)))
4357 (define-public ntfs-3g
4360 (version "2017.3.23")
4363 (uri (string-append "https://tuxera.com/opensource/"
4364 "ntfs-3g_ntfsprogs-" version ".tgz"))
4365 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
4368 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
4369 (modules '((guix build utils)))
4371 ;; Install under $prefix.
4372 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4376 (build-system gnu-build-system)
4377 (inputs `(("util-linux" ,util-linux)
4378 ("fuse" ,fuse))) ;libuuid
4379 (native-inputs `(("pkg-config" ,pkg-config)))
4381 '(#:configure-flags (list "--exec-prefix=${prefix}"
4382 "--with-fuse=external" ;use our own FUSE
4383 "--enable-mount-helper"
4384 "--enable-posix-acls"
4385 "--enable-xattr-mappings")
4387 (modify-phases %standard-phases
4388 ;; If users install ntfs-3g, they probably want to make it the
4389 ;; default driver as well, so we opt for sensible defaults and link
4390 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
4391 ;; mount NTFS file systems.)
4392 (add-after 'install 'install-link
4393 (lambda* (#:key outputs #:allow-other-keys)
4394 (let* ((out (assoc-ref outputs "out"))
4395 (sbin (string-append out "/sbin")))
4396 (symlink "mount.ntfs-3g"
4397 (string-append sbin "/mount.ntfs")))
4399 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
4400 (synopsis "Read-write access to NTFS file systems")
4402 "NTFS-3G provides read-write access to NTFS file systems, which are
4403 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4404 The package provides additional NTFS tools.")
4405 (license license:gpl2+)))
4407 (define-public rdma-core
4413 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4414 "/releases/download/v" version "/rdma-core-"
4418 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
4419 (build-system cmake-build-system)
4421 `(#:tests? #f ; no tests
4422 ;; Upstream uses the "ninja" build system and encourage distros
4423 ;; to do the same for consistency. They also recommend using the
4424 ;; "Release" build type.
4425 #:build-type "Release"
4426 #:configure-flags (list "-GNinja"
4428 (string-append "-DRST2MAN_EXECUTABLE="
4429 (assoc-ref %build-inputs
4433 ;; On some configurations, the
4434 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
4435 ;; used by default, would return ENODEV. To
4436 ;; avoid that, use 'write' instead of ioctls,
4437 ;; as suggested in 'CMakeList.txt'.
4438 "-DIOCTL_MODE=write")
4440 (modify-phases %standard-phases
4444 "-j" (number->string (parallel-job-count)))))
4447 (invoke "ninja" "install"))))))
4450 ("pkg-config" ,pkg-config)
4451 ("python" ,python-wrapper)
4452 ("python-docutils" ,python-docutils))) ;for 'rst2man'
4456 (home-page "https://github.com/linux-rdma/rdma-core")
4457 (synopsis "Utilities and libraries for working with RDMA devices")
4459 "This package provides userspace components for the InfiniBand
4460 subsystem of the Linux kernel. Specifically it contains userspace
4461 libraries for the following device nodes:
4464 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4465 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4466 @item @file{/dev/infiniband/umadX} (@code{libibumad})
4469 The following service daemons are also provided:
4471 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4472 @item @code{iwpmd} (for iWARP kernel providers)
4473 @item @code{ibacm} (for InfiniBand communication management assistant)
4475 ;; All library code is dual licensed under GPL2 and a custom MIT
4476 ;; variant. The package also includes some components covered by
4477 ;; other licenses. Consult COPYING.md for full details.
4480 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4481 license:bsd-2 ; Files referring to COPYING.BSD_FB
4482 license:cc0 ; most files in ccan/
4483 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4485 (define-public perftest
4492 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4493 version "/perftest-" version ".g0927198.tar.gz"))
4495 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
4496 (build-system gnu-build-system)
4499 (modify-phases %standard-phases
4500 (add-after 'unpack 'patch-header-paths
4502 (substitute* '("src/raw_ethernet_fs_rate.c"
4503 "src/raw_ethernet_resources.c"
4504 "src/raw_ethernet_resources.h"
4505 "src/raw_ethernet_send_burst_lat.c"
4506 "src/raw_ethernet_send_bw.c"
4507 "src/raw_ethernet_send_lat.c")
4508 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4510 (inputs `(("rdma-core" ,rdma-core)))
4511 (home-page "https://github.com/linux-rdma/perftest/")
4512 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4513 (description "This is a collection of tests written over uverbs intended for
4514 use as a performance micro-benchmark. The tests may be used for hardware or
4515 software tuning as well as for functional testing.
4517 The collection contains a set of bandwidth and latency benchmark such as:
4519 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
4520 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4521 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4522 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4523 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4525 (license license:gpl2)))
4527 (define-public rng-tools
4530 (home-page "https://github.com/nhorman/rng-tools")
4534 (uri (git-reference (url home-page)
4535 (commit (string-append "v" version))))
4536 (file-name (git-file-name name version))
4539 "065jf26s8zkicb95zc9ilksjdq9gqrh5vcx3mhi6mypbnamn6w98"))))
4540 (build-system gnu-build-system)
4542 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
4543 #:configure-flags '("--without-nistbeacon"
4544 "--without-pkcs11")))
4546 `(("autoconf" ,autoconf)
4547 ("automake" ,automake)
4548 ("pkg-config" ,pkg-config)))
4550 `(("libsysfs" ,sysfsutils)))
4551 (synopsis "Random number generator daemon")
4553 "Monitor a hardware random number generator, and supply entropy
4554 from that to the system kernel's @file{/dev/random} machinery.")
4555 ;; The source package is offered under the GPL2+, but the files
4556 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4557 (license (list license:gpl2 license:gpl2+))))
4559 (define-public cpupower
4562 (version (package-version linux-libre))
4563 (source (package-source linux-libre))
4564 (build-system gnu-build-system)
4566 '(#:phases (modify-phases %standard-phases
4567 (add-after 'unpack 'enter-subdirectory
4569 (chdir "tools/power/cpupower")
4572 (add-before 'build 'fix-makefiles
4574 (substitute* "Makefile"
4576 (("/bin/(install|pwd)" _ command) command))
4577 (substitute* "bench/Makefile"
4578 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4580 #:make-flags (let ((out (assoc-ref %outputs "out")))
4581 (list (string-append "DESTDIR=" out)
4582 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4584 "docdir=/share/doc/cpupower"
4585 "confdir=$(docdir)/examples"
4586 ;; The Makefile recommends the following changes
4588 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4589 #:tests? #f)) ;no tests
4590 (native-inputs `(("gettext" ,gettext-minimal)))
4591 (inputs `(("pciutils" ,pciutils)))
4592 (home-page (package-home-page linux-libre))
4593 (synopsis "CPU frequency and voltage scaling tools for Linux")
4595 "cpupower is a set of user-space tools that use the cpufreq feature of the
4596 Linux kernel to retrieve and control processor features related to power saving,
4597 such as frequency and voltage scaling.")
4598 (license license:gpl2)))
4600 (define-public x86-energy-perf-policy
4602 (name "x86-energy-perf-policy")
4603 (version (package-version linux-libre))
4604 (source (package-source linux-libre))
4605 (build-system gnu-build-system)
4609 (modify-phases %standard-phases
4610 (add-after 'unpack 'enter-subdirectory
4612 (chdir "tools/power/x86/x86_energy_perf_policy")
4615 (add-before 'build 'fix-makefile
4617 (substitute* "Makefile" (("/usr") ""))
4620 (let ((out (assoc-ref %outputs "out")))
4621 (list (string-append "DESTDIR=" out)
4622 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4623 (supported-systems '("i686-linux" "x86_64-linux"))
4624 (home-page (package-home-page linux-libre))
4625 (synopsis "Display and update Intel-CPU energy-performance policy")
4627 "@command{x86_energy_perf_policy} displays and updates energy-performance
4628 policy settings specific to Intel Architecture Processors. Settings are
4629 accessed via Model Specific Register (MSR) updates, no matter if the Linux
4630 cpufreq sub-system is enabled or not.")
4631 (license license:gpl2)))
4633 (define-public haveged
4641 (url "https://github.com/jirka-h/haveged.git")
4642 (commit (string-append "v" version))))
4643 (file-name (git-file-name name version))
4645 (base32 "11kr19n2f87izsj341lv5amhd1wc2ckfmqr9pq5fxix8pkbs94rh"))))
4646 (build-system gnu-build-system)
4647 (home-page "https://www.issihosts.com/haveged")
4648 (synopsis "Entropy source for the Linux random number generator")
4650 "haveged generates an unpredictable stream of random numbers for use by
4651 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4652 standard mechanisms for filling the entropy pool may not be sufficient for
4653 systems with high needs or limited user interaction, such as headless servers.
4655 @command{haveged} runs as a privileged daemon, harvesting randomness from the
4656 indirect effects of hardware events on hidden processor state using the
4657 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
4658 It tunes itself to its environment and provides the same built-in test suite
4659 for the output stream as used on certified hardware security devices.
4661 The quality of the randomness produced by this algorithm has not been proven.
4662 It is recommended to run it together with another entropy source like rngd, and
4663 not as a replacement for it.")
4664 (license (list (license:non-copyleft "file://nist/mconf.h")
4665 (license:non-copyleft "file://nist/packtest.c")
4666 license:public-domain ; nist/dfft.c
4667 license:gpl3+)))) ; everything else
4669 (define-public ecryptfs-utils
4671 (name "ecryptfs-utils")
4676 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4677 version "/+download/ecryptfs-utils_"
4678 version ".orig.tar.gz"))
4681 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4682 (build-system gnu-build-system)
4684 `(#:configure-flags (list "--disable-pywrap")
4686 (modify-phases %standard-phases
4687 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4688 (lambda* (#:key inputs outputs #:allow-other-keys)
4689 (let ((out (assoc-ref outputs "out"))
4690 (utils-linux (assoc-ref inputs "utils-linux"))
4691 (cryptsetup (assoc-ref inputs "cryptsetup"))
4692 (linux-pam (assoc-ref inputs "linux-pam"))
4693 (lvm2 (assoc-ref inputs "lvm2")))
4694 (substitute* '("src/utils/ecryptfs-mount-private"
4695 "src/utils/ecryptfs-umount-private"
4696 "src/utils/ecryptfs-setup-private"
4697 "src/utils/ecryptfs-setup-swap"
4698 "src/utils/mount.ecryptfs.c"
4699 "src/utils/umount.ecryptfs.c"
4700 "src/pam_ecryptfs/pam_ecryptfs.c"
4701 "src/desktop/ecryptfs-mount-private.desktop.in"
4702 "src/desktop/ecryptfs-setup-private.desktop.in")
4704 (string-append utils-linux "/bin/mount"))
4706 (string-append utils-linux "/bin/umount"))
4707 (("/sbin/mount.ecryptfs_private")
4708 (string-append out "/sbin/mount.ecryptfs_private"))
4709 (("/sbin/umount.ecryptfs_private")
4710 (string-append out "/sbin/umount.ecryptfs_private"))
4711 (("/usr/bin/ecryptfs-mount-private")
4712 (string-append out "/bin/ecryptfs-mount-private"))
4713 (("/usr/bin/ecryptfs-rewrite-file")
4714 (string-append out "/bin/ecryptfs-rewrite-file"))
4715 (("/usr/bin/ecryptfs-setup-private")
4716 (string-append out "/bin/ecryptfs-setup-private"))
4717 (("/sbin/cryptsetup")
4718 (string-append cryptsetup "/sbin/cryptsetup"))
4719 (("/sbin/unix_chkpwd")
4720 (string-append linux-pam "/sbin/unix_chkpwd"))
4722 (string-append lvm2 "/sbin/dmsetup")))))))))
4724 `(("intltool" ,intltool)
4725 ("perl" ,perl) ; for pod2man
4726 ("pkg-config" ,pkg-config)))
4728 `(("keyutils" ,keyutils)
4729 ("linux-pam" ,linux-pam)
4730 ("utils-linux" ,util-linux)
4731 ("cryptsetup" ,cryptsetup)
4734 (home-page "https://ecryptfs.org/")
4735 (synopsis "eCryptfs cryptographic file system utilities")
4737 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4738 Each file's cryptographic meta-data is stored inside the file itself, along
4739 with the encrypted contents. This allows individual encrypted files to be
4740 copied between hosts and still be decrypted with the proper key. eCryptfs is a
4741 native Linux file system, and has been part of the Linux kernel since version
4742 2.6.19. This package contains the userland utilities to manage it.")
4743 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4744 ;; grant additional permission to link with OpenSSL.
4745 (license license:gpl2+)))
4747 (define-public libnfsidmap
4749 (name "libnfsidmap")
4754 (uri (string-append "https://fedorapeople.org/~steved/"
4755 name "/" version "/" name "-" version ".tar.bz2"))
4757 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
4758 (build-system gnu-build-system)
4760 `(#:configure-flags (list
4761 (string-append "--with-pluginpath="
4762 (assoc-ref %outputs "out")
4763 "/lib/libnfsidmap"))))
4765 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
4767 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4768 (synopsis "NFSv4 support library for name/ID mapping")
4769 (description "Libnfsidmap is a library holding mulitiple methods of
4770 mapping names to ids and visa versa, mainly for NFSv4. It provides an
4771 extensible array of mapping functions, currently consisting of two choices:
4772 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4773 (license (license:non-copyleft "file://COPYING"
4774 "See COPYING in the distribution."))))
4776 (define-public module-init-tools
4778 (name "module-init-tools")
4783 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
4784 "module-init-tools-" version ".tar.bz2"))
4787 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
4788 (patches (search-patches "module-init-tools-moduledir.patch"))))
4789 (build-system gnu-build-system)
4791 ;; FIXME: The upstream tarball lacks man pages, and building them would
4792 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
4793 ;; but they vanished. In the meantime, fake it.
4795 (modify-phases %standard-phases
4796 (add-before 'configure 'fake-docbook
4798 (substitute* "Makefile.in"
4799 (("^DOCBOOKTOMAN.*$")
4800 "DOCBOOKTOMAN = true\n"))
4802 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
4803 (synopsis "Tools for loading and managing Linux kernel modules")
4805 "Tools for loading and managing Linux kernel modules, such as
4806 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
4807 (license license:gpl2+)))
4809 (define-public mcelog
4815 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
4816 "mcelog.git/snapshot/v" version ".tar.gz"))
4819 "1c4faayg1gcm3002b2fdrfnv76z92mvfzccvx8w9crjp0d17sp24"))
4820 (file-name (string-append name "-" version ".tar.gz"))
4821 (modules '((guix build utils)))
4824 ;; The snapshots lack a .git directory,
4825 ;; breaking ‘git describe’.
4826 (substitute* "Makefile"
4827 (("\"unknown\"") (string-append "\"v" ,version "\"")))
4829 (build-system gnu-build-system)
4831 `(#:phases (modify-phases %standard-phases
4832 (delete 'configure)) ; no configure script
4833 #:make-flags (let ((out (assoc-ref %outputs "out")))
4835 (string-append "prefix=" out)
4836 (string-append "DOCDIR=" out "/share/doc/mcelog")
4837 "etcprefix=$(DOCDIR)/examples"))
4838 ;; The tests will only run as root on certain supported CPU models.
4840 (supported-systems (list "i686-linux" "x86_64-linux"))
4841 (home-page "https://mcelog.org/")
4842 (synopsis "Machine check monitor for x86 Linux systems")
4844 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
4845 and other hardware errors on x86 systems. It can also perform user-defined
4846 tasks, such as bringing bad pages off-line, when configurable error thresholds
4848 (license license:gpl2)))
4850 (define-public mtd-utils
4857 "ftp://ftp.infradead.org/pub/mtd-utils/"
4858 "mtd-utils-" version ".tar.bz2"))
4861 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
4863 '(#:configure-flags '("--enable-unit-tests")))
4865 `(("cmocka" ,cmocka)
4866 ("pkg-config" ,pkg-config)))
4868 `(("acl" ,acl) ; extended attributes (xattr)
4869 ("libuuid" ,util-linux)
4871 ("openssl" ,openssl) ; optional crypto support
4873 ("zstd" ,zstd "lib")))
4874 (build-system gnu-build-system)
4875 (synopsis "MTD Flash Storage Utilities")
4876 (description "This package provides utilities for testing, partitioning, etc
4878 (home-page "http://www.linux-mtd.infradead.org/")
4880 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
4881 license:mpl1.1 ; All ftl* files
4882 license:expat)))) ; libiniparser
4884 (define-public libseccomp
4890 (uri (string-append "https://github.com/seccomp/libseccomp/"
4891 "releases/download/v" version
4892 "/libseccomp-" version ".tar.gz"))
4895 "0nsq81acrbkdr8zairxbwa33bj2a6126npp76b4srjl472sjfkxm"))
4896 (patches (search-patches "libseccomp-open-aarch64.patch"))))
4897 (build-system gnu-build-system)
4899 `(("which" ,which)))
4900 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
4901 (description "The libseccomp library provides an easy to use, platform
4902 independent, interface to the Linux Kernel's syscall filtering mechanism. The
4903 libseccomp API is designed to abstract away the underlying BPF based syscall
4904 filter language and present a more conventional function-call based filtering
4905 interface that should be familiar to, and easily adopted by, application
4907 (home-page "https://github.com/seccomp/libseccomp")
4908 (license license:lgpl2.1)))
4910 (define-public radeontop
4918 (url "https://github.com/clbr/radeontop.git")
4919 (commit (string-append "v" version))))
4920 (file-name (git-file-name name version))
4922 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
4923 (build-system gnu-build-system)
4925 `(#:phases (modify-phases %standard-phases
4926 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4927 ;; dependency, and doesn't even work on release(!) tarballs.
4928 (add-after 'unpack 'report-correct-version
4930 (substitute* "getver.sh"
4932 (string-append "ver=" ,version)))
4934 (delete 'configure)) ; no configure script
4935 #:make-flags (list "CC=gcc"
4936 (string-append "PREFIX=" %output))
4937 #:tests? #f)) ; no tests
4939 `(("gettext" ,gettext-minimal)
4940 ("pkg-config" ,pkg-config)))
4942 `(("libdrm" ,libdrm)
4943 ("libpciaccess" ,libpciaccess)
4945 ("ncurses" ,ncurses)))
4946 (home-page "https://github.com/clbr/radeontop/")
4947 (synopsis "Usage monitor for AMD Radeon graphics")
4948 (description "RadeonTop monitors resource consumption on supported AMD
4949 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4950 a terminal or saved to a file for further processing. It measures both the
4951 activity of the GPU as a whole, which is also accurate during OpenCL
4952 computations, as well as separate component statistics that are only meaningful
4953 under OpenGL graphics workloads.")
4954 (license license:gpl3)))
4956 (define-public efivar
4962 (uri (string-append "https://github.com/rhboot/" name
4963 "/releases/download/" version "/" name
4964 "-" version ".tar.bz2"))
4967 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
4968 (build-system gnu-build-system)
4970 `(;; Tests require a UEFI system and is not detected in the chroot.
4972 #:make-flags (list (string-append "prefix=" %output)
4973 (string-append "libdir=" %output "/lib")
4975 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4977 (modify-phases %standard-phases
4979 (add-before 'build 'kernel-headers-are-system-headers
4980 (lambda* (#:key inputs #:allow-other-keys)
4981 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
4982 ;; Make sure the kernel headers are treated as system headers
4983 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
4984 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
4987 `(("pkg-config" ,pkg-config)))
4990 (home-page "https://github.com/rhboot/efivar")
4991 (synopsis "Tool and library to manipulate EFI variables")
4992 (description "This package provides a library and a command line
4993 interface to the variable facility of UEFI boot firmware.")
4994 (license license:lgpl2.1+)))
4996 (define-public efibootmgr
5002 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5003 "/releases/download/" version "/efibootmgr"
5004 "-" version ".tar.bz2"))
5007 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5008 (build-system gnu-build-system)
5010 `(#:tests? #f ;no tests
5011 #:make-flags (list (string-append "prefix=" %output)
5012 (string-append "libdir=" %output "/lib")
5013 ;; EFIDIR denotes a subdirectory relative to the
5014 ;; EFI System Partition where the loader will be
5015 ;; installed (known as OS_VENDOR in the code).
5016 ;; GRUB overrides this, as such it's only used if
5017 ;; nothing else is specified on the command line.
5019 ;; Treat kernel headers as system headers to prevent
5020 ;; warnings about conflicting types.
5021 (string-append "C_INCLUDE_PATH="
5022 (assoc-ref %build-inputs "kernel-headers")
5024 #:phases (modify-phases %standard-phases (delete 'configure))))
5026 `(("pkg-config" ,pkg-config)))
5028 `(("efivar" ,efivar)
5030 (home-page "https://github.com/rhinstaller/efibootmgr")
5031 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5033 "@code{efibootmgr} is a user-space application to modify the Intel
5034 Extensible Firmware Interface (EFI) Boot Manager. This application can
5035 create and destroy boot entries, change the boot order, change the next
5036 running boot option, and more.")
5037 (license license:gpl2+)))
5039 (define-public sysstat
5045 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5046 "sysstat-" version ".tar.xz"))
5049 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
5050 (build-system gnu-build-system)
5052 `(#:tests? #f ; No test suite.
5053 ;; Without this flag, it tries to install the man pages with group 'root'
5054 ;; and fails because /etc/passwd lacks an entry for the root user.
5056 (list "--disable-file-attr"
5057 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5059 (modify-phases %standard-phases
5060 ;; The build process tries to create '/var/lib/sa', so we skip that
5062 (add-after 'build 'skip-touching-var
5064 (substitute* "Makefile"
5065 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5068 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5069 (synopsis "Performance monitoring tools for Linux")
5070 (description "The sysstat utilities are a collection of performance
5071 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5072 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5073 @code{sadf} and @code{sa}.")
5074 (license license:gpl2+)))
5076 (define-public light
5084 (url "https://github.com/haikarainen/light.git")
5085 (commit (string-append "v" version))))
5087 (base32 "0zrjipd392bzjvxx0rjrb0cgi0ix1d83fwgw1mcy8kc4d16cgyjg"))
5088 (file-name (git-file-name name version))))
5089 (build-system gnu-build-system)
5092 (modify-phases %standard-phases
5093 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5094 (lambda* (#:key inputs #:allow-other-keys)
5095 (substitute* "90-backlight.rules"
5096 (("/bin/chgrp") (which "chgrp"))
5097 (("/bin/chmod") (which "chmod")))
5099 (add-after 'install 'install-udev-rules
5100 (lambda* (#:key outputs #:allow-other-keys)
5101 (let ((out (assoc-ref outputs "out")))
5103 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5106 `(("autoconf" ,autoconf)
5107 ("automake" ,automake)))
5108 (home-page "https://haikarainen.github.io/light/")
5109 (synopsis "GNU/Linux application to control backlights")
5111 "Light is a program to send commands to screen backlight controllers
5112 under GNU/Linux. Features include:
5115 @item It does not rely on X.
5116 @item Light can automatically figure out the best controller to use, making
5117 full use of underlying hardware.
5118 @item It is possible to set a minimum brightness value, as some controllers
5119 set the screen to be pitch black at a vaĺue of 0 (or higher).
5122 Light is the successor of lightscript.")
5123 (license license:gpl3+)))
5125 (define-public brightnessctl
5126 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5128 (name "brightnessctl")
5129 (version (git-version "0.4" "0" commit))
5133 (url "https://github.com/Hummer12007/brightnessctl/")
5135 (file-name (git-file-name name version))
5138 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5139 (build-system gnu-build-system)
5141 '(#:tests? #f ; no tests
5142 #:make-flags (list "CC=gcc"
5143 (string-append "PREFIX=" %output)
5144 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5146 (modify-phases %standard-phases
5148 (add-after 'unpack 'adjust-udev-rules
5150 (substitute* "90-brightnessctl.rules"
5151 (("/bin/") "/run/current-system/profile/bin/"))
5153 (home-page "https://github.com/Hummer12007/brightnessctl")
5154 (synopsis "Backlight and LED brightness control")
5156 "This program allows you read and control device brightness. Devices
5157 include backlight and LEDs. It can also preserve current brightness before
5158 applying the operation, such as on lid close.
5160 The appropriate permissions must be set on the backlight or LED control
5161 interface in sysfs, which can be accomplished with the included udev rules.")
5162 (license license:expat))))
5171 "https://github.com/linrunner/"
5172 (string-upcase name)
5173 "/archive/" version ".tar.gz"))
5174 (file-name (string-append name "-" version ".tar.gz"))
5177 "059kxrpxx580mm6p0z2a421nxngszyh4yqqhbgvn04b6a7dbsa2w"))))
5178 (inputs `(("bash" ,bash)
5180 ("ethtool" ,ethtool)
5184 ("inetutils" ,inetutils)
5187 ("pciutils" ,pciutils)
5191 ("usbutils" ,usbutils)
5192 ("util-linux" ,util-linux)
5193 ("wireless-tools" ,wireless-tools)
5194 ,@(if (let ((system (or (%current-target-system)
5195 (%current-system))))
5196 (or (string-prefix? "i686-" system)
5197 (string-prefix? "x86_64-" system)))
5198 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5200 (build-system gnu-build-system)
5202 `(#:modules ((guix build gnu-build-system)
5206 (modify-phases %standard-phases
5207 (delete 'configure) ; no configure script
5208 (add-before 'build 'setenv
5209 (lambda* (#:key outputs #:allow-other-keys)
5210 (let ((out (assoc-ref outputs "out")))
5211 (setenv "TLP_WITH_SYSTEMD" "0")
5212 (setenv "TLP_NO_INIT" "1")
5213 (setenv "TLP_NO_PMUTILS" "1")
5214 (setenv "TLP_SBIN" (string-append out "/bin"))
5215 (setenv "TLP_BIN" (string-append out "/bin"))
5216 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5217 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5218 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5219 (setenv "TLP_CONF" "/etc/tlp")
5221 (string-append out "/lib/elogind/system-sleep"))
5223 (string-append out "/share/bash-completion/completions"))
5224 (setenv "TLP_MAN" (string-append out "/share/man"))
5225 (setenv "TLP_META" (string-append out "/share/metainfo"))
5227 (delete 'check) ; no tests
5228 (add-before 'install 'fix-installation
5230 ;; Stop the Makefile from trying to create system directories.
5231 (substitute* "Makefile"
5232 (("\\[ -f \\$\\(_CONF\\) \\]") "#")
5233 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5237 (invoke "make" "install-tlp" "install-man")))
5238 (add-after 'install 'wrap
5239 (lambda* (#:key inputs outputs #:allow-other-keys)
5240 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5241 (bin-files (find-files bin ".*")))
5242 (define (bin-directory input-name)
5243 (let ((p (assoc-ref inputs input-name)))
5244 (and p (string-append p "/bin"))))
5245 (define (sbin-directory input-name)
5246 (string-append (assoc-ref inputs input-name) "/sbin"))
5247 (for-each (lambda (program)
5248 (wrap-program program
5251 (filter-map bin-directory
5263 "x86-energy-perf-policy"))
5264 (filter-map sbin-directory
5270 "wireless-tools"))))))
5273 (home-page "http://linrunner.de/en/tlp/tlp.html")
5274 (synopsis "Power management tool for Linux")
5275 (description "TLP is a power management tool for Linux. It comes with
5276 a default configuration already optimized for battery life. Nevertheless,
5277 TLP is customizable to fulfil system requirements. TLP settings are applied
5278 every time the power supply source is changed.")
5279 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5281 (license (list license:gpl2+ license:gpl3+))))
5289 (uri (string-append "https://www.ezix.org/software/"
5290 "files/lshw-" version
5294 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5295 (build-system gnu-build-system)
5297 `(#:phases (modify-phases %standard-phases (delete 'configure))
5298 #:tests? #f ; no tests
5300 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5301 (synopsis "List hardware information")
5303 "@command{lshw} (Hardware Lister) is a small tool to provide
5304 detailed information on the hardware configuration of the machine.
5305 It can report exact memory configuration, firmware version, mainboard
5306 configuration, CPU version and speed, cache configuration, bus speed,
5307 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5308 machines (PowerMac G4 is known to work).")
5309 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5310 (license license:gpl2+)))
5312 (define-public libmnl
5319 (uri (string-append "mirror://netfilter.org/libmnl/"
5320 "libmnl-" version ".tar.bz2"))
5323 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5324 (build-system gnu-build-system)
5325 (home-page "https://www.netfilter.org/projects/libmnl/")
5326 (synopsis "Netlink utility library")
5327 (description "Libmnl is a minimalistic user-space library oriented to
5328 Netlink developers. There are a lot of common tasks in parsing, validating,
5329 constructing of both the Netlink header and TLVs that are repetitive and easy to
5330 get wrong. This library aims to provide simple helpers that allows you to
5331 re-use code and to avoid re-inventing the wheel.")
5332 (license license:lgpl2.1+)))
5334 (define-public libnftnl
5341 (uri (string-append "mirror://netfilter.org/libnftnl/"
5342 "libnftnl-" version ".tar.bz2"))
5344 (base32 "1wqlxf76bkqf3qhka9sw32qhb2ni20q1k6rn3iril2kw482lvpk6"))
5346 (search-patches "libnftnl-dont-check-NFTNL_FLOWTABLE_SIZE.patch"))))
5347 (build-system gnu-build-system)
5349 `(("pkg-config" ,pkg-config)))
5351 `(("libmnl" ,libmnl)))
5352 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5353 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5354 (description "Libnftnl is a userspace library providing a low-level netlink
5355 programming interface to the in-kernel nf_tables subsystem. The library
5356 libnftnl has been previously known as libnftables. This library is currently
5358 (license license:gpl2+)))
5360 (define-public nftables
5367 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
5369 (string-append "https://www.nftables.org/projects/nftables"
5370 "/files/nftables-" version ".tar.bz2")))
5372 (base32 "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm"))))
5373 (build-system gnu-build-system)
5374 (arguments `(#:configure-flags
5375 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5376 (inputs `(("bison" ,bison)
5380 ("libnftnl" ,libnftnl)
5381 ("readline" ,readline)))
5382 (native-inputs `(("pkg-config" ,pkg-config)))
5383 (home-page "https://www.nftables.org")
5384 (synopsis "Userspace utility for Linux packet filtering")
5385 (description "nftables is the project that aims to replace the existing
5386 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5387 filtering framework, a new userspace utility and also a compatibility layer for
5388 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5389 infrastructure such as the existing hooks, the connection tracking system, the
5390 userspace queueing component and the logging subsystem.")
5391 (license license:gpl2)))
5393 (define-public proot
5401 (url "https://github.com/proot-me/PRoot.git")
5402 (commit (string-append "v" version))))
5403 (file-name (git-file-name name version))
5405 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5406 (patches (search-patches "proot-test-fhs.patch"))))
5407 (build-system gnu-build-system)
5409 '(#:make-flags '("-C" "src")
5411 #:phases (modify-phases %standard-phases
5413 (add-before 'build 'set-shell-file-name
5414 (lambda* (#:key inputs #:allow-other-keys)
5415 (substitute* (find-files "src" "\\.[ch]$")
5418 (assoc-ref inputs "bash")
5421 (add-before 'check 'fix-fhs-assumptions-in-tests
5423 (substitute* "tests/test-c6b77b77.mk"
5424 (("/bin/bash") (which "bash"))
5425 (("/usr/bin/test") (which "test")))
5426 (substitute* '("tests/test-16573e73.c")
5427 (("/bin/([a-z-]+)" _ program)
5430 (substitute* (find-files "tests" "\\.sh$")
5431 ;; Some of the tests try to "bind-mount" /bin/true.
5433 (string-append "-b " (which "true") ":"))
5434 ;; Likewise for /bin.
5435 (("-b /bin:") "-b /gnu:")
5436 ;; Others try to run /bin/sh.
5437 (("/bin/sh") (which "sh"))
5438 ;; Others assume /etc/fstab exists.
5439 (("/etc/fstab") "/etc/passwd"))
5441 (substitute* "tests/GNUmakefile"
5442 (("-b /bin:") "-b /gnu:"))
5444 ;; XXX: This test fails in an obscure corner case, just
5446 (delete-file "tests/test-kkkkkkkk.c")
5451 (let ((n (parallel-job-count)))
5452 ;; For some reason we get lots of segfaults with
5453 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5454 (setenv "PROOT_NO_SECCOMP" "1")
5456 ;; Most of the tests expect "/bin" to be in $PATH so
5457 ;; they can run things that live in $ROOTFS/bin.
5459 (string-append (getenv "PATH") ":/bin"))
5461 (invoke "make" "check" "-C" "tests"
5463 "-j" (number->string n)))))
5465 (lambda* (#:key outputs #:allow-other-keys)
5466 ;; The 'install' rule does nearly nothing.
5467 (let* ((out (assoc-ref outputs "out"))
5468 (man1 (string-append out "/share/man/man1")))
5469 ;; TODO: 'make install-care' (does not even
5470 ;; build currently.)
5471 (invoke "make" "-C" "src" "install"
5472 (string-append "PREFIX=" out))
5475 (copy-file "doc/proot/man.1"
5476 (string-append man1 "/proot.1"))
5478 (native-inputs `(("which" ,which)
5480 ;; For 'mcookie', used by some of the tests.
5481 ("util-linux" ,util-linux)))
5482 (inputs `(("talloc" ,talloc)))
5483 (home-page "https://github.com/proot-me/PRoot")
5484 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5486 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5487 and @code{binfmt_misc}. This means that users don't need any privileges or
5488 setup to do things like using an arbitrary directory as the new root
5489 file system, making files accessible somewhere else in the file system
5490 hierarchy, or executing programs built for another CPU architecture
5491 transparently through QEMU user-mode. Also, developers can use PRoot as a
5492 generic process instrumentation engine thanks to its extension mechanism.
5493 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5494 available in the kernel Linux.")
5495 (license license:gpl2+)))
5497 (define-public proot-static
5500 (name "proot-static")
5502 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5503 (inputs `(("talloc" ,talloc/static)))
5505 (substitute-keyword-arguments (package-arguments proot)
5506 ((#:make-flags flags)
5507 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5509 `(modify-phases ,phases
5510 (add-after 'strip 'remove-store-references
5511 (lambda* (#:key outputs #:allow-other-keys)
5512 (let* ((out (assoc-ref outputs "out")))
5513 (with-directory-excursion out
5514 (remove-store-references "bin/proot")
5516 ((#:allowed-references _ '("out"))
5519 (define-public cpuid
5522 (version "20200116")
5525 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5526 version ".src.tar.gz"))
5529 "1gxi4iwy6j366l6bkj1yyxhrk1rxmwfp498gikfxn8xwhij9dn0a"))))
5530 (build-system gnu-build-system)
5532 '(#:make-flags '("CC=gcc")
5533 #:tests? #f ; no tests
5534 #:phases (modify-phases %standard-phases
5535 (delete 'configure) ; no configure script
5536 (add-before 'install 'fix-makefile
5537 (lambda* (#:key outputs #:allow-other-keys)
5538 (substitute* "Makefile"
5539 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5540 ;; Make the compressed manpages writable so that the
5541 ;; reset-gzip-timestamps phase does not error out.
5542 (substitute* "Makefile"
5543 (("-m 444") "-m 644"))
5545 (inputs `(("perl" ,perl)))
5546 (supported-systems '("i686-linux" "x86_64-linux"))
5547 (home-page "http://www.etallen.com/cpuid.html")
5548 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5549 (description "cpuid dumps detailed information about the CPU(s) gathered
5550 from the CPUID instruction, and also determines the exact model of CPU(s). It
5551 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5552 NexGen, Rise, and SiS CPUs.")
5553 (license license:gpl2+)))
5555 (define-public jmtpfs
5562 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5564 (file-name (string-append name "-" version ".tar.gz"))
5567 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5568 (build-system gnu-build-system)
5572 ("libmtp" ,libmtp)))
5574 `(("pkg-config" ,pkg-config)))
5575 (home-page "https://github.com/JasonFerrara/jmtpfs")
5576 (synopsis "Use a FUSE file system to access data over MTP")
5577 (description "jmtpfs uses FUSE (file system in userspace) to provide access
5578 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
5579 the MTP device as a file system.")
5580 (license license:gpl3)))
5582 (define-public procenv
5589 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5591 (file-name (string-append name "-" version ".tar.gz"))
5593 (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
5594 (build-system gnu-build-system)
5595 (arguments `(#:configure-flags '("--disable-silent-rules")))
5596 (native-inputs `(("pkg-config" ,pkg-config)))
5597 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5598 ("groff" ,groff) ; for tests
5599 ("libselinux" ,libselinux)))
5600 (synopsis "Utility to show process environment")
5601 (description "Procenv is a command-line tool that displays as much detail about
5602 itself and its environment as possible. It can be used as a test
5603 tool, to understand the type of environment a process runs in, and for
5604 comparing system environments.")
5605 (home-page "http://github.com/jamesodhunt/procenv/")
5606 (license license:gpl3+)))
5608 (define-public libfabric
5616 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5617 version "/libfabric-" version ".tar.bz2"))
5619 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5620 (build-system gnu-build-system)
5621 (inputs `(("rdma-core" ,rdma-core)
5622 ,@(match (%current-system)
5623 ((member (package-supported-systems psm))
5627 (home-page "https://ofiwg.github.io/libfabric/")
5628 (synopsis "Open Fabric Interfaces")
5630 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5631 communication services to applications. OFI is best described as a collection
5632 of libraries and applications used to export fabric services. The key
5633 components of OFI are: application interfaces, provider libraries, kernel
5634 services, daemons, and test applications.
5636 Libfabric is a core component of OFI. It is the library that defines and
5637 exports the user-space API of OFI, and is typically the only software that
5638 applications deal with directly. It works in conjunction with provider
5639 libraries, which are often integrated directly into libfabric.")
5640 (license (list license:bsd-2 license:gpl2)))) ;dual
5645 (version "3.3.20170428")
5646 (home-page "https://github.com/intel/psm")
5650 (uri (git-reference (url home-page)
5651 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5652 (file-name (string-append "psm-" version ".tar.gz"))
5654 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5655 (patches (search-patches
5656 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5657 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5658 "psm-repro.patch" ; reproducibility
5659 "psm-disable-memory-stats.patch"))))
5660 (build-system gnu-build-system)
5661 (outputs '("out" "debug"))
5662 (inputs `(("libuuid" ,util-linux)))
5664 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5665 ,(string-append "INSTALL_PREFIX=" %output)
5666 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5668 #:phases (modify-phases %standard-phases
5670 (add-after 'unpack 'patch-/usr/include
5672 (substitute* "Makefile"
5673 (("\\$\\{DESTDIR}/usr/include")
5674 (string-append %output "/include")))
5675 (substitute* "Makefile"
5676 (("/lib64") "/lib"))
5678 (add-after 'unpack 'patch-sysmacros
5680 (substitute* "ipath/ipath_proto.c"
5681 (("#include <sys/poll.h>" m)
5682 (string-append m "\n"
5683 "#include <sys/sysmacros.h>")))
5685 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5687 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5688 communications interface for the True Scale family of products. PSM users are
5689 enabled with mechanisms necessary to implement higher level communications
5690 interfaces in parallel environments.")
5691 ;; Only Intel-compatable processors are supported.
5692 (supported-systems '("i686-linux" "x86_64-linux"))
5693 (license (list license:bsd-2 license:gpl2)))) ;dual
5695 (define-public snapscreenshot
5697 (name "snapscreenshot")
5698 (version "1.0.14.3")
5702 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5703 name "-" version ".tar.bz2"))
5705 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5706 (build-system gnu-build-system)
5709 (let ((out (assoc-ref %outputs "out")))
5710 (list (string-append "BINDIR=" out "/bin")
5711 (string-append "MANDIR=" out "/share/man")))
5712 #:tests? #f ; no test suite
5714 (modify-phases %standard-phases
5715 (delete 'configure) ; ./configure is a snarky no-op
5716 (add-before 'install 'fix-ownership
5717 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5719 (substitute* "depfun.mak"
5720 ((" -o bin -g bin ") " "))
5722 (add-before 'install 'create-output-directories
5723 (lambda* (#:key outputs #:allow-other-keys)
5724 (let ((out (assoc-ref outputs "out")))
5725 (mkdir-p (string-append out "/share/man/man1"))
5727 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
5728 (synopsis "Take screenshots of one or more Linux text consoles")
5730 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
5731 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
5732 relevant @file{/dev/vcs*} file(s).")
5733 (license license:gpl2)))
5735 (define-public fbcat
5742 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
5743 version "/" name "-" version ".tar.gz"))
5745 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
5746 (build-system gnu-build-system)
5748 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
5749 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
5750 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
5751 `(("pnmtopng" ,netpbm)))
5752 (outputs (list "out" "fbgrab"))
5756 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5757 #:tests? #f ; no tests
5759 (modify-phases %standard-phases
5760 (delete 'configure) ; no configure script
5761 (add-after 'build 'qualify-references
5762 (lambda* (#:key inputs outputs #:allow-other-keys)
5763 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5764 (out (assoc-ref outputs "out")))
5765 (substitute* "fbgrab"
5767 (string-append out "/bin/" all))
5769 (string-append pnmtopng "/bin/" all)))
5771 (add-after 'install 'split-fbgrab-output
5772 (lambda* (#:key outputs #:allow-other-keys)
5773 (let* ((out (assoc-ref outputs "out"))
5774 (out:fbgrab (assoc-ref outputs "fbgrab")))
5775 (for-each (lambda (file)
5776 (let ((old (string-append out "/" file))
5777 (new (string-append out:fbgrab "/" file)))
5778 (mkdir-p (dirname new))
5779 (rename-file old new)))
5781 "share/man/man1/fbgrab.1"))
5783 (home-page "https://jwilk.net/software/fbcat")
5784 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
5786 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
5787 a dump therof. It supports a wide range of drivers and pixel formats.
5788 @command{fbcat} can take screenshots of virtually any application that can be
5789 made to write its output to the framebuffer, including (but not limited to)
5790 text-mode or graphical applications that don't use a display server.
5792 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
5793 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
5794 (license license:gpl2)))
5796 (define-public libcgroup
5804 "mirror://sourceforge/libcg/" name "/"
5805 version "/" name "-" version ".tar.bz2"))
5807 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
5808 (build-system gnu-build-system)
5815 `(("linux-pam" ,linux-pam)))
5816 (home-page "https://sourceforge.net/projects/libcg/")
5817 (synopsis "Control groups management tools")
5818 (description "Control groups is Linux kernel method for process resource
5819 restriction, permission handling and more. This package provides userspace
5820 interface to this kernel feature.")
5821 (license license:lgpl2.1)))
5823 (define-public mbpfan
5831 (url "https://github.com/dgraziotin/mbpfan.git")
5832 (commit (string-append "v" version))))
5833 (file-name (git-file-name name version))
5835 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5836 (build-system gnu-build-system)
5838 '(#:tests? #f ; tests ask to be run as root
5839 #:make-flags (let ((out (assoc-ref %outputs "out")))
5840 (list (string-append "DESTDIR=" out)
5843 (modify-phases %standard-phases
5844 (add-after 'unpack 'patch-paths
5846 (substitute* "Makefile"
5849 (delete 'configure)))) ; there's no configure phase
5850 (home-page "https://github.com/dgraziotin/mbpfan")
5851 (synopsis "Control fan speed on Macbooks")
5853 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
5854 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
5855 module. It can be executed as a daemon or in the foreground with root
5857 (license license:gpl3+)))
5866 (url "https://github.com/intel/opa-psm2.git")
5867 (commit (string-append "PSM2_" version))))
5868 (file-name (git-file-name name version))
5871 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
5872 (build-system gnu-build-system)
5875 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5877 #:phases (modify-phases %standard-phases
5879 (add-after 'unpack 'patch-Makefiles
5881 (substitute* "Makefile"
5884 (substitute* "compat/Makefile"
5890 (setenv "DESTDIR" %output)
5891 (invoke "make" "install")
5894 `(("rdma-core" ,rdma-core)
5895 ("numactl" ,numactl)))
5896 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
5898 "This package is low-level user-level Intel's communications interface.
5899 The PSM2 API is a high-performance vendor-specific protocol that provides a
5900 low-level communications interface for the Intel Omni-Path family of
5901 high-speed networking devices.")
5902 (home-page "https://github.com/intel/opa-psm2")
5903 ;; Only the x86_64 architecure is supported.
5904 (supported-systems '("x86_64-linux"))
5905 (license (list license:bsd-3 license:gpl2)))) ; dual
5907 (define-public libpfm4
5913 (uri (string-append "mirror://sourceforge/perfmon2/"
5914 name "/libpfm-" version ".tar.gz"))
5917 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
5918 (build-system gnu-build-system)
5920 '(#:modules ((guix build utils)
5921 (guix build gnu-build-system))
5922 #:phases (modify-phases %standard-phases
5926 (lambda* (#:key inputs outputs #:allow-other-keys)
5927 (let* ((out (assoc-ref outputs "out")))
5932 (lambda* (#:key outputs #:allow-other-keys)
5933 (let* ((out (assoc-ref outputs "out")))
5935 (string-append "PREFIX=" out)
5938 (synopsis "Performance event monitoring library")
5940 "This package provides a library called libpfm4, which is used to develop
5941 monitoring tools exploiting the performance monitoring events such as those
5942 provided by the Performance Monitoring Unit (PMU) of modern processors.
5944 Libpfm4 helps convert from an event name, expressed as a string, to the event
5945 encoding that is either the raw event as documented by the hardware vendor or
5946 the OS-specific encoding. In the latter case, the library is able to prepare
5947 the OS-specific data structures needed by the kernel to setup the event.
5949 libpfm4 provides support for the @code{perf_events} interface, which was
5950 introduced in Linux 2.6.31.")
5951 (home-page "http://perfmon2.sourceforge.net/")
5952 (license license:expat)))
5954 (define-public libnfnetlink
5956 (name "libnfnetlink")
5961 "https://www.netfilter.org/projects/libnfnetlink/files/"
5962 "libnfnetlink-" version ".tar.bz2"))
5965 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
5966 (build-system gnu-build-system)
5967 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
5968 (synopsis "Low-level netfilter netlink communication library")
5970 "@code{libnfnetlink} is the low-level library for netfilter related
5971 kernel/userspace communication. It provides a generic messaging
5972 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
5973 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
5974 management tools in userspace.")
5975 (license license:gpl2)))
5977 (define-public go-netlink
5984 (url "https://github.com/vishvananda/netlink.git")
5985 (commit (string-append "v" version))))
5986 (file-name (git-file-name name version))
5989 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
5990 (build-system go-build-system)
5992 `(#:import-path "github.com/vishvananda/netlink"))
5994 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
5995 ("go-netns" ,go-netns)))
5996 (home-page "https://github.com/vishvananda/netlink")
5997 (synopsis "Simple netlink library for Go")
5998 (description "The netlink package provides a simple netlink library for
5999 Go. Netlink is the interface a user-space program in Linux uses to
6000 communicate with the kernel. It can be used to add and remove interfaces, set
6001 IP addresses and routes, and configure IPsec.")
6002 (license license:asl2.0)))
6004 (define-public xfsprogs
6011 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6012 "xfsprogs-" version ".tar.gz"))
6015 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
6016 (build-system gnu-build-system)
6017 (outputs (list "out" "python"))
6019 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6021 (modify-phases %standard-phases
6022 (add-after 'install 'separate-python-output
6023 (lambda* (#:key outputs #:allow-other-keys)
6024 (let ((out (assoc-ref outputs "out"))
6025 (python (assoc-ref outputs "python")))
6028 (mkdir-p (string-append python (dirname script)))
6029 (rename-file (string-append out script)
6030 (string-append python script)))
6031 (list "/sbin/xfs_scrub_all"))
6033 (add-after 'install 'install-headers
6035 (invoke "make" "install-dev"))))))
6037 `(("gettext" ,gettext-minimal)))
6039 `(("libuuid" ,util-linux)
6040 ("python" ,python-wrapper)))
6041 (home-page "https://xfs.wiki.kernel.org/")
6042 (synopsis "XFS file system tools")
6043 (description "This package provides commands to create and check XFS
6045 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6046 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6047 (license (list license:gpl2 license:lgpl2.1))))
6049 (define-public genext2fs
6056 (url "https://github.com/jeremie-koenig/genext2fs.git")
6057 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6058 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6059 (file-name (git-file-name name version))
6061 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6062 (build-system gnu-build-system)
6065 (modify-phases %standard-phases
6066 (add-after 'unpack 'apply-debian-patches
6067 ;; Debian changes (the revision after ‘-’ in VERSION) are
6068 ;; maintained as separate patches. Apply those relevant to us.
6072 (invoke "patch" "-p1" "-i"
6073 (string-append "debian/patches/" file-name)))
6074 (list "blocksize+creator.diff" ; add -B/-o options
6075 "byteswap_fix.diff"))
6078 `(("autoconf" ,autoconf)
6079 ("automake" ,automake)))
6080 (home-page "https://github.com/jeremie-koenig/genext2fs")
6081 (synopsis "Generate ext2 file system as a normal user")
6082 (description "This package provides a program to generate an ext2
6083 file system as a normal (non-root) user. It does not require you to mount
6084 the image file to copy files on it, nor does it require that you become
6085 the superuser to make device nodes.")
6086 (license license:gpl2)))
6088 (define-public fakeroot
6094 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6095 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6096 (file-name (string-append name "-" version ".tar.gz"))
6099 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6100 (build-system gnu-build-system)
6103 (modify-phases %standard-phases
6104 (add-after 'configure 'patch-Makefile
6106 ;; Note: The root of the problem is already in "Makefile.am".
6107 (substitute* "Makefile"
6108 (("/bin/sh") (which "sh")))
6110 (add-after 'unpack 'patch-getopt
6111 (lambda* (#:key inputs #:allow-other-keys)
6112 (substitute* "scripts/fakeroot.in"
6114 (string-append (assoc-ref inputs "util-linux")
6117 (add-before 'configure 'setenv
6119 (setenv "LIBS" "-lacl")
6121 (add-before 'check 'prepare-check
6123 (setenv "SHELL" (which "bash"))
6124 (setenv "VERBOSE" "1")
6125 (substitute* "test/t.touchinstall"
6126 ;; We don't have the name of the root user, so use ID=0.
6127 (("grep root") "grep \"\\<0\\>\""))
6128 (substitute* "test/tartest"
6129 ;; We don't have the name of the root group, so use ID=0.
6130 (("ROOTGROUP=root") "ROOTGROUP=0")
6131 ;; We don't have the name of the daemon user, so use IDs.
6132 (("daemon:sys") "1:3")
6134 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6135 (substitute* "test/compare-tar"
6136 (("tar -tvf") "tar --numeric-owner -tvf"))
6140 ("sharutils" ,sharutils) ; for the tests
6141 ("xz" ,xz))) ; for the tests
6143 `(("libcap" ,libcap)
6144 ("util-linux" ,util-linux)))
6145 (synopsis "Provides a fake root environment")
6146 (description "@command{fakeroot} runs a command in an environment where
6147 it appears to have root privileges for file manipulation. This is useful
6148 for allowing users to create archives (tar, ar, .deb etc.) with files in
6149 them with root permissions/ownership. Without fakeroot one would have to
6150 have root privileges to create the constituent files of the archives with
6151 the correct permissions and ownership, and then pack them up, or one would
6152 have to construct the archives directly, without using the archiver.")
6153 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6154 (license license:gpl3+)))
6156 (define-public inputattach
6158 (name "inputattach")
6163 (url "https://github.com/linuxwacom/input-wacom.git")
6164 (commit (string-append "input-wacom-" version))))
6165 (file-name (git-file-name name version))
6167 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6168 (build-system gnu-build-system)
6171 (modify-phases %standard-phases
6175 (lambda* (#:key inputs #:allow-other-keys)
6176 (with-directory-excursion "inputattach"
6177 (invoke (string-append (assoc-ref inputs "gcc")
6179 "-O2" "-o" "inputattach" "inputattach.c"))
6183 (lambda* (#:key outputs #:allow-other-keys)
6184 (let ((target-dir (string-append
6185 (assoc-ref outputs "out")
6187 (mkdir-p target-dir)
6188 (copy-file "inputattach/inputattach"
6189 (string-append target-dir
6192 (home-page "https://linuxwacom.github.io/")
6193 (synopsis "Dispatch input peripherals events to a device file")
6194 (description "inputattach dispatches input events from several device
6195 types and interfaces and translates so that the X server can use them.")
6196 (license license:gpl2+)))
6198 (define-public pipewire
6205 (url "https://github.com/PipeWire/pipewire")
6207 (file-name (git-file-name name version))
6210 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
6211 (build-system meson-build-system)
6213 '(#:configure-flags '("-Dsystemd=false")))
6215 `(("pkg-config" ,pkg-config)))
6217 `(("alsa-lib" ,alsa-lib)
6221 ("gstreamer" ,gstreamer)
6222 ("gst-plugins-base" ,gst-plugins-base)
6226 (home-page "https://pipewire.org/")
6227 (synopsis "Server and user space API to deal with multimedia pipelines")
6229 "PipeWire is a project that aims to greatly improve handling of audio and
6230 video under Linux. It aims to support the usecases currently handled by both
6231 PulseAudio and Jack and at the same time provide same level of powerful handling
6232 of Video input and output. It also introduces a security model that makes
6233 interacting with audio and video devices from containerized applications easy,
6234 with supporting Flatpak applications being the primary goal. Alongside Wayland
6235 and Flatpak we expect PipeWire to provide a core building block for the future
6236 of Linux application development.")
6237 (license license:lgpl2.0+)))
6246 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6248 (file-name (git-file-name name version))
6251 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6252 (build-system gnu-build-system)
6255 (modify-phases %standard-phases
6256 (add-after 'unpack 'fix-dbus-tests
6258 (substitute* '("unit/test-dbus-message-fds.c"
6259 "unit/test-dbus-properties.c"
6261 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6265 ("libtool" ,libtool)))
6267 `(("autoconf" ,autoconf)
6268 ("pkgconfig" ,pkg-config)
6269 ("automake" ,automake)))
6270 (home-page "https://01.org/ell")
6271 (synopsis "Embedded Linux Library")
6272 (description "The Embedded Linux* Library (ELL) provides core, low-level
6273 functionality for system daemons. It typically has no dependencies other than
6274 the Linux kernel, C standard library, and libdl (for dynamic linking). While
6275 ELL is designed to be efficient and compact enough for use on embedded Linux
6276 platforms, it is not limited to resource-constrained systems.")
6277 (license license:lgpl2.1+)))