gnu: bridge-utils: Update home page.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
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 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 ng0 <ng0@n0.is>
22 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
23 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
24 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
25 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
26 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
27 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
30 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
31 ;;; Copyright © 2018 Brendan Tildesley <mail@brendan.scot>
32 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
33 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
34 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
35 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
36 ;;; Copyright © 2019, 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 ;;;
46 ;;; This file is part of GNU Guix.
47 ;;;
48 ;;; GNU Guix is free software; you can redistribute it and/or modify it
49 ;;; under the terms of the GNU General Public License as published by
50 ;;; the Free Software Foundation; either version 3 of the License, or (at
51 ;;; your option) any later version.
52 ;;;
53 ;;; GNU Guix is distributed in the hope that it will be useful, but
54 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
55 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56 ;;; GNU General Public License for more details.
57 ;;;
58 ;;; You should have received a copy of the GNU General Public License
59 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
60
61 (define-module (gnu packages linux)
62 #:use-module (gnu packages)
63 #:use-module (gnu packages acl)
64 #:use-module (gnu packages admin)
65 #:use-module (gnu packages algebra)
66 #:use-module (gnu packages attr)
67 #:use-module (gnu packages audio)
68 #:use-module (gnu packages autotools)
69 #:use-module (gnu packages backup)
70 #:use-module (gnu packages base)
71 #:use-module (gnu packages bash)
72 #:use-module (gnu packages bison)
73 #:use-module (gnu packages calendar)
74 #:use-module (gnu packages check)
75 #:use-module (gnu packages crypto)
76 #:use-module (gnu packages cryptsetup)
77 #:use-module (gnu packages compression)
78 #:use-module (gnu packages dbm)
79 #:use-module (gnu packages datastructures)
80 #:use-module (gnu packages docbook)
81 #:use-module (gnu packages documentation)
82 #:use-module (gnu packages elf)
83 #:use-module (gnu packages flex)
84 #:use-module (gnu packages file)
85 #:use-module (gnu packages freedesktop)
86 #:use-module (gnu packages gcc)
87 #:use-module (gnu packages gettext)
88 #:use-module (gnu packages glib)
89 #:use-module (gnu packages golang)
90 #:use-module (gnu packages gperf)
91 #:use-module (gnu packages gstreamer)
92 #:use-module (gnu packages gtk)
93 #:use-module (gnu packages haskell-apps)
94 #:use-module (gnu packages haskell-xyz)
95 #:use-module (gnu packages libunwind)
96 #:use-module (gnu packages libusb)
97 #:use-module (gnu packages man)
98 #:use-module (gnu packages maths)
99 #:use-module (gnu packages multiprecision)
100 #:use-module (gnu packages ncurses)
101 #:use-module (gnu packages netpbm)
102 #:use-module (gnu packages networking)
103 #:use-module (gnu packages ninja)
104 #:use-module (gnu packages nss)
105 #:use-module (gnu packages perl)
106 #:use-module (gnu packages pciutils)
107 #:use-module (gnu packages pkg-config)
108 #:use-module (gnu packages popt)
109 #:use-module (gnu packages pulseaudio)
110 #:use-module (gnu packages python)
111 #:use-module (gnu packages python-xyz)
112 #:use-module (gnu packages readline)
113 #:use-module (gnu packages rrdtool)
114 #:use-module (gnu packages samba)
115 #:use-module (gnu packages sdl)
116 #:use-module (gnu packages serialization)
117 #:use-module (gnu packages slang)
118 #:use-module (gnu packages texinfo)
119 #:use-module (gnu packages tls)
120 #:use-module (gnu packages valgrind)
121 #:use-module (gnu packages video)
122 #:use-module (gnu packages web)
123 #:use-module (gnu packages xiph)
124 #:use-module (gnu packages xml)
125 #:use-module (gnu packages xdisorg)
126 #:use-module (gnu packages xorg)
127 #:use-module (gnu packages groff)
128 #:use-module (gnu packages rsync)
129 #:use-module (gnu packages selinux)
130 #:use-module (gnu packages swig)
131 #:use-module (guix build-system cmake)
132 #:use-module (guix build-system gnu)
133 #:use-module (guix build-system go)
134 #:use-module (guix build-system meson)
135 #:use-module (guix build-system python)
136 #:use-module (guix build-system trivial)
137 #:use-module (guix build-system linux-module)
138 #:use-module (guix download)
139 #:use-module (guix git-download)
140 #:use-module ((guix licenses) #:prefix license:)
141 #:use-module (guix packages)
142 #:use-module (guix gexp)
143 #:use-module (guix store)
144 #:use-module (guix monads)
145 #:use-module (guix utils)
146 #:use-module (srfi srfi-1)
147 #:use-module (srfi srfi-2)
148 #:use-module (srfi srfi-26)
149 #:use-module (ice-9 match))
150
151 (define-public (system->linux-architecture arch)
152 "Return the Linux architecture name for ARCH, a Guix system name such as
153 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
154 (let ((arch (car (string-split arch #\-))))
155 (cond ((string=? arch "i686") "i386")
156 ((string-prefix? "mips" arch) "mips")
157 ((string-prefix? "arm" arch) "arm")
158 ((string-prefix? "aarch64" arch) "arm64")
159 ((string-prefix? "alpha" arch) "alpha")
160 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
161 ((string-prefix? "s390" arch) "s390")
162 ((string-prefix? "riscv" arch) "riscv")
163 (else arch))))
164
165 (define-public (system->defconfig system)
166 "Some systems (notably powerpc-linux) require a special target for kernel
167 defconfig. Return the appropriate make target if applicable, otherwise return
168 \"defconfig\"."
169 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
170 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
171 (else "defconfig")))
172
173 \f
174 ;;;
175 ;;; Kernel source code deblobbing.
176 ;;;
177
178 (define (linux-libre-deblob-scripts version
179 deblob-hash
180 deblob-check-hash)
181 (list (version-major+minor version)
182 (origin
183 (method url-fetch)
184 (uri (string-append "https://linux-libre.fsfla.org"
185 "/pub/linux-libre/releases/" version "-gnu/"
186 "deblob-" (version-major+minor version)))
187 (sha256 deblob-hash))
188 (origin
189 (method url-fetch)
190 (uri (string-append "https://linux-libre.fsfla.org"
191 "/pub/linux-libre/releases/" version "-gnu/"
192 "deblob-check"))
193 (sha256 deblob-check-hash))))
194
195 (define deblob-scripts-5.4
196 (linux-libre-deblob-scripts
197 "5.4.19"
198 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
199 (base32 "1ajzwyy6vgmihxpz3sbshzfzd0w8yzj0fihv0d5rjpr4z3gm48bk")))
200
201 (define deblob-scripts-4.19
202 (linux-libre-deblob-scripts
203 "4.19.103"
204 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
205 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
206
207 (define deblob-scripts-4.14
208 (linux-libre-deblob-scripts
209 "4.14.170"
210 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
211 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
212
213 (define deblob-scripts-4.9
214 (linux-libre-deblob-scripts
215 "4.9.213"
216 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
217 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
218
219 (define deblob-scripts-4.4
220 (linux-libre-deblob-scripts
221 "4.4.213"
222 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
223 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
224
225 (define* (computed-origin-method gexp-promise hash-algo hash
226 #:optional (name "source")
227 #:key (system (%current-system))
228 (guile (default-guile)))
229 "Return a derivation that executes the G-expression that results
230 from forcing GEXP-PROMISE."
231 (mlet %store-monad ((guile (package->derivation guile system)))
232 (gexp->derivation (or name "computed-origin")
233 (force gexp-promise)
234 #:graft? #f ;nothing to graft
235 #:system system
236 #:guile-for-build guile)))
237
238 (define (make-linux-libre-source version
239 upstream-source
240 deblob-scripts)
241 "Return a 'computed' origin that generates a Linux-libre tarball from the
242 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
243 (match deblob-scripts
244 ((deblob-version (? origin? deblob) (? origin? deblob-check))
245 (unless (string=? deblob-version (version-major+minor version))
246 ;; The deblob script cannot be expected to work properly on a
247 ;; different version (major+minor) of Linux, even if no errors
248 ;; are signaled during execution.
249 (error "deblob major+minor version mismatch"))
250 (origin
251 (method computed-origin-method)
252 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
253 (sha256 #f)
254 (uri
255 (delay
256 (with-imported-modules '((guix build utils))
257 #~(begin
258 (use-modules (guix build utils)
259 (srfi srfi-1)
260 (ice-9 match)
261 (ice-9 ftw))
262 (let ((dir (string-append "linux-" #$version)))
263
264 (mkdir "/tmp/bin")
265 (set-path-environment-variable
266 "PATH" '("bin")
267 (list "/tmp"
268 #+(canonical-package bash)
269 #+(canonical-package coreutils)
270 #+(canonical-package diffutils)
271 #+(canonical-package findutils)
272 #+(canonical-package patch)
273 #+(canonical-package xz)
274 #+(canonical-package sed)
275 #+(canonical-package grep)
276 #+(canonical-package bzip2)
277 #+(canonical-package gzip)
278 #+(canonical-package tar)
279 ;; The comments in the 'deblob-check' script
280 ;; claim that it supports Python 2 and 3, but
281 ;; in fact it fails when run in Python 3 as
282 ;; of version 5.1.3.
283 #+python-2))
284
285 (with-directory-excursion "/tmp/bin"
286
287 (copy-file #+deblob "deblob")
288 (chmod "deblob" #o755)
289 (substitute* "deblob"
290 (("/bin/sh") (which "sh")))
291
292 (copy-file #+deblob-check "deblob-check")
293 (chmod "deblob-check" #o755)
294 (substitute* "deblob-check"
295 (("/bin/sh") (which "sh"))
296 (("/bin/sed") (which "sed"))
297 (("/usr/bin/python") (which "python"))))
298
299 (if (file-is-directory? #+upstream-source)
300 (begin
301 (format #t "Copying upstream linux source...~%")
302 (force-output)
303 (invoke "cp" "--archive" #+upstream-source dir)
304 (invoke "chmod" "--recursive" "u+w" dir))
305 (begin
306 (format #t "Unpacking upstream linux tarball...~%")
307 (force-output)
308 (invoke "tar" "xf" #$upstream-source)
309 (match (scandir "."
310 (lambda (name)
311 (and (not (member name '("." "..")))
312 (file-is-directory? name))))
313 ((unpacked-dir)
314 (unless (string=? dir unpacked-dir)
315 (rename-file unpacked-dir dir)))
316 (dirs
317 (error "multiple directories found" dirs)))))
318
319 (with-directory-excursion dir
320 (setenv "PYTHON" (which "python"))
321 (format #t "Running deblob script...~%")
322 (force-output)
323 (invoke "/tmp/bin/deblob"))
324
325 (format #t "~%Packing new Linux-libre tarball...~%")
326 (force-output)
327 (invoke "tar" "cvfa" #$output
328 ;; Avoid non-determinism in the archive.
329 "--mtime=@0"
330 "--owner=root:0"
331 "--group=root:0"
332 "--sort=name"
333 "--hard-dereference"
334 dir))))))))))
335
336 \f
337 ;;;
338 ;;; Kernel sources.
339 ;;;
340
341 (define (linux-libre-urls version)
342 "Return a list of URLs for Linux-Libre VERSION."
343 (list (string-append
344 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
345 version "-gnu/linux-libre-" version "-gnu.tar.xz")
346
347 ;; XXX: Work around <http://bugs.gnu.org/14851>.
348 (string-append
349 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
350 version "-gnu.tar.xz")
351
352 ;; Maybe this URL will become valid eventually.
353 (string-append
354 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
355 version "-gnu.tar.xz")))
356
357 (define (%upstream-linux-source version hash)
358 (origin
359 (method url-fetch)
360 (uri (string-append "mirror://kernel.org"
361 "/linux/kernel/v" (version-major version) ".x/"
362 "linux-" version ".tar.xz"))
363 (sha256 hash)))
364
365 (define-public linux-libre-5.4-version "5.4.25")
366 (define-public linux-libre-5.4-pristine-source
367 (let ((version linux-libre-5.4-version)
368 (hash (base32 "09ay0adc3s3m7qk0nj5lkmrp5i0q76a9kax0xix8914d115rgvf0")))
369 (make-linux-libre-source version
370 (%upstream-linux-source version hash)
371 deblob-scripts-5.4)))
372
373 (define-public linux-libre-4.19-version "4.19.110")
374 (define-public linux-libre-4.19-pristine-source
375 (let ((version linux-libre-4.19-version)
376 (hash (base32 "15kbgj13vsr74c61vzs96a72k86x205jjq5bz9pbn70698n3s4fa")))
377 (make-linux-libre-source version
378 (%upstream-linux-source version hash)
379 deblob-scripts-4.19)))
380
381 (define-public linux-libre-4.14-version "4.14.173")
382 (define-public linux-libre-4.14-pristine-source
383 (let ((version linux-libre-4.14-version)
384 (hash (base32 "0kxp3mgiags8hdax15masab9zr89xraqvl9ri7zwgksx8ixav0m2")))
385 (make-linux-libre-source version
386 (%upstream-linux-source version hash)
387 deblob-scripts-4.14)))
388
389 (define-public linux-libre-4.9-version "4.9.216")
390 (define-public linux-libre-4.9-pristine-source
391 (let ((version linux-libre-4.9-version)
392 (hash (base32 "0lgv5k8v5xz9z2z4k42566bh0akyk1gr0dx6s1m1rjrzsf9k86l6")))
393 (make-linux-libre-source version
394 (%upstream-linux-source version hash)
395 deblob-scripts-4.9)))
396
397 (define-public linux-libre-4.4-version "4.4.216")
398 (define-public linux-libre-4.4-pristine-source
399 (let ((version linux-libre-4.4-version)
400 (hash (base32 "1hjgh9brvxzi6ypgfnk07l3j28xsxgz88sdshnz19vj96bn1w70q")))
401 (make-linux-libre-source version
402 (%upstream-linux-source version hash)
403 deblob-scripts-4.4)))
404
405 (define %boot-logo-patch
406 ;; Linux-Libre boot logo featuring Freedo and a gnu.
407 (origin
408 (method url-fetch)
409 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
410 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
411 (sha256
412 (base32
413 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
414
415 (define %linux-libre-arm-export-__sync_icache_dcache-patch
416 (origin
417 (method url-fetch)
418 (uri (string-append
419 "https://salsa.debian.org/kernel-team/linux"
420 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
421 "/debian/patches/bugfix/arm/"
422 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
423 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
424 (sha256
425 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
426
427 (define (source-with-patches source patches)
428 (origin
429 (inherit source)
430 (patches (append (origin-patches source)
431 patches))))
432
433 (define-public linux-libre-5.4-source
434 (source-with-patches linux-libre-5.4-pristine-source
435 (list %boot-logo-patch
436 %linux-libre-arm-export-__sync_icache_dcache-patch)))
437
438 (define-public linux-libre-4.19-source
439 (source-with-patches linux-libre-4.19-pristine-source
440 (list %boot-logo-patch
441 %linux-libre-arm-export-__sync_icache_dcache-patch)))
442
443 (define-public linux-libre-4.14-source
444 (source-with-patches linux-libre-4.14-pristine-source
445 (list %boot-logo-patch)))
446
447 (define-public linux-libre-4.9-source
448 (source-with-patches linux-libre-4.9-pristine-source
449 (list %boot-logo-patch)))
450
451 (define-public linux-libre-4.4-source
452 (source-with-patches linux-libre-4.4-pristine-source
453 (list %boot-logo-patch)))
454
455 \f
456 ;;;
457 ;;; Kernel headers.
458 ;;;
459
460 (define (make-linux-libre-headers version hash-string)
461 (make-linux-libre-headers* version
462 (origin
463 (method url-fetch)
464 (uri (linux-libre-urls version))
465 (sha256 (base32 hash-string)))))
466
467 (define (make-linux-libre-headers* version source)
468 (package
469 (name "linux-libre-headers")
470 (version version)
471 (source source)
472 (build-system gnu-build-system)
473 (native-inputs `(("perl" ,perl)
474 ,@(if (version>=? version "4.16")
475 `(("flex" ,flex)
476 ("bison" ,bison))
477 '())
478 ,@(if (version>=? version "5.3")
479 `(("rsync" ,rsync))
480 '())))
481 (arguments
482 `(#:modules ((guix build gnu-build-system)
483 (guix build utils)
484 (srfi srfi-1))
485 #:phases
486 (modify-phases %standard-phases
487 (delete 'configure)
488 (replace 'build
489 (lambda _
490 (let ((arch ,(system->linux-architecture
491 (or (%current-target-system)
492 (%current-system))))
493 (defconfig ,(system->defconfig
494 (or (%current-target-system)
495 (%current-system)))))
496 (setenv "ARCH" arch)
497 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
498 (invoke "make" defconfig)
499 (invoke "make" "mrproper" "headers_check"))))
500 (replace 'install
501 (lambda* (#:key outputs #:allow-other-keys)
502 (let ((out (assoc-ref outputs "out")))
503 (invoke "make"
504 (string-append "INSTALL_HDR_PATH=" out)
505 "headers_install")
506
507 (mkdir (string-append out "/include/config"))
508 (call-with-output-file
509 (string-append out
510 "/include/config/kernel.release")
511 (lambda (p)
512 (format p "~a-default~%" ,version)))
513
514 ;; Remove the '.install' and '..install.cmd' files; the
515 ;; latter contains store paths, which pulls in bootstrap
516 ;; binaries in the build environment, and prevents bit
517 ;; reproducibility for the bootstrap binaries.
518 (for-each delete-file (find-files out "\\.install"))
519
520 #t))))
521 #:allowed-references ()
522 #:tests? #f))
523 (home-page "https://www.gnu.org/software/linux-libre/")
524 (synopsis "GNU Linux-Libre kernel headers")
525 (description "Headers of the Linux-Libre kernel.")
526 (license license:gpl2)))
527
528 (define-public linux-libre-headers-5.4
529 (make-linux-libre-headers* linux-libre-5.4-version
530 linux-libre-5.4-source))
531
532 (define-public linux-libre-headers-4.19
533 (make-linux-libre-headers* linux-libre-4.19-version
534 linux-libre-4.19-source))
535
536 (define-public linux-libre-headers-4.14
537 (make-linux-libre-headers* linux-libre-4.14-version
538 linux-libre-4.14-source))
539
540 (define-public linux-libre-headers-4.9
541 (make-linux-libre-headers* linux-libre-4.9-version
542 linux-libre-4.9-source))
543
544 (define-public linux-libre-headers-4.4
545 (make-linux-libre-headers* linux-libre-4.4-version
546 linux-libre-4.4-source))
547
548 ;; The following package is used in the early bootstrap, and thus must be kept
549 ;; stable and with minimal build requirements.
550 (define-public linux-libre-headers-4.19.56
551 (make-linux-libre-headers "4.19.56"
552 "1zqiic55viy065lhnkmhn33sz3bbbr2ykbm5f92yzd8lpc9zl7yx"))
553
554 (define-public linux-libre-headers linux-libre-headers-4.19.56)
555
556 \f
557 ;;;
558 ;;; Kernel configurations.
559 ;;;
560
561 (define* (kernel-config arch #:key variant)
562 "Return the absolute file name of the Linux-Libre build configuration file
563 for ARCH and optionally VARIANT, or #f if there is no such configuration."
564 (let* ((name (string-append (if variant (string-append variant "-") "")
565 (if (string=? "i386" arch) "i686" arch) ".conf"))
566 (file (string-append "linux-libre/" name)))
567 (search-auxiliary-file file)))
568
569 ;; FIXME: merge into kernel-config
570 (define* (kernel-config-veyron arch #:key variant)
571 "Return the absolute file name of the Linux-Libre build configuration file
572 for ARCH and optionally VARIANT, or #f if there is no such configuration."
573 (let* ((name (string-append (if variant (string-append variant "-") "")
574 (if (string=? "i386" arch) "i686" arch) "-veyron.conf"))
575 (file (string-append "linux-libre/" name)))
576 (search-auxiliary-file file)))
577
578 (define %default-extra-linux-options
579 `(;; Some very mild hardening.
580 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
581 ;; All kernels should have NAMESPACES options enabled
582 ("CONFIG_NAMESPACES" . #t)
583 ("CONFIG_UTS_NS" . #t)
584 ("CONFIG_IPC_NS" . #t)
585 ("CONFIG_USER_NS" . #t)
586 ("CONFIG_PID_NS" . #t)
587 ("CONFIG_NET_NS" . #t)
588 ;; Modules required for initrd:
589 ("CONFIG_NET_9P" . m)
590 ("CONFIG_NET_9P_VIRTIO" . m)
591 ("CONFIG_VIRTIO_BLK" . m)
592 ("CONFIG_VIRTIO_NET" . m)
593 ("CONFIG_VIRTIO_PCI" . m)
594 ("CONFIG_VIRTIO_BALLOON" . m)
595 ("CONFIG_VIRTIO_MMIO" . m)
596 ("CONFIG_FUSE_FS" . m)
597 ("CONFIG_CIFS" . m)
598 ("CONFIG_9P_FS" . m)))
599
600 (define (config->string options)
601 (string-join (map (match-lambda
602 ((option . 'm)
603 (string-append option "=m"))
604 ((option . #t)
605 (string-append option "=y"))
606 ((option . #f)
607 (string-append option "=n")))
608 options)
609 "\n"))
610
611 \f
612 ;;;
613 ;;; Kernel package utilities.
614 ;;;
615
616 (define* (make-linux-libre version hash-string supported-systems
617 #:key
618 ;; A function that takes an arch and a variant.
619 ;; See kernel-config for an example.
620 (extra-version #f)
621 (configuration-file #f)
622 (defconfig "defconfig")
623 (extra-options %default-extra-linux-options)
624 (patches (list %boot-logo-patch)))
625 (make-linux-libre* version
626 (origin
627 (method url-fetch)
628 (uri (linux-libre-urls version))
629 (sha256 (base32 hash-string))
630 (patches patches))
631 supported-systems
632 #:extra-version extra-version
633 #:configuration-file configuration-file
634 #:defconfig defconfig
635 #:extra-options extra-options))
636
637 (define* (make-linux-libre* version source supported-systems
638 #:key
639 ;; A function that takes an arch and a variant.
640 ;; See kernel-config for an example.
641 (extra-version #f)
642 (configuration-file #f)
643 (defconfig "defconfig")
644 (extra-options %default-extra-linux-options))
645 (package
646 (name (if extra-version
647 (string-append "linux-libre-" extra-version)
648 "linux-libre"))
649 (version version)
650 (source source)
651 (supported-systems supported-systems)
652 (build-system gnu-build-system)
653 (native-inputs
654 `(("perl" ,perl)
655 ("bc" ,bc)
656 ("openssl" ,openssl)
657 ("kmod" ,kmod)
658 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
659 ("flex" ,flex)
660 ("bison" ,bison)
661
662 ;; These are needed to compile the GCC plugins.
663 ("gmp" ,gmp)
664 ("mpfr" ,mpfr)
665 ("mpc" ,mpc)
666
667 ,@(match (and configuration-file
668 (configuration-file
669 (system->linux-architecture
670 (or (%current-target-system) (%current-system)))
671 #:variant (version-major+minor version)))
672 (#f ;no config for this platform
673 '())
674 ((? string? config)
675 `(("kconfig" ,config))))))
676 (arguments
677 `(#:modules ((guix build gnu-build-system)
678 (guix build utils)
679 (srfi srfi-1)
680 (srfi srfi-26)
681 (ice-9 match))
682 #:phases
683 (modify-phases %standard-phases
684 (add-after 'unpack 'patch-/bin/pwd
685 (lambda _
686 (substitute* (find-files "." "^Makefile(\\.include)?$")
687 (("/bin/pwd") "pwd"))
688 #t))
689 (replace 'configure
690 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
691 ;; On AArch64 (at least), we need to remove glibc headers from
692 ;; CPATH (they are still available as "system headers"), so that
693 ;; the kernel can override uint64_t. See
694 ;; <https://bugs.gnu.org/37593>. This is also true when
695 ;; cross-compiling, except in that case, cross-libc must be
696 ;; removed from CROSS_CPATH.
697 (let ((var ,(if (%current-target-system)
698 "CROSS_CPATH"
699 "CPATH"))
700 (libc ,(if (%current-target-system)
701 "cross-libc"
702 "libc")))
703 (setenv var
704 (string-join
705 (remove
706 (cut string-prefix? (assoc-ref inputs libc) <>)
707 (string-split (getenv var) #\:))
708 ":"))
709 (format #t "environment variable `~a' changed to `~a'~%"
710 var (getenv var)))
711
712 ;; Avoid introducing timestamps
713 (setenv "KCONFIG_NOTIMESTAMP" "1")
714 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
715
716 ;; Set ARCH and CROSS_COMPILE
717 (let ((arch ,(system->linux-architecture
718 (or (%current-target-system)
719 (%current-system)))))
720 (setenv "ARCH" arch)
721 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
722
723 (when target
724 (setenv "CROSS_COMPILE" (string-append target "-"))
725 (format #t "`CROSS_COMPILE' set to `~a'~%"
726 (getenv "CROSS_COMPILE"))))
727
728 (setenv "EXTRA_VERSION" ,extra-version)
729
730 (let ((build (assoc-ref %standard-phases 'build))
731 (config (assoc-ref (or native-inputs inputs) "kconfig")))
732
733 ;; Use a custom kernel configuration file or a default
734 ;; configuration file.
735 (if config
736 (begin
737 (copy-file config ".config")
738 (chmod ".config" #o666))
739 (invoke "make" ,defconfig))
740
741 ;; Appending works even when the option wasn't in the
742 ;; file. The last one prevails if duplicated.
743 (let ((port (open-file ".config" "a"))
744 (extra-configuration ,(config->string extra-options)))
745 (display extra-configuration port)
746 (close-port port))
747
748 (invoke "make" "oldconfig"))))
749 (replace 'install
750 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
751 (let* ((out (assoc-ref outputs "out"))
752 (moddir (string-append out "/lib/modules"))
753 (dtbdir (string-append out "/lib/dtbs"))
754 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
755 ;; Install kernel image, kernel configuration and link map.
756 (for-each (lambda (file) (install-file file out))
757 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
758 ;; Install device tree files
759 (unless (null? (find-files "." "\\.dtb$"))
760 (mkdir-p dtbdir)
761 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
762 "dtbs_install"))
763 ;; Install kernel modules
764 (mkdir-p moddir)
765 (invoke "make"
766 (string-append "DEPMOD=" kmod "/bin/depmod")
767 (string-append "MODULE_DIR=" moddir)
768 (string-append "INSTALL_PATH=" out)
769 (string-append "INSTALL_MOD_PATH=" out)
770 "INSTALL_MOD_STRIP=1"
771 "modules_install")))))
772 #:tests? #f))
773 (home-page "https://www.gnu.org/software/linux-libre/")
774 (synopsis "100% free redistribution of a cleaned Linux kernel")
775 (description
776 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
777 It has been modified to remove all non-free binary blobs.")
778 (license license:gpl2)))
779
780 \f
781 ;;;
782 ;;; Generic kernel packages.
783 ;;;
784
785 (define-public linux-libre-5.4
786 (make-linux-libre* linux-libre-5.4-version
787 linux-libre-5.4-source
788 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
789 #:configuration-file kernel-config))
790
791 (define-public linux-libre-version linux-libre-5.4-version)
792 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
793 (define-public linux-libre-source linux-libre-5.4-source)
794 (define-public linux-libre linux-libre-5.4)
795
796 (define-public linux-libre-4.19
797 (make-linux-libre* linux-libre-4.19-version
798 linux-libre-4.19-source
799 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
800 #:configuration-file kernel-config))
801
802 (define-public linux-libre-4.14
803 (make-linux-libre* linux-libre-4.14-version
804 linux-libre-4.14-source
805 '("x86_64-linux" "i686-linux" "armhf-linux")
806 #:configuration-file kernel-config))
807
808 (define-public linux-libre-4.9
809 (make-linux-libre* linux-libre-4.9-version
810 linux-libre-4.9-source
811 '("x86_64-linux" "i686-linux")
812 #:configuration-file kernel-config))
813
814 (define-public linux-libre-4.4
815 (make-linux-libre* linux-libre-4.4-version
816 linux-libre-4.4-source
817 '("x86_64-linux" "i686-linux")
818 #:configuration-file kernel-config
819 #:extra-options
820 (append
821 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
822 ;; This option was removed upstream in version 4.7.
823 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
824 %default-extra-linux-options)))
825
826 \f
827 ;;;
828 ;;; Specialized kernel variants.
829 ;;;
830
831 (define-public linux-libre-arm-veyron
832 (make-linux-libre* linux-libre-version
833 linux-libre-source
834 '("armhf-linux")
835 #:configuration-file kernel-config-veyron
836 #:extra-version "arm-veyron"))
837
838 (define-public linux-libre-arm-generic
839 (make-linux-libre* linux-libre-version
840 linux-libre-source
841 '("armhf-linux")
842 #:defconfig "multi_v7_defconfig"
843 #:extra-version "arm-generic"))
844
845 (define-public linux-libre-arm-generic-4.19
846 (make-linux-libre* linux-libre-4.19-version
847 linux-libre-4.19-source
848 '("armhf-linux")
849 #:defconfig "multi_v7_defconfig"
850 #:extra-version "arm-generic"))
851
852 (define-public linux-libre-arm-generic-4.14
853 (make-linux-libre* linux-libre-4.14-version
854 linux-libre-4.14-source
855 '("armhf-linux")
856 #:defconfig "multi_v7_defconfig"
857 #:extra-version "arm-generic"))
858
859 (define-public linux-libre-arm-omap2plus
860 (make-linux-libre* linux-libre-version
861 linux-libre-source
862 '("armhf-linux")
863 #:defconfig "omap2plus_defconfig"
864 #:extra-version "arm-omap2plus"))
865
866 (define-public linux-libre-arm-omap2plus-4.19
867 (make-linux-libre* linux-libre-4.19-version
868 linux-libre-4.19-source
869 '("armhf-linux")
870 #:defconfig "omap2plus_defconfig"
871 #:extra-version "arm-omap2plus"))
872
873 (define-public linux-libre-arm-omap2plus-4.14
874 (make-linux-libre* linux-libre-4.14-version
875 linux-libre-4.14-source
876 '("armhf-linux")
877 #:defconfig "omap2plus_defconfig"
878 #:extra-version "arm-omap2plus"))
879
880 (define-public linux-libre-riscv64-generic
881 (make-linux-libre* linux-libre-version
882 linux-libre-source
883 '("riscv64-linux")
884 #:extra-version "riscv64-generic"))
885
886 \f
887 ;;;
888 ;;; Linux kernel modules.
889 ;;;
890
891 (define-public acpi-call-linux-module
892 (package
893 (name "acpi-call-linux-module")
894 (version "3.17")
895 (source
896 (origin
897 (method git-fetch)
898 (uri (git-reference
899 (url "https://github.com/teleshoes/acpi_call.git")
900 (commit version)))
901 (file-name (git-file-name name version))
902 (sha256
903 (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
904 (build-system linux-module-build-system)
905 (arguments
906 `(#:tests? #f ; no tests
907 #:phases
908 (modify-phases %standard-phases
909 (add-after 'unpack 'fix-for-linux-4.12
910 (lambda _
911 (substitute* "acpi_call.c"
912 (("asm/uaccess\\.h")
913 "linux/uaccess.h"))
914 #t))
915 (add-after 'install 'install-documentation
916 (lambda* (#:key outputs #:allow-other-keys)
917 (let* ((out (assoc-ref outputs "out"))
918 (doc (string-append out "/share/doc/" ,name "-" ,version)))
919 (for-each (lambda (file)
920 (let ((target (string-append doc "/" file)))
921 (mkdir-p (dirname target))
922 (copy-recursively file target)))
923 (list "README.md" "examples"))
924 #t))))))
925 (home-page "https://github.com/teleshoes/acpi_call")
926 (synopsis "Linux kernel module to perform ACPI method calls")
927 (description
928 "This simple Linux kernel module allows calls from user space to any
929 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
930 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
931 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
932 and @code{ACPI_BUFFER}.
933
934 It grants direct and undocumented access to your hardware that may cause damage
935 and should be used with caution, especially on untested models.")
936 (license license:gpl3+))) ; see README.md (no licence headers)
937
938 (define-public rtl8812au-aircrack-ng-linux-module
939 (let ((commit "945d6ed6505c32f0993b1dba576388e92e78101b")
940 (revision "0"))
941 (package
942 (name "rtl8812au-aircrack-ng-linux-module")
943 (version (git-version "5.6.4.2" revision commit))
944 (source
945 (origin
946 (method git-fetch)
947 (uri (git-reference
948 (url "https://github.com/aircrack-ng/rtl8812au.git")
949 (commit commit)))
950 (file-name (git-file-name name version))
951 (sha256
952 (base32 "1pjws7qb5l4z9k80vgz4zdxmqhbwxjjrmkpf0hijf821byyddvi7"))
953 (modules '((guix build utils)))
954 (snippet
955 '(begin
956 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
957 ;; and other unnecessary unlicenced things.
958 (for-each delete-file-recursively (list "android"
959 "docs"
960 "tools"))
961 #t))))
962 (build-system linux-module-build-system)
963 (arguments
964 `(#:phases
965 (modify-phases %standard-phases
966 (replace 'build
967 (lambda* (#:key inputs make-flags #:allow-other-keys)
968 (apply invoke "make"
969 (string-append "KSRC="
970 (assoc-ref inputs "linux-module-builder")
971 "/lib/modules/build")
972 (or make-flags '())))))
973 #:tests? #f)) ; no test suite
974 (supported-systems '("x86_64-linux" "i686-linux"))
975 (home-page "https://github.com/aircrack-ng/rtl8812au")
976 (synopsis "Linux driver for Realtek USB wireless network adapters")
977 (description
978 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
979 network adapters, modified by the aircrack-ng project to support monitor mode
980 and frame injection. It provides a @code{88XXau} kernel module that supports
981 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
982 (license license:gpl2+))))
983
984 (define-public vhba-module
985 (package
986 (name "vhba-module")
987 (version "20200106")
988 (source (origin
989 (method url-fetch)
990 (uri (string-append
991 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
992 version ".tar.bz2"))
993 (sha256
994 (base32
995 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
996 (build-system linux-module-build-system)
997 (arguments
998 ;; TODO: No tests?
999 `(#:tests? #f))
1000 (home-page "https://cdemu.sourceforge.io/")
1001 (synopsis "Kernel module that emulates SCSI devices")
1002 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1003 between the CDemu userspace daemon and linux kernel.")
1004 (license license:gpl2+)))
1005
1006 (define-public ddcci-driver-linux
1007 (package
1008 (name "ddcci-driver-linux")
1009 (version "0.3.3")
1010 (source
1011 (origin
1012 (method git-fetch)
1013 (uri
1014 (git-reference
1015 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1016 (commit (string-append "v" version))))
1017 (file-name (git-file-name name version))
1018 (sha256
1019 (base32
1020 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1021 (build-system linux-module-build-system)
1022 (arguments
1023 `(#:tests? #f ; no tests
1024 #:phases
1025 (modify-phases %standard-phases
1026 (replace 'build
1027 (lambda args
1028 (for-each
1029 (lambda (module)
1030 (with-directory-excursion module
1031 (apply (assoc-ref %standard-phases 'build) args)))
1032 '("ddcci" "ddcci-backlight"))
1033 #t))
1034 (replace 'install
1035 (lambda args
1036 (for-each
1037 (lambda (module)
1038 (with-directory-excursion module
1039 (apply (assoc-ref %standard-phases 'install) args)))
1040 '("ddcci" "ddcci-backlight"))
1041 #t)))))
1042 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1043 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1044 (description "This package provides two Linux kernel drivers, ddcci and
1045 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1046 interface. The ddcci module creates a character device for each DDC/CI
1047 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1048 module allows the control of the backlight level or luminance property when
1049 supported under @file{/sys/class/backlight/}.")
1050 (license license:gpl2+)))
1051
1052 \f
1053 ;;;
1054 ;;; Pluggable authentication modules (PAM).
1055 ;;;
1056
1057 (define-public linux-pam
1058 (package
1059 (name "linux-pam")
1060 (version "1.3.1")
1061 (source
1062 (origin
1063 (method url-fetch)
1064 (uri (string-append
1065 "https://github.com/linux-pam/linux-pam/releases/download/v"
1066 version "/Linux-PAM-" version ".tar.xz"))
1067 (sha256
1068 (base32
1069 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1070 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1071
1072 (build-system gnu-build-system)
1073 (native-inputs
1074 `(("flex" ,flex)
1075
1076 ;; TODO: optional dependencies
1077 ;; ("libxcrypt" ,libxcrypt)
1078 ;; ("cracklib" ,cracklib)
1079 ))
1080 (arguments
1081 `(;; Most users, such as `shadow', expect the headers to be under
1082 ;; `security'.
1083 #:configure-flags (list (string-append "--includedir="
1084 (assoc-ref %outputs "out")
1085 "/include/security")
1086
1087 ;; XXX: <rpc/rpc.h> is missing from glibc when
1088 ;; cross-compiling, so we have to disable NIS
1089 ;; support altogether.
1090 ,@(if (%current-target-system)
1091 '("--disable-nis")
1092 '()))
1093
1094 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1095 ;; isn't available.
1096 #:tests? #f))
1097 (home-page "http://www.linux-pam.org/")
1098 (synopsis "Pluggable authentication modules for Linux")
1099 (description
1100 "A *Free* project to implement OSF's RFC 86.0.
1101 Pluggable authentication modules are small shared object files that can
1102 be used through the PAM API to perform tasks, like authenticating a user
1103 at login. Local and dynamic reconfiguration are its key features.")
1104 (license license:bsd-3)))
1105
1106 (define-public linux-pam-1.2
1107 (package
1108 (inherit linux-pam)
1109 (version "1.2.1")
1110 (source
1111 (origin
1112 (method url-fetch)
1113 (uri (string-append
1114 "http://www.linux-pam.org/library/"
1115 "Linux-PAM-" version ".tar.bz2"))
1116 (sha256
1117 (base32
1118 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1119 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1120
1121
1122 ;;;
1123 ;;; Miscellaneous.
1124 ;;;
1125
1126 (define-public psmisc
1127 (package
1128 (name "psmisc")
1129 (version "23.3")
1130 (source
1131 (origin
1132 (method url-fetch)
1133 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1134 version ".tar.xz"))
1135 (sha256
1136 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1137 (build-system gnu-build-system)
1138 (arguments
1139 `(,@(if (%current-target-system)
1140 '(#:configure-flags
1141 (list
1142 "ac_cv_func_malloc_0_nonnull=yes"
1143 "ac_cv_func_realloc_0_nonnull=yes"))
1144 '())))
1145 (inputs `(("ncurses" ,ncurses)))
1146 (home-page "https://gitlab.com/psmisc/psmisc")
1147 (synopsis "Small utilities that use the proc file system")
1148 (description
1149 "This PSmisc package is a set of some small useful utilities that
1150 use the proc file system. We're not about changing the world, but
1151 providing the system administrator with some help in common tasks.")
1152 (license license:gpl2+)))
1153
1154 (define-public util-linux
1155 (package
1156 (name "util-linux")
1157 (version "2.34")
1158 (source (origin
1159 (method url-fetch)
1160 (uri (string-append "mirror://kernel.org/linux/utils/"
1161 "util-linux/v" (version-major+minor version) "/"
1162 "util-linux-" version ".tar.xz"))
1163 (sha256
1164 (base32
1165 "1db2kydkwjmvgd1glkcba3adhidxw0f1x735dcjdpdjjf869sgvl"))
1166 (patches (search-patches "util-linux-tests.patch"))
1167 (modules '((guix build utils)))
1168 (snippet
1169 ;; We take 'nologin' from Shadow, the 'logger' program from
1170 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1171 '(begin
1172 (substitute* "configure"
1173 (("build_nologin=yes") "build_nologin=no")
1174 (("build_logger=yes") "build_logger=no")
1175 (("build_kill=yes") "build_kill=no"))
1176 #t))))
1177 (build-system gnu-build-system)
1178 (outputs '("out"
1179 "static")) ;>2 MiB of static .a libraries
1180 (arguments
1181 `(#:configure-flags (list "--disable-use-tty-group"
1182 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1183 ;; Don't try to chown root:root mount and umount
1184 "--disable-makeinstall-chown"
1185 ;; Install completions where our
1186 ;; bash-completion package expects them.
1187 (string-append "--with-bashcompletiondir="
1188 (assoc-ref %outputs "out")
1189 "/etc/bash_completion.d"))
1190 #:phases (modify-phases %standard-phases
1191 (add-before 'build 'set-umount-file-name
1192 (lambda* (#:key outputs #:allow-other-keys)
1193 ;; Tell 'eject' the right file name of 'umount'.
1194 (let ((out (assoc-ref outputs "out")))
1195 (substitute* "sys-utils/eject.c"
1196 (("\"/bin/umount\"")
1197 (string-append "\"" out "/bin/umount\"")))
1198 #t)))
1199 (add-before 'check 'pre-check
1200 (lambda* (#:key inputs outputs #:allow-other-keys)
1201 (let ((out (assoc-ref outputs "out"))
1202 (net (assoc-ref inputs "net-base")))
1203 ;; Change the test to refer to the right file.
1204 (substitute* "tests/ts/misc/mcookie"
1205 (("/etc/services")
1206 (string-append net "/etc/services")))
1207 #t)))
1208 (add-after 'install 'move-static-libraries
1209 (lambda* (#:key outputs #:allow-other-keys)
1210 (let ((out (assoc-ref outputs "out"))
1211 (static (assoc-ref outputs "static")))
1212 (mkdir-p (string-append static "/lib"))
1213 (with-directory-excursion out
1214 (for-each (lambda (file)
1215 (rename-file file
1216 (string-append static "/"
1217 file)))
1218 (find-files "lib" "\\.a$"))
1219
1220 ;; Remove references to the static library from the '.la'
1221 ;; files so that Libtool does the right thing when both
1222 ;; the shared and static library is available.
1223 (substitute* (find-files "lib" "\\.la$")
1224 (("old_library=.*") "old_library=''\n")))
1225
1226 #t))))))
1227 (inputs `(("zlib" ,zlib)
1228 ("ncurses" ,ncurses)
1229
1230 ;; XXX: This is so that the 'pre-check' phase can find it.
1231 ,@(if (%current-target-system)
1232 `(("net-base" ,net-base))
1233 '())))
1234 (native-inputs
1235 `(("perl" ,perl)
1236 ("net-base" ,net-base))) ;for tests
1237 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1238 (synopsis "Collection of utilities for the Linux kernel")
1239 (description "Util-linux is a diverse collection of Linux kernel
1240 utilities. It provides dmesg and includes tools for working with file systems,
1241 block devices, UUIDs, TTYs, and many other tools.")
1242
1243 ;; Note that util-linux doesn't use the same license for all the
1244 ;; code. GPLv2+ is the default license for a code without an
1245 ;; explicitly defined license.
1246 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1247 license:bsd-4 license:public-domain))))
1248
1249 ;; util-linux optionally supports udev, which allows lsblk to read file system
1250 ;; metadata without special privileges. Add it as a separate package to avoid
1251 ;; a circular dependency, and to keep the size small.
1252 (define-public util-linux+udev
1253 (package/inherit
1254 util-linux
1255 (name "util-linux-with-udev")
1256 (inputs
1257 `(("udev" ,eudev)
1258 ,@(package-inputs util-linux)))))
1259
1260 (define-public ddate
1261 (package
1262 (name "ddate")
1263 (version "0.2.2")
1264 (source (origin
1265 (method url-fetch)
1266 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1267 version ".tar.gz"))
1268 (file-name (string-append name "-" version ".tar.gz"))
1269 (sha256
1270 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1271 (build-system cmake-build-system)
1272 (arguments '(#:tests? #f))
1273 (home-page "https://github.com/bo0ts/ddate")
1274 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1275 (description
1276 "ddate displays the Discordian date and holidays of a given date.
1277 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1278 by Robert Shea and Robert Anton Wilson.")
1279 (license license:public-domain)))
1280
1281 (define-public fbset
1282 (package
1283 (name "fbset")
1284 (version "2.1")
1285 (source
1286 (origin
1287 (method url-fetch)
1288 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1289 version ".tar.gz"))
1290 (sha256
1291 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1292 (build-system gnu-build-system)
1293 (arguments
1294 '(#:modules ((guix build gnu-build-system)
1295 (guix build utils)
1296 (srfi srfi-26))
1297 #:phases
1298 (modify-phases %standard-phases
1299 (delete 'configure) ; no configure script
1300 (add-before 'install 'pre-install
1301 (lambda* (#:key outputs #:allow-other-keys)
1302 (let ((out (assoc-ref outputs "out")))
1303 (substitute* "Makefile"
1304 (("mknod ") "true ")
1305 ;; The Makefile doesn't honour PREFIX or similar.
1306 (("/usr") out))
1307 (mkdir out)
1308 (with-directory-excursion out
1309 (for-each mkdir-p (list "sbin"
1310 "man/man5"
1311 "man/man8")))
1312 #t)))
1313 (add-after 'install 'install-fb.modes
1314 (lambda* (#:key outputs #:allow-other-keys)
1315 (let* ((out (assoc-ref outputs "out"))
1316 (etc (string-append out "/etc")))
1317 (for-each (cut install-file <> etc)
1318 (find-files "etc" "^fb\\.modes"))
1319 (symlink "fb.modes.ATI"
1320 (string-append etc "/fb.modes"))
1321 #t))))
1322 ;; Parallel building races to create modes.tab.c.
1323 #:parallel-build? #f
1324 #:tests? #f)) ; no test suite
1325 (native-inputs
1326 `(("bison" ,bison)
1327 ("flex" ,flex)))
1328 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1329 (synopsis "Show and modify Linux frame buffer settings")
1330 (description
1331 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1332 different kinds of graphic displays. The @command{fbset} utility can query and
1333 change various device settings such as depth, virtual resolution, and timing
1334 parameters.")
1335 (license license:gpl2)))
1336
1337 (define-public procps
1338 (package
1339 (name "procps")
1340 (version "3.3.16")
1341 (source (origin
1342 (method url-fetch)
1343 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1344 "procps-ng-" version ".tar.xz"))
1345 (sha256
1346 (base32
1347 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1348 (build-system gnu-build-system)
1349 (arguments
1350 '(#:modules ((guix build utils)
1351 (guix build gnu-build-system)
1352 (srfi srfi-1)
1353 (srfi srfi-26))
1354 #:phases
1355 (modify-phases %standard-phases
1356 (add-after
1357 'install 'post-install
1358 ;; Remove commands and man pages redudant with
1359 ;; Coreutils.
1360 (lambda* (#:key outputs #:allow-other-keys)
1361 (let* ((out (assoc-ref outputs "out"))
1362 (dup (append-map (cut find-files out <>)
1363 '("^kill" "^uptime"))))
1364 (for-each delete-file dup)
1365 #t))))))
1366 (inputs `(("ncurses" ,ncurses)))
1367 (home-page "https://gitlab.com/procps-ng/procps/")
1368 (synopsis "Utilities that give information about processes")
1369 (description
1370 "Procps is the package that has a bunch of small useful utilities
1371 that give information about processes using the Linux /proc file system.
1372 The package includes the programs ps, top, vmstat, w, kill, free,
1373 slabtop, and skill.")
1374 (license license:gpl2)))
1375
1376 (define-public usbutils
1377 (package
1378 (name "usbutils")
1379 (version "012")
1380 (source
1381 (origin
1382 (method url-fetch)
1383 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1384 "usbutils-" version ".tar.xz"))
1385 (sha256
1386 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1387 (build-system gnu-build-system)
1388 (outputs (list "out" "python"))
1389 (arguments
1390 `(#:phases
1391 (modify-phases %standard-phases
1392 (add-before 'bootstrap 'patch-bootstrap-scripts
1393 (lambda _
1394 (substitute* "usbhid-dump/bootstrap"
1395 (("/bin/bash") (which "bash")))
1396
1397 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1398 (substitute* "autogen.sh"
1399 (("^\\./configure.*") ""))
1400 #t))
1401 (add-after 'install 'separate-python-output
1402 ;; Separating one Python script shaves more than 106 MiB from :out.
1403 (lambda* (#:key outputs #:allow-other-keys)
1404 (let ((out (assoc-ref outputs "out"))
1405 (out:python (assoc-ref outputs "python")))
1406 (for-each (lambda (file)
1407 (let ((old (string-append out "/" file))
1408 (new (string-append out:python "/" file)))
1409 (mkdir-p (dirname new))
1410 (rename-file old new)))
1411 (list "bin/lsusb.py"))
1412 #t))))))
1413 (inputs
1414 `(("eudev" ,eudev)
1415 ("libusb" ,libusb)
1416 ("python" ,python)))
1417 (native-inputs
1418 `(("autoconf" ,autoconf)
1419 ("automake" ,automake)
1420 ("libtool" ,libtool)
1421 ("pkg-config" ,pkg-config)))
1422 (home-page "http://www.linux-usb.org/")
1423 (synopsis
1424 "Tools for working with USB devices, such as lsusb")
1425 (description
1426 "Tools for working with USB devices, such as lsusb.")
1427 (license license:gpl2+)))
1428
1429 (define-public e2fsprogs
1430 (package
1431 (name "e2fsprogs")
1432 (version "1.45.5")
1433 (source (origin
1434 (method url-fetch)
1435 (uri (string-append
1436 "mirror://kernel.org/linux/kernel/people/tytso/"
1437 name "/v" version "/"
1438 name "-" version ".tar.xz"))
1439 (sha256
1440 (base32
1441 "1pmf8inp736l587rqq7qsd8bv0mmg5cwrivxg5p5awqgv70crypr"))))
1442 (build-system gnu-build-system)
1443 (inputs `(("util-linux" ,util-linux)))
1444 (native-inputs `(("pkg-config" ,pkg-config)
1445 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1446
1447 ;; For tests.
1448 ("perl" ,perl)
1449 ("procps" ,procps)))
1450 (arguments
1451 '(;; util-linux is the preferred source for some of the libraries and
1452 ;; commands, so disable them (see, e.g.,
1453 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1454 #:configure-flags (list "--disable-libblkid"
1455 "--disable-libuuid" "--disable-uuidd"
1456 "--disable-fsck"
1457
1458 ;; Use symlinks instead of hard links for
1459 ;; 'fsck.extN' etc. This makes the resulting nar
1460 ;; smaller and is preserved across copies.
1461 "--enable-symlink-install"
1462
1463 (string-append "LDFLAGS=-Wl,-rpath="
1464 (assoc-ref %outputs "out")
1465 "/lib")
1466
1467 ;; Install libext2fs et al.
1468 "--enable-elf-shlibs")
1469
1470 #:phases
1471 (modify-phases %standard-phases
1472 (add-before 'configure 'patch-shells
1473 (lambda _
1474 (substitute* "configure"
1475 (("/bin/sh (.*)parse-types.sh" _ dir)
1476 (string-append (which "sh") " " dir
1477 "parse-types.sh")))
1478 (substitute* "MCONFIG.in"
1479 (("INSTALL_SYMLINK = /bin/sh")
1480 "INSTALL_SYMLINK = sh"))
1481 (substitute* (find-files "." "^Makefile.in$")
1482 (("#!/bin/sh")
1483 (string-append "#!" (which "sh"))))
1484 #t))
1485 (add-after 'install 'install-libs
1486 (lambda* (#:key outputs #:allow-other-keys)
1487 (let* ((out (assoc-ref outputs "out"))
1488 (lib (string-append out "/lib")))
1489 (invoke "make" "install-libs")
1490
1491 ;; Make the .a writable so that 'strip' works.
1492 ;; Failing to do that, due to debug symbols, we
1493 ;; retain a reference to the final
1494 ;; linux-libre-headers, which refer to the
1495 ;; bootstrap binaries.
1496 (let ((archives (find-files lib "\\.a$")))
1497 (for-each (lambda (file)
1498 (chmod file #o666))
1499 archives))
1500 #t))))))
1501 (home-page "http://e2fsprogs.sourceforge.net/")
1502 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1503 (description
1504 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1505 (license (list license:gpl2 ;programs
1506 license:lgpl2.0 ;libext2fs
1507 license:x11)))) ;libuuid
1508
1509 (define e2fsprogs/static
1510 (static-package
1511 (package (inherit e2fsprogs)
1512 (arguments
1513 ;; Do not build shared libraries.
1514 (substitute-keyword-arguments (package-arguments e2fsprogs)
1515 ((#:configure-flags _)
1516 '(list "--disable-blkid"))
1517 ((#:make-flags _)
1518 '(list)))))))
1519
1520 (define-public e2fsck/static
1521 (package
1522 (name "e2fsck-static")
1523 (version (package-version e2fsprogs))
1524 (build-system trivial-build-system)
1525 (source #f)
1526 (inputs
1527 `(("e2fsprogs" ,e2fsprogs/static)))
1528 (arguments
1529 `(#:modules ((guix build utils))
1530 #:builder
1531 (begin
1532 (use-modules (guix build utils)
1533 (ice-9 ftw)
1534 (srfi srfi-26))
1535
1536 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1537 "/sbin/e2fsck"))
1538 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1539 (mkdir-p bin)
1540 (with-directory-excursion bin
1541 (copy-file e2fsck "e2fsck")
1542 (remove-store-references "e2fsck")
1543 (chmod "e2fsck" #o555))
1544 #t))))
1545 (home-page (package-home-page e2fsprogs))
1546 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1547 (description "This package provides statically-linked e2fsck command taken
1548 from the e2fsprogs package. It is meant to be used in initrds.")
1549 (license (package-license e2fsprogs))))
1550
1551 (define-public extundelete
1552 (package
1553 (name "extundelete")
1554 (version "0.2.4")
1555 (source
1556 (origin
1557 (method url-fetch)
1558 (uri (string-append "mirror://sourceforge/extundelete/"
1559 "extundelete/" version "/extundelete-"
1560 version ".tar.bz2"))
1561 (sha256
1562 (base32
1563 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1564 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1565 (build-system gnu-build-system)
1566 (inputs `(("e2fsprogs" ,e2fsprogs)))
1567 (home-page "http://extundelete.sourceforge.net/")
1568 (synopsis "Recover deleted files from ext2/3/4 partitions")
1569 (description
1570 "Extundelete is a set of tools that can recover deleted files from an
1571 ext3 or ext4 partition.")
1572 (license license:gpl2)))
1573
1574 (define-public zerofree
1575 (package
1576 (name "zerofree")
1577 (version "1.1.1")
1578 (home-page "https://frippery.org/uml/")
1579 (source (origin
1580 (method url-fetch)
1581 (uri (string-append home-page name "-" version
1582 ".tgz"))
1583 (sha256
1584 (base32
1585 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1586 (build-system gnu-build-system)
1587 (arguments
1588 '(#:phases
1589 (modify-phases %standard-phases
1590 (delete 'configure) ; no configure script
1591 (replace 'install
1592 ;; The Makefile lacks an ‘install’ target.
1593 (lambda* (#:key outputs #:allow-other-keys)
1594 (let* ((out (assoc-ref outputs "out"))
1595 (bin (string-append out "/bin")))
1596 (chmod "zerofree" #o555)
1597 (install-file "zerofree" bin)
1598 #t))))
1599 #:tests? #f)) ; no tests
1600 (inputs `(("libext2fs" ,e2fsprogs)))
1601 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1602 (description
1603 "Zerofree finds the unallocated blocks with non-zero value content in an
1604 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1605 This is a simple way to make disk images more compressible.
1606 Zerofree requires the file system to be unmounted or mounted read-only.")
1607 (license license:gpl2)))
1608
1609 (define-public strace
1610 (package
1611 (name "strace")
1612 (version "5.5")
1613 (home-page "https://strace.io")
1614 (source (origin
1615 (method url-fetch)
1616 (uri (string-append home-page "/files/" version
1617 "/strace-" version ".tar.xz"))
1618 (sha256
1619 (base32
1620 "1zrhpzjlgfwfl8dd53llswmmharm5rbi0zch7lln5sjris69an4z"))))
1621 (build-system gnu-build-system)
1622 (arguments
1623 '(#:phases
1624 (modify-phases %standard-phases
1625 (add-after 'unpack 'patch-/bin/sh
1626 (lambda _
1627 (substitute* "strace.c"
1628 (("/bin/sh") (which "sh")))
1629 #t)))
1630 ;; Don't fail if the architecture doesn't support different personalities.
1631 #:configure-flags '("--enable-mpers=check")
1632 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1633 #:parallel-tests? #f)) ; undeterministic failures
1634 (native-inputs `(("perl" ,perl)))
1635 (synopsis "System call tracer for Linux")
1636 (description
1637 "strace is a system call tracer, i.e. a debugging tool which prints out a
1638 trace of all the system calls made by a another process/program.")
1639 (license license:lgpl2.1+)))
1640
1641 (define-public ltrace
1642 (package
1643 (name "ltrace")
1644 (version "0.7.3")
1645 (source (origin
1646 (method url-fetch)
1647 (uri (string-append "http://www.ltrace.org/ltrace_" version
1648 ".orig.tar.bz2"))
1649 (sha256
1650 (base32
1651 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1652 (build-system gnu-build-system)
1653 (inputs `(("libelf" ,libelf)))
1654 (arguments
1655 ;; Compilation uses -Werror by default, but it fails.
1656 '(#:configure-flags '("--disable-werror")))
1657 (home-page "https://www.ltrace.org/")
1658 (synopsis "Library call tracer for Linux")
1659 (description
1660 "ltrace intercepts and records dynamic library calls which are called by
1661 an executed process and the signals received by that process. It can also
1662 intercept and print the system calls executed by the program.")
1663 (license license:gpl2+)))
1664
1665 (define-public alsa-lib
1666 (package
1667 (name "alsa-lib")
1668 (version "1.2.2")
1669 (source (origin
1670 (method url-fetch)
1671 (uri (string-append
1672 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1673 version ".tar.bz2"))
1674 (sha256
1675 (base32
1676 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
1677 (build-system gnu-build-system)
1678 (arguments
1679 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1680 (assoc-ref %outputs "out")
1681 "/lib"))))
1682 (home-page "https://www.alsa-project.org/")
1683 (synopsis "The Advanced Linux Sound Architecture libraries")
1684 (description
1685 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1686 MIDI functionality to the Linux-based operating system.")
1687 (license license:lgpl2.1+)))
1688
1689 (define-public alsa-utils
1690 (package
1691 (name "alsa-utils")
1692 (version "1.2.2")
1693 (source (origin
1694 (method url-fetch)
1695 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1696 name "-" version ".tar.bz2"))
1697 (sha256
1698 (base32
1699 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
1700 (build-system gnu-build-system)
1701 (arguments
1702 ;; XXX: Disable man page creation until we have DocBook.
1703 '(#:configure-flags (list "--disable-xmlto"
1704
1705 ;; The udev rule is responsible for restoring
1706 ;; the volume.
1707 (string-append "--with-udev-rules-dir="
1708 (assoc-ref %outputs "out")
1709 "/lib/udev/rules.d"))
1710 #:phases
1711 (modify-phases %standard-phases
1712 (add-before 'check 'disable-broken-test
1713 (lambda _
1714 ;; XXX: The 1.1.8 release tarball is missing a header that's
1715 ;; required for this test to work. Fixed in 1.1.9.
1716 (substitute* "axfer/test/Makefile"
1717 ((".*container-test.*") ""))
1718 #t))
1719 (add-before
1720 'install 'pre-install
1721 (lambda _
1722 ;; Don't try to mkdir /var/lib/alsa.
1723 (substitute* "Makefile"
1724 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1725 "true\n"))
1726 #t)))))
1727 (inputs
1728 `(("libsamplerate" ,libsamplerate)
1729 ("ncurses" ,ncurses)
1730 ("alsa-lib" ,alsa-lib)
1731 ("xmlto" ,xmlto)
1732 ("gettext" ,gettext-minimal)))
1733 (home-page "http://www.alsa-project.org/")
1734 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1735 (description
1736 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1737 MIDI functionality to the Linux-based operating system.")
1738
1739 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1740 ;; GPLv2-only.
1741 (license license:gpl2)))
1742
1743 (define-public alsa-plugins
1744 (package
1745 (name "alsa-plugins")
1746 (version "1.2.2")
1747 (source (origin
1748 (method url-fetch)
1749 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1750 name "-" version ".tar.bz2"))
1751 (sha256
1752 (base32
1753 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
1754 (build-system gnu-build-system)
1755 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1756 ;; be split, there are references to both in files.
1757 ;; TODO: Remove OSS related plugins, they add support to run native
1758 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1759 ;; obsolete.
1760 (outputs '("out" "pulseaudio" "jack"))
1761 (arguments
1762 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1763 ;; for /etc/alsa. On Guix System plugins are loaded from
1764 ;; the ALSA service, and other distributions likely
1765 ;; won't use these files.
1766 "--with-alsalconfdir=/tmp/noop")
1767 #:phases
1768 (modify-phases %standard-phases
1769 (add-after 'install 'split
1770 (lambda* (#:key inputs outputs #:allow-other-keys)
1771 ;; Distribute the binaries to the various outputs.
1772 (let* ((out (assoc-ref outputs "out"))
1773 (jack (assoc-ref outputs "jack"))
1774 (jacklib (string-append jack "/lib/alsa-lib"))
1775 (pua (assoc-ref outputs "pulseaudio"))
1776 (pualib (string-append pua "/lib/alsa-lib")))
1777 ;; For jack.
1778 (mkdir-p jacklib)
1779 (for-each (lambda (file)
1780 (rename-file file (string-append jacklib "/" (basename file))))
1781 (find-files out ".*jack\\.(la|so)"))
1782 ;; For pulseaudio.
1783 (mkdir-p pualib)
1784 (for-each (lambda (file)
1785 (rename-file file (string-append pualib "/" (basename file))))
1786 (find-files out ".*pulse\\.(la|so)"))
1787 #t))))))
1788 (inputs
1789 `(("alsa-lib" ,alsa-lib)
1790 ("jack" ,jack-1)
1791 ("speex" ,speex) ; libspeexdsp resampling plugin
1792 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1793 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1794 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1795 (native-inputs
1796 `(("pkg-config" ,pkg-config)))
1797 (home-page "http://www.alsa-project.org/")
1798 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1799 (description
1800 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1801 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1802 by providing additional plugins which include: upmixing, downmixing, jackd and
1803 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1804 external rate conversion.")
1805 (license (list license:gpl2+
1806 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1807 license:lgpl2.1+))))
1808
1809 (define-public iptables
1810 (package
1811 (name "iptables")
1812 (version "1.8.4")
1813 (source (origin
1814 (method url-fetch)
1815 (uri (string-append
1816 "mirror://netfilter.org/iptables/iptables-"
1817 version ".tar.bz2"))
1818 (sha256
1819 (base32
1820 "0z0mgs1ghvn3slc868mgbf2g26njgrzcy5ggyb5w4i55j1a3lflr"))))
1821 (build-system gnu-build-system)
1822 (native-inputs
1823 `(("pkg-config" ,pkg-config)
1824 ("flex" ,flex)
1825 ("bison" ,bison)))
1826 (inputs
1827 `(("libmnl" ,libmnl)
1828 ("libnftnl" ,libnftnl)))
1829 (arguments
1830 '(#:tests? #f ; no test suite
1831 #:configure-flags ; add $libdir to the RUNPATH of executables
1832 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1833 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1834 (synopsis "Programs to configure Linux IP packet filtering rules")
1835 (description
1836 "@command{iptables} is the user-space command line program used to
1837 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1838 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1839
1840 This package also includes @command{ip6tables}, which is used to configure the
1841 IPv6 packet filter.
1842
1843 Both commands are targeted at system administrators.")
1844 (license license:gpl2+)))
1845
1846 (define-public lsscsi
1847 (package
1848 (name "lsscsi")
1849 (version "0.31")
1850 (source (origin
1851 (method url-fetch)
1852 (uri (string-append
1853 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
1854 (sha256
1855 (base32
1856 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
1857 (build-system gnu-build-system)
1858 (synopsis "Lists information about SCSI or NVMe devices in Linux")
1859 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
1860 (description
1861 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
1862 also list NVMe namespaces or controllers and show the relationship between a
1863 device's primary node name, its SCSI generic (sg) node name and its kernel
1864 name.")
1865 (license license:gpl2)))
1866
1867 (define-public ebtables
1868 (package
1869 (name "ebtables")
1870 (version "2.0.11")
1871 (source (origin
1872 (method url-fetch)
1873 (uri (string-append
1874 "mirror://netfilter.org/ebtables/ebtables-"
1875 version ".tar.gz"))
1876 (sha256
1877 (base32
1878 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
1879 (build-system gnu-build-system)
1880 (inputs
1881 `(("perl" ,perl)
1882 ("iptables" ,iptables)))
1883 (synopsis "Ethernet bridge frame table administration")
1884 (home-page "https://ebtables.netfilter.org/")
1885 (description
1886 "ebtables is an application program used to set up and maintain the
1887 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1888 analogous to the iptables application, but less complicated, due to the fact
1889 that the Ethernet protocol is much simpler than the IP protocol.")
1890 (license license:gpl2+)))
1891
1892 (define-public iproute
1893 (package
1894 (name "iproute2")
1895 (version "5.5.0")
1896 (source (origin
1897 (method url-fetch)
1898 (uri (string-append
1899 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1900 version ".tar.xz"))
1901 (sha256
1902 (base32
1903 "0ywg70f98wgfai35jl47xzpjp45a6n7crja4vc8ql85cbi1l7ids"))))
1904 (build-system gnu-build-system)
1905 (arguments
1906 `( ;; There is a test suite, but it wants network namespaces and sudo.
1907 #:tests? #f
1908 #:make-flags (let ((out (assoc-ref %outputs "out")))
1909 (list "DESTDIR="
1910 (string-append "BASH_COMPDIR=" out
1911 "/etc/bash_completion.d")
1912 (string-append "LIBDIR=" out "/lib")
1913 (string-append "HDRDIR=" out "/include")
1914 (string-append "SBINDIR=" out "/sbin")
1915 (string-append "CONFDIR=" out "/etc")
1916 (string-append "DOCDIR=" out "/share/doc/"
1917 ,name "-" ,version)
1918 (string-append "MANDIR=" out "/share/man")))
1919 #:phases (modify-phases %standard-phases
1920 (add-before 'install 'pre-install
1921 (lambda _
1922 ;; Don't attempt to create /var/lib/arpd.
1923 (substitute* "Makefile"
1924 (("^.*ARPDDIR.*$") ""))
1925 #t)))))
1926 (inputs
1927 `(("db4" ,bdb)
1928 ("iptables" ,iptables)
1929 ("libmnl" ,libmnl)))
1930 (native-inputs
1931 `(("bison" ,bison)
1932 ("flex" ,flex)
1933 ("pkg-config" ,pkg-config)))
1934 ;; For tests.
1935 ;; ("libmnl" ,libmnl)
1936 ;; ("util-linux" ,util-linux)
1937 (home-page
1938 "https://wiki.linuxfoundation.org/networking/iproute2")
1939 (synopsis
1940 "Utilities for controlling TCP/IP networking and traffic in Linux")
1941 (description
1942 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1943 and traffic with the Linux kernel. The most important of these are
1944 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1945 control.
1946
1947 Most network configuration manuals still refer to ifconfig and route as the
1948 primary network configuration tools, but ifconfig is known to behave
1949 inadequately in modern network environments, and both should be deprecated.")
1950 (license license:gpl2+)))
1951
1952 (define-public net-tools
1953 ;; XXX: This package is basically unmaintained, but it provides a few
1954 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1955 ;; live with it.
1956 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1957 (revision "0"))
1958 (package
1959 (name "net-tools")
1960 (version (string-append "1.60-" revision "." (string-take commit 7)))
1961 (source (origin
1962 (method url-fetch)
1963 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1964 "n/ne/net-tools/code.git/net-tools-code-"
1965 commit ".zip"))
1966 (file-name (string-append name "-" version ".zip"))
1967 (sha256
1968 (base32
1969 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1970 (home-page "http://net-tools.sourceforge.net/")
1971 (build-system gnu-build-system)
1972 (arguments
1973 '(#:modules ((guix build gnu-build-system)
1974 (guix build utils)
1975 (srfi srfi-1)
1976 (srfi srfi-26))
1977 #:phases
1978 (modify-phases %standard-phases
1979 (replace 'configure
1980 (lambda* (#:key outputs #:allow-other-keys)
1981 (let ((out (assoc-ref outputs "out")))
1982 (mkdir-p (string-append out "/bin"))
1983 (mkdir-p (string-append out "/sbin"))
1984
1985 ;; Pretend we have everything...
1986 (system "yes | make config")
1987
1988 ;; ... except for the things we don't have.
1989 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1990 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1991 ;; that have been removed.
1992 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1993 ;; think about adding them later.
1994 (substitute* '("config.make" "config.h")
1995 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1996 ""))
1997 #t)))
1998 (add-after 'install 'remove-redundant-commands
1999 (lambda* (#:key outputs #:allow-other-keys)
2000 ;; Remove commands and man pages redundant with Inetutils.
2001 (let* ((out (assoc-ref outputs "out"))
2002 (dup (append-map (cut find-files out <>)
2003 '("^hostname"
2004 "^(yp|nis|dns)?domainname"))))
2005 (for-each delete-file dup)
2006 #t))))
2007 ;; Binaries that depend on libnet-tools.a don't declare that
2008 ;; dependency, making it parallel-unsafe.
2009 #:parallel-build? #f
2010
2011 #:tests? #f ; no test suite
2012 #:make-flags (let ((out (assoc-ref %outputs "out")))
2013 (list "CC=gcc"
2014 (string-append "BASEDIR=" out)
2015 (string-append "INSTALLNLSDIR=" out "/share/locale")
2016 (string-append "mandir=/share/man")))))
2017 (native-inputs `(("gettext" ,gettext-minimal)
2018 ("unzip" ,unzip)))
2019 (synopsis "Tools for controlling the network subsystem in Linux")
2020 (description
2021 "This package includes the important tools for controlling the network
2022 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2023 route. Additionally, this package contains utilities relating to particular
2024 network hardware types (plipconfig, slattach) and advanced aspects of IP
2025 configuration (iptunnel, ipmaddr).")
2026 (license license:gpl2+))))
2027
2028 (define-public libcap
2029 (package
2030 (name "libcap")
2031 (version "2.27")
2032 (source (origin
2033 (method url-fetch)
2034 (uri (string-append
2035 "mirror://kernel.org/linux/libs/security/linux-privs/"
2036 "libcap2/libcap-" version ".tar.xz"))
2037 (sha256
2038 (base32
2039 "0sj8kidl7qgf2qwxcbw1vadnlb30y4zvjzxswsmfdghq04npkhfs"))))
2040 (build-system gnu-build-system)
2041 (arguments '(#:phases
2042 (modify-phases %standard-phases
2043 (replace 'configure
2044 ;; Add $libdir to the RUNPATH of executables.
2045 (lambda _
2046 (substitute* "Make.Rules"
2047 (("LDFLAGS := #-g")
2048 (string-append "LDFLAGS := -Wl,-rpath="
2049 %output "/lib")))
2050 #t)))
2051 #:tests? #f ; no 'check' target
2052 #:make-flags (list "lib=lib"
2053 (string-append "prefix="
2054 (assoc-ref %outputs "out"))
2055 "RAISE_SETFCAP=no")))
2056 (native-inputs `(("perl" ,perl)))
2057 (inputs `(("attr" ,attr)))
2058 (home-page "https://sites.google.com/site/fullycapable/")
2059 (synopsis "Library for working with POSIX capabilities")
2060 (description
2061 "Libcap2 provides a programming interface to POSIX capabilities on
2062 Linux-based operating systems.")
2063
2064 ;; License is BSD-3 or GPLv2, at the user's choice.
2065 (license license:gpl2)))
2066
2067 (define-public bridge-utils
2068 (package
2069 (name "bridge-utils")
2070 (version "1.6")
2071 (source
2072 (origin
2073 (method url-fetch)
2074 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2075 "bridge-utils-" version ".tar.xz"))
2076 (sha256
2077 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
2078 (build-system gnu-build-system)
2079
2080 ;; The tarball lacks all the generated files.
2081 (native-inputs `(("autoconf" ,autoconf)
2082 ("automake" ,automake)))
2083 (arguments
2084 '(#:phases
2085 (modify-phases %standard-phases
2086 (add-before 'bootstrap 'patch-stuff
2087 (lambda _
2088 ;; Fix "field ‘ip6’ has incomplete type" errors.
2089 (substitute* "libbridge/libbridge.h"
2090 (("#include <linux/if_bridge.h>")
2091 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2092
2093 ;; Ensure that the entire build fails if one of the
2094 ;; sub-Makefiles fails.
2095 (substitute* "Makefile.in"
2096 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2097 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2098
2099 #t)))
2100 #:tests? #f)) ; no 'check' target
2101
2102 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2103 (synopsis "Manipulate Ethernet bridges")
2104 (description
2105 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2106 to connect two Ethernet segments together in a protocol independent way.
2107 Packets are forwarded based on Ethernet address, rather than IP address (like
2108 a router). Since forwarding is done at Layer 2, all protocols can go
2109 transparently through a bridge.")
2110 (license license:gpl2+)))
2111
2112 (define-public libnl
2113 (package
2114 (name "libnl")
2115 (version "3.5.0")
2116 (source (origin
2117 (method url-fetch)
2118 (uri (string-append
2119 "https://github.com/thom311/libnl/releases/download/"
2120 "libnl" (string-join (string-split version #\.) "_")
2121 "/libnl-" version ".tar.gz"))
2122 (sha256
2123 (base32
2124 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2125 (build-system gnu-build-system)
2126 (native-inputs
2127 `(("bison" ,bison)
2128 ("flex" ,flex)
2129 ("pkg-config" ,pkg-config)
2130 ("swig" ,swig)
2131 ("libnl3-doc"
2132 ,(origin
2133 (method url-fetch)
2134 (uri (string-append
2135 "https://github.com/thom311/libnl/releases/download/libnl"
2136 (string-join (string-split version #\.) "_")
2137 "/libnl-doc-" version ".tar.gz"))
2138 (sha256
2139 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2140 (inputs
2141 `(("python-2" ,python-2)
2142 ("python-3" ,python-3)))
2143 (outputs '("out" "doc" "python2" "python3"))
2144 (arguments
2145 `(#:modules ((guix build gnu-build-system)
2146 (guix build utils)
2147 (srfi srfi-1))
2148 #:phases
2149 (modify-phases %standard-phases
2150 (add-after 'install 'install-python
2151 (lambda* (#:key outputs #:allow-other-keys)
2152 (define (python-inst python)
2153 (invoke python "setup.py" "build")
2154 (invoke python "setup.py" "install"
2155 (string-append "--prefix="
2156 (assoc-ref %outputs python)))
2157 (invoke python "setup.py" "clean"))
2158 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2159 (assoc-ref %outputs "out")))
2160 (with-directory-excursion "./python"
2161 (for-each python-inst '("python2" "python3")))
2162 #t))
2163 (add-after 'install 'install-doc
2164 (lambda* (#:key inputs outputs #:allow-other-keys)
2165 (let ((dest (string-append (assoc-ref outputs "doc")
2166 "/share/doc/libnl")))
2167 (mkdir-p dest)
2168 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
2169 "--strip-components=1" "-C" dest)))))))
2170 (home-page "https://www.infradead.org/~tgr/libnl/")
2171 (synopsis "NetLink protocol library suite")
2172 (description
2173 "The libnl suite is a collection of libraries providing APIs to netlink
2174 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2175 between the kernel and user space processes. It was designed to be a more
2176 flexible successor to ioctl to provide mainly networking related kernel
2177 configuration and monitoring interfaces.")
2178
2179 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2180 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2181 (license license:gpl2)))
2182
2183 (define-public iw
2184 (package
2185 (name "iw")
2186 (version "4.14")
2187 (source (origin
2188 (method url-fetch)
2189 (uri (string-append
2190 "mirror://kernel.org/software/network/iw/iw-"
2191 version ".tar.xz"))
2192 (sha256
2193 (base32
2194 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2195 (build-system gnu-build-system)
2196 (native-inputs `(("pkg-config" ,pkg-config)))
2197 (inputs `(("libnl" ,libnl)))
2198 (arguments
2199 `(#:make-flags
2200 (let* ((target ,(%current-target-system))
2201 (gcc (if target (string-append target "-gcc") "gcc"))
2202 (pkg-config (if target
2203 (string-append target "-pkg-config")
2204 "pkg-config")))
2205 (list
2206 (string-append "CC=" gcc)
2207 (string-append "PKG_CONFIG="
2208 (assoc-ref %build-inputs "pkg-config")
2209 "/bin/" pkg-config)
2210 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2211 #:phases (modify-phases %standard-phases (delete 'configure))))
2212 (home-page "https://wireless.wiki.kernel.org/")
2213 (synopsis "Tool for configuring wireless devices")
2214 (description
2215 "iw is a new nl80211 based CLI configuration utility for wireless
2216 devices. It replaces @code{iwconfig}, which is deprecated.")
2217 (license license:isc)))
2218
2219 (define-public powertop
2220 (package
2221 (name "powertop")
2222 (version "2.11")
2223 (source
2224 (origin
2225 (method url-fetch)
2226 (uri (string-append "https://01.org/sites/default/files/downloads/"
2227 "powertop-v" version "-1-g7ef7f79.tar_0.gz"))
2228 (sha256
2229 (base32 "0kynypj5cydfbma0ssblq1k4m1arixc1s2vf0ybv8y2gg09wjs5f"))))
2230 (build-system gnu-build-system)
2231 (arguments
2232 '(#:phases
2233 (modify-phases %standard-phases
2234 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2235 ;; allow calibrating the network interface in Guix System.
2236 (add-after 'unpack 'patch-absolute-file-names
2237 (lambda* (#:key inputs #:allow-other-keys)
2238 (let ((kmod (assoc-ref inputs "kmod")))
2239 (substitute* (find-files "src" "\\.cpp$")
2240 ;; Give the right 'modprobe' file name so that essential
2241 ;; modules such as msr.ko can be loaded.
2242 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2243 ;; These programs are only needed to calibrate, so using
2244 ;; relative file names avoids adding extra inputs. When they
2245 ;; are missing powertop gracefully handles it.
2246 (("/usr/bin/hcitool") "hcitool")
2247 (("/usr/bin/xset") "xset")
2248 (("/usr/sbin/hciconfig") "hciconfig"))
2249 #t))))))
2250 (inputs
2251 `(("kmod" ,kmod)
2252 ("libnl" ,libnl)
2253 ("ncurses" ,ncurses)
2254 ("pciutils" ,pciutils)
2255 ("zlib" ,zlib)))
2256 (native-inputs
2257 `(("pkg-config" ,pkg-config)))
2258 (home-page "https://01.org/powertop/")
2259 (synopsis "Analyze power consumption on Intel-based laptops")
2260 (description
2261 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2262 power management. In addition to being a diagnostic tool, PowerTOP also has
2263 an interactive mode where the user can experiment various power management
2264 settings for cases where the operating system has not enabled these
2265 settings.")
2266 (license license:gpl2)))
2267
2268 (define-public aumix
2269 (package
2270 (name "aumix")
2271 (version "2.9.1")
2272 (source (origin
2273 (method url-fetch)
2274 (uri (string-append
2275 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2276 version ".tar.bz2"))
2277 (sha256
2278 (base32
2279 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2280 (build-system gnu-build-system)
2281 (inputs `(("ncurses" ,ncurses)))
2282 (home-page "http://www.jpj.net/~trevor/aumix.html")
2283 (synopsis "Audio mixer for X and the console")
2284 (description
2285 "Aumix adjusts an audio mixer from X, the console, a terminal,
2286 the command line or a script.")
2287 (license license:gpl2+)))
2288
2289 (define-public iotop
2290 (package
2291 (name "iotop")
2292 (version "0.6")
2293 (source
2294 (origin
2295 (method url-fetch)
2296 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2297 version ".tar.gz"))
2298 (sha256 (base32
2299 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2300 (build-system python-build-system)
2301 (arguments
2302 '(#:phases
2303 (modify-phases %standard-phases
2304 (add-after 'unpack 'fix-build-with-python3
2305 (lambda _
2306 (substitute* "setup.py"
2307 (("itervalues") "values"))
2308 #t)))
2309 ;; There are currently no checks in the package.
2310 #:tests? #f))
2311 (native-inputs `(("python" ,python)))
2312 (home-page "http://guichaz.free.fr/iotop/")
2313 (synopsis
2314 "Displays the IO activity of running processes")
2315 (description
2316 "Iotop is a Python program with a top like user interface to show the
2317 processes currently causing I/O.")
2318 (license license:gpl2+)))
2319
2320 (define-public fuse
2321 (package
2322 (name "fuse")
2323 (version "2.9.9")
2324 (source (origin
2325 (method url-fetch)
2326 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2327 "download/fuse-" version
2328 "/fuse-" version ".tar.gz"))
2329 (sha256
2330 (base32
2331 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2332 (patches (search-patches "fuse-overlapping-headers.patch"))))
2333 (build-system gnu-build-system)
2334 (inputs `(("util-linux" ,util-linux)))
2335 (arguments
2336 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2337 (assoc-ref %outputs "out")
2338 "/sbin")
2339 (string-append "INIT_D_PATH="
2340 (assoc-ref %outputs "out")
2341 "/etc/init.d")
2342
2343 ;; The rule makes /dev/fuse 666.
2344 (string-append "UDEV_RULES_PATH="
2345 (assoc-ref %outputs "out")
2346 "/lib/udev/rules.d"))
2347 #:phases
2348 (modify-phases %standard-phases
2349 (add-before 'build 'set-file-names
2350 (lambda* (#:key inputs #:allow-other-keys)
2351 ;; libfuse calls out to mount(8) and umount(8). Make sure
2352 ;; it refers to the right ones.
2353 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2354 (("/bin/(u?)mount" _ maybe-u)
2355 (string-append (assoc-ref inputs "util-linux")
2356 "/bin/" maybe-u "mount")))
2357 (substitute* '("util/mount.fuse.c")
2358 (("/bin/sh")
2359 (which "sh")))
2360
2361 ;; This hack leads libfuse to search for 'fusermount' in
2362 ;; $PATH, where it may find a setuid-root binary, instead of
2363 ;; trying solely $out/sbin/fusermount and failing because
2364 ;; it's not setuid.
2365 (substitute* "lib/Makefile"
2366 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2367 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2368 #t)))))
2369 (home-page "https://github.com/libfuse/libfuse")
2370 (synopsis "Support file systems implemented in user space")
2371 (description
2372 "As a consequence of its monolithic design, file system code for Linux
2373 normally goes into the kernel itself---which is not only a robustness issue,
2374 but also an impediment to system extensibility. FUSE, for \"file systems in
2375 user space\", is a kernel module and user-space library that tries to address
2376 part of this problem by allowing users to run file system implementations as
2377 user-space processes.")
2378 (license (list license:lgpl2.1 ;library
2379 license:gpl2+)))) ;command-line utilities
2380
2381 (define-public unionfs-fuse
2382 (package
2383 (name "unionfs-fuse")
2384 (version "2.0")
2385 (source (origin
2386 (method url-fetch)
2387 (uri (string-append
2388 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
2389 version ".tar.gz"))
2390 (file-name (string-append name "-" version ".tar.gz"))
2391 (sha256
2392 (base32
2393 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
2394 (build-system cmake-build-system)
2395 (native-inputs
2396 `(("python" ,python)))
2397 (inputs `(("fuse" ,fuse)))
2398 (arguments
2399 ;; The tests were never actually run ("collected 0 items"), but in recent
2400 ;; versions of pytest that causes an error.
2401 '(#:tests? #f))
2402 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2403 (synopsis "User-space union file system")
2404 (description
2405 "UnionFS-FUSE is a flexible union file system implementation in user
2406 space, using the FUSE library. Mounting a union file system allows you to
2407 \"aggregate\" the contents of several directories into a single mount point.
2408 UnionFS-FUSE additionally supports copy-on-write.")
2409 (license license:bsd-3)))
2410
2411 (define fuse-static
2412 (package (inherit fuse)
2413 (name "fuse-static")
2414 (source (origin (inherit (package-source fuse))
2415 (modules '((guix build utils)))
2416 (snippet
2417 '(begin
2418 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2419 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2420 ;; that it doesn't do that, allowing us to remove the
2421 ;; dependency on util-linux (something that is useful in
2422 ;; initrds.)
2423 (substitute* '("lib/mount_util.c"
2424 "util/mount_util.c")
2425 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2426 "0")
2427 (("/bin/")
2428 ""))
2429 #t))))))
2430
2431 (define-public unionfs-fuse/static
2432 (package (inherit unionfs-fuse)
2433 (synopsis "User-space union file system (statically linked)")
2434 (name (string-append (package-name unionfs-fuse) "-static"))
2435 (source (origin (inherit (package-source unionfs-fuse))
2436 (modules '((guix build utils)))
2437 (snippet
2438 '(begin
2439 ;; Add -ldl to the libraries, because libfuse.a needs that.
2440 (substitute* "src/CMakeLists.txt"
2441 (("target_link_libraries(.*)\\)" _ libs)
2442 (string-append "target_link_libraries"
2443 libs " dl)")))
2444 #t))))
2445 (arguments
2446 '(#:tests? #f
2447 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2448 #:phases
2449 (modify-phases %standard-phases
2450 (add-after 'install 'post-install
2451 (lambda* (#:key outputs #:allow-other-keys)
2452 (let* ((out (assoc-ref outputs "out"))
2453 (exe (string-append out "/bin/unionfs")))
2454 ;; By default, 'unionfs' keeps references to
2455 ;; $glibc/share/locale and similar stuff. Remove them.
2456 (remove-store-references exe)
2457
2458 ;; 'unionfsctl' has references to glibc as well. Since
2459 ;; we don't need it, remove it.
2460 (delete-file (string-append out "/bin/unionfsctl"))
2461 #t))))))
2462 (inputs `(("fuse" ,fuse-static)))))
2463
2464 (define-public sshfs
2465 (package
2466 (name "sshfs")
2467 (version "2.10")
2468 (source (origin
2469 (method url-fetch)
2470 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2471 "download/sshfs-" version "/sshfs-" version
2472 ".tar.gz"))
2473 (sha256
2474 (base32
2475 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2476 (build-system gnu-build-system)
2477 (inputs
2478 `(("fuse" ,fuse)
2479 ("glib" ,glib)))
2480 (native-inputs
2481 `(("pkg-config" ,pkg-config)))
2482 (home-page "https://github.com/libfuse/sshfs")
2483 (synopsis "Mount remote file systems over SSH")
2484 (description
2485 "This is a file system client based on the SSH File Transfer Protocol.
2486 Since most SSH servers already support this protocol it is very easy to set
2487 up: on the server side there's nothing to do; on the client side mounting the
2488 file system is as easy as logging into the server with an SSH client.")
2489 (license license:gpl2+)))
2490
2491 (define-public sshfs-fuse
2492 (package (inherit sshfs)
2493 (name "sshfs-fuse")
2494 (properties `((superseded . ,sshfs)))))
2495
2496 (define-public archivemount
2497 (package
2498 (name "archivemount")
2499 (version "0.8.12")
2500 (source
2501 (origin
2502 (method url-fetch)
2503 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2504 "archivemount-" version ".tar.gz"))
2505 (sha256
2506 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2507 (build-system gnu-build-system)
2508 (inputs `(("fuse" ,fuse)
2509 ("libarchive" ,libarchive)))
2510 (native-inputs `(("pkg-config" ,pkg-config)))
2511 (home-page "https://www.cybernoia.de/software/archivemount.html")
2512 (synopsis "Tool for mounting archive files with FUSE")
2513 (description "archivemount is a FUSE-based file system for Unix variants,
2514 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2515 mount point where it can be read from or written to as with any other file
2516 system. This makes accessing the contents of the archive, which may be
2517 compressed, transparent to other programs, without decompressing them.")
2518 (license license:lgpl2.0+)))
2519
2520 (define-public numactl
2521 (package
2522 (name "numactl")
2523 (version "2.0.13")
2524 (source (origin
2525 (method url-fetch)
2526 (uri (string-append
2527 "https://github.com/numactl/numactl/releases/download/v"
2528 version "/numactl-" version ".tar.gz"))
2529 (sha256
2530 (base32
2531 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2532 (build-system gnu-build-system)
2533 (arguments
2534 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2535 ;; to run, which we can't assume to have.
2536 #:tests? #f))
2537
2538 ;; NUMA is apparently not supported on armhf, see
2539 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2540 (supported-systems (delete "armhf-linux" %supported-systems))
2541 (home-page "https://github.com/numactl/numactl")
2542 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2543 (description
2544 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2545 memory is not all in one place. The @command{numactl} program allows you to
2546 run your application program on specific CPUs and memory nodes. It does this
2547 by supplying a NUMA memory policy to the operating system before running your
2548 program.
2549
2550 The package contains other commands, such as @command{numastat},
2551 @command{memhog}, and @command{numademo} which provides a quick overview of
2552 NUMA performance on your system.")
2553 (license (list license:gpl2 ;programs
2554 license:lgpl2.1)))) ;library
2555
2556 (define-public kbd-neo
2557 (package
2558 (name "kbd-neo")
2559 (version "2486")
2560 (source
2561 (origin
2562 (method url-fetch)
2563 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2564 version "/linux/console/neo.map"))
2565 (file-name (string-append name "-" version ".map"))
2566 (sha256
2567 (base32
2568 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2569 (build-system trivial-build-system)
2570 (arguments
2571 `(#:modules ((guix build utils))
2572 #:builder (begin
2573 (use-modules (guix build utils))
2574 (let ((out (string-append %output "/share/keymaps"))
2575 (source (assoc-ref %build-inputs "source")))
2576 (mkdir-p out)
2577 (copy-file source (string-append out "/neo.map"))
2578 #t))))
2579 (home-page "https://neo-layout.org")
2580 (synopsis "Neo2 console layout")
2581 (description
2582 "Kbd-neo provides the Neo2 keyboard layout for use with
2583 @command{loadkeys(1)} from @code{kbd(4)}.")
2584 ;; The file is located in an svn directory, the entire content of
2585 ;; the directory is licensed as GPL3.
2586 (license license:gpl3+)))
2587
2588 (define-public kbd
2589 (package
2590 (name "kbd")
2591 (version "2.0.4")
2592 (source (origin
2593 (method url-fetch)
2594 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2595 version ".tar.xz"))
2596 (sha256
2597 (base32
2598 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2599 (modules '((guix build utils)))
2600 (snippet
2601 '(begin
2602 (substitute* "tests/Makefile.in"
2603 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2604 (("@VERSION@")
2605 "[@]VERSION[@]"))
2606 (substitute* '("src/unicode_start" "src/unicode_stop")
2607 ;; Assume the Coreutils are in $PATH.
2608 (("/usr/bin/tty")
2609 "tty"))
2610 #t))))
2611 (build-system gnu-build-system)
2612 (arguments
2613 '(#:phases
2614 (modify-phases %standard-phases
2615 (add-before 'build 'pre-build
2616 (lambda* (#:key inputs #:allow-other-keys)
2617 (let ((gzip (assoc-ref %build-inputs "gzip"))
2618 (bzip2 (assoc-ref %build-inputs "bzip2")))
2619 (substitute* "src/libkeymap/findfile.c"
2620 (("gzip")
2621 (string-append gzip "/bin/gzip"))
2622 (("bzip2")
2623 (string-append bzip2 "/bin/bzip2")))
2624 #t)))
2625 (add-after 'install 'post-install
2626 (lambda* (#:key outputs #:allow-other-keys)
2627 ;; Make sure these programs find their comrades.
2628 (let* ((out (assoc-ref outputs "out"))
2629 (bin (string-append out "/bin")))
2630 (for-each (lambda (prog)
2631 (wrap-program (string-append bin "/" prog)
2632 `("PATH" ":" prefix (,bin))))
2633 '("unicode_start" "unicode_stop"))
2634 #t))))))
2635 (inputs `(("check" ,check)
2636 ("gzip" ,gzip)
2637 ("bzip2" ,bzip2)
2638 ("pam" ,linux-pam)))
2639 (native-search-paths
2640 (list (search-path-specification
2641 (variable "LOADKEYS_KEYMAP_PATH")
2642 ;; Append ‘/**’ to recursively search all directories. One can then
2643 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2644 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2645 (files (list "share/keymaps/**")))))
2646 (native-inputs `(("pkg-config" ,pkg-config)))
2647 (home-page "http://kbd-project.org/")
2648 (synopsis "Linux keyboard utilities and keyboard maps")
2649 (description
2650 "This package contains keytable files and keyboard utilities compatible
2651 for systems using the Linux kernel. This includes commands such as
2652 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2653 (license license:gpl2+)))
2654
2655 (define-public loadkeys-static
2656 (package
2657 (inherit kbd)
2658 (name "loadkeys-static")
2659 (arguments
2660 (substitute-keyword-arguments (package-arguments kbd)
2661 ((#:configure-flags flags ''())
2662 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2663 "--disable-vlock" ;so we don't need libpam
2664 "--disable-libkeymap")
2665 ,flags))
2666 ((#:make-flags flags ''())
2667 `(cons "LDFLAGS=-all-static" ,flags))
2668 ((#:phases phases '%standard-phases)
2669 `(modify-phases ,phases
2670 (replace 'install
2671 (lambda* (#:key outputs #:allow-other-keys)
2672 (let ((out (assoc-ref outputs "out")))
2673 ;; The binary keeps references to gzip, among other things,
2674 ;; which we don't need in the initrd, so strip references.
2675 (remove-store-references "src/loadkeys")
2676
2677 (install-file "src/loadkeys"
2678 (string-append out "/bin"))
2679 #t)))
2680 (delete 'post-install)))
2681 ((#:strip-flags _ '())
2682 ''("--strip-all"))
2683 ((#:allowed-references _ '())
2684 '())))
2685
2686 (synopsis "Statically-linked @command{loadkeys} program")
2687
2688 ;; This package is meant to be used internally in the initrd so don't
2689 ;; expose it.
2690 (properties '((hidden? . #t)))))
2691
2692 (define-public inotify-tools
2693 (package
2694 (name "inotify-tools")
2695 (version "3.20.1")
2696 (source (origin
2697 (method git-fetch)
2698 (uri (git-reference
2699 (url "https://github.com/rvoicilas/inotify-tools.git")
2700 (commit version)))
2701 (file-name (git-file-name name version))
2702 (sha256
2703 (base32
2704 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2705 (build-system gnu-build-system)
2706 (native-inputs
2707 `(("autoconf" ,autoconf)
2708 ("automake" ,automake)
2709 ("libtool" ,libtool)))
2710 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2711 (synopsis "Monitor file accesses")
2712 (description
2713 "The inotify-tools packages provides a C library and command-line tools
2714 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2715 (license license:gpl2+)))
2716
2717 (define-public kmod
2718 (package
2719 (name "kmod")
2720 (version "26")
2721 (source (origin
2722 (method url-fetch)
2723 (uri
2724 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2725 "kmod-" version ".tar.xz"))
2726 (sha256
2727 (base32
2728 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2729 (patches (search-patches "kmod-module-directory.patch"))))
2730 (build-system gnu-build-system)
2731 (native-inputs
2732 `(("pkg-config" ,pkg-config)))
2733 (inputs
2734 `(("xz" ,xz)
2735 ("zlib" ,zlib)))
2736 (arguments
2737 `(#:tests? #f ; FIXME: Investigate test failures
2738 #:configure-flags '("--with-xz" "--with-zlib")
2739 #:phases
2740 (modify-phases %standard-phases
2741 (add-after 'install 'install-modprobe&co
2742 (lambda* (#:key outputs #:allow-other-keys)
2743 (let* ((out (assoc-ref outputs "out"))
2744 (bin (string-append out "/bin")))
2745 (for-each (lambda (tool)
2746 (symlink "kmod"
2747 (string-append bin "/" tool)))
2748 '("insmod" "rmmod" "lsmod" "modprobe"
2749 "modinfo" "depmod"))
2750 #t))))))
2751 (home-page "https://www.kernel.org/")
2752 (synopsis "Kernel module tools")
2753 (description "Kmod is a set of tools to handle common tasks with Linux
2754 kernel modules like insert, remove, list, check properties, resolve
2755 dependencies and aliases.
2756
2757 These tools are designed on top of libkmod, a library that is shipped with
2758 kmod. The aim is to be compatible with tools, configurations and indices
2759 from the module-init-tools project.")
2760 (license license:gpl2+))) ; library under lgpl2.1+
2761
2762 (define-public earlyoom
2763 (package
2764 (name "earlyoom")
2765 (version "1.3.1")
2766 (source (origin
2767 (method git-fetch)
2768 (uri (git-reference
2769 (url "https://github.com/rfjakob/earlyoom.git")
2770 (commit (string-append "v" version))))
2771 (file-name (git-file-name name version))
2772 (sha256
2773 (base32
2774 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
2775 (build-system gnu-build-system)
2776 (arguments
2777 `(#:phases (modify-phases %standard-phases
2778 (delete 'configure)
2779 (add-before 'check 'set-home
2780 (lambda _
2781 (setenv "HOME" (getcwd))
2782 #t))
2783 (add-after 'build 'install-contribs
2784 ;; Install what seems useful from the contrib directory.
2785 (lambda* (#:key outputs #:allow-other-keys)
2786 (let* ((out (assoc-ref outputs "out"))
2787 (contrib (string-append
2788 out "/share/earlyoom/contrib")))
2789 (install-file "contrib/notify_all_users.py" contrib)
2790 #t))))
2791 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
2792 (list "CC=gcc"
2793 (string-append "VERSION=v" ,version)
2794 (string-append "PREFIX=" prefix)
2795 (string-append "SYSCONFDIR=" prefix "/etc")))
2796 #:test-target "test"))
2797 (native-inputs `(("go" ,go) ;for the test suite
2798 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
2799 (home-page "https://github.com/rfjakob/earlyoom")
2800 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
2801 (description "Early OOM is a minimalist out of memory (OOM) daemon that
2802 runs in user space and provides a more responsive and configurable alternative
2803 to the in-kernel OOM killer.")
2804 (license license:expat)))
2805
2806 (define-public eudev
2807 ;; The post-systemd fork, maintained by Gentoo.
2808 (package
2809 (name "eudev")
2810 (version "3.2.9")
2811 (source (origin
2812 (method git-fetch)
2813 (uri (git-reference (url "https://github.com/gentoo/eudev")
2814 (commit (string-append "v" version))))
2815 (file-name (git-file-name name version))
2816 (sha256
2817 (base32
2818 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
2819 (patches (search-patches "eudev-rules-directory.patch"))))
2820 (build-system gnu-build-system)
2821 (arguments
2822 '(#:phases
2823 (modify-phases %standard-phases
2824 (add-after 'unpack 'make-source-writable
2825 (lambda _
2826 ;; XXX: Git checkouts are read-only, but this package needs to
2827 ;; modify some of its files.
2828 (for-each make-file-writable (find-files "."))
2829 #t))
2830 (add-before 'bootstrap 'patch-file-names
2831 (lambda* (#:key inputs #:allow-other-keys)
2832 (substitute* "man/make.sh"
2833 (("/usr/bin/xsltproc")
2834 (string-append (assoc-ref inputs "xsltproc")
2835 "/bin/xsltproc")))
2836 #t))
2837 (add-after 'install 'move-static-library
2838 (lambda* (#:key outputs #:allow-other-keys)
2839 (let* ((out (assoc-ref outputs "out"))
2840 (static (assoc-ref outputs "static"))
2841 (source (string-append out "/lib/libudev.a"))
2842 (target (string-append static "/lib/libudev.a")))
2843 (mkdir-p (dirname target))
2844 (link source target)
2845 (delete-file source)
2846 ;; Remove reference to the static library from the .la file
2847 ;; such that Libtool looks for it in the usual places.
2848 (substitute* (string-append out "/lib/libudev.la")
2849 (("old_library=.*")
2850 "old_library=''\n"))
2851 #t)))
2852 (add-after 'install 'build-hwdb
2853 (lambda* (#:key outputs #:allow-other-keys)
2854 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2855 ;; similar tools to display product names.
2856 (let ((out (assoc-ref outputs "out")))
2857 (invoke (string-append out "/bin/udevadm")
2858 "hwdb" "--update")))))
2859 #:configure-flags (list "--enable-manpages")))
2860 (native-inputs
2861 `(("autoconf" ,autoconf)
2862 ("automake" ,automake)
2863 ("gperf" ,gperf)
2864 ("libtool" ,libtool)
2865 ("pkg-config" ,pkg-config)
2866 ;; For tests.
2867 ("perl" ,perl)
2868 ("python" ,python-wrapper)
2869 ;; For documentation.
2870 ("docbook-xml" ,docbook-xml-4.2)
2871 ("docbook-xsl" ,docbook-xsl)
2872 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2873 ("xsltproc" ,libxslt)))
2874 (inputs
2875 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2876 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2877 ;; which contains the rules to do that.
2878 `(("util-linux" ,util-linux) ;for blkid
2879 ("kmod" ,kmod)))
2880 (outputs '("out" "static"))
2881 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2882 (synopsis "Userspace device management")
2883 (description "Udev is a daemon which dynamically creates and removes
2884 device nodes from /dev/, handles hotplug events and loads drivers at boot
2885 time.")
2886 (license license:gpl2+)))
2887
2888 ;; TODO: Merge with eudev on the next rebuild cycle.
2889 (define-public eudev/btrfs-fix
2890 (package/inherit
2891 eudev
2892 (version (string-append (package-version eudev) "-1"))
2893 (arguments
2894 (substitute-keyword-arguments (package-arguments eudev)
2895 ((#:phases phases '%standard-phases)
2896 `(modify-phases ,phases
2897 (add-before 'configure 'patch-bindir-in-btrfs-rules
2898 (lambda* (#:key outputs #:allow-other-keys)
2899 ;; The "@bindir@" substitution incorrectly expands to a literal
2900 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
2901 ;; around it.
2902 (let ((out (assoc-ref outputs "out")))
2903 (substitute* "rules/64-btrfs.rules.in"
2904 (("@bindir@")
2905 (string-append out "/bin")))
2906 #t)))))))))
2907
2908 (define-public eudev-with-hwdb
2909 (deprecated-package "eudev-with-hwdb" eudev))
2910
2911 (define-public lvm2
2912 (package
2913 (name "lvm2")
2914 (version "2.03.08")
2915 (source (origin
2916 (method url-fetch)
2917 (uri (list (string-append "ftp://sourceware.org/pub/lvm2/LVM2."
2918 version ".tgz")
2919 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2920 version ".tgz")))
2921 (sha256
2922 (base32
2923 "1j0yis658564rk1ddabkl8vbavp0fdd10gd6qhgyzc3akzf620kf"))
2924 (modules '((guix build utils)))
2925 (snippet
2926 '(begin
2927 (use-modules (guix build utils))
2928
2929 ;; Honor sysconfdir.
2930 (substitute* "make.tmpl.in"
2931 (("^confdir = .*$")
2932 "confdir = @sysconfdir@\n")
2933 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2934 "DEFAULT_SYS_DIR = @sysconfdir@"))
2935 #t))
2936 (patches (search-patches "lvm2-static-link.patch"))))
2937 (build-system gnu-build-system)
2938 (native-inputs
2939 `(("pkg-config" ,pkg-config)
2940 ("procps" ,procps))) ;tests use 'pgrep'
2941 (inputs
2942 `(("libaio" ,libaio)
2943 ("udev" ,eudev)))
2944 (arguments
2945 '(#:phases
2946 (modify-phases %standard-phases
2947 (add-after 'configure 'set-makefile-shell
2948 (lambda _
2949 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2950 ;; expected.
2951 (setenv "SHELL" (which "sh"))
2952
2953 ;; Replace /bin/sh with the right file name.
2954 (patch-makefile-SHELL "make.tmpl")
2955 #t)))
2956
2957 #:configure-flags (list (string-append "--sysconfdir="
2958 (assoc-ref %outputs "out")
2959 "/etc/lvm")
2960 "--enable-udev_sync"
2961 "--enable-udev_rules"
2962 "--enable-pkgconfig"
2963 "--enable-cmdlib"
2964 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
2965
2966 ;; Make sure programs such as 'dmsetup' can
2967 ;; find libdevmapper.so.
2968 (string-append "LDFLAGS=-Wl,-rpath="
2969 (assoc-ref %outputs "out")
2970 "/lib,-rpath="
2971 (assoc-ref %outputs "out")
2972 "/lib/device-mapper"))
2973
2974 ;; The tests use 'mknod', which requires root access.
2975 #:tests? #f))
2976 (home-page "https://sourceware.org/lvm2/")
2977 (synopsis "Logical volume management for Linux")
2978 (description
2979 "LVM2 is the logical volume management tool set for Linux-based systems.
2980 This package includes the user-space libraries and tools, including the device
2981 mapper. Kernel components are part of Linux-libre.")
2982
2983 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2984 ;; Command-line tools are GPLv2.
2985 (license (list license:gpl2 license:lgpl2.1))))
2986
2987 (define-public lvm2-static
2988 (package
2989 (inherit lvm2)
2990 (name "lvm2-static")
2991
2992 ;; Propagate udev because libdevmapper.a depends on libudev.
2993 (propagated-inputs `(("udev:static" ,eudev "static")))
2994
2995 (arguments
2996 (substitute-keyword-arguments (package-arguments lvm2)
2997 ((#:configure-flags flags '())
2998 ;; LVM2 doesn't use Libtool, hence the custom option.
2999 `(append '("--enable-static_link")
3000 ;; Building dmeventd statically is complicated due to a
3001 ;; requirement on libdevmapper.a, which is being phased out
3002 ;; in favor of libdevice-mapper.a, which in turn is is not
3003 ;; easily made available at dmeventd build time. Just ignore
3004 ;; it until the situation improves.
3005 (delete "--enable-dmeventd" ,flags)))
3006 ((#:phases phases)
3007 `(modify-phases ,phases
3008 (add-before 'configure 'adjust-Makefile
3009 (lambda _
3010 ;; These fixes are related to the upstream libdm->device_mapper
3011 ;; migration and will hopefully be fixed upstream in due time.
3012 (substitute* "tools/Makefile.in"
3013 ;; This variable is empty in a static configuration and causes
3014 ;; an erroneous GCC command line.
3015 (("-L\\$\\(interfacebuilddir\\)") "")
3016 ;; Remove obsolete reference to libdevmapper.a.
3017 (("-ldevmapper") ""))
3018 #t))))))
3019 (synopsis "Logical volume management for Linux (statically linked)")))
3020
3021 (define-public wireless-tools
3022 (package
3023 (name "wireless-tools")
3024 (version "30.pre9")
3025 (source (origin
3026 (method url-fetch)
3027 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3028 version ".tar.gz"))
3029 (sha256
3030 (base32
3031 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3032 (snippet
3033 '(begin
3034 ;; Remove the older header files that are not free software.
3035 (for-each (lambda (n)
3036 (delete-file (format #f "wireless.~a.h" n)))
3037 '(10 11 12 13 14 15 16 17 18 19 20))
3038 #t))))
3039 (build-system gnu-build-system)
3040 (arguments
3041 `(#:make-flags
3042 (list (string-append "PREFIX=" %output)
3043 (string-append "INSTALL_MAN=" %output "/share/man")
3044 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3045 "BUILD_STATIC=")
3046 #:phases
3047 (modify-phases %standard-phases
3048 (replace 'configure
3049 (lambda* (#:key target #:allow-other-keys)
3050 (when ,(%current-target-system)
3051 ;; Cross-compilation: use the cross tools.
3052 (substitute* (find-files "." "Makefile")
3053 (("CC = .*$")
3054 (string-append "CC = " target "-gcc\n"))
3055 (("AR = .*$")
3056 (string-append "AR = " target "-ar\n"))
3057 (("RANLIB = .*$")
3058 (string-append "RANLIB = " target "-ranlib\n"))))
3059 #t)))
3060 #:tests? #f))
3061 (synopsis "Tools for manipulating Linux Wireless Extensions")
3062 (description "Wireless Tools are used to manipulate the now-deprecated
3063 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3064 Extension was an interface allowing you to set Wireless LAN specific
3065 parameters and get the specific stats. It is deprecated in favor the nl80211
3066 interface.")
3067 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3068 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3069 ;; other files are distributed under gpl2.
3070 (license (list license:gpl2 license:lgpl2.1+))))
3071
3072 (define-public crda
3073 (package
3074 (name "crda")
3075 (version "3.18")
3076 (source (origin
3077 (method url-fetch)
3078 (uri (string-append "mirror://kernel.org/software/network/crda/"
3079 "crda-" version ".tar.xz"))
3080 (sha256
3081 (base32
3082 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3083 (patches (search-patches "crda-optional-gcrypt.patch"))))
3084 (build-system gnu-build-system)
3085 (arguments
3086 '(#:phases (modify-phases %standard-phases
3087 (delete 'configure)
3088 (add-after 'unpack 'gzip-determinism
3089 (lambda _
3090 (substitute* "Makefile"
3091 (("gzip") "gzip --no-name"))
3092 #t))
3093 (add-before
3094 'build 'no-werror-no-ldconfig
3095 (lambda _
3096 (substitute* "Makefile"
3097 (("-Werror") "")
3098 (("ldconfig") "true"))
3099 #t))
3100 (add-before
3101 'build 'set-regulator-db-file-name
3102 (lambda* (#:key inputs #:allow-other-keys)
3103 ;; Tell CRDA where to find our database.
3104 (let ((regdb (assoc-ref inputs "wireless-regdb")))
3105 (substitute* "crda.c"
3106 (("\"/lib/crda/regulatory.bin\"")
3107 (string-append "\"" regdb
3108 "/lib/crda/regulatory.bin\"")))
3109 #t))))
3110 #:test-target "verify"
3111 #:make-flags (let ((out (assoc-ref %outputs "out"))
3112 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3113 (list "CC=gcc" "V=1"
3114
3115 ;; Disable signature-checking on 'regulatory.bin'.
3116 ;; The reason is that this simplifies maintenance
3117 ;; on our side (no need to manage a distro key
3118 ;; pair), and we can guarantee integrity of
3119 ;; 'regulatory.bin' by other means anyway, such as
3120 ;; 'guix gc --verify'. See
3121 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3122 ;; for a discssion.
3123 "USE_OPENSSL=0"
3124
3125 (string-append "PREFIX=" out)
3126 (string-append "SBINDIR=" out "/sbin/")
3127 (string-append "UDEV_RULE_DIR="
3128 out "/lib/udev/rules.d")
3129 (string-append "LDFLAGS=-Wl,-rpath="
3130 out "/lib -L.")
3131 (string-append "REG_BIN=" regdb
3132 "/lib/crda/regulatory.bin")))))
3133 (native-inputs `(("pkg-config" ,pkg-config)
3134 ("wireless-regdb" ,wireless-regdb)))
3135 (inputs `(("libnl" ,libnl)))
3136 (home-page
3137 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3138 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3139 (description
3140 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3141 communication between the kernel Linux and user space for regulatory
3142 compliance.")
3143 (license license:copyleft-next)))
3144
3145 (define-public wireless-regdb
3146 (package
3147 (name "wireless-regdb")
3148 (version "2019.06.03")
3149 (source (origin
3150 (method url-fetch)
3151 (uri (string-append
3152 "mirror://kernel.org/software/network/wireless-regdb/"
3153 "wireless-regdb-" version ".tar.xz"))
3154 (sha256
3155 (base32
3156 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
3157
3158 ;; We're building 'regulatory.bin' by ourselves.
3159 (snippet '(begin
3160 (delete-file "regulatory.bin")
3161 #t))))
3162 (build-system gnu-build-system)
3163 (arguments
3164 '(#:phases
3165 (modify-phases %standard-phases
3166 (add-after 'unpack 'gzip-determinism
3167 (lambda _
3168 (substitute* "Makefile"
3169 (("gzip") "gzip --no-name"))
3170 #t))
3171 (add-after 'unpack 'omit-signature
3172 (lambda _
3173 (substitute* "Makefile"
3174 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3175 ;; don't provide (see below). Disable it.
3176 ((" regulatory\\.db\\.p7s") "")
3177 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3178 ;; but ‘make install’ depends only on the latter while installing
3179 ;; both (and failing). Depend on it explicitly.
3180 (("^install: " all) (string-append all "regulatory.db ")))
3181 #t))
3182 (delete 'configure)) ; no configure script
3183
3184 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3185 ;; is computed and can be equal to 'maintainer-clean'; when that
3186 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3187 ;; just built. Thus, build things sequentially.
3188 #:parallel-build? #f
3189
3190 #:tests? #f ; no tests
3191 #:make-flags
3192 (let ((out (assoc-ref %outputs "out")))
3193 (list (string-append "PREFIX=" out)
3194 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3195
3196 ;; Leave this empty so that db2bin.py doesn't try to sign
3197 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3198 ;; pair for the whole distribution.
3199 (string-append "REGDB_PRIVKEY=")
3200 ;; Don't generate a public key for the same reason. These are
3201 ;; used as Makefile targets and can't be the empty string.
3202 (string-append "REGDB_PUBCERT=/dev/null")
3203 (string-append "REGDB_PUBKEY=/dev/null")))))
3204 (native-inputs
3205 `(("python" ,python-wrapper)))
3206 (home-page
3207 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3208 (synopsis "Wireless regulatory database")
3209 (description
3210 "This package contains the wireless regulatory database Central
3211 Regulatory Database Agent (CRDA) daemon. The database contains information on
3212 country-specific regulations for the wireless spectrum.")
3213 (license license:isc)))
3214
3215 (define-public lm-sensors
3216 (package
3217 (name "lm-sensors")
3218 (version "3.6.0")
3219 (source
3220 (origin
3221 (method git-fetch)
3222 (uri (git-reference
3223 (url "https://github.com/groeck/lm-sensors.git")
3224 (commit (string-append "V" (string-join
3225 (string-split version #\.) "-")))))
3226 (file-name (git-file-name name version))
3227 (sha256
3228 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3229 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3230 (build-system gnu-build-system)
3231 (inputs `(("rrdtool" ,rrdtool)
3232 ("perl" ,perl)
3233 ("kmod" ,kmod)
3234 ("gnuplot" ,gnuplot)))
3235 (native-inputs `(("pkg-config" ,pkg-config)
3236 ("flex" ,flex)
3237 ("bison" ,bison)
3238 ("which" ,which)))
3239 (outputs '("lib" ; avoid perl in closure
3240 "out"))
3241 (arguments
3242 `(#:tests? #f ; no 'check' target
3243 #:make-flags (list (string-append "PREFIX=" %output)
3244 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3245 (string-append "INCLUDEDIR="
3246 (assoc-ref %outputs "lib") "/include")
3247 (string-append "MANDIR=" %output "/share/man")
3248 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3249 #:phases
3250 (modify-phases %standard-phases
3251 (delete 'configure)
3252 (add-before 'build 'patch-exec-paths
3253 (lambda* (#:key inputs outputs #:allow-other-keys)
3254 (substitute* "prog/detect/sensors-detect"
3255 (("`uname")
3256 (string-append "`" (assoc-ref inputs "coreutils")
3257 "/bin/uname"))
3258 (("(`|\")modprobe" all open-quote)
3259 (string-append open-quote
3260 (assoc-ref inputs "kmod")
3261 "/bin/modprobe")))
3262 (substitute* '("prog/pwm/pwmconfig"
3263 "prog/pwm/fancontrol")
3264 (("gnuplot")
3265 (string-append (assoc-ref inputs "gnuplot")
3266 "/bin/gnuplot"))
3267 (("cat ")
3268 (string-append (assoc-ref inputs "coreutils")
3269 "/bin/cat "))
3270 (("grep ")
3271 (string-append (assoc-ref inputs "grep")
3272 "/bin/grep "))
3273 (("sed -e")
3274 (string-append (assoc-ref inputs "sed")
3275 "/bin/sed -e"))
3276 (("cut -d")
3277 (string-append (assoc-ref inputs "coreutils")
3278 "/bin/cut -d"))
3279 (("sleep ")
3280 (string-append (assoc-ref inputs "coreutils")
3281 "/bin/sleep "))
3282 (("readlink -f")
3283 (string-append (assoc-ref inputs "coreutils")
3284 "/bin/readlink -f")))
3285 #t)))))
3286 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3287 (synopsis "Utilities to read temperature/voltage/fan sensors")
3288 (description
3289 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3290 you to access information from temperature, voltage, and fan speed sensors.
3291 It works with most newer systems.")
3292 (license license:gpl2+)))
3293
3294 (define-public iucode-tool
3295 (package
3296 (name "iucode-tool")
3297 (version "2.3.1")
3298 (source (origin
3299 (method url-fetch)
3300 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3301 "/raw/latest/iucode-tool_" version ".tar.xz"))
3302 (sha256
3303 (base32
3304 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3305 (build-system gnu-build-system)
3306 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3307 (synopsis "Manipulate Intel microcode bundles")
3308 (description
3309 "@command{iucode_tool} is a utility to work with microcode packages for
3310 Intel processors. It can convert between formats, extract specific versions,
3311 create a firmware image suitable for the Linux kernel, and more.")
3312 ;; cpuid.h is available for i686, x86_64, and ia64.
3313 (supported-systems '("i686-linux" "x86_64-linux"))
3314 (license license:gpl2+)))
3315
3316 (define-public i2c-tools
3317 (package
3318 (name "i2c-tools")
3319 (version "3.1.1")
3320 (source (origin
3321 (method url-fetch)
3322 (uri (string-append
3323 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3324 version ".tar.bz2"))
3325 (sha256
3326 (base32
3327 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3328 (build-system gnu-build-system)
3329 (arguments
3330 `(#:tests? #f ; no 'check' target
3331 #:make-flags (list (string-append "prefix=" %output)
3332 "CC=gcc")
3333 ;; no configure script
3334 #:phases (modify-phases %standard-phases (delete 'configure))))
3335 (inputs
3336 `(("perl" ,perl)))
3337 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3338 (synopsis "I2C tools for Linux")
3339 (description
3340 "The i2c-tools package contains a heterogeneous set of I2C tools for
3341 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3342 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3343 SMBus access.")
3344 (license license:gpl2+)))
3345
3346 (define-public xsensors
3347 (package
3348 (name "xsensors")
3349 (version "0.70")
3350 (source (origin
3351 (method url-fetch)
3352 (uri (string-append
3353 "http://www.linuxhardware.org/xsensors/xsensors-"
3354 version ".tar.gz"))
3355 (sha256
3356 (base32
3357 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3358 (build-system gnu-build-system)
3359 (inputs `(("lm-sensors" ,lm-sensors "lib")
3360 ("gtk" ,gtk+-2)))
3361 (native-inputs `(("pkg-config" ,pkg-config)))
3362 (arguments
3363 `(#:phases
3364 (modify-phases %standard-phases
3365 (add-before 'configure 'enable-deprecated
3366 (lambda _
3367 (substitute* "src/Makefile.in"
3368 (("-DGDK_DISABLE_DEPRECATED") "")
3369 (("-DGTK_DISABLE_DEPRECATED") ""))
3370 #t))
3371 (add-before 'configure 'remove-Werror
3372 (lambda _
3373 (substitute* '("configure" "src/Makefile.in")
3374 (("-Werror") ""))
3375 #t)))))
3376 (home-page "http://www.linuxhardware.org/xsensors/")
3377 (synopsis "Hardware health information viewer")
3378 (description
3379 "Xsensors reads data from the libsensors library regarding hardware
3380 health such as temperature, voltage and fan speed and displays the information
3381 in a digital read-out.")
3382 (license license:gpl2+)))
3383
3384 (define-public perf
3385 (package
3386 (name "perf")
3387 (version (package-version linux-libre))
3388 (source (package-source linux-libre))
3389 (build-system gnu-build-system)
3390 (arguments
3391 '(#:phases
3392 (modify-phases %standard-phases
3393 (replace 'configure
3394 (lambda* (#:key inputs #:allow-other-keys)
3395 (setenv "SHELL_PATH" (which "bash"))
3396 (chdir "tools/perf")
3397 #t)))
3398 #:make-flags (list (string-append "prefix="
3399 (assoc-ref %outputs "out"))
3400 ;; Make sure the kernel headers are treated as system
3401 ;; headers to suppress warnings from those.
3402 (string-append "C_INCLUDE_PATH="
3403 (assoc-ref %build-inputs "kernel-headers")
3404 "/include")
3405 "WERROR=0"
3406
3407 ;; By default, 'config/Makefile' uses lib64 on
3408 ;; x86_64. Work around that.
3409 "lib=lib")
3410 #:tests? #f)) ;no tests
3411 (native-inputs
3412 `(("pkg-config" ,pkg-config)
3413 ("bison" ,bison)
3414 ("flex" ,flex)
3415
3416 ;; There are build scripts written in these languages.
3417 ("perl" ,perl)
3418 ("python" ,python-2)))
3419 (inputs
3420 `(("slang" ,slang) ;for the interactive TUI
3421 ;; ("newt" ,newt)
3422 ("python" ,python-2) ;'perf' links against libpython
3423 ("elfutils" ,elfutils)
3424 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3425 ("libunwind" ,libunwind) ;better stack walking
3426 ("numactl" ,numactl) ;for 'perf bench numa mem'
3427
3428 ;; Documentation.
3429 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3430 ("docbook-xsl" ,docbook-xsl)
3431 ("xmlto" ,xmlto)
3432 ("asciidoc" ,asciidoc)))
3433 (home-page "https://perf.wiki.kernel.org/")
3434 (synopsis "Linux profiling with performance counters")
3435 (description
3436 "perf is a tool suite for profiling using hardware performance counters,
3437 with support in the Linux kernel. perf can instrument CPU performance
3438 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3439 of lightweight profiling. This package contains the user-land tools and in
3440 particular the @code{perf} command.")
3441 (license (package-license linux-libre))))
3442
3443 (define-public pflask
3444 (package
3445 (name "pflask")
3446 (version "0.2")
3447 (source (origin
3448 (method url-fetch)
3449 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3450 version ".tar.gz"))
3451 (file-name (string-append name "-" version ".tar.gz"))
3452 (sha256
3453 (base32
3454 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3455 (build-system cmake-build-system)
3456 (arguments
3457 '(#:tests? #f)) ; no tests
3458 (home-page "https://ghedo.github.io/pflask/")
3459 (synopsis "Simple tool for creating Linux namespace containers")
3460 (description "pflask is a simple tool for creating Linux namespace
3461 containers. It can be used for running a command or even booting an OS inside
3462 an isolated container, created with the help of Linux namespaces. It is
3463 similar in functionality to chroot, although pflask provides better isolation
3464 thanks to the use of namespaces.")
3465 (license license:bsd-2)))
3466
3467 (define-public singularity
3468 (package
3469 (name "singularity")
3470 (version "2.6.1")
3471 (source (origin
3472 (method url-fetch)
3473 (uri (string-append "https://github.com/singularityware/singularity/"
3474 "releases/download/" version
3475 "/singularity-" version ".tar.gz"))
3476 (sha256
3477 (base32
3478 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3479 (modules '((guix build utils)))
3480 (snippet
3481 '(begin
3482 ;; Do not create directories in /var.
3483 (substitute* "Makefile.in"
3484 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3485
3486 ;; The original source overrides PATH so that it points to
3487 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3488 ;; on Guix System. Leave PATH unchanged so we refer to the
3489 ;; installed Coreutils, grep, etc.
3490 (substitute* "bin/singularity.in"
3491 (("^PATH=.*" all)
3492 (string-append "#" all "\n")))
3493
3494 (substitute* (find-files "libexec/cli" "\\.exec$")
3495 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3496 _ program)
3497 (string-append "/run/setuid-programs/singularity-"
3498 program "-helper")))
3499
3500 ;; These squashfs mount options are apparently no longer
3501 ;; supported since Linux-libre 5.4.5.
3502 (substitute* "src/lib/image/squashfs/mount.c"
3503 (("\"errors=remount-ro\"")
3504 "NULL"))
3505 #t))))
3506 (build-system gnu-build-system)
3507 (arguments
3508 `(#:configure-flags '("--localstatedir=/var")
3509 #:phases
3510 (modify-phases %standard-phases
3511 (add-after 'unpack 'patch-reference-to-squashfs-tools
3512 (lambda _
3513 (substitute* "libexec/cli/build.exec"
3514 (("if ! singularity_which mksquashfs") "if 0")
3515 (("if ! mksquashfs")
3516 (string-append "if ! " (which "mksquashfs"))))
3517 #t))
3518 (add-after 'install 'set-PATH
3519 (lambda* (#:key inputs outputs #:allow-other-keys)
3520 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
3521 (let ((out (assoc-ref outputs "out"))
3522 (coreutils (assoc-ref inputs "coreutils")))
3523 (wrap-program (string-append out "/bin/singularity")
3524 `("PATH" ":" = (,(string-append coreutils "/bin"))))
3525 (substitute* (string-append out "/bin/run-singularity")
3526 (("/usr/bin/env singularity")
3527 (string-append (which "env") " "
3528 out "/bin/singularity")))
3529 #t))))))
3530 (inputs
3531 `(("libarchive" ,libarchive)
3532 ("python" ,python-wrapper)
3533 ("zlib" ,zlib)
3534 ("squashfs-tools" ,squashfs-tools)))
3535 (home-page "https://singularity.lbl.gov/")
3536 (synopsis "Container platform")
3537 (description "Singularity is a container platform supporting a number of
3538 container image formats. It can build SquashFS container images or import
3539 existing Docker images. Singularity requires kernel support for container
3540 isolation or root privileges.")
3541 (license license:bsd-3)))
3542
3543 (define-public hdparm
3544 (package
3545 (name "hdparm")
3546 (version "9.58")
3547 (source (origin
3548 (method url-fetch)
3549 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3550 "hdparm-" version ".tar.gz"))
3551 (sha256
3552 (base32
3553 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3554 (build-system gnu-build-system)
3555 (arguments
3556 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3557 (list (string-append "binprefix=" out)
3558 (string-append "manprefix=" out)
3559 "CC=gcc"))
3560 #:phases
3561 (modify-phases %standard-phases
3562 (delete 'configure)) ; no configure script
3563 #:tests? #f)) ; no test suite
3564 (home-page "https://sourceforge.net/projects/hdparm/")
3565 (synopsis "View and tune ATA disk drive parameters")
3566 (description
3567 "@command{hdparm} is a command-line utility to control ATA controllers and
3568 disk drives. It can increase performance and/or reliability by careful tuning
3569 of hardware settings like power and acoustic management, DMA modes, and caching.
3570 It can also display detailed device information, or be used as a simple
3571 performance benchmarking tool.
3572
3573 @command{hdparm} provides a command line interface to various Linux kernel
3574 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3575 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3576 Translation (@dfn{SAT}) are also supported.")
3577 (license (license:non-copyleft "file://LICENSE.TXT"))))
3578
3579 (define-public nvme-cli
3580 (package
3581 (name "nvme-cli")
3582 (version "1.10.1")
3583 (home-page "https://github.com/linux-nvme/nvme-cli")
3584 (source (origin
3585 (method git-fetch)
3586 (uri (git-reference
3587 (url home-page)
3588 (commit (string-append "v" version))))
3589 (sha256
3590 (base32 "12wp2wxmsw2v8m9bhvwvdbhdgx1md8iilhbl19sfzz2araiwi2x8"))
3591 (file-name (git-file-name name version))))
3592 (build-system gnu-build-system)
3593 (arguments
3594 `(#:make-flags (list "CC=gcc")
3595 #:phases (modify-phases %standard-phases
3596 (delete 'configure) ; No ./configure script
3597 (replace 'install
3598 (lambda _
3599 (invoke "make" "install-spec" "PREFIX="
3600 (string-append "DESTDIR=" %output)))))
3601 #:tests? #f)) ; The tests require sysfs, which is not accessible from
3602 ; the build environment
3603 (synopsis "NVM-Express user space tooling for Linux")
3604 (description "Nvme-cli is a utility to provide standards compliant tooling
3605 for NVM-Express drives. It was made specifically for Linux as it relies on the
3606 IOCTLs defined by the mainline kernel driver.")
3607 (license license:gpl2+)))
3608
3609 (define-public rfkill
3610 (package
3611 (name "rfkill")
3612 (version "0.5")
3613 (source (origin
3614 (method url-fetch)
3615 (uri (string-append "mirror://kernel.org/software/network/"
3616 name "/" name "-" version ".tar.xz"))
3617 (sha256
3618 (base32
3619 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3620 (build-system gnu-build-system)
3621 (arguments
3622 `(#:make-flags (list "CC=gcc"
3623 (string-append "PREFIX=" %output))
3624 #:phases (modify-phases %standard-phases
3625 (delete 'configure))
3626 #:tests? #f))
3627 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3628 (synopsis "Tool for enabling and disabling wireless devices")
3629 (description
3630 "rfkill is a simple tool for accessing the rfkill device interface,
3631 which is used to enable and disable wireless networking devices, typically
3632 WLAN, Bluetooth and mobile broadband.")
3633 (license (license:non-copyleft "file://COPYING"
3634 "See COPYING in the distribution."))
3635 ;; rfkill is part of util-linux as of 2.31.
3636 (properties `((superseded . ,util-linux)))))
3637
3638 (define-public acpi
3639 (package
3640 (name "acpi")
3641 (version "1.7")
3642 (source (origin
3643 (method url-fetch)
3644 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3645 version "/" name "-" version ".tar.gz"))
3646 (sha256
3647 (base32
3648 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3649 (build-system gnu-build-system)
3650 (home-page "http://acpiclient.sourceforge.net")
3651 (synopsis "Display information on ACPI devices")
3652 (description "@code{acpi} attempts to replicate the functionality of the
3653 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3654 information. It does not support ACPI suspending, only displays information
3655 about ACPI devices.")
3656 (license license:gpl2+)))
3657
3658 (define-public acpid
3659 (package
3660 (name "acpid")
3661 (version "2.0.32")
3662 (source (origin
3663 (method url-fetch)
3664 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3665 version ".tar.xz"))
3666 (sha256
3667 (base32
3668 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
3669 (build-system gnu-build-system)
3670 (home-page "https://sourceforge.net/projects/acpid2/")
3671 (synopsis "Daemon for delivering ACPI events to user-space programs")
3672 (description
3673 "acpid is designed to notify user-space programs of Advanced
3674 Configuration and Power Interface (ACPI) events. acpid should be started
3675 during the system boot, and will run as a background process. When an ACPI
3676 event is received from the kernel, acpid will examine the list of rules
3677 specified in /etc/acpi/events and execute the rules that match the event.")
3678 (license license:gpl2+)))
3679
3680 (define-public sysfsutils
3681 (package
3682 (name "sysfsutils")
3683 (version "2.1.0")
3684 (source
3685 (origin
3686 (method url-fetch)
3687 (uri
3688 (string-append
3689 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3690 version ".tar.gz"))
3691 (sha256
3692 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3693 (build-system gnu-build-system)
3694 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3695 (synopsis "System utilities based on Linux sysfs")
3696 (description
3697 "These are a set of utilities built upon sysfs, a virtual file system in
3698 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3699 also contains the libsysfs library.")
3700 ;; The library is under lgpl2.1+ (all files say "or any later version").
3701 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3702 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3703
3704 (define-public sysfsutils-1
3705 (package
3706 (inherit sysfsutils)
3707 (version "1.3.0")
3708 (source
3709 (origin
3710 (method url-fetch)
3711 (uri
3712 (string-append
3713 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3714 "/sysfsutils-" version ".tar.gz"))
3715 (sha256
3716 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3717 (modules '((guix build utils)))
3718 (snippet
3719 '(begin
3720 (substitute* "Makefile.in"
3721 (("includedir = /usr/include/sysfs")
3722 "includedir = @includedir@"))
3723 (substitute* "configure"
3724 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3725 (string-append "includedir='" orig "/sysfs'")))
3726 #t))))
3727 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3728
3729 (define-public cpufrequtils
3730 (package
3731 (name "cpufrequtils")
3732 (version "0.3")
3733 (source
3734 (origin
3735 (method url-fetch)
3736 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3737 "cpufrequtils-" version ".tar.gz"))
3738 (sha256
3739 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3740 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3741 (build-system gnu-build-system)
3742 (native-inputs
3743 `(("sysfsutils" ,sysfsutils-1)))
3744 (arguments
3745 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3746 (assoc-ref %outputs "out") "/lib"))))
3747 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3748 (synopsis "Utilities to get and set CPU frequency on Linux")
3749 (description
3750 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3751 information, and set the CPU frequency if supported, using the cpufreq
3752 capabilities of the Linux kernel.")
3753 (license license:gpl2)))
3754
3755 (define-public libraw1394
3756 (package
3757 (name "libraw1394")
3758 (version "2.1.2")
3759 (source (origin
3760 (method url-fetch)
3761 (uri (string-append
3762 "mirror://kernel.org/linux/libs/ieee1394/"
3763 name "-" version ".tar.xz"))
3764 (sha256
3765 (base32
3766 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3767 (build-system gnu-build-system)
3768 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3769 (synopsis "Interface library for the Linux IEEE1394 drivers")
3770 (description
3771 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3772 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3773 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3774 send to and receive from other nodes without requiring a kernel driver for the
3775 protocol in question.")
3776 (license license:lgpl2.1+)))
3777
3778 (define-public libavc1394
3779 (package
3780 (name "libavc1394")
3781 (version "0.5.4")
3782 (source (origin
3783 (method url-fetch)
3784 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3785 name "-" version ".tar.gz"))
3786 (sha256
3787 (base32
3788 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3789 (build-system gnu-build-system)
3790 (native-inputs
3791 `(("pkg-config" ,pkg-config)))
3792 (propagated-inputs
3793 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3794 (home-page "https://sourceforge.net/projects/libavc1394/")
3795 (synopsis "AV/C protocol library for IEEE 1394")
3796 (description
3797 "Libavc1394 is a programming interface to the AV/C specification from
3798 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3799 (license license:lgpl2.1+)))
3800
3801 (define-public libiec61883
3802 (package
3803 (name "libiec61883")
3804 (version "1.2.0")
3805 (source (origin
3806 (method url-fetch)
3807 (uri (string-append
3808 "mirror://kernel.org/linux/libs/ieee1394/"
3809 name "-" version ".tar.xz"))
3810 (sha256
3811 (base32
3812 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3813 (build-system gnu-build-system)
3814 (native-inputs
3815 `(("pkg-config" ,pkg-config)))
3816 (propagated-inputs
3817 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3818 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3819 (synopsis "Isochronous streaming media library for IEEE 1394")
3820 (description
3821 "The libiec61883 library provides a higher level API for streaming DV,
3822 MPEG-2 and audio over Linux IEEE 1394.")
3823 (license license:lgpl2.1+)))
3824
3825 (define-public mdadm
3826 (package
3827 (name "mdadm")
3828 (version "4.1")
3829 (source (origin
3830 (method url-fetch)
3831 (uri (string-append
3832 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3833 version ".tar.xz"))
3834 (sha256
3835 (base32
3836 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3837 (build-system gnu-build-system)
3838 (inputs
3839 `(("udev" ,eudev)))
3840 (arguments
3841 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3842 (list "CC=gcc"
3843 "INSTALL=install"
3844 "CHECK_RUN_DIR=0"
3845 ;; TODO: tell it where to find 'sendmail'
3846 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3847 (string-append "BINDIR=" out "/sbin")
3848 (string-append "MANDIR=" out "/share/man")
3849 (string-append "UDEVDIR=" out "/lib/udev")))
3850 #:phases
3851 (modify-phases %standard-phases
3852 (add-before 'build 'patch-program-paths
3853 (lambda* (#:key inputs #:allow-other-keys)
3854 (let ((coreutils (assoc-ref inputs "coreutils")))
3855 (substitute* "udev-md-raid-arrays.rules"
3856 (("/usr/bin/(readlink|basename)" all program)
3857 (string-append coreutils "/bin/" program))))
3858 #t))
3859 (add-before 'build 'remove-W-error
3860 (lambda _
3861 ;; We cannot build with -Werror on i686 due to a
3862 ;; 'sign-compare' warning in util.c.
3863 (substitute* "Makefile"
3864 (("-Werror") ""))
3865 #t))
3866 (delete 'configure))
3867 ;;tests must be done as root
3868 #:tests? #f))
3869 (home-page "http://neil.brown.name/blog/mdadm")
3870 (synopsis "Tool for managing Linux Software RAID arrays")
3871 (description
3872 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3873 assemble, report on, and monitor arrays. It can also move spares between raid
3874 arrays when needed.")
3875 (license license:gpl2+)))
3876
3877 (define-public mdadm-static
3878 (package
3879 (inherit mdadm)
3880 (name "mdadm-static")
3881 (arguments
3882 (substitute-keyword-arguments (package-arguments mdadm)
3883 ((#:make-flags flags)
3884 `(cons "LDFLAGS = -static" ,flags))
3885 ((#:phases phases)
3886 `(modify-phases ,phases
3887 (add-after 'install 'remove-cruft
3888 (lambda* (#:key outputs #:allow-other-keys)
3889 (let* ((out (assoc-ref outputs "out"))
3890 (precious? (lambda (file)
3891 (member file '("." ".." "sbin"))))
3892 (directories (scandir out (negate precious?))))
3893 (with-directory-excursion out
3894 (for-each delete-file-recursively directories)
3895 (remove-store-references "sbin/mdadm")
3896 (delete-file "sbin/mdmon")
3897 #t))))))
3898 ((#:modules modules %gnu-build-system-modules)
3899 `((ice-9 ftw) ,@modules))
3900 ((#:strip-flags _ '())
3901 ''("--strip-all")) ;strip a few extra KiB
3902 ((#:allowed-references _ '("out"))
3903 '("out")))) ;refer only self
3904 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3905
3906 (define-public multipath-tools
3907 (package
3908 (name "multipath-tools")
3909 (version "0.8.3")
3910 (source (origin
3911 (method url-fetch)
3912 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3913 ".git;a=snapshot;h=" version ";sf=tgz"))
3914 (file-name (string-append name "-" version ".tar.gz"))
3915 (sha256
3916 (base32
3917 "1c6ay97wlfv1fl0y8hcfpxhkps14hlnw9gzmj7884micsp7pa9yv"))
3918 (modules '((guix build utils)))
3919 (snippet
3920 '(begin
3921 ;; Drop bundled valgrind headers.
3922 (delete-file-recursively "third-party")
3923 (substitute* '("multipathd/main.c"
3924 "libmultipath/debug.c")
3925 (("#include \"../third-party/")
3926 "#include \""))
3927 #t))))
3928 (build-system gnu-build-system)
3929 (arguments
3930 '(#:tests? #f ; no tests
3931 #:make-flags (list "CC=gcc"
3932 (string-append "DESTDIR="
3933 (assoc-ref %outputs "out"))
3934 "SYSTEMDPATH=lib"
3935 ;; Add the libaio headers to GCCs system header
3936 ;; search path to suppress -Werror=cast-qual on
3937 ;; the included headers.
3938 (string-append "C_INCLUDE_PATH="
3939 (assoc-ref %build-inputs "libaio")
3940 "/include")
3941 (string-append "LDFLAGS=-Wl,-rpath="
3942 (assoc-ref %outputs "out")
3943 "/lib"))
3944 #:phases
3945 (modify-phases %standard-phases
3946 (add-after 'unpack 'patch-source
3947 (lambda* (#:key inputs #:allow-other-keys)
3948 (let ((lvm2 (assoc-ref inputs "lvm2"))
3949 (udev (assoc-ref inputs "udev")))
3950 (substitute* "Makefile.inc"
3951 (("\\$\\(prefix\\)/usr") "$(prefix)")
3952 ;; Do not save timestamp to avoid gzip "timestamp
3953 ;; out-of-range" warnings.
3954 (("gzip -9") "gzip -9n"))
3955 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3956 (("/usr/include/libdevmapper.h")
3957 (string-append lvm2 "/include/libdevmapper.h"))
3958 (("/usr/include/libudev.h")
3959 (string-append udev "/include/libudev.h")))
3960 #t)))
3961 (delete 'configure)))) ; no configure script
3962 (native-inputs
3963 `(("perl" ,perl)
3964 ("pkg-config" ,pkg-config)
3965 ("valgrind" ,valgrind)))
3966 (inputs
3967 `(("json-c" ,json-c)
3968 ("libaio" ,libaio)
3969 ("liburcu" ,liburcu)
3970 ("lvm2" ,lvm2)
3971 ("readline" ,readline)
3972 ("udev" ,eudev)))
3973 (home-page "http://christophe.varoqui.free.fr/")
3974 (synopsis "Access block devices through multiple paths")
3975 (description
3976 "This package provides the following binaries to drive the
3977 Linux Device Mapper multipathing driver:
3978 @enumerate
3979 @item @command{multipath} - Device mapper target autoconfig.
3980 @item @command{multipathd} - Multipath daemon.
3981 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3982 @code{dm} multipath devices.
3983 @item @command{kpartx} - Create device maps from partition tables.
3984 @end enumerate")
3985 (license (list license:gpl2+ ; main distribution
3986 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3987
3988 (define-public libaio
3989 (package
3990 (name "libaio")
3991 (version "0.3.112")
3992 (source (origin
3993 (method url-fetch)
3994 (uri (list
3995 (string-append "https://releases.pagure.org/libaio/"
3996 name "-" version ".tar.gz")))
3997 (sha256
3998 (base32
3999 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4000 (build-system gnu-build-system)
4001 (arguments
4002 '(#:make-flags
4003 (list "CC=gcc" (string-append "prefix=" %output))
4004 #:test-target "partcheck" ; need root for a full 'check'
4005 #:phases
4006 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4007 (home-page "https://pagure.io/libaio")
4008 (synopsis "Linux-native asynchronous I/O access library")
4009 (description
4010 "This library enables userspace to use Linux kernel asynchronous I/O
4011 system calls, important for the performance of databases and other advanced
4012 applications.")
4013 (license license:lgpl2.1+)))
4014
4015 (define-public sbc
4016 (package
4017 (name "sbc")
4018 (version "1.4")
4019 (source (origin
4020 (method url-fetch)
4021 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4022 version ".tar.xz"))
4023 (sha256
4024 (base32
4025 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4026 (build-system gnu-build-system)
4027 (inputs
4028 `(("libsndfile" ,libsndfile)))
4029 (native-inputs
4030 `(("pkg-config" ,pkg-config)))
4031 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4032 (synopsis "Bluetooth subband audio codec")
4033 (description
4034 "The SBC is a digital audio encoder and decoder used to transfer data to
4035 Bluetooth audio output devices like headphones or loudspeakers.")
4036 (license license:gpl2+)))
4037
4038 (define-public bluez
4039 (package
4040 (name "bluez")
4041 (replacement bluez/fixed)
4042 (version "5.53")
4043 (source (origin
4044 (method url-fetch)
4045 (uri (string-append
4046 "mirror://kernel.org/linux/bluetooth/bluez-"
4047 version ".tar.xz"))
4048 (sha256
4049 (base32
4050 "1g1qg6dz6hl3csrmz75ixr12lwv836hq3ckb259svvrg62l2vaiq"))))
4051 (build-system gnu-build-system)
4052 (arguments
4053 `(#:configure-flags
4054 (let ((out (assoc-ref %outputs "out")))
4055 (list "--sysconfdir=/etc"
4056 "--localstatedir=/var"
4057 "--enable-library"
4058 "--disable-systemd"
4059 ;; Install dbus/udev files to the correct location.
4060 (string-append "--with-dbusconfdir=" out "/etc")
4061 (string-append "--with-udevdir=" out "/lib/udev")))
4062 #:phases
4063 (modify-phases %standard-phases
4064 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4065 ;; issue (discussion on upstream mailing list:
4066 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4067 (add-before 'check 'skip-wonky-test
4068 (lambda _
4069 (substitute* "unit/test-gatt.c"
4070 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4071 #t))
4072 (add-after 'install 'post-install
4073 (lambda* (#:key inputs outputs #:allow-other-keys)
4074 (let* ((out (assoc-ref outputs "out"))
4075 (servicedir (string-append out "/share/dbus-1/services"))
4076 (service "obexd/src/org.bluez.obex.service")
4077 (rule (string-append
4078 out "/lib/udev/rules.d/97-hid2hci.rules")))
4079 ;; Install the obex dbus service file.
4080 (substitute* service
4081 (("/bin/false")
4082 (string-append out "/libexec/bluetooth/obexd")))
4083 (install-file service servicedir)
4084 ;; Fix paths in the udev rule.
4085 (substitute* rule
4086 (("hid2hci --method")
4087 (string-append out "/lib/udev/hid2hci --method"))
4088 (("/sbin/udevadm")
4089 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4090 #t))))))
4091 (native-inputs
4092 `(("pkg-config" ,pkg-config)
4093 ("gettext" ,gettext-minimal)))
4094 (inputs
4095 `(("glib" ,glib)
4096 ("dbus" ,dbus)
4097 ("eudev" ,eudev)
4098 ("libical" ,libical)
4099 ("readline" ,readline)))
4100 (home-page "http://www.bluez.org/")
4101 (synopsis "Linux Bluetooth protocol stack")
4102 (description
4103 "BlueZ provides support for the core Bluetooth layers and protocols. It
4104 is flexible, efficient and uses a modular implementation.")
4105 (license license:gpl2+)))
4106
4107 (define bluez/fixed
4108 (package
4109 (inherit bluez)
4110 (source (origin
4111 (inherit (package-source bluez))
4112 (patches (append (origin-patches (package-source bluez))
4113 (search-patches "bluez-CVE-2020-0556.patch")))))))
4114
4115 (define-public fuse-exfat
4116 (package
4117 (name "fuse-exfat")
4118 (version "1.3.0")
4119 (source (origin
4120 (method url-fetch)
4121 (uri (string-append
4122 "https://github.com/relan/exfat/releases/download/v"
4123 version "/" name "-" version ".tar.gz"))
4124 (sha256
4125 (base32
4126 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4127 (build-system gnu-build-system)
4128 (native-inputs
4129 `(("pkg-config" ,pkg-config)))
4130 (inputs
4131 `(("fuse" ,fuse)))
4132 (home-page "https://github.com/relan/exfat")
4133 (synopsis "Mount exFAT file systems")
4134 (description
4135 "This package provides a FUSE-based file system that provides read and
4136 write access to exFAT devices.")
4137 (license license:gpl2+)))
4138
4139 (define-public fuseiso
4140 (package
4141 (name "fuseiso")
4142 (version "20070708")
4143 (source (origin
4144 (method url-fetch)
4145 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4146 version "/fuseiso-" version ".tar.bz2"))
4147 (sha256
4148 (base32
4149 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4150 (build-system gnu-build-system)
4151 (native-inputs
4152 `(("pkg-config" ,pkg-config)))
4153 (inputs
4154 `(("fuse" ,fuse)
4155 ("glib" ,glib)
4156 ("zlib" ,zlib)))
4157 (home-page "https://sourceforge.net/projects/fuseiso/")
4158 (synopsis "Mount ISO file system images")
4159 (description
4160 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4161 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4162 Ridge, Joliet, and zisofs.")
4163 (license license:gpl2)))
4164
4165 (define-public gpm
4166 (package
4167 (name "gpm")
4168 (version "1.20.7")
4169 (source (origin
4170 (method url-fetch)
4171 (uri (string-append
4172 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
4173 version ".tar.bz2"))
4174 (patches (search-patches "gpm-glibc-2.26.patch"))
4175 (sha256
4176 (base32
4177 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4178 (build-system gnu-build-system)
4179 (arguments
4180 '(#:phases (modify-phases %standard-phases
4181 (replace 'bootstrap
4182 (lambda _
4183 ;; The tarball was not generated with 'make dist' so we
4184 ;; need to bootstrap things ourselves.
4185 (substitute* "autogen.sh"
4186 (("/bin/sh") (which "sh")))
4187 (invoke "./autogen.sh")
4188 (patch-makefile-SHELL "Makefile.include.in")
4189 #t)))
4190
4191 ;; Make sure programs find libgpm.so.
4192 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4193 (assoc-ref %outputs "out")
4194 "/lib"))))
4195 (native-inputs
4196 `(("texinfo" ,texinfo)
4197 ("bison" ,bison)
4198 ("flex" ,flex)
4199 ("autoconf" ,autoconf)
4200 ("automake" ,automake)
4201 ("libtool" ,libtool)))
4202 (home-page "http://www.nico.schottelius.org/software/gpm/")
4203 (synopsis "Mouse support for the Linux console")
4204 (description
4205 "The GPM (general-purpose mouse) daemon is a mouse server for
4206 applications running on the Linux console. It allows users to select items
4207 and copy/paste text in the console and in xterm.")
4208 (license license:gpl2+)))
4209
4210 (define-public btrfs-progs
4211 (package
4212 (name "btrfs-progs")
4213 (version "5.4.1")
4214 (source (origin
4215 (method url-fetch)
4216 (uri (string-append "mirror://kernel.org/linux/kernel/"
4217 "people/kdave/btrfs-progs/"
4218 "btrfs-progs-v" version ".tar.xz"))
4219 (sha256
4220 (base32
4221 "0scxg9p6z0wss92gmv5a8yxdmr8x449kb5v3bfnvs26n92r7zq7k"))))
4222 (build-system gnu-build-system)
4223 (outputs '("out"
4224 "static")) ; static versions of the binaries in "out"
4225 (arguments
4226 '(#:phases (modify-phases %standard-phases
4227 (add-after 'unpack 'patch-makefile
4228 (lambda* (#:key outputs #:allow-other-keys)
4229 (substitute* "Makefile"
4230 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4231 (string-append (assoc-ref outputs "out")
4232 "/lib/udev/rules.d")))
4233 #t))
4234 (add-after 'build 'build-static
4235 (lambda _ (invoke "make" "static")))
4236 (add-after 'install 'install-bash-completion
4237 (lambda* (#:key outputs #:allow-other-keys)
4238 (let* ((out (assoc-ref outputs "out"))
4239 (bashcomp (string-append out "/etc/bash_completion.d")))
4240 (mkdir-p bashcomp)
4241 (copy-file "btrfs-completion"
4242 (string-append bashcomp "/btrfs"))
4243 #t)))
4244 (add-after 'install 'install-static
4245 (let ((staticbin (string-append (assoc-ref %outputs "static")
4246 "/bin")))
4247 (lambda _
4248 (invoke "make"
4249 (string-append "bindir=" staticbin)
4250 "install-static")))))
4251 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4252 #:test-target "test"
4253 #:parallel-tests? #f)) ; tests fail when run in parallel
4254 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4255 ("libblkid" ,util-linux)
4256 ("libblkid:static" ,util-linux "static")
4257 ("libuuid" ,util-linux)
4258 ("libuuid:static" ,util-linux "static")
4259 ("lzo" ,lzo)
4260 ("zlib" ,zlib)
4261 ("zlib:static" ,zlib "static")
4262 ("zstd" ,zstd "lib")
4263 ("zstd:static" ,zstd "static")))
4264 (native-inputs `(("pkg-config" ,pkg-config)
4265 ("asciidoc" ,asciidoc)
4266 ("python" ,python)
4267 ("xmlto" ,xmlto)
4268 ;; For building documentation.
4269 ("libxml2" ,libxml2)
4270 ("docbook-xsl" ,docbook-xsl)
4271 ;; For tests.
4272 ("acl" ,acl)
4273 ("which" ,which)
4274 ("dmsetup" ,lvm2)
4275 ("udevadm" ,eudev)
4276 ;; The tests need 'grep' with perl regexp support.
4277 ("grep" ,grep)))
4278 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4279 (synopsis "Create and manage btrfs copy-on-write file systems")
4280 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4281 aimed at implementing advanced features while focusing on fault tolerance,
4282 repair and easy administration.")
4283 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4284 ;; GPL2: Everything else.
4285 (license (list license:gpl2 license:gpl2+))))
4286
4287 (define-public btrfs-progs/static
4288 (package
4289 (name "btrfs-progs-static")
4290 (version (package-version btrfs-progs))
4291 (source #f)
4292 (build-system trivial-build-system)
4293 (inputs
4294 `(("btrfs-progs:static" ,btrfs-progs "static")))
4295 (arguments
4296 `(#:modules ((guix build utils))
4297 #:builder
4298 (begin
4299 (use-modules (guix build utils)
4300 (ice-9 ftw)
4301 (srfi srfi-26))
4302
4303 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4304 (out (assoc-ref %outputs "out"))
4305 (source (string-append btrfs "/bin/btrfs.static"))
4306 (target (string-append out "/bin/btrfs")))
4307 (mkdir-p (dirname target))
4308 (copy-file source target)
4309 (remove-store-references target)
4310 (chmod target #o555)
4311 #t))))
4312 (home-page (package-home-page btrfs-progs))
4313 (synopsis "Statically-linked btrfs command from btrfs-progs")
4314 (description "This package provides the statically-linked @command{btrfs}
4315 from the btrfs-progs package. It is meant to be used in initrds.")
4316 (license (package-license btrfs-progs))))
4317
4318 (define-public compsize
4319 (package
4320 (name "compsize")
4321 (version "1.3")
4322 (home-page "https://github.com/kilobyte/compsize")
4323 (source (origin
4324 (method git-fetch)
4325 (uri (git-reference
4326 (url home-page)
4327 (commit (string-append "v" version))))
4328 (sha256
4329 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4330 (file-name (git-file-name name version))))
4331 (build-system gnu-build-system)
4332 (inputs
4333 `(("btrfs-progs" ,btrfs-progs)))
4334 (arguments
4335 `(#:tests? #f ; No tests.
4336 #:make-flags (list "CC=gcc")
4337 #:phases
4338 (modify-phases %standard-phases
4339 (delete 'configure)
4340 (replace 'install
4341 (lambda* (#:key outputs #:allow-other-keys)
4342 (let ((out (assoc-ref outputs "out")))
4343 (install-file "compsize" (string-append out "/bin"))
4344 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4345 (synopsis "Find compression type/ratio on Btrfs files")
4346 (description "@command{compsize} takes a list of files (given as
4347 arguments) on a Btrfs file system and measures used compression types and
4348 effective compression ratio, producing a report.
4349
4350 A directory has no extents but has a (recursive) list of files. A non-regular
4351 file is silently ignored.
4352
4353 As it makes no sense to talk about compression ratio of a partial extent,
4354 every referenced extent is counted whole, exactly once -- no matter if you use
4355 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4356 uncompressed size will not match the number given by @command{tar} or
4357 @command{du}. On the other hand, the space used should be accurate (although
4358 obviously it can be shared with files outside our set).")
4359 (license license:gpl2+)))
4360
4361 (define-public f2fs-tools-1.7
4362 (package
4363 (name "f2fs-tools")
4364 (version "1.7.0")
4365 (source (origin
4366 (method url-fetch)
4367 (uri (string-append
4368 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4369 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4370 (sha256
4371 (base32
4372 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4373
4374 (build-system gnu-build-system)
4375 (arguments
4376 `(#:phases
4377 (modify-phases %standard-phases
4378 (add-after 'install 'install-headers
4379 (lambda* (#:key outputs #:allow-other-keys)
4380 (let* ((out (assoc-ref outputs "out"))
4381 (out-include (string-append out "/include")))
4382 (install-file "include/f2fs_fs.h" out-include)
4383 (install-file "mkfs/f2fs_format_utils.h" out-include)
4384 #t))))))
4385 (native-inputs
4386 `(("autoconf" ,autoconf)
4387 ("automake" ,automake)
4388 ("libtool" ,libtool)
4389 ("pkg-config" ,pkg-config)))
4390 (inputs
4391 `(("libuuid" ,util-linux)
4392 ("libselinux" ,libselinux)))
4393 (home-page "https://f2fs.wiki.kernel.org/")
4394 (synopsis "Userland tools for f2fs")
4395 (description
4396 "F2FS, the Flash-Friendly File System, is a modern file system
4397 designed to be fast and durable on flash devices such as solid-state
4398 disks and SD cards. This package provides the userland utilities.")
4399 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4400 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4401 (license (list license:gpl2 license:lgpl2.1))))
4402
4403 (define-public f2fs-tools
4404 (package
4405 (inherit f2fs-tools-1.7)
4406 (name "f2fs-tools")
4407 (version "1.13.0")
4408 (source (origin
4409 (method url-fetch)
4410 (uri (string-append
4411 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4412 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4413 (sha256
4414 (base32
4415 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4416 (inputs
4417 `(("libuuid" ,util-linux)))))
4418
4419 (define-public freefall
4420 (package
4421 (name "freefall")
4422 (version (package-version linux-libre))
4423 (source (package-source linux-libre))
4424 (build-system gnu-build-system)
4425 (arguments
4426 '(#:phases (modify-phases %standard-phases
4427 (add-after 'unpack 'enter-subdirectory
4428 (lambda _
4429 (chdir "tools/laptop/freefall")
4430 #t))
4431 (delete 'configure)
4432 (add-before 'build 'increase-timeout
4433 (lambda _
4434 ;; The default of 2 seconds is too low: it assumes an
4435 ;; open lid and AC power without actually checking.
4436 (substitute* "freefall.c"
4437 (("alarm\\(2\\)") "alarm(5)"))
4438 #t)))
4439 #:make-flags (list (string-append "PREFIX="
4440 (assoc-ref %outputs "out"))
4441 "CC=gcc")
4442 #:tests? #f)) ;no tests
4443 (home-page (package-home-page linux-libre))
4444 (synopsis "Free-fall protection for spinning laptop hard drives")
4445 (description
4446 "Prevents shock damage to the internal spinning hard drive(s) of some
4447 HP and Dell laptops. When sudden movement is detected, all input/output
4448 operations on the drive are suspended and its heads are parked on the ramp,
4449 where they are less likely to cause damage to the spinning disc. Requires a
4450 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4451 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4452 (license license:gpl2)))
4453
4454 (define-public thinkfan
4455 (package
4456 (name "thinkfan")
4457 (version "1.0.2")
4458 (source
4459 (origin
4460 (method git-fetch)
4461 (uri (git-reference
4462 (url "https://github.com/vmatare/thinkfan.git")
4463 (commit version)))
4464 (file-name (git-file-name name version))
4465 (sha256
4466 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
4467 (build-system cmake-build-system)
4468 (arguments
4469 `(#:modules ((guix build cmake-build-system)
4470 (guix build utils)
4471 (srfi srfi-26))
4472 #:tests? #f ; no test target
4473 #:configure-flags
4474 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4475 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4476 ;; inefficient’.
4477 `("-DUSE_ATASMART:BOOL=ON")
4478 #:phases
4479 (modify-phases %standard-phases
4480 (add-after 'unpack 'create-init-scripts
4481 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4482 ;; systemd to patch and install their service files. Fake their
4483 ;; presence rather than duplicating the build system below. Leave
4484 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4485 ;; The sysvinit needs manual patching, but since upstream doesn't
4486 ;; even provide the option to install it: don't.
4487 (lambda* (#:key outputs #:allow-other-keys)
4488 (let* ((out (assoc-ref outputs "out"))
4489 (share (string-append out "/share/" ,name)))
4490 (substitute* "CMakeLists.txt"
4491 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4492 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4493 ;; That was easy! Now we just need to fix the destinations.
4494 (("/etc" directory)
4495 (string-append out directory)))
4496 #t))))))
4497 (native-inputs
4498 `(("pkg-config" ,pkg-config)))
4499 (inputs
4500 `(("libatasmart" ,libatasmart)
4501 ("yaml-cpp" ,yaml-cpp)))
4502 (home-page "http://thinkfan.sourceforge.net/")
4503 (synopsis "Simple fan control program")
4504 (description
4505 "Thinkfan is a simple fan control program. It reads temperatures,
4506 checks them against configured limits and switches to appropriate (also
4507 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4508 other @code{hwmon} driver that enables temperature reading and fan control
4509 from userspace.")
4510 (license license:gpl3+)))
4511
4512 (define-public tpacpi-bat
4513 (package
4514 (name "tpacpi-bat")
4515 (version "3.1")
4516 (source
4517 (origin
4518 (method git-fetch)
4519 (uri (git-reference
4520 (url "https://github.com/teleshoes/tpacpi-bat.git")
4521 (commit (string-append "v" version))))
4522 (file-name (git-file-name name version))
4523 (sha256
4524 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4525 (build-system gnu-build-system)
4526 (arguments
4527 `(#:tests? #f ; no test target
4528 #:phases
4529 (modify-phases %standard-phases
4530 (add-after 'unpack 'refer-to-inputs
4531 (lambda _
4532 (substitute* "tpacpi-bat"
4533 (("cat ")
4534 (format "~a " (which "cat")))
4535 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4536 ;; loaded. That's the administrator's prerogative; disable it.
4537 (("system \"(modprobe .*)\"" _ match)
4538 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4539 #t))
4540 (delete 'configure) ; nothing to configure
4541 (delete 'build) ; nothing to build
4542 (replace 'install
4543 (lambda* (#:key outputs #:allow-other-keys)
4544 (let* ((out (assoc-ref outputs "out"))
4545 (bin (string-append out "/bin"))
4546 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4547 (install-file "tpacpi-bat" bin)
4548
4549 ;; There's no man page. Install other forms of documentation.
4550 (for-each (lambda (file)
4551 (let ((target (string-append doc "/" file)))
4552 (mkdir-p (dirname target))
4553 (copy-recursively file target)))
4554 (list "battery_asl" "examples" "README.md"))
4555 #t))))))
4556 (inputs
4557 `(("perl" ,perl)))
4558 (home-page "https://github.com/teleshoes/tpacpi-bat")
4559 (synopsis "ThinkPad battery charge controller")
4560 (description
4561 "Tpacpi-bat is a command-line interface to control battery charging on
4562 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4563 ThinkPad models released after 2011}, starting with the xx20 series. It can
4564 query and set the thresholds at which one or both batteries will start and stop
4565 charging, inhibit charging batteries for a set period of time, or force them to
4566 discharge when they otherwise would not.
4567
4568 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4569 kernel module provided by the @code{acpi-call-linux-module} package, which must
4570 be installed and loaded separately. Only the original vendor firmware is
4571 supported.")
4572 (license license:gpl3+)))
4573
4574 (define-public ntfs-3g
4575 (package
4576 (name "ntfs-3g")
4577 (version "2017.3.23")
4578 (source (origin
4579 (method url-fetch)
4580 (uri (string-append "https://tuxera.com/opensource/"
4581 "ntfs-3g_ntfsprogs-" version ".tgz"))
4582 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
4583 (sha256
4584 (base32
4585 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
4586 (modules '((guix build utils)))
4587 (snippet '(begin
4588 ;; Install under $prefix.
4589 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4590 (("/sbin")
4591 "@sbindir@"))
4592 #t))))
4593 (build-system gnu-build-system)
4594 (inputs `(("util-linux" ,util-linux)
4595 ("fuse" ,fuse))) ;libuuid
4596 (native-inputs `(("pkg-config" ,pkg-config)))
4597 (arguments
4598 '(#:configure-flags (list "--exec-prefix=${prefix}"
4599 "--with-fuse=external" ;use our own FUSE
4600 "--enable-mount-helper"
4601 "--enable-posix-acls"
4602 "--enable-xattr-mappings")
4603 #:phases
4604 (modify-phases %standard-phases
4605 ;; If users install ntfs-3g, they probably want to make it the
4606 ;; default driver as well, so we opt for sensible defaults and link
4607 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
4608 ;; mount NTFS file systems.)
4609 (add-after 'install 'install-link
4610 (lambda* (#:key outputs #:allow-other-keys)
4611 (let* ((out (assoc-ref outputs "out"))
4612 (sbin (string-append out "/sbin")))
4613 (symlink "mount.ntfs-3g"
4614 (string-append sbin "/mount.ntfs")))
4615 #t)))))
4616 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
4617 (synopsis "Read-write access to NTFS file systems")
4618 (description
4619 "NTFS-3G provides read-write access to NTFS file systems, which are
4620 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4621 The package provides additional NTFS tools.")
4622 (license license:gpl2+)))
4623
4624 (define-public rdma-core
4625 (package
4626 (name "rdma-core")
4627 (version "26.0")
4628 (source (origin
4629 (method url-fetch)
4630 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4631 "/releases/download/v" version "/rdma-core-"
4632 version ".tar.gz"))
4633 (sha256
4634 (base32
4635 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
4636 (build-system cmake-build-system)
4637 (arguments
4638 `(#:tests? #f ; no tests
4639 ;; Upstream uses the "ninja" build system and encourage distros
4640 ;; to do the same for consistency. They also recommend using the
4641 ;; "Release" build type.
4642 #:build-type "Release"
4643 #:configure-flags (list "-GNinja"
4644
4645 (string-append "-DRST2MAN_EXECUTABLE="
4646 (assoc-ref %build-inputs
4647 "python-docutils")
4648 "/bin/rst2man.py")
4649
4650 ;; On some configurations, the
4651 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
4652 ;; used by default, would return ENODEV. To
4653 ;; avoid that, use 'write' instead of ioctls,
4654 ;; as suggested in 'CMakeList.txt'.
4655 "-DIOCTL_MODE=write")
4656 #:phases
4657 (modify-phases %standard-phases
4658 (replace 'build
4659 (lambda _
4660 (invoke "ninja"
4661 "-j" (number->string (parallel-job-count)))))
4662 (replace 'install
4663 (lambda _
4664 (invoke "ninja" "install"))))))
4665 (native-inputs
4666 `(("ninja" ,ninja)
4667 ("pkg-config" ,pkg-config)
4668 ("python" ,python-wrapper)
4669 ("python-docutils" ,python-docutils))) ;for 'rst2man'
4670 (inputs
4671 `(("libnl" ,libnl)
4672 ("udev" ,eudev)))
4673 (home-page "https://github.com/linux-rdma/rdma-core")
4674 (synopsis "Utilities and libraries for working with RDMA devices")
4675 (description
4676 "This package provides userspace components for the InfiniBand
4677 subsystem of the Linux kernel. Specifically it contains userspace
4678 libraries for the following device nodes:
4679
4680 @enumerate
4681 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4682 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4683 @item @file{/dev/infiniband/umadX} (@code{libibumad})
4684 @end enumerate
4685
4686 The following service daemons are also provided:
4687 @enumerate
4688 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4689 @item @code{iwpmd} (for iWARP kernel providers)
4690 @item @code{ibacm} (for InfiniBand communication management assistant)
4691 @end enumerate")
4692 ;; All library code is dual licensed under GPL2 and a custom MIT
4693 ;; variant. The package also includes some components covered by
4694 ;; other licenses. Consult COPYING.md for full details.
4695 (license
4696 (list license:gpl2
4697 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4698 license:bsd-2 ; Files referring to COPYING.BSD_FB
4699 license:cc0 ; most files in ccan/
4700 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4701
4702 (define-public perftest
4703 (package
4704 (name "perftest")
4705 (version "4.4-0.4")
4706 (source
4707 (origin
4708 (method url-fetch)
4709 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4710 version "/perftest-" version ".g0927198.tar.gz"))
4711 (sha256
4712 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
4713 (build-system gnu-build-system)
4714 (arguments
4715 `(#:phases
4716 (modify-phases %standard-phases
4717 (add-after 'unpack 'patch-header-paths
4718 (lambda _
4719 (substitute* '("src/raw_ethernet_fs_rate.c"
4720 "src/raw_ethernet_resources.c"
4721 "src/raw_ethernet_resources.h"
4722 "src/raw_ethernet_send_burst_lat.c"
4723 "src/raw_ethernet_send_bw.c"
4724 "src/raw_ethernet_send_lat.c")
4725 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4726 #t)))))
4727 (inputs `(("rdma-core" ,rdma-core)))
4728 (home-page "https://github.com/linux-rdma/perftest/")
4729 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4730 (description "This is a collection of tests written over uverbs intended for
4731 use as a performance micro-benchmark. The tests may be used for hardware or
4732 software tuning as well as for functional testing.
4733
4734 The collection contains a set of bandwidth and latency benchmark such as:
4735 @enumerate
4736 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
4737 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4738 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4739 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4740 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4741 @end enumerate")
4742 (license license:gpl2)))
4743
4744 (define-public rng-tools
4745 (package
4746 (name "rng-tools")
4747 (home-page "https://github.com/nhorman/rng-tools")
4748 (version "6.9")
4749 (source (origin
4750 (method git-fetch)
4751 (uri (git-reference (url home-page)
4752 (commit (string-append "v" version))))
4753 (file-name (git-file-name name version))
4754 (sha256
4755 (base32
4756 "065jf26s8zkicb95zc9ilksjdq9gqrh5vcx3mhi6mypbnamn6w98"))))
4757 (build-system gnu-build-system)
4758 (arguments
4759 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
4760 #:configure-flags '("--without-nistbeacon"
4761 "--without-pkcs11")))
4762 (native-inputs
4763 `(("autoconf" ,autoconf)
4764 ("automake" ,automake)
4765 ("pkg-config" ,pkg-config)))
4766 (inputs
4767 `(("libsysfs" ,sysfsutils)))
4768 (synopsis "Random number generator daemon")
4769 (description
4770 "Monitor a hardware random number generator, and supply entropy
4771 from that to the system kernel's @file{/dev/random} machinery.")
4772 ;; The source package is offered under the GPL2+, but the files
4773 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4774 (license (list license:gpl2 license:gpl2+))))
4775
4776 (define-public cpupower
4777 (package
4778 (name "cpupower")
4779 (version (package-version linux-libre))
4780 (source (package-source linux-libre))
4781 (build-system gnu-build-system)
4782 (arguments
4783 '(#:phases (modify-phases %standard-phases
4784 (add-after 'unpack 'enter-subdirectory
4785 (lambda _
4786 (chdir "tools/power/cpupower")
4787 #t))
4788 (delete 'configure)
4789 (add-before 'build 'fix-makefiles
4790 (lambda _
4791 (substitute* "Makefile"
4792 (("/usr/") "/")
4793 (("/bin/(install|pwd)" _ command) command))
4794 (substitute* "bench/Makefile"
4795 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4796 #t)))
4797 #:make-flags (let ((out (assoc-ref %outputs "out")))
4798 (list (string-append "DESTDIR=" out)
4799 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4800 "libdir=/lib"
4801 "docdir=/share/doc/cpupower"
4802 "confdir=$(docdir)/examples"
4803 ;; The Makefile recommends the following changes
4804 "DEBUG=false"
4805 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4806 #:tests? #f)) ;no tests
4807 (native-inputs `(("gettext" ,gettext-minimal)))
4808 (inputs `(("pciutils" ,pciutils)))
4809 (home-page (package-home-page linux-libre))
4810 (synopsis "CPU frequency and voltage scaling tools for Linux")
4811 (description
4812 "cpupower is a set of user-space tools that use the cpufreq feature of the
4813 Linux kernel to retrieve and control processor features related to power saving,
4814 such as frequency and voltage scaling.")
4815 (license license:gpl2)))
4816
4817 (define-public x86-energy-perf-policy
4818 (package
4819 (name "x86-energy-perf-policy")
4820 (version (package-version linux-libre))
4821 (source (package-source linux-libre))
4822 (build-system gnu-build-system)
4823 (arguments
4824 '(#:tests? #f
4825 #:phases
4826 (modify-phases %standard-phases
4827 (add-after 'unpack 'enter-subdirectory
4828 (lambda _
4829 (chdir "tools/power/x86/x86_energy_perf_policy")
4830 #t))
4831 (delete 'configure)
4832 (add-before 'build 'fix-makefile
4833 (lambda _
4834 (substitute* "Makefile" (("/usr") ""))
4835 #t)))
4836 #:make-flags
4837 (let ((out (assoc-ref %outputs "out")))
4838 (list (string-append "DESTDIR=" out)
4839 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4840 (supported-systems '("i686-linux" "x86_64-linux"))
4841 (home-page (package-home-page linux-libre))
4842 (synopsis "Display and update Intel-CPU energy-performance policy")
4843 (description
4844 "@command{x86_energy_perf_policy} displays and updates energy-performance
4845 policy settings specific to Intel Architecture Processors. Settings are
4846 accessed via Model Specific Register (MSR) updates, no matter if the Linux
4847 cpufreq sub-system is enabled or not.")
4848 (license license:gpl2)))
4849
4850 (define-public haveged
4851 (package
4852 (name "haveged")
4853 (version "1.9.8")
4854 (source
4855 (origin
4856 (method git-fetch)
4857 (uri (git-reference
4858 (url "https://github.com/jirka-h/haveged.git")
4859 (commit (string-append "v" version))))
4860 (file-name (git-file-name name version))
4861 (sha256
4862 (base32 "1znr58fb3faq4nmrvc3c5whkc1f3chivm4vhicdwr9pdsyqqsd51"))))
4863 (build-system gnu-build-system)
4864 (home-page "https://www.issihosts.com/haveged")
4865 (synopsis "Entropy source for the Linux random number generator")
4866 (description
4867 "haveged generates an unpredictable stream of random numbers for use by
4868 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4869 standard mechanisms for filling the entropy pool may not be sufficient for
4870 systems with high needs or limited user interaction, such as headless servers.
4871
4872 @command{haveged} runs as a privileged daemon, harvesting randomness from the
4873 indirect effects of hardware events on hidden processor state using the
4874 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
4875 It tunes itself to its environment and provides the same built-in test suite
4876 for the output stream as used on certified hardware security devices.
4877
4878 The quality of the randomness produced by this algorithm has not been proven.
4879 It is recommended to run it together with another entropy source like rngd, and
4880 not as a replacement for it.")
4881 (license (list (license:non-copyleft "file://nist/mconf.h")
4882 (license:non-copyleft "file://nist/packtest.c")
4883 license:public-domain ; nist/dfft.c
4884 license:gpl3+)))) ; everything else
4885
4886 (define-public ecryptfs-utils
4887 (package
4888 (name "ecryptfs-utils")
4889 (version "111")
4890 (source
4891 (origin
4892 (method url-fetch)
4893 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4894 version "/+download/ecryptfs-utils_"
4895 version ".orig.tar.gz"))
4896 (sha256
4897 (base32
4898 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4899 (build-system gnu-build-system)
4900 (arguments
4901 `(#:configure-flags (list "--disable-pywrap")
4902 #:phases
4903 (modify-phases %standard-phases
4904 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4905 (lambda* (#:key inputs outputs #:allow-other-keys)
4906 (let ((out (assoc-ref outputs "out"))
4907 (utils-linux (assoc-ref inputs "utils-linux"))
4908 (cryptsetup (assoc-ref inputs "cryptsetup"))
4909 (linux-pam (assoc-ref inputs "linux-pam"))
4910 (lvm2 (assoc-ref inputs "lvm2")))
4911 (substitute* '("src/utils/ecryptfs-mount-private"
4912 "src/utils/ecryptfs-umount-private"
4913 "src/utils/ecryptfs-setup-private"
4914 "src/utils/ecryptfs-setup-swap"
4915 "src/utils/mount.ecryptfs.c"
4916 "src/utils/umount.ecryptfs.c"
4917 "src/pam_ecryptfs/pam_ecryptfs.c"
4918 "src/desktop/ecryptfs-mount-private.desktop.in"
4919 "src/desktop/ecryptfs-setup-private.desktop.in")
4920 (("/bin/mount")
4921 (string-append utils-linux "/bin/mount"))
4922 (("/bin/umount")
4923 (string-append utils-linux "/bin/umount"))
4924 (("/sbin/mount.ecryptfs_private")
4925 (string-append out "/sbin/mount.ecryptfs_private"))
4926 (("/sbin/umount.ecryptfs_private")
4927 (string-append out "/sbin/umount.ecryptfs_private"))
4928 (("/usr/bin/ecryptfs-mount-private")
4929 (string-append out "/bin/ecryptfs-mount-private"))
4930 (("/usr/bin/ecryptfs-rewrite-file")
4931 (string-append out "/bin/ecryptfs-rewrite-file"))
4932 (("/usr/bin/ecryptfs-setup-private")
4933 (string-append out "/bin/ecryptfs-setup-private"))
4934 (("/sbin/cryptsetup")
4935 (string-append cryptsetup "/sbin/cryptsetup"))
4936 (("/sbin/unix_chkpwd")
4937 (string-append linux-pam "/sbin/unix_chkpwd"))
4938 (("/sbin/dmsetup")
4939 (string-append lvm2 "/sbin/dmsetup")))))))))
4940 (native-inputs
4941 `(("intltool" ,intltool)
4942 ("perl" ,perl) ; for pod2man
4943 ("pkg-config" ,pkg-config)))
4944 (inputs
4945 `(("keyutils" ,keyutils)
4946 ("linux-pam" ,linux-pam)
4947 ("utils-linux" ,util-linux)
4948 ("cryptsetup" ,cryptsetup)
4949 ("lvm2" ,lvm2)
4950 ("nss" ,nss)))
4951 (home-page "https://ecryptfs.org/")
4952 (synopsis "eCryptfs cryptographic file system utilities")
4953 (description
4954 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4955 Each file's cryptographic meta-data is stored inside the file itself, along
4956 with the encrypted contents. This allows individual encrypted files to be
4957 copied between hosts and still be decrypted with the proper key. eCryptfs is a
4958 native Linux file system, and has been part of the Linux kernel since version
4959 2.6.19. This package contains the userland utilities to manage it.")
4960 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4961 ;; grant additional permission to link with OpenSSL.
4962 (license license:gpl2+)))
4963
4964 (define-public libnfsidmap
4965 (package
4966 (name "libnfsidmap")
4967 (version "0.27")
4968 (source
4969 (origin
4970 (method url-fetch)
4971 (uri (string-append "https://fedorapeople.org/~steved/"
4972 name "/" version "/" name "-" version ".tar.bz2"))
4973 (sha256
4974 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
4975 (build-system gnu-build-system)
4976 (arguments
4977 `(#:configure-flags (list
4978 (string-append "--with-pluginpath="
4979 (assoc-ref %outputs "out")
4980 "/lib/libnfsidmap"))))
4981 (native-inputs
4982 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
4983 (home-page
4984 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4985 (synopsis "NFSv4 support library for name/ID mapping")
4986 (description "Libnfsidmap is a library holding mulitiple methods of
4987 mapping names to ids and visa versa, mainly for NFSv4. It provides an
4988 extensible array of mapping functions, currently consisting of two choices:
4989 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4990 (license (license:non-copyleft "file://COPYING"
4991 "See COPYING in the distribution."))))
4992
4993 (define-public module-init-tools
4994 (package
4995 (name "module-init-tools")
4996 (version "3.16")
4997 (source (origin
4998 (method url-fetch)
4999 (uri (string-append
5000 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5001 "module-init-tools-" version ".tar.bz2"))
5002 (sha256
5003 (base32
5004 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5005 (patches (search-patches "module-init-tools-moduledir.patch"))))
5006 (build-system gnu-build-system)
5007 (arguments
5008 ;; FIXME: The upstream tarball lacks man pages, and building them would
5009 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5010 ;; but they vanished. In the meantime, fake it.
5011 '(#:phases
5012 (modify-phases %standard-phases
5013 (add-before 'configure 'fake-docbook
5014 (lambda _
5015 (substitute* "Makefile.in"
5016 (("^DOCBOOKTOMAN.*$")
5017 "DOCBOOKTOMAN = true\n"))
5018 #t)))))
5019 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5020 (synopsis "Tools for loading and managing Linux kernel modules")
5021 (description
5022 "Tools for loading and managing Linux kernel modules, such as
5023 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5024 (license license:gpl2+)))
5025
5026 (define-public mcelog
5027 (package
5028 (name "mcelog")
5029 (version "168")
5030 (source (origin
5031 (method url-fetch)
5032 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5033 "mcelog.git/snapshot/v" version ".tar.gz"))
5034 (sha256
5035 (base32
5036 "1c4faayg1gcm3002b2fdrfnv76z92mvfzccvx8w9crjp0d17sp24"))
5037 (file-name (string-append name "-" version ".tar.gz"))
5038 (modules '((guix build utils)))
5039 (snippet
5040 `(begin
5041 ;; The snapshots lack a .git directory,
5042 ;; breaking ‘git describe’.
5043 (substitute* "Makefile"
5044 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5045 #t))))
5046 (build-system gnu-build-system)
5047 (arguments
5048 `(#:phases (modify-phases %standard-phases
5049 (delete 'configure)) ; no configure script
5050 #:make-flags (let ((out (assoc-ref %outputs "out")))
5051 (list "CC=gcc"
5052 (string-append "prefix=" out)
5053 (string-append "DOCDIR=" out "/share/doc/mcelog")
5054 "etcprefix=$(DOCDIR)/examples"))
5055 ;; The tests will only run as root on certain supported CPU models.
5056 #:tests? #f))
5057 (supported-systems (list "i686-linux" "x86_64-linux"))
5058 (home-page "https://mcelog.org/")
5059 (synopsis "Machine check monitor for x86 Linux systems")
5060 (description
5061 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
5062 and other hardware errors on x86 systems. It can also perform user-defined
5063 tasks, such as bringing bad pages off-line, when configurable error thresholds
5064 are exceeded.")
5065 (license license:gpl2)))
5066
5067 (define-public mtd-utils
5068 (package
5069 (name "mtd-utils")
5070 (version "2.1.1")
5071 (source (origin
5072 (method url-fetch)
5073 (uri (string-append
5074 "ftp://ftp.infradead.org/pub/mtd-utils/"
5075 "mtd-utils-" version ".tar.bz2"))
5076 (sha256
5077 (base32
5078 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
5079 (arguments
5080 '(#:configure-flags '("--enable-unit-tests")))
5081 (native-inputs
5082 `(("cmocka" ,cmocka)
5083 ("pkg-config" ,pkg-config)))
5084 (inputs
5085 `(("acl" ,acl) ; extended attributes (xattr)
5086 ("libuuid" ,util-linux)
5087 ("lzo" ,lzo)
5088 ("openssl" ,openssl) ; optional crypto support
5089 ("zlib" ,zlib)
5090 ("zstd" ,zstd "lib")))
5091 (build-system gnu-build-system)
5092 (synopsis "MTD Flash Storage Utilities")
5093 (description "This package provides utilities for testing, partitioning, etc
5094 of flash storage.")
5095 (home-page "http://www.linux-mtd.infradead.org/")
5096 (license
5097 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5098 license:mpl1.1 ; All ftl* files
5099 license:expat)))) ; libiniparser
5100
5101 (define-public libseccomp
5102 (package
5103 (name "libseccomp")
5104 (version "2.4.3")
5105 (source (origin
5106 (method url-fetch)
5107 (uri (string-append "https://github.com/seccomp/libseccomp/"
5108 "releases/download/v" version
5109 "/libseccomp-" version ".tar.gz"))
5110 (sha256
5111 (base32
5112 "07crwxqzvl5k2b90a47ii9wgvi09s9hsy5b5jddw9ylp351d25fg"))))
5113 (build-system gnu-build-system)
5114 (native-inputs
5115 `(("which" ,which)))
5116 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5117 (description "The libseccomp library provides an easy to use, platform
5118 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5119 libseccomp API is designed to abstract away the underlying BPF based syscall
5120 filter language and present a more conventional function-call based filtering
5121 interface that should be familiar to, and easily adopted by, application
5122 developers.")
5123 (home-page "https://github.com/seccomp/libseccomp")
5124 (license license:lgpl2.1)))
5125
5126 (define-public radeontop
5127 (package
5128 (name "radeontop")
5129 (version "1.2")
5130 (source
5131 (origin
5132 (method git-fetch)
5133 (uri (git-reference
5134 (url "https://github.com/clbr/radeontop.git")
5135 (commit (string-append "v" version))))
5136 (file-name (git-file-name name version))
5137 (sha256
5138 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5139 (build-system gnu-build-system)
5140 (arguments
5141 `(#:phases (modify-phases %standard-phases
5142 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5143 ;; dependency, and doesn't even work on release(!) tarballs.
5144 (add-after 'unpack 'report-correct-version
5145 (lambda _
5146 (substitute* "getver.sh"
5147 (("ver=unknown")
5148 (string-append "ver=" ,version)))
5149 #t))
5150 (delete 'configure)) ; no configure script
5151 #:make-flags (list "CC=gcc"
5152 (string-append "PREFIX=" %output))
5153 #:tests? #f)) ; no tests
5154 (native-inputs
5155 `(("gettext" ,gettext-minimal)
5156 ("pkg-config" ,pkg-config)))
5157 (inputs
5158 `(("libdrm" ,libdrm)
5159 ("libpciaccess" ,libpciaccess)
5160 ("libxcb" ,libxcb)
5161 ("ncurses" ,ncurses)))
5162 (home-page "https://github.com/clbr/radeontop/")
5163 (synopsis "Usage monitor for AMD Radeon graphics")
5164 (description "RadeonTop monitors resource consumption on supported AMD
5165 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5166 a terminal or saved to a file for further processing. It measures both the
5167 activity of the GPU as a whole, which is also accurate during OpenCL
5168 computations, as well as separate component statistics that are only meaningful
5169 under OpenGL graphics workloads.")
5170 (license license:gpl3)))
5171
5172 (define-public efivar
5173 (package
5174 (name "efivar")
5175 (version "37")
5176 (source (origin
5177 (method url-fetch)
5178 (uri (string-append "https://github.com/rhboot/" name
5179 "/releases/download/" version "/" name
5180 "-" version ".tar.bz2"))
5181 (sha256
5182 (base32
5183 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5184 (build-system gnu-build-system)
5185 (arguments
5186 `(;; Tests require a UEFI system and is not detected in the chroot.
5187 #:tests? #f
5188 #:make-flags (list (string-append "prefix=" %output)
5189 (string-append "libdir=" %output "/lib")
5190 "CC_FOR_BUILD=gcc"
5191 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5192 #:phases
5193 (modify-phases %standard-phases
5194 (delete 'configure)
5195 (add-before 'build 'kernel-headers-are-system-headers
5196 (lambda* (#:key inputs #:allow-other-keys)
5197 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
5198 ;; Make sure the kernel headers are treated as system headers
5199 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
5200 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
5201 #t))))))
5202 (native-inputs
5203 `(("pkg-config" ,pkg-config)))
5204 (inputs
5205 `(("popt" ,popt)))
5206 (home-page "https://github.com/rhboot/efivar")
5207 (synopsis "Tool and library to manipulate EFI variables")
5208 (description "This package provides a library and a command line
5209 interface to the variable facility of UEFI boot firmware.")
5210 (license license:lgpl2.1+)))
5211
5212 (define-public efibootmgr
5213 (package
5214 (name "efibootmgr")
5215 (version "16")
5216 (source (origin
5217 (method url-fetch)
5218 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5219 "/releases/download/" version "/efibootmgr"
5220 "-" version ".tar.bz2"))
5221 (sha256
5222 (base32
5223 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5224 (build-system gnu-build-system)
5225 (arguments
5226 `(#:tests? #f ;no tests
5227 #:make-flags (list (string-append "prefix=" %output)
5228 (string-append "libdir=" %output "/lib")
5229 ;; EFIDIR denotes a subdirectory relative to the
5230 ;; EFI System Partition where the loader will be
5231 ;; installed (known as OS_VENDOR in the code).
5232 ;; GRUB overrides this, as such it's only used if
5233 ;; nothing else is specified on the command line.
5234 "EFIDIR=gnu"
5235 ;; Treat kernel headers as system headers to prevent
5236 ;; warnings about conflicting types.
5237 (string-append "C_INCLUDE_PATH="
5238 (assoc-ref %build-inputs "kernel-headers")
5239 "/include"))
5240 #:phases (modify-phases %standard-phases (delete 'configure))))
5241 (native-inputs
5242 `(("pkg-config" ,pkg-config)))
5243 (inputs
5244 `(("efivar" ,efivar)
5245 ("popt" ,popt)))
5246 (home-page "https://github.com/rhinstaller/efibootmgr")
5247 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5248 (description
5249 "@code{efibootmgr} is a user-space application to modify the Intel
5250 Extensible Firmware Interface (EFI) Boot Manager. This application can
5251 create and destroy boot entries, change the boot order, change the next
5252 running boot option, and more.")
5253 (license license:gpl2+)))
5254
5255 (define-public sysstat
5256 (package
5257 (name "sysstat")
5258 (version "12.3.1")
5259 (source (origin
5260 (method url-fetch)
5261 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5262 "sysstat-" version ".tar.xz"))
5263 (sha256
5264 (base32
5265 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
5266 (build-system gnu-build-system)
5267 (arguments
5268 `(#:tests? #f ; No test suite.
5269 ;; Without this flag, it tries to install the man pages with group 'root'
5270 ;; and fails because /etc/passwd lacks an entry for the root user.
5271 #:configure-flags
5272 (list "--disable-file-attr"
5273 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5274 #:phases
5275 (modify-phases %standard-phases
5276 ;; The build process tries to create '/var/lib/sa', so we skip that
5277 ;; instruction.
5278 (add-after 'build 'skip-touching-var
5279 (lambda _
5280 (substitute* "Makefile"
5281 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5282 ""))
5283 #t)))))
5284 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5285 (synopsis "Performance monitoring tools for Linux")
5286 (description "The sysstat utilities are a collection of performance
5287 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5288 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5289 @code{sadf} and @code{sa}.")
5290 (license license:gpl2+)))
5291
5292 (define-public light
5293 (package
5294 (name "light")
5295 (version "1.2.1")
5296 (source
5297 (origin
5298 (method git-fetch)
5299 (uri (git-reference
5300 (url "https://github.com/haikarainen/light.git")
5301 (commit (string-append "v" version))))
5302 (sha256
5303 (base32 "0zrjipd392bzjvxx0rjrb0cgi0ix1d83fwgw1mcy8kc4d16cgyjg"))
5304 (file-name (git-file-name name version))))
5305 (build-system gnu-build-system)
5306 (arguments
5307 `(#:phases
5308 (modify-phases %standard-phases
5309 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5310 (lambda* (#:key inputs #:allow-other-keys)
5311 (substitute* "90-backlight.rules"
5312 (("/bin/chgrp") (which "chgrp"))
5313 (("/bin/chmod") (which "chmod")))
5314 #t))
5315 (add-after 'install 'install-udev-rules
5316 (lambda* (#:key outputs #:allow-other-keys)
5317 (let ((out (assoc-ref outputs "out")))
5318 (install-file
5319 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5320 #t))))))
5321 (native-inputs
5322 `(("autoconf" ,autoconf)
5323 ("automake" ,automake)))
5324 (home-page "https://haikarainen.github.io/light/")
5325 (synopsis "GNU/Linux application to control backlights")
5326 (description
5327 "Light is a program to send commands to screen backlight controllers
5328 under GNU/Linux. Features include:
5329
5330 @itemize
5331 @item It does not rely on X.
5332 @item Light can automatically figure out the best controller to use, making
5333 full use of underlying hardware.
5334 @item It is possible to set a minimum brightness value, as some controllers
5335 set the screen to be pitch black at a vaĺue of 0 (or higher).
5336 @end itemize
5337
5338 Light is the successor of lightscript.")
5339 (license license:gpl3+)))
5340
5341 (define-public brightnessctl
5342 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5343 (package
5344 (name "brightnessctl")
5345 (version (git-version "0.4" "0" commit))
5346 (source (origin
5347 (method git-fetch)
5348 (uri (git-reference
5349 (url "https://github.com/Hummer12007/brightnessctl/")
5350 (commit commit)))
5351 (file-name (git-file-name name version))
5352 (sha256
5353 (base32
5354 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5355 (build-system gnu-build-system)
5356 (arguments
5357 '(#:tests? #f ; no tests
5358 #:make-flags (list "CC=gcc"
5359 (string-append "PREFIX=" %output)
5360 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5361 #:phases
5362 (modify-phases %standard-phases
5363 (delete 'configure)
5364 (add-after 'unpack 'adjust-udev-rules
5365 (lambda _
5366 (substitute* "90-brightnessctl.rules"
5367 (("/bin/") "/run/current-system/profile/bin/"))
5368 #t)))))
5369 (home-page "https://github.com/Hummer12007/brightnessctl")
5370 (synopsis "Backlight and LED brightness control")
5371 (description
5372 "This program allows you read and control device brightness. Devices
5373 include backlight and LEDs. It can also preserve current brightness before
5374 applying the operation, such as on lid close.
5375
5376 The appropriate permissions must be set on the backlight or LED control
5377 interface in sysfs, which can be accomplished with the included udev rules.")
5378 (license license:expat))))
5379
5380 (define-public tlp
5381 (package
5382 (name "tlp")
5383 (version "1.3.1")
5384 (source
5385 (origin
5386 (method git-fetch)
5387 (uri (git-reference
5388 (url "https://github.com/linrunner/TLP.git")
5389 (commit version)))
5390 (file-name (git-file-name name version))
5391 (sha256
5392 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
5393 (native-inputs
5394 `(("shellcheck" ,shellcheck)))
5395 (inputs
5396 `(("bash" ,bash)
5397 ("dbus" ,dbus)
5398 ("ethtool" ,ethtool)
5399 ("eudev" ,eudev)
5400 ("grep" ,grep)
5401 ("hdparm" ,hdparm)
5402 ("inetutils" ,inetutils)
5403 ("iw" ,iw)
5404 ("kmod" ,kmod)
5405 ("pciutils" ,pciutils)
5406 ("perl" ,perl)
5407 ("rfkill" ,rfkill)
5408 ("sed" ,sed)
5409 ("usbutils" ,usbutils)
5410 ("util-linux" ,util-linux)
5411 ("wireless-tools" ,wireless-tools)
5412 ,@(if (let ((system (or (%current-target-system)
5413 (%current-system))))
5414 (or (string-prefix? "i686-" system)
5415 (string-prefix? "x86_64-" system)))
5416 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5417 '())))
5418 (build-system gnu-build-system)
5419 (arguments
5420 ;; XXX: The full test suite is run with "checkall" but it requires
5421 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
5422 `(#:test-target "shellcheck"
5423 #:modules ((guix build gnu-build-system)
5424 (guix build utils)
5425 (srfi srfi-1))
5426 #:phases
5427 (modify-phases %standard-phases
5428 (delete 'configure) ; no configure script
5429 (add-before 'build 'setenv
5430 (lambda* (#:key outputs #:allow-other-keys)
5431 (let ((out (assoc-ref outputs "out")))
5432 (setenv "TLP_WITH_SYSTEMD" "0")
5433 (setenv "TLP_NO_INIT" "1")
5434 (setenv "TLP_NO_PMUTILS" "1")
5435 (setenv "TLP_SBIN" (string-append out "/bin"))
5436 (setenv "TLP_BIN" (string-append out "/bin"))
5437 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5438 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5439 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5440 (setenv "TLP_CONFDEF"
5441 (string-append out "/share/tlp/defaults.conf"))
5442 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
5443 (setenv "TLP_ELOD"
5444 (string-append out "/lib/elogind/system-sleep"))
5445 (setenv "TLP_SHCPL"
5446 (string-append out "/share/bash-completion/completions"))
5447 (setenv "TLP_MAN" (string-append out "/share/man"))
5448 (setenv "TLP_META" (string-append out "/share/metainfo"))
5449 #t)))
5450 (add-before 'install 'fix-installation
5451 (lambda _
5452 ;; Stop the Makefile from trying to create system directories.
5453 (substitute* "Makefile"
5454 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
5455 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5456 #t))
5457 (replace 'install
5458 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
5459 (add-after 'install 'wrap
5460 (lambda* (#:key inputs outputs #:allow-other-keys)
5461 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5462 (bin-files (find-files bin ".*")))
5463 (define (bin-directory input-name)
5464 (let ((p (assoc-ref inputs input-name)))
5465 (and p (string-append p "/bin"))))
5466 (define (sbin-directory input-name)
5467 (string-append (assoc-ref inputs input-name) "/sbin"))
5468 (for-each (lambda (program)
5469 (wrap-program program
5470 `("PATH" ":" prefix
5471 ,(append
5472 (filter-map bin-directory
5473 '("bash"
5474 "coreutils"
5475 "dbus"
5476 "eudev"
5477 "grep"
5478 "inetutils"
5479 "kmod"
5480 "perl"
5481 "sed"
5482 "usbutils"
5483 "util-linux"
5484 "x86-energy-perf-policy"))
5485 (filter-map sbin-directory
5486 '("ethtool"
5487 "hdparm"
5488 "iw"
5489 "pciutils"
5490 "rfkill"
5491 "wireless-tools"))))))
5492 bin-files)
5493 #t))))))
5494 (home-page "https://linrunner.de/en/tlp/tlp.html")
5495 (synopsis "Power management tool for Linux")
5496 (description "TLP is a power management tool for Linux. It comes with
5497 a default configuration already optimized for battery life. Nevertheless,
5498 TLP is customizable to fulfil system requirements. TLP settings are applied
5499 every time the power supply source is changed.")
5500 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5501 ;; rest is GPLv2+.
5502 (license (list license:gpl2+ license:gpl3+))))
5503
5504 (define-public lshw
5505 (package
5506 (name "lshw")
5507 (version "B.02.18")
5508 (source (origin
5509 (method url-fetch)
5510 (uri (string-append "https://www.ezix.org/software/"
5511 "files/lshw-" version
5512 ".tar.gz"))
5513 (sha256
5514 (base32
5515 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5516 (build-system gnu-build-system)
5517 (arguments
5518 `(#:phases (modify-phases %standard-phases (delete 'configure))
5519 #:tests? #f ; no tests
5520 #:make-flags
5521 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5522 (synopsis "List hardware information")
5523 (description
5524 "@command{lshw} (Hardware Lister) is a small tool to provide
5525 detailed information on the hardware configuration of the machine.
5526 It can report exact memory configuration, firmware version, mainboard
5527 configuration, CPU version and speed, cache configuration, bus speed,
5528 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5529 machines (PowerMac G4 is known to work).")
5530 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5531 (license license:gpl2+)))
5532
5533 (define-public libmnl
5534 (package
5535 (name "libmnl")
5536 (version "1.0.4")
5537 (source
5538 (origin
5539 (method url-fetch)
5540 (uri (string-append "mirror://netfilter.org/libmnl/"
5541 "libmnl-" version ".tar.bz2"))
5542 (sha256
5543 (base32
5544 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5545 (build-system gnu-build-system)
5546 (home-page "https://www.netfilter.org/projects/libmnl/")
5547 (synopsis "Netlink utility library")
5548 (description "Libmnl is a minimalistic user-space library oriented to
5549 Netlink developers. There are a lot of common tasks in parsing, validating,
5550 constructing of both the Netlink header and TLVs that are repetitive and easy to
5551 get wrong. This library aims to provide simple helpers that allows you to
5552 re-use code and to avoid re-inventing the wheel.")
5553 (license license:lgpl2.1+)))
5554
5555 (define-public libnftnl
5556 (package
5557 (name "libnftnl")
5558 (version "1.1.5")
5559 (source
5560 (origin
5561 (method url-fetch)
5562 (uri (string-append "mirror://netfilter.org/libnftnl/"
5563 "libnftnl-" version ".tar.bz2"))
5564 (sha256
5565 (base32 "1wqlxf76bkqf3qhka9sw32qhb2ni20q1k6rn3iril2kw482lvpk6"))
5566 (patches
5567 (search-patches "libnftnl-dont-check-NFTNL_FLOWTABLE_SIZE.patch"))))
5568 (build-system gnu-build-system)
5569 (native-inputs
5570 `(("pkg-config" ,pkg-config)))
5571 (inputs
5572 `(("libmnl" ,libmnl)))
5573 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5574 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5575 (description "Libnftnl is a userspace library providing a low-level netlink
5576 programming interface to the in-kernel nf_tables subsystem. The library
5577 libnftnl has been previously known as libnftables. This library is currently
5578 used by nftables.")
5579 (license license:gpl2+)))
5580
5581 (define-public nftables
5582 (package
5583 (name "nftables")
5584 (version "0.9.3")
5585 (source
5586 (origin
5587 (method url-fetch)
5588 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
5589 version ".tar.bz2")
5590 (string-append "https://www.nftables.org/projects/nftables"
5591 "/files/nftables-" version ".tar.bz2")))
5592 (sha256
5593 (base32 "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm"))))
5594 (build-system gnu-build-system)
5595 (arguments `(#:configure-flags
5596 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5597 (inputs `(("bison" ,bison)
5598 ("flex" ,flex)
5599 ("gmp" ,gmp)
5600 ("libmnl" ,libmnl)
5601 ("libnftnl" ,libnftnl)
5602 ("readline" ,readline)))
5603 (native-inputs `(("pkg-config" ,pkg-config)))
5604 (home-page "https://www.nftables.org")
5605 (synopsis "Userspace utility for Linux packet filtering")
5606 (description "nftables is the project that aims to replace the existing
5607 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5608 filtering framework, a new userspace utility and also a compatibility layer for
5609 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5610 infrastructure such as the existing hooks, the connection tracking system, the
5611 userspace queueing component and the logging subsystem.")
5612 (license license:gpl2)))
5613
5614 (define-public proot
5615 (package
5616 (name "proot")
5617 (version "5.1.0")
5618 (source
5619 (origin
5620 (method git-fetch)
5621 (uri (git-reference
5622 (url "https://github.com/proot-me/PRoot.git")
5623 (commit (string-append "v" version))))
5624 (file-name (git-file-name name version))
5625 (sha256
5626 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5627 (patches (search-patches "proot-test-fhs.patch"))))
5628 (build-system gnu-build-system)
5629 (arguments
5630 '(#:make-flags '("-C" "src")
5631
5632 #:phases (modify-phases %standard-phases
5633 (delete 'configure)
5634 (add-before 'build 'set-shell-file-name
5635 (lambda* (#:key inputs #:allow-other-keys)
5636 (substitute* (find-files "src" "\\.[ch]$")
5637 (("\"/bin/sh\"")
5638 (string-append "\""
5639 (assoc-ref inputs "bash")
5640 "/bin/sh\"")))
5641 #t))
5642 (add-before 'check 'fix-fhs-assumptions-in-tests
5643 (lambda _
5644 (substitute* "tests/test-c6b77b77.mk"
5645 (("/bin/bash") (which "bash"))
5646 (("/usr/bin/test") (which "test")))
5647 (substitute* '("tests/test-16573e73.c")
5648 (("/bin/([a-z-]+)" _ program)
5649 (which program)))
5650
5651 (substitute* (find-files "tests" "\\.sh$")
5652 ;; Some of the tests try to "bind-mount" /bin/true.
5653 (("-b /bin/true:")
5654 (string-append "-b " (which "true") ":"))
5655 ;; Likewise for /bin.
5656 (("-b /bin:") "-b /gnu:")
5657 ;; Others try to run /bin/sh.
5658 (("/bin/sh") (which "sh"))
5659 ;; Others assume /etc/fstab exists.
5660 (("/etc/fstab") "/etc/passwd"))
5661
5662 (substitute* "tests/GNUmakefile"
5663 (("-b /bin:") "-b /gnu:"))
5664
5665 ;; XXX: This test fails in an obscure corner case, just
5666 ;; skip it.
5667 (delete-file "tests/test-kkkkkkkk.c")
5668
5669 #t))
5670 (replace 'check
5671 (lambda _
5672 (let ((n (parallel-job-count)))
5673 ;; For some reason we get lots of segfaults with
5674 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5675 (setenv "PROOT_NO_SECCOMP" "1")
5676
5677 ;; Most of the tests expect "/bin" to be in $PATH so
5678 ;; they can run things that live in $ROOTFS/bin.
5679 (setenv "PATH"
5680 (string-append (getenv "PATH") ":/bin"))
5681
5682 (invoke "make" "check" "-C" "tests"
5683 ;;"V=1"
5684 "-j" (number->string n)))))
5685 (replace 'install
5686 (lambda* (#:key outputs #:allow-other-keys)
5687 ;; The 'install' rule does nearly nothing.
5688 (let* ((out (assoc-ref outputs "out"))
5689 (man1 (string-append out "/share/man/man1")))
5690 ;; TODO: 'make install-care' (does not even
5691 ;; build currently.)
5692 (invoke "make" "-C" "src" "install"
5693 (string-append "PREFIX=" out))
5694
5695 (mkdir-p man1)
5696 (copy-file "doc/proot/man.1"
5697 (string-append man1 "/proot.1"))
5698 #t))))))
5699 (native-inputs `(("which" ,which)
5700
5701 ;; For 'mcookie', used by some of the tests.
5702 ("util-linux" ,util-linux)))
5703 (inputs `(("talloc" ,talloc)))
5704 (home-page "https://github.com/proot-me/PRoot")
5705 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5706 (description
5707 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5708 and @code{binfmt_misc}. This means that users don't need any privileges or
5709 setup to do things like using an arbitrary directory as the new root
5710 file system, making files accessible somewhere else in the file system
5711 hierarchy, or executing programs built for another CPU architecture
5712 transparently through QEMU user-mode. Also, developers can use PRoot as a
5713 generic process instrumentation engine thanks to its extension mechanism.
5714 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5715 available in the kernel Linux.")
5716 (license license:gpl2+)))
5717
5718 (define-public proot-static
5719 (package
5720 (inherit proot)
5721 (name "proot-static")
5722 (synopsis
5723 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5724 (inputs `(("talloc" ,talloc/static)))
5725 (arguments
5726 (substitute-keyword-arguments (package-arguments proot)
5727 ((#:make-flags flags)
5728 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5729 ((#:phases phases)
5730 `(modify-phases ,phases
5731 (add-after 'strip 'remove-store-references
5732 (lambda* (#:key outputs #:allow-other-keys)
5733 (let* ((out (assoc-ref outputs "out")))
5734 (with-directory-excursion out
5735 (remove-store-references "bin/proot")
5736 #t))))))
5737 ((#:allowed-references _ '("out"))
5738 '("out"))))))
5739
5740 (define-public cpuid
5741 (package
5742 (name "cpuid")
5743 (version "20200211")
5744 (source (origin
5745 (method url-fetch)
5746 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5747 version ".src.tar.gz"))
5748 (sha256
5749 (base32
5750 "06sjbqqp80l7nhsp6khglkzdp9qy4vhbvjxbfilznhsmrqiwlw55"))))
5751 (build-system gnu-build-system)
5752 (arguments
5753 '(#:make-flags '("CC=gcc")
5754 #:tests? #f ; no tests
5755 #:phases (modify-phases %standard-phases
5756 (delete 'configure) ; no configure script
5757 (add-before 'install 'fix-makefile
5758 (lambda* (#:key outputs #:allow-other-keys)
5759 (substitute* "Makefile"
5760 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5761 ;; Make the compressed manpages writable so that the
5762 ;; reset-gzip-timestamps phase does not error out.
5763 (substitute* "Makefile"
5764 (("-m 444") "-m 644"))
5765 #t)))))
5766 (inputs `(("perl" ,perl)))
5767 (supported-systems '("i686-linux" "x86_64-linux"))
5768 (home-page "http://www.etallen.com/cpuid.html")
5769 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5770 (description "cpuid dumps detailed information about the CPU(s) gathered
5771 from the CPUID instruction, and also determines the exact model of CPU(s). It
5772 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5773 NexGen, Rise, and SiS CPUs.")
5774 (license license:gpl2+)))
5775
5776 (define-public jmtpfs
5777 (package
5778 (name "jmtpfs")
5779 (version "0.5")
5780 (source
5781 (origin
5782 (method url-fetch)
5783 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5784 version ".tar.gz"))
5785 (file-name (string-append name "-" version ".tar.gz"))
5786 (sha256
5787 (base32
5788 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5789 (build-system gnu-build-system)
5790 (inputs
5791 `(("file" ,file)
5792 ("fuse" ,fuse)
5793 ("libmtp" ,libmtp)))
5794 (native-inputs
5795 `(("pkg-config" ,pkg-config)))
5796 (home-page "https://github.com/JasonFerrara/jmtpfs")
5797 (synopsis "Use a FUSE file system to access data over MTP")
5798 (description "jmtpfs uses FUSE (file system in userspace) to provide access
5799 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
5800 the MTP device as a file system.")
5801 (license license:gpl3)))
5802
5803 (define-public procenv
5804 (package
5805 (name "procenv")
5806 (version "0.51")
5807 (source
5808 (origin
5809 (method url-fetch)
5810 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5811 version ".tar.gz"))
5812 (file-name (string-append name "-" version ".tar.gz"))
5813 (sha256
5814 (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
5815 (build-system gnu-build-system)
5816 (arguments `(#:configure-flags '("--disable-silent-rules")))
5817 (native-inputs `(("pkg-config" ,pkg-config)))
5818 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5819 ("groff" ,groff) ; for tests
5820 ("libselinux" ,libselinux)))
5821 (synopsis "Utility to show process environment")
5822 (description "Procenv is a command-line tool that displays as much detail about
5823 itself and its environment as possible. It can be used as a test
5824 tool, to understand the type of environment a process runs in, and for
5825 comparing system environments.")
5826 (home-page "http://github.com/jamesodhunt/procenv/")
5827 (license license:gpl3+)))
5828
5829 (define-public libfabric
5830 (package
5831 (name "libfabric")
5832 (version "1.4.1")
5833 (source
5834 (origin
5835 (method url-fetch)
5836 (uri
5837 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5838 version "/libfabric-" version ".tar.bz2"))
5839 (sha256
5840 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5841 (build-system gnu-build-system)
5842 (inputs `(("rdma-core" ,rdma-core)
5843 ,@(match (%current-system)
5844 ((member (package-supported-systems psm))
5845 `(("psm" ,psm)))
5846 (_ `()))
5847 ("libnl" ,libnl)))
5848 (home-page "https://ofiwg.github.io/libfabric/")
5849 (synopsis "Open Fabric Interfaces")
5850 (description
5851 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5852 communication services to applications. OFI is best described as a collection
5853 of libraries and applications used to export fabric services. The key
5854 components of OFI are: application interfaces, provider libraries, kernel
5855 services, daemons, and test applications.
5856
5857 Libfabric is a core component of OFI. It is the library that defines and
5858 exports the user-space API of OFI, and is typically the only software that
5859 applications deal with directly. It works in conjunction with provider
5860 libraries, which are often integrated directly into libfabric.")
5861 (license (list license:bsd-2 license:gpl2)))) ;dual
5862
5863 (define-public psm
5864 (package
5865 (name "psm")
5866 (version "3.3.20170428")
5867 (home-page "https://github.com/intel/psm")
5868 (source
5869 (origin
5870 (method git-fetch)
5871 (uri (git-reference (url home-page)
5872 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5873 (file-name (string-append "psm-" version ".tar.gz"))
5874 (sha256
5875 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5876 (patches (search-patches
5877 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5878 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5879 "psm-repro.patch" ; reproducibility
5880 "psm-disable-memory-stats.patch"))))
5881 (build-system gnu-build-system)
5882 (outputs '("out" "debug"))
5883 (inputs `(("libuuid" ,util-linux)))
5884 (arguments
5885 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5886 ,(string-append "INSTALL_PREFIX=" %output)
5887 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5888 #:tests? #f
5889 #:phases (modify-phases %standard-phases
5890 (delete 'configure)
5891 (add-after 'unpack 'patch-/usr/include
5892 (lambda _
5893 (substitute* "Makefile"
5894 (("\\$\\{DESTDIR}/usr/include")
5895 (string-append %output "/include")))
5896 (substitute* "Makefile"
5897 (("/lib64") "/lib"))
5898 #t))
5899 (add-after 'unpack 'patch-sysmacros
5900 (lambda _
5901 (substitute* "ipath/ipath_proto.c"
5902 (("#include <sys/poll.h>" m)
5903 (string-append m "\n"
5904 "#include <sys/sysmacros.h>")))
5905 #t)))))
5906 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5907 (description
5908 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5909 communications interface for the True Scale family of products. PSM users are
5910 enabled with mechanisms necessary to implement higher level communications
5911 interfaces in parallel environments.")
5912 ;; Only Intel-compatable processors are supported.
5913 (supported-systems '("i686-linux" "x86_64-linux"))
5914 (license (list license:bsd-2 license:gpl2)))) ;dual
5915
5916 (define-public snapscreenshot
5917 (package
5918 (name "snapscreenshot")
5919 (version "1.0.14.3")
5920 (source
5921 (origin
5922 (method url-fetch)
5923 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5924 name "-" version ".tar.bz2"))
5925 (sha256
5926 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5927 (build-system gnu-build-system)
5928 (arguments
5929 `(#:make-flags
5930 (let ((out (assoc-ref %outputs "out")))
5931 (list (string-append "BINDIR=" out "/bin")
5932 (string-append "MANDIR=" out "/share/man")))
5933 #:tests? #f ; no test suite
5934 #:phases
5935 (modify-phases %standard-phases
5936 (delete 'configure) ; ./configure is a snarky no-op
5937 (add-before 'install 'fix-ownership
5938 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5939 (lambda _
5940 (substitute* "depfun.mak"
5941 ((" -o bin -g bin ") " "))
5942 #t))
5943 (add-before 'install 'create-output-directories
5944 (lambda* (#:key outputs #:allow-other-keys)
5945 (let ((out (assoc-ref outputs "out")))
5946 (mkdir-p (string-append out "/share/man/man1"))
5947 #t))))))
5948 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
5949 (synopsis "Take screenshots of one or more Linux text consoles")
5950 (description
5951 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
5952 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
5953 relevant @file{/dev/vcs*} file(s).")
5954 (license license:gpl2)))
5955
5956 (define-public fbcat
5957 (package
5958 (name "fbcat")
5959 (version "0.5.1")
5960 (source
5961 (origin
5962 (method url-fetch)
5963 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
5964 version "/" name "-" version ".tar.gz"))
5965 (sha256
5966 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
5967 (build-system gnu-build-system)
5968 (inputs
5969 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
5970 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
5971 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
5972 `(("pnmtopng" ,netpbm)))
5973 (outputs (list "out" "fbgrab"))
5974 (arguments
5975 `(#:make-flags
5976 (list "CC=gcc"
5977 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5978 #:tests? #f ; no tests
5979 #:phases
5980 (modify-phases %standard-phases
5981 (delete 'configure) ; no configure script
5982 (add-after 'build 'qualify-references
5983 (lambda* (#:key inputs outputs #:allow-other-keys)
5984 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5985 (out (assoc-ref outputs "out")))
5986 (substitute* "fbgrab"
5987 (("fbcat" all)
5988 (string-append out "/bin/" all))
5989 (("pnmtopng" all)
5990 (string-append pnmtopng "/bin/" all)))
5991 #t)))
5992 (add-after 'install 'split-fbgrab-output
5993 (lambda* (#:key outputs #:allow-other-keys)
5994 (let* ((out (assoc-ref outputs "out"))
5995 (out:fbgrab (assoc-ref outputs "fbgrab")))
5996 (for-each (lambda (file)
5997 (let ((old (string-append out "/" file))
5998 (new (string-append out:fbgrab "/" file)))
5999 (mkdir-p (dirname new))
6000 (rename-file old new)))
6001 (list "bin/fbgrab"
6002 "share/man/man1/fbgrab.1"))
6003 #t))))))
6004 (home-page "https://jwilk.net/software/fbcat")
6005 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6006 (description
6007 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6008 a dump therof. It supports a wide range of drivers and pixel formats.
6009 @command{fbcat} can take screenshots of virtually any application that can be
6010 made to write its output to the framebuffer, including (but not limited to)
6011 text-mode or graphical applications that don't use a display server.
6012
6013 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6014 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6015 (license license:gpl2)))
6016
6017 (define-public libcgroup
6018 (package
6019 (name "libcgroup")
6020 (version "0.41")
6021 (source
6022 (origin
6023 (method url-fetch)
6024 (uri (string-append
6025 "mirror://sourceforge/libcg/" name "/"
6026 version "/" name "-" version ".tar.bz2"))
6027 (sha256
6028 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6029 (build-system gnu-build-system)
6030 (arguments
6031 `(#:tests? #f))
6032 (native-inputs
6033 `(("bison" ,bison)
6034 ("flex" ,flex)))
6035 (inputs
6036 `(("linux-pam" ,linux-pam)))
6037 (home-page "https://sourceforge.net/projects/libcg/")
6038 (synopsis "Control groups management tools")
6039 (description "Control groups is Linux kernel method for process resource
6040 restriction, permission handling and more. This package provides userspace
6041 interface to this kernel feature.")
6042 (license license:lgpl2.1)))
6043
6044 (define-public mbpfan
6045 (package
6046 (name "mbpfan")
6047 (version "2.1.1")
6048 (source
6049 (origin
6050 (method git-fetch)
6051 (uri (git-reference
6052 (url "https://github.com/dgraziotin/mbpfan.git")
6053 (commit (string-append "v" version))))
6054 (file-name (git-file-name name version))
6055 (sha256
6056 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6057 (build-system gnu-build-system)
6058 (arguments
6059 '(#:tests? #f ; tests ask to be run as root
6060 #:make-flags (let ((out (assoc-ref %outputs "out")))
6061 (list (string-append "DESTDIR=" out)
6062 "CC=gcc"))
6063 #:phases
6064 (modify-phases %standard-phases
6065 (add-after 'unpack 'patch-paths
6066 (lambda _
6067 (substitute* "Makefile"
6068 (("/usr") ""))
6069 #t))
6070 (delete 'configure)))) ; there's no configure phase
6071 (home-page "https://github.com/dgraziotin/mbpfan")
6072 (synopsis "Control fan speed on Macbooks")
6073 (description
6074 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6075 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6076 module. It can be executed as a daemon or in the foreground with root
6077 privileges.")
6078 (license license:gpl3+)))
6079
6080 (define-public psm2
6081 (package
6082 (name "psm2")
6083 (version "11.2.86")
6084 (source (origin
6085 (method git-fetch)
6086 (uri (git-reference
6087 (url "https://github.com/intel/opa-psm2.git")
6088 (commit (string-append "PSM2_" version))))
6089 (file-name (git-file-name name version))
6090 (sha256
6091 (base32
6092 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6093 (build-system gnu-build-system)
6094 (arguments
6095 '(#:make-flags
6096 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6097 #:tests? #f
6098 #:phases (modify-phases %standard-phases
6099 (delete 'configure)
6100 (add-after 'unpack 'patch-Makefiles
6101 (lambda _
6102 (substitute* "Makefile"
6103 (("/lib64") "/lib")
6104 (("/usr") ""))
6105 (substitute* "compat/Makefile"
6106 (("/lib64") "/lib")
6107 (("/usr") ""))
6108 #t))
6109 (replace 'install
6110 (lambda _
6111 (setenv "DESTDIR" %output)
6112 (invoke "make" "install")
6113 #t)))))
6114 (inputs
6115 `(("rdma-core" ,rdma-core)
6116 ("numactl" ,numactl)))
6117 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6118 (description
6119 "This package is low-level user-level Intel's communications interface.
6120 The PSM2 API is a high-performance vendor-specific protocol that provides a
6121 low-level communications interface for the Intel Omni-Path family of
6122 high-speed networking devices.")
6123 (home-page "https://github.com/intel/opa-psm2")
6124 ;; Only the x86_64 architecure is supported.
6125 (supported-systems '("x86_64-linux"))
6126 (license (list license:bsd-3 license:gpl2)))) ; dual
6127
6128 (define-public libpfm4
6129 (package
6130 (name "libpfm4")
6131 (version "4.9.0")
6132 (source (origin
6133 (method url-fetch)
6134 (uri (string-append "mirror://sourceforge/perfmon2/"
6135 name "/libpfm-" version ".tar.gz"))
6136 (sha256
6137 (base32
6138 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6139 (build-system gnu-build-system)
6140 (arguments
6141 '(#:modules ((guix build utils)
6142 (guix build gnu-build-system))
6143 #:phases (modify-phases %standard-phases
6144 (delete 'configure)
6145 (delete 'check)
6146 (replace 'build
6147 (lambda* (#:key inputs outputs #:allow-other-keys)
6148 (let* ((out (assoc-ref outputs "out")))
6149 (setenv "CC" "gcc")
6150 (invoke "make")
6151 #t)))
6152 (replace 'install
6153 (lambda* (#:key outputs #:allow-other-keys)
6154 (let* ((out (assoc-ref outputs "out")))
6155 (invoke "make"
6156 (string-append "PREFIX=" out)
6157 "install")
6158 #t))))))
6159 (synopsis "Performance event monitoring library")
6160 (description
6161 "This package provides a library called libpfm4, which is used to develop
6162 monitoring tools exploiting the performance monitoring events such as those
6163 provided by the Performance Monitoring Unit (PMU) of modern processors.
6164
6165 Libpfm4 helps convert from an event name, expressed as a string, to the event
6166 encoding that is either the raw event as documented by the hardware vendor or
6167 the OS-specific encoding. In the latter case, the library is able to prepare
6168 the OS-specific data structures needed by the kernel to setup the event.
6169
6170 libpfm4 provides support for the @code{perf_events} interface, which was
6171 introduced in Linux 2.6.31.")
6172 (home-page "http://perfmon2.sourceforge.net/")
6173 (license license:expat)))
6174
6175 (define-public libnfnetlink
6176 (package
6177 (name "libnfnetlink")
6178 (version "1.0.1")
6179 (source (origin
6180 (method url-fetch)
6181 (uri (string-append
6182 "https://www.netfilter.org/projects/libnfnetlink/files/"
6183 "libnfnetlink-" version ".tar.bz2"))
6184 (sha256
6185 (base32
6186 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6187 (build-system gnu-build-system)
6188 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6189 (synopsis "Low-level netfilter netlink communication library")
6190 (description
6191 "@code{libnfnetlink} is the low-level library for netfilter related
6192 kernel/userspace communication. It provides a generic messaging
6193 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6194 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6195 management tools in userspace.")
6196 (license license:gpl2)))
6197
6198 (define-public go-netlink
6199 (package
6200 (name "go-netlink")
6201 (version "1.0.0")
6202 (source (origin
6203 (method git-fetch)
6204 (uri (git-reference
6205 (url "https://github.com/vishvananda/netlink.git")
6206 (commit (string-append "v" version))))
6207 (file-name (git-file-name name version))
6208 (sha256
6209 (base32
6210 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6211 (build-system go-build-system)
6212 (arguments
6213 `(#:import-path "github.com/vishvananda/netlink"))
6214 (native-inputs
6215 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6216 ("go-netns" ,go-netns)))
6217 (home-page "https://github.com/vishvananda/netlink")
6218 (synopsis "Simple netlink library for Go")
6219 (description "The netlink package provides a simple netlink library for
6220 Go. Netlink is the interface a user-space program in Linux uses to
6221 communicate with the kernel. It can be used to add and remove interfaces, set
6222 IP addresses and routes, and configure IPsec.")
6223 (license license:asl2.0)))
6224
6225 (define-public xfsprogs
6226 (package
6227 (name "xfsprogs")
6228 (version "5.2.1")
6229 (source (origin
6230 (method url-fetch)
6231 (uri (string-append
6232 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6233 "xfsprogs-" version ".tar.gz"))
6234 (sha256
6235 (base32
6236 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
6237 (build-system gnu-build-system)
6238 (outputs (list "out" "python"))
6239 (arguments
6240 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6241 #:phases
6242 (modify-phases %standard-phases
6243 (add-after 'install 'separate-python-output
6244 (lambda* (#:key outputs #:allow-other-keys)
6245 (let ((out (assoc-ref outputs "out"))
6246 (python (assoc-ref outputs "python")))
6247 (for-each
6248 (lambda (script)
6249 (mkdir-p (string-append python (dirname script)))
6250 (rename-file (string-append out script)
6251 (string-append python script)))
6252 (list "/sbin/xfs_scrub_all"))
6253 #t)))
6254 (add-after 'install 'install-headers
6255 (lambda _
6256 (invoke "make" "install-dev"))))))
6257 (native-inputs
6258 `(("gettext" ,gettext-minimal)))
6259 (inputs
6260 `(("libuuid" ,util-linux)
6261 ("python" ,python-wrapper)))
6262 (home-page "https://xfs.wiki.kernel.org/")
6263 (synopsis "XFS file system tools")
6264 (description "This package provides commands to create and check XFS
6265 file systems.")
6266 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6267 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6268 (license (list license:gpl2 license:lgpl2.1))))
6269
6270 (define-public genext2fs
6271 (package
6272 (name "genext2fs")
6273 (version "1.4.1-4")
6274 (source (origin
6275 (method git-fetch)
6276 (uri (git-reference
6277 (url "https://github.com/jeremie-koenig/genext2fs.git")
6278 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6279 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6280 (file-name (git-file-name name version))
6281 (sha256
6282 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6283 (build-system gnu-build-system)
6284 (arguments
6285 `(#:phases
6286 (modify-phases %standard-phases
6287 (add-after 'unpack 'apply-debian-patches
6288 ;; Debian changes (the revision after ‘-’ in VERSION) are
6289 ;; maintained as separate patches. Apply those relevant to us.
6290 (lambda _
6291 (for-each
6292 (lambda (file-name)
6293 (invoke "patch" "-p1" "-i"
6294 (string-append "debian/patches/" file-name)))
6295 (list "blocksize+creator.diff" ; add -B/-o options
6296 "byteswap_fix.diff"))
6297 #t)))))
6298 (native-inputs
6299 `(("autoconf" ,autoconf)
6300 ("automake" ,automake)))
6301 (home-page "https://github.com/jeremie-koenig/genext2fs")
6302 (synopsis "Generate ext2 file system as a normal user")
6303 (description "This package provides a program to generate an ext2
6304 file system as a normal (non-root) user. It does not require you to mount
6305 the image file to copy files on it, nor does it require that you become
6306 the superuser to make device nodes.")
6307 (license license:gpl2)))
6308
6309 (define-public fakeroot
6310 (package
6311 (name "fakeroot")
6312 (version "1.24")
6313 (source (origin
6314 (method url-fetch)
6315 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6316 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6317 (file-name (string-append name "-" version ".tar.gz"))
6318 (sha256
6319 (base32
6320 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6321 (build-system gnu-build-system)
6322 (arguments
6323 `(#:phases
6324 (modify-phases %standard-phases
6325 (add-after 'configure 'patch-Makefile
6326 (lambda _
6327 ;; Note: The root of the problem is already in "Makefile.am".
6328 (substitute* "Makefile"
6329 (("/bin/sh") (which "sh")))
6330 #t))
6331 (add-after 'unpack 'patch-getopt
6332 (lambda* (#:key inputs #:allow-other-keys)
6333 (substitute* "scripts/fakeroot.in"
6334 (("getopt")
6335 (string-append (assoc-ref inputs "util-linux")
6336 "/bin/getopt")))
6337 #t))
6338 (add-before 'configure 'setenv
6339 (lambda _
6340 (setenv "LIBS" "-lacl")
6341 #t))
6342 (add-before 'check 'prepare-check
6343 (lambda _
6344 (setenv "SHELL" (which "bash"))
6345 (setenv "VERBOSE" "1")
6346 (substitute* "test/t.touchinstall"
6347 ;; We don't have the name of the root user, so use ID=0.
6348 (("grep root") "grep \"\\<0\\>\""))
6349 (substitute* "test/tartest"
6350 ;; We don't have the name of the root group, so use ID=0.
6351 (("ROOTGROUP=root") "ROOTGROUP=0")
6352 ;; We don't have the name of the daemon user, so use IDs.
6353 (("daemon:sys") "1:3")
6354 (("daemon:") "1:"))
6355 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6356 (substitute* "test/compare-tar"
6357 (("tar -tvf") "tar --numeric-owner -tvf"))
6358 #t)))))
6359 (native-inputs
6360 `(("acl" ,acl)
6361 ("sharutils" ,sharutils) ; for the tests
6362 ("xz" ,xz))) ; for the tests
6363 (inputs
6364 `(("libcap" ,libcap)
6365 ("util-linux" ,util-linux)))
6366 (synopsis "Provides a fake root environment")
6367 (description "@command{fakeroot} runs a command in an environment where
6368 it appears to have root privileges for file manipulation. This is useful
6369 for allowing users to create archives (tar, ar, .deb etc.) with files in
6370 them with root permissions/ownership. Without fakeroot one would have to
6371 have root privileges to create the constituent files of the archives with
6372 the correct permissions and ownership, and then pack them up, or one would
6373 have to construct the archives directly, without using the archiver.")
6374 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6375 (license license:gpl3+)))
6376
6377 (define-public inputattach
6378 (package
6379 (name "inputattach")
6380 (version "0.42.0")
6381 (source (origin
6382 (method git-fetch)
6383 (uri (git-reference
6384 (url "https://github.com/linuxwacom/input-wacom.git")
6385 (commit (string-append "input-wacom-" version))))
6386 (file-name (git-file-name name version))
6387 (sha256
6388 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6389 (build-system gnu-build-system)
6390 (arguments
6391 `(#:phases
6392 (modify-phases %standard-phases
6393 (delete 'bootstrap)
6394 (delete 'configure)
6395 (replace 'build
6396 (lambda* (#:key inputs #:allow-other-keys)
6397 (with-directory-excursion "inputattach"
6398 (invoke (string-append (assoc-ref inputs "gcc")
6399 "/bin/gcc")
6400 "-O2" "-o" "inputattach" "inputattach.c"))
6401 #t))
6402 (delete 'check)
6403 (replace 'install
6404 (lambda* (#:key outputs #:allow-other-keys)
6405 (let ((target-dir (string-append
6406 (assoc-ref outputs "out")
6407 "/bin/")))
6408 (mkdir-p target-dir)
6409 (copy-file "inputattach/inputattach"
6410 (string-append target-dir
6411 "inputattach"))
6412 #t))))))
6413 (home-page "https://linuxwacom.github.io/")
6414 (synopsis "Dispatch input peripherals events to a device file")
6415 (description "inputattach dispatches input events from several device
6416 types and interfaces and translates so that the X server can use them.")
6417 (license license:gpl2+)))
6418
6419 (define-public pipewire
6420 (package
6421 (name "pipewire")
6422 (version "0.2.7")
6423 (source (origin
6424 (method git-fetch)
6425 (uri (git-reference
6426 (url "https://github.com/PipeWire/pipewire")
6427 (commit version)))
6428 (file-name (git-file-name name version))
6429 (sha256
6430 (base32
6431 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
6432 (build-system meson-build-system)
6433 (arguments
6434 '(#:configure-flags '("-Dsystemd=false")))
6435 (native-inputs
6436 `(("pkg-config" ,pkg-config)))
6437 (inputs
6438 `(("alsa-lib" ,alsa-lib)
6439 ("dbus" ,dbus)
6440 ("eudev" ,eudev)
6441 ("ffmpeg" ,ffmpeg)
6442 ("gstreamer" ,gstreamer)
6443 ("gst-plugins-base" ,gst-plugins-base)
6444 ("libva" ,libva)
6445 ("sbc" ,sbc)
6446 ("sdl2" ,sdl2)))
6447 (home-page "https://pipewire.org/")
6448 (synopsis "Server and user space API to deal with multimedia pipelines")
6449 (description
6450 "PipeWire is a project that aims to greatly improve handling of audio and
6451 video under Linux. It aims to support the usecases currently handled by both
6452 PulseAudio and Jack and at the same time provide same level of powerful handling
6453 of Video input and output. It also introduces a security model that makes
6454 interacting with audio and video devices from containerized applications easy,
6455 with supporting Flatpak applications being the primary goal. Alongside Wayland
6456 and Flatpak we expect PipeWire to provide a core building block for the future
6457 of Linux application development.")
6458 (license license:lgpl2.0+)))
6459
6460 (define-public ell
6461 (package
6462 (name "ell")
6463 (version "0.23")
6464 (source (origin
6465 (method git-fetch)
6466 (uri (git-reference
6467 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6468 (commit version)))
6469 (file-name (git-file-name name version))
6470 (sha256
6471 (base32
6472 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6473 (build-system gnu-build-system)
6474 (arguments
6475 `(#:phases
6476 (modify-phases %standard-phases
6477 (add-after 'unpack 'fix-dbus-tests
6478 (lambda _
6479 (substitute* '("unit/test-dbus-message-fds.c"
6480 "unit/test-dbus-properties.c"
6481 "unit/test-dbus.c")
6482 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6483 #t)))))
6484 (inputs
6485 `(("dbus" ,dbus)
6486 ("libtool" ,libtool)))
6487 (native-inputs
6488 `(("autoconf" ,autoconf)
6489 ("pkgconfig" ,pkg-config)
6490 ("automake" ,automake)))
6491 (home-page "https://01.org/ell")
6492 (synopsis "Embedded Linux Library")
6493 (description "The Embedded Linux* Library (ELL) provides core, low-level
6494 functionality for system daemons. It typically has no dependencies other than
6495 the Linux kernel, C standard library, and libdl (for dynamic linking). While
6496 ELL is designed to be efficient and compact enough for use on embedded Linux
6497 platforms, it is not limited to resource-constrained systems.")
6498 (license license:lgpl2.1+)))
6499
6500 (define-public lttng-ust
6501 (package
6502 (name "lttng-ust")
6503 (version "2.11.0")
6504 (source (origin
6505 (method url-fetch)
6506 (uri (string-append "https://lttng.org/files/lttng-ust/"
6507 "lttng-ust-" version ".tar.bz2"))
6508 (sha256
6509 (base32
6510 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
6511 (build-system gnu-build-system)
6512 (inputs
6513 `(("liburcu" ,liburcu)
6514 ("numactl" ,numactl)))
6515 (native-inputs
6516 `(("python" ,python-3)))
6517 (home-page "https://lttng.org/")
6518 (synopsis "LTTng userspace tracer libraries")
6519 (description "The user space tracing library, liblttng-ust, is the LTTng
6520 user space tracer. It receives commands from a session daemon, for example to
6521 enable and disable specific instrumentation points, and writes event records
6522 to ring buffers shared with a consumer daemon.")
6523 (license license:lgpl2.1+)))
6524
6525 (define-public kexec-tools
6526 (package
6527 (name "kexec-tools")
6528 (version "2.0.20")
6529 (source (origin
6530 (method url-fetch)
6531 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
6532 "/kexec/kexec-tools-" version ".tar.xz"))
6533 (sha256
6534 (base32
6535 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
6536 (build-system gnu-build-system)
6537 (arguments
6538 ;; There are no automated tests.
6539 '(#:tests? #f))
6540 (home-page "https://projects.horms.net/projects/kexec/")
6541 (synopsis "Tools for booting directly into different kernels")
6542 (description "This package provides the @code{kexec} program and ancillary
6543 utilities. Using @code{kexec}, it is possible to boot directly into a new
6544 kernel from the context of an already-running kernel, bypassing the normal
6545 system boot process.")
6546 (license license:gpl2)))