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