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