1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
12 ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
13 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
14 ;;; Copyright © 2016, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
22 ;;; Copyright © 2017, 2018, 2020 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, 2019 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, 2020 Brendan Tildesley <mail@brendan.scot>
32 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
33 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
34 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
35 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
36 ;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
37 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
38 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
39 ;;; Copyright © 2019, 2020 Brice Waegeneire <brice@waegenei.re>
40 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
41 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
42 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
43 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
44 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
45 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
46 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
47 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
48 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
49 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
50 ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
51 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
53 ;;; This file is part of GNU Guix.
55 ;;; GNU Guix is free software; you can redistribute it and/or modify it
56 ;;; under the terms of the GNU General Public License as published by
57 ;;; the Free Software Foundation; either version 3 of the License, or (at
58 ;;; your option) any later version.
60 ;;; GNU Guix is distributed in the hope that it will be useful, but
61 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
62 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
63 ;;; GNU General Public License for more details.
65 ;;; You should have received a copy of the GNU General Public License
66 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
68 (define-module (gnu packages linux)
69 #:use-module (gnu packages)
70 #:use-module (gnu packages acl)
71 #:use-module (gnu packages admin)
72 #:use-module (gnu packages algebra)
73 #:use-module (gnu packages audio)
74 #:use-module (gnu packages autotools)
75 #:use-module (gnu packages backup)
76 #:use-module (gnu packages base)
77 #:use-module (gnu packages bash)
78 #:use-module (gnu packages bison)
79 #:use-module (gnu packages boost)
80 #:use-module (gnu packages calendar)
81 #:use-module (gnu packages check)
82 #:use-module (gnu packages cpio)
83 #:use-module (gnu packages crypto)
84 #:use-module (gnu packages cryptsetup)
85 #:use-module (gnu packages compression)
86 #:use-module (gnu packages dbm)
87 #:use-module (gnu packages datastructures)
88 #:use-module (gnu packages docbook)
89 #:use-module (gnu packages documentation)
90 #:use-module (gnu packages elf)
91 #:use-module (gnu packages flex)
92 #:use-module (gnu packages file)
93 #:use-module (gnu packages freedesktop)
94 #:use-module (gnu packages gawk)
95 #:use-module (gnu packages gcc)
96 #:use-module (gnu packages gettext)
97 #:use-module (gnu packages glib)
98 #:use-module (gnu packages golang)
99 #:use-module (gnu packages gperf)
100 #:use-module (gnu packages gstreamer)
101 #:use-module (gnu packages gtk)
102 #:use-module (gnu packages haskell-apps)
103 #:use-module (gnu packages haskell-xyz)
104 #:use-module (gnu packages libunwind)
105 #:use-module (gnu packages libusb)
106 #:use-module (gnu packages llvm)
107 #:use-module (gnu packages lua)
108 #:use-module (gnu packages man)
109 #:use-module (gnu packages maths)
110 #:use-module (gnu packages multiprecision)
111 #:use-module (gnu packages ncurses)
112 #:use-module (gnu packages netpbm)
113 #:use-module (gnu packages networking)
114 #:use-module (gnu packages ninja)
115 #:use-module (gnu packages nss)
116 #:use-module (gnu packages perl)
117 #:use-module (gnu packages pciutils)
118 #:use-module (gnu packages pkg-config)
119 #:use-module (gnu packages popt)
120 #:use-module (gnu packages pulseaudio)
121 #:use-module (gnu packages python)
122 #:use-module (gnu packages python-xyz)
123 #:use-module (gnu packages readline)
124 #:use-module (gnu packages rrdtool)
125 #:use-module (gnu packages samba)
126 #:use-module (gnu packages sdl)
127 #:use-module (gnu packages serialization)
128 #:use-module (gnu packages slang)
129 #:use-module (gnu packages texinfo)
130 #:use-module (gnu packages tls)
131 #:use-module (gnu packages valgrind)
132 #:use-module (gnu packages video)
133 #:use-module (gnu packages vulkan)
134 #:use-module (gnu packages web)
135 #:use-module (gnu packages xiph)
136 #:use-module (gnu packages xml)
137 #:use-module (gnu packages xdisorg)
138 #:use-module (gnu packages xorg)
139 #:use-module (gnu packages groff)
140 #:use-module (gnu packages rsync)
141 #:use-module (gnu packages selinux)
142 #:use-module (gnu packages swig)
143 #:use-module (guix build-system cmake)
144 #:use-module (guix build-system gnu)
145 #:use-module (guix build-system go)
146 #:use-module (guix build-system meson)
147 #:use-module (guix build-system python)
148 #:use-module (guix build-system trivial)
149 #:use-module (guix build-system linux-module)
150 #:use-module (guix download)
151 #:use-module (guix git-download)
152 #:use-module ((guix licenses) #:prefix license:)
153 #:use-module (guix packages)
154 #:use-module (guix gexp)
155 #:use-module (guix store)
156 #:use-module (guix monads)
157 #:use-module (guix utils)
158 #:use-module (srfi srfi-1)
159 #:use-module (srfi srfi-2)
160 #:use-module (srfi srfi-26)
161 #:use-module (ice-9 match))
163 (define-public (system->linux-architecture arch)
164 "Return the Linux architecture name for ARCH, a Guix system name such as
165 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
166 (let ((arch (car (string-split arch #\-))))
167 (cond ((string=? arch "i686") "i386")
168 ((string-prefix? "mips" arch) "mips")
169 ((string-prefix? "arm" arch) "arm")
170 ((string-prefix? "aarch64" arch) "arm64")
171 ((string-prefix? "alpha" arch) "alpha")
172 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
173 ((string-prefix? "s390" arch) "s390")
174 ((string-prefix? "riscv" arch) "riscv")
177 (define-public (system->defconfig system)
178 "Some systems (notably powerpc-linux) require a special target for kernel
179 defconfig. Return the appropriate make target if applicable, otherwise return
181 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
182 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
187 ;;; Kernel source code deblobbing.
190 (define (linux-libre-deblob-scripts version
193 (list (version-major+minor version)
196 (uri (string-append "https://linux-libre.fsfla.org"
197 "/pub/linux-libre/releases/" version "-gnu/"
199 (file-name (string-append "linux-libre-deblob-"
200 (version-major+minor version)))
201 (sha256 deblob-hash))
204 (uri (string-append "https://linux-libre.fsfla.org"
205 "/pub/linux-libre/releases/" version "-gnu/"
207 (file-name (string-append "linux-libre-deblob-check-" version))
208 (sha256 deblob-check-hash))))
210 (define* (computed-origin-method gexp-promise hash-algo hash
211 #:optional (name "source")
212 #:key (system (%current-system))
213 (guile (default-guile)))
214 "Return a derivation that executes the G-expression that results
215 from forcing GEXP-PROMISE."
216 (mlet %store-monad ((guile (package->derivation guile system)))
217 (gexp->derivation (or name "computed-origin")
219 #:graft? #f ;nothing to graft
221 #:guile-for-build guile)))
223 (define (make-linux-libre-source version
226 "Return a 'computed' origin that generates a Linux-libre tarball from the
227 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
228 (match deblob-scripts
229 ((deblob-version (? origin? deblob) (? origin? deblob-check))
230 (unless (string=? deblob-version (version-major+minor version))
231 ;; The deblob script cannot be expected to work properly on a
232 ;; different version (major+minor) of Linux, even if no errors
233 ;; are signaled during execution.
234 (error "deblob major+minor version mismatch"))
236 (method computed-origin-method)
237 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
241 (with-imported-modules '((guix build utils))
243 (use-modules (guix build utils)
248 (setvbuf (current-output-port) 'line)
250 (let ((dir (string-append "linux-" #$version)))
253 (set-path-environment-variable
256 #+(canonical-package bash)
257 #+(canonical-package coreutils)
258 #+(canonical-package diffutils)
259 #+(canonical-package findutils)
260 #+(canonical-package patch)
261 #+(canonical-package xz)
262 #+(canonical-package sed)
263 #+(canonical-package grep)
264 #+(canonical-package bzip2)
265 #+(canonical-package gzip)
266 #+(canonical-package tar)
267 #+(canonical-package gawk)
270 (with-directory-excursion "/tmp/bin"
272 (copy-file #+deblob "deblob")
273 (chmod "deblob" #o755)
274 (substitute* "deblob"
275 (("/bin/sh") (which "sh")))
277 (copy-file #+deblob-check "deblob-check")
278 (chmod "deblob-check" #o755)
279 (substitute* "deblob-check"
280 (("/bin/sh") (which "sh"))
281 (("/bin/sed") (which "sed"))
282 (("/usr/bin/python") (which "python"))))
284 (if (file-is-directory? #+upstream-source)
286 (format #t "Copying upstream linux source...~%")
287 (invoke "cp" "--archive" #+upstream-source dir)
288 (invoke "chmod" "--recursive" "u+w" dir))
290 (format #t "Unpacking upstream linux tarball...~%")
291 (invoke "tar" "xf" #$upstream-source)
294 (and (not (member name '("." "..")))
295 (file-is-directory? name))))
297 (unless (string=? dir unpacked-dir)
298 (rename-file unpacked-dir dir)))
300 (error "multiple directories found" dirs)))))
302 (with-directory-excursion dir
303 (format #t "Running deblob script...~%")
304 (invoke "/tmp/bin/deblob"))
306 (format #t "~%Packing new Linux-libre tarball...~%")
307 (invoke "tar" "cvfa" #$output
308 ;; Avoid non-determinism in the archive.
316 (format #t "~%Scanning the generated tarball for blobs...~%")
317 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
325 (define (linux-libre-urls version)
326 "Return a list of URLs for Linux-Libre VERSION."
328 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
329 version "-gnu/linux-libre-" version "-gnu.tar.xz")
331 ;; XXX: Work around <http://bugs.gnu.org/14851>.
333 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
334 version "-gnu.tar.xz")
336 ;; Maybe this URL will become valid eventually.
338 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
339 version "-gnu.tar.xz")))
341 (define (%upstream-linux-source version hash)
344 (uri (string-append "mirror://kernel.org"
345 "/linux/kernel/v" (version-major version) ".x/"
346 "linux-" version ".tar.xz"))
350 ;; The current "stable" kernel. That is, the most recently released major
352 (define-public linux-libre-5.8-version "5.8.7")
353 (define deblob-scripts-5.8
354 (linux-libre-deblob-scripts
355 linux-libre-5.8-version
356 (base32 "07z7sglyrfh0706icqqf3shadf638pvyid9386r661ds5lbsa2mw")
357 (base32 "0j6jba5fcddqlb42f95gjl78jisfla4nswqila074gglcrbnl9q7")))
358 (define-public linux-libre-5.8-pristine-source
359 (let ((version linux-libre-5.8-version)
360 (hash (base32 "1zhpzlhl2ykna2nc70m72wlgyv1pkvkpfssb4k8p5pwlkh1ga2vv")))
361 (make-linux-libre-source version
362 (%upstream-linux-source version hash)
363 deblob-scripts-5.8)))
365 ;; The "longterm" kernels — the older releases with long-term upstream support.
366 ;; Here are the support timelines:
367 ;; <https://www.kernel.org/category/releases.html>
368 (define-public linux-libre-5.4-version "5.4.64")
369 (define deblob-scripts-5.4
370 (linux-libre-deblob-scripts
372 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
373 (base32 "1b3q88i2qfdxyvpi9f7jds0qlb8hfpw87mgia096ax6822c2cmyb")))
374 (define-public linux-libre-5.4-pristine-source
375 (let ((version linux-libre-5.4-version)
376 (hash (base32 "1vymhl6p7i06gfgpw9iv75bvga5sj5kgv46i1ykqiwv6hj9w5lxr")))
377 (make-linux-libre-source version
378 (%upstream-linux-source version hash)
379 deblob-scripts-5.4)))
381 (define-public linux-libre-4.19-version "4.19.144")
382 (define deblob-scripts-4.19
383 (linux-libre-deblob-scripts
385 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
386 (base32 "1jiaw0as1ippkrjdpd52657w5mz9qczg3y2hlra7m9k0xawwiqlf")))
387 (define-public linux-libre-4.19-pristine-source
388 (let ((version linux-libre-4.19-version)
389 (hash (base32 "0jnj65bdy5y9lcj5zhrn4iaszpww8z41ac66j00l75sd931l1g9k")))
390 (make-linux-libre-source version
391 (%upstream-linux-source version hash)
392 deblob-scripts-4.19)))
394 (define-public linux-libre-4.14-version "4.14.197")
395 (define deblob-scripts-4.14
396 (linux-libre-deblob-scripts
398 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
399 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
400 (define-public linux-libre-4.14-pristine-source
401 (let ((version linux-libre-4.14-version)
402 (hash (base32 "029h46yki2hxdbn7afmnf3yar1pnwrpszx76irsa5mf8gnrasyp0")))
403 (make-linux-libre-source version
404 (%upstream-linux-source version hash)
405 deblob-scripts-4.14)))
407 (define-public linux-libre-4.9-version "4.9.235")
408 (define deblob-scripts-4.9
409 (linux-libre-deblob-scripts
410 linux-libre-4.9-version
411 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
412 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
413 (define-public linux-libre-4.9-pristine-source
414 (let ((version linux-libre-4.9-version)
415 (hash (base32 "1hqcb3zw4546h6x5xy2mywdznha8813lx15mxbgfbvwm4qhsc9g6")))
416 (make-linux-libre-source version
417 (%upstream-linux-source version hash)
418 deblob-scripts-4.9)))
420 (define-public linux-libre-4.4-version "4.4.235")
421 (define deblob-scripts-4.4
422 (linux-libre-deblob-scripts
423 linux-libre-4.4-version
424 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
425 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
426 (define-public linux-libre-4.4-pristine-source
427 (let ((version linux-libre-4.4-version)
428 (hash (base32 "0w5pkv936zb0shjgnpv17gcp5n8f91djznzq54p6j1bl5q2qdyqd")))
429 (make-linux-libre-source version
430 (%upstream-linux-source version hash)
431 deblob-scripts-4.4)))
433 (define %boot-logo-patch
434 ;; Linux-Libre boot logo featuring Freedo and a gnu.
437 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
438 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
441 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
443 (define %linux-libre-arm-export-__sync_icache_dcache-patch
447 "https://salsa.debian.org/kernel-team/linux"
448 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
449 "/debian/patches/bugfix/arm/"
450 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
451 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
453 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
455 (define (source-with-patches source patches)
458 (patches (append (origin-patches source)
461 (define-public linux-libre-5.8-source
462 (source-with-patches linux-libre-5.8-pristine-source
463 (list %boot-logo-patch
464 %linux-libre-arm-export-__sync_icache_dcache-patch)))
466 (define-public linux-libre-5.4-source
467 (source-with-patches linux-libre-5.4-pristine-source
468 (list %boot-logo-patch
469 %linux-libre-arm-export-__sync_icache_dcache-patch
470 ;; Pinebook Pro patch from linux-next,
471 ;; can be dropped for linux-libre 5.7
473 "linux-libre-support-for-Pinebook-Pro.patch"))))
475 (define-public linux-libre-4.19-source
476 (source-with-patches linux-libre-4.19-pristine-source
477 (list %boot-logo-patch
478 %linux-libre-arm-export-__sync_icache_dcache-patch)))
480 (define-public linux-libre-4.14-source
481 (source-with-patches linux-libre-4.14-pristine-source
482 (list %boot-logo-patch)))
484 (define-public linux-libre-4.9-source
485 (source-with-patches linux-libre-4.9-pristine-source
486 (list %boot-logo-patch)))
488 (define-public linux-libre-4.4-source
489 (source-with-patches linux-libre-4.4-pristine-source
490 (list %boot-logo-patch)))
497 (define (make-linux-libre-headers version hash-string)
498 (make-linux-libre-headers* version
501 (uri (linux-libre-urls version))
502 (sha256 (base32 hash-string)))))
504 (define (make-linux-libre-headers* version source)
506 (name "linux-libre-headers")
509 (build-system gnu-build-system)
510 (native-inputs `(("perl" ,perl)
511 ,@(if (version>=? version "4.16")
515 ,@(if (version>=? version "5.3")
519 `(#:modules ((guix build gnu-build-system)
523 (modify-phases %standard-phases
527 (let ((arch ,(system->linux-architecture
528 (or (%current-target-system)
530 (defconfig ,(system->defconfig
531 (or (%current-target-system)
532 (%current-system)))))
534 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
535 (invoke "make" defconfig)
536 (invoke "make" "mrproper" "headers_check"))))
538 (lambda* (#:key outputs #:allow-other-keys)
539 (let ((out (assoc-ref outputs "out")))
541 (string-append "INSTALL_HDR_PATH=" out)
544 (mkdir (string-append out "/include/config"))
545 (call-with-output-file
547 "/include/config/kernel.release")
549 (format p "~a-default~%" ,version)))
551 ;; Remove the '.install' and '..install.cmd' files; the
552 ;; latter contains store paths, which pulls in bootstrap
553 ;; binaries in the build environment, and prevents bit
554 ;; reproducibility for the bootstrap binaries.
555 (for-each delete-file (find-files out "\\.install"))
558 #:allowed-references ()
560 (home-page "https://www.gnu.org/software/linux-libre/")
561 (synopsis "GNU Linux-Libre kernel headers")
562 (description "Headers of the Linux-Libre kernel.")
563 (license license:gpl2)))
565 (define-public linux-libre-headers-5.8
566 (make-linux-libre-headers* linux-libre-5.8-version
567 linux-libre-5.8-source))
569 (define-public linux-libre-headers-5.4
570 (make-linux-libre-headers* linux-libre-5.4-version
571 linux-libre-5.4-source))
573 (define-public linux-libre-headers-4.19
574 (make-linux-libre-headers* linux-libre-4.19-version
575 linux-libre-4.19-source))
577 (define-public linux-libre-headers-4.14
578 (make-linux-libre-headers* linux-libre-4.14-version
579 linux-libre-4.14-source))
581 (define-public linux-libre-headers-4.9
582 (make-linux-libre-headers* linux-libre-4.9-version
583 linux-libre-4.9-source))
585 (define-public linux-libre-headers-4.4
586 (make-linux-libre-headers* linux-libre-4.4-version
587 linux-libre-4.4-source))
589 ;; The following package is used in the early bootstrap, and thus must be kept
590 ;; stable and with minimal build requirements.
591 (define-public linux-libre-headers-5.4.20
592 (make-linux-libre-headers "5.4.20"
593 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
595 (define-public linux-libre-headers linux-libre-headers-5.4.20)
599 ;;; Kernel configurations.
602 (define* (kernel-config arch #:key variant)
603 "Return the absolute file name of the Linux-Libre build configuration file
604 for ARCH and optionally VARIANT, or #f if there is no such configuration."
605 (let* ((name (string-append (if variant (string-append variant "-") "")
606 (if (string=? "i386" arch) "i686" arch) ".conf"))
607 (file (string-append "linux-libre/" name)))
608 (search-auxiliary-file file)))
610 (define %default-extra-linux-options
611 `(;; Some very mild hardening.
612 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
613 ;; All kernels should have NAMESPACES options enabled
614 ("CONFIG_NAMESPACES" . #t)
615 ("CONFIG_UTS_NS" . #t)
616 ("CONFIG_IPC_NS" . #t)
617 ("CONFIG_USER_NS" . #t)
618 ("CONFIG_PID_NS" . #t)
619 ("CONFIG_NET_NS" . #t)
620 ;; Various options needed for elogind service:
621 ;; https://issues.guix.gnu.org/43078
622 ("CONFIG_CGROUP_FREEZER" . #t)
623 ("CONFIG_BLK_CGROUP" . #t)
624 ("CONFIG_CGROUP_WRITEBACK" . #t)
625 ("CONFIG_CGROUP_SCHED" . #t)
626 ("CONFIG_CGROUP_PIDS" . #t)
627 ("CONFIG_CGROUP_FREEZER" . #t)
628 ("CONFIG_CGROUP_DEVICE" . #t)
629 ("CONFIG_CGROUP_CPUACCT" . #t)
630 ("CONFIG_CGROUP_PERF" . #t)
631 ("CONFIG_SOCK_CGROUP_DATA" . #t)
632 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
633 ("CONFIG_CGROUP_NET_PRIO" . #t)
634 ("CONFIG_CGROUP_NET_CLASSID" . #t)
635 ("CONFIG_MEMCG" . #t)
636 ("CONFIG_MEMCG_SWAP" . #t)
637 ("CONFIG_MEMCG_KMEM" . #t)
638 ("CONFIG_CPUSETS" . #t)
639 ("CONFIG_PROC_PID_CPUSET" . #t)
640 ;; Modules required for initrd:
641 ("CONFIG_NET_9P" . m)
642 ("CONFIG_NET_9P_VIRTIO" . m)
643 ("CONFIG_VIRTIO_BLK" . m)
644 ("CONFIG_VIRTIO_NET" . m)
645 ("CONFIG_VIRTIO_PCI" . m)
646 ("CONFIG_VIRTIO_BALLOON" . m)
647 ("CONFIG_VIRTIO_MMIO" . m)
648 ("CONFIG_FUSE_FS" . m)
650 ("CONFIG_9P_FS" . m)))
652 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
653 (define %bpf-extra-linux-options
654 `(;; Needed for probes
655 ("CONFIG_UPROBE_EVENTS" . #t)
656 ("CONFIG_KPROBE_EVENTS" . #t)
657 ;; kheaders module also helpful for tracing
658 ("CONFIG_IKHEADERS" . #t)
660 ("CONFIG_BPF_SYSCALL" . #t)
661 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
662 ;; optional, for tc filters
663 ("CONFIG_NET_CLS_BPF" . m)
664 ;; optional, for tc actions
665 ("CONFIG_NET_ACT_BPF" . m)
666 ("CONFIG_BPF_JIT" . #t)
667 ;; for Linux kernel versions 4.1 through 4.6
668 ;; ("CONFIG_HAVE_BPF_JIT" . y)
669 ;; for Linux kernel versions 4.7 and later
670 ("CONFIG_HAVE_EBPF_JIT" . #t)
671 ;; optional, for kprobes
672 ("CONFIG_BPF_EVENTS" . #t)
674 ("CONFIG_IKHEADERS" . #t)))
676 (define (config->string options)
677 (string-join (map (match-lambda
679 (string-append option "=m"))
681 (string-append option "=y"))
683 (string-append option "=n")))
689 ;;; Kernel package utilities.
692 (define* (make-linux-libre version hash-string supported-systems
694 ;; A function that takes an arch and a variant.
695 ;; See kernel-config for an example.
697 (configuration-file #f)
698 (defconfig "defconfig")
699 (extra-options %default-extra-linux-options)
700 (patches (list %boot-logo-patch)))
701 (make-linux-libre* version
704 (uri (linux-libre-urls version))
705 (sha256 (base32 hash-string))
708 #:extra-version extra-version
709 #:configuration-file configuration-file
710 #:defconfig defconfig
711 #:extra-options extra-options))
713 (define* (make-linux-libre* version source supported-systems
715 ;; A function that takes an arch and a variant.
716 ;; See kernel-config for an example.
718 (configuration-file #f)
719 (defconfig "defconfig")
720 (extra-options %default-extra-linux-options))
722 (name (if extra-version
723 (string-append "linux-libre-" extra-version)
727 (supported-systems supported-systems)
728 (build-system gnu-build-system)
733 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
737 ;; These are needed to compile the GCC plugins.
742 ,@(match (and configuration-file
744 (system->linux-architecture
745 (or (%current-target-system) (%current-system)))
746 #:variant (version-major+minor version)))
747 (#f ;no config for this platform
750 `(("kconfig" ,config))))))
752 `(#:modules ((guix build gnu-build-system)
759 (modify-phases %standard-phases
760 (add-after 'unpack 'patch-/bin/pwd
762 (substitute* (find-files "." "^Makefile(\\.include)?$")
763 (("/bin/pwd") "pwd"))
766 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
767 ;; Avoid introducing timestamps
768 (setenv "KCONFIG_NOTIMESTAMP" "1")
769 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
771 ;; Set ARCH and CROSS_COMPILE
772 (let ((arch ,(system->linux-architecture
773 (or (%current-target-system)
774 (%current-system)))))
776 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
779 (setenv "CROSS_COMPILE" (string-append target "-"))
780 (format #t "`CROSS_COMPILE' set to `~a'~%"
781 (getenv "CROSS_COMPILE"))))
783 (setenv "EXTRA_VERSION" ,extra-version)
785 (let ((build (assoc-ref %standard-phases 'build))
786 (config (assoc-ref (or native-inputs inputs) "kconfig")))
788 ;; Use a custom kernel configuration file or a default
789 ;; configuration file.
792 (copy-file config ".config")
793 (chmod ".config" #o666))
794 (invoke "make" ,defconfig))
796 ;; Appending works even when the option wasn't in the
797 ;; file. The last one prevails if duplicated.
798 (let ((port (open-file ".config" "a"))
799 (extra-configuration ,(config->string extra-options)))
800 (display extra-configuration port)
803 (invoke "make" "oldconfig"))))
805 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
806 (let* ((out (assoc-ref outputs "out"))
807 (moddir (string-append out "/lib/modules"))
808 (dtbdir (string-append out "/lib/dtbs")))
809 ;; Install kernel image, kernel configuration and link map.
810 (for-each (lambda (file) (install-file file out))
811 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
812 ;; Install device tree files
813 (unless (null? (find-files "." "\\.dtb$"))
815 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
817 ;; Install kernel modules
820 ;; Disable depmod because the Guix system's module directory
821 ;; is an union of potentially multiple packages. It is not
822 ;; possible to use depmod to usefully calculate a dependency
823 ;; graph while building only one of those packages.
825 (string-append "MODULE_DIR=" moddir)
826 (string-append "INSTALL_PATH=" out)
827 (string-append "INSTALL_MOD_PATH=" out)
828 "INSTALL_MOD_STRIP=1"
830 (let* ((versions (filter (lambda (name)
831 (not (string-prefix? "." name)))
833 (version (match versions
835 ;; There are symlinks to the build and source directory,
836 ;; both of which will point to target /tmp/guix-build*
837 ;; and thus not be useful in a profile. Delete the symlinks.
838 (false-if-file-not-found
839 (delete-file (string-append moddir "/" version "/build")))
840 (false-if-file-not-found
841 (delete-file (string-append moddir "/" version "/source"))))
844 (home-page "https://www.gnu.org/software/linux-libre/")
845 (synopsis "100% free redistribution of a cleaned Linux kernel")
847 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
848 It has been modified to remove all non-free binary blobs.")
849 (license license:gpl2)))
853 ;;; Generic kernel packages.
856 (define-public linux-libre-5.8
857 (make-linux-libre* linux-libre-5.8-version
858 linux-libre-5.8-source
859 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
860 #:configuration-file kernel-config))
862 (define-public linux-libre-version linux-libre-5.8-version)
863 (define-public linux-libre-pristine-source linux-libre-5.8-pristine-source)
864 (define-public linux-libre-source linux-libre-5.8-source)
865 (define-public linux-libre linux-libre-5.8)
867 (define-public linux-libre-5.4
868 (make-linux-libre* linux-libre-5.4-version
869 linux-libre-5.4-source
870 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
871 #:configuration-file kernel-config))
873 (define-public linux-libre-4.19
874 (make-linux-libre* linux-libre-4.19-version
875 linux-libre-4.19-source
876 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
877 #:configuration-file kernel-config))
879 (define-public linux-libre-4.14
880 (make-linux-libre* linux-libre-4.14-version
881 linux-libre-4.14-source
882 '("x86_64-linux" "i686-linux" "armhf-linux")
883 #:configuration-file kernel-config))
885 (define-public linux-libre-4.9
886 (make-linux-libre* linux-libre-4.9-version
887 linux-libre-4.9-source
888 '("x86_64-linux" "i686-linux")
889 #:configuration-file kernel-config))
891 (define-public linux-libre-4.4
892 (make-linux-libre* linux-libre-4.4-version
893 linux-libre-4.4-source
894 '("x86_64-linux" "i686-linux")
895 #:configuration-file kernel-config
898 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
899 ;; This option was removed upstream in version 4.7.
900 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
901 %default-extra-linux-options)))
905 ;;; Specialized kernel variants.
908 (define-public linux-libre-arm-generic
909 (make-linux-libre* linux-libre-version
912 #:defconfig "multi_v7_defconfig"
913 #:extra-version "arm-generic"
916 `(;; needed to fix the RTC on rockchip platforms
917 ("CONFIG_RTC_DRV_RK808" . #t))
918 %default-extra-linux-options)))
920 (define-public linux-libre-arm-veyron
921 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
923 (define-public linux-libre-arm-generic-5.4
924 (make-linux-libre* linux-libre-5.4-version
925 linux-libre-5.4-source
927 #:defconfig "multi_v7_defconfig"
928 #:extra-version "arm-generic"
931 `(;; needed to fix the RTC on rockchip platforms
932 ("CONFIG_RTC_DRV_RK808" . #t))
933 %default-extra-linux-options)))
935 (define-public linux-libre-arm-generic-4.19
936 (make-linux-libre* linux-libre-4.19-version
937 linux-libre-4.19-source
939 #:defconfig "multi_v7_defconfig"
940 #:extra-version "arm-generic"))
942 (define-public linux-libre-arm-generic-4.14
943 (make-linux-libre* linux-libre-4.14-version
944 linux-libre-4.14-source
946 #:defconfig "multi_v7_defconfig"
947 #:extra-version "arm-generic"))
949 (define-public linux-libre-arm-omap2plus
950 (make-linux-libre* linux-libre-version
953 #:defconfig "omap2plus_defconfig"
954 #:extra-version "arm-omap2plus"))
956 (define-public linux-libre-arm-omap2plus-4.19
957 (make-linux-libre* linux-libre-4.19-version
958 linux-libre-4.19-source
960 #:defconfig "omap2plus_defconfig"
961 #:extra-version "arm-omap2plus"))
963 (define-public linux-libre-arm-omap2plus-4.14
964 (make-linux-libre* linux-libre-4.14-version
965 linux-libre-4.14-source
967 #:defconfig "omap2plus_defconfig"
968 #:extra-version "arm-omap2plus"))
970 (define-public linux-libre-arm64-generic
971 (make-linux-libre* linux-libre-version
974 #:defconfig "defconfig"
975 #:extra-version "arm64-generic"
978 `(;; needed to fix the RTC on rockchip platforms
979 ("CONFIG_RTC_DRV_RK808" . #t))
980 %default-extra-linux-options)))
982 (define-public linux-libre-arm64-generic-5.4
983 (make-linux-libre* linux-libre-5.4-version
984 linux-libre-5.4-source
986 #:defconfig "defconfig"
987 #:extra-version "arm64-generic"
990 `(;; needed to fix the RTC on rockchip platforms
991 ("CONFIG_RTC_DRV_RK808" . #t))
992 %default-extra-linux-options)))
994 (define-public linux-libre-riscv64-generic
995 (make-linux-libre* linux-libre-version
998 #:extra-version "riscv64-generic"))
1000 (define-public linux-libre-with-bpf
1001 (let ((base-linux-libre
1003 linux-libre-5.4-version
1004 linux-libre-5.4-source
1005 '("x86_64-linux" "i686-linux" "armhf-linux"
1006 "aarch64-linux" "riscv64-linux")
1007 #:extra-version "bpf"
1008 #:configuration-file kernel-config
1010 (append %bpf-extra-linux-options
1011 %default-extra-linux-options))))
1013 (inherit base-linux-libre)
1014 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
1019 ;;; Linux kernel modules.
1022 (define-public acpi-call-linux-module
1023 (let ((commit "70b9c80bd700e6a4d10797eaac9fd34b7e8cbd4a")
1026 (name "acpi-call-linux-module")
1027 (version (git-version "3.17" revision commit))
1032 (url "https://github.com/teleshoes/acpi_call")
1034 (file-name (git-file-name name version))
1036 (base32 "09c1vw6vcrkqxbwhpgfgpj4d1grzn4qq6ka8pwwzm7cvm405xj7x"))))
1037 (build-system linux-module-build-system)
1039 `(#:tests? #f ; no tests
1041 (modify-phases %standard-phases
1042 (add-after 'install 'install-documentation
1043 (lambda* (#:key outputs #:allow-other-keys)
1044 (let* ((out (assoc-ref outputs "out"))
1045 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1046 (for-each (lambda (file)
1047 (let ((target (string-append doc "/" file)))
1048 (mkdir-p (dirname target))
1049 (copy-recursively file target)))
1050 (list "README.md" "examples"))
1052 (home-page "https://github.com/teleshoes/acpi_call")
1053 (synopsis "Linux kernel module to perform ACPI method calls")
1055 "This simple Linux kernel module allows calls from user space to any
1056 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1057 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1058 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1059 and @code{ACPI_BUFFER}.
1061 It grants direct and undocumented access to your hardware that may cause damage
1062 and should be used with caution, especially on untested models.")
1063 (license license:gpl3+)))) ; see README.md (no licence headers)
1065 (define-public rtl8812au-aircrack-ng-linux-module
1066 (let ((commit "df2b8dfd8cb7d9f6cfeb55abaeab8a5372011fc9")
1069 (name "rtl8812au-aircrack-ng-linux-module")
1070 (version (git-version "5.6.4.2" revision commit))
1075 (url "https://github.com/aircrack-ng/rtl8812au")
1077 (file-name (git-file-name name version))
1079 (base32 "1qcr0j8yhg8l9l0f5y55zcsk1mgf3qd46yh9xfqgg91szxa3yvca"))
1080 (modules '((guix build utils)))
1083 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1084 ;; and other unnecessary unlicenced things.
1085 (for-each delete-file-recursively (list "android"
1089 (build-system linux-module-build-system)
1092 (list (string-append "KSRC="
1093 (assoc-ref %build-inputs "linux-module-builder")
1094 "/lib/modules/build"))
1096 (modify-phases %standard-phases
1098 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1099 (apply invoke "make" make-flags))))
1100 #:tests? #f)) ; no test suite
1101 (supported-systems '("x86_64-linux" "i686-linux"))
1102 (home-page "https://github.com/aircrack-ng/rtl8812au")
1103 (synopsis "Linux driver for Realtek USB wireless network adapters")
1105 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1106 network adapters, modified by the aircrack-ng project to support monitor mode
1107 and frame injection. It provides a @code{88XXau} kernel module that supports
1108 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1109 (license license:gpl2+))))
1111 (define-public rtl8821ce-linux-module
1112 (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea")
1115 (name "rtl8821ce-linux-module")
1116 (version (git-version "0.0.0" revision commit))
1121 (url "https://github.com/tomaspinho/rtl8821ce")
1123 (file-name (git-file-name name version))
1126 "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))
1127 (build-system linux-module-build-system)
1131 (string-append "KSRC="
1132 (assoc-ref %build-inputs "linux-module-builder")
1133 "/lib/modules/build"))
1135 (modify-phases %standard-phases
1137 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1138 (apply invoke "make" make-flags))))
1139 #:tests? #f)) ; no test suite
1140 (home-page "https://github.com/tomaspinho/rtl8821ce")
1141 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1142 (description "This is Realtek's RTL8821CE Linux driver for wireless
1144 (license license:gpl2))))
1146 (define-public vhba-module
1148 (name "vhba-module")
1149 (version "20200106")
1153 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1154 version ".tar.bz2"))
1157 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1158 (build-system linux-module-build-system)
1162 (home-page "https://cdemu.sourceforge.io/")
1163 (synopsis "Kernel module that emulates SCSI devices")
1164 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1165 between the CDemu userspace daemon and linux kernel.")
1166 (license license:gpl2+)))
1168 (define-public bbswitch-module
1170 (name "bbswitch-module")
1175 (url "https://github.com/Bumblebee-Project/bbswitch")
1176 (commit (string-append "v" version))))
1177 (file-name (git-file-name name version))
1180 "1glch4j0x1dzlp2yrb67v2r5jg9609jb6p8m251y78m74advqw0l"))))
1181 (build-system linux-module-build-system)
1185 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1186 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1187 (description "The bbswitch module provides a way to toggle the Nvidia
1188 graphics card on Optimus laptops.")
1189 (license license:gpl2)))
1191 (define-public ddcci-driver-linux
1193 (name "ddcci-driver-linux")
1200 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1201 (commit (string-append "v" version))))
1202 (file-name (git-file-name name version))
1205 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1206 (build-system linux-module-build-system)
1208 `(#:tests? #f ; no tests
1210 (modify-phases %standard-phases
1215 (with-directory-excursion module
1216 (apply (assoc-ref %standard-phases 'build) args)))
1217 '("ddcci" "ddcci-backlight"))
1223 (with-directory-excursion module
1224 (apply (assoc-ref %standard-phases 'install) args)))
1225 '("ddcci" "ddcci-backlight"))
1227 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1228 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1229 (description "This package provides two Linux kernel drivers, ddcci and
1230 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1231 interface. The ddcci module creates a character device for each DDC/CI
1232 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1233 module allows the control of the backlight level or luminance property when
1234 supported under @file{/sys/class/backlight/}.")
1235 (license license:gpl2+)))
1237 (define-public v4l2loopback-linux-module
1239 (name "v4l2loopback-linux-module")
1244 (url "https://github.com/umlaeute/v4l2loopback")
1245 (commit (string-append "v" version))))
1246 (file-name (git-file-name name version))
1249 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1250 (build-system linux-module-build-system)
1252 `(#:tests? #f)) ; no test suite
1253 (home-page "https://github.com/umlaeute/v4l2loopback")
1254 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1256 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1257 for Linux 2} applications will treat these as ordinary video devices but read
1258 video data generated by another application, instead of a hardware device such
1261 This lets you apply nifty effects to your Jitsi video, for example, but also
1262 allows some more serious things like adding streaming capabilities to an
1263 application by hooking GStreamer into the loopback device.")
1264 (license license:gpl2+)))
1268 ;;; Pluggable authentication modules (PAM).
1271 (define-public linux-pam
1279 "https://github.com/linux-pam/linux-pam/releases/download/v"
1280 version "/Linux-PAM-" version ".tar.xz"))
1283 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1284 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1286 (build-system gnu-build-system)
1290 ;; TODO: optional dependencies
1291 ;; ("libxcrypt" ,libxcrypt)
1292 ;; ("cracklib" ,cracklib)
1295 `(;; Most users, such as `shadow', expect the headers to be under
1297 #:configure-flags (list (string-append "--includedir="
1298 (assoc-ref %outputs "out")
1299 "/include/security")
1301 ;; XXX: <rpc/rpc.h> is missing from glibc when
1302 ;; cross-compiling, so we have to disable NIS
1303 ;; support altogether.
1304 ,@(if (%current-target-system)
1308 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1311 (home-page "http://www.linux-pam.org/")
1312 (synopsis "Pluggable authentication modules for Linux")
1314 "A *Free* project to implement OSF's RFC 86.0.
1315 Pluggable authentication modules are small shared object files that can
1316 be used through the PAM API to perform tasks, like authenticating a user
1317 at login. Local and dynamic reconfiguration are its key features.")
1318 (license license:bsd-3)))
1320 (define-public linux-pam-1.2
1328 "http://www.linux-pam.org/library/"
1329 "Linux-PAM-" version ".tar.bz2"))
1332 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1333 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1335 (define-public python-pamela
1337 (name "python-pamela")
1341 ;; Tests not distributed in pypi release.
1344 (url "https://github.com/minrk/pamela.git")
1346 (file-name (git-file-name name version))
1349 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
1350 (build-system python-build-system)
1352 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
1354 (modify-phases %standard-phases
1355 (add-after 'unpack 'hardcode-pam.so
1356 (lambda* (#:key inputs #:allow-other-keys)
1357 (let ((pam (assoc-ref inputs "linux-pam")))
1358 (substitute* "pamela.py"
1359 (("find_library\\(\"pam\")")
1360 (string-append "'" pam "/lib/libpam.so'")))
1363 (lambda* (#:key tests? #:allow-other-keys)
1365 (if (file-exists? "test_pamela.py")
1366 (invoke "py.test" "--assert=plain" "test_pamela.py")
1367 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
1370 `(("linux-pam" ,linux-pam)))
1372 `(("python-pytest" ,python-pytest)))
1373 (home-page "https://github.com/minrk/pamela")
1374 (synopsis "PAM interface using ctypes")
1375 (description "This package provides a PAM interface using @code{ctypes}.")
1376 (license license:expat)))
1383 (define-public powerstat
1390 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1391 "powerstat/powerstat-" version ".tar.gz"))
1393 (base32 "0r355b9syqa2nhfy8ksvxyy5d58v0isf983842js091s6liy0x7g"))))
1394 (build-system gnu-build-system)
1397 (list (string-append "CC=" ,(cc-for-target))
1398 (string-append "prefix=" (assoc-ref %outputs "out")))
1399 #:tests? #f ; no test suite
1401 (modify-phases %standard-phases
1402 (add-after 'unpack 'respect-$prefix
1403 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1405 (substitute* "Makefile"
1406 (("DIR=/usr/") "DIR=$(prefix)/"))
1408 (delete 'configure)))) ; no configure script
1409 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1410 (synopsis "Measure system power consumption")
1412 "Powerstat measures and reports your computer's power consumption in real
1413 time. On mobile PCs, it uses ACPI battery information to measure the power
1414 drain of the entire system.
1416 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1417 domain measurements. These are available only on some hardware such as Intel
1418 Sandybridge and newer, and cover only part of the machine's components such as
1419 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1420 and don't require a battery at all.
1422 The output is like @command{vmstat} but also shows power consumption statistics:
1423 at the end of a run, @command{powerstat} will calculate the average, standard
1424 deviation, and minimum and maximum values. It can show a nice histogram too.")
1425 (license license:gpl2)))
1427 (define-public psmisc
1434 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1437 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1438 (build-system gnu-build-system)
1440 `(,@(if (%current-target-system)
1443 "ac_cv_func_malloc_0_nonnull=yes"
1444 "ac_cv_func_realloc_0_nonnull=yes"))
1446 (inputs `(("ncurses" ,ncurses)))
1447 (home-page "https://gitlab.com/psmisc/psmisc")
1448 (synopsis "Small utilities that use the proc file system")
1450 "This PSmisc package is a set of some small useful utilities that
1451 use the proc file system. We're not about changing the world, but
1452 providing the system administrator with some help in common tasks.")
1453 (license license:gpl2+)))
1455 (define-public util-linux
1461 (uri (string-append "mirror://kernel.org/linux/utils/"
1462 "util-linux/v" (version-major+minor version) "/"
1463 "util-linux-" version ".tar.xz"))
1466 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1467 (patches (search-patches "util-linux-tests.patch"))
1468 (modules '((guix build utils)))
1470 ;; We take 'nologin' from Shadow, the 'logger' program from
1471 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1473 (substitute* "configure"
1474 (("build_nologin=yes") "build_nologin=no")
1475 (("build_logger=yes") "build_logger=no")
1476 (("build_kill=yes") "build_kill=no"))
1478 (build-system gnu-build-system)
1479 (outputs '("out" ;6.4 MiB executables and documentation
1480 "lib" ;8.8 MiB shared libraries, headers and locales
1481 "static")) ;2.9 MiB static .a libraries
1483 `(#:configure-flags (list "--disable-use-tty-group"
1484 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1485 ;; Don't try to chown root:root mount and umount
1486 "--disable-makeinstall-chown"
1487 "--localstatedir=/var"
1488 (string-append "--localedir="
1489 (assoc-ref %outputs "lib")
1491 ;; Install completions where our
1492 ;; bash-completion package expects them.
1493 (string-append "--with-bashcompletiondir="
1494 (assoc-ref %outputs "out")
1495 "/etc/bash_completion.d"))
1496 #:phases (modify-phases %standard-phases
1497 (add-before 'configure 'patch-build-scripts
1498 (lambda* (#:key outputs #:allow-other-keys)
1499 (substitute* "configure"
1500 ;; The build system assumes that we want to install
1501 ;; libraries below $exec_prefix when $libdir does not
1502 ;; match any of the "usual" locations. Fix that.
1503 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1504 "usrlib_execdir=$libdir"))
1506 (add-before 'build 'set-umount-file-name
1507 (lambda* (#:key outputs #:allow-other-keys)
1508 ;; Tell 'eject' the right file name of 'umount'.
1509 (let ((out (assoc-ref outputs "out")))
1510 (substitute* "sys-utils/eject.c"
1511 (("\"/bin/umount\"")
1512 (string-append "\"" out "/bin/umount\"")))
1514 (add-before 'check 'pre-check
1515 (lambda* (#:key inputs outputs #:allow-other-keys)
1516 (let ((out (assoc-ref outputs "out"))
1517 (net (assoc-ref inputs "net-base")))
1518 ;; Change the test to refer to the right file.
1519 (substitute* "tests/ts/misc/mcookie"
1521 (string-append net "/etc/services")))
1523 ;; The C.UTF-8 locale does not exist in our libc.
1524 (substitute* "tests/ts/column/invalid-multibyte"
1525 (("C\\.UTF-8") "en_US.utf8"))
1527 ;; TODO: Remove the conditional on the next rebuild cycle.
1528 ,@(if (string-prefix? "arm" (%current-system))
1529 '((add-before 'check 'disable-setarch-test
1531 ;; The setarch tests are unreliable in QEMU's
1532 ;; user-mode emulation, which is our primary
1533 ;; method of building ARMv7 packages.
1534 ;; <https://github.com/karelzak/util-linux/issues/601>
1535 (substitute* "tests/ts/misc/setarch"
1536 (("ts_init_subtest.*" all)
1539 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1542 (add-after 'install 'move-static-libraries
1543 (lambda* (#:key outputs #:allow-other-keys)
1544 (let ((lib (assoc-ref outputs "lib"))
1545 (static (assoc-ref outputs "static")))
1547 ;; Move static libraries to the "static" output.
1548 (mkdir-p (string-append static "/lib"))
1549 (with-directory-excursion lib
1550 (for-each (lambda (file)
1552 (string-append static "/"
1554 (find-files "lib" "\\.a$"))
1556 ;; Remove references to the static library from the '.la'
1557 ;; files so that Libtool does the right thing when both
1558 ;; the shared and static library is available.
1559 (substitute* (find-files "lib" "\\.la$")
1560 (("old_library=.*") "old_library=''\n")))
1563 (add-after 'install 'adjust-pkg-config-files
1564 (lambda* (#:key outputs #:allow-other-keys)
1565 (let ((lib (assoc-ref outputs "lib")))
1566 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1567 ;; the pkg-config files to avoid a cyclic reference on "out".
1568 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1570 (("^(exec_)?prefix=.*") "")))
1572 (inputs `(("zlib" ,zlib)
1573 ("ncurses" ,ncurses)
1575 ;; XXX: This is so that the 'pre-check' phase can find it.
1576 ,@(if (%current-target-system)
1577 `(("net-base" ,net-base))
1581 ("net-base" ,net-base))) ;for tests
1582 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1583 (synopsis "Collection of utilities for the Linux kernel")
1584 (description "Util-linux is a diverse collection of Linux kernel
1585 utilities. It provides dmesg and includes tools for working with file systems,
1586 block devices, UUIDs, TTYs, and many other tools.")
1588 ;; Note that util-linux doesn't use the same license for all the
1589 ;; code. GPLv2+ is the default license for a code without an
1590 ;; explicitly defined license.
1591 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1592 license:bsd-4 license:public-domain))))
1594 ;; util-linux optionally supports udev, which allows lsblk to read file system
1595 ;; metadata without special privileges. Add it as a separate package to avoid
1596 ;; a circular dependency, and to keep the size small.
1597 (define-public util-linux+udev
1600 (name "util-linux-with-udev")
1603 ,@(package-inputs util-linux)))))
1605 (define-public ddate
1612 (url "https://github.com/bo0ts/ddate")
1613 (commit (string-append "v" version))))
1614 (file-name (git-file-name name version))
1616 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1617 (build-system cmake-build-system)
1618 (arguments '(#:tests? #f))
1619 (home-page "https://github.com/bo0ts/ddate")
1620 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1622 "ddate displays the Discordian date and holidays of a given date.
1623 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1624 by Robert Shea and Robert Anton Wilson.")
1625 (license license:public-domain)))
1627 (define-public fbset
1634 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1637 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1638 (build-system gnu-build-system)
1640 '(#:modules ((guix build gnu-build-system)
1644 (modify-phases %standard-phases
1645 (delete 'configure) ; no configure script
1646 (add-before 'install 'pre-install
1647 (lambda* (#:key outputs #:allow-other-keys)
1648 (let ((out (assoc-ref outputs "out")))
1649 (substitute* "Makefile"
1650 (("mknod ") "true ")
1651 ;; The Makefile doesn't honour PREFIX or similar.
1654 (with-directory-excursion out
1655 (for-each mkdir-p (list "sbin"
1659 (add-after 'install 'install-fb.modes
1660 (lambda* (#:key outputs #:allow-other-keys)
1661 (let* ((out (assoc-ref outputs "out"))
1662 (etc (string-append out "/etc")))
1663 (for-each (cut install-file <> etc)
1664 (find-files "etc" "^fb\\.modes"))
1665 (symlink "fb.modes.ATI"
1666 (string-append etc "/fb.modes"))
1668 ;; Parallel building races to create modes.tab.c.
1669 #:parallel-build? #f
1670 #:tests? #f)) ; no test suite
1674 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1675 (synopsis "Show and modify Linux frame buffer settings")
1677 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1678 different kinds of graphic displays. The @command{fbset} utility can query and
1679 change various device settings such as depth, virtual resolution, and timing
1681 (license license:gpl2)))
1683 (define-public procps
1689 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1690 "procps-ng-" version ".tar.xz"))
1693 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1694 (build-system gnu-build-system)
1696 `(#:modules ((guix build utils)
1697 (guix build gnu-build-system)
1700 ,@(if (%current-target-system)
1703 "ac_cv_func_malloc_0_nonnull=yes"
1704 "ac_cv_func_realloc_0_nonnull=yes"))
1707 (modify-phases %standard-phases
1709 'install 'post-install
1710 ;; Remove commands and man pages redudant with
1712 (lambda* (#:key outputs #:allow-other-keys)
1713 (let* ((out (assoc-ref outputs "out"))
1714 (dup (append-map (cut find-files out <>)
1715 '("^kill" "^uptime"))))
1716 (for-each delete-file dup)
1718 (inputs `(("ncurses" ,ncurses)))
1719 (home-page "https://gitlab.com/procps-ng/procps/")
1720 (synopsis "Utilities that give information about processes")
1722 "Procps is the package that has a bunch of small useful utilities
1723 that give information about processes using the Linux /proc file system.
1724 The package includes the programs ps, top, vmstat, w, kill, free,
1725 slabtop, and skill.")
1726 (license license:gpl2)))
1728 (define-public usbutils
1735 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1736 "usbutils-" version ".tar.xz"))
1738 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1739 (build-system gnu-build-system)
1740 (outputs (list "out" "python"))
1743 (modify-phases %standard-phases
1744 (add-before 'bootstrap 'patch-bootstrap-scripts
1746 (substitute* "usbhid-dump/bootstrap"
1747 (("/bin/bash") (which "bash")))
1749 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1750 (substitute* "autogen.sh"
1751 (("^\\./configure.*") ""))
1753 (add-after 'install 'separate-python-output
1754 ;; Separating one Python script shaves more than 106 MiB from :out.
1755 (lambda* (#:key outputs #:allow-other-keys)
1756 (let ((out (assoc-ref outputs "out"))
1757 (out:python (assoc-ref outputs "python")))
1758 (for-each (lambda (file)
1759 (let ((old (string-append out "/" file))
1760 (new (string-append out:python "/" file)))
1761 (mkdir-p (dirname new))
1762 (rename-file old new)))
1763 (list "bin/lsusb.py"))
1768 ("python" ,python)))
1770 `(("autoconf" ,autoconf)
1771 ("automake" ,automake)
1772 ("libtool" ,libtool)
1773 ("pkg-config" ,pkg-config)))
1774 (home-page "http://www.linux-usb.org/")
1776 "Tools for working with USB devices, such as lsusb")
1778 "Tools for working with USB devices, such as lsusb.")
1779 (license license:gpl2+)))
1781 (define-public e2fsprogs
1788 "mirror://kernel.org/linux/kernel/people/tytso/"
1789 "e2fsprogs/v" version "/"
1790 "e2fsprogs-" version ".tar.xz"))
1793 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1794 (build-system gnu-build-system)
1795 (inputs `(("util-linux" ,util-linux "lib")))
1796 (native-inputs `(("pkg-config" ,pkg-config)
1797 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1801 ("procps" ,procps)))
1803 '(;; util-linux is the preferred source for some of the libraries and
1804 ;; commands, so disable them (see, e.g.,
1805 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1806 #:configure-flags (list "--disable-libblkid"
1807 "--disable-libuuid" "--disable-uuidd"
1810 ;; Use symlinks instead of hard links for
1811 ;; 'fsck.extN' etc. This makes the resulting nar
1812 ;; smaller and is preserved across copies.
1813 "--enable-symlink-install"
1815 (string-append "LDFLAGS=-Wl,-rpath="
1816 (assoc-ref %outputs "out")
1819 ;; Install libext2fs et al.
1820 "--enable-elf-shlibs")
1823 (modify-phases %standard-phases
1824 (add-before 'configure 'patch-shells
1826 (substitute* "configure"
1827 (("/bin/sh (.*)parse-types.sh" _ dir)
1828 (string-append (which "sh") " " dir
1830 (substitute* "MCONFIG.in"
1831 (("INSTALL_SYMLINK = /bin/sh")
1832 "INSTALL_SYMLINK = sh"))
1833 (substitute* (find-files "." "^Makefile.in$")
1835 (string-append "#!" (which "sh"))))
1837 (add-after 'install 'install-libs
1838 (lambda* (#:key outputs #:allow-other-keys)
1839 (let* ((out (assoc-ref outputs "out"))
1840 (lib (string-append out "/lib")))
1841 (invoke "make" "install-libs")
1843 ;; Make the .a writable so that 'strip' works.
1844 ;; Failing to do that, due to debug symbols, we
1845 ;; retain a reference to the final
1846 ;; linux-libre-headers, which refer to the
1847 ;; bootstrap binaries.
1848 (let ((archives (find-files lib "\\.a$")))
1849 (for-each (lambda (file)
1853 (home-page "http://e2fsprogs.sourceforge.net/")
1854 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1856 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1857 (license (list license:gpl2 ;programs
1858 license:lgpl2.0 ;libext2fs
1859 license:x11)))) ;libuuid
1861 (define e2fsprogs/static
1863 (package (inherit e2fsprogs)
1865 ;; Do not build shared libraries.
1866 (substitute-keyword-arguments (package-arguments e2fsprogs)
1867 ((#:configure-flags _)
1868 '(list "--disable-blkid"))
1872 (define-public e2fsck/static
1874 (name "e2fsck-static")
1875 (version (package-version e2fsprogs))
1876 (build-system trivial-build-system)
1879 `(("e2fsprogs" ,e2fsprogs/static)))
1881 `(#:modules ((guix build utils))
1884 (use-modules (guix build utils)
1888 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1890 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1892 (with-directory-excursion bin
1893 (copy-file e2fsck "e2fsck")
1894 (remove-store-references "e2fsck")
1895 (chmod "e2fsck" #o555))
1897 (home-page (package-home-page e2fsprogs))
1898 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1899 (description "This package provides statically-linked e2fsck command taken
1900 from the e2fsprogs package. It is meant to be used in initrds.")
1901 (license (package-license e2fsprogs))))
1903 (define-public extundelete
1905 (name "extundelete")
1910 (uri (string-append "mirror://sourceforge/extundelete/"
1911 "extundelete/" version "/extundelete-"
1912 version ".tar.bz2"))
1915 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1916 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1917 (build-system gnu-build-system)
1918 (inputs `(("e2fsprogs" ,e2fsprogs)))
1919 (home-page "http://extundelete.sourceforge.net/")
1920 (synopsis "Recover deleted files from ext2/3/4 partitions")
1922 "Extundelete is a set of tools that can recover deleted files from an
1923 ext3 or ext4 partition.")
1924 (license license:gpl2)))
1926 (define-public zerofree
1930 (home-page "https://frippery.org/uml/")
1933 (uri (string-append home-page name "-" version
1937 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1938 (build-system gnu-build-system)
1941 (modify-phases %standard-phases
1942 (delete 'configure) ; no configure script
1944 ;; The Makefile lacks an ‘install’ target.
1945 (lambda* (#:key outputs #:allow-other-keys)
1946 (let* ((out (assoc-ref outputs "out"))
1947 (bin (string-append out "/bin")))
1948 (chmod "zerofree" #o555)
1949 (install-file "zerofree" bin)
1951 #:tests? #f)) ; no tests
1952 (inputs `(("libext2fs" ,e2fsprogs)))
1953 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1955 "Zerofree finds the unallocated blocks with non-zero value content in an
1956 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1957 This is a simple way to make disk images more compressible.
1958 Zerofree requires the file system to be unmounted or mounted read-only.")
1959 (license license:gpl2)))
1961 (define-public strace
1965 (home-page "https://strace.io")
1968 (uri (string-append home-page "/files/" version
1969 "/strace-" version ".tar.xz"))
1972 "1abs3svkg9985f4jrxx34sj1dcpsf95vv1a0g01c777zgygncjnz"))))
1973 (build-system gnu-build-system)
1976 (modify-phases %standard-phases
1977 (add-after 'unpack 'patch-/bin/sh
1979 (substitute* "strace.c"
1980 (("/bin/sh") (which "sh")))
1982 (add-after 'unpack 'disable-failing-tests
1984 ;; XXX These hang forever even if the test time-out is extended.
1985 (substitute* "tests/Makefile.in"
1986 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
1988 ;; Don't fail if the architecture doesn't support different personalities.
1989 #:configure-flags '("--enable-mpers=check")
1990 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1991 #:parallel-tests? #f)) ; undeterministic failures
1992 (native-inputs `(("perl" ,perl)))
1993 (synopsis "System call tracer for Linux")
1995 "strace is a system call tracer, i.e. a debugging tool which prints out a
1996 trace of all the system calls made by a another process/program.")
1997 (license license:lgpl2.1+)))
1999 (define-public ltrace
2005 (uri (string-append "http://www.ltrace.org/ltrace_" version
2009 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
2010 (build-system gnu-build-system)
2011 (inputs `(("libelf" ,libelf)))
2013 ;; Compilation uses -Werror by default, but it fails.
2014 '(#:configure-flags '("--disable-werror")))
2015 (home-page "https://www.ltrace.org/")
2016 (synopsis "Library call tracer for Linux")
2018 "ltrace intercepts and records dynamic library calls which are called by
2019 an executed process and the signals received by that process. It can also
2020 intercept and print the system calls executed by the program.")
2021 (license license:gpl2+)))
2023 (define-public alsa-lib
2030 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
2031 version ".tar.bz2"))
2034 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
2035 (build-system gnu-build-system)
2037 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2038 (assoc-ref %outputs "out")
2040 (home-page "https://www.alsa-project.org/")
2041 (synopsis "The Advanced Linux Sound Architecture libraries")
2043 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2044 MIDI functionality to the Linux-based operating system.")
2045 (license license:lgpl2.1+)))
2047 (define-public alsa-utils
2053 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
2054 name "-" version ".tar.bz2"))
2057 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
2058 (build-system gnu-build-system)
2060 ;; XXX: Disable man page creation until we have DocBook.
2061 '(#:configure-flags (list "--disable-xmlto"
2063 ;; The udev rule is responsible for restoring
2065 (string-append "--with-udev-rules-dir="
2066 (assoc-ref %outputs "out")
2067 "/lib/udev/rules.d"))
2069 (modify-phases %standard-phases
2070 (add-before 'check 'disable-broken-test
2072 ;; XXX: The 1.1.8 release tarball is missing a header that's
2073 ;; required for this test to work. Fixed in 1.1.9.
2074 (substitute* "axfer/test/Makefile"
2075 ((".*container-test.*") ""))
2078 'install 'pre-install
2080 ;; Don't try to mkdir /var/lib/alsa.
2081 (substitute* "Makefile"
2082 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2086 `(("gettext" ,gettext-minimal)))
2088 `(("libsamplerate" ,libsamplerate)
2089 ("ncurses" ,ncurses)
2090 ("alsa-lib" ,alsa-lib)
2092 (home-page "http://www.alsa-project.org/")
2093 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2095 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2096 MIDI functionality to the Linux-based operating system.")
2098 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2100 (license license:gpl2)))
2102 (define-public alsa-plugins
2104 (name "alsa-plugins")
2108 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2109 name "-" version ".tar.bz2"))
2112 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2113 (build-system gnu-build-system)
2114 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2115 ;; be split, there are references to both in files.
2116 ;; TODO: Remove OSS related plugins, they add support to run native
2117 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2119 (outputs '("out" "pulseaudio" "jack"))
2121 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2122 ;; for /etc/alsa. On Guix System plugins are loaded from
2123 ;; the ALSA service, and other distributions likely
2124 ;; won't use these files.
2125 "--with-alsalconfdir=/tmp/noop")
2127 (modify-phases %standard-phases
2128 (add-after 'install 'split
2129 (lambda* (#:key inputs outputs #:allow-other-keys)
2130 ;; Distribute the binaries to the various outputs.
2131 (let* ((out (assoc-ref outputs "out"))
2132 (jack (assoc-ref outputs "jack"))
2133 (jacklib (string-append jack "/lib/alsa-lib"))
2134 (pua (assoc-ref outputs "pulseaudio"))
2135 (pualib (string-append pua "/lib/alsa-lib")))
2138 (for-each (lambda (file)
2139 (rename-file file (string-append jacklib "/" (basename file))))
2140 (find-files out ".*jack\\.(la|so)"))
2143 (for-each (lambda (file)
2144 (rename-file file (string-append pualib "/" (basename file))))
2145 (find-files out ".*pulse\\.(la|so)"))
2148 `(("alsa-lib" ,alsa-lib)
2150 ("speex" ,speex) ; libspeexdsp resampling plugin
2151 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2152 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2153 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2155 `(("pkg-config" ,pkg-config)))
2156 (home-page "http://www.alsa-project.org/")
2157 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2159 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2160 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2161 by providing additional plugins which include: upmixing, downmixing, jackd and
2162 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2163 external rate conversion.")
2164 (license (list license:gpl2+
2165 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2166 license:lgpl2.1+))))
2168 (define-public iptables
2171 ;; XXX When updating, remove the ‘install-missing-script’ phase.
2176 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2178 (string-append "https://www.netfilter.org/projects/iptables/"
2179 "files/iptables-" version ".tar.bz2")))
2181 (base32 "02a3575ypdpg6a2x752mhk3f7h1381ymkq1n0gss6fp6292xfmyl"))))
2182 (build-system gnu-build-system)
2184 `(("pkg-config" ,pkg-config)
2188 `(("libmnl" ,libmnl)
2189 ("libnftnl" ,libnftnl)))
2191 '(#:tests? #f ; no test suite
2192 #:configure-flags ; add $libdir to the RUNPATH of executables
2193 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
2195 (modify-phases %standard-phases
2196 (add-after 'install 'install-missing-script
2197 ;; A typo prevents installation of /sbin/iptables-apply. It's been
2198 ;; fixed upstream (d4ed0c741fc789bb09d977d74d30875fdd50d08b), but
2199 ;; a patch would require bootstrapping and more inputs. Simply copy
2200 ;; the file ourselves.
2201 (lambda* (#:key outputs #:allow-other-keys)
2202 (let* ((out (assoc-ref outputs "out"))
2203 (sbin (string-append out "/sbin")))
2204 (install-file "iptables/iptables-apply" sbin)
2206 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2207 (synopsis "Programs to configure Linux IP packet filtering rules")
2209 "@command{iptables} is the user-space command line program used to
2210 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2211 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2213 This package also includes @command{ip6tables}, which is used to configure the
2216 Both commands are targeted at system administrators.")
2217 (license license:gpl2+)))
2219 (define-public lsscsi
2226 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2229 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
2230 (build-system gnu-build-system)
2231 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2232 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2234 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2235 also list NVMe namespaces or controllers and show the relationship between a
2236 device's primary node name, its SCSI generic (sg) node name and its kernel
2238 (license license:gpl2)))
2240 (define-public ebtables
2247 "mirror://netfilter.org/ebtables/ebtables-"
2251 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2252 (build-system gnu-build-system)
2255 ("iptables" ,iptables)))
2256 (synopsis "Ethernet bridge frame table administration")
2257 (home-page "https://ebtables.netfilter.org/")
2259 "ebtables is an application program used to set up and maintain the
2260 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2261 analogous to the iptables application, but less complicated, due to the fact
2262 that the Ethernet protocol is much simpler than the IP protocol.")
2263 (license license:gpl2+)))
2265 (define-public iproute
2272 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2276 "0vk4vickrpahdhl3zazr2qn2bf99v5549ncirjpwiy4h0a4izkfg"))))
2277 (build-system gnu-build-system)
2279 `( ;; There is a test suite, but it wants network namespaces and sudo.
2281 #:make-flags (let ((out (assoc-ref %outputs "out")))
2283 (string-append "BASH_COMPDIR=" out
2284 "/etc/bash_completion.d")
2285 (string-append "LIBDIR=" out "/lib")
2286 (string-append "HDRDIR=" out "/include")
2287 (string-append "SBINDIR=" out "/sbin")
2288 (string-append "CONFDIR=" out "/etc")
2289 (string-append "DOCDIR=" out "/share/doc/"
2291 (string-append "MANDIR=" out "/share/man")))
2292 #:phases (modify-phases %standard-phases
2293 (add-before 'install 'pre-install
2295 ;; Don't attempt to create /var/lib/arpd.
2296 (substitute* "Makefile"
2297 (("^.*ARPDDIR.*$") ""))
2301 ("iptables" ,iptables)
2302 ("libmnl" ,libmnl)))
2306 ("pkg-config" ,pkg-config)))
2308 ;; ("libmnl" ,libmnl)
2309 ;; ("util-linux" ,util-linux)
2311 "https://wiki.linuxfoundation.org/networking/iproute2")
2313 "Utilities for controlling TCP/IP networking and traffic in Linux")
2315 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2316 and traffic with the Linux kernel. The most important of these are
2317 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2320 Most network configuration manuals still refer to ifconfig and route as the
2321 primary network configuration tools, but ifconfig is known to behave
2322 inadequately in modern network environments, and both should be deprecated.")
2323 (license license:gpl2+)))
2325 (define-public net-tools
2326 ;; XXX: This package is basically unmaintained, but it provides a few
2327 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2329 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2333 (version (string-append "1.60-" revision "." (string-take commit 7)))
2336 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2337 "n/ne/net-tools/code.git/net-tools-code-"
2339 (file-name (string-append name "-" version ".zip"))
2342 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2343 (home-page "http://net-tools.sourceforge.net/")
2344 (build-system gnu-build-system)
2346 `(#:modules ((guix build gnu-build-system)
2351 (modify-phases %standard-phases
2353 (lambda* (#:key outputs #:allow-other-keys)
2354 (let ((out (assoc-ref outputs "out")))
2355 (mkdir-p (string-append out "/bin"))
2356 (mkdir-p (string-append out "/sbin"))
2358 ;; Pretend we have everything...
2359 (system "yes | make config")
2361 ;; ... except for the things we don't have.
2362 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2363 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2364 ;; that have been removed.
2365 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2366 ;; think about adding them later.
2367 (substitute* '("config.make" "config.h")
2368 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2371 (add-after 'install 'remove-redundant-commands
2372 (lambda* (#:key outputs #:allow-other-keys)
2373 ;; Remove commands and man pages redundant with Inetutils.
2374 (let* ((out (assoc-ref outputs "out"))
2375 (dup (append-map (cut find-files out <>)
2377 "^(yp|nis|dns)?domainname"))))
2378 (for-each delete-file dup)
2380 ;; Binaries that depend on libnet-tools.a don't declare that
2381 ;; dependency, making it parallel-unsafe.
2382 #:parallel-build? #f
2384 #:tests? #f ; no test suite
2385 #:make-flags (let ((out (assoc-ref %outputs "out")))
2386 (list ,(string-append "CC=" (cc-for-target))
2387 (string-append "BASEDIR=" out)
2388 (string-append "INSTALLNLSDIR=" out "/share/locale")
2389 (string-append "mandir=/share/man")))))
2390 (native-inputs `(("gettext" ,gettext-minimal)
2392 (supported-systems (delete "i586-gnu" %supported-systems))
2393 (synopsis "Tools for controlling the network subsystem in Linux")
2395 "This package includes the important tools for controlling the network
2396 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2397 route. Additionally, this package contains utilities relating to particular
2398 network hardware types (plipconfig, slattach) and advanced aspects of IP
2399 configuration (iptunnel, ipmaddr).")
2400 (license license:gpl2+))))
2402 (define-public libcap
2409 "mirror://kernel.org/linux/libs/security/linux-privs/"
2410 "libcap2/libcap-" version ".tar.xz"))
2413 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2414 (build-system gnu-build-system)
2415 (arguments '(#:phases
2416 (modify-phases %standard-phases
2418 ;; Add $libdir to the RUNPATH of executables.
2420 (substitute* "Make.Rules"
2422 (string-append "LDFLAGS := -Wl,-rpath="
2425 #:test-target "test"
2426 #:make-flags (list "lib=lib"
2427 (string-append "prefix="
2428 (assoc-ref %outputs "out"))
2429 "RAISE_SETFCAP=no")))
2430 (native-inputs `(("perl" ,perl)))
2431 (supported-systems (delete "i586-gnu" %supported-systems))
2432 (home-page "https://sites.google.com/site/fullycapable/")
2433 (synopsis "Library for working with POSIX capabilities")
2435 "Libcap2 provides a programming interface to POSIX capabilities on
2436 Linux-based operating systems.")
2438 ;; License is BSD-3 or GPLv2, at the user's choice.
2439 (license license:gpl2)))
2441 ;; libcap 2.31 causes problems for 'fakeroot', so provide this newer variant.
2442 ;; To be merged with libcap on the next rebuild cycle.
2443 (define-public libcap/next
2450 "mirror://kernel.org/linux/libs/security/linux-privs/"
2451 "libcap2/libcap-" version ".tar.xz"))
2454 "048n1gy2p48vl9hkrr9wymfxxcpwj2aslz2bv79nhl4m2lhd9kdf"))))))
2456 (define-public bridge-utils
2458 (name "bridge-utils")
2463 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2464 "bridge-utils-" version ".tar.xz"))
2466 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
2467 (build-system gnu-build-system)
2469 ;; The tarball lacks all the generated files.
2470 (native-inputs `(("autoconf" ,autoconf)
2471 ("automake" ,automake)))
2474 (modify-phases %standard-phases
2475 (add-before 'bootstrap 'patch-stuff
2477 ;; Fix "field ‘ip6’ has incomplete type" errors.
2478 (substitute* "libbridge/libbridge.h"
2479 (("#include <linux/if_bridge.h>")
2480 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2482 ;; Ensure that the entire build fails if one of the
2483 ;; sub-Makefiles fails.
2484 (substitute* "Makefile.in"
2485 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2486 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2489 #:tests? #f)) ; no 'check' target
2491 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2492 (synopsis "Manipulate Ethernet bridges")
2494 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2495 to connect two Ethernet segments together in a protocol independent way.
2496 Packets are forwarded based on Ethernet address, rather than IP address (like
2497 a router). Since forwarding is done at Layer 2, all protocols can go
2498 transparently through a bridge.")
2499 (license license:gpl2+)))
2501 (define-public libnl
2508 "https://github.com/thom311/libnl/releases/download/"
2509 "libnl" (string-join (string-split version #\.) "_")
2510 "/libnl-" version ".tar.gz"))
2513 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2514 (build-system gnu-build-system)
2518 ("pkg-config" ,pkg-config)
2524 "https://github.com/thom311/libnl/releases/download/libnl"
2525 (string-join (string-split version #\.) "_")
2526 "/libnl-doc-" version ".tar.gz"))
2528 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2529 (outputs `("out" "doc"))
2532 (modify-phases %standard-phases
2533 (add-after 'install 'install-doc
2534 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2535 (let ((dest (string-append (assoc-ref outputs "doc")
2536 "/share/doc/libnl")))
2538 (invoke "tar" "xf" (assoc-ref
2539 (or native-inputs inputs)
2541 "--strip-components=1" "-C" dest)))))))
2542 (home-page "https://www.infradead.org/~tgr/libnl/")
2543 (synopsis "NetLink protocol library suite")
2545 "The libnl suite is a collection of libraries providing APIs to netlink
2546 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2547 between the kernel and user space processes. It was designed to be a more
2548 flexible successor to ioctl to provide mainly networking related kernel
2549 configuration and monitoring interfaces.")
2551 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2552 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2553 (license license:gpl2)))
2555 ;; libnl python extensions used to be outputs of libnl. However, as
2556 ;; cross-compiling python extensions is currently broken, create separate
2557 ;; packages for libnl python extensions.
2558 (define (libnl-python-package python)
2559 (let ((name (string-append "libnl-" python)))
2564 ((string=? python "python2")
2565 `(("python-2" ,python-2)))
2566 ((string=? python "python3")
2567 `(("python-3" ,python-3))))))
2568 (propagated-inputs `(("libnl" ,libnl)))
2571 `(#:modules ((guix build gnu-build-system)
2575 (modify-phases %standard-phases
2577 (lambda* (#:key inputs outputs #:allow-other-keys)
2578 (define (python-inst python)
2579 (invoke python "setup.py" "build")
2580 (invoke python "setup.py" "install"
2581 (string-append "--prefix="
2582 (assoc-ref %outputs "out")))
2583 (invoke python "setup.py" "clean"))
2584 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2585 (assoc-ref inputs "libnl")))
2586 (with-directory-excursion "./python" (python-inst ,python))
2589 (define-public libnl-python2 (libnl-python-package "python2"))
2590 (define-public libnl-python3 (libnl-python-package "python3"))
2599 "mirror://kernel.org/software/network/iw/iw-"
2603 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2604 (build-system gnu-build-system)
2605 (native-inputs `(("pkg-config" ,pkg-config)))
2606 (inputs `(("libnl" ,libnl)))
2609 (let* ((target ,(%current-target-system))
2610 (pkg-config (if target
2611 (string-append target "-pkg-config")
2614 ,(string-append "CC=" (cc-for-target))
2615 (string-append "PKG_CONFIG="
2616 (assoc-ref %build-inputs "pkg-config")
2618 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2619 #:phases (modify-phases %standard-phases (delete 'configure))))
2620 (home-page "https://wireless.wiki.kernel.org/")
2621 (synopsis "Tool for configuring wireless devices")
2623 "iw is a new nl80211 based CLI configuration utility for wireless
2624 devices. It replaces @code{iwconfig}, which is deprecated.")
2625 (license license:isc)))
2627 (define-public powertop
2634 (uri (string-append "https://01.org/sites/default/files/downloads/"
2635 "powertop-" version ".tar.gz"))
2637 (base32 "0y1ixw8v17fdb1ima0zshrd0rh4zxdh10r93nrrvq6d4lhn9jpx6"))))
2638 (build-system gnu-build-system)
2641 (modify-phases %standard-phases
2642 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2643 ;; allow calibrating the network interface in Guix System.
2644 (add-after 'unpack 'patch-absolute-file-names
2645 (lambda* (#:key inputs #:allow-other-keys)
2646 (let ((kmod (assoc-ref inputs "kmod")))
2647 (substitute* (find-files "src" "\\.cpp$")
2648 ;; Give the right 'modprobe' file name so that essential
2649 ;; modules such as msr.ko can be loaded.
2650 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2651 ;; These programs are only needed to calibrate, so using
2652 ;; relative file names avoids adding extra inputs. When they
2653 ;; are missing powertop gracefully handles it.
2654 (("/usr/bin/hcitool") "hcitool")
2655 (("/usr/bin/xset") "xset")
2656 (("/usr/sbin/hciconfig") "hciconfig"))
2661 ("ncurses" ,ncurses)
2662 ("pciutils" ,pciutils)
2665 `(("pkg-config" ,pkg-config)))
2666 (home-page "https://01.org/powertop/")
2667 (synopsis "Analyze power consumption on Intel-based laptops")
2669 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2670 power management. In addition to being a diagnostic tool, PowerTOP also has
2671 an interactive mode where the user can experiment various power management
2672 settings for cases where the operating system has not enabled these
2674 (license license:gpl2)))
2676 (define-public aumix
2683 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2684 version ".tar.bz2"))
2687 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2688 (build-system gnu-build-system)
2689 (inputs `(("ncurses" ,ncurses)))
2690 (home-page "http://www.jpj.net/~trevor/aumix.html")
2691 (synopsis "Audio mixer for X and the console")
2693 "Aumix adjusts an audio mixer from X, the console, a terminal,
2694 the command line or a script.")
2695 (license license:gpl2+)))
2697 (define-public iotop
2704 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2707 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2708 (build-system python-build-system)
2711 (modify-phases %standard-phases
2712 (add-after 'unpack 'fix-build-with-python3
2714 (substitute* "setup.py"
2715 (("itervalues") "values"))
2717 ;; There are currently no checks in the package.
2719 (native-inputs `(("python" ,python)))
2720 (home-page "http://guichaz.free.fr/iotop/")
2722 "Displays the IO activity of running processes")
2724 "Iotop is a Python program with a top like user interface to show the
2725 processes currently causing I/O.")
2726 (license license:gpl2+)))
2734 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2735 "download/fuse-" version
2736 "/fuse-" version ".tar.gz"))
2739 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2740 (patches (search-patches "fuse-overlapping-headers.patch"))))
2741 (build-system gnu-build-system)
2742 (inputs `(("util-linux" ,util-linux)))
2744 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2745 (assoc-ref %outputs "out")
2747 (string-append "INIT_D_PATH="
2748 (assoc-ref %outputs "out")
2751 ;; The rule makes /dev/fuse 666.
2752 (string-append "UDEV_RULES_PATH="
2753 (assoc-ref %outputs "out")
2754 "/lib/udev/rules.d"))
2756 (modify-phases %standard-phases
2757 (add-before 'build 'set-file-names
2758 (lambda* (#:key inputs #:allow-other-keys)
2759 ;; libfuse calls out to mount(8) and umount(8). Make sure
2760 ;; it refers to the right ones.
2761 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2762 (("/bin/(u?)mount" _ maybe-u)
2763 (string-append (assoc-ref inputs "util-linux")
2764 "/bin/" maybe-u "mount")))
2765 (substitute* '("util/mount.fuse.c")
2769 ;; This hack leads libfuse to search for 'fusermount' in
2770 ;; $PATH, where it may find a setuid-root binary, instead of
2771 ;; trying solely $out/sbin/fusermount and failing because
2773 (substitute* "lib/Makefile"
2774 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2775 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2777 (supported-systems (delete "i586-gnu" %supported-systems))
2778 (home-page "https://github.com/libfuse/libfuse")
2779 (synopsis "Support file systems implemented in user space")
2781 "As a consequence of its monolithic design, file system code for Linux
2782 normally goes into the kernel itself---which is not only a robustness issue,
2783 but also an impediment to system extensibility. FUSE, for \"file systems in
2784 user space\", is a kernel module and user-space library that tries to address
2785 part of this problem by allowing users to run file system implementations as
2786 user-space processes.")
2787 (license (list license:lgpl2.1 ;library
2788 license:gpl2+)))) ;command-line utilities
2790 (define-public unionfs-fuse
2792 (name "unionfs-fuse")
2797 (url "https://github.com/rpodgorny/unionfs-fuse")
2798 (commit (string-append "v" version))))
2799 (file-name (git-file-name name version))
2802 "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6"))))
2803 (build-system cmake-build-system)
2805 `(("python" ,python)))
2806 (inputs `(("fuse" ,fuse)))
2808 ;; The tests were never actually run ("collected 0 items"), but in recent
2809 ;; versions of pytest that causes an error.
2811 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2812 (synopsis "User-space union file system")
2814 "UnionFS-FUSE is a flexible union file system implementation in user
2815 space, using the FUSE library. Mounting a union file system allows you to
2816 \"aggregate\" the contents of several directories into a single mount point.
2817 UnionFS-FUSE additionally supports copy-on-write.")
2818 (license license:bsd-3)))
2821 (package (inherit fuse)
2822 (name "fuse-static")
2823 (source (origin (inherit (package-source fuse))
2824 (modules '((guix build utils)))
2827 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2828 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2829 ;; that it doesn't do that, allowing us to remove the
2830 ;; dependency on util-linux (something that is useful in
2832 (substitute* '("lib/mount_util.c"
2833 "util/mount_util.c")
2834 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2840 (define-public unionfs-fuse/static
2841 (package (inherit unionfs-fuse)
2842 (synopsis "User-space union file system (statically linked)")
2843 (name (string-append (package-name unionfs-fuse) "-static"))
2844 (source (origin (inherit (package-source unionfs-fuse))
2845 (modules '((guix build utils)))
2848 ;; Add -ldl to the libraries, because libfuse.a needs that.
2849 (substitute* "src/CMakeLists.txt"
2850 (("target_link_libraries(.*)\\)" _ libs)
2851 (string-append "target_link_libraries"
2856 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2858 (modify-phases %standard-phases
2859 (add-after 'install 'post-install
2860 (lambda* (#:key outputs #:allow-other-keys)
2861 (let* ((out (assoc-ref outputs "out"))
2862 (exe (string-append out "/bin/unionfs")))
2863 ;; By default, 'unionfs' keeps references to
2864 ;; $glibc/share/locale and similar stuff. Remove them.
2865 (remove-store-references exe)
2867 ;; 'unionfsctl' has references to glibc as well. Since
2868 ;; we don't need it, remove it.
2869 (delete-file (string-append out "/bin/unionfsctl"))
2871 (inputs `(("fuse" ,fuse-static)))))
2873 (define-public sshfs
2879 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2880 "download/sshfs-" version "/sshfs-" version
2884 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2885 (build-system gnu-build-system)
2890 `(("pkg-config" ,pkg-config)))
2891 (home-page "https://github.com/libfuse/sshfs")
2892 (synopsis "Mount remote file systems over SSH")
2894 "This is a file system client based on the SSH File Transfer Protocol.
2895 Since most SSH servers already support this protocol it is very easy to set
2896 up: on the server side there's nothing to do; on the client side mounting the
2897 file system is as easy as logging into the server with an SSH client.")
2898 (license license:gpl2+)))
2900 (define-public sshfs-fuse
2901 (package (inherit sshfs)
2903 (properties `((superseded . ,sshfs)))))
2905 (define-public archivemount
2907 (name "archivemount")
2912 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2913 "archivemount-" version ".tar.gz"))
2915 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2916 (build-system gnu-build-system)
2917 (inputs `(("fuse" ,fuse)
2918 ("libarchive" ,libarchive)))
2919 (native-inputs `(("pkg-config" ,pkg-config)))
2920 (home-page "https://www.cybernoia.de/software/archivemount.html")
2921 (synopsis "Tool for mounting archive files with FUSE")
2922 (description "archivemount is a FUSE-based file system for Unix variants,
2923 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2924 mount point where it can be read from or written to as with any other file
2925 system. This makes accessing the contents of the archive, which may be
2926 compressed, transparent to other programs, without decompressing them.")
2927 (license license:lgpl2.0+)))
2929 (define-public numactl
2936 "https://github.com/numactl/numactl/releases/download/v"
2937 version "/numactl-" version ".tar.gz"))
2940 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2941 (build-system gnu-build-system)
2943 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2944 ;; to run, which we can't assume to have.
2947 ;; NUMA is apparently not supported on armhf, see
2948 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2949 (supported-systems (delete "armhf-linux" %supported-systems))
2950 (home-page "https://github.com/numactl/numactl")
2951 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2953 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2954 memory is not all in one place. The @command{numactl} program allows you to
2955 run your application program on specific CPUs and memory nodes. It does this
2956 by supplying a NUMA memory policy to the operating system before running your
2959 The package contains other commands, such as @command{numastat},
2960 @command{memhog}, and @command{numademo} which provides a quick overview of
2961 NUMA performance on your system.")
2962 (license (list license:gpl2 ;programs
2963 license:lgpl2.1)))) ;library
2965 (define-public kbd-neo
2972 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2973 version "/linux/console/neo.map"))
2974 (file-name (string-append name "-" version ".map"))
2977 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2978 (build-system trivial-build-system)
2980 `(#:modules ((guix build utils))
2982 (use-modules (guix build utils))
2983 (let ((out (string-append %output "/share/keymaps"))
2984 (source (assoc-ref %build-inputs "source")))
2986 (copy-file source (string-append out "/neo.map"))
2988 (home-page "https://neo-layout.org")
2989 (synopsis "Neo2 console layout")
2991 "Kbd-neo provides the Neo2 keyboard layout for use with
2992 @command{loadkeys(1)} from @code{kbd(4)}.")
2993 ;; The file is located in an svn directory, the entire content of
2994 ;; the directory is licensed as GPL3.
2995 (license license:gpl3+)))
3003 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
3007 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
3008 (modules '((guix build utils)))
3011 (substitute* "tests/Makefile.in"
3012 ;; The '%: %.in' rule incorrectly uses @VERSION@.
3015 (substitute* '("src/unicode_start" "src/unicode_stop")
3016 ;; Assume the Coreutils are in $PATH.
3020 (build-system gnu-build-system)
3023 (modify-phases %standard-phases
3024 (add-before 'build 'pre-build
3025 (lambda* (#:key inputs #:allow-other-keys)
3026 (let ((gzip (assoc-ref %build-inputs "gzip"))
3027 (bzip2 (assoc-ref %build-inputs "bzip2")))
3028 (substitute* "src/libkeymap/findfile.c"
3030 (string-append gzip "/bin/gzip"))
3032 (string-append bzip2 "/bin/bzip2")))
3034 (add-after 'install 'post-install
3035 (lambda* (#:key outputs #:allow-other-keys)
3036 ;; Make sure these programs find their comrades.
3037 (let* ((out (assoc-ref outputs "out"))
3038 (bin (string-append out "/bin")))
3039 (for-each (lambda (prog)
3040 (wrap-program (string-append bin "/" prog)
3041 `("PATH" ":" prefix (,bin))))
3042 '("unicode_start" "unicode_stop"))
3044 (inputs `(("check" ,check)
3047 ("pam" ,linux-pam)))
3048 (native-search-paths
3049 (list (search-path-specification
3050 (variable "LOADKEYS_KEYMAP_PATH")
3051 ;; Append ‘/**’ to recursively search all directories. One can then
3052 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
3053 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
3054 (files (list "share/keymaps/**")))))
3055 (native-inputs `(("pkg-config" ,pkg-config)))
3056 (home-page "http://kbd-project.org/")
3057 (synopsis "Linux keyboard utilities and keyboard maps")
3059 "This package contains keytable files and keyboard utilities compatible
3060 for systems using the Linux kernel. This includes commands such as
3061 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3062 (license license:gpl2+)))
3064 (define-public loadkeys-static
3067 (name "loadkeys-static")
3069 (substitute-keyword-arguments (package-arguments kbd)
3070 ((#:configure-flags flags ''())
3071 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
3072 "--disable-vlock" ;so we don't need libpam
3073 "--disable-libkeymap")
3075 ((#:make-flags flags ''())
3076 `(cons "LDFLAGS=-all-static" ,flags))
3077 ((#:phases phases '%standard-phases)
3078 `(modify-phases ,phases
3080 (lambda* (#:key outputs #:allow-other-keys)
3081 (let ((out (assoc-ref outputs "out")))
3082 ;; The binary keeps references to gzip, among other things,
3083 ;; which we don't need in the initrd, so strip references.
3084 (remove-store-references "src/loadkeys")
3086 (install-file "src/loadkeys"
3087 (string-append out "/bin"))
3089 (delete 'post-install)))
3090 ((#:strip-flags _ '())
3092 ((#:allowed-references _ '())
3095 (synopsis "Statically-linked @command{loadkeys} program")
3097 ;; This package is meant to be used internally in the initrd so don't
3099 (properties '((hidden? . #t)))))
3101 (define-public inotify-tools
3103 (name "inotify-tools")
3104 (version "3.20.2.2")
3108 (url "https://github.com/rvoicilas/inotify-tools")
3110 (file-name (git-file-name name version))
3113 "1r12bglkb0bkqff6kgxjm81hk6z20nrxq3m7iv15d4nrqf9pm7s0"))))
3114 (build-system gnu-build-system)
3116 `(("autoconf" ,autoconf)
3117 ("automake" ,automake)
3118 ("libtool" ,libtool)))
3119 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3120 (synopsis "Monitor file accesses")
3122 "The inotify-tools packages provides a C library and command-line tools
3123 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3124 (license license:gpl2+)))
3133 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3134 "kmod-" version ".tar.xz"))
3137 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3138 (patches (search-patches "kmod-module-directory.patch"))))
3139 (build-system gnu-build-system)
3141 `(("pkg-config" ,pkg-config)))
3146 `(#:configure-flags '("--with-xz" "--with-zlib"
3147 "--disable-test-modules")
3149 (modify-phases %standard-phases
3150 (add-after 'unpack 'disable-tests
3152 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3153 (substitute* "Makefile.in"
3154 (("testsuite/test-modprobe") "")
3155 (("testsuite/test-depmod") "")
3156 (("testsuite/test-blacklist") ""))
3158 (add-after 'install 'install-modprobe&co
3159 (lambda* (#:key outputs #:allow-other-keys)
3160 (let* ((out (assoc-ref outputs "out"))
3161 (bin (string-append out "/bin")))
3162 (for-each (lambda (tool)
3164 (string-append bin "/" tool)))
3165 '("insmod" "rmmod" "lsmod" "modprobe"
3166 "modinfo" "depmod"))
3168 (supported-systems (delete "i586-gnu" %supported-systems))
3169 (home-page "https://www.kernel.org/")
3170 (synopsis "Kernel module tools")
3171 (description "Kmod is a set of tools to handle common tasks with Linux
3172 kernel modules like insert, remove, list, check properties, resolve
3173 dependencies and aliases.
3175 These tools are designed on top of libkmod, a library that is shipped with
3176 kmod. The aim is to be compatible with tools, configurations and indices
3177 from the module-init-tools project.")
3178 (license license:gpl2+))) ; library under lgpl2.1+
3180 (define-public earlyoom
3187 (url "https://github.com/rfjakob/earlyoom")
3188 (commit (string-append "v" version))))
3189 (file-name (git-file-name name version))
3192 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
3193 (build-system gnu-build-system)
3195 `(#:phases (modify-phases %standard-phases
3197 (add-before 'check 'set-home
3199 (setenv "HOME" (getcwd))
3201 (add-after 'build 'install-contribs
3202 ;; Install what seems useful from the contrib directory.
3203 (lambda* (#:key outputs #:allow-other-keys)
3204 (let* ((out (assoc-ref outputs "out"))
3205 (contrib (string-append
3206 out "/share/earlyoom/contrib")))
3207 (install-file "contrib/notify_all_users.py" contrib)
3209 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3210 (list ,(string-append "CC=" (cc-for-target))
3211 (string-append "VERSION=v" ,version)
3212 (string-append "PREFIX=" prefix)
3213 (string-append "SYSCONFDIR=" prefix "/etc")))
3214 #:test-target "test"))
3215 (native-inputs `(("go" ,go) ;for the test suite
3216 ("pandoc" ,pandoc))) ;to generate the manpage
3217 (home-page "https://github.com/rfjakob/earlyoom")
3218 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3219 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3220 runs in user space and provides a more responsive and configurable alternative
3221 to the in-kernel OOM killer.")
3222 (license license:expat)))
3224 (define-public eudev
3225 ;; The post-systemd fork, maintained by Gentoo.
3231 (uri (git-reference (url "https://github.com/gentoo/eudev")
3232 (commit (string-append "v" version))))
3233 (file-name (git-file-name name version))
3236 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3237 (patches (search-patches "eudev-rules-directory.patch"))))
3238 (build-system gnu-build-system)
3241 (modify-phases %standard-phases
3242 (add-after 'unpack 'make-source-writable
3244 ;; XXX: Git checkouts are read-only, but this package needs to
3245 ;; modify some of its files.
3246 (for-each make-file-writable (find-files "."))
3248 (add-before 'bootstrap 'patch-file-names
3249 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3250 (substitute* "man/make.sh"
3251 (("/usr/bin/xsltproc")
3252 (string-append (assoc-ref
3253 (or native-inputs inputs) "xsltproc")
3256 (add-before 'configure 'patch-bindir-in-btrfs-rules
3257 (lambda* (#:key outputs #:allow-other-keys)
3258 ;; The "@bindir@" substitution incorrectly expands to a literal
3259 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3261 (let ((out (assoc-ref outputs "out")))
3262 (substitute* "rules/64-btrfs.rules.in"
3264 (string-append out "/bin")))
3266 (add-after 'install 'move-static-library
3267 (lambda* (#:key outputs #:allow-other-keys)
3268 (let* ((out (assoc-ref outputs "out"))
3269 (static (assoc-ref outputs "static"))
3270 (source (string-append out "/lib/libudev.a"))
3271 (target (string-append static "/lib/libudev.a")))
3272 (mkdir-p (dirname target))
3273 (link source target)
3274 (delete-file source)
3275 ;; Remove reference to the static library from the .la file
3276 ;; such that Libtool looks for it in the usual places.
3277 (substitute* (string-append out "/lib/libudev.la")
3279 "old_library=''\n"))
3281 (add-after 'install 'build-hwdb
3282 (lambda* (#:key outputs #:allow-other-keys)
3283 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3284 ;; similar tools to display product names.
3286 ;; XXX: This can't be done when cross-compiling. Find another way
3287 ;; to generate hwdb.bin for cross-built systems.
3288 (let ((out (assoc-ref outputs "out")))
3289 ,@(if (%current-target-system)
3291 '((invoke (string-append out "/bin/udevadm")
3292 "hwdb" "--update")))))))
3293 #:configure-flags (list "--enable-manpages")))
3295 `(("autoconf" ,autoconf)
3296 ("automake" ,automake)
3298 ("libtool" ,libtool)
3299 ("pkg-config" ,pkg-config)
3302 ("python" ,python-wrapper)
3303 ;; For documentation.
3304 ("docbook-xml" ,docbook-xml-4.2)
3305 ("docbook-xsl" ,docbook-xsl)
3306 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3307 ("xsltproc" ,libxslt)))
3309 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3310 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3311 ;; which contains the rules to do that.
3312 `(("util-linux" ,util-linux "lib") ;for blkid
3314 (outputs '("out" "static"))
3315 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3316 (synopsis "Userspace device management")
3317 (description "Udev is a daemon which dynamically creates and removes
3318 device nodes from /dev/, handles hotplug events and loads drivers at boot
3320 (license license:gpl2+)))
3322 (define-public python-evdev
3324 (name "python-evdev")
3329 (uri (pypi-uri "evdev" version))
3331 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3332 (build-system python-build-system)
3334 `(("kernel-headers" ,linux-libre-headers)))
3336 `(#:tests? #f ;no rule for tests
3338 (modify-phases %standard-phases
3339 (add-before 'build 'fix-hard-coded-directory
3340 (lambda* (#:key inputs #:allow-other-keys)
3341 (substitute* "setup.py"
3342 (("/usr/include/linux")
3344 (assoc-ref inputs "kernel-headers") "/include/linux")))
3346 (home-page "https://github.com/gvalkov/python-evdev")
3347 (synopsis "Bindings to the Linux input handling subsystem")
3349 "Python-evdev provides bindings to the generic input event interface in
3350 Linux. The @code{evdev} interface serves the purpose of passing events
3351 generated in the kernel directly to userspace through character devices that
3352 are typically located in @file{/dev/input/}.
3354 This package also comes with bindings to @code{uinput}, the userspace input
3355 subsystem. @code{uinput} allows userspace programs to create and handle input
3356 devices that can inject events directly into the input subsystem.")
3357 (license license:bsd-3)))
3365 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
3367 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3371 "1l0fkn9abrgk5mfn6jfh9qhdr86b59l1c5pk6lp8jh0491d69las"))
3372 (modules '((guix build utils)))
3375 (use-modules (guix build utils))
3377 ;; Honor sysconfdir.
3378 (substitute* "make.tmpl.in"
3380 "confdir = @sysconfdir@\n")
3381 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3382 "DEFAULT_SYS_DIR = @sysconfdir@"))
3384 (patches (search-patches "lvm2-static-link.patch"))))
3385 (build-system gnu-build-system)
3387 `(("pkg-config" ,pkg-config)
3388 ("procps" ,procps))) ;tests use 'pgrep'
3390 `(("libaio" ,libaio)
3394 (modify-phases %standard-phases
3395 (add-after 'configure 'set-makefile-shell
3397 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3399 (setenv "SHELL" (which "sh"))
3401 ;; Replace /bin/sh with the right file name.
3402 (patch-makefile-SHELL "make.tmpl")
3405 #:configure-flags (list (string-append "--sysconfdir="
3406 (assoc-ref %outputs "out")
3408 "--enable-udev_sync"
3409 "--enable-udev_rules"
3410 "--enable-pkgconfig"
3412 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3414 ;; Make sure programs such as 'dmsetup' can
3415 ;; find libdevmapper.so.
3416 (string-append "LDFLAGS=-Wl,-rpath="
3417 (assoc-ref %outputs "out")
3419 (assoc-ref %outputs "out")
3420 "/lib/device-mapper")
3421 ;; This is needed when cross-compiling.
3422 ,@(if (%current-target-system)
3423 '("ac_cv_func_malloc_0_nonnull=yes"
3424 "ac_cv_func_realloc_0_nonnull=yes")
3427 ;; The tests use 'mknod', which requires root access.
3429 (supported-systems (delete "i586-gnu" %supported-systems))
3430 (home-page "https://sourceware.org/lvm2/")
3431 (synopsis "Logical volume management for Linux")
3433 "LVM2 is the logical volume management tool set for Linux-based systems.
3434 This package includes the user-space libraries and tools, including the device
3435 mapper. Kernel components are part of Linux-libre.")
3437 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3438 ;; Command-line tools are GPLv2.
3439 (license (list license:gpl2 license:lgpl2.1))))
3441 (define-public lvm2-static
3444 (name "lvm2-static")
3446 ;; Propagate udev because libdevmapper.a depends on libudev.
3447 (propagated-inputs `(("udev:static" ,eudev "static")))
3450 (substitute-keyword-arguments (package-arguments lvm2)
3451 ((#:configure-flags flags '())
3452 ;; LVM2 doesn't use Libtool, hence the custom option.
3453 `(append '("--enable-static_link")
3454 ;; Building dmeventd statically is complicated due to a
3455 ;; requirement on libdevmapper.a, which is being phased out
3456 ;; in favor of libdevice-mapper.a, which in turn is is not
3457 ;; easily made available at dmeventd build time. Just ignore
3458 ;; it until the situation improves.
3459 (delete "--enable-dmeventd" ,flags)))
3461 `(modify-phases ,phases
3462 (add-before 'configure 'adjust-Makefile
3464 ;; These fixes are related to the upstream libdm->device_mapper
3465 ;; migration and will hopefully be fixed upstream in due time.
3466 (substitute* "tools/Makefile.in"
3467 ;; This variable is empty in a static configuration and causes
3468 ;; an erroneous GCC command line.
3469 (("-L\\$\\(interfacebuilddir\\)") "")
3470 ;; Remove obsolete reference to libdevmapper.a.
3471 (("-ldevmapper") ""))
3473 (synopsis "Logical volume management for Linux (statically linked)")))
3475 (define-public thin-provisioning-tools
3477 (name "thin-provisioning-tools")
3483 (url "https://github.com/jthornber/thin-provisioning-tools")
3484 (commit (string-append "v" version))))
3485 (file-name (git-file-name name version))
3487 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
3488 (build-system gnu-build-system)
3490 ;; Doesn't build with --enable-testing due to a function name collision
3491 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
3494 `(("automake" ,automake)
3495 ("autoreconf" ,autoconf)))
3499 ("libaio" ,libaio)))
3500 (synopsis "Tools for manipulating the metadata of device-mapper targets")
3501 (description "A suite of tools for manipulating the metadata of the
3502 dm-thin, dm-cache and dm-era device-mapper targets.")
3503 (home-page "https://github.com/jthornber/thin-provisioning-tools")
3504 (license license:gpl3+)))
3506 (define-public wireless-tools
3508 (name "wireless-tools")
3512 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3516 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3519 ;; Remove the older header files that are not free software.
3520 (for-each (lambda (n)
3521 (delete-file (format #f "wireless.~a.h" n)))
3522 '(10 11 12 13 14 15 16 17 18 19 20))
3524 (build-system gnu-build-system)
3527 (list (string-append "PREFIX=" %output)
3528 (string-append "INSTALL_MAN=" %output "/share/man")
3529 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3532 (modify-phases %standard-phases
3534 (lambda* (#:key target #:allow-other-keys)
3535 (when ,(%current-target-system)
3536 ;; Cross-compilation: use the cross tools.
3537 (substitute* (find-files "." "Makefile")
3539 (string-append "CC = " target "-gcc\n"))
3541 (string-append "AR = " target "-ar\n"))
3543 (string-append "RANLIB = " target "-ranlib\n"))))
3546 (synopsis "Tools for manipulating Linux Wireless Extensions")
3547 (description "Wireless Tools are used to manipulate the now-deprecated
3548 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3549 Extension was an interface allowing you to set Wireless LAN specific
3550 parameters and get the specific stats. It is deprecated in favor the nl80211
3552 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3553 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3554 ;; other files are distributed under gpl2.
3555 (license (list license:gpl2 license:lgpl2.1+))))
3563 (uri (string-append "mirror://kernel.org/software/network/crda/"
3564 "crda-" version ".tar.xz"))
3567 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3568 (patches (search-patches "crda-optional-gcrypt.patch"))))
3569 (build-system gnu-build-system)
3571 `(#:phases (modify-phases %standard-phases
3573 (add-after 'unpack 'gzip-determinism
3575 (substitute* "Makefile"
3576 (("gzip") "gzip --no-name"))
3578 ,@(if (%current-target-system)
3580 'unpack 'fix-pkg-config
3581 (lambda* (#:key target #:allow-other-keys)
3585 (string-append target "-pkg-config")))
3589 'build 'no-werror-no-ldconfig
3591 (substitute* "Makefile"
3593 (("ldconfig") "true"))
3596 'build 'set-regulator-db-file-name
3597 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3598 ;; Tell CRDA where to find our database.
3599 (let ((regdb (assoc-ref (or native-inputs inputs)
3601 (substitute* "crda.c"
3602 (("\"/lib/crda/regulatory.bin\"")
3603 (string-append "\"" regdb
3604 "/lib/crda/regulatory.bin\"")))
3606 #:test-target "verify"
3607 #:make-flags (let ((out (assoc-ref %outputs "out"))
3608 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3610 (string-append "CC=" ,(cc-for-target))
3613 ;; Disable signature-checking on 'regulatory.bin'.
3614 ;; The reason is that this simplifies maintenance
3615 ;; on our side (no need to manage a distro key
3616 ;; pair), and we can guarantee integrity of
3617 ;; 'regulatory.bin' by other means anyway, such as
3618 ;; 'guix gc --verify'. See
3619 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3623 (string-append "PREFIX=" out)
3624 (string-append "SBINDIR=" out "/sbin/")
3625 (string-append "UDEV_RULE_DIR="
3626 out "/lib/udev/rules.d")
3627 (string-append "LDFLAGS=-Wl,-rpath="
3629 (string-append "REG_BIN=" regdb
3630 "/lib/crda/regulatory.bin")
3632 (native-inputs `(("pkg-config" ,pkg-config)
3633 ("wireless-regdb" ,wireless-regdb)))
3634 (inputs `(("libnl" ,libnl)))
3636 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3637 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3639 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3640 communication between the kernel Linux and user space for regulatory
3642 (license license:copyleft-next)))
3644 (define-public wireless-regdb
3646 (name "wireless-regdb")
3647 (version "2020.04.29")
3651 "mirror://kernel.org/software/network/wireless-regdb/"
3652 "wireless-regdb-" version ".tar.xz"))
3655 "0yicda474ygahv8da18h1p4yf42s6x2f208mlwcw4xsrxld07zc9"))
3657 ;; We're building 'regulatory.bin' by ourselves.
3659 (delete-file "regulatory.bin")
3661 (build-system gnu-build-system)
3664 (modify-phases %standard-phases
3665 (add-after 'unpack 'gzip-determinism
3667 (substitute* "Makefile"
3668 (("gzip") "gzip --no-name"))
3670 (add-after 'unpack 'omit-signature
3672 (substitute* "Makefile"
3673 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3674 ;; don't provide (see below). Disable it.
3675 ((" regulatory\\.db\\.p7s") "")
3676 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3677 ;; but ‘make install’ depends only on the latter while installing
3678 ;; both (and failing). Depend on it explicitly.
3679 (("^install: " all) (string-append all "regulatory.db ")))
3681 (delete 'configure)) ; no configure script
3683 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3684 ;; is computed and can be equal to 'maintainer-clean'; when that
3685 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3686 ;; just built. Thus, build things sequentially.
3687 #:parallel-build? #f
3689 #:tests? #f ; no tests
3691 (let ((out (assoc-ref %outputs "out")))
3692 (list (string-append "PREFIX=" out)
3693 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3695 ;; Leave this empty so that db2bin.py doesn't try to sign
3696 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3697 ;; pair for the whole distribution.
3698 (string-append "REGDB_PRIVKEY=")
3699 ;; Don't generate a public key for the same reason. These are
3700 ;; used as Makefile targets and can't be the empty string.
3701 (string-append "REGDB_PUBCERT=/dev/null")
3702 (string-append "REGDB_PUBKEY=/dev/null")))))
3704 `(("python" ,python-wrapper)))
3706 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3707 (synopsis "Wireless regulatory database")
3709 "This package contains the wireless regulatory database Central
3710 Regulatory Database Agent (CRDA) daemon. The database contains information on
3711 country-specific regulations for the wireless spectrum.")
3712 (license license:isc)))
3714 (define-public lm-sensors
3722 (url "https://github.com/groeck/lm-sensors")
3723 (commit (string-append "V" (string-join
3724 (string-split version #\.) "-")))))
3725 (file-name (git-file-name name version))
3727 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3728 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3729 (build-system gnu-build-system)
3730 (inputs `(("rrdtool" ,rrdtool)
3733 ("gnuplot" ,gnuplot)))
3734 (native-inputs `(("pkg-config" ,pkg-config)
3738 (outputs '("lib" ; avoid perl in closure
3741 `(#:tests? #f ; no 'check' target
3742 #:make-flags (list (string-append "PREFIX=" %output)
3743 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3744 (string-append "INCLUDEDIR="
3745 (assoc-ref %outputs "lib") "/include")
3746 (string-append "MANDIR=" %output "/share/man")
3747 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3749 (modify-phases %standard-phases
3751 (add-before 'build 'patch-exec-paths
3752 (lambda* (#:key inputs outputs #:allow-other-keys)
3753 (substitute* "prog/detect/sensors-detect"
3755 (string-append "`" (assoc-ref inputs "coreutils")
3757 (("(`|\")modprobe" all open-quote)
3758 (string-append open-quote
3759 (assoc-ref inputs "kmod")
3761 (substitute* '("prog/pwm/pwmconfig"
3762 "prog/pwm/fancontrol")
3764 (string-append (assoc-ref inputs "gnuplot")
3767 (string-append (assoc-ref inputs "coreutils")
3770 (string-append (assoc-ref inputs "grep")
3773 (string-append (assoc-ref inputs "sed")
3776 (string-append (assoc-ref inputs "coreutils")
3779 (string-append (assoc-ref inputs "coreutils")
3782 (string-append (assoc-ref inputs "coreutils")
3783 "/bin/readlink -f")))
3785 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3786 (synopsis "Utilities to read temperature/voltage/fan sensors")
3788 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3789 you to access information from temperature, voltage, and fan speed sensors.
3790 It works with most newer systems.")
3791 (license license:gpl2+)))
3793 (define-public iucode-tool
3795 (name "iucode-tool")
3799 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3800 "/raw/latest/iucode-tool_" version ".tar.xz"))
3803 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3804 (build-system gnu-build-system)
3805 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3806 (synopsis "Manipulate Intel microcode bundles")
3808 "@command{iucode_tool} is a utility to work with microcode packages for
3809 Intel processors. It can convert between formats, extract specific versions,
3810 create a firmware image suitable for the Linux kernel, and more.")
3811 ;; cpuid.h is available for i686, x86_64, and ia64.
3812 (supported-systems '("i686-linux" "x86_64-linux"))
3813 (license license:gpl2+)))
3815 (define-public i2c-tools
3822 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3823 version ".tar.bz2"))
3826 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3827 (build-system gnu-build-system)
3829 `(#:tests? #f ; no 'check' target
3830 #:make-flags (list (string-append "prefix=" %output)
3831 ,(string-append "CC=" (cc-for-target)))
3832 ;; No configure script.
3833 #:phases (modify-phases %standard-phases (delete 'configure))))
3836 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3837 (synopsis "I2C tools for Linux")
3839 "The i2c-tools package contains a heterogeneous set of I2C tools for
3840 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3841 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3843 (license license:gpl2+)))
3845 (define-public xsensors
3852 "http://www.linuxhardware.org/xsensors/xsensors-"
3856 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3857 (build-system gnu-build-system)
3858 (inputs `(("lm-sensors" ,lm-sensors "lib")
3860 (native-inputs `(("pkg-config" ,pkg-config)))
3863 (modify-phases %standard-phases
3864 (add-before 'configure 'enable-deprecated
3866 (substitute* "src/Makefile.in"
3867 (("-DGDK_DISABLE_DEPRECATED") "")
3868 (("-DGTK_DISABLE_DEPRECATED") ""))
3870 (add-before 'configure 'remove-Werror
3872 (substitute* '("configure" "src/Makefile.in")
3875 (home-page "http://www.linuxhardware.org/xsensors/")
3876 (synopsis "Hardware health information viewer")
3878 "Xsensors reads data from the libsensors library regarding hardware
3879 health such as temperature, voltage and fan speed and displays the information
3880 in a digital read-out.")
3881 (license license:gpl2+)))
3886 (version (package-version linux-libre))
3887 (source (package-source linux-libre))
3888 (build-system gnu-build-system)
3891 (modify-phases %standard-phases
3893 (lambda* (#:key inputs #:allow-other-keys)
3894 (setenv "SHELL_PATH" (which "bash"))
3895 (chdir "tools/perf")
3897 #:make-flags (list (string-append "prefix="
3898 (assoc-ref %outputs "out"))
3902 ;; By default, 'config/Makefile' uses lib64 on
3903 ;; x86_64. Work around that.
3905 #:tests? #f)) ;no tests
3907 `(("pkg-config" ,pkg-config)
3911 ;; There are build scripts written in these languages.
3913 ("python2" ,python-2)
3914 ("python3" ,python-3)))
3916 `(("slang" ,slang) ;for the interactive TUI
3918 ("python" ,python-2) ;'perf' links against libpython
3919 ("elfutils" ,elfutils)
3920 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3921 ("libunwind" ,libunwind) ;better stack walking
3922 ("numactl" ,numactl) ;for 'perf bench numa mem'
3925 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3926 ("docbook-xsl" ,docbook-xsl)
3928 ("asciidoc" ,asciidoc)))
3929 (home-page "https://perf.wiki.kernel.org/")
3930 (synopsis "Linux profiling with performance counters")
3932 "perf is a tool suite for profiling using hardware performance counters,
3933 with support in the Linux kernel. perf can instrument CPU performance
3934 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3935 of lightweight profiling. This package contains the user-land tools and in
3936 particular the @code{perf} command.")
3937 (license (package-license linux-libre))))
3939 (define-public pflask
3946 (url "https://github.com/ghedo/pflask")
3947 (commit (string-append "v" version))))
3948 (file-name (git-file-name name version))
3951 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
3952 (build-system cmake-build-system)
3954 '(#:tests? #f)) ; no tests
3955 (home-page "https://ghedo.github.io/pflask/")
3956 (synopsis "Simple tool for creating Linux namespace containers")
3957 (description "pflask is a simple tool for creating Linux namespace
3958 containers. It can be used for running a command or even booting an OS inside
3959 an isolated container, created with the help of Linux namespaces. It is
3960 similar in functionality to chroot, although pflask provides better isolation
3961 thanks to the use of namespaces.")
3962 (license license:bsd-2)))
3964 (define-public singularity
3966 (name "singularity")
3970 (uri (string-append "https://github.com/singularityware/singularity/"
3971 "releases/download/" version
3972 "/singularity-" version ".tar.gz"))
3975 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3976 (modules '((guix build utils)))
3979 ;; Do not create directories in /var.
3980 (substitute* "Makefile.in"
3981 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3983 ;; The original source overrides PATH so that it points to
3984 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3985 ;; on Guix System. Leave PATH unchanged so we refer to the
3986 ;; installed Coreutils, grep, etc.
3987 (substitute* "bin/singularity.in"
3989 (string-append "#" all "\n")))
3991 (substitute* (find-files "libexec/cli" "\\.exec$")
3992 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3994 (string-append "/run/setuid-programs/singularity-"
3995 program "-helper")))
3997 ;; These squashfs mount options are apparently no longer
3998 ;; supported since Linux-libre 5.4.5.
3999 (substitute* "src/lib/image/squashfs/mount.c"
4000 (("\"errors=remount-ro\"")
4003 (build-system gnu-build-system)
4005 `(#:configure-flags '("--localstatedir=/var")
4007 (modify-phases %standard-phases
4008 (add-after 'unpack 'patch-references
4010 (substitute* "libexec/cli/build.exec"
4011 (("if ! singularity_which mksquashfs") "if 0")
4012 (("if ! mksquashfs")
4013 (string-append "if ! " (which "mksquashfs"))))
4014 (substitute* (list "libexec/cli/help.exec"
4015 "libexec/bootstrap-scripts/functions"
4016 "libexec/bootstrap-scripts/post.sh"
4017 "libexec/functions")
4019 (string-append "| " (which "grep") " "))
4021 (string-append (which "egrep") " ")))
4023 (add-after 'install 'set-PATH
4024 (lambda* (#:key inputs outputs #:allow-other-keys)
4025 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
4026 (let ((out (assoc-ref outputs "out"))
4027 (coreutils (assoc-ref inputs "coreutils")))
4028 (wrap-program (string-append out "/bin/singularity")
4029 `("PATH" ":" = (,(string-append coreutils "/bin"))))
4030 (substitute* (string-append out "/bin/run-singularity")
4031 (("/usr/bin/env singularity")
4032 (string-append (which "env") " "
4033 out "/bin/singularity")))
4036 `(("libarchive" ,libarchive)
4037 ("python" ,python-wrapper)
4039 ("squashfs-tools" ,squashfs-tools)))
4040 (home-page "https://singularity.lbl.gov/")
4041 (synopsis "Container platform")
4042 (description "Singularity is a container platform supporting a number of
4043 container image formats. It can build SquashFS container images or import
4044 existing Docker images. Singularity requires kernel support for container
4045 isolation or root privileges.")
4046 (license license:bsd-3)))
4048 (define-public hdparm
4054 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
4055 "hdparm-" version ".tar.gz"))
4058 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
4059 (build-system gnu-build-system)
4062 (let ((out (assoc-ref %outputs "out")))
4063 (list (string-append "binprefix=" out)
4064 (string-append "manprefix=" out)
4065 ,(string-append "CC=" (cc-for-target))
4066 ;; Let Guix strip the binaries and not break cross-compilation.
4069 (modify-phases %standard-phases
4070 (delete 'configure)) ; no configure script
4071 #:tests? #f)) ; no test suite
4072 (home-page "https://sourceforge.net/projects/hdparm/")
4073 (synopsis "View and tune ATA disk drive parameters")
4075 "@command{hdparm} is a command-line utility to control ATA controllers and
4076 disk drives. It can increase performance and/or reliability by careful tuning
4077 of hardware settings like power and acoustic management, DMA modes, and caching.
4078 It can also display detailed device information, or be used as a simple
4079 performance benchmarking tool.
4081 @command{hdparm} provides a command line interface to various Linux kernel
4082 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
4083 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4084 Translation (@dfn{SAT}) are also supported.")
4085 (license (license:non-copyleft "file://LICENSE.TXT"))))
4087 (define-public nvme-cli
4091 (home-page "https://github.com/linux-nvme/nvme-cli")
4096 (commit (string-append "v" version))))
4098 (base32 "0ldky34sn0m5c4hgiip0fkzm465nca69bhxicpd5dg8wxhzxqrp3"))
4099 (file-name (git-file-name name version))))
4100 (build-system gnu-build-system)
4103 (list ,(string-append "CC=" (cc-for-target)))
4104 #:phases (modify-phases %standard-phases
4105 (delete 'configure) ; no ./configure script
4108 (invoke "make" "install-spec" "PREFIX="
4109 (string-append "DESTDIR=" %output)))))
4110 ;; The tests require sysfs, which is not accessible from from the build
4113 (synopsis "NVM-Express user space tooling for Linux")
4114 (description "Nvme-cli is a utility to provide standards compliant tooling
4115 for NVM-Express drives. It was made specifically for Linux as it relies on the
4116 IOCTLs defined by the mainline kernel driver.")
4117 (license license:gpl2+)))
4119 (define-public rfkill
4125 (uri (string-append "mirror://kernel.org/software/network/"
4126 name "/" name "-" version ".tar.xz"))
4129 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4130 (build-system gnu-build-system)
4132 `(#:make-flags (list "CC=gcc"
4133 (string-append "PREFIX=" %output))
4134 #:phases (modify-phases %standard-phases
4135 (delete 'configure))
4137 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4138 (synopsis "Tool for enabling and disabling wireless devices")
4140 "rfkill is a simple tool for accessing the rfkill device interface,
4141 which is used to enable and disable wireless networking devices, typically
4142 WLAN, Bluetooth and mobile broadband.")
4143 (license (license:non-copyleft "file://COPYING"
4144 "See COPYING in the distribution."))
4145 ;; rfkill is part of util-linux as of 2.31.
4146 (properties `((superseded . ,util-linux)))))
4154 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4155 version "/" name "-" version ".tar.gz"))
4158 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4159 (build-system gnu-build-system)
4160 (home-page "http://acpiclient.sourceforge.net")
4161 (synopsis "Display information on ACPI devices")
4162 (description "@code{acpi} attempts to replicate the functionality of the
4163 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4164 information. It does not support ACPI suspending, only displays information
4165 about ACPI devices.")
4166 (license license:gpl2+)))
4168 (define-public acpid
4174 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4178 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4179 (build-system gnu-build-system)
4180 (home-page "https://sourceforge.net/projects/acpid2/")
4181 (synopsis "Daemon for delivering ACPI events to user-space programs")
4183 "acpid is designed to notify user-space programs of Advanced
4184 Configuration and Power Interface (ACPI) events. acpid should be started
4185 during the system boot, and will run as a background process. When an ACPI
4186 event is received from the kernel, acpid will examine the list of rules
4187 specified in /etc/acpi/events and execute the rules that match the event.")
4188 (license license:gpl2+)))
4190 (define-public sysfsutils
4199 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4202 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4203 (build-system gnu-build-system)
4204 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4205 (synopsis "System utilities based on Linux sysfs")
4207 "These are a set of utilities built upon sysfs, a virtual file system in
4208 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4209 also contains the libsysfs library.")
4210 ;; The library is under lgpl2.1+ (all files say "or any later version").
4211 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4212 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4214 (define-public sysfsutils-1
4216 (inherit sysfsutils)
4223 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4224 "/sysfsutils-" version ".tar.gz"))
4226 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4227 (modules '((guix build utils)))
4230 (substitute* "Makefile.in"
4231 (("includedir = /usr/include/sysfs")
4232 "includedir = @includedir@"))
4233 (substitute* "configure"
4234 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4235 (string-append "includedir='" orig "/sysfs'")))
4237 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4239 (define-public cpufrequtils
4241 (name "cpufrequtils")
4246 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4247 "cpufrequtils-" version ".tar.gz"))
4249 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4250 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4251 (build-system gnu-build-system)
4253 `(("sysfsutils" ,sysfsutils-1)))
4255 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4256 (assoc-ref %outputs "out") "/lib"))))
4257 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4258 (synopsis "Utilities to get and set CPU frequency on Linux")
4260 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4261 information, and set the CPU frequency if supported, using the cpufreq
4262 capabilities of the Linux kernel.")
4263 (license license:gpl2)))
4265 (define-public libraw1394
4272 "mirror://kernel.org/linux/libs/ieee1394/"
4273 name "-" version ".tar.xz"))
4276 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4277 (build-system gnu-build-system)
4278 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4279 (synopsis "Interface library for the Linux IEEE1394 drivers")
4281 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4282 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4283 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4284 send to and receive from other nodes without requiring a kernel driver for the
4285 protocol in question.")
4286 (license license:lgpl2.1+)))
4288 (define-public libavc1394
4294 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4295 name "-" version ".tar.gz"))
4298 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4299 (build-system gnu-build-system)
4301 `(("pkg-config" ,pkg-config)))
4303 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4304 (home-page "https://sourceforge.net/projects/libavc1394/")
4305 (synopsis "AV/C protocol library for IEEE 1394")
4307 "Libavc1394 is a programming interface to the AV/C specification from
4308 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4309 (license license:lgpl2.1+)))
4311 (define-public libiec61883
4313 (name "libiec61883")
4318 "mirror://kernel.org/linux/libs/ieee1394/"
4319 name "-" version ".tar.xz"))
4322 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4323 (build-system gnu-build-system)
4325 `(("pkg-config" ,pkg-config)))
4327 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4328 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4329 (synopsis "Isochronous streaming media library for IEEE 1394")
4331 "The libiec61883 library provides a higher level API for streaming DV,
4332 MPEG-2 and audio over Linux IEEE 1394.")
4333 (license license:lgpl2.1+)))
4335 (define-public mdadm
4342 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4346 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4347 (build-system gnu-build-system)
4351 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4352 (list ,(string-append "CC=" (cc-for-target))
4355 ;; TODO: tell it where to find 'sendmail'
4356 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4357 (string-append "BINDIR=" out "/sbin")
4358 (string-append "MANDIR=" out "/share/man")
4359 (string-append "UDEVDIR=" out "/lib/udev")))
4361 (modify-phases %standard-phases
4362 (add-before 'build 'patch-program-paths
4363 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4364 (let ((coreutils (assoc-ref (or native-inputs inputs)
4366 (substitute* "udev-md-raid-arrays.rules"
4367 (("/usr/bin/(readlink|basename)" all program)
4368 (string-append coreutils "/bin/" program))))
4370 (add-before 'build 'remove-W-error
4372 ;; We cannot build with -Werror on i686 due to a
4373 ;; 'sign-compare' warning in util.c.
4374 (substitute* "Makefile"
4377 (delete 'configure))
4378 ;;tests must be done as root
4380 (supported-systems (delete "i586-gnu" %supported-systems))
4381 (home-page "http://neil.brown.name/blog/mdadm")
4382 (synopsis "Tool for managing Linux Software RAID arrays")
4384 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4385 assemble, report on, and monitor arrays. It can also move spares between raid
4386 arrays when needed.")
4387 (license license:gpl2+)))
4389 (define-public mdadm-static
4392 (name "mdadm-static")
4394 (substitute-keyword-arguments (package-arguments mdadm)
4395 ((#:make-flags flags)
4396 `(cons "LDFLAGS = -static" ,flags))
4398 `(modify-phases ,phases
4399 (add-after 'install 'remove-cruft
4400 (lambda* (#:key outputs #:allow-other-keys)
4401 (let* ((out (assoc-ref outputs "out"))
4402 (precious? (lambda (file)
4403 (member file '("." ".." "sbin"))))
4404 (directories (scandir out (negate precious?))))
4405 (with-directory-excursion out
4406 (for-each delete-file-recursively directories)
4407 (remove-store-references "sbin/mdadm")
4408 (delete-file "sbin/mdmon")
4410 ((#:modules modules %gnu-build-system-modules)
4411 `((ice-9 ftw) ,@modules))
4412 ((#:strip-flags _ '())
4413 ''("--strip-all")) ;strip a few extra KiB
4414 ((#:allowed-references _ '("out"))
4415 '("out")))) ;refer only self
4416 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4418 (define-public multipath-tools
4420 (name "multipath-tools")
4425 (url "https://git.opensvc.com/multipath-tools/.git")
4427 (file-name (git-file-name name version))
4430 "14n8pcgnliicqxzc40xvjxk4cafm4qx7a3rsx5qva74r3ydzx8rn"))
4431 (patches (search-patches "multipath-tools-sans-systemd.patch"))
4432 (modules '((guix build utils)))
4435 ;; Drop bundled valgrind headers.
4436 (delete-file-recursively "third-party")
4437 (substitute* '("multipathd/main.c"
4438 "libmultipath/debug.c")
4439 (("#include \"../third-party/")
4442 (build-system gnu-build-system)
4444 '(#:test-target "test"
4445 #:parallel-build? #f ;XXX: broken in 0.8.4
4446 #:make-flags (list "CC=gcc"
4447 (string-append "DESTDIR="
4448 (assoc-ref %outputs "out"))
4449 ;; Install Udev rules below this directory, relative
4452 (string-append "LDFLAGS=-Wl,-rpath="
4453 (assoc-ref %outputs "out")
4456 (modify-phases %standard-phases
4457 (add-after 'unpack 'patch-source
4458 (lambda* (#:key inputs #:allow-other-keys)
4459 (let ((lvm2 (assoc-ref inputs "lvm2"))
4460 (udev (assoc-ref inputs "udev")))
4461 (substitute* "Makefile.inc"
4462 (("\\$\\(prefix\\)/usr") "$(prefix)")
4463 ;; Do not save timestamp to avoid gzip "timestamp
4464 ;; out-of-range" warnings.
4465 (("gzip -9") "gzip -9n"))
4466 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4467 (("/usr/include/libdevmapper.h")
4468 (string-append lvm2 "/include/libdevmapper.h"))
4469 (("/usr/include/libudev.h")
4470 (string-append udev "/include/libudev.h")))
4472 (add-after 'unpack 'fix-maybe-uninitialized-variable
4474 ;; This variable gets initialized later if needed, but GCC 7
4475 ;; fails to notice. Should be fixed for > 0.8.4.
4476 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4477 (substitute* "libmultipath/structs_vec.c"
4478 (("bool is_queueing;")
4479 "bool is_queueing = false;"))
4481 (add-after 'unpack 'fix-linking-tests
4483 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4484 ;; for versions > 0.8.4.
4485 (substitute* "tests/Makefile"
4486 (("-lmultipath -lcmocka")
4487 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4489 (delete 'configure)))) ; no configure script
4492 ("pkg-config" ,pkg-config)
4493 ("valgrind" ,valgrind)
4496 ("cmocka" ,cmocka)))
4498 `(("json-c" ,json-c-0.13)
4500 ("liburcu" ,liburcu)
4502 ("readline" ,readline)
4504 (home-page "http://christophe.varoqui.free.fr/")
4505 (synopsis "Access block devices through multiple paths")
4507 "This package provides the following binaries to drive the
4508 Linux Device Mapper multipathing driver:
4510 @item @command{multipath} - Device mapper target autoconfig.
4511 @item @command{multipathd} - Multipath daemon.
4512 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4513 @code{dm} multipath devices.
4514 @item @command{kpartx} - Create device maps from partition tables.
4516 (license (list license:gpl2+ ; main distribution
4517 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4519 (define-public libaio
4526 (string-append "https://releases.pagure.org/libaio/"
4527 name "-" version ".tar.gz")))
4530 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4531 (build-system gnu-build-system)
4534 (let ((target ,(%current-target-system)))
4535 (list (string-append "prefix=" %output)
4538 (string-append (assoc-ref %build-inputs "cross-gcc")
4539 "/bin/" target "-gcc")
4541 #:test-target "partcheck" ; need root for a full 'check'
4543 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4544 (home-page "https://pagure.io/libaio")
4545 (synopsis "Linux-native asynchronous I/O access library")
4547 "This library enables userspace to use Linux kernel asynchronous I/O
4548 system calls, important for the performance of databases and other advanced
4550 (license license:lgpl2.1+)))
4552 (define-public blktrace
4553 ;; Take a newer commit to get the fix for CVE-2018-10689.
4554 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4558 (version (git-version "1.2.0" revision commit))
4560 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4567 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4568 (file-name (git-file-name name version))))
4569 (build-system gnu-build-system)
4572 (list ,(string-append "CC=" (cc-for-target))
4573 (string-append "prefix=" %output))
4574 #:tests? #f ; no tests
4576 (modify-phases %standard-phases
4577 (delete 'configure) ; no configure script
4578 (add-after 'unpack 'fix-gnuplot-path
4579 (lambda* (#:key inputs #:allow-other-keys)
4580 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4581 (substitute* "btt/bno_plot.py"
4583 (string-append gnuplot "/bin/gnuplot %s")))
4586 `(("libaio" ,libaio)
4587 ("gnuplot" ,gnuplot)
4588 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4589 (synopsis "Block layer IO tracing mechanism")
4590 (description "Blktrace is a block layer IO tracing mechanism which provides
4591 detailed information about request queue operations to user space. It extracts
4592 event traces from the kernel (via the relaying through the debug file system).")
4593 (license license:gpl2))))
4601 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4605 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4606 (build-system gnu-build-system)
4608 `(("libsndfile" ,libsndfile)))
4610 `(("pkg-config" ,pkg-config)))
4611 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4612 (synopsis "Bluetooth subband audio codec")
4614 "The SBC is a digital audio encoder and decoder used to transfer data to
4615 Bluetooth audio output devices like headphones or loudspeakers.")
4616 (license license:gpl2+)))
4618 (define-public bluez
4625 "mirror://kernel.org/linux/bluetooth/bluez-"
4629 "1p2ncvjz6alr9n3l5wvq2arqgc7xjs6dqyar1l9jp0z8cfgapkb8"))))
4630 (build-system gnu-build-system)
4633 (let ((out (assoc-ref %outputs "out")))
4634 (list "--sysconfdir=/etc"
4635 "--localstatedir=/var"
4638 ;; Install dbus/udev files to the correct location.
4639 (string-append "--with-dbusconfdir=" out "/etc")
4640 (string-append "--with-udevdir=" out "/lib/udev")))
4642 (modify-phases %standard-phases
4643 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4644 ;; issue (discussion on upstream mailing list:
4645 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4646 (add-before 'check 'skip-wonky-test
4648 (substitute* "unit/test-gatt.c"
4649 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4651 (add-after 'install 'post-install
4652 (lambda* (#:key inputs outputs #:allow-other-keys)
4653 (let* ((out (assoc-ref outputs "out"))
4654 (servicedir (string-append out "/share/dbus-1/services"))
4655 (service "obexd/src/org.bluez.obex.service")
4656 (rule (string-append
4657 out "/lib/udev/rules.d/97-hid2hci.rules")))
4658 ;; Install the obex dbus service file.
4659 (substitute* service
4661 (string-append out "/libexec/bluetooth/obexd")))
4662 (install-file service servicedir)
4663 ;; Fix paths in the udev rule.
4665 (("hid2hci --method")
4666 (string-append out "/lib/udev/hid2hci --method"))
4668 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4671 `(("pkg-config" ,pkg-config)
4672 ("gettext" ,gettext-minimal)))
4677 ("libical" ,libical)
4678 ("readline" ,readline)))
4679 (home-page "http://www.bluez.org/")
4680 (synopsis "Linux Bluetooth protocol stack")
4682 "BlueZ provides support for the core Bluetooth layers and protocols. It
4683 is flexible, efficient and uses a modular implementation.")
4684 (license license:gpl2+)))
4686 (define-public fuse-exfat
4693 "https://github.com/relan/exfat/releases/download/v"
4694 version "/" name "-" version ".tar.gz"))
4697 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4698 (build-system gnu-build-system)
4700 `(("pkg-config" ,pkg-config)))
4703 (home-page "https://github.com/relan/exfat")
4704 (synopsis "Mount exFAT file systems")
4706 "This package provides a FUSE-based file system that provides read and
4707 write access to exFAT devices.")
4708 (license license:gpl2+)))
4710 (define-public fuseiso
4713 (version "20070708")
4716 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4717 version "/fuseiso-" version ".tar.bz2"))
4720 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4721 (build-system gnu-build-system)
4723 `(("pkg-config" ,pkg-config)))
4728 (home-page "https://sourceforge.net/projects/fuseiso/")
4729 (synopsis "Mount ISO file system images")
4731 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4732 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4733 Ridge, Joliet, and zisofs.")
4734 (license license:gpl2)))
4743 "https://www.nico.schottelius.org/software/gpm/archives/"
4744 "gpm-" version ".tar.bz2"))
4745 (patches (search-patches "gpm-glibc-2.26.patch"))
4748 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4749 (build-system gnu-build-system)
4751 '(#:phases (modify-phases %standard-phases
4754 ;; The tarball was not generated with 'make dist' so we
4755 ;; need to bootstrap things ourselves.
4756 (substitute* "autogen.sh"
4757 (("/bin/sh") (which "sh")))
4758 (invoke "./autogen.sh")
4759 (patch-makefile-SHELL "Makefile.include.in")
4762 ;; Make sure programs find libgpm.so.
4763 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4764 (assoc-ref %outputs "out")
4767 `(("texinfo" ,texinfo)
4770 ("autoconf" ,autoconf)
4771 ("automake" ,automake)
4772 ("libtool" ,libtool)))
4773 (home-page "https://www.nico.schottelius.org/software/gpm/")
4774 (synopsis "Mouse support for the Linux console")
4776 "The GPM (general-purpose mouse) daemon is a mouse server for
4777 applications running on the Linux console. It allows users to select items
4778 and copy/paste text in the console and in xterm.")
4779 (license license:gpl2+)))
4781 (define-public btrfs-progs
4783 (name "btrfs-progs")
4787 (uri (string-append "mirror://kernel.org/linux/kernel/"
4788 "people/kdave/btrfs-progs/"
4789 "btrfs-progs-v" version ".tar.xz"))
4792 "0p6ycbr8sw5bq3mj84gh9rvh5sk8sjr2l9hb9dhm4j41ij5h8bsw"))))
4793 (build-system gnu-build-system)
4795 "static")) ; static versions of the binaries in "out"
4797 '(#:phases (modify-phases %standard-phases
4798 (add-after 'unpack 'patch-makefile
4799 (lambda* (#:key outputs #:allow-other-keys)
4800 (substitute* "Makefile"
4801 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4802 (string-append (assoc-ref outputs "out")
4803 "/lib/udev/rules.d")))
4805 (add-after 'build 'build-static
4806 (lambda _ (invoke "make" "static")))
4807 (add-after 'install 'install-bash-completion
4808 (lambda* (#:key outputs #:allow-other-keys)
4809 (let* ((out (assoc-ref outputs "out"))
4810 (bashcomp (string-append out "/etc/bash_completion.d")))
4812 (copy-file "btrfs-completion"
4813 (string-append bashcomp "/btrfs"))
4815 (add-after 'install 'install-static
4816 (let ((staticbin (string-append (assoc-ref %outputs "static")
4820 (string-append "bindir=" staticbin)
4821 "install-static")))))
4822 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4823 #:test-target "test"
4824 #:parallel-tests? #f)) ; tests fail when run in parallel
4825 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4827 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
4828 ("util-linux:static" ,util-linux "static") ;ditto
4830 ("zlib:static" ,zlib "static")
4831 ("zstd" ,zstd "lib")
4832 ("zstd:static" ,zstd "static")))
4833 (native-inputs `(("pkg-config" ,pkg-config)
4834 ("asciidoc" ,asciidoc)
4837 ;; For building documentation.
4838 ("libxml2" ,libxml2)
4839 ("docbook-xsl" ,docbook-xsl)
4845 ;; The tests need 'grep' with perl regexp support.
4847 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4848 (synopsis "Create and manage btrfs copy-on-write file systems")
4849 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4850 aimed at implementing advanced features while focusing on fault tolerance,
4851 repair and easy administration.")
4852 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4853 ;; GPL2: Everything else.
4854 (license (list license:gpl2 license:gpl2+))))
4856 (define-public btrfs-progs/static
4858 (name "btrfs-progs-static")
4859 (version (package-version btrfs-progs))
4861 (build-system trivial-build-system)
4863 `(("btrfs-progs:static" ,btrfs-progs "static")))
4865 `(#:modules ((guix build utils))
4868 (use-modules (guix build utils)
4872 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4873 (out (assoc-ref %outputs "out"))
4874 (source (string-append btrfs "/bin/btrfs.static"))
4875 (target (string-append out "/bin/btrfs")))
4876 (mkdir-p (dirname target))
4877 (copy-file source target)
4878 (remove-store-references target)
4879 (chmod target #o555)
4881 (home-page (package-home-page btrfs-progs))
4882 (synopsis "Statically-linked btrfs command from btrfs-progs")
4883 (description "This package provides the statically-linked @command{btrfs}
4884 from the btrfs-progs package. It is meant to be used in initrds.")
4885 (license (package-license btrfs-progs))))
4887 (define-public cramfs-tools
4889 (name "cramfs-tools")
4890 (home-page "https://github.com/npitre/cramfs-tools")
4896 (commit (string-append "v" version))))
4898 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
4899 (file-name (git-file-name name version))))
4900 (build-system gnu-build-system)
4902 '(#:tests? #f ; No tests.
4904 (modify-phases %standard-phases
4907 (lambda* (#:key outputs #:allow-other-keys)
4908 (let ((out (assoc-ref outputs "out")))
4909 (install-file "mkcramfs" (string-append out "/sbin"))
4910 (install-file "cramfsck" (string-append out "/sbin")))
4914 (synopsis "Tools to manage Cramfs file systems")
4915 (description "Cramfs is a Linux file system designed to be simple, small,
4916 and to compress things well. It is used on a number of embedded systems and
4917 small devices. This version has additional features such as uncompressed
4918 blocks and random block placement.")
4919 (license license:gpl2+)))
4921 (define-public compsize
4925 (home-page "https://github.com/kilobyte/compsize")
4930 (commit (string-append "v" version))))
4932 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4933 (file-name (git-file-name name version))))
4934 (build-system gnu-build-system)
4936 `(("btrfs-progs" ,btrfs-progs)))
4938 `(#:tests? #f ; No tests.
4939 #:make-flags (list "CC=gcc")
4941 (modify-phases %standard-phases
4944 (lambda* (#:key outputs #:allow-other-keys)
4945 (let ((out (assoc-ref outputs "out")))
4946 (install-file "compsize" (string-append out "/bin"))
4947 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4948 (synopsis "Find compression type/ratio on Btrfs files")
4949 (description "@command{compsize} takes a list of files (given as
4950 arguments) on a Btrfs file system and measures used compression types and
4951 effective compression ratio, producing a report.
4953 A directory has no extents but has a (recursive) list of files. A non-regular
4954 file is silently ignored.
4956 As it makes no sense to talk about compression ratio of a partial extent,
4957 every referenced extent is counted whole, exactly once -- no matter if you use
4958 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4959 uncompressed size will not match the number given by @command{tar} or
4960 @command{du}. On the other hand, the space used should be accurate (although
4961 obviously it can be shared with files outside our set).")
4962 (license license:gpl2+)))
4964 (define-public f2fs-tools-1.7
4971 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4972 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4975 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4977 (build-system gnu-build-system)
4980 (modify-phases %standard-phases
4981 (add-after 'install 'install-headers
4982 (lambda* (#:key outputs #:allow-other-keys)
4983 (let* ((out (assoc-ref outputs "out"))
4984 (out-include (string-append out "/include")))
4985 (install-file "include/f2fs_fs.h" out-include)
4986 (install-file "mkfs/f2fs_format_utils.h" out-include)
4989 `(("autoconf" ,autoconf)
4990 ("automake" ,automake)
4991 ("libtool" ,libtool)
4992 ("pkg-config" ,pkg-config)))
4994 `(("libuuid" ,util-linux "lib")
4995 ("libselinux" ,libselinux)))
4996 (home-page "https://f2fs.wiki.kernel.org/")
4997 (synopsis "Userland tools for f2fs")
4999 "F2FS, the Flash-Friendly File System, is a modern file system
5000 designed to be fast and durable on flash devices such as solid-state
5001 disks and SD cards. This package provides the userland utilities.")
5002 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
5003 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
5004 (license (list license:gpl2 license:lgpl2.1))))
5006 (define-public f2fs-tools
5008 (inherit f2fs-tools-1.7)
5014 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5015 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5018 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
5020 `(("libuuid" ,util-linux "lib")))))
5022 (define-public f2fs-tools/static
5025 (inherit f2fs-tools)
5026 (name "f2fs-tools-static")
5029 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
5030 (libuuid (assoc-ref %build-inputs "libuuid")))
5032 (string-append "libuuid_CFLAGS=-I" libuuid "/include")
5033 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
5034 (string-append "libblkid_CFLAGS=-I" libuuid "/include")
5035 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
5036 #:disallowed-references (,util-linux)
5038 (modify-phases %standard-phases ; TODO: f2fs phases.
5039 (add-after 'unpack 'make-static
5041 (define (append-to-file name body)
5042 (let ((file (open-file name "a")))
5045 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
5046 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
5047 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
5049 (add-after 'install 'remove-store-references
5050 (lambda* (#:key outputs #:allow-other-keys)
5051 ;; Work around bug in our util-linux.
5052 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
5053 (remove-store-references (string-append (assoc-ref outputs "out")
5057 `(("libuuid:static" ,util-linux "static")
5058 ("libuuid" ,util-linux "lib")))))) ; for include files
5060 (define-public f2fs-fsck/static
5062 (name "f2fs-fsck-static")
5063 (version (package-version f2fs-tools/static))
5065 (build-system trivial-build-system)
5067 `(#:modules ((guix build utils))
5070 (use-modules (guix build utils)
5073 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
5075 (out (assoc-ref %outputs "out"))
5076 (sbin (string-append out "/sbin")))
5078 (with-directory-excursion sbin
5079 (install-file (string-append f2fs-tools "/sbin/" fsck)
5081 (remove-store-references fsck)
5085 `(("f2fs-tools-static" ,f2fs-tools/static)))
5086 (home-page (package-home-page f2fs-tools/static))
5087 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5088 (description "This package provides statically-linked fsck.f2fs command taken
5089 from the f2fs-tools package. It is meant to be used in initrds.")
5090 (license (package-license f2fs-tools/static))))
5092 (define-public freefall
5095 (version (package-version linux-libre))
5096 (source (package-source linux-libre))
5097 (build-system gnu-build-system)
5099 '(#:phases (modify-phases %standard-phases
5100 (add-after 'unpack 'enter-subdirectory
5102 (chdir "tools/laptop/freefall")
5105 (add-before 'build 'increase-timeout
5107 ;; The default of 2 seconds is too low: it assumes an
5108 ;; open lid and AC power without actually checking.
5109 (substitute* "freefall.c"
5110 (("alarm\\(2\\)") "alarm(5)"))
5112 #:make-flags (list (string-append "PREFIX="
5113 (assoc-ref %outputs "out"))
5115 #:tests? #f)) ;no tests
5116 (home-page (package-home-page linux-libre))
5117 (synopsis "Free-fall protection for spinning laptop hard drives")
5119 "Prevents shock damage to the internal spinning hard drive(s) of some
5120 HP and Dell laptops. When sudden movement is detected, all input/output
5121 operations on the drive are suspended and its heads are parked on the ramp,
5122 where they are less likely to cause damage to the spinning disc. Requires a
5123 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5124 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5125 (license license:gpl2)))
5127 (define-public thinkfan
5135 (url "https://github.com/vmatare/thinkfan")
5137 (file-name (git-file-name name version))
5139 (base32 "18vgm5w5pjnpipa34j4x87q10695w2jnqwvc2f027afy7mnzw7kz"))))
5140 (build-system cmake-build-system)
5142 `(#:modules ((guix build cmake-build-system)
5145 #:tests? #f ; no test target
5147 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5148 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5150 `("-DUSE_ATASMART:BOOL=ON")
5152 (modify-phases %standard-phases
5153 (add-after 'unpack 'create-init-scripts
5154 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5155 ;; systemd to patch and install their service files. Fake their
5156 ;; presence rather than duplicating the build system below. Leave
5157 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5158 ;; The sysvinit needs manual patching, but since upstream doesn't
5159 ;; even provide the option to install it: don't.
5160 (lambda* (#:key outputs #:allow-other-keys)
5161 (let* ((out (assoc-ref outputs "out"))
5162 (share (string-append out "/share/" ,name)))
5163 (substitute* "CMakeLists.txt"
5164 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5165 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5166 ;; That was easy! Now we just need to fix the destinations.
5168 (string-append out directory)))
5171 `(("pkg-config" ,pkg-config)))
5173 `(("libatasmart" ,libatasmart)
5174 ("yaml-cpp" ,yaml-cpp)))
5175 (home-page "https://github.com/vmatare/thinkfan")
5176 (synopsis "Simple fan control program")
5178 "Thinkfan is a simple fan control program. It reads temperatures,
5179 checks them against configured limits and switches to appropriate (also
5180 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5181 other @code{hwmon} driver that enables temperature reading and fan control
5183 (license license:gpl3+)))
5185 (define-public tpacpi-bat
5193 (url "https://github.com/teleshoes/tpacpi-bat")
5194 (commit (string-append "v" version))))
5195 (file-name (git-file-name name version))
5197 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5198 (build-system gnu-build-system)
5200 `(#:tests? #f ; no test target
5202 (modify-phases %standard-phases
5203 (add-after 'unpack 'refer-to-inputs
5205 (substitute* "tpacpi-bat"
5207 (format #f "~a " (which "cat")))
5208 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5209 ;; loaded. That's the administrator's prerogative; disable it.
5210 (("system \"(modprobe .*)\"" _ match)
5211 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5213 (delete 'configure) ; nothing to configure
5214 (delete 'build) ; nothing to build
5216 (lambda* (#:key outputs #:allow-other-keys)
5217 (let* ((out (assoc-ref outputs "out"))
5218 (bin (string-append out "/bin"))
5219 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5220 (install-file "tpacpi-bat" bin)
5222 ;; There's no man page. Install other forms of documentation.
5223 (for-each (lambda (file)
5224 (let ((target (string-append doc "/" file)))
5225 (mkdir-p (dirname target))
5226 (copy-recursively file target)))
5227 (list "battery_asl" "examples" "README.md"))
5231 (home-page "https://github.com/teleshoes/tpacpi-bat")
5232 (synopsis "ThinkPad battery charge controller")
5234 "Tpacpi-bat is a command-line interface to control battery charging on
5235 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5236 ThinkPad models released after 2011}, starting with the xx20 series. It can
5237 query and set the thresholds at which one or both batteries will start and stop
5238 charging, inhibit charging batteries for a set period of time, or force them to
5239 discharge when they otherwise would not.
5241 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5242 kernel module provided by the @code{acpi-call-linux-module} package, which must
5243 be installed and loaded separately. Only the original vendor firmware is
5245 (license license:gpl3+)))
5247 (define-public ntfs-3g
5250 (version "2017.3.23")
5253 (uri (string-append "https://tuxera.com/opensource/"
5254 "ntfs-3g_ntfsprogs-" version ".tgz"))
5255 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5258 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5259 (modules '((guix build utils)))
5261 ;; Install under $prefix.
5262 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5266 (build-system gnu-build-system)
5267 (inputs `(("util-linux" ,util-linux)
5268 ("fuse" ,fuse))) ;libuuid
5269 (native-inputs `(("pkg-config" ,pkg-config)))
5271 '(#:configure-flags (list "--exec-prefix=${prefix}"
5272 "--with-fuse=external" ;use our own FUSE
5273 "--enable-mount-helper"
5274 "--enable-posix-acls"
5275 "--enable-xattr-mappings")
5277 (modify-phases %standard-phases
5278 ;; If users install ntfs-3g, they probably want to make it the
5279 ;; default driver as well, so we opt for sensible defaults and link
5280 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5281 ;; mount NTFS file systems.)
5282 (add-after 'install 'install-link
5283 (lambda* (#:key outputs #:allow-other-keys)
5284 (let* ((out (assoc-ref outputs "out"))
5285 (sbin (string-append out "/sbin")))
5286 (symlink "mount.ntfs-3g"
5287 (string-append sbin "/mount.ntfs")))
5289 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5290 (synopsis "Read-write access to NTFS file systems")
5292 "NTFS-3G provides read-write access to NTFS file systems, which are
5293 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5294 The package provides additional NTFS tools.")
5295 (license license:gpl2+)))
5297 (define-public rdma-core
5303 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5304 "/releases/download/v" version "/rdma-core-"
5308 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
5309 (build-system cmake-build-system)
5311 `(#:tests? #f ; no tests
5312 ;; Upstream uses the "ninja" build system and encourage distros
5313 ;; to do the same for consistency. They also recommend using the
5314 ;; "Release" build type.
5315 #:build-type "Release"
5316 #:configure-flags (list "-GNinja"
5318 (string-append "-DRST2MAN_EXECUTABLE="
5319 (assoc-ref %build-inputs
5323 ;; On some configurations, the
5324 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
5325 ;; used by default, would return ENODEV. To
5326 ;; avoid that, use 'write' instead of ioctls,
5327 ;; as suggested in 'CMakeList.txt'.
5328 "-DIOCTL_MODE=write")
5330 (modify-phases %standard-phases
5334 "-j" (number->string (parallel-job-count)))))
5337 (invoke "ninja" "install"))))))
5340 ("pkg-config" ,pkg-config)
5341 ("python" ,python-wrapper)
5342 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5346 (home-page "https://github.com/linux-rdma/rdma-core")
5347 (synopsis "Utilities and libraries for working with RDMA devices")
5349 "This package provides userspace components for the InfiniBand
5350 subsystem of the Linux kernel. Specifically it contains userspace
5351 libraries for the following device nodes:
5354 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5355 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5356 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5359 The following service daemons are also provided:
5361 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5362 @item @code{iwpmd} (for iWARP kernel providers)
5363 @item @code{ibacm} (for InfiniBand communication management assistant)
5365 ;; All library code is dual licensed under GPL2 and a custom MIT
5366 ;; variant. The package also includes some components covered by
5367 ;; other licenses. Consult COPYING.md for full details.
5370 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5371 license:bsd-2 ; Files referring to COPYING.BSD_FB
5372 license:cc0 ; most files in ccan/
5373 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5375 (define-public perftest
5382 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5383 version "/perftest-" version ".g0927198.tar.gz"))
5385 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5386 (build-system gnu-build-system)
5389 (modify-phases %standard-phases
5390 (add-after 'unpack 'patch-header-paths
5392 (substitute* '("src/raw_ethernet_fs_rate.c"
5393 "src/raw_ethernet_resources.c"
5394 "src/raw_ethernet_resources.h"
5395 "src/raw_ethernet_send_burst_lat.c"
5396 "src/raw_ethernet_send_bw.c"
5397 "src/raw_ethernet_send_lat.c")
5398 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5400 (inputs `(("rdma-core" ,rdma-core)))
5401 (home-page "https://github.com/linux-rdma/perftest/")
5402 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5403 (description "This is a collection of tests written over uverbs intended for
5404 use as a performance micro-benchmark. The tests may be used for hardware or
5405 software tuning as well as for functional testing.
5407 The collection contains a set of bandwidth and latency benchmark such as:
5409 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5410 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5411 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5412 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5413 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5415 (license license:gpl2)))
5417 (define-public rng-tools
5420 (home-page "https://github.com/nhorman/rng-tools")
5424 (uri (git-reference (url home-page)
5425 (commit (string-append "v" version))))
5426 (file-name (git-file-name name version))
5429 "0hbml37yxs0fs69g7f2x4ixq61z0029swy99rn7ykma9mi6b7ni9"))))
5430 (build-system gnu-build-system)
5432 `(;; Disable support for various hardware entropy sources as they need
5433 ;; dependencies that are not yet in Guix, and would significantly
5434 ;; increase closure size.
5435 #:configure-flags '("--without-nistbeacon"
5437 "--without-rtlsdr")))
5439 `(("autoconf" ,autoconf)
5440 ("automake" ,automake)
5441 ("pkg-config" ,pkg-config)))
5443 `(("libsysfs" ,sysfsutils)
5444 ("openssl" ,openssl)))
5445 (synopsis "Random number generator daemon")
5447 "Monitor a hardware random number generator, and supply entropy
5448 from that to the system kernel's @file{/dev/random} machinery.")
5449 ;; The source package is offered under the GPL2+, but the files
5450 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5451 (license (list license:gpl2 license:gpl2+))))
5453 (define-public cpupower
5456 (version (package-version linux-libre))
5457 (source (package-source linux-libre))
5458 (build-system gnu-build-system)
5460 '(#:phases (modify-phases %standard-phases
5461 (add-after 'unpack 'enter-subdirectory
5463 (chdir "tools/power/cpupower")
5466 (add-before 'build 'fix-makefiles
5468 (substitute* "Makefile"
5470 (("/bin/(install|pwd)" _ command) command))
5471 (substitute* "bench/Makefile"
5472 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5474 #:make-flags (let ((out (assoc-ref %outputs "out")))
5475 (list (string-append "DESTDIR=" out)
5476 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5478 "docdir=/share/doc/cpupower"
5479 "confdir=$(docdir)/examples"
5480 ;; The Makefile recommends the following changes
5482 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5483 #:tests? #f)) ;no tests
5484 (native-inputs `(("gettext" ,gettext-minimal)))
5485 (inputs `(("pciutils" ,pciutils)))
5486 (home-page (package-home-page linux-libre))
5487 (synopsis "CPU frequency and voltage scaling tools for Linux")
5489 "cpupower is a set of user-space tools that use the cpufreq feature of the
5490 Linux kernel to retrieve and control processor features related to power saving,
5491 such as frequency and voltage scaling.")
5492 (license license:gpl2)))
5494 (define-public x86-energy-perf-policy
5496 (name "x86-energy-perf-policy")
5497 (version (package-version linux-libre))
5498 (source (package-source linux-libre))
5499 (build-system gnu-build-system)
5503 (modify-phases %standard-phases
5504 (add-after 'unpack 'enter-subdirectory
5506 (chdir "tools/power/x86/x86_energy_perf_policy")
5509 (add-before 'build 'fix-makefile
5511 (substitute* "Makefile" (("/usr") ""))
5514 (let ((out (assoc-ref %outputs "out")))
5515 (list (string-append "DESTDIR=" out)
5516 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5517 (supported-systems '("i686-linux" "x86_64-linux"))
5518 (home-page (package-home-page linux-libre))
5519 (synopsis "Display and update Intel-CPU energy-performance policy")
5521 "@command{x86_energy_perf_policy} displays and updates energy-performance
5522 policy settings specific to Intel Architecture Processors. Settings are
5523 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5524 cpufreq sub-system is enabled or not.")
5525 (license license:gpl2)))
5527 (define-public haveged
5535 (url "https://github.com/jirka-h/haveged")
5536 (commit (string-append "v" version))))
5537 (file-name (git-file-name name version))
5539 (base32 "0g3hcvpky76cabgcfqh65fay7nnjkms32sgmlf33q969833hijqz"))))
5540 (build-system gnu-build-system)
5541 (home-page "https://www.issihosts.com/haveged")
5542 (synopsis "Entropy source for the Linux random number generator")
5544 "haveged generates an unpredictable stream of random numbers for use by
5545 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5546 standard mechanisms for filling the entropy pool may not be sufficient for
5547 systems with high needs or limited user interaction, such as headless servers.
5549 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5550 indirect effects of hardware events on hidden processor state using the
5551 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5552 It tunes itself to its environment and provides the same built-in test suite
5553 for the output stream as used on certified hardware security devices.
5555 The quality of the randomness produced by this algorithm has not been proven.
5556 It is recommended to run it together with another entropy source like rngd, and
5557 not as a replacement for it.")
5558 (license (list (license:non-copyleft "file://nist/mconf.h")
5559 (license:non-copyleft "file://nist/packtest.c")
5560 license:public-domain ; nist/dfft.c
5561 license:gpl3+)))) ; everything else
5563 (define-public ecryptfs-utils
5565 (name "ecryptfs-utils")
5570 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5571 version "/+download/ecryptfs-utils_"
5572 version ".orig.tar.gz"))
5575 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5576 (build-system gnu-build-system)
5578 `(#:configure-flags (list "--disable-pywrap")
5580 (modify-phases %standard-phases
5581 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5582 (lambda* (#:key inputs outputs #:allow-other-keys)
5583 (let ((out (assoc-ref outputs "out"))
5584 (utils-linux (assoc-ref inputs "utils-linux"))
5585 (cryptsetup (assoc-ref inputs "cryptsetup"))
5586 (linux-pam (assoc-ref inputs "linux-pam"))
5587 (lvm2 (assoc-ref inputs "lvm2")))
5588 (substitute* '("src/utils/ecryptfs-mount-private"
5589 "src/utils/ecryptfs-umount-private"
5590 "src/utils/ecryptfs-setup-private"
5591 "src/utils/ecryptfs-setup-swap"
5592 "src/utils/mount.ecryptfs.c"
5593 "src/utils/umount.ecryptfs.c"
5594 "src/pam_ecryptfs/pam_ecryptfs.c"
5595 "src/desktop/ecryptfs-mount-private.desktop.in"
5596 "src/desktop/ecryptfs-setup-private.desktop.in")
5598 (string-append utils-linux "/bin/mount"))
5600 (string-append utils-linux "/bin/umount"))
5601 (("/sbin/mount.ecryptfs_private")
5602 (string-append out "/sbin/mount.ecryptfs_private"))
5603 (("/sbin/umount.ecryptfs_private")
5604 (string-append out "/sbin/umount.ecryptfs_private"))
5605 (("/usr/bin/ecryptfs-mount-private")
5606 (string-append out "/bin/ecryptfs-mount-private"))
5607 (("/usr/bin/ecryptfs-rewrite-file")
5608 (string-append out "/bin/ecryptfs-rewrite-file"))
5609 (("/usr/bin/ecryptfs-setup-private")
5610 (string-append out "/bin/ecryptfs-setup-private"))
5611 (("/sbin/cryptsetup")
5612 (string-append cryptsetup "/sbin/cryptsetup"))
5613 (("/sbin/unix_chkpwd")
5614 (string-append linux-pam "/sbin/unix_chkpwd"))
5616 (string-append lvm2 "/sbin/dmsetup")))))))))
5618 `(("intltool" ,intltool)
5619 ("perl" ,perl) ; for pod2man
5620 ("pkg-config" ,pkg-config)))
5622 `(("keyutils" ,keyutils)
5623 ("linux-pam" ,linux-pam)
5624 ("utils-linux" ,util-linux)
5625 ("cryptsetup" ,cryptsetup)
5628 (home-page "https://ecryptfs.org/")
5629 (synopsis "eCryptfs cryptographic file system utilities")
5631 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5632 Each file's cryptographic meta-data is stored inside the file itself, along
5633 with the encrypted contents. This allows individual encrypted files to be
5634 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5635 native Linux file system, and has been part of the Linux kernel since version
5636 2.6.19. This package contains the userland utilities to manage it.")
5637 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5638 ;; grant additional permission to link with OpenSSL.
5639 (license license:gpl2+)))
5641 (define-public libnfsidmap
5643 (name "libnfsidmap")
5648 (uri (string-append "https://fedorapeople.org/~steved/"
5649 name "/" version "/" name "-" version ".tar.bz2"))
5651 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5652 (build-system gnu-build-system)
5654 `(#:configure-flags (list
5655 (string-append "--with-pluginpath="
5656 (assoc-ref %outputs "out")
5657 "/lib/libnfsidmap"))))
5659 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5661 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5662 (synopsis "NFSv4 support library for name/ID mapping")
5663 (description "Libnfsidmap is a library holding mulitiple methods of
5664 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5665 extensible array of mapping functions, currently consisting of two choices:
5666 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5667 (license (license:non-copyleft "file://COPYING"
5668 "See COPYING in the distribution."))))
5670 (define-public module-init-tools
5672 (name "module-init-tools")
5677 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5678 "module-init-tools-" version ".tar.bz2"))
5681 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5682 (patches (search-patches "module-init-tools-moduledir.patch"))))
5683 (build-system gnu-build-system)
5685 ;; FIXME: The upstream tarball lacks man pages, and building them would
5686 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5687 ;; but they vanished. In the meantime, fake it.
5689 (modify-phases %standard-phases
5690 (add-before 'configure 'fake-docbook
5692 (substitute* "Makefile.in"
5693 (("^DOCBOOKTOMAN.*$")
5694 "DOCBOOKTOMAN = true\n"))
5696 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5697 (synopsis "Tools for loading and managing Linux kernel modules")
5699 "Tools for loading and managing Linux kernel modules, such as
5700 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5701 (license license:gpl2+)))
5703 (define-public mcelog
5709 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5710 "mcelog.git/snapshot/v" version ".tar.gz"))
5713 "1m11v1y7cvpm7hwsghj23z77ps1w5jzn8000iwiyxpb939h2km5l"))
5714 (file-name (string-append name "-" version ".tar.gz"))
5715 (modules '((guix build utils)))
5718 ;; The snapshots lack a .git directory,
5719 ;; breaking ‘git describe’.
5720 (substitute* "Makefile"
5721 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5723 (build-system gnu-build-system)
5725 `(#:phases (modify-phases %standard-phases
5726 (delete 'configure)) ; no configure script
5727 #:make-flags (let ((out (assoc-ref %outputs "out")))
5729 (string-append "prefix=" out)
5730 (string-append "DOCDIR=" out "/share/doc/"
5732 "etcprefix=$(DOCDIR)/examples"))
5733 ;; The tests will only run as root on certain supported CPU models.
5735 (supported-systems (list "i686-linux" "x86_64-linux"))
5736 (home-page "https://mcelog.org/")
5737 (synopsis "Machine check monitor for x86 Linux systems")
5739 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
5740 systems running the kernel Linux. It can also perform user-defined tasks, such
5741 as bringing bad pages off-line, when configurable error thresholds are
5743 (license license:gpl2)))
5745 (define-public mtd-utils
5752 "ftp://ftp.infradead.org/pub/mtd-utils/"
5753 "mtd-utils-" version ".tar.bz2"))
5756 "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
5758 '(#:configure-flags '("--enable-unit-tests")))
5760 `(("cmocka" ,cmocka)
5761 ("pkg-config" ,pkg-config)))
5763 `(("acl" ,acl) ; extended attributes (xattr)
5764 ("libuuid" ,util-linux "lib")
5766 ("openssl" ,openssl) ; optional crypto support
5768 ("zstd" ,zstd "lib")))
5769 (build-system gnu-build-system)
5770 (synopsis "MTD Flash Storage Utilities")
5771 (description "This package provides utilities for testing, partitioning, etc
5773 (home-page "http://www.linux-mtd.infradead.org/")
5775 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5776 license:mpl1.1 ; All ftl* files
5777 license:expat)))) ; libiniparser
5779 (define-public libseccomp
5785 (uri (string-append "https://github.com/seccomp/libseccomp/"
5786 "releases/download/v" version
5787 "/libseccomp-" version ".tar.gz"))
5790 "1wql62cg8f95cwpy057cl764nni9g4sdn5lqj68x22kjs8w71yhz"))))
5791 (build-system gnu-build-system)
5793 '(#:configure-flags '("--disable-static")
5794 #:phases (modify-phases %standard-phases
5795 (add-before 'check 'skip-load-test
5797 ;; This test does a native system call and fails when
5798 ;; run under QEMU user-mode emulation. Just skip it.
5799 (delete-file "tests/52-basic-load.tests")
5804 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5805 (description "The libseccomp library provides an easy to use, platform
5806 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5807 libseccomp API is designed to abstract away the underlying BPF based syscall
5808 filter language and present a more conventional function-call based filtering
5809 interface that should be familiar to, and easily adopted by, application
5811 (home-page "https://github.com/seccomp/libseccomp")
5812 (license license:lgpl2.1)))
5814 (define-public radeontop
5822 (url "https://github.com/clbr/radeontop")
5823 (commit (string-append "v" version))))
5824 (file-name (git-file-name name version))
5826 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5827 (build-system gnu-build-system)
5829 `(#:phases (modify-phases %standard-phases
5830 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5831 ;; dependency, and doesn't even work on release(!) tarballs.
5832 (add-after 'unpack 'report-correct-version
5834 (substitute* "getver.sh"
5836 (string-append "ver=" ,version)))
5838 (delete 'configure)) ; no configure script
5839 #:make-flags (list "CC=gcc"
5840 (string-append "PREFIX=" %output))
5841 #:tests? #f)) ; no tests
5843 `(("gettext" ,gettext-minimal)
5844 ("pkg-config" ,pkg-config)))
5846 `(("libdrm" ,libdrm)
5847 ("libpciaccess" ,libpciaccess)
5849 ("ncurses" ,ncurses)))
5850 (home-page "https://github.com/clbr/radeontop/")
5851 (synopsis "Usage monitor for AMD Radeon graphics")
5852 (description "RadeonTop monitors resource consumption on supported AMD
5853 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5854 a terminal or saved to a file for further processing. It measures both the
5855 activity of the GPU as a whole, which is also accurate during OpenCL
5856 computations, as well as separate component statistics that are only meaningful
5857 under OpenGL graphics workloads.")
5858 (license license:gpl3)))
5860 (define-public efivar
5866 (uri (string-append "https://github.com/rhboot/" name
5867 "/releases/download/" version "/" name
5868 "-" version ".tar.bz2"))
5871 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5872 (build-system gnu-build-system)
5874 `(;; Tests require a UEFI system and is not detected in the chroot.
5876 #:make-flags (list (string-append "prefix=" %output)
5877 (string-append "libdir=" %output "/lib")
5879 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5881 (modify-phases %standard-phases
5882 (delete 'configure))))
5884 `(("pkg-config" ,pkg-config)))
5887 (home-page "https://github.com/rhboot/efivar")
5888 (synopsis "Tool and library to manipulate EFI variables")
5889 (description "This package provides a library and a command line
5890 interface to the variable facility of UEFI boot firmware.")
5891 (license license:lgpl2.1+)))
5893 (define-public efibootmgr
5899 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5900 "/releases/download/" version "/efibootmgr"
5901 "-" version ".tar.bz2"))
5904 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5905 (build-system gnu-build-system)
5907 `(#:tests? #f ;no tests
5908 #:make-flags (list (string-append "prefix=" %output)
5909 (string-append "libdir=" %output "/lib")
5910 ;; EFIDIR denotes a subdirectory relative to the
5911 ;; EFI System Partition where the loader will be
5912 ;; installed (known as OS_VENDOR in the code).
5913 ;; GRUB overrides this, as such it's only used if
5914 ;; nothing else is specified on the command line.
5916 #:phases (modify-phases %standard-phases (delete 'configure))))
5918 `(("pkg-config" ,pkg-config)))
5920 `(("efivar" ,efivar)
5922 (home-page "https://github.com/rhinstaller/efibootmgr")
5923 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5925 "@code{efibootmgr} is a user-space application to modify the Intel
5926 Extensible Firmware Interface (EFI) Boot Manager. This application can
5927 create and destroy boot entries, change the boot order, change the next
5928 running boot option, and more.")
5929 (license license:gpl2+)))
5931 (define-public sysstat
5937 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5938 "sysstat-" version ".tar.xz"))
5941 "05idnvkhvzaynj9awx7q54x1v42jblzrxq0fn5zd1v4mjwrnqmbq"))))
5942 (build-system gnu-build-system)
5944 `(#:tests? #f ; no test suite.
5945 ;; Without this flag, it tries to install the man pages with group 'root'
5946 ;; and fails because /etc/passwd lacks an entry for the root user.
5948 (list "--disable-file-attr"
5949 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5951 (modify-phases %standard-phases
5952 ;; The build process tries to create '/var/lib/sa', so we skip that
5954 (add-after 'build 'skip-touching-var
5956 (substitute* "Makefile"
5957 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5960 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5961 (synopsis "Performance monitoring tools for Linux")
5962 (description "The sysstat utilities are a collection of performance
5963 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5964 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5965 @code{sadf} and @code{sa}.")
5966 (license license:gpl2+)))
5968 (define-public light
5976 (url "https://github.com/haikarainen/light")
5977 (commit (string-append "v" version))))
5979 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
5980 (file-name (git-file-name name version))))
5981 (build-system gnu-build-system)
5984 (modify-phases %standard-phases
5985 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5986 (lambda* (#:key inputs #:allow-other-keys)
5987 (substitute* "90-backlight.rules"
5988 (("/bin/chgrp") (which "chgrp"))
5989 (("/bin/chmod") (which "chmod")))
5991 (add-after 'install 'install-udev-rules
5992 (lambda* (#:key outputs #:allow-other-keys)
5993 (let ((out (assoc-ref outputs "out")))
5995 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5998 `(("autoconf" ,autoconf)
5999 ("automake" ,automake)))
6000 (home-page "https://haikarainen.github.io/light/")
6001 (synopsis "GNU/Linux application to control backlights")
6003 "Light is a program to send commands to screen backlight controllers
6004 under GNU/Linux. Features include:
6007 @item It does not rely on X.
6008 @item Light can automatically figure out the best controller to use, making
6009 full use of underlying hardware.
6010 @item It is possible to set a minimum brightness value, as some controllers
6011 set the screen to be pitch black at a vaĺue of 0 (or higher).
6014 Light is the successor of lightscript.")
6015 (license license:gpl3+)))
6017 (define-public brightnessctl
6018 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
6020 (name "brightnessctl")
6021 (version (git-version "0.4" "0" commit))
6025 (url "https://github.com/Hummer12007/brightnessctl/")
6027 (file-name (git-file-name name version))
6030 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
6031 (build-system gnu-build-system)
6033 '(#:tests? #f ; no tests
6034 #:make-flags (list "CC=gcc"
6035 (string-append "PREFIX=" %output)
6036 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
6038 (modify-phases %standard-phases
6040 (add-after 'unpack 'adjust-udev-rules
6042 (substitute* "90-brightnessctl.rules"
6043 (("/bin/") "/run/current-system/profile/bin/"))
6045 (home-page "https://github.com/Hummer12007/brightnessctl")
6046 (synopsis "Backlight and LED brightness control")
6048 "This program allows you read and control device brightness. Devices
6049 include backlight and LEDs. It can also preserve current brightness before
6050 applying the operation, such as on lid close.
6052 The appropriate permissions must be set on the backlight or LED control
6053 interface in sysfs, which can be accomplished with the included udev rules.")
6054 (license license:expat))))
6064 (url "https://github.com/linrunner/TLP")
6066 (file-name (git-file-name name version))
6068 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
6070 `(("shellcheck" ,shellcheck)))
6074 ("ethtool" ,ethtool)
6078 ("inetutils" ,inetutils)
6081 ("pciutils" ,pciutils)
6085 ("usbutils" ,usbutils)
6086 ("util-linux" ,util-linux)
6087 ("wireless-tools" ,wireless-tools)
6088 ,@(if (let ((system (or (%current-target-system)
6089 (%current-system))))
6090 (or (string-prefix? "i686-" system)
6091 (string-prefix? "x86_64-" system)))
6092 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
6094 (build-system gnu-build-system)
6096 ;; XXX: The full test suite is run with "checkall" but it requires
6097 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
6098 `(#:test-target "shellcheck"
6099 #:modules ((guix build gnu-build-system)
6103 (modify-phases %standard-phases
6104 (delete 'configure) ; no configure script
6105 (add-before 'build 'setenv
6106 (lambda* (#:key outputs #:allow-other-keys)
6107 (let ((out (assoc-ref outputs "out")))
6108 (setenv "TLP_WITH_SYSTEMD" "0")
6109 (setenv "TLP_NO_INIT" "1")
6110 (setenv "TLP_NO_PMUTILS" "1")
6111 (setenv "TLP_SBIN" (string-append out "/bin"))
6112 (setenv "TLP_BIN" (string-append out "/bin"))
6113 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
6114 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
6115 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
6116 (setenv "TLP_CONFDEF"
6117 (string-append out "/share/tlp/defaults.conf"))
6118 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
6120 (string-append out "/lib/elogind/system-sleep"))
6122 (string-append out "/share/bash-completion/completions"))
6123 (setenv "TLP_MAN" (string-append out "/share/man"))
6124 (setenv "TLP_META" (string-append out "/share/metainfo"))
6126 (add-before 'install 'fix-installation
6128 ;; Stop the Makefile from trying to create system directories.
6129 (substitute* "Makefile"
6130 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6131 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6134 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6135 (add-after 'install 'wrap
6136 (lambda* (#:key inputs outputs #:allow-other-keys)
6137 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6138 (bin-files (find-files bin ".*")))
6139 (define (bin-directory input-name)
6140 (let ((p (assoc-ref inputs input-name)))
6141 (and p (string-append p "/bin"))))
6142 (define (sbin-directory input-name)
6143 (string-append (assoc-ref inputs input-name) "/sbin"))
6144 (for-each (lambda (program)
6145 (wrap-program program
6148 (filter-map bin-directory
6160 "x86-energy-perf-policy"))
6161 (filter-map sbin-directory
6167 "wireless-tools"))))))
6170 (home-page "https://linrunner.de/en/tlp/tlp.html")
6171 (synopsis "Power management tool for Linux")
6172 (description "TLP is a power management tool for Linux. It comes with
6173 a default configuration already optimized for battery life. Nevertheless,
6174 TLP is customizable to fulfil system requirements. TLP settings are applied
6175 every time the power supply source is changed.")
6176 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6178 (license (list license:gpl2+ license:gpl3+))))
6183 (version "B.02.19.2")
6186 (uri (string-append "https://www.ezix.org/software/"
6187 "files/lshw-" version
6191 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
6192 (build-system gnu-build-system)
6194 `(#:phases (modify-phases %standard-phases (delete 'configure))
6195 #:tests? #f ; no tests
6197 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6198 (synopsis "List hardware information")
6200 "@command{lshw} (Hardware Lister) is a small tool to provide
6201 detailed information on the hardware configuration of the machine.
6202 It can report exact memory configuration, firmware version, mainboard
6203 configuration, CPU version and speed, cache configuration, bus speed,
6204 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6205 machines (PowerMac G4 is known to work).")
6206 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6207 (license license:gpl2+)))
6209 (define-public libmnl
6216 (uri (string-append "mirror://netfilter.org/libmnl/"
6217 "libmnl-" version ".tar.bz2"))
6220 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6221 (build-system gnu-build-system)
6222 (home-page "https://www.netfilter.org/projects/libmnl/")
6223 (synopsis "Netlink utility library")
6224 (description "Libmnl is a minimalistic user-space library oriented to
6225 Netlink developers. There are a lot of common tasks in parsing, validating,
6226 constructing of both the Netlink header and TLVs that are repetitive and easy to
6227 get wrong. This library aims to provide simple helpers that allows you to
6228 re-use code and to avoid re-inventing the wheel.")
6229 (license license:lgpl2.1+)))
6231 (define-public libnftnl
6238 (uri (string-append "mirror://netfilter.org/libnftnl/"
6239 "libnftnl-" version ".tar.bz2"))
6241 (base32 "13zd90bfrr0q3j0l0cbc8kiizccw6n8gp727kqnfljh024zw3nr0"))))
6242 (build-system gnu-build-system)
6244 `(("pkg-config" ,pkg-config)))
6246 `(("libmnl" ,libmnl)))
6247 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6248 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6249 (description "Libnftnl is a userspace library providing a low-level netlink
6250 programming interface to the in-kernel nf_tables subsystem. The library
6251 libnftnl has been previously known as libnftables. This library is currently
6253 (license license:gpl2+)))
6255 (define-public nftables
6262 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6264 (string-append "https://www.nftables.org/projects/nftables"
6265 "/files/nftables-" version ".tar.bz2")))
6267 (base32 "0vmn6xwqa1nq6crfxshh049b199d0aj6hfgin7k068xhibzgvmk8"))))
6268 (build-system gnu-build-system)
6269 (arguments `(#:configure-flags
6270 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6271 (inputs `(("gmp" ,gmp)
6273 ("libnftnl" ,libnftnl)
6274 ("readline" ,readline)))
6275 (native-inputs `(("pkg-config" ,pkg-config)
6278 (home-page "https://www.nftables.org")
6279 (synopsis "Userspace utility for Linux packet filtering")
6280 (description "nftables is the project that aims to replace the existing
6281 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6282 filtering framework, a new userspace utility and also a compatibility layer for
6283 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6284 infrastructure such as the existing hooks, the connection tracking system, the
6285 userspace queueing component and the logging subsystem.")
6286 (license license:gpl2)))
6288 (define-public proot
6296 (url "https://github.com/proot-me/PRoot")
6297 (commit (string-append "v" version))))
6298 (file-name (git-file-name name version))
6300 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6301 (patches (search-patches "proot-test-fhs.patch"))))
6302 (build-system gnu-build-system)
6304 '(#:make-flags '("-C" "src")
6306 #:phases (modify-phases %standard-phases
6308 (add-before 'build 'set-shell-file-name
6309 (lambda* (#:key inputs #:allow-other-keys)
6310 (substitute* (find-files "src" "\\.[ch]$")
6313 (assoc-ref inputs "bash")
6316 (add-before 'check 'fix-fhs-assumptions-in-tests
6318 (substitute* "tests/test-c6b77b77.mk"
6319 (("/bin/bash") (which "bash"))
6320 (("/usr/bin/test") (which "test")))
6321 (substitute* '("tests/test-16573e73.c")
6322 (("/bin/([a-z-]+)" _ program)
6325 (substitute* (find-files "tests" "\\.sh$")
6326 ;; Some of the tests try to "bind-mount" /bin/true.
6328 (string-append "-b " (which "true") ":"))
6329 ;; Likewise for /bin.
6330 (("-b /bin:") "-b /gnu:")
6331 ;; Others try to run /bin/sh.
6332 (("/bin/sh") (which "sh"))
6333 ;; Others assume /etc/fstab exists.
6334 (("/etc/fstab") "/etc/passwd"))
6336 (substitute* "tests/GNUmakefile"
6337 (("-b /bin:") "-b /gnu:"))
6339 ;; XXX: This test fails in an obscure corner case, just
6341 (delete-file "tests/test-kkkkkkkk.c")
6346 (let ((n (parallel-job-count)))
6347 ;; For some reason we get lots of segfaults with
6348 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6349 (setenv "PROOT_NO_SECCOMP" "1")
6351 ;; Most of the tests expect "/bin" to be in $PATH so
6352 ;; they can run things that live in $ROOTFS/bin.
6354 (string-append (getenv "PATH") ":/bin"))
6356 (invoke "make" "check" "-C" "tests"
6358 "-j" (number->string n)))))
6360 (lambda* (#:key outputs #:allow-other-keys)
6361 ;; The 'install' rule does nearly nothing.
6362 (let* ((out (assoc-ref outputs "out"))
6363 (man1 (string-append out "/share/man/man1")))
6364 ;; TODO: 'make install-care' (does not even
6365 ;; build currently.)
6366 (invoke "make" "-C" "src" "install"
6367 (string-append "PREFIX=" out))
6370 (copy-file "doc/proot/man.1"
6371 (string-append man1 "/proot.1"))
6373 (native-inputs `(("which" ,which)
6375 ;; For 'mcookie', used by some of the tests.
6376 ("util-linux" ,util-linux)
6378 ;; XXX: Choose the old coreutils because its 'stat'
6379 ;; program does not use statx(2) when running 'stat -c
6380 ;; %a' or similar, which PRoot doesn't properly support.
6381 ("coreutils-old" ,coreutils-8.30)
6383 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6384 ;; make 4.3 to segfault.
6385 ("make-old" ,gnu-make-4.2)))
6386 (inputs `(("talloc" ,talloc)))
6387 (home-page "https://github.com/proot-me/PRoot")
6388 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6390 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6391 and @code{binfmt_misc}. This means that users don't need any privileges or
6392 setup to do things like using an arbitrary directory as the new root
6393 file system, making files accessible somewhere else in the file system
6394 hierarchy, or executing programs built for another CPU architecture
6395 transparently through QEMU user-mode. Also, developers can use PRoot as a
6396 generic process instrumentation engine thanks to its extension mechanism.
6397 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6398 available in the kernel Linux.")
6399 (license license:gpl2+)))
6401 (define-public proot-static
6404 (name "proot-static")
6406 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6407 (inputs `(("talloc" ,talloc/static)))
6409 (substitute-keyword-arguments (package-arguments proot)
6410 ((#:make-flags flags)
6411 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6413 `(modify-phases ,phases
6414 (add-after 'strip 'remove-store-references
6415 (lambda* (#:key outputs #:allow-other-keys)
6416 (let* ((out (assoc-ref outputs "out")))
6417 (with-directory-excursion out
6418 (remove-store-references "bin/proot")
6420 ((#:allowed-references _ '("out"))
6423 (define-public cpuid
6426 (version "20200427")
6429 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6430 version ".src.tar.gz"))
6433 "1m31238z2ya8f8pzpyklwp0ksf5xicqrw1z941hhhx913wzldaf1"))))
6434 (build-system gnu-build-system)
6436 '(#:make-flags '("CC=gcc")
6437 #:tests? #f ; no tests
6438 #:phases (modify-phases %standard-phases
6439 (delete 'configure) ; no configure script
6440 (add-before 'install 'fix-makefile
6441 (lambda* (#:key outputs #:allow-other-keys)
6442 (substitute* "Makefile"
6443 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6444 ;; Make the compressed manpages writable so that the
6445 ;; reset-gzip-timestamps phase does not error out.
6446 (substitute* "Makefile"
6447 (("-m 444") "-m 644"))
6449 (inputs `(("perl" ,perl)))
6450 (supported-systems '("i686-linux" "x86_64-linux"))
6451 (home-page "http://www.etallen.com/cpuid.html")
6452 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6453 (description "cpuid dumps detailed information about the CPU(s) gathered
6454 from the CPUID instruction, and also determines the exact model of CPU(s). It
6455 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6456 NexGen, Rise, and SiS CPUs.")
6457 (license license:gpl2+)))
6459 (define-public jmtpfs
6467 (url "https://github.com/JasonFerrara/jmtpfs")
6468 (commit (string-append "v" version))))
6469 (file-name (git-file-name name version))
6472 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6473 (build-system gnu-build-system)
6477 ("libmtp" ,libmtp)))
6479 `(("pkg-config" ,pkg-config)))
6480 (home-page "https://github.com/JasonFerrara/jmtpfs")
6481 (synopsis "Use a FUSE file system to access data over MTP")
6482 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6483 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6484 the MTP device as a file system.")
6485 (license license:gpl3)))
6487 (define-public procenv
6495 (url "https://github.com/jamesodhunt/procenv")
6497 (file-name (git-file-name name version))
6499 (base32 "1ilrsw1rc85w29mkbkmm5n5w427gapv43yrjzvkb4kc9xhscgdjn"))))
6500 (build-system gnu-build-system)
6501 (arguments `(#:configure-flags '("--disable-silent-rules")))
6503 `(("pkg-config" ,pkg-config)
6511 ("libselinux" ,libselinux)))
6512 (synopsis "Utility to show process environment")
6513 (description "Procenv is a command-line tool that displays as much detail about
6514 itself and its environment as possible. It can be used as a test
6515 tool, to understand the type of environment a process runs in, and for
6516 comparing system environments.")
6517 (home-page "https://github.com/jamesodhunt/procenv/")
6518 (license license:gpl3+)))
6520 (define-public libfabric
6528 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6529 version "/libfabric-" version ".tar.bz2"))
6531 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
6532 (build-system gnu-build-system)
6533 (inputs `(("rdma-core" ,rdma-core)
6534 ,@(match (%current-system)
6535 ((member (package-supported-systems psm))
6539 (home-page "https://ofiwg.github.io/libfabric/")
6540 (synopsis "Open Fabric Interfaces")
6542 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6543 communication services to applications. OFI is best described as a collection
6544 of libraries and applications used to export fabric services. The key
6545 components of OFI are: application interfaces, provider libraries, kernel
6546 services, daemons, and test applications.
6548 Libfabric is a core component of OFI. It is the library that defines and
6549 exports the user-space API of OFI, and is typically the only software that
6550 applications deal with directly. It works in conjunction with provider
6551 libraries, which are often integrated directly into libfabric.")
6552 (license (list license:bsd-2 license:gpl2)))) ;dual
6557 (version "3.3.20170428")
6558 (home-page "https://github.com/intel/psm")
6562 (uri (git-reference (url home-page)
6563 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6564 (file-name (string-append "psm-" version ".tar.gz"))
6566 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6567 (patches (search-patches
6568 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6569 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6570 "psm-repro.patch" ; reproducibility
6571 "psm-disable-memory-stats.patch"))))
6572 (build-system gnu-build-system)
6573 (outputs '("out" "debug"))
6574 (inputs `(("libuuid" ,util-linux "lib")))
6576 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6577 ,(string-append "INSTALL_PREFIX=" %output)
6578 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6580 #:phases (modify-phases %standard-phases
6582 (add-after 'unpack 'patch-/usr/include
6584 (substitute* "Makefile"
6585 (("\\$\\{DESTDIR}/usr/include")
6586 (string-append %output "/include")))
6587 (substitute* "Makefile"
6588 (("/lib64") "/lib"))
6590 (add-after 'unpack 'patch-sysmacros
6592 (substitute* "ipath/ipath_proto.c"
6593 (("#include <sys/poll.h>" m)
6594 (string-append m "\n"
6595 "#include <sys/sysmacros.h>")))
6597 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6599 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6600 communications interface for the True Scale family of products. PSM users are
6601 enabled with mechanisms necessary to implement higher level communications
6602 interfaces in parallel environments.")
6603 ;; Only Intel-compatable processors are supported.
6604 (supported-systems '("i686-linux" "x86_64-linux"))
6605 (license (list license:bsd-2 license:gpl2)))) ;dual
6607 (define-public snapscreenshot
6609 (name "snapscreenshot")
6610 (version "1.0.14.3")
6614 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6615 name "-" version ".tar.bz2"))
6617 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6618 (build-system gnu-build-system)
6621 (let ((out (assoc-ref %outputs "out")))
6622 (list (string-append "BINDIR=" out "/bin")
6623 (string-append "MANDIR=" out "/share/man")))
6624 #:tests? #f ; no test suite
6626 (modify-phases %standard-phases
6627 (delete 'configure) ; ./configure is a snarky no-op
6628 (add-before 'install 'fix-ownership
6629 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6631 (substitute* "depfun.mak"
6632 ((" -o bin -g bin ") " "))
6634 (add-before 'install 'create-output-directories
6635 (lambda* (#:key outputs #:allow-other-keys)
6636 (let ((out (assoc-ref outputs "out")))
6637 (mkdir-p (string-append out "/share/man/man1"))
6639 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6640 (synopsis "Take screenshots of one or more Linux text consoles")
6642 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6643 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6644 relevant @file{/dev/vcs*} file(s).")
6645 (license license:gpl2)))
6647 (define-public fbcat
6654 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6655 version "/" name "-" version ".tar.gz"))
6657 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6658 (build-system gnu-build-system)
6660 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6661 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6662 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6663 `(("pnmtopng" ,netpbm)))
6664 (outputs (list "out" "fbgrab"))
6668 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6669 #:tests? #f ; no tests
6671 (modify-phases %standard-phases
6672 (delete 'configure) ; no configure script
6673 (add-after 'build 'qualify-references
6674 (lambda* (#:key inputs outputs #:allow-other-keys)
6675 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6676 (out (assoc-ref outputs "out")))
6677 (substitute* "fbgrab"
6679 (string-append out "/bin/" all))
6681 (string-append pnmtopng "/bin/" all)))
6683 (add-after 'install 'split-fbgrab-output
6684 (lambda* (#:key outputs #:allow-other-keys)
6685 (let* ((out (assoc-ref outputs "out"))
6686 (out:fbgrab (assoc-ref outputs "fbgrab")))
6687 (for-each (lambda (file)
6688 (let ((old (string-append out "/" file))
6689 (new (string-append out:fbgrab "/" file)))
6690 (mkdir-p (dirname new))
6691 (rename-file old new)))
6693 "share/man/man1/fbgrab.1"))
6695 (home-page "https://jwilk.net/software/fbcat")
6696 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6698 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6699 a dump therof. It supports a wide range of drivers and pixel formats.
6700 @command{fbcat} can take screenshots of virtually any application that can be
6701 made to write its output to the framebuffer, including (but not limited to)
6702 text-mode or graphical applications that don't use a display server.
6704 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6705 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6706 (license license:gpl2)))
6708 (define-public libcgroup
6716 "mirror://sourceforge/libcg/" name "/"
6717 version "/" name "-" version ".tar.bz2"))
6719 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6720 (build-system gnu-build-system)
6727 `(("linux-pam" ,linux-pam)))
6728 (home-page "https://sourceforge.net/projects/libcg/")
6729 (synopsis "Control groups management tools")
6730 (description "Control groups is Linux kernel method for process resource
6731 restriction, permission handling and more. This package provides userspace
6732 interface to this kernel feature.")
6733 (license license:lgpl2.1)))
6735 (define-public mbpfan
6743 (url "https://github.com/dgraziotin/mbpfan")
6744 (commit (string-append "v" version))))
6745 (file-name (git-file-name name version))
6747 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6748 (build-system gnu-build-system)
6750 `(#:tests? #f ; tests ask to be run as root
6751 #:make-flags (let ((out (assoc-ref %outputs "out")))
6752 (list (string-append "DESTDIR=" out)
6753 ,(string-append "CC=" (cc-for-target))))
6755 (modify-phases %standard-phases
6756 (add-after 'unpack 'patch-paths
6758 (substitute* "Makefile"
6761 (delete 'configure)))) ; there's no configure phase
6762 (home-page "https://github.com/dgraziotin/mbpfan")
6763 (synopsis "Control fan speed on Macbooks")
6765 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6766 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6767 module. It can be executed as a daemon or in the foreground with root
6769 (license license:gpl3+)))
6778 (url "https://github.com/intel/opa-psm2")
6779 (commit (string-append "PSM2_" version))))
6780 (file-name (git-file-name name version))
6783 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6784 (build-system gnu-build-system)
6787 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6789 #:phases (modify-phases %standard-phases
6791 (add-after 'unpack 'patch-Makefiles
6793 (substitute* "Makefile"
6796 (substitute* "compat/Makefile"
6802 (setenv "DESTDIR" %output)
6803 (invoke "make" "install")
6806 `(("rdma-core" ,rdma-core)
6807 ("numactl" ,numactl)))
6808 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6810 "This package is low-level user-level Intel's communications interface.
6811 The PSM2 API is a high-performance vendor-specific protocol that provides a
6812 low-level communications interface for the Intel Omni-Path family of
6813 high-speed networking devices.")
6814 (home-page "https://github.com/intel/opa-psm2")
6815 ;; Only the x86_64 architecure is supported.
6816 (supported-systems '("x86_64-linux"))
6817 (license (list license:bsd-3 license:gpl2)))) ; dual
6819 (define-public libpfm4
6825 (uri (string-append "mirror://sourceforge/perfmon2/"
6826 name "/libpfm-" version ".tar.gz"))
6829 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6830 (build-system gnu-build-system)
6832 '(#:modules ((guix build utils)
6833 (guix build gnu-build-system))
6834 #:phases (modify-phases %standard-phases
6838 (lambda* (#:key inputs outputs #:allow-other-keys)
6839 (let* ((out (assoc-ref outputs "out")))
6844 (lambda* (#:key outputs #:allow-other-keys)
6845 (let* ((out (assoc-ref outputs "out")))
6847 (string-append "PREFIX=" out)
6850 (synopsis "Performance event monitoring library")
6852 "This package provides a library called libpfm4, which is used to develop
6853 monitoring tools exploiting the performance monitoring events such as those
6854 provided by the Performance Monitoring Unit (PMU) of modern processors.
6856 Libpfm4 helps convert from an event name, expressed as a string, to the event
6857 encoding that is either the raw event as documented by the hardware vendor or
6858 the OS-specific encoding. In the latter case, the library is able to prepare
6859 the OS-specific data structures needed by the kernel to setup the event.
6861 libpfm4 provides support for the @code{perf_events} interface, which was
6862 introduced in Linux 2.6.31.")
6863 (home-page "http://perfmon2.sourceforge.net/")
6864 (license license:expat)))
6866 (define-public libnfnetlink
6868 (name "libnfnetlink")
6873 "https://www.netfilter.org/projects/libnfnetlink/files/"
6874 "libnfnetlink-" version ".tar.bz2"))
6877 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6878 (build-system gnu-build-system)
6879 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6880 (synopsis "Low-level netfilter netlink communication library")
6882 "@code{libnfnetlink} is the low-level library for netfilter related
6883 kernel/userspace communication. It provides a generic messaging
6884 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6885 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6886 management tools in userspace.")
6887 (license license:gpl2)))
6889 (define-public go-netlink
6896 (url "https://github.com/vishvananda/netlink")
6897 (commit (string-append "v" version))))
6898 (file-name (git-file-name name version))
6901 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6902 (build-system go-build-system)
6904 `(#:import-path "github.com/vishvananda/netlink"))
6906 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6907 ("go-netns" ,go-netns)))
6908 (home-page "https://github.com/vishvananda/netlink")
6909 (synopsis "Simple netlink library for Go")
6910 (description "The netlink package provides a simple netlink library for
6911 Go. Netlink is the interface a user-space program in Linux uses to
6912 communicate with the kernel. It can be used to add and remove interfaces, set
6913 IP addresses and routes, and configure IPsec.")
6914 (license license:asl2.0)))
6916 (define-public xfsprogs
6923 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6924 "xfsprogs-" version ".tar.gz"))
6927 "0bssrfhnw5mhybgaa6d8wp87izi3c9cjpjy7vicm6y76mf7kl8p9"))))
6928 (build-system gnu-build-system)
6929 (outputs (list "out" "python"))
6931 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6933 (modify-phases %standard-phases
6934 (add-after 'install 'separate-python-output
6935 (lambda* (#:key outputs #:allow-other-keys)
6936 (let ((out (assoc-ref outputs "out"))
6937 (python (assoc-ref outputs "python")))
6940 (mkdir-p (string-append python (dirname script)))
6941 (rename-file (string-append out script)
6942 (string-append python script)))
6943 (list "/sbin/xfs_scrub_all"))
6945 (add-after 'install 'install-headers
6947 (invoke "make" "install-dev"))))))
6949 `(("gettext" ,gettext-minimal)))
6951 `(("libuuid" ,util-linux "lib")
6952 ("python" ,python-wrapper)))
6953 (home-page "https://xfs.wiki.kernel.org/")
6954 (synopsis "XFS file system tools")
6955 (description "This package provides commands to create and check XFS
6957 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6958 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6959 (license (list license:gpl2 license:lgpl2.1))))
6961 (define-public genext2fs
6968 (url "https://github.com/jeremie-koenig/genext2fs")
6969 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6970 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6971 (file-name (git-file-name name version))
6973 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6974 (build-system gnu-build-system)
6977 (modify-phases %standard-phases
6978 (add-after 'unpack 'apply-debian-patches
6979 ;; Debian changes (the revision after ‘-’ in VERSION) are
6980 ;; maintained as separate patches. Apply those relevant to us.
6984 (invoke "patch" "-p1" "-i"
6985 (string-append "debian/patches/" file-name)))
6986 (list "blocksize+creator.diff" ; add -B/-o options
6987 "byteswap_fix.diff"))
6990 `(("autoconf" ,autoconf)
6991 ("automake" ,automake)))
6992 (home-page "https://github.com/jeremie-koenig/genext2fs")
6993 (synopsis "Generate ext2 file system as a normal user")
6994 (description "This package provides a program to generate an ext2
6995 file system as a normal (non-root) user. It does not require you to mount
6996 the image file to copy files on it, nor does it require that you become
6997 the superuser to make device nodes.")
6998 (license license:gpl2)))
7000 (define-public fakeroot
7006 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
7007 "fakeroot/fakeroot_" version ".orig.tar.gz"))
7008 (file-name (string-append name "-" version ".tar.gz"))
7011 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
7012 (build-system gnu-build-system)
7015 (modify-phases %standard-phases
7016 (add-after 'configure 'patch-Makefile
7018 ;; Note: The root of the problem is already in "Makefile.am".
7019 (substitute* "Makefile"
7020 (("/bin/sh") (which "sh")))
7022 (add-after 'unpack 'patch-script
7023 (lambda* (#:key inputs #:allow-other-keys)
7024 (substitute* "scripts/fakeroot.in"
7026 (string-append (assoc-ref inputs "util-linux")
7029 (string-append (assoc-ref inputs "sed")
7032 (string-append (assoc-ref inputs "coreutils")
7035 (add-before 'configure 'setenv
7037 (setenv "LIBS" "-lacl")
7039 (add-before 'check 'prepare-check
7041 (setenv "SHELL" (which "bash"))
7042 (setenv "VERBOSE" "1")
7043 (substitute* "test/t.touchinstall"
7044 ;; We don't have the name of the root user, so use ID=0.
7045 (("grep root") "grep \"\\<0\\>\""))
7046 (substitute* "test/tartest"
7047 ;; We don't have the name of the root group, so use ID=0.
7048 (("ROOTGROUP=root") "ROOTGROUP=0")
7049 ;; We don't have the name of the daemon user, so use IDs.
7050 (("daemon:sys") "1:3")
7052 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
7053 (substitute* "test/compare-tar"
7054 (("tar -tvf") "tar --numeric-owner -tvf"))
7056 ;; coreutils 8.32 changed 'ls' to use the statx() syscall instead
7057 ;; of lstat(). fakeroot 1.24 does not support the former, so
7058 ;; adjust these tests to use 'test -b' instead of 'ls' to test for
7059 ;; block device. See <https://bugs.gnu.org/41090>.
7060 (substitute* '("test/t.mknod" "test/t.chmod_dev")
7061 (("ls -ld? \\$tmp/hda3")
7062 "test -b $tmp/hda3 && echo block || echo fail"))
7066 ("sharutils" ,sharutils) ; for the tests
7067 ("xz" ,xz))) ; for the tests
7069 `(("libcap" ,libcap/next)
7070 ("util-linux" ,util-linux)
7072 ("coreutils" ,coreutils)))
7073 (synopsis "Provides a fake root environment")
7074 (description "@command{fakeroot} runs a command in an environment where
7075 it appears to have root privileges for file manipulation. This is useful
7076 for allowing users to create archives (tar, ar, .deb etc.) with files in
7077 them with root permissions/ownership. Without fakeroot one would have to
7078 have root privileges to create the constituent files of the archives with
7079 the correct permissions and ownership, and then pack them up, or one would
7080 have to construct the archives directly, without using the archiver.")
7081 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
7082 (license license:gpl3+)))
7084 (define-public fakechroot
7091 "https://github.com/dex4er/fakechroot/releases/download/"
7092 version "/fakechroot-" version ".tar.gz"))
7095 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
7096 (build-system gnu-build-system)
7098 ;; XXX: The tests heavily assume they run on an FHS system so for now
7101 #:configure-flags '("--disable-static")))
7102 (synopsis "Emulate @code{chroot} by overriding file system calls")
7104 "@command{fakechroot} runs a command in an environment were is additional
7105 possibility to use @code{chroot} command without root privileges. This is
7106 useful for allowing users to create own chrooted environment with possibility
7107 to install another packages without need for root privileges.
7109 It works by providing @file{libfakechroot.so}, a shared library meant to be
7110 set as @code{LD_PRELOAD} to override the C library file system functions.")
7111 (home-page "https://github.com/dex4er/fakechroot/")
7112 (license license:lgpl2.1+)))
7114 (define-public inputattach
7116 (name "inputattach")
7121 (url "https://github.com/linuxwacom/input-wacom")
7122 (commit (string-append "input-wacom-" version))))
7123 (file-name (git-file-name name version))
7125 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
7126 (build-system gnu-build-system)
7129 (modify-phases %standard-phases
7133 (lambda* (#:key inputs #:allow-other-keys)
7134 (with-directory-excursion "inputattach"
7135 (invoke (string-append (assoc-ref inputs "gcc")
7137 "-O2" "-o" "inputattach" "inputattach.c"))
7141 (lambda* (#:key outputs #:allow-other-keys)
7142 (let ((target-dir (string-append
7143 (assoc-ref outputs "out")
7145 (mkdir-p target-dir)
7146 (copy-file "inputattach/inputattach"
7147 (string-append target-dir
7150 (home-page "https://linuxwacom.github.io/")
7151 (synopsis "Dispatch input peripherals events to a device file")
7152 (description "inputattach dispatches input events from several device
7153 types and interfaces and translates so that the X server can use them.")
7154 (license license:gpl2+)))
7156 (define-public pipewire
7163 (url "https://github.com/PipeWire/pipewire")
7165 (file-name (git-file-name name version))
7168 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
7169 (build-system meson-build-system)
7171 '(#:configure-flags '("-Dsystemd=false")))
7173 `(("pkg-config" ,pkg-config)))
7175 `(("alsa-lib" ,alsa-lib)
7179 ("gstreamer" ,gstreamer)
7180 ("gst-plugins-base" ,gst-plugins-base)
7184 (home-page "https://pipewire.org/")
7185 (synopsis "Server and user space API to deal with multimedia pipelines")
7187 "PipeWire is a project that aims to greatly improve handling of audio and
7188 video under Linux. It aims to support the usecases currently handled by both
7189 PulseAudio and Jack and at the same time provide same level of powerful handling
7190 of Video input and output. It also introduces a security model that makes
7191 interacting with audio and video devices from containerized applications easy,
7192 with supporting Flatpak applications being the primary goal. Alongside Wayland
7193 and Flatpak we expect PipeWire to provide a core building block for the future
7194 of Linux application development.")
7195 (license license:lgpl2.0+)))
7197 (define-public pipewire-0.3
7205 (url "https://github.com/PipeWire/pipewire")
7207 (file-name (git-file-name name version))
7210 "1y293sfhhmzbgnlvs46bpiyimlii5nk71f8115qxs8sviwlsdr3w"))))
7213 (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
7214 "/lib/udev/rules.d")
7217 (modify-phases %standard-phases
7218 ;; Skip shrink-runpath, otherwise validate-runpath fails.
7219 (delete 'shrink-runpath))))
7221 (append (package-inputs pipewire)
7224 ("pulseaudio" ,pulseaudio)
7225 ("vulkan-loader" ,vulkan-loader)
7226 ("vulkan-headers" ,vulkan-headers))))))
7235 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7237 (file-name (git-file-name name version))
7240 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
7241 (build-system gnu-build-system)
7244 (modify-phases %standard-phases
7245 (add-after 'unpack 'fix-dbus-tests
7247 (substitute* '("unit/test-dbus-message-fds.c"
7248 "unit/test-dbus-properties.c"
7250 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7255 `(("autoconf" ,autoconf)
7256 ("libtool" ,libtool)
7257 ("pkgconfig" ,pkg-config)
7258 ("automake" ,automake)))
7259 (home-page "https://01.org/ell")
7260 (synopsis "Embedded Linux Library")
7261 (description "The Embedded Linux* Library (ELL) provides core, low-level
7262 functionality for system daemons. It typically has no dependencies other than
7263 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7264 ELL is designed to be efficient and compact enough for use on embedded Linux
7265 platforms, it is not limited to resource-constrained systems.")
7266 (license license:lgpl2.1+)))
7268 (define-public lttng-ust
7274 (uri (string-append "https://lttng.org/files/lttng-ust/"
7275 "lttng-ust-" version ".tar.bz2"))
7278 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7279 (build-system gnu-build-system)
7281 `(("liburcu" ,liburcu)
7282 ("numactl" ,numactl)))
7284 `(("python" ,python-3)))
7285 (home-page "https://lttng.org/")
7286 (synopsis "LTTng userspace tracer libraries")
7287 (description "The user space tracing library, liblttng-ust, is the LTTng
7288 user space tracer. It receives commands from a session daemon, for example to
7289 enable and disable specific instrumentation points, and writes event records
7290 to ring buffers shared with a consumer daemon.")
7291 (license license:lgpl2.1+)))
7293 (define-public kexec-tools
7295 (name "kexec-tools")
7299 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7300 "/kexec/kexec-tools-" version ".tar.xz"))
7303 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
7304 (build-system gnu-build-system)
7306 ;; There are no automated tests.
7308 (home-page "https://projects.horms.net/projects/kexec/")
7309 (synopsis "Tools for booting directly into different kernels")
7310 (description "This package provides the @code{kexec} program and ancillary
7311 utilities. Using @code{kexec}, it is possible to boot directly into a new
7312 kernel from the context of an already-running kernel, bypassing the normal
7313 system boot process.")
7314 (license license:gpl2)))
7316 (define-public cachefilesd
7318 (name "cachefilesd")
7323 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7324 "/cachefilesd.git/snapshot/cachefilesd-"
7328 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7329 (build-system gnu-build-system)
7332 `(#:tests? #f ; there are no tests
7334 (let ((prefix-dir (lambda (var dir)
7335 (string-append var "=" %output "/" dir))))
7336 (list (string-append "CC=" ,(cc-for-target))
7337 (prefix-dir "SBINDIR" "sbin/")
7338 (prefix-dir "ETCDIR" "etc/")
7339 (prefix-dir "MANDIR" "share/man/")))
7340 #:phases (modify-phases %standard-phases (delete 'configure))))
7341 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7342 (synopsis "CacheFiles userspace management daemon")
7343 (description "@code{cachefilesd} is a userspace daemon that manages the
7344 cache data store that is used by network file systems such as @code{AFS} and
7345 @code{NFS} to cache data locally on disk. The content of the cache is
7346 persistent over reboots.")
7347 (license license:gpl2+)))
7349 (define-public libbpf
7357 (url "https://github.com/libbpf/libbpf")
7358 (commit (string-append "v" version))))
7359 (file-name (git-file-name name version))
7362 "18l0gff7nm841mwhr7bc7x863xcyvwh58zl7mc0amnsjqlbrvqg7"))))
7363 (build-system gnu-build-system)
7365 `(("pkg-config" ,pkg-config)))
7367 `(("libelf" ,libelf)
7370 `(#:tests? #f ; No tests
7373 (string-append "PREFIX=''")
7374 (string-append "DESTDIR=" (assoc-ref %outputs "out"))
7375 (string-append "LIBDIR=/lib")
7377 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
7379 (modify-phases %standard-phases
7381 (add-before 'build 'pre-build
7382 (lambda* (#:key inputs #:allow-other-keys)
7383 (substitute* "scripts/check-reallocarray.sh"
7385 (string-append (assoc-ref inputs "coreutils") rm)))
7388 (home-page "https://github.com/libbpf/libbpf")
7389 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
7391 "Libbpf supports building BPF CO-RE-enabled applications, which, in
7392 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
7394 (license `(,license:lgpl2.1 ,license:bsd-2))))
7404 (url "https://github.com/iovisor/bcc")
7405 (commit (string-append "v" version))))
7406 (file-name (git-file-name name version))
7409 "1d5j9zanffa1c7lpi5fcrdlx1n7hy86xl82fam2xqr0s41q4ipxw"))))
7410 (build-system cmake-build-system)
7415 `(("clang-toolchain" ,clang-toolchain)
7416 ("libbpf" ,(package-source libbpf))
7417 ;; LibElf required but libelf does not contain
7418 ;; archives, only object files.
7419 ;; https://github.com/iovisor/bcc/issues/504
7420 ("elfutils" ,elfutils)
7421 ("linux-libre-headers" ,linux-libre-headers)
7423 ("python-wrapper" ,python-wrapper)))
7425 `(;; Tests all require root permissions and a "standard" file hierarchy.
7428 (let ((revision ,version))
7429 `(,(string-append "-DREVISION=" revision)))
7431 (modify-phases %standard-phases
7432 ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
7433 (add-after 'unpack 'copy-libbpf
7434 (lambda* (#:key inputs #:allow-other-keys)
7435 (delete-file-recursively "src/cc/libbpf")
7437 (assoc-ref inputs "libbpf") "src/cc/libbpf")))
7438 (add-after 'copy-libbpf 'substitute-libbc
7439 (lambda* (#:key outputs #:allow-other-keys)
7440 (substitute* "src/python/bcc/libbcc.py"
7441 (("(libbcc\\.so.*)\\b" _ libbcc)
7443 (assoc-ref outputs "out") "/lib/" libbcc)))))
7444 (add-after 'install 'wrap-tools
7445 (lambda* (#:key outputs #:allow-other-keys)
7446 (use-modules (ice-9 textual-ports))
7447 (let* ((out (assoc-ref outputs "out"))
7448 (lib (string-append out "/lib"))
7449 (tools (string-append out "/share/bcc/tools"))
7451 (lambda (filename _)
7452 (call-with-input-file filename
7454 (string-contains (get-line port)
7457 (lambda (python-executable)
7458 (format #t "Wrapping: ~A.~%" python-executable)
7459 (wrap-program python-executable
7460 `("PYTHONPATH" ":" prefix
7461 (,(string-append lib
7463 ,(version-major+minor
7464 (package-version python))
7465 "/site-packages")))))
7466 (find-files tools python-executable?))
7468 (home-page "https://github.com/iovisor/bcc")
7469 (synopsis "Tools for BPF on Linux")
7471 "BCC is a toolkit for creating efficient kernel tracing and manipulation
7472 programs, and includes several useful tools and examples. It makes use of
7473 extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
7474 that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
7476 (license license:asl2.0)))
7478 (define-public bpftrace
7486 (url "https://github.com/iovisor/bpftrace")
7487 (commit (string-append "v" version))))
7488 (file-name (git-file-name name version))
7491 "023ardywbw5w8815j2ny9rrp2xlpxndqaa7v2njjm8109p7ilsdn"))
7492 (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
7493 (build-system cmake-build-system)
7499 ("clang-toolchain" ,clang-toolchain)
7500 ("elfutils" ,elfutils)
7502 ("linux-libre-headers" ,linux-libre-headers)))
7504 `(#:tests? #f ;Tests require googletest sources.
7506 '("-DBUILD_TESTING=OFF"
7507 ;; FIXME: libbfd misses some link dependencies, when fixed, remove
7508 ;; the associated patch.
7509 "-DHAVE_BFD_DISASM=OFF")))
7510 (home-page "https://github.com/iovisor/bpftrace")
7511 (synopsis "High-level tracing language for Linux eBPF")
7513 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
7514 Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
7515 LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
7516 interacting with the Linux BPF system, as well as existing Linux tracing
7517 capabilities: kernel dynamic tracing (kprobes), user-level dynamic
7518 tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
7519 and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
7520 created by Alastair Robertson.")
7521 (license license:asl2.0)))
7523 (define-public ttyebus-linux-module
7524 (let ((revision "0")
7525 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
7527 (name "ttyebus-linux-module")
7528 (version (git-version "1.5" revision commit))
7533 (url "https://github.com/eBUS/ttyebus.git")
7534 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
7535 (file-name (git-file-name name version))
7538 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
7539 (supported-systems '("armhf-linux" "aarch64-linux"))
7540 (build-system linux-module-build-system)
7543 (home-page "https://github.com/eBUS/ttyebus")
7544 (synopsis "Low-latency Raspberry Pi UART driver")
7545 (description "This package provides a Linux kernel module that will
7546 provide a serial device @code{/dev/ttyebus} with almost no latency upon
7547 receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
7548 (license license:gpl3+))))