projects/guix·blob version-1.2.0 · refs

7627 lines · 312.6 KiB

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