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