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 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 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>
52 ;;; This file is part of GNU Guix.
54 ;;; GNU Guix is free software; you can redistribute it and/or modify it
55 ;;; under the terms of the GNU General Public License as published by
56 ;;; the Free Software Foundation; either version 3 of the License, or (at
57 ;;; your option) any later version.
59 ;;; GNU Guix is distributed in the hope that it will be useful, but
60 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
61 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62 ;;; GNU General Public License for more details.
64 ;;; You should have received a copy of the GNU General Public License
65 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
67 (define-module (gnu packages linux)
68 #:use-module (gnu packages)
69 #:use-module (gnu packages acl)
70 #:use-module (gnu packages admin)
71 #:use-module (gnu packages algebra)
72 #:use-module (gnu packages audio)
73 #:use-module (gnu packages autotools)
74 #:use-module (gnu packages backup)
75 #:use-module (gnu packages base)
76 #:use-module (gnu packages bash)
77 #:use-module (gnu packages bison)
78 #:use-module (gnu packages boost)
79 #:use-module (gnu packages calendar)
80 #:use-module (gnu packages check)
81 #:use-module (gnu packages cpio)
82 #:use-module (gnu packages crypto)
83 #:use-module (gnu packages cryptsetup)
84 #:use-module (gnu packages compression)
85 #:use-module (gnu packages dbm)
86 #:use-module (gnu packages datastructures)
87 #:use-module (gnu packages docbook)
88 #:use-module (gnu packages documentation)
89 #:use-module (gnu packages elf)
90 #:use-module (gnu packages flex)
91 #:use-module (gnu packages file)
92 #:use-module (gnu packages freedesktop)
93 #:use-module (gnu packages gcc)
94 #:use-module (gnu packages gettext)
95 #:use-module (gnu packages glib)
96 #:use-module (gnu packages golang)
97 #:use-module (gnu packages gperf)
98 #:use-module (gnu packages gstreamer)
99 #:use-module (gnu packages gtk)
100 #:use-module (gnu packages haskell-apps)
101 #:use-module (gnu packages haskell-xyz)
102 #:use-module (gnu packages libunwind)
103 #:use-module (gnu packages libusb)
104 #:use-module (gnu packages man)
105 #:use-module (gnu packages maths)
106 #:use-module (gnu packages multiprecision)
107 #:use-module (gnu packages ncurses)
108 #:use-module (gnu packages netpbm)
109 #:use-module (gnu packages networking)
110 #:use-module (gnu packages ninja)
111 #:use-module (gnu packages nss)
112 #:use-module (gnu packages perl)
113 #:use-module (gnu packages pciutils)
114 #:use-module (gnu packages pkg-config)
115 #:use-module (gnu packages popt)
116 #:use-module (gnu packages pulseaudio)
117 #:use-module (gnu packages python)
118 #:use-module (gnu packages python-xyz)
119 #:use-module (gnu packages readline)
120 #:use-module (gnu packages rrdtool)
121 #:use-module (gnu packages samba)
122 #:use-module (gnu packages sdl)
123 #:use-module (gnu packages serialization)
124 #:use-module (gnu packages slang)
125 #:use-module (gnu packages texinfo)
126 #:use-module (gnu packages tls)
127 #:use-module (gnu packages valgrind)
128 #:use-module (gnu packages video)
129 #:use-module (gnu packages vulkan)
130 #:use-module (gnu packages web)
131 #:use-module (gnu packages xiph)
132 #:use-module (gnu packages xml)
133 #:use-module (gnu packages xdisorg)
134 #:use-module (gnu packages xorg)
135 #:use-module (gnu packages groff)
136 #:use-module (gnu packages rsync)
137 #:use-module (gnu packages selinux)
138 #:use-module (gnu packages swig)
139 #:use-module (guix build-system cmake)
140 #:use-module (guix build-system gnu)
141 #:use-module (guix build-system go)
142 #:use-module (guix build-system meson)
143 #:use-module (guix build-system python)
144 #:use-module (guix build-system trivial)
145 #:use-module (guix build-system linux-module)
146 #:use-module (guix download)
147 #:use-module (guix git-download)
148 #:use-module ((guix licenses) #:prefix license:)
149 #:use-module (guix packages)
150 #:use-module (guix gexp)
151 #:use-module (guix store)
152 #:use-module (guix monads)
153 #:use-module (guix utils)
154 #:use-module (srfi srfi-1)
155 #:use-module (srfi srfi-2)
156 #:use-module (srfi srfi-26)
157 #:use-module (ice-9 match))
159 (define-public (system->linux-architecture arch)
160 "Return the Linux architecture name for ARCH, a Guix system name such as
161 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
162 (let ((arch (car (string-split arch #\-))))
163 (cond ((string=? arch "i686") "i386")
164 ((string-prefix? "mips" arch) "mips")
165 ((string-prefix? "arm" arch) "arm")
166 ((string-prefix? "aarch64" arch) "arm64")
167 ((string-prefix? "alpha" arch) "alpha")
168 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
169 ((string-prefix? "s390" arch) "s390")
170 ((string-prefix? "riscv" arch) "riscv")
173 (define-public (system->defconfig system)
174 "Some systems (notably powerpc-linux) require a special target for kernel
175 defconfig. Return the appropriate make target if applicable, otherwise return
177 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
178 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
183 ;;; Kernel source code deblobbing.
186 (define (linux-libre-deblob-scripts version
189 (list (version-major+minor version)
192 (uri (string-append "https://linux-libre.fsfla.org"
193 "/pub/linux-libre/releases/" version "-gnu/"
194 "deblob-" (version-major+minor version)))
195 (sha256 deblob-hash))
198 (uri (string-append "https://linux-libre.fsfla.org"
199 "/pub/linux-libre/releases/" version "-gnu/"
201 (sha256 deblob-check-hash))))
203 (define deblob-scripts-5.7
204 (linux-libre-deblob-scripts
206 (base32 "1gharhw104wxp9dxjkzzvsqc2xn44mc9yvacc3v7jh7b6bb0a64a")
207 (base32 "1n198gx18rxc7xflgiwya43inkwayc91pgb129kngfza8sm6v8ks")))
209 (define deblob-scripts-5.4
210 (linux-libre-deblob-scripts
212 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
213 (base32 "10qb890is4z58vr8czh3xx69q62l3b3j38y410kgiw8nii3zx5lr")))
215 (define deblob-scripts-4.19
216 (linux-libre-deblob-scripts
218 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
219 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
221 (define deblob-scripts-4.14
222 (linux-libre-deblob-scripts
224 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
225 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
227 (define deblob-scripts-4.9
228 (linux-libre-deblob-scripts
230 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
231 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
233 (define deblob-scripts-4.4
234 (linux-libre-deblob-scripts
236 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
237 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
239 (define* (computed-origin-method gexp-promise hash-algo hash
240 #:optional (name "source")
241 #:key (system (%current-system))
242 (guile (default-guile)))
243 "Return a derivation that executes the G-expression that results
244 from forcing GEXP-PROMISE."
245 (mlet %store-monad ((guile (package->derivation guile system)))
246 (gexp->derivation (or name "computed-origin")
248 #:graft? #f ;nothing to graft
250 #:guile-for-build guile)))
252 (define (make-linux-libre-source version
255 "Return a 'computed' origin that generates a Linux-libre tarball from the
256 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
257 (match deblob-scripts
258 ((deblob-version (? origin? deblob) (? origin? deblob-check))
259 (unless (string=? deblob-version (version-major+minor version))
260 ;; The deblob script cannot be expected to work properly on a
261 ;; different version (major+minor) of Linux, even if no errors
262 ;; are signaled during execution.
263 (error "deblob major+minor version mismatch"))
265 (method computed-origin-method)
266 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
270 (with-imported-modules '((guix build utils))
272 (use-modules (guix build utils)
276 (let ((dir (string-append "linux-" #$version)))
279 (set-path-environment-variable
282 #+(canonical-package bash)
283 #+(canonical-package coreutils)
284 #+(canonical-package diffutils)
285 #+(canonical-package findutils)
286 #+(canonical-package patch)
287 #+(canonical-package xz)
288 #+(canonical-package sed)
289 #+(canonical-package grep)
290 #+(canonical-package bzip2)
291 #+(canonical-package gzip)
292 #+(canonical-package tar)
293 ;; The comments in the 'deblob-check' script
294 ;; claim that it supports Python 2 and 3, but
295 ;; in fact it fails when run in Python 3 as
299 (with-directory-excursion "/tmp/bin"
301 (copy-file #+deblob "deblob")
302 (chmod "deblob" #o755)
303 (substitute* "deblob"
304 (("/bin/sh") (which "sh")))
306 (copy-file #+deblob-check "deblob-check")
307 (chmod "deblob-check" #o755)
308 (substitute* "deblob-check"
309 (("/bin/sh") (which "sh"))
310 (("/bin/sed") (which "sed"))
311 (("/usr/bin/python") (which "python"))))
313 (if (file-is-directory? #+upstream-source)
315 (format #t "Copying upstream linux source...~%")
317 (invoke "cp" "--archive" #+upstream-source dir)
318 (invoke "chmod" "--recursive" "u+w" dir))
320 (format #t "Unpacking upstream linux tarball...~%")
322 (invoke "tar" "xf" #$upstream-source)
325 (and (not (member name '("." "..")))
326 (file-is-directory? name))))
328 (unless (string=? dir unpacked-dir)
329 (rename-file unpacked-dir dir)))
331 (error "multiple directories found" dirs)))))
333 (with-directory-excursion dir
334 (setenv "PYTHON" (which "python"))
335 (format #t "Running deblob script...~%")
337 (invoke "/tmp/bin/deblob"))
339 (format #t "~%Packing new Linux-libre tarball...~%")
341 (invoke "tar" "cvfa" #$output
342 ;; Avoid non-determinism in the archive.
355 (define (linux-libre-urls version)
356 "Return a list of URLs for Linux-Libre VERSION."
358 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
359 version "-gnu/linux-libre-" version "-gnu.tar.xz")
361 ;; XXX: Work around <http://bugs.gnu.org/14851>.
363 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
364 version "-gnu.tar.xz")
366 ;; Maybe this URL will become valid eventually.
368 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
369 version "-gnu.tar.xz")))
371 (define (%upstream-linux-source version hash)
374 (uri (string-append "mirror://kernel.org"
375 "/linux/kernel/v" (version-major version) ".x/"
376 "linux-" version ".tar.xz"))
380 (define-public linux-libre-5.7-version "5.7.11")
381 (define-public linux-libre-5.7-pristine-source
382 (let ((version linux-libre-5.7-version)
383 (hash (base32 "1wb0xm9srkrzrrs6zi7ydykyiwn0247r3z9axf79khqkm8r30ack")))
384 (make-linux-libre-source version
385 (%upstream-linux-source version hash)
386 deblob-scripts-5.7)))
388 (define-public linux-libre-5.4-version "5.4.54")
389 (define-public linux-libre-5.4-pristine-source
390 (let ((version linux-libre-5.4-version)
391 (hash (base32 "0xzlvd9h9vf9m9x088kacwd25whn1anq4bxpd3bg9s5c1r7a3qh3")))
392 (make-linux-libre-source version
393 (%upstream-linux-source version hash)
394 deblob-scripts-5.4)))
396 (define-public linux-libre-4.19-version "4.19.135")
397 (define-public linux-libre-4.19-pristine-source
398 (let ((version linux-libre-4.19-version)
399 (hash (base32 "165g6agfvjxi5qi9gm5ilnfn6d01shjwypia3n4370i5lv5cxmrk")))
400 (make-linux-libre-source version
401 (%upstream-linux-source version hash)
402 deblob-scripts-4.19)))
404 (define-public linux-libre-4.14-version "4.14.190")
405 (define-public linux-libre-4.14-pristine-source
406 (let ((version linux-libre-4.14-version)
407 (hash (base32 "0h9zxm8l8hn19x7n31z3185y2frh5ij8lidyffx1a2pgjcvml5vg")))
408 (make-linux-libre-source version
409 (%upstream-linux-source version hash)
410 deblob-scripts-4.14)))
412 (define-public linux-libre-4.9-version "4.9.231")
413 (define-public linux-libre-4.9-pristine-source
414 (let ((version linux-libre-4.9-version)
415 (hash (base32 "1sz8xk767yy4lxqvy4229yrgkwnm43hdrbr54aa1flns5yh3p12g")))
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.231")
421 (define-public linux-libre-4.4-pristine-source
422 (let ((version linux-libre-4.4-version)
423 (hash (base32 "1c6p5hv18isa328pvpa3qmmsg4qsssf2mwsx3hzn489rb8ycdxp7")))
424 (make-linux-libre-source version
425 (%upstream-linux-source version hash)
426 deblob-scripts-4.4)))
428 (define %boot-logo-patch
429 ;; Linux-Libre boot logo featuring Freedo and a gnu.
432 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
433 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
436 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
438 (define %linux-libre-arm-export-__sync_icache_dcache-patch
442 "https://salsa.debian.org/kernel-team/linux"
443 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
444 "/debian/patches/bugfix/arm/"
445 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
446 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
448 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
450 (define (source-with-patches source patches)
453 (patches (append (origin-patches source)
456 (define-public linux-libre-5.7-source
457 (source-with-patches linux-libre-5.7-pristine-source
458 (list %boot-logo-patch
459 %linux-libre-arm-export-__sync_icache_dcache-patch)))
461 (define-public linux-libre-5.4-source
462 (source-with-patches linux-libre-5.4-pristine-source
463 (list %boot-logo-patch
464 %linux-libre-arm-export-__sync_icache_dcache-patch
465 ;; Pinebook Pro patch from linux-next,
466 ;; can be dropped for linux-libre 5.7
468 "linux-libre-support-for-Pinebook-Pro.patch"))))
470 (define-public linux-libre-4.19-source
471 (source-with-patches linux-libre-4.19-pristine-source
472 (list %boot-logo-patch
473 %linux-libre-arm-export-__sync_icache_dcache-patch)))
475 (define-public linux-libre-4.14-source
476 (source-with-patches linux-libre-4.14-pristine-source
477 (list %boot-logo-patch)))
479 (define-public linux-libre-4.9-source
480 (source-with-patches linux-libre-4.9-pristine-source
481 (list %boot-logo-patch)))
483 (define-public linux-libre-4.4-source
484 (source-with-patches linux-libre-4.4-pristine-source
485 (list %boot-logo-patch)))
492 (define (make-linux-libre-headers version hash-string)
493 (make-linux-libre-headers* version
496 (uri (linux-libre-urls version))
497 (sha256 (base32 hash-string)))))
499 (define (make-linux-libre-headers* version source)
501 (name "linux-libre-headers")
504 (build-system gnu-build-system)
505 (native-inputs `(("perl" ,perl)
506 ,@(if (version>=? version "4.16")
510 ,@(if (version>=? version "5.3")
514 `(#:modules ((guix build gnu-build-system)
518 (modify-phases %standard-phases
522 (let ((arch ,(system->linux-architecture
523 (or (%current-target-system)
525 (defconfig ,(system->defconfig
526 (or (%current-target-system)
527 (%current-system)))))
529 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
530 (invoke "make" defconfig)
531 (invoke "make" "mrproper" "headers_check"))))
533 (lambda* (#:key outputs #:allow-other-keys)
534 (let ((out (assoc-ref outputs "out")))
536 (string-append "INSTALL_HDR_PATH=" out)
539 (mkdir (string-append out "/include/config"))
540 (call-with-output-file
542 "/include/config/kernel.release")
544 (format p "~a-default~%" ,version)))
546 ;; Remove the '.install' and '..install.cmd' files; the
547 ;; latter contains store paths, which pulls in bootstrap
548 ;; binaries in the build environment, and prevents bit
549 ;; reproducibility for the bootstrap binaries.
550 (for-each delete-file (find-files out "\\.install"))
553 #:allowed-references ()
555 (home-page "https://www.gnu.org/software/linux-libre/")
556 (synopsis "GNU Linux-Libre kernel headers")
557 (description "Headers of the Linux-Libre kernel.")
558 (license license:gpl2)))
560 (define-public linux-libre-headers-5.7
561 (make-linux-libre-headers* linux-libre-5.7-version
562 linux-libre-5.7-source))
564 (define-public linux-libre-headers-5.4
565 (make-linux-libre-headers* linux-libre-5.4-version
566 linux-libre-5.4-source))
568 (define-public linux-libre-headers-4.19
569 (make-linux-libre-headers* linux-libre-4.19-version
570 linux-libre-4.19-source))
572 (define-public linux-libre-headers-4.14
573 (make-linux-libre-headers* linux-libre-4.14-version
574 linux-libre-4.14-source))
576 (define-public linux-libre-headers-4.9
577 (make-linux-libre-headers* linux-libre-4.9-version
578 linux-libre-4.9-source))
580 (define-public linux-libre-headers-4.4
581 (make-linux-libre-headers* linux-libre-4.4-version
582 linux-libre-4.4-source))
584 ;; The following package is used in the early bootstrap, and thus must be kept
585 ;; stable and with minimal build requirements.
586 (define-public linux-libre-headers-5.4.20
587 (make-linux-libre-headers "5.4.20"
588 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
590 (define-public linux-libre-headers linux-libre-headers-5.4.20)
594 ;;; Kernel configurations.
597 (define* (kernel-config arch #:key variant)
598 "Return the absolute file name of the Linux-Libre build configuration file
599 for ARCH and optionally VARIANT, or #f if there is no such configuration."
600 (let* ((name (string-append (if variant (string-append variant "-") "")
601 (if (string=? "i386" arch) "i686" arch) ".conf"))
602 (file (string-append "linux-libre/" name)))
603 (search-auxiliary-file file)))
605 (define %default-extra-linux-options
606 `(;; Some very mild hardening.
607 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
608 ;; All kernels should have NAMESPACES options enabled
609 ("CONFIG_NAMESPACES" . #t)
610 ("CONFIG_UTS_NS" . #t)
611 ("CONFIG_IPC_NS" . #t)
612 ("CONFIG_USER_NS" . #t)
613 ("CONFIG_PID_NS" . #t)
614 ("CONFIG_NET_NS" . #t)
615 ;; Modules required for initrd:
616 ("CONFIG_NET_9P" . m)
617 ("CONFIG_NET_9P_VIRTIO" . m)
618 ("CONFIG_VIRTIO_BLK" . m)
619 ("CONFIG_VIRTIO_NET" . m)
620 ("CONFIG_VIRTIO_PCI" . m)
621 ("CONFIG_VIRTIO_BALLOON" . m)
622 ("CONFIG_VIRTIO_MMIO" . m)
623 ("CONFIG_FUSE_FS" . m)
625 ("CONFIG_9P_FS" . m)))
627 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
628 (define %bpf-extra-linux-options
629 `(;; Needed for probes
630 ("CONFIG_UPROBE_EVENTS" . #t)
631 ("CONFIG_KPROBE_EVENTS" . #t)
632 ;; kheaders module also helpful for tracing
633 ("CONFIG_IKHEADERS" . #t)
635 ("CONFIG_BPF_SYSCALL" . #t)
636 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
637 ;; optional, for tc filters
638 ("CONFIG_NET_CLS_BPF" . m)
639 ;; optional, for tc actions
640 ("CONFIG_NET_ACT_BPF" . m)
641 ("CONFIG_BPF_JIT" . #t)
642 ;; for Linux kernel versions 4.1 through 4.6
643 ;; ("CONFIG_HAVE_BPF_JIT" . y)
644 ;; for Linux kernel versions 4.7 and later
645 ("CONFIG_HAVE_EBPF_JIT" . #t)
646 ;; optional, for kprobes
647 ("CONFIG_BPF_EVENTS" . #t)
649 ("CONFIG_IKHEADERS" . #t)))
651 (define (config->string options)
652 (string-join (map (match-lambda
654 (string-append option "=m"))
656 (string-append option "=y"))
658 (string-append option "=n")))
664 ;;; Kernel package utilities.
667 (define* (make-linux-libre version hash-string supported-systems
669 ;; A function that takes an arch and a variant.
670 ;; See kernel-config for an example.
672 (configuration-file #f)
673 (defconfig "defconfig")
674 (extra-options %default-extra-linux-options)
675 (patches (list %boot-logo-patch)))
676 (make-linux-libre* version
679 (uri (linux-libre-urls version))
680 (sha256 (base32 hash-string))
683 #:extra-version extra-version
684 #:configuration-file configuration-file
685 #:defconfig defconfig
686 #:extra-options extra-options))
688 (define* (make-linux-libre* version source supported-systems
690 ;; A function that takes an arch and a variant.
691 ;; See kernel-config for an example.
693 (configuration-file #f)
694 (defconfig "defconfig")
695 (extra-options %default-extra-linux-options))
697 (name (if extra-version
698 (string-append "linux-libre-" extra-version)
702 (supported-systems supported-systems)
703 (build-system gnu-build-system)
708 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
712 ;; These are needed to compile the GCC plugins.
717 ,@(match (and configuration-file
719 (system->linux-architecture
720 (or (%current-target-system) (%current-system)))
721 #:variant (version-major+minor version)))
722 (#f ;no config for this platform
725 `(("kconfig" ,config))))))
727 `(#:modules ((guix build gnu-build-system)
734 (modify-phases %standard-phases
735 (add-after 'unpack 'patch-/bin/pwd
737 (substitute* (find-files "." "^Makefile(\\.include)?$")
738 (("/bin/pwd") "pwd"))
741 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
742 ;; Avoid introducing timestamps
743 (setenv "KCONFIG_NOTIMESTAMP" "1")
744 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
746 ;; Set ARCH and CROSS_COMPILE
747 (let ((arch ,(system->linux-architecture
748 (or (%current-target-system)
749 (%current-system)))))
751 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
754 (setenv "CROSS_COMPILE" (string-append target "-"))
755 (format #t "`CROSS_COMPILE' set to `~a'~%"
756 (getenv "CROSS_COMPILE"))))
758 (setenv "EXTRA_VERSION" ,extra-version)
760 (let ((build (assoc-ref %standard-phases 'build))
761 (config (assoc-ref (or native-inputs inputs) "kconfig")))
763 ;; Use a custom kernel configuration file or a default
764 ;; configuration file.
767 (copy-file config ".config")
768 (chmod ".config" #o666))
769 (invoke "make" ,defconfig))
771 ;; Appending works even when the option wasn't in the
772 ;; file. The last one prevails if duplicated.
773 (let ((port (open-file ".config" "a"))
774 (extra-configuration ,(config->string extra-options)))
775 (display extra-configuration port)
778 (invoke "make" "oldconfig"))))
780 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
781 (let* ((out (assoc-ref outputs "out"))
782 (moddir (string-append out "/lib/modules"))
783 (dtbdir (string-append out "/lib/dtbs")))
784 ;; Install kernel image, kernel configuration and link map.
785 (for-each (lambda (file) (install-file file out))
786 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
787 ;; Install device tree files
788 (unless (null? (find-files "." "\\.dtb$"))
790 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
792 ;; Install kernel modules
795 ;; Disable depmod because the Guix system's module directory
796 ;; is an union of potentially multiple packages. It is not
797 ;; possible to use depmod to usefully calculate a dependency
798 ;; graph while building only one of those packages.
800 (string-append "MODULE_DIR=" moddir)
801 (string-append "INSTALL_PATH=" out)
802 (string-append "INSTALL_MOD_PATH=" out)
803 "INSTALL_MOD_STRIP=1"
805 (let* ((versions (filter (lambda (name)
806 (not (string-prefix? "." name)))
808 (version (match versions
810 ;; There are symlinks to the build and source directory,
811 ;; both of which will point to target /tmp/guix-build*
812 ;; and thus not be useful in a profile. Delete the symlinks.
813 (false-if-file-not-found
814 (delete-file (string-append moddir "/" version "/build")))
815 (false-if-file-not-found
816 (delete-file (string-append moddir "/" version "/source"))))
819 (home-page "https://www.gnu.org/software/linux-libre/")
820 (synopsis "100% free redistribution of a cleaned Linux kernel")
822 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
823 It has been modified to remove all non-free binary blobs.")
824 (license license:gpl2)))
828 ;;; Generic kernel packages.
831 (define-public linux-libre-5.4
832 (make-linux-libre* linux-libre-5.4-version
833 linux-libre-5.4-source
834 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
835 #:configuration-file kernel-config))
837 (define-public linux-libre-version linux-libre-5.4-version)
838 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
839 (define-public linux-libre-source linux-libre-5.4-source)
840 (define-public linux-libre linux-libre-5.4)
842 (define-public linux-libre-4.19
843 (make-linux-libre* linux-libre-4.19-version
844 linux-libre-4.19-source
845 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
846 #:configuration-file kernel-config))
848 (define-public linux-libre-4.14
849 (make-linux-libre* linux-libre-4.14-version
850 linux-libre-4.14-source
851 '("x86_64-linux" "i686-linux" "armhf-linux")
852 #:configuration-file kernel-config))
854 (define-public linux-libre-4.9
855 (make-linux-libre* linux-libre-4.9-version
856 linux-libre-4.9-source
857 '("x86_64-linux" "i686-linux")
858 #:configuration-file kernel-config))
860 (define-public linux-libre-4.4
861 (make-linux-libre* linux-libre-4.4-version
862 linux-libre-4.4-source
863 '("x86_64-linux" "i686-linux")
864 #:configuration-file kernel-config
867 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
868 ;; This option was removed upstream in version 4.7.
869 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
870 %default-extra-linux-options)))
874 ;;; Specialized kernel variants.
877 (define-public linux-libre-arm-generic
878 (make-linux-libre* linux-libre-version
881 #:defconfig "multi_v7_defconfig"
882 #:extra-version "arm-generic"
885 `(;; needed to fix the RTC on rockchip platforms
886 ("CONFIG_RTC_DRV_RK808" . #t))
887 %default-extra-linux-options)))
889 (define-public linux-libre-arm-generic-5.7
890 (make-linux-libre* linux-libre-5.7-version
891 linux-libre-5.7-source
893 #:defconfig "multi_v7_defconfig"
894 #:extra-version "arm-generic"
897 `(;; needed to fix the RTC on rockchip platforms
898 ("CONFIG_RTC_DRV_RK808" . #t))
899 %default-extra-linux-options)))
901 (define-public linux-libre-arm-veyron
902 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
904 (define-public linux-libre-arm-generic-4.19
905 (make-linux-libre* linux-libre-4.19-version
906 linux-libre-4.19-source
908 #:defconfig "multi_v7_defconfig"
909 #:extra-version "arm-generic"))
911 (define-public linux-libre-arm-generic-4.14
912 (make-linux-libre* linux-libre-4.14-version
913 linux-libre-4.14-source
915 #:defconfig "multi_v7_defconfig"
916 #:extra-version "arm-generic"))
918 (define-public linux-libre-arm-omap2plus
919 (make-linux-libre* linux-libre-version
922 #:defconfig "omap2plus_defconfig"
923 #:extra-version "arm-omap2plus"))
925 (define-public linux-libre-arm-omap2plus-4.19
926 (make-linux-libre* linux-libre-4.19-version
927 linux-libre-4.19-source
929 #:defconfig "omap2plus_defconfig"
930 #:extra-version "arm-omap2plus"))
932 (define-public linux-libre-arm-omap2plus-4.14
933 (make-linux-libre* linux-libre-4.14-version
934 linux-libre-4.14-source
936 #:defconfig "omap2plus_defconfig"
937 #:extra-version "arm-omap2plus"))
939 (define-public linux-libre-arm64-generic
940 (make-linux-libre* linux-libre-version
943 #:defconfig "defconfig"
944 #:extra-version "arm64-generic"
947 `(;; needed to fix the RTC on rockchip platforms
948 ("CONFIG_RTC_DRV_RK808" . #t))
949 %default-extra-linux-options)))
951 (define-public linux-libre-arm64-generic-5.7
952 (make-linux-libre* linux-libre-5.7-version
953 linux-libre-5.7-source
955 #:defconfig "defconfig"
956 #:extra-version "arm64-generic"
959 `(;; needed to fix the RTC on rockchip platforms
960 ("CONFIG_RTC_DRV_RK808" . #t))
961 %default-extra-linux-options)))
963 (define-public linux-libre-riscv64-generic
964 (make-linux-libre* linux-libre-version
967 #:extra-version "riscv64-generic"))
969 (define-public linux-libre-with-bpf
970 (let ((base-linux-libre
972 linux-libre-5.4-version
973 linux-libre-5.4-source
974 '("x86_64-linux" "i686-linux" "armhf-linux"
975 "aarch64-linux" "riscv64-linux")
976 #:extra-version "bpf"
977 #:configuration-file kernel-config
979 (append %bpf-extra-linux-options
980 %default-extra-linux-options))))
982 (inherit base-linux-libre)
983 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
988 ;;; Linux kernel modules.
991 (define-public acpi-call-linux-module
992 (let ((commit "70b9c80bd700e6a4d10797eaac9fd34b7e8cbd4a")
995 (name "acpi-call-linux-module")
996 (version (git-version "3.17" revision commit))
1001 (url "https://github.com/teleshoes/acpi_call")
1003 (file-name (git-file-name name version))
1005 (base32 "09c1vw6vcrkqxbwhpgfgpj4d1grzn4qq6ka8pwwzm7cvm405xj7x"))))
1006 (build-system linux-module-build-system)
1008 `(#:tests? #f ; no tests
1010 (modify-phases %standard-phases
1011 (add-after 'install 'install-documentation
1012 (lambda* (#:key outputs #:allow-other-keys)
1013 (let* ((out (assoc-ref outputs "out"))
1014 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1015 (for-each (lambda (file)
1016 (let ((target (string-append doc "/" file)))
1017 (mkdir-p (dirname target))
1018 (copy-recursively file target)))
1019 (list "README.md" "examples"))
1021 (home-page "https://github.com/teleshoes/acpi_call")
1022 (synopsis "Linux kernel module to perform ACPI method calls")
1024 "This simple Linux kernel module allows calls from user space to any
1025 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1026 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1027 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1028 and @code{ACPI_BUFFER}.
1030 It grants direct and undocumented access to your hardware that may cause damage
1031 and should be used with caution, especially on untested models.")
1032 (license license:gpl3+)))) ; see README.md (no licence headers)
1034 (define-public rtl8812au-aircrack-ng-linux-module
1035 (let ((commit "df2b8dfd8cb7d9f6cfeb55abaeab8a5372011fc9")
1038 (name "rtl8812au-aircrack-ng-linux-module")
1039 (version (git-version "5.6.4.2" revision commit))
1044 (url "https://github.com/aircrack-ng/rtl8812au")
1046 (file-name (git-file-name name version))
1048 (base32 "1qcr0j8yhg8l9l0f5y55zcsk1mgf3qd46yh9xfqgg91szxa3yvca"))
1049 (modules '((guix build utils)))
1052 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1053 ;; and other unnecessary unlicenced things.
1054 (for-each delete-file-recursively (list "android"
1058 (build-system linux-module-build-system)
1061 (list (string-append "KSRC="
1062 (assoc-ref %build-inputs "linux-module-builder")
1063 "/lib/modules/build"))
1065 (modify-phases %standard-phases
1067 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1068 (apply invoke "make" make-flags))))
1069 #:tests? #f)) ; no test suite
1070 (supported-systems '("x86_64-linux" "i686-linux"))
1071 (home-page "https://github.com/aircrack-ng/rtl8812au")
1072 (synopsis "Linux driver for Realtek USB wireless network adapters")
1074 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1075 network adapters, modified by the aircrack-ng project to support monitor mode
1076 and frame injection. It provides a @code{88XXau} kernel module that supports
1077 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1078 (license license:gpl2+))))
1080 (define-public rtl8821ce-linux-module
1081 (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea")
1084 (name "rtl8821ce-linux-module")
1085 (version (git-version "0.0.0" revision commit))
1090 (url "https://github.com/tomaspinho/rtl8821ce")
1092 (file-name (git-file-name name version))
1095 "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))
1096 (build-system linux-module-build-system)
1100 (string-append "KSRC="
1101 (assoc-ref %build-inputs "linux-module-builder")
1102 "/lib/modules/build"))
1104 (modify-phases %standard-phases
1106 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1107 (apply invoke "make" make-flags))))
1108 #:tests? #f)) ; no test suite
1109 (home-page "https://github.com/tomaspinho/rtl8821ce")
1110 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1111 (description "This is Realtek's RTL8821CE Linux driver for wireless
1113 (license license:gpl2))))
1115 (define-public vhba-module
1117 (name "vhba-module")
1118 (version "20200106")
1122 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1123 version ".tar.bz2"))
1126 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1127 (build-system linux-module-build-system)
1131 (home-page "https://cdemu.sourceforge.io/")
1132 (synopsis "Kernel module that emulates SCSI devices")
1133 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1134 between the CDemu userspace daemon and linux kernel.")
1135 (license license:gpl2+)))
1137 (define-public bbswitch-module
1139 (name "bbswitch-module")
1144 (url "https://github.com/Bumblebee-Project/bbswitch")
1145 (commit (string-append "v" version))))
1146 (file-name (git-file-name name version))
1149 "1glch4j0x1dzlp2yrb67v2r5jg9609jb6p8m251y78m74advqw0l"))))
1150 (build-system linux-module-build-system)
1154 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1155 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1156 (description "The bbswitch module provides a way to toggle the Nvidia
1157 graphics card on Optimus laptops.")
1158 (license license:gpl2)))
1160 (define-public ddcci-driver-linux
1162 (name "ddcci-driver-linux")
1169 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1170 (commit (string-append "v" version))))
1171 (file-name (git-file-name name version))
1174 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1175 (build-system linux-module-build-system)
1177 `(#:tests? #f ; no tests
1179 (modify-phases %standard-phases
1184 (with-directory-excursion module
1185 (apply (assoc-ref %standard-phases 'build) args)))
1186 '("ddcci" "ddcci-backlight"))
1192 (with-directory-excursion module
1193 (apply (assoc-ref %standard-phases 'install) args)))
1194 '("ddcci" "ddcci-backlight"))
1196 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1197 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1198 (description "This package provides two Linux kernel drivers, ddcci and
1199 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1200 interface. The ddcci module creates a character device for each DDC/CI
1201 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1202 module allows the control of the backlight level or luminance property when
1203 supported under @file{/sys/class/backlight/}.")
1204 (license license:gpl2+)))
1206 (define-public v4l2loopback-linux-module
1208 (name "v4l2loopback-linux-module")
1213 (url "https://github.com/umlaeute/v4l2loopback")
1214 (commit (string-append "v" version))))
1215 (file-name (git-file-name name version))
1218 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1219 (build-system linux-module-build-system)
1221 `(#:tests? #f)) ; no test suite
1222 (home-page "https://github.com/umlaeute/v4l2loopback")
1223 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1225 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1226 for Linux 2} applications will treat these as ordinary video devices but read
1227 video data generated by another application, instead of a hardware device such
1230 This lets you apply nifty effects to your Jitsi video, for example, but also
1231 allows some more serious things like adding streaming capabilities to an
1232 application by hooking GStreamer into the loopback device.")
1233 (license license:gpl2+)))
1237 ;;; Pluggable authentication modules (PAM).
1240 (define-public linux-pam
1248 "https://github.com/linux-pam/linux-pam/releases/download/v"
1249 version "/Linux-PAM-" version ".tar.xz"))
1252 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1253 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1255 (build-system gnu-build-system)
1259 ;; TODO: optional dependencies
1260 ;; ("libxcrypt" ,libxcrypt)
1261 ;; ("cracklib" ,cracklib)
1264 `(;; Most users, such as `shadow', expect the headers to be under
1266 #:configure-flags (list (string-append "--includedir="
1267 (assoc-ref %outputs "out")
1268 "/include/security")
1270 ;; XXX: <rpc/rpc.h> is missing from glibc when
1271 ;; cross-compiling, so we have to disable NIS
1272 ;; support altogether.
1273 ,@(if (%current-target-system)
1277 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1280 (home-page "http://www.linux-pam.org/")
1281 (synopsis "Pluggable authentication modules for Linux")
1283 "A *Free* project to implement OSF's RFC 86.0.
1284 Pluggable authentication modules are small shared object files that can
1285 be used through the PAM API to perform tasks, like authenticating a user
1286 at login. Local and dynamic reconfiguration are its key features.")
1287 (license license:bsd-3)))
1289 (define-public linux-pam-1.2
1297 "http://www.linux-pam.org/library/"
1298 "Linux-PAM-" version ".tar.bz2"))
1301 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1302 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1309 (define-public powerstat
1316 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1317 "powerstat/powerstat-" version ".tar.gz"))
1319 (base32 "0r355b9syqa2nhfy8ksvxyy5d58v0isf983842js091s6liy0x7g"))))
1320 (build-system gnu-build-system)
1323 (list (string-append "CC=" ,(cc-for-target))
1324 (string-append "prefix=" (assoc-ref %outputs "out")))
1325 #:tests? #f ; no test suite
1327 (modify-phases %standard-phases
1328 (add-after 'unpack 'respect-$prefix
1329 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1331 (substitute* "Makefile"
1332 (("DIR=/usr/") "DIR=$(prefix)/"))
1334 (delete 'configure)))) ; no configure script
1335 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1336 (synopsis "Measure system power consumption")
1338 "Powerstat measures and reports your computer's power consumption in real
1339 time. On mobile PCs, it uses ACPI battery information to measure the power
1340 drain of the entire system.
1342 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1343 domain measurements. These are available only on some hardware such as Intel
1344 Sandybridge and newer, and cover only part of the machine's components such as
1345 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1346 and don't require a battery at all.
1348 The output is like @command{vmstat} but also shows power consumption statistics:
1349 at the end of a run, @command{powerstat} will calculate the average, standard
1350 deviation, and minimum and maximum values. It can show a nice histogram too.")
1351 (license license:gpl2)))
1353 (define-public psmisc
1360 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1363 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1364 (build-system gnu-build-system)
1366 `(,@(if (%current-target-system)
1369 "ac_cv_func_malloc_0_nonnull=yes"
1370 "ac_cv_func_realloc_0_nonnull=yes"))
1372 (inputs `(("ncurses" ,ncurses)))
1373 (home-page "https://gitlab.com/psmisc/psmisc")
1374 (synopsis "Small utilities that use the proc file system")
1376 "This PSmisc package is a set of some small useful utilities that
1377 use the proc file system. We're not about changing the world, but
1378 providing the system administrator with some help in common tasks.")
1379 (license license:gpl2+)))
1381 (define-public util-linux
1387 (uri (string-append "mirror://kernel.org/linux/utils/"
1388 "util-linux/v" (version-major+minor version) "/"
1389 "util-linux-" version ".tar.xz"))
1392 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1393 (patches (search-patches "util-linux-tests.patch"))
1394 (modules '((guix build utils)))
1396 ;; We take 'nologin' from Shadow, the 'logger' program from
1397 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1399 (substitute* "configure"
1400 (("build_nologin=yes") "build_nologin=no")
1401 (("build_logger=yes") "build_logger=no")
1402 (("build_kill=yes") "build_kill=no"))
1404 (build-system gnu-build-system)
1405 (outputs '("out" ;6.4 MiB executables and documentation
1406 "lib" ;8.8 MiB shared libraries, headers and locales
1407 "static")) ;2.9 MiB static .a libraries
1409 `(#:configure-flags (list "--disable-use-tty-group"
1410 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1411 ;; Don't try to chown root:root mount and umount
1412 "--disable-makeinstall-chown"
1413 "--localstatedir=/var"
1414 (string-append "--localedir="
1415 (assoc-ref %outputs "lib")
1417 ;; Install completions where our
1418 ;; bash-completion package expects them.
1419 (string-append "--with-bashcompletiondir="
1420 (assoc-ref %outputs "out")
1421 "/etc/bash_completion.d"))
1422 #:phases (modify-phases %standard-phases
1423 (add-before 'configure 'patch-build-scripts
1424 (lambda* (#:key outputs #:allow-other-keys)
1425 (substitute* "configure"
1426 ;; The build system assumes that we want to install
1427 ;; libraries below $exec_prefix when $libdir does not
1428 ;; match any of the "usual" locations. Fix that.
1429 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1430 "usrlib_execdir=$libdir"))
1432 (add-before 'build 'set-umount-file-name
1433 (lambda* (#:key outputs #:allow-other-keys)
1434 ;; Tell 'eject' the right file name of 'umount'.
1435 (let ((out (assoc-ref outputs "out")))
1436 (substitute* "sys-utils/eject.c"
1437 (("\"/bin/umount\"")
1438 (string-append "\"" out "/bin/umount\"")))
1440 (add-before 'check 'pre-check
1441 (lambda* (#:key inputs outputs #:allow-other-keys)
1442 (let ((out (assoc-ref outputs "out"))
1443 (net (assoc-ref inputs "net-base")))
1444 ;; Change the test to refer to the right file.
1445 (substitute* "tests/ts/misc/mcookie"
1447 (string-append net "/etc/services")))
1449 ;; The C.UTF-8 locale does not exist in our libc.
1450 (substitute* "tests/ts/column/invalid-multibyte"
1451 (("C\\.UTF-8") "en_US.utf8"))
1453 ;; TODO: Remove the conditional on the next rebuild cycle.
1454 ,@(if (string-prefix? "arm" (%current-system))
1455 '((add-before 'check 'disable-setarch-test
1457 ;; The setarch tests are unreliable in QEMU's
1458 ;; user-mode emulation, which is our primary
1459 ;; method of building ARMv7 packages.
1460 ;; <https://github.com/karelzak/util-linux/issues/601>
1461 (substitute* "tests/ts/misc/setarch"
1462 (("ts_init_subtest.*" all)
1465 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1468 (add-after 'install 'move-static-libraries
1469 (lambda* (#:key outputs #:allow-other-keys)
1470 (let ((lib (assoc-ref outputs "lib"))
1471 (static (assoc-ref outputs "static")))
1473 ;; Move static libraries to the "static" output.
1474 (mkdir-p (string-append static "/lib"))
1475 (with-directory-excursion lib
1476 (for-each (lambda (file)
1478 (string-append static "/"
1480 (find-files "lib" "\\.a$"))
1482 ;; Remove references to the static library from the '.la'
1483 ;; files so that Libtool does the right thing when both
1484 ;; the shared and static library is available.
1485 (substitute* (find-files "lib" "\\.la$")
1486 (("old_library=.*") "old_library=''\n")))
1489 (add-after 'install 'adjust-pkg-config-files
1490 (lambda* (#:key outputs #:allow-other-keys)
1491 (let ((lib (assoc-ref outputs "lib")))
1492 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1493 ;; the pkg-config files to avoid a cyclic reference on "out".
1494 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1496 (("^(exec_)?prefix=.*") "")))
1498 (inputs `(("zlib" ,zlib)
1499 ("ncurses" ,ncurses)
1501 ;; XXX: This is so that the 'pre-check' phase can find it.
1502 ,@(if (%current-target-system)
1503 `(("net-base" ,net-base))
1507 ("net-base" ,net-base))) ;for tests
1508 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1509 (synopsis "Collection of utilities for the Linux kernel")
1510 (description "Util-linux is a diverse collection of Linux kernel
1511 utilities. It provides dmesg and includes tools for working with file systems,
1512 block devices, UUIDs, TTYs, and many other tools.")
1514 ;; Note that util-linux doesn't use the same license for all the
1515 ;; code. GPLv2+ is the default license for a code without an
1516 ;; explicitly defined license.
1517 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1518 license:bsd-4 license:public-domain))))
1520 ;; util-linux optionally supports udev, which allows lsblk to read file system
1521 ;; metadata without special privileges. Add it as a separate package to avoid
1522 ;; a circular dependency, and to keep the size small.
1523 (define-public util-linux+udev
1526 (name "util-linux-with-udev")
1529 ,@(package-inputs util-linux)))))
1531 (define-public ddate
1538 (url "https://github.com/bo0ts/ddate")
1539 (commit (string-append "v" version))))
1540 (file-name (git-file-name name version))
1542 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1543 (build-system cmake-build-system)
1544 (arguments '(#:tests? #f))
1545 (home-page "https://github.com/bo0ts/ddate")
1546 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1548 "ddate displays the Discordian date and holidays of a given date.
1549 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1550 by Robert Shea and Robert Anton Wilson.")
1551 (license license:public-domain)))
1553 (define-public fbset
1560 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1563 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1564 (build-system gnu-build-system)
1566 '(#:modules ((guix build gnu-build-system)
1570 (modify-phases %standard-phases
1571 (delete 'configure) ; no configure script
1572 (add-before 'install 'pre-install
1573 (lambda* (#:key outputs #:allow-other-keys)
1574 (let ((out (assoc-ref outputs "out")))
1575 (substitute* "Makefile"
1576 (("mknod ") "true ")
1577 ;; The Makefile doesn't honour PREFIX or similar.
1580 (with-directory-excursion out
1581 (for-each mkdir-p (list "sbin"
1585 (add-after 'install 'install-fb.modes
1586 (lambda* (#:key outputs #:allow-other-keys)
1587 (let* ((out (assoc-ref outputs "out"))
1588 (etc (string-append out "/etc")))
1589 (for-each (cut install-file <> etc)
1590 (find-files "etc" "^fb\\.modes"))
1591 (symlink "fb.modes.ATI"
1592 (string-append etc "/fb.modes"))
1594 ;; Parallel building races to create modes.tab.c.
1595 #:parallel-build? #f
1596 #:tests? #f)) ; no test suite
1600 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1601 (synopsis "Show and modify Linux frame buffer settings")
1603 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1604 different kinds of graphic displays. The @command{fbset} utility can query and
1605 change various device settings such as depth, virtual resolution, and timing
1607 (license license:gpl2)))
1609 (define-public procps
1615 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1616 "procps-ng-" version ".tar.xz"))
1619 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1620 (build-system gnu-build-system)
1622 `(#:modules ((guix build utils)
1623 (guix build gnu-build-system)
1626 ,@(if (%current-target-system)
1629 "ac_cv_func_malloc_0_nonnull=yes"
1630 "ac_cv_func_realloc_0_nonnull=yes"))
1633 (modify-phases %standard-phases
1635 'install 'post-install
1636 ;; Remove commands and man pages redudant with
1638 (lambda* (#:key outputs #:allow-other-keys)
1639 (let* ((out (assoc-ref outputs "out"))
1640 (dup (append-map (cut find-files out <>)
1641 '("^kill" "^uptime"))))
1642 (for-each delete-file dup)
1644 (inputs `(("ncurses" ,ncurses)))
1645 (home-page "https://gitlab.com/procps-ng/procps/")
1646 (synopsis "Utilities that give information about processes")
1648 "Procps is the package that has a bunch of small useful utilities
1649 that give information about processes using the Linux /proc file system.
1650 The package includes the programs ps, top, vmstat, w, kill, free,
1651 slabtop, and skill.")
1652 (license license:gpl2)))
1654 (define-public usbutils
1661 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1662 "usbutils-" version ".tar.xz"))
1664 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1665 (build-system gnu-build-system)
1666 (outputs (list "out" "python"))
1669 (modify-phases %standard-phases
1670 (add-before 'bootstrap 'patch-bootstrap-scripts
1672 (substitute* "usbhid-dump/bootstrap"
1673 (("/bin/bash") (which "bash")))
1675 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1676 (substitute* "autogen.sh"
1677 (("^\\./configure.*") ""))
1679 (add-after 'install 'separate-python-output
1680 ;; Separating one Python script shaves more than 106 MiB from :out.
1681 (lambda* (#:key outputs #:allow-other-keys)
1682 (let ((out (assoc-ref outputs "out"))
1683 (out:python (assoc-ref outputs "python")))
1684 (for-each (lambda (file)
1685 (let ((old (string-append out "/" file))
1686 (new (string-append out:python "/" file)))
1687 (mkdir-p (dirname new))
1688 (rename-file old new)))
1689 (list "bin/lsusb.py"))
1694 ("python" ,python)))
1696 `(("autoconf" ,autoconf)
1697 ("automake" ,automake)
1698 ("libtool" ,libtool)
1699 ("pkg-config" ,pkg-config)))
1700 (home-page "http://www.linux-usb.org/")
1702 "Tools for working with USB devices, such as lsusb")
1704 "Tools for working with USB devices, such as lsusb.")
1705 (license license:gpl2+)))
1707 (define-public e2fsprogs
1714 "mirror://kernel.org/linux/kernel/people/tytso/"
1715 "e2fsprogs/v" version "/"
1716 "e2fsprogs-" version ".tar.xz"))
1719 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1720 (build-system gnu-build-system)
1721 (inputs `(("util-linux" ,util-linux "lib")))
1722 (native-inputs `(("pkg-config" ,pkg-config)
1723 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1727 ("procps" ,procps)))
1729 '(;; util-linux is the preferred source for some of the libraries and
1730 ;; commands, so disable them (see, e.g.,
1731 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1732 #:configure-flags (list "--disable-libblkid"
1733 "--disable-libuuid" "--disable-uuidd"
1736 ;; Use symlinks instead of hard links for
1737 ;; 'fsck.extN' etc. This makes the resulting nar
1738 ;; smaller and is preserved across copies.
1739 "--enable-symlink-install"
1741 (string-append "LDFLAGS=-Wl,-rpath="
1742 (assoc-ref %outputs "out")
1745 ;; Install libext2fs et al.
1746 "--enable-elf-shlibs")
1749 (modify-phases %standard-phases
1750 (add-before 'configure 'patch-shells
1752 (substitute* "configure"
1753 (("/bin/sh (.*)parse-types.sh" _ dir)
1754 (string-append (which "sh") " " dir
1756 (substitute* "MCONFIG.in"
1757 (("INSTALL_SYMLINK = /bin/sh")
1758 "INSTALL_SYMLINK = sh"))
1759 (substitute* (find-files "." "^Makefile.in$")
1761 (string-append "#!" (which "sh"))))
1763 (add-after 'install 'install-libs
1764 (lambda* (#:key outputs #:allow-other-keys)
1765 (let* ((out (assoc-ref outputs "out"))
1766 (lib (string-append out "/lib")))
1767 (invoke "make" "install-libs")
1769 ;; Make the .a writable so that 'strip' works.
1770 ;; Failing to do that, due to debug symbols, we
1771 ;; retain a reference to the final
1772 ;; linux-libre-headers, which refer to the
1773 ;; bootstrap binaries.
1774 (let ((archives (find-files lib "\\.a$")))
1775 (for-each (lambda (file)
1779 (home-page "http://e2fsprogs.sourceforge.net/")
1780 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1782 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1783 (license (list license:gpl2 ;programs
1784 license:lgpl2.0 ;libext2fs
1785 license:x11)))) ;libuuid
1787 (define e2fsprogs/static
1789 (package (inherit e2fsprogs)
1791 ;; Do not build shared libraries.
1792 (substitute-keyword-arguments (package-arguments e2fsprogs)
1793 ((#:configure-flags _)
1794 '(list "--disable-blkid"))
1798 (define-public e2fsck/static
1800 (name "e2fsck-static")
1801 (version (package-version e2fsprogs))
1802 (build-system trivial-build-system)
1805 `(("e2fsprogs" ,e2fsprogs/static)))
1807 `(#:modules ((guix build utils))
1810 (use-modules (guix build utils)
1814 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1816 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1818 (with-directory-excursion bin
1819 (copy-file e2fsck "e2fsck")
1820 (remove-store-references "e2fsck")
1821 (chmod "e2fsck" #o555))
1823 (home-page (package-home-page e2fsprogs))
1824 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1825 (description "This package provides statically-linked e2fsck command taken
1826 from the e2fsprogs package. It is meant to be used in initrds.")
1827 (license (package-license e2fsprogs))))
1829 (define-public extundelete
1831 (name "extundelete")
1836 (uri (string-append "mirror://sourceforge/extundelete/"
1837 "extundelete/" version "/extundelete-"
1838 version ".tar.bz2"))
1841 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1842 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1843 (build-system gnu-build-system)
1844 (inputs `(("e2fsprogs" ,e2fsprogs)))
1845 (home-page "http://extundelete.sourceforge.net/")
1846 (synopsis "Recover deleted files from ext2/3/4 partitions")
1848 "Extundelete is a set of tools that can recover deleted files from an
1849 ext3 or ext4 partition.")
1850 (license license:gpl2)))
1852 (define-public zerofree
1856 (home-page "https://frippery.org/uml/")
1859 (uri (string-append home-page name "-" version
1863 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1864 (build-system gnu-build-system)
1867 (modify-phases %standard-phases
1868 (delete 'configure) ; no configure script
1870 ;; The Makefile lacks an ‘install’ target.
1871 (lambda* (#:key outputs #:allow-other-keys)
1872 (let* ((out (assoc-ref outputs "out"))
1873 (bin (string-append out "/bin")))
1874 (chmod "zerofree" #o555)
1875 (install-file "zerofree" bin)
1877 #:tests? #f)) ; no tests
1878 (inputs `(("libext2fs" ,e2fsprogs)))
1879 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1881 "Zerofree finds the unallocated blocks with non-zero value content in an
1882 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1883 This is a simple way to make disk images more compressible.
1884 Zerofree requires the file system to be unmounted or mounted read-only.")
1885 (license license:gpl2)))
1887 (define-public strace
1891 (home-page "https://strace.io")
1894 (uri (string-append home-page "/files/" version
1895 "/strace-" version ".tar.xz"))
1898 "1n6cfz3i2krkyvxpdp3kmxhf7sy5xp0danzaiirbk5fdkfgvb15j"))))
1899 (build-system gnu-build-system)
1902 (modify-phases %standard-phases
1903 (add-after 'unpack 'patch-/bin/sh
1905 (substitute* "strace.c"
1906 (("/bin/sh") (which "sh")))
1908 (add-after 'unpack 'disable-failing-tests
1910 ;; XXX These hang forever even if the test time-out is extended.
1911 (substitute* "tests/Makefile.in"
1912 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
1914 ;; Don't fail if the architecture doesn't support different personalities.
1915 #:configure-flags '("--enable-mpers=check")
1916 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1917 #:parallel-tests? #f)) ; undeterministic failures
1918 (native-inputs `(("perl" ,perl)))
1919 (synopsis "System call tracer for Linux")
1921 "strace is a system call tracer, i.e. a debugging tool which prints out a
1922 trace of all the system calls made by a another process/program.")
1923 (license license:lgpl2.1+)))
1925 (define-public ltrace
1931 (uri (string-append "http://www.ltrace.org/ltrace_" version
1935 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1936 (build-system gnu-build-system)
1937 (inputs `(("libelf" ,libelf)))
1939 ;; Compilation uses -Werror by default, but it fails.
1940 '(#:configure-flags '("--disable-werror")))
1941 (home-page "https://www.ltrace.org/")
1942 (synopsis "Library call tracer for Linux")
1944 "ltrace intercepts and records dynamic library calls which are called by
1945 an executed process and the signals received by that process. It can also
1946 intercept and print the system calls executed by the program.")
1947 (license license:gpl2+)))
1949 (define-public alsa-lib
1956 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1957 version ".tar.bz2"))
1960 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
1961 (build-system gnu-build-system)
1963 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1964 (assoc-ref %outputs "out")
1966 (home-page "https://www.alsa-project.org/")
1967 (synopsis "The Advanced Linux Sound Architecture libraries")
1969 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1970 MIDI functionality to the Linux-based operating system.")
1971 (license license:lgpl2.1+)))
1973 (define-public alsa-utils
1979 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1980 name "-" version ".tar.bz2"))
1983 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
1984 (build-system gnu-build-system)
1986 ;; XXX: Disable man page creation until we have DocBook.
1987 '(#:configure-flags (list "--disable-xmlto"
1989 ;; The udev rule is responsible for restoring
1991 (string-append "--with-udev-rules-dir="
1992 (assoc-ref %outputs "out")
1993 "/lib/udev/rules.d"))
1995 (modify-phases %standard-phases
1996 (add-before 'check 'disable-broken-test
1998 ;; XXX: The 1.1.8 release tarball is missing a header that's
1999 ;; required for this test to work. Fixed in 1.1.9.
2000 (substitute* "axfer/test/Makefile"
2001 ((".*container-test.*") ""))
2004 'install 'pre-install
2006 ;; Don't try to mkdir /var/lib/alsa.
2007 (substitute* "Makefile"
2008 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2012 `(("gettext" ,gettext-minimal)))
2014 `(("libsamplerate" ,libsamplerate)
2015 ("ncurses" ,ncurses)
2016 ("alsa-lib" ,alsa-lib)
2018 (home-page "http://www.alsa-project.org/")
2019 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2021 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2022 MIDI functionality to the Linux-based operating system.")
2024 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2026 (license license:gpl2)))
2028 (define-public alsa-plugins
2030 (name "alsa-plugins")
2034 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2035 name "-" version ".tar.bz2"))
2038 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2039 (build-system gnu-build-system)
2040 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2041 ;; be split, there are references to both in files.
2042 ;; TODO: Remove OSS related plugins, they add support to run native
2043 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2045 (outputs '("out" "pulseaudio" "jack"))
2047 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2048 ;; for /etc/alsa. On Guix System plugins are loaded from
2049 ;; the ALSA service, and other distributions likely
2050 ;; won't use these files.
2051 "--with-alsalconfdir=/tmp/noop")
2053 (modify-phases %standard-phases
2054 (add-after 'install 'split
2055 (lambda* (#:key inputs outputs #:allow-other-keys)
2056 ;; Distribute the binaries to the various outputs.
2057 (let* ((out (assoc-ref outputs "out"))
2058 (jack (assoc-ref outputs "jack"))
2059 (jacklib (string-append jack "/lib/alsa-lib"))
2060 (pua (assoc-ref outputs "pulseaudio"))
2061 (pualib (string-append pua "/lib/alsa-lib")))
2064 (for-each (lambda (file)
2065 (rename-file file (string-append jacklib "/" (basename file))))
2066 (find-files out ".*jack\\.(la|so)"))
2069 (for-each (lambda (file)
2070 (rename-file file (string-append pualib "/" (basename file))))
2071 (find-files out ".*pulse\\.(la|so)"))
2074 `(("alsa-lib" ,alsa-lib)
2076 ("speex" ,speex) ; libspeexdsp resampling plugin
2077 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2078 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2079 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2081 `(("pkg-config" ,pkg-config)))
2082 (home-page "http://www.alsa-project.org/")
2083 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2085 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2086 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2087 by providing additional plugins which include: upmixing, downmixing, jackd and
2088 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2089 external rate conversion.")
2090 (license (list license:gpl2+
2091 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2092 license:lgpl2.1+))))
2094 (define-public iptables
2097 ;; XXX When updating, remove the ‘install-missing-script’ phase.
2102 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2104 (string-append "https://www.netfilter.org/projects/iptables/"
2105 "files/iptables-" version ".tar.bz2")))
2107 (base32 "02a3575ypdpg6a2x752mhk3f7h1381ymkq1n0gss6fp6292xfmyl"))))
2108 (build-system gnu-build-system)
2110 `(("pkg-config" ,pkg-config)
2114 `(("libmnl" ,libmnl)
2115 ("libnftnl" ,libnftnl)))
2117 '(#:tests? #f ; no test suite
2118 #:configure-flags ; add $libdir to the RUNPATH of executables
2119 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
2121 (modify-phases %standard-phases
2122 (add-after 'install 'install-missing-script
2123 ;; A typo prevents installation of /sbin/iptables-apply. It's been
2124 ;; fixed upstream (d4ed0c741fc789bb09d977d74d30875fdd50d08b), but
2125 ;; a patch would require bootstrapping and more inputs. Simply copy
2126 ;; the file ourselves.
2127 (lambda* (#:key outputs #:allow-other-keys)
2128 (let* ((out (assoc-ref outputs "out"))
2129 (sbin (string-append out "/sbin")))
2130 (install-file "iptables/iptables-apply" sbin)
2132 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2133 (synopsis "Programs to configure Linux IP packet filtering rules")
2135 "@command{iptables} is the user-space command line program used to
2136 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2137 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2139 This package also includes @command{ip6tables}, which is used to configure the
2142 Both commands are targeted at system administrators.")
2143 (license license:gpl2+)))
2145 (define-public lsscsi
2152 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2155 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
2156 (build-system gnu-build-system)
2157 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2158 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2160 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2161 also list NVMe namespaces or controllers and show the relationship between a
2162 device's primary node name, its SCSI generic (sg) node name and its kernel
2164 (license license:gpl2)))
2166 (define-public ebtables
2173 "mirror://netfilter.org/ebtables/ebtables-"
2177 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2178 (build-system gnu-build-system)
2181 ("iptables" ,iptables)))
2182 (synopsis "Ethernet bridge frame table administration")
2183 (home-page "https://ebtables.netfilter.org/")
2185 "ebtables is an application program used to set up and maintain the
2186 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2187 analogous to the iptables application, but less complicated, due to the fact
2188 that the Ethernet protocol is much simpler than the IP protocol.")
2189 (license license:gpl2+)))
2191 (define-public iproute
2198 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2202 "088gs56iqhdlpw1iqjwrss4zxd4zbl2wl8s2implrrdajjxcfpbj"))))
2203 (build-system gnu-build-system)
2205 `( ;; There is a test suite, but it wants network namespaces and sudo.
2207 #:make-flags (let ((out (assoc-ref %outputs "out")))
2209 (string-append "BASH_COMPDIR=" out
2210 "/etc/bash_completion.d")
2211 (string-append "LIBDIR=" out "/lib")
2212 (string-append "HDRDIR=" out "/include")
2213 (string-append "SBINDIR=" out "/sbin")
2214 (string-append "CONFDIR=" out "/etc")
2215 (string-append "DOCDIR=" out "/share/doc/"
2217 (string-append "MANDIR=" out "/share/man")))
2218 #:phases (modify-phases %standard-phases
2219 (add-before 'install 'pre-install
2221 ;; Don't attempt to create /var/lib/arpd.
2222 (substitute* "Makefile"
2223 (("^.*ARPDDIR.*$") ""))
2227 ("iptables" ,iptables)
2228 ("libmnl" ,libmnl)))
2232 ("pkg-config" ,pkg-config)))
2234 ;; ("libmnl" ,libmnl)
2235 ;; ("util-linux" ,util-linux)
2237 "https://wiki.linuxfoundation.org/networking/iproute2")
2239 "Utilities for controlling TCP/IP networking and traffic in Linux")
2241 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2242 and traffic with the Linux kernel. The most important of these are
2243 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2246 Most network configuration manuals still refer to ifconfig and route as the
2247 primary network configuration tools, but ifconfig is known to behave
2248 inadequately in modern network environments, and both should be deprecated.")
2249 (license license:gpl2+)))
2251 (define-public net-tools
2252 ;; XXX: This package is basically unmaintained, but it provides a few
2253 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2255 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2259 (version (string-append "1.60-" revision "." (string-take commit 7)))
2262 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2263 "n/ne/net-tools/code.git/net-tools-code-"
2265 (file-name (string-append name "-" version ".zip"))
2268 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2269 (home-page "http://net-tools.sourceforge.net/")
2270 (build-system gnu-build-system)
2272 `(#:modules ((guix build gnu-build-system)
2277 (modify-phases %standard-phases
2279 (lambda* (#:key outputs #:allow-other-keys)
2280 (let ((out (assoc-ref outputs "out")))
2281 (mkdir-p (string-append out "/bin"))
2282 (mkdir-p (string-append out "/sbin"))
2284 ;; Pretend we have everything...
2285 (system "yes | make config")
2287 ;; ... except for the things we don't have.
2288 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2289 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2290 ;; that have been removed.
2291 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2292 ;; think about adding them later.
2293 (substitute* '("config.make" "config.h")
2294 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2297 (add-after 'install 'remove-redundant-commands
2298 (lambda* (#:key outputs #:allow-other-keys)
2299 ;; Remove commands and man pages redundant with Inetutils.
2300 (let* ((out (assoc-ref outputs "out"))
2301 (dup (append-map (cut find-files out <>)
2303 "^(yp|nis|dns)?domainname"))))
2304 (for-each delete-file dup)
2306 ;; Binaries that depend on libnet-tools.a don't declare that
2307 ;; dependency, making it parallel-unsafe.
2308 #:parallel-build? #f
2310 #:tests? #f ; no test suite
2311 #:make-flags (let ((out (assoc-ref %outputs "out")))
2312 (list ,(string-append "CC=" (cc-for-target))
2313 (string-append "BASEDIR=" out)
2314 (string-append "INSTALLNLSDIR=" out "/share/locale")
2315 (string-append "mandir=/share/man")))))
2316 (native-inputs `(("gettext" ,gettext-minimal)
2318 (supported-systems (delete "i586-gnu" %supported-systems))
2319 (synopsis "Tools for controlling the network subsystem in Linux")
2321 "This package includes the important tools for controlling the network
2322 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2323 route. Additionally, this package contains utilities relating to particular
2324 network hardware types (plipconfig, slattach) and advanced aspects of IP
2325 configuration (iptunnel, ipmaddr).")
2326 (license license:gpl2+))))
2328 (define-public libcap
2335 "mirror://kernel.org/linux/libs/security/linux-privs/"
2336 "libcap2/libcap-" version ".tar.xz"))
2339 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2340 (build-system gnu-build-system)
2341 (arguments '(#:phases
2342 (modify-phases %standard-phases
2344 ;; Add $libdir to the RUNPATH of executables.
2346 (substitute* "Make.Rules"
2348 (string-append "LDFLAGS := -Wl,-rpath="
2351 #:test-target "test"
2352 #:make-flags (list "lib=lib"
2353 (string-append "prefix="
2354 (assoc-ref %outputs "out"))
2355 "RAISE_SETFCAP=no")))
2356 (native-inputs `(("perl" ,perl)))
2357 (supported-systems (delete "i586-gnu" %supported-systems))
2358 (home-page "https://sites.google.com/site/fullycapable/")
2359 (synopsis "Library for working with POSIX capabilities")
2361 "Libcap2 provides a programming interface to POSIX capabilities on
2362 Linux-based operating systems.")
2364 ;; License is BSD-3 or GPLv2, at the user's choice.
2365 (license license:gpl2)))
2367 ;; libcap 2.31 causes problems for 'fakeroot', so provide this newer variant.
2368 ;; To be merged with libcap on the next rebuild cycle.
2369 (define-public libcap/next
2376 "mirror://kernel.org/linux/libs/security/linux-privs/"
2377 "libcap2/libcap-" version ".tar.xz"))
2380 "048n1gy2p48vl9hkrr9wymfxxcpwj2aslz2bv79nhl4m2lhd9kdf"))))))
2382 (define-public bridge-utils
2384 (name "bridge-utils")
2389 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2390 "bridge-utils-" version ".tar.xz"))
2392 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
2393 (build-system gnu-build-system)
2395 ;; The tarball lacks all the generated files.
2396 (native-inputs `(("autoconf" ,autoconf)
2397 ("automake" ,automake)))
2400 (modify-phases %standard-phases
2401 (add-before 'bootstrap 'patch-stuff
2403 ;; Fix "field ‘ip6’ has incomplete type" errors.
2404 (substitute* "libbridge/libbridge.h"
2405 (("#include <linux/if_bridge.h>")
2406 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2408 ;; Ensure that the entire build fails if one of the
2409 ;; sub-Makefiles fails.
2410 (substitute* "Makefile.in"
2411 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2412 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2415 #:tests? #f)) ; no 'check' target
2417 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2418 (synopsis "Manipulate Ethernet bridges")
2420 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2421 to connect two Ethernet segments together in a protocol independent way.
2422 Packets are forwarded based on Ethernet address, rather than IP address (like
2423 a router). Since forwarding is done at Layer 2, all protocols can go
2424 transparently through a bridge.")
2425 (license license:gpl2+)))
2427 (define-public libnl
2434 "https://github.com/thom311/libnl/releases/download/"
2435 "libnl" (string-join (string-split version #\.) "_")
2436 "/libnl-" version ".tar.gz"))
2439 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2440 (build-system gnu-build-system)
2444 ("pkg-config" ,pkg-config)
2450 "https://github.com/thom311/libnl/releases/download/libnl"
2451 (string-join (string-split version #\.) "_")
2452 "/libnl-doc-" version ".tar.gz"))
2454 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2455 (outputs `("out" "doc"))
2458 (modify-phases %standard-phases
2459 (add-after 'install 'install-doc
2460 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2461 (let ((dest (string-append (assoc-ref outputs "doc")
2462 "/share/doc/libnl")))
2464 (invoke "tar" "xf" (assoc-ref
2465 (or native-inputs inputs)
2467 "--strip-components=1" "-C" dest)))))))
2468 (home-page "https://www.infradead.org/~tgr/libnl/")
2469 (synopsis "NetLink protocol library suite")
2471 "The libnl suite is a collection of libraries providing APIs to netlink
2472 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2473 between the kernel and user space processes. It was designed to be a more
2474 flexible successor to ioctl to provide mainly networking related kernel
2475 configuration and monitoring interfaces.")
2477 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2478 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2479 (license license:gpl2)))
2481 ;; libnl python extensions used to be outputs of libnl. However, as
2482 ;; cross-compiling python extensions is currently broken, create separate
2483 ;; packages for libnl python extensions.
2484 (define (libnl-python-package python)
2485 (let ((name (string-append "libnl-" python)))
2490 ((string=? python "python2")
2491 `(("python-2" ,python-2)))
2492 ((string=? python "python3")
2493 `(("python-3" ,python-3))))))
2494 (propagated-inputs `(("libnl" ,libnl)))
2497 `(#:modules ((guix build gnu-build-system)
2501 (modify-phases %standard-phases
2503 (lambda* (#:key inputs outputs #:allow-other-keys)
2504 (define (python-inst python)
2505 (invoke python "setup.py" "build")
2506 (invoke python "setup.py" "install"
2507 (string-append "--prefix="
2508 (assoc-ref %outputs "out")))
2509 (invoke python "setup.py" "clean"))
2510 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2511 (assoc-ref inputs "libnl")))
2512 (with-directory-excursion "./python" (python-inst ,python))
2515 (define-public libnl-python2 (libnl-python-package "python2"))
2516 (define-public libnl-python3 (libnl-python-package "python3"))
2525 "mirror://kernel.org/software/network/iw/iw-"
2529 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2530 (build-system gnu-build-system)
2531 (native-inputs `(("pkg-config" ,pkg-config)))
2532 (inputs `(("libnl" ,libnl)))
2535 (let* ((target ,(%current-target-system))
2536 (pkg-config (if target
2537 (string-append target "-pkg-config")
2540 ,(string-append "CC=" (cc-for-target))
2541 (string-append "PKG_CONFIG="
2542 (assoc-ref %build-inputs "pkg-config")
2544 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2545 #:phases (modify-phases %standard-phases (delete 'configure))))
2546 (home-page "https://wireless.wiki.kernel.org/")
2547 (synopsis "Tool for configuring wireless devices")
2549 "iw is a new nl80211 based CLI configuration utility for wireless
2550 devices. It replaces @code{iwconfig}, which is deprecated.")
2551 (license license:isc)))
2553 (define-public powertop
2560 (uri (string-append "https://01.org/sites/default/files/downloads/"
2561 "powertop-" version ".tar.gz"))
2563 (base32 "0y1ixw8v17fdb1ima0zshrd0rh4zxdh10r93nrrvq6d4lhn9jpx6"))))
2564 (build-system gnu-build-system)
2567 (modify-phases %standard-phases
2568 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2569 ;; allow calibrating the network interface in Guix System.
2570 (add-after 'unpack 'patch-absolute-file-names
2571 (lambda* (#:key inputs #:allow-other-keys)
2572 (let ((kmod (assoc-ref inputs "kmod")))
2573 (substitute* (find-files "src" "\\.cpp$")
2574 ;; Give the right 'modprobe' file name so that essential
2575 ;; modules such as msr.ko can be loaded.
2576 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2577 ;; These programs are only needed to calibrate, so using
2578 ;; relative file names avoids adding extra inputs. When they
2579 ;; are missing powertop gracefully handles it.
2580 (("/usr/bin/hcitool") "hcitool")
2581 (("/usr/bin/xset") "xset")
2582 (("/usr/sbin/hciconfig") "hciconfig"))
2587 ("ncurses" ,ncurses)
2588 ("pciutils" ,pciutils)
2591 `(("pkg-config" ,pkg-config)))
2592 (home-page "https://01.org/powertop/")
2593 (synopsis "Analyze power consumption on Intel-based laptops")
2595 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2596 power management. In addition to being a diagnostic tool, PowerTOP also has
2597 an interactive mode where the user can experiment various power management
2598 settings for cases where the operating system has not enabled these
2600 (license license:gpl2)))
2602 (define-public aumix
2609 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2610 version ".tar.bz2"))
2613 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2614 (build-system gnu-build-system)
2615 (inputs `(("ncurses" ,ncurses)))
2616 (home-page "http://www.jpj.net/~trevor/aumix.html")
2617 (synopsis "Audio mixer for X and the console")
2619 "Aumix adjusts an audio mixer from X, the console, a terminal,
2620 the command line or a script.")
2621 (license license:gpl2+)))
2623 (define-public iotop
2630 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2633 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2634 (build-system python-build-system)
2637 (modify-phases %standard-phases
2638 (add-after 'unpack 'fix-build-with-python3
2640 (substitute* "setup.py"
2641 (("itervalues") "values"))
2643 ;; There are currently no checks in the package.
2645 (native-inputs `(("python" ,python)))
2646 (home-page "http://guichaz.free.fr/iotop/")
2648 "Displays the IO activity of running processes")
2650 "Iotop is a Python program with a top like user interface to show the
2651 processes currently causing I/O.")
2652 (license license:gpl2+)))
2660 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2661 "download/fuse-" version
2662 "/fuse-" version ".tar.gz"))
2665 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2666 (patches (search-patches "fuse-overlapping-headers.patch"))))
2667 (build-system gnu-build-system)
2668 (inputs `(("util-linux" ,util-linux)))
2670 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2671 (assoc-ref %outputs "out")
2673 (string-append "INIT_D_PATH="
2674 (assoc-ref %outputs "out")
2677 ;; The rule makes /dev/fuse 666.
2678 (string-append "UDEV_RULES_PATH="
2679 (assoc-ref %outputs "out")
2680 "/lib/udev/rules.d"))
2682 (modify-phases %standard-phases
2683 (add-before 'build 'set-file-names
2684 (lambda* (#:key inputs #:allow-other-keys)
2685 ;; libfuse calls out to mount(8) and umount(8). Make sure
2686 ;; it refers to the right ones.
2687 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2688 (("/bin/(u?)mount" _ maybe-u)
2689 (string-append (assoc-ref inputs "util-linux")
2690 "/bin/" maybe-u "mount")))
2691 (substitute* '("util/mount.fuse.c")
2695 ;; This hack leads libfuse to search for 'fusermount' in
2696 ;; $PATH, where it may find a setuid-root binary, instead of
2697 ;; trying solely $out/sbin/fusermount and failing because
2699 (substitute* "lib/Makefile"
2700 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2701 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2703 (supported-systems (delete "i586-gnu" %supported-systems))
2704 (home-page "https://github.com/libfuse/libfuse")
2705 (synopsis "Support file systems implemented in user space")
2707 "As a consequence of its monolithic design, file system code for Linux
2708 normally goes into the kernel itself---which is not only a robustness issue,
2709 but also an impediment to system extensibility. FUSE, for \"file systems in
2710 user space\", is a kernel module and user-space library that tries to address
2711 part of this problem by allowing users to run file system implementations as
2712 user-space processes.")
2713 (license (list license:lgpl2.1 ;library
2714 license:gpl2+)))) ;command-line utilities
2716 (define-public unionfs-fuse
2718 (name "unionfs-fuse")
2723 (url "https://github.com/rpodgorny/unionfs-fuse")
2724 (commit (string-append "v" version))))
2725 (file-name (git-file-name name version))
2728 "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6"))))
2729 (build-system cmake-build-system)
2731 `(("python" ,python)))
2732 (inputs `(("fuse" ,fuse)))
2734 ;; The tests were never actually run ("collected 0 items"), but in recent
2735 ;; versions of pytest that causes an error.
2737 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2738 (synopsis "User-space union file system")
2740 "UnionFS-FUSE is a flexible union file system implementation in user
2741 space, using the FUSE library. Mounting a union file system allows you to
2742 \"aggregate\" the contents of several directories into a single mount point.
2743 UnionFS-FUSE additionally supports copy-on-write.")
2744 (license license:bsd-3)))
2747 (package (inherit fuse)
2748 (name "fuse-static")
2749 (source (origin (inherit (package-source fuse))
2750 (modules '((guix build utils)))
2753 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2754 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2755 ;; that it doesn't do that, allowing us to remove the
2756 ;; dependency on util-linux (something that is useful in
2758 (substitute* '("lib/mount_util.c"
2759 "util/mount_util.c")
2760 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2766 (define-public unionfs-fuse/static
2767 (package (inherit unionfs-fuse)
2768 (synopsis "User-space union file system (statically linked)")
2769 (name (string-append (package-name unionfs-fuse) "-static"))
2770 (source (origin (inherit (package-source unionfs-fuse))
2771 (modules '((guix build utils)))
2774 ;; Add -ldl to the libraries, because libfuse.a needs that.
2775 (substitute* "src/CMakeLists.txt"
2776 (("target_link_libraries(.*)\\)" _ libs)
2777 (string-append "target_link_libraries"
2782 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2784 (modify-phases %standard-phases
2785 (add-after 'install 'post-install
2786 (lambda* (#:key outputs #:allow-other-keys)
2787 (let* ((out (assoc-ref outputs "out"))
2788 (exe (string-append out "/bin/unionfs")))
2789 ;; By default, 'unionfs' keeps references to
2790 ;; $glibc/share/locale and similar stuff. Remove them.
2791 (remove-store-references exe)
2793 ;; 'unionfsctl' has references to glibc as well. Since
2794 ;; we don't need it, remove it.
2795 (delete-file (string-append out "/bin/unionfsctl"))
2797 (inputs `(("fuse" ,fuse-static)))))
2799 (define-public sshfs
2805 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2806 "download/sshfs-" version "/sshfs-" version
2810 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2811 (build-system gnu-build-system)
2816 `(("pkg-config" ,pkg-config)))
2817 (home-page "https://github.com/libfuse/sshfs")
2818 (synopsis "Mount remote file systems over SSH")
2820 "This is a file system client based on the SSH File Transfer Protocol.
2821 Since most SSH servers already support this protocol it is very easy to set
2822 up: on the server side there's nothing to do; on the client side mounting the
2823 file system is as easy as logging into the server with an SSH client.")
2824 (license license:gpl2+)))
2826 (define-public sshfs-fuse
2827 (package (inherit sshfs)
2829 (properties `((superseded . ,sshfs)))))
2831 (define-public archivemount
2833 (name "archivemount")
2838 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2839 "archivemount-" version ".tar.gz"))
2841 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2842 (build-system gnu-build-system)
2843 (inputs `(("fuse" ,fuse)
2844 ("libarchive" ,libarchive)))
2845 (native-inputs `(("pkg-config" ,pkg-config)))
2846 (home-page "https://www.cybernoia.de/software/archivemount.html")
2847 (synopsis "Tool for mounting archive files with FUSE")
2848 (description "archivemount is a FUSE-based file system for Unix variants,
2849 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2850 mount point where it can be read from or written to as with any other file
2851 system. This makes accessing the contents of the archive, which may be
2852 compressed, transparent to other programs, without decompressing them.")
2853 (license license:lgpl2.0+)))
2855 (define-public numactl
2862 "https://github.com/numactl/numactl/releases/download/v"
2863 version "/numactl-" version ".tar.gz"))
2866 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2867 (build-system gnu-build-system)
2869 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2870 ;; to run, which we can't assume to have.
2873 ;; NUMA is apparently not supported on armhf, see
2874 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2875 (supported-systems (delete "armhf-linux" %supported-systems))
2876 (home-page "https://github.com/numactl/numactl")
2877 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2879 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2880 memory is not all in one place. The @command{numactl} program allows you to
2881 run your application program on specific CPUs and memory nodes. It does this
2882 by supplying a NUMA memory policy to the operating system before running your
2885 The package contains other commands, such as @command{numastat},
2886 @command{memhog}, and @command{numademo} which provides a quick overview of
2887 NUMA performance on your system.")
2888 (license (list license:gpl2 ;programs
2889 license:lgpl2.1)))) ;library
2891 (define-public kbd-neo
2898 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2899 version "/linux/console/neo.map"))
2900 (file-name (string-append name "-" version ".map"))
2903 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2904 (build-system trivial-build-system)
2906 `(#:modules ((guix build utils))
2908 (use-modules (guix build utils))
2909 (let ((out (string-append %output "/share/keymaps"))
2910 (source (assoc-ref %build-inputs "source")))
2912 (copy-file source (string-append out "/neo.map"))
2914 (home-page "https://neo-layout.org")
2915 (synopsis "Neo2 console layout")
2917 "Kbd-neo provides the Neo2 keyboard layout for use with
2918 @command{loadkeys(1)} from @code{kbd(4)}.")
2919 ;; The file is located in an svn directory, the entire content of
2920 ;; the directory is licensed as GPL3.
2921 (license license:gpl3+)))
2929 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2933 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2934 (modules '((guix build utils)))
2937 (substitute* "tests/Makefile.in"
2938 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2941 (substitute* '("src/unicode_start" "src/unicode_stop")
2942 ;; Assume the Coreutils are in $PATH.
2946 (build-system gnu-build-system)
2949 (modify-phases %standard-phases
2950 (add-before 'build 'pre-build
2951 (lambda* (#:key inputs #:allow-other-keys)
2952 (let ((gzip (assoc-ref %build-inputs "gzip"))
2953 (bzip2 (assoc-ref %build-inputs "bzip2")))
2954 (substitute* "src/libkeymap/findfile.c"
2956 (string-append gzip "/bin/gzip"))
2958 (string-append bzip2 "/bin/bzip2")))
2960 (add-after 'install 'post-install
2961 (lambda* (#:key outputs #:allow-other-keys)
2962 ;; Make sure these programs find their comrades.
2963 (let* ((out (assoc-ref outputs "out"))
2964 (bin (string-append out "/bin")))
2965 (for-each (lambda (prog)
2966 (wrap-program (string-append bin "/" prog)
2967 `("PATH" ":" prefix (,bin))))
2968 '("unicode_start" "unicode_stop"))
2970 (inputs `(("check" ,check)
2973 ("pam" ,linux-pam)))
2974 (native-search-paths
2975 (list (search-path-specification
2976 (variable "LOADKEYS_KEYMAP_PATH")
2977 ;; Append ‘/**’ to recursively search all directories. One can then
2978 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2979 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2980 (files (list "share/keymaps/**")))))
2981 (native-inputs `(("pkg-config" ,pkg-config)))
2982 (home-page "http://kbd-project.org/")
2983 (synopsis "Linux keyboard utilities and keyboard maps")
2985 "This package contains keytable files and keyboard utilities compatible
2986 for systems using the Linux kernel. This includes commands such as
2987 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2988 (license license:gpl2+)))
2990 (define-public loadkeys-static
2993 (name "loadkeys-static")
2995 (substitute-keyword-arguments (package-arguments kbd)
2996 ((#:configure-flags flags ''())
2997 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2998 "--disable-vlock" ;so we don't need libpam
2999 "--disable-libkeymap")
3001 ((#:make-flags flags ''())
3002 `(cons "LDFLAGS=-all-static" ,flags))
3003 ((#:phases phases '%standard-phases)
3004 `(modify-phases ,phases
3006 (lambda* (#:key outputs #:allow-other-keys)
3007 (let ((out (assoc-ref outputs "out")))
3008 ;; The binary keeps references to gzip, among other things,
3009 ;; which we don't need in the initrd, so strip references.
3010 (remove-store-references "src/loadkeys")
3012 (install-file "src/loadkeys"
3013 (string-append out "/bin"))
3015 (delete 'post-install)))
3016 ((#:strip-flags _ '())
3018 ((#:allowed-references _ '())
3021 (synopsis "Statically-linked @command{loadkeys} program")
3023 ;; This package is meant to be used internally in the initrd so don't
3025 (properties '((hidden? . #t)))))
3027 (define-public inotify-tools
3029 (name "inotify-tools")
3030 (version "3.20.2.2")
3034 (url "https://github.com/rvoicilas/inotify-tools")
3036 (file-name (git-file-name name version))
3039 "1r12bglkb0bkqff6kgxjm81hk6z20nrxq3m7iv15d4nrqf9pm7s0"))))
3040 (build-system gnu-build-system)
3042 `(("autoconf" ,autoconf)
3043 ("automake" ,automake)
3044 ("libtool" ,libtool)))
3045 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3046 (synopsis "Monitor file accesses")
3048 "The inotify-tools packages provides a C library and command-line tools
3049 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3050 (license license:gpl2+)))
3059 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3060 "kmod-" version ".tar.xz"))
3063 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3064 (patches (search-patches "kmod-module-directory.patch"))))
3065 (build-system gnu-build-system)
3067 `(("pkg-config" ,pkg-config)))
3072 `(#:configure-flags '("--with-xz" "--with-zlib"
3073 "--disable-test-modules")
3075 (modify-phases %standard-phases
3076 (add-after 'unpack 'disable-tests
3078 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3079 (substitute* "Makefile.in"
3080 (("testsuite/test-modprobe") "")
3081 (("testsuite/test-depmod") "")
3082 (("testsuite/test-blacklist") ""))
3084 (add-after 'install 'install-modprobe&co
3085 (lambda* (#:key outputs #:allow-other-keys)
3086 (let* ((out (assoc-ref outputs "out"))
3087 (bin (string-append out "/bin")))
3088 (for-each (lambda (tool)
3090 (string-append bin "/" tool)))
3091 '("insmod" "rmmod" "lsmod" "modprobe"
3092 "modinfo" "depmod"))
3094 (supported-systems (delete "i586-gnu" %supported-systems))
3095 (home-page "https://www.kernel.org/")
3096 (synopsis "Kernel module tools")
3097 (description "Kmod is a set of tools to handle common tasks with Linux
3098 kernel modules like insert, remove, list, check properties, resolve
3099 dependencies and aliases.
3101 These tools are designed on top of libkmod, a library that is shipped with
3102 kmod. The aim is to be compatible with tools, configurations and indices
3103 from the module-init-tools project.")
3104 (license license:gpl2+))) ; library under lgpl2.1+
3106 (define-public earlyoom
3113 (url "https://github.com/rfjakob/earlyoom")
3114 (commit (string-append "v" version))))
3115 (file-name (git-file-name name version))
3118 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
3119 (build-system gnu-build-system)
3121 `(#:phases (modify-phases %standard-phases
3123 (add-before 'check 'set-home
3125 (setenv "HOME" (getcwd))
3127 (add-after 'build 'install-contribs
3128 ;; Install what seems useful from the contrib directory.
3129 (lambda* (#:key outputs #:allow-other-keys)
3130 (let* ((out (assoc-ref outputs "out"))
3131 (contrib (string-append
3132 out "/share/earlyoom/contrib")))
3133 (install-file "contrib/notify_all_users.py" contrib)
3135 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3136 (list ,(string-append "CC=" (cc-for-target))
3137 (string-append "VERSION=v" ,version)
3138 (string-append "PREFIX=" prefix)
3139 (string-append "SYSCONFDIR=" prefix "/etc")))
3140 #:test-target "test"))
3141 (native-inputs `(("go" ,go) ;for the test suite
3142 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
3143 (home-page "https://github.com/rfjakob/earlyoom")
3144 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3145 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3146 runs in user space and provides a more responsive and configurable alternative
3147 to the in-kernel OOM killer.")
3148 (license license:expat)))
3150 (define-public eudev
3151 ;; The post-systemd fork, maintained by Gentoo.
3157 (uri (git-reference (url "https://github.com/gentoo/eudev")
3158 (commit (string-append "v" version))))
3159 (file-name (git-file-name name version))
3162 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3163 (patches (search-patches "eudev-rules-directory.patch"))))
3164 (build-system gnu-build-system)
3167 (modify-phases %standard-phases
3168 (add-after 'unpack 'make-source-writable
3170 ;; XXX: Git checkouts are read-only, but this package needs to
3171 ;; modify some of its files.
3172 (for-each make-file-writable (find-files "."))
3174 (add-before 'bootstrap 'patch-file-names
3175 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3176 (substitute* "man/make.sh"
3177 (("/usr/bin/xsltproc")
3178 (string-append (assoc-ref
3179 (or native-inputs inputs) "xsltproc")
3182 (add-before 'configure 'patch-bindir-in-btrfs-rules
3183 (lambda* (#:key outputs #:allow-other-keys)
3184 ;; The "@bindir@" substitution incorrectly expands to a literal
3185 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3187 (let ((out (assoc-ref outputs "out")))
3188 (substitute* "rules/64-btrfs.rules.in"
3190 (string-append out "/bin")))
3192 (add-after 'install 'move-static-library
3193 (lambda* (#:key outputs #:allow-other-keys)
3194 (let* ((out (assoc-ref outputs "out"))
3195 (static (assoc-ref outputs "static"))
3196 (source (string-append out "/lib/libudev.a"))
3197 (target (string-append static "/lib/libudev.a")))
3198 (mkdir-p (dirname target))
3199 (link source target)
3200 (delete-file source)
3201 ;; Remove reference to the static library from the .la file
3202 ;; such that Libtool looks for it in the usual places.
3203 (substitute* (string-append out "/lib/libudev.la")
3205 "old_library=''\n"))
3207 (add-after 'install 'build-hwdb
3208 (lambda* (#:key outputs #:allow-other-keys)
3209 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3210 ;; similar tools to display product names.
3212 ;; XXX: This can't be done when cross-compiling. Find another way
3213 ;; to generate hwdb.bin for cross-built systems.
3214 (let ((out (assoc-ref outputs "out")))
3215 ,@(if (%current-target-system)
3217 '((invoke (string-append out "/bin/udevadm")
3218 "hwdb" "--update")))))))
3219 #:configure-flags (list "--enable-manpages")))
3221 `(("autoconf" ,autoconf)
3222 ("automake" ,automake)
3224 ("libtool" ,libtool)
3225 ("pkg-config" ,pkg-config)
3228 ("python" ,python-wrapper)
3229 ;; For documentation.
3230 ("docbook-xml" ,docbook-xml-4.2)
3231 ("docbook-xsl" ,docbook-xsl)
3232 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3233 ("xsltproc" ,libxslt)))
3235 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3236 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3237 ;; which contains the rules to do that.
3238 `(("util-linux" ,util-linux "lib") ;for blkid
3240 (outputs '("out" "static"))
3241 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3242 (synopsis "Userspace device management")
3243 (description "Udev is a daemon which dynamically creates and removes
3244 device nodes from /dev/, handles hotplug events and loads drivers at boot
3246 (license license:gpl2+)))
3248 (define-public python-evdev
3250 (name "python-evdev")
3255 (uri (pypi-uri "evdev" version))
3257 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3258 (build-system python-build-system)
3260 `(("kernel-headers" ,linux-libre-headers)))
3262 `(#:tests? #f ;no rule for tests
3264 (modify-phases %standard-phases
3265 (add-before 'build 'fix-hard-coded-directory
3266 (lambda* (#:key inputs #:allow-other-keys)
3267 (substitute* "setup.py"
3268 (("/usr/include/linux")
3270 (assoc-ref inputs "kernel-headers") "/include/linux")))
3272 (home-page "https://github.com/gvalkov/python-evdev")
3273 (synopsis "Bindings to the Linux input handling subsystem")
3275 "Python-evdev provides bindings to the generic input event interface in
3276 Linux. The @code{evdev} interface serves the purpose of passing events
3277 generated in the kernel directly to userspace through character devices that
3278 are typically located in @file{/dev/input/}.
3280 This package also comes with bindings to @code{uinput}, the userspace input
3281 subsystem. @code{uinput} allows userspace programs to create and handle input
3282 devices that can inject events directly into the input subsystem.")
3283 (license license:bsd-3)))
3291 (uri (list (string-append "ftp://sourceware.org/pub/lvm2/LVM2."
3293 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3297 "0xdr9qbqw6kja267wmx6ajnfv1nhw056gpxx9v2qmfh3bj6qnfn0"))
3298 (modules '((guix build utils)))
3301 (use-modules (guix build utils))
3303 ;; Honor sysconfdir.
3304 (substitute* "make.tmpl.in"
3306 "confdir = @sysconfdir@\n")
3307 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3308 "DEFAULT_SYS_DIR = @sysconfdir@"))
3310 (patches (search-patches "lvm2-static-link.patch"))))
3311 (build-system gnu-build-system)
3313 `(("pkg-config" ,pkg-config)
3314 ("procps" ,procps))) ;tests use 'pgrep'
3316 `(("libaio" ,libaio)
3320 (modify-phases %standard-phases
3321 (add-after 'configure 'set-makefile-shell
3323 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3325 (setenv "SHELL" (which "sh"))
3327 ;; Replace /bin/sh with the right file name.
3328 (patch-makefile-SHELL "make.tmpl")
3331 #:configure-flags (list (string-append "--sysconfdir="
3332 (assoc-ref %outputs "out")
3334 "--enable-udev_sync"
3335 "--enable-udev_rules"
3336 "--enable-pkgconfig"
3338 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3340 ;; Make sure programs such as 'dmsetup' can
3341 ;; find libdevmapper.so.
3342 (string-append "LDFLAGS=-Wl,-rpath="
3343 (assoc-ref %outputs "out")
3345 (assoc-ref %outputs "out")
3346 "/lib/device-mapper")
3347 ;; This is needed when cross-compiling.
3348 ,@(if (%current-target-system)
3349 '("ac_cv_func_malloc_0_nonnull=yes"
3350 "ac_cv_func_realloc_0_nonnull=yes")
3353 ;; The tests use 'mknod', which requires root access.
3355 (supported-systems (delete "i586-gnu" %supported-systems))
3356 (home-page "https://sourceware.org/lvm2/")
3357 (synopsis "Logical volume management for Linux")
3359 "LVM2 is the logical volume management tool set for Linux-based systems.
3360 This package includes the user-space libraries and tools, including the device
3361 mapper. Kernel components are part of Linux-libre.")
3363 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3364 ;; Command-line tools are GPLv2.
3365 (license (list license:gpl2 license:lgpl2.1))))
3367 (define-public lvm2-static
3370 (name "lvm2-static")
3372 ;; Propagate udev because libdevmapper.a depends on libudev.
3373 (propagated-inputs `(("udev:static" ,eudev "static")))
3376 (substitute-keyword-arguments (package-arguments lvm2)
3377 ((#:configure-flags flags '())
3378 ;; LVM2 doesn't use Libtool, hence the custom option.
3379 `(append '("--enable-static_link")
3380 ;; Building dmeventd statically is complicated due to a
3381 ;; requirement on libdevmapper.a, which is being phased out
3382 ;; in favor of libdevice-mapper.a, which in turn is is not
3383 ;; easily made available at dmeventd build time. Just ignore
3384 ;; it until the situation improves.
3385 (delete "--enable-dmeventd" ,flags)))
3387 `(modify-phases ,phases
3388 (add-before 'configure 'adjust-Makefile
3390 ;; These fixes are related to the upstream libdm->device_mapper
3391 ;; migration and will hopefully be fixed upstream in due time.
3392 (substitute* "tools/Makefile.in"
3393 ;; This variable is empty in a static configuration and causes
3394 ;; an erroneous GCC command line.
3395 (("-L\\$\\(interfacebuilddir\\)") "")
3396 ;; Remove obsolete reference to libdevmapper.a.
3397 (("-ldevmapper") ""))
3399 (synopsis "Logical volume management for Linux (statically linked)")))
3401 (define-public thin-provisioning-tools
3403 (name "thin-provisioning-tools")
3409 (url "https://github.com/jthornber/thin-provisioning-tools")
3410 (commit (string-append "v" version))))
3411 (file-name (git-file-name name version))
3413 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
3414 (build-system gnu-build-system)
3416 ;; Doesn't build with --enable-testing due to a function name collision
3417 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
3420 `(("automake" ,automake)
3421 ("autoreconf" ,autoconf)))
3425 ("libaio" ,libaio)))
3426 (synopsis "Tools for manipulating the metadata of device-mapper targets")
3427 (description "A suite of tools for manipulating the metadata of the
3428 dm-thin, dm-cache and dm-era device-mapper targets.")
3429 (home-page "https://github.com/jthornber/thin-provisioning-tools")
3430 (license license:gpl3+)))
3432 (define-public wireless-tools
3434 (name "wireless-tools")
3438 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3442 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3445 ;; Remove the older header files that are not free software.
3446 (for-each (lambda (n)
3447 (delete-file (format #f "wireless.~a.h" n)))
3448 '(10 11 12 13 14 15 16 17 18 19 20))
3450 (build-system gnu-build-system)
3453 (list (string-append "PREFIX=" %output)
3454 (string-append "INSTALL_MAN=" %output "/share/man")
3455 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3458 (modify-phases %standard-phases
3460 (lambda* (#:key target #:allow-other-keys)
3461 (when ,(%current-target-system)
3462 ;; Cross-compilation: use the cross tools.
3463 (substitute* (find-files "." "Makefile")
3465 (string-append "CC = " target "-gcc\n"))
3467 (string-append "AR = " target "-ar\n"))
3469 (string-append "RANLIB = " target "-ranlib\n"))))
3472 (synopsis "Tools for manipulating Linux Wireless Extensions")
3473 (description "Wireless Tools are used to manipulate the now-deprecated
3474 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3475 Extension was an interface allowing you to set Wireless LAN specific
3476 parameters and get the specific stats. It is deprecated in favor the nl80211
3478 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3479 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3480 ;; other files are distributed under gpl2.
3481 (license (list license:gpl2 license:lgpl2.1+))))
3489 (uri (string-append "mirror://kernel.org/software/network/crda/"
3490 "crda-" version ".tar.xz"))
3493 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3494 (patches (search-patches "crda-optional-gcrypt.patch"))))
3495 (build-system gnu-build-system)
3497 `(#:phases (modify-phases %standard-phases
3499 (add-after 'unpack 'gzip-determinism
3501 (substitute* "Makefile"
3502 (("gzip") "gzip --no-name"))
3504 ,@(if (%current-target-system)
3506 'unpack 'fix-pkg-config
3507 (lambda* (#:key target #:allow-other-keys)
3511 (string-append target "-pkg-config")))
3515 'build 'no-werror-no-ldconfig
3517 (substitute* "Makefile"
3519 (("ldconfig") "true"))
3522 'build 'set-regulator-db-file-name
3523 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3524 ;; Tell CRDA where to find our database.
3525 (let ((regdb (assoc-ref (or native-inputs inputs)
3527 (substitute* "crda.c"
3528 (("\"/lib/crda/regulatory.bin\"")
3529 (string-append "\"" regdb
3530 "/lib/crda/regulatory.bin\"")))
3532 #:test-target "verify"
3533 #:make-flags (let ((out (assoc-ref %outputs "out"))
3534 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3536 (string-append "CC=" ,(cc-for-target))
3539 ;; Disable signature-checking on 'regulatory.bin'.
3540 ;; The reason is that this simplifies maintenance
3541 ;; on our side (no need to manage a distro key
3542 ;; pair), and we can guarantee integrity of
3543 ;; 'regulatory.bin' by other means anyway, such as
3544 ;; 'guix gc --verify'. See
3545 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3549 (string-append "PREFIX=" out)
3550 (string-append "SBINDIR=" out "/sbin/")
3551 (string-append "UDEV_RULE_DIR="
3552 out "/lib/udev/rules.d")
3553 (string-append "LDFLAGS=-Wl,-rpath="
3555 (string-append "REG_BIN=" regdb
3556 "/lib/crda/regulatory.bin")
3558 (native-inputs `(("pkg-config" ,pkg-config)
3559 ("wireless-regdb" ,wireless-regdb)))
3560 (inputs `(("libnl" ,libnl)))
3562 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3563 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3565 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3566 communication between the kernel Linux and user space for regulatory
3568 (license license:copyleft-next)))
3570 (define-public wireless-regdb
3572 (name "wireless-regdb")
3573 (version "2019.06.03")
3577 "mirror://kernel.org/software/network/wireless-regdb/"
3578 "wireless-regdb-" version ".tar.xz"))
3581 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
3583 ;; We're building 'regulatory.bin' by ourselves.
3585 (delete-file "regulatory.bin")
3587 (build-system gnu-build-system)
3590 (modify-phases %standard-phases
3591 (add-after 'unpack 'gzip-determinism
3593 (substitute* "Makefile"
3594 (("gzip") "gzip --no-name"))
3596 (add-after 'unpack 'omit-signature
3598 (substitute* "Makefile"
3599 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3600 ;; don't provide (see below). Disable it.
3601 ((" regulatory\\.db\\.p7s") "")
3602 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3603 ;; but ‘make install’ depends only on the latter while installing
3604 ;; both (and failing). Depend on it explicitly.
3605 (("^install: " all) (string-append all "regulatory.db ")))
3607 (delete 'configure)) ; no configure script
3609 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3610 ;; is computed and can be equal to 'maintainer-clean'; when that
3611 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3612 ;; just built. Thus, build things sequentially.
3613 #:parallel-build? #f
3615 #:tests? #f ; no tests
3617 (let ((out (assoc-ref %outputs "out")))
3618 (list (string-append "PREFIX=" out)
3619 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3621 ;; Leave this empty so that db2bin.py doesn't try to sign
3622 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3623 ;; pair for the whole distribution.
3624 (string-append "REGDB_PRIVKEY=")
3625 ;; Don't generate a public key for the same reason. These are
3626 ;; used as Makefile targets and can't be the empty string.
3627 (string-append "REGDB_PUBCERT=/dev/null")
3628 (string-append "REGDB_PUBKEY=/dev/null")))))
3630 `(("python" ,python-wrapper)))
3632 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3633 (synopsis "Wireless regulatory database")
3635 "This package contains the wireless regulatory database Central
3636 Regulatory Database Agent (CRDA) daemon. The database contains information on
3637 country-specific regulations for the wireless spectrum.")
3638 (license license:isc)))
3640 (define-public lm-sensors
3648 (url "https://github.com/groeck/lm-sensors")
3649 (commit (string-append "V" (string-join
3650 (string-split version #\.) "-")))))
3651 (file-name (git-file-name name version))
3653 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3654 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3655 (build-system gnu-build-system)
3656 (inputs `(("rrdtool" ,rrdtool)
3659 ("gnuplot" ,gnuplot)))
3660 (native-inputs `(("pkg-config" ,pkg-config)
3664 (outputs '("lib" ; avoid perl in closure
3667 `(#:tests? #f ; no 'check' target
3668 #:make-flags (list (string-append "PREFIX=" %output)
3669 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3670 (string-append "INCLUDEDIR="
3671 (assoc-ref %outputs "lib") "/include")
3672 (string-append "MANDIR=" %output "/share/man")
3673 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3675 (modify-phases %standard-phases
3677 (add-before 'build 'patch-exec-paths
3678 (lambda* (#:key inputs outputs #:allow-other-keys)
3679 (substitute* "prog/detect/sensors-detect"
3681 (string-append "`" (assoc-ref inputs "coreutils")
3683 (("(`|\")modprobe" all open-quote)
3684 (string-append open-quote
3685 (assoc-ref inputs "kmod")
3687 (substitute* '("prog/pwm/pwmconfig"
3688 "prog/pwm/fancontrol")
3690 (string-append (assoc-ref inputs "gnuplot")
3693 (string-append (assoc-ref inputs "coreutils")
3696 (string-append (assoc-ref inputs "grep")
3699 (string-append (assoc-ref inputs "sed")
3702 (string-append (assoc-ref inputs "coreutils")
3705 (string-append (assoc-ref inputs "coreutils")
3708 (string-append (assoc-ref inputs "coreutils")
3709 "/bin/readlink -f")))
3711 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3712 (synopsis "Utilities to read temperature/voltage/fan sensors")
3714 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3715 you to access information from temperature, voltage, and fan speed sensors.
3716 It works with most newer systems.")
3717 (license license:gpl2+)))
3719 (define-public iucode-tool
3721 (name "iucode-tool")
3725 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3726 "/raw/latest/iucode-tool_" version ".tar.xz"))
3729 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3730 (build-system gnu-build-system)
3731 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3732 (synopsis "Manipulate Intel microcode bundles")
3734 "@command{iucode_tool} is a utility to work with microcode packages for
3735 Intel processors. It can convert between formats, extract specific versions,
3736 create a firmware image suitable for the Linux kernel, and more.")
3737 ;; cpuid.h is available for i686, x86_64, and ia64.
3738 (supported-systems '("i686-linux" "x86_64-linux"))
3739 (license license:gpl2+)))
3741 (define-public i2c-tools
3748 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3749 version ".tar.bz2"))
3752 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3753 (build-system gnu-build-system)
3755 `(#:tests? #f ; no 'check' target
3756 #:make-flags (list (string-append "prefix=" %output)
3757 ,(string-append "CC=" (cc-for-target)))
3758 ;; No configure script.
3759 #:phases (modify-phases %standard-phases (delete 'configure))))
3762 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3763 (synopsis "I2C tools for Linux")
3765 "The i2c-tools package contains a heterogeneous set of I2C tools for
3766 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3767 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3769 (license license:gpl2+)))
3771 (define-public xsensors
3778 "http://www.linuxhardware.org/xsensors/xsensors-"
3782 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3783 (build-system gnu-build-system)
3784 (inputs `(("lm-sensors" ,lm-sensors "lib")
3786 (native-inputs `(("pkg-config" ,pkg-config)))
3789 (modify-phases %standard-phases
3790 (add-before 'configure 'enable-deprecated
3792 (substitute* "src/Makefile.in"
3793 (("-DGDK_DISABLE_DEPRECATED") "")
3794 (("-DGTK_DISABLE_DEPRECATED") ""))
3796 (add-before 'configure 'remove-Werror
3798 (substitute* '("configure" "src/Makefile.in")
3801 (home-page "http://www.linuxhardware.org/xsensors/")
3802 (synopsis "Hardware health information viewer")
3804 "Xsensors reads data from the libsensors library regarding hardware
3805 health such as temperature, voltage and fan speed and displays the information
3806 in a digital read-out.")
3807 (license license:gpl2+)))
3812 (version (package-version linux-libre))
3813 (source (package-source linux-libre))
3814 (build-system gnu-build-system)
3817 (modify-phases %standard-phases
3819 (lambda* (#:key inputs #:allow-other-keys)
3820 (setenv "SHELL_PATH" (which "bash"))
3821 (chdir "tools/perf")
3823 #:make-flags (list (string-append "prefix="
3824 (assoc-ref %outputs "out"))
3828 ;; By default, 'config/Makefile' uses lib64 on
3829 ;; x86_64. Work around that.
3831 #:tests? #f)) ;no tests
3833 `(("pkg-config" ,pkg-config)
3837 ;; There are build scripts written in these languages.
3839 ("python" ,python-2)))
3841 `(("slang" ,slang) ;for the interactive TUI
3843 ("python" ,python-2) ;'perf' links against libpython
3844 ("elfutils" ,elfutils)
3845 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3846 ("libunwind" ,libunwind) ;better stack walking
3847 ("numactl" ,numactl) ;for 'perf bench numa mem'
3850 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3851 ("docbook-xsl" ,docbook-xsl)
3853 ("asciidoc" ,asciidoc)))
3854 (home-page "https://perf.wiki.kernel.org/")
3855 (synopsis "Linux profiling with performance counters")
3857 "perf is a tool suite for profiling using hardware performance counters,
3858 with support in the Linux kernel. perf can instrument CPU performance
3859 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3860 of lightweight profiling. This package contains the user-land tools and in
3861 particular the @code{perf} command.")
3862 (license (package-license linux-libre))))
3864 (define-public pflask
3871 (url "https://github.com/ghedo/pflask")
3872 (commit (string-append "v" version))))
3873 (file-name (git-file-name name version))
3876 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
3877 (build-system cmake-build-system)
3879 '(#:tests? #f)) ; no tests
3880 (home-page "https://ghedo.github.io/pflask/")
3881 (synopsis "Simple tool for creating Linux namespace containers")
3882 (description "pflask is a simple tool for creating Linux namespace
3883 containers. It can be used for running a command or even booting an OS inside
3884 an isolated container, created with the help of Linux namespaces. It is
3885 similar in functionality to chroot, although pflask provides better isolation
3886 thanks to the use of namespaces.")
3887 (license license:bsd-2)))
3889 (define-public singularity
3891 (name "singularity")
3895 (uri (string-append "https://github.com/singularityware/singularity/"
3896 "releases/download/" version
3897 "/singularity-" version ".tar.gz"))
3900 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3901 (modules '((guix build utils)))
3904 ;; Do not create directories in /var.
3905 (substitute* "Makefile.in"
3906 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3908 ;; The original source overrides PATH so that it points to
3909 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3910 ;; on Guix System. Leave PATH unchanged so we refer to the
3911 ;; installed Coreutils, grep, etc.
3912 (substitute* "bin/singularity.in"
3914 (string-append "#" all "\n")))
3916 (substitute* (find-files "libexec/cli" "\\.exec$")
3917 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3919 (string-append "/run/setuid-programs/singularity-"
3920 program "-helper")))
3922 ;; These squashfs mount options are apparently no longer
3923 ;; supported since Linux-libre 5.4.5.
3924 (substitute* "src/lib/image/squashfs/mount.c"
3925 (("\"errors=remount-ro\"")
3928 (build-system gnu-build-system)
3930 `(#:configure-flags '("--localstatedir=/var")
3932 (modify-phases %standard-phases
3933 (add-after 'unpack 'patch-references
3935 (substitute* "libexec/cli/build.exec"
3936 (("if ! singularity_which mksquashfs") "if 0")
3937 (("if ! mksquashfs")
3938 (string-append "if ! " (which "mksquashfs"))))
3939 (substitute* (list "libexec/cli/help.exec"
3940 "libexec/bootstrap-scripts/functions"
3941 "libexec/bootstrap-scripts/post.sh"
3942 "libexec/functions")
3944 (string-append (which "egrep") " ")))
3946 (add-after 'install 'set-PATH
3947 (lambda* (#:key inputs outputs #:allow-other-keys)
3948 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
3949 (let ((out (assoc-ref outputs "out"))
3950 (coreutils (assoc-ref inputs "coreutils")))
3951 (wrap-program (string-append out "/bin/singularity")
3952 `("PATH" ":" = (,(string-append coreutils "/bin"))))
3953 (substitute* (string-append out "/bin/run-singularity")
3954 (("/usr/bin/env singularity")
3955 (string-append (which "env") " "
3956 out "/bin/singularity")))
3959 `(("libarchive" ,libarchive)
3960 ("python" ,python-wrapper)
3962 ("squashfs-tools" ,squashfs-tools)))
3963 (home-page "https://singularity.lbl.gov/")
3964 (synopsis "Container platform")
3965 (description "Singularity is a container platform supporting a number of
3966 container image formats. It can build SquashFS container images or import
3967 existing Docker images. Singularity requires kernel support for container
3968 isolation or root privileges.")
3969 (license license:bsd-3)))
3971 (define-public hdparm
3977 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3978 "hdparm-" version ".tar.gz"))
3981 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3982 (build-system gnu-build-system)
3985 (let ((out (assoc-ref %outputs "out")))
3986 (list (string-append "binprefix=" out)
3987 (string-append "manprefix=" out)
3988 ,(string-append "CC=" (cc-for-target))
3989 ;; Let Guix strip the binaries and not break cross-compilation.
3992 (modify-phases %standard-phases
3993 (delete 'configure)) ; no configure script
3994 #:tests? #f)) ; no test suite
3995 (home-page "https://sourceforge.net/projects/hdparm/")
3996 (synopsis "View and tune ATA disk drive parameters")
3998 "@command{hdparm} is a command-line utility to control ATA controllers and
3999 disk drives. It can increase performance and/or reliability by careful tuning
4000 of hardware settings like power and acoustic management, DMA modes, and caching.
4001 It can also display detailed device information, or be used as a simple
4002 performance benchmarking tool.
4004 @command{hdparm} provides a command line interface to various Linux kernel
4005 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
4006 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4007 Translation (@dfn{SAT}) are also supported.")
4008 (license (license:non-copyleft "file://LICENSE.TXT"))))
4010 (define-public nvme-cli
4014 (home-page "https://github.com/linux-nvme/nvme-cli")
4019 (commit (string-append "v" version))))
4021 (base32 "0ldky34sn0m5c4hgiip0fkzm465nca69bhxicpd5dg8wxhzxqrp3"))
4022 (file-name (git-file-name name version))))
4023 (build-system gnu-build-system)
4026 (list ,(string-append "CC=" (cc-for-target)))
4027 #:phases (modify-phases %standard-phases
4028 (delete 'configure) ; no ./configure script
4031 (invoke "make" "install-spec" "PREFIX="
4032 (string-append "DESTDIR=" %output)))))
4033 ;; The tests require sysfs, which is not accessible from from the build
4036 (synopsis "NVM-Express user space tooling for Linux")
4037 (description "Nvme-cli is a utility to provide standards compliant tooling
4038 for NVM-Express drives. It was made specifically for Linux as it relies on the
4039 IOCTLs defined by the mainline kernel driver.")
4040 (license license:gpl2+)))
4042 (define-public rfkill
4048 (uri (string-append "mirror://kernel.org/software/network/"
4049 name "/" name "-" version ".tar.xz"))
4052 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4053 (build-system gnu-build-system)
4055 `(#:make-flags (list "CC=gcc"
4056 (string-append "PREFIX=" %output))
4057 #:phases (modify-phases %standard-phases
4058 (delete 'configure))
4060 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4061 (synopsis "Tool for enabling and disabling wireless devices")
4063 "rfkill is a simple tool for accessing the rfkill device interface,
4064 which is used to enable and disable wireless networking devices, typically
4065 WLAN, Bluetooth and mobile broadband.")
4066 (license (license:non-copyleft "file://COPYING"
4067 "See COPYING in the distribution."))
4068 ;; rfkill is part of util-linux as of 2.31.
4069 (properties `((superseded . ,util-linux)))))
4077 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4078 version "/" name "-" version ".tar.gz"))
4081 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4082 (build-system gnu-build-system)
4083 (home-page "http://acpiclient.sourceforge.net")
4084 (synopsis "Display information on ACPI devices")
4085 (description "@code{acpi} attempts to replicate the functionality of the
4086 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4087 information. It does not support ACPI suspending, only displays information
4088 about ACPI devices.")
4089 (license license:gpl2+)))
4091 (define-public acpid
4097 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4101 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4102 (build-system gnu-build-system)
4103 (home-page "https://sourceforge.net/projects/acpid2/")
4104 (synopsis "Daemon for delivering ACPI events to user-space programs")
4106 "acpid is designed to notify user-space programs of Advanced
4107 Configuration and Power Interface (ACPI) events. acpid should be started
4108 during the system boot, and will run as a background process. When an ACPI
4109 event is received from the kernel, acpid will examine the list of rules
4110 specified in /etc/acpi/events and execute the rules that match the event.")
4111 (license license:gpl2+)))
4113 (define-public sysfsutils
4122 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4125 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4126 (build-system gnu-build-system)
4127 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4128 (synopsis "System utilities based on Linux sysfs")
4130 "These are a set of utilities built upon sysfs, a virtual file system in
4131 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4132 also contains the libsysfs library.")
4133 ;; The library is under lgpl2.1+ (all files say "or any later version").
4134 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4135 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4137 (define-public sysfsutils-1
4139 (inherit sysfsutils)
4146 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4147 "/sysfsutils-" version ".tar.gz"))
4149 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4150 (modules '((guix build utils)))
4153 (substitute* "Makefile.in"
4154 (("includedir = /usr/include/sysfs")
4155 "includedir = @includedir@"))
4156 (substitute* "configure"
4157 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4158 (string-append "includedir='" orig "/sysfs'")))
4160 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4162 (define-public cpufrequtils
4164 (name "cpufrequtils")
4169 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4170 "cpufrequtils-" version ".tar.gz"))
4172 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4173 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4174 (build-system gnu-build-system)
4176 `(("sysfsutils" ,sysfsutils-1)))
4178 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4179 (assoc-ref %outputs "out") "/lib"))))
4180 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4181 (synopsis "Utilities to get and set CPU frequency on Linux")
4183 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4184 information, and set the CPU frequency if supported, using the cpufreq
4185 capabilities of the Linux kernel.")
4186 (license license:gpl2)))
4188 (define-public libraw1394
4195 "mirror://kernel.org/linux/libs/ieee1394/"
4196 name "-" version ".tar.xz"))
4199 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4200 (build-system gnu-build-system)
4201 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4202 (synopsis "Interface library for the Linux IEEE1394 drivers")
4204 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4205 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4206 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4207 send to and receive from other nodes without requiring a kernel driver for the
4208 protocol in question.")
4209 (license license:lgpl2.1+)))
4211 (define-public libavc1394
4217 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4218 name "-" version ".tar.gz"))
4221 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4222 (build-system gnu-build-system)
4224 `(("pkg-config" ,pkg-config)))
4226 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4227 (home-page "https://sourceforge.net/projects/libavc1394/")
4228 (synopsis "AV/C protocol library for IEEE 1394")
4230 "Libavc1394 is a programming interface to the AV/C specification from
4231 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4232 (license license:lgpl2.1+)))
4234 (define-public libiec61883
4236 (name "libiec61883")
4241 "mirror://kernel.org/linux/libs/ieee1394/"
4242 name "-" version ".tar.xz"))
4245 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4246 (build-system gnu-build-system)
4248 `(("pkg-config" ,pkg-config)))
4250 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4251 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4252 (synopsis "Isochronous streaming media library for IEEE 1394")
4254 "The libiec61883 library provides a higher level API for streaming DV,
4255 MPEG-2 and audio over Linux IEEE 1394.")
4256 (license license:lgpl2.1+)))
4258 (define-public mdadm
4265 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4269 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4270 (build-system gnu-build-system)
4274 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4275 (list ,(string-append "CC=" (cc-for-target))
4278 ;; TODO: tell it where to find 'sendmail'
4279 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4280 (string-append "BINDIR=" out "/sbin")
4281 (string-append "MANDIR=" out "/share/man")
4282 (string-append "UDEVDIR=" out "/lib/udev")))
4284 (modify-phases %standard-phases
4285 (add-before 'build 'patch-program-paths
4286 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4287 (let ((coreutils (assoc-ref (or native-inputs inputs)
4289 (substitute* "udev-md-raid-arrays.rules"
4290 (("/usr/bin/(readlink|basename)" all program)
4291 (string-append coreutils "/bin/" program))))
4293 (add-before 'build 'remove-W-error
4295 ;; We cannot build with -Werror on i686 due to a
4296 ;; 'sign-compare' warning in util.c.
4297 (substitute* "Makefile"
4300 (delete 'configure))
4301 ;;tests must be done as root
4303 (supported-systems (delete "i586-gnu" %supported-systems))
4304 (home-page "http://neil.brown.name/blog/mdadm")
4305 (synopsis "Tool for managing Linux Software RAID arrays")
4307 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4308 assemble, report on, and monitor arrays. It can also move spares between raid
4309 arrays when needed.")
4310 (license license:gpl2+)))
4312 (define-public mdadm-static
4315 (name "mdadm-static")
4317 (substitute-keyword-arguments (package-arguments mdadm)
4318 ((#:make-flags flags)
4319 `(cons "LDFLAGS = -static" ,flags))
4321 `(modify-phases ,phases
4322 (add-after 'install 'remove-cruft
4323 (lambda* (#:key outputs #:allow-other-keys)
4324 (let* ((out (assoc-ref outputs "out"))
4325 (precious? (lambda (file)
4326 (member file '("." ".." "sbin"))))
4327 (directories (scandir out (negate precious?))))
4328 (with-directory-excursion out
4329 (for-each delete-file-recursively directories)
4330 (remove-store-references "sbin/mdadm")
4331 (delete-file "sbin/mdmon")
4333 ((#:modules modules %gnu-build-system-modules)
4334 `((ice-9 ftw) ,@modules))
4335 ((#:strip-flags _ '())
4336 ''("--strip-all")) ;strip a few extra KiB
4337 ((#:allowed-references _ '("out"))
4338 '("out")))) ;refer only self
4339 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4341 (define-public multipath-tools
4343 (name "multipath-tools")
4348 (url "https://git.opensvc.com/multipath-tools/.git")
4350 (file-name (git-file-name name version))
4353 "14n8pcgnliicqxzc40xvjxk4cafm4qx7a3rsx5qva74r3ydzx8rn"))
4354 (patches (search-patches "multipath-tools-sans-systemd.patch"))
4355 (modules '((guix build utils)))
4358 ;; Drop bundled valgrind headers.
4359 (delete-file-recursively "third-party")
4360 (substitute* '("multipathd/main.c"
4361 "libmultipath/debug.c")
4362 (("#include \"../third-party/")
4365 (build-system gnu-build-system)
4367 '(#:test-target "test"
4368 #:parallel-build? #f ;XXX: broken in 0.8.4
4369 #:make-flags (list "CC=gcc"
4370 (string-append "DESTDIR="
4371 (assoc-ref %outputs "out"))
4372 ;; Install Udev rules below this directory, relative
4375 (string-append "LDFLAGS=-Wl,-rpath="
4376 (assoc-ref %outputs "out")
4379 (modify-phases %standard-phases
4380 (add-after 'unpack 'patch-source
4381 (lambda* (#:key inputs #:allow-other-keys)
4382 (let ((lvm2 (assoc-ref inputs "lvm2"))
4383 (udev (assoc-ref inputs "udev")))
4384 (substitute* "Makefile.inc"
4385 (("\\$\\(prefix\\)/usr") "$(prefix)")
4386 ;; Do not save timestamp to avoid gzip "timestamp
4387 ;; out-of-range" warnings.
4388 (("gzip -9") "gzip -9n"))
4389 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4390 (("/usr/include/libdevmapper.h")
4391 (string-append lvm2 "/include/libdevmapper.h"))
4392 (("/usr/include/libudev.h")
4393 (string-append udev "/include/libudev.h")))
4395 (add-after 'unpack 'fix-maybe-uninitialized-variable
4397 ;; This variable gets initialized later if needed, but GCC 7
4398 ;; fails to notice. Should be fixed for > 0.8.4.
4399 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4400 (substitute* "libmultipath/structs_vec.c"
4401 (("bool is_queueing;")
4402 "bool is_queueing = false;"))
4404 (add-after 'unpack 'fix-linking-tests
4406 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4407 ;; for versions > 0.8.4.
4408 (substitute* "tests/Makefile"
4409 (("-lmultipath -lcmocka")
4410 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4412 (delete 'configure)))) ; no configure script
4415 ("pkg-config" ,pkg-config)
4416 ("valgrind" ,valgrind)
4419 ("cmocka" ,cmocka)))
4421 `(("json-c" ,json-c-0.13)
4423 ("liburcu" ,liburcu)
4425 ("readline" ,readline)
4427 (home-page "http://christophe.varoqui.free.fr/")
4428 (synopsis "Access block devices through multiple paths")
4430 "This package provides the following binaries to drive the
4431 Linux Device Mapper multipathing driver:
4433 @item @command{multipath} - Device mapper target autoconfig.
4434 @item @command{multipathd} - Multipath daemon.
4435 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4436 @code{dm} multipath devices.
4437 @item @command{kpartx} - Create device maps from partition tables.
4439 (license (list license:gpl2+ ; main distribution
4440 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4442 (define-public libaio
4449 (string-append "https://releases.pagure.org/libaio/"
4450 name "-" version ".tar.gz")))
4453 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4454 (build-system gnu-build-system)
4457 (let ((target ,(%current-target-system)))
4458 (list (string-append "prefix=" %output)
4461 (string-append (assoc-ref %build-inputs "cross-gcc")
4462 "/bin/" target "-gcc")
4464 #:test-target "partcheck" ; need root for a full 'check'
4466 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4467 (home-page "https://pagure.io/libaio")
4468 (synopsis "Linux-native asynchronous I/O access library")
4470 "This library enables userspace to use Linux kernel asynchronous I/O
4471 system calls, important for the performance of databases and other advanced
4473 (license license:lgpl2.1+)))
4475 (define-public blktrace
4476 ;; Take a newer commit to get the fix for CVE-2018-10689.
4477 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4481 (version (git-version "1.2.0" revision commit))
4483 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4490 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4491 (file-name (git-file-name name version))))
4492 (build-system gnu-build-system)
4495 (list ,(string-append "CC=" (cc-for-target))
4496 (string-append "prefix=" %output))
4497 #:tests? #f ; no tests
4499 (modify-phases %standard-phases
4500 (delete 'configure) ; no configure script
4501 (add-after 'unpack 'fix-gnuplot-path
4502 (lambda* (#:key inputs #:allow-other-keys)
4503 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4504 (substitute* "btt/bno_plot.py"
4506 (string-append gnuplot "/bin/gnuplot %s")))
4509 `(("libaio" ,libaio)
4510 ("gnuplot" ,gnuplot)
4511 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4512 (synopsis "Block layer IO tracing mechanism")
4513 (description "Blktrace is a block layer IO tracing mechanism which provides
4514 detailed information about request queue operations to user space. It extracts
4515 event traces from the kernel (via the relaying through the debug file system).")
4516 (license license:gpl2))))
4524 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4528 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4529 (build-system gnu-build-system)
4531 `(("libsndfile" ,libsndfile)))
4533 `(("pkg-config" ,pkg-config)))
4534 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4535 (synopsis "Bluetooth subband audio codec")
4537 "The SBC is a digital audio encoder and decoder used to transfer data to
4538 Bluetooth audio output devices like headphones or loudspeakers.")
4539 (license license:gpl2+)))
4541 (define-public bluez
4548 "mirror://kernel.org/linux/bluetooth/bluez-"
4552 "1p2ncvjz6alr9n3l5wvq2arqgc7xjs6dqyar1l9jp0z8cfgapkb8"))))
4553 (build-system gnu-build-system)
4556 (let ((out (assoc-ref %outputs "out")))
4557 (list "--sysconfdir=/etc"
4558 "--localstatedir=/var"
4561 ;; Install dbus/udev files to the correct location.
4562 (string-append "--with-dbusconfdir=" out "/etc")
4563 (string-append "--with-udevdir=" out "/lib/udev")))
4565 (modify-phases %standard-phases
4566 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4567 ;; issue (discussion on upstream mailing list:
4568 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4569 (add-before 'check 'skip-wonky-test
4571 (substitute* "unit/test-gatt.c"
4572 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4574 (add-after 'install 'post-install
4575 (lambda* (#:key inputs outputs #:allow-other-keys)
4576 (let* ((out (assoc-ref outputs "out"))
4577 (servicedir (string-append out "/share/dbus-1/services"))
4578 (service "obexd/src/org.bluez.obex.service")
4579 (rule (string-append
4580 out "/lib/udev/rules.d/97-hid2hci.rules")))
4581 ;; Install the obex dbus service file.
4582 (substitute* service
4584 (string-append out "/libexec/bluetooth/obexd")))
4585 (install-file service servicedir)
4586 ;; Fix paths in the udev rule.
4588 (("hid2hci --method")
4589 (string-append out "/lib/udev/hid2hci --method"))
4591 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4594 `(("pkg-config" ,pkg-config)
4595 ("gettext" ,gettext-minimal)))
4600 ("libical" ,libical)
4601 ("readline" ,readline)))
4602 (home-page "http://www.bluez.org/")
4603 (synopsis "Linux Bluetooth protocol stack")
4605 "BlueZ provides support for the core Bluetooth layers and protocols. It
4606 is flexible, efficient and uses a modular implementation.")
4607 (license license:gpl2+)))
4609 (define-public fuse-exfat
4616 "https://github.com/relan/exfat/releases/download/v"
4617 version "/" name "-" version ".tar.gz"))
4620 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4621 (build-system gnu-build-system)
4623 `(("pkg-config" ,pkg-config)))
4626 (home-page "https://github.com/relan/exfat")
4627 (synopsis "Mount exFAT file systems")
4629 "This package provides a FUSE-based file system that provides read and
4630 write access to exFAT devices.")
4631 (license license:gpl2+)))
4633 (define-public fuseiso
4636 (version "20070708")
4639 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4640 version "/fuseiso-" version ".tar.bz2"))
4643 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4644 (build-system gnu-build-system)
4646 `(("pkg-config" ,pkg-config)))
4651 (home-page "https://sourceforge.net/projects/fuseiso/")
4652 (synopsis "Mount ISO file system images")
4654 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4655 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4656 Ridge, Joliet, and zisofs.")
4657 (license license:gpl2)))
4666 "https://www.nico.schottelius.org/software/gpm/archives/"
4667 "gpm-" version ".tar.bz2"))
4668 (patches (search-patches "gpm-glibc-2.26.patch"))
4671 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4672 (build-system gnu-build-system)
4674 '(#:phases (modify-phases %standard-phases
4677 ;; The tarball was not generated with 'make dist' so we
4678 ;; need to bootstrap things ourselves.
4679 (substitute* "autogen.sh"
4680 (("/bin/sh") (which "sh")))
4681 (invoke "./autogen.sh")
4682 (patch-makefile-SHELL "Makefile.include.in")
4685 ;; Make sure programs find libgpm.so.
4686 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4687 (assoc-ref %outputs "out")
4690 `(("texinfo" ,texinfo)
4693 ("autoconf" ,autoconf)
4694 ("automake" ,automake)
4695 ("libtool" ,libtool)))
4696 (home-page "https://www.nico.schottelius.org/software/gpm/")
4697 (synopsis "Mouse support for the Linux console")
4699 "The GPM (general-purpose mouse) daemon is a mouse server for
4700 applications running on the Linux console. It allows users to select items
4701 and copy/paste text in the console and in xterm.")
4702 (license license:gpl2+)))
4704 (define-public btrfs-progs
4706 (name "btrfs-progs")
4710 (uri (string-append "mirror://kernel.org/linux/kernel/"
4711 "people/kdave/btrfs-progs/"
4712 "btrfs-progs-v" version ".tar.xz"))
4715 "0p6ycbr8sw5bq3mj84gh9rvh5sk8sjr2l9hb9dhm4j41ij5h8bsw"))))
4716 (build-system gnu-build-system)
4718 "static")) ; static versions of the binaries in "out"
4720 '(#:phases (modify-phases %standard-phases
4721 (add-after 'unpack 'patch-makefile
4722 (lambda* (#:key outputs #:allow-other-keys)
4723 (substitute* "Makefile"
4724 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4725 (string-append (assoc-ref outputs "out")
4726 "/lib/udev/rules.d")))
4728 (add-after 'build 'build-static
4729 (lambda _ (invoke "make" "static")))
4730 (add-after 'install 'install-bash-completion
4731 (lambda* (#:key outputs #:allow-other-keys)
4732 (let* ((out (assoc-ref outputs "out"))
4733 (bashcomp (string-append out "/etc/bash_completion.d")))
4735 (copy-file "btrfs-completion"
4736 (string-append bashcomp "/btrfs"))
4738 (add-after 'install 'install-static
4739 (let ((staticbin (string-append (assoc-ref %outputs "static")
4743 (string-append "bindir=" staticbin)
4744 "install-static")))))
4745 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4746 #:test-target "test"
4747 #:parallel-tests? #f)) ; tests fail when run in parallel
4748 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4750 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
4751 ("util-linux:static" ,util-linux "static") ;ditto
4753 ("zlib:static" ,zlib "static")
4754 ("zstd" ,zstd "lib")
4755 ("zstd:static" ,zstd "static")))
4756 (native-inputs `(("pkg-config" ,pkg-config)
4757 ("asciidoc" ,asciidoc)
4760 ;; For building documentation.
4761 ("libxml2" ,libxml2)
4762 ("docbook-xsl" ,docbook-xsl)
4768 ;; The tests need 'grep' with perl regexp support.
4770 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4771 (synopsis "Create and manage btrfs copy-on-write file systems")
4772 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4773 aimed at implementing advanced features while focusing on fault tolerance,
4774 repair and easy administration.")
4775 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4776 ;; GPL2: Everything else.
4777 (license (list license:gpl2 license:gpl2+))))
4779 (define-public btrfs-progs/static
4781 (name "btrfs-progs-static")
4782 (version (package-version btrfs-progs))
4784 (build-system trivial-build-system)
4786 `(("btrfs-progs:static" ,btrfs-progs "static")))
4788 `(#:modules ((guix build utils))
4791 (use-modules (guix build utils)
4795 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4796 (out (assoc-ref %outputs "out"))
4797 (source (string-append btrfs "/bin/btrfs.static"))
4798 (target (string-append out "/bin/btrfs")))
4799 (mkdir-p (dirname target))
4800 (copy-file source target)
4801 (remove-store-references target)
4802 (chmod target #o555)
4804 (home-page (package-home-page btrfs-progs))
4805 (synopsis "Statically-linked btrfs command from btrfs-progs")
4806 (description "This package provides the statically-linked @command{btrfs}
4807 from the btrfs-progs package. It is meant to be used in initrds.")
4808 (license (package-license btrfs-progs))))
4810 (define-public cramfs-tools
4812 (name "cramfs-tools")
4813 (home-page "https://github.com/npitre/cramfs-tools")
4819 (commit (string-append "v" version))))
4821 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
4822 (file-name (git-file-name name version))))
4823 (build-system gnu-build-system)
4825 '(#:tests? #f ; No tests.
4827 (modify-phases %standard-phases
4830 (lambda* (#:key outputs #:allow-other-keys)
4831 (let ((out (assoc-ref outputs "out")))
4832 (install-file "mkcramfs" (string-append out "/sbin"))
4833 (install-file "cramfsck" (string-append out "/sbin")))
4837 (synopsis "Tools to manage Cramfs file systems")
4838 (description "Cramfs is a Linux file system designed to be simple, small,
4839 and to compress things well. It is used on a number of embedded systems and
4840 small devices. This version has additional features such as uncompressed
4841 blocks and random block placement.")
4842 (license license:gpl2+)))
4844 (define-public compsize
4848 (home-page "https://github.com/kilobyte/compsize")
4853 (commit (string-append "v" version))))
4855 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4856 (file-name (git-file-name name version))))
4857 (build-system gnu-build-system)
4859 `(("btrfs-progs" ,btrfs-progs)))
4861 `(#:tests? #f ; No tests.
4862 #:make-flags (list "CC=gcc")
4864 (modify-phases %standard-phases
4867 (lambda* (#:key outputs #:allow-other-keys)
4868 (let ((out (assoc-ref outputs "out")))
4869 (install-file "compsize" (string-append out "/bin"))
4870 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4871 (synopsis "Find compression type/ratio on Btrfs files")
4872 (description "@command{compsize} takes a list of files (given as
4873 arguments) on a Btrfs file system and measures used compression types and
4874 effective compression ratio, producing a report.
4876 A directory has no extents but has a (recursive) list of files. A non-regular
4877 file is silently ignored.
4879 As it makes no sense to talk about compression ratio of a partial extent,
4880 every referenced extent is counted whole, exactly once -- no matter if you use
4881 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4882 uncompressed size will not match the number given by @command{tar} or
4883 @command{du}. On the other hand, the space used should be accurate (although
4884 obviously it can be shared with files outside our set).")
4885 (license license:gpl2+)))
4887 (define-public f2fs-tools-1.7
4894 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4895 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4898 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4900 (build-system gnu-build-system)
4903 (modify-phases %standard-phases
4904 (add-after 'install 'install-headers
4905 (lambda* (#:key outputs #:allow-other-keys)
4906 (let* ((out (assoc-ref outputs "out"))
4907 (out-include (string-append out "/include")))
4908 (install-file "include/f2fs_fs.h" out-include)
4909 (install-file "mkfs/f2fs_format_utils.h" out-include)
4912 `(("autoconf" ,autoconf)
4913 ("automake" ,automake)
4914 ("libtool" ,libtool)
4915 ("pkg-config" ,pkg-config)))
4917 `(("libuuid" ,util-linux "lib")
4918 ("libselinux" ,libselinux)))
4919 (home-page "https://f2fs.wiki.kernel.org/")
4920 (synopsis "Userland tools for f2fs")
4922 "F2FS, the Flash-Friendly File System, is a modern file system
4923 designed to be fast and durable on flash devices such as solid-state
4924 disks and SD cards. This package provides the userland utilities.")
4925 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4926 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4927 (license (list license:gpl2 license:lgpl2.1))))
4929 (define-public f2fs-tools
4931 (inherit f2fs-tools-1.7)
4937 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4938 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4941 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4943 `(("libuuid" ,util-linux "lib")))))
4945 (define-public f2fs-tools/static
4948 (inherit f2fs-tools)
4949 (name "f2fs-tools-static")
4952 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
4953 (libuuid (assoc-ref %build-inputs "libuuid")))
4955 (string-append "libuuid_CFLAGS=-I" libuuid "/include")
4956 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
4957 (string-append "libblkid_CFLAGS=-I" libuuid "/include")
4958 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
4959 #:disallowed-references (,util-linux)
4961 (modify-phases %standard-phases ; TODO: f2fs phases.
4962 (add-after 'unpack 'make-static
4964 (define (append-to-file name body)
4965 (let ((file (open-file name "a")))
4968 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
4969 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
4970 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
4972 (add-after 'install 'remove-store-references
4973 (lambda* (#:key outputs #:allow-other-keys)
4974 ;; Work around bug in our util-linux.
4975 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
4976 (remove-store-references (string-append (assoc-ref outputs "out")
4980 `(("libuuid:static" ,util-linux "static")
4981 ("libuuid" ,util-linux "lib")))))) ; for include files
4983 (define-public f2fs-fsck/static
4985 (name "f2fs-fsck-static")
4986 (version (package-version f2fs-tools/static))
4988 (build-system trivial-build-system)
4990 `(#:modules ((guix build utils))
4993 (use-modules (guix build utils)
4996 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
4998 (out (assoc-ref %outputs "out"))
4999 (sbin (string-append out "/sbin")))
5001 (with-directory-excursion sbin
5002 (install-file (string-append f2fs-tools "/sbin/" fsck)
5004 (remove-store-references fsck)
5008 `(("f2fs-tools-static" ,f2fs-tools/static)))
5009 (home-page (package-home-page f2fs-tools/static))
5010 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5011 (description "This package provides statically-linked fsck.f2fs command taken
5012 from the f2fs-tools package. It is meant to be used in initrds.")
5013 (license (package-license f2fs-tools/static))))
5015 (define-public freefall
5018 (version (package-version linux-libre))
5019 (source (package-source linux-libre))
5020 (build-system gnu-build-system)
5022 '(#:phases (modify-phases %standard-phases
5023 (add-after 'unpack 'enter-subdirectory
5025 (chdir "tools/laptop/freefall")
5028 (add-before 'build 'increase-timeout
5030 ;; The default of 2 seconds is too low: it assumes an
5031 ;; open lid and AC power without actually checking.
5032 (substitute* "freefall.c"
5033 (("alarm\\(2\\)") "alarm(5)"))
5035 #:make-flags (list (string-append "PREFIX="
5036 (assoc-ref %outputs "out"))
5038 #:tests? #f)) ;no tests
5039 (home-page (package-home-page linux-libre))
5040 (synopsis "Free-fall protection for spinning laptop hard drives")
5042 "Prevents shock damage to the internal spinning hard drive(s) of some
5043 HP and Dell laptops. When sudden movement is detected, all input/output
5044 operations on the drive are suspended and its heads are parked on the ramp,
5045 where they are less likely to cause damage to the spinning disc. Requires a
5046 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5047 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5048 (license license:gpl2)))
5050 (define-public thinkfan
5058 (url "https://github.com/vmatare/thinkfan")
5060 (file-name (git-file-name name version))
5062 (base32 "0vmkpj575a1w52zx1jn6kdrk8rc9vp0f1bldi1bajicpgbs6rjd3"))))
5063 (build-system cmake-build-system)
5065 `(#:modules ((guix build cmake-build-system)
5068 #:tests? #f ; no test target
5070 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5071 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5073 `("-DUSE_ATASMART:BOOL=ON")
5075 (modify-phases %standard-phases
5076 (add-after 'unpack 'create-init-scripts
5077 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5078 ;; systemd to patch and install their service files. Fake their
5079 ;; presence rather than duplicating the build system below. Leave
5080 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5081 ;; The sysvinit needs manual patching, but since upstream doesn't
5082 ;; even provide the option to install it: don't.
5083 (lambda* (#:key outputs #:allow-other-keys)
5084 (let* ((out (assoc-ref outputs "out"))
5085 (share (string-append out "/share/" ,name)))
5086 (substitute* "CMakeLists.txt"
5087 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5088 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5089 ;; That was easy! Now we just need to fix the destinations.
5091 (string-append out directory)))
5094 `(("pkg-config" ,pkg-config)))
5096 `(("libatasmart" ,libatasmart)
5097 ("yaml-cpp" ,yaml-cpp)))
5098 (home-page "https://github.com/vmatare/thinkfan")
5099 (synopsis "Simple fan control program")
5101 "Thinkfan is a simple fan control program. It reads temperatures,
5102 checks them against configured limits and switches to appropriate (also
5103 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5104 other @code{hwmon} driver that enables temperature reading and fan control
5106 (license license:gpl3+)))
5108 (define-public tpacpi-bat
5116 (url "https://github.com/teleshoes/tpacpi-bat")
5117 (commit (string-append "v" version))))
5118 (file-name (git-file-name name version))
5120 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5121 (build-system gnu-build-system)
5123 `(#:tests? #f ; no test target
5125 (modify-phases %standard-phases
5126 (add-after 'unpack 'refer-to-inputs
5128 (substitute* "tpacpi-bat"
5130 (format #f "~a " (which "cat")))
5131 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5132 ;; loaded. That's the administrator's prerogative; disable it.
5133 (("system \"(modprobe .*)\"" _ match)
5134 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5136 (delete 'configure) ; nothing to configure
5137 (delete 'build) ; nothing to build
5139 (lambda* (#:key outputs #:allow-other-keys)
5140 (let* ((out (assoc-ref outputs "out"))
5141 (bin (string-append out "/bin"))
5142 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5143 (install-file "tpacpi-bat" bin)
5145 ;; There's no man page. Install other forms of documentation.
5146 (for-each (lambda (file)
5147 (let ((target (string-append doc "/" file)))
5148 (mkdir-p (dirname target))
5149 (copy-recursively file target)))
5150 (list "battery_asl" "examples" "README.md"))
5154 (home-page "https://github.com/teleshoes/tpacpi-bat")
5155 (synopsis "ThinkPad battery charge controller")
5157 "Tpacpi-bat is a command-line interface to control battery charging on
5158 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5159 ThinkPad models released after 2011}, starting with the xx20 series. It can
5160 query and set the thresholds at which one or both batteries will start and stop
5161 charging, inhibit charging batteries for a set period of time, or force them to
5162 discharge when they otherwise would not.
5164 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5165 kernel module provided by the @code{acpi-call-linux-module} package, which must
5166 be installed and loaded separately. Only the original vendor firmware is
5168 (license license:gpl3+)))
5170 (define-public ntfs-3g
5173 (version "2017.3.23")
5176 (uri (string-append "https://tuxera.com/opensource/"
5177 "ntfs-3g_ntfsprogs-" version ".tgz"))
5178 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5181 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5182 (modules '((guix build utils)))
5184 ;; Install under $prefix.
5185 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5189 (build-system gnu-build-system)
5190 (inputs `(("util-linux" ,util-linux)
5191 ("fuse" ,fuse))) ;libuuid
5192 (native-inputs `(("pkg-config" ,pkg-config)))
5194 '(#:configure-flags (list "--exec-prefix=${prefix}"
5195 "--with-fuse=external" ;use our own FUSE
5196 "--enable-mount-helper"
5197 "--enable-posix-acls"
5198 "--enable-xattr-mappings")
5200 (modify-phases %standard-phases
5201 ;; If users install ntfs-3g, they probably want to make it the
5202 ;; default driver as well, so we opt for sensible defaults and link
5203 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5204 ;; mount NTFS file systems.)
5205 (add-after 'install 'install-link
5206 (lambda* (#:key outputs #:allow-other-keys)
5207 (let* ((out (assoc-ref outputs "out"))
5208 (sbin (string-append out "/sbin")))
5209 (symlink "mount.ntfs-3g"
5210 (string-append sbin "/mount.ntfs")))
5212 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5213 (synopsis "Read-write access to NTFS file systems")
5215 "NTFS-3G provides read-write access to NTFS file systems, which are
5216 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5217 The package provides additional NTFS tools.")
5218 (license license:gpl2+)))
5220 (define-public rdma-core
5226 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5227 "/releases/download/v" version "/rdma-core-"
5231 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
5232 (build-system cmake-build-system)
5234 `(#:tests? #f ; no tests
5235 ;; Upstream uses the "ninja" build system and encourage distros
5236 ;; to do the same for consistency. They also recommend using the
5237 ;; "Release" build type.
5238 #:build-type "Release"
5239 #:configure-flags (list "-GNinja"
5241 (string-append "-DRST2MAN_EXECUTABLE="
5242 (assoc-ref %build-inputs
5246 ;; On some configurations, the
5247 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
5248 ;; used by default, would return ENODEV. To
5249 ;; avoid that, use 'write' instead of ioctls,
5250 ;; as suggested in 'CMakeList.txt'.
5251 "-DIOCTL_MODE=write")
5253 (modify-phases %standard-phases
5257 "-j" (number->string (parallel-job-count)))))
5260 (invoke "ninja" "install"))))))
5263 ("pkg-config" ,pkg-config)
5264 ("python" ,python-wrapper)
5265 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5269 (home-page "https://github.com/linux-rdma/rdma-core")
5270 (synopsis "Utilities and libraries for working with RDMA devices")
5272 "This package provides userspace components for the InfiniBand
5273 subsystem of the Linux kernel. Specifically it contains userspace
5274 libraries for the following device nodes:
5277 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5278 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5279 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5282 The following service daemons are also provided:
5284 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5285 @item @code{iwpmd} (for iWARP kernel providers)
5286 @item @code{ibacm} (for InfiniBand communication management assistant)
5288 ;; All library code is dual licensed under GPL2 and a custom MIT
5289 ;; variant. The package also includes some components covered by
5290 ;; other licenses. Consult COPYING.md for full details.
5293 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5294 license:bsd-2 ; Files referring to COPYING.BSD_FB
5295 license:cc0 ; most files in ccan/
5296 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5298 (define-public perftest
5305 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5306 version "/perftest-" version ".g0927198.tar.gz"))
5308 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5309 (build-system gnu-build-system)
5312 (modify-phases %standard-phases
5313 (add-after 'unpack 'patch-header-paths
5315 (substitute* '("src/raw_ethernet_fs_rate.c"
5316 "src/raw_ethernet_resources.c"
5317 "src/raw_ethernet_resources.h"
5318 "src/raw_ethernet_send_burst_lat.c"
5319 "src/raw_ethernet_send_bw.c"
5320 "src/raw_ethernet_send_lat.c")
5321 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5323 (inputs `(("rdma-core" ,rdma-core)))
5324 (home-page "https://github.com/linux-rdma/perftest/")
5325 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5326 (description "This is a collection of tests written over uverbs intended for
5327 use as a performance micro-benchmark. The tests may be used for hardware or
5328 software tuning as well as for functional testing.
5330 The collection contains a set of bandwidth and latency benchmark such as:
5332 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5333 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5334 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5335 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5336 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5338 (license license:gpl2)))
5340 (define-public rng-tools
5343 (home-page "https://github.com/nhorman/rng-tools")
5347 (uri (git-reference (url home-page)
5348 (commit (string-append "v" version))))
5349 (file-name (git-file-name name version))
5352 "0hbml37yxs0fs69g7f2x4ixq61z0029swy99rn7ykma9mi6b7ni9"))))
5353 (build-system gnu-build-system)
5355 `(;; Disable support for various hardware entropy sources as they need
5356 ;; dependencies that are not yet in Guix, and would significantly
5357 ;; increase closure size.
5358 #:configure-flags '("--without-nistbeacon"
5360 "--without-rtlsdr")))
5362 `(("autoconf" ,autoconf)
5363 ("automake" ,automake)
5364 ("pkg-config" ,pkg-config)))
5366 `(("libsysfs" ,sysfsutils)
5367 ("openssl" ,openssl)))
5368 (synopsis "Random number generator daemon")
5370 "Monitor a hardware random number generator, and supply entropy
5371 from that to the system kernel's @file{/dev/random} machinery.")
5372 ;; The source package is offered under the GPL2+, but the files
5373 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5374 (license (list license:gpl2 license:gpl2+))))
5376 (define-public cpupower
5379 (version (package-version linux-libre))
5380 (source (package-source linux-libre))
5381 (build-system gnu-build-system)
5383 '(#:phases (modify-phases %standard-phases
5384 (add-after 'unpack 'enter-subdirectory
5386 (chdir "tools/power/cpupower")
5389 (add-before 'build 'fix-makefiles
5391 (substitute* "Makefile"
5393 (("/bin/(install|pwd)" _ command) command))
5394 (substitute* "bench/Makefile"
5395 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5397 #:make-flags (let ((out (assoc-ref %outputs "out")))
5398 (list (string-append "DESTDIR=" out)
5399 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5401 "docdir=/share/doc/cpupower"
5402 "confdir=$(docdir)/examples"
5403 ;; The Makefile recommends the following changes
5405 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5406 #:tests? #f)) ;no tests
5407 (native-inputs `(("gettext" ,gettext-minimal)))
5408 (inputs `(("pciutils" ,pciutils)))
5409 (home-page (package-home-page linux-libre))
5410 (synopsis "CPU frequency and voltage scaling tools for Linux")
5412 "cpupower is a set of user-space tools that use the cpufreq feature of the
5413 Linux kernel to retrieve and control processor features related to power saving,
5414 such as frequency and voltage scaling.")
5415 (license license:gpl2)))
5417 (define-public x86-energy-perf-policy
5419 (name "x86-energy-perf-policy")
5420 (version (package-version linux-libre))
5421 (source (package-source linux-libre))
5422 (build-system gnu-build-system)
5426 (modify-phases %standard-phases
5427 (add-after 'unpack 'enter-subdirectory
5429 (chdir "tools/power/x86/x86_energy_perf_policy")
5432 (add-before 'build 'fix-makefile
5434 (substitute* "Makefile" (("/usr") ""))
5437 (let ((out (assoc-ref %outputs "out")))
5438 (list (string-append "DESTDIR=" out)
5439 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5440 (supported-systems '("i686-linux" "x86_64-linux"))
5441 (home-page (package-home-page linux-libre))
5442 (synopsis "Display and update Intel-CPU energy-performance policy")
5444 "@command{x86_energy_perf_policy} displays and updates energy-performance
5445 policy settings specific to Intel Architecture Processors. Settings are
5446 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5447 cpufreq sub-system is enabled or not.")
5448 (license license:gpl2)))
5450 (define-public haveged
5458 (url "https://github.com/jirka-h/haveged")
5459 (commit (string-append "v" version))))
5460 (file-name (git-file-name name version))
5462 (base32 "0g3hcvpky76cabgcfqh65fay7nnjkms32sgmlf33q969833hijqz"))))
5463 (build-system gnu-build-system)
5464 (home-page "https://www.issihosts.com/haveged")
5465 (synopsis "Entropy source for the Linux random number generator")
5467 "haveged generates an unpredictable stream of random numbers for use by
5468 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5469 standard mechanisms for filling the entropy pool may not be sufficient for
5470 systems with high needs or limited user interaction, such as headless servers.
5472 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5473 indirect effects of hardware events on hidden processor state using the
5474 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5475 It tunes itself to its environment and provides the same built-in test suite
5476 for the output stream as used on certified hardware security devices.
5478 The quality of the randomness produced by this algorithm has not been proven.
5479 It is recommended to run it together with another entropy source like rngd, and
5480 not as a replacement for it.")
5481 (license (list (license:non-copyleft "file://nist/mconf.h")
5482 (license:non-copyleft "file://nist/packtest.c")
5483 license:public-domain ; nist/dfft.c
5484 license:gpl3+)))) ; everything else
5486 (define-public ecryptfs-utils
5488 (name "ecryptfs-utils")
5493 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5494 version "/+download/ecryptfs-utils_"
5495 version ".orig.tar.gz"))
5498 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5499 (build-system gnu-build-system)
5501 `(#:configure-flags (list "--disable-pywrap")
5503 (modify-phases %standard-phases
5504 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5505 (lambda* (#:key inputs outputs #:allow-other-keys)
5506 (let ((out (assoc-ref outputs "out"))
5507 (utils-linux (assoc-ref inputs "utils-linux"))
5508 (cryptsetup (assoc-ref inputs "cryptsetup"))
5509 (linux-pam (assoc-ref inputs "linux-pam"))
5510 (lvm2 (assoc-ref inputs "lvm2")))
5511 (substitute* '("src/utils/ecryptfs-mount-private"
5512 "src/utils/ecryptfs-umount-private"
5513 "src/utils/ecryptfs-setup-private"
5514 "src/utils/ecryptfs-setup-swap"
5515 "src/utils/mount.ecryptfs.c"
5516 "src/utils/umount.ecryptfs.c"
5517 "src/pam_ecryptfs/pam_ecryptfs.c"
5518 "src/desktop/ecryptfs-mount-private.desktop.in"
5519 "src/desktop/ecryptfs-setup-private.desktop.in")
5521 (string-append utils-linux "/bin/mount"))
5523 (string-append utils-linux "/bin/umount"))
5524 (("/sbin/mount.ecryptfs_private")
5525 (string-append out "/sbin/mount.ecryptfs_private"))
5526 (("/sbin/umount.ecryptfs_private")
5527 (string-append out "/sbin/umount.ecryptfs_private"))
5528 (("/usr/bin/ecryptfs-mount-private")
5529 (string-append out "/bin/ecryptfs-mount-private"))
5530 (("/usr/bin/ecryptfs-rewrite-file")
5531 (string-append out "/bin/ecryptfs-rewrite-file"))
5532 (("/usr/bin/ecryptfs-setup-private")
5533 (string-append out "/bin/ecryptfs-setup-private"))
5534 (("/sbin/cryptsetup")
5535 (string-append cryptsetup "/sbin/cryptsetup"))
5536 (("/sbin/unix_chkpwd")
5537 (string-append linux-pam "/sbin/unix_chkpwd"))
5539 (string-append lvm2 "/sbin/dmsetup")))))))))
5541 `(("intltool" ,intltool)
5542 ("perl" ,perl) ; for pod2man
5543 ("pkg-config" ,pkg-config)))
5545 `(("keyutils" ,keyutils)
5546 ("linux-pam" ,linux-pam)
5547 ("utils-linux" ,util-linux)
5548 ("cryptsetup" ,cryptsetup)
5551 (home-page "https://ecryptfs.org/")
5552 (synopsis "eCryptfs cryptographic file system utilities")
5554 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5555 Each file's cryptographic meta-data is stored inside the file itself, along
5556 with the encrypted contents. This allows individual encrypted files to be
5557 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5558 native Linux file system, and has been part of the Linux kernel since version
5559 2.6.19. This package contains the userland utilities to manage it.")
5560 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5561 ;; grant additional permission to link with OpenSSL.
5562 (license license:gpl2+)))
5564 (define-public libnfsidmap
5566 (name "libnfsidmap")
5571 (uri (string-append "https://fedorapeople.org/~steved/"
5572 name "/" version "/" name "-" version ".tar.bz2"))
5574 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5575 (build-system gnu-build-system)
5577 `(#:configure-flags (list
5578 (string-append "--with-pluginpath="
5579 (assoc-ref %outputs "out")
5580 "/lib/libnfsidmap"))))
5582 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5584 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5585 (synopsis "NFSv4 support library for name/ID mapping")
5586 (description "Libnfsidmap is a library holding mulitiple methods of
5587 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5588 extensible array of mapping functions, currently consisting of two choices:
5589 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5590 (license (license:non-copyleft "file://COPYING"
5591 "See COPYING in the distribution."))))
5593 (define-public module-init-tools
5595 (name "module-init-tools")
5600 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5601 "module-init-tools-" version ".tar.bz2"))
5604 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5605 (patches (search-patches "module-init-tools-moduledir.patch"))))
5606 (build-system gnu-build-system)
5608 ;; FIXME: The upstream tarball lacks man pages, and building them would
5609 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5610 ;; but they vanished. In the meantime, fake it.
5612 (modify-phases %standard-phases
5613 (add-before 'configure 'fake-docbook
5615 (substitute* "Makefile.in"
5616 (("^DOCBOOKTOMAN.*$")
5617 "DOCBOOKTOMAN = true\n"))
5619 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5620 (synopsis "Tools for loading and managing Linux kernel modules")
5622 "Tools for loading and managing Linux kernel modules, such as
5623 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5624 (license license:gpl2+)))
5626 (define-public mcelog
5632 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5633 "mcelog.git/snapshot/v" version ".tar.gz"))
5636 "1m11v1y7cvpm7hwsghj23z77ps1w5jzn8000iwiyxpb939h2km5l"))
5637 (file-name (string-append name "-" version ".tar.gz"))
5638 (modules '((guix build utils)))
5641 ;; The snapshots lack a .git directory,
5642 ;; breaking ‘git describe’.
5643 (substitute* "Makefile"
5644 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5646 (build-system gnu-build-system)
5648 `(#:phases (modify-phases %standard-phases
5649 (delete 'configure)) ; no configure script
5650 #:make-flags (let ((out (assoc-ref %outputs "out")))
5652 (string-append "prefix=" out)
5653 (string-append "DOCDIR=" out "/share/doc/"
5655 "etcprefix=$(DOCDIR)/examples"))
5656 ;; The tests will only run as root on certain supported CPU models.
5658 (supported-systems (list "i686-linux" "x86_64-linux"))
5659 (home-page "https://mcelog.org/")
5660 (synopsis "Machine check monitor for x86 Linux systems")
5662 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
5663 systems running the kernel Linux. It can also perform user-defined tasks, such
5664 as bringing bad pages off-line, when configurable error thresholds are
5666 (license license:gpl2)))
5668 (define-public mtd-utils
5675 "ftp://ftp.infradead.org/pub/mtd-utils/"
5676 "mtd-utils-" version ".tar.bz2"))
5679 "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
5681 '(#:configure-flags '("--enable-unit-tests")))
5683 `(("cmocka" ,cmocka)
5684 ("pkg-config" ,pkg-config)))
5686 `(("acl" ,acl) ; extended attributes (xattr)
5687 ("libuuid" ,util-linux "lib")
5689 ("openssl" ,openssl) ; optional crypto support
5691 ("zstd" ,zstd "lib")))
5692 (build-system gnu-build-system)
5693 (synopsis "MTD Flash Storage Utilities")
5694 (description "This package provides utilities for testing, partitioning, etc
5696 (home-page "http://www.linux-mtd.infradead.org/")
5698 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5699 license:mpl1.1 ; All ftl* files
5700 license:expat)))) ; libiniparser
5702 (define-public libseccomp
5708 (uri (string-append "https://github.com/seccomp/libseccomp/"
5709 "releases/download/v" version
5710 "/libseccomp-" version ".tar.gz"))
5713 "1wql62cg8f95cwpy057cl764nni9g4sdn5lqj68x22kjs8w71yhz"))))
5714 (build-system gnu-build-system)
5716 '(#:configure-flags '("--disable-static")
5717 #:phases (modify-phases %standard-phases
5718 (add-before 'check 'skip-load-test
5720 ;; This test does a native system call and fails when
5721 ;; run under QEMU user-mode emulation. Just skip it.
5722 (delete-file "tests/52-basic-load.tests")
5727 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5728 (description "The libseccomp library provides an easy to use, platform
5729 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5730 libseccomp API is designed to abstract away the underlying BPF based syscall
5731 filter language and present a more conventional function-call based filtering
5732 interface that should be familiar to, and easily adopted by, application
5734 (home-page "https://github.com/seccomp/libseccomp")
5735 (license license:lgpl2.1)))
5737 (define-public radeontop
5745 (url "https://github.com/clbr/radeontop")
5746 (commit (string-append "v" version))))
5747 (file-name (git-file-name name version))
5749 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5750 (build-system gnu-build-system)
5752 `(#:phases (modify-phases %standard-phases
5753 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5754 ;; dependency, and doesn't even work on release(!) tarballs.
5755 (add-after 'unpack 'report-correct-version
5757 (substitute* "getver.sh"
5759 (string-append "ver=" ,version)))
5761 (delete 'configure)) ; no configure script
5762 #:make-flags (list "CC=gcc"
5763 (string-append "PREFIX=" %output))
5764 #:tests? #f)) ; no tests
5766 `(("gettext" ,gettext-minimal)
5767 ("pkg-config" ,pkg-config)))
5769 `(("libdrm" ,libdrm)
5770 ("libpciaccess" ,libpciaccess)
5772 ("ncurses" ,ncurses)))
5773 (home-page "https://github.com/clbr/radeontop/")
5774 (synopsis "Usage monitor for AMD Radeon graphics")
5775 (description "RadeonTop monitors resource consumption on supported AMD
5776 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5777 a terminal or saved to a file for further processing. It measures both the
5778 activity of the GPU as a whole, which is also accurate during OpenCL
5779 computations, as well as separate component statistics that are only meaningful
5780 under OpenGL graphics workloads.")
5781 (license license:gpl3)))
5783 (define-public efivar
5789 (uri (string-append "https://github.com/rhboot/" name
5790 "/releases/download/" version "/" name
5791 "-" version ".tar.bz2"))
5794 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5795 (build-system gnu-build-system)
5797 `(;; Tests require a UEFI system and is not detected in the chroot.
5799 #:make-flags (list (string-append "prefix=" %output)
5800 (string-append "libdir=" %output "/lib")
5802 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5804 (modify-phases %standard-phases
5805 (delete 'configure))))
5807 `(("pkg-config" ,pkg-config)))
5810 (home-page "https://github.com/rhboot/efivar")
5811 (synopsis "Tool and library to manipulate EFI variables")
5812 (description "This package provides a library and a command line
5813 interface to the variable facility of UEFI boot firmware.")
5814 (license license:lgpl2.1+)))
5816 (define-public efibootmgr
5822 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5823 "/releases/download/" version "/efibootmgr"
5824 "-" version ".tar.bz2"))
5827 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5828 (build-system gnu-build-system)
5830 `(#:tests? #f ;no tests
5831 #:make-flags (list (string-append "prefix=" %output)
5832 (string-append "libdir=" %output "/lib")
5833 ;; EFIDIR denotes a subdirectory relative to the
5834 ;; EFI System Partition where the loader will be
5835 ;; installed (known as OS_VENDOR in the code).
5836 ;; GRUB overrides this, as such it's only used if
5837 ;; nothing else is specified on the command line.
5839 #:phases (modify-phases %standard-phases (delete 'configure))))
5841 `(("pkg-config" ,pkg-config)))
5843 `(("efivar" ,efivar)
5845 (home-page "https://github.com/rhinstaller/efibootmgr")
5846 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5848 "@code{efibootmgr} is a user-space application to modify the Intel
5849 Extensible Firmware Interface (EFI) Boot Manager. This application can
5850 create and destroy boot entries, change the boot order, change the next
5851 running boot option, and more.")
5852 (license license:gpl2+)))
5854 (define-public sysstat
5860 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5861 "sysstat-" version ".tar.xz"))
5864 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
5865 (build-system gnu-build-system)
5867 `(#:tests? #f ; No test suite.
5868 ;; Without this flag, it tries to install the man pages with group 'root'
5869 ;; and fails because /etc/passwd lacks an entry for the root user.
5871 (list "--disable-file-attr"
5872 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5874 (modify-phases %standard-phases
5875 ;; The build process tries to create '/var/lib/sa', so we skip that
5877 (add-after 'build 'skip-touching-var
5879 (substitute* "Makefile"
5880 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5883 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5884 (synopsis "Performance monitoring tools for Linux")
5885 (description "The sysstat utilities are a collection of performance
5886 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5887 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5888 @code{sadf} and @code{sa}.")
5889 (license license:gpl2+)))
5891 (define-public light
5899 (url "https://github.com/haikarainen/light")
5900 (commit (string-append "v" version))))
5902 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
5903 (file-name (git-file-name name version))))
5904 (build-system gnu-build-system)
5907 (modify-phases %standard-phases
5908 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5909 (lambda* (#:key inputs #:allow-other-keys)
5910 (substitute* "90-backlight.rules"
5911 (("/bin/chgrp") (which "chgrp"))
5912 (("/bin/chmod") (which "chmod")))
5914 (add-after 'install 'install-udev-rules
5915 (lambda* (#:key outputs #:allow-other-keys)
5916 (let ((out (assoc-ref outputs "out")))
5918 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5921 `(("autoconf" ,autoconf)
5922 ("automake" ,automake)))
5923 (home-page "https://haikarainen.github.io/light/")
5924 (synopsis "GNU/Linux application to control backlights")
5926 "Light is a program to send commands to screen backlight controllers
5927 under GNU/Linux. Features include:
5930 @item It does not rely on X.
5931 @item Light can automatically figure out the best controller to use, making
5932 full use of underlying hardware.
5933 @item It is possible to set a minimum brightness value, as some controllers
5934 set the screen to be pitch black at a vaĺue of 0 (or higher).
5937 Light is the successor of lightscript.")
5938 (license license:gpl3+)))
5940 (define-public brightnessctl
5941 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5943 (name "brightnessctl")
5944 (version (git-version "0.4" "0" commit))
5948 (url "https://github.com/Hummer12007/brightnessctl/")
5950 (file-name (git-file-name name version))
5953 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5954 (build-system gnu-build-system)
5956 '(#:tests? #f ; no tests
5957 #:make-flags (list "CC=gcc"
5958 (string-append "PREFIX=" %output)
5959 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5961 (modify-phases %standard-phases
5963 (add-after 'unpack 'adjust-udev-rules
5965 (substitute* "90-brightnessctl.rules"
5966 (("/bin/") "/run/current-system/profile/bin/"))
5968 (home-page "https://github.com/Hummer12007/brightnessctl")
5969 (synopsis "Backlight and LED brightness control")
5971 "This program allows you read and control device brightness. Devices
5972 include backlight and LEDs. It can also preserve current brightness before
5973 applying the operation, such as on lid close.
5975 The appropriate permissions must be set on the backlight or LED control
5976 interface in sysfs, which can be accomplished with the included udev rules.")
5977 (license license:expat))))
5987 (url "https://github.com/linrunner/TLP")
5989 (file-name (git-file-name name version))
5991 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
5993 `(("shellcheck" ,shellcheck)))
5997 ("ethtool" ,ethtool)
6001 ("inetutils" ,inetutils)
6004 ("pciutils" ,pciutils)
6008 ("usbutils" ,usbutils)
6009 ("util-linux" ,util-linux)
6010 ("wireless-tools" ,wireless-tools)
6011 ,@(if (let ((system (or (%current-target-system)
6012 (%current-system))))
6013 (or (string-prefix? "i686-" system)
6014 (string-prefix? "x86_64-" system)))
6015 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
6017 (build-system gnu-build-system)
6019 ;; XXX: The full test suite is run with "checkall" but it requires
6020 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
6021 `(#:test-target "shellcheck"
6022 #:modules ((guix build gnu-build-system)
6026 (modify-phases %standard-phases
6027 (delete 'configure) ; no configure script
6028 (add-before 'build 'setenv
6029 (lambda* (#:key outputs #:allow-other-keys)
6030 (let ((out (assoc-ref outputs "out")))
6031 (setenv "TLP_WITH_SYSTEMD" "0")
6032 (setenv "TLP_NO_INIT" "1")
6033 (setenv "TLP_NO_PMUTILS" "1")
6034 (setenv "TLP_SBIN" (string-append out "/bin"))
6035 (setenv "TLP_BIN" (string-append out "/bin"))
6036 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
6037 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
6038 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
6039 (setenv "TLP_CONFDEF"
6040 (string-append out "/share/tlp/defaults.conf"))
6041 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
6043 (string-append out "/lib/elogind/system-sleep"))
6045 (string-append out "/share/bash-completion/completions"))
6046 (setenv "TLP_MAN" (string-append out "/share/man"))
6047 (setenv "TLP_META" (string-append out "/share/metainfo"))
6049 (add-before 'install 'fix-installation
6051 ;; Stop the Makefile from trying to create system directories.
6052 (substitute* "Makefile"
6053 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6054 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6057 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6058 (add-after 'install 'wrap
6059 (lambda* (#:key inputs outputs #:allow-other-keys)
6060 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6061 (bin-files (find-files bin ".*")))
6062 (define (bin-directory input-name)
6063 (let ((p (assoc-ref inputs input-name)))
6064 (and p (string-append p "/bin"))))
6065 (define (sbin-directory input-name)
6066 (string-append (assoc-ref inputs input-name) "/sbin"))
6067 (for-each (lambda (program)
6068 (wrap-program program
6071 (filter-map bin-directory
6083 "x86-energy-perf-policy"))
6084 (filter-map sbin-directory
6090 "wireless-tools"))))))
6093 (home-page "https://linrunner.de/en/tlp/tlp.html")
6094 (synopsis "Power management tool for Linux")
6095 (description "TLP is a power management tool for Linux. It comes with
6096 a default configuration already optimized for battery life. Nevertheless,
6097 TLP is customizable to fulfil system requirements. TLP settings are applied
6098 every time the power supply source is changed.")
6099 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6101 (license (list license:gpl2+ license:gpl3+))))
6106 (version "B.02.19.2")
6109 (uri (string-append "https://www.ezix.org/software/"
6110 "files/lshw-" version
6114 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
6115 (build-system gnu-build-system)
6117 `(#:phases (modify-phases %standard-phases (delete 'configure))
6118 #:tests? #f ; no tests
6120 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6121 (synopsis "List hardware information")
6123 "@command{lshw} (Hardware Lister) is a small tool to provide
6124 detailed information on the hardware configuration of the machine.
6125 It can report exact memory configuration, firmware version, mainboard
6126 configuration, CPU version and speed, cache configuration, bus speed,
6127 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6128 machines (PowerMac G4 is known to work).")
6129 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6130 (license license:gpl2+)))
6132 (define-public libmnl
6139 (uri (string-append "mirror://netfilter.org/libmnl/"
6140 "libmnl-" version ".tar.bz2"))
6143 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6144 (build-system gnu-build-system)
6145 (home-page "https://www.netfilter.org/projects/libmnl/")
6146 (synopsis "Netlink utility library")
6147 (description "Libmnl is a minimalistic user-space library oriented to
6148 Netlink developers. There are a lot of common tasks in parsing, validating,
6149 constructing of both the Netlink header and TLVs that are repetitive and easy to
6150 get wrong. This library aims to provide simple helpers that allows you to
6151 re-use code and to avoid re-inventing the wheel.")
6152 (license license:lgpl2.1+)))
6154 (define-public libnftnl
6161 (uri (string-append "mirror://netfilter.org/libnftnl/"
6162 "libnftnl-" version ".tar.bz2"))
6164 (base32 "13zd90bfrr0q3j0l0cbc8kiizccw6n8gp727kqnfljh024zw3nr0"))))
6165 (build-system gnu-build-system)
6167 `(("pkg-config" ,pkg-config)))
6169 `(("libmnl" ,libmnl)))
6170 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6171 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6172 (description "Libnftnl is a userspace library providing a low-level netlink
6173 programming interface to the in-kernel nf_tables subsystem. The library
6174 libnftnl has been previously known as libnftables. This library is currently
6176 (license license:gpl2+)))
6178 (define-public nftables
6185 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6187 (string-append "https://www.nftables.org/projects/nftables"
6188 "/files/nftables-" version ".tar.bz2")))
6190 (base32 "0vmn6xwqa1nq6crfxshh049b199d0aj6hfgin7k068xhibzgvmk8"))))
6191 (build-system gnu-build-system)
6192 (arguments `(#:configure-flags
6193 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6194 (inputs `(("gmp" ,gmp)
6196 ("libnftnl" ,libnftnl)
6197 ("readline" ,readline)))
6198 (native-inputs `(("pkg-config" ,pkg-config)
6201 (home-page "https://www.nftables.org")
6202 (synopsis "Userspace utility for Linux packet filtering")
6203 (description "nftables is the project that aims to replace the existing
6204 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6205 filtering framework, a new userspace utility and also a compatibility layer for
6206 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6207 infrastructure such as the existing hooks, the connection tracking system, the
6208 userspace queueing component and the logging subsystem.")
6209 (license license:gpl2)))
6211 (define-public proot
6219 (url "https://github.com/proot-me/PRoot")
6220 (commit (string-append "v" version))))
6221 (file-name (git-file-name name version))
6223 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6224 (patches (search-patches "proot-test-fhs.patch"))))
6225 (build-system gnu-build-system)
6227 '(#:make-flags '("-C" "src")
6229 #:phases (modify-phases %standard-phases
6231 (add-before 'build 'set-shell-file-name
6232 (lambda* (#:key inputs #:allow-other-keys)
6233 (substitute* (find-files "src" "\\.[ch]$")
6236 (assoc-ref inputs "bash")
6239 (add-before 'check 'fix-fhs-assumptions-in-tests
6241 (substitute* "tests/test-c6b77b77.mk"
6242 (("/bin/bash") (which "bash"))
6243 (("/usr/bin/test") (which "test")))
6244 (substitute* '("tests/test-16573e73.c")
6245 (("/bin/([a-z-]+)" _ program)
6248 (substitute* (find-files "tests" "\\.sh$")
6249 ;; Some of the tests try to "bind-mount" /bin/true.
6251 (string-append "-b " (which "true") ":"))
6252 ;; Likewise for /bin.
6253 (("-b /bin:") "-b /gnu:")
6254 ;; Others try to run /bin/sh.
6255 (("/bin/sh") (which "sh"))
6256 ;; Others assume /etc/fstab exists.
6257 (("/etc/fstab") "/etc/passwd"))
6259 (substitute* "tests/GNUmakefile"
6260 (("-b /bin:") "-b /gnu:"))
6262 ;; XXX: This test fails in an obscure corner case, just
6264 (delete-file "tests/test-kkkkkkkk.c")
6269 (let ((n (parallel-job-count)))
6270 ;; For some reason we get lots of segfaults with
6271 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6272 (setenv "PROOT_NO_SECCOMP" "1")
6274 ;; Most of the tests expect "/bin" to be in $PATH so
6275 ;; they can run things that live in $ROOTFS/bin.
6277 (string-append (getenv "PATH") ":/bin"))
6279 (invoke "make" "check" "-C" "tests"
6281 "-j" (number->string n)))))
6283 (lambda* (#:key outputs #:allow-other-keys)
6284 ;; The 'install' rule does nearly nothing.
6285 (let* ((out (assoc-ref outputs "out"))
6286 (man1 (string-append out "/share/man/man1")))
6287 ;; TODO: 'make install-care' (does not even
6288 ;; build currently.)
6289 (invoke "make" "-C" "src" "install"
6290 (string-append "PREFIX=" out))
6293 (copy-file "doc/proot/man.1"
6294 (string-append man1 "/proot.1"))
6296 (native-inputs `(("which" ,which)
6298 ;; For 'mcookie', used by some of the tests.
6299 ("util-linux" ,util-linux)
6301 ;; XXX: Choose the old coreutils because its 'stat'
6302 ;; program does not use statx(2) when running 'stat -c
6303 ;; %a' or similar, which PRoot doesn't properly support.
6304 ("coreutils-old" ,coreutils-8.30)
6306 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6307 ;; make 4.3 to segfault.
6308 ("make-old" ,gnu-make-4.2)))
6309 (inputs `(("talloc" ,talloc)))
6310 (home-page "https://github.com/proot-me/PRoot")
6311 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6313 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6314 and @code{binfmt_misc}. This means that users don't need any privileges or
6315 setup to do things like using an arbitrary directory as the new root
6316 file system, making files accessible somewhere else in the file system
6317 hierarchy, or executing programs built for another CPU architecture
6318 transparently through QEMU user-mode. Also, developers can use PRoot as a
6319 generic process instrumentation engine thanks to its extension mechanism.
6320 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6321 available in the kernel Linux.")
6322 (license license:gpl2+)))
6324 (define-public proot-static
6327 (name "proot-static")
6329 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6330 (inputs `(("talloc" ,talloc/static)))
6332 (substitute-keyword-arguments (package-arguments proot)
6333 ((#:make-flags flags)
6334 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6336 `(modify-phases ,phases
6337 (add-after 'strip 'remove-store-references
6338 (lambda* (#:key outputs #:allow-other-keys)
6339 (let* ((out (assoc-ref outputs "out")))
6340 (with-directory-excursion out
6341 (remove-store-references "bin/proot")
6343 ((#:allowed-references _ '("out"))
6346 (define-public cpuid
6349 (version "20200211")
6352 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6353 version ".src.tar.gz"))
6356 "06sjbqqp80l7nhsp6khglkzdp9qy4vhbvjxbfilznhsmrqiwlw55"))))
6357 (build-system gnu-build-system)
6359 '(#:make-flags '("CC=gcc")
6360 #:tests? #f ; no tests
6361 #:phases (modify-phases %standard-phases
6362 (delete 'configure) ; no configure script
6363 (add-before 'install 'fix-makefile
6364 (lambda* (#:key outputs #:allow-other-keys)
6365 (substitute* "Makefile"
6366 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6367 ;; Make the compressed manpages writable so that the
6368 ;; reset-gzip-timestamps phase does not error out.
6369 (substitute* "Makefile"
6370 (("-m 444") "-m 644"))
6372 (inputs `(("perl" ,perl)))
6373 (supported-systems '("i686-linux" "x86_64-linux"))
6374 (home-page "http://www.etallen.com/cpuid.html")
6375 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6376 (description "cpuid dumps detailed information about the CPU(s) gathered
6377 from the CPUID instruction, and also determines the exact model of CPU(s). It
6378 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6379 NexGen, Rise, and SiS CPUs.")
6380 (license license:gpl2+)))
6382 (define-public jmtpfs
6390 (url "https://github.com/JasonFerrara/jmtpfs")
6391 (commit (string-append "v" version))))
6392 (file-name (git-file-name name version))
6395 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6396 (build-system gnu-build-system)
6400 ("libmtp" ,libmtp)))
6402 `(("pkg-config" ,pkg-config)))
6403 (home-page "https://github.com/JasonFerrara/jmtpfs")
6404 (synopsis "Use a FUSE file system to access data over MTP")
6405 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6406 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6407 the MTP device as a file system.")
6408 (license license:gpl3)))
6410 (define-public procenv
6418 (url "https://github.com/jamesodhunt/procenv")
6420 (file-name (git-file-name name version))
6422 (base32 "1ilrsw1rc85w29mkbkmm5n5w427gapv43yrjzvkb4kc9xhscgdjn"))))
6423 (build-system gnu-build-system)
6424 (arguments `(#:configure-flags '("--disable-silent-rules")))
6426 `(("pkg-config" ,pkg-config)
6434 ("libselinux" ,libselinux)))
6435 (synopsis "Utility to show process environment")
6436 (description "Procenv is a command-line tool that displays as much detail about
6437 itself and its environment as possible. It can be used as a test
6438 tool, to understand the type of environment a process runs in, and for
6439 comparing system environments.")
6440 (home-page "https://github.com/jamesodhunt/procenv/")
6441 (license license:gpl3+)))
6443 (define-public libfabric
6451 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6452 version "/libfabric-" version ".tar.bz2"))
6454 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
6455 (build-system gnu-build-system)
6456 (inputs `(("rdma-core" ,rdma-core)
6457 ,@(match (%current-system)
6458 ((member (package-supported-systems psm))
6462 (home-page "https://ofiwg.github.io/libfabric/")
6463 (synopsis "Open Fabric Interfaces")
6465 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6466 communication services to applications. OFI is best described as a collection
6467 of libraries and applications used to export fabric services. The key
6468 components of OFI are: application interfaces, provider libraries, kernel
6469 services, daemons, and test applications.
6471 Libfabric is a core component of OFI. It is the library that defines and
6472 exports the user-space API of OFI, and is typically the only software that
6473 applications deal with directly. It works in conjunction with provider
6474 libraries, which are often integrated directly into libfabric.")
6475 (license (list license:bsd-2 license:gpl2)))) ;dual
6480 (version "3.3.20170428")
6481 (home-page "https://github.com/intel/psm")
6485 (uri (git-reference (url home-page)
6486 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6487 (file-name (string-append "psm-" version ".tar.gz"))
6489 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6490 (patches (search-patches
6491 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6492 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6493 "psm-repro.patch" ; reproducibility
6494 "psm-disable-memory-stats.patch"))))
6495 (build-system gnu-build-system)
6496 (outputs '("out" "debug"))
6497 (inputs `(("libuuid" ,util-linux "lib")))
6499 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6500 ,(string-append "INSTALL_PREFIX=" %output)
6501 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6503 #:phases (modify-phases %standard-phases
6505 (add-after 'unpack 'patch-/usr/include
6507 (substitute* "Makefile"
6508 (("\\$\\{DESTDIR}/usr/include")
6509 (string-append %output "/include")))
6510 (substitute* "Makefile"
6511 (("/lib64") "/lib"))
6513 (add-after 'unpack 'patch-sysmacros
6515 (substitute* "ipath/ipath_proto.c"
6516 (("#include <sys/poll.h>" m)
6517 (string-append m "\n"
6518 "#include <sys/sysmacros.h>")))
6520 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6522 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6523 communications interface for the True Scale family of products. PSM users are
6524 enabled with mechanisms necessary to implement higher level communications
6525 interfaces in parallel environments.")
6526 ;; Only Intel-compatable processors are supported.
6527 (supported-systems '("i686-linux" "x86_64-linux"))
6528 (license (list license:bsd-2 license:gpl2)))) ;dual
6530 (define-public snapscreenshot
6532 (name "snapscreenshot")
6533 (version "1.0.14.3")
6537 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6538 name "-" version ".tar.bz2"))
6540 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6541 (build-system gnu-build-system)
6544 (let ((out (assoc-ref %outputs "out")))
6545 (list (string-append "BINDIR=" out "/bin")
6546 (string-append "MANDIR=" out "/share/man")))
6547 #:tests? #f ; no test suite
6549 (modify-phases %standard-phases
6550 (delete 'configure) ; ./configure is a snarky no-op
6551 (add-before 'install 'fix-ownership
6552 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6554 (substitute* "depfun.mak"
6555 ((" -o bin -g bin ") " "))
6557 (add-before 'install 'create-output-directories
6558 (lambda* (#:key outputs #:allow-other-keys)
6559 (let ((out (assoc-ref outputs "out")))
6560 (mkdir-p (string-append out "/share/man/man1"))
6562 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6563 (synopsis "Take screenshots of one or more Linux text consoles")
6565 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6566 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6567 relevant @file{/dev/vcs*} file(s).")
6568 (license license:gpl2)))
6570 (define-public fbcat
6577 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6578 version "/" name "-" version ".tar.gz"))
6580 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6581 (build-system gnu-build-system)
6583 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6584 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6585 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6586 `(("pnmtopng" ,netpbm)))
6587 (outputs (list "out" "fbgrab"))
6591 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6592 #:tests? #f ; no tests
6594 (modify-phases %standard-phases
6595 (delete 'configure) ; no configure script
6596 (add-after 'build 'qualify-references
6597 (lambda* (#:key inputs outputs #:allow-other-keys)
6598 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6599 (out (assoc-ref outputs "out")))
6600 (substitute* "fbgrab"
6602 (string-append out "/bin/" all))
6604 (string-append pnmtopng "/bin/" all)))
6606 (add-after 'install 'split-fbgrab-output
6607 (lambda* (#:key outputs #:allow-other-keys)
6608 (let* ((out (assoc-ref outputs "out"))
6609 (out:fbgrab (assoc-ref outputs "fbgrab")))
6610 (for-each (lambda (file)
6611 (let ((old (string-append out "/" file))
6612 (new (string-append out:fbgrab "/" file)))
6613 (mkdir-p (dirname new))
6614 (rename-file old new)))
6616 "share/man/man1/fbgrab.1"))
6618 (home-page "https://jwilk.net/software/fbcat")
6619 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6621 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6622 a dump therof. It supports a wide range of drivers and pixel formats.
6623 @command{fbcat} can take screenshots of virtually any application that can be
6624 made to write its output to the framebuffer, including (but not limited to)
6625 text-mode or graphical applications that don't use a display server.
6627 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6628 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6629 (license license:gpl2)))
6631 (define-public libcgroup
6639 "mirror://sourceforge/libcg/" name "/"
6640 version "/" name "-" version ".tar.bz2"))
6642 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6643 (build-system gnu-build-system)
6650 `(("linux-pam" ,linux-pam)))
6651 (home-page "https://sourceforge.net/projects/libcg/")
6652 (synopsis "Control groups management tools")
6653 (description "Control groups is Linux kernel method for process resource
6654 restriction, permission handling and more. This package provides userspace
6655 interface to this kernel feature.")
6656 (license license:lgpl2.1)))
6658 (define-public mbpfan
6666 (url "https://github.com/dgraziotin/mbpfan")
6667 (commit (string-append "v" version))))
6668 (file-name (git-file-name name version))
6670 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6671 (build-system gnu-build-system)
6673 `(#:tests? #f ; tests ask to be run as root
6674 #:make-flags (let ((out (assoc-ref %outputs "out")))
6675 (list (string-append "DESTDIR=" out)
6676 ,(string-append "CC=" (cc-for-target))))
6678 (modify-phases %standard-phases
6679 (add-after 'unpack 'patch-paths
6681 (substitute* "Makefile"
6684 (delete 'configure)))) ; there's no configure phase
6685 (home-page "https://github.com/dgraziotin/mbpfan")
6686 (synopsis "Control fan speed on Macbooks")
6688 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6689 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6690 module. It can be executed as a daemon or in the foreground with root
6692 (license license:gpl3+)))
6701 (url "https://github.com/intel/opa-psm2")
6702 (commit (string-append "PSM2_" version))))
6703 (file-name (git-file-name name version))
6706 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6707 (build-system gnu-build-system)
6710 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6712 #:phases (modify-phases %standard-phases
6714 (add-after 'unpack 'patch-Makefiles
6716 (substitute* "Makefile"
6719 (substitute* "compat/Makefile"
6725 (setenv "DESTDIR" %output)
6726 (invoke "make" "install")
6729 `(("rdma-core" ,rdma-core)
6730 ("numactl" ,numactl)))
6731 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6733 "This package is low-level user-level Intel's communications interface.
6734 The PSM2 API is a high-performance vendor-specific protocol that provides a
6735 low-level communications interface for the Intel Omni-Path family of
6736 high-speed networking devices.")
6737 (home-page "https://github.com/intel/opa-psm2")
6738 ;; Only the x86_64 architecure is supported.
6739 (supported-systems '("x86_64-linux"))
6740 (license (list license:bsd-3 license:gpl2)))) ; dual
6742 (define-public libpfm4
6748 (uri (string-append "mirror://sourceforge/perfmon2/"
6749 name "/libpfm-" version ".tar.gz"))
6752 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6753 (build-system gnu-build-system)
6755 '(#:modules ((guix build utils)
6756 (guix build gnu-build-system))
6757 #:phases (modify-phases %standard-phases
6761 (lambda* (#:key inputs outputs #:allow-other-keys)
6762 (let* ((out (assoc-ref outputs "out")))
6767 (lambda* (#:key outputs #:allow-other-keys)
6768 (let* ((out (assoc-ref outputs "out")))
6770 (string-append "PREFIX=" out)
6773 (synopsis "Performance event monitoring library")
6775 "This package provides a library called libpfm4, which is used to develop
6776 monitoring tools exploiting the performance monitoring events such as those
6777 provided by the Performance Monitoring Unit (PMU) of modern processors.
6779 Libpfm4 helps convert from an event name, expressed as a string, to the event
6780 encoding that is either the raw event as documented by the hardware vendor or
6781 the OS-specific encoding. In the latter case, the library is able to prepare
6782 the OS-specific data structures needed by the kernel to setup the event.
6784 libpfm4 provides support for the @code{perf_events} interface, which was
6785 introduced in Linux 2.6.31.")
6786 (home-page "http://perfmon2.sourceforge.net/")
6787 (license license:expat)))
6789 (define-public libnfnetlink
6791 (name "libnfnetlink")
6796 "https://www.netfilter.org/projects/libnfnetlink/files/"
6797 "libnfnetlink-" version ".tar.bz2"))
6800 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6801 (build-system gnu-build-system)
6802 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6803 (synopsis "Low-level netfilter netlink communication library")
6805 "@code{libnfnetlink} is the low-level library for netfilter related
6806 kernel/userspace communication. It provides a generic messaging
6807 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6808 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6809 management tools in userspace.")
6810 (license license:gpl2)))
6812 (define-public go-netlink
6819 (url "https://github.com/vishvananda/netlink")
6820 (commit (string-append "v" version))))
6821 (file-name (git-file-name name version))
6824 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6825 (build-system go-build-system)
6827 `(#:import-path "github.com/vishvananda/netlink"))
6829 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6830 ("go-netns" ,go-netns)))
6831 (home-page "https://github.com/vishvananda/netlink")
6832 (synopsis "Simple netlink library for Go")
6833 (description "The netlink package provides a simple netlink library for
6834 Go. Netlink is the interface a user-space program in Linux uses to
6835 communicate with the kernel. It can be used to add and remove interfaces, set
6836 IP addresses and routes, and configure IPsec.")
6837 (license license:asl2.0)))
6839 (define-public xfsprogs
6846 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6847 "xfsprogs-" version ".tar.gz"))
6850 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
6851 (build-system gnu-build-system)
6852 (outputs (list "out" "python"))
6854 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6856 (modify-phases %standard-phases
6857 (add-after 'install 'separate-python-output
6858 (lambda* (#:key outputs #:allow-other-keys)
6859 (let ((out (assoc-ref outputs "out"))
6860 (python (assoc-ref outputs "python")))
6863 (mkdir-p (string-append python (dirname script)))
6864 (rename-file (string-append out script)
6865 (string-append python script)))
6866 (list "/sbin/xfs_scrub_all"))
6868 (add-after 'install 'install-headers
6870 (invoke "make" "install-dev"))))))
6872 `(("gettext" ,gettext-minimal)))
6874 `(("libuuid" ,util-linux "lib")
6875 ("python" ,python-wrapper)))
6876 (home-page "https://xfs.wiki.kernel.org/")
6877 (synopsis "XFS file system tools")
6878 (description "This package provides commands to create and check XFS
6880 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6881 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6882 (license (list license:gpl2 license:lgpl2.1))))
6884 (define-public genext2fs
6891 (url "https://github.com/jeremie-koenig/genext2fs")
6892 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6893 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6894 (file-name (git-file-name name version))
6896 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6897 (build-system gnu-build-system)
6900 (modify-phases %standard-phases
6901 (add-after 'unpack 'apply-debian-patches
6902 ;; Debian changes (the revision after ‘-’ in VERSION) are
6903 ;; maintained as separate patches. Apply those relevant to us.
6907 (invoke "patch" "-p1" "-i"
6908 (string-append "debian/patches/" file-name)))
6909 (list "blocksize+creator.diff" ; add -B/-o options
6910 "byteswap_fix.diff"))
6913 `(("autoconf" ,autoconf)
6914 ("automake" ,automake)))
6915 (home-page "https://github.com/jeremie-koenig/genext2fs")
6916 (synopsis "Generate ext2 file system as a normal user")
6917 (description "This package provides a program to generate an ext2
6918 file system as a normal (non-root) user. It does not require you to mount
6919 the image file to copy files on it, nor does it require that you become
6920 the superuser to make device nodes.")
6921 (license license:gpl2)))
6923 (define-public fakeroot
6929 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6930 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6931 (file-name (string-append name "-" version ".tar.gz"))
6934 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6935 (build-system gnu-build-system)
6938 (modify-phases %standard-phases
6939 (add-after 'configure 'patch-Makefile
6941 ;; Note: The root of the problem is already in "Makefile.am".
6942 (substitute* "Makefile"
6943 (("/bin/sh") (which "sh")))
6945 (add-after 'unpack 'patch-script
6946 (lambda* (#:key inputs #:allow-other-keys)
6947 (substitute* "scripts/fakeroot.in"
6949 (string-append (assoc-ref inputs "util-linux")
6952 (string-append (assoc-ref inputs "sed")
6955 (string-append (assoc-ref inputs "coreutils")
6958 (add-before 'configure 'setenv
6960 (setenv "LIBS" "-lacl")
6962 (add-before 'check 'prepare-check
6964 (setenv "SHELL" (which "bash"))
6965 (setenv "VERBOSE" "1")
6966 (substitute* "test/t.touchinstall"
6967 ;; We don't have the name of the root user, so use ID=0.
6968 (("grep root") "grep \"\\<0\\>\""))
6969 (substitute* "test/tartest"
6970 ;; We don't have the name of the root group, so use ID=0.
6971 (("ROOTGROUP=root") "ROOTGROUP=0")
6972 ;; We don't have the name of the daemon user, so use IDs.
6973 (("daemon:sys") "1:3")
6975 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6976 (substitute* "test/compare-tar"
6977 (("tar -tvf") "tar --numeric-owner -tvf"))
6979 ;; coreutils 8.32 changed 'ls' to use the statx() syscall instead
6980 ;; of lstat(). fakeroot 1.24 does not support the former, so
6981 ;; adjust these tests to use 'test -b' instead of 'ls' to test for
6982 ;; block device. See <https://bugs.gnu.org/41090>.
6983 (substitute* '("test/t.mknod" "test/t.chmod_dev")
6984 (("ls -ld? \\$tmp/hda3")
6985 "test -b $tmp/hda3 && echo block || echo fail"))
6989 ("sharutils" ,sharutils) ; for the tests
6990 ("xz" ,xz))) ; for the tests
6992 `(("libcap" ,libcap/next)
6993 ("util-linux" ,util-linux)
6995 ("coreutils" ,coreutils)))
6996 (synopsis "Provides a fake root environment")
6997 (description "@command{fakeroot} runs a command in an environment where
6998 it appears to have root privileges for file manipulation. This is useful
6999 for allowing users to create archives (tar, ar, .deb etc.) with files in
7000 them with root permissions/ownership. Without fakeroot one would have to
7001 have root privileges to create the constituent files of the archives with
7002 the correct permissions and ownership, and then pack them up, or one would
7003 have to construct the archives directly, without using the archiver.")
7004 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
7005 (license license:gpl3+)))
7007 (define-public fakechroot
7014 "https://github.com/dex4er/fakechroot/releases/download/"
7015 version "/fakechroot-" version ".tar.gz"))
7018 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
7019 (build-system gnu-build-system)
7021 ;; XXX: The tests heavily assume they run on an FHS system so for now
7024 #:configure-flags '("--disable-static")))
7025 (synopsis "Emulate @code{chroot} by overriding file system calls")
7027 "@command{fakechroot} runs a command in an environment were is additional
7028 possibility to use @code{chroot} command without root privileges. This is
7029 useful for allowing users to create own chrooted environment with possibility
7030 to install another packages without need for root privileges.
7032 It works by providing @file{libfakechroot.so}, a shared library meant to be
7033 set as @code{LD_PRELOAD} to override the C library file system functions.")
7034 (home-page "https://github.com/dex4er/fakechroot/")
7035 (license license:lgpl2.1+)))
7037 (define-public inputattach
7039 (name "inputattach")
7044 (url "https://github.com/linuxwacom/input-wacom")
7045 (commit (string-append "input-wacom-" version))))
7046 (file-name (git-file-name name version))
7048 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
7049 (build-system gnu-build-system)
7052 (modify-phases %standard-phases
7056 (lambda* (#:key inputs #:allow-other-keys)
7057 (with-directory-excursion "inputattach"
7058 (invoke (string-append (assoc-ref inputs "gcc")
7060 "-O2" "-o" "inputattach" "inputattach.c"))
7064 (lambda* (#:key outputs #:allow-other-keys)
7065 (let ((target-dir (string-append
7066 (assoc-ref outputs "out")
7068 (mkdir-p target-dir)
7069 (copy-file "inputattach/inputattach"
7070 (string-append target-dir
7073 (home-page "https://linuxwacom.github.io/")
7074 (synopsis "Dispatch input peripherals events to a device file")
7075 (description "inputattach dispatches input events from several device
7076 types and interfaces and translates so that the X server can use them.")
7077 (license license:gpl2+)))
7079 (define-public pipewire
7086 (url "https://github.com/PipeWire/pipewire")
7088 (file-name (git-file-name name version))
7091 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
7092 (build-system meson-build-system)
7094 '(#:configure-flags '("-Dsystemd=false")))
7096 `(("pkg-config" ,pkg-config)))
7098 `(("alsa-lib" ,alsa-lib)
7102 ("gstreamer" ,gstreamer)
7103 ("gst-plugins-base" ,gst-plugins-base)
7107 (home-page "https://pipewire.org/")
7108 (synopsis "Server and user space API to deal with multimedia pipelines")
7110 "PipeWire is a project that aims to greatly improve handling of audio and
7111 video under Linux. It aims to support the usecases currently handled by both
7112 PulseAudio and Jack and at the same time provide same level of powerful handling
7113 of Video input and output. It also introduces a security model that makes
7114 interacting with audio and video devices from containerized applications easy,
7115 with supporting Flatpak applications being the primary goal. Alongside Wayland
7116 and Flatpak we expect PipeWire to provide a core building block for the future
7117 of Linux application development.")
7118 (license license:lgpl2.0+)))
7120 (define-public pipewire-0.3
7128 (url "https://github.com/PipeWire/pipewire")
7130 (file-name (git-file-name name version))
7133 "04l66p0wj553gp2zf3vwwh6jbr1vkf6wrq4za9zlm9dn144am4j2"))))
7135 '(#:configure-flags '("-Dsystemd=false")
7137 (modify-phases %standard-phases
7138 ;; Skip shrink-runpath, otherwise validate-runpath fails
7139 (delete 'shrink-runpath))))
7141 (append (package-inputs pipewire)
7144 ("pulseaudio" ,pulseaudio)
7145 ("vulkan-loader" ,vulkan-loader)
7146 ("vulkan-headers" ,vulkan-headers))))))
7155 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7157 (file-name (git-file-name name version))
7160 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
7161 (build-system gnu-build-system)
7164 (modify-phases %standard-phases
7165 (add-after 'unpack 'fix-dbus-tests
7167 (substitute* '("unit/test-dbus-message-fds.c"
7168 "unit/test-dbus-properties.c"
7170 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7175 `(("autoconf" ,autoconf)
7176 ("libtool" ,libtool)
7177 ("pkgconfig" ,pkg-config)
7178 ("automake" ,automake)))
7179 (home-page "https://01.org/ell")
7180 (synopsis "Embedded Linux Library")
7181 (description "The Embedded Linux* Library (ELL) provides core, low-level
7182 functionality for system daemons. It typically has no dependencies other than
7183 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7184 ELL is designed to be efficient and compact enough for use on embedded Linux
7185 platforms, it is not limited to resource-constrained systems.")
7186 (license license:lgpl2.1+)))
7188 (define-public lttng-ust
7194 (uri (string-append "https://lttng.org/files/lttng-ust/"
7195 "lttng-ust-" version ".tar.bz2"))
7198 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7199 (build-system gnu-build-system)
7201 `(("liburcu" ,liburcu)
7202 ("numactl" ,numactl)))
7204 `(("python" ,python-3)))
7205 (home-page "https://lttng.org/")
7206 (synopsis "LTTng userspace tracer libraries")
7207 (description "The user space tracing library, liblttng-ust, is the LTTng
7208 user space tracer. It receives commands from a session daemon, for example to
7209 enable and disable specific instrumentation points, and writes event records
7210 to ring buffers shared with a consumer daemon.")
7211 (license license:lgpl2.1+)))
7213 (define-public kexec-tools
7215 (name "kexec-tools")
7219 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7220 "/kexec/kexec-tools-" version ".tar.xz"))
7223 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
7224 (build-system gnu-build-system)
7226 ;; There are no automated tests.
7228 (home-page "https://projects.horms.net/projects/kexec/")
7229 (synopsis "Tools for booting directly into different kernels")
7230 (description "This package provides the @code{kexec} program and ancillary
7231 utilities. Using @code{kexec}, it is possible to boot directly into a new
7232 kernel from the context of an already-running kernel, bypassing the normal
7233 system boot process.")
7234 (license license:gpl2)))
7236 (define-public cachefilesd
7238 (name "cachefilesd")
7243 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7244 "/cachefilesd.git/snapshot/cachefilesd-"
7248 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7249 (build-system gnu-build-system)
7252 `(#:tests? #f ; there are no tests
7254 (let ((prefix-dir (lambda (var dir)
7255 (string-append var "=" %output "/" dir))))
7256 (list (string-append "CC=" ,(cc-for-target))
7257 (prefix-dir "SBINDIR" "sbin/")
7258 (prefix-dir "ETCDIR" "etc/")
7259 (prefix-dir "MANDIR" "share/man/")))
7260 #:phases (modify-phases %standard-phases (delete 'configure))))
7261 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7262 (synopsis "CacheFiles userspace management daemon")
7263 (description "@code{cachefilesd} is a userspace daemon that manages the
7264 cache data store that is used by network file systems such as @code{AFS} and
7265 @code{NFS} to cache data locally on disk. The content of the cache is
7266 persistent over reboots.")
7267 (license license:gpl2+)))
7269 (define-public libbpf
7277 (url "https://github.com/libbpf/libbpf")
7278 (commit (string-append "v" version))))
7279 (file-name (git-file-name name version))
7282 "18l0gff7nm841mwhr7bc7x863xcyvwh58zl7mc0amnsjqlbrvqg7"))))
7283 (build-system gnu-build-system)
7285 `(("pkg-config" ,pkg-config)))
7287 `(("libelf" ,libelf)
7290 `(#:tests? #f ; No tests
7293 (string-append "PREFIX=''")
7294 (string-append "DESTDIR=" (assoc-ref %outputs "out"))
7295 (string-append "LIBDIR=/lib")
7297 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
7299 (modify-phases %standard-phases
7301 (add-before 'build 'pre-build
7302 (lambda* (#:key inputs #:allow-other-keys)
7303 (substitute* "scripts/check-reallocarray.sh"
7305 (string-append (assoc-ref inputs "coreutils") rm)))
7308 (home-page "https://github.com/libbpf/libbpf")
7309 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
7311 "Libbpf supports building BPF CO-RE-enabled applications, which, in
7312 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
7314 (license `(,license:lgpl2.1 ,license:bsd-2))))