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 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>
41 ;;; This file is part of GNU Guix.
43 ;;; GNU Guix is free software; you can redistribute it and/or modify it
44 ;;; under the terms of the GNU General Public License as published by
45 ;;; the Free Software Foundation; either version 3 of the License, or (at
46 ;;; your option) any later version.
48 ;;; GNU Guix is distributed in the hope that it will be useful, but
49 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
50 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51 ;;; GNU General Public License for more details.
53 ;;; You should have received a copy of the GNU General Public License
54 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
56 (define-module (gnu packages linux)
57 #:use-module (gnu packages)
58 #:use-module (gnu packages acl)
59 #:use-module (gnu packages admin)
60 #:use-module (gnu packages algebra)
61 #:use-module (gnu packages attr)
62 #:use-module (gnu packages audio)
63 #:use-module (gnu packages autotools)
64 #:use-module (gnu packages backup)
65 #:use-module (gnu packages base)
66 #:use-module (gnu packages bash)
67 #:use-module (gnu packages bison)
68 #:use-module (gnu packages calendar)
69 #:use-module (gnu packages check)
70 #:use-module (gnu packages crypto)
71 #:use-module (gnu packages cryptsetup)
72 #:use-module (gnu packages compression)
73 #:use-module (gnu packages dbm)
74 #:use-module (gnu packages datastructures)
75 #:use-module (gnu packages docbook)
76 #:use-module (gnu packages documentation)
77 #:use-module (gnu packages elf)
78 #:use-module (gnu packages flex)
79 #:use-module (gnu packages file)
80 #:use-module (gnu packages freedesktop)
81 #:use-module (gnu packages gcc)
82 #:use-module (gnu packages gettext)
83 #:use-module (gnu packages glib)
84 #:use-module (gnu packages golang)
85 #:use-module (gnu packages gperf)
86 #:use-module (gnu packages gtk)
87 #:use-module (gnu packages libunwind)
88 #:use-module (gnu packages libusb)
89 #:use-module (gnu packages man)
90 #:use-module (gnu packages maths)
91 #:use-module (gnu packages multiprecision)
92 #:use-module (gnu packages ncurses)
93 #:use-module (gnu packages netpbm)
94 #:use-module (gnu packages networking)
95 #:use-module (gnu packages ninja)
96 #:use-module (gnu packages nss)
97 #:use-module (gnu packages perl)
98 #:use-module (gnu packages pciutils)
99 #:use-module (gnu packages pkg-config)
100 #:use-module (gnu packages popt)
101 #:use-module (gnu packages pulseaudio)
102 #:use-module (gnu packages python)
103 #:use-module (gnu packages readline)
104 #:use-module (gnu packages rrdtool)
105 #:use-module (gnu packages samba)
106 #:use-module (gnu packages serialization)
107 #:use-module (gnu packages slang)
108 #:use-module (gnu packages texinfo)
109 #:use-module (gnu packages tls)
110 #:use-module (gnu packages valgrind)
111 #:use-module (gnu packages video)
112 #:use-module (gnu packages web)
113 #:use-module (gnu packages xiph)
114 #:use-module (gnu packages xml)
115 #:use-module (gnu packages xdisorg)
116 #:use-module (gnu packages xorg)
117 #:use-module (gnu packages groff)
118 #:use-module (gnu packages rsync)
119 #:use-module (gnu packages selinux)
120 #:use-module (gnu packages swig)
121 #:use-module (guix build-system cmake)
122 #:use-module (guix build-system gnu)
123 #:use-module (guix build-system go)
124 #:use-module (guix build-system python)
125 #:use-module (guix build-system trivial)
126 #:use-module (guix build-system linux-module)
127 #:use-module (guix download)
128 #:use-module (guix git-download)
129 #:use-module ((guix licenses) #:prefix license:)
130 #:use-module (guix packages)
131 #:use-module (guix gexp)
132 #:use-module (guix store)
133 #:use-module (guix monads)
134 #:use-module (guix utils)
135 #:use-module (srfi srfi-1)
136 #:use-module (srfi srfi-2)
137 #:use-module (srfi srfi-26)
138 #:use-module (ice-9 match))
140 (define-public (system->linux-architecture arch)
141 "Return the Linux architecture name for ARCH, a Guix system name such as
142 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
143 (let ((arch (car (string-split arch #\-))))
144 (cond ((string=? arch "i686") "i386")
145 ((string-prefix? "mips" arch) "mips")
146 ((string-prefix? "arm" arch) "arm")
147 ((string-prefix? "aarch64" arch) "arm64")
148 ((string-prefix? "alpha" arch) "alpha")
149 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
150 ((string-prefix? "s390" arch) "s390")
151 ((string-prefix? "riscv" arch) "riscv")
154 (define-public (system->defconfig system)
155 "Some systems (notably powerpc-linux) require a special target for kernel
156 defconfig. Return the appropriate make target if applicable, otherwise return
158 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
159 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
164 ;;; Kernel source code deblobbing.
167 (define (linux-libre-deblob-scripts version
170 (list (version-major+minor version)
173 (uri (string-append "https://linux-libre.fsfla.org"
174 "/pub/linux-libre/releases/" version "-gnu/"
175 "deblob-" (version-major+minor version)))
176 (sha256 deblob-hash))
179 (uri (string-append "https://linux-libre.fsfla.org"
180 "/pub/linux-libre/releases/" version "-gnu/"
182 (sha256 deblob-check-hash))))
184 (define deblob-scripts-5.3
185 (linux-libre-deblob-scripts
187 (base32 "15n09zq38d69y1wl28s3nasf3377qp2yil5b887zpqrm00dif7i4")
188 (base32 "0nrimraf46nf6y1hwkg29fyl0a83wnj0mwq54ggxvffn9gk5h9pa")))
190 (define deblob-scripts-5.2
191 (linux-libre-deblob-scripts
193 (base32 "076fwxlm6jq6z4vg1xq3kr474zz7qk71r90sf9dnfia3rw2pb4fa")
194 (base32 "1vghzpvlsvz5q8baxjza8jdryjmcx61g2pmnm6dd1k7glr6jy1a9")))
196 (define deblob-scripts-4.19
197 (linux-libre-deblob-scripts
199 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
200 (base32 "1fyacg28aym6virxyn7wk99qil2fjbks3iwm7p3hxy51pccn34za")))
202 (define deblob-scripts-4.14
203 (linux-libre-deblob-scripts
205 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
206 (base32 "0x9nd3hnyrm753cbgdqmy92mbnyw86w64g4hvyibnkpq5n7s3z9n")))
208 (define deblob-scripts-4.9
209 (linux-libre-deblob-scripts
211 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
212 (base32 "0is8gn4qdd7h5l6lacvhqdch26lmrbgxfm8ab7fx8n85ha7y358w")))
214 (define deblob-scripts-4.4
215 (linux-libre-deblob-scripts
217 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
218 (base32 "12ac4g3ky8yma8sylmxvvysqvd4hnaqjiwmxrxb6wlxggfd7zkbx")))
220 (define* (computed-origin-method gexp-promise hash-algo hash
221 #:optional (name "source")
222 #:key (system (%current-system))
223 (guile (default-guile)))
224 "Return a derivation that executes the G-expression that results
225 from forcing GEXP-PROMISE."
226 (mlet %store-monad ((guile (package->derivation guile system)))
227 (gexp->derivation (or name "computed-origin")
229 #:graft? #f ;nothing to graft
231 #:guile-for-build guile)))
233 (define (make-linux-libre-source version
236 "Return a 'computed' origin that generates a Linux-libre tarball from the
237 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
238 (match deblob-scripts
239 ((deblob-version (? origin? deblob) (? origin? deblob-check))
240 (unless (string=? deblob-version (version-major+minor version))
241 ;; The deblob script cannot be expected to work properly on a
242 ;; different version (major+minor) of Linux, even if no errors
243 ;; are signaled during execution.
244 (error "deblob major+minor version mismatch"))
246 (method computed-origin-method)
247 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
251 (with-imported-modules '((guix build utils))
253 (use-modules (guix build utils)
257 (let ((dir (string-append "linux-" #$version)))
260 (set-path-environment-variable
263 #+(canonical-package bash)
264 #+(canonical-package coreutils)
265 #+(canonical-package diffutils)
266 #+(canonical-package findutils)
267 #+(canonical-package patch)
268 #+(canonical-package xz)
269 #+(canonical-package sed)
270 #+(canonical-package grep)
271 #+(canonical-package bzip2)
272 #+(canonical-package gzip)
273 #+(canonical-package tar)
274 ;; The comments in the 'deblob-check' script
275 ;; claim that it supports Python 2 and 3, but
276 ;; in fact it fails when run in Python 3 as
280 (with-directory-excursion "/tmp/bin"
282 (copy-file #+deblob "deblob")
283 (chmod "deblob" #o755)
284 (substitute* "deblob"
285 (("/bin/sh") (which "sh")))
287 (copy-file #+deblob-check "deblob-check")
288 (chmod "deblob-check" #o755)
289 (substitute* "deblob-check"
290 (("/bin/sh") (which "sh"))
291 (("/bin/sed") (which "sed"))
292 (("/usr/bin/python") (which "python"))))
294 (if (file-is-directory? #+upstream-source)
296 (format #t "Copying upstream linux source...~%")
298 (invoke "cp" "--archive" #+upstream-source dir)
299 (invoke "chmod" "--recursive" "u+w" dir))
301 (format #t "Unpacking upstream linux tarball...~%")
303 (invoke "tar" "xf" #$upstream-source)
306 (and (not (member name '("." "..")))
307 (file-is-directory? name))))
309 (unless (string=? dir unpacked-dir)
310 (rename-file unpacked-dir dir)))
312 (error "multiple directories found" dirs)))))
314 (with-directory-excursion dir
315 (setenv "PYTHON" (which "python"))
316 (format #t "Running deblob script...~%")
318 (invoke "/tmp/bin/deblob"))
320 (format #t "~%Packing new Linux-libre tarball...~%")
322 (invoke "tar" "cvfa" #$output
323 ;; Avoid non-determinism in the archive.
336 (define (linux-libre-urls version)
337 "Return a list of URLs for Linux-Libre VERSION."
339 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
340 version "-gnu/linux-libre-" version "-gnu.tar.xz")
342 ;; XXX: Work around <http://bugs.gnu.org/14851>.
344 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
345 version "-gnu.tar.xz")
347 ;; Maybe this URL will become valid eventually.
349 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
350 version "-gnu.tar.xz")))
352 (define (%upstream-linux-source version hash)
355 (uri (string-append "mirror://kernel.org"
356 "/linux/kernel/v" (version-major version) ".x/"
357 "linux-" version ".tar.xz"))
360 (define-public linux-libre-5.3-version "5.3.4")
361 (define-public linux-libre-5.3-pristine-source
362 (let ((version linux-libre-5.3-version)
363 (hash (base32 "0vi4bgcr921z5l6fbcrcgmhaji5gl2avpmp7njna6v0f7sxism0r")))
364 (make-linux-libre-source version
365 (%upstream-linux-source version hash)
366 deblob-scripts-5.3)))
368 (define-public linux-libre-5.2-version "5.2.19")
369 (define-public linux-libre-5.2-pristine-source
370 (let ((version linux-libre-5.2-version)
371 (hash (base32 "12mi857lyd5vj8qhj2f505hqnwzsnd829hxd78n9kk88iv1f966y")))
372 (make-linux-libre-source version
373 (%upstream-linux-source version hash)
374 deblob-scripts-5.2)))
376 (define-public linux-libre-4.19-version "4.19.77")
377 (define-public linux-libre-4.19-pristine-source
378 (let ((version linux-libre-4.19-version)
379 (hash (base32 "1agksl35amjzc6g6d9zjwz6p5qir2cligb5c1d9s2bag9766jav1")))
380 (make-linux-libre-source version
381 (%upstream-linux-source version hash)
382 deblob-scripts-4.19)))
384 (define-public linux-libre-4.14-version "4.14.147")
385 (define-public linux-libre-4.14-pristine-source
386 (let ((version linux-libre-4.14-version)
387 (hash (base32 "04jvp05spszcxmkdsl21dylbcf76ns9bwxf1zlk4x7cxiil97mwg")))
388 (make-linux-libre-source version
389 (%upstream-linux-source version hash)
390 deblob-scripts-4.14)))
392 (define-public linux-libre-4.9-version "4.9.195")
393 (define-public linux-libre-4.9-pristine-source
394 (let ((version linux-libre-4.9-version)
395 (hash (base32 "0s4xj8f1dpnz3fbrqmgwq02smhcrq1ni8hgn2bbfqvm15lm5dgjl")))
396 (make-linux-libre-source version
397 (%upstream-linux-source version hash)
398 deblob-scripts-4.9)))
400 (define-public linux-libre-4.4-version "4.4.194")
401 (define-public linux-libre-4.4-pristine-source
402 (let ((version linux-libre-4.4-version)
403 (hash (base32 "0kvlp2v4nvkilaanhpgwf8dkyfj24msaw0m38rbc4y51y69yhqvz")))
404 (make-linux-libre-source version
405 (%upstream-linux-source version hash)
406 deblob-scripts-4.4)))
408 (define %boot-logo-patch
409 ;; Linux-Libre boot logo featuring Freedo and a gnu.
412 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
413 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
416 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
418 (define %linux-libre-arm-export-__sync_icache_dcache-patch
422 "https://salsa.debian.org/kernel-team/linux"
423 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
424 "/debian/patches/bugfix/arm/"
425 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
426 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
428 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
430 (define (source-with-patches source patches)
433 (patches (append (origin-patches source)
436 (define-public linux-libre-5.3-source
437 (source-with-patches linux-libre-5.3-pristine-source
438 (list %boot-logo-patch
439 %linux-libre-arm-export-__sync_icache_dcache-patch)))
441 (define-public linux-libre-5.2-source
442 (source-with-patches linux-libre-5.2-pristine-source
443 (list (search-patch "linux-libre-active-entropy.patch")
445 %linux-libre-arm-export-__sync_icache_dcache-patch)))
447 (define-public linux-libre-4.19-source
448 (source-with-patches linux-libre-4.19-pristine-source
449 (list %boot-logo-patch
450 %linux-libre-arm-export-__sync_icache_dcache-patch)))
452 (define-public linux-libre-4.14-source
453 (source-with-patches linux-libre-4.14-pristine-source
454 (list %boot-logo-patch)))
456 (define-public linux-libre-4.9-source
457 (source-with-patches linux-libre-4.9-pristine-source
458 (list %boot-logo-patch)))
460 (define-public linux-libre-4.4-source
461 (source-with-patches linux-libre-4.4-pristine-source
462 (list %boot-logo-patch)))
469 (define (make-linux-libre-headers version hash-string)
470 (make-linux-libre-headers* version
473 (uri (linux-libre-urls version))
474 (sha256 (base32 hash-string)))))
476 (define (make-linux-libre-headers* version source)
478 (name "linux-libre-headers")
481 (build-system gnu-build-system)
482 (native-inputs `(("perl" ,perl)
483 ,@(if (version>=? version "4.16")
487 ,@(if (version>=? version "5.3")
491 `(#:modules ((guix build gnu-build-system)
495 (modify-phases %standard-phases
499 (let ((arch ,(system->linux-architecture
500 (or (%current-target-system)
502 (defconfig ,(system->defconfig
503 (or (%current-target-system)
504 (%current-system)))))
506 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
507 (invoke "make" defconfig)
508 (invoke "make" "mrproper" "headers_check"))))
510 (lambda* (#:key outputs #:allow-other-keys)
511 (let ((out (assoc-ref outputs "out")))
513 (string-append "INSTALL_HDR_PATH=" out)
516 (mkdir (string-append out "/include/config"))
517 (call-with-output-file
519 "/include/config/kernel.release")
521 (format p "~a-default~%" ,version)))
523 ;; Remove the '.install' and '..install.cmd' files; the
524 ;; latter contains store paths, which pulls in bootstrap
525 ;; binaries in the build environment, and prevents bit
526 ;; reproducibility for the bootstrap binaries.
527 (for-each delete-file (find-files out "\\.install"))
530 #:allowed-references ()
532 (home-page "https://www.gnu.org/software/linux-libre/")
533 (synopsis "GNU Linux-Libre kernel headers")
534 (description "Headers of the Linux-Libre kernel.")
535 (license license:gpl2)))
537 (define-public linux-libre-headers-5.3
538 (make-linux-libre-headers* linux-libre-5.3-version
539 linux-libre-5.3-source))
541 (define-public linux-libre-headers-5.2
542 (make-linux-libre-headers* linux-libre-5.2-version
543 linux-libre-5.2-source))
545 (define-public linux-libre-headers-4.19
546 (make-linux-libre-headers* linux-libre-4.19-version
547 linux-libre-4.19-source))
549 (define-public linux-libre-headers-4.14
550 (make-linux-libre-headers* linux-libre-4.14-version
551 linux-libre-4.14-source))
553 (define-public linux-libre-headers-4.9
554 (make-linux-libre-headers* linux-libre-4.9-version
555 linux-libre-4.9-source))
557 (define-public linux-libre-headers-4.4
558 (make-linux-libre-headers* linux-libre-4.4-version
559 linux-libre-4.4-source))
561 ;; The following package is used in the early bootstrap, and thus must be kept
562 ;; stable and with minimal build requirements.
563 (define-public linux-libre-headers-4.19.56
564 (make-linux-libre-headers "4.19.56"
565 "1zqiic55viy065lhnkmhn33sz3bbbr2ykbm5f92yzd8lpc9zl7yx"))
567 (define-public linux-libre-headers linux-libre-headers-4.19.56)
571 ;;; Kernel configurations.
574 (define* (kernel-config arch #:key variant)
575 "Return the absolute file name of the Linux-Libre build configuration file
576 for ARCH and optionally VARIANT, or #f if there is no such configuration."
577 (let* ((name (string-append (if variant (string-append variant "-") "")
578 (if (string=? "i386" arch) "i686" arch) ".conf"))
579 (file (string-append "linux-libre/" name)))
580 (search-auxiliary-file file)))
582 ;; FIXME: merge into kernel-config
583 (define* (kernel-config-veyron arch #:key variant)
584 "Return the absolute file name of the Linux-Libre build configuration file
585 for ARCH and optionally VARIANT, or #f if there is no such configuration."
586 (let* ((name (string-append (if variant (string-append variant "-") "")
587 (if (string=? "i386" arch) "i686" arch) "-veyron.conf"))
588 (file (string-append "linux-libre/" name)))
589 (search-auxiliary-file file)))
591 (define %default-extra-linux-options
592 `(;; Some very mild hardening.
593 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
594 ;; All kernels should have NAMESPACES options enabled
595 ("CONFIG_NAMESPACES" . #t)
596 ("CONFIG_UTS_NS" . #t)
597 ("CONFIG_IPC_NS" . #t)
598 ("CONFIG_USER_NS" . #t)
599 ("CONFIG_PID_NS" . #t)
600 ("CONFIG_NET_NS" . #t)
601 ;; Modules required for initrd:
602 ("CONFIG_NET_9P" . m)
603 ("CONFIG_NET_9P_VIRTIO" . m)
604 ("CONFIG_VIRTIO_BLK" . m)
605 ("CONFIG_VIRTIO_NET" . m)
606 ("CONFIG_VIRTIO_PCI" . m)
607 ("CONFIG_VIRTIO_BALLOON" . m)
608 ("CONFIG_VIRTIO_MMIO" . m)
609 ("CONFIG_FUSE_FS" . m)
611 ("CONFIG_9P_FS" . m)))
613 (define (config->string options)
614 (string-join (map (match-lambda
616 (string-append option "=m"))
618 (string-append option "=y"))
620 (string-append option "=n")))
626 ;;; Kernel package utilities.
629 (define* (make-linux-libre version hash-string supported-systems
631 ;; A function that takes an arch and a variant.
632 ;; See kernel-config for an example.
634 (configuration-file #f)
635 (defconfig "defconfig")
636 (extra-options %default-extra-linux-options)
637 (patches (list %boot-logo-patch)))
638 (make-linux-libre* version
641 (uri (linux-libre-urls version))
642 (sha256 (base32 hash-string))
645 #:extra-version extra-version
646 #:configuration-file configuration-file
647 #:defconfig defconfig
648 #:extra-options extra-options))
650 (define* (make-linux-libre* version source supported-systems
652 ;; A function that takes an arch and a variant.
653 ;; See kernel-config for an example.
655 (configuration-file #f)
656 (defconfig "defconfig")
657 (extra-options %default-extra-linux-options))
659 (name (if extra-version
660 (string-append "linux-libre-" extra-version)
664 (supported-systems supported-systems)
665 (build-system gnu-build-system)
671 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
675 ;; These are needed to compile the GCC plugins.
680 ,@(match (and configuration-file
682 (system->linux-architecture
683 (or (%current-target-system) (%current-system)))
684 #:variant (version-major+minor version)))
685 (#f ;no config for this platform
688 `(("kconfig" ,config))))))
690 `(#:modules ((guix build gnu-build-system)
696 (modify-phases %standard-phases
697 (add-after 'unpack 'patch-/bin/pwd
699 (substitute* (find-files "." "^Makefile(\\.include)?$")
700 (("/bin/pwd") "pwd"))
703 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
704 ;; Unset CROSS_CPATH to make sure that cross-libc is not
705 ;; found. Otherwise, some of its header would conflict with the
706 ;; one from linux (stdint.h and linux/types.h)
707 ,@(if (%current-target-system)
708 '((unsetenv "CROSS_CPATH"))
711 ;; On AArch64 (at least), we need to remove glibc headers from CPATH
712 ;; (they are still available as "system headers"), so that the kernel
713 ;; can override uint64_t. See <https://bugs.gnu.org/37593>.
716 (remove (cut string-prefix? (assoc-ref inputs "libc") <>)
717 (string-split (getenv "CPATH") #\:))
719 (format #t "environment variable `CPATH' changed to `~a'~%"
722 ;; Avoid introducing timestamps
723 (setenv "KCONFIG_NOTIMESTAMP" "1")
724 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
726 ;; Set ARCH and CROSS_COMPILE
727 (let ((arch ,(system->linux-architecture
728 (or (%current-target-system)
729 (%current-system)))))
731 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
734 (setenv "CROSS_COMPILE" (string-append target "-"))
735 (format #t "`CROSS_COMPILE' set to `~a'~%"
736 (getenv "CROSS_COMPILE"))))
738 (setenv "EXTRA_VERSION" ,extra-version)
740 (let ((build (assoc-ref %standard-phases 'build))
741 (config (assoc-ref (or native-inputs inputs) "kconfig")))
743 ;; Use a custom kernel configuration file or a default
744 ;; configuration file.
747 (copy-file config ".config")
748 (chmod ".config" #o666))
749 (invoke "make" ,defconfig))
751 ;; Appending works even when the option wasn't in the
752 ;; file. The last one prevails if duplicated.
753 (let ((port (open-file ".config" "a"))
754 (extra-configuration ,(config->string extra-options)))
755 (display extra-configuration port)
758 (invoke "make" "oldconfig"))))
760 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
761 (let* ((out (assoc-ref outputs "out"))
762 (moddir (string-append out "/lib/modules"))
763 (dtbdir (string-append out "/lib/dtbs"))
764 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
765 ;; Install kernel image, kernel configuration and link map.
766 (for-each (lambda (file) (install-file file out))
767 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
768 ;; Install device tree files
769 (unless (null? (find-files "." "\\.dtb$"))
771 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
773 ;; Install kernel modules
776 (string-append "DEPMOD=" kmod "/bin/depmod")
777 (string-append "MODULE_DIR=" moddir)
778 (string-append "INSTALL_PATH=" out)
779 (string-append "INSTALL_MOD_PATH=" out)
780 "INSTALL_MOD_STRIP=1"
781 "modules_install")))))
783 (home-page "https://www.gnu.org/software/linux-libre/")
784 (synopsis "100% free redistribution of a cleaned Linux kernel")
786 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
787 It has been modified to remove all non-free binary blobs.")
788 (license license:gpl2)))
792 ;;; Generic kernel packages.
795 (define-public linux-libre-5.3
796 (make-linux-libre* linux-libre-5.3-version
797 linux-libre-5.3-source
798 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
799 #:configuration-file kernel-config))
801 (define-public linux-libre-version linux-libre-5.3-version)
802 (define-public linux-libre-pristine-source linux-libre-5.3-pristine-source)
803 (define-public linux-libre-source linux-libre-5.3-source)
804 (define-public linux-libre linux-libre-5.3)
806 (define-public linux-libre-5.2
807 (make-linux-libre* linux-libre-5.2-version
808 linux-libre-5.2-source
809 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
810 #:configuration-file kernel-config))
812 (define-public linux-libre-4.19
813 (make-linux-libre* linux-libre-4.19-version
814 linux-libre-4.19-source
815 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
816 #:configuration-file kernel-config))
818 (define-public linux-libre-4.14
819 (make-linux-libre* linux-libre-4.14-version
820 linux-libre-4.14-source
821 '("x86_64-linux" "i686-linux" "armhf-linux")
822 #:configuration-file kernel-config))
824 (define-public linux-libre-4.9
825 (make-linux-libre* linux-libre-4.9-version
826 linux-libre-4.9-source
827 '("x86_64-linux" "i686-linux")
828 #:configuration-file kernel-config))
830 (define-public linux-libre-4.4
831 (make-linux-libre* linux-libre-4.4-version
832 linux-libre-4.4-source
833 '("x86_64-linux" "i686-linux")
834 #:configuration-file kernel-config
837 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
838 ;; This option was removed upstream in version 4.7.
839 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
840 %default-extra-linux-options)))
844 ;;; Specialized kernel variants.
847 (define-public linux-libre-arm-veyron
848 (make-linux-libre* linux-libre-version
851 #:configuration-file kernel-config-veyron
852 #:extra-version "arm-veyron"))
854 (define-public linux-libre-arm-generic
855 (make-linux-libre* linux-libre-version
858 #:defconfig "multi_v7_defconfig"
859 #:extra-version "arm-generic"))
861 (define-public linux-libre-arm-generic-4.19
862 (make-linux-libre* linux-libre-4.19-version
863 linux-libre-4.19-source
865 #:defconfig "multi_v7_defconfig"
866 #:extra-version "arm-generic"))
868 (define-public linux-libre-arm-generic-4.14
869 (make-linux-libre* linux-libre-4.14-version
870 linux-libre-4.14-source
872 #:defconfig "multi_v7_defconfig"
873 #:extra-version "arm-generic"))
875 (define-public linux-libre-arm-omap2plus
876 (make-linux-libre* linux-libre-version
879 #:defconfig "omap2plus_defconfig"
880 #:extra-version "arm-omap2plus"))
882 (define-public linux-libre-arm-omap2plus-4.19
883 (make-linux-libre* linux-libre-4.19-version
884 linux-libre-4.19-source
886 #:defconfig "omap2plus_defconfig"
887 #:extra-version "arm-omap2plus"))
889 (define-public linux-libre-arm-omap2plus-4.14
890 (make-linux-libre* linux-libre-4.14-version
891 linux-libre-4.14-source
893 #:defconfig "omap2plus_defconfig"
894 #:extra-version "arm-omap2plus"))
898 ;;; Linux kernel modules.
901 (define-public acpi-call-linux-module
903 (name "acpi-call-linux-module")
909 (url "https://github.com/teleshoes/acpi_call.git")
911 (file-name (git-file-name name version))
913 (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
914 (build-system linux-module-build-system)
916 `(#:tests? #f ; no tests
918 (modify-phases %standard-phases
919 (add-after 'unpack 'fix-for-linux-4.12
921 (substitute* "acpi_call.c"
925 (add-after 'install 'install-documentation
926 (lambda* (#:key outputs #:allow-other-keys)
927 (let* ((out (assoc-ref outputs "out"))
928 (doc (string-append out "/share/doc/" ,name "-" ,version)))
929 (for-each (lambda (file)
930 (let ((target (string-append doc "/" file)))
931 (mkdir-p (dirname target))
932 (copy-recursively file target)))
933 (list "README.md" "examples"))
935 (home-page "https://github.com/teleshoes/acpi_call")
936 (synopsis "Linux kernel module to perform ACPI method calls")
938 "This simple Linux kernel module allows calls from user space to any
939 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
940 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
941 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
942 and @code{ACPI_BUFFER}.
944 It grants direct and undocumented access to your hardware that may cause damage
945 and should be used with caution, especially on untested models.")
946 (license license:gpl3+))) ; see README.md (no licence headers)
948 (define-public vhba-module
955 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
959 "1ybbk6l06n0y11n5wnfmvdz0baizmq55l458ywimghdyz0n7g0ws"))))
960 (build-system linux-module-build-system)
964 (home-page "https://cdemu.sourceforge.io/")
965 (synopsis "Kernel module that emulates SCSI devices")
966 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
967 between the CDemu userspace daemon and linux kernel.")
968 (license license:gpl2+)))
972 ;;; Pluggable authentication modules (PAM).
975 (define-public linux-pam
983 "https://github.com/linux-pam/linux-pam/releases/download/v"
984 version "/Linux-PAM-" version ".tar.xz"))
987 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
988 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
990 (build-system gnu-build-system)
994 ;; TODO: optional dependencies
995 ;; ("libxcrypt" ,libxcrypt)
996 ;; ("cracklib" ,cracklib)
999 `(;; Most users, such as `shadow', expect the headers to be under
1001 #:configure-flags (list (string-append "--includedir="
1002 (assoc-ref %outputs "out")
1003 "/include/security")
1005 ;; XXX: <rpc/rpc.h> is missing from glibc when
1006 ;; cross-compiling, so we have to disable NIS
1007 ;; support altogether.
1008 ,@(if (%current-target-system)
1012 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1015 (home-page "http://www.linux-pam.org/")
1016 (synopsis "Pluggable authentication modules for Linux")
1018 "A *Free* project to implement OSF's RFC 86.0.
1019 Pluggable authentication modules are small shared object files that can
1020 be used through the PAM API to perform tasks, like authenticating a user
1021 at login. Local and dynamic reconfiguration are its key features.")
1022 (license license:bsd-3)))
1024 (define-public linux-pam-1.2
1032 "http://www.linux-pam.org/library/"
1033 "Linux-PAM-" version ".tar.bz2"))
1036 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1037 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1044 (define-public psmisc
1051 (uri (string-append "mirror://sourceforge/psmisc/psmisc devel/psmisc-"
1055 "0s1kjhrik0wzqbm7hv4gkhywhjrwhp9ajw0ad05fwharikk6ah49"))))
1056 (build-system gnu-build-system)
1057 (inputs `(("ncurses" ,ncurses)))
1058 (home-page "https://gitlab.com/psmisc/psmisc")
1060 "Small utilities that use the proc file system")
1062 "This PSmisc package is a set of some small useful utilities that
1063 use the proc file system. We're not about changing the world, but
1064 providing the system administrator with some help in common tasks.")
1065 (license license:gpl2+)))
1067 (define-public util-linux
1073 (uri (string-append "mirror://kernel.org/linux/utils/"
1074 name "/v" (version-major+minor version) "/"
1075 name "-" version ".tar.xz"))
1078 "1db2kydkwjmvgd1glkcba3adhidxw0f1x735dcjdpdjjf869sgvl"))
1079 (patches (search-patches "util-linux-tests.patch"))
1080 (modules '((guix build utils)))
1082 ;; We take 'nologin' from Shadow, the 'logger' program from
1083 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1085 (substitute* "configure"
1086 (("build_nologin=yes") "build_nologin=no")
1087 (("build_logger=yes") "build_logger=no")
1088 (("build_kill=yes") "build_kill=no"))
1090 (build-system gnu-build-system)
1092 "static")) ; >2 MiB of static .a libraries
1094 `(#:configure-flags (list "--disable-use-tty-group"
1095 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1096 ;; Don't try to chown root:root mount and umount
1097 "--disable-makeinstall-chown"
1098 ;; Install completions where our
1099 ;; bash-completion package expects them.
1100 (string-append "--with-bashcompletiondir="
1101 (assoc-ref %outputs "out")
1102 "/etc/bash_completion.d"))
1103 #:phases (modify-phases %standard-phases
1105 'build 'set-umount-file-name
1106 (lambda* (#:key outputs #:allow-other-keys)
1107 ;; Tell 'eject' the right file name of 'umount'.
1108 (let ((out (assoc-ref outputs "out")))
1109 (substitute* "sys-utils/eject.c"
1110 (("\"/bin/umount\"")
1111 (string-append "\"" out "/bin/umount\"")))
1115 (lambda* (#:key inputs outputs #:allow-other-keys)
1116 (let ((out (assoc-ref outputs "out"))
1117 (net (assoc-ref inputs "net-base")))
1118 ;; Change the test to refer to the right file.
1119 (substitute* "tests/ts/misc/mcookie"
1121 (string-append net "/etc/services")))
1124 'install 'move-static-libraries
1125 (lambda* (#:key outputs #:allow-other-keys)
1126 (let ((out (assoc-ref outputs "out"))
1127 (static (assoc-ref outputs "static")))
1128 (mkdir-p (string-append static "/lib"))
1129 (with-directory-excursion out
1130 (for-each (lambda (file)
1132 (string-append static "/"
1134 (find-files "lib" "\\.a$"))
1136 ;; Remove references to the static library from the '.la'
1137 ;; files so that Libtool does the right thing when both
1138 ;; the shared and static library is available.
1139 (substitute* (find-files "lib" "\\.la$")
1140 (("old_library=.*") "old_library=''\n")))
1143 (inputs `(("zlib" ,zlib)
1144 ("ncurses" ,ncurses)
1146 ;; XXX: This is so that the 'pre-check' phase can find it.
1147 ,@(if (%current-target-system)
1148 `(("net-base" ,net-base))
1152 ("net-base" ,net-base))) ;for tests
1153 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1154 (synopsis "Collection of utilities for the Linux kernel")
1155 (description "Util-linux is a diverse collection of Linux kernel
1156 utilities. It provides dmesg and includes tools for working with file systems,
1157 block devices, UUIDs, TTYs, and many other tools.")
1159 ;; Note that util-linux doesn't use the same license for all the
1160 ;; code. GPLv2+ is the default license for a code without an
1161 ;; explicitly defined license.
1162 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1163 license:bsd-4 license:public-domain))))
1165 (define-public ddate
1171 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1173 (file-name (string-append name "-" version ".tar.gz"))
1175 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1176 (build-system cmake-build-system)
1177 (arguments '(#:tests? #f))
1178 (home-page "https://github.com/bo0ts/ddate")
1179 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1181 "ddate displays the Discordian date and holidays of a given date.
1182 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1183 by Robert Shea and Robert Anton Wilson.")
1184 (license license:public-domain)))
1186 (define-public procps
1192 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1193 "procps-ng-" version ".tar.xz"))
1196 "0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
1197 (build-system gnu-build-system)
1199 '(#:modules ((guix build utils)
1200 (guix build gnu-build-system)
1204 (modify-phases %standard-phases
1206 'install 'post-install
1207 ;; Remove commands and man pages redudant with
1209 (lambda* (#:key outputs #:allow-other-keys)
1210 (let* ((out (assoc-ref outputs "out"))
1211 (dup (append-map (cut find-files out <>)
1212 '("^kill" "^uptime"))))
1213 (for-each delete-file dup)
1215 (inputs `(("ncurses" ,ncurses)))
1216 (home-page "https://gitlab.com/procps-ng/procps/")
1217 (synopsis "Utilities that give information about processes")
1219 "Procps is the package that has a bunch of small useful utilities
1220 that give information about processes using the Linux /proc file system.
1221 The package includes the programs ps, top, vmstat, w, kill, free,
1222 slabtop, and skill.")
1223 (license license:gpl2)))
1225 (define-public usbutils
1232 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1233 "usbutils-" version ".tar.xz"))
1235 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1236 (build-system gnu-build-system)
1237 (outputs (list "out" "python"))
1240 (modify-phases %standard-phases
1241 (add-before 'bootstrap 'patch-bootstrap-scripts
1243 (substitute* "usbhid-dump/bootstrap"
1244 (("/bin/bash") (which "bash")))
1246 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1247 (substitute* "autogen.sh"
1248 (("^\\./configure.*") ""))
1250 (add-after 'install 'separate-python-output
1251 ;; Separating one Python script shaves more than 106 MiB from :out.
1252 (lambda* (#:key outputs #:allow-other-keys)
1253 (let ((out (assoc-ref outputs "out"))
1254 (out:python (assoc-ref outputs "python")))
1255 (for-each (lambda (file)
1256 (let ((old (string-append out "/" file))
1257 (new (string-append out:python "/" file)))
1258 (mkdir-p (dirname new))
1259 (rename-file old new)))
1260 (list "bin/lsusb.py"))
1265 ("python" ,python)))
1267 `(("autoconf" ,autoconf)
1268 ("automake" ,automake)
1269 ("libtool" ,libtool)
1270 ("pkg-config" ,pkg-config)))
1271 (home-page "http://www.linux-usb.org/")
1273 "Tools for working with USB devices, such as lsusb")
1275 "Tools for working with USB devices, such as lsusb.")
1276 (license license:gpl2+)))
1278 (define-public e2fsprogs
1285 "mirror://kernel.org/linux/kernel/people/tytso/"
1286 name "/v" version "/"
1287 name "-" version ".tar.xz"))
1290 "02g0cm72sgz709s9pkg4mvj56m7bgs7rwnyc2cp7cvg3j6pcjlj9"))))
1291 (build-system gnu-build-system)
1292 (inputs `(("util-linux" ,util-linux)))
1293 (native-inputs `(("pkg-config" ,pkg-config)
1294 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1298 ("procps" ,procps)))
1300 '(;; util-linux is the preferred source for some of the libraries and
1301 ;; commands, so disable them (see, e.g.,
1302 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1303 #:configure-flags (list "--disable-libblkid"
1304 "--disable-libuuid" "--disable-uuidd"
1307 ;; Use symlinks instead of hard links for
1308 ;; 'fsck.extN' etc. This makes the resulting nar
1309 ;; smaller and is preserved across copies.
1310 "--enable-symlink-install"
1312 (string-append "LDFLAGS=-Wl,-rpath="
1313 (assoc-ref %outputs "out")
1316 ;; Install libext2fs et al.
1317 "--enable-elf-shlibs")
1320 (modify-phases %standard-phases
1321 (add-before 'configure 'patch-shells
1323 (substitute* "configure"
1324 (("/bin/sh (.*)parse-types.sh" _ dir)
1325 (string-append (which "sh") " " dir
1327 (substitute* "MCONFIG.in"
1328 (("INSTALL_SYMLINK = /bin/sh")
1329 "INSTALL_SYMLINK = sh"))
1330 (substitute* (find-files "." "^Makefile.in$")
1332 (string-append "#!" (which "sh"))))
1334 (add-after 'install 'install-libs
1335 (lambda* (#:key outputs #:allow-other-keys)
1336 (let* ((out (assoc-ref outputs "out"))
1337 (lib (string-append out "/lib")))
1338 (invoke "make" "install-libs")
1340 ;; Make the .a writable so that 'strip' works.
1341 ;; Failing to do that, due to debug symbols, we
1342 ;; retain a reference to the final
1343 ;; linux-libre-headers, which refer to the
1344 ;; bootstrap binaries.
1345 (let ((archives (find-files lib "\\.a$")))
1346 (for-each (lambda (file)
1350 (home-page "http://e2fsprogs.sourceforge.net/")
1351 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1353 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1354 (license (list license:gpl2 ;programs
1355 license:lgpl2.0 ;libext2fs
1356 license:x11)))) ;libuuid
1358 (define e2fsprogs/static
1360 (package (inherit e2fsprogs)
1362 ;; Do not build shared libraries.
1363 (substitute-keyword-arguments (package-arguments e2fsprogs)
1364 ((#:configure-flags _)
1365 '(list "--disable-blkid"))
1369 (define-public e2fsck/static
1371 (name "e2fsck-static")
1372 (version (package-version e2fsprogs))
1373 (build-system trivial-build-system)
1376 `(("e2fsprogs" ,e2fsprogs/static)))
1378 `(#:modules ((guix build utils))
1381 (use-modules (guix build utils)
1385 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1387 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1389 (with-directory-excursion bin
1390 (copy-file e2fsck "e2fsck")
1391 (remove-store-references "e2fsck")
1392 (chmod "e2fsck" #o555))
1394 (home-page (package-home-page e2fsprogs))
1395 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1396 (description "This package provides statically-linked e2fsck command taken
1397 from the e2fsprogs package. It is meant to be used in initrds.")
1398 (license (package-license e2fsprogs))))
1400 (define-public extundelete
1402 (name "extundelete")
1407 (uri (string-append "mirror://sourceforge/extundelete/"
1408 "extundelete/" version "/extundelete-"
1409 version ".tar.bz2"))
1412 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1413 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1414 (build-system gnu-build-system)
1415 (inputs `(("e2fsprogs" ,e2fsprogs)))
1416 (home-page "http://extundelete.sourceforge.net/")
1417 (synopsis "Recover deleted files from ext2/3/4 partitions")
1419 "Extundelete is a set of tools that can recover deleted files from an
1420 ext3 or ext4 partition.")
1421 (license license:gpl2)))
1423 (define-public zerofree
1427 (home-page "https://frippery.org/uml/")
1430 (uri (string-append home-page name "-" version
1434 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1435 (build-system gnu-build-system)
1438 (modify-phases %standard-phases
1439 (delete 'configure) ; no configure script
1441 ;; The Makefile lacks an ‘install’ target.
1442 (lambda* (#:key outputs #:allow-other-keys)
1443 (let* ((out (assoc-ref outputs "out"))
1444 (bin (string-append out "/bin")))
1445 (chmod "zerofree" #o555)
1446 (install-file "zerofree" bin)
1448 #:tests? #f)) ; no tests
1449 (inputs `(("libext2fs" ,e2fsprogs)))
1450 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1452 "Zerofree finds the unallocated blocks with non-zero value content in an
1453 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1454 This is a simple way to make disk images more compressible.
1455 Zerofree requires the file system to be unmounted or mounted read-only.")
1456 (license license:gpl2)))
1458 (define-public strace
1462 (home-page "https://strace.io")
1465 (uri (string-append home-page "/files/" version
1466 "/strace-" version ".tar.xz"))
1467 ;; XXX Remove the 'regenerate-tests' phase below when
1468 ;; "strace-ipc-tests.patch" is no longer applied.
1469 (patches (search-patches "strace-ipc-tests.patch"))
1472 "1li49i75wrdw91hchyyd8spnzfcmxcfyfb5g9zbaza89aq4bq4ym"))))
1473 (build-system gnu-build-system)
1476 (modify-phases %standard-phases
1477 (add-after 'unpack 'patch-/bin/sh
1479 (substitute* "strace.c"
1480 (("/bin/sh") (which "sh")))
1482 (add-before 'configure 'regenerate-tests
1483 ;; XXX Remove this phase when "strace-ipc-tests.patch" is no longer
1484 ;; applied in the 'source' field above. This phase is needed to
1485 ;; regenerate many other files from tests/gen_tests.in, which is
1486 ;; modified by the aforementioned patch.
1488 (invoke "tests/gen_tests.sh"))))
1489 ;; Don't fail if the architecture doesn't support different personalities.
1490 #:configure-flags '("--enable-mpers=check")
1491 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1492 #:parallel-tests? #f)) ; undeterministic failures
1493 (native-inputs `(("perl" ,perl)))
1494 (synopsis "System call tracer for Linux")
1496 "strace is a system call tracer, i.e. a debugging tool which prints out a
1497 trace of all the system calls made by a another process/program.")
1498 (license license:lgpl2.1+)))
1500 (define-public ltrace
1506 (uri (string-append "http://www.ltrace.org/ltrace_" version
1510 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1511 (build-system gnu-build-system)
1512 (inputs `(("libelf" ,libelf)))
1514 ;; Compilation uses -Werror by default, but it fails.
1515 '(#:configure-flags '("--disable-werror")))
1516 (home-page "https://www.ltrace.org/")
1517 (synopsis "Library call tracer for Linux")
1519 "ltrace intercepts and records dynamic library calls which are called by
1520 an executed process and the signals received by that process. It can also
1521 intercept and print the system calls executed by the program.")
1522 (license license:gpl2+)))
1524 (define-public alsa-lib
1531 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1532 version ".tar.bz2"))
1535 "0jwr9g4yxg9gj6xx0sb2r6wrdl8amrjd19hilkrq4rirynp770s8"))))
1536 (build-system gnu-build-system)
1537 (home-page "https://www.alsa-project.org/")
1538 (synopsis "The Advanced Linux Sound Architecture libraries")
1540 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1541 MIDI functionality to the Linux-based operating system.")
1542 (license license:lgpl2.1+)))
1544 (define-public alsa-utils
1550 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1551 name "-" version ".tar.bz2"))
1554 "0fi11b7r8hg1bdjw74s8sqx8rc4qb310jaj9lsia9labvfyjrpsx"))))
1555 (build-system gnu-build-system)
1557 ;; XXX: Disable man page creation until we have DocBook.
1558 '(#:configure-flags (list "--disable-xmlto"
1560 ;; The udev rule is responsible for restoring
1562 (string-append "--with-udev-rules-dir="
1563 (assoc-ref %outputs "out")
1564 "/lib/udev/rules.d"))
1566 (modify-phases %standard-phases
1567 (add-before 'check 'disable-broken-test
1569 ;; XXX: The 1.1.8 release tarball is missing a header that's
1570 ;; required for this test to work. Fixed in 1.1.9.
1571 (substitute* "axfer/test/Makefile"
1572 ((".*container-test.*") ""))
1575 'install 'pre-install
1577 ;; Don't try to mkdir /var/lib/alsa.
1578 (substitute* "Makefile"
1579 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1583 `(("libsamplerate" ,libsamplerate)
1584 ("ncurses" ,ncurses)
1585 ("alsa-lib" ,alsa-lib)
1587 ("gettext" ,gettext-minimal)))
1588 (home-page "http://www.alsa-project.org/")
1589 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1591 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1592 MIDI functionality to the Linux-based operating system.")
1594 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1596 (license license:gpl2)))
1598 (define-public alsa-plugins
1600 (name "alsa-plugins")
1604 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1605 name "-" version ".tar.bz2"))
1608 "01zrg0h2jw9dlj9233vjsn916yf4f2s667yry6xsn8d57lq745qn"))))
1609 (build-system gnu-build-system)
1610 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1611 ;; be split, there are references to both in files.
1612 ;; TODO: Remove OSS related plugins, they add support to run native
1613 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1615 (outputs '("out" "pulseaudio" "jack"))
1617 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1618 ;; for /etc/alsa. On Guix System plugins are loaded from
1619 ;; the ALSA service, and other distributions likely
1620 ;; won't use these files.
1621 "--with-alsalconfdir=/tmp/noop")
1623 (modify-phases %standard-phases
1624 (add-after 'install 'split
1625 (lambda* (#:key inputs outputs #:allow-other-keys)
1626 ;; Distribute the binaries to the various outputs.
1627 (let* ((out (assoc-ref outputs "out"))
1628 (jack (assoc-ref outputs "jack"))
1629 (jacklib (string-append jack "/lib/alsa-lib"))
1630 (pua (assoc-ref outputs "pulseaudio"))
1631 (pualib (string-append pua "/lib/alsa-lib")))
1634 (for-each (lambda (file)
1635 (rename-file file (string-append jacklib "/" (basename file))))
1636 (find-files out ".*jack\\.(la|so)"))
1639 (for-each (lambda (file)
1640 (rename-file file (string-append pualib "/" (basename file))))
1641 (find-files out ".*pulse\\.(la|so)"))
1644 `(("alsa-lib" ,alsa-lib)
1646 ("speex" ,speex) ; libspeexdsp resampling plugin
1647 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1648 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1649 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1651 `(("pkg-config" ,pkg-config)))
1652 (home-page "http://www.alsa-project.org/")
1653 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1655 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1656 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1657 by providing additional plugins which include: upmixing, downmixing, jackd and
1658 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1659 external rate conversion.")
1660 (license (list license:gpl2+
1661 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1662 license:lgpl2.1+))))
1664 (define-public iptables
1671 "mirror://netfilter.org/iptables/iptables-"
1672 version ".tar.bz2"))
1675 "0crp0lvh5m2f15pr8cw97h8yb8zjj10x95zj06j46cr68vx2vl2m"))))
1676 (build-system gnu-build-system)
1678 `(("pkg-config" ,pkg-config)
1682 `(("libmnl" ,libmnl)
1683 ("libnftnl" ,libnftnl)))
1685 '(#:tests? #f ; no test suite
1686 #:configure-flags ; add $libdir to the RUNPATH of executables
1687 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1688 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1689 (synopsis "Programs to configure Linux IP packet filtering rules")
1691 "@command{iptables} is the user-space command line program used to
1692 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1693 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1695 This package also includes @command{ip6tables}, which is used to configure the
1698 Both commands are targeted at system administrators.")
1699 (license license:gpl2+)))
1701 (define-public ebtables
1704 (version "2.0.10-4")
1708 "mirror://netfilter.org/ebtables/ebtables-v"
1712 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1713 (build-system gnu-build-system)
1715 '(#:tests? #f ; no test suite
1717 (let* ((out (assoc-ref %outputs "out"))
1718 (bin (string-append out "/sbin"))
1719 (lib (string-append out "/lib"))
1720 (man (string-append out "/share/man"))
1721 (iptables (assoc-ref %build-inputs "iptables"))
1722 (ethertypes (string-append iptables "/etc/ethertypes")))
1723 (list (string-append "LIBDIR=" lib)
1724 (string-append "MANDIR=" man)
1725 (string-append "BINDIR=" bin)
1726 (string-append "ETHERTYPESFILE=" ethertypes)
1727 ;; With the default CFLAGS, it falis with:
1728 ;; communication.c:259:58: error: variable ‘ret’ set but not
1729 ;; used [-Werror=unused-but-set-variable]
1732 (modify-phases %standard-phases
1734 ;; no configure script
1736 (substitute* "Makefile"
1737 ;; Remove user and group options from install commands,
1738 ;; otherwise it fails with: invalid user 'root'.
1739 (("-o root -g root") "")
1740 ;; Remove 'ethertypes' from the install target.
1742 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1746 ("iptables" ,iptables)))
1747 (synopsis "Ethernet bridge frame table administration")
1748 (home-page "http://ebtables.netfilter.org/")
1750 "ebtables is an application program used to set up and maintain the
1751 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1752 analogous to the iptables application, but less complicated, due to the fact
1753 that the Ethernet protocol is much simpler than the IP protocol.")
1754 (license license:gpl2+)))
1756 (define-public iproute
1763 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1767 "0gvv269wjn4279hxr5zzwsk2c5qgswr47za3hm1x4frsk52iw76b"))))
1768 (build-system gnu-build-system)
1770 `( ;; There is a test suite, but it wants network namespaces and sudo.
1772 #:make-flags (let ((out (assoc-ref %outputs "out")))
1774 (string-append "BASH_COMPDIR=" out
1775 "/etc/bash_completion.d")
1776 (string-append "LIBDIR=" out "/lib")
1777 (string-append "HDRDIR=" out "/include")
1778 (string-append "SBINDIR=" out "/sbin")
1779 (string-append "CONFDIR=" out "/etc")
1780 (string-append "DOCDIR=" out "/share/doc/"
1782 (string-append "MANDIR=" out "/share/man")))
1783 #:phases (modify-phases %standard-phases
1784 (add-before 'install 'pre-install
1786 ;; Don't attempt to create /var/lib/arpd.
1787 (substitute* "Makefile"
1788 (("^.*ARPDDIR.*$") ""))
1792 ("iptables" ,iptables)
1793 ("libmnl" ,libmnl)))
1797 ("pkg-config" ,pkg-config)))
1799 ;; ("libmnl" ,libmnl)
1800 ;; ("util-linux" ,util-linux)
1802 "https://wiki.linuxfoundation.org/networking/iproute2")
1804 "Utilities for controlling TCP/IP networking and traffic in Linux")
1806 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1807 and traffic with the Linux kernel. The most important of these are
1808 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1811 Most network configuration manuals still refer to ifconfig and route as the
1812 primary network configuration tools, but ifconfig is known to behave
1813 inadequately in modern network environments, and both should be deprecated.")
1814 (license license:gpl2+)))
1816 (define-public net-tools
1817 ;; XXX: This package is basically unmaintained, but it provides a few
1818 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1820 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1824 (version (string-append "1.60-" revision "." (string-take commit 7)))
1827 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1828 "n/ne/net-tools/code.git/net-tools-code-"
1830 (file-name (string-append name "-" version ".zip"))
1833 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1834 (home-page "http://net-tools.sourceforge.net/")
1835 (build-system gnu-build-system)
1837 '(#:modules ((guix build gnu-build-system)
1842 (modify-phases %standard-phases
1844 (lambda* (#:key outputs #:allow-other-keys)
1845 (let ((out (assoc-ref outputs "out")))
1846 (mkdir-p (string-append out "/bin"))
1847 (mkdir-p (string-append out "/sbin"))
1849 ;; Pretend we have everything...
1850 (system "yes | make config")
1852 ;; ... except for the things we don't have.
1853 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1854 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1855 ;; that have been removed.
1856 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1857 ;; think about adding them later.
1858 (substitute* '("config.make" "config.h")
1859 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1862 (add-after 'install 'remove-redundant-commands
1863 (lambda* (#:key outputs #:allow-other-keys)
1864 ;; Remove commands and man pages redundant with Inetutils.
1865 (let* ((out (assoc-ref outputs "out"))
1866 (dup (append-map (cut find-files out <>)
1868 "^(yp|nis|dns)?domainname"))))
1869 (for-each delete-file dup)
1871 ;; Binaries that depend on libnet-tools.a don't declare that
1872 ;; dependency, making it parallel-unsafe.
1873 #:parallel-build? #f
1875 #:tests? #f ; no test suite
1876 #:make-flags (let ((out (assoc-ref %outputs "out")))
1878 (string-append "BASEDIR=" out)
1879 (string-append "INSTALLNLSDIR=" out "/share/locale")
1880 (string-append "mandir=/share/man")))))
1881 (native-inputs `(("gettext" ,gettext-minimal)
1883 (synopsis "Tools for controlling the network subsystem in Linux")
1885 "This package includes the important tools for controlling the network
1886 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1887 route. Additionally, this package contains utilities relating to particular
1888 network hardware types (plipconfig, slattach) and advanced aspects of IP
1889 configuration (iptunnel, ipmaddr).")
1890 (license license:gpl2+))))
1892 (define-public libcap
1899 "mirror://kernel.org/linux/libs/security/linux-privs/"
1900 "libcap2/libcap-" version ".tar.xz"))
1903 "0sj8kidl7qgf2qwxcbw1vadnlb30y4zvjzxswsmfdghq04npkhfs"))))
1904 (build-system gnu-build-system)
1905 (arguments '(#:phases
1906 (modify-phases %standard-phases
1908 ;; Add $libdir to the RUNPATH of executables.
1910 (substitute* "Make.Rules"
1912 (string-append "LDFLAGS := -Wl,-rpath="
1915 #:tests? #f ; no 'check' target
1916 #:make-flags (list "lib=lib"
1917 (string-append "prefix="
1918 (assoc-ref %outputs "out"))
1919 "RAISE_SETFCAP=no")))
1920 (native-inputs `(("perl" ,perl)))
1921 (inputs `(("attr" ,attr)))
1922 (home-page "https://sites.google.com/site/fullycapable/")
1923 (synopsis "Library for working with POSIX capabilities")
1925 "Libcap2 provides a programming interface to POSIX capabilities on
1926 Linux-based operating systems.")
1928 ;; License is BSD-3 or GPLv2, at the user's choice.
1929 (license license:gpl2)))
1931 (define-public bridge-utils
1933 (name "bridge-utils")
1938 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
1939 "bridge-utils-" version ".tar.xz"))
1941 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
1942 (build-system gnu-build-system)
1944 ;; The tarball lacks all the generated files.
1945 (native-inputs `(("autoconf" ,autoconf)
1946 ("automake" ,automake)))
1949 (modify-phases %standard-phases
1950 (add-before 'bootstrap 'patch-stuff
1952 ;; Fix "field ‘ip6’ has incomplete type" errors.
1953 (substitute* "libbridge/libbridge.h"
1954 (("#include <linux/if_bridge.h>")
1955 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1957 ;; Ensure that the entire build fails if one of the
1958 ;; sub-Makefiles fails.
1959 (substitute* "Makefile.in"
1960 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1961 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1964 #:tests? #f)) ; no 'check' target
1967 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1968 (synopsis "Manipulate Ethernet bridges")
1970 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1971 to connect two Ethernet segments together in a protocol independent way.
1972 Packets are forwarded based on Ethernet address, rather than IP address (like
1973 a router). Since forwarding is done at Layer 2, all protocols can go
1974 transparently through a bridge.")
1975 (license license:gpl2+)))
1977 (define-public libnl
1984 "https://github.com/thom311/libnl/releases/download/"
1985 "libnl" (string-join (string-split version #\.) "_")
1986 "/libnl-" version ".tar.gz"))
1989 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
1990 (build-system gnu-build-system)
1994 ("pkg-config" ,pkg-config)
2000 "https://github.com/thom311/libnl/releases/download/libnl"
2001 (string-join (string-split version #\.) "_")
2002 "/libnl-doc-" version ".tar.gz"))
2004 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2006 `(("python-2" ,python-2)
2007 ("python-3" ,python-3)))
2008 (outputs '("out" "doc" "python2" "python3"))
2010 `(#:modules ((guix build gnu-build-system)
2014 (modify-phases %standard-phases
2015 (add-after 'install 'install-python
2016 (lambda* (#:key outputs #:allow-other-keys)
2017 (define (python-inst python)
2018 (invoke python "setup.py" "build")
2019 (invoke python "setup.py" "install"
2020 (string-append "--prefix="
2021 (assoc-ref %outputs python)))
2022 (invoke python "setup.py" "clean"))
2023 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2024 (assoc-ref %outputs "out")))
2025 (with-directory-excursion "./python"
2026 (for-each python-inst '("python2" "python3")))
2028 (add-after 'install 'install-doc
2029 (lambda* (#:key inputs outputs #:allow-other-keys)
2030 (let ((dest (string-append (assoc-ref outputs "doc")
2031 "/share/doc/libnl")))
2033 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
2034 "--strip-components=1" "-C" dest)))))))
2035 (home-page "https://www.infradead.org/~tgr/libnl/")
2036 (synopsis "NetLink protocol library suite")
2038 "The libnl suite is a collection of libraries providing APIs to netlink
2039 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2040 between the kernel and user space processes. It was designed to be a more
2041 flexible successor to ioctl to provide mainly networking related kernel
2042 configuration and monitoring interfaces.")
2044 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2045 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2046 (license license:gpl2)))
2055 "mirror://kernel.org/software/network/iw/iw-"
2059 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2060 (build-system gnu-build-system)
2061 (native-inputs `(("pkg-config" ,pkg-config)))
2062 (inputs `(("libnl" ,libnl)))
2064 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2066 #:phases (modify-phases %standard-phases (delete 'configure))))
2067 (home-page "https://wireless.wiki.kernel.org/")
2068 (synopsis "Tool for configuring wireless devices")
2070 "iw is a new nl80211 based CLI configuration utility for wireless
2071 devices. It replaces @code{iwconfig}, which is deprecated.")
2072 (license license:isc)))
2074 (define-public powertop
2081 (uri (string-append "https://01.org/sites/default/files/downloads/"
2082 "powertop-v" version ".tar.gz"))
2084 (base32 "0xaazqccyd42v2q532dxx40nqhb9sfsa6cyx8641rl57mfg4bdyk"))))
2085 (build-system gnu-build-system)
2088 (modify-phases %standard-phases
2089 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2090 ;; allow calibrating the network interface in Guix System.
2091 (add-after 'unpack 'patch-absolute-file-names
2092 (lambda* (#:key inputs #:allow-other-keys)
2093 (let ((kmod (assoc-ref inputs "kmod")))
2094 (substitute* (find-files "src" "\\.cpp$")
2095 ;; Give the right 'modprobe' file name so that essential
2096 ;; modules such as msr.ko can be loaded.
2097 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2098 ;; These programs are only needed to calibrate, so using
2099 ;; relative file names avoids adding extra inputs. When they
2100 ;; are missing powertop gracefully handles it.
2101 (("/usr/bin/hcitool") "hcitool")
2102 (("/usr/bin/xset") "xset")
2103 (("/usr/sbin/hciconfig") "hciconfig"))
2108 ("ncurses" ,ncurses)
2109 ("pciutils" ,pciutils)
2112 `(("pkg-config" ,pkg-config)))
2113 (home-page "https://01.org/powertop/")
2114 (synopsis "Analyze power consumption on Intel-based laptops")
2116 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2117 power management. In addition to being a diagnostic tool, PowerTOP also has
2118 an interactive mode where the user can experiment various power management
2119 settings for cases where the operating system has not enabled these
2121 (license license:gpl2)))
2123 (define-public aumix
2130 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2131 version ".tar.bz2"))
2134 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2135 (build-system gnu-build-system)
2136 (inputs `(("ncurses" ,ncurses)))
2137 (home-page "http://www.jpj.net/~trevor/aumix.html")
2138 (synopsis "Audio mixer for X and the console")
2140 "Aumix adjusts an audio mixer from X, the console, a terminal,
2141 the command line or a script.")
2142 (license license:gpl2+)))
2144 (define-public iotop
2151 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2154 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2155 (build-system python-build-system)
2157 ;; The setup.py script expects python-2.
2158 `(#:python ,python-2
2159 ;; There are currently no checks in the package.
2161 (native-inputs `(("python" ,python-2)))
2162 (home-page "http://guichaz.free.fr/iotop/")
2164 "Displays the IO activity of running processes")
2166 "Iotop is a Python program with a top like user interface to show the
2167 processes currently causing I/O.")
2168 (license license:gpl2+)))
2176 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2177 "download/fuse-" version
2178 "/fuse-" version ".tar.gz"))
2181 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2182 (patches (search-patches "fuse-overlapping-headers.patch"))))
2183 (build-system gnu-build-system)
2184 (inputs `(("util-linux" ,util-linux)))
2186 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2187 (assoc-ref %outputs "out")
2189 (string-append "INIT_D_PATH="
2190 (assoc-ref %outputs "out")
2193 ;; The rule makes /dev/fuse 666.
2194 (string-append "UDEV_RULES_PATH="
2195 (assoc-ref %outputs "out")
2196 "/lib/udev/rules.d"))
2198 (modify-phases %standard-phases
2199 (add-before 'build 'set-file-names
2200 (lambda* (#:key inputs #:allow-other-keys)
2201 ;; libfuse calls out to mount(8) and umount(8). Make sure
2202 ;; it refers to the right ones.
2203 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2204 (("/bin/(u?)mount" _ maybe-u)
2205 (string-append (assoc-ref inputs "util-linux")
2206 "/bin/" maybe-u "mount")))
2207 (substitute* '("util/mount.fuse.c")
2211 ;; This hack leads libfuse to search for 'fusermount' in
2212 ;; $PATH, where it may find a setuid-root binary, instead of
2213 ;; trying solely $out/sbin/fusermount and failing because
2215 (substitute* "lib/Makefile"
2216 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2217 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2219 (home-page "https://github.com/libfuse/libfuse")
2220 (synopsis "Support file systems implemented in user space")
2222 "As a consequence of its monolithic design, file system code for Linux
2223 normally goes into the kernel itself---which is not only a robustness issue,
2224 but also an impediment to system extensibility. FUSE, for \"file systems in
2225 user space\", is a kernel module and user-space library that tries to address
2226 part of this problem by allowing users to run file system implementations as
2227 user-space processes.")
2228 (license (list license:lgpl2.1 ;library
2229 license:gpl2+)))) ;command-line utilities
2231 (define-public unionfs-fuse
2233 (name "unionfs-fuse")
2238 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
2240 (file-name (string-append name "-" version ".tar.gz"))
2243 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
2244 (build-system cmake-build-system)
2246 `(("python" ,python)))
2247 (inputs `(("fuse" ,fuse)))
2249 ;; The tests were never actually run ("collected 0 items"), but in recent
2250 ;; versions of pytest that causes an error.
2252 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2253 (synopsis "User-space union file system")
2255 "UnionFS-FUSE is a flexible union file system implementation in user
2256 space, using the FUSE library. Mounting a union file system allows you to
2257 \"aggregate\" the contents of several directories into a single mount point.
2258 UnionFS-FUSE additionally supports copy-on-write.")
2259 (license license:bsd-3)))
2262 (package (inherit fuse)
2263 (name "fuse-static")
2264 (source (origin (inherit (package-source fuse))
2265 (modules '((guix build utils)))
2268 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2269 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2270 ;; that it doesn't do that, allowing us to remove the
2271 ;; dependency on util-linux (something that is useful in
2273 (substitute* '("lib/mount_util.c"
2274 "util/mount_util.c")
2275 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2281 (define-public unionfs-fuse/static
2282 (package (inherit unionfs-fuse)
2283 (synopsis "User-space union file system (statically linked)")
2284 (name (string-append (package-name unionfs-fuse) "-static"))
2285 (source (origin (inherit (package-source unionfs-fuse))
2286 (modules '((guix build utils)))
2289 ;; Add -ldl to the libraries, because libfuse.a needs that.
2290 (substitute* "src/CMakeLists.txt"
2291 (("target_link_libraries(.*)\\)" _ libs)
2292 (string-append "target_link_libraries"
2297 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2299 (modify-phases %standard-phases
2300 (add-after 'install 'post-install
2301 (lambda* (#:key outputs #:allow-other-keys)
2302 (let* ((out (assoc-ref outputs "out"))
2303 (exe (string-append out "/bin/unionfs")))
2304 ;; By default, 'unionfs' keeps references to
2305 ;; $glibc/share/locale and similar stuff. Remove them.
2306 (remove-store-references exe)
2308 ;; 'unionfsctl' has references to glibc as well. Since
2309 ;; we don't need it, remove it.
2310 (delete-file (string-append out "/bin/unionfsctl"))
2312 (inputs `(("fuse" ,fuse-static)))))
2314 (define-public sshfs
2320 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2321 "download/sshfs-" version "/sshfs-" version
2325 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2326 (build-system gnu-build-system)
2331 `(("pkg-config" ,pkg-config)))
2332 (home-page "https://github.com/libfuse/sshfs")
2333 (synopsis "Mount remote file systems over SSH")
2335 "This is a file system client based on the SSH File Transfer Protocol.
2336 Since most SSH servers already support this protocol it is very easy to set
2337 up: on the server side there's nothing to do; on the client side mounting the
2338 file system is as easy as logging into the server with an SSH client.")
2339 (license license:gpl2+)))
2341 (define-public sshfs-fuse
2342 (package (inherit sshfs)
2344 (properties `((superseded . ,sshfs)))))
2346 (define-public archivemount
2348 (name "archivemount")
2353 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2354 "archivemount-" version ".tar.gz"))
2356 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2357 (build-system gnu-build-system)
2358 (inputs `(("fuse" ,fuse)
2359 ("libarchive" ,libarchive)))
2360 (native-inputs `(("pkg-config" ,pkg-config)))
2361 (home-page "https://www.cybernoia.de/software/archivemount.html")
2362 (synopsis "Tool for mounting archive files with FUSE")
2363 (description "archivemount is a FUSE-based file system for Unix variants,
2364 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2365 mount point where it can be read from or written to as with any other file
2366 system. This makes accessing the contents of the archive, which may be
2367 compressed, transparent to other programs, without decompressing them.")
2368 (license license:lgpl2.0+)))
2370 (define-public numactl
2377 "https://github.com/numactl/numactl/releases/download/v"
2378 version "/numactl-" version ".tar.gz"))
2381 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2382 (build-system gnu-build-system)
2384 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2385 ;; to run, which we can't assume to have.
2388 ;; NUMA is apparently not supported on armhf, see
2389 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2390 (supported-systems (delete "armhf-linux" %supported-systems))
2391 (home-page "https://github.com/numactl/numactl")
2392 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2394 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2395 memory is not all in one place. The @command{numactl} program allows you to
2396 run your application program on specific CPUs and memory nodes. It does this
2397 by supplying a NUMA memory policy to the operating system before running your
2400 The package contains other commands, such as @command{numastat},
2401 @command{memhog}, and @command{numademo} which provides a quick overview of
2402 NUMA performance on your system.")
2403 (license (list license:gpl2 ;programs
2404 license:lgpl2.1)))) ;library
2406 (define-public kbd-neo
2413 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2414 version "/linux/console/neo.map"))
2415 (file-name (string-append name "-" version ".map"))
2418 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2419 (build-system trivial-build-system)
2421 `(#:modules ((guix build utils))
2423 (use-modules (guix build utils))
2424 (let ((out (string-append %output "/share/keymaps"))
2425 (source (assoc-ref %build-inputs "source")))
2427 (copy-file source (string-append out "/neo.map"))
2429 (home-page "https://neo-layout.org")
2430 (synopsis "Neo2 console layout")
2432 "Kbd-neo provides the Neo2 keyboard layout for use with
2433 @command{loadkeys(1)} from @code{kbd(4)}.")
2434 ;; The file is located in an svn directory, the entire content of
2435 ;; the directory is licensed as GPL3.
2436 (license license:gpl3+)))
2444 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2448 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2449 (modules '((guix build utils)))
2452 (substitute* "tests/Makefile.in"
2453 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2456 (substitute* '("src/unicode_start" "src/unicode_stop")
2457 ;; Assume the Coreutils are in $PATH.
2461 (build-system gnu-build-system)
2464 (modify-phases %standard-phases
2465 (add-before 'build 'pre-build
2466 (lambda* (#:key inputs #:allow-other-keys)
2467 (let ((gzip (assoc-ref %build-inputs "gzip"))
2468 (bzip2 (assoc-ref %build-inputs "bzip2")))
2469 (substitute* "src/libkeymap/findfile.c"
2471 (string-append gzip "/bin/gzip"))
2473 (string-append bzip2 "/bin/bzip2")))
2475 (add-after 'install 'post-install
2476 (lambda* (#:key outputs #:allow-other-keys)
2477 ;; Make sure these programs find their comrades.
2478 (let* ((out (assoc-ref outputs "out"))
2479 (bin (string-append out "/bin")))
2480 (for-each (lambda (prog)
2481 (wrap-program (string-append bin "/" prog)
2482 `("PATH" ":" prefix (,bin))))
2483 '("unicode_start" "unicode_stop"))
2485 (inputs `(("check" ,check)
2488 ("pam" ,linux-pam)))
2489 (native-search-paths
2490 (list (search-path-specification
2491 (variable "LOADKEYS_KEYMAP_PATH")
2492 ;; Append ‘/**’ to recursively search all directories. One can then
2493 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2494 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2495 (files (list "share/keymaps/**")))))
2496 (native-inputs `(("pkg-config" ,pkg-config)))
2497 (home-page "http://kbd-project.org/")
2498 (synopsis "Linux keyboard utilities and keyboard maps")
2500 "This package contains keytable files and keyboard utilities compatible
2501 for systems using the Linux kernel. This includes commands such as
2502 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2503 (license license:gpl2+)))
2505 (define-public loadkeys-static
2508 (name "loadkeys-static")
2510 (substitute-keyword-arguments (package-arguments kbd)
2511 ((#:configure-flags flags ''())
2512 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2513 "--disable-vlock" ;so we don't need libpam
2514 "--disable-libkeymap")
2516 ((#:make-flags flags ''())
2517 `(cons "LDFLAGS=-all-static" ,flags))
2518 ((#:phases phases '%standard-phases)
2519 `(modify-phases ,phases
2521 (lambda* (#:key outputs #:allow-other-keys)
2522 (let ((out (assoc-ref outputs "out")))
2523 ;; The binary keeps references to gzip, among other things,
2524 ;; which we don't need in the initrd, so strip references.
2525 (remove-store-references "src/loadkeys")
2527 (install-file "src/loadkeys"
2528 (string-append out "/bin"))
2530 (delete 'post-install)))
2531 ((#:strip-flags _ '())
2533 ((#:allowed-references _ '())
2536 (synopsis "Statically-linked @command{loadkeys} program")
2538 ;; This package is meant to be used internally in the initrd so don't
2540 (properties '((hidden? . #t)))))
2542 (define-public inotify-tools
2544 (name "inotify-tools")
2549 (url "https://github.com/rvoicilas/inotify-tools.git")
2551 (file-name (git-file-name name version))
2554 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2555 (build-system gnu-build-system)
2557 `(("autoconf" ,autoconf)
2558 ("automake" ,automake)
2559 ("libtool" ,libtool)))
2560 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2561 (synopsis "Monitor file accesses")
2563 "The inotify-tools packages provides a C library and command-line tools
2564 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2565 (license license:gpl2+)))
2574 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2575 "kmod-" version ".tar.xz"))
2578 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2579 (patches (search-patches "kmod-module-directory.patch"))))
2580 (build-system gnu-build-system)
2582 `(("pkg-config" ,pkg-config)))
2587 `(#:tests? #f ; FIXME: Investigate test failures
2588 #:configure-flags '("--with-xz" "--with-zlib")
2590 (modify-phases %standard-phases
2591 (add-after 'install 'install-modprobe&co
2592 (lambda* (#:key outputs #:allow-other-keys)
2593 (let* ((out (assoc-ref outputs "out"))
2594 (bin (string-append out "/bin")))
2595 (for-each (lambda (tool)
2597 (string-append bin "/" tool)))
2598 '("insmod" "rmmod" "lsmod" "modprobe"
2599 "modinfo" "depmod"))
2601 (home-page "https://www.kernel.org/")
2602 (synopsis "Kernel module tools")
2603 (description "Kmod is a set of tools to handle common tasks with Linux
2604 kernel modules like insert, remove, list, check properties, resolve
2605 dependencies and aliases.
2607 These tools are designed on top of libkmod, a library that is shipped with
2608 kmod. The aim is to be compatible with tools, configurations and indices
2609 from the module-init-tools project.")
2610 (license license:gpl2+))) ; library under lgpl2.1+
2612 (define-public eudev
2613 ;; The post-systemd fork, maintained by Gentoo.
2619 (uri (git-reference (url "https://github.com/gentoo/eudev")
2620 (commit (string-append "v" version))))
2621 (file-name (git-file-name name version))
2624 "1g95yzzx4qxm5qhhylbi930lrq4gsbz207n72018nkvswj6gmpjw"))
2625 (patches (search-patches "eudev-rules-directory.patch"))))
2626 (build-system gnu-build-system)
2629 (modify-phases %standard-phases
2630 (add-after 'unpack 'make-source-writable
2632 ;; XXX: Git checkouts are read-only, but this package needs to
2633 ;; modify some of its files.
2634 (for-each make-file-writable (find-files "."))
2636 (add-before 'bootstrap 'patch-file-names
2637 (lambda* (#:key inputs #:allow-other-keys)
2638 (substitute* "man/make.sh"
2639 (("/usr/bin/xsltproc")
2640 (string-append (assoc-ref inputs "xsltproc")
2643 (add-after 'install 'build-hwdb
2644 (lambda* (#:key outputs #:allow-other-keys)
2645 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2646 ;; similar tools to display product names.
2647 (let ((out (assoc-ref outputs "out")))
2648 (invoke (string-append out "/bin/udevadm")
2649 "hwdb" "--update")))))
2650 #:configure-flags (list "--enable-manpages")))
2652 `(("autoconf" ,autoconf)
2653 ("automake" ,automake)
2655 ("libtool" ,libtool)
2656 ("pkg-config" ,pkg-config)
2659 ("python" ,python-wrapper)
2660 ;; For documentation.
2661 ("docbook-xml" ,docbook-xml-4.2)
2662 ("docbook-xsl" ,docbook-xsl)
2663 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2664 ("xsltproc" ,libxslt)))
2666 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2667 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2668 ;; which contains the rules to do that.
2669 `(("util-linux" ,util-linux) ;for blkid
2671 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2672 (synopsis "Userspace device management")
2673 (description "Udev is a daemon which dynamically creates and removes
2674 device nodes from /dev/, handles hotplug events and loads drivers at boot
2676 (license license:gpl2+)))
2678 (define-public eudev-with-hwdb
2679 (deprecated-package "eudev-with-hwdb" eudev))
2684 (version "2.02.177")
2687 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2691 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2692 (modules '((guix build utils)))
2695 (use-modules (guix build utils))
2697 ;; Honor sysconfdir.
2698 (substitute* "make.tmpl.in"
2700 "confdir = @sysconfdir@\n")
2701 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2702 "DEFAULT_SYS_DIR = @sysconfdir@"))
2704 (patches (search-patches "lvm2-static-link.patch"))))
2705 (build-system gnu-build-system)
2707 `(("pkg-config" ,pkg-config)
2708 ("procps" ,procps))) ;tests use 'pgrep'
2713 (modify-phases %standard-phases
2714 (add-after 'configure 'set-makefile-shell
2716 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2718 (setenv "SHELL" (which "sh"))
2720 ;; Replace /bin/sh with the right file name.
2721 (patch-makefile-SHELL "make.tmpl")
2724 #:configure-flags (list (string-append "--sysconfdir="
2725 (assoc-ref %outputs "out")
2727 "--enable-udev_sync"
2728 "--enable-udev_rules"
2729 "--enable-pkgconfig"
2731 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
2733 ;; Make sure programs such as 'dmsetup' can
2734 ;; find libdevmapper.so.
2735 (string-append "LDFLAGS=-Wl,-rpath="
2736 (assoc-ref %outputs "out")
2738 (assoc-ref %outputs "out")
2739 "/lib/device-mapper")
2740 ;; TODO: Patch make.tmpl.in to take LDFLAGS
2741 ;; into account so that we don't need to also
2743 (string-append "CLDFLAGS=-Wl,-rpath="
2744 (assoc-ref %outputs "out")
2746 (assoc-ref %outputs "out")
2747 "/lib/device-mapper"))
2749 ;; The tests use 'mknod', which requires root access.
2751 (home-page "https://sourceware.org/lvm2/")
2752 (synopsis "Logical volume management for Linux")
2754 "LVM2 is the logical volume management tool set for Linux-based systems.
2755 This package includes the user-space libraries and tools, including the device
2756 mapper. Kernel components are part of Linux-libre.")
2758 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2759 ;; Command-line tools are GPLv2.
2760 (license (list license:gpl2 license:lgpl2.1))))
2762 (define-public lvm2-static
2765 (name "lvm2-static")
2767 ;; Propagate udev because libdevmapper.a depends on libudev.
2768 (inputs (alist-delete "udev" (package-inputs lvm2)))
2769 (propagated-inputs `(("udev" ,eudev)))
2772 (substitute-keyword-arguments (package-arguments lvm2)
2773 ((#:configure-flags flags '())
2774 ;; LVM2 doesn't use Libtool, hence the custom option.
2775 `(cons "--enable-static_link" ,flags))))
2776 (synopsis "Logical volume management for Linux (statically linked)")))
2778 (define-public wireless-tools
2780 (name "wireless-tools")
2784 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2788 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2791 ;; Remove the older header files that are not free software.
2792 (for-each (lambda (n)
2793 (delete-file (format #f "wireless.~a.h" n)))
2794 '(10 11 12 13 14 15 16 17 18 19 20))
2796 (build-system gnu-build-system)
2799 (list (string-append "PREFIX=" %output)
2800 (string-append "INSTALL_MAN=" %output "/share/man")
2801 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2803 #:phases (modify-phases %standard-phases
2804 (delete 'configure))
2806 (synopsis "Tools for manipulating Linux Wireless Extensions")
2807 (description "Wireless Tools are used to manipulate the now-deprecated
2808 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
2809 Extension was an interface allowing you to set Wireless LAN specific
2810 parameters and get the specific stats. It is deprecated in favor the nl80211
2812 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2813 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2814 ;; other files are distributed under gpl2.
2815 (license (list license:gpl2 license:lgpl2.1+))))
2823 (uri (string-append "mirror://kernel.org/software/network/crda/"
2824 "crda-" version ".tar.xz"))
2827 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2828 (patches (search-patches "crda-optional-gcrypt.patch"))))
2829 (build-system gnu-build-system)
2831 '(#:phases (modify-phases %standard-phases
2833 (add-after 'unpack 'gzip-determinism
2835 (substitute* "Makefile"
2836 (("gzip") "gzip --no-name"))
2839 'build 'no-werror-no-ldconfig
2841 (substitute* "Makefile"
2843 (("ldconfig") "true"))
2846 'build 'set-regulator-db-file-name
2847 (lambda* (#:key inputs #:allow-other-keys)
2848 ;; Tell CRDA where to find our database.
2849 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2850 (substitute* "crda.c"
2851 (("\"/lib/crda/regulatory.bin\"")
2852 (string-append "\"" regdb
2853 "/lib/crda/regulatory.bin\"")))
2855 #:test-target "verify"
2856 #:make-flags (let ((out (assoc-ref %outputs "out"))
2857 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2858 (list "CC=gcc" "V=1"
2860 ;; Disable signature-checking on 'regulatory.bin'.
2861 ;; The reason is that this simplifies maintenance
2862 ;; on our side (no need to manage a distro key
2863 ;; pair), and we can guarantee integrity of
2864 ;; 'regulatory.bin' by other means anyway, such as
2865 ;; 'guix gc --verify'. See
2866 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2870 (string-append "PREFIX=" out)
2871 (string-append "SBINDIR=" out "/sbin/")
2872 (string-append "UDEV_RULE_DIR="
2873 out "/lib/udev/rules.d")
2874 (string-append "LDFLAGS=-Wl,-rpath="
2876 (string-append "REG_BIN=" regdb
2877 "/lib/crda/regulatory.bin")))))
2878 (native-inputs `(("pkg-config" ,pkg-config)
2879 ("python" ,python-2)
2880 ("wireless-regdb" ,wireless-regdb)))
2881 (inputs `(("libnl" ,libnl)))
2883 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2884 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2886 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2887 communication between the kernel Linux and user space for regulatory
2889 (license license:copyleft-next)))
2891 (define-public wireless-regdb
2893 (name "wireless-regdb")
2894 (version "2019.06.03")
2898 "mirror://kernel.org/software/network/wireless-regdb/"
2899 "wireless-regdb-" version ".tar.xz"))
2902 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
2904 ;; We're building 'regulatory.bin' by ourselves.
2906 (delete-file "regulatory.bin")
2908 (build-system gnu-build-system)
2911 (modify-phases %standard-phases
2912 (add-after 'unpack 'gzip-determinism
2914 (substitute* "Makefile"
2915 (("gzip") "gzip --no-name"))
2917 (add-after 'unpack 'omit-signature
2919 (substitute* "Makefile"
2920 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
2921 ;; don't provide (see below). Disable it.
2922 ((" regulatory\\.db\\.p7s") "")
2923 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
2924 ;; but ‘make install’ depends only on the latter while installing
2925 ;; both (and failing). Depend on it explicitly.
2926 (("^install: " all) (string-append all "regulatory.db ")))
2928 (delete 'configure)) ; no configure script
2930 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2931 ;; is computed and can be equal to 'maintainer-clean'; when that
2932 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2933 ;; just built. Thus, build things sequentially.
2934 #:parallel-build? #f
2936 #:tests? #f ; no tests
2938 (let ((out (assoc-ref %outputs "out")))
2939 (list (string-append "PREFIX=" out)
2940 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
2942 ;; Leave this empty so that db2bin.py doesn't try to sign
2943 ;; ‘regulatory.bin’. This allows us to avoid managing a key
2944 ;; pair for the whole distribution.
2945 (string-append "REGDB_PRIVKEY=")
2946 ;; Don't generate a public key for the same reason. These are
2947 ;; used as Makefile targets and can't be the empty string.
2948 (string-append "REGDB_PUBCERT=/dev/null")
2949 (string-append "REGDB_PUBKEY=/dev/null")))))
2951 `(("python" ,python-wrapper)))
2953 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2954 (synopsis "Wireless regulatory database")
2956 "This package contains the wireless regulatory database Central
2957 Regulatory Database Agent (CRDA) daemon. The database contains information on
2958 country-specific regulations for the wireless spectrum.")
2959 (license license:isc)))
2961 (define-public lm-sensors
2969 (url "https://github.com/groeck/lm-sensors.git")
2970 (commit (string-append "V" (string-join
2971 (string-split version #\.) "-")))))
2972 (file-name (git-file-name name version))
2974 (base32 "1mdrnb9r01z1xfdm6dpkywvf9yy9a4yzb59paih9sijwmigv19fj"))
2975 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2976 (build-system gnu-build-system)
2977 (inputs `(("rrdtool" ,rrdtool)
2980 ("gnuplot" ,gnuplot)))
2981 (native-inputs `(("pkg-config" ,pkg-config)
2985 (outputs '("lib" ;avoid perl in closure
2988 `(#:tests? #f ; no 'check' target
2989 #:make-flags (list (string-append "PREFIX=" %output)
2990 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
2991 (string-append "INCLUDEDIR="
2992 (assoc-ref %outputs "lib") "/include")
2993 (string-append "MANDIR=" %output "/share/man")
2994 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
2996 (modify-phases %standard-phases
2998 (add-before 'build 'patch-exec-paths
2999 (lambda* (#:key inputs outputs #:allow-other-keys)
3000 (substitute* "prog/detect/sensors-detect"
3002 (string-append "`" (assoc-ref inputs "coreutils")
3004 (("(`|\")modprobe" all open-quote)
3005 (string-append open-quote
3006 (assoc-ref inputs "kmod")
3008 (substitute* '("prog/pwm/pwmconfig"
3009 "prog/pwm/fancontrol")
3011 (string-append (assoc-ref inputs "gnuplot")
3014 (string-append (assoc-ref inputs "coreutils")
3017 (string-append (assoc-ref inputs "grep")
3020 (string-append (assoc-ref inputs "sed")
3023 (string-append (assoc-ref inputs "coreutils")
3026 (string-append (assoc-ref inputs "coreutils")
3029 (string-append (assoc-ref inputs "coreutils")
3030 "/bin/readlink -f")))
3032 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3033 (synopsis "Utilities to read temperature/voltage/fan sensors")
3035 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3036 you to access information from temperature, voltage, and fan speed sensors.
3037 It works with most newer systems.")
3038 (license license:gpl2+)))
3040 (define-public iucode-tool
3042 (name "iucode-tool")
3046 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3047 "/raw/latest/iucode-tool_" version ".tar.xz"))
3050 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3051 (build-system gnu-build-system)
3052 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3053 (synopsis "Manipulate Intel microcode bundles")
3055 "@command{iucode_tool} is a utility to work with microcode packages for
3056 Intel processors. It can convert between formats, extract specific versions,
3057 create a firmware image suitable for the Linux kernel, and more.")
3058 ;; cpuid.h is available for i686, x86_64, and ia64.
3059 (supported-systems '("i686-linux" "x86_64-linux"))
3060 (license license:gpl2+)))
3062 (define-public i2c-tools
3069 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3070 version ".tar.bz2"))
3073 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3074 (build-system gnu-build-system)
3076 `(#:tests? #f ; no 'check' target
3077 #:make-flags (list (string-append "prefix=" %output)
3079 ;; no configure script
3080 #:phases (modify-phases %standard-phases (delete 'configure))))
3083 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3084 (synopsis "I2C tools for Linux")
3086 "The i2c-tools package contains a heterogeneous set of I2C tools for
3087 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3088 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3090 (license license:gpl2+)))
3092 (define-public xsensors
3099 "http://www.linuxhardware.org/xsensors/xsensors-"
3103 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3104 (build-system gnu-build-system)
3105 (inputs `(("lm-sensors" ,lm-sensors "lib")
3107 (native-inputs `(("pkg-config" ,pkg-config)))
3110 (modify-phases %standard-phases
3111 (add-before 'configure 'enable-deprecated
3113 (substitute* "src/Makefile.in"
3114 (("-DGDK_DISABLE_DEPRECATED") "")
3115 (("-DGTK_DISABLE_DEPRECATED") ""))
3117 (add-before 'configure 'remove-Werror
3119 (substitute* '("configure" "src/Makefile.in")
3122 (home-page "http://www.linuxhardware.org/xsensors/")
3123 (synopsis "Hardware health information viewer")
3125 "Xsensors reads data from the libsensors library regarding hardware
3126 health such as temperature, voltage and fan speed and displays the information
3127 in a digital read-out.")
3128 (license license:gpl2+)))
3133 (version (package-version linux-libre))
3134 (source (package-source linux-libre))
3135 (build-system gnu-build-system)
3138 (modify-phases %standard-phases
3140 (lambda* (#:key inputs #:allow-other-keys)
3141 (setenv "SHELL_PATH" (which "bash"))
3142 (chdir "tools/perf")
3144 #:make-flags (list (string-append "prefix="
3145 (assoc-ref %outputs "out"))
3146 ;; Make sure the kernel headers are treated as system
3147 ;; headers to suppress warnings from those.
3148 (string-append "C_INCLUDE_PATH="
3149 (assoc-ref %build-inputs "kernel-headers")
3153 ;; By default, 'config/Makefile' uses lib64 on
3154 ;; x86_64. Work around that.
3156 #:tests? #f)) ;no tests
3158 `(("pkg-config" ,pkg-config)
3162 ;; There are build scripts written in these languages.
3164 ("python" ,python-2)))
3166 `(("slang" ,slang) ;for the interactive TUI
3168 ("python" ,python-2) ;'perf' links against libpython
3169 ("elfutils" ,elfutils)
3170 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3171 ("libunwind" ,libunwind) ;better stack walking
3172 ("numactl" ,numactl) ;for 'perf bench numa mem'
3175 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3176 ("docbook-xsl" ,docbook-xsl)
3178 ("asciidoc" ,asciidoc)))
3179 (home-page "https://perf.wiki.kernel.org/")
3180 (synopsis "Linux profiling with performance counters")
3182 "perf is a tool suite for profiling using hardware performance counters,
3183 with support in the Linux kernel. perf can instrument CPU performance
3184 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3185 of lightweight profiling. This package contains the user-land tools and in
3186 particular the @code{perf} command.")
3187 (license (package-license linux-libre))))
3189 (define-public pflask
3195 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3197 (file-name (string-append name "-" version ".tar.gz"))
3200 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3201 (build-system cmake-build-system)
3203 '(#:tests? #f)) ; no tests
3204 (home-page "https://ghedo.github.io/pflask/")
3205 (synopsis "Simple tool for creating Linux namespace containers")
3206 (description "pflask is a simple tool for creating Linux namespace
3207 containers. It can be used for running a command or even booting an OS inside
3208 an isolated container, created with the help of Linux namespaces. It is
3209 similar in functionality to chroot, although pflask provides better isolation
3210 thanks to the use of namespaces.")
3211 (license license:bsd-2)))
3213 (define-public singularity
3215 (name "singularity")
3219 (uri (string-append "https://github.com/singularityware/singularity/"
3220 "releases/download/" version
3221 "/singularity-" version ".tar.gz"))
3224 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3225 (modules '((guix build utils)))
3228 ;; Do not create directories in /var.
3229 (substitute* "Makefile.in"
3230 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3232 ;; The original source overrides PATH so that it points to
3233 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3234 ;; on Guix System. Leave PATH unchanged so we refer to the
3235 ;; installed Coreutils, grep, etc.
3236 (substitute* "bin/singularity.in"
3238 (string-append "#" all "\n")))
3240 (substitute* (find-files "libexec/cli" "\\.exec$")
3241 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3243 (string-append "/run/setuid-programs/singularity-"
3244 program "-helper")))
3246 (build-system gnu-build-system)
3248 `(#:configure-flags '("--localstatedir=/var")
3250 (modify-phases %standard-phases
3251 (add-after 'unpack 'patch-reference-to-squashfs-tools
3253 (substitute* "libexec/cli/build.exec"
3254 (("if ! singularity_which mksquashfs") "if 0")
3255 (("if ! mksquashfs")
3256 (string-append "if ! " (which "mksquashfs"))))
3259 `(("libarchive" ,libarchive)
3260 ("python" ,python-wrapper)
3262 ("squashfs-tools" ,squashfs-tools)))
3263 (home-page "https://singularity.lbl.gov/")
3264 (synopsis "Container platform")
3265 (description "Singularity is a container platform supporting a number of
3266 container image formats. It can build SquashFS container images or import
3267 existing Docker images. Singularity requires kernel support for container
3268 isolation or root privileges.")
3269 (license license:bsd-3)))
3271 (define-public hdparm
3277 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3278 "hdparm-" version ".tar.gz"))
3281 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3282 (build-system gnu-build-system)
3284 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3285 (list (string-append "binprefix=" out)
3286 (string-append "manprefix=" out)
3289 (modify-phases %standard-phases
3290 (delete 'configure)) ; no configure script
3291 #:tests? #f)) ; no test suite
3292 (home-page "https://sourceforge.net/projects/hdparm/")
3293 (synopsis "View and tune ATA disk drive parameters")
3295 "@command{hdparm} is a command-line utility to control ATA controllers and
3296 disk drives. It can increase performance and/or reliability by careful tuning
3297 of hardware settings like power and acoustic management, DMA modes, and caching.
3298 It can also display detailed device information, or be used as a simple
3299 performance benchmarking tool.
3301 @command{hdparm} provides a command line interface to various Linux kernel
3302 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3303 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3304 Translation (@dfn{SAT}) are also supported.")
3305 (license (license:non-copyleft "file://LICENSE.TXT"))))
3307 (define-public rfkill
3313 (uri (string-append "mirror://kernel.org/software/network/"
3314 name "/" name "-" version ".tar.xz"))
3317 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3318 (build-system gnu-build-system)
3320 `(#:make-flags (list "CC=gcc"
3321 (string-append "PREFIX=" %output))
3322 #:phases (modify-phases %standard-phases
3323 (delete 'configure))
3325 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3326 (synopsis "Tool for enabling and disabling wireless devices")
3328 "rfkill is a simple tool for accessing the rfkill device interface,
3329 which is used to enable and disable wireless networking devices, typically
3330 WLAN, Bluetooth and mobile broadband.")
3331 (license (license:non-copyleft "file://COPYING"
3332 "See COPYING in the distribution."))
3333 ;; rfkill is part of util-linux as of 2.31.
3334 (properties `((superseded . ,util-linux)))))
3342 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3343 version "/" name "-" version ".tar.gz"))
3346 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3347 (build-system gnu-build-system)
3348 (home-page "http://acpiclient.sourceforge.net")
3349 (synopsis "Display information on ACPI devices")
3350 (description "@code{acpi} attempts to replicate the functionality of the
3351 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3352 information. It does not support ACPI suspending, only displays information
3353 about ACPI devices.")
3354 (license license:gpl2+)))
3356 (define-public acpid
3362 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3366 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
3367 (build-system gnu-build-system)
3368 (home-page "https://sourceforge.net/projects/acpid2/")
3369 (synopsis "Daemon for delivering ACPI events to user-space programs")
3371 "acpid is designed to notify user-space programs of Advanced
3372 Configuration and Power Interface (ACPI) events. acpid should be started
3373 during the system boot, and will run as a background process. When an ACPI
3374 event is received from the kernel, acpid will examine the list of rules
3375 specified in /etc/acpi/events and execute the rules that match the event.")
3376 (license license:gpl2+)))
3378 (define-public sysfsutils
3387 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3390 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3391 (build-system gnu-build-system)
3392 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3393 (synopsis "System utilities based on Linux sysfs")
3395 "These are a set of utilities built upon sysfs, a virtual file system in
3396 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3397 also contains the libsysfs library.")
3398 ;; The library is under lgpl2.1+ (all files say "or any later version").
3399 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3400 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3402 (define-public sysfsutils-1
3404 (inherit sysfsutils)
3411 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3412 "/sysfsutils-" version ".tar.gz"))
3414 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3415 (modules '((guix build utils)))
3418 (substitute* "Makefile.in"
3419 (("includedir = /usr/include/sysfs")
3420 "includedir = @includedir@"))
3421 (substitute* "configure"
3422 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3423 (string-append "includedir='" orig "/sysfs'")))
3425 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3427 (define-public cpufrequtils
3429 (name "cpufrequtils")
3434 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3435 "cpufrequtils-" version ".tar.gz"))
3437 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3438 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3439 (build-system gnu-build-system)
3441 `(("sysfsutils" ,sysfsutils-1)))
3443 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3444 (assoc-ref %outputs "out") "/lib"))))
3445 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3446 (synopsis "Utilities to get and set CPU frequency on Linux")
3448 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3449 information, and set the CPU frequency if supported, using the cpufreq
3450 capabilities of the Linux kernel.")
3451 (license license:gpl2)))
3453 (define-public libraw1394
3460 "mirror://kernel.org/linux/libs/ieee1394/"
3461 name "-" version ".tar.xz"))
3464 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3465 (build-system gnu-build-system)
3466 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3467 (synopsis "Interface library for the Linux IEEE1394 drivers")
3469 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3470 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3471 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3472 send to and receive from other nodes without requiring a kernel driver for the
3473 protocol in question.")
3474 (license license:lgpl2.1+)))
3476 (define-public libavc1394
3482 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3483 name "-" version ".tar.gz"))
3486 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3487 (build-system gnu-build-system)
3489 `(("pkg-config" ,pkg-config)))
3491 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3492 (home-page "https://sourceforge.net/projects/libavc1394/")
3493 (synopsis "AV/C protocol library for IEEE 1394")
3495 "Libavc1394 is a programming interface to the AV/C specification from
3496 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3497 (license license:lgpl2.1+)))
3499 (define-public libiec61883
3501 (name "libiec61883")
3506 "mirror://kernel.org/linux/libs/ieee1394/"
3507 name "-" version ".tar.xz"))
3510 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3511 (build-system gnu-build-system)
3513 `(("pkg-config" ,pkg-config)))
3515 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3516 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3517 (synopsis "Isochronous streaming media library for IEEE 1394")
3519 "The libiec61883 library provides a higher level API for streaming DV,
3520 MPEG-2 and audio over Linux IEEE 1394.")
3521 (license license:lgpl2.1+)))
3523 (define-public mdadm
3530 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3534 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3535 (build-system gnu-build-system)
3539 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3543 ;; TODO: tell it where to find 'sendmail'
3544 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3545 (string-append "BINDIR=" out "/sbin")
3546 (string-append "MANDIR=" out "/share/man")
3547 (string-append "UDEVDIR=" out "/lib/udev")))
3549 (modify-phases %standard-phases
3550 (add-before 'build 'patch-program-paths
3551 (lambda* (#:key inputs #:allow-other-keys)
3552 (let ((coreutils (assoc-ref inputs "coreutils")))
3553 (substitute* "udev-md-raid-arrays.rules"
3554 (("/usr/bin/(readlink|basename)" all program)
3555 (string-append coreutils "/bin/" program))))
3557 (add-before 'build 'remove-W-error
3559 ;; We cannot build with -Werror on i686 due to a
3560 ;; 'sign-compare' warning in util.c.
3561 (substitute* "Makefile"
3564 (delete 'configure))
3565 ;;tests must be done as root
3567 (home-page "http://neil.brown.name/blog/mdadm")
3568 (synopsis "Tool for managing Linux Software RAID arrays")
3570 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3571 assemble, report on, and monitor arrays. It can also move spares between raid
3572 arrays when needed.")
3573 (license license:gpl2+)))
3575 (define-public mdadm-static
3578 (name "mdadm-static")
3580 (substitute-keyword-arguments (package-arguments mdadm)
3581 ((#:make-flags flags)
3582 `(cons "LDFLAGS = -static" ,flags))
3584 `(modify-phases ,phases
3585 (add-after 'install 'remove-cruft
3586 (lambda* (#:key outputs #:allow-other-keys)
3587 (let* ((out (assoc-ref outputs "out"))
3588 (precious? (lambda (file)
3589 (member file '("." ".." "sbin"))))
3590 (directories (scandir out (negate precious?))))
3591 (with-directory-excursion out
3592 (for-each delete-file-recursively directories)
3593 (remove-store-references "sbin/mdadm")
3594 (delete-file "sbin/mdmon")
3596 ((#:modules modules %gnu-build-system-modules)
3597 `((ice-9 ftw) ,@modules))
3598 ((#:strip-flags _ '())
3599 ''("--strip-all")) ;strip a few extra KiB
3600 ((#:allowed-references _ '("out"))
3601 '("out")))) ;refer only self
3602 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3604 (define-public multipath-tools
3606 (name "multipath-tools")
3610 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3611 ".git;a=snapshot;h=" version ";sf=tgz"))
3612 (file-name (string-append name "-" version ".tar.gz"))
3615 "0kb4mhzwyygdbikikmby6hj39pb3nrzv05v526c75wnycwnpxg31"))
3616 (modules '((guix build utils)))
3619 ;; Drop bundled valgrind headers.
3620 (delete-file-recursively "third-party")
3621 (substitute* '("multipathd/main.c"
3622 "libmultipath/debug.c")
3623 (("#include \"../third-party/")
3626 (build-system gnu-build-system)
3628 '(#:tests? #f ; no tests
3629 #:make-flags (list "CC=gcc"
3630 (string-append "DESTDIR="
3631 (assoc-ref %outputs "out"))
3633 ;; Add the libaio headers to GCCs system header
3634 ;; search path to suppress -Werror=cast-qual on
3635 ;; the included headers.
3636 (string-append "C_INCLUDE_PATH="
3637 (assoc-ref %build-inputs "libaio")
3639 (string-append "LDFLAGS=-Wl,-rpath="
3640 (assoc-ref %outputs "out")
3643 (modify-phases %standard-phases
3644 (add-after 'unpack 'patch-source
3645 (lambda* (#:key inputs #:allow-other-keys)
3646 (let ((lvm2 (assoc-ref inputs "lvm2"))
3647 (udev (assoc-ref inputs "udev")))
3648 (substitute* "Makefile.inc"
3649 (("\\$\\(prefix\\)/usr") "$(prefix)")
3650 ;; Do not save timestamp to avoid gzip "timestamp
3651 ;; out-of-range" warnings.
3652 (("gzip -9") "gzip -9n"))
3653 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3654 (("/usr/include/libdevmapper.h")
3655 (string-append lvm2 "/include/libdevmapper.h"))
3656 (("/usr/include/libudev.h")
3657 (string-append udev "/include/libudev.h")))
3659 (delete 'configure)))) ; no configure script
3662 ("pkg-config" ,pkg-config)
3663 ("valgrind" ,valgrind)))
3665 `(("json-c" ,json-c)
3667 ("liburcu" ,liburcu)
3669 ("readline" ,readline)
3671 (home-page "http://christophe.varoqui.free.fr/")
3672 (synopsis "Access block devices through multiple paths")
3674 "This package provides the following binaries to drive the
3675 Linux Device Mapper multipathing driver:
3677 @item @command{multipath} - Device mapper target autoconfig.
3678 @item @command{multipathd} - Multipath daemon.
3679 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3680 @code{dm} multipath devices.
3681 @item @command{kpartx} - Create device maps from partition tables.
3683 (license (list license:gpl2+ ; main distribution
3684 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3686 (define-public libaio
3693 (string-append "https://releases.pagure.org/libaio/"
3694 name "-" version ".tar.gz")))
3697 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
3698 (build-system gnu-build-system)
3701 (list "CC=gcc" (string-append "prefix=" %output))
3702 #:test-target "partcheck" ; need root for a full 'check'
3704 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
3705 (home-page "https://pagure.io/libaio")
3706 (synopsis "Linux-native asynchronous I/O access library")
3708 "This library enables userspace to use Linux kernel asynchronous I/O
3709 system calls, important for the performance of databases and other advanced
3711 (license license:lgpl2.1+)))
3719 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
3723 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
3724 (build-system gnu-build-system)
3726 `(("libsndfile" ,libsndfile)))
3728 `(("pkg-config" ,pkg-config)))
3729 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3730 (synopsis "Bluetooth subband audio codec")
3732 "The SBC is a digital audio encoder and decoder used to transfer data to
3733 Bluetooth audio output devices like headphones or loudspeakers.")
3734 (license license:gpl2+)))
3736 (define-public bluez
3743 "mirror://kernel.org/linux/bluetooth/bluez-"
3747 "048r91vx9gs5nwwbah2s0xig04nwk14c5s0vb7qmaqdvighsmz2z"))))
3748 (build-system gnu-build-system)
3751 (let ((out (assoc-ref %outputs "out")))
3752 (list "--sysconfdir=/etc"
3753 "--localstatedir=/var"
3756 ;; Install dbus/udev files to the correct location.
3757 (string-append "--with-dbusconfdir=" out "/etc")
3758 (string-append "--with-udevdir=" out "/lib/udev")))
3760 (modify-phases %standard-phases
3761 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3762 ;; issue (discussion on upstream mailing list:
3763 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3764 (add-before 'check 'skip-wonky-test
3766 (substitute* "unit/test-gatt.c"
3767 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3769 (add-after 'install 'post-install
3770 (lambda* (#:key inputs outputs #:allow-other-keys)
3771 (let* ((out (assoc-ref outputs "out"))
3772 (servicedir (string-append out "/share/dbus-1/services"))
3773 (service "obexd/src/org.bluez.obex.service")
3774 (rule (string-append
3775 out "/lib/udev/rules.d/97-hid2hci.rules")))
3776 ;; Install the obex dbus service file.
3777 (substitute* service
3779 (string-append out "/libexec/bluetooth/obexd")))
3780 (install-file service servicedir)
3781 ;; Fix paths in the udev rule.
3783 (("hid2hci --method")
3784 (string-append out "/lib/udev/hid2hci --method"))
3786 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3789 `(("pkg-config" ,pkg-config)
3790 ("gettext" ,gettext-minimal)))
3795 ("libical" ,libical)
3796 ("readline" ,readline)))
3797 (home-page "http://www.bluez.org/")
3798 (synopsis "Linux Bluetooth protocol stack")
3800 "BlueZ provides support for the core Bluetooth layers and protocols. It
3801 is flexible, efficient and uses a modular implementation.")
3802 (license license:gpl2+)))
3804 (define-public fuse-exfat
3811 "https://github.com/relan/exfat/releases/download/v"
3812 version "/" name "-" version ".tar.gz"))
3815 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3816 (build-system gnu-build-system)
3818 `(("pkg-config" ,pkg-config)))
3821 (home-page "https://github.com/relan/exfat")
3822 (synopsis "Mount exFAT file systems")
3824 "This package provides a FUSE-based file system that provides read and
3825 write access to exFAT devices.")
3826 (license license:gpl2+)))
3828 (define-public fuseiso
3831 (version "20070708")
3834 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
3835 version "/fuseiso-" version ".tar.bz2"))
3838 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
3839 (build-system gnu-build-system)
3841 `(("pkg-config" ,pkg-config)))
3846 (home-page "https://sourceforge.net/projects/fuseiso/")
3847 (synopsis "Mount ISO file system images")
3849 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
3850 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
3851 Ridge, Joliet, and zisofs.")
3852 (license license:gpl2)))
3861 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3862 version ".tar.bz2"))
3863 (patches (search-patches "gpm-glibc-2.26.patch"))
3866 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3867 (build-system gnu-build-system)
3869 '(#:phases (modify-phases %standard-phases
3872 ;; The tarball was not generated with 'make dist' so we
3873 ;; need to bootstrap things ourselves.
3874 (substitute* "autogen.sh"
3875 (("/bin/sh") (which "sh")))
3876 (invoke "./autogen.sh")
3877 (patch-makefile-SHELL "Makefile.include.in")
3880 ;; Make sure programs find libgpm.so.
3881 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3882 (assoc-ref %outputs "out")
3885 `(("texinfo" ,texinfo)
3888 ("autoconf" ,autoconf)
3889 ("automake" ,automake)
3890 ("libtool" ,libtool)))
3891 (home-page "http://www.nico.schottelius.org/software/gpm/")
3892 (synopsis "Mouse support for the Linux console")
3894 "The GPM (general-purpose mouse) daemon is a mouse server for
3895 applications running on the Linux console. It allows users to select items
3896 and copy/paste text in the console and in xterm.")
3897 (license license:gpl2+)))
3899 (define-public btrfs-progs
3901 (name "btrfs-progs")
3905 (uri (string-append "mirror://kernel.org/linux/kernel/"
3906 "people/kdave/btrfs-progs/"
3907 "btrfs-progs-v" version ".tar.xz"))
3910 "1imivxjppi8zl27gn472pwpk8bg5dijkbyi340by31vhy7dj24w2"))))
3911 (build-system gnu-build-system)
3913 "static")) ; static versions of the binaries in "out"
3915 '(#:phases (modify-phases %standard-phases
3916 (add-after 'build 'build-static
3917 (lambda _ (invoke "make" "static")))
3918 (add-after 'install 'install-bash-completion
3919 (lambda* (#:key outputs #:allow-other-keys)
3920 (let* ((out (assoc-ref outputs "out"))
3921 (bashcomp (string-append out "/etc/bash_completion.d")))
3923 (copy-file "btrfs-completion"
3924 (string-append bashcomp "/btrfs"))
3926 (add-after 'install 'install-static
3927 (let ((staticbin (string-append (assoc-ref %outputs "static")
3931 (string-append "bindir=" staticbin)
3932 "install-static")))))
3933 #:tests? #f ; XXX: require the 'btrfs' kernel module.
3934 #:test-target "test"
3935 #:parallel-tests? #f)) ; tests fail when run in parallel
3936 (inputs `(("e2fsprogs" ,e2fsprogs)
3937 ("libblkid" ,util-linux)
3938 ("libblkid:static" ,util-linux "static")
3939 ("libuuid" ,util-linux)
3940 ("libuuid:static" ,util-linux "static")
3943 ("zlib:static" ,zlib "static")
3944 ("zstd" ,zstd "lib")
3945 ("zstd:static" ,zstd "static")))
3946 (native-inputs `(("pkg-config" ,pkg-config)
3947 ("asciidoc" ,asciidoc)
3950 ;; For building documentation.
3951 ("libxml2" ,libxml2)
3952 ("docbook-xsl" ,docbook-xsl)
3956 ;; The tests need 'grep' with perl regexp support.
3958 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
3959 (synopsis "Create and manage btrfs copy-on-write file systems")
3960 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3961 aimed at implementing advanced features while focusing on fault tolerance,
3962 repair and easy administration.")
3963 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3964 ;; GPL2: Everything else.
3965 (license (list license:gpl2 license:gpl2+))))
3967 (define-public btrfs-progs/static
3969 (name "btrfs-progs-static")
3970 (version (package-version btrfs-progs))
3972 (build-system trivial-build-system)
3974 `(("btrfs-progs:static" ,btrfs-progs "static")))
3976 `(#:modules ((guix build utils))
3979 (use-modules (guix build utils)
3983 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3984 (out (assoc-ref %outputs "out"))
3985 (source (string-append btrfs "/bin/btrfs.static"))
3986 (target (string-append out "/bin/btrfs")))
3987 (mkdir-p (dirname target))
3988 (copy-file source target)
3989 (remove-store-references target)
3990 (chmod target #o555)
3992 (home-page (package-home-page btrfs-progs))
3993 (synopsis "Statically-linked btrfs command from btrfs-progs")
3994 (description "This package provides the statically-linked @command{btrfs}
3995 from the btrfs-progs package. It is meant to be used in initrds.")
3996 (license (package-license btrfs-progs))))
3998 (define-public compsize
4002 (home-page "https://github.com/kilobyte/compsize")
4007 (commit (string-append "v" version))))
4009 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4010 (file-name (git-file-name name version))))
4011 (build-system gnu-build-system)
4013 `(("btrfs-progs" ,btrfs-progs)))
4015 `(#:tests? #f ; No tests.
4016 #:make-flags (list "CC=gcc")
4018 (modify-phases %standard-phases
4021 (lambda* (#:key outputs #:allow-other-keys)
4022 (let ((out (assoc-ref outputs "out")))
4023 (install-file "compsize" (string-append out "/bin"))
4024 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4025 (synopsis "Find compression type/ratio on Btrfs files")
4026 (description "@command{compsize} takes a list of files (given as
4027 arguments) on a Btrfs file system and measures used compression types and
4028 effective compression ratio, producing a report.
4030 A directory has no extents but has a (recursive) list of files. A non-regular
4031 file is silently ignored.
4033 As it makes no sense to talk about compression ratio of a partial extent,
4034 every referenced extent is counted whole, exactly once -- no matter if you use
4035 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4036 uncompressed size will not match the number given by @command{tar} or
4037 @command{du}. On the other hand, the space used should be accurate (although
4038 obviously it can be shared with files outside our set).")
4039 (license license:gpl2+)))
4041 (define-public f2fs-tools-1.7
4048 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4049 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4052 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4054 (build-system gnu-build-system)
4057 (modify-phases %standard-phases
4058 (add-after 'install 'install-headers
4059 (lambda* (#:key outputs #:allow-other-keys)
4060 (let* ((out (assoc-ref outputs "out"))
4061 (out-include (string-append out "/include")))
4062 (install-file "include/f2fs_fs.h" out-include)
4063 (install-file "mkfs/f2fs_format_utils.h" out-include)
4066 `(("autoconf" ,autoconf)
4067 ("automake" ,automake)
4068 ("libtool" ,libtool)
4069 ("pkg-config" ,pkg-config)))
4071 `(("libuuid" ,util-linux)
4072 ("libselinux" ,libselinux)))
4073 (home-page "https://f2fs.wiki.kernel.org/")
4074 (synopsis "Userland tools for f2fs")
4076 "F2FS, the Flash-Friendly File System, is a modern file system
4077 designed to be fast and durable on flash devices such as solid-state
4078 disks and SD cards. This package provides the userland utilities.")
4079 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4080 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4081 (license (list license:gpl2 license:lgpl2.1))))
4083 (define-public f2fs-tools
4085 (inherit f2fs-tools-1.7)
4091 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4092 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4095 "15pn2fm9knn7p1vzfzy6msnrdl14p6y1gn4m2ka6ba5bzx6lw4p2"))))
4097 `(("libuuid" ,util-linux)))))
4099 (define-public freefall
4102 (version (package-version linux-libre))
4103 (source (package-source linux-libre))
4104 (build-system gnu-build-system)
4106 '(#:phases (modify-phases %standard-phases
4107 (add-after 'unpack 'enter-subdirectory
4109 (chdir "tools/laptop/freefall")
4112 (add-before 'build 'increase-timeout
4114 ;; The default of 2 seconds is too low: it assumes an
4115 ;; open lid and AC power without actually checking.
4116 (substitute* "freefall.c"
4117 (("alarm\\(2\\)") "alarm(5)"))
4119 #:make-flags (list (string-append "PREFIX="
4120 (assoc-ref %outputs "out"))
4122 #:tests? #f)) ;no tests
4123 (home-page (package-home-page linux-libre))
4124 (synopsis "Free-fall protection for spinning laptop hard drives")
4126 "Prevents shock damage to the internal spinning hard drive(s) of some
4127 HP and Dell laptops. When sudden movement is detected, all input/output
4128 operations on the drive are suspended and its heads are parked on the ramp,
4129 where they are less likely to cause damage to the spinning disc. Requires a
4130 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4131 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4132 (license license:gpl2)))
4134 (define-public thinkfan
4142 (url "https://github.com/vmatare/thinkfan.git")
4144 (file-name (git-file-name name version))
4146 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
4147 (build-system cmake-build-system)
4149 `(#:modules ((guix build cmake-build-system)
4152 #:tests? #f ; no test target
4154 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4155 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4157 `("-DUSE_ATASMART:BOOL=ON")
4159 (modify-phases %standard-phases
4160 (add-after 'unpack 'create-init-scripts
4161 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4162 ;; systemd to patch and install their service files. Fake their
4163 ;; presence rather than duplicating the build system below. Leave
4164 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4165 ;; The sysvinit needs manual patching, but since upstream doesn't
4166 ;; even provide the option to install it: don't.
4167 (lambda* (#:key outputs #:allow-other-keys)
4168 (let* ((out (assoc-ref outputs "out"))
4169 (share (string-append out "/share/" ,name)))
4170 (substitute* "CMakeLists.txt"
4171 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4172 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4173 ;; That was easy! Now we just need to fix the destinations.
4175 (string-append out directory)))
4178 `(("pkg-config" ,pkg-config)))
4180 `(("libatasmart" ,libatasmart)
4181 ("yaml-cpp" ,yaml-cpp)))
4182 (home-page "http://thinkfan.sourceforge.net/")
4183 (synopsis "Simple fan control program")
4185 "Thinkfan is a simple fan control program. It reads temperatures,
4186 checks them against configured limits and switches to appropriate (also
4187 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4188 other @code{hwmon} driver that enables temperature reading and fan control
4190 (license license:gpl3+)))
4192 (define-public tpacpi-bat
4200 (url "https://github.com/teleshoes/tpacpi-bat.git")
4201 (commit (string-append "v" version))))
4202 (file-name (git-file-name name version))
4204 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4205 (build-system gnu-build-system)
4207 `(#:tests? #f ; no test target
4209 (modify-phases %standard-phases
4210 (add-after 'unpack 'refer-to-inputs
4212 (substitute* "tpacpi-bat"
4214 (format "~a " (which "cat")))
4215 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4216 ;; loaded. That's the administrator's prerogative; disable it.
4217 (("system \"(modprobe .*)\"" _ match)
4218 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4220 (delete 'configure) ; nothing to configure
4221 (delete 'build) ; nothing to build
4223 (lambda* (#:key outputs #:allow-other-keys)
4224 (let* ((out (assoc-ref outputs "out"))
4225 (bin (string-append out "/bin"))
4226 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4227 (install-file "tpacpi-bat" bin)
4229 ;; There's no man page. Install other forms of documentation.
4230 (for-each (lambda (file)
4231 (let ((target (string-append doc "/" file)))
4232 (mkdir-p (dirname target))
4233 (copy-recursively file target)))
4234 (list "battery_asl" "examples" "README.md"))
4238 (home-page "https://github.com/teleshoes/tpacpi-bat")
4239 (synopsis "ThinkPad battery charge controller")
4241 "Tpacpi-bat is a command-line interface to control battery charging on
4242 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4243 ThinkPad models released after 2011}, starting with the xx20 series. It can
4244 query and set the thresholds at which one or both batteries will start and stop
4245 charging, inhibit charging batteries for a set period of time, or force them to
4246 discharge when they otherwise would not.
4248 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4249 kernel module provided by the @code{acpi-call-linux-module} package, which must
4250 be installed and loaded separately. Only the original vendor firmware is
4252 (license license:gpl3+)))
4254 (define-public ntfs-3g
4257 (version "2017.3.23")
4260 (uri (string-append "https://tuxera.com/opensource/"
4261 "ntfs-3g_ntfsprogs-" version ".tgz"))
4262 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
4265 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
4266 (modules '((guix build utils)))
4268 ;; Install under $prefix.
4269 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4273 (build-system gnu-build-system)
4274 (inputs `(("util-linux" ,util-linux)
4275 ("fuse" ,fuse))) ;libuuid
4276 (native-inputs `(("pkg-config" ,pkg-config)))
4278 '(#:configure-flags (list "--exec-prefix=${prefix}"
4279 "--with-fuse=external" ;use our own FUSE
4280 "--enable-mount-helper"
4281 "--enable-posix-acls"
4282 "--enable-xattr-mappings")
4284 (modify-phases %standard-phases
4285 ;; If users install ntfs-3g, they probably want to make it the
4286 ;; default driver as well, so we opt for sensible defaults and link
4287 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
4288 ;; mount NTFS file systems.)
4289 (add-after 'install 'install-link
4290 (lambda* (#:key outputs #:allow-other-keys)
4291 (let* ((out (assoc-ref outputs "out"))
4292 (sbin (string-append out "/sbin")))
4293 (symlink "mount.ntfs-3g"
4294 (string-append sbin "/mount.ntfs")))
4296 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
4297 (synopsis "Read-write access to NTFS file systems")
4299 "NTFS-3G provides read-write access to NTFS file systems, which are
4300 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4301 The package provides additional NTFS tools.")
4302 (license license:gpl2+)))
4304 (define-public rdma-core
4310 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4311 "/releases/download/v" version "/rdma-core-"
4315 "0jgp1xh328x0kr6lkn4vq71cc627zd05wczr74b3j3151flhj828"))))
4316 (build-system cmake-build-system)
4318 '(#:tests? #f ; no tests
4319 ;; Upstream uses the "ninja" build system and encourage distros
4320 ;; to do the same for consistency. They also recommend using the
4321 ;; "Release" build type.
4322 #:build-type "Release"
4323 #:configure-flags (list "-GNinja")
4325 (modify-phases %standard-phases
4329 "-j" (number->string (parallel-job-count)))))
4332 (invoke "ninja" "install"))))))
4335 ("pkg-config" ,pkg-config)
4336 ("python" ,python-wrapper)))
4340 (home-page "https://github.com/linux-rdma/rdma-core")
4341 (synopsis "Utilities and libraries for working with RDMA devices")
4343 "This package provides userspace components for the InfiniBand
4344 subsystem of the Linux kernel. Specifically it contains userspace
4345 libraries for the following device nodes:
4348 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4349 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4350 @item @file{/dev/infiniband/umadX} (@code{libibumad})
4353 The following service daemons are also provided:
4355 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4356 @item @code{iwpmd} (for iWARP kernel providers)
4357 @item @code{ibacm} (for InfiniBand communication management assistant)
4359 ;; All library code is dual licensed under GPL2 and a custom MIT
4360 ;; variant. The package also includes some components covered by
4361 ;; other licenses. Consult COPYING.md for full details.
4364 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4365 license:bsd-2 ; Files referring to COPYING.BSD_FB
4366 license:cc0 ; most files in ccan/
4367 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4369 (define-public perftest
4376 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4377 version "/perftest-" version ".g0927198.tar.gz"))
4379 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
4380 (build-system gnu-build-system)
4383 (modify-phases %standard-phases
4384 (add-after 'unpack 'patch-header-paths
4386 (substitute* '("src/raw_ethernet_fs_rate.c"
4387 "src/raw_ethernet_resources.c"
4388 "src/raw_ethernet_resources.h"
4389 "src/raw_ethernet_send_burst_lat.c"
4390 "src/raw_ethernet_send_bw.c"
4391 "src/raw_ethernet_send_lat.c")
4392 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4394 (inputs `(("rdma-core" ,rdma-core)))
4395 (home-page "https://github.com/linux-rdma/perftest/")
4396 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4397 (description "This is a collection of tests written over uverbs intended for
4398 use as a performance micro-benchmark. The tests may be used for hardware or
4399 software tuning as well as for functional testing.
4401 The collection contains a set of bandwidth and latency benchmark such as:
4403 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
4404 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4405 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4406 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4407 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4409 (license license:gpl2)))
4411 (define-public rng-tools
4414 (home-page "https://github.com/nhorman/rng-tools")
4418 (uri (git-reference (url home-page)
4419 (commit (string-append "v" version))))
4420 (file-name (git-file-name name version))
4423 "19f75m6mzg8h7b4snzg7d6ypvkz6nq32lrpi9ja95gqz4wsd18a5"))))
4424 (build-system gnu-build-system)
4426 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
4427 #:configure-flags '("--without-nistbeacon"
4428 "--without-pkcs11")))
4430 `(("autoconf" ,autoconf)
4431 ("automake" ,automake)
4432 ("pkg-config" ,pkg-config)))
4434 `(("libsysfs" ,sysfsutils)))
4435 (synopsis "Random number generator daemon")
4437 "Monitor a hardware random number generator, and supply entropy
4438 from that to the system kernel's @file{/dev/random} machinery.")
4439 ;; The source package is offered under the GPL2+, but the files
4440 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4441 (license (list license:gpl2 license:gpl2+))))
4443 (define-public cpupower
4446 (version (package-version linux-libre))
4447 (source (package-source linux-libre))
4448 (build-system gnu-build-system)
4450 '(#:phases (modify-phases %standard-phases
4451 (add-after 'unpack 'enter-subdirectory
4453 (chdir "tools/power/cpupower")
4456 (add-before 'build 'fix-makefiles
4458 (substitute* "Makefile"
4460 (("/bin/(install|pwd)" _ command) command))
4461 (substitute* "bench/Makefile"
4462 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4464 #:make-flags (let ((out (assoc-ref %outputs "out")))
4465 (list (string-append "DESTDIR=" out)
4466 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4467 "docdir=/share/doc/cpupower"
4468 "confdir=$(docdir)/examples"
4469 ;; The Makefile recommends the following changes
4471 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4472 #:tests? #f)) ;no tests
4473 (native-inputs `(("gettext" ,gettext-minimal)))
4474 (inputs `(("pciutils" ,pciutils)))
4475 (home-page (package-home-page linux-libre))
4476 (synopsis "CPU frequency and voltage scaling tools for Linux")
4478 "cpupower is a set of user-space tools that use the cpufreq feature of the
4479 Linux kernel to retrieve and control processor features related to power saving,
4480 such as frequency and voltage scaling.")
4481 (license license:gpl2)))
4483 (define-public x86-energy-perf-policy
4485 (name "x86-energy-perf-policy")
4486 (version (package-version linux-libre))
4487 (source (package-source linux-libre))
4488 (build-system gnu-build-system)
4492 (modify-phases %standard-phases
4493 (add-after 'unpack 'enter-subdirectory
4495 (chdir "tools/power/x86/x86_energy_perf_policy")
4498 (add-before 'build 'fix-makefile
4500 (substitute* "Makefile" (("/usr") ""))
4503 (let ((out (assoc-ref %outputs "out")))
4504 (list (string-append "DESTDIR=" out)
4505 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4506 (supported-systems '("i686-linux" "x86_64-linux"))
4507 (home-page (package-home-page linux-libre))
4508 (synopsis "Display and update Intel-CPU energy-performance policy")
4510 "@command{x86_energy_perf_policy} displays and updates energy-performance
4511 policy settings specific to Intel Architecture Processors. Settings are
4512 accessed via Model Specific Register (MSR) updates, no matter if the Linux
4513 cpufreq sub-system is enabled or not.")
4514 (license license:gpl2)))
4516 (define-public haveged
4524 (url "https://github.com/jirka-h/haveged.git")
4525 (commit (string-append "v" version))))
4526 (file-name (git-file-name name version))
4528 (base32 "11kr19n2f87izsj341lv5amhd1wc2ckfmqr9pq5fxix8pkbs94rh"))))
4529 (build-system gnu-build-system)
4530 (home-page "https://www.issihosts.com/haveged")
4531 (synopsis "Entropy source for the Linux random number generator")
4533 "haveged generates an unpredictable stream of random numbers for use by
4534 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4535 standard mechanisms for filling the entropy pool may not be sufficient for
4536 systems with high needs or limited user interaction, such as headless servers.
4538 @command{haveged} runs as a privileged daemon, harvesting randomness from the
4539 indirect effects of hardware events on hidden processor state using the
4540 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
4541 It tunes itself to its environment and provides the same built-in test suite
4542 for the output stream as used on certified hardware security devices.
4544 The quality of the randomness produced by this algorithm has not been proven.
4545 It is recommended to run it together with another entropy source like rngd, and
4546 not as a replacement for it.")
4547 (license (list (license:non-copyleft "file://nist/mconf.h")
4548 (license:non-copyleft "file://nist/packtest.c")
4549 license:public-domain ; nist/dfft.c
4550 license:gpl3+)))) ; everything else
4552 (define-public ecryptfs-utils
4554 (name "ecryptfs-utils")
4559 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4560 version "/+download/ecryptfs-utils_"
4561 version ".orig.tar.gz"))
4564 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4565 (build-system gnu-build-system)
4567 `(#:configure-flags (list "--disable-pywrap")
4569 (modify-phases %standard-phases
4570 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4571 (lambda* (#:key inputs outputs #:allow-other-keys)
4572 (let ((out (assoc-ref outputs "out"))
4573 (utils-linux (assoc-ref inputs "utils-linux"))
4574 (cryptsetup (assoc-ref inputs "cryptsetup"))
4575 (linux-pam (assoc-ref inputs "linux-pam"))
4576 (lvm2 (assoc-ref inputs "lvm2")))
4577 (substitute* '("src/utils/ecryptfs-mount-private"
4578 "src/utils/ecryptfs-umount-private"
4579 "src/utils/ecryptfs-setup-private"
4580 "src/utils/ecryptfs-setup-swap"
4581 "src/utils/mount.ecryptfs.c"
4582 "src/utils/umount.ecryptfs.c"
4583 "src/pam_ecryptfs/pam_ecryptfs.c"
4584 "src/desktop/ecryptfs-mount-private.desktop.in"
4585 "src/desktop/ecryptfs-setup-private.desktop.in")
4587 (string-append utils-linux "/bin/mount"))
4589 (string-append utils-linux "/bin/umount"))
4590 (("/sbin/mount.ecryptfs_private")
4591 (string-append out "/sbin/mount.ecryptfs_private"))
4592 (("/sbin/umount.ecryptfs_private")
4593 (string-append out "/sbin/umount.ecryptfs_private"))
4594 (("/usr/bin/ecryptfs-mount-private")
4595 (string-append out "/bin/ecryptfs-mount-private"))
4596 (("/usr/bin/ecryptfs-rewrite-file")
4597 (string-append out "/bin/ecryptfs-rewrite-file"))
4598 (("/usr/bin/ecryptfs-setup-private")
4599 (string-append out "/bin/ecryptfs-setup-private"))
4600 (("/sbin/cryptsetup")
4601 (string-append cryptsetup "/sbin/cryptsetup"))
4602 (("/sbin/unix_chkpwd")
4603 (string-append linux-pam "/sbin/unix_chkpwd"))
4605 (string-append lvm2 "/sbin/dmsetup")))))))))
4607 `(("intltool" ,intltool)
4608 ("perl" ,perl) ; for pod2man
4609 ("pkg-config" ,pkg-config)))
4611 `(("keyutils" ,keyutils)
4612 ("linux-pam" ,linux-pam)
4613 ("utils-linux" ,util-linux)
4614 ("cryptsetup" ,cryptsetup)
4617 (home-page "http://ecryptfs.org/")
4618 (synopsis "eCryptfs cryptographic file system utilities")
4620 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4621 Each file's cryptographic meta-data is stored inside the file itself, along
4622 with the encrypted contents. This allows individual encrypted files to be
4623 copied between hosts and still be decrypted with the proper key. eCryptfs is a
4624 native Linux file system, and has been part of the Linux kernel since version
4625 2.6.19. This package contains the userland utilities to manage it.")
4626 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4627 ;; grant additional permission to link with OpenSSL.
4628 (license license:gpl2+)))
4630 (define-public libnfsidmap
4632 (name "libnfsidmap")
4637 (uri (string-append "https://fedorapeople.org/~steved/"
4638 name "/" version "/" name "-" version ".tar.bz2"))
4640 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
4641 (build-system gnu-build-system)
4643 `(#:configure-flags (list
4644 (string-append "--with-pluginpath="
4645 (assoc-ref %outputs "out")
4646 "/lib/libnfsidmap"))))
4648 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
4650 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4651 (synopsis "NFSv4 support library for name/ID mapping")
4652 (description "Libnfsidmap is a library holding mulitiple methods of
4653 mapping names to ids and visa versa, mainly for NFSv4. It provides an
4654 extensible array of mapping functions, currently consisting of two choices:
4655 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4656 (license (license:non-copyleft "file://COPYING"
4657 "See COPYING in the distribution."))))
4659 (define-public module-init-tools
4661 (name "module-init-tools")
4666 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
4667 "module-init-tools-" version ".tar.bz2"))
4670 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
4671 (patches (search-patches "module-init-tools-moduledir.patch"))))
4672 (build-system gnu-build-system)
4674 ;; FIXME: The upstream tarball lacks man pages, and building them would
4675 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
4676 ;; but they vanished. In the meantime, fake it.
4678 (modify-phases %standard-phases
4679 (add-before 'configure 'fake-docbook
4681 (substitute* "Makefile.in"
4682 (("^DOCBOOKTOMAN.*$")
4683 "DOCBOOKTOMAN = true\n"))
4685 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
4686 (synopsis "Tools for loading and managing Linux kernel modules")
4688 "Tools for loading and managing Linux kernel modules, such as
4689 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
4690 (license license:gpl2+)))
4692 (define-public mcelog
4698 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
4699 "mcelog.git/snapshot/v" version ".tar.gz"))
4702 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
4703 (file-name (string-append name "-" version ".tar.gz"))
4704 (modules '((guix build utils)))
4707 ;; The snapshots lack a .git directory,
4708 ;; breaking ‘git describe’.
4709 (substitute* "Makefile"
4710 (("\"unknown\"") (string-append "\"v" ,version "\"")))
4712 (build-system gnu-build-system)
4714 `(#:phases (modify-phases %standard-phases
4715 (delete 'configure)) ; no configure script
4716 #:make-flags (let ((out (assoc-ref %outputs "out")))
4718 (string-append "prefix=" out)
4719 (string-append "DOCDIR=" out "/share/doc/mcelog")
4720 "etcprefix=$(DOCDIR)/examples"))
4721 ;; The tests will only run as root on certain supported CPU models.
4723 (supported-systems (list "i686-linux" "x86_64-linux"))
4724 (home-page "https://mcelog.org/")
4725 (synopsis "Machine check monitor for x86 Linux systems")
4727 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
4728 and other hardware errors on x86 systems. It can also perform user-defined
4729 tasks, such as bringing bad pages off-line, when configurable error thresholds
4731 (license license:gpl2)))
4733 (define-public mtd-utils
4740 "ftp://ftp.infradead.org/pub/mtd-utils/"
4741 "mtd-utils-" version ".tar.bz2"))
4744 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
4746 '(#:configure-flags '("--enable-unit-tests")))
4748 `(("cmocka" ,cmocka)
4749 ("pkg-config" ,pkg-config)))
4751 `(("acl" ,acl) ; extended attributes (xattr)
4752 ("libuuid" ,util-linux)
4754 ("openssl" ,openssl) ; optional crypto support
4756 ("zstd" ,zstd "lib")))
4757 (build-system gnu-build-system)
4758 (synopsis "MTD Flash Storage Utilities")
4759 (description "This package provides utilities for testing, partitioning, etc
4761 (home-page "http://www.linux-mtd.infradead.org/")
4763 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
4764 license:mpl1.1 ; All ftl* files
4765 license:expat)))) ; libiniparser
4767 (define-public libseccomp
4773 (uri (string-append "https://github.com/seccomp/libseccomp/"
4774 "releases/download/v" version
4775 "/libseccomp-" version ".tar.gz"))
4778 "1s06h2cgk0xxwmhwj72z33bllafc1xqnxzk2yyra2rmg959778qw"))))
4779 (build-system gnu-build-system)
4781 `(("which" ,which)))
4782 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
4783 (description "The libseccomp library provides an easy to use, platform
4784 independent, interface to the Linux Kernel's syscall filtering mechanism. The
4785 libseccomp API is designed to abstract away the underlying BPF based syscall
4786 filter language and present a more conventional function-call based filtering
4787 interface that should be familiar to, and easily adopted by, application
4789 (home-page "https://github.com/seccomp/libseccomp")
4790 (license license:lgpl2.1)))
4792 (define-public radeontop
4800 (url "https://github.com/clbr/radeontop.git")
4801 (commit (string-append "v" version))))
4802 (file-name (git-file-name name version))
4804 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
4805 (build-system gnu-build-system)
4807 `(#:phases (modify-phases %standard-phases
4808 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4809 ;; dependency, and doesn't even work on release(!) tarballs.
4810 (add-after 'unpack 'report-correct-version
4812 (substitute* "getver.sh"
4814 (string-append "ver=" ,version)))
4816 (delete 'configure)) ; no configure script
4817 #:make-flags (list "CC=gcc"
4818 (string-append "PREFIX=" %output))
4819 #:tests? #f)) ; no tests
4821 `(("gettext" ,gettext-minimal)
4822 ("pkg-config" ,pkg-config)))
4824 `(("libdrm" ,libdrm)
4825 ("libpciaccess" ,libpciaccess)
4827 ("ncurses" ,ncurses)))
4828 (home-page "https://github.com/clbr/radeontop/")
4829 (synopsis "Usage monitor for AMD Radeon graphics")
4830 (description "RadeonTop monitors resource consumption on supported AMD
4831 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4832 a terminal or saved to a file for further processing. It measures both the
4833 activity of the GPU as a whole, which is also accurate during OpenCL
4834 computations, as well as separate component statistics that are only meaningful
4835 under OpenGL graphics workloads.")
4836 (license license:gpl3)))
4838 (define-public efivar
4844 (uri (string-append "https://github.com/rhboot/" name
4845 "/releases/download/" version "/" name
4846 "-" version ".tar.bz2"))
4849 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
4850 (build-system gnu-build-system)
4852 `(;; Tests require a UEFI system and is not detected in the chroot.
4854 #:make-flags (list (string-append "prefix=" %output)
4855 (string-append "libdir=" %output "/lib")
4857 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4859 (modify-phases %standard-phases
4861 (add-before 'build 'kernel-headers-are-system-headers
4862 (lambda* (#:key inputs #:allow-other-keys)
4863 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
4864 ;; Make sure the kernel headers are treated as system headers
4865 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
4866 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
4869 `(("pkg-config" ,pkg-config)))
4872 (home-page "https://github.com/rhboot/efivar")
4873 (synopsis "Tool and library to manipulate EFI variables")
4874 (description "This package provides a library and a command line
4875 interface to the variable facility of UEFI boot firmware.")
4876 (license license:lgpl2.1+)))
4878 (define-public efibootmgr
4884 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
4885 "/releases/download/" version "/efibootmgr"
4886 "-" version ".tar.bz2"))
4889 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
4890 (build-system gnu-build-system)
4892 `(#:tests? #f ;no tests
4893 #:make-flags (list (string-append "prefix=" %output)
4894 (string-append "libdir=" %output "/lib")
4895 ;; EFIDIR denotes a subdirectory relative to the
4896 ;; EFI System Partition where the loader will be
4897 ;; installed (known as OS_VENDOR in the code).
4898 ;; GRUB overrides this, as such it's only used if
4899 ;; nothing else is specified on the command line.
4901 ;; Treat kernel headers as system headers to prevent
4902 ;; warnings about conflicting types.
4903 (string-append "C_INCLUDE_PATH="
4904 (assoc-ref %build-inputs "kernel-headers")
4906 #:phases (modify-phases %standard-phases (delete 'configure))))
4908 `(("pkg-config" ,pkg-config)))
4910 `(("efivar" ,efivar)
4912 (home-page "https://github.com/rhinstaller/efibootmgr")
4913 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
4915 "@code{efibootmgr} is a user-space application to modify the Intel
4916 Extensible Firmware Interface (EFI) Boot Manager. This application can
4917 create and destroy boot entries, change the boot order, change the next
4918 running boot option, and more.")
4919 (license license:gpl2+)))
4921 (define-public sysstat
4927 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
4928 "sysstat-" version ".tar.xz"))
4931 "0agi17n82k363mf9f7cky3isq195hw112vs98v26yfhm0v2g6lpp"))))
4932 (build-system gnu-build-system)
4934 `(#:tests? #f ; No test suite.
4935 ;; Without this flag, it tries to install the man pages with group 'root'
4936 ;; and fails because /etc/passwd lacks an entry for the root user.
4938 (list "--disable-file-attr"
4939 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
4941 (modify-phases %standard-phases
4942 ;; The build process tries to create '/var/lib/sa', so we skip that
4944 (add-after 'build 'skip-touching-var
4946 (substitute* "Makefile"
4947 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
4950 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
4951 (synopsis "Performance monitoring tools for Linux")
4952 (description "The sysstat utilities are a collection of performance
4953 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
4954 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
4955 @code{sadf} and @code{sa}.")
4956 (license license:gpl2+)))
4958 (define-public light
4965 "https://github.com/haikarainen/light/archive/v"
4969 "1gfvsw7gh5pis733l7j54vzp272pvjyzbg8a0pvapfmg0s7mip97"))
4970 (file-name (string-append name "-" version ".tar.gz"))))
4971 (build-system gnu-build-system)
4973 `(("autoconf" ,autoconf)
4974 ("automake" ,automake)))
4975 (home-page "https://haikarainen.github.io/light/")
4976 (synopsis "GNU/Linux application to control backlights")
4978 "Light is a program to send commands to screen backlight controllers
4979 under GNU/Linux. Features include:
4982 @item It does not rely on X.
4983 @item Light can automatically figure out the best controller to use, making
4984 full use of underlying hardware.
4985 @item It is possible to set a minimum brightness value, as some controllers
4986 set the screen to be pitch black at a vaĺue of 0 (or higher).
4989 Light is the successor of lightscript.")
4990 (license license:gpl3+)))
4992 (define-public brightnessctl
4993 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
4995 (name "brightnessctl")
4996 (version (git-version "0.4" "0" commit))
5000 (url "https://github.com/Hummer12007/brightnessctl/")
5002 (file-name (git-file-name name version))
5005 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5006 (build-system gnu-build-system)
5008 '(#:tests? #f ; no tests
5009 #:make-flags (list "CC=gcc"
5010 (string-append "PREFIX=" %output)
5011 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5013 (modify-phases %standard-phases
5015 (add-after 'unpack 'adjust-udev-rules
5017 (substitute* "90-brightnessctl.rules"
5018 (("/bin/") "/run/current-system/profile/bin/"))
5020 (home-page "https://github.com/Hummer12007/brightnessctl")
5021 (synopsis "Backlight and LED brightness control")
5023 "This program allows you read and control device brightness. Devices
5024 include backlight and LEDs. It can also preserve current brightness before
5025 applying the operation, such as on lid close.
5027 The appropriate permissions must be set on the backlight or LED control
5028 interface in sysfs, which can be accomplished with the included udev rules.")
5029 (license license:expat))))
5038 "https://github.com/linrunner/"
5039 (string-upcase name)
5040 "/archive/" version ".tar.gz"))
5041 (file-name (string-append name "-" version ".tar.gz"))
5044 "059kxrpxx580mm6p0z2a421nxngszyh4yqqhbgvn04b6a7dbsa2w"))))
5045 (inputs `(("bash" ,bash)
5047 ("ethtool" ,ethtool)
5051 ("inetutils" ,inetutils)
5054 ("pciutils" ,pciutils)
5058 ("usbutils" ,usbutils)
5059 ("util-linux" ,util-linux)
5060 ("wireless-tools" ,wireless-tools)
5061 ,@(if (let ((system (or (%current-target-system)
5062 (%current-system))))
5063 (or (string-prefix? "i686-" system)
5064 (string-prefix? "x86_64-" system)))
5065 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5067 (build-system gnu-build-system)
5069 `(#:modules ((guix build gnu-build-system)
5073 (modify-phases %standard-phases
5074 (delete 'configure) ; no configure script
5075 (add-before 'build 'setenv
5076 (lambda* (#:key outputs #:allow-other-keys)
5077 (let ((out (assoc-ref outputs "out")))
5078 (setenv "TLP_WITH_SYSTEMD" "0")
5079 (setenv "TLP_NO_INIT" "1")
5080 (setenv "TLP_NO_PMUTILS" "1")
5081 (setenv "TLP_SBIN" (string-append out "/bin"))
5082 (setenv "TLP_BIN" (string-append out "/bin"))
5083 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5084 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5085 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5086 (setenv "TLP_CONF" "/etc/tlp")
5088 (string-append out "/lib/elogind/system-sleep"))
5090 (string-append out "/share/bash-completion/completions"))
5091 (setenv "TLP_MAN" (string-append out "/share/man"))
5092 (setenv "TLP_META" (string-append out "/share/metainfo"))
5094 (delete 'check) ; no tests
5095 (add-before 'install 'fix-installation
5097 ;; Stop the Makefile from trying to create system directories.
5098 (substitute* "Makefile"
5099 (("\\[ -f \\$\\(_CONF\\) \\]") "#")
5100 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5104 (invoke "make" "install-tlp" "install-man")))
5105 (add-after 'install 'wrap
5106 (lambda* (#:key inputs outputs #:allow-other-keys)
5107 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5108 (bin-files (find-files bin ".*")))
5109 (define (bin-directory input-name)
5110 (let ((p (assoc-ref inputs input-name)))
5111 (and p (string-append p "/bin"))))
5112 (define (sbin-directory input-name)
5113 (string-append (assoc-ref inputs input-name) "/sbin"))
5114 (for-each (lambda (program)
5115 (wrap-program program
5118 (filter-map bin-directory
5130 "x86-energy-perf-policy"))
5131 (filter-map sbin-directory
5137 "wireless-tools"))))))
5140 (home-page "http://linrunner.de/en/tlp/tlp.html")
5141 (synopsis "Power management tool for Linux")
5142 (description "TLP is a power management tool for Linux. It comes with
5143 a default configuration already optimized for battery life. Nevertheless,
5144 TLP is customizable to fulfil system requirements. TLP settings are applied
5145 every time the power supply source is changed.")
5146 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5148 (license (list license:gpl2+ license:gpl3+))))
5156 (uri (string-append "https://www.ezix.org/software/"
5157 "files/lshw-" version
5161 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5162 (build-system gnu-build-system)
5164 `(#:phases (modify-phases %standard-phases (delete 'configure))
5165 #:tests? #f ; no tests
5167 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5168 (synopsis "List hardware information")
5170 "@command{lshw} (Hardware Lister) is a small tool to provide
5171 detailed information on the hardware configuration of the machine.
5172 It can report exact memory configuration, firmware version, mainboard
5173 configuration, CPU version and speed, cache configuration, bus speed,
5174 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5175 machines (PowerMac G4 is known to work).")
5176 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5177 (license license:gpl2+)))
5179 (define-public libmnl
5186 (uri (string-append "mirror://netfilter.org/libmnl/"
5187 "libmnl-" version ".tar.bz2"))
5190 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5191 (build-system gnu-build-system)
5192 (home-page "https://www.netfilter.org/projects/libmnl/")
5193 (synopsis "Netlink utility library")
5194 (description "Libmnl is a minimalistic user-space library oriented to
5195 Netlink developers. There are a lot of common tasks in parsing, validating,
5196 constructing of both the Netlink header and TLVs that are repetitive and easy to
5197 get wrong. This library aims to provide simple helpers that allows you to
5198 re-use code and to avoid re-inventing the wheel.")
5199 (license license:lgpl2.1+)))
5201 (define-public libnftnl
5208 (uri (string-append "mirror://netfilter.org/libnftnl/"
5209 "libnftnl-" version ".tar.bz2"))
5211 (base32 "087dfc2n4saf2k68hyi4byvgz5grwpw5kfjvmkpn3wmd8y1riiy8"))))
5212 (build-system gnu-build-system)
5214 `(("pkg-config" ,pkg-config)))
5216 `(("libmnl" ,libmnl)))
5217 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5218 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5219 (description "Libnftnl is a userspace library providing a low-level netlink
5220 programming interface to the in-kernel nf_tables subsystem. The library
5221 libnftnl has been previously known as libnftables. This library is currently
5223 (license license:gpl2+)))
5225 (define-public nftables
5232 (uri (string-append "http://www.nftables.org/projects/nftables"
5233 "/files/nftables-" version ".tar.bz2"))
5236 "1x8kalbggjq44j4916i6vyv1rb20dlh1dcsf9xvzqsry2j063djw"))))
5237 (build-system gnu-build-system)
5238 (arguments `(#:configure-flags
5239 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5240 (inputs `(("bison" ,bison)
5244 ("libnftnl" ,libnftnl)
5245 ("readline" ,readline)))
5246 (native-inputs `(("pkg-config" ,pkg-config)))
5247 (home-page "http://www.nftables.org")
5248 (synopsis "Userspace utility for Linux packet filtering")
5249 (description "nftables is the project that aims to replace the existing
5250 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5251 filtering framework, a new userspace utility and also a compatibility layer for
5252 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5253 infrastructure such as the existing hooks, the connection tracking system, the
5254 userspace queueing component and the logging subsystem.")
5255 (license license:gpl2)))
5257 (define-public proot
5265 (url "https://github.com/proot-me/PRoot.git")
5266 (commit (string-append "v" version))))
5267 (file-name (git-file-name name version))
5269 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5270 (patches (search-patches "proot-test-fhs.patch"))))
5271 (build-system gnu-build-system)
5273 '(#:make-flags '("-C" "src")
5275 #:phases (modify-phases %standard-phases
5277 (add-before 'build 'set-shell-file-name
5278 (lambda* (#:key inputs #:allow-other-keys)
5279 (substitute* (find-files "src" "\\.[ch]$")
5282 (assoc-ref inputs "bash")
5285 (add-before 'check 'fix-fhs-assumptions-in-tests
5287 (substitute* "tests/test-c6b77b77.mk"
5288 (("/bin/bash") (which "bash"))
5289 (("/usr/bin/test") (which "test")))
5290 (substitute* '("tests/test-16573e73.c")
5291 (("/bin/([a-z-]+)" _ program)
5294 (substitute* (find-files "tests" "\\.sh$")
5295 ;; Some of the tests try to "bind-mount" /bin/true.
5297 (string-append "-b " (which "true") ":"))
5298 ;; Likewise for /bin.
5299 (("-b /bin:") "-b /gnu:")
5300 ;; Others try to run /bin/sh.
5301 (("/bin/sh") (which "sh"))
5302 ;; Others assume /etc/fstab exists.
5303 (("/etc/fstab") "/etc/passwd"))
5305 (substitute* "tests/GNUmakefile"
5306 (("-b /bin:") "-b /gnu:"))
5308 ;; XXX: This test fails in an obscure corner case, just
5310 (delete-file "tests/test-kkkkkkkk.c")
5315 (let ((n (parallel-job-count)))
5316 ;; For some reason we get lots of segfaults with
5317 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5318 (setenv "PROOT_NO_SECCOMP" "1")
5320 ;; Most of the tests expect "/bin" to be in $PATH so
5321 ;; they can run things that live in $ROOTFS/bin.
5323 (string-append (getenv "PATH") ":/bin"))
5325 (invoke "make" "check" "-C" "tests"
5327 "-j" (number->string n)))))
5329 (lambda* (#:key outputs #:allow-other-keys)
5330 ;; The 'install' rule does nearly nothing.
5331 (let* ((out (assoc-ref outputs "out"))
5332 (man1 (string-append out "/share/man/man1")))
5333 ;; TODO: 'make install-care' (does not even
5334 ;; build currently.)
5335 (invoke "make" "-C" "src" "install"
5336 (string-append "PREFIX=" out))
5339 (copy-file "doc/proot/man.1"
5340 (string-append man1 "/proot.1"))
5342 (native-inputs `(("which" ,which)
5344 ;; For 'mcookie', used by some of the tests.
5345 ("util-linux" ,util-linux)))
5346 (inputs `(("talloc" ,talloc)))
5347 (home-page "https://github.com/proot-me/PRoot")
5348 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5350 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5351 and @code{binfmt_misc}. This means that users don't need any privileges or
5352 setup to do things like using an arbitrary directory as the new root
5353 file system, making files accessible somewhere else in the file system
5354 hierarchy, or executing programs built for another CPU architecture
5355 transparently through QEMU user-mode. Also, developers can use PRoot as a
5356 generic process instrumentation engine thanks to its extension mechanism.
5357 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5358 available in the kernel Linux.")
5359 (license license:gpl2+)))
5361 (define-public proot-static
5364 (name "proot-static")
5366 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5367 (inputs `(("talloc" ,talloc/static)))
5369 (substitute-keyword-arguments (package-arguments proot)
5370 ((#:make-flags flags)
5371 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5373 `(modify-phases ,phases
5374 (add-after 'strip 'remove-store-references
5375 (lambda* (#:key outputs #:allow-other-keys)
5376 (let* ((out (assoc-ref outputs "out")))
5377 (with-directory-excursion out
5378 (remove-store-references "bin/proot")
5380 ((#:allowed-references _ '("out"))
5383 (define-public cpuid
5386 (version "20180519")
5389 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5390 version ".src.tar.gz"))
5393 "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
5394 (build-system gnu-build-system)
5396 '(#:make-flags '("CC=gcc")
5397 #:tests? #f ; no tests
5398 #:phases (modify-phases %standard-phases
5399 (delete 'configure) ; no configure script
5400 (add-before 'install 'fix-makefile
5401 (lambda* (#:key outputs #:allow-other-keys)
5402 (substitute* "Makefile"
5403 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5404 ;; Make the compressed manpages writable so that the
5405 ;; reset-gzip-timestamps phase does not error out.
5406 (substitute* "Makefile"
5407 (("-m 444") "-m 644"))
5409 (inputs `(("perl" ,perl)))
5410 (supported-systems '("i686-linux" "x86_64-linux"))
5411 (home-page "http://www.etallen.com/cpuid.html")
5412 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5413 (description "cpuid dumps detailed information about the CPU(s) gathered
5414 from the CPUID instruction, and also determines the exact model of CPU(s). It
5415 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5416 NexGen, Rise, and SiS CPUs.")
5417 (license license:gpl2+)))
5419 (define-public jmtpfs
5426 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5428 (file-name (string-append name "-" version ".tar.gz"))
5431 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5432 (build-system gnu-build-system)
5436 ("libmtp" ,libmtp)))
5438 `(("pkg-config" ,pkg-config)))
5439 (home-page "https://github.com/JasonFerrara/jmtpfs")
5440 (synopsis "Use a FUSE file system to access data over MTP")
5441 (description "jmtpfs uses FUSE (file system in userspace) to provide access
5442 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
5443 the MTP device as a file system.")
5444 (license license:gpl3)))
5446 (define-public procenv
5453 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5455 (file-name (string-append name "-" version ".tar.gz"))
5457 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
5458 (build-system gnu-build-system)
5459 (arguments `(#:configure-flags '("--disable-silent-rules")))
5460 (native-inputs `(("pkg-config" ,pkg-config)))
5461 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5462 ("groff" ,groff) ; for tests
5463 ("libselinux" ,libselinux)))
5464 (synopsis "Utility to show process environment")
5465 (description "Procenv is a command-line tool that displays as much detail about
5466 itself and its environment as possible. It can be used as a test
5467 tool, to understand the type of environment a process runs in, and for
5468 comparing system environments.")
5469 (home-page "http://github.com/jamesodhunt/procenv/")
5470 (license license:gpl3+)))
5472 (define-public libfabric
5480 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5481 version "/libfabric-" version ".tar.bz2"))
5483 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5484 (build-system gnu-build-system)
5485 (inputs `(("rdma-core" ,rdma-core)
5486 ,@(match (%current-system)
5487 ((member (package-supported-systems psm))
5491 (home-page "https://ofiwg.github.io/libfabric/")
5492 (synopsis "Open Fabric Interfaces")
5494 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5495 communication services to applications. OFI is best described as a collection
5496 of libraries and applications used to export fabric services. The key
5497 components of OFI are: application interfaces, provider libraries, kernel
5498 services, daemons, and test applications.
5500 Libfabric is a core component of OFI. It is the library that defines and
5501 exports the user-space API of OFI, and is typically the only software that
5502 applications deal with directly. It works in conjunction with provider
5503 libraries, which are often integrated directly into libfabric.")
5504 (license (list license:bsd-2 license:gpl2)))) ;dual
5509 (version "3.3.20170428")
5510 (home-page "https://github.com/intel/psm")
5514 (uri (git-reference (url home-page)
5515 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5516 (file-name (string-append "psm-" version ".tar.gz"))
5518 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5519 (patches (search-patches
5520 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5521 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5522 "psm-repro.patch")))) ; reproducibility
5523 (build-system gnu-build-system)
5524 (inputs `(("libuuid" ,util-linux)))
5526 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5527 ,(string-append "INSTALL_PREFIX=" %output)
5528 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5530 #:phases (modify-phases %standard-phases
5532 (add-after 'unpack 'patch-/usr/include
5534 (substitute* "Makefile"
5535 (("\\$\\{DESTDIR}/usr/include")
5536 (string-append %output "/include")))
5537 (substitute* "Makefile"
5538 (("/lib64") "/lib"))
5540 (add-after 'unpack 'patch-sysmacros
5542 (substitute* "ipath/ipath_proto.c"
5543 (("#include <sys/poll.h>" m)
5544 (string-append m "\n"
5545 "#include <sys/sysmacros.h>")))
5547 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5549 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5550 communications interface for the True Scale family of products. PSM users are
5551 enabled with mechanisms necessary to implement higher level communications
5552 interfaces in parallel environments.")
5553 ;; Only Intel-compatable processors are supported.
5554 (supported-systems '("i686-linux" "x86_64-linux"))
5555 (license (list license:bsd-2 license:gpl2)))) ;dual
5557 (define-public snapscreenshot
5559 (name "snapscreenshot")
5560 (version "1.0.14.3")
5564 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5565 name "-" version ".tar.bz2"))
5567 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5568 (build-system gnu-build-system)
5571 (let ((out (assoc-ref %outputs "out")))
5572 (list (string-append "BINDIR=" out "/bin")
5573 (string-append "MANDIR=" out "/share/man")))
5574 #:tests? #f ; no test suite
5576 (modify-phases %standard-phases
5577 (delete 'configure) ; ./configure is a snarky no-op
5578 (add-before 'install 'fix-ownership
5579 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5581 (substitute* "depfun.mak"
5582 ((" -o bin -g bin ") " "))
5584 (add-before 'install 'create-output-directories
5585 (lambda* (#:key outputs #:allow-other-keys)
5586 (let ((out (assoc-ref outputs "out")))
5587 (mkdir-p (string-append out "/share/man/man1"))
5589 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
5590 (synopsis "Take screenshots of one or more Linux text consoles")
5592 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
5593 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
5594 relevant @file{/dev/vcs*} file(s).")
5595 (license license:gpl2)))
5597 (define-public fbcat
5604 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
5605 version "/" name "-" version ".tar.gz"))
5607 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
5608 (build-system gnu-build-system)
5610 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
5611 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
5612 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
5613 `(("pnmtopng" ,netpbm)))
5614 (outputs (list "out" "fbgrab"))
5618 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5619 #:tests? #f ; no tests
5621 (modify-phases %standard-phases
5622 (delete 'configure) ; no configure script
5623 (add-after 'build 'qualify-references
5624 (lambda* (#:key inputs outputs #:allow-other-keys)
5625 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5626 (out (assoc-ref outputs "out")))
5627 (substitute* "fbgrab"
5629 (string-append out "/bin/" all))
5631 (string-append pnmtopng "/bin/" all)))
5633 (add-after 'install 'split-fbgrab-output
5634 (lambda* (#:key outputs #:allow-other-keys)
5635 (let* ((out (assoc-ref outputs "out"))
5636 (out:fbgrab (assoc-ref outputs "fbgrab")))
5637 (for-each (lambda (file)
5638 (let ((old (string-append out "/" file))
5639 (new (string-append out:fbgrab "/" file)))
5640 (mkdir-p (dirname new))
5641 (rename-file old new)))
5643 "share/man/man1/fbgrab.1"))
5645 (home-page "https://jwilk.net/software/fbcat")
5646 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
5648 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
5649 a dump therof. It supports a wide range of drivers and pixel formats.
5650 @command{fbcat} can take screenshots of virtually any application that can be
5651 made to write its output to the framebuffer, including (but not limited to)
5652 text-mode or graphical applications that don't use a display server.
5654 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
5655 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
5656 (license license:gpl2)))
5658 (define-public libcgroup
5666 "mirror://sourceforge/libcg/" name "/"
5667 version "/" name "-" version ".tar.bz2"))
5669 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
5670 (build-system gnu-build-system)
5677 `(("linux-pam" ,linux-pam)))
5678 (home-page "https://sourceforge.net/projects/libcg/")
5679 (synopsis "Control groups management tools")
5680 (description "Control groups is Linux kernel method for process resource
5681 restriction, permission handling and more. This package provides userspace
5682 interface to this kernel feature.")
5683 (license license:lgpl2.1)))
5685 (define-public mbpfan
5693 (url "https://github.com/dgraziotin/mbpfan.git")
5694 (commit (string-append "v" version))))
5695 (file-name (git-file-name name version))
5697 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5698 (build-system gnu-build-system)
5700 '(#:tests? #f ; tests ask to be run as root
5701 #:make-flags (let ((out (assoc-ref %outputs "out")))
5702 (list (string-append "DESTDIR=" out)
5705 (modify-phases %standard-phases
5706 (add-after 'unpack 'patch-paths
5708 (substitute* "Makefile"
5711 (delete 'configure)))) ; there's no configure phase
5712 (home-page "https://github.com/dgraziotin/mbpfan")
5713 (synopsis "Control fan speed on Macbooks")
5715 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
5716 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
5717 module. It can be executed as a daemon or in the foreground with root
5719 (license license:gpl3+)))
5728 (url "https://github.com/intel/opa-psm2.git")
5729 (commit (string-append "PSM2_" version))))
5730 (file-name (git-file-name name version))
5733 "0wadphv4rl5p38x6a3dgpbijlzqdvcn02cfafnp72nh9faz0zvlx"))))
5734 (build-system gnu-build-system)
5737 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5739 #:phases (modify-phases %standard-phases
5741 (add-after 'unpack 'patch-Makefiles
5743 (substitute* "Makefile"
5746 (substitute* "compat/Makefile"
5752 (setenv "DESTDIR" %output)
5753 (invoke "make" "install")
5756 `(("rdma-core" ,rdma-core)
5757 ("numactl" ,numactl)))
5758 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
5760 "This package is low-level user-level Intel's communications interface.
5761 The PSM2 API is a high-performance vendor-specific protocol that provides a
5762 low-level communications interface for the Intel Omni-Path family of
5763 high-speed networking devices.")
5764 (home-page "https://github.com/intel/opa-psm2")
5765 ;; Only the x86_64 architecure is supported.
5766 (supported-systems '("x86_64-linux"))
5767 (license (list license:bsd-3 license:gpl2)))) ; dual
5769 (define-public libpfm4
5775 (uri (string-append "mirror://sourceforge/perfmon2/"
5776 name "/libpfm-" version ".tar.gz"))
5779 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
5780 (build-system gnu-build-system)
5782 '(#:modules ((guix build utils)
5783 (guix build gnu-build-system))
5784 #:phases (modify-phases %standard-phases
5788 (lambda* (#:key inputs outputs #:allow-other-keys)
5789 (let* ((out (assoc-ref outputs "out")))
5794 (lambda* (#:key outputs #:allow-other-keys)
5795 (let* ((out (assoc-ref outputs "out")))
5797 (string-append "PREFIX=" out)
5800 (synopsis "Performance event monitoring library")
5802 "This package provides a library called libpfm4, which is used to develop
5803 monitoring tools exploiting the performance monitoring events such as those
5804 provided by the Performance Monitoring Unit (PMU) of modern processors.
5806 Libpfm4 helps convert from an event name, expressed as a string, to the event
5807 encoding that is either the raw event as documented by the hardware vendor or
5808 the OS-specific encoding. In the latter case, the library is able to prepare
5809 the OS-specific data structures needed by the kernel to setup the event.
5811 libpfm4 provides support for the @code{perf_events} interface, which was
5812 introduced in Linux 2.6.31.")
5813 (home-page "http://perfmon2.sourceforge.net/")
5814 (license license:expat)))
5816 (define-public libnfnetlink
5818 (name "libnfnetlink")
5823 "https://www.netfilter.org/projects/libnfnetlink/files/"
5824 "libnfnetlink-" version ".tar.bz2"))
5827 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
5828 (build-system gnu-build-system)
5829 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
5830 (synopsis "Low-level netfilter netlink communication library")
5832 "@code{libnfnetlink} is the low-level library for netfilter related
5833 kernel/userspace communication. It provides a generic messaging
5834 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
5835 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
5836 management tools in userspace.")
5837 (license license:gpl2)))
5839 (define-public go-netlink
5846 (url "https://github.com/vishvananda/netlink.git")
5847 (commit (string-append "v" version))))
5848 (file-name (git-file-name name version))
5851 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
5852 (build-system go-build-system)
5854 `(#:import-path "github.com/vishvananda/netlink"))
5856 `(("go-golang-org-x-sys-unix" ,go-golang-org-x-sys-unix)
5857 ("go-netns" ,go-netns)))
5858 (home-page "https://github.com/vishvananda/netlink")
5859 (synopsis "Simple netlink library for Go")
5860 (description "The netlink package provides a simple netlink library for
5861 Go. Netlink is the interface a user-space program in Linux uses to
5862 communicate with the kernel. It can be used to add and remove interfaces, set
5863 IP addresses and routes, and configure IPsec.")
5864 (license license:asl2.0)))
5866 (define-public xfsprogs
5873 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
5874 "xfsprogs-" version ".tar.gz"))
5877 "0ss0r6jlxxinf9fhpc0fgf7b89n9mzirpa85xxjmi1ix9l6cls6x"))))
5878 (build-system gnu-build-system)
5880 `(#:tests? #f ;kernel/user integration tests are in package "xfstests"
5881 #:phases (modify-phases %standard-phases
5882 (add-after 'install 'install-headers
5884 (invoke "make" "install-dev"))))))
5886 `(("gettext" ,gettext-minimal)
5887 ("util-linux" ,util-linux)))
5888 (home-page "https://xfs.wiki.kernel.org/")
5889 (synopsis "XFS file system tools")
5890 (description "This package provides commands to create and check XFS
5892 ;; The library "libhandle" and the headers in "xfslibs-dev" are
5893 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
5894 (license (list license:gpl2 license:lgpl2.1))))
5896 (define-public genext2fs
5903 (url "https://github.com/jeremie-koenig/genext2fs.git")
5904 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
5905 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
5906 (file-name (git-file-name name version))
5908 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
5909 (build-system gnu-build-system)
5912 (modify-phases %standard-phases
5913 (add-after 'unpack 'apply-debian-patches
5914 ;; Debian changes (the revision after ‘-’ in VERSION) are
5915 ;; maintained as separate patches. Apply those relevant to us.
5919 (invoke "patch" "-p1" "-i"
5920 (string-append "debian/patches/" file-name)))
5921 (list "blocksize+creator.diff" ; add -B/-o options
5922 "byteswap_fix.diff"))
5925 `(("autoconf" ,autoconf)
5926 ("automake" ,automake)))
5927 (home-page "https://github.com/jeremie-koenig/genext2fs")
5928 (synopsis "Generate ext2 file system as a normal user")
5929 (description "This package provides a program to generate an ext2
5930 file system as a normal (non-root) user. It does not require you to mount
5931 the image file to copy files on it, nor does it require that you become
5932 the superuser to make device nodes.")
5933 (license license:gpl2)))
5935 (define-public fakeroot
5941 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
5942 "fakeroot/fakeroot_" version ".orig.tar.gz"))
5943 (file-name (string-append name "-" version ".tar.gz"))
5946 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
5947 (build-system gnu-build-system)
5950 (modify-phases %standard-phases
5951 (add-after 'configure 'patch-Makefile
5953 ;; Note: The root of the problem is already in "Makefile.am".
5954 (substitute* "Makefile"
5955 (("/bin/sh") (which "sh")))
5957 (add-after 'unpack 'patch-getopt
5958 (lambda* (#:key inputs #:allow-other-keys)
5959 (substitute* "scripts/fakeroot.in"
5961 (string-append (assoc-ref inputs "util-linux")
5964 (add-before 'configure 'setenv
5966 (setenv "LIBS" "-lacl")
5968 (add-before 'check 'prepare-check
5970 (setenv "SHELL" (which "bash"))
5971 (setenv "VERBOSE" "1")
5972 (substitute* "test/t.touchinstall"
5973 ;; We don't have the name of the root user, so use ID=0.
5974 (("grep root") "grep \"\\<0\\>\""))
5975 (substitute* "test/tartest"
5976 ;; We don't have the name of the root group, so use ID=0.
5977 (("ROOTGROUP=root") "ROOTGROUP=0")
5978 ;; We don't have the name of the daemon user, so use IDs.
5979 (("daemon:sys") "1:3")
5981 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
5982 (substitute* "test/compare-tar"
5983 (("tar -tvf") "tar --numeric-owner -tvf"))
5987 ("sharutils" ,sharutils) ; for the tests
5988 ("xz" ,xz))) ; for the tests
5990 `(("libcap" ,libcap)
5991 ("util-linux" ,util-linux)))
5992 (synopsis "Provides a fake root environment")
5993 (description "@command{fakeroot} runs a command in an environment where
5994 it appears to have root privileges for file manipulation. This is useful
5995 for allowing users to create archives (tar, ar, .deb etc.) with files in
5996 them with root permissions/ownership. Without fakeroot one would have to
5997 have root privileges to create the constituent files of the archives with
5998 the correct permissions and ownership, and then pack them up, or one would
5999 have to construct the archives directly, without using the archiver.")
6000 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6001 (license license:gpl3+)))
6003 (define-public inputattach
6005 (name "inputattach")
6010 (url "https://github.com/linuxwacom/input-wacom.git")
6011 (commit (string-append "input-wacom-" version))))
6012 (file-name (git-file-name name version))
6014 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6015 (build-system gnu-build-system)
6018 (modify-phases %standard-phases
6022 (lambda* (#:key inputs #:allow-other-keys)
6023 (with-directory-excursion "inputattach"
6024 (invoke (string-append (assoc-ref inputs "gcc")
6026 "-O2" "-o" "inputattach" "inputattach.c"))
6030 (lambda* (#:key outputs #:allow-other-keys)
6031 (let ((target-dir (string-append
6032 (assoc-ref outputs "out")
6034 (mkdir-p target-dir)
6035 (copy-file "inputattach/inputattach"
6036 (string-append target-dir
6039 (home-page "https://linuxwacom.github.io/")
6040 (synopsis "Dispatch input peripherals events to a device file")
6041 (description "inputattach dispatches input events from several device
6042 types and interfaces and translates so that the X server can use them.")
6043 (license license:gpl2+)))
6052 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6054 (file-name (git-file-name name version))
6057 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6058 (build-system gnu-build-system)
6061 (modify-phases %standard-phases
6062 (add-after 'unpack 'fix-dbus-tests
6064 (substitute* '("unit/test-dbus-message-fds.c"
6065 "unit/test-dbus-properties.c"
6067 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6071 ("libtool" ,libtool)))
6073 `(("autoconf" ,autoconf)
6074 ("pkgconfig" ,pkg-config)
6075 ("automake" ,automake)))
6076 (home-page "https://01.org/ell")
6077 (synopsis "Embedded Linux Library")
6078 (description "The Embedded Linux* Library (ELL) provides core, low-level
6079 functionality for system daemons. It typically has no dependencies other than
6080 the Linux kernel, C standard library, and libdl (for dynamic linking). While
6081 ELL is designed to be efficient and compact enough for use on embedded Linux
6082 platforms, it is not limited to resource-constrained systems.")
6083 (license license:lgpl2.1+)))