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