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>
40 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
42 ;;; This file is part of GNU Guix.
44 ;;; GNU Guix is free software; you can redistribute it and/or modify it
45 ;;; under the terms of the GNU General Public License as published by
46 ;;; the Free Software Foundation; either version 3 of the License, or (at
47 ;;; your option) any later version.
49 ;;; GNU Guix is distributed in the hope that it will be useful, but
50 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
51 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52 ;;; GNU General Public License for more details.
54 ;;; You should have received a copy of the GNU General Public License
55 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
57 (define-module (gnu packages linux)
58 #:use-module (gnu packages)
59 #:use-module (gnu packages acl)
60 #:use-module (gnu packages admin)
61 #:use-module (gnu packages algebra)
62 #:use-module (gnu packages attr)
63 #:use-module (gnu packages audio)
64 #:use-module (gnu packages autotools)
65 #:use-module (gnu packages backup)
66 #:use-module (gnu packages base)
67 #:use-module (gnu packages bash)
68 #:use-module (gnu packages bison)
69 #:use-module (gnu packages calendar)
70 #:use-module (gnu packages check)
71 #:use-module (gnu packages crypto)
72 #:use-module (gnu packages cryptsetup)
73 #:use-module (gnu packages compression)
74 #:use-module (gnu packages dbm)
75 #:use-module (gnu packages datastructures)
76 #:use-module (gnu packages docbook)
77 #:use-module (gnu packages documentation)
78 #:use-module (gnu packages elf)
79 #:use-module (gnu packages flex)
80 #:use-module (gnu packages file)
81 #:use-module (gnu packages freedesktop)
82 #:use-module (gnu packages gcc)
83 #:use-module (gnu packages gettext)
84 #:use-module (gnu packages glib)
85 #:use-module (gnu packages golang)
86 #:use-module (gnu packages gperf)
87 #:use-module (gnu packages gstreamer)
88 #:use-module (gnu packages gtk)
89 #:use-module (gnu packages libunwind)
90 #:use-module (gnu packages libusb)
91 #:use-module (gnu packages man)
92 #:use-module (gnu packages maths)
93 #:use-module (gnu packages multiprecision)
94 #:use-module (gnu packages ncurses)
95 #:use-module (gnu packages netpbm)
96 #:use-module (gnu packages networking)
97 #:use-module (gnu packages ninja)
98 #:use-module (gnu packages nss)
99 #:use-module (gnu packages perl)
100 #:use-module (gnu packages pciutils)
101 #:use-module (gnu packages pkg-config)
102 #:use-module (gnu packages popt)
103 #:use-module (gnu packages pulseaudio)
104 #:use-module (gnu packages python)
105 #:use-module (gnu packages python-xyz)
106 #:use-module (gnu packages readline)
107 #:use-module (gnu packages rrdtool)
108 #:use-module (gnu packages samba)
109 #:use-module (gnu packages sdl)
110 #:use-module (gnu packages serialization)
111 #:use-module (gnu packages slang)
112 #:use-module (gnu packages texinfo)
113 #:use-module (gnu packages tls)
114 #:use-module (gnu packages valgrind)
115 #:use-module (gnu packages video)
116 #:use-module (gnu packages web)
117 #:use-module (gnu packages xiph)
118 #:use-module (gnu packages xml)
119 #:use-module (gnu packages xdisorg)
120 #:use-module (gnu packages xorg)
121 #:use-module (gnu packages groff)
122 #:use-module (gnu packages rsync)
123 #:use-module (gnu packages selinux)
124 #:use-module (gnu packages swig)
125 #:use-module (guix build-system cmake)
126 #:use-module (guix build-system gnu)
127 #:use-module (guix build-system go)
128 #:use-module (guix build-system meson)
129 #:use-module (guix build-system python)
130 #:use-module (guix build-system trivial)
131 #:use-module (guix build-system linux-module)
132 #:use-module (guix download)
133 #:use-module (guix git-download)
134 #:use-module ((guix licenses) #:prefix license:)
135 #:use-module (guix packages)
136 #:use-module (guix gexp)
137 #:use-module (guix store)
138 #:use-module (guix monads)
139 #:use-module (guix utils)
140 #:use-module (srfi srfi-1)
141 #:use-module (srfi srfi-2)
142 #:use-module (srfi srfi-26)
143 #:use-module (ice-9 match))
145 (define-public (system->linux-architecture arch)
146 "Return the Linux architecture name for ARCH, a Guix system name such as
147 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
148 (let ((arch (car (string-split arch #\-))))
149 (cond ((string=? arch "i686") "i386")
150 ((string-prefix? "mips" arch) "mips")
151 ((string-prefix? "arm" arch) "arm")
152 ((string-prefix? "aarch64" arch) "arm64")
153 ((string-prefix? "alpha" arch) "alpha")
154 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
155 ((string-prefix? "s390" arch) "s390")
156 ((string-prefix? "riscv" arch) "riscv")
159 (define-public (system->defconfig system)
160 "Some systems (notably powerpc-linux) require a special target for kernel
161 defconfig. Return the appropriate make target if applicable, otherwise return
163 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
164 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
169 ;;; Kernel source code deblobbing.
172 (define (linux-libre-deblob-scripts version
175 (list (version-major+minor version)
178 (uri (string-append "https://linux-libre.fsfla.org"
179 "/pub/linux-libre/releases/" version "-gnu/"
180 "deblob-" (version-major+minor version)))
181 (sha256 deblob-hash))
184 (uri (string-append "https://linux-libre.fsfla.org"
185 "/pub/linux-libre/releases/" version "-gnu/"
187 (sha256 deblob-check-hash))))
189 (define deblob-scripts-5.4
190 (linux-libre-deblob-scripts
192 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
193 (base32 "09hy3jqb8lny861pxjbjvzg90imi8p7z10j14xp0rclxmyb81rk3")))
195 (define deblob-scripts-4.19
196 (linux-libre-deblob-scripts
198 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
199 (base32 "0xpcl6pd1280gm81bivz45dfhy6v16j0hghxhjynmcbasgnx8vpd")))
201 (define deblob-scripts-4.14
202 (linux-libre-deblob-scripts
204 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
205 (base32 "0yd0c3qxk5rm686j4kd5v4zppjj3k9ivqnv46z4p3xh1gqmhv7cz")))
207 (define deblob-scripts-4.9
208 (linux-libre-deblob-scripts
210 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
211 (base32 "0is8gn4qdd7h5l6lacvhqdch26lmrbgxfm8ab7fx8n85ha7y358w")))
213 (define deblob-scripts-4.4
214 (linux-libre-deblob-scripts
216 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
217 (base32 "12ac4g3ky8yma8sylmxvvysqvd4hnaqjiwmxrxb6wlxggfd7zkbx")))
219 (define* (computed-origin-method gexp-promise hash-algo hash
220 #:optional (name "source")
221 #:key (system (%current-system))
222 (guile (default-guile)))
223 "Return a derivation that executes the G-expression that results
224 from forcing GEXP-PROMISE."
225 (mlet %store-monad ((guile (package->derivation guile system)))
226 (gexp->derivation (or name "computed-origin")
228 #:graft? #f ;nothing to graft
230 #:guile-for-build guile)))
232 (define (make-linux-libre-source version
235 "Return a 'computed' origin that generates a Linux-libre tarball from the
236 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
237 (match deblob-scripts
238 ((deblob-version (? origin? deblob) (? origin? deblob-check))
239 (unless (string=? deblob-version (version-major+minor version))
240 ;; The deblob script cannot be expected to work properly on a
241 ;; different version (major+minor) of Linux, even if no errors
242 ;; are signaled during execution.
243 (error "deblob major+minor version mismatch"))
245 (method computed-origin-method)
246 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
250 (with-imported-modules '((guix build utils))
252 (use-modules (guix build utils)
256 (let ((dir (string-append "linux-" #$version)))
259 (set-path-environment-variable
262 #+(canonical-package bash)
263 #+(canonical-package coreutils)
264 #+(canonical-package diffutils)
265 #+(canonical-package findutils)
266 #+(canonical-package patch)
267 #+(canonical-package xz)
268 #+(canonical-package sed)
269 #+(canonical-package grep)
270 #+(canonical-package bzip2)
271 #+(canonical-package gzip)
272 #+(canonical-package tar)
273 ;; The comments in the 'deblob-check' script
274 ;; claim that it supports Python 2 and 3, but
275 ;; in fact it fails when run in Python 3 as
279 (with-directory-excursion "/tmp/bin"
281 (copy-file #+deblob "deblob")
282 (chmod "deblob" #o755)
283 (substitute* "deblob"
284 (("/bin/sh") (which "sh")))
286 (copy-file #+deblob-check "deblob-check")
287 (chmod "deblob-check" #o755)
288 (substitute* "deblob-check"
289 (("/bin/sh") (which "sh"))
290 (("/bin/sed") (which "sed"))
291 (("/usr/bin/python") (which "python"))))
293 (if (file-is-directory? #+upstream-source)
295 (format #t "Copying upstream linux source...~%")
297 (invoke "cp" "--archive" #+upstream-source dir)
298 (invoke "chmod" "--recursive" "u+w" dir))
300 (format #t "Unpacking upstream linux tarball...~%")
302 (invoke "tar" "xf" #$upstream-source)
305 (and (not (member name '("." "..")))
306 (file-is-directory? name))))
308 (unless (string=? dir unpacked-dir)
309 (rename-file unpacked-dir dir)))
311 (error "multiple directories found" dirs)))))
313 (with-directory-excursion dir
314 (setenv "PYTHON" (which "python"))
315 (format #t "Running deblob script...~%")
317 (invoke "/tmp/bin/deblob"))
319 (format #t "~%Packing new Linux-libre tarball...~%")
321 (invoke "tar" "cvfa" #$output
322 ;; Avoid non-determinism in the archive.
335 (define (linux-libre-urls version)
336 "Return a list of URLs for Linux-Libre VERSION."
338 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
339 version "-gnu/linux-libre-" version "-gnu.tar.xz")
341 ;; XXX: Work around <http://bugs.gnu.org/14851>.
343 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
344 version "-gnu.tar.xz")
346 ;; Maybe this URL will become valid eventually.
348 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
349 version "-gnu.tar.xz")))
351 (define (%upstream-linux-source version hash)
354 (uri (string-append "mirror://kernel.org"
355 "/linux/kernel/v" (version-major version) ".x/"
356 "linux-" version ".tar.xz"))
359 (define-public linux-libre-5.4-version "5.4.6")
360 (define-public linux-libre-5.4-pristine-source
361 (let ((version linux-libre-5.4-version)
362 (hash (base32 "1j4916izy2nrzq7g6m5m365r60hhhx9rqcanjvaxv5x3vsy639gx")))
363 (make-linux-libre-source version
364 (%upstream-linux-source version hash)
365 deblob-scripts-5.4)))
367 (define-public linux-libre-4.19-version "4.19.91")
368 (define-public linux-libre-4.19-pristine-source
369 (let ((version linux-libre-4.19-version)
370 (hash (base32 "0irl5jlh5rrdfz5g28x4ifbillvspwd8fy4wi3qhmv9dw7gc60zl")))
371 (make-linux-libre-source version
372 (%upstream-linux-source version hash)
373 deblob-scripts-4.19)))
375 (define-public linux-libre-4.14-version "4.14.160")
376 (define-public linux-libre-4.14-pristine-source
377 (let ((version linux-libre-4.14-version)
378 (hash (base32 "0b59xyr8if0qcbnwqa88y275g9rzhjbbp8589i8xxpmws6x2c0y6")))
379 (make-linux-libre-source version
380 (%upstream-linux-source version hash)
381 deblob-scripts-4.14)))
383 (define-public linux-libre-4.9-version "4.9.207")
384 (define-public linux-libre-4.9-pristine-source
385 (let ((version linux-libre-4.9-version)
386 (hash (base32 "090181vij95py22jhx7baaxabb78w0j5hsfsnzp6bv2vgdz671na")))
387 (make-linux-libre-source version
388 (%upstream-linux-source version hash)
389 deblob-scripts-4.9)))
391 (define-public linux-libre-4.4-version "4.4.207")
392 (define-public linux-libre-4.4-pristine-source
393 (let ((version linux-libre-4.4-version)
394 (hash (base32 "024flajnl3l4yk8sgqdrfrl21js4vsjcv4ivmjblj4l9fl3hdjb6")))
395 (make-linux-libre-source version
396 (%upstream-linux-source version hash)
397 deblob-scripts-4.4)))
399 (define %boot-logo-patch
400 ;; Linux-Libre boot logo featuring Freedo and a gnu.
403 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
404 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
407 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
409 (define %linux-libre-arm-export-__sync_icache_dcache-patch
413 "https://salsa.debian.org/kernel-team/linux"
414 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
415 "/debian/patches/bugfix/arm/"
416 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
417 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
419 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
421 (define (source-with-patches source patches)
424 (patches (append (origin-patches source)
427 (define-public linux-libre-5.4-source
428 (source-with-patches linux-libre-5.4-pristine-source
429 (list %boot-logo-patch
430 %linux-libre-arm-export-__sync_icache_dcache-patch)))
432 (define-public linux-libre-4.19-source
433 (source-with-patches linux-libre-4.19-pristine-source
434 (list %boot-logo-patch
435 %linux-libre-arm-export-__sync_icache_dcache-patch)))
437 (define-public linux-libre-4.14-source
438 (source-with-patches linux-libre-4.14-pristine-source
439 (list %boot-logo-patch)))
441 (define-public linux-libre-4.9-source
442 (source-with-patches linux-libre-4.9-pristine-source
443 (list %boot-logo-patch)))
445 (define-public linux-libre-4.4-source
446 (source-with-patches linux-libre-4.4-pristine-source
447 (list %boot-logo-patch)))
454 (define (make-linux-libre-headers version hash-string)
455 (make-linux-libre-headers* version
458 (uri (linux-libre-urls version))
459 (sha256 (base32 hash-string)))))
461 (define (make-linux-libre-headers* version source)
463 (name "linux-libre-headers")
466 (build-system gnu-build-system)
467 (native-inputs `(("perl" ,perl)
468 ,@(if (version>=? version "4.16")
472 ,@(if (version>=? version "5.3")
476 `(#:modules ((guix build gnu-build-system)
480 (modify-phases %standard-phases
484 (let ((arch ,(system->linux-architecture
485 (or (%current-target-system)
487 (defconfig ,(system->defconfig
488 (or (%current-target-system)
489 (%current-system)))))
491 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
492 (invoke "make" defconfig)
493 (invoke "make" "mrproper" "headers_check"))))
495 (lambda* (#:key outputs #:allow-other-keys)
496 (let ((out (assoc-ref outputs "out")))
498 (string-append "INSTALL_HDR_PATH=" out)
501 (mkdir (string-append out "/include/config"))
502 (call-with-output-file
504 "/include/config/kernel.release")
506 (format p "~a-default~%" ,version)))
508 ;; Remove the '.install' and '..install.cmd' files; the
509 ;; latter contains store paths, which pulls in bootstrap
510 ;; binaries in the build environment, and prevents bit
511 ;; reproducibility for the bootstrap binaries.
512 (for-each delete-file (find-files out "\\.install"))
515 #:allowed-references ()
517 (home-page "https://www.gnu.org/software/linux-libre/")
518 (synopsis "GNU Linux-Libre kernel headers")
519 (description "Headers of the Linux-Libre kernel.")
520 (license license:gpl2)))
522 (define-public linux-libre-headers-5.4
523 (make-linux-libre-headers* linux-libre-5.4-version
524 linux-libre-5.4-source))
526 (define-public linux-libre-headers-4.19
527 (make-linux-libre-headers* linux-libre-4.19-version
528 linux-libre-4.19-source))
530 (define-public linux-libre-headers-4.14
531 (make-linux-libre-headers* linux-libre-4.14-version
532 linux-libre-4.14-source))
534 (define-public linux-libre-headers-4.9
535 (make-linux-libre-headers* linux-libre-4.9-version
536 linux-libre-4.9-source))
538 (define-public linux-libre-headers-4.4
539 (make-linux-libre-headers* linux-libre-4.4-version
540 linux-libre-4.4-source))
542 ;; The following package is used in the early bootstrap, and thus must be kept
543 ;; stable and with minimal build requirements.
544 (define-public linux-libre-headers-4.19.56
545 (make-linux-libre-headers "4.19.56"
546 "1zqiic55viy065lhnkmhn33sz3bbbr2ykbm5f92yzd8lpc9zl7yx"))
548 (define-public linux-libre-headers linux-libre-headers-4.19.56)
552 ;;; Kernel configurations.
555 (define* (kernel-config arch #:key variant)
556 "Return the absolute file name of the Linux-Libre build configuration file
557 for ARCH and optionally VARIANT, or #f if there is no such configuration."
558 (let* ((name (string-append (if variant (string-append variant "-") "")
559 (if (string=? "i386" arch) "i686" arch) ".conf"))
560 (file (string-append "linux-libre/" name)))
561 (search-auxiliary-file file)))
563 ;; FIXME: merge into kernel-config
564 (define* (kernel-config-veyron arch #:key variant)
565 "Return the absolute file name of the Linux-Libre build configuration file
566 for ARCH and optionally VARIANT, or #f if there is no such configuration."
567 (let* ((name (string-append (if variant (string-append variant "-") "")
568 (if (string=? "i386" arch) "i686" arch) "-veyron.conf"))
569 (file (string-append "linux-libre/" name)))
570 (search-auxiliary-file file)))
572 (define %default-extra-linux-options
573 `(;; Some very mild hardening.
574 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
575 ;; All kernels should have NAMESPACES options enabled
576 ("CONFIG_NAMESPACES" . #t)
577 ("CONFIG_UTS_NS" . #t)
578 ("CONFIG_IPC_NS" . #t)
579 ("CONFIG_USER_NS" . #t)
580 ("CONFIG_PID_NS" . #t)
581 ("CONFIG_NET_NS" . #t)
582 ;; Modules required for initrd:
583 ("CONFIG_NET_9P" . m)
584 ("CONFIG_NET_9P_VIRTIO" . m)
585 ("CONFIG_VIRTIO_BLK" . m)
586 ("CONFIG_VIRTIO_NET" . m)
587 ("CONFIG_VIRTIO_PCI" . m)
588 ("CONFIG_VIRTIO_BALLOON" . m)
589 ("CONFIG_VIRTIO_MMIO" . m)
590 ("CONFIG_FUSE_FS" . m)
592 ("CONFIG_9P_FS" . m)))
594 (define (config->string options)
595 (string-join (map (match-lambda
597 (string-append option "=m"))
599 (string-append option "=y"))
601 (string-append option "=n")))
607 ;;; Kernel package utilities.
610 (define* (make-linux-libre version hash-string supported-systems
612 ;; A function that takes an arch and a variant.
613 ;; See kernel-config for an example.
615 (configuration-file #f)
616 (defconfig "defconfig")
617 (extra-options %default-extra-linux-options)
618 (patches (list %boot-logo-patch)))
619 (make-linux-libre* version
622 (uri (linux-libre-urls version))
623 (sha256 (base32 hash-string))
626 #:extra-version extra-version
627 #:configuration-file configuration-file
628 #:defconfig defconfig
629 #:extra-options extra-options))
631 (define* (make-linux-libre* version source supported-systems
633 ;; A function that takes an arch and a variant.
634 ;; See kernel-config for an example.
636 (configuration-file #f)
637 (defconfig "defconfig")
638 (extra-options %default-extra-linux-options))
640 (name (if extra-version
641 (string-append "linux-libre-" extra-version)
645 (supported-systems supported-systems)
646 (build-system gnu-build-system)
652 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
656 ;; These are needed to compile the GCC plugins.
661 ,@(match (and configuration-file
663 (system->linux-architecture
664 (or (%current-target-system) (%current-system)))
665 #:variant (version-major+minor version)))
666 (#f ;no config for this platform
669 `(("kconfig" ,config))))))
671 `(#:modules ((guix build gnu-build-system)
677 (modify-phases %standard-phases
678 (add-after 'unpack 'patch-/bin/pwd
680 (substitute* (find-files "." "^Makefile(\\.include)?$")
681 (("/bin/pwd") "pwd"))
684 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
685 ;; On AArch64 (at least), we need to remove glibc headers from
686 ;; CPATH (they are still available as "system headers"), so that
687 ;; the kernel can override uint64_t. See
688 ;; <https://bugs.gnu.org/37593>. This is also true when
689 ;; cross-compiling, except in that case, cross-libc must be
690 ;; removed from CROSS_CPATH.
691 (let ((var ,(if (%current-target-system)
694 (libc ,(if (%current-target-system)
700 (cut string-prefix? (assoc-ref inputs libc) <>)
701 (string-split (getenv var) #\:))
703 (format #t "environment variable `~a' changed to `~a'~%"
706 ;; Avoid introducing timestamps
707 (setenv "KCONFIG_NOTIMESTAMP" "1")
708 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
710 ;; Set ARCH and CROSS_COMPILE
711 (let ((arch ,(system->linux-architecture
712 (or (%current-target-system)
713 (%current-system)))))
715 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
718 (setenv "CROSS_COMPILE" (string-append target "-"))
719 (format #t "`CROSS_COMPILE' set to `~a'~%"
720 (getenv "CROSS_COMPILE"))))
722 (setenv "EXTRA_VERSION" ,extra-version)
724 (let ((build (assoc-ref %standard-phases 'build))
725 (config (assoc-ref (or native-inputs inputs) "kconfig")))
727 ;; Use a custom kernel configuration file or a default
728 ;; configuration file.
731 (copy-file config ".config")
732 (chmod ".config" #o666))
733 (invoke "make" ,defconfig))
735 ;; Appending works even when the option wasn't in the
736 ;; file. The last one prevails if duplicated.
737 (let ((port (open-file ".config" "a"))
738 (extra-configuration ,(config->string extra-options)))
739 (display extra-configuration port)
742 (invoke "make" "oldconfig"))))
744 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
745 (let* ((out (assoc-ref outputs "out"))
746 (moddir (string-append out "/lib/modules"))
747 (dtbdir (string-append out "/lib/dtbs"))
748 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
749 ;; Install kernel image, kernel configuration and link map.
750 (for-each (lambda (file) (install-file file out))
751 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
752 ;; Install device tree files
753 (unless (null? (find-files "." "\\.dtb$"))
755 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
757 ;; Install kernel modules
760 (string-append "DEPMOD=" kmod "/bin/depmod")
761 (string-append "MODULE_DIR=" moddir)
762 (string-append "INSTALL_PATH=" out)
763 (string-append "INSTALL_MOD_PATH=" out)
764 "INSTALL_MOD_STRIP=1"
765 "modules_install")))))
767 (home-page "https://www.gnu.org/software/linux-libre/")
768 (synopsis "100% free redistribution of a cleaned Linux kernel")
770 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
771 It has been modified to remove all non-free binary blobs.")
772 (license license:gpl2)))
776 ;;; Generic kernel packages.
779 (define-public linux-libre-5.4
780 (make-linux-libre* linux-libre-5.4-version
781 linux-libre-5.4-source
782 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
783 #:configuration-file kernel-config))
785 (define-public linux-libre-version linux-libre-5.4-version)
786 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
787 (define-public linux-libre-source linux-libre-5.4-source)
788 (define-public linux-libre linux-libre-5.4)
790 (define-public linux-libre-4.19
791 (make-linux-libre* linux-libre-4.19-version
792 linux-libre-4.19-source
793 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
794 #:configuration-file kernel-config))
796 (define-public linux-libre-4.14
797 (make-linux-libre* linux-libre-4.14-version
798 linux-libre-4.14-source
799 '("x86_64-linux" "i686-linux" "armhf-linux")
800 #:configuration-file kernel-config))
802 (define-public linux-libre-4.9
803 (make-linux-libre* linux-libre-4.9-version
804 linux-libre-4.9-source
805 '("x86_64-linux" "i686-linux")
806 #:configuration-file kernel-config))
808 (define-public linux-libre-4.4
809 (make-linux-libre* linux-libre-4.4-version
810 linux-libre-4.4-source
811 '("x86_64-linux" "i686-linux")
812 #:configuration-file kernel-config
815 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
816 ;; This option was removed upstream in version 4.7.
817 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
818 %default-extra-linux-options)))
822 ;;; Specialized kernel variants.
825 (define-public linux-libre-arm-veyron
826 (make-linux-libre* linux-libre-version
829 #:configuration-file kernel-config-veyron
830 #:extra-version "arm-veyron"))
832 (define-public linux-libre-arm-generic
833 (make-linux-libre* linux-libre-version
836 #:defconfig "multi_v7_defconfig"
837 #:extra-version "arm-generic"))
839 (define-public linux-libre-arm-generic-4.19
840 (make-linux-libre* linux-libre-4.19-version
841 linux-libre-4.19-source
843 #:defconfig "multi_v7_defconfig"
844 #:extra-version "arm-generic"))
846 (define-public linux-libre-arm-generic-4.14
847 (make-linux-libre* linux-libre-4.14-version
848 linux-libre-4.14-source
850 #:defconfig "multi_v7_defconfig"
851 #:extra-version "arm-generic"))
853 (define-public linux-libre-arm-omap2plus
854 (make-linux-libre* linux-libre-version
857 #:defconfig "omap2plus_defconfig"
858 #:extra-version "arm-omap2plus"))
860 (define-public linux-libre-arm-omap2plus-4.19
861 (make-linux-libre* linux-libre-4.19-version
862 linux-libre-4.19-source
864 #:defconfig "omap2plus_defconfig"
865 #:extra-version "arm-omap2plus"))
867 (define-public linux-libre-arm-omap2plus-4.14
868 (make-linux-libre* linux-libre-4.14-version
869 linux-libre-4.14-source
871 #:defconfig "omap2plus_defconfig"
872 #:extra-version "arm-omap2plus"))
876 ;;; Linux kernel modules.
879 (define-public acpi-call-linux-module
881 (name "acpi-call-linux-module")
887 (url "https://github.com/teleshoes/acpi_call.git")
889 (file-name (git-file-name name version))
891 (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
892 (build-system linux-module-build-system)
894 `(#:tests? #f ; no tests
896 (modify-phases %standard-phases
897 (add-after 'unpack 'fix-for-linux-4.12
899 (substitute* "acpi_call.c"
903 (add-after 'install 'install-documentation
904 (lambda* (#:key outputs #:allow-other-keys)
905 (let* ((out (assoc-ref outputs "out"))
906 (doc (string-append out "/share/doc/" ,name "-" ,version)))
907 (for-each (lambda (file)
908 (let ((target (string-append doc "/" file)))
909 (mkdir-p (dirname target))
910 (copy-recursively file target)))
911 (list "README.md" "examples"))
913 (home-page "https://github.com/teleshoes/acpi_call")
914 (synopsis "Linux kernel module to perform ACPI method calls")
916 "This simple Linux kernel module allows calls from user space to any
917 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
918 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
919 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
920 and @code{ACPI_BUFFER}.
922 It grants direct and undocumented access to your hardware that may cause damage
923 and should be used with caution, especially on untested models.")
924 (license license:gpl3+))) ; see README.md (no licence headers)
926 (define-public vhba-module
933 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
937 "1ybbk6l06n0y11n5wnfmvdz0baizmq55l458ywimghdyz0n7g0ws"))))
938 (build-system linux-module-build-system)
942 (home-page "https://cdemu.sourceforge.io/")
943 (synopsis "Kernel module that emulates SCSI devices")
944 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
945 between the CDemu userspace daemon and linux kernel.")
946 (license license:gpl2+)))
948 (define-public ddcci-driver-linux
950 (name "ddcci-driver-linux")
957 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
958 (commit (string-append "v" version))))
959 (file-name (git-file-name name version))
962 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
963 (build-system linux-module-build-system)
965 `(#:tests? #f ; no tests
967 (modify-phases %standard-phases
972 (with-directory-excursion module
973 (apply (assoc-ref %standard-phases 'build) args)))
974 '("ddcci" "ddcci-backlight"))
980 (with-directory-excursion module
981 (apply (assoc-ref %standard-phases 'install) args)))
982 '("ddcci" "ddcci-backlight"))
984 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
985 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
986 (description "This package provides two Linux kernel drivers, ddcci and
987 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
988 interface. The ddcci module creates a character device for each DDC/CI
989 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
990 module allows the control of the backlight level or luminance property when
991 supported under @file{/sys/class/backlight/}.")
992 (license license:gpl2+)))
996 ;;; Pluggable authentication modules (PAM).
999 (define-public linux-pam
1007 "https://github.com/linux-pam/linux-pam/releases/download/v"
1008 version "/Linux-PAM-" version ".tar.xz"))
1011 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1012 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1014 (build-system gnu-build-system)
1018 ;; TODO: optional dependencies
1019 ;; ("libxcrypt" ,libxcrypt)
1020 ;; ("cracklib" ,cracklib)
1023 `(;; Most users, such as `shadow', expect the headers to be under
1025 #:configure-flags (list (string-append "--includedir="
1026 (assoc-ref %outputs "out")
1027 "/include/security")
1029 ;; XXX: <rpc/rpc.h> is missing from glibc when
1030 ;; cross-compiling, so we have to disable NIS
1031 ;; support altogether.
1032 ,@(if (%current-target-system)
1036 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1039 (home-page "http://www.linux-pam.org/")
1040 (synopsis "Pluggable authentication modules for Linux")
1042 "A *Free* project to implement OSF's RFC 86.0.
1043 Pluggable authentication modules are small shared object files that can
1044 be used through the PAM API to perform tasks, like authenticating a user
1045 at login. Local and dynamic reconfiguration are its key features.")
1046 (license license:bsd-3)))
1048 (define-public linux-pam-1.2
1056 "http://www.linux-pam.org/library/"
1057 "Linux-PAM-" version ".tar.bz2"))
1060 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1061 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1068 (define-public psmisc
1075 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1078 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1079 (build-system gnu-build-system)
1081 `(,@(if (%current-target-system)
1084 "ac_cv_func_malloc_0_nonnull=yes"
1085 "ac_cv_func_realloc_0_nonnull=yes"))
1087 (inputs `(("ncurses" ,ncurses)))
1088 (home-page "https://gitlab.com/psmisc/psmisc")
1089 (synopsis "Small utilities that use the proc file system")
1091 "This PSmisc package is a set of some small useful utilities that
1092 use the proc file system. We're not about changing the world, but
1093 providing the system administrator with some help in common tasks.")
1094 (license license:gpl2+)))
1096 (define-public util-linux
1102 (uri (string-append "mirror://kernel.org/linux/utils/"
1103 "util-linux/v" (version-major+minor version) "/"
1104 "util-linux-" version ".tar.xz"))
1107 "1db2kydkwjmvgd1glkcba3adhidxw0f1x735dcjdpdjjf869sgvl"))
1108 (patches (search-patches "util-linux-tests.patch"))
1109 (modules '((guix build utils)))
1111 ;; We take 'nologin' from Shadow, the 'logger' program from
1112 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1114 (substitute* "configure"
1115 (("build_nologin=yes") "build_nologin=no")
1116 (("build_logger=yes") "build_logger=no")
1117 (("build_kill=yes") "build_kill=no"))
1119 (build-system gnu-build-system)
1121 "static")) ;>2 MiB of static .a libraries
1123 `(#:configure-flags (list "--disable-use-tty-group"
1124 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1125 ;; Don't try to chown root:root mount and umount
1126 "--disable-makeinstall-chown"
1127 ;; Install completions where our
1128 ;; bash-completion package expects them.
1129 (string-append "--with-bashcompletiondir="
1130 (assoc-ref %outputs "out")
1131 "/etc/bash_completion.d"))
1132 #:phases (modify-phases %standard-phases
1133 (add-before 'build 'set-umount-file-name
1134 (lambda* (#:key outputs #:allow-other-keys)
1135 ;; Tell 'eject' the right file name of 'umount'.
1136 (let ((out (assoc-ref outputs "out")))
1137 (substitute* "sys-utils/eject.c"
1138 (("\"/bin/umount\"")
1139 (string-append "\"" out "/bin/umount\"")))
1141 (add-before 'check 'pre-check
1142 (lambda* (#:key inputs outputs #:allow-other-keys)
1143 (let ((out (assoc-ref outputs "out"))
1144 (net (assoc-ref inputs "net-base")))
1145 ;; Change the test to refer to the right file.
1146 (substitute* "tests/ts/misc/mcookie"
1148 (string-append net "/etc/services")))
1150 (add-after 'install 'move-static-libraries
1151 (lambda* (#:key outputs #:allow-other-keys)
1152 (let ((out (assoc-ref outputs "out"))
1153 (static (assoc-ref outputs "static")))
1154 (mkdir-p (string-append static "/lib"))
1155 (with-directory-excursion out
1156 (for-each (lambda (file)
1158 (string-append static "/"
1160 (find-files "lib" "\\.a$"))
1162 ;; Remove references to the static library from the '.la'
1163 ;; files so that Libtool does the right thing when both
1164 ;; the shared and static library is available.
1165 (substitute* (find-files "lib" "\\.la$")
1166 (("old_library=.*") "old_library=''\n")))
1169 (inputs `(("zlib" ,zlib)
1170 ("ncurses" ,ncurses)
1172 ;; XXX: This is so that the 'pre-check' phase can find it.
1173 ,@(if (%current-target-system)
1174 `(("net-base" ,net-base))
1178 ("net-base" ,net-base))) ;for tests
1179 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1180 (synopsis "Collection of utilities for the Linux kernel")
1181 (description "Util-linux is a diverse collection of Linux kernel
1182 utilities. It provides dmesg and includes tools for working with file systems,
1183 block devices, UUIDs, TTYs, and many other tools.")
1185 ;; Note that util-linux doesn't use the same license for all the
1186 ;; code. GPLv2+ is the default license for a code without an
1187 ;; explicitly defined license.
1188 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1189 license:bsd-4 license:public-domain))))
1191 (define-public ddate
1197 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1199 (file-name (string-append name "-" version ".tar.gz"))
1201 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1202 (build-system cmake-build-system)
1203 (arguments '(#:tests? #f))
1204 (home-page "https://github.com/bo0ts/ddate")
1205 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1207 "ddate displays the Discordian date and holidays of a given date.
1208 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1209 by Robert Shea and Robert Anton Wilson.")
1210 (license license:public-domain)))
1212 (define-public procps
1218 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1219 "procps-ng-" version ".tar.xz"))
1222 "0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
1223 (build-system gnu-build-system)
1225 '(#:modules ((guix build utils)
1226 (guix build gnu-build-system)
1230 (modify-phases %standard-phases
1232 'install 'post-install
1233 ;; Remove commands and man pages redudant with
1235 (lambda* (#:key outputs #:allow-other-keys)
1236 (let* ((out (assoc-ref outputs "out"))
1237 (dup (append-map (cut find-files out <>)
1238 '("^kill" "^uptime"))))
1239 (for-each delete-file dup)
1241 (inputs `(("ncurses" ,ncurses)))
1242 (home-page "https://gitlab.com/procps-ng/procps/")
1243 (synopsis "Utilities that give information about processes")
1245 "Procps is the package that has a bunch of small useful utilities
1246 that give information about processes using the Linux /proc file system.
1247 The package includes the programs ps, top, vmstat, w, kill, free,
1248 slabtop, and skill.")
1249 (license license:gpl2)))
1251 (define-public usbutils
1258 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1259 "usbutils-" version ".tar.xz"))
1261 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1262 (build-system gnu-build-system)
1263 (outputs (list "out" "python"))
1266 (modify-phases %standard-phases
1267 (add-before 'bootstrap 'patch-bootstrap-scripts
1269 (substitute* "usbhid-dump/bootstrap"
1270 (("/bin/bash") (which "bash")))
1272 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1273 (substitute* "autogen.sh"
1274 (("^\\./configure.*") ""))
1276 (add-after 'install 'separate-python-output
1277 ;; Separating one Python script shaves more than 106 MiB from :out.
1278 (lambda* (#:key outputs #:allow-other-keys)
1279 (let ((out (assoc-ref outputs "out"))
1280 (out:python (assoc-ref outputs "python")))
1281 (for-each (lambda (file)
1282 (let ((old (string-append out "/" file))
1283 (new (string-append out:python "/" file)))
1284 (mkdir-p (dirname new))
1285 (rename-file old new)))
1286 (list "bin/lsusb.py"))
1291 ("python" ,python)))
1293 `(("autoconf" ,autoconf)
1294 ("automake" ,automake)
1295 ("libtool" ,libtool)
1296 ("pkg-config" ,pkg-config)))
1297 (home-page "http://www.linux-usb.org/")
1299 "Tools for working with USB devices, such as lsusb")
1301 "Tools for working with USB devices, such as lsusb.")
1302 (license license:gpl2+)))
1304 (define-public e2fsprogs
1311 "mirror://kernel.org/linux/kernel/people/tytso/"
1312 name "/v" version "/"
1313 name "-" version ".tar.xz"))
1316 "00nwl1ppjalxbnx40dsm895r3q793p8nni6n81saj7faj2szdyk5"))))
1317 (build-system gnu-build-system)
1318 (inputs `(("util-linux" ,util-linux)))
1319 (native-inputs `(("pkg-config" ,pkg-config)
1320 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1324 ("procps" ,procps)))
1326 '(;; util-linux is the preferred source for some of the libraries and
1327 ;; commands, so disable them (see, e.g.,
1328 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1329 #:configure-flags (list "--disable-libblkid"
1330 "--disable-libuuid" "--disable-uuidd"
1333 ;; Use symlinks instead of hard links for
1334 ;; 'fsck.extN' etc. This makes the resulting nar
1335 ;; smaller and is preserved across copies.
1336 "--enable-symlink-install"
1338 (string-append "LDFLAGS=-Wl,-rpath="
1339 (assoc-ref %outputs "out")
1342 ;; Install libext2fs et al.
1343 "--enable-elf-shlibs")
1346 (modify-phases %standard-phases
1347 (add-before 'configure 'patch-shells
1349 (substitute* "configure"
1350 (("/bin/sh (.*)parse-types.sh" _ dir)
1351 (string-append (which "sh") " " dir
1353 (substitute* "MCONFIG.in"
1354 (("INSTALL_SYMLINK = /bin/sh")
1355 "INSTALL_SYMLINK = sh"))
1356 (substitute* (find-files "." "^Makefile.in$")
1358 (string-append "#!" (which "sh"))))
1360 (add-after 'install 'install-libs
1361 (lambda* (#:key outputs #:allow-other-keys)
1362 (let* ((out (assoc-ref outputs "out"))
1363 (lib (string-append out "/lib")))
1364 (invoke "make" "install-libs")
1366 ;; Make the .a writable so that 'strip' works.
1367 ;; Failing to do that, due to debug symbols, we
1368 ;; retain a reference to the final
1369 ;; linux-libre-headers, which refer to the
1370 ;; bootstrap binaries.
1371 (let ((archives (find-files lib "\\.a$")))
1372 (for-each (lambda (file)
1376 (home-page "http://e2fsprogs.sourceforge.net/")
1377 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1379 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1380 (license (list license:gpl2 ;programs
1381 license:lgpl2.0 ;libext2fs
1382 license:x11)))) ;libuuid
1384 (define e2fsprogs/static
1386 (package (inherit e2fsprogs)
1388 ;; Do not build shared libraries.
1389 (substitute-keyword-arguments (package-arguments e2fsprogs)
1390 ((#:configure-flags _)
1391 '(list "--disable-blkid"))
1395 (define-public e2fsck/static
1397 (name "e2fsck-static")
1398 (version (package-version e2fsprogs))
1399 (build-system trivial-build-system)
1402 `(("e2fsprogs" ,e2fsprogs/static)))
1404 `(#:modules ((guix build utils))
1407 (use-modules (guix build utils)
1411 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1413 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1415 (with-directory-excursion bin
1416 (copy-file e2fsck "e2fsck")
1417 (remove-store-references "e2fsck")
1418 (chmod "e2fsck" #o555))
1420 (home-page (package-home-page e2fsprogs))
1421 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1422 (description "This package provides statically-linked e2fsck command taken
1423 from the e2fsprogs package. It is meant to be used in initrds.")
1424 (license (package-license e2fsprogs))))
1426 (define-public extundelete
1428 (name "extundelete")
1433 (uri (string-append "mirror://sourceforge/extundelete/"
1434 "extundelete/" version "/extundelete-"
1435 version ".tar.bz2"))
1438 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1439 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1440 (build-system gnu-build-system)
1441 (inputs `(("e2fsprogs" ,e2fsprogs)))
1442 (home-page "http://extundelete.sourceforge.net/")
1443 (synopsis "Recover deleted files from ext2/3/4 partitions")
1445 "Extundelete is a set of tools that can recover deleted files from an
1446 ext3 or ext4 partition.")
1447 (license license:gpl2)))
1449 (define-public zerofree
1453 (home-page "https://frippery.org/uml/")
1456 (uri (string-append home-page name "-" version
1460 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1461 (build-system gnu-build-system)
1464 (modify-phases %standard-phases
1465 (delete 'configure) ; no configure script
1467 ;; The Makefile lacks an ‘install’ target.
1468 (lambda* (#:key outputs #:allow-other-keys)
1469 (let* ((out (assoc-ref outputs "out"))
1470 (bin (string-append out "/bin")))
1471 (chmod "zerofree" #o555)
1472 (install-file "zerofree" bin)
1474 #:tests? #f)) ; no tests
1475 (inputs `(("libext2fs" ,e2fsprogs)))
1476 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1478 "Zerofree finds the unallocated blocks with non-zero value content in an
1479 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1480 This is a simple way to make disk images more compressible.
1481 Zerofree requires the file system to be unmounted or mounted read-only.")
1482 (license license:gpl2)))
1484 (define-public strace
1488 (home-page "https://strace.io")
1491 (uri (string-append home-page "/files/" version
1492 "/strace-" version ".tar.xz"))
1495 "0hd7sb7l99y9rcj8jjc1b6m3ryds17krsymdg3dvd40jsla0bl7p"))))
1496 (build-system gnu-build-system)
1499 (modify-phases %standard-phases
1500 (add-after 'unpack 'patch-/bin/sh
1502 (substitute* "strace.c"
1503 (("/bin/sh") (which "sh")))
1505 ;; Don't fail if the architecture doesn't support different personalities.
1506 #:configure-flags '("--enable-mpers=check")
1507 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1508 #:parallel-tests? #f)) ; undeterministic failures
1509 (native-inputs `(("perl" ,perl)))
1510 (synopsis "System call tracer for Linux")
1512 "strace is a system call tracer, i.e. a debugging tool which prints out a
1513 trace of all the system calls made by a another process/program.")
1514 (license license:lgpl2.1+)))
1516 (define-public ltrace
1522 (uri (string-append "http://www.ltrace.org/ltrace_" version
1526 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1527 (build-system gnu-build-system)
1528 (inputs `(("libelf" ,libelf)))
1530 ;; Compilation uses -Werror by default, but it fails.
1531 '(#:configure-flags '("--disable-werror")))
1532 (home-page "https://www.ltrace.org/")
1533 (synopsis "Library call tracer for Linux")
1535 "ltrace intercepts and records dynamic library calls which are called by
1536 an executed process and the signals received by that process. It can also
1537 intercept and print the system calls executed by the program.")
1538 (license license:gpl2+)))
1540 (define-public alsa-lib
1547 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1548 version ".tar.bz2"))
1551 "0jwr9g4yxg9gj6xx0sb2r6wrdl8amrjd19hilkrq4rirynp770s8"))))
1552 (build-system gnu-build-system)
1553 (home-page "https://www.alsa-project.org/")
1554 (synopsis "The Advanced Linux Sound Architecture libraries")
1556 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1557 MIDI functionality to the Linux-based operating system.")
1558 (license license:lgpl2.1+)))
1560 (define-public alsa-utils
1566 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1567 name "-" version ".tar.bz2"))
1570 "0fi11b7r8hg1bdjw74s8sqx8rc4qb310jaj9lsia9labvfyjrpsx"))))
1571 (build-system gnu-build-system)
1573 ;; XXX: Disable man page creation until we have DocBook.
1574 '(#:configure-flags (list "--disable-xmlto"
1576 ;; The udev rule is responsible for restoring
1578 (string-append "--with-udev-rules-dir="
1579 (assoc-ref %outputs "out")
1580 "/lib/udev/rules.d"))
1582 (modify-phases %standard-phases
1583 (add-before 'check 'disable-broken-test
1585 ;; XXX: The 1.1.8 release tarball is missing a header that's
1586 ;; required for this test to work. Fixed in 1.1.9.
1587 (substitute* "axfer/test/Makefile"
1588 ((".*container-test.*") ""))
1591 'install 'pre-install
1593 ;; Don't try to mkdir /var/lib/alsa.
1594 (substitute* "Makefile"
1595 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1599 `(("libsamplerate" ,libsamplerate)
1600 ("ncurses" ,ncurses)
1601 ("alsa-lib" ,alsa-lib)
1603 ("gettext" ,gettext-minimal)))
1604 (home-page "http://www.alsa-project.org/")
1605 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1607 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1608 MIDI functionality to the Linux-based operating system.")
1610 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1612 (license license:gpl2)))
1614 (define-public alsa-plugins
1616 (name "alsa-plugins")
1620 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1621 name "-" version ".tar.bz2"))
1624 "01zrg0h2jw9dlj9233vjsn916yf4f2s667yry6xsn8d57lq745qn"))))
1625 (build-system gnu-build-system)
1626 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1627 ;; be split, there are references to both in files.
1628 ;; TODO: Remove OSS related plugins, they add support to run native
1629 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1631 (outputs '("out" "pulseaudio" "jack"))
1633 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1634 ;; for /etc/alsa. On Guix System plugins are loaded from
1635 ;; the ALSA service, and other distributions likely
1636 ;; won't use these files.
1637 "--with-alsalconfdir=/tmp/noop")
1639 (modify-phases %standard-phases
1640 (add-after 'install 'split
1641 (lambda* (#:key inputs outputs #:allow-other-keys)
1642 ;; Distribute the binaries to the various outputs.
1643 (let* ((out (assoc-ref outputs "out"))
1644 (jack (assoc-ref outputs "jack"))
1645 (jacklib (string-append jack "/lib/alsa-lib"))
1646 (pua (assoc-ref outputs "pulseaudio"))
1647 (pualib (string-append pua "/lib/alsa-lib")))
1650 (for-each (lambda (file)
1651 (rename-file file (string-append jacklib "/" (basename file))))
1652 (find-files out ".*jack\\.(la|so)"))
1655 (for-each (lambda (file)
1656 (rename-file file (string-append pualib "/" (basename file))))
1657 (find-files out ".*pulse\\.(la|so)"))
1660 `(("alsa-lib" ,alsa-lib)
1662 ("speex" ,speex) ; libspeexdsp resampling plugin
1663 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1664 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1665 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1667 `(("pkg-config" ,pkg-config)))
1668 (home-page "http://www.alsa-project.org/")
1669 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1671 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1672 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1673 by providing additional plugins which include: upmixing, downmixing, jackd and
1674 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1675 external rate conversion.")
1676 (license (list license:gpl2+
1677 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1678 license:lgpl2.1+))))
1680 (define-public iptables
1687 "mirror://netfilter.org/iptables/iptables-"
1688 version ".tar.bz2"))
1691 "0z0mgs1ghvn3slc868mgbf2g26njgrzcy5ggyb5w4i55j1a3lflr"))))
1692 (build-system gnu-build-system)
1694 `(("pkg-config" ,pkg-config)
1698 `(("libmnl" ,libmnl)
1699 ("libnftnl" ,libnftnl)))
1701 '(#:tests? #f ; no test suite
1702 #:configure-flags ; add $libdir to the RUNPATH of executables
1703 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1704 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1705 (synopsis "Programs to configure Linux IP packet filtering rules")
1707 "@command{iptables} is the user-space command line program used to
1708 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1709 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1711 This package also includes @command{ip6tables}, which is used to configure the
1714 Both commands are targeted at system administrators.")
1715 (license license:gpl2+)))
1717 (define-public ebtables
1720 (version "2.0.10-4")
1724 "mirror://netfilter.org/ebtables/ebtables-v"
1728 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1729 (build-system gnu-build-system)
1731 '(#:tests? #f ; no test suite
1733 (let* ((out (assoc-ref %outputs "out"))
1734 (bin (string-append out "/sbin"))
1735 (lib (string-append out "/lib"))
1736 (man (string-append out "/share/man"))
1737 (iptables (assoc-ref %build-inputs "iptables"))
1738 (ethertypes (string-append iptables "/etc/ethertypes")))
1739 (list (string-append "LIBDIR=" lib)
1740 (string-append "MANDIR=" man)
1741 (string-append "BINDIR=" bin)
1742 (string-append "ETHERTYPESFILE=" ethertypes)
1743 ;; With the default CFLAGS, it falis with:
1744 ;; communication.c:259:58: error: variable ‘ret’ set but not
1745 ;; used [-Werror=unused-but-set-variable]
1748 (modify-phases %standard-phases
1750 ;; no configure script
1752 (substitute* "Makefile"
1753 ;; Remove user and group options from install commands,
1754 ;; otherwise it fails with: invalid user 'root'.
1755 (("-o root -g root") "")
1756 ;; Remove 'ethertypes' from the install target.
1758 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1762 ("iptables" ,iptables)))
1763 (synopsis "Ethernet bridge frame table administration")
1764 (home-page "http://ebtables.netfilter.org/")
1766 "ebtables is an application program used to set up and maintain the
1767 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1768 analogous to the iptables application, but less complicated, due to the fact
1769 that the Ethernet protocol is much simpler than the IP protocol.")
1770 (license license:gpl2+)))
1772 (define-public iproute
1779 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1783 "0gvv269wjn4279hxr5zzwsk2c5qgswr47za3hm1x4frsk52iw76b"))))
1784 (build-system gnu-build-system)
1786 `( ;; There is a test suite, but it wants network namespaces and sudo.
1788 #:make-flags (let ((out (assoc-ref %outputs "out")))
1790 (string-append "BASH_COMPDIR=" out
1791 "/etc/bash_completion.d")
1792 (string-append "LIBDIR=" out "/lib")
1793 (string-append "HDRDIR=" out "/include")
1794 (string-append "SBINDIR=" out "/sbin")
1795 (string-append "CONFDIR=" out "/etc")
1796 (string-append "DOCDIR=" out "/share/doc/"
1798 (string-append "MANDIR=" out "/share/man")))
1799 #:phases (modify-phases %standard-phases
1800 (add-before 'install 'pre-install
1802 ;; Don't attempt to create /var/lib/arpd.
1803 (substitute* "Makefile"
1804 (("^.*ARPDDIR.*$") ""))
1808 ("iptables" ,iptables)
1809 ("libmnl" ,libmnl)))
1813 ("pkg-config" ,pkg-config)))
1815 ;; ("libmnl" ,libmnl)
1816 ;; ("util-linux" ,util-linux)
1818 "https://wiki.linuxfoundation.org/networking/iproute2")
1820 "Utilities for controlling TCP/IP networking and traffic in Linux")
1822 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1823 and traffic with the Linux kernel. The most important of these are
1824 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1827 Most network configuration manuals still refer to ifconfig and route as the
1828 primary network configuration tools, but ifconfig is known to behave
1829 inadequately in modern network environments, and both should be deprecated.")
1830 (license license:gpl2+)))
1832 (define-public net-tools
1833 ;; XXX: This package is basically unmaintained, but it provides a few
1834 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1836 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1840 (version (string-append "1.60-" revision "." (string-take commit 7)))
1843 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1844 "n/ne/net-tools/code.git/net-tools-code-"
1846 (file-name (string-append name "-" version ".zip"))
1849 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1850 (home-page "http://net-tools.sourceforge.net/")
1851 (build-system gnu-build-system)
1853 '(#:modules ((guix build gnu-build-system)
1858 (modify-phases %standard-phases
1860 (lambda* (#:key outputs #:allow-other-keys)
1861 (let ((out (assoc-ref outputs "out")))
1862 (mkdir-p (string-append out "/bin"))
1863 (mkdir-p (string-append out "/sbin"))
1865 ;; Pretend we have everything...
1866 (system "yes | make config")
1868 ;; ... except for the things we don't have.
1869 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1870 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1871 ;; that have been removed.
1872 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1873 ;; think about adding them later.
1874 (substitute* '("config.make" "config.h")
1875 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1878 (add-after 'install 'remove-redundant-commands
1879 (lambda* (#:key outputs #:allow-other-keys)
1880 ;; Remove commands and man pages redundant with Inetutils.
1881 (let* ((out (assoc-ref outputs "out"))
1882 (dup (append-map (cut find-files out <>)
1884 "^(yp|nis|dns)?domainname"))))
1885 (for-each delete-file dup)
1887 ;; Binaries that depend on libnet-tools.a don't declare that
1888 ;; dependency, making it parallel-unsafe.
1889 #:parallel-build? #f
1891 #:tests? #f ; no test suite
1892 #:make-flags (let ((out (assoc-ref %outputs "out")))
1894 (string-append "BASEDIR=" out)
1895 (string-append "INSTALLNLSDIR=" out "/share/locale")
1896 (string-append "mandir=/share/man")))))
1897 (native-inputs `(("gettext" ,gettext-minimal)
1899 (synopsis "Tools for controlling the network subsystem in Linux")
1901 "This package includes the important tools for controlling the network
1902 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1903 route. Additionally, this package contains utilities relating to particular
1904 network hardware types (plipconfig, slattach) and advanced aspects of IP
1905 configuration (iptunnel, ipmaddr).")
1906 (license license:gpl2+))))
1908 (define-public libcap
1915 "mirror://kernel.org/linux/libs/security/linux-privs/"
1916 "libcap2/libcap-" version ".tar.xz"))
1919 "0sj8kidl7qgf2qwxcbw1vadnlb30y4zvjzxswsmfdghq04npkhfs"))))
1920 (build-system gnu-build-system)
1921 (arguments '(#:phases
1922 (modify-phases %standard-phases
1924 ;; Add $libdir to the RUNPATH of executables.
1926 (substitute* "Make.Rules"
1928 (string-append "LDFLAGS := -Wl,-rpath="
1931 #:tests? #f ; no 'check' target
1932 #:make-flags (list "lib=lib"
1933 (string-append "prefix="
1934 (assoc-ref %outputs "out"))
1935 "RAISE_SETFCAP=no")))
1936 (native-inputs `(("perl" ,perl)))
1937 (inputs `(("attr" ,attr)))
1938 (home-page "https://sites.google.com/site/fullycapable/")
1939 (synopsis "Library for working with POSIX capabilities")
1941 "Libcap2 provides a programming interface to POSIX capabilities on
1942 Linux-based operating systems.")
1944 ;; License is BSD-3 or GPLv2, at the user's choice.
1945 (license license:gpl2)))
1947 (define-public bridge-utils
1949 (name "bridge-utils")
1954 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
1955 "bridge-utils-" version ".tar.xz"))
1957 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
1958 (build-system gnu-build-system)
1960 ;; The tarball lacks all the generated files.
1961 (native-inputs `(("autoconf" ,autoconf)
1962 ("automake" ,automake)))
1965 (modify-phases %standard-phases
1966 (add-before 'bootstrap 'patch-stuff
1968 ;; Fix "field ‘ip6’ has incomplete type" errors.
1969 (substitute* "libbridge/libbridge.h"
1970 (("#include <linux/if_bridge.h>")
1971 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1973 ;; Ensure that the entire build fails if one of the
1974 ;; sub-Makefiles fails.
1975 (substitute* "Makefile.in"
1976 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1977 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1980 #:tests? #f)) ; no 'check' target
1983 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1984 (synopsis "Manipulate Ethernet bridges")
1986 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1987 to connect two Ethernet segments together in a protocol independent way.
1988 Packets are forwarded based on Ethernet address, rather than IP address (like
1989 a router). Since forwarding is done at Layer 2, all protocols can go
1990 transparently through a bridge.")
1991 (license license:gpl2+)))
1993 (define-public libnl
2000 "https://github.com/thom311/libnl/releases/download/"
2001 "libnl" (string-join (string-split version #\.) "_")
2002 "/libnl-" version ".tar.gz"))
2005 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2006 (build-system gnu-build-system)
2010 ("pkg-config" ,pkg-config)
2016 "https://github.com/thom311/libnl/releases/download/libnl"
2017 (string-join (string-split version #\.) "_")
2018 "/libnl-doc-" version ".tar.gz"))
2020 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2022 `(("python-2" ,python-2)
2023 ("python-3" ,python-3)))
2024 (outputs '("out" "doc" "python2" "python3"))
2026 `(#:modules ((guix build gnu-build-system)
2030 (modify-phases %standard-phases
2031 (add-after 'install 'install-python
2032 (lambda* (#:key outputs #:allow-other-keys)
2033 (define (python-inst python)
2034 (invoke python "setup.py" "build")
2035 (invoke python "setup.py" "install"
2036 (string-append "--prefix="
2037 (assoc-ref %outputs python)))
2038 (invoke python "setup.py" "clean"))
2039 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2040 (assoc-ref %outputs "out")))
2041 (with-directory-excursion "./python"
2042 (for-each python-inst '("python2" "python3")))
2044 (add-after 'install 'install-doc
2045 (lambda* (#:key inputs outputs #:allow-other-keys)
2046 (let ((dest (string-append (assoc-ref outputs "doc")
2047 "/share/doc/libnl")))
2049 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
2050 "--strip-components=1" "-C" dest)))))))
2051 (home-page "https://www.infradead.org/~tgr/libnl/")
2052 (synopsis "NetLink protocol library suite")
2054 "The libnl suite is a collection of libraries providing APIs to netlink
2055 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2056 between the kernel and user space processes. It was designed to be a more
2057 flexible successor to ioctl to provide mainly networking related kernel
2058 configuration and monitoring interfaces.")
2060 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2061 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2062 (license license:gpl2)))
2071 "mirror://kernel.org/software/network/iw/iw-"
2075 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2076 (build-system gnu-build-system)
2077 (native-inputs `(("pkg-config" ,pkg-config)))
2078 (inputs `(("libnl" ,libnl)))
2081 (let* ((target ,(%current-target-system))
2082 (gcc (if target (string-append target "-gcc") "gcc"))
2083 (pkg-config (if target
2084 (string-append target "-pkg-config")
2087 (string-append "CC=" gcc)
2088 (string-append "PKG_CONFIG="
2089 (assoc-ref %build-inputs "pkg-config")
2091 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2092 #:phases (modify-phases %standard-phases (delete 'configure))))
2093 (home-page "https://wireless.wiki.kernel.org/")
2094 (synopsis "Tool for configuring wireless devices")
2096 "iw is a new nl80211 based CLI configuration utility for wireless
2097 devices. It replaces @code{iwconfig}, which is deprecated.")
2098 (license license:isc)))
2100 (define-public powertop
2107 (uri (string-append "https://01.org/sites/default/files/downloads/"
2108 "powertop-v" version "-1-g7ef7f79.tar_0.gz"))
2110 (base32 "0kynypj5cydfbma0ssblq1k4m1arixc1s2vf0ybv8y2gg09wjs5f"))))
2111 (build-system gnu-build-system)
2114 (modify-phases %standard-phases
2115 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2116 ;; allow calibrating the network interface in Guix System.
2117 (add-after 'unpack 'patch-absolute-file-names
2118 (lambda* (#:key inputs #:allow-other-keys)
2119 (let ((kmod (assoc-ref inputs "kmod")))
2120 (substitute* (find-files "src" "\\.cpp$")
2121 ;; Give the right 'modprobe' file name so that essential
2122 ;; modules such as msr.ko can be loaded.
2123 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2124 ;; These programs are only needed to calibrate, so using
2125 ;; relative file names avoids adding extra inputs. When they
2126 ;; are missing powertop gracefully handles it.
2127 (("/usr/bin/hcitool") "hcitool")
2128 (("/usr/bin/xset") "xset")
2129 (("/usr/sbin/hciconfig") "hciconfig"))
2134 ("ncurses" ,ncurses)
2135 ("pciutils" ,pciutils)
2138 `(("pkg-config" ,pkg-config)))
2139 (home-page "https://01.org/powertop/")
2140 (synopsis "Analyze power consumption on Intel-based laptops")
2142 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2143 power management. In addition to being a diagnostic tool, PowerTOP also has
2144 an interactive mode where the user can experiment various power management
2145 settings for cases where the operating system has not enabled these
2147 (license license:gpl2)))
2149 (define-public aumix
2156 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2157 version ".tar.bz2"))
2160 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2161 (build-system gnu-build-system)
2162 (inputs `(("ncurses" ,ncurses)))
2163 (home-page "http://www.jpj.net/~trevor/aumix.html")
2164 (synopsis "Audio mixer for X and the console")
2166 "Aumix adjusts an audio mixer from X, the console, a terminal,
2167 the command line or a script.")
2168 (license license:gpl2+)))
2170 (define-public iotop
2177 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2180 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2181 (build-system python-build-system)
2184 (modify-phases %standard-phases
2185 (add-after 'unpack 'fix-build-with-python3
2187 (substitute* "setup.py"
2188 (("itervalues") "values"))
2190 ;; There are currently no checks in the package.
2192 (native-inputs `(("python" ,python)))
2193 (home-page "http://guichaz.free.fr/iotop/")
2195 "Displays the IO activity of running processes")
2197 "Iotop is a Python program with a top like user interface to show the
2198 processes currently causing I/O.")
2199 (license license:gpl2+)))
2207 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2208 "download/fuse-" version
2209 "/fuse-" version ".tar.gz"))
2212 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2213 (patches (search-patches "fuse-overlapping-headers.patch"))))
2214 (build-system gnu-build-system)
2215 (inputs `(("util-linux" ,util-linux)))
2217 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2218 (assoc-ref %outputs "out")
2220 (string-append "INIT_D_PATH="
2221 (assoc-ref %outputs "out")
2224 ;; The rule makes /dev/fuse 666.
2225 (string-append "UDEV_RULES_PATH="
2226 (assoc-ref %outputs "out")
2227 "/lib/udev/rules.d"))
2229 (modify-phases %standard-phases
2230 (add-before 'build 'set-file-names
2231 (lambda* (#:key inputs #:allow-other-keys)
2232 ;; libfuse calls out to mount(8) and umount(8). Make sure
2233 ;; it refers to the right ones.
2234 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2235 (("/bin/(u?)mount" _ maybe-u)
2236 (string-append (assoc-ref inputs "util-linux")
2237 "/bin/" maybe-u "mount")))
2238 (substitute* '("util/mount.fuse.c")
2242 ;; This hack leads libfuse to search for 'fusermount' in
2243 ;; $PATH, where it may find a setuid-root binary, instead of
2244 ;; trying solely $out/sbin/fusermount and failing because
2246 (substitute* "lib/Makefile"
2247 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2248 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2250 (home-page "https://github.com/libfuse/libfuse")
2251 (synopsis "Support file systems implemented in user space")
2253 "As a consequence of its monolithic design, file system code for Linux
2254 normally goes into the kernel itself---which is not only a robustness issue,
2255 but also an impediment to system extensibility. FUSE, for \"file systems in
2256 user space\", is a kernel module and user-space library that tries to address
2257 part of this problem by allowing users to run file system implementations as
2258 user-space processes.")
2259 (license (list license:lgpl2.1 ;library
2260 license:gpl2+)))) ;command-line utilities
2262 (define-public unionfs-fuse
2264 (name "unionfs-fuse")
2269 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
2271 (file-name (string-append name "-" version ".tar.gz"))
2274 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
2275 (build-system cmake-build-system)
2277 `(("python" ,python)))
2278 (inputs `(("fuse" ,fuse)))
2280 ;; The tests were never actually run ("collected 0 items"), but in recent
2281 ;; versions of pytest that causes an error.
2283 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2284 (synopsis "User-space union file system")
2286 "UnionFS-FUSE is a flexible union file system implementation in user
2287 space, using the FUSE library. Mounting a union file system allows you to
2288 \"aggregate\" the contents of several directories into a single mount point.
2289 UnionFS-FUSE additionally supports copy-on-write.")
2290 (license license:bsd-3)))
2293 (package (inherit fuse)
2294 (name "fuse-static")
2295 (source (origin (inherit (package-source fuse))
2296 (modules '((guix build utils)))
2299 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2300 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2301 ;; that it doesn't do that, allowing us to remove the
2302 ;; dependency on util-linux (something that is useful in
2304 (substitute* '("lib/mount_util.c"
2305 "util/mount_util.c")
2306 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2312 (define-public unionfs-fuse/static
2313 (package (inherit unionfs-fuse)
2314 (synopsis "User-space union file system (statically linked)")
2315 (name (string-append (package-name unionfs-fuse) "-static"))
2316 (source (origin (inherit (package-source unionfs-fuse))
2317 (modules '((guix build utils)))
2320 ;; Add -ldl to the libraries, because libfuse.a needs that.
2321 (substitute* "src/CMakeLists.txt"
2322 (("target_link_libraries(.*)\\)" _ libs)
2323 (string-append "target_link_libraries"
2328 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2330 (modify-phases %standard-phases
2331 (add-after 'install 'post-install
2332 (lambda* (#:key outputs #:allow-other-keys)
2333 (let* ((out (assoc-ref outputs "out"))
2334 (exe (string-append out "/bin/unionfs")))
2335 ;; By default, 'unionfs' keeps references to
2336 ;; $glibc/share/locale and similar stuff. Remove them.
2337 (remove-store-references exe)
2339 ;; 'unionfsctl' has references to glibc as well. Since
2340 ;; we don't need it, remove it.
2341 (delete-file (string-append out "/bin/unionfsctl"))
2343 (inputs `(("fuse" ,fuse-static)))))
2345 (define-public sshfs
2351 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2352 "download/sshfs-" version "/sshfs-" version
2356 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2357 (build-system gnu-build-system)
2362 `(("pkg-config" ,pkg-config)))
2363 (home-page "https://github.com/libfuse/sshfs")
2364 (synopsis "Mount remote file systems over SSH")
2366 "This is a file system client based on the SSH File Transfer Protocol.
2367 Since most SSH servers already support this protocol it is very easy to set
2368 up: on the server side there's nothing to do; on the client side mounting the
2369 file system is as easy as logging into the server with an SSH client.")
2370 (license license:gpl2+)))
2372 (define-public sshfs-fuse
2373 (package (inherit sshfs)
2375 (properties `((superseded . ,sshfs)))))
2377 (define-public archivemount
2379 (name "archivemount")
2384 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2385 "archivemount-" version ".tar.gz"))
2387 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2388 (build-system gnu-build-system)
2389 (inputs `(("fuse" ,fuse)
2390 ("libarchive" ,libarchive)))
2391 (native-inputs `(("pkg-config" ,pkg-config)))
2392 (home-page "https://www.cybernoia.de/software/archivemount.html")
2393 (synopsis "Tool for mounting archive files with FUSE")
2394 (description "archivemount is a FUSE-based file system for Unix variants,
2395 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2396 mount point where it can be read from or written to as with any other file
2397 system. This makes accessing the contents of the archive, which may be
2398 compressed, transparent to other programs, without decompressing them.")
2399 (license license:lgpl2.0+)))
2401 (define-public numactl
2408 "https://github.com/numactl/numactl/releases/download/v"
2409 version "/numactl-" version ".tar.gz"))
2412 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2413 (build-system gnu-build-system)
2415 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2416 ;; to run, which we can't assume to have.
2419 ;; NUMA is apparently not supported on armhf, see
2420 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2421 (supported-systems (delete "armhf-linux" %supported-systems))
2422 (home-page "https://github.com/numactl/numactl")
2423 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2425 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2426 memory is not all in one place. The @command{numactl} program allows you to
2427 run your application program on specific CPUs and memory nodes. It does this
2428 by supplying a NUMA memory policy to the operating system before running your
2431 The package contains other commands, such as @command{numastat},
2432 @command{memhog}, and @command{numademo} which provides a quick overview of
2433 NUMA performance on your system.")
2434 (license (list license:gpl2 ;programs
2435 license:lgpl2.1)))) ;library
2437 (define-public kbd-neo
2444 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2445 version "/linux/console/neo.map"))
2446 (file-name (string-append name "-" version ".map"))
2449 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2450 (build-system trivial-build-system)
2452 `(#:modules ((guix build utils))
2454 (use-modules (guix build utils))
2455 (let ((out (string-append %output "/share/keymaps"))
2456 (source (assoc-ref %build-inputs "source")))
2458 (copy-file source (string-append out "/neo.map"))
2460 (home-page "https://neo-layout.org")
2461 (synopsis "Neo2 console layout")
2463 "Kbd-neo provides the Neo2 keyboard layout for use with
2464 @command{loadkeys(1)} from @code{kbd(4)}.")
2465 ;; The file is located in an svn directory, the entire content of
2466 ;; the directory is licensed as GPL3.
2467 (license license:gpl3+)))
2475 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2479 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2480 (modules '((guix build utils)))
2483 (substitute* "tests/Makefile.in"
2484 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2487 (substitute* '("src/unicode_start" "src/unicode_stop")
2488 ;; Assume the Coreutils are in $PATH.
2492 (build-system gnu-build-system)
2495 (modify-phases %standard-phases
2496 (add-before 'build 'pre-build
2497 (lambda* (#:key inputs #:allow-other-keys)
2498 (let ((gzip (assoc-ref %build-inputs "gzip"))
2499 (bzip2 (assoc-ref %build-inputs "bzip2")))
2500 (substitute* "src/libkeymap/findfile.c"
2502 (string-append gzip "/bin/gzip"))
2504 (string-append bzip2 "/bin/bzip2")))
2506 (add-after 'install 'post-install
2507 (lambda* (#:key outputs #:allow-other-keys)
2508 ;; Make sure these programs find their comrades.
2509 (let* ((out (assoc-ref outputs "out"))
2510 (bin (string-append out "/bin")))
2511 (for-each (lambda (prog)
2512 (wrap-program (string-append bin "/" prog)
2513 `("PATH" ":" prefix (,bin))))
2514 '("unicode_start" "unicode_stop"))
2516 (inputs `(("check" ,check)
2519 ("pam" ,linux-pam)))
2520 (native-search-paths
2521 (list (search-path-specification
2522 (variable "LOADKEYS_KEYMAP_PATH")
2523 ;; Append ‘/**’ to recursively search all directories. One can then
2524 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2525 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2526 (files (list "share/keymaps/**")))))
2527 (native-inputs `(("pkg-config" ,pkg-config)))
2528 (home-page "http://kbd-project.org/")
2529 (synopsis "Linux keyboard utilities and keyboard maps")
2531 "This package contains keytable files and keyboard utilities compatible
2532 for systems using the Linux kernel. This includes commands such as
2533 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2534 (license license:gpl2+)))
2536 (define-public loadkeys-static
2539 (name "loadkeys-static")
2541 (substitute-keyword-arguments (package-arguments kbd)
2542 ((#:configure-flags flags ''())
2543 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2544 "--disable-vlock" ;so we don't need libpam
2545 "--disable-libkeymap")
2547 ((#:make-flags flags ''())
2548 `(cons "LDFLAGS=-all-static" ,flags))
2549 ((#:phases phases '%standard-phases)
2550 `(modify-phases ,phases
2552 (lambda* (#:key outputs #:allow-other-keys)
2553 (let ((out (assoc-ref outputs "out")))
2554 ;; The binary keeps references to gzip, among other things,
2555 ;; which we don't need in the initrd, so strip references.
2556 (remove-store-references "src/loadkeys")
2558 (install-file "src/loadkeys"
2559 (string-append out "/bin"))
2561 (delete 'post-install)))
2562 ((#:strip-flags _ '())
2564 ((#:allowed-references _ '())
2567 (synopsis "Statically-linked @command{loadkeys} program")
2569 ;; This package is meant to be used internally in the initrd so don't
2571 (properties '((hidden? . #t)))))
2573 (define-public inotify-tools
2575 (name "inotify-tools")
2580 (url "https://github.com/rvoicilas/inotify-tools.git")
2582 (file-name (git-file-name name version))
2585 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2586 (build-system gnu-build-system)
2588 `(("autoconf" ,autoconf)
2589 ("automake" ,automake)
2590 ("libtool" ,libtool)))
2591 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2592 (synopsis "Monitor file accesses")
2594 "The inotify-tools packages provides a C library and command-line tools
2595 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2596 (license license:gpl2+)))
2605 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2606 "kmod-" version ".tar.xz"))
2609 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2610 (patches (search-patches "kmod-module-directory.patch"))))
2611 (build-system gnu-build-system)
2613 `(("pkg-config" ,pkg-config)))
2618 `(#:tests? #f ; FIXME: Investigate test failures
2619 #:configure-flags '("--with-xz" "--with-zlib")
2621 (modify-phases %standard-phases
2622 (add-after 'install 'install-modprobe&co
2623 (lambda* (#:key outputs #:allow-other-keys)
2624 (let* ((out (assoc-ref outputs "out"))
2625 (bin (string-append out "/bin")))
2626 (for-each (lambda (tool)
2628 (string-append bin "/" tool)))
2629 '("insmod" "rmmod" "lsmod" "modprobe"
2630 "modinfo" "depmod"))
2632 (home-page "https://www.kernel.org/")
2633 (synopsis "Kernel module tools")
2634 (description "Kmod is a set of tools to handle common tasks with Linux
2635 kernel modules like insert, remove, list, check properties, resolve
2636 dependencies and aliases.
2638 These tools are designed on top of libkmod, a library that is shipped with
2639 kmod. The aim is to be compatible with tools, configurations and indices
2640 from the module-init-tools project.")
2641 (license license:gpl2+))) ; library under lgpl2.1+
2643 (define-public eudev
2644 ;; The post-systemd fork, maintained by Gentoo.
2650 (uri (git-reference (url "https://github.com/gentoo/eudev")
2651 (commit (string-append "v" version))))
2652 (file-name (git-file-name name version))
2655 "1g95yzzx4qxm5qhhylbi930lrq4gsbz207n72018nkvswj6gmpjw"))
2656 (patches (search-patches "eudev-rules-directory.patch"))))
2657 (build-system gnu-build-system)
2660 (modify-phases %standard-phases
2661 (add-after 'unpack 'make-source-writable
2663 ;; XXX: Git checkouts are read-only, but this package needs to
2664 ;; modify some of its files.
2665 (for-each make-file-writable (find-files "."))
2667 (add-before 'bootstrap 'patch-file-names
2668 (lambda* (#:key inputs #:allow-other-keys)
2669 (substitute* "man/make.sh"
2670 (("/usr/bin/xsltproc")
2671 (string-append (assoc-ref inputs "xsltproc")
2674 (add-after 'install 'build-hwdb
2675 (lambda* (#:key outputs #:allow-other-keys)
2676 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2677 ;; similar tools to display product names.
2678 (let ((out (assoc-ref outputs "out")))
2679 (invoke (string-append out "/bin/udevadm")
2680 "hwdb" "--update")))))
2681 #:configure-flags (list "--enable-manpages")))
2683 `(("autoconf" ,autoconf)
2684 ("automake" ,automake)
2686 ("libtool" ,libtool)
2687 ("pkg-config" ,pkg-config)
2690 ("python" ,python-wrapper)
2691 ;; For documentation.
2692 ("docbook-xml" ,docbook-xml-4.2)
2693 ("docbook-xsl" ,docbook-xsl)
2694 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2695 ("xsltproc" ,libxslt)))
2697 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2698 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2699 ;; which contains the rules to do that.
2700 `(("util-linux" ,util-linux) ;for blkid
2702 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2703 (synopsis "Userspace device management")
2704 (description "Udev is a daemon which dynamically creates and removes
2705 device nodes from /dev/, handles hotplug events and loads drivers at boot
2707 (license license:gpl2+)))
2709 (define-public eudev-with-hwdb
2710 (deprecated-package "eudev-with-hwdb" eudev))
2715 (version "2.02.177")
2718 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2722 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2723 (modules '((guix build utils)))
2726 (use-modules (guix build utils))
2728 ;; Honor sysconfdir.
2729 (substitute* "make.tmpl.in"
2731 "confdir = @sysconfdir@\n")
2732 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2733 "DEFAULT_SYS_DIR = @sysconfdir@"))
2735 (patches (search-patches "lvm2-static-link.patch"))))
2736 (build-system gnu-build-system)
2738 `(("pkg-config" ,pkg-config)
2739 ("procps" ,procps))) ;tests use 'pgrep'
2744 (modify-phases %standard-phases
2745 (add-after 'configure 'set-makefile-shell
2747 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2749 (setenv "SHELL" (which "sh"))
2751 ;; Replace /bin/sh with the right file name.
2752 (patch-makefile-SHELL "make.tmpl")
2755 #:configure-flags (list (string-append "--sysconfdir="
2756 (assoc-ref %outputs "out")
2758 "--enable-udev_sync"
2759 "--enable-udev_rules"
2760 "--enable-pkgconfig"
2762 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
2764 ;; Make sure programs such as 'dmsetup' can
2765 ;; find libdevmapper.so.
2766 (string-append "LDFLAGS=-Wl,-rpath="
2767 (assoc-ref %outputs "out")
2769 (assoc-ref %outputs "out")
2770 "/lib/device-mapper")
2771 ;; TODO: Patch make.tmpl.in to take LDFLAGS
2772 ;; into account so that we don't need to also
2774 (string-append "CLDFLAGS=-Wl,-rpath="
2775 (assoc-ref %outputs "out")
2777 (assoc-ref %outputs "out")
2778 "/lib/device-mapper"))
2780 ;; The tests use 'mknod', which requires root access.
2782 (home-page "https://sourceware.org/lvm2/")
2783 (synopsis "Logical volume management for Linux")
2785 "LVM2 is the logical volume management tool set for Linux-based systems.
2786 This package includes the user-space libraries and tools, including the device
2787 mapper. Kernel components are part of Linux-libre.")
2789 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2790 ;; Command-line tools are GPLv2.
2791 (license (list license:gpl2 license:lgpl2.1))))
2793 (define-public lvm2-static
2796 (name "lvm2-static")
2798 ;; Propagate udev because libdevmapper.a depends on libudev.
2799 (inputs (alist-delete "udev" (package-inputs lvm2)))
2800 (propagated-inputs `(("udev" ,eudev)))
2803 (substitute-keyword-arguments (package-arguments lvm2)
2804 ((#:configure-flags flags '())
2805 ;; LVM2 doesn't use Libtool, hence the custom option.
2806 `(cons "--enable-static_link" ,flags))))
2807 (synopsis "Logical volume management for Linux (statically linked)")))
2809 (define-public wireless-tools
2811 (name "wireless-tools")
2815 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2819 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2822 ;; Remove the older header files that are not free software.
2823 (for-each (lambda (n)
2824 (delete-file (format #f "wireless.~a.h" n)))
2825 '(10 11 12 13 14 15 16 17 18 19 20))
2827 (build-system gnu-build-system)
2830 (list (string-append "PREFIX=" %output)
2831 (string-append "INSTALL_MAN=" %output "/share/man")
2832 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2835 (modify-phases %standard-phases
2837 (lambda* (#:key target #:allow-other-keys)
2838 (when ,(%current-target-system)
2839 ;; Cross-compilation: use the cross tools.
2840 (substitute* (find-files "." "Makefile")
2842 (string-append "CC = " target "-gcc\n"))
2844 (string-append "AR = " target "-ar\n"))
2846 (string-append "RANLIB = " target "-ranlib\n"))))
2849 (synopsis "Tools for manipulating Linux Wireless Extensions")
2850 (description "Wireless Tools are used to manipulate the now-deprecated
2851 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
2852 Extension was an interface allowing you to set Wireless LAN specific
2853 parameters and get the specific stats. It is deprecated in favor the nl80211
2855 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2856 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2857 ;; other files are distributed under gpl2.
2858 (license (list license:gpl2 license:lgpl2.1+))))
2866 (uri (string-append "mirror://kernel.org/software/network/crda/"
2867 "crda-" version ".tar.xz"))
2870 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2871 (patches (search-patches "crda-optional-gcrypt.patch"))))
2872 (build-system gnu-build-system)
2874 '(#:phases (modify-phases %standard-phases
2876 (add-after 'unpack 'gzip-determinism
2878 (substitute* "Makefile"
2879 (("gzip") "gzip --no-name"))
2882 'build 'no-werror-no-ldconfig
2884 (substitute* "Makefile"
2886 (("ldconfig") "true"))
2889 'build 'set-regulator-db-file-name
2890 (lambda* (#:key inputs #:allow-other-keys)
2891 ;; Tell CRDA where to find our database.
2892 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2893 (substitute* "crda.c"
2894 (("\"/lib/crda/regulatory.bin\"")
2895 (string-append "\"" regdb
2896 "/lib/crda/regulatory.bin\"")))
2898 #:test-target "verify"
2899 #:make-flags (let ((out (assoc-ref %outputs "out"))
2900 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2901 (list "CC=gcc" "V=1"
2903 ;; Disable signature-checking on 'regulatory.bin'.
2904 ;; The reason is that this simplifies maintenance
2905 ;; on our side (no need to manage a distro key
2906 ;; pair), and we can guarantee integrity of
2907 ;; 'regulatory.bin' by other means anyway, such as
2908 ;; 'guix gc --verify'. See
2909 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2913 (string-append "PREFIX=" out)
2914 (string-append "SBINDIR=" out "/sbin/")
2915 (string-append "UDEV_RULE_DIR="
2916 out "/lib/udev/rules.d")
2917 (string-append "LDFLAGS=-Wl,-rpath="
2919 (string-append "REG_BIN=" regdb
2920 "/lib/crda/regulatory.bin")))))
2921 (native-inputs `(("pkg-config" ,pkg-config)
2922 ("wireless-regdb" ,wireless-regdb)))
2923 (inputs `(("libnl" ,libnl)))
2925 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2926 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2928 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2929 communication between the kernel Linux and user space for regulatory
2931 (license license:copyleft-next)))
2933 (define-public wireless-regdb
2935 (name "wireless-regdb")
2936 (version "2019.06.03")
2940 "mirror://kernel.org/software/network/wireless-regdb/"
2941 "wireless-regdb-" version ".tar.xz"))
2944 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
2946 ;; We're building 'regulatory.bin' by ourselves.
2948 (delete-file "regulatory.bin")
2950 (build-system gnu-build-system)
2953 (modify-phases %standard-phases
2954 (add-after 'unpack 'gzip-determinism
2956 (substitute* "Makefile"
2957 (("gzip") "gzip --no-name"))
2959 (add-after 'unpack 'omit-signature
2961 (substitute* "Makefile"
2962 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
2963 ;; don't provide (see below). Disable it.
2964 ((" regulatory\\.db\\.p7s") "")
2965 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
2966 ;; but ‘make install’ depends only on the latter while installing
2967 ;; both (and failing). Depend on it explicitly.
2968 (("^install: " all) (string-append all "regulatory.db ")))
2970 (delete 'configure)) ; no configure script
2972 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2973 ;; is computed and can be equal to 'maintainer-clean'; when that
2974 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2975 ;; just built. Thus, build things sequentially.
2976 #:parallel-build? #f
2978 #:tests? #f ; no tests
2980 (let ((out (assoc-ref %outputs "out")))
2981 (list (string-append "PREFIX=" out)
2982 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
2984 ;; Leave this empty so that db2bin.py doesn't try to sign
2985 ;; ‘regulatory.bin’. This allows us to avoid managing a key
2986 ;; pair for the whole distribution.
2987 (string-append "REGDB_PRIVKEY=")
2988 ;; Don't generate a public key for the same reason. These are
2989 ;; used as Makefile targets and can't be the empty string.
2990 (string-append "REGDB_PUBCERT=/dev/null")
2991 (string-append "REGDB_PUBKEY=/dev/null")))))
2993 `(("python" ,python-wrapper)))
2995 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2996 (synopsis "Wireless regulatory database")
2998 "This package contains the wireless regulatory database Central
2999 Regulatory Database Agent (CRDA) daemon. The database contains information on
3000 country-specific regulations for the wireless spectrum.")
3001 (license license:isc)))
3003 (define-public lm-sensors
3011 (url "https://github.com/groeck/lm-sensors.git")
3012 (commit (string-append "V" (string-join
3013 (string-split version #\.) "-")))))
3014 (file-name (git-file-name name version))
3016 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3017 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3018 (build-system gnu-build-system)
3019 (inputs `(("rrdtool" ,rrdtool)
3022 ("gnuplot" ,gnuplot)))
3023 (native-inputs `(("pkg-config" ,pkg-config)
3027 (outputs '("lib" ; avoid perl in closure
3030 `(#:tests? #f ; no 'check' target
3031 #:make-flags (list (string-append "PREFIX=" %output)
3032 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3033 (string-append "INCLUDEDIR="
3034 (assoc-ref %outputs "lib") "/include")
3035 (string-append "MANDIR=" %output "/share/man")
3036 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3038 (modify-phases %standard-phases
3040 (add-before 'build 'patch-exec-paths
3041 (lambda* (#:key inputs outputs #:allow-other-keys)
3042 (substitute* "prog/detect/sensors-detect"
3044 (string-append "`" (assoc-ref inputs "coreutils")
3046 (("(`|\")modprobe" all open-quote)
3047 (string-append open-quote
3048 (assoc-ref inputs "kmod")
3050 (substitute* '("prog/pwm/pwmconfig"
3051 "prog/pwm/fancontrol")
3053 (string-append (assoc-ref inputs "gnuplot")
3056 (string-append (assoc-ref inputs "coreutils")
3059 (string-append (assoc-ref inputs "grep")
3062 (string-append (assoc-ref inputs "sed")
3065 (string-append (assoc-ref inputs "coreutils")
3068 (string-append (assoc-ref inputs "coreutils")
3071 (string-append (assoc-ref inputs "coreutils")
3072 "/bin/readlink -f")))
3074 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3075 (synopsis "Utilities to read temperature/voltage/fan sensors")
3077 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3078 you to access information from temperature, voltage, and fan speed sensors.
3079 It works with most newer systems.")
3080 (license license:gpl2+)))
3082 (define-public iucode-tool
3084 (name "iucode-tool")
3088 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3089 "/raw/latest/iucode-tool_" version ".tar.xz"))
3092 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3093 (build-system gnu-build-system)
3094 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3095 (synopsis "Manipulate Intel microcode bundles")
3097 "@command{iucode_tool} is a utility to work with microcode packages for
3098 Intel processors. It can convert between formats, extract specific versions,
3099 create a firmware image suitable for the Linux kernel, and more.")
3100 ;; cpuid.h is available for i686, x86_64, and ia64.
3101 (supported-systems '("i686-linux" "x86_64-linux"))
3102 (license license:gpl2+)))
3104 (define-public i2c-tools
3111 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3112 version ".tar.bz2"))
3115 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3116 (build-system gnu-build-system)
3118 `(#:tests? #f ; no 'check' target
3119 #:make-flags (list (string-append "prefix=" %output)
3121 ;; no configure script
3122 #:phases (modify-phases %standard-phases (delete 'configure))))
3125 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3126 (synopsis "I2C tools for Linux")
3128 "The i2c-tools package contains a heterogeneous set of I2C tools for
3129 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3130 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3132 (license license:gpl2+)))
3134 (define-public xsensors
3141 "http://www.linuxhardware.org/xsensors/xsensors-"
3145 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3146 (build-system gnu-build-system)
3147 (inputs `(("lm-sensors" ,lm-sensors "lib")
3149 (native-inputs `(("pkg-config" ,pkg-config)))
3152 (modify-phases %standard-phases
3153 (add-before 'configure 'enable-deprecated
3155 (substitute* "src/Makefile.in"
3156 (("-DGDK_DISABLE_DEPRECATED") "")
3157 (("-DGTK_DISABLE_DEPRECATED") ""))
3159 (add-before 'configure 'remove-Werror
3161 (substitute* '("configure" "src/Makefile.in")
3164 (home-page "http://www.linuxhardware.org/xsensors/")
3165 (synopsis "Hardware health information viewer")
3167 "Xsensors reads data from the libsensors library regarding hardware
3168 health such as temperature, voltage and fan speed and displays the information
3169 in a digital read-out.")
3170 (license license:gpl2+)))
3175 (version (package-version linux-libre))
3176 (source (package-source linux-libre))
3177 (build-system gnu-build-system)
3180 (modify-phases %standard-phases
3182 (lambda* (#:key inputs #:allow-other-keys)
3183 (setenv "SHELL_PATH" (which "bash"))
3184 (chdir "tools/perf")
3186 #:make-flags (list (string-append "prefix="
3187 (assoc-ref %outputs "out"))
3188 ;; Make sure the kernel headers are treated as system
3189 ;; headers to suppress warnings from those.
3190 (string-append "C_INCLUDE_PATH="
3191 (assoc-ref %build-inputs "kernel-headers")
3195 ;; By default, 'config/Makefile' uses lib64 on
3196 ;; x86_64. Work around that.
3198 #:tests? #f)) ;no tests
3200 `(("pkg-config" ,pkg-config)
3204 ;; There are build scripts written in these languages.
3206 ("python" ,python-2)))
3208 `(("slang" ,slang) ;for the interactive TUI
3210 ("python" ,python-2) ;'perf' links against libpython
3211 ("elfutils" ,elfutils)
3212 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3213 ("libunwind" ,libunwind) ;better stack walking
3214 ("numactl" ,numactl) ;for 'perf bench numa mem'
3217 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3218 ("docbook-xsl" ,docbook-xsl)
3220 ("asciidoc" ,asciidoc)))
3221 (home-page "https://perf.wiki.kernel.org/")
3222 (synopsis "Linux profiling with performance counters")
3224 "perf is a tool suite for profiling using hardware performance counters,
3225 with support in the Linux kernel. perf can instrument CPU performance
3226 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3227 of lightweight profiling. This package contains the user-land tools and in
3228 particular the @code{perf} command.")
3229 (license (package-license linux-libre))))
3231 (define-public pflask
3237 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3239 (file-name (string-append name "-" version ".tar.gz"))
3242 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3243 (build-system cmake-build-system)
3245 '(#:tests? #f)) ; no tests
3246 (home-page "https://ghedo.github.io/pflask/")
3247 (synopsis "Simple tool for creating Linux namespace containers")
3248 (description "pflask is a simple tool for creating Linux namespace
3249 containers. It can be used for running a command or even booting an OS inside
3250 an isolated container, created with the help of Linux namespaces. It is
3251 similar in functionality to chroot, although pflask provides better isolation
3252 thanks to the use of namespaces.")
3253 (license license:bsd-2)))
3255 (define-public singularity
3257 (name "singularity")
3261 (uri (string-append "https://github.com/singularityware/singularity/"
3262 "releases/download/" version
3263 "/singularity-" version ".tar.gz"))
3266 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3267 (modules '((guix build utils)))
3270 ;; Do not create directories in /var.
3271 (substitute* "Makefile.in"
3272 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3274 ;; The original source overrides PATH so that it points to
3275 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3276 ;; on Guix System. Leave PATH unchanged so we refer to the
3277 ;; installed Coreutils, grep, etc.
3278 (substitute* "bin/singularity.in"
3280 (string-append "#" all "\n")))
3282 (substitute* (find-files "libexec/cli" "\\.exec$")
3283 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3285 (string-append "/run/setuid-programs/singularity-"
3286 program "-helper")))
3288 (build-system gnu-build-system)
3290 `(#:configure-flags '("--localstatedir=/var")
3292 (modify-phases %standard-phases
3293 (add-after 'unpack 'patch-reference-to-squashfs-tools
3295 (substitute* "libexec/cli/build.exec"
3296 (("if ! singularity_which mksquashfs") "if 0")
3297 (("if ! mksquashfs")
3298 (string-append "if ! " (which "mksquashfs"))))
3301 `(("libarchive" ,libarchive)
3302 ("python" ,python-wrapper)
3304 ("squashfs-tools" ,squashfs-tools)))
3305 (home-page "https://singularity.lbl.gov/")
3306 (synopsis "Container platform")
3307 (description "Singularity is a container platform supporting a number of
3308 container image formats. It can build SquashFS container images or import
3309 existing Docker images. Singularity requires kernel support for container
3310 isolation or root privileges.")
3311 (license license:bsd-3)))
3313 (define-public hdparm
3319 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3320 "hdparm-" version ".tar.gz"))
3323 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3324 (build-system gnu-build-system)
3326 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3327 (list (string-append "binprefix=" out)
3328 (string-append "manprefix=" out)
3331 (modify-phases %standard-phases
3332 (delete 'configure)) ; no configure script
3333 #:tests? #f)) ; no test suite
3334 (home-page "https://sourceforge.net/projects/hdparm/")
3335 (synopsis "View and tune ATA disk drive parameters")
3337 "@command{hdparm} is a command-line utility to control ATA controllers and
3338 disk drives. It can increase performance and/or reliability by careful tuning
3339 of hardware settings like power and acoustic management, DMA modes, and caching.
3340 It can also display detailed device information, or be used as a simple
3341 performance benchmarking tool.
3343 @command{hdparm} provides a command line interface to various Linux kernel
3344 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3345 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3346 Translation (@dfn{SAT}) are also supported.")
3347 (license (license:non-copyleft "file://LICENSE.TXT"))))
3349 (define-public rfkill
3355 (uri (string-append "mirror://kernel.org/software/network/"
3356 name "/" name "-" version ".tar.xz"))
3359 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3360 (build-system gnu-build-system)
3362 `(#:make-flags (list "CC=gcc"
3363 (string-append "PREFIX=" %output))
3364 #:phases (modify-phases %standard-phases
3365 (delete 'configure))
3367 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3368 (synopsis "Tool for enabling and disabling wireless devices")
3370 "rfkill is a simple tool for accessing the rfkill device interface,
3371 which is used to enable and disable wireless networking devices, typically
3372 WLAN, Bluetooth and mobile broadband.")
3373 (license (license:non-copyleft "file://COPYING"
3374 "See COPYING in the distribution."))
3375 ;; rfkill is part of util-linux as of 2.31.
3376 (properties `((superseded . ,util-linux)))))
3384 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3385 version "/" name "-" version ".tar.gz"))
3388 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3389 (build-system gnu-build-system)
3390 (home-page "http://acpiclient.sourceforge.net")
3391 (synopsis "Display information on ACPI devices")
3392 (description "@code{acpi} attempts to replicate the functionality of the
3393 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3394 information. It does not support ACPI suspending, only displays information
3395 about ACPI devices.")
3396 (license license:gpl2+)))
3398 (define-public acpid
3404 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3408 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
3409 (build-system gnu-build-system)
3410 (home-page "https://sourceforge.net/projects/acpid2/")
3411 (synopsis "Daemon for delivering ACPI events to user-space programs")
3413 "acpid is designed to notify user-space programs of Advanced
3414 Configuration and Power Interface (ACPI) events. acpid should be started
3415 during the system boot, and will run as a background process. When an ACPI
3416 event is received from the kernel, acpid will examine the list of rules
3417 specified in /etc/acpi/events and execute the rules that match the event.")
3418 (license license:gpl2+)))
3420 (define-public sysfsutils
3429 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3432 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3433 (build-system gnu-build-system)
3434 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3435 (synopsis "System utilities based on Linux sysfs")
3437 "These are a set of utilities built upon sysfs, a virtual file system in
3438 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3439 also contains the libsysfs library.")
3440 ;; The library is under lgpl2.1+ (all files say "or any later version").
3441 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3442 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3444 (define-public sysfsutils-1
3446 (inherit sysfsutils)
3453 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3454 "/sysfsutils-" version ".tar.gz"))
3456 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3457 (modules '((guix build utils)))
3460 (substitute* "Makefile.in"
3461 (("includedir = /usr/include/sysfs")
3462 "includedir = @includedir@"))
3463 (substitute* "configure"
3464 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3465 (string-append "includedir='" orig "/sysfs'")))
3467 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3469 (define-public cpufrequtils
3471 (name "cpufrequtils")
3476 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3477 "cpufrequtils-" version ".tar.gz"))
3479 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3480 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3481 (build-system gnu-build-system)
3483 `(("sysfsutils" ,sysfsutils-1)))
3485 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3486 (assoc-ref %outputs "out") "/lib"))))
3487 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3488 (synopsis "Utilities to get and set CPU frequency on Linux")
3490 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3491 information, and set the CPU frequency if supported, using the cpufreq
3492 capabilities of the Linux kernel.")
3493 (license license:gpl2)))
3495 (define-public libraw1394
3502 "mirror://kernel.org/linux/libs/ieee1394/"
3503 name "-" version ".tar.xz"))
3506 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3507 (build-system gnu-build-system)
3508 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3509 (synopsis "Interface library for the Linux IEEE1394 drivers")
3511 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3512 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3513 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3514 send to and receive from other nodes without requiring a kernel driver for the
3515 protocol in question.")
3516 (license license:lgpl2.1+)))
3518 (define-public libavc1394
3524 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3525 name "-" version ".tar.gz"))
3528 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3529 (build-system gnu-build-system)
3531 `(("pkg-config" ,pkg-config)))
3533 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3534 (home-page "https://sourceforge.net/projects/libavc1394/")
3535 (synopsis "AV/C protocol library for IEEE 1394")
3537 "Libavc1394 is a programming interface to the AV/C specification from
3538 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3539 (license license:lgpl2.1+)))
3541 (define-public libiec61883
3543 (name "libiec61883")
3548 "mirror://kernel.org/linux/libs/ieee1394/"
3549 name "-" version ".tar.xz"))
3552 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3553 (build-system gnu-build-system)
3555 `(("pkg-config" ,pkg-config)))
3557 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3558 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3559 (synopsis "Isochronous streaming media library for IEEE 1394")
3561 "The libiec61883 library provides a higher level API for streaming DV,
3562 MPEG-2 and audio over Linux IEEE 1394.")
3563 (license license:lgpl2.1+)))
3565 (define-public mdadm
3572 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3576 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3577 (build-system gnu-build-system)
3581 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3585 ;; TODO: tell it where to find 'sendmail'
3586 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3587 (string-append "BINDIR=" out "/sbin")
3588 (string-append "MANDIR=" out "/share/man")
3589 (string-append "UDEVDIR=" out "/lib/udev")))
3591 (modify-phases %standard-phases
3592 (add-before 'build 'patch-program-paths
3593 (lambda* (#:key inputs #:allow-other-keys)
3594 (let ((coreutils (assoc-ref inputs "coreutils")))
3595 (substitute* "udev-md-raid-arrays.rules"
3596 (("/usr/bin/(readlink|basename)" all program)
3597 (string-append coreutils "/bin/" program))))
3599 (add-before 'build 'remove-W-error
3601 ;; We cannot build with -Werror on i686 due to a
3602 ;; 'sign-compare' warning in util.c.
3603 (substitute* "Makefile"
3606 (delete 'configure))
3607 ;;tests must be done as root
3609 (home-page "http://neil.brown.name/blog/mdadm")
3610 (synopsis "Tool for managing Linux Software RAID arrays")
3612 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3613 assemble, report on, and monitor arrays. It can also move spares between raid
3614 arrays when needed.")
3615 (license license:gpl2+)))
3617 (define-public mdadm-static
3620 (name "mdadm-static")
3622 (substitute-keyword-arguments (package-arguments mdadm)
3623 ((#:make-flags flags)
3624 `(cons "LDFLAGS = -static" ,flags))
3626 `(modify-phases ,phases
3627 (add-after 'install 'remove-cruft
3628 (lambda* (#:key outputs #:allow-other-keys)
3629 (let* ((out (assoc-ref outputs "out"))
3630 (precious? (lambda (file)
3631 (member file '("." ".." "sbin"))))
3632 (directories (scandir out (negate precious?))))
3633 (with-directory-excursion out
3634 (for-each delete-file-recursively directories)
3635 (remove-store-references "sbin/mdadm")
3636 (delete-file "sbin/mdmon")
3638 ((#:modules modules %gnu-build-system-modules)
3639 `((ice-9 ftw) ,@modules))
3640 ((#:strip-flags _ '())
3641 ''("--strip-all")) ;strip a few extra KiB
3642 ((#:allowed-references _ '("out"))
3643 '("out")))) ;refer only self
3644 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3646 (define-public multipath-tools
3648 (name "multipath-tools")
3652 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3653 ".git;a=snapshot;h=" version ";sf=tgz"))
3654 (file-name (string-append name "-" version ".tar.gz"))
3657 "0kb4mhzwyygdbikikmby6hj39pb3nrzv05v526c75wnycwnpxg31"))
3658 (modules '((guix build utils)))
3661 ;; Drop bundled valgrind headers.
3662 (delete-file-recursively "third-party")
3663 (substitute* '("multipathd/main.c"
3664 "libmultipath/debug.c")
3665 (("#include \"../third-party/")
3668 (build-system gnu-build-system)
3670 '(#:tests? #f ; no tests
3671 #:make-flags (list "CC=gcc"
3672 (string-append "DESTDIR="
3673 (assoc-ref %outputs "out"))
3675 ;; Add the libaio headers to GCCs system header
3676 ;; search path to suppress -Werror=cast-qual on
3677 ;; the included headers.
3678 (string-append "C_INCLUDE_PATH="
3679 (assoc-ref %build-inputs "libaio")
3681 (string-append "LDFLAGS=-Wl,-rpath="
3682 (assoc-ref %outputs "out")
3685 (modify-phases %standard-phases
3686 (add-after 'unpack 'patch-source
3687 (lambda* (#:key inputs #:allow-other-keys)
3688 (let ((lvm2 (assoc-ref inputs "lvm2"))
3689 (udev (assoc-ref inputs "udev")))
3690 (substitute* "Makefile.inc"
3691 (("\\$\\(prefix\\)/usr") "$(prefix)")
3692 ;; Do not save timestamp to avoid gzip "timestamp
3693 ;; out-of-range" warnings.
3694 (("gzip -9") "gzip -9n"))
3695 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3696 (("/usr/include/libdevmapper.h")
3697 (string-append lvm2 "/include/libdevmapper.h"))
3698 (("/usr/include/libudev.h")
3699 (string-append udev "/include/libudev.h")))
3701 (delete 'configure)))) ; no configure script
3704 ("pkg-config" ,pkg-config)
3705 ("valgrind" ,valgrind)))
3707 `(("json-c" ,json-c)
3709 ("liburcu" ,liburcu)
3711 ("readline" ,readline)
3713 (home-page "http://christophe.varoqui.free.fr/")
3714 (synopsis "Access block devices through multiple paths")
3716 "This package provides the following binaries to drive the
3717 Linux Device Mapper multipathing driver:
3719 @item @command{multipath} - Device mapper target autoconfig.
3720 @item @command{multipathd} - Multipath daemon.
3721 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3722 @code{dm} multipath devices.
3723 @item @command{kpartx} - Create device maps from partition tables.
3725 (license (list license:gpl2+ ; main distribution
3726 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3728 (define-public libaio
3735 (string-append "https://releases.pagure.org/libaio/"
3736 name "-" version ".tar.gz")))
3739 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
3740 (build-system gnu-build-system)
3743 (list "CC=gcc" (string-append "prefix=" %output))
3744 #:test-target "partcheck" ; need root for a full 'check'
3746 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
3747 (home-page "https://pagure.io/libaio")
3748 (synopsis "Linux-native asynchronous I/O access library")
3750 "This library enables userspace to use Linux kernel asynchronous I/O
3751 system calls, important for the performance of databases and other advanced
3753 (license license:lgpl2.1+)))
3761 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
3765 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
3766 (build-system gnu-build-system)
3768 `(("libsndfile" ,libsndfile)))
3770 `(("pkg-config" ,pkg-config)))
3771 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3772 (synopsis "Bluetooth subband audio codec")
3774 "The SBC is a digital audio encoder and decoder used to transfer data to
3775 Bluetooth audio output devices like headphones or loudspeakers.")
3776 (license license:gpl2+)))
3778 (define-public bluez
3785 "mirror://kernel.org/linux/bluetooth/bluez-"
3789 "1fpbsl9kkfq6mn6n0dg4h0il4c7fzhwhn79gh907k5b2kwszpvgb"))))
3790 (build-system gnu-build-system)
3793 (let ((out (assoc-ref %outputs "out")))
3794 (list "--sysconfdir=/etc"
3795 "--localstatedir=/var"
3798 ;; Install dbus/udev files to the correct location.
3799 (string-append "--with-dbusconfdir=" out "/etc")
3800 (string-append "--with-udevdir=" out "/lib/udev")))
3802 (modify-phases %standard-phases
3803 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3804 ;; issue (discussion on upstream mailing list:
3805 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3806 (add-before 'check 'skip-wonky-test
3808 (substitute* "unit/test-gatt.c"
3809 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3811 (add-after 'install 'post-install
3812 (lambda* (#:key inputs outputs #:allow-other-keys)
3813 (let* ((out (assoc-ref outputs "out"))
3814 (servicedir (string-append out "/share/dbus-1/services"))
3815 (service "obexd/src/org.bluez.obex.service")
3816 (rule (string-append
3817 out "/lib/udev/rules.d/97-hid2hci.rules")))
3818 ;; Install the obex dbus service file.
3819 (substitute* service
3821 (string-append out "/libexec/bluetooth/obexd")))
3822 (install-file service servicedir)
3823 ;; Fix paths in the udev rule.
3825 (("hid2hci --method")
3826 (string-append out "/lib/udev/hid2hci --method"))
3828 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3831 `(("pkg-config" ,pkg-config)
3832 ("gettext" ,gettext-minimal)))
3837 ("libical" ,libical)
3838 ("readline" ,readline)))
3839 (home-page "http://www.bluez.org/")
3840 (synopsis "Linux Bluetooth protocol stack")
3842 "BlueZ provides support for the core Bluetooth layers and protocols. It
3843 is flexible, efficient and uses a modular implementation.")
3844 (license license:gpl2+)))
3846 (define-public fuse-exfat
3853 "https://github.com/relan/exfat/releases/download/v"
3854 version "/" name "-" version ".tar.gz"))
3857 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3858 (build-system gnu-build-system)
3860 `(("pkg-config" ,pkg-config)))
3863 (home-page "https://github.com/relan/exfat")
3864 (synopsis "Mount exFAT file systems")
3866 "This package provides a FUSE-based file system that provides read and
3867 write access to exFAT devices.")
3868 (license license:gpl2+)))
3870 (define-public fuseiso
3873 (version "20070708")
3876 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
3877 version "/fuseiso-" version ".tar.bz2"))
3880 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
3881 (build-system gnu-build-system)
3883 `(("pkg-config" ,pkg-config)))
3888 (home-page "https://sourceforge.net/projects/fuseiso/")
3889 (synopsis "Mount ISO file system images")
3891 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
3892 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
3893 Ridge, Joliet, and zisofs.")
3894 (license license:gpl2)))
3903 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3904 version ".tar.bz2"))
3905 (patches (search-patches "gpm-glibc-2.26.patch"))
3908 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3909 (build-system gnu-build-system)
3911 '(#:phases (modify-phases %standard-phases
3914 ;; The tarball was not generated with 'make dist' so we
3915 ;; need to bootstrap things ourselves.
3916 (substitute* "autogen.sh"
3917 (("/bin/sh") (which "sh")))
3918 (invoke "./autogen.sh")
3919 (patch-makefile-SHELL "Makefile.include.in")
3922 ;; Make sure programs find libgpm.so.
3923 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3924 (assoc-ref %outputs "out")
3927 `(("texinfo" ,texinfo)
3930 ("autoconf" ,autoconf)
3931 ("automake" ,automake)
3932 ("libtool" ,libtool)))
3933 (home-page "http://www.nico.schottelius.org/software/gpm/")
3934 (synopsis "Mouse support for the Linux console")
3936 "The GPM (general-purpose mouse) daemon is a mouse server for
3937 applications running on the Linux console. It allows users to select items
3938 and copy/paste text in the console and in xterm.")
3939 (license license:gpl2+)))
3941 (define-public btrfs-progs
3943 (name "btrfs-progs")
3947 (uri (string-append "mirror://kernel.org/linux/kernel/"
3948 "people/kdave/btrfs-progs/"
3949 "btrfs-progs-v" version ".tar.xz"))
3952 "0f6s1iwiqbncrvxp74k50s88x6zqf85sjxg04kyni82l1vk1m8xz"))))
3953 (build-system gnu-build-system)
3955 "static")) ; static versions of the binaries in "out"
3957 '(#:phases (modify-phases %standard-phases
3958 (add-after 'build 'build-static
3959 (lambda _ (invoke "make" "static")))
3960 (add-after 'install 'install-bash-completion
3961 (lambda* (#:key outputs #:allow-other-keys)
3962 (let* ((out (assoc-ref outputs "out"))
3963 (bashcomp (string-append out "/etc/bash_completion.d")))
3965 (copy-file "btrfs-completion"
3966 (string-append bashcomp "/btrfs"))
3968 (add-after 'install 'install-static
3969 (let ((staticbin (string-append (assoc-ref %outputs "static")
3973 (string-append "bindir=" staticbin)
3974 "install-static")))))
3975 #:tests? #f ; XXX: require the 'btrfs' kernel module.
3976 #:test-target "test"
3977 #:parallel-tests? #f)) ; tests fail when run in parallel
3978 (inputs `(("e2fsprogs" ,e2fsprogs)
3979 ("libblkid" ,util-linux)
3980 ("libblkid:static" ,util-linux "static")
3981 ("libuuid" ,util-linux)
3982 ("libuuid:static" ,util-linux "static")
3985 ("zlib:static" ,zlib "static")
3986 ("zstd" ,zstd "lib")
3987 ("zstd:static" ,zstd "static")))
3988 (native-inputs `(("pkg-config" ,pkg-config)
3989 ("asciidoc" ,asciidoc)
3992 ;; For building documentation.
3993 ("libxml2" ,libxml2)
3994 ("docbook-xsl" ,docbook-xsl)
3998 ;; The tests need 'grep' with perl regexp support.
4000 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4001 (synopsis "Create and manage btrfs copy-on-write file systems")
4002 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4003 aimed at implementing advanced features while focusing on fault tolerance,
4004 repair and easy administration.")
4005 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4006 ;; GPL2: Everything else.
4007 (license (list license:gpl2 license:gpl2+))))
4009 (define-public btrfs-progs/static
4011 (name "btrfs-progs-static")
4012 (version (package-version btrfs-progs))
4014 (build-system trivial-build-system)
4016 `(("btrfs-progs:static" ,btrfs-progs "static")))
4018 `(#:modules ((guix build utils))
4021 (use-modules (guix build utils)
4025 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4026 (out (assoc-ref %outputs "out"))
4027 (source (string-append btrfs "/bin/btrfs.static"))
4028 (target (string-append out "/bin/btrfs")))
4029 (mkdir-p (dirname target))
4030 (copy-file source target)
4031 (remove-store-references target)
4032 (chmod target #o555)
4034 (home-page (package-home-page btrfs-progs))
4035 (synopsis "Statically-linked btrfs command from btrfs-progs")
4036 (description "This package provides the statically-linked @command{btrfs}
4037 from the btrfs-progs package. It is meant to be used in initrds.")
4038 (license (package-license btrfs-progs))))
4040 (define-public compsize
4044 (home-page "https://github.com/kilobyte/compsize")
4049 (commit (string-append "v" version))))
4051 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4052 (file-name (git-file-name name version))))
4053 (build-system gnu-build-system)
4055 `(("btrfs-progs" ,btrfs-progs)))
4057 `(#:tests? #f ; No tests.
4058 #:make-flags (list "CC=gcc")
4060 (modify-phases %standard-phases
4063 (lambda* (#:key outputs #:allow-other-keys)
4064 (let ((out (assoc-ref outputs "out")))
4065 (install-file "compsize" (string-append out "/bin"))
4066 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4067 (synopsis "Find compression type/ratio on Btrfs files")
4068 (description "@command{compsize} takes a list of files (given as
4069 arguments) on a Btrfs file system and measures used compression types and
4070 effective compression ratio, producing a report.
4072 A directory has no extents but has a (recursive) list of files. A non-regular
4073 file is silently ignored.
4075 As it makes no sense to talk about compression ratio of a partial extent,
4076 every referenced extent is counted whole, exactly once -- no matter if you use
4077 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4078 uncompressed size will not match the number given by @command{tar} or
4079 @command{du}. On the other hand, the space used should be accurate (although
4080 obviously it can be shared with files outside our set).")
4081 (license license:gpl2+)))
4083 (define-public f2fs-tools-1.7
4090 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4091 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4094 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4096 (build-system gnu-build-system)
4099 (modify-phases %standard-phases
4100 (add-after 'install 'install-headers
4101 (lambda* (#:key outputs #:allow-other-keys)
4102 (let* ((out (assoc-ref outputs "out"))
4103 (out-include (string-append out "/include")))
4104 (install-file "include/f2fs_fs.h" out-include)
4105 (install-file "mkfs/f2fs_format_utils.h" out-include)
4108 `(("autoconf" ,autoconf)
4109 ("automake" ,automake)
4110 ("libtool" ,libtool)
4111 ("pkg-config" ,pkg-config)))
4113 `(("libuuid" ,util-linux)
4114 ("libselinux" ,libselinux)))
4115 (home-page "https://f2fs.wiki.kernel.org/")
4116 (synopsis "Userland tools for f2fs")
4118 "F2FS, the Flash-Friendly File System, is a modern file system
4119 designed to be fast and durable on flash devices such as solid-state
4120 disks and SD cards. This package provides the userland utilities.")
4121 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4122 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4123 (license (list license:gpl2 license:lgpl2.1))))
4125 (define-public f2fs-tools
4127 (inherit f2fs-tools-1.7)
4133 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4134 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4137 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4139 `(("libuuid" ,util-linux)))))
4141 (define-public freefall
4144 (version (package-version linux-libre))
4145 (source (package-source linux-libre))
4146 (build-system gnu-build-system)
4148 '(#:phases (modify-phases %standard-phases
4149 (add-after 'unpack 'enter-subdirectory
4151 (chdir "tools/laptop/freefall")
4154 (add-before 'build 'increase-timeout
4156 ;; The default of 2 seconds is too low: it assumes an
4157 ;; open lid and AC power without actually checking.
4158 (substitute* "freefall.c"
4159 (("alarm\\(2\\)") "alarm(5)"))
4161 #:make-flags (list (string-append "PREFIX="
4162 (assoc-ref %outputs "out"))
4164 #:tests? #f)) ;no tests
4165 (home-page (package-home-page linux-libre))
4166 (synopsis "Free-fall protection for spinning laptop hard drives")
4168 "Prevents shock damage to the internal spinning hard drive(s) of some
4169 HP and Dell laptops. When sudden movement is detected, all input/output
4170 operations on the drive are suspended and its heads are parked on the ramp,
4171 where they are less likely to cause damage to the spinning disc. Requires a
4172 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4173 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4174 (license license:gpl2)))
4176 (define-public thinkfan
4184 (url "https://github.com/vmatare/thinkfan.git")
4186 (file-name (git-file-name name version))
4188 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
4189 (build-system cmake-build-system)
4191 `(#:modules ((guix build cmake-build-system)
4194 #:tests? #f ; no test target
4196 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4197 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4199 `("-DUSE_ATASMART:BOOL=ON")
4201 (modify-phases %standard-phases
4202 (add-after 'unpack 'create-init-scripts
4203 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4204 ;; systemd to patch and install their service files. Fake their
4205 ;; presence rather than duplicating the build system below. Leave
4206 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4207 ;; The sysvinit needs manual patching, but since upstream doesn't
4208 ;; even provide the option to install it: don't.
4209 (lambda* (#:key outputs #:allow-other-keys)
4210 (let* ((out (assoc-ref outputs "out"))
4211 (share (string-append out "/share/" ,name)))
4212 (substitute* "CMakeLists.txt"
4213 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4214 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4215 ;; That was easy! Now we just need to fix the destinations.
4217 (string-append out directory)))
4220 `(("pkg-config" ,pkg-config)))
4222 `(("libatasmart" ,libatasmart)
4223 ("yaml-cpp" ,yaml-cpp)))
4224 (home-page "http://thinkfan.sourceforge.net/")
4225 (synopsis "Simple fan control program")
4227 "Thinkfan is a simple fan control program. It reads temperatures,
4228 checks them against configured limits and switches to appropriate (also
4229 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4230 other @code{hwmon} driver that enables temperature reading and fan control
4232 (license license:gpl3+)))
4234 (define-public tpacpi-bat
4242 (url "https://github.com/teleshoes/tpacpi-bat.git")
4243 (commit (string-append "v" version))))
4244 (file-name (git-file-name name version))
4246 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4247 (build-system gnu-build-system)
4249 `(#:tests? #f ; no test target
4251 (modify-phases %standard-phases
4252 (add-after 'unpack 'refer-to-inputs
4254 (substitute* "tpacpi-bat"
4256 (format "~a " (which "cat")))
4257 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4258 ;; loaded. That's the administrator's prerogative; disable it.
4259 (("system \"(modprobe .*)\"" _ match)
4260 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4262 (delete 'configure) ; nothing to configure
4263 (delete 'build) ; nothing to build
4265 (lambda* (#:key outputs #:allow-other-keys)
4266 (let* ((out (assoc-ref outputs "out"))
4267 (bin (string-append out "/bin"))
4268 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4269 (install-file "tpacpi-bat" bin)
4271 ;; There's no man page. Install other forms of documentation.
4272 (for-each (lambda (file)
4273 (let ((target (string-append doc "/" file)))
4274 (mkdir-p (dirname target))
4275 (copy-recursively file target)))
4276 (list "battery_asl" "examples" "README.md"))
4280 (home-page "https://github.com/teleshoes/tpacpi-bat")
4281 (synopsis "ThinkPad battery charge controller")
4283 "Tpacpi-bat is a command-line interface to control battery charging on
4284 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4285 ThinkPad models released after 2011}, starting with the xx20 series. It can
4286 query and set the thresholds at which one or both batteries will start and stop
4287 charging, inhibit charging batteries for a set period of time, or force them to
4288 discharge when they otherwise would not.
4290 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4291 kernel module provided by the @code{acpi-call-linux-module} package, which must
4292 be installed and loaded separately. Only the original vendor firmware is
4294 (license license:gpl3+)))
4296 (define-public ntfs-3g
4299 (version "2017.3.23")
4302 (uri (string-append "https://tuxera.com/opensource/"
4303 "ntfs-3g_ntfsprogs-" version ".tgz"))
4304 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
4307 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
4308 (modules '((guix build utils)))
4310 ;; Install under $prefix.
4311 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4315 (build-system gnu-build-system)
4316 (inputs `(("util-linux" ,util-linux)
4317 ("fuse" ,fuse))) ;libuuid
4318 (native-inputs `(("pkg-config" ,pkg-config)))
4320 '(#:configure-flags (list "--exec-prefix=${prefix}"
4321 "--with-fuse=external" ;use our own FUSE
4322 "--enable-mount-helper"
4323 "--enable-posix-acls"
4324 "--enable-xattr-mappings")
4326 (modify-phases %standard-phases
4327 ;; If users install ntfs-3g, they probably want to make it the
4328 ;; default driver as well, so we opt for sensible defaults and link
4329 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
4330 ;; mount NTFS file systems.)
4331 (add-after 'install 'install-link
4332 (lambda* (#:key outputs #:allow-other-keys)
4333 (let* ((out (assoc-ref outputs "out"))
4334 (sbin (string-append out "/sbin")))
4335 (symlink "mount.ntfs-3g"
4336 (string-append sbin "/mount.ntfs")))
4338 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
4339 (synopsis "Read-write access to NTFS file systems")
4341 "NTFS-3G provides read-write access to NTFS file systems, which are
4342 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4343 The package provides additional NTFS tools.")
4344 (license license:gpl2+)))
4346 (define-public rdma-core
4352 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4353 "/releases/download/v" version "/rdma-core-"
4357 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
4358 (build-system cmake-build-system)
4360 `(#:tests? #f ; no tests
4361 ;; Upstream uses the "ninja" build system and encourage distros
4362 ;; to do the same for consistency. They also recommend using the
4363 ;; "Release" build type.
4364 #:build-type "Release"
4365 #:configure-flags (list "-GNinja"
4367 (string-append "-DRST2MAN_EXECUTABLE="
4368 (assoc-ref %build-inputs
4372 ;; On some configurations, the
4373 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
4374 ;; used by default, would return ENODEV. To
4375 ;; avoid that, use 'write' instead of ioctls,
4376 ;; as suggested in 'CMakeList.txt'.
4377 "-DIOCTL_MODE=write")
4379 (modify-phases %standard-phases
4383 "-j" (number->string (parallel-job-count)))))
4386 (invoke "ninja" "install"))))))
4389 ("pkg-config" ,pkg-config)
4390 ("python" ,python-wrapper)
4391 ("python-docutils" ,python-docutils))) ;for 'rst2man'
4395 (home-page "https://github.com/linux-rdma/rdma-core")
4396 (synopsis "Utilities and libraries for working with RDMA devices")
4398 "This package provides userspace components for the InfiniBand
4399 subsystem of the Linux kernel. Specifically it contains userspace
4400 libraries for the following device nodes:
4403 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4404 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4405 @item @file{/dev/infiniband/umadX} (@code{libibumad})
4408 The following service daemons are also provided:
4410 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4411 @item @code{iwpmd} (for iWARP kernel providers)
4412 @item @code{ibacm} (for InfiniBand communication management assistant)
4414 ;; All library code is dual licensed under GPL2 and a custom MIT
4415 ;; variant. The package also includes some components covered by
4416 ;; other licenses. Consult COPYING.md for full details.
4419 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4420 license:bsd-2 ; Files referring to COPYING.BSD_FB
4421 license:cc0 ; most files in ccan/
4422 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4424 (define-public perftest
4431 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4432 version "/perftest-" version ".g0927198.tar.gz"))
4434 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
4435 (build-system gnu-build-system)
4438 (modify-phases %standard-phases
4439 (add-after 'unpack 'patch-header-paths
4441 (substitute* '("src/raw_ethernet_fs_rate.c"
4442 "src/raw_ethernet_resources.c"
4443 "src/raw_ethernet_resources.h"
4444 "src/raw_ethernet_send_burst_lat.c"
4445 "src/raw_ethernet_send_bw.c"
4446 "src/raw_ethernet_send_lat.c")
4447 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4449 (inputs `(("rdma-core" ,rdma-core)))
4450 (home-page "https://github.com/linux-rdma/perftest/")
4451 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4452 (description "This is a collection of tests written over uverbs intended for
4453 use as a performance micro-benchmark. The tests may be used for hardware or
4454 software tuning as well as for functional testing.
4456 The collection contains a set of bandwidth and latency benchmark such as:
4458 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
4459 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4460 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4461 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4462 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4464 (license license:gpl2)))
4466 (define-public rng-tools
4469 (home-page "https://github.com/nhorman/rng-tools")
4473 (uri (git-reference (url home-page)
4474 (commit (string-append "v" version))))
4475 (file-name (git-file-name name version))
4478 "1clm9i9xg3j79q0d6vinn6dx0nwh1fvzcmkqpcbay7mwsgkknvw2"))))
4479 (build-system gnu-build-system)
4481 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
4482 #:configure-flags '("--without-nistbeacon"
4483 "--without-pkcs11")))
4485 `(("autoconf" ,autoconf)
4486 ("automake" ,automake)
4487 ("pkg-config" ,pkg-config)))
4489 `(("libsysfs" ,sysfsutils)))
4490 (synopsis "Random number generator daemon")
4492 "Monitor a hardware random number generator, and supply entropy
4493 from that to the system kernel's @file{/dev/random} machinery.")
4494 ;; The source package is offered under the GPL2+, but the files
4495 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4496 (license (list license:gpl2 license:gpl2+))))
4498 (define-public cpupower
4501 (version (package-version linux-libre))
4502 (source (package-source linux-libre))
4503 (build-system gnu-build-system)
4505 '(#:phases (modify-phases %standard-phases
4506 (add-after 'unpack 'enter-subdirectory
4508 (chdir "tools/power/cpupower")
4511 (add-before 'build 'fix-makefiles
4513 (substitute* "Makefile"
4515 (("/bin/(install|pwd)" _ command) command))
4516 (substitute* "bench/Makefile"
4517 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4519 #:make-flags (let ((out (assoc-ref %outputs "out")))
4520 (list (string-append "DESTDIR=" out)
4521 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4523 "docdir=/share/doc/cpupower"
4524 "confdir=$(docdir)/examples"
4525 ;; The Makefile recommends the following changes
4527 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4528 #:tests? #f)) ;no tests
4529 (native-inputs `(("gettext" ,gettext-minimal)))
4530 (inputs `(("pciutils" ,pciutils)))
4531 (home-page (package-home-page linux-libre))
4532 (synopsis "CPU frequency and voltage scaling tools for Linux")
4534 "cpupower is a set of user-space tools that use the cpufreq feature of the
4535 Linux kernel to retrieve and control processor features related to power saving,
4536 such as frequency and voltage scaling.")
4537 (license license:gpl2)))
4539 (define-public x86-energy-perf-policy
4541 (name "x86-energy-perf-policy")
4542 (version (package-version linux-libre))
4543 (source (package-source linux-libre))
4544 (build-system gnu-build-system)
4548 (modify-phases %standard-phases
4549 (add-after 'unpack 'enter-subdirectory
4551 (chdir "tools/power/x86/x86_energy_perf_policy")
4554 (add-before 'build 'fix-makefile
4556 (substitute* "Makefile" (("/usr") ""))
4559 (let ((out (assoc-ref %outputs "out")))
4560 (list (string-append "DESTDIR=" out)
4561 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4562 (supported-systems '("i686-linux" "x86_64-linux"))
4563 (home-page (package-home-page linux-libre))
4564 (synopsis "Display and update Intel-CPU energy-performance policy")
4566 "@command{x86_energy_perf_policy} displays and updates energy-performance
4567 policy settings specific to Intel Architecture Processors. Settings are
4568 accessed via Model Specific Register (MSR) updates, no matter if the Linux
4569 cpufreq sub-system is enabled or not.")
4570 (license license:gpl2)))
4572 (define-public haveged
4580 (url "https://github.com/jirka-h/haveged.git")
4581 (commit (string-append "v" version))))
4582 (file-name (git-file-name name version))
4584 (base32 "11kr19n2f87izsj341lv5amhd1wc2ckfmqr9pq5fxix8pkbs94rh"))))
4585 (build-system gnu-build-system)
4586 (home-page "https://www.issihosts.com/haveged")
4587 (synopsis "Entropy source for the Linux random number generator")
4589 "haveged generates an unpredictable stream of random numbers for use by
4590 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4591 standard mechanisms for filling the entropy pool may not be sufficient for
4592 systems with high needs or limited user interaction, such as headless servers.
4594 @command{haveged} runs as a privileged daemon, harvesting randomness from the
4595 indirect effects of hardware events on hidden processor state using the
4596 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
4597 It tunes itself to its environment and provides the same built-in test suite
4598 for the output stream as used on certified hardware security devices.
4600 The quality of the randomness produced by this algorithm has not been proven.
4601 It is recommended to run it together with another entropy source like rngd, and
4602 not as a replacement for it.")
4603 (license (list (license:non-copyleft "file://nist/mconf.h")
4604 (license:non-copyleft "file://nist/packtest.c")
4605 license:public-domain ; nist/dfft.c
4606 license:gpl3+)))) ; everything else
4608 (define-public ecryptfs-utils
4610 (name "ecryptfs-utils")
4615 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4616 version "/+download/ecryptfs-utils_"
4617 version ".orig.tar.gz"))
4620 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4621 (build-system gnu-build-system)
4623 `(#:configure-flags (list "--disable-pywrap")
4625 (modify-phases %standard-phases
4626 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4627 (lambda* (#:key inputs outputs #:allow-other-keys)
4628 (let ((out (assoc-ref outputs "out"))
4629 (utils-linux (assoc-ref inputs "utils-linux"))
4630 (cryptsetup (assoc-ref inputs "cryptsetup"))
4631 (linux-pam (assoc-ref inputs "linux-pam"))
4632 (lvm2 (assoc-ref inputs "lvm2")))
4633 (substitute* '("src/utils/ecryptfs-mount-private"
4634 "src/utils/ecryptfs-umount-private"
4635 "src/utils/ecryptfs-setup-private"
4636 "src/utils/ecryptfs-setup-swap"
4637 "src/utils/mount.ecryptfs.c"
4638 "src/utils/umount.ecryptfs.c"
4639 "src/pam_ecryptfs/pam_ecryptfs.c"
4640 "src/desktop/ecryptfs-mount-private.desktop.in"
4641 "src/desktop/ecryptfs-setup-private.desktop.in")
4643 (string-append utils-linux "/bin/mount"))
4645 (string-append utils-linux "/bin/umount"))
4646 (("/sbin/mount.ecryptfs_private")
4647 (string-append out "/sbin/mount.ecryptfs_private"))
4648 (("/sbin/umount.ecryptfs_private")
4649 (string-append out "/sbin/umount.ecryptfs_private"))
4650 (("/usr/bin/ecryptfs-mount-private")
4651 (string-append out "/bin/ecryptfs-mount-private"))
4652 (("/usr/bin/ecryptfs-rewrite-file")
4653 (string-append out "/bin/ecryptfs-rewrite-file"))
4654 (("/usr/bin/ecryptfs-setup-private")
4655 (string-append out "/bin/ecryptfs-setup-private"))
4656 (("/sbin/cryptsetup")
4657 (string-append cryptsetup "/sbin/cryptsetup"))
4658 (("/sbin/unix_chkpwd")
4659 (string-append linux-pam "/sbin/unix_chkpwd"))
4661 (string-append lvm2 "/sbin/dmsetup")))))))))
4663 `(("intltool" ,intltool)
4664 ("perl" ,perl) ; for pod2man
4665 ("pkg-config" ,pkg-config)))
4667 `(("keyutils" ,keyutils)
4668 ("linux-pam" ,linux-pam)
4669 ("utils-linux" ,util-linux)
4670 ("cryptsetup" ,cryptsetup)
4673 (home-page "http://ecryptfs.org/")
4674 (synopsis "eCryptfs cryptographic file system utilities")
4676 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4677 Each file's cryptographic meta-data is stored inside the file itself, along
4678 with the encrypted contents. This allows individual encrypted files to be
4679 copied between hosts and still be decrypted with the proper key. eCryptfs is a
4680 native Linux file system, and has been part of the Linux kernel since version
4681 2.6.19. This package contains the userland utilities to manage it.")
4682 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4683 ;; grant additional permission to link with OpenSSL.
4684 (license license:gpl2+)))
4686 (define-public libnfsidmap
4688 (name "libnfsidmap")
4693 (uri (string-append "https://fedorapeople.org/~steved/"
4694 name "/" version "/" name "-" version ".tar.bz2"))
4696 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
4697 (build-system gnu-build-system)
4699 `(#:configure-flags (list
4700 (string-append "--with-pluginpath="
4701 (assoc-ref %outputs "out")
4702 "/lib/libnfsidmap"))))
4704 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
4706 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4707 (synopsis "NFSv4 support library for name/ID mapping")
4708 (description "Libnfsidmap is a library holding mulitiple methods of
4709 mapping names to ids and visa versa, mainly for NFSv4. It provides an
4710 extensible array of mapping functions, currently consisting of two choices:
4711 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4712 (license (license:non-copyleft "file://COPYING"
4713 "See COPYING in the distribution."))))
4715 (define-public module-init-tools
4717 (name "module-init-tools")
4722 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
4723 "module-init-tools-" version ".tar.bz2"))
4726 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
4727 (patches (search-patches "module-init-tools-moduledir.patch"))))
4728 (build-system gnu-build-system)
4730 ;; FIXME: The upstream tarball lacks man pages, and building them would
4731 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
4732 ;; but they vanished. In the meantime, fake it.
4734 (modify-phases %standard-phases
4735 (add-before 'configure 'fake-docbook
4737 (substitute* "Makefile.in"
4738 (("^DOCBOOKTOMAN.*$")
4739 "DOCBOOKTOMAN = true\n"))
4741 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
4742 (synopsis "Tools for loading and managing Linux kernel modules")
4744 "Tools for loading and managing Linux kernel modules, such as
4745 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
4746 (license license:gpl2+)))
4748 (define-public mcelog
4754 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
4755 "mcelog.git/snapshot/v" version ".tar.gz"))
4758 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
4759 (file-name (string-append name "-" version ".tar.gz"))
4760 (modules '((guix build utils)))
4763 ;; The snapshots lack a .git directory,
4764 ;; breaking ‘git describe’.
4765 (substitute* "Makefile"
4766 (("\"unknown\"") (string-append "\"v" ,version "\"")))
4768 (build-system gnu-build-system)
4770 `(#:phases (modify-phases %standard-phases
4771 (delete 'configure)) ; no configure script
4772 #:make-flags (let ((out (assoc-ref %outputs "out")))
4774 (string-append "prefix=" out)
4775 (string-append "DOCDIR=" out "/share/doc/mcelog")
4776 "etcprefix=$(DOCDIR)/examples"))
4777 ;; The tests will only run as root on certain supported CPU models.
4779 (supported-systems (list "i686-linux" "x86_64-linux"))
4780 (home-page "https://mcelog.org/")
4781 (synopsis "Machine check monitor for x86 Linux systems")
4783 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
4784 and other hardware errors on x86 systems. It can also perform user-defined
4785 tasks, such as bringing bad pages off-line, when configurable error thresholds
4787 (license license:gpl2)))
4789 (define-public mtd-utils
4796 "ftp://ftp.infradead.org/pub/mtd-utils/"
4797 "mtd-utils-" version ".tar.bz2"))
4800 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
4802 '(#:configure-flags '("--enable-unit-tests")))
4804 `(("cmocka" ,cmocka)
4805 ("pkg-config" ,pkg-config)))
4807 `(("acl" ,acl) ; extended attributes (xattr)
4808 ("libuuid" ,util-linux)
4810 ("openssl" ,openssl) ; optional crypto support
4812 ("zstd" ,zstd "lib")))
4813 (build-system gnu-build-system)
4814 (synopsis "MTD Flash Storage Utilities")
4815 (description "This package provides utilities for testing, partitioning, etc
4817 (home-page "http://www.linux-mtd.infradead.org/")
4819 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
4820 license:mpl1.1 ; All ftl* files
4821 license:expat)))) ; libiniparser
4823 (define-public libseccomp
4829 (uri (string-append "https://github.com/seccomp/libseccomp/"
4830 "releases/download/v" version
4831 "/libseccomp-" version ".tar.gz"))
4834 "0nsq81acrbkdr8zairxbwa33bj2a6126npp76b4srjl472sjfkxm"))
4835 (patches (search-patches "libseccomp-open-aarch64.patch"))))
4836 (build-system gnu-build-system)
4838 `(("which" ,which)))
4839 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
4840 (description "The libseccomp library provides an easy to use, platform
4841 independent, interface to the Linux Kernel's syscall filtering mechanism. The
4842 libseccomp API is designed to abstract away the underlying BPF based syscall
4843 filter language and present a more conventional function-call based filtering
4844 interface that should be familiar to, and easily adopted by, application
4846 (home-page "https://github.com/seccomp/libseccomp")
4847 (license license:lgpl2.1)))
4849 (define-public radeontop
4857 (url "https://github.com/clbr/radeontop.git")
4858 (commit (string-append "v" version))))
4859 (file-name (git-file-name name version))
4861 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
4862 (build-system gnu-build-system)
4864 `(#:phases (modify-phases %standard-phases
4865 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4866 ;; dependency, and doesn't even work on release(!) tarballs.
4867 (add-after 'unpack 'report-correct-version
4869 (substitute* "getver.sh"
4871 (string-append "ver=" ,version)))
4873 (delete 'configure)) ; no configure script
4874 #:make-flags (list "CC=gcc"
4875 (string-append "PREFIX=" %output))
4876 #:tests? #f)) ; no tests
4878 `(("gettext" ,gettext-minimal)
4879 ("pkg-config" ,pkg-config)))
4881 `(("libdrm" ,libdrm)
4882 ("libpciaccess" ,libpciaccess)
4884 ("ncurses" ,ncurses)))
4885 (home-page "https://github.com/clbr/radeontop/")
4886 (synopsis "Usage monitor for AMD Radeon graphics")
4887 (description "RadeonTop monitors resource consumption on supported AMD
4888 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4889 a terminal or saved to a file for further processing. It measures both the
4890 activity of the GPU as a whole, which is also accurate during OpenCL
4891 computations, as well as separate component statistics that are only meaningful
4892 under OpenGL graphics workloads.")
4893 (license license:gpl3)))
4895 (define-public efivar
4901 (uri (string-append "https://github.com/rhboot/" name
4902 "/releases/download/" version "/" name
4903 "-" version ".tar.bz2"))
4906 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
4907 (build-system gnu-build-system)
4909 `(;; Tests require a UEFI system and is not detected in the chroot.
4911 #:make-flags (list (string-append "prefix=" %output)
4912 (string-append "libdir=" %output "/lib")
4914 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4916 (modify-phases %standard-phases
4918 (add-before 'build 'kernel-headers-are-system-headers
4919 (lambda* (#:key inputs #:allow-other-keys)
4920 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
4921 ;; Make sure the kernel headers are treated as system headers
4922 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
4923 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
4926 `(("pkg-config" ,pkg-config)))
4929 (home-page "https://github.com/rhboot/efivar")
4930 (synopsis "Tool and library to manipulate EFI variables")
4931 (description "This package provides a library and a command line
4932 interface to the variable facility of UEFI boot firmware.")
4933 (license license:lgpl2.1+)))
4935 (define-public efibootmgr
4941 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
4942 "/releases/download/" version "/efibootmgr"
4943 "-" version ".tar.bz2"))
4946 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
4947 (build-system gnu-build-system)
4949 `(#:tests? #f ;no tests
4950 #:make-flags (list (string-append "prefix=" %output)
4951 (string-append "libdir=" %output "/lib")
4952 ;; EFIDIR denotes a subdirectory relative to the
4953 ;; EFI System Partition where the loader will be
4954 ;; installed (known as OS_VENDOR in the code).
4955 ;; GRUB overrides this, as such it's only used if
4956 ;; nothing else is specified on the command line.
4958 ;; Treat kernel headers as system headers to prevent
4959 ;; warnings about conflicting types.
4960 (string-append "C_INCLUDE_PATH="
4961 (assoc-ref %build-inputs "kernel-headers")
4963 #:phases (modify-phases %standard-phases (delete 'configure))))
4965 `(("pkg-config" ,pkg-config)))
4967 `(("efivar" ,efivar)
4969 (home-page "https://github.com/rhinstaller/efibootmgr")
4970 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
4972 "@code{efibootmgr} is a user-space application to modify the Intel
4973 Extensible Firmware Interface (EFI) Boot Manager. This application can
4974 create and destroy boot entries, change the boot order, change the next
4975 running boot option, and more.")
4976 (license license:gpl2+)))
4978 (define-public sysstat
4984 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
4985 "sysstat-" version ".tar.xz"))
4988 "0xc3983ccr0dwab1px2jhbgj86pfmmr29k7ggnwjwm1qigmriak1"))))
4989 (build-system gnu-build-system)
4991 `(#:tests? #f ; No test suite.
4992 ;; Without this flag, it tries to install the man pages with group 'root'
4993 ;; and fails because /etc/passwd lacks an entry for the root user.
4995 (list "--disable-file-attr"
4996 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
4998 (modify-phases %standard-phases
4999 ;; The build process tries to create '/var/lib/sa', so we skip that
5001 (add-after 'build 'skip-touching-var
5003 (substitute* "Makefile"
5004 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5007 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5008 (synopsis "Performance monitoring tools for Linux")
5009 (description "The sysstat utilities are a collection of performance
5010 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5011 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5012 @code{sadf} and @code{sa}.")
5013 (license license:gpl2+)))
5015 (define-public light
5023 (url "https://github.com/haikarainen/light.git")
5024 (commit (string-append "v" version))))
5026 (base32 "0zrjipd392bzjvxx0rjrb0cgi0ix1d83fwgw1mcy8kc4d16cgyjg"))
5027 (file-name (git-file-name name version))))
5028 (build-system gnu-build-system)
5030 `(("autoconf" ,autoconf)
5031 ("automake" ,automake)))
5032 (home-page "https://haikarainen.github.io/light/")
5033 (synopsis "GNU/Linux application to control backlights")
5035 "Light is a program to send commands to screen backlight controllers
5036 under GNU/Linux. Features include:
5039 @item It does not rely on X.
5040 @item Light can automatically figure out the best controller to use, making
5041 full use of underlying hardware.
5042 @item It is possible to set a minimum brightness value, as some controllers
5043 set the screen to be pitch black at a vaĺue of 0 (or higher).
5046 Light is the successor of lightscript.")
5047 (license license:gpl3+)))
5049 (define-public brightnessctl
5050 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5052 (name "brightnessctl")
5053 (version (git-version "0.4" "0" commit))
5057 (url "https://github.com/Hummer12007/brightnessctl/")
5059 (file-name (git-file-name name version))
5062 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5063 (build-system gnu-build-system)
5065 '(#:tests? #f ; no tests
5066 #:make-flags (list "CC=gcc"
5067 (string-append "PREFIX=" %output)
5068 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5070 (modify-phases %standard-phases
5072 (add-after 'unpack 'adjust-udev-rules
5074 (substitute* "90-brightnessctl.rules"
5075 (("/bin/") "/run/current-system/profile/bin/"))
5077 (home-page "https://github.com/Hummer12007/brightnessctl")
5078 (synopsis "Backlight and LED brightness control")
5080 "This program allows you read and control device brightness. Devices
5081 include backlight and LEDs. It can also preserve current brightness before
5082 applying the operation, such as on lid close.
5084 The appropriate permissions must be set on the backlight or LED control
5085 interface in sysfs, which can be accomplished with the included udev rules.")
5086 (license license:expat))))
5095 "https://github.com/linrunner/"
5096 (string-upcase name)
5097 "/archive/" version ".tar.gz"))
5098 (file-name (string-append name "-" version ".tar.gz"))
5101 "059kxrpxx580mm6p0z2a421nxngszyh4yqqhbgvn04b6a7dbsa2w"))))
5102 (inputs `(("bash" ,bash)
5104 ("ethtool" ,ethtool)
5108 ("inetutils" ,inetutils)
5111 ("pciutils" ,pciutils)
5115 ("usbutils" ,usbutils)
5116 ("util-linux" ,util-linux)
5117 ("wireless-tools" ,wireless-tools)
5118 ,@(if (let ((system (or (%current-target-system)
5119 (%current-system))))
5120 (or (string-prefix? "i686-" system)
5121 (string-prefix? "x86_64-" system)))
5122 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5124 (build-system gnu-build-system)
5126 `(#:modules ((guix build gnu-build-system)
5130 (modify-phases %standard-phases
5131 (delete 'configure) ; no configure script
5132 (add-before 'build 'setenv
5133 (lambda* (#:key outputs #:allow-other-keys)
5134 (let ((out (assoc-ref outputs "out")))
5135 (setenv "TLP_WITH_SYSTEMD" "0")
5136 (setenv "TLP_NO_INIT" "1")
5137 (setenv "TLP_NO_PMUTILS" "1")
5138 (setenv "TLP_SBIN" (string-append out "/bin"))
5139 (setenv "TLP_BIN" (string-append out "/bin"))
5140 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5141 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5142 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5143 (setenv "TLP_CONF" "/etc/tlp")
5145 (string-append out "/lib/elogind/system-sleep"))
5147 (string-append out "/share/bash-completion/completions"))
5148 (setenv "TLP_MAN" (string-append out "/share/man"))
5149 (setenv "TLP_META" (string-append out "/share/metainfo"))
5151 (delete 'check) ; no tests
5152 (add-before 'install 'fix-installation
5154 ;; Stop the Makefile from trying to create system directories.
5155 (substitute* "Makefile"
5156 (("\\[ -f \\$\\(_CONF\\) \\]") "#")
5157 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5161 (invoke "make" "install-tlp" "install-man")))
5162 (add-after 'install 'wrap
5163 (lambda* (#:key inputs outputs #:allow-other-keys)
5164 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5165 (bin-files (find-files bin ".*")))
5166 (define (bin-directory input-name)
5167 (let ((p (assoc-ref inputs input-name)))
5168 (and p (string-append p "/bin"))))
5169 (define (sbin-directory input-name)
5170 (string-append (assoc-ref inputs input-name) "/sbin"))
5171 (for-each (lambda (program)
5172 (wrap-program program
5175 (filter-map bin-directory
5187 "x86-energy-perf-policy"))
5188 (filter-map sbin-directory
5194 "wireless-tools"))))))
5197 (home-page "http://linrunner.de/en/tlp/tlp.html")
5198 (synopsis "Power management tool for Linux")
5199 (description "TLP is a power management tool for Linux. It comes with
5200 a default configuration already optimized for battery life. Nevertheless,
5201 TLP is customizable to fulfil system requirements. TLP settings are applied
5202 every time the power supply source is changed.")
5203 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5205 (license (list license:gpl2+ license:gpl3+))))
5213 (uri (string-append "https://www.ezix.org/software/"
5214 "files/lshw-" version
5218 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5219 (build-system gnu-build-system)
5221 `(#:phases (modify-phases %standard-phases (delete 'configure))
5222 #:tests? #f ; no tests
5224 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5225 (synopsis "List hardware information")
5227 "@command{lshw} (Hardware Lister) is a small tool to provide
5228 detailed information on the hardware configuration of the machine.
5229 It can report exact memory configuration, firmware version, mainboard
5230 configuration, CPU version and speed, cache configuration, bus speed,
5231 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5232 machines (PowerMac G4 is known to work).")
5233 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5234 (license license:gpl2+)))
5236 (define-public libmnl
5243 (uri (string-append "mirror://netfilter.org/libmnl/"
5244 "libmnl-" version ".tar.bz2"))
5247 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5248 (build-system gnu-build-system)
5249 (home-page "https://www.netfilter.org/projects/libmnl/")
5250 (synopsis "Netlink utility library")
5251 (description "Libmnl is a minimalistic user-space library oriented to
5252 Netlink developers. There are a lot of common tasks in parsing, validating,
5253 constructing of both the Netlink header and TLVs that are repetitive and easy to
5254 get wrong. This library aims to provide simple helpers that allows you to
5255 re-use code and to avoid re-inventing the wheel.")
5256 (license license:lgpl2.1+)))
5258 (define-public libnftnl
5265 (uri (string-append "mirror://netfilter.org/libnftnl/"
5266 "libnftnl-" version ".tar.bz2"))
5268 (base32 "1wqlxf76bkqf3qhka9sw32qhb2ni20q1k6rn3iril2kw482lvpk6"))
5270 (search-patches "libnftnl-dont-check-NFTNL_FLOWTABLE_SIZE.patch"))))
5271 (build-system gnu-build-system)
5273 `(("pkg-config" ,pkg-config)))
5275 `(("libmnl" ,libmnl)))
5276 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5277 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5278 (description "Libnftnl is a userspace library providing a low-level netlink
5279 programming interface to the in-kernel nf_tables subsystem. The library
5280 libnftnl has been previously known as libnftables. This library is currently
5282 (license license:gpl2+)))
5284 (define-public nftables
5291 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
5293 (string-append "https://www.nftables.org/projects/nftables"
5294 "/files/nftables-" version ".tar.bz2")))
5296 (base32 "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm"))))
5297 (build-system gnu-build-system)
5298 (arguments `(#:configure-flags
5299 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5300 (inputs `(("bison" ,bison)
5304 ("libnftnl" ,libnftnl)
5305 ("readline" ,readline)))
5306 (native-inputs `(("pkg-config" ,pkg-config)))
5307 (home-page "https://www.nftables.org")
5308 (synopsis "Userspace utility for Linux packet filtering")
5309 (description "nftables is the project that aims to replace the existing
5310 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5311 filtering framework, a new userspace utility and also a compatibility layer for
5312 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5313 infrastructure such as the existing hooks, the connection tracking system, the
5314 userspace queueing component and the logging subsystem.")
5315 (license license:gpl2)))
5317 (define-public proot
5325 (url "https://github.com/proot-me/PRoot.git")
5326 (commit (string-append "v" version))))
5327 (file-name (git-file-name name version))
5329 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5330 (patches (search-patches "proot-test-fhs.patch"))))
5331 (build-system gnu-build-system)
5333 '(#:make-flags '("-C" "src")
5335 #:phases (modify-phases %standard-phases
5337 (add-before 'build 'set-shell-file-name
5338 (lambda* (#:key inputs #:allow-other-keys)
5339 (substitute* (find-files "src" "\\.[ch]$")
5342 (assoc-ref inputs "bash")
5345 (add-before 'check 'fix-fhs-assumptions-in-tests
5347 (substitute* "tests/test-c6b77b77.mk"
5348 (("/bin/bash") (which "bash"))
5349 (("/usr/bin/test") (which "test")))
5350 (substitute* '("tests/test-16573e73.c")
5351 (("/bin/([a-z-]+)" _ program)
5354 (substitute* (find-files "tests" "\\.sh$")
5355 ;; Some of the tests try to "bind-mount" /bin/true.
5357 (string-append "-b " (which "true") ":"))
5358 ;; Likewise for /bin.
5359 (("-b /bin:") "-b /gnu:")
5360 ;; Others try to run /bin/sh.
5361 (("/bin/sh") (which "sh"))
5362 ;; Others assume /etc/fstab exists.
5363 (("/etc/fstab") "/etc/passwd"))
5365 (substitute* "tests/GNUmakefile"
5366 (("-b /bin:") "-b /gnu:"))
5368 ;; XXX: This test fails in an obscure corner case, just
5370 (delete-file "tests/test-kkkkkkkk.c")
5375 (let ((n (parallel-job-count)))
5376 ;; For some reason we get lots of segfaults with
5377 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5378 (setenv "PROOT_NO_SECCOMP" "1")
5380 ;; Most of the tests expect "/bin" to be in $PATH so
5381 ;; they can run things that live in $ROOTFS/bin.
5383 (string-append (getenv "PATH") ":/bin"))
5385 (invoke "make" "check" "-C" "tests"
5387 "-j" (number->string n)))))
5389 (lambda* (#:key outputs #:allow-other-keys)
5390 ;; The 'install' rule does nearly nothing.
5391 (let* ((out (assoc-ref outputs "out"))
5392 (man1 (string-append out "/share/man/man1")))
5393 ;; TODO: 'make install-care' (does not even
5394 ;; build currently.)
5395 (invoke "make" "-C" "src" "install"
5396 (string-append "PREFIX=" out))
5399 (copy-file "doc/proot/man.1"
5400 (string-append man1 "/proot.1"))
5402 (native-inputs `(("which" ,which)
5404 ;; For 'mcookie', used by some of the tests.
5405 ("util-linux" ,util-linux)))
5406 (inputs `(("talloc" ,talloc)))
5407 (home-page "https://github.com/proot-me/PRoot")
5408 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5410 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5411 and @code{binfmt_misc}. This means that users don't need any privileges or
5412 setup to do things like using an arbitrary directory as the new root
5413 file system, making files accessible somewhere else in the file system
5414 hierarchy, or executing programs built for another CPU architecture
5415 transparently through QEMU user-mode. Also, developers can use PRoot as a
5416 generic process instrumentation engine thanks to its extension mechanism.
5417 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5418 available in the kernel Linux.")
5419 (license license:gpl2+)))
5421 (define-public proot-static
5424 (name "proot-static")
5426 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5427 (inputs `(("talloc" ,talloc/static)))
5429 (substitute-keyword-arguments (package-arguments proot)
5430 ((#:make-flags flags)
5431 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5433 `(modify-phases ,phases
5434 (add-after 'strip 'remove-store-references
5435 (lambda* (#:key outputs #:allow-other-keys)
5436 (let* ((out (assoc-ref outputs "out")))
5437 (with-directory-excursion out
5438 (remove-store-references "bin/proot")
5440 ((#:allowed-references _ '("out"))
5443 (define-public cpuid
5446 (version "20180519")
5449 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5450 version ".src.tar.gz"))
5453 "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
5454 (build-system gnu-build-system)
5456 '(#:make-flags '("CC=gcc")
5457 #:tests? #f ; no tests
5458 #:phases (modify-phases %standard-phases
5459 (delete 'configure) ; no configure script
5460 (add-before 'install 'fix-makefile
5461 (lambda* (#:key outputs #:allow-other-keys)
5462 (substitute* "Makefile"
5463 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5464 ;; Make the compressed manpages writable so that the
5465 ;; reset-gzip-timestamps phase does not error out.
5466 (substitute* "Makefile"
5467 (("-m 444") "-m 644"))
5469 (inputs `(("perl" ,perl)))
5470 (supported-systems '("i686-linux" "x86_64-linux"))
5471 (home-page "http://www.etallen.com/cpuid.html")
5472 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5473 (description "cpuid dumps detailed information about the CPU(s) gathered
5474 from the CPUID instruction, and also determines the exact model of CPU(s). It
5475 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5476 NexGen, Rise, and SiS CPUs.")
5477 (license license:gpl2+)))
5479 (define-public jmtpfs
5486 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5488 (file-name (string-append name "-" version ".tar.gz"))
5491 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5492 (build-system gnu-build-system)
5496 ("libmtp" ,libmtp)))
5498 `(("pkg-config" ,pkg-config)))
5499 (home-page "https://github.com/JasonFerrara/jmtpfs")
5500 (synopsis "Use a FUSE file system to access data over MTP")
5501 (description "jmtpfs uses FUSE (file system in userspace) to provide access
5502 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
5503 the MTP device as a file system.")
5504 (license license:gpl3)))
5506 (define-public procenv
5513 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5515 (file-name (string-append name "-" version ".tar.gz"))
5517 (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
5518 (build-system gnu-build-system)
5519 (arguments `(#:configure-flags '("--disable-silent-rules")))
5520 (native-inputs `(("pkg-config" ,pkg-config)))
5521 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5522 ("groff" ,groff) ; for tests
5523 ("libselinux" ,libselinux)))
5524 (synopsis "Utility to show process environment")
5525 (description "Procenv is a command-line tool that displays as much detail about
5526 itself and its environment as possible. It can be used as a test
5527 tool, to understand the type of environment a process runs in, and for
5528 comparing system environments.")
5529 (home-page "http://github.com/jamesodhunt/procenv/")
5530 (license license:gpl3+)))
5532 (define-public libfabric
5540 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5541 version "/libfabric-" version ".tar.bz2"))
5543 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5544 (build-system gnu-build-system)
5545 (inputs `(("rdma-core" ,rdma-core)
5546 ,@(match (%current-system)
5547 ((member (package-supported-systems psm))
5551 (home-page "https://ofiwg.github.io/libfabric/")
5552 (synopsis "Open Fabric Interfaces")
5554 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5555 communication services to applications. OFI is best described as a collection
5556 of libraries and applications used to export fabric services. The key
5557 components of OFI are: application interfaces, provider libraries, kernel
5558 services, daemons, and test applications.
5560 Libfabric is a core component of OFI. It is the library that defines and
5561 exports the user-space API of OFI, and is typically the only software that
5562 applications deal with directly. It works in conjunction with provider
5563 libraries, which are often integrated directly into libfabric.")
5564 (license (list license:bsd-2 license:gpl2)))) ;dual
5569 (version "3.3.20170428")
5570 (home-page "https://github.com/intel/psm")
5574 (uri (git-reference (url home-page)
5575 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5576 (file-name (string-append "psm-" version ".tar.gz"))
5578 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5579 (patches (search-patches
5580 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5581 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5582 "psm-repro.patch" ; reproducibility
5583 "psm-disable-memory-stats.patch"))))
5584 (build-system gnu-build-system)
5585 (outputs '("out" "debug"))
5586 (inputs `(("libuuid" ,util-linux)))
5588 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5589 ,(string-append "INSTALL_PREFIX=" %output)
5590 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5592 #:phases (modify-phases %standard-phases
5594 (add-after 'unpack 'patch-/usr/include
5596 (substitute* "Makefile"
5597 (("\\$\\{DESTDIR}/usr/include")
5598 (string-append %output "/include")))
5599 (substitute* "Makefile"
5600 (("/lib64") "/lib"))
5602 (add-after 'unpack 'patch-sysmacros
5604 (substitute* "ipath/ipath_proto.c"
5605 (("#include <sys/poll.h>" m)
5606 (string-append m "\n"
5607 "#include <sys/sysmacros.h>")))
5609 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5611 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5612 communications interface for the True Scale family of products. PSM users are
5613 enabled with mechanisms necessary to implement higher level communications
5614 interfaces in parallel environments.")
5615 ;; Only Intel-compatable processors are supported.
5616 (supported-systems '("i686-linux" "x86_64-linux"))
5617 (license (list license:bsd-2 license:gpl2)))) ;dual
5619 (define-public snapscreenshot
5621 (name "snapscreenshot")
5622 (version "1.0.14.3")
5626 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5627 name "-" version ".tar.bz2"))
5629 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5630 (build-system gnu-build-system)
5633 (let ((out (assoc-ref %outputs "out")))
5634 (list (string-append "BINDIR=" out "/bin")
5635 (string-append "MANDIR=" out "/share/man")))
5636 #:tests? #f ; no test suite
5638 (modify-phases %standard-phases
5639 (delete 'configure) ; ./configure is a snarky no-op
5640 (add-before 'install 'fix-ownership
5641 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5643 (substitute* "depfun.mak"
5644 ((" -o bin -g bin ") " "))
5646 (add-before 'install 'create-output-directories
5647 (lambda* (#:key outputs #:allow-other-keys)
5648 (let ((out (assoc-ref outputs "out")))
5649 (mkdir-p (string-append out "/share/man/man1"))
5651 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
5652 (synopsis "Take screenshots of one or more Linux text consoles")
5654 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
5655 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
5656 relevant @file{/dev/vcs*} file(s).")
5657 (license license:gpl2)))
5659 (define-public fbcat
5666 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
5667 version "/" name "-" version ".tar.gz"))
5669 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
5670 (build-system gnu-build-system)
5672 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
5673 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
5674 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
5675 `(("pnmtopng" ,netpbm)))
5676 (outputs (list "out" "fbgrab"))
5680 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5681 #:tests? #f ; no tests
5683 (modify-phases %standard-phases
5684 (delete 'configure) ; no configure script
5685 (add-after 'build 'qualify-references
5686 (lambda* (#:key inputs outputs #:allow-other-keys)
5687 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5688 (out (assoc-ref outputs "out")))
5689 (substitute* "fbgrab"
5691 (string-append out "/bin/" all))
5693 (string-append pnmtopng "/bin/" all)))
5695 (add-after 'install 'split-fbgrab-output
5696 (lambda* (#:key outputs #:allow-other-keys)
5697 (let* ((out (assoc-ref outputs "out"))
5698 (out:fbgrab (assoc-ref outputs "fbgrab")))
5699 (for-each (lambda (file)
5700 (let ((old (string-append out "/" file))
5701 (new (string-append out:fbgrab "/" file)))
5702 (mkdir-p (dirname new))
5703 (rename-file old new)))
5705 "share/man/man1/fbgrab.1"))
5707 (home-page "https://jwilk.net/software/fbcat")
5708 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
5710 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
5711 a dump therof. It supports a wide range of drivers and pixel formats.
5712 @command{fbcat} can take screenshots of virtually any application that can be
5713 made to write its output to the framebuffer, including (but not limited to)
5714 text-mode or graphical applications that don't use a display server.
5716 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
5717 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
5718 (license license:gpl2)))
5720 (define-public libcgroup
5728 "mirror://sourceforge/libcg/" name "/"
5729 version "/" name "-" version ".tar.bz2"))
5731 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
5732 (build-system gnu-build-system)
5739 `(("linux-pam" ,linux-pam)))
5740 (home-page "https://sourceforge.net/projects/libcg/")
5741 (synopsis "Control groups management tools")
5742 (description "Control groups is Linux kernel method for process resource
5743 restriction, permission handling and more. This package provides userspace
5744 interface to this kernel feature.")
5745 (license license:lgpl2.1)))
5747 (define-public mbpfan
5755 (url "https://github.com/dgraziotin/mbpfan.git")
5756 (commit (string-append "v" version))))
5757 (file-name (git-file-name name version))
5759 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5760 (build-system gnu-build-system)
5762 '(#:tests? #f ; tests ask to be run as root
5763 #:make-flags (let ((out (assoc-ref %outputs "out")))
5764 (list (string-append "DESTDIR=" out)
5767 (modify-phases %standard-phases
5768 (add-after 'unpack 'patch-paths
5770 (substitute* "Makefile"
5773 (delete 'configure)))) ; there's no configure phase
5774 (home-page "https://github.com/dgraziotin/mbpfan")
5775 (synopsis "Control fan speed on Macbooks")
5777 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
5778 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
5779 module. It can be executed as a daemon or in the foreground with root
5781 (license license:gpl3+)))
5790 (url "https://github.com/intel/opa-psm2.git")
5791 (commit (string-append "PSM2_" version))))
5792 (file-name (git-file-name name version))
5795 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
5796 (build-system gnu-build-system)
5799 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5801 #:phases (modify-phases %standard-phases
5803 (add-after 'unpack 'patch-Makefiles
5805 (substitute* "Makefile"
5808 (substitute* "compat/Makefile"
5814 (setenv "DESTDIR" %output)
5815 (invoke "make" "install")
5818 `(("rdma-core" ,rdma-core)
5819 ("numactl" ,numactl)))
5820 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
5822 "This package is low-level user-level Intel's communications interface.
5823 The PSM2 API is a high-performance vendor-specific protocol that provides a
5824 low-level communications interface for the Intel Omni-Path family of
5825 high-speed networking devices.")
5826 (home-page "https://github.com/intel/opa-psm2")
5827 ;; Only the x86_64 architecure is supported.
5828 (supported-systems '("x86_64-linux"))
5829 (license (list license:bsd-3 license:gpl2)))) ; dual
5831 (define-public libpfm4
5837 (uri (string-append "mirror://sourceforge/perfmon2/"
5838 name "/libpfm-" version ".tar.gz"))
5841 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
5842 (build-system gnu-build-system)
5844 '(#:modules ((guix build utils)
5845 (guix build gnu-build-system))
5846 #:phases (modify-phases %standard-phases
5850 (lambda* (#:key inputs outputs #:allow-other-keys)
5851 (let* ((out (assoc-ref outputs "out")))
5856 (lambda* (#:key outputs #:allow-other-keys)
5857 (let* ((out (assoc-ref outputs "out")))
5859 (string-append "PREFIX=" out)
5862 (synopsis "Performance event monitoring library")
5864 "This package provides a library called libpfm4, which is used to develop
5865 monitoring tools exploiting the performance monitoring events such as those
5866 provided by the Performance Monitoring Unit (PMU) of modern processors.
5868 Libpfm4 helps convert from an event name, expressed as a string, to the event
5869 encoding that is either the raw event as documented by the hardware vendor or
5870 the OS-specific encoding. In the latter case, the library is able to prepare
5871 the OS-specific data structures needed by the kernel to setup the event.
5873 libpfm4 provides support for the @code{perf_events} interface, which was
5874 introduced in Linux 2.6.31.")
5875 (home-page "http://perfmon2.sourceforge.net/")
5876 (license license:expat)))
5878 (define-public libnfnetlink
5880 (name "libnfnetlink")
5885 "https://www.netfilter.org/projects/libnfnetlink/files/"
5886 "libnfnetlink-" version ".tar.bz2"))
5889 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
5890 (build-system gnu-build-system)
5891 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
5892 (synopsis "Low-level netfilter netlink communication library")
5894 "@code{libnfnetlink} is the low-level library for netfilter related
5895 kernel/userspace communication. It provides a generic messaging
5896 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
5897 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
5898 management tools in userspace.")
5899 (license license:gpl2)))
5901 (define-public go-netlink
5908 (url "https://github.com/vishvananda/netlink.git")
5909 (commit (string-append "v" version))))
5910 (file-name (git-file-name name version))
5913 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
5914 (build-system go-build-system)
5916 `(#:import-path "github.com/vishvananda/netlink"))
5918 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
5919 ("go-netns" ,go-netns)))
5920 (home-page "https://github.com/vishvananda/netlink")
5921 (synopsis "Simple netlink library for Go")
5922 (description "The netlink package provides a simple netlink library for
5923 Go. Netlink is the interface a user-space program in Linux uses to
5924 communicate with the kernel. It can be used to add and remove interfaces, set
5925 IP addresses and routes, and configure IPsec.")
5926 (license license:asl2.0)))
5928 (define-public xfsprogs
5935 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
5936 "xfsprogs-" version ".tar.gz"))
5939 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
5940 (build-system gnu-build-system)
5941 (outputs (list "out" "python"))
5943 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
5945 (modify-phases %standard-phases
5946 (add-after 'install 'separate-python-output
5947 (lambda* (#:key outputs #:allow-other-keys)
5948 (let ((out (assoc-ref outputs "out"))
5949 (python (assoc-ref outputs "python")))
5952 (mkdir-p (string-append python (dirname script)))
5953 (rename-file (string-append out script)
5954 (string-append python script)))
5955 (list "/sbin/xfs_scrub_all"))
5957 (add-after 'install 'install-headers
5959 (invoke "make" "install-dev"))))))
5961 `(("gettext" ,gettext-minimal)
5962 ("util-linux" ,util-linux)))
5964 `(("python" ,python-wrapper)))
5965 (home-page "https://xfs.wiki.kernel.org/")
5966 (synopsis "XFS file system tools")
5967 (description "This package provides commands to create and check XFS
5969 ;; The library "libhandle" and the headers in "xfslibs-dev" are
5970 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
5971 (license (list license:gpl2 license:lgpl2.1))))
5973 (define-public genext2fs
5980 (url "https://github.com/jeremie-koenig/genext2fs.git")
5981 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
5982 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
5983 (file-name (git-file-name name version))
5985 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
5986 (build-system gnu-build-system)
5989 (modify-phases %standard-phases
5990 (add-after 'unpack 'apply-debian-patches
5991 ;; Debian changes (the revision after ‘-’ in VERSION) are
5992 ;; maintained as separate patches. Apply those relevant to us.
5996 (invoke "patch" "-p1" "-i"
5997 (string-append "debian/patches/" file-name)))
5998 (list "blocksize+creator.diff" ; add -B/-o options
5999 "byteswap_fix.diff"))
6002 `(("autoconf" ,autoconf)
6003 ("automake" ,automake)))
6004 (home-page "https://github.com/jeremie-koenig/genext2fs")
6005 (synopsis "Generate ext2 file system as a normal user")
6006 (description "This package provides a program to generate an ext2
6007 file system as a normal (non-root) user. It does not require you to mount
6008 the image file to copy files on it, nor does it require that you become
6009 the superuser to make device nodes.")
6010 (license license:gpl2)))
6012 (define-public fakeroot
6018 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6019 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6020 (file-name (string-append name "-" version ".tar.gz"))
6023 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6024 (build-system gnu-build-system)
6027 (modify-phases %standard-phases
6028 (add-after 'configure 'patch-Makefile
6030 ;; Note: The root of the problem is already in "Makefile.am".
6031 (substitute* "Makefile"
6032 (("/bin/sh") (which "sh")))
6034 (add-after 'unpack 'patch-getopt
6035 (lambda* (#:key inputs #:allow-other-keys)
6036 (substitute* "scripts/fakeroot.in"
6038 (string-append (assoc-ref inputs "util-linux")
6041 (add-before 'configure 'setenv
6043 (setenv "LIBS" "-lacl")
6045 (add-before 'check 'prepare-check
6047 (setenv "SHELL" (which "bash"))
6048 (setenv "VERBOSE" "1")
6049 (substitute* "test/t.touchinstall"
6050 ;; We don't have the name of the root user, so use ID=0.
6051 (("grep root") "grep \"\\<0\\>\""))
6052 (substitute* "test/tartest"
6053 ;; We don't have the name of the root group, so use ID=0.
6054 (("ROOTGROUP=root") "ROOTGROUP=0")
6055 ;; We don't have the name of the daemon user, so use IDs.
6056 (("daemon:sys") "1:3")
6058 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6059 (substitute* "test/compare-tar"
6060 (("tar -tvf") "tar --numeric-owner -tvf"))
6064 ("sharutils" ,sharutils) ; for the tests
6065 ("xz" ,xz))) ; for the tests
6067 `(("libcap" ,libcap)
6068 ("util-linux" ,util-linux)))
6069 (synopsis "Provides a fake root environment")
6070 (description "@command{fakeroot} runs a command in an environment where
6071 it appears to have root privileges for file manipulation. This is useful
6072 for allowing users to create archives (tar, ar, .deb etc.) with files in
6073 them with root permissions/ownership. Without fakeroot one would have to
6074 have root privileges to create the constituent files of the archives with
6075 the correct permissions and ownership, and then pack them up, or one would
6076 have to construct the archives directly, without using the archiver.")
6077 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6078 (license license:gpl3+)))
6080 (define-public inputattach
6082 (name "inputattach")
6087 (url "https://github.com/linuxwacom/input-wacom.git")
6088 (commit (string-append "input-wacom-" version))))
6089 (file-name (git-file-name name version))
6091 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6092 (build-system gnu-build-system)
6095 (modify-phases %standard-phases
6099 (lambda* (#:key inputs #:allow-other-keys)
6100 (with-directory-excursion "inputattach"
6101 (invoke (string-append (assoc-ref inputs "gcc")
6103 "-O2" "-o" "inputattach" "inputattach.c"))
6107 (lambda* (#:key outputs #:allow-other-keys)
6108 (let ((target-dir (string-append
6109 (assoc-ref outputs "out")
6111 (mkdir-p target-dir)
6112 (copy-file "inputattach/inputattach"
6113 (string-append target-dir
6116 (home-page "https://linuxwacom.github.io/")
6117 (synopsis "Dispatch input peripherals events to a device file")
6118 (description "inputattach dispatches input events from several device
6119 types and interfaces and translates so that the X server can use them.")
6120 (license license:gpl2+)))
6122 (define-public pipewire
6129 (url "https://github.com/PipeWire/pipewire")
6131 (file-name (git-file-name name version))
6134 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
6135 (build-system meson-build-system)
6137 '(#:configure-flags '("-Dsystemd=false")))
6139 `(("pkg-config" ,pkg-config)))
6141 `(("alsa-lib" ,alsa-lib)
6145 ("gstreamer" ,gstreamer)
6146 ("gst-plugins-base" ,gst-plugins-base)
6150 (home-page "https://pipewire.org/")
6151 (synopsis "Server and user space API to deal with multimedia pipelines")
6153 "PipeWire is a project that aims to greatly improve handling of audio and
6154 video under Linux. It aims to support the usecases currently handled by both
6155 PulseAudio and Jack and at the same time provide same level of powerful handling
6156 of Video input and output. It also introduces a security model that makes
6157 interacting with audio and video devices from containerized applications easy,
6158 with supporting Flatpak applications being the primary goal. Alongside Wayland
6159 and Flatpak we expect PipeWire to provide a core building block for the future
6160 of Linux application development.")
6161 (license license:lgpl2.0+)))
6170 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6172 (file-name (git-file-name name version))
6175 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6176 (build-system gnu-build-system)
6179 (modify-phases %standard-phases
6180 (add-after 'unpack 'fix-dbus-tests
6182 (substitute* '("unit/test-dbus-message-fds.c"
6183 "unit/test-dbus-properties.c"
6185 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6189 ("libtool" ,libtool)))
6191 `(("autoconf" ,autoconf)
6192 ("pkgconfig" ,pkg-config)
6193 ("automake" ,automake)))
6194 (home-page "https://01.org/ell")
6195 (synopsis "Embedded Linux Library")
6196 (description "The Embedded Linux* Library (ELL) provides core, low-level
6197 functionality for system daemons. It typically has no dependencies other than
6198 the Linux kernel, C standard library, and libdl (for dynamic linking). While
6199 ELL is designed to be efficient and compact enough for use on embedded Linux
6200 platforms, it is not limited to resource-constrained systems.")
6201 (license license:lgpl2.1+)))