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