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