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 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 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 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>
42 ;;; This file is part of GNU Guix.
44 ;;; GNU Guix is free software; you can redistribute it and/or modify it
45 ;;; under the terms of the GNU General Public License as published by
46 ;;; the Free Software Foundation; either version 3 of the License, or (at
47 ;;; your option) any later version.
49 ;;; GNU Guix is distributed in the hope that it will be useful, but
50 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
51 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52 ;;; GNU General Public License for more details.
54 ;;; You should have received a copy of the GNU General Public License
55 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
57 (define-module (gnu packages linux)
58 #:use-module (gnu packages)
59 #:use-module (gnu packages acl)
60 #:use-module (gnu packages admin)
61 #:use-module (gnu packages algebra)
62 #:use-module (gnu packages attr)
63 #:use-module (gnu packages audio)
64 #:use-module (gnu packages autotools)
65 #:use-module (gnu packages backup)
66 #:use-module (gnu packages base)
67 #:use-module (gnu packages bash)
68 #:use-module (gnu packages bison)
69 #:use-module (gnu packages calendar)
70 #:use-module (gnu packages check)
71 #:use-module (gnu packages crypto)
72 #:use-module (gnu packages cryptsetup)
73 #:use-module (gnu packages compression)
74 #:use-module (gnu packages dbm)
75 #:use-module (gnu packages datastructures)
76 #:use-module (gnu packages docbook)
77 #:use-module (gnu packages documentation)
78 #:use-module (gnu packages elf)
79 #:use-module (gnu packages flex)
80 #:use-module (gnu packages file)
81 #:use-module (gnu packages freedesktop)
82 #:use-module (gnu packages gcc)
83 #:use-module (gnu packages gettext)
84 #:use-module (gnu packages glib)
85 #:use-module (gnu packages golang)
86 #:use-module (gnu packages gperf)
87 #:use-module (gnu packages gstreamer)
88 #:use-module (gnu packages gtk)
89 #:use-module (gnu packages libunwind)
90 #:use-module (gnu packages libusb)
91 #:use-module (gnu packages man)
92 #:use-module (gnu packages maths)
93 #:use-module (gnu packages multiprecision)
94 #:use-module (gnu packages ncurses)
95 #:use-module (gnu packages netpbm)
96 #:use-module (gnu packages networking)
97 #:use-module (gnu packages ninja)
98 #:use-module (gnu packages nss)
99 #:use-module (gnu packages perl)
100 #:use-module (gnu packages pciutils)
101 #:use-module (gnu packages pkg-config)
102 #:use-module (gnu packages popt)
103 #:use-module (gnu packages pulseaudio)
104 #:use-module (gnu packages python)
105 #:use-module (gnu packages python-xyz)
106 #:use-module (gnu packages readline)
107 #:use-module (gnu packages rrdtool)
108 #:use-module (gnu packages samba)
109 #:use-module (gnu packages sdl)
110 #:use-module (gnu packages serialization)
111 #:use-module (gnu packages slang)
112 #:use-module (gnu packages texinfo)
113 #:use-module (gnu packages tls)
114 #:use-module (gnu packages valgrind)
115 #:use-module (gnu packages video)
116 #:use-module (gnu packages web)
117 #:use-module (gnu packages xiph)
118 #:use-module (gnu packages xml)
119 #:use-module (gnu packages xdisorg)
120 #:use-module (gnu packages xorg)
121 #:use-module (gnu packages groff)
122 #:use-module (gnu packages rsync)
123 #:use-module (gnu packages selinux)
124 #:use-module (gnu packages swig)
125 #:use-module (guix build-system cmake)
126 #:use-module (guix build-system gnu)
127 #:use-module (guix build-system go)
128 #:use-module (guix build-system meson)
129 #:use-module (guix build-system python)
130 #:use-module (guix build-system trivial)
131 #:use-module (guix build-system linux-module)
132 #:use-module (guix download)
133 #:use-module (guix git-download)
134 #:use-module ((guix licenses) #:prefix license:)
135 #:use-module (guix packages)
136 #:use-module (guix gexp)
137 #:use-module (guix store)
138 #:use-module (guix monads)
139 #:use-module (guix utils)
140 #:use-module (srfi srfi-1)
141 #:use-module (srfi srfi-2)
142 #:use-module (srfi srfi-26)
143 #:use-module (ice-9 match))
145 (define-public (system->linux-architecture arch)
146 "Return the Linux architecture name for ARCH, a Guix system name such as
147 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
148 (let ((arch (car (string-split arch #\-))))
149 (cond ((string=? arch "i686") "i386")
150 ((string-prefix? "mips" arch) "mips")
151 ((string-prefix? "arm" arch) "arm")
152 ((string-prefix? "aarch64" arch) "arm64")
153 ((string-prefix? "alpha" arch) "alpha")
154 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
155 ((string-prefix? "s390" arch) "s390")
156 ((string-prefix? "riscv" arch) "riscv")
159 (define-public (system->defconfig system)
160 "Some systems (notably powerpc-linux) require a special target for kernel
161 defconfig. Return the appropriate make target if applicable, otherwise return
163 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
164 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
169 ;;; Kernel source code deblobbing.
172 (define (linux-libre-deblob-scripts version
175 (list (version-major+minor version)
178 (uri (string-append "https://linux-libre.fsfla.org"
179 "/pub/linux-libre/releases/" version "-gnu/"
180 "deblob-" (version-major+minor version)))
181 (sha256 deblob-hash))
184 (uri (string-append "https://linux-libre.fsfla.org"
185 "/pub/linux-libre/releases/" version "-gnu/"
187 (sha256 deblob-check-hash))))
189 (define deblob-scripts-5.4
190 (linux-libre-deblob-scripts
192 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
193 (base32 "09hy3jqb8lny861pxjbjvzg90imi8p7z10j14xp0rclxmyb81rk3")))
195 (define deblob-scripts-4.19
196 (linux-libre-deblob-scripts
198 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
199 (base32 "0xpcl6pd1280gm81bivz45dfhy6v16j0hghxhjynmcbasgnx8vpd")))
201 (define deblob-scripts-4.14
202 (linux-libre-deblob-scripts
204 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
205 (base32 "0yd0c3qxk5rm686j4kd5v4zppjj3k9ivqnv46z4p3xh1gqmhv7cz")))
207 (define deblob-scripts-4.9
208 (linux-libre-deblob-scripts
210 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
211 (base32 "0is8gn4qdd7h5l6lacvhqdch26lmrbgxfm8ab7fx8n85ha7y358w")))
213 (define deblob-scripts-4.4
214 (linux-libre-deblob-scripts
216 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
217 (base32 "12ac4g3ky8yma8sylmxvvysqvd4hnaqjiwmxrxb6wlxggfd7zkbx")))
219 (define* (computed-origin-method gexp-promise hash-algo hash
220 #:optional (name "source")
221 #:key (system (%current-system))
222 (guile (default-guile)))
223 "Return a derivation that executes the G-expression that results
224 from forcing GEXP-PROMISE."
225 (mlet %store-monad ((guile (package->derivation guile system)))
226 (gexp->derivation (or name "computed-origin")
228 #:graft? #f ;nothing to graft
230 #:guile-for-build guile)))
232 (define (make-linux-libre-source version
235 "Return a 'computed' origin that generates a Linux-libre tarball from the
236 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
237 (match deblob-scripts
238 ((deblob-version (? origin? deblob) (? origin? deblob-check))
239 (unless (string=? deblob-version (version-major+minor version))
240 ;; The deblob script cannot be expected to work properly on a
241 ;; different version (major+minor) of Linux, even if no errors
242 ;; are signaled during execution.
243 (error "deblob major+minor version mismatch"))
245 (method computed-origin-method)
246 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
250 (with-imported-modules '((guix build utils))
252 (use-modules (guix build utils)
256 (let ((dir (string-append "linux-" #$version)))
259 (set-path-environment-variable
262 #+(canonical-package bash)
263 #+(canonical-package coreutils)
264 #+(canonical-package diffutils)
265 #+(canonical-package findutils)
266 #+(canonical-package patch)
267 #+(canonical-package xz)
268 #+(canonical-package sed)
269 #+(canonical-package grep)
270 #+(canonical-package bzip2)
271 #+(canonical-package gzip)
272 #+(canonical-package tar)
273 ;; The comments in the 'deblob-check' script
274 ;; claim that it supports Python 2 and 3, but
275 ;; in fact it fails when run in Python 3 as
279 (with-directory-excursion "/tmp/bin"
281 (copy-file #+deblob "deblob")
282 (chmod "deblob" #o755)
283 (substitute* "deblob"
284 (("/bin/sh") (which "sh")))
286 (copy-file #+deblob-check "deblob-check")
287 (chmod "deblob-check" #o755)
288 (substitute* "deblob-check"
289 (("/bin/sh") (which "sh"))
290 (("/bin/sed") (which "sed"))
291 (("/usr/bin/python") (which "python"))))
293 (if (file-is-directory? #+upstream-source)
295 (format #t "Copying upstream linux source...~%")
297 (invoke "cp" "--archive" #+upstream-source dir)
298 (invoke "chmod" "--recursive" "u+w" dir))
300 (format #t "Unpacking upstream linux tarball...~%")
302 (invoke "tar" "xf" #$upstream-source)
305 (and (not (member name '("." "..")))
306 (file-is-directory? name))))
308 (unless (string=? dir unpacked-dir)
309 (rename-file unpacked-dir dir)))
311 (error "multiple directories found" dirs)))))
313 (with-directory-excursion dir
314 (setenv "PYTHON" (which "python"))
315 (format #t "Running deblob script...~%")
317 (invoke "/tmp/bin/deblob"))
319 (format #t "~%Packing new Linux-libre tarball...~%")
321 (invoke "tar" "cvfa" #$output
322 ;; Avoid non-determinism in the archive.
335 (define (linux-libre-urls version)
336 "Return a list of URLs for Linux-Libre VERSION."
338 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
339 version "-gnu/linux-libre-" version "-gnu.tar.xz")
341 ;; XXX: Work around <http://bugs.gnu.org/14851>.
343 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
344 version "-gnu.tar.xz")
346 ;; Maybe this URL will become valid eventually.
348 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
349 version "-gnu.tar.xz")))
351 (define (%upstream-linux-source version hash)
354 (uri (string-append "mirror://kernel.org"
355 "/linux/kernel/v" (version-major version) ".x/"
356 "linux-" version ".tar.xz"))
359 (define-public linux-libre-5.4-version "5.4.8")
360 (define-public linux-libre-5.4-pristine-source
361 (let ((version linux-libre-5.4-version)
362 (hash (base32 "0llss8hbzkwqxx92y419vj2jvq0d8k52iivh3f59wgqr0b4i9i22")))
363 (make-linux-libre-source version
364 (%upstream-linux-source version hash)
365 deblob-scripts-5.4)))
367 (define-public linux-libre-4.19-version "4.19.93")
368 (define-public linux-libre-4.19-pristine-source
369 (let ((version linux-libre-4.19-version)
370 (hash (base32 "0d2qgwnmvnwbsijc8k85sgmywyrv55wpah6qwjk6kgx8h8zx5x9a")))
371 (make-linux-libre-source version
372 (%upstream-linux-source version hash)
373 deblob-scripts-4.19)))
375 (define-public linux-libre-4.14-version "4.14.162")
376 (define-public linux-libre-4.14-pristine-source
377 (let ((version linux-libre-4.14-version)
378 (hash (base32 "0jwbr7q17khv0174hl0kp78bsyhjv0mljfvrnbl9qdfl9hi70lgn")))
379 (make-linux-libre-source version
380 (%upstream-linux-source version hash)
381 deblob-scripts-4.14)))
383 (define-public linux-libre-4.9-version "4.9.208")
384 (define-public linux-libre-4.9-pristine-source
385 (let ((version linux-libre-4.9-version)
386 (hash (base32 "0njjw1i8dilihn1hz62zra4b9y05fb3r2k2sqlkd0wfn86c1rbdp")))
387 (make-linux-libre-source version
388 (%upstream-linux-source version hash)
389 deblob-scripts-4.9)))
391 (define-public linux-libre-4.4-version "4.4.208")
392 (define-public linux-libre-4.4-pristine-source
393 (let ((version linux-libre-4.4-version)
394 (hash (base32 "03jj91z5dc0ybpjy9w6aanb3k53gcj7gsjc32h3ldf72hlmgz6aq")))
395 (make-linux-libre-source version
396 (%upstream-linux-source version hash)
397 deblob-scripts-4.4)))
399 (define %boot-logo-patch
400 ;; Linux-Libre boot logo featuring Freedo and a gnu.
403 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
404 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
407 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
409 (define %linux-libre-arm-export-__sync_icache_dcache-patch
413 "https://salsa.debian.org/kernel-team/linux"
414 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
415 "/debian/patches/bugfix/arm/"
416 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
417 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
419 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
421 (define (source-with-patches source patches)
424 (patches (append (origin-patches source)
427 (define-public linux-libre-5.4-source
428 (source-with-patches linux-libre-5.4-pristine-source
429 (list %boot-logo-patch
430 %linux-libre-arm-export-__sync_icache_dcache-patch)))
432 (define-public linux-libre-4.19-source
433 (source-with-patches linux-libre-4.19-pristine-source
434 (list %boot-logo-patch
435 %linux-libre-arm-export-__sync_icache_dcache-patch)))
437 (define-public linux-libre-4.14-source
438 (source-with-patches linux-libre-4.14-pristine-source
439 (list %boot-logo-patch)))
441 (define-public linux-libre-4.9-source
442 (source-with-patches linux-libre-4.9-pristine-source
443 (list %boot-logo-patch)))
445 (define-public linux-libre-4.4-source
446 (source-with-patches linux-libre-4.4-pristine-source
447 (list %boot-logo-patch)))
454 (define (make-linux-libre-headers version hash-string)
455 (make-linux-libre-headers* version
458 (uri (linux-libre-urls version))
459 (sha256 (base32 hash-string)))))
461 (define (make-linux-libre-headers* version source)
463 (name "linux-libre-headers")
466 (build-system gnu-build-system)
467 (native-inputs `(("perl" ,perl)
468 ,@(if (version>=? version "4.16")
472 ,@(if (version>=? version "5.3")
476 `(#:modules ((guix build gnu-build-system)
480 (modify-phases %standard-phases
484 (let ((arch ,(system->linux-architecture
485 (or (%current-target-system)
487 (defconfig ,(system->defconfig
488 (or (%current-target-system)
489 (%current-system)))))
491 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
492 (invoke "make" defconfig)
493 (invoke "make" "mrproper" "headers_check"))))
495 (lambda* (#:key outputs #:allow-other-keys)
496 (let ((out (assoc-ref outputs "out")))
498 (string-append "INSTALL_HDR_PATH=" out)
501 (mkdir (string-append out "/include/config"))
502 (call-with-output-file
504 "/include/config/kernel.release")
506 (format p "~a-default~%" ,version)))
508 ;; Remove the '.install' and '..install.cmd' files; the
509 ;; latter contains store paths, which pulls in bootstrap
510 ;; binaries in the build environment, and prevents bit
511 ;; reproducibility for the bootstrap binaries.
512 (for-each delete-file (find-files out "\\.install"))
515 #:allowed-references ()
517 (home-page "https://www.gnu.org/software/linux-libre/")
518 (synopsis "GNU Linux-Libre kernel headers")
519 (description "Headers of the Linux-Libre kernel.")
520 (license license:gpl2)))
522 (define-public linux-libre-headers-5.4
523 (make-linux-libre-headers* linux-libre-5.4-version
524 linux-libre-5.4-source))
526 (define-public linux-libre-headers-4.19
527 (make-linux-libre-headers* linux-libre-4.19-version
528 linux-libre-4.19-source))
530 (define-public linux-libre-headers-4.14
531 (make-linux-libre-headers* linux-libre-4.14-version
532 linux-libre-4.14-source))
534 (define-public linux-libre-headers-4.9
535 (make-linux-libre-headers* linux-libre-4.9-version
536 linux-libre-4.9-source))
538 (define-public linux-libre-headers-4.4
539 (make-linux-libre-headers* linux-libre-4.4-version
540 linux-libre-4.4-source))
542 ;; The following package is used in the early bootstrap, and thus must be kept
543 ;; stable and with minimal build requirements.
544 (define-public linux-libre-headers-4.19.56
545 (make-linux-libre-headers "4.19.56"
546 "1zqiic55viy065lhnkmhn33sz3bbbr2ykbm5f92yzd8lpc9zl7yx"))
548 (define-public linux-libre-headers linux-libre-headers-4.19.56)
552 ;;; Kernel configurations.
555 (define* (kernel-config arch #:key variant)
556 "Return the absolute file name of the Linux-Libre build configuration file
557 for ARCH and optionally VARIANT, or #f if there is no such configuration."
558 (let* ((name (string-append (if variant (string-append variant "-") "")
559 (if (string=? "i386" arch) "i686" arch) ".conf"))
560 (file (string-append "linux-libre/" name)))
561 (search-auxiliary-file file)))
563 ;; FIXME: merge into kernel-config
564 (define* (kernel-config-veyron arch #:key variant)
565 "Return the absolute file name of the Linux-Libre build configuration file
566 for ARCH and optionally VARIANT, or #f if there is no such configuration."
567 (let* ((name (string-append (if variant (string-append variant "-") "")
568 (if (string=? "i386" arch) "i686" arch) "-veyron.conf"))
569 (file (string-append "linux-libre/" name)))
570 (search-auxiliary-file file)))
572 (define %default-extra-linux-options
573 `(;; Some very mild hardening.
574 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
575 ;; All kernels should have NAMESPACES options enabled
576 ("CONFIG_NAMESPACES" . #t)
577 ("CONFIG_UTS_NS" . #t)
578 ("CONFIG_IPC_NS" . #t)
579 ("CONFIG_USER_NS" . #t)
580 ("CONFIG_PID_NS" . #t)
581 ("CONFIG_NET_NS" . #t)
582 ;; Modules required for initrd:
583 ("CONFIG_NET_9P" . m)
584 ("CONFIG_NET_9P_VIRTIO" . m)
585 ("CONFIG_VIRTIO_BLK" . m)
586 ("CONFIG_VIRTIO_NET" . m)
587 ("CONFIG_VIRTIO_PCI" . m)
588 ("CONFIG_VIRTIO_BALLOON" . m)
589 ("CONFIG_VIRTIO_MMIO" . m)
590 ("CONFIG_FUSE_FS" . m)
592 ("CONFIG_9P_FS" . m)))
594 (define (config->string options)
595 (string-join (map (match-lambda
597 (string-append option "=m"))
599 (string-append option "=y"))
601 (string-append option "=n")))
607 ;;; Kernel package utilities.
610 (define* (make-linux-libre version hash-string supported-systems
612 ;; A function that takes an arch and a variant.
613 ;; See kernel-config for an example.
615 (configuration-file #f)
616 (defconfig "defconfig")
617 (extra-options %default-extra-linux-options)
618 (patches (list %boot-logo-patch)))
619 (make-linux-libre* version
622 (uri (linux-libre-urls version))
623 (sha256 (base32 hash-string))
626 #:extra-version extra-version
627 #:configuration-file configuration-file
628 #:defconfig defconfig
629 #:extra-options extra-options))
631 (define* (make-linux-libre* version source supported-systems
633 ;; A function that takes an arch and a variant.
634 ;; See kernel-config for an example.
636 (configuration-file #f)
637 (defconfig "defconfig")
638 (extra-options %default-extra-linux-options))
640 (name (if extra-version
641 (string-append "linux-libre-" extra-version)
645 (supported-systems supported-systems)
646 (build-system gnu-build-system)
652 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
656 ;; These are needed to compile the GCC plugins.
661 ,@(match (and configuration-file
663 (system->linux-architecture
664 (or (%current-target-system) (%current-system)))
665 #:variant (version-major+minor version)))
666 (#f ;no config for this platform
669 `(("kconfig" ,config))))))
671 `(#:modules ((guix build gnu-build-system)
677 (modify-phases %standard-phases
678 (add-after 'unpack 'patch-/bin/pwd
680 (substitute* (find-files "." "^Makefile(\\.include)?$")
681 (("/bin/pwd") "pwd"))
684 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
685 ;; On AArch64 (at least), we need to remove glibc headers from
686 ;; CPATH (they are still available as "system headers"), so that
687 ;; the kernel can override uint64_t. See
688 ;; <https://bugs.gnu.org/37593>. This is also true when
689 ;; cross-compiling, except in that case, cross-libc must be
690 ;; removed from CROSS_CPATH.
691 (let ((var ,(if (%current-target-system)
694 (libc ,(if (%current-target-system)
700 (cut string-prefix? (assoc-ref inputs libc) <>)
701 (string-split (getenv var) #\:))
703 (format #t "environment variable `~a' changed to `~a'~%"
706 ;; Avoid introducing timestamps
707 (setenv "KCONFIG_NOTIMESTAMP" "1")
708 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
710 ;; Set ARCH and CROSS_COMPILE
711 (let ((arch ,(system->linux-architecture
712 (or (%current-target-system)
713 (%current-system)))))
715 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
718 (setenv "CROSS_COMPILE" (string-append target "-"))
719 (format #t "`CROSS_COMPILE' set to `~a'~%"
720 (getenv "CROSS_COMPILE"))))
722 (setenv "EXTRA_VERSION" ,extra-version)
724 (let ((build (assoc-ref %standard-phases 'build))
725 (config (assoc-ref (or native-inputs inputs) "kconfig")))
727 ;; Use a custom kernel configuration file or a default
728 ;; configuration file.
731 (copy-file config ".config")
732 (chmod ".config" #o666))
733 (invoke "make" ,defconfig))
735 ;; Appending works even when the option wasn't in the
736 ;; file. The last one prevails if duplicated.
737 (let ((port (open-file ".config" "a"))
738 (extra-configuration ,(config->string extra-options)))
739 (display extra-configuration port)
742 (invoke "make" "oldconfig"))))
744 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
745 (let* ((out (assoc-ref outputs "out"))
746 (moddir (string-append out "/lib/modules"))
747 (dtbdir (string-append out "/lib/dtbs"))
748 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
749 ;; Install kernel image, kernel configuration and link map.
750 (for-each (lambda (file) (install-file file out))
751 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
752 ;; Install device tree files
753 (unless (null? (find-files "." "\\.dtb$"))
755 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
757 ;; Install kernel modules
760 (string-append "DEPMOD=" kmod "/bin/depmod")
761 (string-append "MODULE_DIR=" moddir)
762 (string-append "INSTALL_PATH=" out)
763 (string-append "INSTALL_MOD_PATH=" out)
764 "INSTALL_MOD_STRIP=1"
765 "modules_install")))))
767 (home-page "https://www.gnu.org/software/linux-libre/")
768 (synopsis "100% free redistribution of a cleaned Linux kernel")
770 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
771 It has been modified to remove all non-free binary blobs.")
772 (license license:gpl2)))
776 ;;; Generic kernel packages.
779 (define-public linux-libre-5.4
780 (make-linux-libre* linux-libre-5.4-version
781 linux-libre-5.4-source
782 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
783 #:configuration-file kernel-config))
785 (define-public linux-libre-version linux-libre-5.4-version)
786 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
787 (define-public linux-libre-source linux-libre-5.4-source)
788 (define-public linux-libre linux-libre-5.4)
790 (define-public linux-libre-4.19
791 (make-linux-libre* linux-libre-4.19-version
792 linux-libre-4.19-source
793 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
794 #:configuration-file kernel-config))
796 (define-public linux-libre-4.14
797 (make-linux-libre* linux-libre-4.14-version
798 linux-libre-4.14-source
799 '("x86_64-linux" "i686-linux" "armhf-linux")
800 #:configuration-file kernel-config))
802 (define-public linux-libre-4.9
803 (make-linux-libre* linux-libre-4.9-version
804 linux-libre-4.9-source
805 '("x86_64-linux" "i686-linux")
806 #:configuration-file kernel-config))
808 (define-public linux-libre-4.4
809 (make-linux-libre* linux-libre-4.4-version
810 linux-libre-4.4-source
811 '("x86_64-linux" "i686-linux")
812 #:configuration-file kernel-config
815 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
816 ;; This option was removed upstream in version 4.7.
817 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
818 %default-extra-linux-options)))
822 ;;; Specialized kernel variants.
825 (define-public linux-libre-arm-veyron
826 (make-linux-libre* linux-libre-version
829 #:configuration-file kernel-config-veyron
830 #:extra-version "arm-veyron"))
832 (define-public linux-libre-arm-generic
833 (make-linux-libre* linux-libre-version
836 #:defconfig "multi_v7_defconfig"
837 #:extra-version "arm-generic"))
839 (define-public linux-libre-arm-generic-4.19
840 (make-linux-libre* linux-libre-4.19-version
841 linux-libre-4.19-source
843 #:defconfig "multi_v7_defconfig"
844 #:extra-version "arm-generic"))
846 (define-public linux-libre-arm-generic-4.14
847 (make-linux-libre* linux-libre-4.14-version
848 linux-libre-4.14-source
850 #:defconfig "multi_v7_defconfig"
851 #:extra-version "arm-generic"))
853 (define-public linux-libre-arm-omap2plus
854 (make-linux-libre* linux-libre-version
857 #:defconfig "omap2plus_defconfig"
858 #:extra-version "arm-omap2plus"))
860 (define-public linux-libre-arm-omap2plus-4.19
861 (make-linux-libre* linux-libre-4.19-version
862 linux-libre-4.19-source
864 #:defconfig "omap2plus_defconfig"
865 #:extra-version "arm-omap2plus"))
867 (define-public linux-libre-arm-omap2plus-4.14
868 (make-linux-libre* linux-libre-4.14-version
869 linux-libre-4.14-source
871 #:defconfig "omap2plus_defconfig"
872 #:extra-version "arm-omap2plus"))
876 ;;; Linux kernel modules.
879 (define-public acpi-call-linux-module
881 (name "acpi-call-linux-module")
887 (url "https://github.com/teleshoes/acpi_call.git")
889 (file-name (git-file-name name version))
891 (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
892 (build-system linux-module-build-system)
894 `(#:tests? #f ; no tests
896 (modify-phases %standard-phases
897 (add-after 'unpack 'fix-for-linux-4.12
899 (substitute* "acpi_call.c"
903 (add-after 'install 'install-documentation
904 (lambda* (#:key outputs #:allow-other-keys)
905 (let* ((out (assoc-ref outputs "out"))
906 (doc (string-append out "/share/doc/" ,name "-" ,version)))
907 (for-each (lambda (file)
908 (let ((target (string-append doc "/" file)))
909 (mkdir-p (dirname target))
910 (copy-recursively file target)))
911 (list "README.md" "examples"))
913 (home-page "https://github.com/teleshoes/acpi_call")
914 (synopsis "Linux kernel module to perform ACPI method calls")
916 "This simple Linux kernel module allows calls from user space to any
917 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
918 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
919 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
920 and @code{ACPI_BUFFER}.
922 It grants direct and undocumented access to your hardware that may cause damage
923 and should be used with caution, especially on untested models.")
924 (license license:gpl3+))) ; see README.md (no licence headers)
926 (define-public vhba-module
933 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
937 "1ybbk6l06n0y11n5wnfmvdz0baizmq55l458ywimghdyz0n7g0ws"))))
938 (build-system linux-module-build-system)
942 (home-page "https://cdemu.sourceforge.io/")
943 (synopsis "Kernel module that emulates SCSI devices")
944 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
945 between the CDemu userspace daemon and linux kernel.")
946 (license license:gpl2+)))
948 (define-public ddcci-driver-linux
950 (name "ddcci-driver-linux")
957 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
958 (commit (string-append "v" version))))
959 (file-name (git-file-name name version))
962 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
963 (build-system linux-module-build-system)
965 `(#:tests? #f ; no tests
967 (modify-phases %standard-phases
972 (with-directory-excursion module
973 (apply (assoc-ref %standard-phases 'build) args)))
974 '("ddcci" "ddcci-backlight"))
980 (with-directory-excursion module
981 (apply (assoc-ref %standard-phases 'install) args)))
982 '("ddcci" "ddcci-backlight"))
984 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
985 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
986 (description "This package provides two Linux kernel drivers, ddcci and
987 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
988 interface. The ddcci module creates a character device for each DDC/CI
989 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
990 module allows the control of the backlight level or luminance property when
991 supported under @file{/sys/class/backlight/}.")
992 (license license:gpl2+)))
996 ;;; Pluggable authentication modules (PAM).
999 (define-public linux-pam
1007 "https://github.com/linux-pam/linux-pam/releases/download/v"
1008 version "/Linux-PAM-" version ".tar.xz"))
1011 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1012 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1014 (build-system gnu-build-system)
1018 ;; TODO: optional dependencies
1019 ;; ("libxcrypt" ,libxcrypt)
1020 ;; ("cracklib" ,cracklib)
1023 `(;; Most users, such as `shadow', expect the headers to be under
1025 #:configure-flags (list (string-append "--includedir="
1026 (assoc-ref %outputs "out")
1027 "/include/security")
1029 ;; XXX: <rpc/rpc.h> is missing from glibc when
1030 ;; cross-compiling, so we have to disable NIS
1031 ;; support altogether.
1032 ,@(if (%current-target-system)
1036 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1039 (home-page "http://www.linux-pam.org/")
1040 (synopsis "Pluggable authentication modules for Linux")
1042 "A *Free* project to implement OSF's RFC 86.0.
1043 Pluggable authentication modules are small shared object files that can
1044 be used through the PAM API to perform tasks, like authenticating a user
1045 at login. Local and dynamic reconfiguration are its key features.")
1046 (license license:bsd-3)))
1048 (define-public linux-pam-1.2
1056 "http://www.linux-pam.org/library/"
1057 "Linux-PAM-" version ".tar.bz2"))
1060 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1061 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1068 (define-public psmisc
1075 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1078 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1079 (build-system gnu-build-system)
1081 `(,@(if (%current-target-system)
1084 "ac_cv_func_malloc_0_nonnull=yes"
1085 "ac_cv_func_realloc_0_nonnull=yes"))
1087 (inputs `(("ncurses" ,ncurses)))
1088 (home-page "https://gitlab.com/psmisc/psmisc")
1089 (synopsis "Small utilities that use the proc file system")
1091 "This PSmisc package is a set of some small useful utilities that
1092 use the proc file system. We're not about changing the world, but
1093 providing the system administrator with some help in common tasks.")
1094 (license license:gpl2+)))
1096 (define-public util-linux
1102 (uri (string-append "mirror://kernel.org/linux/utils/"
1103 "util-linux/v" (version-major+minor version) "/"
1104 "util-linux-" version ".tar.xz"))
1107 "1db2kydkwjmvgd1glkcba3adhidxw0f1x735dcjdpdjjf869sgvl"))
1108 (patches (search-patches "util-linux-tests.patch"))
1109 (modules '((guix build utils)))
1111 ;; We take 'nologin' from Shadow, the 'logger' program from
1112 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1114 (substitute* "configure"
1115 (("build_nologin=yes") "build_nologin=no")
1116 (("build_logger=yes") "build_logger=no")
1117 (("build_kill=yes") "build_kill=no"))
1119 (build-system gnu-build-system)
1121 "static")) ;>2 MiB of static .a libraries
1123 `(#:configure-flags (list "--disable-use-tty-group"
1124 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1125 ;; Don't try to chown root:root mount and umount
1126 "--disable-makeinstall-chown"
1127 ;; Install completions where our
1128 ;; bash-completion package expects them.
1129 (string-append "--with-bashcompletiondir="
1130 (assoc-ref %outputs "out")
1131 "/etc/bash_completion.d"))
1132 #:phases (modify-phases %standard-phases
1133 (add-before 'build 'set-umount-file-name
1134 (lambda* (#:key outputs #:allow-other-keys)
1135 ;; Tell 'eject' the right file name of 'umount'.
1136 (let ((out (assoc-ref outputs "out")))
1137 (substitute* "sys-utils/eject.c"
1138 (("\"/bin/umount\"")
1139 (string-append "\"" out "/bin/umount\"")))
1141 (add-before 'check 'pre-check
1142 (lambda* (#:key inputs outputs #:allow-other-keys)
1143 (let ((out (assoc-ref outputs "out"))
1144 (net (assoc-ref inputs "net-base")))
1145 ;; Change the test to refer to the right file.
1146 (substitute* "tests/ts/misc/mcookie"
1148 (string-append net "/etc/services")))
1150 (add-after 'install 'move-static-libraries
1151 (lambda* (#:key outputs #:allow-other-keys)
1152 (let ((out (assoc-ref outputs "out"))
1153 (static (assoc-ref outputs "static")))
1154 (mkdir-p (string-append static "/lib"))
1155 (with-directory-excursion out
1156 (for-each (lambda (file)
1158 (string-append static "/"
1160 (find-files "lib" "\\.a$"))
1162 ;; Remove references to the static library from the '.la'
1163 ;; files so that Libtool does the right thing when both
1164 ;; the shared and static library is available.
1165 (substitute* (find-files "lib" "\\.la$")
1166 (("old_library=.*") "old_library=''\n")))
1169 (inputs `(("zlib" ,zlib)
1170 ("ncurses" ,ncurses)
1172 ;; XXX: This is so that the 'pre-check' phase can find it.
1173 ,@(if (%current-target-system)
1174 `(("net-base" ,net-base))
1178 ("net-base" ,net-base))) ;for tests
1179 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1180 (synopsis "Collection of utilities for the Linux kernel")
1181 (description "Util-linux is a diverse collection of Linux kernel
1182 utilities. It provides dmesg and includes tools for working with file systems,
1183 block devices, UUIDs, TTYs, and many other tools.")
1185 ;; Note that util-linux doesn't use the same license for all the
1186 ;; code. GPLv2+ is the default license for a code without an
1187 ;; explicitly defined license.
1188 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1189 license:bsd-4 license:public-domain))))
1191 ;; util-linux optionally supports udev, which allows lsblk to read file system
1192 ;; metadata without special privileges. Add it as a separate package to avoid
1193 ;; a circular dependency, and to keep the size small.
1194 (define-public util-linux+udev
1197 (name "util-linux-with-udev")
1200 ,@(package-inputs util-linux)))))
1202 (define-public ddate
1208 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1210 (file-name (string-append name "-" version ".tar.gz"))
1212 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1213 (build-system cmake-build-system)
1214 (arguments '(#:tests? #f))
1215 (home-page "https://github.com/bo0ts/ddate")
1216 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1218 "ddate displays the Discordian date and holidays of a given date.
1219 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1220 by Robert Shea and Robert Anton Wilson.")
1221 (license license:public-domain)))
1223 (define-public procps
1229 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1230 "procps-ng-" version ".tar.xz"))
1233 "0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
1234 (build-system gnu-build-system)
1236 '(#:modules ((guix build utils)
1237 (guix build gnu-build-system)
1241 (modify-phases %standard-phases
1243 'install 'post-install
1244 ;; Remove commands and man pages redudant with
1246 (lambda* (#:key outputs #:allow-other-keys)
1247 (let* ((out (assoc-ref outputs "out"))
1248 (dup (append-map (cut find-files out <>)
1249 '("^kill" "^uptime"))))
1250 (for-each delete-file dup)
1252 (inputs `(("ncurses" ,ncurses)))
1253 (home-page "https://gitlab.com/procps-ng/procps/")
1254 (synopsis "Utilities that give information about processes")
1256 "Procps is the package that has a bunch of small useful utilities
1257 that give information about processes using the Linux /proc file system.
1258 The package includes the programs ps, top, vmstat, w, kill, free,
1259 slabtop, and skill.")
1260 (license license:gpl2)))
1262 (define-public usbutils
1269 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1270 "usbutils-" version ".tar.xz"))
1272 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1273 (build-system gnu-build-system)
1274 (outputs (list "out" "python"))
1277 (modify-phases %standard-phases
1278 (add-before 'bootstrap 'patch-bootstrap-scripts
1280 (substitute* "usbhid-dump/bootstrap"
1281 (("/bin/bash") (which "bash")))
1283 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1284 (substitute* "autogen.sh"
1285 (("^\\./configure.*") ""))
1287 (add-after 'install 'separate-python-output
1288 ;; Separating one Python script shaves more than 106 MiB from :out.
1289 (lambda* (#:key outputs #:allow-other-keys)
1290 (let ((out (assoc-ref outputs "out"))
1291 (out:python (assoc-ref outputs "python")))
1292 (for-each (lambda (file)
1293 (let ((old (string-append out "/" file))
1294 (new (string-append out:python "/" file)))
1295 (mkdir-p (dirname new))
1296 (rename-file old new)))
1297 (list "bin/lsusb.py"))
1302 ("python" ,python)))
1304 `(("autoconf" ,autoconf)
1305 ("automake" ,automake)
1306 ("libtool" ,libtool)
1307 ("pkg-config" ,pkg-config)))
1308 (home-page "http://www.linux-usb.org/")
1310 "Tools for working with USB devices, such as lsusb")
1312 "Tools for working with USB devices, such as lsusb.")
1313 (license license:gpl2+)))
1315 (define-public e2fsprogs
1322 "mirror://kernel.org/linux/kernel/people/tytso/"
1323 name "/v" version "/"
1324 name "-" version ".tar.xz"))
1327 "00nwl1ppjalxbnx40dsm895r3q793p8nni6n81saj7faj2szdyk5"))))
1328 (build-system gnu-build-system)
1329 (inputs `(("util-linux" ,util-linux)))
1330 (native-inputs `(("pkg-config" ,pkg-config)
1331 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1335 ("procps" ,procps)))
1337 '(;; util-linux is the preferred source for some of the libraries and
1338 ;; commands, so disable them (see, e.g.,
1339 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1340 #:configure-flags (list "--disable-libblkid"
1341 "--disable-libuuid" "--disable-uuidd"
1344 ;; Use symlinks instead of hard links for
1345 ;; 'fsck.extN' etc. This makes the resulting nar
1346 ;; smaller and is preserved across copies.
1347 "--enable-symlink-install"
1349 (string-append "LDFLAGS=-Wl,-rpath="
1350 (assoc-ref %outputs "out")
1353 ;; Install libext2fs et al.
1354 "--enable-elf-shlibs")
1357 (modify-phases %standard-phases
1358 (add-before 'configure 'patch-shells
1360 (substitute* "configure"
1361 (("/bin/sh (.*)parse-types.sh" _ dir)
1362 (string-append (which "sh") " " dir
1364 (substitute* "MCONFIG.in"
1365 (("INSTALL_SYMLINK = /bin/sh")
1366 "INSTALL_SYMLINK = sh"))
1367 (substitute* (find-files "." "^Makefile.in$")
1369 (string-append "#!" (which "sh"))))
1371 (add-after 'install 'install-libs
1372 (lambda* (#:key outputs #:allow-other-keys)
1373 (let* ((out (assoc-ref outputs "out"))
1374 (lib (string-append out "/lib")))
1375 (invoke "make" "install-libs")
1377 ;; Make the .a writable so that 'strip' works.
1378 ;; Failing to do that, due to debug symbols, we
1379 ;; retain a reference to the final
1380 ;; linux-libre-headers, which refer to the
1381 ;; bootstrap binaries.
1382 (let ((archives (find-files lib "\\.a$")))
1383 (for-each (lambda (file)
1387 (home-page "http://e2fsprogs.sourceforge.net/")
1388 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1390 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1391 (license (list license:gpl2 ;programs
1392 license:lgpl2.0 ;libext2fs
1393 license:x11)))) ;libuuid
1395 (define e2fsprogs/static
1397 (package (inherit e2fsprogs)
1399 ;; Do not build shared libraries.
1400 (substitute-keyword-arguments (package-arguments e2fsprogs)
1401 ((#:configure-flags _)
1402 '(list "--disable-blkid"))
1406 (define-public e2fsck/static
1408 (name "e2fsck-static")
1409 (version (package-version e2fsprogs))
1410 (build-system trivial-build-system)
1413 `(("e2fsprogs" ,e2fsprogs/static)))
1415 `(#:modules ((guix build utils))
1418 (use-modules (guix build utils)
1422 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1424 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1426 (with-directory-excursion bin
1427 (copy-file e2fsck "e2fsck")
1428 (remove-store-references "e2fsck")
1429 (chmod "e2fsck" #o555))
1431 (home-page (package-home-page e2fsprogs))
1432 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1433 (description "This package provides statically-linked e2fsck command taken
1434 from the e2fsprogs package. It is meant to be used in initrds.")
1435 (license (package-license e2fsprogs))))
1437 (define-public extundelete
1439 (name "extundelete")
1444 (uri (string-append "mirror://sourceforge/extundelete/"
1445 "extundelete/" version "/extundelete-"
1446 version ".tar.bz2"))
1449 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1450 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1451 (build-system gnu-build-system)
1452 (inputs `(("e2fsprogs" ,e2fsprogs)))
1453 (home-page "http://extundelete.sourceforge.net/")
1454 (synopsis "Recover deleted files from ext2/3/4 partitions")
1456 "Extundelete is a set of tools that can recover deleted files from an
1457 ext3 or ext4 partition.")
1458 (license license:gpl2)))
1460 (define-public zerofree
1464 (home-page "https://frippery.org/uml/")
1467 (uri (string-append home-page name "-" version
1471 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1472 (build-system gnu-build-system)
1475 (modify-phases %standard-phases
1476 (delete 'configure) ; no configure script
1478 ;; The Makefile lacks an ‘install’ target.
1479 (lambda* (#:key outputs #:allow-other-keys)
1480 (let* ((out (assoc-ref outputs "out"))
1481 (bin (string-append out "/bin")))
1482 (chmod "zerofree" #o555)
1483 (install-file "zerofree" bin)
1485 #:tests? #f)) ; no tests
1486 (inputs `(("libext2fs" ,e2fsprogs)))
1487 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1489 "Zerofree finds the unallocated blocks with non-zero value content in an
1490 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1491 This is a simple way to make disk images more compressible.
1492 Zerofree requires the file system to be unmounted or mounted read-only.")
1493 (license license:gpl2)))
1495 (define-public strace
1499 (home-page "https://strace.io")
1502 (uri (string-append home-page "/files/" version
1503 "/strace-" version ".tar.xz"))
1506 "0hd7sb7l99y9rcj8jjc1b6m3ryds17krsymdg3dvd40jsla0bl7p"))))
1507 (build-system gnu-build-system)
1510 (modify-phases %standard-phases
1511 (add-after 'unpack 'patch-/bin/sh
1513 (substitute* "strace.c"
1514 (("/bin/sh") (which "sh")))
1516 ;; Don't fail if the architecture doesn't support different personalities.
1517 #:configure-flags '("--enable-mpers=check")
1518 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1519 #:parallel-tests? #f)) ; undeterministic failures
1520 (native-inputs `(("perl" ,perl)))
1521 (synopsis "System call tracer for Linux")
1523 "strace is a system call tracer, i.e. a debugging tool which prints out a
1524 trace of all the system calls made by a another process/program.")
1525 (license license:lgpl2.1+)))
1527 (define-public ltrace
1533 (uri (string-append "http://www.ltrace.org/ltrace_" version
1537 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1538 (build-system gnu-build-system)
1539 (inputs `(("libelf" ,libelf)))
1541 ;; Compilation uses -Werror by default, but it fails.
1542 '(#:configure-flags '("--disable-werror")))
1543 (home-page "https://www.ltrace.org/")
1544 (synopsis "Library call tracer for Linux")
1546 "ltrace intercepts and records dynamic library calls which are called by
1547 an executed process and the signals received by that process. It can also
1548 intercept and print the system calls executed by the program.")
1549 (license license:gpl2+)))
1551 (define-public alsa-lib
1558 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1559 version ".tar.bz2"))
1562 "0hvrx0ipzqbcx4y1cmr9bgm9niifzkrhsb1ddgzzdwbk6q72d3lm"))))
1563 (build-system gnu-build-system)
1565 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1566 (assoc-ref %outputs "out")
1568 (home-page "https://www.alsa-project.org/")
1569 (synopsis "The Advanced Linux Sound Architecture libraries")
1571 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1572 MIDI functionality to the Linux-based operating system.")
1573 (license license:lgpl2.1+)))
1575 (define-public alsa-utils
1581 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1582 name "-" version ".tar.bz2"))
1585 "039c19b7091is0czl9jlrfczp7pp1jpdri0vvc4k07gl3skhn48b"))))
1586 (build-system gnu-build-system)
1588 ;; XXX: Disable man page creation until we have DocBook.
1589 '(#:configure-flags (list "--disable-xmlto"
1591 ;; The udev rule is responsible for restoring
1593 (string-append "--with-udev-rules-dir="
1594 (assoc-ref %outputs "out")
1595 "/lib/udev/rules.d"))
1597 (modify-phases %standard-phases
1598 (add-before 'check 'disable-broken-test
1600 ;; XXX: The 1.1.8 release tarball is missing a header that's
1601 ;; required for this test to work. Fixed in 1.1.9.
1602 (substitute* "axfer/test/Makefile"
1603 ((".*container-test.*") ""))
1606 'install 'pre-install
1608 ;; Don't try to mkdir /var/lib/alsa.
1609 (substitute* "Makefile"
1610 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1614 `(("libsamplerate" ,libsamplerate)
1615 ("ncurses" ,ncurses)
1616 ("alsa-lib" ,alsa-lib)
1618 ("gettext" ,gettext-minimal)))
1619 (home-page "http://www.alsa-project.org/")
1620 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1622 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1623 MIDI functionality to the Linux-based operating system.")
1625 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1627 (license license:gpl2)))
1629 (define-public alsa-plugins
1631 (name "alsa-plugins")
1635 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1636 name "-" version ".tar.bz2"))
1639 "1nj8cpbi05rb62yzs01c1k7lymdn1ch229b599hbhd0psixdx52d"))))
1640 (build-system gnu-build-system)
1641 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1642 ;; be split, there are references to both in files.
1643 ;; TODO: Remove OSS related plugins, they add support to run native
1644 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1646 (outputs '("out" "pulseaudio" "jack"))
1648 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1649 ;; for /etc/alsa. On Guix System plugins are loaded from
1650 ;; the ALSA service, and other distributions likely
1651 ;; won't use these files.
1652 "--with-alsalconfdir=/tmp/noop")
1654 (modify-phases %standard-phases
1655 (add-after 'install 'split
1656 (lambda* (#:key inputs outputs #:allow-other-keys)
1657 ;; Distribute the binaries to the various outputs.
1658 (let* ((out (assoc-ref outputs "out"))
1659 (jack (assoc-ref outputs "jack"))
1660 (jacklib (string-append jack "/lib/alsa-lib"))
1661 (pua (assoc-ref outputs "pulseaudio"))
1662 (pualib (string-append pua "/lib/alsa-lib")))
1665 (for-each (lambda (file)
1666 (rename-file file (string-append jacklib "/" (basename file))))
1667 (find-files out ".*jack\\.(la|so)"))
1670 (for-each (lambda (file)
1671 (rename-file file (string-append pualib "/" (basename file))))
1672 (find-files out ".*pulse\\.(la|so)"))
1675 `(("alsa-lib" ,alsa-lib)
1677 ("speex" ,speex) ; libspeexdsp resampling plugin
1678 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1679 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1680 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1682 `(("pkg-config" ,pkg-config)))
1683 (home-page "http://www.alsa-project.org/")
1684 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1686 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1687 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1688 by providing additional plugins which include: upmixing, downmixing, jackd and
1689 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1690 external rate conversion.")
1691 (license (list license:gpl2+
1692 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1693 license:lgpl2.1+))))
1695 (define-public iptables
1702 "mirror://netfilter.org/iptables/iptables-"
1703 version ".tar.bz2"))
1706 "0z0mgs1ghvn3slc868mgbf2g26njgrzcy5ggyb5w4i55j1a3lflr"))))
1707 (build-system gnu-build-system)
1709 `(("pkg-config" ,pkg-config)
1713 `(("libmnl" ,libmnl)
1714 ("libnftnl" ,libnftnl)))
1716 '(#:tests? #f ; no test suite
1717 #:configure-flags ; add $libdir to the RUNPATH of executables
1718 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1719 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1720 (synopsis "Programs to configure Linux IP packet filtering rules")
1722 "@command{iptables} is the user-space command line program used to
1723 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1724 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1726 This package also includes @command{ip6tables}, which is used to configure the
1729 Both commands are targeted at system administrators.")
1730 (license license:gpl2+)))
1732 (define-public ebtables
1735 (version "2.0.10-4")
1739 "mirror://netfilter.org/ebtables/ebtables-v"
1743 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1744 (build-system gnu-build-system)
1746 '(#:tests? #f ; no test suite
1748 (let* ((out (assoc-ref %outputs "out"))
1749 (bin (string-append out "/sbin"))
1750 (lib (string-append out "/lib"))
1751 (man (string-append out "/share/man"))
1752 (iptables (assoc-ref %build-inputs "iptables"))
1753 (ethertypes (string-append iptables "/etc/ethertypes")))
1754 (list (string-append "LIBDIR=" lib)
1755 (string-append "MANDIR=" man)
1756 (string-append "BINDIR=" bin)
1757 (string-append "ETHERTYPESFILE=" ethertypes)
1758 ;; With the default CFLAGS, it falis with:
1759 ;; communication.c:259:58: error: variable ‘ret’ set but not
1760 ;; used [-Werror=unused-but-set-variable]
1763 (modify-phases %standard-phases
1765 ;; no configure script
1767 (substitute* "Makefile"
1768 ;; Remove user and group options from install commands,
1769 ;; otherwise it fails with: invalid user 'root'.
1770 (("-o root -g root") "")
1771 ;; Remove 'ethertypes' from the install target.
1773 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1777 ("iptables" ,iptables)))
1778 (synopsis "Ethernet bridge frame table administration")
1779 (home-page "http://ebtables.netfilter.org/")
1781 "ebtables is an application program used to set up and maintain the
1782 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1783 analogous to the iptables application, but less complicated, due to the fact
1784 that the Ethernet protocol is much simpler than the IP protocol.")
1785 (license license:gpl2+)))
1787 (define-public iproute
1794 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1798 "0gvv269wjn4279hxr5zzwsk2c5qgswr47za3hm1x4frsk52iw76b"))))
1799 (build-system gnu-build-system)
1801 `( ;; There is a test suite, but it wants network namespaces and sudo.
1803 #:make-flags (let ((out (assoc-ref %outputs "out")))
1805 (string-append "BASH_COMPDIR=" out
1806 "/etc/bash_completion.d")
1807 (string-append "LIBDIR=" out "/lib")
1808 (string-append "HDRDIR=" out "/include")
1809 (string-append "SBINDIR=" out "/sbin")
1810 (string-append "CONFDIR=" out "/etc")
1811 (string-append "DOCDIR=" out "/share/doc/"
1813 (string-append "MANDIR=" out "/share/man")))
1814 #:phases (modify-phases %standard-phases
1815 (add-before 'install 'pre-install
1817 ;; Don't attempt to create /var/lib/arpd.
1818 (substitute* "Makefile"
1819 (("^.*ARPDDIR.*$") ""))
1823 ("iptables" ,iptables)
1824 ("libmnl" ,libmnl)))
1828 ("pkg-config" ,pkg-config)))
1830 ;; ("libmnl" ,libmnl)
1831 ;; ("util-linux" ,util-linux)
1833 "https://wiki.linuxfoundation.org/networking/iproute2")
1835 "Utilities for controlling TCP/IP networking and traffic in Linux")
1837 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1838 and traffic with the Linux kernel. The most important of these are
1839 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1842 Most network configuration manuals still refer to ifconfig and route as the
1843 primary network configuration tools, but ifconfig is known to behave
1844 inadequately in modern network environments, and both should be deprecated.")
1845 (license license:gpl2+)))
1847 (define-public net-tools
1848 ;; XXX: This package is basically unmaintained, but it provides a few
1849 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1851 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1855 (version (string-append "1.60-" revision "." (string-take commit 7)))
1858 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1859 "n/ne/net-tools/code.git/net-tools-code-"
1861 (file-name (string-append name "-" version ".zip"))
1864 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1865 (home-page "http://net-tools.sourceforge.net/")
1866 (build-system gnu-build-system)
1868 '(#:modules ((guix build gnu-build-system)
1873 (modify-phases %standard-phases
1875 (lambda* (#:key outputs #:allow-other-keys)
1876 (let ((out (assoc-ref outputs "out")))
1877 (mkdir-p (string-append out "/bin"))
1878 (mkdir-p (string-append out "/sbin"))
1880 ;; Pretend we have everything...
1881 (system "yes | make config")
1883 ;; ... except for the things we don't have.
1884 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1885 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1886 ;; that have been removed.
1887 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1888 ;; think about adding them later.
1889 (substitute* '("config.make" "config.h")
1890 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1893 (add-after 'install 'remove-redundant-commands
1894 (lambda* (#:key outputs #:allow-other-keys)
1895 ;; Remove commands and man pages redundant with Inetutils.
1896 (let* ((out (assoc-ref outputs "out"))
1897 (dup (append-map (cut find-files out <>)
1899 "^(yp|nis|dns)?domainname"))))
1900 (for-each delete-file dup)
1902 ;; Binaries that depend on libnet-tools.a don't declare that
1903 ;; dependency, making it parallel-unsafe.
1904 #:parallel-build? #f
1906 #:tests? #f ; no test suite
1907 #:make-flags (let ((out (assoc-ref %outputs "out")))
1909 (string-append "BASEDIR=" out)
1910 (string-append "INSTALLNLSDIR=" out "/share/locale")
1911 (string-append "mandir=/share/man")))))
1912 (native-inputs `(("gettext" ,gettext-minimal)
1914 (synopsis "Tools for controlling the network subsystem in Linux")
1916 "This package includes the important tools for controlling the network
1917 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1918 route. Additionally, this package contains utilities relating to particular
1919 network hardware types (plipconfig, slattach) and advanced aspects of IP
1920 configuration (iptunnel, ipmaddr).")
1921 (license license:gpl2+))))
1923 (define-public libcap
1930 "mirror://kernel.org/linux/libs/security/linux-privs/"
1931 "libcap2/libcap-" version ".tar.xz"))
1934 "0sj8kidl7qgf2qwxcbw1vadnlb30y4zvjzxswsmfdghq04npkhfs"))))
1935 (build-system gnu-build-system)
1936 (arguments '(#:phases
1937 (modify-phases %standard-phases
1939 ;; Add $libdir to the RUNPATH of executables.
1941 (substitute* "Make.Rules"
1943 (string-append "LDFLAGS := -Wl,-rpath="
1946 #:tests? #f ; no 'check' target
1947 #:make-flags (list "lib=lib"
1948 (string-append "prefix="
1949 (assoc-ref %outputs "out"))
1950 "RAISE_SETFCAP=no")))
1951 (native-inputs `(("perl" ,perl)))
1952 (inputs `(("attr" ,attr)))
1953 (home-page "https://sites.google.com/site/fullycapable/")
1954 (synopsis "Library for working with POSIX capabilities")
1956 "Libcap2 provides a programming interface to POSIX capabilities on
1957 Linux-based operating systems.")
1959 ;; License is BSD-3 or GPLv2, at the user's choice.
1960 (license license:gpl2)))
1962 (define-public bridge-utils
1964 (name "bridge-utils")
1969 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
1970 "bridge-utils-" version ".tar.xz"))
1972 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
1973 (build-system gnu-build-system)
1975 ;; The tarball lacks all the generated files.
1976 (native-inputs `(("autoconf" ,autoconf)
1977 ("automake" ,automake)))
1980 (modify-phases %standard-phases
1981 (add-before 'bootstrap 'patch-stuff
1983 ;; Fix "field ‘ip6’ has incomplete type" errors.
1984 (substitute* "libbridge/libbridge.h"
1985 (("#include <linux/if_bridge.h>")
1986 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1988 ;; Ensure that the entire build fails if one of the
1989 ;; sub-Makefiles fails.
1990 (substitute* "Makefile.in"
1991 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1992 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1995 #:tests? #f)) ; no 'check' target
1998 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1999 (synopsis "Manipulate Ethernet bridges")
2001 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2002 to connect two Ethernet segments together in a protocol independent way.
2003 Packets are forwarded based on Ethernet address, rather than IP address (like
2004 a router). Since forwarding is done at Layer 2, all protocols can go
2005 transparently through a bridge.")
2006 (license license:gpl2+)))
2008 (define-public libnl
2015 "https://github.com/thom311/libnl/releases/download/"
2016 "libnl" (string-join (string-split version #\.) "_")
2017 "/libnl-" version ".tar.gz"))
2020 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2021 (build-system gnu-build-system)
2025 ("pkg-config" ,pkg-config)
2031 "https://github.com/thom311/libnl/releases/download/libnl"
2032 (string-join (string-split version #\.) "_")
2033 "/libnl-doc-" version ".tar.gz"))
2035 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2037 `(("python-2" ,python-2)
2038 ("python-3" ,python-3)))
2039 (outputs '("out" "doc" "python2" "python3"))
2041 `(#:modules ((guix build gnu-build-system)
2045 (modify-phases %standard-phases
2046 (add-after 'install 'install-python
2047 (lambda* (#:key outputs #:allow-other-keys)
2048 (define (python-inst python)
2049 (invoke python "setup.py" "build")
2050 (invoke python "setup.py" "install"
2051 (string-append "--prefix="
2052 (assoc-ref %outputs python)))
2053 (invoke python "setup.py" "clean"))
2054 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2055 (assoc-ref %outputs "out")))
2056 (with-directory-excursion "./python"
2057 (for-each python-inst '("python2" "python3")))
2059 (add-after 'install 'install-doc
2060 (lambda* (#:key inputs outputs #:allow-other-keys)
2061 (let ((dest (string-append (assoc-ref outputs "doc")
2062 "/share/doc/libnl")))
2064 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
2065 "--strip-components=1" "-C" dest)))))))
2066 (home-page "https://www.infradead.org/~tgr/libnl/")
2067 (synopsis "NetLink protocol library suite")
2069 "The libnl suite is a collection of libraries providing APIs to netlink
2070 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2071 between the kernel and user space processes. It was designed to be a more
2072 flexible successor to ioctl to provide mainly networking related kernel
2073 configuration and monitoring interfaces.")
2075 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2076 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2077 (license license:gpl2)))
2086 "mirror://kernel.org/software/network/iw/iw-"
2090 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2091 (build-system gnu-build-system)
2092 (native-inputs `(("pkg-config" ,pkg-config)))
2093 (inputs `(("libnl" ,libnl)))
2096 (let* ((target ,(%current-target-system))
2097 (gcc (if target (string-append target "-gcc") "gcc"))
2098 (pkg-config (if target
2099 (string-append target "-pkg-config")
2102 (string-append "CC=" gcc)
2103 (string-append "PKG_CONFIG="
2104 (assoc-ref %build-inputs "pkg-config")
2106 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2107 #:phases (modify-phases %standard-phases (delete 'configure))))
2108 (home-page "https://wireless.wiki.kernel.org/")
2109 (synopsis "Tool for configuring wireless devices")
2111 "iw is a new nl80211 based CLI configuration utility for wireless
2112 devices. It replaces @code{iwconfig}, which is deprecated.")
2113 (license license:isc)))
2115 (define-public powertop
2122 (uri (string-append "https://01.org/sites/default/files/downloads/"
2123 "powertop-v" version "-1-g7ef7f79.tar_0.gz"))
2125 (base32 "0kynypj5cydfbma0ssblq1k4m1arixc1s2vf0ybv8y2gg09wjs5f"))))
2126 (build-system gnu-build-system)
2129 (modify-phases %standard-phases
2130 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2131 ;; allow calibrating the network interface in Guix System.
2132 (add-after 'unpack 'patch-absolute-file-names
2133 (lambda* (#:key inputs #:allow-other-keys)
2134 (let ((kmod (assoc-ref inputs "kmod")))
2135 (substitute* (find-files "src" "\\.cpp$")
2136 ;; Give the right 'modprobe' file name so that essential
2137 ;; modules such as msr.ko can be loaded.
2138 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2139 ;; These programs are only needed to calibrate, so using
2140 ;; relative file names avoids adding extra inputs. When they
2141 ;; are missing powertop gracefully handles it.
2142 (("/usr/bin/hcitool") "hcitool")
2143 (("/usr/bin/xset") "xset")
2144 (("/usr/sbin/hciconfig") "hciconfig"))
2149 ("ncurses" ,ncurses)
2150 ("pciutils" ,pciutils)
2153 `(("pkg-config" ,pkg-config)))
2154 (home-page "https://01.org/powertop/")
2155 (synopsis "Analyze power consumption on Intel-based laptops")
2157 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2158 power management. In addition to being a diagnostic tool, PowerTOP also has
2159 an interactive mode where the user can experiment various power management
2160 settings for cases where the operating system has not enabled these
2162 (license license:gpl2)))
2164 (define-public aumix
2171 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2172 version ".tar.bz2"))
2175 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2176 (build-system gnu-build-system)
2177 (inputs `(("ncurses" ,ncurses)))
2178 (home-page "http://www.jpj.net/~trevor/aumix.html")
2179 (synopsis "Audio mixer for X and the console")
2181 "Aumix adjusts an audio mixer from X, the console, a terminal,
2182 the command line or a script.")
2183 (license license:gpl2+)))
2185 (define-public iotop
2192 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2195 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2196 (build-system python-build-system)
2199 (modify-phases %standard-phases
2200 (add-after 'unpack 'fix-build-with-python3
2202 (substitute* "setup.py"
2203 (("itervalues") "values"))
2205 ;; There are currently no checks in the package.
2207 (native-inputs `(("python" ,python)))
2208 (home-page "http://guichaz.free.fr/iotop/")
2210 "Displays the IO activity of running processes")
2212 "Iotop is a Python program with a top like user interface to show the
2213 processes currently causing I/O.")
2214 (license license:gpl2+)))
2222 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2223 "download/fuse-" version
2224 "/fuse-" version ".tar.gz"))
2227 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2228 (patches (search-patches "fuse-overlapping-headers.patch"))))
2229 (build-system gnu-build-system)
2230 (inputs `(("util-linux" ,util-linux)))
2232 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2233 (assoc-ref %outputs "out")
2235 (string-append "INIT_D_PATH="
2236 (assoc-ref %outputs "out")
2239 ;; The rule makes /dev/fuse 666.
2240 (string-append "UDEV_RULES_PATH="
2241 (assoc-ref %outputs "out")
2242 "/lib/udev/rules.d"))
2244 (modify-phases %standard-phases
2245 (add-before 'build 'set-file-names
2246 (lambda* (#:key inputs #:allow-other-keys)
2247 ;; libfuse calls out to mount(8) and umount(8). Make sure
2248 ;; it refers to the right ones.
2249 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2250 (("/bin/(u?)mount" _ maybe-u)
2251 (string-append (assoc-ref inputs "util-linux")
2252 "/bin/" maybe-u "mount")))
2253 (substitute* '("util/mount.fuse.c")
2257 ;; This hack leads libfuse to search for 'fusermount' in
2258 ;; $PATH, where it may find a setuid-root binary, instead of
2259 ;; trying solely $out/sbin/fusermount and failing because
2261 (substitute* "lib/Makefile"
2262 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2263 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2265 (home-page "https://github.com/libfuse/libfuse")
2266 (synopsis "Support file systems implemented in user space")
2268 "As a consequence of its monolithic design, file system code for Linux
2269 normally goes into the kernel itself---which is not only a robustness issue,
2270 but also an impediment to system extensibility. FUSE, for \"file systems in
2271 user space\", is a kernel module and user-space library that tries to address
2272 part of this problem by allowing users to run file system implementations as
2273 user-space processes.")
2274 (license (list license:lgpl2.1 ;library
2275 license:gpl2+)))) ;command-line utilities
2277 (define-public unionfs-fuse
2279 (name "unionfs-fuse")
2284 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
2286 (file-name (string-append name "-" version ".tar.gz"))
2289 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
2290 (build-system cmake-build-system)
2292 `(("python" ,python)))
2293 (inputs `(("fuse" ,fuse)))
2295 ;; The tests were never actually run ("collected 0 items"), but in recent
2296 ;; versions of pytest that causes an error.
2298 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2299 (synopsis "User-space union file system")
2301 "UnionFS-FUSE is a flexible union file system implementation in user
2302 space, using the FUSE library. Mounting a union file system allows you to
2303 \"aggregate\" the contents of several directories into a single mount point.
2304 UnionFS-FUSE additionally supports copy-on-write.")
2305 (license license:bsd-3)))
2308 (package (inherit fuse)
2309 (name "fuse-static")
2310 (source (origin (inherit (package-source fuse))
2311 (modules '((guix build utils)))
2314 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2315 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2316 ;; that it doesn't do that, allowing us to remove the
2317 ;; dependency on util-linux (something that is useful in
2319 (substitute* '("lib/mount_util.c"
2320 "util/mount_util.c")
2321 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2327 (define-public unionfs-fuse/static
2328 (package (inherit unionfs-fuse)
2329 (synopsis "User-space union file system (statically linked)")
2330 (name (string-append (package-name unionfs-fuse) "-static"))
2331 (source (origin (inherit (package-source unionfs-fuse))
2332 (modules '((guix build utils)))
2335 ;; Add -ldl to the libraries, because libfuse.a needs that.
2336 (substitute* "src/CMakeLists.txt"
2337 (("target_link_libraries(.*)\\)" _ libs)
2338 (string-append "target_link_libraries"
2343 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2345 (modify-phases %standard-phases
2346 (add-after 'install 'post-install
2347 (lambda* (#:key outputs #:allow-other-keys)
2348 (let* ((out (assoc-ref outputs "out"))
2349 (exe (string-append out "/bin/unionfs")))
2350 ;; By default, 'unionfs' keeps references to
2351 ;; $glibc/share/locale and similar stuff. Remove them.
2352 (remove-store-references exe)
2354 ;; 'unionfsctl' has references to glibc as well. Since
2355 ;; we don't need it, remove it.
2356 (delete-file (string-append out "/bin/unionfsctl"))
2358 (inputs `(("fuse" ,fuse-static)))))
2360 (define-public sshfs
2366 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2367 "download/sshfs-" version "/sshfs-" version
2371 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2372 (build-system gnu-build-system)
2377 `(("pkg-config" ,pkg-config)))
2378 (home-page "https://github.com/libfuse/sshfs")
2379 (synopsis "Mount remote file systems over SSH")
2381 "This is a file system client based on the SSH File Transfer Protocol.
2382 Since most SSH servers already support this protocol it is very easy to set
2383 up: on the server side there's nothing to do; on the client side mounting the
2384 file system is as easy as logging into the server with an SSH client.")
2385 (license license:gpl2+)))
2387 (define-public sshfs-fuse
2388 (package (inherit sshfs)
2390 (properties `((superseded . ,sshfs)))))
2392 (define-public archivemount
2394 (name "archivemount")
2399 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2400 "archivemount-" version ".tar.gz"))
2402 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2403 (build-system gnu-build-system)
2404 (inputs `(("fuse" ,fuse)
2405 ("libarchive" ,libarchive)))
2406 (native-inputs `(("pkg-config" ,pkg-config)))
2407 (home-page "https://www.cybernoia.de/software/archivemount.html")
2408 (synopsis "Tool for mounting archive files with FUSE")
2409 (description "archivemount is a FUSE-based file system for Unix variants,
2410 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2411 mount point where it can be read from or written to as with any other file
2412 system. This makes accessing the contents of the archive, which may be
2413 compressed, transparent to other programs, without decompressing them.")
2414 (license license:lgpl2.0+)))
2416 (define-public numactl
2423 "https://github.com/numactl/numactl/releases/download/v"
2424 version "/numactl-" version ".tar.gz"))
2427 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2428 (build-system gnu-build-system)
2430 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2431 ;; to run, which we can't assume to have.
2434 ;; NUMA is apparently not supported on armhf, see
2435 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2436 (supported-systems (delete "armhf-linux" %supported-systems))
2437 (home-page "https://github.com/numactl/numactl")
2438 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2440 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2441 memory is not all in one place. The @command{numactl} program allows you to
2442 run your application program on specific CPUs and memory nodes. It does this
2443 by supplying a NUMA memory policy to the operating system before running your
2446 The package contains other commands, such as @command{numastat},
2447 @command{memhog}, and @command{numademo} which provides a quick overview of
2448 NUMA performance on your system.")
2449 (license (list license:gpl2 ;programs
2450 license:lgpl2.1)))) ;library
2452 (define-public kbd-neo
2459 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2460 version "/linux/console/neo.map"))
2461 (file-name (string-append name "-" version ".map"))
2464 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2465 (build-system trivial-build-system)
2467 `(#:modules ((guix build utils))
2469 (use-modules (guix build utils))
2470 (let ((out (string-append %output "/share/keymaps"))
2471 (source (assoc-ref %build-inputs "source")))
2473 (copy-file source (string-append out "/neo.map"))
2475 (home-page "https://neo-layout.org")
2476 (synopsis "Neo2 console layout")
2478 "Kbd-neo provides the Neo2 keyboard layout for use with
2479 @command{loadkeys(1)} from @code{kbd(4)}.")
2480 ;; The file is located in an svn directory, the entire content of
2481 ;; the directory is licensed as GPL3.
2482 (license license:gpl3+)))
2490 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2494 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2495 (modules '((guix build utils)))
2498 (substitute* "tests/Makefile.in"
2499 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2502 (substitute* '("src/unicode_start" "src/unicode_stop")
2503 ;; Assume the Coreutils are in $PATH.
2507 (build-system gnu-build-system)
2510 (modify-phases %standard-phases
2511 (add-before 'build 'pre-build
2512 (lambda* (#:key inputs #:allow-other-keys)
2513 (let ((gzip (assoc-ref %build-inputs "gzip"))
2514 (bzip2 (assoc-ref %build-inputs "bzip2")))
2515 (substitute* "src/libkeymap/findfile.c"
2517 (string-append gzip "/bin/gzip"))
2519 (string-append bzip2 "/bin/bzip2")))
2521 (add-after 'install 'post-install
2522 (lambda* (#:key outputs #:allow-other-keys)
2523 ;; Make sure these programs find their comrades.
2524 (let* ((out (assoc-ref outputs "out"))
2525 (bin (string-append out "/bin")))
2526 (for-each (lambda (prog)
2527 (wrap-program (string-append bin "/" prog)
2528 `("PATH" ":" prefix (,bin))))
2529 '("unicode_start" "unicode_stop"))
2531 (inputs `(("check" ,check)
2534 ("pam" ,linux-pam)))
2535 (native-search-paths
2536 (list (search-path-specification
2537 (variable "LOADKEYS_KEYMAP_PATH")
2538 ;; Append ‘/**’ to recursively search all directories. One can then
2539 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2540 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2541 (files (list "share/keymaps/**")))))
2542 (native-inputs `(("pkg-config" ,pkg-config)))
2543 (home-page "http://kbd-project.org/")
2544 (synopsis "Linux keyboard utilities and keyboard maps")
2546 "This package contains keytable files and keyboard utilities compatible
2547 for systems using the Linux kernel. This includes commands such as
2548 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2549 (license license:gpl2+)))
2551 (define-public loadkeys-static
2554 (name "loadkeys-static")
2556 (substitute-keyword-arguments (package-arguments kbd)
2557 ((#:configure-flags flags ''())
2558 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2559 "--disable-vlock" ;so we don't need libpam
2560 "--disable-libkeymap")
2562 ((#:make-flags flags ''())
2563 `(cons "LDFLAGS=-all-static" ,flags))
2564 ((#:phases phases '%standard-phases)
2565 `(modify-phases ,phases
2567 (lambda* (#:key outputs #:allow-other-keys)
2568 (let ((out (assoc-ref outputs "out")))
2569 ;; The binary keeps references to gzip, among other things,
2570 ;; which we don't need in the initrd, so strip references.
2571 (remove-store-references "src/loadkeys")
2573 (install-file "src/loadkeys"
2574 (string-append out "/bin"))
2576 (delete 'post-install)))
2577 ((#:strip-flags _ '())
2579 ((#:allowed-references _ '())
2582 (synopsis "Statically-linked @command{loadkeys} program")
2584 ;; This package is meant to be used internally in the initrd so don't
2586 (properties '((hidden? . #t)))))
2588 (define-public inotify-tools
2590 (name "inotify-tools")
2595 (url "https://github.com/rvoicilas/inotify-tools.git")
2597 (file-name (git-file-name name version))
2600 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2601 (build-system gnu-build-system)
2603 `(("autoconf" ,autoconf)
2604 ("automake" ,automake)
2605 ("libtool" ,libtool)))
2606 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2607 (synopsis "Monitor file accesses")
2609 "The inotify-tools packages provides a C library and command-line tools
2610 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2611 (license license:gpl2+)))
2620 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2621 "kmod-" version ".tar.xz"))
2624 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2625 (patches (search-patches "kmod-module-directory.patch"))))
2626 (build-system gnu-build-system)
2628 `(("pkg-config" ,pkg-config)))
2633 `(#:tests? #f ; FIXME: Investigate test failures
2634 #:configure-flags '("--with-xz" "--with-zlib")
2636 (modify-phases %standard-phases
2637 (add-after 'install 'install-modprobe&co
2638 (lambda* (#:key outputs #:allow-other-keys)
2639 (let* ((out (assoc-ref outputs "out"))
2640 (bin (string-append out "/bin")))
2641 (for-each (lambda (tool)
2643 (string-append bin "/" tool)))
2644 '("insmod" "rmmod" "lsmod" "modprobe"
2645 "modinfo" "depmod"))
2647 (home-page "https://www.kernel.org/")
2648 (synopsis "Kernel module tools")
2649 (description "Kmod is a set of tools to handle common tasks with Linux
2650 kernel modules like insert, remove, list, check properties, resolve
2651 dependencies and aliases.
2653 These tools are designed on top of libkmod, a library that is shipped with
2654 kmod. The aim is to be compatible with tools, configurations and indices
2655 from the module-init-tools project.")
2656 (license license:gpl2+))) ; library under lgpl2.1+
2658 (define-public eudev
2659 ;; The post-systemd fork, maintained by Gentoo.
2665 (uri (git-reference (url "https://github.com/gentoo/eudev")
2666 (commit (string-append "v" version))))
2667 (file-name (git-file-name name version))
2670 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
2671 (patches (search-patches "eudev-rules-directory.patch"))))
2672 (build-system gnu-build-system)
2675 (modify-phases %standard-phases
2676 (add-after 'unpack 'make-source-writable
2678 ;; XXX: Git checkouts are read-only, but this package needs to
2679 ;; modify some of its files.
2680 (for-each make-file-writable (find-files "."))
2682 (add-before 'bootstrap 'patch-file-names
2683 (lambda* (#:key inputs #:allow-other-keys)
2684 (substitute* "man/make.sh"
2685 (("/usr/bin/xsltproc")
2686 (string-append (assoc-ref inputs "xsltproc")
2689 (add-after 'install 'build-hwdb
2690 (lambda* (#:key outputs #:allow-other-keys)
2691 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2692 ;; similar tools to display product names.
2693 (let ((out (assoc-ref outputs "out")))
2694 (invoke (string-append out "/bin/udevadm")
2695 "hwdb" "--update")))))
2696 #:configure-flags (list "--enable-manpages")))
2698 `(("autoconf" ,autoconf)
2699 ("automake" ,automake)
2701 ("libtool" ,libtool)
2702 ("pkg-config" ,pkg-config)
2705 ("python" ,python-wrapper)
2706 ;; For documentation.
2707 ("docbook-xml" ,docbook-xml-4.2)
2708 ("docbook-xsl" ,docbook-xsl)
2709 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2710 ("xsltproc" ,libxslt)))
2712 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2713 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2714 ;; which contains the rules to do that.
2715 `(("util-linux" ,util-linux) ;for blkid
2717 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2718 (synopsis "Userspace device management")
2719 (description "Udev is a daemon which dynamically creates and removes
2720 device nodes from /dev/, handles hotplug events and loads drivers at boot
2722 (license license:gpl2+)))
2724 (define-public eudev-with-hwdb
2725 (deprecated-package "eudev-with-hwdb" eudev))
2730 (version "2.02.177")
2733 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2737 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2738 (modules '((guix build utils)))
2741 (use-modules (guix build utils))
2743 ;; Honor sysconfdir.
2744 (substitute* "make.tmpl.in"
2746 "confdir = @sysconfdir@\n")
2747 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2748 "DEFAULT_SYS_DIR = @sysconfdir@"))
2750 (patches (search-patches "lvm2-static-link.patch"))))
2751 (build-system gnu-build-system)
2753 `(("pkg-config" ,pkg-config)
2754 ("procps" ,procps))) ;tests use 'pgrep'
2759 (modify-phases %standard-phases
2760 (add-after 'configure 'set-makefile-shell
2762 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2764 (setenv "SHELL" (which "sh"))
2766 ;; Replace /bin/sh with the right file name.
2767 (patch-makefile-SHELL "make.tmpl")
2770 #:configure-flags (list (string-append "--sysconfdir="
2771 (assoc-ref %outputs "out")
2773 "--enable-udev_sync"
2774 "--enable-udev_rules"
2775 "--enable-pkgconfig"
2777 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
2779 ;; Make sure programs such as 'dmsetup' can
2780 ;; find libdevmapper.so.
2781 (string-append "LDFLAGS=-Wl,-rpath="
2782 (assoc-ref %outputs "out")
2784 (assoc-ref %outputs "out")
2785 "/lib/device-mapper")
2786 ;; TODO: Patch make.tmpl.in to take LDFLAGS
2787 ;; into account so that we don't need to also
2789 (string-append "CLDFLAGS=-Wl,-rpath="
2790 (assoc-ref %outputs "out")
2792 (assoc-ref %outputs "out")
2793 "/lib/device-mapper"))
2795 ;; The tests use 'mknod', which requires root access.
2797 (home-page "https://sourceware.org/lvm2/")
2798 (synopsis "Logical volume management for Linux")
2800 "LVM2 is the logical volume management tool set for Linux-based systems.
2801 This package includes the user-space libraries and tools, including the device
2802 mapper. Kernel components are part of Linux-libre.")
2804 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2805 ;; Command-line tools are GPLv2.
2806 (license (list license:gpl2 license:lgpl2.1))))
2808 (define-public lvm2-static
2811 (name "lvm2-static")
2813 ;; Propagate udev because libdevmapper.a depends on libudev.
2814 (inputs (alist-delete "udev" (package-inputs lvm2)))
2815 (propagated-inputs `(("udev" ,eudev)))
2818 (substitute-keyword-arguments (package-arguments lvm2)
2819 ((#:configure-flags flags '())
2820 ;; LVM2 doesn't use Libtool, hence the custom option.
2821 `(cons "--enable-static_link" ,flags))))
2822 (synopsis "Logical volume management for Linux (statically linked)")))
2824 (define-public wireless-tools
2826 (name "wireless-tools")
2830 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2834 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2837 ;; Remove the older header files that are not free software.
2838 (for-each (lambda (n)
2839 (delete-file (format #f "wireless.~a.h" n)))
2840 '(10 11 12 13 14 15 16 17 18 19 20))
2842 (build-system gnu-build-system)
2845 (list (string-append "PREFIX=" %output)
2846 (string-append "INSTALL_MAN=" %output "/share/man")
2847 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2850 (modify-phases %standard-phases
2852 (lambda* (#:key target #:allow-other-keys)
2853 (when ,(%current-target-system)
2854 ;; Cross-compilation: use the cross tools.
2855 (substitute* (find-files "." "Makefile")
2857 (string-append "CC = " target "-gcc\n"))
2859 (string-append "AR = " target "-ar\n"))
2861 (string-append "RANLIB = " target "-ranlib\n"))))
2864 (synopsis "Tools for manipulating Linux Wireless Extensions")
2865 (description "Wireless Tools are used to manipulate the now-deprecated
2866 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
2867 Extension was an interface allowing you to set Wireless LAN specific
2868 parameters and get the specific stats. It is deprecated in favor the nl80211
2870 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2871 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2872 ;; other files are distributed under gpl2.
2873 (license (list license:gpl2 license:lgpl2.1+))))
2881 (uri (string-append "mirror://kernel.org/software/network/crda/"
2882 "crda-" version ".tar.xz"))
2885 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2886 (patches (search-patches "crda-optional-gcrypt.patch"))))
2887 (build-system gnu-build-system)
2889 '(#:phases (modify-phases %standard-phases
2891 (add-after 'unpack 'gzip-determinism
2893 (substitute* "Makefile"
2894 (("gzip") "gzip --no-name"))
2897 'build 'no-werror-no-ldconfig
2899 (substitute* "Makefile"
2901 (("ldconfig") "true"))
2904 'build 'set-regulator-db-file-name
2905 (lambda* (#:key inputs #:allow-other-keys)
2906 ;; Tell CRDA where to find our database.
2907 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2908 (substitute* "crda.c"
2909 (("\"/lib/crda/regulatory.bin\"")
2910 (string-append "\"" regdb
2911 "/lib/crda/regulatory.bin\"")))
2913 #:test-target "verify"
2914 #:make-flags (let ((out (assoc-ref %outputs "out"))
2915 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2916 (list "CC=gcc" "V=1"
2918 ;; Disable signature-checking on 'regulatory.bin'.
2919 ;; The reason is that this simplifies maintenance
2920 ;; on our side (no need to manage a distro key
2921 ;; pair), and we can guarantee integrity of
2922 ;; 'regulatory.bin' by other means anyway, such as
2923 ;; 'guix gc --verify'. See
2924 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2928 (string-append "PREFIX=" out)
2929 (string-append "SBINDIR=" out "/sbin/")
2930 (string-append "UDEV_RULE_DIR="
2931 out "/lib/udev/rules.d")
2932 (string-append "LDFLAGS=-Wl,-rpath="
2934 (string-append "REG_BIN=" regdb
2935 "/lib/crda/regulatory.bin")))))
2936 (native-inputs `(("pkg-config" ,pkg-config)
2937 ("wireless-regdb" ,wireless-regdb)))
2938 (inputs `(("libnl" ,libnl)))
2940 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2941 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2943 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2944 communication between the kernel Linux and user space for regulatory
2946 (license license:copyleft-next)))
2948 (define-public wireless-regdb
2950 (name "wireless-regdb")
2951 (version "2019.06.03")
2955 "mirror://kernel.org/software/network/wireless-regdb/"
2956 "wireless-regdb-" version ".tar.xz"))
2959 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
2961 ;; We're building 'regulatory.bin' by ourselves.
2963 (delete-file "regulatory.bin")
2965 (build-system gnu-build-system)
2968 (modify-phases %standard-phases
2969 (add-after 'unpack 'gzip-determinism
2971 (substitute* "Makefile"
2972 (("gzip") "gzip --no-name"))
2974 (add-after 'unpack 'omit-signature
2976 (substitute* "Makefile"
2977 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
2978 ;; don't provide (see below). Disable it.
2979 ((" regulatory\\.db\\.p7s") "")
2980 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
2981 ;; but ‘make install’ depends only on the latter while installing
2982 ;; both (and failing). Depend on it explicitly.
2983 (("^install: " all) (string-append all "regulatory.db ")))
2985 (delete 'configure)) ; no configure script
2987 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2988 ;; is computed and can be equal to 'maintainer-clean'; when that
2989 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2990 ;; just built. Thus, build things sequentially.
2991 #:parallel-build? #f
2993 #:tests? #f ; no tests
2995 (let ((out (assoc-ref %outputs "out")))
2996 (list (string-append "PREFIX=" out)
2997 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
2999 ;; Leave this empty so that db2bin.py doesn't try to sign
3000 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3001 ;; pair for the whole distribution.
3002 (string-append "REGDB_PRIVKEY=")
3003 ;; Don't generate a public key for the same reason. These are
3004 ;; used as Makefile targets and can't be the empty string.
3005 (string-append "REGDB_PUBCERT=/dev/null")
3006 (string-append "REGDB_PUBKEY=/dev/null")))))
3008 `(("python" ,python-wrapper)))
3010 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3011 (synopsis "Wireless regulatory database")
3013 "This package contains the wireless regulatory database Central
3014 Regulatory Database Agent (CRDA) daemon. The database contains information on
3015 country-specific regulations for the wireless spectrum.")
3016 (license license:isc)))
3018 (define-public lm-sensors
3026 (url "https://github.com/groeck/lm-sensors.git")
3027 (commit (string-append "V" (string-join
3028 (string-split version #\.) "-")))))
3029 (file-name (git-file-name name version))
3031 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3032 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3033 (build-system gnu-build-system)
3034 (inputs `(("rrdtool" ,rrdtool)
3037 ("gnuplot" ,gnuplot)))
3038 (native-inputs `(("pkg-config" ,pkg-config)
3042 (outputs '("lib" ; avoid perl in closure
3045 `(#:tests? #f ; no 'check' target
3046 #:make-flags (list (string-append "PREFIX=" %output)
3047 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3048 (string-append "INCLUDEDIR="
3049 (assoc-ref %outputs "lib") "/include")
3050 (string-append "MANDIR=" %output "/share/man")
3051 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3053 (modify-phases %standard-phases
3055 (add-before 'build 'patch-exec-paths
3056 (lambda* (#:key inputs outputs #:allow-other-keys)
3057 (substitute* "prog/detect/sensors-detect"
3059 (string-append "`" (assoc-ref inputs "coreutils")
3061 (("(`|\")modprobe" all open-quote)
3062 (string-append open-quote
3063 (assoc-ref inputs "kmod")
3065 (substitute* '("prog/pwm/pwmconfig"
3066 "prog/pwm/fancontrol")
3068 (string-append (assoc-ref inputs "gnuplot")
3071 (string-append (assoc-ref inputs "coreutils")
3074 (string-append (assoc-ref inputs "grep")
3077 (string-append (assoc-ref inputs "sed")
3080 (string-append (assoc-ref inputs "coreutils")
3083 (string-append (assoc-ref inputs "coreutils")
3086 (string-append (assoc-ref inputs "coreutils")
3087 "/bin/readlink -f")))
3089 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3090 (synopsis "Utilities to read temperature/voltage/fan sensors")
3092 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3093 you to access information from temperature, voltage, and fan speed sensors.
3094 It works with most newer systems.")
3095 (license license:gpl2+)))
3097 (define-public iucode-tool
3099 (name "iucode-tool")
3103 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3104 "/raw/latest/iucode-tool_" version ".tar.xz"))
3107 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3108 (build-system gnu-build-system)
3109 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3110 (synopsis "Manipulate Intel microcode bundles")
3112 "@command{iucode_tool} is a utility to work with microcode packages for
3113 Intel processors. It can convert between formats, extract specific versions,
3114 create a firmware image suitable for the Linux kernel, and more.")
3115 ;; cpuid.h is available for i686, x86_64, and ia64.
3116 (supported-systems '("i686-linux" "x86_64-linux"))
3117 (license license:gpl2+)))
3119 (define-public i2c-tools
3126 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3127 version ".tar.bz2"))
3130 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3131 (build-system gnu-build-system)
3133 `(#:tests? #f ; no 'check' target
3134 #:make-flags (list (string-append "prefix=" %output)
3136 ;; no configure script
3137 #:phases (modify-phases %standard-phases (delete 'configure))))
3140 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3141 (synopsis "I2C tools for Linux")
3143 "The i2c-tools package contains a heterogeneous set of I2C tools for
3144 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3145 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3147 (license license:gpl2+)))
3149 (define-public xsensors
3156 "http://www.linuxhardware.org/xsensors/xsensors-"
3160 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3161 (build-system gnu-build-system)
3162 (inputs `(("lm-sensors" ,lm-sensors "lib")
3164 (native-inputs `(("pkg-config" ,pkg-config)))
3167 (modify-phases %standard-phases
3168 (add-before 'configure 'enable-deprecated
3170 (substitute* "src/Makefile.in"
3171 (("-DGDK_DISABLE_DEPRECATED") "")
3172 (("-DGTK_DISABLE_DEPRECATED") ""))
3174 (add-before 'configure 'remove-Werror
3176 (substitute* '("configure" "src/Makefile.in")
3179 (home-page "http://www.linuxhardware.org/xsensors/")
3180 (synopsis "Hardware health information viewer")
3182 "Xsensors reads data from the libsensors library regarding hardware
3183 health such as temperature, voltage and fan speed and displays the information
3184 in a digital read-out.")
3185 (license license:gpl2+)))
3190 (version (package-version linux-libre))
3191 (source (package-source linux-libre))
3192 (build-system gnu-build-system)
3195 (modify-phases %standard-phases
3197 (lambda* (#:key inputs #:allow-other-keys)
3198 (setenv "SHELL_PATH" (which "bash"))
3199 (chdir "tools/perf")
3201 #:make-flags (list (string-append "prefix="
3202 (assoc-ref %outputs "out"))
3203 ;; Make sure the kernel headers are treated as system
3204 ;; headers to suppress warnings from those.
3205 (string-append "C_INCLUDE_PATH="
3206 (assoc-ref %build-inputs "kernel-headers")
3210 ;; By default, 'config/Makefile' uses lib64 on
3211 ;; x86_64. Work around that.
3213 #:tests? #f)) ;no tests
3215 `(("pkg-config" ,pkg-config)
3219 ;; There are build scripts written in these languages.
3221 ("python" ,python-2)))
3223 `(("slang" ,slang) ;for the interactive TUI
3225 ("python" ,python-2) ;'perf' links against libpython
3226 ("elfutils" ,elfutils)
3227 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3228 ("libunwind" ,libunwind) ;better stack walking
3229 ("numactl" ,numactl) ;for 'perf bench numa mem'
3232 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3233 ("docbook-xsl" ,docbook-xsl)
3235 ("asciidoc" ,asciidoc)))
3236 (home-page "https://perf.wiki.kernel.org/")
3237 (synopsis "Linux profiling with performance counters")
3239 "perf is a tool suite for profiling using hardware performance counters,
3240 with support in the Linux kernel. perf can instrument CPU performance
3241 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3242 of lightweight profiling. This package contains the user-land tools and in
3243 particular the @code{perf} command.")
3244 (license (package-license linux-libre))))
3246 (define-public pflask
3252 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3254 (file-name (string-append name "-" version ".tar.gz"))
3257 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3258 (build-system cmake-build-system)
3260 '(#:tests? #f)) ; no tests
3261 (home-page "https://ghedo.github.io/pflask/")
3262 (synopsis "Simple tool for creating Linux namespace containers")
3263 (description "pflask is a simple tool for creating Linux namespace
3264 containers. It can be used for running a command or even booting an OS inside
3265 an isolated container, created with the help of Linux namespaces. It is
3266 similar in functionality to chroot, although pflask provides better isolation
3267 thanks to the use of namespaces.")
3268 (license license:bsd-2)))
3270 (define-public singularity
3272 (name "singularity")
3276 (uri (string-append "https://github.com/singularityware/singularity/"
3277 "releases/download/" version
3278 "/singularity-" version ".tar.gz"))
3281 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3282 (modules '((guix build utils)))
3285 ;; Do not create directories in /var.
3286 (substitute* "Makefile.in"
3287 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3289 ;; The original source overrides PATH so that it points to
3290 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3291 ;; on Guix System. Leave PATH unchanged so we refer to the
3292 ;; installed Coreutils, grep, etc.
3293 (substitute* "bin/singularity.in"
3295 (string-append "#" all "\n")))
3297 (substitute* (find-files "libexec/cli" "\\.exec$")
3298 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3300 (string-append "/run/setuid-programs/singularity-"
3301 program "-helper")))
3303 (build-system gnu-build-system)
3305 `(#:configure-flags '("--localstatedir=/var")
3307 (modify-phases %standard-phases
3308 (add-after 'unpack 'patch-reference-to-squashfs-tools
3310 (substitute* "libexec/cli/build.exec"
3311 (("if ! singularity_which mksquashfs") "if 0")
3312 (("if ! mksquashfs")
3313 (string-append "if ! " (which "mksquashfs"))))
3316 `(("libarchive" ,libarchive)
3317 ("python" ,python-wrapper)
3319 ("squashfs-tools" ,squashfs-tools)))
3320 (home-page "https://singularity.lbl.gov/")
3321 (synopsis "Container platform")
3322 (description "Singularity is a container platform supporting a number of
3323 container image formats. It can build SquashFS container images or import
3324 existing Docker images. Singularity requires kernel support for container
3325 isolation or root privileges.")
3326 (license license:bsd-3)))
3328 (define-public hdparm
3334 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3335 "hdparm-" version ".tar.gz"))
3338 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3339 (build-system gnu-build-system)
3341 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3342 (list (string-append "binprefix=" out)
3343 (string-append "manprefix=" out)
3346 (modify-phases %standard-phases
3347 (delete 'configure)) ; no configure script
3348 #:tests? #f)) ; no test suite
3349 (home-page "https://sourceforge.net/projects/hdparm/")
3350 (synopsis "View and tune ATA disk drive parameters")
3352 "@command{hdparm} is a command-line utility to control ATA controllers and
3353 disk drives. It can increase performance and/or reliability by careful tuning
3354 of hardware settings like power and acoustic management, DMA modes, and caching.
3355 It can also display detailed device information, or be used as a simple
3356 performance benchmarking tool.
3358 @command{hdparm} provides a command line interface to various Linux kernel
3359 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3360 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3361 Translation (@dfn{SAT}) are also supported.")
3362 (license (license:non-copyleft "file://LICENSE.TXT"))))
3364 (define-public rfkill
3370 (uri (string-append "mirror://kernel.org/software/network/"
3371 name "/" name "-" version ".tar.xz"))
3374 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3375 (build-system gnu-build-system)
3377 `(#:make-flags (list "CC=gcc"
3378 (string-append "PREFIX=" %output))
3379 #:phases (modify-phases %standard-phases
3380 (delete 'configure))
3382 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3383 (synopsis "Tool for enabling and disabling wireless devices")
3385 "rfkill is a simple tool for accessing the rfkill device interface,
3386 which is used to enable and disable wireless networking devices, typically
3387 WLAN, Bluetooth and mobile broadband.")
3388 (license (license:non-copyleft "file://COPYING"
3389 "See COPYING in the distribution."))
3390 ;; rfkill is part of util-linux as of 2.31.
3391 (properties `((superseded . ,util-linux)))))
3399 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3400 version "/" name "-" version ".tar.gz"))
3403 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3404 (build-system gnu-build-system)
3405 (home-page "http://acpiclient.sourceforge.net")
3406 (synopsis "Display information on ACPI devices")
3407 (description "@code{acpi} attempts to replicate the functionality of the
3408 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3409 information. It does not support ACPI suspending, only displays information
3410 about ACPI devices.")
3411 (license license:gpl2+)))
3413 (define-public acpid
3419 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3423 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
3424 (build-system gnu-build-system)
3425 (home-page "https://sourceforge.net/projects/acpid2/")
3426 (synopsis "Daemon for delivering ACPI events to user-space programs")
3428 "acpid is designed to notify user-space programs of Advanced
3429 Configuration and Power Interface (ACPI) events. acpid should be started
3430 during the system boot, and will run as a background process. When an ACPI
3431 event is received from the kernel, acpid will examine the list of rules
3432 specified in /etc/acpi/events and execute the rules that match the event.")
3433 (license license:gpl2+)))
3435 (define-public sysfsutils
3444 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3447 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3448 (build-system gnu-build-system)
3449 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3450 (synopsis "System utilities based on Linux sysfs")
3452 "These are a set of utilities built upon sysfs, a virtual file system in
3453 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3454 also contains the libsysfs library.")
3455 ;; The library is under lgpl2.1+ (all files say "or any later version").
3456 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3457 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3459 (define-public sysfsutils-1
3461 (inherit sysfsutils)
3468 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3469 "/sysfsutils-" version ".tar.gz"))
3471 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3472 (modules '((guix build utils)))
3475 (substitute* "Makefile.in"
3476 (("includedir = /usr/include/sysfs")
3477 "includedir = @includedir@"))
3478 (substitute* "configure"
3479 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3480 (string-append "includedir='" orig "/sysfs'")))
3482 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3484 (define-public cpufrequtils
3486 (name "cpufrequtils")
3491 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3492 "cpufrequtils-" version ".tar.gz"))
3494 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3495 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3496 (build-system gnu-build-system)
3498 `(("sysfsutils" ,sysfsutils-1)))
3500 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3501 (assoc-ref %outputs "out") "/lib"))))
3502 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3503 (synopsis "Utilities to get and set CPU frequency on Linux")
3505 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3506 information, and set the CPU frequency if supported, using the cpufreq
3507 capabilities of the Linux kernel.")
3508 (license license:gpl2)))
3510 (define-public libraw1394
3517 "mirror://kernel.org/linux/libs/ieee1394/"
3518 name "-" version ".tar.xz"))
3521 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3522 (build-system gnu-build-system)
3523 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3524 (synopsis "Interface library for the Linux IEEE1394 drivers")
3526 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3527 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3528 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3529 send to and receive from other nodes without requiring a kernel driver for the
3530 protocol in question.")
3531 (license license:lgpl2.1+)))
3533 (define-public libavc1394
3539 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3540 name "-" version ".tar.gz"))
3543 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3544 (build-system gnu-build-system)
3546 `(("pkg-config" ,pkg-config)))
3548 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3549 (home-page "https://sourceforge.net/projects/libavc1394/")
3550 (synopsis "AV/C protocol library for IEEE 1394")
3552 "Libavc1394 is a programming interface to the AV/C specification from
3553 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3554 (license license:lgpl2.1+)))
3556 (define-public libiec61883
3558 (name "libiec61883")
3563 "mirror://kernel.org/linux/libs/ieee1394/"
3564 name "-" version ".tar.xz"))
3567 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3568 (build-system gnu-build-system)
3570 `(("pkg-config" ,pkg-config)))
3572 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3573 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3574 (synopsis "Isochronous streaming media library for IEEE 1394")
3576 "The libiec61883 library provides a higher level API for streaming DV,
3577 MPEG-2 and audio over Linux IEEE 1394.")
3578 (license license:lgpl2.1+)))
3580 (define-public mdadm
3587 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3591 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3592 (build-system gnu-build-system)
3596 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3600 ;; TODO: tell it where to find 'sendmail'
3601 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3602 (string-append "BINDIR=" out "/sbin")
3603 (string-append "MANDIR=" out "/share/man")
3604 (string-append "UDEVDIR=" out "/lib/udev")))
3606 (modify-phases %standard-phases
3607 (add-before 'build 'patch-program-paths
3608 (lambda* (#:key inputs #:allow-other-keys)
3609 (let ((coreutils (assoc-ref inputs "coreutils")))
3610 (substitute* "udev-md-raid-arrays.rules"
3611 (("/usr/bin/(readlink|basename)" all program)
3612 (string-append coreutils "/bin/" program))))
3614 (add-before 'build 'remove-W-error
3616 ;; We cannot build with -Werror on i686 due to a
3617 ;; 'sign-compare' warning in util.c.
3618 (substitute* "Makefile"
3621 (delete 'configure))
3622 ;;tests must be done as root
3624 (home-page "http://neil.brown.name/blog/mdadm")
3625 (synopsis "Tool for managing Linux Software RAID arrays")
3627 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3628 assemble, report on, and monitor arrays. It can also move spares between raid
3629 arrays when needed.")
3630 (license license:gpl2+)))
3632 (define-public mdadm-static
3635 (name "mdadm-static")
3637 (substitute-keyword-arguments (package-arguments mdadm)
3638 ((#:make-flags flags)
3639 `(cons "LDFLAGS = -static" ,flags))
3641 `(modify-phases ,phases
3642 (add-after 'install 'remove-cruft
3643 (lambda* (#:key outputs #:allow-other-keys)
3644 (let* ((out (assoc-ref outputs "out"))
3645 (precious? (lambda (file)
3646 (member file '("." ".." "sbin"))))
3647 (directories (scandir out (negate precious?))))
3648 (with-directory-excursion out
3649 (for-each delete-file-recursively directories)
3650 (remove-store-references "sbin/mdadm")
3651 (delete-file "sbin/mdmon")
3653 ((#:modules modules %gnu-build-system-modules)
3654 `((ice-9 ftw) ,@modules))
3655 ((#:strip-flags _ '())
3656 ''("--strip-all")) ;strip a few extra KiB
3657 ((#:allowed-references _ '("out"))
3658 '("out")))) ;refer only self
3659 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3661 (define-public multipath-tools
3663 (name "multipath-tools")
3667 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3668 ".git;a=snapshot;h=" version ";sf=tgz"))
3669 (file-name (string-append name "-" version ".tar.gz"))
3672 "0kb4mhzwyygdbikikmby6hj39pb3nrzv05v526c75wnycwnpxg31"))
3673 (modules '((guix build utils)))
3676 ;; Drop bundled valgrind headers.
3677 (delete-file-recursively "third-party")
3678 (substitute* '("multipathd/main.c"
3679 "libmultipath/debug.c")
3680 (("#include \"../third-party/")
3683 (build-system gnu-build-system)
3685 '(#:tests? #f ; no tests
3686 #:make-flags (list "CC=gcc"
3687 (string-append "DESTDIR="
3688 (assoc-ref %outputs "out"))
3690 ;; Add the libaio headers to GCCs system header
3691 ;; search path to suppress -Werror=cast-qual on
3692 ;; the included headers.
3693 (string-append "C_INCLUDE_PATH="
3694 (assoc-ref %build-inputs "libaio")
3696 (string-append "LDFLAGS=-Wl,-rpath="
3697 (assoc-ref %outputs "out")
3700 (modify-phases %standard-phases
3701 (add-after 'unpack 'patch-source
3702 (lambda* (#:key inputs #:allow-other-keys)
3703 (let ((lvm2 (assoc-ref inputs "lvm2"))
3704 (udev (assoc-ref inputs "udev")))
3705 (substitute* "Makefile.inc"
3706 (("\\$\\(prefix\\)/usr") "$(prefix)")
3707 ;; Do not save timestamp to avoid gzip "timestamp
3708 ;; out-of-range" warnings.
3709 (("gzip -9") "gzip -9n"))
3710 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3711 (("/usr/include/libdevmapper.h")
3712 (string-append lvm2 "/include/libdevmapper.h"))
3713 (("/usr/include/libudev.h")
3714 (string-append udev "/include/libudev.h")))
3716 (delete 'configure)))) ; no configure script
3719 ("pkg-config" ,pkg-config)
3720 ("valgrind" ,valgrind)))
3722 `(("json-c" ,json-c)
3724 ("liburcu" ,liburcu)
3726 ("readline" ,readline)
3728 (home-page "http://christophe.varoqui.free.fr/")
3729 (synopsis "Access block devices through multiple paths")
3731 "This package provides the following binaries to drive the
3732 Linux Device Mapper multipathing driver:
3734 @item @command{multipath} - Device mapper target autoconfig.
3735 @item @command{multipathd} - Multipath daemon.
3736 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3737 @code{dm} multipath devices.
3738 @item @command{kpartx} - Create device maps from partition tables.
3740 (license (list license:gpl2+ ; main distribution
3741 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3743 (define-public libaio
3750 (string-append "https://releases.pagure.org/libaio/"
3751 name "-" version ".tar.gz")))
3754 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
3755 (build-system gnu-build-system)
3758 (list "CC=gcc" (string-append "prefix=" %output))
3759 #:test-target "partcheck" ; need root for a full 'check'
3761 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
3762 (home-page "https://pagure.io/libaio")
3763 (synopsis "Linux-native asynchronous I/O access library")
3765 "This library enables userspace to use Linux kernel asynchronous I/O
3766 system calls, important for the performance of databases and other advanced
3768 (license license:lgpl2.1+)))
3776 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
3780 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
3781 (build-system gnu-build-system)
3783 `(("libsndfile" ,libsndfile)))
3785 `(("pkg-config" ,pkg-config)))
3786 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3787 (synopsis "Bluetooth subband audio codec")
3789 "The SBC is a digital audio encoder and decoder used to transfer data to
3790 Bluetooth audio output devices like headphones or loudspeakers.")
3791 (license license:gpl2+)))
3793 (define-public bluez
3800 "mirror://kernel.org/linux/bluetooth/bluez-"
3804 "02jng21lp6fb3c2bh6vf9y7cj4gaxwk29dfc32ncy0lj0gi4q57p"))))
3805 (build-system gnu-build-system)
3808 (let ((out (assoc-ref %outputs "out")))
3809 (list "--sysconfdir=/etc"
3810 "--localstatedir=/var"
3813 ;; Install dbus/udev files to the correct location.
3814 (string-append "--with-dbusconfdir=" out "/etc")
3815 (string-append "--with-udevdir=" out "/lib/udev")))
3817 (modify-phases %standard-phases
3818 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3819 ;; issue (discussion on upstream mailing list:
3820 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3821 (add-before 'check 'skip-wonky-test
3823 (substitute* "unit/test-gatt.c"
3824 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3826 (add-after 'install 'post-install
3827 (lambda* (#:key inputs outputs #:allow-other-keys)
3828 (let* ((out (assoc-ref outputs "out"))
3829 (servicedir (string-append out "/share/dbus-1/services"))
3830 (service "obexd/src/org.bluez.obex.service")
3831 (rule (string-append
3832 out "/lib/udev/rules.d/97-hid2hci.rules")))
3833 ;; Install the obex dbus service file.
3834 (substitute* service
3836 (string-append out "/libexec/bluetooth/obexd")))
3837 (install-file service servicedir)
3838 ;; Fix paths in the udev rule.
3840 (("hid2hci --method")
3841 (string-append out "/lib/udev/hid2hci --method"))
3843 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3846 `(("pkg-config" ,pkg-config)
3847 ("gettext" ,gettext-minimal)))
3852 ("libical" ,libical)
3853 ("readline" ,readline)))
3854 (home-page "http://www.bluez.org/")
3855 (synopsis "Linux Bluetooth protocol stack")
3857 "BlueZ provides support for the core Bluetooth layers and protocols. It
3858 is flexible, efficient and uses a modular implementation.")
3859 (license license:gpl2+)))
3861 (define-public fuse-exfat
3868 "https://github.com/relan/exfat/releases/download/v"
3869 version "/" name "-" version ".tar.gz"))
3872 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3873 (build-system gnu-build-system)
3875 `(("pkg-config" ,pkg-config)))
3878 (home-page "https://github.com/relan/exfat")
3879 (synopsis "Mount exFAT file systems")
3881 "This package provides a FUSE-based file system that provides read and
3882 write access to exFAT devices.")
3883 (license license:gpl2+)))
3885 (define-public fuseiso
3888 (version "20070708")
3891 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
3892 version "/fuseiso-" version ".tar.bz2"))
3895 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
3896 (build-system gnu-build-system)
3898 `(("pkg-config" ,pkg-config)))
3903 (home-page "https://sourceforge.net/projects/fuseiso/")
3904 (synopsis "Mount ISO file system images")
3906 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
3907 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
3908 Ridge, Joliet, and zisofs.")
3909 (license license:gpl2)))
3918 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3919 version ".tar.bz2"))
3920 (patches (search-patches "gpm-glibc-2.26.patch"))
3923 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3924 (build-system gnu-build-system)
3926 '(#:phases (modify-phases %standard-phases
3929 ;; The tarball was not generated with 'make dist' so we
3930 ;; need to bootstrap things ourselves.
3931 (substitute* "autogen.sh"
3932 (("/bin/sh") (which "sh")))
3933 (invoke "./autogen.sh")
3934 (patch-makefile-SHELL "Makefile.include.in")
3937 ;; Make sure programs find libgpm.so.
3938 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3939 (assoc-ref %outputs "out")
3942 `(("texinfo" ,texinfo)
3945 ("autoconf" ,autoconf)
3946 ("automake" ,automake)
3947 ("libtool" ,libtool)))
3948 (home-page "http://www.nico.schottelius.org/software/gpm/")
3949 (synopsis "Mouse support for the Linux console")
3951 "The GPM (general-purpose mouse) daemon is a mouse server for
3952 applications running on the Linux console. It allows users to select items
3953 and copy/paste text in the console and in xterm.")
3954 (license license:gpl2+)))
3956 (define-public btrfs-progs
3958 (name "btrfs-progs")
3962 (uri (string-append "mirror://kernel.org/linux/kernel/"
3963 "people/kdave/btrfs-progs/"
3964 "btrfs-progs-v" version ".tar.xz"))
3967 "1ykhasv0jc3qi3xrm5841mzkmlbkjw6rm70gl4aww90jj6ak55qg"))))
3968 (build-system gnu-build-system)
3970 "static")) ; static versions of the binaries in "out"
3972 '(#:phases (modify-phases %standard-phases
3973 (add-after 'build 'build-static
3974 (lambda _ (invoke "make" "static")))
3975 (add-after 'install 'install-bash-completion
3976 (lambda* (#:key outputs #:allow-other-keys)
3977 (let* ((out (assoc-ref outputs "out"))
3978 (bashcomp (string-append out "/etc/bash_completion.d")))
3980 (copy-file "btrfs-completion"
3981 (string-append bashcomp "/btrfs"))
3983 (add-after 'install 'install-static
3984 (let ((staticbin (string-append (assoc-ref %outputs "static")
3988 (string-append "bindir=" staticbin)
3989 "install-static")))))
3990 #:tests? #f ; XXX: require the 'btrfs' kernel module.
3991 #:test-target "test"
3992 #:parallel-tests? #f)) ; tests fail when run in parallel
3993 (inputs `(("e2fsprogs" ,e2fsprogs)
3994 ("libblkid" ,util-linux)
3995 ("libblkid:static" ,util-linux "static")
3996 ("libuuid" ,util-linux)
3997 ("libuuid:static" ,util-linux "static")
4000 ("zlib:static" ,zlib "static")
4001 ("zstd" ,zstd "lib")
4002 ("zstd:static" ,zstd "static")))
4003 (native-inputs `(("pkg-config" ,pkg-config)
4004 ("asciidoc" ,asciidoc)
4007 ;; For building documentation.
4008 ("libxml2" ,libxml2)
4009 ("docbook-xsl" ,docbook-xsl)
4013 ;; The tests need 'grep' with perl regexp support.
4015 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4016 (synopsis "Create and manage btrfs copy-on-write file systems")
4017 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4018 aimed at implementing advanced features while focusing on fault tolerance,
4019 repair and easy administration.")
4020 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4021 ;; GPL2: Everything else.
4022 (license (list license:gpl2 license:gpl2+))))
4024 (define-public btrfs-progs/static
4026 (name "btrfs-progs-static")
4027 (version (package-version btrfs-progs))
4029 (build-system trivial-build-system)
4031 `(("btrfs-progs:static" ,btrfs-progs "static")))
4033 `(#:modules ((guix build utils))
4036 (use-modules (guix build utils)
4040 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4041 (out (assoc-ref %outputs "out"))
4042 (source (string-append btrfs "/bin/btrfs.static"))
4043 (target (string-append out "/bin/btrfs")))
4044 (mkdir-p (dirname target))
4045 (copy-file source target)
4046 (remove-store-references target)
4047 (chmod target #o555)
4049 (home-page (package-home-page btrfs-progs))
4050 (synopsis "Statically-linked btrfs command from btrfs-progs")
4051 (description "This package provides the statically-linked @command{btrfs}
4052 from the btrfs-progs package. It is meant to be used in initrds.")
4053 (license (package-license btrfs-progs))))
4055 (define-public compsize
4059 (home-page "https://github.com/kilobyte/compsize")
4064 (commit (string-append "v" version))))
4066 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4067 (file-name (git-file-name name version))))
4068 (build-system gnu-build-system)
4070 `(("btrfs-progs" ,btrfs-progs)))
4072 `(#:tests? #f ; No tests.
4073 #:make-flags (list "CC=gcc")
4075 (modify-phases %standard-phases
4078 (lambda* (#:key outputs #:allow-other-keys)
4079 (let ((out (assoc-ref outputs "out")))
4080 (install-file "compsize" (string-append out "/bin"))
4081 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4082 (synopsis "Find compression type/ratio on Btrfs files")
4083 (description "@command{compsize} takes a list of files (given as
4084 arguments) on a Btrfs file system and measures used compression types and
4085 effective compression ratio, producing a report.
4087 A directory has no extents but has a (recursive) list of files. A non-regular
4088 file is silently ignored.
4090 As it makes no sense to talk about compression ratio of a partial extent,
4091 every referenced extent is counted whole, exactly once -- no matter if you use
4092 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4093 uncompressed size will not match the number given by @command{tar} or
4094 @command{du}. On the other hand, the space used should be accurate (although
4095 obviously it can be shared with files outside our set).")
4096 (license license:gpl2+)))
4098 (define-public f2fs-tools-1.7
4105 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4106 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4109 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4111 (build-system gnu-build-system)
4114 (modify-phases %standard-phases
4115 (add-after 'install 'install-headers
4116 (lambda* (#:key outputs #:allow-other-keys)
4117 (let* ((out (assoc-ref outputs "out"))
4118 (out-include (string-append out "/include")))
4119 (install-file "include/f2fs_fs.h" out-include)
4120 (install-file "mkfs/f2fs_format_utils.h" out-include)
4123 `(("autoconf" ,autoconf)
4124 ("automake" ,automake)
4125 ("libtool" ,libtool)
4126 ("pkg-config" ,pkg-config)))
4128 `(("libuuid" ,util-linux)
4129 ("libselinux" ,libselinux)))
4130 (home-page "https://f2fs.wiki.kernel.org/")
4131 (synopsis "Userland tools for f2fs")
4133 "F2FS, the Flash-Friendly File System, is a modern file system
4134 designed to be fast and durable on flash devices such as solid-state
4135 disks and SD cards. This package provides the userland utilities.")
4136 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4137 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4138 (license (list license:gpl2 license:lgpl2.1))))
4140 (define-public f2fs-tools
4142 (inherit f2fs-tools-1.7)
4148 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4149 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4152 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4154 `(("libuuid" ,util-linux)))))
4156 (define-public freefall
4159 (version (package-version linux-libre))
4160 (source (package-source linux-libre))
4161 (build-system gnu-build-system)
4163 '(#:phases (modify-phases %standard-phases
4164 (add-after 'unpack 'enter-subdirectory
4166 (chdir "tools/laptop/freefall")
4169 (add-before 'build 'increase-timeout
4171 ;; The default of 2 seconds is too low: it assumes an
4172 ;; open lid and AC power without actually checking.
4173 (substitute* "freefall.c"
4174 (("alarm\\(2\\)") "alarm(5)"))
4176 #:make-flags (list (string-append "PREFIX="
4177 (assoc-ref %outputs "out"))
4179 #:tests? #f)) ;no tests
4180 (home-page (package-home-page linux-libre))
4181 (synopsis "Free-fall protection for spinning laptop hard drives")
4183 "Prevents shock damage to the internal spinning hard drive(s) of some
4184 HP and Dell laptops. When sudden movement is detected, all input/output
4185 operations on the drive are suspended and its heads are parked on the ramp,
4186 where they are less likely to cause damage to the spinning disc. Requires a
4187 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4188 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4189 (license license:gpl2)))
4191 (define-public thinkfan
4199 (url "https://github.com/vmatare/thinkfan.git")
4201 (file-name (git-file-name name version))
4203 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
4204 (build-system cmake-build-system)
4206 `(#:modules ((guix build cmake-build-system)
4209 #:tests? #f ; no test target
4211 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4212 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4214 `("-DUSE_ATASMART:BOOL=ON")
4216 (modify-phases %standard-phases
4217 (add-after 'unpack 'create-init-scripts
4218 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4219 ;; systemd to patch and install their service files. Fake their
4220 ;; presence rather than duplicating the build system below. Leave
4221 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4222 ;; The sysvinit needs manual patching, but since upstream doesn't
4223 ;; even provide the option to install it: don't.
4224 (lambda* (#:key outputs #:allow-other-keys)
4225 (let* ((out (assoc-ref outputs "out"))
4226 (share (string-append out "/share/" ,name)))
4227 (substitute* "CMakeLists.txt"
4228 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4229 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4230 ;; That was easy! Now we just need to fix the destinations.
4232 (string-append out directory)))
4235 `(("pkg-config" ,pkg-config)))
4237 `(("libatasmart" ,libatasmart)
4238 ("yaml-cpp" ,yaml-cpp)))
4239 (home-page "http://thinkfan.sourceforge.net/")
4240 (synopsis "Simple fan control program")
4242 "Thinkfan is a simple fan control program. It reads temperatures,
4243 checks them against configured limits and switches to appropriate (also
4244 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4245 other @code{hwmon} driver that enables temperature reading and fan control
4247 (license license:gpl3+)))
4249 (define-public tpacpi-bat
4257 (url "https://github.com/teleshoes/tpacpi-bat.git")
4258 (commit (string-append "v" version))))
4259 (file-name (git-file-name name version))
4261 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4262 (build-system gnu-build-system)
4264 `(#:tests? #f ; no test target
4266 (modify-phases %standard-phases
4267 (add-after 'unpack 'refer-to-inputs
4269 (substitute* "tpacpi-bat"
4271 (format "~a " (which "cat")))
4272 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4273 ;; loaded. That's the administrator's prerogative; disable it.
4274 (("system \"(modprobe .*)\"" _ match)
4275 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4277 (delete 'configure) ; nothing to configure
4278 (delete 'build) ; nothing to build
4280 (lambda* (#:key outputs #:allow-other-keys)
4281 (let* ((out (assoc-ref outputs "out"))
4282 (bin (string-append out "/bin"))
4283 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4284 (install-file "tpacpi-bat" bin)
4286 ;; There's no man page. Install other forms of documentation.
4287 (for-each (lambda (file)
4288 (let ((target (string-append doc "/" file)))
4289 (mkdir-p (dirname target))
4290 (copy-recursively file target)))
4291 (list "battery_asl" "examples" "README.md"))
4295 (home-page "https://github.com/teleshoes/tpacpi-bat")
4296 (synopsis "ThinkPad battery charge controller")
4298 "Tpacpi-bat is a command-line interface to control battery charging on
4299 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4300 ThinkPad models released after 2011}, starting with the xx20 series. It can
4301 query and set the thresholds at which one or both batteries will start and stop
4302 charging, inhibit charging batteries for a set period of time, or force them to
4303 discharge when they otherwise would not.
4305 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4306 kernel module provided by the @code{acpi-call-linux-module} package, which must
4307 be installed and loaded separately. Only the original vendor firmware is
4309 (license license:gpl3+)))
4311 (define-public ntfs-3g
4314 (version "2017.3.23")
4317 (uri (string-append "https://tuxera.com/opensource/"
4318 "ntfs-3g_ntfsprogs-" version ".tgz"))
4319 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
4322 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
4323 (modules '((guix build utils)))
4325 ;; Install under $prefix.
4326 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4330 (build-system gnu-build-system)
4331 (inputs `(("util-linux" ,util-linux)
4332 ("fuse" ,fuse))) ;libuuid
4333 (native-inputs `(("pkg-config" ,pkg-config)))
4335 '(#:configure-flags (list "--exec-prefix=${prefix}"
4336 "--with-fuse=external" ;use our own FUSE
4337 "--enable-mount-helper"
4338 "--enable-posix-acls"
4339 "--enable-xattr-mappings")
4341 (modify-phases %standard-phases
4342 ;; If users install ntfs-3g, they probably want to make it the
4343 ;; default driver as well, so we opt for sensible defaults and link
4344 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
4345 ;; mount NTFS file systems.)
4346 (add-after 'install 'install-link
4347 (lambda* (#:key outputs #:allow-other-keys)
4348 (let* ((out (assoc-ref outputs "out"))
4349 (sbin (string-append out "/sbin")))
4350 (symlink "mount.ntfs-3g"
4351 (string-append sbin "/mount.ntfs")))
4353 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
4354 (synopsis "Read-write access to NTFS file systems")
4356 "NTFS-3G provides read-write access to NTFS file systems, which are
4357 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4358 The package provides additional NTFS tools.")
4359 (license license:gpl2+)))
4361 (define-public rdma-core
4367 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4368 "/releases/download/v" version "/rdma-core-"
4372 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
4373 (build-system cmake-build-system)
4375 `(#:tests? #f ; no tests
4376 ;; Upstream uses the "ninja" build system and encourage distros
4377 ;; to do the same for consistency. They also recommend using the
4378 ;; "Release" build type.
4379 #:build-type "Release"
4380 #:configure-flags (list "-GNinja"
4382 (string-append "-DRST2MAN_EXECUTABLE="
4383 (assoc-ref %build-inputs
4387 ;; On some configurations, the
4388 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
4389 ;; used by default, would return ENODEV. To
4390 ;; avoid that, use 'write' instead of ioctls,
4391 ;; as suggested in 'CMakeList.txt'.
4392 "-DIOCTL_MODE=write")
4394 (modify-phases %standard-phases
4398 "-j" (number->string (parallel-job-count)))))
4401 (invoke "ninja" "install"))))))
4404 ("pkg-config" ,pkg-config)
4405 ("python" ,python-wrapper)
4406 ("python-docutils" ,python-docutils))) ;for 'rst2man'
4410 (home-page "https://github.com/linux-rdma/rdma-core")
4411 (synopsis "Utilities and libraries for working with RDMA devices")
4413 "This package provides userspace components for the InfiniBand
4414 subsystem of the Linux kernel. Specifically it contains userspace
4415 libraries for the following device nodes:
4418 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4419 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4420 @item @file{/dev/infiniband/umadX} (@code{libibumad})
4423 The following service daemons are also provided:
4425 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4426 @item @code{iwpmd} (for iWARP kernel providers)
4427 @item @code{ibacm} (for InfiniBand communication management assistant)
4429 ;; All library code is dual licensed under GPL2 and a custom MIT
4430 ;; variant. The package also includes some components covered by
4431 ;; other licenses. Consult COPYING.md for full details.
4434 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4435 license:bsd-2 ; Files referring to COPYING.BSD_FB
4436 license:cc0 ; most files in ccan/
4437 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4439 (define-public perftest
4446 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4447 version "/perftest-" version ".g0927198.tar.gz"))
4449 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
4450 (build-system gnu-build-system)
4453 (modify-phases %standard-phases
4454 (add-after 'unpack 'patch-header-paths
4456 (substitute* '("src/raw_ethernet_fs_rate.c"
4457 "src/raw_ethernet_resources.c"
4458 "src/raw_ethernet_resources.h"
4459 "src/raw_ethernet_send_burst_lat.c"
4460 "src/raw_ethernet_send_bw.c"
4461 "src/raw_ethernet_send_lat.c")
4462 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4464 (inputs `(("rdma-core" ,rdma-core)))
4465 (home-page "https://github.com/linux-rdma/perftest/")
4466 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4467 (description "This is a collection of tests written over uverbs intended for
4468 use as a performance micro-benchmark. The tests may be used for hardware or
4469 software tuning as well as for functional testing.
4471 The collection contains a set of bandwidth and latency benchmark such as:
4473 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
4474 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4475 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4476 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4477 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4479 (license license:gpl2)))
4481 (define-public rng-tools
4484 (home-page "https://github.com/nhorman/rng-tools")
4488 (uri (git-reference (url home-page)
4489 (commit (string-append "v" version))))
4490 (file-name (git-file-name name version))
4493 "1clm9i9xg3j79q0d6vinn6dx0nwh1fvzcmkqpcbay7mwsgkknvw2"))))
4494 (build-system gnu-build-system)
4496 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
4497 #:configure-flags '("--without-nistbeacon"
4498 "--without-pkcs11")))
4500 `(("autoconf" ,autoconf)
4501 ("automake" ,automake)
4502 ("pkg-config" ,pkg-config)))
4504 `(("libsysfs" ,sysfsutils)))
4505 (synopsis "Random number generator daemon")
4507 "Monitor a hardware random number generator, and supply entropy
4508 from that to the system kernel's @file{/dev/random} machinery.")
4509 ;; The source package is offered under the GPL2+, but the files
4510 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4511 (license (list license:gpl2 license:gpl2+))))
4513 (define-public cpupower
4516 (version (package-version linux-libre))
4517 (source (package-source linux-libre))
4518 (build-system gnu-build-system)
4520 '(#:phases (modify-phases %standard-phases
4521 (add-after 'unpack 'enter-subdirectory
4523 (chdir "tools/power/cpupower")
4526 (add-before 'build 'fix-makefiles
4528 (substitute* "Makefile"
4530 (("/bin/(install|pwd)" _ command) command))
4531 (substitute* "bench/Makefile"
4532 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4534 #:make-flags (let ((out (assoc-ref %outputs "out")))
4535 (list (string-append "DESTDIR=" out)
4536 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4538 "docdir=/share/doc/cpupower"
4539 "confdir=$(docdir)/examples"
4540 ;; The Makefile recommends the following changes
4542 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4543 #:tests? #f)) ;no tests
4544 (native-inputs `(("gettext" ,gettext-minimal)))
4545 (inputs `(("pciutils" ,pciutils)))
4546 (home-page (package-home-page linux-libre))
4547 (synopsis "CPU frequency and voltage scaling tools for Linux")
4549 "cpupower is a set of user-space tools that use the cpufreq feature of the
4550 Linux kernel to retrieve and control processor features related to power saving,
4551 such as frequency and voltage scaling.")
4552 (license license:gpl2)))
4554 (define-public x86-energy-perf-policy
4556 (name "x86-energy-perf-policy")
4557 (version (package-version linux-libre))
4558 (source (package-source linux-libre))
4559 (build-system gnu-build-system)
4563 (modify-phases %standard-phases
4564 (add-after 'unpack 'enter-subdirectory
4566 (chdir "tools/power/x86/x86_energy_perf_policy")
4569 (add-before 'build 'fix-makefile
4571 (substitute* "Makefile" (("/usr") ""))
4574 (let ((out (assoc-ref %outputs "out")))
4575 (list (string-append "DESTDIR=" out)
4576 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4577 (supported-systems '("i686-linux" "x86_64-linux"))
4578 (home-page (package-home-page linux-libre))
4579 (synopsis "Display and update Intel-CPU energy-performance policy")
4581 "@command{x86_energy_perf_policy} displays and updates energy-performance
4582 policy settings specific to Intel Architecture Processors. Settings are
4583 accessed via Model Specific Register (MSR) updates, no matter if the Linux
4584 cpufreq sub-system is enabled or not.")
4585 (license license:gpl2)))
4587 (define-public haveged
4595 (url "https://github.com/jirka-h/haveged.git")
4596 (commit (string-append "v" version))))
4597 (file-name (git-file-name name version))
4599 (base32 "11kr19n2f87izsj341lv5amhd1wc2ckfmqr9pq5fxix8pkbs94rh"))))
4600 (build-system gnu-build-system)
4601 (home-page "https://www.issihosts.com/haveged")
4602 (synopsis "Entropy source for the Linux random number generator")
4604 "haveged generates an unpredictable stream of random numbers for use by
4605 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4606 standard mechanisms for filling the entropy pool may not be sufficient for
4607 systems with high needs or limited user interaction, such as headless servers.
4609 @command{haveged} runs as a privileged daemon, harvesting randomness from the
4610 indirect effects of hardware events on hidden processor state using the
4611 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
4612 It tunes itself to its environment and provides the same built-in test suite
4613 for the output stream as used on certified hardware security devices.
4615 The quality of the randomness produced by this algorithm has not been proven.
4616 It is recommended to run it together with another entropy source like rngd, and
4617 not as a replacement for it.")
4618 (license (list (license:non-copyleft "file://nist/mconf.h")
4619 (license:non-copyleft "file://nist/packtest.c")
4620 license:public-domain ; nist/dfft.c
4621 license:gpl3+)))) ; everything else
4623 (define-public ecryptfs-utils
4625 (name "ecryptfs-utils")
4630 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4631 version "/+download/ecryptfs-utils_"
4632 version ".orig.tar.gz"))
4635 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4636 (build-system gnu-build-system)
4638 `(#:configure-flags (list "--disable-pywrap")
4640 (modify-phases %standard-phases
4641 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4642 (lambda* (#:key inputs outputs #:allow-other-keys)
4643 (let ((out (assoc-ref outputs "out"))
4644 (utils-linux (assoc-ref inputs "utils-linux"))
4645 (cryptsetup (assoc-ref inputs "cryptsetup"))
4646 (linux-pam (assoc-ref inputs "linux-pam"))
4647 (lvm2 (assoc-ref inputs "lvm2")))
4648 (substitute* '("src/utils/ecryptfs-mount-private"
4649 "src/utils/ecryptfs-umount-private"
4650 "src/utils/ecryptfs-setup-private"
4651 "src/utils/ecryptfs-setup-swap"
4652 "src/utils/mount.ecryptfs.c"
4653 "src/utils/umount.ecryptfs.c"
4654 "src/pam_ecryptfs/pam_ecryptfs.c"
4655 "src/desktop/ecryptfs-mount-private.desktop.in"
4656 "src/desktop/ecryptfs-setup-private.desktop.in")
4658 (string-append utils-linux "/bin/mount"))
4660 (string-append utils-linux "/bin/umount"))
4661 (("/sbin/mount.ecryptfs_private")
4662 (string-append out "/sbin/mount.ecryptfs_private"))
4663 (("/sbin/umount.ecryptfs_private")
4664 (string-append out "/sbin/umount.ecryptfs_private"))
4665 (("/usr/bin/ecryptfs-mount-private")
4666 (string-append out "/bin/ecryptfs-mount-private"))
4667 (("/usr/bin/ecryptfs-rewrite-file")
4668 (string-append out "/bin/ecryptfs-rewrite-file"))
4669 (("/usr/bin/ecryptfs-setup-private")
4670 (string-append out "/bin/ecryptfs-setup-private"))
4671 (("/sbin/cryptsetup")
4672 (string-append cryptsetup "/sbin/cryptsetup"))
4673 (("/sbin/unix_chkpwd")
4674 (string-append linux-pam "/sbin/unix_chkpwd"))
4676 (string-append lvm2 "/sbin/dmsetup")))))))))
4678 `(("intltool" ,intltool)
4679 ("perl" ,perl) ; for pod2man
4680 ("pkg-config" ,pkg-config)))
4682 `(("keyutils" ,keyutils)
4683 ("linux-pam" ,linux-pam)
4684 ("utils-linux" ,util-linux)
4685 ("cryptsetup" ,cryptsetup)
4688 (home-page "http://ecryptfs.org/")
4689 (synopsis "eCryptfs cryptographic file system utilities")
4691 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4692 Each file's cryptographic meta-data is stored inside the file itself, along
4693 with the encrypted contents. This allows individual encrypted files to be
4694 copied between hosts and still be decrypted with the proper key. eCryptfs is a
4695 native Linux file system, and has been part of the Linux kernel since version
4696 2.6.19. This package contains the userland utilities to manage it.")
4697 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4698 ;; grant additional permission to link with OpenSSL.
4699 (license license:gpl2+)))
4701 (define-public libnfsidmap
4703 (name "libnfsidmap")
4708 (uri (string-append "https://fedorapeople.org/~steved/"
4709 name "/" version "/" name "-" version ".tar.bz2"))
4711 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
4712 (build-system gnu-build-system)
4714 `(#:configure-flags (list
4715 (string-append "--with-pluginpath="
4716 (assoc-ref %outputs "out")
4717 "/lib/libnfsidmap"))))
4719 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
4721 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4722 (synopsis "NFSv4 support library for name/ID mapping")
4723 (description "Libnfsidmap is a library holding mulitiple methods of
4724 mapping names to ids and visa versa, mainly for NFSv4. It provides an
4725 extensible array of mapping functions, currently consisting of two choices:
4726 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4727 (license (license:non-copyleft "file://COPYING"
4728 "See COPYING in the distribution."))))
4730 (define-public module-init-tools
4732 (name "module-init-tools")
4737 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
4738 "module-init-tools-" version ".tar.bz2"))
4741 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
4742 (patches (search-patches "module-init-tools-moduledir.patch"))))
4743 (build-system gnu-build-system)
4745 ;; FIXME: The upstream tarball lacks man pages, and building them would
4746 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
4747 ;; but they vanished. In the meantime, fake it.
4749 (modify-phases %standard-phases
4750 (add-before 'configure 'fake-docbook
4752 (substitute* "Makefile.in"
4753 (("^DOCBOOKTOMAN.*$")
4754 "DOCBOOKTOMAN = true\n"))
4756 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
4757 (synopsis "Tools for loading and managing Linux kernel modules")
4759 "Tools for loading and managing Linux kernel modules, such as
4760 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
4761 (license license:gpl2+)))
4763 (define-public mcelog
4769 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
4770 "mcelog.git/snapshot/v" version ".tar.gz"))
4773 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
4774 (file-name (string-append name "-" version ".tar.gz"))
4775 (modules '((guix build utils)))
4778 ;; The snapshots lack a .git directory,
4779 ;; breaking ‘git describe’.
4780 (substitute* "Makefile"
4781 (("\"unknown\"") (string-append "\"v" ,version "\"")))
4783 (build-system gnu-build-system)
4785 `(#:phases (modify-phases %standard-phases
4786 (delete 'configure)) ; no configure script
4787 #:make-flags (let ((out (assoc-ref %outputs "out")))
4789 (string-append "prefix=" out)
4790 (string-append "DOCDIR=" out "/share/doc/mcelog")
4791 "etcprefix=$(DOCDIR)/examples"))
4792 ;; The tests will only run as root on certain supported CPU models.
4794 (supported-systems (list "i686-linux" "x86_64-linux"))
4795 (home-page "https://mcelog.org/")
4796 (synopsis "Machine check monitor for x86 Linux systems")
4798 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
4799 and other hardware errors on x86 systems. It can also perform user-defined
4800 tasks, such as bringing bad pages off-line, when configurable error thresholds
4802 (license license:gpl2)))
4804 (define-public mtd-utils
4811 "ftp://ftp.infradead.org/pub/mtd-utils/"
4812 "mtd-utils-" version ".tar.bz2"))
4815 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
4817 '(#:configure-flags '("--enable-unit-tests")))
4819 `(("cmocka" ,cmocka)
4820 ("pkg-config" ,pkg-config)))
4822 `(("acl" ,acl) ; extended attributes (xattr)
4823 ("libuuid" ,util-linux)
4825 ("openssl" ,openssl) ; optional crypto support
4827 ("zstd" ,zstd "lib")))
4828 (build-system gnu-build-system)
4829 (synopsis "MTD Flash Storage Utilities")
4830 (description "This package provides utilities for testing, partitioning, etc
4832 (home-page "http://www.linux-mtd.infradead.org/")
4834 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
4835 license:mpl1.1 ; All ftl* files
4836 license:expat)))) ; libiniparser
4838 (define-public libseccomp
4844 (uri (string-append "https://github.com/seccomp/libseccomp/"
4845 "releases/download/v" version
4846 "/libseccomp-" version ".tar.gz"))
4849 "0nsq81acrbkdr8zairxbwa33bj2a6126npp76b4srjl472sjfkxm"))
4850 (patches (search-patches "libseccomp-open-aarch64.patch"))))
4851 (build-system gnu-build-system)
4853 `(("which" ,which)))
4854 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
4855 (description "The libseccomp library provides an easy to use, platform
4856 independent, interface to the Linux Kernel's syscall filtering mechanism. The
4857 libseccomp API is designed to abstract away the underlying BPF based syscall
4858 filter language and present a more conventional function-call based filtering
4859 interface that should be familiar to, and easily adopted by, application
4861 (home-page "https://github.com/seccomp/libseccomp")
4862 (license license:lgpl2.1)))
4864 (define-public radeontop
4872 (url "https://github.com/clbr/radeontop.git")
4873 (commit (string-append "v" version))))
4874 (file-name (git-file-name name version))
4876 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
4877 (build-system gnu-build-system)
4879 `(#:phases (modify-phases %standard-phases
4880 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4881 ;; dependency, and doesn't even work on release(!) tarballs.
4882 (add-after 'unpack 'report-correct-version
4884 (substitute* "getver.sh"
4886 (string-append "ver=" ,version)))
4888 (delete 'configure)) ; no configure script
4889 #:make-flags (list "CC=gcc"
4890 (string-append "PREFIX=" %output))
4891 #:tests? #f)) ; no tests
4893 `(("gettext" ,gettext-minimal)
4894 ("pkg-config" ,pkg-config)))
4896 `(("libdrm" ,libdrm)
4897 ("libpciaccess" ,libpciaccess)
4899 ("ncurses" ,ncurses)))
4900 (home-page "https://github.com/clbr/radeontop/")
4901 (synopsis "Usage monitor for AMD Radeon graphics")
4902 (description "RadeonTop monitors resource consumption on supported AMD
4903 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4904 a terminal or saved to a file for further processing. It measures both the
4905 activity of the GPU as a whole, which is also accurate during OpenCL
4906 computations, as well as separate component statistics that are only meaningful
4907 under OpenGL graphics workloads.")
4908 (license license:gpl3)))
4910 (define-public efivar
4916 (uri (string-append "https://github.com/rhboot/" name
4917 "/releases/download/" version "/" name
4918 "-" version ".tar.bz2"))
4921 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
4922 (build-system gnu-build-system)
4924 `(;; Tests require a UEFI system and is not detected in the chroot.
4926 #:make-flags (list (string-append "prefix=" %output)
4927 (string-append "libdir=" %output "/lib")
4929 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4931 (modify-phases %standard-phases
4933 (add-before 'build 'kernel-headers-are-system-headers
4934 (lambda* (#:key inputs #:allow-other-keys)
4935 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
4936 ;; Make sure the kernel headers are treated as system headers
4937 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
4938 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
4941 `(("pkg-config" ,pkg-config)))
4944 (home-page "https://github.com/rhboot/efivar")
4945 (synopsis "Tool and library to manipulate EFI variables")
4946 (description "This package provides a library and a command line
4947 interface to the variable facility of UEFI boot firmware.")
4948 (license license:lgpl2.1+)))
4950 (define-public efibootmgr
4956 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
4957 "/releases/download/" version "/efibootmgr"
4958 "-" version ".tar.bz2"))
4961 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
4962 (build-system gnu-build-system)
4964 `(#:tests? #f ;no tests
4965 #:make-flags (list (string-append "prefix=" %output)
4966 (string-append "libdir=" %output "/lib")
4967 ;; EFIDIR denotes a subdirectory relative to the
4968 ;; EFI System Partition where the loader will be
4969 ;; installed (known as OS_VENDOR in the code).
4970 ;; GRUB overrides this, as such it's only used if
4971 ;; nothing else is specified on the command line.
4973 ;; Treat kernel headers as system headers to prevent
4974 ;; warnings about conflicting types.
4975 (string-append "C_INCLUDE_PATH="
4976 (assoc-ref %build-inputs "kernel-headers")
4978 #:phases (modify-phases %standard-phases (delete 'configure))))
4980 `(("pkg-config" ,pkg-config)))
4982 `(("efivar" ,efivar)
4984 (home-page "https://github.com/rhinstaller/efibootmgr")
4985 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
4987 "@code{efibootmgr} is a user-space application to modify the Intel
4988 Extensible Firmware Interface (EFI) Boot Manager. This application can
4989 create and destroy boot entries, change the boot order, change the next
4990 running boot option, and more.")
4991 (license license:gpl2+)))
4993 (define-public sysstat
4999 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5000 "sysstat-" version ".tar.xz"))
5003 "0xc3983ccr0dwab1px2jhbgj86pfmmr29k7ggnwjwm1qigmriak1"))))
5004 (build-system gnu-build-system)
5006 `(#:tests? #f ; No test suite.
5007 ;; Without this flag, it tries to install the man pages with group 'root'
5008 ;; and fails because /etc/passwd lacks an entry for the root user.
5010 (list "--disable-file-attr"
5011 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5013 (modify-phases %standard-phases
5014 ;; The build process tries to create '/var/lib/sa', so we skip that
5016 (add-after 'build 'skip-touching-var
5018 (substitute* "Makefile"
5019 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5022 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5023 (synopsis "Performance monitoring tools for Linux")
5024 (description "The sysstat utilities are a collection of performance
5025 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5026 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5027 @code{sadf} and @code{sa}.")
5028 (license license:gpl2+)))
5030 (define-public light
5038 (url "https://github.com/haikarainen/light.git")
5039 (commit (string-append "v" version))))
5041 (base32 "0zrjipd392bzjvxx0rjrb0cgi0ix1d83fwgw1mcy8kc4d16cgyjg"))
5042 (file-name (git-file-name name version))))
5043 (build-system gnu-build-system)
5045 `(("autoconf" ,autoconf)
5046 ("automake" ,automake)))
5047 (home-page "https://haikarainen.github.io/light/")
5048 (synopsis "GNU/Linux application to control backlights")
5050 "Light is a program to send commands to screen backlight controllers
5051 under GNU/Linux. Features include:
5054 @item It does not rely on X.
5055 @item Light can automatically figure out the best controller to use, making
5056 full use of underlying hardware.
5057 @item It is possible to set a minimum brightness value, as some controllers
5058 set the screen to be pitch black at a vaĺue of 0 (or higher).
5061 Light is the successor of lightscript.")
5062 (license license:gpl3+)))
5064 (define-public brightnessctl
5065 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5067 (name "brightnessctl")
5068 (version (git-version "0.4" "0" commit))
5072 (url "https://github.com/Hummer12007/brightnessctl/")
5074 (file-name (git-file-name name version))
5077 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5078 (build-system gnu-build-system)
5080 '(#:tests? #f ; no tests
5081 #:make-flags (list "CC=gcc"
5082 (string-append "PREFIX=" %output)
5083 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5085 (modify-phases %standard-phases
5087 (add-after 'unpack 'adjust-udev-rules
5089 (substitute* "90-brightnessctl.rules"
5090 (("/bin/") "/run/current-system/profile/bin/"))
5092 (home-page "https://github.com/Hummer12007/brightnessctl")
5093 (synopsis "Backlight and LED brightness control")
5095 "This program allows you read and control device brightness. Devices
5096 include backlight and LEDs. It can also preserve current brightness before
5097 applying the operation, such as on lid close.
5099 The appropriate permissions must be set on the backlight or LED control
5100 interface in sysfs, which can be accomplished with the included udev rules.")
5101 (license license:expat))))
5110 "https://github.com/linrunner/"
5111 (string-upcase name)
5112 "/archive/" version ".tar.gz"))
5113 (file-name (string-append name "-" version ".tar.gz"))
5116 "059kxrpxx580mm6p0z2a421nxngszyh4yqqhbgvn04b6a7dbsa2w"))))
5117 (inputs `(("bash" ,bash)
5119 ("ethtool" ,ethtool)
5123 ("inetutils" ,inetutils)
5126 ("pciutils" ,pciutils)
5130 ("usbutils" ,usbutils)
5131 ("util-linux" ,util-linux)
5132 ("wireless-tools" ,wireless-tools)
5133 ,@(if (let ((system (or (%current-target-system)
5134 (%current-system))))
5135 (or (string-prefix? "i686-" system)
5136 (string-prefix? "x86_64-" system)))
5137 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5139 (build-system gnu-build-system)
5141 `(#:modules ((guix build gnu-build-system)
5145 (modify-phases %standard-phases
5146 (delete 'configure) ; no configure script
5147 (add-before 'build 'setenv
5148 (lambda* (#:key outputs #:allow-other-keys)
5149 (let ((out (assoc-ref outputs "out")))
5150 (setenv "TLP_WITH_SYSTEMD" "0")
5151 (setenv "TLP_NO_INIT" "1")
5152 (setenv "TLP_NO_PMUTILS" "1")
5153 (setenv "TLP_SBIN" (string-append out "/bin"))
5154 (setenv "TLP_BIN" (string-append out "/bin"))
5155 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5156 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5157 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5158 (setenv "TLP_CONF" "/etc/tlp")
5160 (string-append out "/lib/elogind/system-sleep"))
5162 (string-append out "/share/bash-completion/completions"))
5163 (setenv "TLP_MAN" (string-append out "/share/man"))
5164 (setenv "TLP_META" (string-append out "/share/metainfo"))
5166 (delete 'check) ; no tests
5167 (add-before 'install 'fix-installation
5169 ;; Stop the Makefile from trying to create system directories.
5170 (substitute* "Makefile"
5171 (("\\[ -f \\$\\(_CONF\\) \\]") "#")
5172 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5176 (invoke "make" "install-tlp" "install-man")))
5177 (add-after 'install 'wrap
5178 (lambda* (#:key inputs outputs #:allow-other-keys)
5179 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5180 (bin-files (find-files bin ".*")))
5181 (define (bin-directory input-name)
5182 (let ((p (assoc-ref inputs input-name)))
5183 (and p (string-append p "/bin"))))
5184 (define (sbin-directory input-name)
5185 (string-append (assoc-ref inputs input-name) "/sbin"))
5186 (for-each (lambda (program)
5187 (wrap-program program
5190 (filter-map bin-directory
5202 "x86-energy-perf-policy"))
5203 (filter-map sbin-directory
5209 "wireless-tools"))))))
5212 (home-page "http://linrunner.de/en/tlp/tlp.html")
5213 (synopsis "Power management tool for Linux")
5214 (description "TLP is a power management tool for Linux. It comes with
5215 a default configuration already optimized for battery life. Nevertheless,
5216 TLP is customizable to fulfil system requirements. TLP settings are applied
5217 every time the power supply source is changed.")
5218 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5220 (license (list license:gpl2+ license:gpl3+))))
5228 (uri (string-append "https://www.ezix.org/software/"
5229 "files/lshw-" version
5233 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5234 (build-system gnu-build-system)
5236 `(#:phases (modify-phases %standard-phases (delete 'configure))
5237 #:tests? #f ; no tests
5239 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5240 (synopsis "List hardware information")
5242 "@command{lshw} (Hardware Lister) is a small tool to provide
5243 detailed information on the hardware configuration of the machine.
5244 It can report exact memory configuration, firmware version, mainboard
5245 configuration, CPU version and speed, cache configuration, bus speed,
5246 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5247 machines (PowerMac G4 is known to work).")
5248 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5249 (license license:gpl2+)))
5251 (define-public libmnl
5258 (uri (string-append "mirror://netfilter.org/libmnl/"
5259 "libmnl-" version ".tar.bz2"))
5262 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5263 (build-system gnu-build-system)
5264 (home-page "https://www.netfilter.org/projects/libmnl/")
5265 (synopsis "Netlink utility library")
5266 (description "Libmnl is a minimalistic user-space library oriented to
5267 Netlink developers. There are a lot of common tasks in parsing, validating,
5268 constructing of both the Netlink header and TLVs that are repetitive and easy to
5269 get wrong. This library aims to provide simple helpers that allows you to
5270 re-use code and to avoid re-inventing the wheel.")
5271 (license license:lgpl2.1+)))
5273 (define-public libnftnl
5280 (uri (string-append "mirror://netfilter.org/libnftnl/"
5281 "libnftnl-" version ".tar.bz2"))
5283 (base32 "1wqlxf76bkqf3qhka9sw32qhb2ni20q1k6rn3iril2kw482lvpk6"))
5285 (search-patches "libnftnl-dont-check-NFTNL_FLOWTABLE_SIZE.patch"))))
5286 (build-system gnu-build-system)
5288 `(("pkg-config" ,pkg-config)))
5290 `(("libmnl" ,libmnl)))
5291 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5292 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5293 (description "Libnftnl is a userspace library providing a low-level netlink
5294 programming interface to the in-kernel nf_tables subsystem. The library
5295 libnftnl has been previously known as libnftables. This library is currently
5297 (license license:gpl2+)))
5299 (define-public nftables
5306 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
5308 (string-append "https://www.nftables.org/projects/nftables"
5309 "/files/nftables-" version ".tar.bz2")))
5311 (base32 "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm"))))
5312 (build-system gnu-build-system)
5313 (arguments `(#:configure-flags
5314 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5315 (inputs `(("bison" ,bison)
5319 ("libnftnl" ,libnftnl)
5320 ("readline" ,readline)))
5321 (native-inputs `(("pkg-config" ,pkg-config)))
5322 (home-page "https://www.nftables.org")
5323 (synopsis "Userspace utility for Linux packet filtering")
5324 (description "nftables is the project that aims to replace the existing
5325 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5326 filtering framework, a new userspace utility and also a compatibility layer for
5327 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5328 infrastructure such as the existing hooks, the connection tracking system, the
5329 userspace queueing component and the logging subsystem.")
5330 (license license:gpl2)))
5332 (define-public proot
5340 (url "https://github.com/proot-me/PRoot.git")
5341 (commit (string-append "v" version))))
5342 (file-name (git-file-name name version))
5344 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5345 (patches (search-patches "proot-test-fhs.patch"))))
5346 (build-system gnu-build-system)
5348 '(#:make-flags '("-C" "src")
5350 #:phases (modify-phases %standard-phases
5352 (add-before 'build 'set-shell-file-name
5353 (lambda* (#:key inputs #:allow-other-keys)
5354 (substitute* (find-files "src" "\\.[ch]$")
5357 (assoc-ref inputs "bash")
5360 (add-before 'check 'fix-fhs-assumptions-in-tests
5362 (substitute* "tests/test-c6b77b77.mk"
5363 (("/bin/bash") (which "bash"))
5364 (("/usr/bin/test") (which "test")))
5365 (substitute* '("tests/test-16573e73.c")
5366 (("/bin/([a-z-]+)" _ program)
5369 (substitute* (find-files "tests" "\\.sh$")
5370 ;; Some of the tests try to "bind-mount" /bin/true.
5372 (string-append "-b " (which "true") ":"))
5373 ;; Likewise for /bin.
5374 (("-b /bin:") "-b /gnu:")
5375 ;; Others try to run /bin/sh.
5376 (("/bin/sh") (which "sh"))
5377 ;; Others assume /etc/fstab exists.
5378 (("/etc/fstab") "/etc/passwd"))
5380 (substitute* "tests/GNUmakefile"
5381 (("-b /bin:") "-b /gnu:"))
5383 ;; XXX: This test fails in an obscure corner case, just
5385 (delete-file "tests/test-kkkkkkkk.c")
5390 (let ((n (parallel-job-count)))
5391 ;; For some reason we get lots of segfaults with
5392 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5393 (setenv "PROOT_NO_SECCOMP" "1")
5395 ;; Most of the tests expect "/bin" to be in $PATH so
5396 ;; they can run things that live in $ROOTFS/bin.
5398 (string-append (getenv "PATH") ":/bin"))
5400 (invoke "make" "check" "-C" "tests"
5402 "-j" (number->string n)))))
5404 (lambda* (#:key outputs #:allow-other-keys)
5405 ;; The 'install' rule does nearly nothing.
5406 (let* ((out (assoc-ref outputs "out"))
5407 (man1 (string-append out "/share/man/man1")))
5408 ;; TODO: 'make install-care' (does not even
5409 ;; build currently.)
5410 (invoke "make" "-C" "src" "install"
5411 (string-append "PREFIX=" out))
5414 (copy-file "doc/proot/man.1"
5415 (string-append man1 "/proot.1"))
5417 (native-inputs `(("which" ,which)
5419 ;; For 'mcookie', used by some of the tests.
5420 ("util-linux" ,util-linux)))
5421 (inputs `(("talloc" ,talloc)))
5422 (home-page "https://github.com/proot-me/PRoot")
5423 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5425 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5426 and @code{binfmt_misc}. This means that users don't need any privileges or
5427 setup to do things like using an arbitrary directory as the new root
5428 file system, making files accessible somewhere else in the file system
5429 hierarchy, or executing programs built for another CPU architecture
5430 transparently through QEMU user-mode. Also, developers can use PRoot as a
5431 generic process instrumentation engine thanks to its extension mechanism.
5432 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5433 available in the kernel Linux.")
5434 (license license:gpl2+)))
5436 (define-public proot-static
5439 (name "proot-static")
5441 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5442 (inputs `(("talloc" ,talloc/static)))
5444 (substitute-keyword-arguments (package-arguments proot)
5445 ((#:make-flags flags)
5446 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5448 `(modify-phases ,phases
5449 (add-after 'strip 'remove-store-references
5450 (lambda* (#:key outputs #:allow-other-keys)
5451 (let* ((out (assoc-ref outputs "out")))
5452 (with-directory-excursion out
5453 (remove-store-references "bin/proot")
5455 ((#:allowed-references _ '("out"))
5458 (define-public cpuid
5461 (version "20180519")
5464 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5465 version ".src.tar.gz"))
5468 "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
5469 (build-system gnu-build-system)
5471 '(#:make-flags '("CC=gcc")
5472 #:tests? #f ; no tests
5473 #:phases (modify-phases %standard-phases
5474 (delete 'configure) ; no configure script
5475 (add-before 'install 'fix-makefile
5476 (lambda* (#:key outputs #:allow-other-keys)
5477 (substitute* "Makefile"
5478 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5479 ;; Make the compressed manpages writable so that the
5480 ;; reset-gzip-timestamps phase does not error out.
5481 (substitute* "Makefile"
5482 (("-m 444") "-m 644"))
5484 (inputs `(("perl" ,perl)))
5485 (supported-systems '("i686-linux" "x86_64-linux"))
5486 (home-page "http://www.etallen.com/cpuid.html")
5487 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5488 (description "cpuid dumps detailed information about the CPU(s) gathered
5489 from the CPUID instruction, and also determines the exact model of CPU(s). It
5490 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5491 NexGen, Rise, and SiS CPUs.")
5492 (license license:gpl2+)))
5494 (define-public jmtpfs
5501 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5503 (file-name (string-append name "-" version ".tar.gz"))
5506 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5507 (build-system gnu-build-system)
5511 ("libmtp" ,libmtp)))
5513 `(("pkg-config" ,pkg-config)))
5514 (home-page "https://github.com/JasonFerrara/jmtpfs")
5515 (synopsis "Use a FUSE file system to access data over MTP")
5516 (description "jmtpfs uses FUSE (file system in userspace) to provide access
5517 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
5518 the MTP device as a file system.")
5519 (license license:gpl3)))
5521 (define-public procenv
5528 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5530 (file-name (string-append name "-" version ".tar.gz"))
5532 (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
5533 (build-system gnu-build-system)
5534 (arguments `(#:configure-flags '("--disable-silent-rules")))
5535 (native-inputs `(("pkg-config" ,pkg-config)))
5536 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5537 ("groff" ,groff) ; for tests
5538 ("libselinux" ,libselinux)))
5539 (synopsis "Utility to show process environment")
5540 (description "Procenv is a command-line tool that displays as much detail about
5541 itself and its environment as possible. It can be used as a test
5542 tool, to understand the type of environment a process runs in, and for
5543 comparing system environments.")
5544 (home-page "http://github.com/jamesodhunt/procenv/")
5545 (license license:gpl3+)))
5547 (define-public libfabric
5555 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5556 version "/libfabric-" version ".tar.bz2"))
5558 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5559 (build-system gnu-build-system)
5560 (inputs `(("rdma-core" ,rdma-core)
5561 ,@(match (%current-system)
5562 ((member (package-supported-systems psm))
5566 (home-page "https://ofiwg.github.io/libfabric/")
5567 (synopsis "Open Fabric Interfaces")
5569 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5570 communication services to applications. OFI is best described as a collection
5571 of libraries and applications used to export fabric services. The key
5572 components of OFI are: application interfaces, provider libraries, kernel
5573 services, daemons, and test applications.
5575 Libfabric is a core component of OFI. It is the library that defines and
5576 exports the user-space API of OFI, and is typically the only software that
5577 applications deal with directly. It works in conjunction with provider
5578 libraries, which are often integrated directly into libfabric.")
5579 (license (list license:bsd-2 license:gpl2)))) ;dual
5584 (version "3.3.20170428")
5585 (home-page "https://github.com/intel/psm")
5589 (uri (git-reference (url home-page)
5590 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5591 (file-name (string-append "psm-" version ".tar.gz"))
5593 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5594 (patches (search-patches
5595 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5596 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5597 "psm-repro.patch" ; reproducibility
5598 "psm-disable-memory-stats.patch"))))
5599 (build-system gnu-build-system)
5600 (outputs '("out" "debug"))
5601 (inputs `(("libuuid" ,util-linux)))
5603 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5604 ,(string-append "INSTALL_PREFIX=" %output)
5605 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5607 #:phases (modify-phases %standard-phases
5609 (add-after 'unpack 'patch-/usr/include
5611 (substitute* "Makefile"
5612 (("\\$\\{DESTDIR}/usr/include")
5613 (string-append %output "/include")))
5614 (substitute* "Makefile"
5615 (("/lib64") "/lib"))
5617 (add-after 'unpack 'patch-sysmacros
5619 (substitute* "ipath/ipath_proto.c"
5620 (("#include <sys/poll.h>" m)
5621 (string-append m "\n"
5622 "#include <sys/sysmacros.h>")))
5624 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5626 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5627 communications interface for the True Scale family of products. PSM users are
5628 enabled with mechanisms necessary to implement higher level communications
5629 interfaces in parallel environments.")
5630 ;; Only Intel-compatable processors are supported.
5631 (supported-systems '("i686-linux" "x86_64-linux"))
5632 (license (list license:bsd-2 license:gpl2)))) ;dual
5634 (define-public snapscreenshot
5636 (name "snapscreenshot")
5637 (version "1.0.14.3")
5641 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5642 name "-" version ".tar.bz2"))
5644 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5645 (build-system gnu-build-system)
5648 (let ((out (assoc-ref %outputs "out")))
5649 (list (string-append "BINDIR=" out "/bin")
5650 (string-append "MANDIR=" out "/share/man")))
5651 #:tests? #f ; no test suite
5653 (modify-phases %standard-phases
5654 (delete 'configure) ; ./configure is a snarky no-op
5655 (add-before 'install 'fix-ownership
5656 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5658 (substitute* "depfun.mak"
5659 ((" -o bin -g bin ") " "))
5661 (add-before 'install 'create-output-directories
5662 (lambda* (#:key outputs #:allow-other-keys)
5663 (let ((out (assoc-ref outputs "out")))
5664 (mkdir-p (string-append out "/share/man/man1"))
5666 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
5667 (synopsis "Take screenshots of one or more Linux text consoles")
5669 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
5670 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
5671 relevant @file{/dev/vcs*} file(s).")
5672 (license license:gpl2)))
5674 (define-public fbcat
5681 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
5682 version "/" name "-" version ".tar.gz"))
5684 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
5685 (build-system gnu-build-system)
5687 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
5688 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
5689 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
5690 `(("pnmtopng" ,netpbm)))
5691 (outputs (list "out" "fbgrab"))
5695 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5696 #:tests? #f ; no tests
5698 (modify-phases %standard-phases
5699 (delete 'configure) ; no configure script
5700 (add-after 'build 'qualify-references
5701 (lambda* (#:key inputs outputs #:allow-other-keys)
5702 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5703 (out (assoc-ref outputs "out")))
5704 (substitute* "fbgrab"
5706 (string-append out "/bin/" all))
5708 (string-append pnmtopng "/bin/" all)))
5710 (add-after 'install 'split-fbgrab-output
5711 (lambda* (#:key outputs #:allow-other-keys)
5712 (let* ((out (assoc-ref outputs "out"))
5713 (out:fbgrab (assoc-ref outputs "fbgrab")))
5714 (for-each (lambda (file)
5715 (let ((old (string-append out "/" file))
5716 (new (string-append out:fbgrab "/" file)))
5717 (mkdir-p (dirname new))
5718 (rename-file old new)))
5720 "share/man/man1/fbgrab.1"))
5722 (home-page "https://jwilk.net/software/fbcat")
5723 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
5725 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
5726 a dump therof. It supports a wide range of drivers and pixel formats.
5727 @command{fbcat} can take screenshots of virtually any application that can be
5728 made to write its output to the framebuffer, including (but not limited to)
5729 text-mode or graphical applications that don't use a display server.
5731 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
5732 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
5733 (license license:gpl2)))
5735 (define-public libcgroup
5743 "mirror://sourceforge/libcg/" name "/"
5744 version "/" name "-" version ".tar.bz2"))
5746 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
5747 (build-system gnu-build-system)
5754 `(("linux-pam" ,linux-pam)))
5755 (home-page "https://sourceforge.net/projects/libcg/")
5756 (synopsis "Control groups management tools")
5757 (description "Control groups is Linux kernel method for process resource
5758 restriction, permission handling and more. This package provides userspace
5759 interface to this kernel feature.")
5760 (license license:lgpl2.1)))
5762 (define-public mbpfan
5770 (url "https://github.com/dgraziotin/mbpfan.git")
5771 (commit (string-append "v" version))))
5772 (file-name (git-file-name name version))
5774 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5775 (build-system gnu-build-system)
5777 '(#:tests? #f ; tests ask to be run as root
5778 #:make-flags (let ((out (assoc-ref %outputs "out")))
5779 (list (string-append "DESTDIR=" out)
5782 (modify-phases %standard-phases
5783 (add-after 'unpack 'patch-paths
5785 (substitute* "Makefile"
5788 (delete 'configure)))) ; there's no configure phase
5789 (home-page "https://github.com/dgraziotin/mbpfan")
5790 (synopsis "Control fan speed on Macbooks")
5792 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
5793 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
5794 module. It can be executed as a daemon or in the foreground with root
5796 (license license:gpl3+)))
5805 (url "https://github.com/intel/opa-psm2.git")
5806 (commit (string-append "PSM2_" version))))
5807 (file-name (git-file-name name version))
5810 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
5811 (build-system gnu-build-system)
5814 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5816 #:phases (modify-phases %standard-phases
5818 (add-after 'unpack 'patch-Makefiles
5820 (substitute* "Makefile"
5823 (substitute* "compat/Makefile"
5829 (setenv "DESTDIR" %output)
5830 (invoke "make" "install")
5833 `(("rdma-core" ,rdma-core)
5834 ("numactl" ,numactl)))
5835 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
5837 "This package is low-level user-level Intel's communications interface.
5838 The PSM2 API is a high-performance vendor-specific protocol that provides a
5839 low-level communications interface for the Intel Omni-Path family of
5840 high-speed networking devices.")
5841 (home-page "https://github.com/intel/opa-psm2")
5842 ;; Only the x86_64 architecure is supported.
5843 (supported-systems '("x86_64-linux"))
5844 (license (list license:bsd-3 license:gpl2)))) ; dual
5846 (define-public libpfm4
5852 (uri (string-append "mirror://sourceforge/perfmon2/"
5853 name "/libpfm-" version ".tar.gz"))
5856 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
5857 (build-system gnu-build-system)
5859 '(#:modules ((guix build utils)
5860 (guix build gnu-build-system))
5861 #:phases (modify-phases %standard-phases
5865 (lambda* (#:key inputs outputs #:allow-other-keys)
5866 (let* ((out (assoc-ref outputs "out")))
5871 (lambda* (#:key outputs #:allow-other-keys)
5872 (let* ((out (assoc-ref outputs "out")))
5874 (string-append "PREFIX=" out)
5877 (synopsis "Performance event monitoring library")
5879 "This package provides a library called libpfm4, which is used to develop
5880 monitoring tools exploiting the performance monitoring events such as those
5881 provided by the Performance Monitoring Unit (PMU) of modern processors.
5883 Libpfm4 helps convert from an event name, expressed as a string, to the event
5884 encoding that is either the raw event as documented by the hardware vendor or
5885 the OS-specific encoding. In the latter case, the library is able to prepare
5886 the OS-specific data structures needed by the kernel to setup the event.
5888 libpfm4 provides support for the @code{perf_events} interface, which was
5889 introduced in Linux 2.6.31.")
5890 (home-page "http://perfmon2.sourceforge.net/")
5891 (license license:expat)))
5893 (define-public libnfnetlink
5895 (name "libnfnetlink")
5900 "https://www.netfilter.org/projects/libnfnetlink/files/"
5901 "libnfnetlink-" version ".tar.bz2"))
5904 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
5905 (build-system gnu-build-system)
5906 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
5907 (synopsis "Low-level netfilter netlink communication library")
5909 "@code{libnfnetlink} is the low-level library for netfilter related
5910 kernel/userspace communication. It provides a generic messaging
5911 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
5912 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
5913 management tools in userspace.")
5914 (license license:gpl2)))
5916 (define-public go-netlink
5923 (url "https://github.com/vishvananda/netlink.git")
5924 (commit (string-append "v" version))))
5925 (file-name (git-file-name name version))
5928 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
5929 (build-system go-build-system)
5931 `(#:import-path "github.com/vishvananda/netlink"))
5933 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
5934 ("go-netns" ,go-netns)))
5935 (home-page "https://github.com/vishvananda/netlink")
5936 (synopsis "Simple netlink library for Go")
5937 (description "The netlink package provides a simple netlink library for
5938 Go. Netlink is the interface a user-space program in Linux uses to
5939 communicate with the kernel. It can be used to add and remove interfaces, set
5940 IP addresses and routes, and configure IPsec.")
5941 (license license:asl2.0)))
5943 (define-public xfsprogs
5950 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
5951 "xfsprogs-" version ".tar.gz"))
5954 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
5955 (build-system gnu-build-system)
5956 (outputs (list "out" "python"))
5958 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
5960 (modify-phases %standard-phases
5961 (add-after 'install 'separate-python-output
5962 (lambda* (#:key outputs #:allow-other-keys)
5963 (let ((out (assoc-ref outputs "out"))
5964 (python (assoc-ref outputs "python")))
5967 (mkdir-p (string-append python (dirname script)))
5968 (rename-file (string-append out script)
5969 (string-append python script)))
5970 (list "/sbin/xfs_scrub_all"))
5972 (add-after 'install 'install-headers
5974 (invoke "make" "install-dev"))))))
5976 `(("gettext" ,gettext-minimal)
5977 ("util-linux" ,util-linux)))
5979 `(("python" ,python-wrapper)))
5980 (home-page "https://xfs.wiki.kernel.org/")
5981 (synopsis "XFS file system tools")
5982 (description "This package provides commands to create and check XFS
5984 ;; The library "libhandle" and the headers in "xfslibs-dev" are
5985 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
5986 (license (list license:gpl2 license:lgpl2.1))))
5988 (define-public genext2fs
5995 (url "https://github.com/jeremie-koenig/genext2fs.git")
5996 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
5997 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
5998 (file-name (git-file-name name version))
6000 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6001 (build-system gnu-build-system)
6004 (modify-phases %standard-phases
6005 (add-after 'unpack 'apply-debian-patches
6006 ;; Debian changes (the revision after ‘-’ in VERSION) are
6007 ;; maintained as separate patches. Apply those relevant to us.
6011 (invoke "patch" "-p1" "-i"
6012 (string-append "debian/patches/" file-name)))
6013 (list "blocksize+creator.diff" ; add -B/-o options
6014 "byteswap_fix.diff"))
6017 `(("autoconf" ,autoconf)
6018 ("automake" ,automake)))
6019 (home-page "https://github.com/jeremie-koenig/genext2fs")
6020 (synopsis "Generate ext2 file system as a normal user")
6021 (description "This package provides a program to generate an ext2
6022 file system as a normal (non-root) user. It does not require you to mount
6023 the image file to copy files on it, nor does it require that you become
6024 the superuser to make device nodes.")
6025 (license license:gpl2)))
6027 (define-public fakeroot
6033 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6034 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6035 (file-name (string-append name "-" version ".tar.gz"))
6038 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6039 (build-system gnu-build-system)
6042 (modify-phases %standard-phases
6043 (add-after 'configure 'patch-Makefile
6045 ;; Note: The root of the problem is already in "Makefile.am".
6046 (substitute* "Makefile"
6047 (("/bin/sh") (which "sh")))
6049 (add-after 'unpack 'patch-getopt
6050 (lambda* (#:key inputs #:allow-other-keys)
6051 (substitute* "scripts/fakeroot.in"
6053 (string-append (assoc-ref inputs "util-linux")
6056 (add-before 'configure 'setenv
6058 (setenv "LIBS" "-lacl")
6060 (add-before 'check 'prepare-check
6062 (setenv "SHELL" (which "bash"))
6063 (setenv "VERBOSE" "1")
6064 (substitute* "test/t.touchinstall"
6065 ;; We don't have the name of the root user, so use ID=0.
6066 (("grep root") "grep \"\\<0\\>\""))
6067 (substitute* "test/tartest"
6068 ;; We don't have the name of the root group, so use ID=0.
6069 (("ROOTGROUP=root") "ROOTGROUP=0")
6070 ;; We don't have the name of the daemon user, so use IDs.
6071 (("daemon:sys") "1:3")
6073 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6074 (substitute* "test/compare-tar"
6075 (("tar -tvf") "tar --numeric-owner -tvf"))
6079 ("sharutils" ,sharutils) ; for the tests
6080 ("xz" ,xz))) ; for the tests
6082 `(("libcap" ,libcap)
6083 ("util-linux" ,util-linux)))
6084 (synopsis "Provides a fake root environment")
6085 (description "@command{fakeroot} runs a command in an environment where
6086 it appears to have root privileges for file manipulation. This is useful
6087 for allowing users to create archives (tar, ar, .deb etc.) with files in
6088 them with root permissions/ownership. Without fakeroot one would have to
6089 have root privileges to create the constituent files of the archives with
6090 the correct permissions and ownership, and then pack them up, or one would
6091 have to construct the archives directly, without using the archiver.")
6092 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6093 (license license:gpl3+)))
6095 (define-public inputattach
6097 (name "inputattach")
6102 (url "https://github.com/linuxwacom/input-wacom.git")
6103 (commit (string-append "input-wacom-" version))))
6104 (file-name (git-file-name name version))
6106 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6107 (build-system gnu-build-system)
6110 (modify-phases %standard-phases
6114 (lambda* (#:key inputs #:allow-other-keys)
6115 (with-directory-excursion "inputattach"
6116 (invoke (string-append (assoc-ref inputs "gcc")
6118 "-O2" "-o" "inputattach" "inputattach.c"))
6122 (lambda* (#:key outputs #:allow-other-keys)
6123 (let ((target-dir (string-append
6124 (assoc-ref outputs "out")
6126 (mkdir-p target-dir)
6127 (copy-file "inputattach/inputattach"
6128 (string-append target-dir
6131 (home-page "https://linuxwacom.github.io/")
6132 (synopsis "Dispatch input peripherals events to a device file")
6133 (description "inputattach dispatches input events from several device
6134 types and interfaces and translates so that the X server can use them.")
6135 (license license:gpl2+)))
6137 (define-public pipewire
6144 (url "https://github.com/PipeWire/pipewire")
6146 (file-name (git-file-name name version))
6149 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
6150 (build-system meson-build-system)
6152 '(#:configure-flags '("-Dsystemd=false")))
6154 `(("pkg-config" ,pkg-config)))
6156 `(("alsa-lib" ,alsa-lib)
6160 ("gstreamer" ,gstreamer)
6161 ("gst-plugins-base" ,gst-plugins-base)
6165 (home-page "https://pipewire.org/")
6166 (synopsis "Server and user space API to deal with multimedia pipelines")
6168 "PipeWire is a project that aims to greatly improve handling of audio and
6169 video under Linux. It aims to support the usecases currently handled by both
6170 PulseAudio and Jack and at the same time provide same level of powerful handling
6171 of Video input and output. It also introduces a security model that makes
6172 interacting with audio and video devices from containerized applications easy,
6173 with supporting Flatpak applications being the primary goal. Alongside Wayland
6174 and Flatpak we expect PipeWire to provide a core building block for the future
6175 of Linux application development.")
6176 (license license:lgpl2.0+)))
6185 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6187 (file-name (git-file-name name version))
6190 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6191 (build-system gnu-build-system)
6194 (modify-phases %standard-phases
6195 (add-after 'unpack 'fix-dbus-tests
6197 (substitute* '("unit/test-dbus-message-fds.c"
6198 "unit/test-dbus-properties.c"
6200 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6204 ("libtool" ,libtool)))
6206 `(("autoconf" ,autoconf)
6207 ("pkgconfig" ,pkg-config)
6208 ("automake" ,automake)))
6209 (home-page "https://01.org/ell")
6210 (synopsis "Embedded Linux Library")
6211 (description "The Embedded Linux* Library (ELL) provides core, low-level
6212 functionality for system daemons. It typically has no dependencies other than
6213 the Linux kernel, C standard library, and libdl (for dynamic linking). While
6214 ELL is designed to be efficient and compact enough for use on embedded Linux
6215 platforms, it is not limited to resource-constrained systems.")
6216 (license license:lgpl2.1+)))