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