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