projects/guix·blob librewolf-updates · refs

12603 lines · 548.4 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012-2021, 2021-2025 Ludovic Courtès <[email protected]>
3;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <[email protected]>
4;;; Copyright © 2012 Nikita Karetnikov <[email protected]>
5;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <[email protected]>
6;;; Copyright © 2015 Federico Beffa <[email protected]>
7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <[email protected]>
8;;; Copyright © 2015-2018, 2020, 2022-2025 Efraim Flashner <[email protected]>
9;;; Copyright © 2016 Christine Lemmer-Webber <[email protected]>
10;;; Copyright © 2016–2022 Tobias Geerinckx-Rice <[email protected]>
11;;; Copyright © 2016, 2017 Alex Kost <[email protected]>
12;;; Copyright © 2016 Raymond Nicholson <[email protected]>
13;;; Copyright © 2016 Mathieu Lirzin <[email protected]>
14;;; Copyright © 2016, 2018-2023, 2025 Nicolas Goaziou <[email protected]>
15;;; Copyright © 2016, 2018, 2019, 2020, 2021, 2022, 2023 Ricardo Wurmus <[email protected]>
16;;; Copyright © 2016 David Craven <[email protected]>
17;;; Copyright © 2016 John Darrington <[email protected]>
18;;; Copyright © 2016-2023 Marius Bakke <[email protected]>
19;;; Copyright © 2016, 2018 Rene Saavedra <[email protected]>
20;;; Copyright © 2016 Carlos Sánchez de La Lama <[email protected]>
21;;; Copyright © 2016, 2017 Nikita <[email protected]>
22;;; Copyright © 2017, 2018, 2020, 2021, 2022 Leo Famulari <[email protected]>
23;;; Copyright © 2017 José Miguel Sánchez García <[email protected]>
24;;; Copyright © 2017 Gábor Boskovits <[email protected]>
25;;; Copyright © 2017, 2019, 2021 Mathieu Othacehe <[email protected]>
26;;; Copyright © 2017 Clément Lassieur <[email protected]>
27;;; Copyright © 2017, 2018, 2019 Rutger Helling <[email protected]>
28;;; Copyright © 2017 nee <[email protected]>
29;;; Copyright © 2017 Dave Love <[email protected]>
30;;; Copyright © 2018 Pierre-Antoine Rouby <[email protected]>
31;;; Copyright © 2018, 2020, 2022 Brendan Tildesley <[email protected]>
32;;; Copyright © 2018 Manuel Graf <[email protected]>
33;;; Copyright © 2018, 2019 Pierre Langlois <[email protected]>
34;;; Copyright © 2018 Vasile Dumitrascu <[email protected]>
35;;; Copyright © 2019 Tim Gesthuizen <[email protected]>
36;;; Copyright © 2019 mikadoZero <[email protected]>
37;;; Copyright © 2019-2025 Maxim Cournoyer <[email protected]>
38;;; Copyright © 2019 Stefan Stefanović <[email protected]>
39;;; Copyright © 2019-2022 Brice Waegeneire <[email protected]>
40;;; Copyright © 2019 Kei Kebreau <[email protected]>
41;;; Copyright © 2020, 2021, 2025 Oleg Pykhalov <[email protected]>
42;;; Copyright © 2020 Pierre Neidhardt <[email protected]>
43;;; Copyright © 2020 Chris Marusich <[email protected]>
44;;; Copyright © 2020 Vincent Legoll <[email protected]>
45;;; Copyright © 2020, 2023, 2024, 2025 Janneke Nieuwenhuizen <[email protected]>
46;;; Copyright © 2020 Morgan Smith <[email protected]>
47;;; Copyright © 2020 John Soo <[email protected]>
48;;; Copyright © 2020, 2022 Michael Rohleder <[email protected]>
49;;; Copyright © 2020 Anders Thuné <[email protected]>
50;;; Copyright © 2020, 2021 Greg Hogan <[email protected]>
51;;; Copyright © 2020 Zhu Zihao <[email protected]>
52;;; Copyright © 2020 David Dashyan <[email protected]>
53;;; Copyright © 2020 pukkamustard <[email protected]>
54;;; Copyright © 2021 Solene Rapenne <[email protected]>
55;;; Copyright © 2021 B. Wilson <[email protected]>
56;;; Copyright © 2021 Ivan Gankevich <[email protected]>
57;;; Copyright © 2021 Maxime Devos <[email protected]>
58;;; Copyright © 2021, 2023 Guillaume Le Vaillant <[email protected]>
59;;; Copyright © 2021 Sarah Morgensen <[email protected]>
60;;; Copyright © 2021 Felix Gruber <[email protected]>
61;;; Copyright © 2021 Josselin Poiret <[email protected]>
62;;; Copyright © 2021 Olivier Dion <[email protected]>
63;;; Copyright © 2021 Solene Rapenne <[email protected]>
64;;; Copyright © 2021, 2022 Petr Hodina <[email protected]>
65;;; Copyright © 2021 Ryan Sundberg <[email protected]>
66;;; Copyright © 2022-2026 Artyom V. Poptsov <[email protected]>
67;;; Copyright © 2022 Rene Saavedra <[email protected]>
68;;; Copyright © 2022 muradm <[email protected]>
69;;; Copyright © 2022, 2023 Denis 'GNUtoo' Carikli <[email protected]>
70;;; Copyright © 2022 Hunter Jozwiak <[email protected]>
71;;; Copyright © 2022 Hilton Chain <[email protected]>
72;;; Copyright © 2022 Stefan <[email protected]>
73;;; Copyright © 2022, 2023 Demis Balbach <[email protected]>
74;;; Copyright © 2023 Bruno Victal <[email protected]>
75;;; Copyright © 2023 Yovan Naumovski <[email protected]>
76;;; Copyright © 2023, 2025 Zheng Junjie <[email protected]>
77;;; Copyright © 2023 dan <[email protected]>
78;;; Copyright © 2023 Foundation Devices, Inc. <[email protected]>
79;;; Copyright © 2023, 2024, 2026 Wilko Meyer <[email protected]>
80;;; Copyright © 2023 Jaeme Sifat <[email protected]>
81;;; Copyright © 2024 Gabriel Wicki <[email protected]>
82;;; Copyright © 2024 Sharlatan Hellseher <[email protected]>
83;;; Copyright © 2024 Arun Isaac <[email protected]>
84;;; Copyright © 2024, 2025 Ashish SHUKLA <[email protected]>
85;;; Copyright © 2025 Nigko Yerden <[email protected]>
86;;; Copyright © 2025 Mathieu Laparie <[email protected]>
87;;; Copyright © 2025 John Kehayias <[email protected]>
88;;; Copyright © 2025 Arjan Adriaanse <[email protected]>
89;;; Copyright © 2026 Justin Veilleux <[email protected]>
90;;;
91;;; This file is part of GNU Guix.
92;;;
93;;; GNU Guix is free software; you can redistribute it and/or modify it
94;;; under the terms of the GNU General Public License as published by
95;;; the Free Software Foundation; either version 3 of the License, or (at
96;;; your option) any later version.
97;;;
98;;; GNU Guix is distributed in the hope that it will be useful, but
99;;; WITHOUT ANY WARRANTY; without even the implied warranty of
100;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
101;;; GNU General Public License for more details.
102;;;
103;;; You should have received a copy of the GNU General Public License
104;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
105
106(define-module (gnu packages linux)
107 #:use-module (gnu packages)
108 #:use-module (gnu packages acl)
109 #:use-module (gnu packages adns)
110 #:use-module (gnu packages admin)
111 #:use-module (gnu packages algebra)
112 #:use-module (gnu packages apparmor)
113 #:use-module (gnu packages audio)
114 #:use-module (gnu packages autotools)
115 #:use-module (gnu packages avahi)
116 #:use-module (gnu packages backup)
117 #:use-module (gnu packages base)
118 #:use-module (gnu packages bash)
119 #:use-module (gnu packages bison)
120 #:use-module (gnu packages boost)
121 #:use-module (gnu packages calendar)
122 #:use-module (gnu packages check)
123 #:use-module (gnu packages cpio)
124 #:use-module (gnu packages cpp)
125 #:use-module (gnu packages crypto)
126 #:use-module (gnu packages cryptsetup)
127 #:use-module (gnu packages compression)
128 #:use-module (gnu packages curl)
129 #:use-module (gnu packages databases)
130 #:use-module (gnu packages datastructures)
131 #:use-module (gnu packages dbm)
132 #:use-module (gnu packages disk)
133 #:use-module (gnu packages docbook)
134 #:use-module (gnu packages documentation)
135 #:use-module (gnu packages dlang)
136 #:use-module (gnu packages elf)
137 #:use-module (gnu packages file)
138 #:use-module (gnu packages flex)
139 #:use-module (gnu packages fontutils)
140 #:use-module (gnu packages freedesktop)
141 #:use-module (gnu packages gawk)
142 #:use-module (gnu packages gcc)
143 #:use-module (gnu packages gettext)
144 #:use-module (gnu packages glib)
145 #:use-module (gnu packages gnome)
146 #:use-module (gnu packages gnupg)
147 #:use-module (gnu packages golang)
148 #:use-module (gnu packages gperf)
149 #:use-module (gnu packages graphviz)
150 #:use-module (gnu packages gstreamer)
151 #:use-module (gnu packages gtk)
152 #:use-module (gnu packages guile)
153 #:use-module (gnu packages haskell-apps)
154 #:use-module (gnu packages haskell-xyz)
155 #:use-module (gnu packages image)
156 #:use-module (gnu packages kde-frameworks)
157 #:use-module (gnu packages libedit)
158 #:use-module (gnu packages kde-graphics)
159 #:use-module (gnu packages libevent)
160 #:use-module (gnu packages libunwind)
161 #:use-module (gnu packages libusb)
162 #:use-module (gnu packages llvm)
163 #:use-module (gnu packages lsof)
164 #:use-module (gnu packages lua)
165 #:use-module (gnu packages m4)
166 #:use-module (gnu packages man)
167 #:use-module (gnu packages maths)
168 #:use-module (gnu packages multiprecision)
169 #:use-module (gnu packages ncurses)
170 #:use-module (gnu packages netpbm)
171 #:use-module (gnu packages networking)
172 #:use-module (gnu packages nss)
173 #:use-module (gnu packages onc-rpc)
174 #:use-module (gnu packages oneapi)
175 #:use-module (gnu packages perl)
176 #:use-module (gnu packages pciutils)
177 #:use-module (gnu packages pkg-config)
178 #:use-module (gnu packages polkit)
179 #:use-module (gnu packages popt)
180 #:use-module (gnu packages protobuf)
181 #:use-module (gnu packages pulseaudio)
182 #:use-module (gnu packages python)
183 #:use-module (gnu packages python-build)
184 #:use-module (gnu packages python-xyz)
185 #:use-module (gnu packages qt)
186 #:use-module (gnu packages readline)
187 #:use-module (gnu packages regex)
188 #:use-module (gnu packages rpc)
189 #:use-module (gnu packages rrdtool)
190 #:use-module (gnu packages rsync)
191 #:use-module (gnu packages rust-sources)
192 #:use-module (gnu packages samba)
193 #:use-module (gnu packages sdl)
194 #:use-module (gnu packages serialization)
195 #:use-module (gnu packages slang)
196 #:use-module (gnu packages sqlite)
197 #:use-module (gnu packages texinfo)
198 #:use-module (gnu packages textutils)
199 #:use-module (gnu packages tls)
200 #:use-module (gnu packages valgrind)
201 #:use-module (gnu packages video)
202 #:use-module (gnu packages vim)
203 #:use-module (gnu packages vulkan)
204 #:use-module (gnu packages web)
205 #:use-module (gnu packages xiph)
206 #:use-module (gnu packages xml)
207 #:use-module (gnu packages xdisorg)
208 #:use-module (gnu packages xorg)
209 #:use-module (gnu packages groff)
210 #:use-module (gnu packages selinux)
211 #:use-module (gnu packages sphinx)
212 #:use-module (gnu packages swig)
213 #:use-module (guix platform)
214 #:use-module (guix build-system cmake)
215 #:use-module (guix build-system copy)
216 #:use-module (guix build-system gnu)
217 #:use-module (guix build-system go)
218 #:use-module (guix build-system meson)
219 #:use-module (guix build-system pyproject)
220 #:use-module (guix build-system python)
221 #:use-module (guix build-system qt)
222 #:use-module (guix build-system trivial)
223 #:use-module (guix build-system linux-module)
224 #:use-module (guix download)
225 #:use-module (guix git-download)
226 #:use-module ((guix licenses) #:prefix license:)
227 #:use-module (guix packages)
228 #:use-module (guix gexp)
229 #:use-module (guix store)
230 #:use-module (guix monads)
231 #:use-module (guix utils)
232 #:use-module (guix deprecation) ;for libcap/next
233 #:use-module (srfi srfi-1)
234 #:use-module (srfi srfi-2)
235 #:use-module (srfi srfi-26)
236 #:use-module (ice-9 match)
237 #:use-module (ice-9 regex)
238 #:export (customize-linux
239 make-defconfig))
240
241
242
243;;;
244;;; Linux kernel customization functions.
245;;;
246
247(define* (customize-linux #:key name
248 (linux linux-libre)
249 source
250 defconfig
251 modconfig
252 (configs "")
253 extra-version)
254 "Make a customized Linux package NAME derived from the LINUX package.
255
256If NAME is not given, then it defaults to the same name as the LINUX package.
257
258Unless SOURCE is given the source of LINUX is used.
259
260A DEFCONFIG file to be used can be given as an origin, as a file-like object
261(file-append, local-file etc.), or as a string with the name of a defconfig file
262available in the Linux sources. If DEFCONFIG is not given, then a defconfig
263file will be saved from the LINUX package configuration.
264
265MODCONFIG is an origin or file-like object used for make localmodconfig to
266disable unlisted modules. For instance, this can come from using modprobed-db
267periodically on a running machine to find all loaded modules.
268
269Additional CONFIGS will be used to modify the given or saved defconfig, which
270will finally be used to build Linux.
271
272CONFIGS can be a list of strings, with one configuration per line. The usual
273defconfig syntax has to be used, but there is a special extension to ease the
274removal of configurations. Comment lines are supported as well.
275
276Here is an example:
277
278 '(;; This string defines the version tail in 'uname -r'.
279 \"CONFIG_LOCALVERSION=\\\"-handcrafted\\\"
280 ;; This '# CONFIG_... is not set' syntax has to match exactly!
281 \"# CONFIG_BOOT_CONFIG is not set\"
282 \"CONFIG_NFS_SWAP=y\"
283 ;; This is a multiline configuration:
284 \"CONFIG_E1000=y
285# This is a comment, below follows an extension to unset a configuration:
286CONFIG_CMDLINE_EXTEND\")
287
288A string of configurations instead of a list of configuration strings is also
289possible.
290
291EXTRA-VERSION can be a string overwriting the EXTRAVERSION setting of the LINUX
292package, after being prepended by a hyphen. It will be visible in the output
293of 'uname -r' behind the Linux version numbers."
294 (package
295 (inherit linux)
296 (name (or name (package-name linux)))
297 (source (or source (package-source linux)))
298 (arguments
299 (substitute-keyword-arguments
300 (package-arguments linux)
301 ((#:imported-modules imported-modules %default-gnu-imported-modules)
302 `((guix build kconfig) ,@imported-modules))
303 ((#:modules modules)
304 `((guix build kconfig) ,@modules))
305 ((#:phases phases)
306 #~(modify-phases #$phases
307 (replace 'configure
308 (lambda* (#:key inputs #:allow-other-keys #:rest arguments)
309 (setenv "EXTRAVERSION"
310 #$(and extra-version
311 (not (string-null? extra-version))
312 (string-append "-" extra-version)))
313 (let* ((configs (string-append "arch/" #$(linux-srcarch)
314 "/configs/"))
315 (guix_defconfig (string-append configs
316 "guix_defconfig")))
317 #$(cond
318 ((not defconfig)
319 #~(begin
320 ;; Call the original 'configure phase.
321 (apply (assoc-ref #$phases 'configure) arguments)
322 ;; Save a defconfig file.
323 (invoke "make" "savedefconfig")
324 ;; Move the saved defconfig to the proper location.
325 (rename-file "defconfig"
326 guix_defconfig)))
327 ((string? defconfig)
328 ;; Use another existing defconfig from the Linux sources.
329 #~(rename-file (string-append configs #$defconfig)
330 guix_defconfig))
331 (else
332 ;; Copy the defconfig input to the proper location.
333 #~(copy-file #$defconfig guix_defconfig)))
334 (chmod guix_defconfig #o644)
335 (modify-defconfig guix_defconfig '#$configs)
336 (invoke "make" "guix_defconfig")
337 (verify-config ".config" guix_defconfig)
338 ;; Minimize module building if provided e.g. a modprobed-db
339 ;; database.
340 (if #$modconfig
341 (invoke "make" (string-append "LSMOD=" #$modconfig)
342 "localmodconfig")))))))))))
343
344(define (make-defconfig uri sha256-as-base32)
345 (origin (method url-fetch)
346 (uri uri)
347 (sha256 (base32 sha256-as-base32))))
348
349(define (linux-srcarch)
350 "Return the linux SRCARCH name, which is set in the toplevel Makefile of
351Linux and denotes the architecture-specific directory name below arch/ in its
352source code. Some few architectures share a common folder. It resembles the
353definition of SRCARCH based on ARCH in the Makefile and may be used to place a
354defconfig file in the proper path."
355 (let ((linux-arch (platform-linux-architecture
356 (lookup-platform-by-target-or-system
357 (or (%current-target-system)
358 (%current-system))))))
359 (match linux-arch
360 ("i386" "x86")
361 ("x86_64" "x86")
362 ("sparc32" "sparc")
363 ("sparc64" "sparc")
364 ("sh64" "sh")
365 (_ linux-arch))))
366
367(define-public (system->defconfig system)
368 "Some systems (notably powerpc-linux) require a special target for kernel
369defconfig. Return the appropriate Make target if applicable, otherwise return
370\"defconfig\"."
371 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
372 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
373 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
374 (else "defconfig")))
375
376
377;;;
378;;; Kernel source code deblobbing.
379;;;
380
381(define (linux-libre-deblob-scripts version gnu-revision
382 deblob-hash
383 deblob-check-hash)
384 (list (version-major+minor version)
385 (origin
386 (method url-fetch)
387 (uri (string-append "https://linux-libre.fsfla.org"
388 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
389 "deblob-" (version-major+minor version)))
390 (file-name (string-append "linux-libre-deblob-"
391 version "-" gnu-revision))
392 (sha256 deblob-hash))
393 (origin
394 (method url-fetch)
395 (uri (string-append "https://linux-libre.fsfla.org"
396 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
397 "deblob-check"))
398 (file-name (string-append "linux-libre-deblob-check-" version "-" gnu-revision))
399 (sha256 deblob-check-hash))))
400
401;; XXXX: Workaround 'snippet' limitations
402(define computed-origin-method (@@ (guix packages) computed-origin-method))
403
404(define (make-linux-libre-source version
405 upstream-source
406 deblob-scripts)
407 "Return a 'computed' origin that generates a Linux-libre tarball from the
408corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
409 (match deblob-scripts
410 ((deblob-version (? origin? deblob) (? origin? deblob-check))
411 (unless (string=? deblob-version (version-major+minor version))
412 ;; The deblob script cannot be expected to work properly on a
413 ;; different version (major+minor) of Linux, even if no errors
414 ;; are signaled during execution.
415 (error "deblob major+minor version mismatch"))
416 (origin
417 (method computed-origin-method)
418 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
419 (sha256 #f)
420 (uri
421 (delay
422 (with-imported-modules '((guix build utils))
423 #~(begin
424 (use-modules (guix build utils)
425 (srfi srfi-1)
426 (ice-9 match)
427 (ice-9 ftw))
428
429 (setvbuf (current-output-port) 'line)
430
431 (let ((dir (string-append "linux-" #$version)))
432
433 (mkdir "/tmp/bin")
434 (set-path-environment-variable
435 "PATH" '("bin")
436 (list "/tmp"
437 #+(canonical-package bash)
438 #+(canonical-package coreutils)
439 #+(canonical-package diffutils)
440 #+(canonical-package findutils)
441 #+(canonical-package patch)
442 #+(canonical-package xz)
443 #+(canonical-package sed)
444 #+(canonical-package grep)
445 #+(canonical-package bzip2)
446 #+(canonical-package gzip)
447 #+(canonical-package tar)
448 #+(canonical-package gawk)
449 #+python-wrapper))
450
451 (with-directory-excursion "/tmp/bin"
452
453 (copy-file #+deblob "deblob")
454 (chmod "deblob" #o755)
455 (substitute* "deblob"
456 (("/bin/sh") (which "sh")))
457
458 (copy-file #+deblob-check "deblob-check")
459 (chmod "deblob-check" #o755)
460 (substitute* "deblob-check"
461 (("/bin/sh") (which "sh"))
462 (("/bin/sed") (which "sed"))
463 (("/usr/bin/python") (which "python"))))
464
465 (if (file-is-directory? #+upstream-source)
466 (begin
467 (format #t "Copying upstream linux source...~%")
468 (invoke "cp" "--archive" #+upstream-source dir)
469 (invoke "chmod" "--recursive" "u+w" dir))
470 (begin
471 (format #t "Unpacking upstream linux tarball...~%")
472 (invoke "tar" "xf" #$upstream-source)
473 (match (scandir "."
474 (lambda (name)
475 (and (not (member name '("." "..")))
476 (file-is-directory? name))))
477 ((unpacked-dir)
478 (unless (string=? dir unpacked-dir)
479 (rename-file unpacked-dir dir)))
480 (dirs
481 (error "multiple directories found" dirs)))))
482
483 (with-directory-excursion dir
484 (format #t "Running deblob script...~%")
485 (invoke "/tmp/bin/deblob"))
486
487 (format #t "~%Packing new Linux-libre tarball...~%")
488 (invoke "tar" "cvfa" #$output
489 ;; Avoid non-determinism in the archive.
490 "--mtime=@0"
491 "--owner=root:0"
492 "--group=root:0"
493 "--sort=name"
494 "--hard-dereference"
495 dir)
496
497 (format #t "~%Scanning the generated tarball for blobs...~%")
498 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
499 #$output))))))))))
500
501
502;;;
503;;; Kernel sources.
504;;;
505
506(define (linux-libre-urls version gnu-revision)
507 "Return a list of URLs for Linux-Libre VERSION."
508 (list (string-append
509 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
510 version "-" gnu-revision "/linux-libre-" version "-" gnu-revision ".tar.xz")
511
512 ;; XXX: Work around <http://bugs.gnu.org/14851>.
513 (string-append
514 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
515 version "-" gnu-revision ".tar.xz")
516
517 ;; Maybe this URL will become valid eventually.
518 (string-append
519 "mirror://gnu/linux-libre/" version "-" gnu-revision "/linux-libre-"
520 version "-" gnu-revision ".tar.xz")))
521
522(define (%upstream-linux-source version hash)
523 (origin
524 (method url-fetch)
525 (uri (string-append "mirror://kernel.org"
526 "/linux/kernel/v" (version-major version) ".x/"
527 "linux-" version ".tar.xz"))
528 (sha256 hash)))
529
530;; The current "stable" kernels. That is, the most recently released major
531;; versions that are still supported upstream.
532
533(define-public linux-libre-6.19-version "6.19.5")
534(define-public linux-libre-6.19-gnu-revision "gnu")
535(define deblob-scripts-6.19
536 (linux-libre-deblob-scripts
537 linux-libre-6.19-version
538 linux-libre-6.19-gnu-revision
539 (base32 "0zl5352xsv12xkqrfygp5kd8nvjq718pg5iaz64y675abymacp8v")
540 (base32 "1awsjh9qs5inrwj34kzkrfvvysdaka6dnbilpn1ai66r6dqc2810")))
541(define-public linux-libre-6.19-pristine-source
542 (let ((version linux-libre-6.19-version)
543 (hash (base32 "1yig0i2q7vn7p8g4lmkviddxi62mzhp0fv2hx3057qq9qz40bblm")))
544 (make-linux-libre-source version
545 (%upstream-linux-source version hash)
546 deblob-scripts-6.19)))
547
548(define-public linux-libre-6.18-version "6.18.15")
549(define-public linux-libre-6.18-gnu-revision "gnu")
550(define deblob-scripts-6.18
551 (linux-libre-deblob-scripts
552 linux-libre-6.18-version
553 linux-libre-6.18-gnu-revision
554 (base32 "1piyq7183bdf169w66k62yr1vbs0ls7pqx3cyyk7hisw8vhy643j")
555 (base32 "1xdz33lshw1xs6a5qiwhvxzdh2a0acll1zdyk2mnn9d4579a4gn1")))
556(define-public linux-libre-6.18-pristine-source
557 (let ((version linux-libre-6.18-version)
558 (hash (base32 "0w7iy9mx1b42q4qz6y9rvny7nmvpwq0mf6b9vv84w4y4qcb64wbw")))
559 (make-linux-libre-source version
560 (%upstream-linux-source version hash)
561 deblob-scripts-6.18)))
562
563;; The "longterm" kernels — the older releases with long-term upstream support.
564;; Here are the support timelines:
565;; <https://www.kernel.org/category/releases.html>
566
567(define-public linux-libre-6.12-version "6.12.74")
568(define-public linux-libre-6.12-gnu-revision "gnu")
569(define deblob-scripts-6.12
570 (linux-libre-deblob-scripts
571 linux-libre-6.12-version
572 linux-libre-6.12-gnu-revision
573 (base32 "168aykyvyyp34549hqhlprl0n052q8wdb2y3vyxqw40wpf2vw3ln")
574 (base32 "1wyfggr9q0f10yr3nxsvx3nd3wscp5145fgxw0ps0b09ckcyr2mi")))
575(define-public linux-libre-6.12-pristine-source
576 (let ((version linux-libre-6.12-version)
577 (hash (base32 "0gm1mjn203gc11dqk82fkbsr96bnwcxq4sx5khc7yhwsvjqywmiv")))
578 (make-linux-libre-source version
579 (%upstream-linux-source version hash)
580 deblob-scripts-6.12)))
581
582(define-public linux-libre-6.6-version "6.6.127")
583(define-public linux-libre-6.6-gnu-revision "gnu")
584(define deblob-scripts-6.6
585 (linux-libre-deblob-scripts
586 linux-libre-6.6-version
587 linux-libre-6.6-gnu-revision
588 (base32 "0y3lawljby2rl0mb0yjdyaasci4pl935y8xa0dnmbzff23knkxlw")
589 (base32 "0z47f6mkllk1fgpq04x73djl5gh3mj50bxj2rpg4jlzm0rcirrag")))
590(define-public linux-libre-6.6-pristine-source
591 (let ((version linux-libre-6.6-version)
592 (hash (base32 "1zn9z3ghjyff71s3yabfanrgyks3wnmn1p5w6301rczhnjbrrkd7")))
593 (make-linux-libre-source version
594 (%upstream-linux-source version hash)
595 deblob-scripts-6.6)))
596
597(define-public linux-libre-6.1-version "6.1.164")
598(define-public linux-libre-6.1-gnu-revision "gnu")
599(define deblob-scripts-6.1
600 (linux-libre-deblob-scripts
601 linux-libre-6.1-version
602 linux-libre-6.1-gnu-revision
603 (base32 "10gcbkd5jxfspa712kvb3qmsjgsapd9cz47pmpfk03bbfzf8ydlv")
604 (base32 "1jiwwl5sgpc16x0v6phbknv94mc46gvwgc2z8s4pdgn4j54yrd8v")))
605(define-public linux-libre-6.1-pristine-source
606 (let ((version linux-libre-6.1-version)
607 (hash (base32 "074xlcrx5lvbkbwgahfvjlvak0j1nig9azfxfdl64zxzgdzhigrk")))
608 (make-linux-libre-source version
609 (%upstream-linux-source version hash)
610 deblob-scripts-6.1)))
611
612(define-public linux-libre-5.15-version "5.15.201")
613(define-public linux-libre-5.15-gnu-revision "gnu")
614(define deblob-scripts-5.15
615 (linux-libre-deblob-scripts
616 linux-libre-5.15-version
617 linux-libre-5.15-gnu-revision
618 (base32 "0b2gd83ihxlq490gpgq930misc6jrckw4rzl7fvwd0qzczqjvff5")
619 (base32 "1s6km2r2mad0wpf7nqn4rqsykw1lm386l1yskmil24239fbva1f1")))
620(define-public linux-libre-5.15-pristine-source
621 (let ((version linux-libre-5.15-version)
622 (hash (base32 "15hv8rqgr6ca9rnbpb6hvzskqvb4h8x3w6nl4y2npbfsxpxzyajg")))
623 (make-linux-libre-source version
624 (%upstream-linux-source version hash)
625 deblob-scripts-5.15)))
626
627(define-public linux-libre-5.10-version "5.10.251")
628(define-public linux-libre-5.10-gnu-revision "gnu1")
629(define deblob-scripts-5.10
630 (linux-libre-deblob-scripts
631 linux-libre-5.10-version
632 linux-libre-5.10-gnu-revision
633 (base32 "1wn9k4lbxcc9rzl1rqidlnb472wyayillrh57gyxnghi7j9ghqna")
634 (base32 "1hgza8fsps7bkjf4i0f2xgvrh1r183z3i6lxrr2nr8qbi5d13qs7")))
635(define-public linux-libre-5.10-pristine-source
636 (let ((version linux-libre-5.10-version)
637 (hash (base32 "00ac9gzidby7b82s2prq4c3w99a077f5li4v4yq8gdg3zqjpd1g6")))
638 (make-linux-libre-source version
639 (%upstream-linux-source version hash)
640 deblob-scripts-5.10)))
641
642(define %boot-logo-patch
643 ;; Linux-Libre boot logo featuring Freedo and a gnu.
644 (origin
645 (method url-fetch)
646 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
647 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
648 (sha256
649 (base32
650 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
651
652(define %linux-libre-arm-export-__sync_icache_dcache-patch
653 (origin
654 (method url-fetch)
655 (uri (string-append
656 "https://salsa.debian.org/kernel-team/linux"
657 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
658 "/debian/patches/bugfix/arm/"
659 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
660 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
661 (sha256
662 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
663
664(define (source-with-patches source patches)
665 (origin
666 (inherit source)
667 (patches (append (origin-patches source)
668 patches))))
669
670(define-public linux-libre-6.19-source
671 (source-with-patches linux-libre-6.19-pristine-source
672 (list %boot-logo-patch
673 %linux-libre-arm-export-__sync_icache_dcache-patch)))
674
675(define-public linux-libre-6.18-source
676 (source-with-patches linux-libre-6.18-pristine-source
677 (list %boot-logo-patch
678 %linux-libre-arm-export-__sync_icache_dcache-patch)))
679
680(define-public linux-libre-6.12-source
681 (source-with-patches linux-libre-6.12-pristine-source
682 (list %boot-logo-patch
683 %linux-libre-arm-export-__sync_icache_dcache-patch)))
684
685(define-public linux-libre-6.6-source
686 (source-with-patches linux-libre-6.6-pristine-source
687 (list %boot-logo-patch
688 %linux-libre-arm-export-__sync_icache_dcache-patch)))
689
690(define-public linux-libre-6.1-source
691 (source-with-patches linux-libre-6.1-pristine-source
692 (append
693 (list %boot-logo-patch
694 %linux-libre-arm-export-__sync_icache_dcache-patch)
695 (search-patches
696 "linux-libre-infodocs-target.patch"))))
697
698(define-public linux-libre-5.15-source
699 (source-with-patches linux-libre-5.15-pristine-source
700 (list %boot-logo-patch
701 %linux-libre-arm-export-__sync_icache_dcache-patch)))
702
703(define-public linux-libre-5.10-source
704 (source-with-patches linux-libre-5.10-pristine-source
705 (list %boot-logo-patch
706 %linux-libre-arm-export-__sync_icache_dcache-patch)))
707
708
709;;;
710;;; Kernel headers.
711;;;
712
713(define %linux-libre-timeout-properties
714 ;; Package properties for 'linux-libre' and 'linux-libre-headers' packages.
715 `((timeout . ,(* 8 3600)) ;deblob takes >5h on AArch64
716 (max-silent-time . ,(* 3 3600)))) ;don't time out on blob scan
717
718(define (make-linux-libre-headers version gnu-revision hash-string)
719 (make-linux-libre-headers* version gnu-revision
720 (origin
721 (method url-fetch)
722 (uri (linux-libre-urls version gnu-revision))
723 (sha256 (base32 hash-string)))))
724
725(define (make-linux-libre-headers* version gnu-revision source)
726 (package
727 (name "linux-libre-headers")
728 (version version)
729 (source source)
730 (build-system gnu-build-system)
731 (native-inputs `(("perl" ,perl)
732 ,@(if (version>=? version "4.16")
733 `(("flex" ,flex)
734 ("bison" ,bison))
735 '())))
736 (arguments
737 `(#:modules ((guix build gnu-build-system)
738 (guix build utils)
739 (srfi srfi-1)
740 (ice-9 match))
741 #:phases
742 (modify-phases %standard-phases
743 (delete 'configure)
744 (replace 'build
745 (lambda _
746 (let ((arch ,(platform-linux-architecture
747 (lookup-platform-by-target-or-system
748 (or (%current-target-system)
749 (%current-system)))))
750 (defconfig ,(system->defconfig
751 (or (%current-target-system)
752 (%current-system))))
753 (make-target ,(if (version>=? version "5.3")
754 "headers"
755 "headers_check")))
756 (setenv "ARCH" arch)
757 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
758 (invoke "make" defconfig)
759 (invoke "make" "mrproper" make-target))))
760 (replace 'install
761 (lambda* (#:key outputs #:allow-other-keys)
762 (let ((out (assoc-ref outputs "out")))
763
764 ;; Mimic the quiet_cmd_headers_install target to avoid a
765 ;; dependency on rsync.
766 (for-each (lambda (file)
767 (let ((destination (string-append
768 out "/include/"
769 ;; Drop the 'usr/include' prefix.
770 (match (string-split file #\/)
771 ((_ _ path ...)
772 (string-join path "/"))))))
773 (format #t "`~a' -> `~a'~%" file destination)
774 (install-file file (dirname destination))))
775 (find-files "usr/include" "\\.h$"))
776
777 (mkdir (string-append out "/include/config"))
778 (call-with-output-file
779 (string-append out
780 "/include/config/kernel.release")
781 (lambda (p)
782 (format p "~a-default~%" ,version)))))))
783 #:allowed-references ()
784 #:tests? #f))
785 (supported-systems (remove target-hurd? %supported-systems))
786 (properties %linux-libre-timeout-properties)
787 (home-page "https://www.gnu.org/software/linux-libre/")
788 (synopsis "GNU Linux-Libre kernel headers")
789 (description "Headers of the Linux-Libre kernel.")
790 (license license:gpl2)))
791
792(define-public linux-libre-headers-6.19
793 (make-linux-libre-headers* linux-libre-6.19-version
794 linux-libre-6.19-gnu-revision
795 linux-libre-6.19-source))
796
797(define-public linux-libre-headers-6.18
798 (make-linux-libre-headers* linux-libre-6.18-version
799 linux-libre-6.18-gnu-revision
800 linux-libre-6.18-source))
801
802(define-public linux-libre-headers-6.12
803 (make-linux-libre-headers* linux-libre-6.12-version
804 linux-libre-6.12-gnu-revision
805 linux-libre-6.12-source))
806
807(define-public linux-libre-headers-6.6
808 (make-linux-libre-headers* linux-libre-6.6-version
809 linux-libre-6.6-gnu-revision
810 linux-libre-6.6-source))
811
812(define-public linux-libre-headers-6.1
813 (make-linux-libre-headers* linux-libre-6.1-version
814 linux-libre-6.1-gnu-revision
815 linux-libre-6.1-source))
816
817(define-public linux-libre-headers-5.15
818 (make-linux-libre-headers* linux-libre-5.15-version
819 linux-libre-5.15-gnu-revision
820 linux-libre-5.15-source))
821
822(define-public linux-libre-headers-5.10
823 (make-linux-libre-headers* linux-libre-5.10-version
824 linux-libre-5.10-gnu-revision
825 linux-libre-5.10-source))
826
827;; The following package is used in the early bootstrap, and thus must be kept
828;; stable and with minimal build requirements.
829(define-public linux-libre-headers-6.12.17
830 (make-linux-libre-headers "6.12.17" "gnu"
831 "1j3iyivh8h9abryjqksf4k51wgwnwqy2l3zsc019bm84xmka38xm"))
832
833(define-public linux-libre-headers linux-libre-headers-6.12.17)
834;; linux-libre-headers-latest points to the latest headers package
835;; and should be used as a dependency for packages that depend on
836;; the headers.
837(define-public linux-libre-headers-latest linux-libre-headers-6.19)
838
839
840;;;
841;;; Kernel configurations.
842;;;
843
844(define* (kernel-config arch #:key variant)
845 "Return a file-like object of the Linux-Libre build configuration file for
846ARCH and optionally VARIANT, or #f if there is no such configuration."
847 (let* ((name (string-append (if variant (string-append variant "-") "")
848 (if (string=? "i386" arch) "i686" arch) ".conf"))
849 (file (string-append "linux-libre/" name))
850 (config (search-auxiliary-file file)))
851 (and config (local-file config))))
852
853(define (default-extra-linux-options version)
854 `(;; Make the kernel config available at /proc/config.gz
855 ("CONFIG_IKCONFIG" . #t)
856 ("CONFIG_IKCONFIG_PROC" . #t)
857 ;; Debugging options.
858 ("CONFIG_DEBUG_INFO" . #t) ;required by BTF
859 ,@(if (version>=? version "5.1")
860 '(("CONFIG_DEBUG_INFO_BTF" . #t))
861 '())
862 ,@(if (version>=? version "5.12")
863 '(("CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT" . #t))
864 '())
865 ("CONFIG_DEBUG_INFO_REDUCED" . #f) ;incompatible with BTF
866 ;; Tracing and related options.
867 ,@(if (version>=? version "5.1")
868 '(("CONFIG_BPF_JIT" . #t)
869 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
870 ("CONFIG_BPF_SYSCALL" . #t))
871 '())
872 ,@(if (version>=? version "5.13")
873 '(("CONFIG_BPF_UNPRIV_DEFAULT_OFF" . #t))
874 '())
875 ("CONFIG_NET_CLS_BPF" . m) ;classify packets based on BPF filters
876 ("CONFIG_NET_ACT_BPF" . m) ;to execute BPF code on packets
877 ;; Compress kernel modules via Zstd.
878 ,(if (version>=? version "5.13")
879 '("CONFIG_MODULE_COMPRESS_ZSTD" . #t)
880 '("CONFIG_MODULE_COMPRESS_GZIP" . #t))
881 ;; Some very mild hardening.
882 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
883 ;; All kernels should have NAMESPACES options enabled
884 ("CONFIG_NAMESPACES" . #t)
885 ("CONFIG_UTS_NS" . #t)
886 ("CONFIG_IPC_NS" . #t)
887 ("CONFIG_USER_NS" . #t)
888 ("CONFIG_PID_NS" . #t)
889 ("CONFIG_NET_NS" . #t)
890 ;; Various options needed for elogind service:
891 ;; https://issues.guix.gnu.org/43078
892 ("CONFIG_CGROUP_FREEZER" . #t)
893 ("CONFIG_BLK_CGROUP" . #t)
894 ("CONFIG_CGROUP_WRITEBACK" . #t)
895 ("CONFIG_CGROUP_SCHED" . #t)
896 ("CONFIG_CGROUP_PIDS" . #t)
897 ("CONFIG_CGROUP_FREEZER" . #t)
898 ("CONFIG_CGROUP_DEVICE" . #t)
899 ("CONFIG_CGROUP_CPUACCT" . #t)
900 ("CONFIG_CGROUP_PERF" . #t)
901 ("CONFIG_SOCK_CGROUP_DATA" . #t)
902 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
903 ("CONFIG_CGROUP_NET_PRIO" . #t)
904 ("CONFIG_CGROUP_NET_CLASSID" . #t)
905 ("CONFIG_MEMCG" . #t)
906 ("CONFIG_MEMCG_SWAP" . #t)
907 ("CONFIG_MEMCG_KMEM" . #t)
908 ("CONFIG_CPUSETS" . #t)
909 ("CONFIG_PROC_PID_CPUSET" . #t)
910 ;; Allow disk encryption by default
911 ("CONFIG_DM_CRYPT" . m)
912 ;; Allow fscrypt filesystem encryption by default
913 ("CONFIG_FS_ENCRYPTION" . #t)
914 ;; Support zram on all kernel configs
915 ("CONFIG_ZSWAP" . #t)
916 ("CONFIG_ZSMALLOC" . #t)
917 ("CONFIG_ZRAM" . m)
918 ;; Accessibility support.
919 ("CONFIG_ACCESSIBILITY" . #t)
920 ("CONFIG_A11Y_BRAILLE_CONSOLE" . #t)
921 ("CONFIG_SPEAKUP" . m)
922 ("CONFIG_SPEAKUP_SYNTH_SOFT" . m)
923 ;; Modules required for initrd:
924 ("CONFIG_NET_9P" . m)
925 ("CONFIG_NET_9P_VIRTIO" . m)
926 ("CONFIG_VIRTIO_BLK" . m)
927 ("CONFIG_VIRTIO_NET" . m)
928 ("CONFIG_VIRTIO_PCI" . m)
929 ("CONFIG_VIRTIO_BALLOON" . m)
930 ("CONFIG_VIRTIO_MMIO" . m)
931 ("CONFIG_FUSE_FS" . m)
932 ("CONFIG_CIFS" . m)
933 ("CONFIG_9P_FS" . m)
934 ;; Disable the EFI pstore storage backend to avoid causing
935 ;; unrecoverable failures on some EFI systems:
936 ;; https://lists.gnu.org/archive/html/help-guix/2025-01/msg00173.html
937 ("CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE" . #t)))
938
939(define (config->string options)
940 (string-join (map (match-lambda
941 ((option . 'm)
942 (string-append option "=m"))
943 ((option . #t)
944 (string-append option "=y"))
945 ((option . #f)
946 (string-append option "=n"))
947 ((option . string)
948 (string-append option "=\"" string "\"")))
949 options)
950 "\n"))
951
952
953;;;
954;;; Kernel package utilities.
955;;;
956
957(define (apply-infodoc-patch? version)
958 ;; Versions older than 5.10 have different enough build scripts that the
959 ;; infodocs patch doesn't apply.
960 (and (version>=? version "5.10")
961 (not (version>=? version "6.2")))) ;patch applied upstream
962
963
964(define* (make-linux-libre version gnu-revision hash-string supported-systems
965 #:key
966 (extra-version #f)
967 ;; A function that takes an arch and a variant, and
968 ;; return a file-like object. See kernel-config
969 ;; for an example.
970 (configuration-file #f)
971 (defconfig "defconfig")
972 (extra-options (default-extra-linux-options version))
973 (patches
974 `(,%boot-logo-patch
975 ,@(if (apply-infodoc-patch? version)
976 (list (search-patch
977 "linux-libre-infodocs-target.patch"))
978 '()))))
979 (make-linux-libre* version gnu-revision
980 (origin
981 (method url-fetch)
982 (uri (linux-libre-urls version gnu-revision))
983 (sha256 (base32 hash-string))
984 (patches patches))
985 supported-systems
986 #:extra-version extra-version
987 #:configuration-file configuration-file
988 #:defconfig defconfig
989 #:extra-options extra-options))
990
991(define* (make-linux-libre* version gnu-revision source supported-systems
992 #:key
993 (extra-version #f)
994 ;; A function that takes an arch and a variant.
995 ;; See kernel-config for an example.
996 (configuration-file #f)
997 (defconfig "defconfig")
998 (extra-options (default-extra-linux-options version)))
999 (package
1000 (name (if extra-version
1001 (string-append "linux-libre-" extra-version)
1002 "linux-libre"))
1003 (version version)
1004 (source source)
1005 (supported-systems supported-systems)
1006 (build-system gnu-build-system)
1007 (arguments
1008 (list
1009 #:modules '((guix build gnu-build-system)
1010 (guix build utils)
1011 (srfi srfi-1)
1012 (srfi srfi-26)
1013 (ice-9 ftw)
1014 (ice-9 match))
1015 #:tests? #f
1016 #:phases
1017 #~(modify-phases %standard-phases
1018 (add-after 'unpack 'patch-/bin/pwd
1019 (lambda _
1020 (substitute* (find-files
1021 "." "^Makefile(\\.include)?$")
1022 (("/bin/pwd") "pwd"))))
1023 (add-before 'configure 'set-environment
1024 (lambda* (#:key target #:allow-other-keys)
1025 ;; Avoid introducing timestamps.
1026 (setenv "KCONFIG_NOTIMESTAMP" "1")
1027 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
1028
1029 ;; Other variables useful for reproducibility.
1030 (setenv "KBUILD_BUILD_VERSION" "1")
1031 (setenv "KBUILD_BUILD_USER" "guix")
1032 (setenv "KBUILD_BUILD_HOST" "guix")
1033
1034 ;; Set ARCH and CROSS_COMPILE.
1035 (let ((arch #$(platform-linux-architecture
1036 (lookup-platform-by-target-or-system
1037 (or (%current-target-system)
1038 (%current-system))))))
1039 (setenv "ARCH" arch)
1040 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
1041 (when target
1042 (setenv "CROSS_COMPILE" (string-append target "-"))
1043 (format #t "`CROSS_COMPILE' set to `~a'~%"
1044 (getenv "CROSS_COMPILE"))))
1045
1046 ;; Allow EXTRAVERSION to be set via the environment.
1047 (substitute* "Makefile"
1048 (("^ *EXTRAVERSION[[:blank:]]*=")
1049 "EXTRAVERSION ?="))
1050 (setenv "EXTRAVERSION"
1051 #$(and extra-version
1052 (string-append "-" extra-version)))
1053 ;; Use the maximum compression available for Zstd-compressed
1054 ;; modules.
1055 (setenv "ZSTD_CLEVEL" "19")))
1056 (replace 'configure
1057 (lambda _
1058 (let ((config
1059 #$(match (let ((arch (platform-linux-architecture
1060 (lookup-platform-by-target-or-system
1061 (or (%current-target-system)
1062 (%current-system))))))
1063 (and configuration-file arch
1064 (configuration-file
1065 arch
1066 #:variant (version-major+minor version))))
1067 (#f ;no config for this platform
1068 #f)
1069 ((? file-like? config)
1070 config))))
1071 ;; Use a custom kernel configuration file or a default
1072 ;; configuration file.
1073 (if config
1074 (begin
1075 (copy-file config ".config")
1076 (chmod ".config" #o666))
1077 (invoke "make" #$defconfig))
1078 ;; Appending works even when the option wasn't in the file.
1079 ;; The last one prevails if duplicated.
1080 (let ((port (open-file ".config" "a"))
1081 (extra-configuration #$(config->string extra-options)))
1082 (display extra-configuration port)
1083 (close-port port))
1084 (invoke "make" "oldconfig"))))
1085 (replace 'install
1086 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1087 (let ((moddir (string-append #$output "/lib/modules"))
1088 (dtbdir (string-append #$output "/lib/dtbs"))
1089 (make-flags
1090 (append make-flags
1091 (list "-j"
1092 (if parallel-build?
1093 (number->string (parallel-job-count))
1094 "1")))))
1095 ;; Install kernel image, kernel configuration and link map.
1096 (for-each (lambda (file) (install-file file #$output))
1097 (find-files "." "^(\\.config|bzImage|zImage|Image\
1098|vmlinuz|System\\.map|Module\\.symvers)$"))
1099 ;; Install device tree files
1100 (unless (null? (find-files "." "\\.dtb$"))
1101 (mkdir-p dtbdir)
1102 (apply invoke "make"
1103 (string-append "INSTALL_DTBS_PATH=" dtbdir)
1104 "dtbs_install" make-flags))
1105 ;; Install kernel modules
1106 (mkdir-p moddir)
1107 (apply invoke "make"
1108 ;; Disable depmod because the Guix system's module
1109 ;; directory is an union of potentially multiple
1110 ;; packages. It is not possible to use depmod to
1111 ;; usefully calculate a dependency graph while building
1112 ;; only one of them.
1113 "DEPMOD=true"
1114 (string-append "MODULE_DIR=" moddir)
1115 (string-append "INSTALL_PATH=" #$output)
1116 (string-append "INSTALL_MOD_PATH=" #$output)
1117 "INSTALL_MOD_STRIP=1"
1118 "modules_install" make-flags)
1119 (let* ((versions (filter (lambda (name)
1120 (not (string-prefix? "." name)))
1121 (scandir moddir)))
1122 (version (match versions
1123 ((x) x))))
1124 ;; There are symlinks to the build and source directory.
1125 ;; Both will point to target /tmp/guix-build* and thus not
1126 ;; be useful in a profile. Delete the symlinks.
1127 (false-if-file-not-found
1128 (delete-file
1129 (string-append moddir "/" version "/build")))
1130 (false-if-file-not-found
1131 (delete-file
1132 (string-append moddir "/" version "/source"))))))))))
1133 (native-inputs
1134 (list perl
1135 bc
1136 openssl
1137 elfutils ;needed to enable CONFIG_STACK_VALIDATION
1138 flex
1139 bison
1140 util-linux ;needed for hexdump
1141 ;; These are needed to compile the GCC plugins.
1142 gmp
1143 mpfr
1144 mpc
1145 ;; These are needed when building with the CONFIG_DEBUG_INFO_BTF
1146 ;; support.
1147 dwarves ;for pahole
1148 python-wrapper
1149 zlib
1150 ;; For Zstd compression of kernel modules.
1151 zstd))
1152 (home-page "https://www.gnu.org/software/linux-libre/")
1153 (synopsis "100% free redistribution of a cleaned Linux kernel")
1154 (description "GNU Linux-Libre is a free (as in freedom) variant of the
1155Linux kernel. It has been modified to remove all non-free binary blobs.")
1156 (license license:gpl2)
1157 (properties %linux-libre-timeout-properties)))
1158
1159
1160;;;
1161;;; Generic kernel packages.
1162;;;
1163
1164(define-public linux-libre-6.19
1165 (make-linux-libre* linux-libre-6.19-version
1166 linux-libre-6.19-gnu-revision
1167 linux-libre-6.19-source
1168 '("x86_64-linux" "i686-linux" "armhf-linux"
1169 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1170 #:configuration-file kernel-config))
1171
1172(define-public linux-libre-6.18
1173 (make-linux-libre* linux-libre-6.18-version
1174 linux-libre-6.18-gnu-revision
1175 linux-libre-6.18-source
1176 '("x86_64-linux" "i686-linux" "armhf-linux"
1177 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1178 #:configuration-file kernel-config))
1179
1180(define-public linux-libre-version linux-libre-6.18-version)
1181(define-public linux-libre-gnu-revision linux-libre-6.18-gnu-revision)
1182(define-public linux-libre-pristine-source linux-libre-6.18-pristine-source)
1183(define-public linux-libre-source linux-libre-6.18-source)
1184(define-public linux-libre linux-libre-6.18)
1185
1186(define-public linux-libre-6.12
1187 (make-linux-libre* linux-libre-6.12-version
1188 linux-libre-6.12-gnu-revision
1189 linux-libre-6.12-source
1190 '("x86_64-linux" "i686-linux" "armhf-linux"
1191 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1192 #:configuration-file kernel-config))
1193
1194(define-public linux-libre-6.6
1195 (make-linux-libre* linux-libre-6.6-version
1196 linux-libre-6.6-gnu-revision
1197 linux-libre-6.6-source
1198 '("x86_64-linux" "i686-linux" "armhf-linux"
1199 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1200 #:configuration-file kernel-config))
1201
1202(define-public linux-libre-6.1
1203 (make-linux-libre* linux-libre-6.1-version
1204 linux-libre-6.1-gnu-revision
1205 linux-libre-6.1-source
1206 '("x86_64-linux" "i686-linux" "armhf-linux"
1207 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1208 #:configuration-file kernel-config))
1209
1210(define-public linux-libre-5.15
1211 (make-linux-libre* linux-libre-5.15-version
1212 linux-libre-5.15-gnu-revision
1213 linux-libre-5.15-source
1214 '("x86_64-linux" "i686-linux" "armhf-linux"
1215 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1216 #:configuration-file kernel-config))
1217
1218(define-public linux-libre-5.10
1219 (make-linux-libre* linux-libre-5.10-version
1220 linux-libre-5.10-gnu-revision
1221 linux-libre-5.10-source
1222 '("x86_64-linux" "i686-linux" "armhf-linux"
1223 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1224 #:configuration-file kernel-config))
1225
1226;; Linux-Libre-LTS points to the *newest* released long-term support version of
1227;; Linux-Libre.
1228;; Reference: <https://www.kernel.org/category/releases.html>
1229
1230(define-public linux-libre-lts-version linux-libre-6.18-version)
1231(define-public linux-libre-lts-gnu-revision linux-libre-6.18-gnu-revision)
1232(define-public linux-libre-lts-pristine-source linux-libre-6.18-pristine-source)
1233(define-public linux-libre-lts-source linux-libre-6.18-source)
1234(define-public linux-libre-lts linux-libre-6.18)
1235
1236
1237;;;
1238;;; Specialized kernel variants.
1239;;;
1240
1241(define-public %dummy-linux-kernel-for-container
1242 (hidden-package
1243 (package
1244 (name "linux-dummy")
1245 (version "0.0.0")
1246 (source #f)
1247 (build-system copy-build-system)
1248 (arguments
1249 (list #:phases
1250 #~(modify-phases %standard-phases
1251 (delete 'unpack)
1252 (replace 'install
1253 (lambda _
1254 (mkdir-p #$output))))))
1255 (home-page "")
1256 (synopsis "Dummy Linux kernel for @command{guix system container}")
1257 (description "")
1258 (license #f))))
1259
1260(define-public linux-libre-arm-generic
1261 (make-linux-libre* linux-libre-version
1262 linux-libre-gnu-revision
1263 linux-libre-source
1264 '("armhf-linux")
1265 #:defconfig "multi_v7_defconfig"
1266 #:extra-version "arm-generic"
1267 #:extra-options
1268 (append
1269 `(;; needed to fix the RTC on rockchip platforms
1270 ("CONFIG_RTC_DRV_RK808" . #t))
1271 (default-extra-linux-options linux-libre-version))))
1272
1273(define-public linux-libre-arm-generic-5.10
1274 (make-linux-libre* linux-libre-5.10-version
1275 linux-libre-5.10-gnu-revision
1276 linux-libre-5.10-source
1277 '("armhf-linux")
1278 #:defconfig "multi_v7_defconfig"
1279 #:extra-version "arm-generic"
1280 #:extra-options
1281 (append
1282 `(;; needed to fix the RTC on rockchip platforms
1283 ("CONFIG_RTC_DRV_RK808" . #t))
1284 (default-extra-linux-options linux-libre-5.10-version))))
1285
1286(define-public linux-libre-arm-omap2plus
1287 (make-linux-libre* linux-libre-version
1288 linux-libre-gnu-revision
1289 linux-libre-source
1290 '("armhf-linux")
1291 #:defconfig "omap2plus_defconfig"
1292 #:extra-version "arm-omap2plus"))
1293
1294(define-public linux-libre-arm64-generic
1295 (make-linux-libre* linux-libre-version
1296 linux-libre-gnu-revision
1297 linux-libre-source
1298 '("aarch64-linux")
1299 #:defconfig "defconfig"
1300 #:extra-version "arm64-generic"
1301 #:extra-options
1302 (append
1303 `(;; Provide support for ath9k wireless
1304 ("CONFIG_ATH9K_HTC" . m)
1305 ;; Support Orange Pi R1 Plus LTS ethernet PHY.
1306 ("CONFIG_MOTORCOMM_PHY" . m)
1307 ;; needed to fix the RTC on rockchip platforms
1308 ("CONFIG_RTC_DRV_RK808" . #t)
1309 ;; Pinebook display, battery, charger and usb
1310 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1311 ("CONFIG_CHARGER_AXP20X" . m)
1312 ("CONFIG_INPUT_AXP20X_PEK" . m)
1313 ("CONFIG_CHARGER_AXP20X" . m)
1314 ("CONFIG_BATTERY_AXP20X" . m)
1315 ("CONFIG_PINCTRL_AXP209" . m)
1316 ("CONFIG_AXP20X_POWER" . m)
1317 ("CONFIG_AXP20X_ADC" . m)
1318 ;; Pinebook PRO battery and sound support
1319 ("CONFIG_BATTERY_CW2015" . m)
1320 ("CONFIG_CHARGER_GPIO" . m)
1321 ("CONFIG_SND_SOC_ES8316" . m))
1322 (default-extra-linux-options linux-libre-version))))
1323
1324(define-public linux-libre-lts-arm64-generic
1325 (if (string=? linux-libre-lts-version linux-libre-version)
1326
1327 ;; Make it a strict alias so that the user interface does not see two
1328 ;; packages with the exact same name and version.
1329 linux-libre-arm64-generic
1330
1331 (make-linux-libre* linux-libre-lts-version
1332 linux-libre-lts-gnu-revision
1333 linux-libre-lts-source
1334 '("aarch64-linux")
1335 #:defconfig "defconfig"
1336 #:extra-version "arm64-generic"
1337 #:extra-options
1338 (append
1339 `( ;; Provide support for ath9k wireless
1340 ("CONFIG_ATH9K_HTC" . m)
1341 ;; Support Orange Pi R1 Plus LTS ethernet PHY.
1342 ("CONFIG_MOTORCOMM_PHY" . m)
1343 ;; needed to fix the RTC on rockchip platforms
1344 ("CONFIG_RTC_DRV_RK808" . #t)
1345 ;; Pinebook display, battery, charger and usb
1346 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1347 ("CONFIG_CHARGER_AXP20X" . m)
1348 ("CONFIG_INPUT_AXP20X_PEK" . m)
1349 ("CONFIG_CHARGER_AXP20X" . m)
1350 ("CONFIG_BATTERY_AXP20X" . m)
1351 ("CONFIG_PINCTRL_AXP209" . m)
1352 ("CONFIG_AXP20X_POWER" . m)
1353 ("CONFIG_AXP20X_ADC" . m)
1354 ;; Pinebook PRO battery and sound support
1355 ("CONFIG_BATTERY_CW2015" . m)
1356 ("CONFIG_CHARGER_GPIO" . m)
1357 ("CONFIG_SND_SOC_ES8316" . m))
1358 (default-extra-linux-options linux-libre-lts-version)))))
1359
1360(define-public linux-libre-arm64-generic-5.10
1361 (make-linux-libre* linux-libre-5.10-version
1362 linux-libre-5.10-gnu-revision
1363 linux-libre-5.10-source
1364 '("aarch64-linux")
1365 #:defconfig "defconfig"
1366 #:extra-version "arm64-generic"
1367 #:extra-options
1368 (append
1369 `(;; needed to fix the RTC on rockchip platforms
1370 ("CONFIG_RTC_DRV_RK808" . #t)
1371 ;; Pinebook display, battery, charger and usb
1372 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1373 ("CONFIG_CHARGER_AXP20X" . m)
1374 ("CONFIG_INPUT_AXP20X_PEK" . m)
1375 ("CONFIG_CHARGER_AXP20X" . m)
1376 ("CONFIG_BATTERY_AXP20X" . m)
1377 ("CONFIG_PINCTRL_AXP209" . m)
1378 ("CONFIG_AXP20X_POWER" . m)
1379 ("CONFIG_AXP20X_ADC" . m)
1380 ;; Pinebook PRO battery and sound support
1381 ("CONFIG_BATTERY_CW2015" . m)
1382 ("CONFIG_CHARGER_GPIO" . m)
1383 ("CONFIG_SND_SOC_ES8316" . m))
1384 (default-extra-linux-options linux-libre-5.10-version))))
1385
1386(define-public linux-libre-arm64-honeycomb
1387 ;; Kernel for use on the HoneyComb LX2 boards:
1388 ;; <https://shop.solid-run.com/product/SRCFTXE000IV13/>.
1389 (make-linux-libre* linux-libre-lts-version
1390 linux-libre-lts-gnu-revision
1391 linux-libre-lts-source
1392 '("aarch64-linux")
1393 #:extra-version "arm64-honeycomb"
1394 #:extra-options
1395 ;; See
1396 ;; https://github.com/SolidRun/lx2160a_build/blob/master/configs/linux/lx2k_additions.config
1397 (append
1398 `(("CONFIG_GPIO_SYSFS" . #true)
1399 ("CONFIG_GPIO_MPC8XXX" . #true)
1400 ("CONFIG_NET_PKTGEN" . #true)
1401 ("CONFIG_USB_SERIAL" . #true)
1402 ("CONFIG_USB_SERIAL_CONSOLE" . #true)
1403 ("CONFIG_USB_SERIAL_GENERIC" . #true)
1404 ("CONFIG_USB_SERIAL_SIMPLE" . #true)
1405 ("CONFIG_USB_SERIAL_FTDI_SIO" . #true)
1406 ("CONFIG_USB_ACM" . #true)
1407 ("CONFIG_USB_NET_DRIVERS" . #true)
1408 ("CONFIG_USB_USBNET" . #true)
1409 ("CONFIG_USB_NET_CDCETHER" . #true)
1410 ("CONFIG_USB_NET_CDC_NCM" . #true)
1411 ("CONFIG_USB_NET_NET1080" . #true)
1412 ("CONFIG_USB_NET_CDC_SUBSET_ENABLE" . #true)
1413 ("CONFIG_USB_NET_CDC_SUBSET" . #true)
1414 ("CONFIG_USB_ARMLINUX" . #true)
1415 ("CONFIG_BLK_DEV_NVME" . #true)
1416 ("CONFIG_NVMEM_BCM_OCOTP" . #true)
1417 ("CONFIG_DRM_AMDGPU" . #true)
1418 ("CONFIG_DRM_AMDGPU_SI" . #true)
1419 ("CONFIG_DRM_AMDGPU_CIK" . #true)
1420 ("CONFIG_DRM_AMDGPU_USERPTR" . #true)
1421 ("CONFIG_DRM_AMD_DC" . #true)
1422 ("CONFIG_CHASH" . #true)
1423 ("CONFIG_PMBUS" . #true)
1424 ("CONFIG_SENSORS_PMBUS" . #true)
1425 ("CONFIG_REGULATOR" . #true)
1426 ("CONFIG_REGULATOR_FIXED_VOLTAGE" . #true)
1427 ("CONFIG_REGULATOR_PWM" . #true)
1428 ("CONFIG_SENSORS_AMC6821" . #true)
1429 ("CONFIG_SENSORS_LM90" . #true)
1430 ("CONFIG_SENSORS_LTC2978" . #true)
1431 ("CONFIG_SENSORS_LTC2978_REGULATOR" . #true)
1432 ("CONFIG_TMPFS" . #true)
1433 ("CONFIG_TMPFS_POSIX_ACL" . #true)
1434 ("CONFIG_TMPFS_XATTR" . #true)
1435 ;;("CONFIG_BLK_DEV_RAM_SIZE" . 524288)
1436 ("CONFIG_POWER_RESET_GPIO" . #true)
1437 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1438 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1439 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1440 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1441
1442 ;; Fixes https://codeberg.org/guix/guix/issues/101
1443 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1444
1445 ;; For connecting to ci.guix.gnu.org over VPN.
1446 ("CONFIG_WIREGUARD" . m)
1447
1448 ;; restool support
1449 ("CONFIG_FSL_MC_UAPI_SUPPORT" . #t)
1450 ("CONFIG_FSL_MC_BUS" . #t)
1451 ("CONFIG_VFIO_FSL_MC" . #t)
1452 ("CONFIG_FSL_MC_DPIO" . #t)
1453 ("CONFIG_ARM_GIC_V3_ITS_FSL_MC" . #t)
1454
1455 ;; vsockets support
1456 ;; TODO This seems to be enabled by default on other
1457 ;; architectures?
1458 ("CONFIG_VSOCKETS" . m)
1459 ("CONFIG_VSOCKETS_DIAG" . m)
1460 ("CONFIG_VSOCKETS_LOOPBACK" . m)
1461 ("CONFIG_VMWARE_VMCI_VSOCKETS" . m)
1462 ("CONFIG_VIRTIO_VSOCKETS" . m)
1463 ("CONFIG_VIRTIO_VSOCKETS_COMMON" . m)
1464 ("CONFIG_HYPERV_VSOCKETS" . m)
1465 ("CONFIG_VHOST_IOTLB" . m)
1466 ("CONFIG_VHOST_RING" . m)
1467 ("CONFIG_VHOST_TASK" . #true)
1468 ("CONFIG_VHOST" . m)
1469 ("CONFIG_VHOST_MENU" . #true)
1470 ("CONFIG_VHOST_NET" . m)
1471 ("CONFIG_VHOST_SCSI" . m)
1472 ("CONFIG_VHOST_VSOCK" . m)
1473 ("CONFIG_VHOST_VDPA" . m))
1474 (default-extra-linux-options linux-libre-lts-version))))
1475
1476(define-public reform-debian-packages-for-6.18
1477 (package
1478 (name "reform-debian-packages")
1479 (version "2023-07-10-525-g7e8a95c") ;from git describe
1480 (source
1481 (origin
1482 (method git-fetch)
1483 (uri (git-reference
1484 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1485 (commit "7e8a95c7babd9e1f4b307b6d146e0846c65fc9b8")))
1486 (file-name (git-file-name name version))
1487 (sha256
1488 (base32 "0g7lm7bfsjn6y77i1gk6wgpmghd36s3axqdqr1ahl9vhzw03cx0g"))))
1489 (build-system copy-build-system)
1490 (arguments
1491 (list
1492 #:install-plan
1493 #~'(("linux/patches6.18/" "/patches6.18")
1494 ("linux/" "/dts/amlogic"
1495 #:include-regexp ("meson.*\\.dts$"))
1496 ("linux/" "/dts/freescale"
1497 #:include-regexp ("imx8.*\\.dts$"))
1498 ("linux/" "/dts/freescale"
1499 #:include-regexp ("fsl.*\\.dts$"))
1500 ("linux/" "/dts/rockchip"
1501 #:include-regexp ("rk3588.*\\.dts$"))
1502 ("linux/config" "config"))))
1503 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1504 (synopsis
1505 "Linux kernel patches and device-trees used for MNT Reform systems")
1506 (description
1507 "Linux kernel patches and device-trees used for the MNT Reform systems")
1508 (license (list
1509 (license:fsf-free "file://filter-output"
1510 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1511 license:bsd-2
1512 license:expat
1513 license:gpl2
1514 license:gpl2+
1515 license:gpl3
1516 license:x11))))
1517
1518(define-public reform-debian-packages-for-6.12
1519 (package
1520 (name "reform-debian-packages")
1521 (version "2023-07-10-320-gaf0a461") ;from git describe
1522 (source
1523 (origin
1524 (method git-fetch)
1525 (uri (git-reference
1526 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1527 (commit "af0a461d38e13481323f061d9ff6827d1d13873b")))
1528 (file-name (git-file-name name version))
1529 (sha256
1530 (base32 "1cylprld2ri3mprj5cgwla1l8qv9iqqvcra7h64yarzs49zaa16m"))))
1531 (build-system copy-build-system)
1532 (arguments
1533 (list
1534 #:install-plan
1535 #~'(("linux/patches6.12/" "/patches6.12")
1536 ("linux/" "/dts/amlogic"
1537 #:include-regexp ("meson.*\\.dts$"))
1538 ("linux/" "/dts/freescale"
1539 #:include-regexp ("imx8.*\\.dts$"))
1540 ("linux/" "/dts/freescale"
1541 #:include-regexp ("fsl.*\\.dts$"))
1542 ("linux/" "/dts/rockchip"
1543 #:include-regexp ("rk3588.*\\.dts$"))
1544 ("linux/config" "config"))))
1545 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1546 (synopsis
1547 "Linux kernel patches and device-trees used for MNT Reform systems")
1548 (description
1549 "Linux kernel patches and device-trees used for the MNT Reform systems")
1550 (license (list
1551 (license:fsf-free "file://filter-output"
1552 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1553 license:bsd-2
1554 license:expat
1555 license:gpl2
1556 license:gpl2+
1557 license:gpl3
1558 license:x11))))
1559
1560(define-public linux-libre-arm64-mnt-reform-6.18
1561 ;; Kernel for use on the MNT/Reform systems
1562 ;; https://mntre.com/reform.html
1563 (let ((base (make-linux-libre* linux-libre-6.18-version
1564 linux-libre-6.18-gnu-revision
1565 linux-libre-6.18-source
1566 '("aarch64-linux")
1567 #:extra-version "arm64-mnt-reform"
1568 #:extra-options
1569 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
1570 (append `(("CONFIG_DRM_LVDS_CODEC" . m)
1571 ("CONFIG_DRM_CDNS_MHDP8546" . m)
1572 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
1573 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
1574 ("CONFIG_DRM_IMX_DCSS" . m)
1575 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
1576 ("CONFIG_DRM_PANEL_LVDS" . m)
1577 ("CONFIG_I2C_IMX_LPI2C" . m)
1578 ("CONFIG_I2C_MUX_REG" . m)
1579 ("CONFIG_INTERCONNECT_IMX" . #true)
1580 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
1581 ("CONFIG_MFD_WM8994" . m)
1582 ("CONFIG_MUX_GPIO" . m)
1583 ("CONFIG_MUX_MMIO" . m)
1584 ("CONFIG_RTC_DRV_PCF8523" . m)
1585 ("CONFIG_USB_EHCI_FSL" . m)
1586 ("CONFIG_NO_HZ_IDLE" . #true)
1587 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
1588 ("CONFIG_SND_IMX_SOC" . m)
1589 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
1590 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
1591 ("CONFIG_SND_SOC_IMX_HDMI" . m)
1592 ("CONFIG_INPUT_JOYSTICK" . #true)
1593 ("CONFIG_JOYSTICK_XPAD" . m)
1594 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
1595 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
1596 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
1597 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
1598 ("CONFIG_DRM_IMX_LCDIF" . #true)
1599 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
1600 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
1601 ("CONFIG_IMX8MM_THERMAL" . #true)
1602 ("CONFIG_IMX2_WDT" . #true)
1603 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
1604 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
1605 ("CONFIG_DRM" . #true)
1606 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . #true)
1607 ("CONFIG_IMX8M_BLK_CTRL" . #true)
1608 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
1609 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
1610 ("CONFIG_DRM_FSL_LDB" . #true)
1611 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
1612 ("CONFIG_BACKLIGHT_PWM" . #true)
1613 ("CONFIG_BACKLIGHT_GPIO" . #true)
1614 ("CONFIG_BACKLIGHT_LED" . #true)
1615 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
1616 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
1617 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
1618 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
1619 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
1620 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
1621 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
1622 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
1623 ("CONFIG_IMX_IRQSTEER" . #true)
1624 ("CONFIG_PCI_MESON" . #true)
1625 ("CONFIG_DWMAC_MESON" . #true)
1626 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . #true)
1627 ("CONFIG_GPIO_ROCKCHIP" . #true)
1628 ("CONFIG_PL330_DMA" . #true)
1629 ("CONFIG_I2C_MESON" . #true)
1630 ("CONFIG_PWM_MESON" . #true)
1631 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
1632 ("CONFIG_MMC_MESON_GX" . #true)
1633 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
1634 ("CONFIG_MESON_DDR_PMU" . #true)
1635 ("CONFIG_RTW88_8822CS" . m)
1636 ("CONFIG_PWM_FSL_FTM" . #true)
1637 ("CONFIG_FSL_RCPM" . #true)
1638 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
1639 ("CONFIG_DRM_PANTHOR" . m)
1640 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
1641 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
1642 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
1643 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
1644 ("CONFIG_SPI_ROCKCHIP" . #true)
1645 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
1646 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
1647 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . #true)
1648 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
1649 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
1650 ("CONFIG_ROCKCHIP_DW_MIPI_DSI2" . #true)
1651 ;; Fixes https://codeberg.org/guix/guix/issues/101
1652 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1653 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1654 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1655 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1656 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1657 ;; nftables support
1658 ("CONFIG_NF_TABLES" . m)
1659 ("CONFIG_NF_TABLES_INET" . #true)
1660 ("CONFIG_NF_TABLES_NETDEV" . #true)
1661 ("CONFIG_NF_TABLES_IPV4" . #true)
1662 ("CONFIG_NF_TABLES_ARP" . #true)
1663 ("CONFIG_NF_TABLES_IPV6" . #true)
1664 ("CONFIG_NF_TABLES_BRIDGE" . m)
1665 ("CONFIG_NFT_NUMGEN" . m)
1666 ("CONFIG_NFT_CT" . m)
1667 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
1668 ("CONFIG_NFT_CONNLIMIT" . m)
1669 ("CONFIG_NFT_LOG" . m)
1670 ("CONFIG_NFT_LIMIT" . m)
1671 ("CONFIG_NFT_MASQ" . m)
1672 ("CONFIG_NFT_REDIR" . m)
1673 ("CONFIG_NFT_NAT" . m)
1674 ("CONFIG_NFT_TUNNEL" . m)
1675 ("CONFIG_NFT_QUEUE" . m)
1676 ("CONFIG_NFT_QUOTA" . m)
1677 ("CONFIG_NFT_REJECT" . m)
1678 ("CONFIG_NFT_REJECT_INET" . m)
1679 ("CONFIG_NFT_COMPAT" . m)
1680 ("CONFIG_NFT_HASH" . m)
1681 ("CONFIG_NFT_FIB" . m)
1682 ("CONFIG_NFT_FIB_INET" . m)
1683 ("CONFIG_NFT_XFRM" . m)
1684 ("CONFIG_NFT_SOCKET" . m)
1685 ("CONFIG_NFT_OSF" . m)
1686 ("CONFIG_NFT_TPROXY" . m)
1687 ("CONFIG_NFT_SYNPROXY" . m)
1688 ("CONFIG_NFT_DUP_NETDEV" . m)
1689 ("CONFIG_NFT_FWD_NETDEV" . m)
1690 ("CONFIG_NFT_FIB_NETDEV" . m)
1691 ("CONFIG_NFT_REJECT_NETDEV" . m)
1692 ("CONFIG_NFT_REJECT_IPV4" . m)
1693 ("CONFIG_NFT_DUP_IPV4" . m)
1694 ("CONFIG_NFT_FIB_IPV4" . m)
1695 ("CONFIG_NFT_COMPAT_ARP" . m)
1696 ("CONFIG_NFT_REJECT_IPV6" . m)
1697 ("CONFIG_NFT_DUP_IPV6" . m)
1698 ("CONFIG_NFT_FIB_IPV6" . m)
1699 ("CONFIG_NFT_BRIDGE_META" . m)
1700 ("CONFIG_NFT_BRIDGE_REJECT" . m)
1701 ;; Provide support for USB tethering
1702 ("CONFIG_USB_NET_CDC_EEM" . m)
1703 ("CONFIG_USB_NET_RNDIS_HOST" . m)
1704 ("CONFIG_USB_WDM" . m)
1705 ("CONFIG_USB_GADGET" . m)
1706 ("CONFIG_USB_ETH" . m)
1707 ("CONFIG_USB_ETH_RNDIS" . m)
1708 ("CONFIG_USB_ETH_EEM" . m)
1709 ("CONFIG_USB_G_NCM" . m)
1710 ;; Provide support for wireguard
1711 ("CONFIG_WIREGUARD" . m)
1712 ;; Provide support for ath9k wireless
1713 ("CONFIG_ATH9K" . m)
1714 ("CONFIG_ATH9K_HTC" . m))
1715 (default-extra-linux-options
1716 linux-libre-6.18-version)))))
1717 (package
1718 (inherit base)
1719 (inputs (list reform-debian-packages-for-6.18))
1720 (synopsis (string-append (package-synopsis base)
1721 " for MNT/Reform systems"))
1722 (description (string-append (package-description base)
1723 " Configuration options and patches have been applied for use with MNT/Reform systems."))
1724 (arguments
1725 (substitute-keyword-arguments (package-arguments base)
1726 ((#:phases phases)
1727 #~(modify-phases #$phases
1728 (add-after 'unpack 'apply-reform-patches
1729 (lambda* (#:key inputs #:allow-other-keys)
1730 (for-each (lambda (patch)
1731 (invoke "patch" "-p1" "-i"
1732 (search-input-file inputs
1733 (string-append
1734 "patches6.18/" patch))))
1735 (list
1736 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
1737 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
1738 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
1739 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
1740 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
1741 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
1742 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
1743 "imx8mp-mnt-pocket-reform/pocket-panel/0002-pocket-panel-fix-sleep-add-orientation.patch"
1744 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
1745 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
1746 "imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch"
1747 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
1748 "imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch"
1749 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
1750 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
1751 "imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
1752 "imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch"
1753 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
1754 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
1755 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
1756 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
1757 "meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch"
1758 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
1759 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
1760 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
1761 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
1762 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
1763 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
1764 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
1765 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
1766 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
1767 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
1768 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
1769 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
1770 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
1771 "meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch"
1772 "rk3588-mnt-reform2/0001-MERGED-drm-bridge-Pass-down-connector-to-drm-bridge-.patch"
1773 "rk3588-mnt-reform2/0024-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
1774 "rk3588-mnt-reform2/0025-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
1775 "rk3588-mnt-reform2/0026-clk-composite-replace-open-coded-abs_diff.patch"
1776 "rk3588-mnt-reform2/0030-mfd-rk8xx-Fix-shutdown-handler.patch"
1777 "rk3588-mnt-reform2/0031-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
1778 "rk3588-mnt-reform2/0032-drm-rockchip-vop2-Add-clock-resets-support.patch"
1779 "rk3588-mnt-reform2/0033-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
1780 "rk3588-mnt-reform2/0035-drm-rockchip-vop2-Add-core-reset-support.patch"
1781 "rk3588-mnt-reform2/0046-arm64-defconfig-Enable-Rockchip-RK3588-DisplayPort-C.patch"
1782 "rk3588-mnt-reform2/0055-phy-rockchip-usbdp-move-orientation-handling-further.patch"
1783 "rk3588-mnt-reform2/0056-phy-rockchip-usbdp-reset-USB3-and-reinit-on-orientat.patch"
1784 "rk3588-mnt-reform2/0060-PCI-dw-rockchip-Rename-rockchip_pcie_get_ltssm-funct.patch"
1785 "rk3588-mnt-reform2/0061-PCI-dw-rockchip-Support-get_ltssm-operation.patch"
1786 "rk3588-mnt-reform2/0062-PCI-dw-rockchip-Move-devm_phy_get-out-of-phy_init.patch"
1787 "rk3588-mnt-reform2/0063-PCI-dw-rockchip-Add-helper-function-for-enhanced-LTS.patch"
1788 "rk3588-mnt-reform2/0064-PCI-dw-rockchip-Add-helper-function-for-controller-m.patch"
1789 "rk3588-mnt-reform2/0065-PCI-dw-rockchip-Add-helper-function-for-DDL-indicato.patch"
1790 "rk3588-mnt-reform2/0066-PCI-dw-rockchip-Add-pme_turn_off-support.patch"
1791 "rk3588-mnt-reform2/0067-PCI-dw-rockchip-Add-system-PM-support.patch"
1792 "rk3588-mnt-reform2/0068-drm-bridge-dw-hdmi-qp-Add-CEC-support.patch"
1793 "rk3588-mnt-reform2/0069-drm-bridge-dw-hdmi-qp-Fixup-timer-base-setup.patch"
1794 "rk3588-mnt-reform2/0070-drm-rockchip-dw_hdmi_qp-Improve-error-handling-with-.patch"
1795 "rk3588-mnt-reform2/0071-drm-rockchip-dw_hdmi_qp-Provide-CEC-IRQ-in-dw_hdmi_q.patch"
1796 "rk3588-mnt-reform2/0072-drm-rockchip-dw_hdmi_qp-Provide-ref-clock-rate-in-dw.patch"
1797 "rk3588-mnt-reform2/0073-arm64-defconfig-Enable-DW-HDMI-QP-CEC-support.patch"
1798 "rk3588-mnt-reform2/0075-phy-hdmi-Add-HDMI-2.1-FRL-configuration-options.patch"
1799 "rk3588-mnt-reform2/0079-phy-rockchip-samsung-hdptx-Use-usleep_range-instead-.patch"
1800 "rk3588-mnt-reform2/0080-phy-rockchip-samsung-hdptx-Fix-coding-style-alignmen.patch"
1801 "rk3588-mnt-reform2/0081-phy-rockchip-samsung-hdptx-Consistently-use-rk_-hdpt.patch"
1802 "rk3588-mnt-reform2/0082-phy-rockchip-samsung-hdptx-Enable-lane-output-in-com.patch"
1803 "rk3588-mnt-reform2/0083-phy-rockchip-samsung-hdptx-Cleanup-_cmn_init_seq-lis.patch"
1804 "rk3588-mnt-reform2/0084-phy-rockchip-samsung-hdptx-Compute-clk-rate-from-PLL.patch"
1805 "rk3588-mnt-reform2/0085-phy-rockchip-samsung-hdptx-Drop-hw_rate-driver-data.patch"
1806 "rk3588-mnt-reform2/0086-phy-rockchip-samsung-hdptx-Switch-to-driver-specific.patch"
1807 "rk3588-mnt-reform2/0087-phy-rockchip-samsung-hdptx-Extend-rk_hdptx_phy_verif.patch"
1808 "rk3588-mnt-reform2/0088-phy-rockchip-samsung-hdptx-Add-HDMI-2.1-FRL-support.patch"
1809 "rk3588-mnt-reform2/0089-drm-rockchip-vop2-Check-bpc-before-switching-DCLK-so.patch"
1810 "rk3588-mnt-reform2/0090-drm-bridge-dw-hdmi-qp-Handle-platform-supported-form.patch"
1811 "rk3588-mnt-reform2/0091-drm-rockchip-dw_hdmi_qp-Switch-to-phy_configure.patch"
1812 "rk3588-mnt-reform2/0092-drm-rockchip-dw_hdmi_qp-Use-bit-macros-for-RK3576-re.patch"
1813 "rk3588-mnt-reform2/0093-drm-rockchip-dw_hdmi_qp-Add-high-color-depth-support.patch"
1814 "rk3588-mnt-reform2/0094-DEBUG-phy-rockchip-samsung-hdptx-Add-verbose-logging.patch"
1815 "rk3588-mnt-reform2/0095-WIP-SCRAMB-drm-bridge-Add-detect_ctx-hook.patch"
1816 "rk3588-mnt-reform2/0096-WIP-SCRAMB-drm-bridge-connector-Switch-from-detect-t.patch"
1817 "rk3588-mnt-reform2/0097-WIP-SCRAMB-drm-bridge-dw-hdmi-qp-Add-high-TMDS-clock.patch"
1818 "rk3588-mnt-reform2/0098-WIP-YUV420-drm-rockchip-vop2-Add-YUV420-output-forma.patch"
1819 "rk3588-mnt-reform2/0099-WIP-YUV420-drm-rockchip-dw_hdmi_qp-Add-YUV420-output.patch"
1820 "rk3588-mnt-reform2/0100-WIP-FRL-dt-bindings-display-rockchip-Add-tmds-enable.patch"
1821 "rk3588-mnt-reform2/0101-WIP-FRL-drm-rockchip-dw_hdmi_qp-Fixup-usage-of-enabl.patch"
1822 "rk3588-mnt-reform2/0103-WIP-FRL-arm64-dts-rockchip-Assign-ACLK_VOP-to-750-MH.patch"
1823 "rk3588-mnt-reform2/0104-WIP-FRL-drm-connector-hdmi-Handle-FRL-in-hdmi_clock_.patch"
1824 "rk3588-mnt-reform2/0105-WIP-FRL-drm-bridge-dw-hdmi-qp-Add-HDMI-2.1-FRL-suppo.patch"
1825 "rk3588-mnt-reform2/0106-WIP-FRL-drm-rockchip-dw_hdmi_qp-Add-HDMI-2.1-FRL-sup.patch"
1826 "rk3588-mnt-reform2/0107-WIP-FRL-drm-rockchip-vop2-Add-HDMI-2.1-FRL-support.patch"
1827 "rk3588-mnt-reform2/0108-dt-bindings-phy-rockchip-usbdp-add-improved-ports-sc.patch"
1828 "rk3588-mnt-reform2/0114-media-dt-bindings-video-interfaces-add-defines-for-s.patch"
1829 "rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch"
1830 "rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch"
1831 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"
1832 "rk3588-mnt-reform2/7001-PCI-dw-rockchip-Disable-root-port-BARs.patch"))))
1833 (add-after 'apply-reform-patches 'copy-reform-dts-files
1834 (lambda* (#:key inputs #:allow-other-keys)
1835 (for-each (lambda (dts)
1836 (copy-file (search-input-file inputs
1837 (string-append
1838 "/dts/" dts))
1839 (string-append "arch/arm64/boot/dts/"
1840 dts)))
1841 (list
1842 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
1843 "freescale/fsl-ls1028a-mnt-reform2.dts"
1844 "freescale/imx8mp-mnt-pocket-reform.dts"
1845 "freescale/imx8mp-mnt-reform2.dts"
1846 "freescale/imx8mq-mnt-reform2-hdmi.dts"
1847 "rockchip/rk3588-mnt-desktop-reform.dts"
1848 "rockchip/rk3588-mnt-pocket-reform.dts"
1849 "rockchip/rk3588-mnt-reform-next.dts"
1850 "rockchip/rk3588-mnt-reform2.dts"
1851 "rockchip/rk3588-mnt-reform2-dsi.dts"
1852 ))))
1853 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
1854 (lambda _
1855 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
1856 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
1857 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
1858dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
1859 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
1860 (("fsl-ls1028a-rdb.dtb")
1861 "fsl-ls1028a-rdb.dtb
1862dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
1863 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
1864 (("imx8mq-mnt-reform2.dtb")
1865 "imx8mq-mnt-reform2.dtb
1866dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
1867dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
1868dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
1869 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
1870 (("rk3588-mnt-reform2.dtb")
1871 "rk3588-mnt-reform2.dtb
1872dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-desktop-reform.dtb
1873dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb
1874dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
1875dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
1876
1877(define-public linux-libre-arm64-mnt-reform linux-libre-arm64-mnt-reform-6.18)
1878
1879(define-public linux-libre-arm64-mnt-reform-6.12
1880 ;; Kernel for use on the MNT/Reform systems
1881 ;; https://mntre.com/reform.html
1882 (let ((base (make-linux-libre* linux-libre-6.12-version
1883 linux-libre-6.12-gnu-revision
1884 (source-with-patches linux-libre-6.12-source
1885 ;; Revert upstream patches
1886 ;; that conflict with
1887 ;; MNT/Reform patches
1888 (search-patches
1889 "linux-libre-arm64-mnt-reform-revert-vop2-display-modes.patch"
1890 "linux-libre-arm64-mnt-reform-revert-phy-rockchip-samsung.patch"
1891 "linux-libre-arm64-mnt-reform-revert-rk-samsung-hdptx.patch"))
1892 '("aarch64-linux")
1893 #:extra-version "arm64-mnt-reform"
1894 #:extra-options
1895 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
1896 (append `(("CONFIG_DRM_LVDS_CODEC" . m)
1897 ("CONFIG_DRM_CDNS_MHDP8546" . m)
1898 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
1899 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
1900 ("CONFIG_DRM_IMX_DCSS" . m)
1901 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
1902 ("CONFIG_DRM_PANEL_LVDS" . m)
1903 ("CONFIG_I2C_IMX_LPI2C" . m)
1904 ("CONFIG_I2C_MUX_REG" . m)
1905 ("CONFIG_INTERCONNECT_IMX" . #true)
1906 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
1907 ("CONFIG_MFD_WM8994" . m)
1908 ("CONFIG_MUX_GPIO" . m)
1909 ("CONFIG_MUX_MMIO" . m)
1910 ("CONFIG_RTC_DRV_PCF8523" . m)
1911 ("CONFIG_USB_EHCI_FSL" . m)
1912 ("CONFIG_NO_HZ_IDLE" . #true)
1913 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
1914 ("CONFIG_SND_IMX_SOC" . m)
1915 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
1916 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
1917 ("CONFIG_SND_SOC_IMX_HDMI" . m)
1918 ("CONFIG_INPUT_JOYSTICK" . #true)
1919 ("CONFIG_JOYSTICK_XPAD" . m)
1920 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
1921 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
1922 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
1923 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
1924 ("CONFIG_DRM_IMX_LCDIF" . #true)
1925 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
1926 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
1927 ("CONFIG_IMX8MM_THERMAL" . #true)
1928 ("CONFIG_IMX2_WDT" . #true)
1929 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
1930 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
1931 ("CONFIG_DRM" . #true)
1932 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . #true)
1933 ("CONFIG_IMX8M_BLK_CTRL" . #true)
1934 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
1935 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
1936 ("CONFIG_DRM_FSL_LDB" . #true)
1937 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
1938 ("CONFIG_BACKLIGHT_PWM" . #true)
1939 ("CONFIG_BACKLIGHT_GPIO" . #true)
1940 ("CONFIG_BACKLIGHT_LED" . #true)
1941 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
1942 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
1943 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
1944 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
1945 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
1946 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
1947 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
1948 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
1949 ("CONFIG_IMX_IRQSTEER" . #true)
1950 ("CONFIG_PCI_MESON" . #true)
1951 ("CONFIG_DWMAC_MESON" . #true)
1952 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . #true)
1953 ("CONFIG_I2C_MESON" . #true)
1954 ("CONFIG_PWM_MESON" . #true)
1955 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
1956 ("CONFIG_MMC_MESON_GX" . #true)
1957 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
1958 ("CONFIG_MESON_DDR_PMU" . #true)
1959 ("CONFIG_RTW88_8822CS" . m)
1960 ("CONFIG_PWM_FSL_FTM" . #true)
1961 ("CONFIG_FSL_RCPM" . #true)
1962 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
1963 ("CONFIG_DRM_PANTHOR" . m)
1964 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
1965 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
1966 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
1967 ("CONFIG_ROCKCHIP_INNO_HDMI" . #true)
1968 ("CONFIG_ROCKCHIP_LVDS" . #true)
1969 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
1970 ("CONFIG_SPI_ROCKCHIP" . #true)
1971 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
1972 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
1973 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . m)
1974 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
1975 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
1976 ("CONFIG_ROCKCHIP_DW_MIPI_DSI" . #true)
1977 ;; Fixes https://codeberg.org/guix/guix/issues/101
1978 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1979 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1980 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1981 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1982 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1983 ;; nftables support
1984 ("CONFIG_NF_TABLES" . m)
1985 ("CONFIG_NF_TABLES_INET" . #true)
1986 ("CONFIG_NF_TABLES_NETDEV" . #true)
1987 ("CONFIG_NF_TABLES_IPV4" . #true)
1988 ("CONFIG_NF_TABLES_ARP" . #true)
1989 ("CONFIG_NF_TABLES_IPV6" . #true)
1990 ("CONFIG_NF_TABLES_BRIDGE" . m)
1991 ("CONFIG_NFT_NUMGEN" . m)
1992 ("CONFIG_NFT_CT" . m)
1993 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
1994 ("CONFIG_NFT_CONNLIMIT" . m)
1995 ("CONFIG_NFT_LOG" . m)
1996 ("CONFIG_NFT_LIMIT" . m)
1997 ("CONFIG_NFT_MASQ" . m)
1998 ("CONFIG_NFT_REDIR" . m)
1999 ("CONFIG_NFT_NAT" . m)
2000 ("CONFIG_NFT_TUNNEL" . m)
2001 ("CONFIG_NFT_QUEUE" . m)
2002 ("CONFIG_NFT_QUOTA" . m)
2003 ("CONFIG_NFT_REJECT" . m)
2004 ("CONFIG_NFT_REJECT_INET" . m)
2005 ("CONFIG_NFT_COMPAT" . m)
2006 ("CONFIG_NFT_HASH" . m)
2007 ("CONFIG_NFT_FIB" . m)
2008 ("CONFIG_NFT_FIB_INET" . m)
2009 ("CONFIG_NFT_XFRM" . m)
2010 ("CONFIG_NFT_SOCKET" . m)
2011 ("CONFIG_NFT_OSF" . m)
2012 ("CONFIG_NFT_TPROXY" . m)
2013 ("CONFIG_NFT_SYNPROXY" . m)
2014 ("CONFIG_NFT_DUP_NETDEV" . m)
2015 ("CONFIG_NFT_FWD_NETDEV" . m)
2016 ("CONFIG_NFT_FIB_NETDEV" . m)
2017 ("CONFIG_NFT_REJECT_NETDEV" . m)
2018 ("CONFIG_NFT_REJECT_IPV4" . m)
2019 ("CONFIG_NFT_DUP_IPV4" . m)
2020 ("CONFIG_NFT_FIB_IPV4" . m)
2021 ("CONFIG_NFT_COMPAT_ARP" . m)
2022 ("CONFIG_NFT_REJECT_IPV6" . m)
2023 ("CONFIG_NFT_DUP_IPV6" . m)
2024 ("CONFIG_NFT_FIB_IPV6" . m)
2025 ("CONFIG_NFT_BRIDGE_META" . m)
2026 ("CONFIG_NFT_BRIDGE_REJECT" . m)
2027 ;; Provide support for USB tethering
2028 ("CONFIG_USB_NET_CDC_EEM" . m)
2029 ("CONFIG_USB_NET_RNDIS_HOST" . m)
2030 ("CONFIG_USB_WDM" . m)
2031 ("CONFIG_USB_GADGET" . m)
2032 ("CONFIG_USB_ETH" . m)
2033 ("CONFIG_USB_ETH_RNDIS" . m)
2034 ("CONFIG_USB_ETH_EEM" . m)
2035 ("CONFIG_USB_G_NCM" . m)
2036 ;; Provide support for wireguard
2037 ("CONFIG_WIREGUARD" . m)
2038 ;; Provide support for ath9k wireless
2039 ("CONFIG_ATH9K" . m)
2040 ("CONFIG_ATH9K_HTC" . m))
2041 (default-extra-linux-options
2042 linux-libre-6.12-version)))))
2043 (package
2044 (inherit base)
2045 (inputs (list reform-debian-packages-for-6.12))
2046 (synopsis (string-append (package-synopsis base)
2047 " for MNT/Reform systems"))
2048 (description (string-append (package-description base)
2049 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2050 (arguments
2051 (substitute-keyword-arguments (package-arguments base)
2052 ((#:phases phases)
2053 #~(modify-phases #$phases
2054 (add-after 'unpack 'apply-reform-patches
2055 (lambda* (#:key inputs #:allow-other-keys)
2056 (for-each (lambda (patch)
2057 (invoke "patch" "-p1" "-i"
2058 (search-input-file inputs
2059 (string-append
2060 "patches6.12/" patch))))
2061 (list
2062 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2063 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2064 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
2065 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2066 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2067 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2068 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2069 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2070 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2071 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2072 "imx8mq-mnt-reform2/0002-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2073 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2074 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2075 ;; Does not apply, needs further investigation
2076 ;; "imx8mq-mnt-reform2/v19_20241126_sandor_yu_initial_support_cadence_mhdp8501_hdmi_dp_for_i_mx8mq.mbx"
2077 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2078 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2079 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2080 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2081 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2082 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2083 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2084 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2085 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2086 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2087 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2088 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2089 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2090 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2091 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2092 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2093 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2094 "rk3588-mnt-reform2/0001-regulator-Add-of_regulator_get_optional-for-pure-DT-.patch"
2095 "rk3588-mnt-reform2/0001-scripts-package-builddeb-allow-hooks-also-in-usr-sha.patch"
2096 "rk3588-mnt-reform2/0002-regulator-Add-devres-version-of-of_regulator_get_opt.patch"
2097 "rk3588-mnt-reform2/0004-arm64-dts-rockchip-rk3588-rock5b-add-USB-C-support.patch"
2098 "rk3588-mnt-reform2/0005-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2099 "rk3588-mnt-reform2/0006-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2100 "rk3588-mnt-reform2/0007-clk-composite-replace-open-coded-abs_diff.patch"
2101 "rk3588-mnt-reform2/0008-clk-rockchip-support-clocks-registered-late.patch"
2102 "rk3588-mnt-reform2/0009-clk-rockchip-rk3588-register-GATE_LINK-later.patch"
2103 "rk3588-mnt-reform2/0010-clk-rockchip-expose-rockchip_clk_set_lookup.patch"
2104 "rk3588-mnt-reform2/0011-clk-rockchip-implement-linked-gate-clock-support.patch"
2105 "rk3588-mnt-reform2/0012-clk-rockchip-rk3588-drop-RK3588_LINKED_CLK.patch"
2106 "rk3588-mnt-reform2/0013-arm64-dts-rockchip-rk3588-evb1-add-bluetooth-rfkill.patch"
2107 "rk3588-mnt-reform2/0014-arm64-dts-rockchip-rk3588-evb1-improve-PCIe-ethernet.patch"
2108 "rk3588-mnt-reform2/0015-arm64-dts-rockchip-Slow-down-EMMC-a-bit-to-keep-IO-s.patch"
2109 "rk3588-mnt-reform2/0016-vop2-Add-clock-resets-support.patch"
2110 "rk3588-mnt-reform2/0017-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2111 "rk3588-mnt-reform2/0018-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2112 "rk3588-mnt-reform2/0019-media-v4l2-ctrls-core-Set-frame_mbs_only_flag-by-def.patch"
2113 "rk3588-mnt-reform2/0020-media-rockchip-Move-H264-CABAC-table-to-header-file.patch"
2114 "rk3588-mnt-reform2/0021-media-rockchip-Introduce-the-rkvdec2-driver.patch"
2115 "rk3588-mnt-reform2/0022-media-dt-bindings-rockchip-Document-RK3588-Video-Dec.patch"
2116 "rk3588-mnt-reform2/0023-arm64-dts-rockchip-Add-rkvdec2-Video-Decoder-on-rk35.patch"
2117 "rk3588-mnt-reform2/0024-arm64-defconfig-enable-Rockchip-RK3588-video-decoder.patch"
2118 "rk3588-mnt-reform2/0025-mfd-rk8xx-Fix-shutdown-handler.patch"
2119 "rk3588-mnt-reform2/0026-WIP-phy-phy-rockchip-samsung-hdptx-Add-FRL-EARC-supp.patch"
2120 "rk3588-mnt-reform2/0027-TESTING-phy-phy-rockchip-samsung-hdptx-Add-verbose-l.patch"
2121 "rk3588-mnt-reform2/0028-WIP-dt-bindings-display-rockchip-drm-Add-optional-cl.patch"
2122 "rk3588-mnt-reform2/0029-WIP-drm-rockchip-vop2-Improve-display-modes-handling.patch"
2123 "rk3588-mnt-reform2/0030-arm64-dts-rockchip-Add-HDMI0-bridge-to-rk3588.patch"
2124 "rk3588-mnt-reform2/0031-arm64-dts-rockchip-Enable-HDMI0-on-rock-5b.patch"
2125 "rk3588-mnt-reform2/0032-arm64-dts-rockchip-Enable-HDMI0-on-rk3588-evb1.patch"
2126 "rk3588-mnt-reform2/0033-WIP-arm64-dts-rockchip-Enable-HDMI0-PHY-clk-provider.patch"
2127 "rk3588-mnt-reform2/0034-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2128 "rk3588-mnt-reform2/0035-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2129 "rk3588-mnt-reform2/0036-dt-bindings-display-bridge-Add-schema-for-Synopsys-D.patch"
2130 "rk3588-mnt-reform2/0037-dt-bindings-display-rockchip-Add-schema-for-RK3588-H.patch"
2131 "rk3588-mnt-reform2/0038-drm-bridge-synopsys-Add-DW-HDMI-QP-TX-controller-dri.patch"
2132 "rk3588-mnt-reform2/0039-drm-rockchip-Add-basic-RK3588-HDMI-output-support.patch"
2133 "rk3588-mnt-reform2/0040-arm64-defconfig-Enable-Rockchip-extensions-for-Synop.patch"
2134 "rk3588-mnt-reform2/0041-MAINTAINERS-Add-entry-for-Synopsys-DesignWare-HDMI-R.patch"
2135 "rk3588-mnt-reform2/0042-dt-bindings-media-Document-bindings-for-HDMI-RX-Cont.patch"
2136 "rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-device-tree-support-for-HDMI-.patch"
2137 "rk3588-mnt-reform2/0044-media-platform-synopsys-Add-support-for-HDMI-input-d.patch"
2138 "rk3588-mnt-reform2/0045-arm64-defconfig-Enable-Synopsys-HDMI-receiver.patch"
2139 "rk3588-mnt-reform2/0046-arm64-dts-rockchip-Enable-HDMI-receiver-on-rock-5b.patch"
2140 "rk3588-mnt-reform2/0047-arm64-dts-rockchip-Enable-HDMI-receiver-on-RK3588-EV.patch"
2141 "rk3588-mnt-reform2/0048-arm64-defconfig-Enable-default-EDID-for-Synopsys-HDM.patch"
2142 "rk3588-mnt-reform2/0049-regulator-Add-devm_-of_regulator_get.patch"
2143 "rk3588-mnt-reform2/0050-pmdomain-rockchip-cleanup-mutex-handling-in-rockchip.patch"
2144 "rk3588-mnt-reform2/0051-pmdomain-rockchip-forward-rockchip_do_pmu_set_power_.patch"
2145 "rk3588-mnt-reform2/0052-pmdomain-rockchip-reduce-indentation-in-rockchip_pd_.patch"
2146 "rk3588-mnt-reform2/0053-dt-bindings-power-rockchip-add-regulator-support.patch"
2147 "rk3588-mnt-reform2/0054-pmdomain-rockchip-add-regulator-support.patch"
2148 "rk3588-mnt-reform2/0055-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch"
2149 "rk3588-mnt-reform2/0056-dt-bindings-net-wireless-brcm4329-fmac-add-pci14e4-4.patch"
2150 "rk3588-mnt-reform2/0057-dt-bindings-net-wireless-brcm4329-fmac-add-clock-des.patch"
2151 "rk3588-mnt-reform2/0058-wifi-brcmfmac-Add-optional-lpo-clock-enable-support.patch"
2152 ;; does not apply cleanly due to DEBLOBBING
2153 ;; "rk3588-mnt-reform2/0059-wifi-brcmfmac-add-flag-for-random-seed-during-firmwa.patch"
2154 "rk3588-mnt-reform2/0060-arm64-dts-rockchip-rk3588-evb1-add-WLAN-controller.patch"
2155 "rk3588-mnt-reform2/0061-arm64-dts-rockchip-add-and-enable-gpu-node-for-Radxa.patch"
2156 "rk3588-mnt-reform2/0062-arm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch"
2157 "rk3588-mnt-reform2/0100-rk3588-dtsi-add-hdmi1-controller.patch"
2158 "rk3588-mnt-reform2/0102-drm-panthor-Actually-suspend-IRQs-in-the-unplug-path.patch"
2159 "rk3588-mnt-reform2/3001-display-rockchip-add-schema-for-rk3588-hdmi-tx.patch"
2160 "rk3588-mnt-reform2/4000-mnt-rk3588-dual-hdmi-qp-rockchip.patch"
2161 "rk3588-mnt-reform2/4001-mnt-rk3588-dual-hdmi-vop2-pll.patch"
2162 "rk3588-mnt-reform2/5001-rk3588-dsi2-driver.patch"
2163 "rk3588-mnt-reform2/5002-rk3588-dsi-dts-nodes.patch"
2164 "rk3588-mnt-reform2/5100-modernize-hdmi1-in-dtsi.patch"
2165 "rk3588-mnt-reform2/5110-hdptx-crash-workaround.patch"
2166 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
2167 (add-after 'apply-reform-patches 'copy-reform-dts-files
2168 (lambda* (#:key inputs #:allow-other-keys)
2169 (for-each (lambda (dts)
2170 (copy-file (search-input-file inputs
2171 (string-append
2172 "/dts/" dts))
2173 (string-append "arch/arm64/boot/dts/"
2174 dts)))
2175 (list
2176 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2177 "amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts"
2178 "freescale/fsl-ls1028a-mnt-reform2.dts"
2179 "freescale/imx8mp-mnt-pocket-reform.dts"
2180 "freescale/imx8mp-mnt-reform2.dts"
2181 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2182 "freescale/imx8mq-mnt-reform2.dts"
2183 "rockchip/rk3588-mnt-pocket-reform.dts"
2184 "rockchip/rk3588-mnt-reform-next.dts"
2185 "rockchip/rk3588-mnt-reform2.dts"))))
2186 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2187 (lambda _
2188 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2189 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2190 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2191dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2192 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2193 (("fsl-ls1028a-rdb.dtb")
2194 "fsl-ls1028a-rdb.dtb
2195dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2196 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2197 (("imx8mq-mnt-reform2.dtb")
2198 "imx8mq-mnt-reform2.dtb
2199dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2200dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2201dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2202 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2203 (("rk3588-rock-5b.dtb")
2204 "rk3588-rock-5b.dtb
2205dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2.dtb
2206dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2207dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
2208
2209(define-public linux-libre-riscv64-generic
2210 (make-linux-libre* linux-libre-version
2211 linux-libre-gnu-revision
2212 linux-libre-source
2213 '("riscv64-linux")
2214 #:extra-version "riscv64-generic"
2215 #:extra-options
2216 (append
2217 ;; required `guix system vm'
2218 `(("CONFIG_USB_HID" . m)
2219 ("CONFIG_HID_GEMBIRD" . m)
2220 ("CONFIG_AHCI_DWC" . m)
2221 ("CONFIG_SATA_AHCI" . m)
2222 ("CONFIG_CRYPTO_SERPENT" . m)
2223 ("CONFIG_CRYPTO_WP512" . m)
2224 ("CONFIG_USB_UAS" . m)
2225 ("CONFIG_USB_STORAGE" . m)
2226 ("CONFIG_HID_GENERIC" . m)
2227 ("CONFIG_DRM_CIRRUS_QEMU" . m)
2228 ("CONFIG_HW_RANDOM_VIRTIO" . m)
2229 ("CONFIG_VIRTIO_CONSOLE" . m)
2230 ("CONFIG_CRYPTO_XTS" . m))
2231 (default-extra-linux-options linux-libre-version))))
2232
2233(define-public linux-libre-mips64el-fuloong2e
2234 (make-linux-libre* linux-libre-version
2235 linux-libre-gnu-revision
2236 linux-libre-source
2237 '("mips64el-linux")
2238 #:defconfig "fuloong2e_defconfig"
2239 #:extra-version "mips64el-fuloong2e"
2240 #:extra-options
2241 (append
2242 `(("CONFIG_OVERLAY_FS" . m))
2243 (default-extra-linux-options linux-libre-version))))
2244
2245(define-deprecated-package linux-libre-with-bpf
2246 linux-libre)
2247
2248
2249;;;
2250;;; Linux kernel modules.
2251;;;
2252
2253(define-public acpi-call-linux-module
2254 (package
2255 (name "acpi-call-linux-module")
2256 (version "1.2.2")
2257 (source
2258 (origin
2259 (method git-fetch)
2260 (uri (git-reference
2261 (url "https://github.com/nix-community/acpi_call")
2262 (commit (string-append "v" version))))
2263 (file-name (git-file-name name version))
2264 (sha256
2265 (base32 "09ljx0jl987753r2kjqj5kxms95bijw0xn14kf82ryn38ck5c8cf"))))
2266 (build-system linux-module-build-system)
2267 (arguments
2268 (list #:tests? #f ; no tests
2269 #:phases
2270 #~(modify-phases %standard-phases
2271 (add-before 'install 'patch-shebangs-harder
2272 ;; The (only) shebangs in examples/ don't justify a reference.
2273 ;; However, do substitute a slightly more portable one.
2274 (lambda _
2275 (substitute* (find-files "examples" ".")
2276 (("^(#! *)/[^ ]*/" _ shebang)
2277 (string-append shebang "/usr/bin/env ")))))
2278 (add-after 'install 'install-documentation
2279 (lambda _
2280 (let* ((doc (string-append #$output "/share/doc/"
2281 #$name "-" #$version)))
2282 (for-each (lambda (file)
2283 (let ((target (string-append doc "/" file)))
2284 (mkdir-p (dirname target))
2285 (copy-recursively file target)))
2286 (list "README.md" "examples"))))))))
2287 (home-page "https://github.com/nix-community/acpi_call")
2288 (synopsis "Linux kernel module to perform ACPI method calls")
2289 (description
2290 "This simple Linux kernel module allows calls from user space to any
2291@acronym{ACPI, Advanced Configuration and Power Interface} method provided by
2292your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
2293any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
2294and @code{ACPI_BUFFER}.
2295
2296It grants direct and undocumented access to your hardware that may cause damage
2297and should be used with caution, especially on untested models.")
2298 (license license:gpl3+))) ; see README.md (no licence headers)
2299
2300(define-public corefreq
2301 (package
2302 (name "corefreq")
2303 (version "1.98.4")
2304 (source
2305 (origin
2306 (method git-fetch)
2307 (uri (git-reference
2308 (url "https://github.com/cyring/CoreFreq")
2309 (commit version)))
2310 (file-name (git-file-name name version))
2311 (sha256
2312 (base32 "0mxp5h23y09674syaj5gpdifr53zvgjv7g7hargwg6897883qfln"))))
2313 ;; The upstream Makefile is now such a proprietary mess that standard builds
2314 ;; as performed by our linux-module-build-system are more or less impossible
2315 ;; without heavy patching. However, we still keep it as the main build
2316 ;; system because lifting out LINUX-MODULE-BUILDER would be even messier.
2317 (build-system linux-module-build-system)
2318 (outputs (list "out" "linux-module"))
2319 (arguments
2320 (list #:imported-modules `((guix build gnu-build-system)
2321 ,@%linux-module-build-system-modules)
2322 #:modules `((guix build linux-module-build-system)
2323 ((guix build gnu-build-system) #:prefix gnu:)
2324 (guix build utils))
2325 #:make-flags
2326 #~(list (string-append "CC=" #$(cc-for-target))
2327 "OPTIM_LVL=3"
2328 (string-append "PREFIX=" #$output))
2329 #:tests? #f ;no test suite
2330 #:source-directory "../build" ;must contain modules.order
2331 #:phases
2332 #~(modify-phases %standard-phases
2333 (add-after 'unpack 'patch-Makefile
2334 (lambda* (#:key inputs #:allow-other-keys)
2335 (let ((dir (search-input-directory
2336 inputs "lib/modules/build")))
2337 (substitute* "Makefile"
2338 (("^(KERNELREL \\?= ).*" _ =)
2339 (string-append = (dirname dir) "\n"))
2340 (("^(KERNELDIR \\?= ).*" _ =)
2341 (string-append = dir "\n"))
2342 (("^([[:space:]]+)(.* modules_install.*)"
2343 _ indent command)
2344 (string-append indent "@echo skipping " command))))))
2345 (add-before 'build 'prepare
2346 (lambda* (#:key source-directory make-flags #:allow-other-keys)
2347 ;; Lazily fix another mismatch between what the kernel module
2348 ;; build system expects and what this package provides.
2349 (symlink "source/build" source-directory) ;$(BUILD)
2350 ;; Set up symbolic links inside $(BUILD), for some reason.
2351 (apply invoke "make" "prepare" make-flags)))
2352 (replace 'build (assoc-ref gnu:%standard-phases 'build))
2353 (add-before 'install 'resolve-symlink
2354 ;; The build system silently fails to install from a symlink.
2355 (lambda _
2356 (delete-file "../build")
2357 (copy-recursively "build" "../build")))
2358 (add-before 'install 'create-output
2359 (lambda _
2360 ;; Avoid installing the corefreq binary as …/bin.
2361 (mkdir-p (string-append #$output "/bin"))))
2362 (add-after 'install 'gnu:install
2363 (assoc-ref gnu:%standard-phases 'install))
2364 (add-after 'install 'separate-module
2365 (lambda* (#:key outputs #:allow-other-keys)
2366 ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an
2367 ;; empty <out>/lib/modules directory, so just do it all by hand.
2368 (let* ((output (assoc-ref outputs "out"))
2369 (module (assoc-ref outputs "linux-module")))
2370 (mkdir-p module)
2371 (rename-file (string-append output "/lib")
2372 (string-append module "/lib")))))
2373 (add-after 'install 'install-README
2374 ;; There is no proper documentation. Provide something.
2375 (lambda* (#:key outputs #:allow-other-keys)
2376 (let* ((out (assoc-ref outputs "out"))
2377 (doc (string-append out "/share/doc/"
2378 #$name "-" #$version)))
2379 (install-file "README.md" doc)))))))
2380 (home-page "https://github.com/cyring/CoreFreq")
2381 (synopsis
2382 "Measure performance data & tweak low-level settings on x86-64 CPUs")
2383 (description
2384 "CoreFreq is a CPU monitor that reports low-level processor settings and
2385performance data with notably high precision by using a loadable Linux kernel
2386module. Unlike most similar tools, it can be used to modify some settings if
2387supported by the hardware and at your own risk. It's designed for 64-bit x86
2388Intel processors (Atom, Core2, Nehalem, SandyBridge, and newer) and compatible
2389architectures like AMD@tie{}Zen and Hygon@tie{}Dhyana.
2390
2391Supported processor features include:
2392@enumerate
2393@item time spent in C-states, including C1/C3 Auto- and UnDemotion;
2394@item core temperatures, voltage, and tweaking thermal limits;
2395@item core frequencies, ratios, and base clock rate;
2396@item enabling, disabling, and testing SpeedStep (EIST), Turbo Boost, and
2397Hyper-Threading or SMT;
2398@item enabling or disabling data cache prefetching;
2399@item kernel assembly code to keep as near as possible readings of performance
2400counters such as the @acronym{TSC, Time Stamp Counter}, @acronym{UCC, Unhalted
2401Core Cycles}, and @acronym{URC, Unhalted Reference Cycles};
2402@item the number of instructions per cycle or second (IPS, IPC, and CPI);
2403@item memory controller geometry and RAM timings;
2404@item running processes' CPU affinity.
2405@end enumerate
2406
2407This package provides the @command{corefreqd} data collection daemon, the
2408@command{corefreq-cli} client to visualise and control it in real time, and the
2409@code{corefreqk} kernel module in its own separate output. Read the included
2410@file{README.md} before loading it.")
2411 (supported-systems (list "x86_64-linux"))
2412 (license license:gpl2)))
2413
2414(define-public librem-ec-acpi-linux-module
2415 (package
2416 (name "librem-ec-acpi-linux-module")
2417 (version "0.9.2")
2418 (source
2419 (origin
2420 (method git-fetch)
2421 (uri (git-reference
2422 (url "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
2423 (commit (string-append "v" version))))
2424 (file-name (git-file-name name version))
2425 (sha256
2426 (base32 "0m8hamf0550083jnk5q4hv20l8lfiardnkxbib4hhvqghpzzbxl0"))))
2427 (build-system linux-module-build-system)
2428 (arguments
2429 (list #:tests? #f)) ; no test suite
2430 (home-page "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
2431 (synopsis "Linux kernel module to control the Librem Embedded Controller")
2432 (description
2433 "This is the Linux kernel @acronym{ACPI, Advanced Configuration and Power
2434Interface} platform driver for the @acronym{EC, Embedded Controller} firmware
2435on Purism Librem laptop computers. It allows user-space control over the
2436battery charging thresholds, keyboard backlight, fans and thermal monitors,
2437and the notification, WiFi, and Bluetooth LED.")
2438 (license license:gpl2)))
2439
2440(define-public tuxedo-keyboard
2441 (package
2442 (name "tuxedo-keyboard")
2443 (version "4.15.4")
2444 (source
2445 (origin
2446 (method git-fetch)
2447 (uri (git-reference
2448 (url "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers.git")
2449 (commit (string-append "v" version))))
2450 (file-name (git-file-name name version))
2451 (sha256
2452 (base32 "0mimgcbp57gp3smd439g8040sl80qqnfzmh2vhs2qv1kwyxs75sq"))))
2453 (build-system linux-module-build-system)
2454 (arguments
2455 (list #:tests? #f)) ; no test suite
2456 ;; This package fails to build on aarch64, and the manufacturer only sells
2457 ;; machines based on Intel-compatible processors. For more information, see
2458 ;; <https://codeberg.org/guix/guix/pulls/1795>.
2459 (supported-systems '("i686-linux" "x86_64-linux"))
2460 (home-page "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers")
2461 (synopsis "Linux kernel modules to control keyboard on most Tuxedo computers")
2462 (description
2463 "This package provides the @code{tuxedo_keyboard}, @code{tuxedo_io},
2464@code{clevo_wmi} @acronym{WMI, Windows Management Engine} and the
2465@code{clevo_acpi} @acronym{ACPI, Advanced Configuration and Power Interface}
2466kernel modules to control the keyboard on most Tuxedo computers. The @code{tuxedo_io}
2467module is also needed for the @code{tuxedo-control-center} (short tcc) package.")
2468 (license license:gpl2+)))
2469
2470(define-public evdi
2471 (package
2472 (name "evdi")
2473 (version "1.14.8") ;inherited by libevdi
2474 (source
2475 (origin
2476 (method git-fetch)
2477 (uri (git-reference
2478 (url "https://github.com/DisplayLink/evdi")
2479 (commit (string-append "v" version))))
2480 (file-name (git-file-name name version))
2481 (sha256
2482 (base32 "18n8kk4gbbj252a2dqb7mbpscfb437x42flh1fsl4g5c8brczc77"))))
2483 (build-system linux-module-build-system)
2484 (arguments
2485 (list #:tests? #f ;no test suite
2486 #:phases #~(modify-phases %standard-phases
2487 (add-after 'unpack 'chdir
2488 (lambda _
2489 (chdir "module"))))))
2490 (home-page "https://github.com/DisplayLink/evdi")
2491 (synopsis
2492 "@acronym{EVDI, Extensible Virtual Display Interface} Linux kernel module")
2493 (description
2494 "The @acronym{EVDI, Extensible Virtual Display Interface} is a Linux kernel
2495module that enables management of multiple screens, allowing user-space programs
2496to take control over what happens with the image. It is essentially a virtual
2497display for which applications using the @code{libevdi} library can add, remove,
2498and receive screen updates.
2499
2500The EVDI driver uses the standard Linux @acronym{DRM, Direct Rendering Manager}.
2501Its displays can be controlled by standard tools such as @command{xrandr} and
2502display settings applets in graphical environments")
2503 (license license:gpl2)))
2504
2505(define-public libevdi
2506 (package
2507 (inherit evdi)
2508 (name "libevdi")
2509 (build-system gnu-build-system)
2510 (arguments
2511 (list #:tests? #f ;no test suite
2512 #:make-flags
2513 #~(list (string-append "CC=" #$(cc-for-target)))
2514 #:phases #~(modify-phases %standard-phases
2515 (delete 'configure)
2516 (add-after 'unpack 'chdir
2517 (lambda _
2518 (chdir "library")))
2519 (replace 'install
2520 (lambda* _
2521 (let* ((lib (string-append #$output "/lib")))
2522 (mkdir-p lib)
2523 (install-file "libevdi.so" lib)))))))
2524 (inputs (list libdrm))
2525 (native-inputs (list pkg-config))
2526 (synopsis
2527 "@acronym{EVDI, Extensible Virtual Display Interface} user-space library")
2528 (description
2529 "Libevdi is a library that gives applications easy access to
2530@acronym{EVDI, Extensible Virtual Display Interface} devices provided by the
2531@code{evdi} driver package.")
2532 (license license:lgpl2.1)))
2533
2534(define-public ec
2535 (package
2536 (name "ec")
2537 (version (package-version linux-libre))
2538 (source (package-source linux-libre))
2539 (build-system gnu-build-system)
2540 (arguments
2541 (list #:make-flags #~(list (string-append "sbindir="
2542 #$output "/sbin")
2543 "INSTALL=install" "STRIPCMD=true")
2544 #:phases #~(modify-phases %standard-phases
2545 (add-after 'unpack 'enter-subdirectory
2546 (lambda _
2547 (chdir "tools/power/acpi/tools/ec")))
2548 (delete 'configure)) ;no configure script
2549 #:tests? #f)) ;no tests
2550 (home-page (package-home-page linux-libre))
2551 (synopsis
2552 "Utility for reading or writing @acronym{EC, Embedded Controller} registers")
2553 (description
2554 "This utility can read or write specific registers or all the available
2555registers of the @acronym{EC, Embedded Controller} supported by the
2556@code{ec_sys} Linux driver.")
2557 (license license:gpl2)))
2558
2559(define-public lkrg
2560 (package
2561 (name "lkrg")
2562 (version "0.9.7")
2563 (source (origin
2564 (method git-fetch)
2565 (uri (git-reference
2566 (url "https://github.com/lkrg-org/lkrg")
2567 (commit (string-append "v" version))))
2568 (file-name (git-file-name name version))
2569 (sha256
2570 (base32
2571 "0k0z9caj48nqjwk3bapgfcdzi1lkizxcjj4r1dvkvwsk38mbk1c4"))))
2572 (build-system linux-module-build-system)
2573 (arguments
2574 (list #:linux linux-libre
2575 #:tests? #f
2576 #:make-flags #~(list (string-append "CC="
2577 #$(cc-for-target))
2578 (string-append "SYSSRC="
2579 (assoc-ref %build-inputs
2580 "linux-module-builder")
2581 "/lib/modules/build"))))
2582 (inputs (list bash-minimal))
2583 (home-page "https://lkrg.org/")
2584 (synopsis "Linux Kernel Runtime Guard")
2585 (description
2586 "This package performs runtime integrity checking of the Linux kernel and
2587detection of security vulnerability exploits against the kernel.")
2588 (license license:gpl2)))
2589
2590(define-public vhba-module
2591 (package
2592 (name "vhba-module")
2593 (version "20211218")
2594 (source
2595 (origin
2596 (method url-fetch)
2597 (uri (string-append
2598 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
2599 version ".tar.xz"))
2600 (sha256
2601 (base32 "1dkprnnya0i8121p7ip4g8cww99drk7fzbwcxx65x02jqk0siibj"))))
2602 (build-system linux-module-build-system)
2603 (arguments
2604 (list #:tests? #f)) ; no test suite
2605 (home-page "https://cdemu.sourceforge.io/")
2606 (synopsis "Linux kernel module that emulates SCSI devices")
2607 (description
2608 "The @acronym{VHBA, Virtual SCSI Host Bus Adapter} module is the link
2609between the CDemu user-space daemon and the kernel Linux. It acts as a
2610low-level SCSI driver that emulates a virtual SCSI adapter which can have
2611multiple virtual devices attached to it. Its typical use with CDEmu is to
2612emulate optical devices such as DVD and CD-ROM drives.")
2613 (license license:gpl2+)))
2614
2615(define-public bbswitch-module
2616 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
2617 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
2618 (let ((commit "19f60204596a6463b162fc7ca11f4946f5c20cea"))
2619 (package
2620 (name "bbswitch-module")
2621 (version (git-version "0.8" "2" commit))
2622 (source (origin
2623 (method git-fetch)
2624 (uri (git-reference
2625 ;; Use fork until
2626 ;; https://github.com/Bumblebee-Project/bbswitch/pull/219
2627 ;; is merged.
2628 (url "https://github.com/madchic/bbswitch")
2629 (commit commit)))
2630 (file-name (git-file-name name version))
2631 (sha256
2632 (base32
2633 "1pv41y02c9xg9k1bg4i4ll3w7hxxzdr651i08f092b9q5hr57mqn"))))
2634 (build-system linux-module-build-system)
2635 (arguments
2636 (list #:tests? #f)) ; no test suite
2637 (home-page "https://github.com/Bumblebee-Project/bbswitch")
2638 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
2639 (description "The bbswitch module provides a way to toggle the Nvidia
2640graphics card on Optimus laptops.")
2641 (license license:gpl2))))
2642
2643(define-public bin-graph
2644 (package
2645 (name "bin-graph")
2646 (version "1.2.0")
2647 (source
2648 (origin
2649 (method git-fetch)
2650 (uri (git-reference
2651 (url "https://github.com/8dcc/bin-graph")
2652 (commit (string-append "v" version))))
2653 (file-name (git-file-name name version))
2654 (sha256
2655 (base32 "1msr4fj1nh6hf5h6j5pimfrgd37xy4xbik3iml9gd3b1fdkxsdv7"))))
2656 (arguments
2657 (list #:tests? #f ; no tests
2658 #:make-flags
2659 #~(list (string-append "CC=" #$(cc-for-target))
2660 (string-append "PREFIX=" #$output)
2661 (string-append "INSTALL_DIR=" #$output "/bin"))
2662 #:phases
2663 #~(modify-phases %standard-phases
2664 (delete 'configure)))) ; no configure script
2665 (build-system gnu-build-system)
2666 (inputs (list libpng))
2667 (home-page "https://github.com/8dcc/bin-graph")
2668 (synopsis "Visualize binary files")
2669 (description
2670 "@code{bin-graph} provides a simple way of visualizing the different regions
2671of a binary file.")
2672 (license license:gpl3)))
2673
2674(define-public ddcci-driver-linux
2675 (let ((revision "0")
2676 (commit "7f8f8e6c221a286d57a643c2909109a54e084eed"))
2677 (package
2678 (name "ddcci-driver-linux")
2679 (version (git-version "0.4.5" revision commit))
2680 (source
2681 (origin
2682 (method git-fetch)
2683 (uri
2684 (git-reference
2685 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
2686 (commit commit)))
2687 (file-name (git-file-name name version))
2688 (sha256
2689 (base32 "0sgldghd8n4qjm5nv9dgxjibj1hg4kkk1811wndf3vx3dacsmkl9"))))
2690 (build-system linux-module-build-system)
2691 (arguments
2692 (list #:tests? #f ; no tests
2693 #:phases
2694 #~(modify-phases %standard-phases
2695 (replace 'build
2696 (lambda args
2697 (for-each
2698 (lambda (module)
2699 (with-directory-excursion module
2700 (apply (assoc-ref %standard-phases 'build) args)))
2701 '("ddcci" "ddcci-backlight"))))
2702 (replace 'install
2703 (lambda args
2704 (for-each
2705 (lambda (module)
2706 (with-directory-excursion module
2707 (apply (assoc-ref %standard-phases 'install) args)))
2708 '("ddcci" "ddcci-backlight")))))))
2709 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
2710 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
2711 (description "This package provides two Linux kernel drivers, ddcci and
2712ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
2713interface. The ddcci module creates a character device for each DDC/CI
2714monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
2715module allows the control of the backlight level or luminance property when
2716supported under @file{/sys/class/backlight/}.")
2717 (license license:gpl2+))))
2718
2719(define-public reform2-lpc-module
2720 (package
2721 (name "reform2-lpc-module")
2722 (version "1.79")
2723 (source
2724 (origin
2725 (method git-fetch)
2726 (uri (git-reference
2727 (url "https://source.mnt.re/reform/reform-tools.git")
2728 (commit version)))
2729 (file-name (git-file-name name version))
2730 (sha256
2731 (base32 "16xzdygf14zksvqjbp5gwiqsn0mb7kphvzrmqbl9db4kvyj4ajqa"))))
2732 (build-system linux-module-build-system)
2733 (arguments
2734 '(#:tests? #f ;no tests
2735 #:source-directory "lpc"))
2736 (synopsis "Linux kernel module for the Reform 2 system controller")
2737 (description
2738 "The reform2_lpc module allows for interaction with the NXP LPC11U24
2739Cortex-M0 MCU system controller in the Reform 2 open hardware laptop. It
2740provides battery status information and is necessary to completely shut down
2741the system when powering it off via userspace.")
2742 (home-page "https://source.mnt.re/reform/reform-tools/")
2743 (license license:gpl3+)))
2744
2745(define-public v4l2loopback-linux-module
2746 (package
2747 (name "v4l2loopback-linux-module")
2748 (version "0.15.3")
2749 (source (origin
2750 (method git-fetch)
2751 (uri (git-reference
2752 (url "https://github.com/v4l2loopback/v4l2loopback")
2753 (commit (string-append "v" version))))
2754 (file-name (git-file-name name version))
2755 (sha256
2756 (base32
2757 "1fpzsymsas4d2maj81k1al02m62d81ll4q15xwc4n0rhh88hkdv7"))))
2758 (build-system linux-module-build-system)
2759 (arguments
2760 (list #:tests? #f)) ; no test suite
2761 (home-page "https://github.com/v4l2loopback/v4l2loopback")
2762 (synopsis "Linux kernel module to create virtual V4L2 video devices")
2763 (description
2764 "This Linux module creates virtual video devices. @acronym{V4L2, Video
2765for Linux 2} applications will treat these as ordinary video devices but read
2766video data generated by another application, instead of a hardware device such
2767as a capture card.
2768
2769This lets you apply nifty effects to your Jitsi video, for example, but also
2770allows some more serious things like adding streaming capabilities to an
2771application by hooking GStreamer into the loopback device.")
2772 (license license:gpl2+)))
2773
2774(define-public xpadneo
2775 (package
2776 (name "xpadneo")
2777 (version "0.9.8")
2778 (source (origin
2779 (method git-fetch)
2780 (uri (git-reference
2781 (url "https://github.com/atar-axis/xpadneo")
2782 (commit (string-append "v" version))))
2783 (file-name (git-file-name name version))
2784 (sha256
2785 (base32
2786 "0928yr832may1ibximnvd6qjzr6sipyg8iclqgpcsa7wpxb4320b"))))
2787 (build-system linux-module-build-system)
2788 (arguments
2789 (list #:tests? #f ; no `check' target
2790 #:source-directory "hid-xpadneo/src"
2791 #:phases
2792 #~(modify-phases %standard-phases
2793 (add-after 'install 'post-install
2794 (lambda _
2795 (copy-recursively "hid-xpadneo/etc-modprobe.d"
2796 (string-append #$output "/etc/modprobe.d"))
2797 ;; udev-service-type takes its rules from /lib rather than
2798 ;; /etc, so copy it there instead
2799 (copy-recursively "hid-xpadneo/etc-udev-rules.d"
2800 (string-append #$output
2801 "/lib/udev/rules.d")))))))
2802 (home-page "https://atar-axis.github.io/xpadneo/")
2803 (synopsis "Xbox One Wireless Controller driver for the kernel Linux")
2804 (description
2805 "This package provides a driver for the XBox One S Wireless controller
2806and some newer models when connected via Bluetooth. In addition to the included
2807Linux kernel module, it also contains a modprobe configuration and udev rules,
2808which need to be installed separately.")
2809 (license license:gpl3+)))
2810
2811(define-public vendor-reset-linux-module
2812 (let ((commit "4b466e92a2d9f76ce1082cde982c7be0be91e248")
2813 (revision "0"))
2814 (package
2815 (name "vendor-reset-linux-module")
2816 (version (git-version "0.1.0" revision commit))
2817 (source (origin
2818 (method git-fetch)
2819 (uri (git-reference
2820 (url "https://github.com/gnif/vendor-reset")
2821 (commit commit)))
2822 (file-name (git-file-name name version))
2823 (sha256
2824 (base32
2825 "1gaf4j20grng689c9fylcqri3j9ycnhr2bsva2z6qcdqvzl6yxbi"))))
2826 (build-system linux-module-build-system)
2827 (arguments
2828 (list #:tests? #f)) ;no test suite
2829 (home-page "https://github.com/gnif/vendor-reset")
2830 (synopsis
2831 "Kernel module that resets GPUs that are affected by the reset bug")
2832 (description
2833 "This package provides a kernel module that is capable of
2834resetting hardware devices into a state where they can be
2835re-initialized or passed through into a virtual machine (VFIO).
2836While it would be great to have these in the kernel as PCI quirks,
2837some of the reset procedures are very complex and would never be
2838accepted as a quirk (ie AMD Vega 10).")
2839 (license license:gpl2))))
2840
2841
2842;;;
2843;;; Pluggable authentication modules (PAM).
2844;;;
2845
2846(define-public linux-pam
2847 (package
2848 (name "linux-pam")
2849 (version "1.5.2")
2850 (source
2851 (origin
2852 (method url-fetch)
2853 (uri (string-append
2854 "https://github.com/linux-pam/linux-pam/releases/download/v"
2855 version "/Linux-PAM-" version ".tar.xz"))
2856 (sha256
2857 (base32
2858 "0kgrsj2scv5mx6w925h9hxf11jnqqs9z8s22aw94b90xm4qp3v74"))
2859 (patches (search-patches "linux-pam-unix_chkpwd.patch"
2860 "linux-pam-no-setfsuid.patch"))))
2861
2862 (build-system gnu-build-system)
2863 (inputs (list libxcrypt))
2864 (native-inputs
2865 (list flex
2866 ;; TODO: optional dependencies
2867 ;; ("cracklib" ,cracklib)
2868 ))
2869 (arguments
2870 (list
2871 ;; Most users, such as `shadow', expect the headers to be under
2872 ;; `security'.
2873 #:configure-flags #~(list (string-append "--includedir="
2874 (assoc-ref %outputs "out")
2875 "/include/security")
2876 ;; explicit libdir for pkgconfig files
2877 ;; drop with 1.5.3, which fixes
2878 ;; https://github.com/linux-pam/linux-pam/issues/466
2879 (string-append "--libdir="
2880 (assoc-ref %outputs "out")
2881 "/lib")
2882
2883 ;; XXX: <rpc/rpc.h> is missing from glibc when
2884 ;; cross-compiling, so we have to disable NIS
2885 ;; support altogether.
2886 #$@(if (%current-target-system)
2887 #~("--disable-nis")
2888 #~()))
2889
2890 #:phases (if (target-hurd?)
2891 #~(modify-phases %standard-phases
2892 (add-after 'unpack 'skip-pam-limits
2893 (lambda _
2894 ;; 'pam_limits.c' uses <sys/prctl.h>, which is
2895 ;; Linux-specific. Skip it on GNU/Hurd.
2896 (substitute* "modules/Makefile.in"
2897 (("pam_limits") "")))))
2898 #~%standard-phases)
2899
2900 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
2901 ;; isn't available.
2902 #:tests? #f))
2903 (home-page "http://www.linux-pam.org/")
2904 (synopsis "Pluggable authentication modules for Linux")
2905 (description
2906 "A *Free* project to implement OSF's RFC 86.0.
2907Pluggable authentication modules are small shared object files that can
2908be used through the PAM API to perform tasks, like authenticating a user
2909at login. Local and dynamic reconfiguration are its key features.")
2910 (license license:bsd-3)))
2911
2912(define-public python-pamela
2913 (package
2914 (name "python-pamela")
2915 (version "1.0.0")
2916 (source
2917 (origin
2918 (method git-fetch)
2919 (uri (git-reference
2920 (url "https://github.com/minrk/pamela")
2921 (commit version)))
2922 (file-name (git-file-name name version))
2923 (sha256
2924 (base32 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
2925 (build-system pyproject-build-system)
2926 (arguments
2927 (list
2928 #:tests? #f ;Test suite isn't designed to be run inside a container.
2929 #:phases
2930 #~(modify-phases %standard-phases
2931 (add-after 'unpack 'hardcode-pam.so
2932 (lambda* (#:key inputs #:allow-other-keys)
2933 (substitute* "pamela.py"
2934 (("find_library\\(\"pam\")")
2935 (format #f "~s"
2936 (search-input-file inputs "lib/libpam.so"))))))
2937 (replace 'check
2938 (lambda* (#:key tests? #:allow-other-keys)
2939 (when (and tests? (file-exists? "test_pamela.py"))
2940 (invoke "pytest" "--assert=plain" "test_pamela.py")
2941 (invoke "python" "-m" "pamela" "-a" "`whoami`")))))))
2942 (inputs (list linux-pam))
2943 (native-inputs (list python-pytest python-setuptools))
2944 (home-page "https://github.com/minrk/pamela")
2945 (synopsis "PAM interface using ctypes")
2946 (description "This package provides a PAM interface using @code{ctypes}.")
2947 (license license:expat)))
2948
2949(define-public pam-gnupg
2950 (package
2951 (name "pam-gnupg")
2952 (version "0.3")
2953 (source (origin
2954 (method git-fetch)
2955 (uri (git-reference
2956 (url "https://github.com/cruegge/pam-gnupg")
2957 (commit (string-append "v" version))))
2958 (file-name (git-file-name name version))
2959 (sha256
2960 (base32
2961 "1bf91gi6zmfzzmczxm7pajxdlgnikasvg5xsd3j0a368rcr7lf9l"))))
2962 (build-system gnu-build-system)
2963 (inputs
2964 (list gnupg linux-pam))
2965 (native-inputs
2966 (list autoconf automake libtool))
2967 (arguments
2968 `(#:tests? #f ;no tests suite
2969 #:configure-flags
2970 (list (string-append "--with-moduledir="
2971 (assoc-ref %outputs "out") "/lib/security"))))
2972
2973 (home-page "https://github.com/cruegge/pam-gnupg")
2974 (synopsis "Unlock GnuPG keys on login")
2975 (description "This package provides a PAM module that hands over your
2976login password to @code{gpg-agent}. This can be useful if you are using a
2977GnuPG-based password manager like @code{pass}.")
2978 (license license:gpl3+)))
2979
2980
2981;;;
2982;;; Kernel documentation
2983;;;
2984
2985(define-public linux-libre-documentation
2986 (package
2987 (inherit linux-libre)
2988 (name "linux-libre-documentation")
2989 (arguments
2990 (list
2991 #:tests? #f
2992 #:phases #~(modify-phases %standard-phases
2993 (delete 'configure)
2994 (replace 'build
2995 (lambda* (#:key parallel-build? #:allow-other-keys)
2996 (substitute* "Documentation/Makefile"
2997 ;; Remove problematic environment check script.
2998 ((".*scripts/sphinx-pre-install.*") ""))
2999 (invoke "make" "infodocs"
3000 "-j" (if parallel-build?
3001 (number->string (parallel-job-count))
3002 "1"))))
3003 (replace 'install
3004 (lambda _
3005 (let* ((info-dir (string-append #$output "/share/info"))
3006 (info (string-append info-dir
3007 "/TheLinuxKernel.info.gz")))
3008 (with-directory-excursion "Documentation/output"
3009 (invoke "make" "-C" "texinfo" "install-info"
3010 (string-append "infodir=" info-dir)))
3011 ;; Create a symlink, for convenience.
3012 (symlink info (string-append info-dir
3013 "/linux.info.gz"))))))))
3014 (native-inputs
3015 (list graphviz
3016 perl
3017 python
3018 python-sphinx
3019 python-pyyaml
3020 texinfo
3021 which))
3022 (synopsis "Documentation for the kernel Linux-Libre")
3023 (description "This package provides the documentation for the kernel
3024Linux-Libre, as an Info manual. To consult it, run @samp{info linux}.")))
3025
3026;;;
3027;;; Miscellaneous.
3028;;;
3029
3030(define-public powercap
3031 (package
3032 (name "powercap")
3033 (version "0.6.0")
3034 (source
3035 (origin
3036 (method git-fetch)
3037 (uri (git-reference
3038 (url "https://github.com/powercap/powercap")
3039 (commit (string-append "v" version))))
3040 (file-name (git-file-name name version))
3041 (sha256
3042 (base32 "087almlx34nzjbv8a40kxlmgy8691z2zlzkfyca8a2b7l0b2kqlp"))))
3043 (build-system cmake-build-system)
3044 (arguments
3045 (list #:configure-flags
3046 #~(list "-DBUILD_SHARED_LIBS=ON")))
3047 (home-page "https://github.com/powercap/powercap")
3048 (synopsis "Utilities for accessing the powercap Linux kernel feature")
3049 (description "This package contains utilities for accessing the powercap
3050Linux kernel feature through sysfs. It includes an implementation for working
3051with Intel @acronym{RAPL, Running Average Power Limit}.
3052It provides the commands @code{powercap-info} and @code{powercap-set}.")
3053 (license license:bsd-3)))
3054
3055(define-public powerstat
3056 (package
3057 (name "powerstat")
3058 (version "0.04.03")
3059 (source
3060 (origin
3061 (method git-fetch)
3062 (uri (git-reference
3063 (url "https://github.com/ColinIanKing/powerstat")
3064 (commit (string-append "V" version))))
3065 (file-name (git-file-name name version))
3066 (sha256
3067 (base32 "1a1fnw4rb8fx4wrcl0yc6dbjj49k6vagnq7diyw4fs4i5nin7mv3"))))
3068 (build-system gnu-build-system)
3069 (arguments
3070 `(#:make-flags
3071 (list (string-append "CC=" ,(cc-for-target))
3072 (string-append "prefix=" (assoc-ref %outputs "out")))
3073 #:tests? #f ; no test suite
3074 #:phases
3075 (modify-phases %standard-phases
3076 (delete 'configure)))) ; no configure script
3077 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
3078 (synopsis "Measure system power consumption")
3079 (description
3080 "Powerstat measures and reports your computer's power consumption in real
3081time. On mobile PCs, it uses ACPI battery information to measure the power
3082drain of the entire system.
3083
3084Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
3085domain measurements. These are available only on some hardware such as Intel
3086Sandybridge and newer, and cover only part of the machine's components such as
3087CPU, DRAM, and graphics. However, they provide accurate and immediate readings
3088and don't require a battery at all.
3089
3090The output is like @command{vmstat} but also shows power consumption statistics:
3091at the end of a run, @command{powerstat} will calculate the average, standard
3092deviation, and minimum and maximum values. It can show a nice histogram too.")
3093 (license license:gpl2)))
3094
3095(define-public psmisc
3096 (package
3097 (name "psmisc")
3098 (version "23.7")
3099 (source
3100 (origin
3101 (method url-fetch)
3102 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
3103 version ".tar.xz"))
3104 (sha256
3105 (base32 "09y30ywh1d4s4f0wgvki115kgpliq48rarmfmmjl0iq22jf5viaq"))))
3106 (build-system gnu-build-system)
3107 (arguments
3108 (list
3109 #:configure-flags
3110 (if (%current-target-system)
3111 #~(list "ac_cv_func_malloc_0_nonnull=yes"
3112 "ac_cv_func_realloc_0_nonnull=yes")
3113 #~'())))
3114 (inputs (list ncurses))
3115 (home-page "https://gitlab.com/psmisc/psmisc")
3116 (synopsis "Small utilities that use the proc file system")
3117 (description
3118 "psmisc is a set of small utilities that use the proc file system.
3119@itemize @bullet
3120@item @command{fuser} identifies processes using files or sockets;
3121@item @command{killall} kills processes by name;
3122@item @command{prtstat} prints statistics of a process;
3123@item @command{pslog} prints the log file(s) of a process;
3124@item @command{pstree} shows the currently running processes as a tree;
3125@item @command{peekfd} shows the data travelling over a file descriptor.
3126@end itemize")
3127 (license license:gpl2+)))
3128
3129(define-public util-linux
3130 (package
3131 (name "util-linux")
3132 (version "2.40.4")
3133 (source (origin
3134 (method url-fetch)
3135 (uri (string-append "mirror://kernel.org/linux/utils/"
3136 "util-linux/v" (version-major+minor version) "/"
3137 "util-linux-" version ".tar.xz"))
3138 (sha256
3139 (base32
3140 "0ygvflcr7v7x2rmr9h5mi07yx00i9368ggf3znd8bs847drsy7aw"))
3141 (patches (search-patches "util-linux-tests.patch"))
3142 (modules '((guix build utils)))
3143 (snippet
3144 ;; We take 'nologin' from Shadow, the 'logger' program from
3145 ;; GNU Inetutils and 'kill' from GNU Coreutils.
3146 '(begin
3147 (substitute* "configure"
3148 (("build_nologin=yes") "build_nologin=no")
3149 (("build_logger=yes") "build_logger=no")
3150 (("build_kill=yes") "build_kill=no"))))))
3151 (build-system gnu-build-system)
3152 (outputs '("out" ;6.4 MiB executables and documentation
3153 "lib" ;8.8 MiB shared libraries, headers and locales
3154 "static")) ;2.9 MiB static .a libraries
3155 (arguments
3156 (list #:configure-flags
3157 #~(list "--disable-use-tty-group"
3158 (string-append
3159 "--enable-fs-paths-default="
3160 "/run/setuid-programs"
3161 ":/run/current-system/profile/sbin")
3162 ;; Don't try to chown root:root mount and umount
3163 "--disable-makeinstall-chown"
3164 "--localstatedir=/var"
3165 (string-append "--localedir=" #$output:lib
3166 "/share/locale")
3167 ;; Install completions where our bash-completion package
3168 ;; expects them.
3169 (string-append "--with-bashcompletiondir=" #$output
3170 "/etc/bash_completion.d")
3171 ;; XXX: 32-bit Hurd platforms don't support 64bit time_t
3172 #$@(if (target-hurd32?)
3173 '("--disable-year2038")
3174 '()))
3175
3176 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
3177 ;; <https://bugs.gnu.org/47791>.
3178 #:tests? (and (not (%current-target-system))
3179 (not (system-hurd?)))
3180
3181 #:phases
3182 #~(modify-phases %standard-phases
3183 (add-before 'configure 'patch-build-scripts
3184 (lambda _
3185 (substitute* "configure"
3186 ;; The build system assumes that we want to install
3187 ;; libraries below $exec_prefix when $libdir does not
3188 ;; match any of the "usual" locations. Fix that.
3189 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
3190 "usrlib_execdir=$libdir"))))
3191 (add-before 'build 'set-umount-file-name
3192 (lambda _
3193 ;; Tell 'eject' the right file name of 'umount'.
3194 (substitute* "sys-utils/eject.c"
3195 (("\"/bin/umount\"")
3196 (string-append "\"" #$output "/bin/umount\"")))))
3197 (add-before 'check 'pre-check
3198 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3199 (let ((services (search-input-file (or native-inputs inputs)
3200 "etc/services")))
3201 ;; Change the test to refer to the right file.
3202 (substitute* "tests/ts/misc/mcookie"
3203 (("/etc/services")
3204 services))
3205 (substitute* "tests/helpers/test_mkfds.c"
3206 (("/etc/fstab")
3207 (which "sh")))
3208 (substitute* "tests/helpers/test_enosys.c"
3209 (("/bin/false")
3210 (which "false"))))))
3211 (add-before 'check 'disable-setarch-test
3212 (lambda _
3213 ;; The setarch tests are unreliable in QEMU's user-mode
3214 ;; emulation, which is our primary method of building
3215 ;; ARMv7 packages. See
3216 ;; <https://github.com/karelzak/util-linux/issues/601>.
3217 (substitute* "tests/ts/misc/setarch"
3218 (("ts_init_subtest.*" all)
3219 (string-append
3220 all "\n"
3221 "ts_skip \"setarch tests are unreliable under QEMU\"")))))
3222 (add-before 'check 'disable-lsns-test
3223 (lambda _
3224 ;; The lsns tests can fail due to ioctl(_, NS_GET_USERNS)
3225 ;; returning ENOTTY, indicating this kernel does not
3226 ;; support user namespaces. Curiously, this test can fail
3227 ;; on i686 even if the same test passes on x86_64 on the
3228 ;; same machine. See <https://issues.guix.gnu.org/49933>.
3229 (delete-file "tests/ts/lsns/ioctl_ns")))
3230 #$@(if (target-ppc32?)
3231 #~((add-before 'check 'disable-enosys-ioctl
3232 ;; It is unclear why this test specifically
3233 ;; fails in Guix's port of powerpc-linux.
3234 (lambda _
3235 (substitute* "tests/ts/misc/enosys"
3236 (("ts_init_subtest ioctl")
3237 (string-append
3238 "ts_init_subtest ioctl\n\n"
3239 "ts_skip \"unexplained failure on powerpc\"\n"))))))
3240 #~())
3241 (add-after 'install 'move-static-libraries
3242 (lambda _
3243 (let ((lib #$output:lib)
3244 (static #$output:static))
3245
3246 ;; Move static libraries to the "static" output.
3247 (mkdir-p (string-append static "/lib"))
3248 (with-directory-excursion lib
3249 (for-each (lambda (file)
3250 (rename-file file
3251 (string-append static "/"
3252 file)))
3253 (find-files "lib" "\\.a$"))
3254
3255 ;; Remove references to the static library from the '.la'
3256 ;; files so that Libtool does the right thing when both
3257 ;; the shared and static library is available.
3258 (substitute* (find-files "lib" "\\.la$")
3259 (("old_library=.*") "old_library=''\n"))))))
3260 (add-after 'install 'adjust-pkg-config-files
3261 (lambda _
3262 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
3263 ;; the pkg-config files to avoid a cyclic reference on "out".
3264 (substitute* (find-files (string-append #$output:lib
3265 "/lib/pkgconfig")
3266 "\\.pc$")
3267 (("^(exec_)?prefix=.*") "")))))))
3268 (inputs
3269 (list file ;for libmagic
3270 ncurses
3271 sqlite
3272 zlib))
3273 (native-inputs
3274 (list net-base ;for tests
3275 perl
3276 pkg-config))
3277 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
3278 (synopsis "Collection of utilities for the Linux kernel")
3279 (description "Util-linux is a diverse collection of Linux kernel
3280utilities. It provides dmesg and includes tools for working with file systems,
3281block devices, UUIDs, TTYs, and many other tools.")
3282
3283 (properties '((upstream-name . "util-linux")))
3284 ;; Note that util-linux doesn't use the same license for all the
3285 ;; code. GPLv2+ is the default license for a code without an
3286 ;; explicitly defined license.
3287 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
3288 license:bsd-4 license:public-domain))))
3289
3290;; util-linux optionally supports udev, which allows lsblk to read file system
3291;; metadata without special privileges. Add it as a separate package to avoid
3292;; a circular dependency, and to keep the size small.
3293(define-public util-linux+udev
3294 (package/inherit
3295 util-linux
3296 (name "util-linux-with-udev")
3297 (inputs
3298 (modify-inputs (package-inputs util-linux)
3299 (prepend eudev)))))
3300
3301(define-public chimerautils
3302 (package
3303 (name "chimerautils")
3304 (version "15.0.3")
3305 (source
3306 (origin
3307 (method git-fetch)
3308 (uri (git-reference
3309 (url "https://github.com/chimera-linux/chimerautils")
3310 (commit (string-append "v" version))))
3311 (file-name (git-file-name name version))
3312 (sha256
3313 (base32 "1inagax7gg2rl2a9ymfxxk71xrwd4sngwc45ph61rlk345jhnxpw"))))
3314 (build-system meson-build-system)
3315 (arguments
3316 (list
3317 #:tests? #f)) ;no test suite
3318 (inputs (list acl
3319 libedit
3320 libxo
3321 ncurses
3322 openssl
3323 zlib
3324 (list zstd "lib")))
3325 (native-inputs (list flex bison pkg-config))
3326 (home-page "https://github.com/chimera-linux/chimerautils")
3327 (synopsis "The FreeBSD-based core Linux userland from Chimera Linux")
3328 (description
3329 "This is a port of the FreeBSD userland for Linux provided by
3330the Chimera Linux distribution. Essentially, it is a collection of UNIX tools
3331such as @command{grep}, @command{cp}, @command{vi}, etc. and can be used as an
3332alternative to the corresponding implementations from the GNU project.")
3333 (license license:bsd-2)))
3334
3335(define-public dislocker
3336 (package
3337 (name "dislocker")
3338 (version "0.7.3")
3339 (home-page "https://github.com/Aorimn/dislocker")
3340 (source (origin
3341 (method git-fetch)
3342 (uri (git-reference
3343 (url home-page)
3344 (commit (string-append "v" version))))
3345 (file-name (git-file-name name version))
3346 (sha256
3347 (base32
3348 "1ak68s1v5dwh8y2dy5zjybmrh0pnqralmyqzis67y21m87g47h2k"))))
3349 (build-system cmake-build-system)
3350 (arguments
3351 '(#:tests? #f)) ;no test suite
3352 (inputs (list fuse-2 mbedtls-lts))
3353 (synopsis "FUSE driver to read/write Windows BitLocker drives")
3354 (description
3355 "This package provides means to to read BitLocker encrypted
3356partitions. Write functionality is also provided but check the README.")
3357 (license license:gpl2+)))
3358
3359(define-public dwarves
3360 (package
3361 (name "dwarves")
3362 (version "1.29")
3363 (source (origin
3364 (method git-fetch)
3365 (uri (git-reference
3366 (url "https://github.com/acmel/dwarves")
3367 (commit (string-append "v" version))))
3368 (file-name (git-file-name name version))
3369 (sha256
3370 (base32
3371 "1ia3r77zyw7r8mydy1zrrdnqzm9ginsvf9pqviq48rglihhddvli"))
3372 (patches
3373 (search-patches "dwarves-threading-reproducibility.patch"))))
3374 (build-system cmake-build-system)
3375 (arguments (list #:configure-flags #~(list "-D__LIB=lib"
3376 "-DLIBBPF_EMBEDDED=OFF")
3377 #:tests? #f)) ;no test suite
3378 (native-inputs (list pkg-config))
3379 (inputs (list libbpf))
3380 (home-page "https://github.com/acmel/dwarves")
3381 (synopsis "Debugging information processing library and utilities")
3382 (description "Dwarves is a set of tools that use the debugging information
3383inserted in ELF binaries by compilers such as GCC, used by well known
3384debuggers such as GDB.
3385
3386Utilities in the Dwarves suite include @command{pahole}, that can be used to
3387find alignment holes in structures and classes in languages such as C, C++,
3388but not limited to these. These tools can also be used to encode and read the
3389BTF type information format used with the kernel Linux @code{bpf} syscall.
3390
3391The @command{codiff} command can be used to compare the effects changes in
3392source code generate on the resulting binaries.
3393
3394The @command{pfunct} command can be used to find all sorts of information
3395about functions, inlines, decisions made by the compiler about inlining, etc.
3396
3397The @command{pahole} command can be used to use all this type information to
3398pretty print raw data according to command line directions.
3399
3400Headers can have its data format described from debugging info and offsets from
3401it can be used to further format a number of records.
3402
3403Finally, the @command{btfdiff} command can be used to compare the output of
3404pahole from BTF and DWARF, to make sure they produce the same results.")
3405 (license license:gpl2+)))
3406
3407(define-public fbset
3408 (package
3409 (name "fbset")
3410 (version "2.1")
3411 (source
3412 (origin
3413 (method url-fetch)
3414 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
3415 version ".tar.gz"))
3416 (sha256
3417 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
3418 (build-system gnu-build-system)
3419 (arguments
3420 '(#:modules ((guix build gnu-build-system)
3421 (guix build utils)
3422 (srfi srfi-26))
3423 #:phases
3424 (modify-phases %standard-phases
3425 (delete 'configure) ; no configure script
3426 (add-before 'install 'pre-install
3427 (lambda* (#:key outputs #:allow-other-keys)
3428 (let ((out (assoc-ref outputs "out")))
3429 (substitute* "Makefile"
3430 (("mknod ") "true ")
3431 ;; The Makefile doesn't honour PREFIX or similar.
3432 (("/usr") out))
3433 (mkdir out)
3434 (with-directory-excursion out
3435 (for-each mkdir-p (list "sbin"
3436 "man/man5"
3437 "man/man8")))
3438 #t)))
3439 (add-after 'install 'install-fb.modes
3440 (lambda* (#:key outputs #:allow-other-keys)
3441 (let* ((out (assoc-ref outputs "out"))
3442 (etc (string-append out "/etc")))
3443 (for-each (cut install-file <> etc)
3444 (find-files "etc" "^fb\\.modes"))
3445 (symlink "fb.modes.ATI"
3446 (string-append etc "/fb.modes"))
3447 #t))))
3448 ;; Parallel building races to create modes.tab.c.
3449 #:parallel-build? #f
3450 #:tests? #f)) ; no test suite
3451 (native-inputs
3452 (list bison flex))
3453 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
3454 (synopsis "Show and modify Linux frame buffer settings")
3455 (description
3456 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
3457different kinds of graphic displays. The @command{fbset} utility can query and
3458change various device settings such as depth, virtual resolution, and timing
3459parameters.")
3460 (license license:gpl2)))
3461
3462(define-public procps
3463 (package
3464 (name "procps")
3465 (version "4.0.3")
3466 (source (origin
3467 (method url-fetch)
3468 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
3469 "procps-ng-" version ".tar.xz"))
3470 (sha256
3471 (base32
3472 "14ms9mkqr1mgl3h5yl6w8m57cf39k382nv7qms78vqbaz728wg1h"))
3473 (patches (search-patches "procps-strtod-test.patch"))))
3474 (build-system gnu-build-system)
3475 (arguments
3476 (list #:modules '((guix build utils)
3477 (guix build gnu-build-system)
3478 (srfi srfi-1)
3479 (srfi srfi-26))
3480 #:configure-flags
3481 (if (%current-target-system)
3482 #~'("ac_cv_func_malloc_0_nonnull=yes"
3483 "ac_cv_func_realloc_0_nonnull=yes")
3484 #~'())
3485 #:phases
3486 #~(modify-phases %standard-phases
3487 (add-after 'install 'post-install
3488 ;; Remove commands and man pages redudant with
3489 ;; Coreutils.
3490 (lambda* (#:key outputs #:allow-other-keys)
3491 (let* ((out #$output)
3492 (dup (append-map (cut find-files out <>)
3493 '("^kill" "^uptime"))))
3494 (for-each delete-file dup))))
3495 #$@(if (system-hurd?)
3496 #~((add-after 'unpack 'skip-tests
3497 (lambda _
3498 (substitute* "library/tests/test_version.c"
3499 (("^int main\\(.*" all)
3500 (string-append all "{\n exit (77);//"))))))
3501 #~()))))
3502 (inputs (list ncurses))
3503 (native-inputs (list pkg-config))
3504 (home-page "https://gitlab.com/procps-ng/procps/")
3505 (synopsis "Utilities that give information about processes")
3506 (description
3507 "Procps is the package that has a bunch of small useful utilities
3508that give information about processes using the Linux /proc file system.
3509The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
3510slabtop, tload, top, vmstat, w, watch and sysctl.")
3511 (properties '((upstream-name . "procps-ng")))
3512 (license license:gpl2)))
3513
3514(define-public usbutils
3515 (package
3516 (name "usbutils")
3517 (version "018")
3518 (source
3519 (origin
3520 (method url-fetch)
3521 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
3522 "usbutils-" version ".tar.xz"))
3523 (sha256
3524 (base32 "14xd7j9fl3pm0z4dhqj3mf9paqk431kq4vi602f5hiw5nmcqpxl3"))))
3525 (build-system meson-build-system)
3526 (outputs (list "out" "python"))
3527 (arguments
3528 (list
3529 #:phases
3530 #~(modify-phases %standard-phases
3531 (add-after 'install 'separate-python-output
3532 ;; Separating one Python script shaves more than 106 MiB from :out.
3533 (lambda _
3534 (for-each (lambda (file)
3535 (let ((old (string-append #$output "/" file))
3536 (new (string-append #$output:python "/" file)))
3537 (mkdir-p (dirname new))
3538 (rename-file old new)))
3539 (list "bin/lsusb.py"))))
3540 (add-after 'install 'install-usbreset
3541 (lambda _
3542 (install-file "usbreset"
3543 (string-append #$output "/bin")))))))
3544 (native-inputs (list pkg-config))
3545 (inputs (list eudev libusb python))
3546 (home-page "http://www.linux-usb.org/")
3547 (synopsis
3548 "Tools for working with USB devices")
3549 (description
3550 "Collection of tools to query what type of USB devices are connected to
3551the system, including @command{lsusb}. The experimental @command{usbreset}
3552command included in the package, but be aware that it may not work for all
3553devices.")
3554 (license license:gpl2+)))
3555
3556(define-public usbip-utils
3557 (package
3558 (name "usbip-utils")
3559 (version (package-version linux-libre))
3560 (source (package-source linux-libre))
3561 (build-system gnu-build-system)
3562 (arguments
3563 '(#:configure-flags '("--disable-static")
3564 #:phases (modify-phases %standard-phases
3565 (add-after 'unpack 'enter-subdirectory
3566 (lambda _
3567 (chdir "tools/usb/usbip")
3568 #t)))))
3569 (native-inputs
3570 `(("automake" ,automake)
3571 ("autoreconf" ,autoconf)
3572 ("libtool" ,libtool)))
3573 (inputs (list eudev))
3574 (home-page (package-home-page linux-libre))
3575 (synopsis "Utilities for sharing USB devices over IP networks")
3576 (description
3577 "The USB/IP protocol enables to pass USB device from a server to
3578a client over the network. The server is a machine which shares an
3579USB device and the client is a machine which uses USB device provided by
3580a server over the network. The USB device may be either physical device
3581connected to a server or software entity created on a server using USB
3582gadget subsystem. The usbip-utils are userspace tools to used to handle
3583connection and management on both side. The client needs the @file{vhci-hcd}
3584Linux kernel module and the server needs the @file{usbip_host} Linux kernel
3585module.")
3586 (license license:gpl2)))
3587
3588(define-public e2fsprogs
3589 (package
3590 (name "e2fsprogs")
3591 (version "1.47.2")
3592 (source (origin
3593 (method url-fetch)
3594 (uri (string-append
3595 "mirror://kernel.org/linux/kernel/people/tytso/"
3596 "e2fsprogs/v" version "/"
3597 "e2fsprogs-" version ".tar.xz"))
3598 (sha256
3599 (base32
3600 "0g76fhnyzr2awwybd6c16439l80r5dv4kbfaq7cr908fr9j2w908"))))
3601 (build-system gnu-build-system)
3602 (inputs
3603 `((,util-linux "lib") ,@(if (target-hurd?) '() (list fuse))))
3604 (native-inputs (list pkg-config
3605 texinfo ;for the libext2fs Info manual
3606 ;; For tests.
3607 perl
3608 procps))
3609 (arguments
3610 `(;; util-linux is the preferred source for some of the libraries and
3611 ;; commands, so disable them (see, e.g.,
3612 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
3613 #:configure-flags (list "--disable-libblkid"
3614 "--disable-libuuid" "--disable-uuidd"
3615 "--disable-fsck"
3616
3617 ;; Use symlinks instead of hard links for
3618 ;; 'fsck.extN' etc. This makes the resulting nar
3619 ;; smaller and is preserved across copies.
3620 "--enable-symlink-install"
3621
3622 (string-append "LDFLAGS=-Wl,-rpath="
3623 (assoc-ref %outputs "out")
3624 "/lib")
3625
3626 ;; Install libext2fs et al.
3627 "--enable-elf-shlibs")
3628
3629 #:phases
3630 (modify-phases %standard-phases
3631 (add-before 'configure 'patch-shells
3632 (lambda _
3633 (substitute* "configure"
3634 (("/bin/sh (.*)parse-types.sh" _ dir)
3635 (string-append (which "sh") " " dir
3636 "parse-types.sh")))
3637 (substitute* "MCONFIG.in"
3638 (("INSTALL_SYMLINK = /bin/sh")
3639 "INSTALL_SYMLINK = sh"))
3640 (substitute* (find-files "." "^Makefile.in$")
3641 (("#!/bin/sh")
3642 (string-append "#!" (which "sh"))))))
3643 (add-after 'install 'install-libs
3644 (lambda* (#:key outputs #:allow-other-keys)
3645 (let* ((out (assoc-ref outputs "out"))
3646 (lib (string-append out "/lib")))
3647 (invoke "make" "install-libs")
3648
3649 ;; Make the .a writable so that 'strip' works.
3650 ;; Failing to do that, due to debug symbols, we
3651 ;; retain a reference to the final
3652 ;; linux-libre-headers, which refer to the
3653 ;; bootstrap binaries.
3654 (let ((archives (find-files lib "\\.a$")))
3655 (for-each (lambda (file)
3656 (chmod file #o666))
3657 archives)))))
3658 ,@(if (system-hurd?)
3659 '((add-after 'unpack 'skip-tests
3660 (lambda _
3661 (with-directory-excursion "tests"
3662 (for-each
3663 (lambda (directory)
3664 (delete-file-recursively directory))
3665 '("d_bad_ostype"
3666 "f_detect_junk"
3667 "f_extent_oobounds"
3668 "j_ext_long_revoke_trans"
3669 "j_ext_long_trans"
3670 "j_long_revoke_trans"
3671 "j_long_revoke_trans_mcsum_32bit"
3672 "j_long_revoke_trans_mcsum_64bit"
3673 "j_long_trans"
3674 "j_long_trans_mcsum_32bit"
3675 "j_long_trans_mcsum_64bit"
3676 "j_short_revoke_trans"
3677 "j_short_revoke_trans_mcsum_64bit"
3678 "j_short_trans_64bit"
3679 "j_short_trans"
3680 "j_short_trans_mcsum_64bit"
3681 "j_short_trans_old_csum"
3682 "j_short_trans_open_recover"
3683 "j_short_trans_recover"
3684 "j_short_trans_recover_mcsum_64bit"
3685 "j_short_uncommitted_trans"
3686 "j_short_uncommitted_trans_mcsum_64bit"
3687 "m_error_behavior"
3688 "m_minrootdir"
3689 "m_rootdir"
3690 "r_32to64bit_expand_full"
3691 "r_expand_full"
3692 "r_fixup_lastbg_big"
3693 "t_change_uuid"
3694 "t_change_uuid_mcsum"
3695 "t_change_uuid_mcsum_mounted"
3696 "t_change_uuid_mcsum_seed_mounted"
3697 "t_change_uuid_mounted"
3698 "t_disable_changed_csum_seed"
3699 "t_disable_changed_csum_seed_mounted"
3700 "t_disable_csum_seed"
3701 "t_disable_meta_csum_and_seed"
3702 "t_enable_csum_seed"
3703 "t_format_csum_seed"
3704 "t_replay_and_set"
3705 "u_compound_rollback"
3706 "u_corrupt_blk_csum"
3707 "u_corrupt_blk_csum_force"
3708 "u_corrupt_key_csum"
3709 "u_debugfs_opt"
3710 "u_dryrun"
3711 "u_e2fsck_opt"
3712 "u_errorout"
3713 "u_force"
3714 "u_force_dryrun"
3715 "u_incomplete"
3716 "u_mke2fs_opt"
3717 "u_mke2fs_opt_oddsize"
3718 "u_offset"
3719 "u_onefile_bad"
3720 "u_resize2fs_opt"
3721 "u_revert_64bitmcsum_onefile"
3722 "u_revert_all_onefile"
3723 "u_revert_upgrade_to_64bitmcsum"
3724 "u_tune2fs_opt"
3725 "u_undo_undo"
3726 "u_wrong_fs"))))))
3727 '()))))
3728 (home-page "https://e2fsprogs.sourceforge.net/")
3729 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
3730 (description
3731 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
3732 (license (list license:gpl2 ;programs
3733 license:lgpl2.0 ;libext2fs
3734 license:x11)))) ;libuuid
3735
3736(define e2fsprogs/static
3737 (static-package
3738 (package (inherit e2fsprogs)
3739 (arguments
3740 ;; Do not build shared libraries.
3741 (substitute-keyword-arguments (package-arguments e2fsprogs)
3742 ((#:configure-flags _)
3743 '(list "--disable-blkid" "--disable-fuse2fs"))
3744 ((#:make-flags _)
3745 '(list)))))))
3746
3747(define-public e2fsck/static
3748 (package
3749 (name "e2fsck-static")
3750 (version (package-version e2fsprogs))
3751 (build-system trivial-build-system)
3752 (source #f)
3753 (inputs
3754 (list e2fsprogs/static))
3755 (arguments
3756 `(#:modules ((guix build utils))
3757 #:builder
3758 (begin
3759 (use-modules (guix build utils)
3760 (ice-9 ftw)
3761 (srfi srfi-26))
3762
3763 (let ((e2fsck (search-input-file %build-inputs "/sbin/e2fsck"))
3764 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
3765 (mkdir-p bin)
3766 (with-directory-excursion bin
3767 (copy-file e2fsck "e2fsck")
3768 (remove-store-references "e2fsck")
3769 (chmod "e2fsck" #o555))
3770 #t))))
3771 (home-page (package-home-page e2fsprogs))
3772 (synopsis "Statically-linked e2fsck command from e2fsprogs")
3773 (description "This package provides statically-linked e2fsck command taken
3774from the e2fsprogs package. It is meant to be used in initrds.")
3775 (license (package-license e2fsprogs))))
3776
3777(define-public extundelete
3778 (package
3779 (name "extundelete")
3780 (version "0.2.4")
3781 (source
3782 (origin
3783 (method url-fetch)
3784 (uri (string-append "mirror://sourceforge/extundelete/"
3785 "extundelete/" version "/extundelete-"
3786 version ".tar.bz2"))
3787 (sha256
3788 (base32
3789 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
3790 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
3791 (build-system gnu-build-system)
3792 (inputs (list e2fsprogs))
3793 (home-page "https://extundelete.sourceforge.net/")
3794 (synopsis "Recover deleted files from ext2/3/4 partitions")
3795 (description
3796 "Extundelete is a set of tools that can recover deleted files from an
3797ext3 or ext4 partition.")
3798 (license license:gpl2)))
3799
3800(define-public zerofree
3801 (package
3802 (name "zerofree")
3803 (version "1.1.1")
3804 (home-page "https://frippery.org/uml/")
3805 (source (origin
3806 (method url-fetch)
3807 (uri (string-append home-page name "-" version
3808 ".tgz"))
3809 (sha256
3810 (base32
3811 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
3812 (build-system gnu-build-system)
3813 (arguments
3814 '(#:phases
3815 (modify-phases %standard-phases
3816 (delete 'configure) ; no configure script
3817 (replace 'install
3818 ;; The Makefile lacks an ‘install’ target.
3819 (lambda* (#:key outputs #:allow-other-keys)
3820 (let* ((out (assoc-ref outputs "out"))
3821 (bin (string-append out "/bin")))
3822 (chmod "zerofree" #o555)
3823 (install-file "zerofree" bin)
3824 #t))))
3825 #:tests? #f)) ; no tests
3826 (inputs `(("libext2fs" ,e2fsprogs)))
3827 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
3828 (description
3829 "Zerofree finds the unallocated blocks with non-zero value content in an
3830ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
3831This is a simple way to make disk images more compressible.
3832Zerofree requires the file system to be unmounted or mounted read-only.")
3833 (license license:gpl2)))
3834
3835(define-public strace
3836 (package
3837 (name "strace")
3838 (version "6.16")
3839 (source
3840 (origin
3841 (method git-fetch)
3842 (uri (git-reference
3843 (url "https://github.com/strace/strace")
3844 (commit (string-append "v" version))))
3845 (file-name (git-file-name name version))
3846 (sha256
3847 (base32 "0p405lf76vksa3ldlq8fjjz5760q2rgr0dvms6bdp3dvc72kr82i"))
3848 (patches (search-patches "strace-readlink-tests.patch"))))
3849 (build-system gnu-build-system)
3850 (arguments
3851 (list
3852 #:phases
3853 #~(modify-phases %standard-phases
3854 ;; Needed for the 'bootstrap phase.
3855 (add-after 'unpack 'patch-source-shebangs-initial
3856 (assoc-ref %standard-phases 'patch-source-shebangs))
3857 (add-after 'unpack 'patch-test-shebangs
3858 (lambda _
3859 (substitute* '("tests/detach-vfork.test"
3860 "tests/gen_tests.sh"
3861 "tests/kill-on-exit.sh")
3862 (("#!/bin/sh")
3863 (string-append "#!" (which "sh")))))))
3864 #:configure-flags
3865 ''("--with-libunwind"
3866 ;; Don't fail if the architecture doesn't support different
3867 ;; personalities.
3868 "--enable-mpers=check")
3869 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
3870 #:parallel-tests? #f)) ; undeterministic failures
3871 (inputs (list libunwind))
3872 (native-inputs
3873 (list autoconf
3874 automake
3875 perl
3876 m4
3877 ;; For some tests
3878 util-linux))
3879 (home-page "https://strace.io")
3880 (synopsis "System call tracer for Linux")
3881 (description
3882 "strace is a system call tracer, i.e. a debugging tool which prints out a
3883trace of all the system calls made by a another process/program.")
3884 (license license:lgpl2.1+)))
3885
3886(define-public ltrace
3887 (package
3888 (name "ltrace")
3889 (version "0.7.3")
3890 (source (origin
3891 (method url-fetch)
3892 (uri (string-append "http://www.ltrace.org/ltrace_" version
3893 ".orig.tar.bz2"))
3894 (sha256
3895 (base32
3896 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
3897 (build-system gnu-build-system)
3898 (inputs `(("libelf" ,elfutils)))
3899 (arguments
3900 ;; Compilation uses -Werror by default, but it fails.
3901 '(#:configure-flags '("--disable-werror")))
3902 (home-page "https://www.ltrace.org/")
3903 (synopsis "Library call tracer for Linux")
3904 (description
3905 "ltrace intercepts and records dynamic library calls which are called by
3906an executed process and the signals received by that process. It can also
3907intercept and print the system calls executed by the program.")
3908 (license license:gpl2+)))
3909
3910(define-public alsa-ucm-conf
3911 (package
3912 (name "alsa-ucm-conf")
3913 (version "1.2.11")
3914 (source (origin
3915 (method url-fetch)
3916 (uri (string-append
3917 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
3918 version ".tar.bz2"))
3919 (sha256
3920 (base32
3921 "10dfzvrmpp9swflw47nxf35an6gj3ilb4wlggdnng8g2637h2z1q"))))
3922 (build-system copy-build-system)
3923 (arguments
3924 '(#:install-plan
3925 '(("ucm" "share/alsa/ucm")
3926 ("ucm2" "share/alsa/ucm2"))))
3927 (home-page "https://www.alsa-project.org/wiki/Main_Page")
3928 (synopsis "The Advanced Linux Sound Architecture Use Case Manager")
3929 (description
3930 "This package contains Advanced Linux Sound Architecture Use Case Manager
3931configuration of audio input/output names and routing for specific audio
3932hardware.")
3933 (license license:bsd-3)))
3934
3935(define-public alsa-topology-conf
3936 (package
3937 (name "alsa-topology-conf")
3938 (version "1.2.4")
3939 (source (origin
3940 (method url-fetch)
3941 (uri (string-append
3942 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
3943 version ".tar.bz2"))
3944 (sha256
3945 (base32
3946 "01zdg6q4s6d01k39z96wi4vbhrfw1i2g4yi5dijwfk6a5vjfdq2m"))))
3947 (build-system copy-build-system)
3948 (arguments
3949 '(#:install-plan
3950 '(("topology" "share/alsa/topology"))))
3951 (home-page "https://www.alsa-project.org/wiki/Main_Page")
3952 (synopsis "The Advanced Linux Sound Architecture libraries")
3953 (description
3954 "This package contains Advanced Linux Sound Architecture topology
3955configuration files that can be used for specific audio hardware.")
3956 (license license:bsd-3)))
3957
3958(define-public alsa-lib
3959 (package
3960 (name "alsa-lib")
3961 (version "1.2.11")
3962 (source (origin
3963 (method url-fetch)
3964 (uri (string-append
3965 "https://www.alsa-project.org/files/pub/lib/"
3966 name "-" version ".tar.bz2"))
3967 (sha256
3968 (base32
3969 "0kdvjlknc50fwfdkxj0z12xbz21skb3gnwlh6lvsvycmp5ljygwz"))))
3970 (build-system gnu-build-system)
3971 (arguments
3972 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3973 (assoc-ref %outputs "out")
3974 "/lib"))
3975 #:phases
3976 (modify-phases %standard-phases
3977 (add-before 'install 'pre-install
3978 (lambda* (#:key inputs outputs #:allow-other-keys)
3979 (let* ((ucm
3980 (string-append (assoc-ref inputs "alsa-ucm-conf")))
3981 (topology
3982 (string-append (assoc-ref inputs "alsa-topology-conf")))
3983 (alsa
3984 (string-append (assoc-ref outputs "out") "/share/alsa"))
3985 (ucm-share
3986 (string-append ucm "/share/alsa/ucm"))
3987 (ucm2-share
3988 (string-append ucm "/share/alsa/ucm2"))
3989 (topology-share
3990 (string-append topology "/share/alsa/topology")))
3991 (mkdir-p alsa)
3992 (symlink ucm-share (string-append alsa "/ucm"))
3993 (symlink ucm2-share (string-append alsa "/ucm2"))
3994 (symlink topology-share (string-append alsa "/topology")))
3995 #t)))))
3996 (inputs
3997 (list alsa-ucm-conf alsa-topology-conf))
3998 (home-page "https://www.alsa-project.org/wiki/Main_Page")
3999 (synopsis "The Advanced Linux Sound Architecture libraries")
4000 (description
4001 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4002MIDI functionality to the Linux-based operating system.")
4003 (license license:lgpl2.1+)))
4004
4005(define-public alsa-utils
4006 (package
4007 (name "alsa-utils")
4008 (version "1.2.11")
4009 (source (origin
4010 (method url-fetch)
4011 (uri (string-append
4012 "https://www.alsa-project.org/files/pub/utils/"
4013 name "-" version ".tar.bz2"))
4014 (sha256
4015 (base32
4016 "19r8qi6b7sd2p1mhxfqrp18wrgjw5s6rp5ygimb1w59zi0xcmils"))))
4017 (build-system gnu-build-system)
4018 (arguments
4019 (list
4020 #:configure-flags
4021 #~(list
4022 ;; The udev rule is responsible for restoring the volume.
4023 (string-append "--with-udev-rules-dir=" #$output "/lib/udev/rules.d"))
4024 #:phases
4025 #~(modify-phases %standard-phases
4026 (add-before 'install 'pre-install
4027 (lambda _
4028 ;; Don't try to mkdir /var/lib/alsa.
4029 (substitute* "Makefile"
4030 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
4031 "true\n")))))))
4032 (native-inputs
4033 (list docbook-xml-4.2 docbook-xsl xmlto
4034 gettext-minimal))
4035 (inputs
4036 (list libsamplerate ncurses alsa-lib))
4037 (home-page "http://www.alsa-project.org/")
4038 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
4039 (description
4040 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4041MIDI functionality to the Linux-based operating system.")
4042
4043 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
4044 ;; GPLv2-only.
4045 (license license:gpl2)))
4046
4047(define-public alsa-plugins
4048 (package
4049 (name "alsa-plugins")
4050 (version "1.2.2")
4051 (source (origin
4052 (method url-fetch)
4053 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
4054 name "-" version ".tar.bz2"))
4055 (sha256
4056 (base32
4057 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
4058 (build-system gnu-build-system)
4059 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
4060 ;; be split, there are references to both in files.
4061 ;; TODO: Remove OSS related plugins, they add support to run native
4062 ;; ALSA applications on OSS however we do not offer OSS and OSS is
4063 ;; obsolete.
4064 (outputs '("out" "pulseaudio" "jack"))
4065 (native-search-paths
4066 (list (search-path-specification
4067 (variable "ALSA_PLUGIN_DIR")
4068 (files '("lib/alsa-lib"))
4069 (separator #f))))
4070 (arguments
4071 `(#:configure-flags '(;; Do not install a "local" configuration targeted
4072 ;; for /etc/alsa. On Guix System plugins are loaded from
4073 ;; the ALSA service, and other distributions likely
4074 ;; won't use these files.
4075 "--with-alsalconfdir=/tmp/noop")
4076 #:phases
4077 (modify-phases %standard-phases
4078 (add-after 'install 'split
4079 (lambda* (#:key inputs outputs #:allow-other-keys)
4080 ;; Distribute the binaries to the various outputs.
4081 (let* ((out (assoc-ref outputs "out"))
4082 (jack (assoc-ref outputs "jack"))
4083 (jacklib (string-append jack "/lib/alsa-lib"))
4084 (pua (assoc-ref outputs "pulseaudio"))
4085 (pualib (string-append pua "/lib/alsa-lib")))
4086 ;; For jack.
4087 (mkdir-p jacklib)
4088 (for-each (lambda (file)
4089 (rename-file file (string-append jacklib "/" (basename file))))
4090 (find-files out ".*jack\\.(la|so)"))
4091 ;; For pulseaudio.
4092 (mkdir-p pualib)
4093 (for-each (lambda (file)
4094 (rename-file file (string-append pualib "/" (basename file))))
4095 (find-files out ".*pulse\\.(la|so)"))
4096 #t))))))
4097 (inputs
4098 (list alsa-lib
4099 jack-1
4100 speex ; libspeexdsp resampling plugin
4101 libsamplerate ; libsamplerate resampling plugin
4102 ffmpeg ; libavcodec resampling plugin, a52 plugin
4103 pulseaudio)) ; PulseAudio plugin
4104 (native-inputs
4105 (list pkg-config))
4106 (home-page "http://www.alsa-project.org/")
4107 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
4108 (description
4109 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4110MIDI functionality to the Linux-based operating system. This package enhances ALSA
4111by providing additional plugins which include: upmixing, downmixing, jackd and
4112pulseaudio support for native alsa applications, format conversion (s16 to a52), and
4113external rate conversion.")
4114 (license (list license:gpl2+
4115 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
4116 license:lgpl2.1+))))
4117
4118(define-public iptables
4119 (package
4120 (name "iptables")
4121 (version "1.8.11")
4122 (source
4123 (origin
4124 (method url-fetch)
4125 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
4126 version ".tar.xz")))
4127 (sha256
4128 (base32 "1cp7kw0d3fpmfmbl4adh88v02wnj4s5rfgyxsk52pjgqbvah6wyq"))))
4129 (build-system gnu-build-system)
4130 (native-inputs
4131 (list pkg-config flex bison))
4132 (inputs
4133 (list libmnl libnftnl/pinned))
4134 (arguments
4135 (list #:tests? #f ; no test suite
4136 #:configure-flags ; add $libdir to the RUNPATH of executables
4137 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))))
4138 (home-page "https://www.netfilter.org/projects/iptables/index.html")
4139 (synopsis "Programs to configure Linux IP packet filtering rules")
4140 (description
4141 "@command{iptables} is the user-space command line program used to
4142configure the Linux 2.4.x and later IPv4 packet filtering ruleset
4143(@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
4144
4145This package also includes @command{ip6tables}, which is used to configure the
4146IPv6 packet filter.
4147
4148Both commands are targeted at system administrators.")
4149 (properties
4150 '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
4151 (license license:gpl2+)))
4152
4153(define-public iptables-nft
4154 (package
4155 (inherit iptables)
4156 (name "iptables-nft")
4157 (source #f)
4158 (build-system copy-build-system)
4159 (arguments
4160 (list
4161 #:phases
4162 #~(modify-phases %standard-phases
4163 (delete 'unpack)
4164 (replace 'install
4165 (lambda* (#:key inputs #:allow-other-keys)
4166 (for-each
4167 (lambda (command-path)
4168 (let ((link-path (string-append #$output command-path)))
4169 (mkdir-p (dirname link-path))
4170 (symlink (search-input-file inputs "sbin/xtables-nft-multi")
4171 link-path)))
4172 (apply append
4173 '("/bin/iptables-xml")
4174 (map (lambda (xtables)
4175 (list (string-append "/sbin/" xtables)
4176 (string-append "/sbin/" xtables "-restore")
4177 (string-append "/sbin/" xtables "-save")))
4178 '("arptables"
4179 "ebtables"
4180 "iptables"
4181 "ip6tables")))))))))
4182 (inputs (list iptables))
4183 (native-inputs '())
4184 (synopsis
4185 "Programs to configure Linux IP packet filtering rules (nftables API)")))
4186
4187(define-public irqbalance
4188 (package
4189 (name "irqbalance")
4190 (version "1.9.4")
4191 (source
4192 (origin
4193 (method git-fetch)
4194 (uri (git-reference
4195 (url "https://github.com/irqbalance/irqbalance")
4196 (commit (string-append "v" version))))
4197 (file-name (git-file-name name version))
4198 (sha256
4199 (base32 "1jswxr0jcxz83j1nanl6xaxpw001l0hfb2xvvy2k970g1g1kpszd"))))
4200 (build-system gnu-build-system)
4201 (inputs (list glib ncurses libnl libcap-ng))
4202 (native-inputs (list autoconf automake libtool pkg-config))
4203 (home-page "https://irqbalance.github.io/irqbalance/")
4204 (synopsis "Daemon used to load balance CPU interrupts")
4205 (description
4206 "Irqbalance is a daemon to help balance the CPU load generated by
4207interrupts across all of a systems CPUs. Irqbalance identifies the highest
4208volume interrupt sources, and isolates each of them to a single unique CPU, so
4209that load is spread as much as possible over an entire processor set, while
4210minimizing cache miss rates for irq handlers.")
4211 (license license:gpl2)))
4212
4213(define-public bolt
4214 (package
4215 (name "bolt")
4216 (version "0.9.10")
4217 (source (origin
4218 (method git-fetch)
4219 (uri (git-reference
4220 (url "https://gitlab.freedesktop.org/bolt/bolt")
4221 (commit version)))
4222 (file-name (git-file-name name version))
4223 (sha256
4224 (base32
4225 "1vw4vzyhkpm73snnfciy7x88ja72cv5isc27k91jvmy2350b29yx"))))
4226 (build-system meson-build-system)
4227 (arguments
4228 (list #:configure-flags '(list "--localstatedir=/var")
4229 #:glib-or-gtk? #t ;To wrap binaries and/or compile schemas
4230 #:phases #~(modify-phases %standard-phases
4231 (add-after 'unpack 'replace-directories
4232 (lambda* (#:key outputs #:allow-other-keys)
4233 (substitute* "meson.build"
4234 (("udev.get_variable\\(pkgconfig: 'udevdir'\\)")
4235 (string-append "'" #$output "/lib/udev'"))
4236 ;; Don't install in /var
4237 (("not systemd\\.found\\(\\)")
4238 "false"))))
4239 (add-before 'install 'no-polkit-magic
4240 (lambda* (#:key outputs #:allow-other-keys)
4241 (setenv "PKEXEC_UID" "something"))))))
4242 (native-inputs (list pkg-config
4243 `(,glib "bin") python asciidoc umockdev))
4244 (inputs (list eudev dbus polkit))
4245 (synopsis "Thunderbolt 3 device manager")
4246 (description
4247 "This package provides @command{boltd}, a userspace daemon
4248for Thunderbolt devices, and @command{boltctl}, a command-line utility for
4249managing those devices.
4250
4251The daemon @command{boltd} exposes devices via D-Bus to clients. It also
4252stores a database of previously authorized devices and will, depending on the
4253policy set for the individual devices, automatically authorize newly connected
4254devices without user interaction.
4255
4256The command-line utility @command{boltctl} manages Thunderbolt devices via
4257@command{boltd}. It can list devices, monitor changes, and initiate
4258authorization of devices.")
4259 (home-page "https://gitlab.freedesktop.org/bolt/bolt")
4260 (properties `((lint-hidden-cpe-vendors . ("boltcms" "puppet"))))
4261 (license license:gpl2+)))
4262
4263(define-public jitterentropy-rngd
4264 (package
4265 (name "jitterentropy-rngd")
4266 (version "1.2.8")
4267 (source
4268 (origin
4269 (method git-fetch)
4270 (uri (git-reference
4271 (url "https://github.com/smuellerDD/jitterentropy-rngd")
4272 (commit (string-append "v" version))))
4273 (file-name (git-file-name name version))
4274 (sha256
4275 (base32 "13br8s6gqnfc844ps38ya5nny3pndsmskszv3dsp1cxcgvmscg1c"))))
4276 (build-system gnu-build-system)
4277 (arguments
4278 (list
4279 #:tests? #f ; no test suite
4280 #:make-flags
4281 #~(list (string-append "CC=" #$(cc-for-target))
4282 (string-append "PREFIX=" #$output)
4283 "UNITDIR=$(PREFIX)/lib/systemd/system")
4284 #:phases
4285 #~(modify-phases %standard-phases
4286 (delete 'configure)))) ; no ./configure script
4287 (home-page "https://www.chronox.de/jent.html")
4288 (synopsis "CPU jitter random number generator daemon")
4289 (description
4290 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
4291number generator} core to the kernel Linux's entropy estimator. This prevents
4292the @file{/dev/random} device from blocking and should benefit users of the
4293preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
4294
4295The CPU Jitter RNG itself is part of the kernel and claims to provide good
4296entropy by collecting and magnifying differences in CPU execution time as
4297measured by the high-resolution timer built into modern CPUs. It requires no
4298additional hardware or external entropy source.
4299
4300The random bit stream generated by @command{jitterentropy-rngd} is not processed
4301by a cryptographically secure whitening function. Nonetheless, its authors
4302believe it to be a suitable source of cryptographically secure key material or
4303other cryptographically sensitive data.
4304
4305If you agree with them, start this daemon as early as possible to provide
4306properly seeded random numbers to services like SSH or those using TLS during
4307early boot when entropy may be low, especially in virtualised environments.")
4308 (license (list license:bsd-3 ; or
4309 license:gpl2+))))
4310
4311(define-public ebtables
4312 (package
4313 (name "ebtables")
4314 (version "2.0.11")
4315 (source (origin
4316 (method url-fetch)
4317 (uri (string-append
4318 "mirror://netfilter.org/ebtables/ebtables-"
4319 version ".tar.gz"))
4320 (sha256
4321 (base32
4322 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
4323 (build-system gnu-build-system)
4324 (inputs
4325 (list perl iptables))
4326 (synopsis "Ethernet bridge frame table administration")
4327 (home-page "https://ebtables.netfilter.org/")
4328 (description
4329 "ebtables is an application program used to set up and maintain the
4330tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
4331analogous to the iptables application, but less complicated, due to the fact
4332that the Ethernet protocol is much simpler than the IP protocol.")
4333 (license license:gpl2+)))
4334
4335(define-public iproute
4336 (package
4337 (name "iproute2")
4338 (version "6.4.0")
4339 (source (origin
4340 (method url-fetch)
4341 (uri (string-append
4342 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
4343 version ".tar.xz"))
4344 (sha256
4345 (base32
4346 "0wm2g70vfhnf8wb6py3zmzwxp4zv1icny1pvkwaxmr67rggbhlac"))))
4347 (build-system gnu-build-system)
4348 (arguments
4349 (list
4350 ;; There is a test suite, but it wants network namespaces and sudo.
4351 #:tests? #f
4352 #:make-flags
4353 #~(let ((out #$output))
4354 (list (string-append "CC=" #$(cc-for-target))
4355 "HOSTCC=gcc"
4356 (string-append "BASH_COMPDIR=" out
4357 "/etc/bash_completion.d")
4358 (string-append "LIBDIR=" out "/lib")
4359 (string-append "HDRDIR=" out "/include")
4360 (string-append "SBINDIR=" out "/sbin")
4361 (string-append "CONFDIR=" out "/etc")
4362 (string-append "MANDIR=" out "/share/man")
4363 #$@(if (target-ppc64le?)
4364 '("CCOPTS=-O2 -pipe -Wno-incompatible-pointer-types")
4365 '())))
4366 #:phases
4367 #~(modify-phases %standard-phases
4368 (replace 'configure
4369 (lambda* (#:key (configure-flags #~'()) #:allow-other-keys)
4370 ;; The configure script does not understand some of the
4371 ;; default options of gnu-build-system.
4372 (setenv "PKG_CONFIG" #$(pkg-config-for-target))
4373 (apply invoke "./configure"
4374 "--prefix" #$output
4375 configure-flags)))
4376 (add-before 'install 'pre-install
4377 (lambda _
4378 ;; Don't attempt to create /var/lib/arpd.
4379 (substitute* "Makefile"
4380 (("^.*ARPDDIR.*$") "")))))))
4381 (inputs
4382 (list bdb iptables libmnl))
4383 (native-inputs
4384 (list bison flex pkg-config))
4385 ;; For tests.
4386 ;; ("libmnl" ,libmnl)
4387 ;; ("util-linux" ,util-linux)
4388 (home-page
4389 "https://wiki.linuxfoundation.org/networking/iproute2")
4390 (synopsis
4391 "Utilities for controlling TCP/IP networking and traffic in Linux")
4392 (description
4393 "Iproute2 is a collection of utilities for controlling TCP/IP networking
4394and traffic with the Linux kernel. The most important of these are
4395@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
4396control.
4397
4398Most network configuration manuals still refer to ifconfig and route as the
4399primary network configuration tools, but ifconfig is known to behave
4400inadequately in modern network environments, and both should be deprecated.")
4401 (license license:gpl2+)))
4402
4403(define-public net-tools
4404 ;; XXX: This package is basically unmaintained, but it provides a few
4405 ;; commands not yet provided by Inetutils, such as 'route', so we have to
4406 ;; live with it.
4407 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
4408 (revision "0"))
4409 (package
4410 (name "net-tools")
4411 (version (string-append "1.60-" revision "." (string-take commit 7)))
4412 (source (origin
4413 (method url-fetch)
4414 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
4415 "n/ne/net-tools/code.git/net-tools-code-"
4416 commit ".zip"))
4417 (file-name (string-append name "-" version ".zip"))
4418 (sha256
4419 (base32
4420 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
4421 (home-page "https://net-tools.sourceforge.net/")
4422 (build-system gnu-build-system)
4423 (arguments
4424 `(#:modules ((guix build gnu-build-system)
4425 (guix build utils)
4426 (srfi srfi-1)
4427 (srfi srfi-26))
4428 #:phases
4429 (modify-phases %standard-phases
4430 (replace 'configure
4431 (lambda* (#:key outputs #:allow-other-keys)
4432 (let ((out (assoc-ref outputs "out")))
4433 (mkdir-p (string-append out "/bin"))
4434 (mkdir-p (string-append out "/sbin"))
4435
4436 ;; Pretend we have everything...
4437 (system "yes | make config")
4438
4439 ;; ... except for the things we don't have.
4440 ;; HAVE_AFDECnet requires libdnet, which we don't have.
4441 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
4442 ;; that have been removed.
4443 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
4444 ;; think about adding them later.
4445 (substitute* '("config.make" "config.h")
4446 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
4447 ""))
4448 #t)))
4449 (add-after 'install 'remove-redundant-commands
4450 (lambda* (#:key outputs #:allow-other-keys)
4451 ;; Remove commands and man pages redundant with Inetutils.
4452 (let* ((out (assoc-ref outputs "out"))
4453 (dup (append-map (cut find-files out <>)
4454 '("^hostname"
4455 "^(yp|nis|dns)?domainname"))))
4456 (for-each delete-file dup)
4457 #t))))
4458 ;; Binaries that depend on libnet-tools.a don't declare that
4459 ;; dependency, making it parallel-unsafe.
4460 #:parallel-build? #f
4461
4462 #:tests? #f ; no test suite
4463 #:make-flags (let ((out (assoc-ref %outputs "out")))
4464 (list ,(string-append "CC=" (cc-for-target))
4465 (string-append "BASEDIR=" out)
4466 (string-append "INSTALLNLSDIR=" out "/share/locale")
4467 (string-append "mandir=/share/man")))))
4468 (native-inputs `(("gettext" ,gettext-minimal)
4469 ("unzip" ,unzip)))
4470 (supported-systems (remove target-hurd? %supported-systems))
4471 (synopsis "Tools for controlling the network subsystem in Linux")
4472 (description
4473 "This package includes the important tools for controlling the network
4474subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
4475route. Additionally, this package contains utilities relating to particular
4476network hardware types (plipconfig, slattach) and advanced aspects of IP
4477configuration (iptunnel, ipmaddr).")
4478 (license license:gpl2+))))
4479
4480(define-public libcap
4481 (package
4482 (name "libcap")
4483 (version "2.64")
4484 (source (origin
4485 (method url-fetch)
4486 (uri (string-append
4487 "mirror://kernel.org/linux/libs/security/linux-privs/"
4488 "libcap2/libcap-" version ".tar.xz"))
4489 (sha256
4490 (base32
4491 "04qy0z6yhlljb29xxcb2srbdnymcrhsi28wrc705z3861cgmwin8"))))
4492 (build-system gnu-build-system)
4493 (arguments
4494 (list #:phases
4495 #~(modify-phases %standard-phases
4496 (delete 'configure)
4497 #$@(if (target-ppc32?)
4498 #~((add-after 'unpack 'apply-patch
4499 (lambda _
4500 (let ((patch
4501 #$(local-file
4502 (search-patch
4503 "libcap-magic-glibc-constant.patch"))))
4504 (invoke "patch" "--force" "-p1" "-i" patch)))))
4505 #~()))
4506 #:test-target "test"
4507 #:make-flags
4508 #~(list "lib=lib"
4509 (string-append "prefix=" #$output)
4510 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
4511 "RAISE_SETFCAP=no"
4512 ;; Tell the makefile to use TARGET-gcc and friends
4513 ;; when cross-compiling.
4514 #$@(if (%current-target-system)
4515 `((string-append "CROSS_COMPILE="
4516 ,(%current-target-system) "-")
4517 "BUILD_CC=gcc")
4518 '()))))
4519 (native-inputs (list perl))
4520 (supported-systems (remove target-hurd? %supported-systems))
4521 (home-page "https://sites.google.com/site/fullycapable/")
4522 (synopsis "Library for working with POSIX capabilities")
4523 (description
4524 "Libcap2 provides a programming interface to POSIX capabilities on
4525Linux-based operating systems.")
4526
4527 ;; License is BSD-3 or GPLv2, at the user's choice.
4528 (license (list license:bsd-3 license:gpl2))))
4529
4530(define-public bridge-utils
4531 (package
4532 (name "bridge-utils")
4533 (version "1.7.1")
4534 (source
4535 (origin
4536 (method url-fetch)
4537 (uri (string-append "mirror://kernel.org/linux/utils/net/"
4538 "bridge-utils/bridge-utils-" version ".tar.xz"))
4539 (sha256
4540 (base32 "03p6cmhm6cqhnfsfa1wv7frhb361y12daf7gr1h5qh51y7j8n7d6"))))
4541 (build-system gnu-build-system)
4542
4543 ;; The tarball lacks all the generated files.
4544 (native-inputs (list autoconf automake))
4545 (arguments
4546 '(#:tests? #f)) ; no 'check' target
4547
4548 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
4549 (synopsis "Manipulate Ethernet bridges")
4550 (description
4551 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
4552to connect two Ethernet segments together in a protocol independent way.
4553Packets are forwarded based on Ethernet address, rather than IP address (like
4554a router). Since forwarding is done at Layer 2, all protocols can go
4555transparently through a bridge.")
4556 (license license:gpl2+)))
4557
4558(define-public libnl
4559 (package
4560 (name "libnl")
4561 (version "3.7.0")
4562 (source (origin
4563 (method url-fetch)
4564 (uri (string-append
4565 "https://github.com/thom311/libnl/releases/download/"
4566 "libnl" (string-join (string-split version #\.) "_")
4567 "/libnl-" version ".tar.gz"))
4568 (sha256
4569 (base32
4570 "0faryrbvp0x4s2zhg5d78vd5q4w34lrr736gpm9wcwpaxv5krr4z"))))
4571 (build-system gnu-build-system)
4572 (native-inputs
4573 `(("bison" ,bison)
4574 ("flex" ,flex)
4575 ("pkg-config" ,pkg-config)
4576 ("swig" ,swig-4.0)
4577 ("libnl3-doc"
4578 ,(origin
4579 (method url-fetch)
4580 (uri (string-append
4581 "https://github.com/thom311/libnl/releases/download/libnl"
4582 (string-join (string-split version #\.) "_")
4583 "/libnl-doc-" version ".tar.gz"))
4584 (sha256
4585 (base32 "1ra8xdf06q9hlsrnc1yz67xkp4kd9sd27ff02mlixixnyyjp32sp"))))))
4586 (outputs `("out" "doc"))
4587 (arguments
4588 `(#:phases
4589 (modify-phases %standard-phases
4590 (add-after 'install 'install-doc
4591 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
4592 (let ((dest (string-append (assoc-ref outputs "doc")
4593 "/share/doc/libnl")))
4594 (mkdir-p dest)
4595 (invoke "tar" "xf" (assoc-ref
4596 (or native-inputs inputs)
4597 "libnl3-doc")
4598 "--strip-components=1" "-C" dest)))))))
4599 (home-page "https://www.infradead.org/~tgr/libnl/")
4600 (synopsis "NetLink protocol library suite")
4601 (description
4602 "The libnl suite is a collection of libraries providing APIs to netlink
4603protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
4604between the kernel and user space processes. It was designed to be a more
4605flexible successor to ioctl to provide mainly networking related kernel
4606configuration and monitoring interfaces.")
4607
4608 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
4609 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
4610 (license license:gpl2)))
4611
4612;; libnl python extensions used to be outputs of libnl. However, as
4613;; cross-compiling python extensions is currently broken, create separate
4614;; packages for libnl python extensions.
4615(define (libnl-python-package python)
4616 (let ((name (string-append "libnl-" python)))
4617 (package
4618 (inherit libnl)
4619 (name name)
4620 (inputs `(,@(cond
4621 ((string=? python "python2")
4622 `(("python-2" ,python-2)))
4623 ((string=? python "python3")
4624 `(("python-3" ,python-3))))
4625 ("libxcrypt" ,libxcrypt))) ;required by Python.h
4626 (propagated-inputs (list libnl))
4627 (outputs '("out"))
4628 (arguments
4629 `(#:modules ((guix build gnu-build-system)
4630 (guix build utils)
4631 (srfi srfi-1))
4632 #:phases
4633 (modify-phases %standard-phases
4634 (replace 'install
4635 (lambda* (#:key inputs outputs #:allow-other-keys)
4636 (define (python-inst python)
4637 (invoke python "setup.py" "build")
4638 (invoke python "setup.py" "install"
4639 (string-append "--prefix="
4640 (assoc-ref %outputs "out")))
4641 (invoke python "setup.py" "clean"))
4642 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
4643 (assoc-ref inputs "libnl")))
4644 (with-directory-excursion "./python" (python-inst ,python))
4645 #t))))))))
4646
4647(define-public libnl-python2 (libnl-python-package "python2"))
4648(define-public libnl-python3 (libnl-python-package "python3"))
4649
4650(define-public iw
4651 (package
4652 (name "iw")
4653 (version "5.19")
4654 (source (origin
4655 (method url-fetch)
4656 (uri (string-append
4657 "mirror://kernel.org/software/network/iw/iw-"
4658 version ".tar.xz"))
4659 (sha256
4660 (base32
4661 "0kjdrihc7ibnjdpjqkq8sv0kmmvavgsww78cpjgbnlyx8zlvnrzi"))))
4662 (build-system gnu-build-system)
4663 (native-inputs (list pkg-config))
4664 (inputs (list libnl))
4665 (arguments
4666 (list #:make-flags
4667 #~(list
4668 (string-append "CC=" #$(cc-for-target))
4669 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
4670 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4671 #:phases
4672 #~(modify-phases %standard-phases
4673 (delete 'configure)))) ; no configure script
4674 (home-page "https://wireless.wiki.kernel.org/")
4675 (synopsis "Tool for configuring wireless devices")
4676 (description
4677 "iw is a new nl80211 based CLI configuration utility for wireless
4678devices. It replaces @code{iwconfig}, which is deprecated.")
4679 (license license:isc)))
4680
4681(define-public powertop
4682 (package
4683 (name "powertop")
4684 (version "2.15")
4685 (source
4686 (origin
4687 (method git-fetch)
4688 (uri (git-reference
4689 (url "https://github.com/fenrus75/powertop")
4690 (commit (string-append "v" version))))
4691 (file-name (git-file-name name version))
4692 (sha256
4693 (base32 "10vbk4vplmzp3p1mhwnhj81g6i5xvam9pdvmiy6cmd0xvnmdyy77"))))
4694 (build-system gnu-build-system)
4695 (arguments
4696 (list
4697 #:configure-flags #~(list "LDFLAGS=-pthread")
4698 #:phases
4699 #~(modify-phases %standard-phases
4700 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
4701 ;; allow calibrating the network interface in Guix System.
4702 (add-after 'unpack 'patch-absolute-file-names
4703 (lambda* (#:key inputs #:allow-other-keys)
4704 (let ((kmod (assoc-ref inputs "kmod")))
4705 ;; Fix for using a more modern gettext.
4706 (substitute* "autogen.sh"
4707 (("autoreconf")
4708 "autoreconf --force"))
4709 (substitute* "configure.ac"
4710 (("^AM_GNU_GETTEXT_VERSION.*$")
4711 (string-append "AM_GNU_GETTEXT_VERSION(["
4712 #$(package-version (this-package-native-input "gettext-minimal"))
4713 "])\n")))
4714 ;; Give the right 'modprobe' file name so that essential
4715 ;; modules such as msr.ko can be loaded.
4716 (substitute* (find-files "src" "\\.cpp$")
4717 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
4718 ;; These programs are only needed to calibrate, so using
4719 ;; relative file names avoids adding extra inputs. When they
4720 ;; are missing powertop gracefully handles it.
4721 (("/usr/s?bin/(hciconfig|hcitool|xset)" _ command)
4722 command
4723 command))))))))
4724 (native-inputs
4725 (list autoconf
4726 autoconf-archive
4727 automake
4728 gettext-minimal
4729 libtool
4730 pkg-config))
4731 (inputs
4732 (list kmod libnl ncurses pciutils zlib))
4733 (home-page "https://01.org/powertop/")
4734 (synopsis "Analyze power consumption on x86-based laptops")
4735 (description
4736 "PowerTOP is a Linux tool to diagnose issues with power consumption and
4737power management. In addition to being a diagnostic tool, PowerTOP also has
4738an interactive mode where the user can experiment various power management
4739settings for cases where the operating system has not enabled these
4740settings.")
4741 (license license:gpl2)))
4742
4743(define-public aumix
4744 (package
4745 (name "aumix")
4746 (version "2.9.1")
4747 (source (origin
4748 (method url-fetch)
4749 (uri (string-append
4750 "https://web.archive.org/web/20211201184543/"
4751 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
4752 version ".tar.bz2"))
4753 (sha256
4754 (base32
4755 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
4756 (build-system gnu-build-system)
4757 (arguments
4758 ;; Allow compilation with GCC 10.
4759 '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
4760 (inputs (list ncurses))
4761 (home-page (string-append "https://web.archive.org/web/20211201184543/"
4762 "http://jpj.net/~trevor/aumix.html"))
4763 (synopsis "Audio mixer for X and the console")
4764 (description
4765 "Aumix adjusts an audio mixer from X, the console, a terminal,
4766the command line or a script.")
4767 (license license:gpl2+)))
4768
4769(define-public iotop-python
4770 ;; The last release is from 2013 and gives a misleading CONFIG_TASK_DELAY_ACCT
4771 ;; error on ‘newer’ kernels.
4772 (let ((revision "0")
4773 (commit "a14256a3ff74eeee59493ac088561f1bafab85a7"))
4774 (package
4775 (name "iotop-python")
4776 (version (git-version "0.6" revision commit))
4777 (source
4778 (origin
4779 (method git-fetch)
4780 (uri (git-reference
4781 (url "https://repo.or.cz/iotop.git")
4782 (commit commit)))
4783 (file-name (git-file-name name version))
4784 (sha256
4785 (base32 "00h5p8fk1zi237q8mqds8apqbis9iw0yih1hl0pr63dsnyzmmrpw"))))
4786 (build-system pyproject-build-system)
4787 (arguments
4788 (list
4789 #:tests? #f ; No tests.
4790 #:phases
4791 #~(modify-phases %standard-phases
4792 (add-after 'unpack 'fix-build-with-python3
4793 (lambda _
4794 (substitute* "setup.py"
4795 (("itervalues")
4796 "values")))))))
4797 (native-inputs (list python python-setuptools))
4798 (home-page "http://guichaz.free.fr/iotop/")
4799 (synopsis "Displays the IO activity of running processes")
4800 (description
4801 "Iotop is a Python program with a top like user interface to show the
4802processes currently causing I/O.")
4803 (license license:gpl2+))))
4804
4805(define-public iotop
4806 (package
4807 (name "iotop")
4808 (version "1.31")
4809 (source
4810 (origin
4811 (method git-fetch)
4812 (uri (git-reference
4813 (url "https://github.com/Tomas-M/iotop")
4814 (commit (string-append "v" version))))
4815 (file-name (git-file-name name version))
4816 (sha256
4817 (base32 "19ccdiw3flzk7gki90rc1nifmma79g2l87vhls4d2xr4z763m4nc"))))
4818 (build-system gnu-build-system)
4819 (arguments
4820 (list #:make-flags
4821 #~(list (string-append "CC=" #$(cc-for-target))
4822 (string-append "PREFIX=" #$output))
4823 #:tests? #f ; no tests
4824 #:phases
4825 #~(modify-phases %standard-phases
4826 (delete 'configure)))) ; no configure script
4827 (native-inputs (list pkg-config))
4828 (inputs (list ncurses))
4829 (home-page "https://github.com/Tomas-M/iotop")
4830 (synopsis "Interactive @command{top}-like input/output activity monitor")
4831 (description
4832 "iotop identifies which processes and threads are most responsible for
4833@acronym{I/O, input/output} activity such as disc reads and writes. It sorts
4834them in a live, interactive table overview similar to that of the well-known
4835@command{top}.
4836
4837This information makes it much easier for an administrator to see which tasks
4838are blocking others and adjust their priority (using @command{ionice}) or stop
4839or kill them altogether.")
4840 (license license:gpl2+)))
4841
4842(define-public fuse
4843 (package
4844 (name "fuse")
4845 (version "3.18.1")
4846 (source (origin
4847 (method url-fetch)
4848 (uri
4849 (string-append "https://github.com/libfuse/libfuse/releases/"
4850 "download/fuse-" version
4851 "/fuse-" version ".tar.gz"))
4852 (sha256
4853 (base32
4854 "0b1jp5gp2gv40gv6cvmv86rcr4l0mdh050qbvnxl0xcwya45qffx"))))
4855 (build-system meson-build-system)
4856 (inputs
4857 (list bash-minimal util-linux))
4858 (arguments
4859 `(#:configure-flags
4860 ,#~(list
4861 (string-append "-Dudevrulesdir=" #$output "/udev/rules.d")
4862 "-Duseroot=false")
4863 #:tests? #f
4864 #:phases
4865 ,#~(modify-phases %standard-phases
4866 (add-after 'unpack 'set-file-names
4867 (lambda* (#:key inputs #:allow-other-keys)
4868 ;; libfuse calls out to mount(8) and umount(8). Make sure
4869 ;; it refers to the right ones.
4870 (substitute* '("lib/mount_util.c")
4871 (("/bin/(u?)mount" _ maybe-u)
4872 (search-input-file inputs
4873 (string-append "bin/"
4874 maybe-u "mount"))))
4875 (substitute* '("util/mount.fuse.c")
4876 (("/bin/sh")
4877 (search-input-file inputs "/bin/sh")))
4878
4879 ;; This hack leads libfuse to search for 'fusermount' in
4880 ;; $PATH, where it may find a setuid-root binary, instead of
4881 ;; trying solely $out/sbin/fusermount and failing because
4882 ;; it's not setuid.
4883 (substitute* "lib/meson.build"
4884 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
4885 "-DFUSERMOUNT_DIR=\"/var/empty\"'"))))
4886 (add-after 'unpack 'fix-install
4887 (lambda* (#:key inputs #:allow-other-keys)
4888 (substitute* '("util/meson.build")
4889 (("install_helper.sh") "true"))
4890 (substitute* '("util/meson.build")
4891 (("fuseconf_path = .*")
4892 "fuseconf_path = '/etc/fuse.conf'"))))
4893 (add-before 'configure 'set-paths
4894 (lambda* (#:key inputs outputs #:allow-other-keys)
4895 (let ((dummy-init.d
4896 (string-append (getcwd) "/etc/init.d")))
4897 (setenv "MOUNT_FUSE_PATH"
4898 (string-append #$output "/sbin"))
4899 (setenv "UDEV_RULES_PATH"
4900 (string-append #$output
4901 "/lib/udev/rules.d"))))))))
4902 (supported-systems (remove target-hurd? %supported-systems))
4903 (home-page "https://github.com/libfuse/libfuse")
4904 (synopsis "Support file systems implemented in user space")
4905 (description
4906 "As a consequence of its monolithic design, file system code for Linux
4907normally goes into the kernel itself---which is not only a robustness issue,
4908but also an impediment to system extensibility. FUSE, for \"file systems in
4909user space\", is a kernel module and user-space library that tries to address
4910part of this problem by allowing users to run file system implementations as
4911user-space processes.")
4912 (license (list license:lgpl2.1 ; library
4913 license:gpl2+)))) ; command-line utilities
4914
4915(define-public fuse-2
4916 (package
4917 (inherit fuse)
4918 (name "fuse")
4919 (version "2.9.9")
4920 (source
4921 (origin
4922 (method url-fetch)
4923 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
4924 "download/fuse-" version
4925 "/fuse-" version ".tar.gz"))
4926 (sha256
4927 (base32 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
4928 (patches (search-patches "fuse-overlapping-headers.patch"
4929 "fuse-glibc-2.34.patch"))))
4930 (build-system gnu-build-system)
4931 (native-inputs
4932 (list autoconf automake gettext-minimal libtool))
4933 (arguments
4934 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
4935 (assoc-ref %outputs "out")
4936 "/sbin")
4937 (string-append "INIT_D_PATH="
4938 (assoc-ref %outputs "out")
4939 "/etc/init.d")
4940
4941 ;; The rule makes /dev/fuse 666.
4942 (string-append "UDEV_RULES_PATH="
4943 (assoc-ref %outputs "out")
4944 "/lib/udev/rules.d"))
4945 #:phases
4946 (modify-phases %standard-phases
4947 (add-before 'bootstrap 'force-bootstrap
4948 (lambda _
4949 ;; Force a bootstrap to make the patch changes effective.
4950 (delete-file "configure")))
4951 (add-before 'build 'set-file-names
4952 (lambda* (#:key inputs #:allow-other-keys)
4953 ;; libfuse calls out to mount(8) and umount(8). Make sure
4954 ;; it refers to the right ones.
4955 (substitute* '("lib/mount_util.c" "util/mount_util.c")
4956 (("/bin/(u?)mount" _ maybe-u)
4957 (search-input-file inputs
4958 (string-append "bin/"
4959 maybe-u "mount"))))
4960 (substitute* '("util/mount.fuse.c")
4961 (("/bin/sh")
4962 (search-input-file inputs "/bin/sh")))
4963
4964 ;; This hack leads libfuse to search for 'fusermount' in
4965 ;; $PATH, where it may find a setuid-root binary, instead of
4966 ;; trying solely $out/sbin/fusermount and failing because
4967 ;; it's not setuid.
4968 (substitute* "lib/Makefile"
4969 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
4970 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))))
4971
4972(define-public fuse-for-appimage
4973 (package
4974 (inherit fuse)
4975 (name "fuse")
4976 (version "3.16.2")
4977 (source
4978 (origin
4979 (method url-fetch)
4980 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
4981 "download/fuse-" version "/fuse-" version ".tar.gz"))
4982 (sha256
4983 (base32 "11yfl2w2a445hllyzlakq97n32g06972vxpmh7lpbclnj9fhb5zp"))))
4984 (arguments
4985 (substitute-keyword-arguments (package-arguments fuse)
4986 ((#:configure-flags original-flags #~(list))
4987 #~(append #$original-flags '("--default-library=static")))))))
4988
4989(define-public unionfs-fuse
4990 (package
4991 (name "unionfs-fuse")
4992 (version "3.3")
4993 (source (origin
4994 (method git-fetch)
4995 (uri (git-reference
4996 (url "https://github.com/rpodgorny/unionfs-fuse")
4997 (commit (string-append "v" version))))
4998 (file-name (git-file-name name version))
4999 (sha256
5000 (base32
5001 "1wl5m5qnwf3s1792xphr35pb80sx8ybaqi3n3ddi5vvk3qjc4iws"))))
5002 (build-system cmake-build-system)
5003 (arguments
5004 (list
5005 #:phases
5006 #~(modify-phases %standard-phases
5007 (replace 'check
5008 ;; The epitome of ‘I tried’: run the 2 trivial tests that don't rely
5009 ;; on the fuse kernel module being loaded. All others would fail.
5010 (lambda* (#:key tests? #:allow-other-keys)
5011 (when tests?
5012 (invoke "pytest" "../source/test_all.py" "-k" "test_help")))))))
5013 (native-inputs
5014 (list pkg-config
5015
5016 ;; Only for the test ‘suite’.
5017 python
5018 python-pytest))
5019 (inputs
5020 (list fuse))
5021 (home-page "https://github.com/rpodgorny/unionfs-fuse")
5022 (synopsis "User-space union file system")
5023 (description
5024 "UnionFS-FUSE is a flexible union file system implementation in user
5025space, using the FUSE library. Mounting a union file system allows you to
5026\"aggregate\" the contents of several directories into a single mount point.
5027UnionFS-FUSE additionally supports copy-on-write.")
5028 (license license:bsd-3)))
5029
5030(define fuse-static
5031 (package (inherit fuse)
5032 (name "fuse-static")
5033 (source
5034 (origin
5035 (inherit (package-source fuse))
5036 (modules '((guix build utils)))
5037 (snippet
5038 #~(begin
5039 ;; Normally libfuse invokes mount(8) so that /etc/mtab is updated.
5040 ;; Change calls to 'mtab_needs_update' to 0 so that it doesn't do
5041 ;; that, allowing us to remove the dependency on util-linux
5042 ;; (something that is useful in initrds.)
5043 (substitute* "lib/mount_util.c"
5044 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") "0")
5045 (("/bin/") ""))))))
5046 (arguments
5047 (substitute-keyword-arguments (package-arguments fuse)
5048 ((#:configure-flags flags '())
5049 #~(cons "-Ddefault_library=static"
5050 #$flags))))))
5051
5052(define-public unionfs-fuse/static
5053 (package (inherit unionfs-fuse)
5054 (synopsis "User-space union file system (statically linked)")
5055 (name (string-append (package-name unionfs-fuse) "-static"))
5056 (source
5057 (origin
5058 (inherit (package-source unionfs-fuse))
5059 (modules '((guix build utils)))
5060 (snippet
5061 #~(begin
5062 ;; Add -ldl to the libraries, because libfuse.a needs that.
5063 (substitute* "src/CMakeLists.txt"
5064 (("target_link_libraries(.*)\\)" _ libs)
5065 (string-append "target_link_libraries"
5066 libs " dl)")))))))
5067 (arguments
5068 (substitute-keyword-arguments (package-arguments unionfs-fuse)
5069 ((#:configure-flags flags #~'())
5070 #~(cons "-DCMAKE_EXE_LINKER_FLAGS=-static" #$flags))
5071 ((#:phases phases #~%standard-phases)
5072 #~(modify-phases #$phases
5073 (add-after 'install 'post-install
5074 (lambda _
5075 ;; By default, 'unionfs' keeps references to
5076 ;; $glibc/share/locale and similar stuff. Remove them.
5077 (remove-store-references (string-append #$output "/bin/unionfs"))
5078 ;; 'unionfsctl' has references to glibc as well. Since
5079 ;; we don't need it, remove it.
5080 (delete-file (string-append #$output "/bin/unionfsctl"))))))))
5081 (inputs (list fuse-static))))
5082
5083(define-public sshfs
5084 (package
5085 (name "sshfs")
5086 (version "3.7.5")
5087 (source (origin
5088 (method url-fetch)
5089 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
5090 "download/sshfs-" version "/sshfs-" version
5091 ".tar.xz"))
5092 (sha256
5093 (base32
5094 "1fx8c4fkvmfi29iw8wz5dwnniq666ji4y4vl67dij2fhq9ixni8f"))))
5095 (build-system meson-build-system)
5096 (arguments
5097 ;; XXX: tests are skipped: FUSE kernel module does not seem to be loaded
5098 '(#:tests? #f))
5099 (inputs
5100 (list fuse glib))
5101 (native-inputs
5102 (list pkg-config
5103 ;; man page
5104 python-docutils))
5105 (home-page "https://github.com/libfuse/sshfs")
5106 (synopsis "Mount remote file systems over SSH")
5107 (description
5108 "This is a file system client based on the SSH File Transfer Protocol.
5109Since most SSH servers already support this protocol it is very easy to set
5110up: on the server side there's nothing to do; on the client side mounting the
5111file system is as easy as logging into the server with an SSH client.")
5112 (license license:gpl2+)))
5113
5114(define-public sshfs-fuse
5115 (package (inherit sshfs)
5116 (name "sshfs-fuse")
5117 (properties `((superseded . ,sshfs)))))
5118
5119(define-public archivemount
5120 (package
5121 (name "archivemount")
5122 (version "0.9.1")
5123 (source
5124 (origin
5125 (method url-fetch)
5126 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
5127 "archivemount-" version ".tar.gz"))
5128 (sha256
5129 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
5130 (build-system gnu-build-system)
5131 (inputs (list fuse-2 libarchive))
5132 (native-inputs (list pkg-config))
5133 (home-page "https://www.cybernoia.de/software/archivemount.html")
5134 (synopsis "Tool for mounting archive files with FUSE")
5135 (description "archivemount is a FUSE-based file system for Unix variants,
5136including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
5137mount point where it can be read from or written to as with any other file
5138system. This makes accessing the contents of the archive, which may be
5139compressed, transparent to other programs, without decompressing them.")
5140 (license license:lgpl2.0+)))
5141
5142(define-public numactl
5143 (package
5144 (name "numactl")
5145 (version "2.0.16")
5146 (source (origin
5147 (method url-fetch)
5148 (uri (string-append
5149 "https://github.com/numactl/numactl/releases/download/v"
5150 version "/numactl-" version ".tar.gz"))
5151 (sha256
5152 (base32
5153 "1j67wx3383fwqbvhg4nwqf72vpdgimmrvkpn3b9s2xzr7a4jy90v"))))
5154 (build-system gnu-build-system)
5155 (arguments
5156 `(,@(if (target-riscv64?)
5157 `(#:make-flags (list "LDFLAGS=-latomic"))
5158 '())
5159 ;; There's a 'test' target, but it requires NUMA support in the kernel
5160 ;; to run, which we can't assume to have.
5161 #:tests? #f))
5162 (home-page "https://github.com/numactl/numactl")
5163 (synopsis "Tools for non-uniform memory access (NUMA) machines")
5164 (description
5165 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
5166memory is not all in one place. The @command{numactl} program allows you to
5167run your application program on specific CPUs and memory nodes. It does this
5168by supplying a NUMA memory policy to the operating system before running your
5169program.
5170
5171The package contains other commands, such as @command{numastat},
5172@command{memhog}, and @command{numademo} which provides a quick overview of
5173NUMA performance on your system.")
5174 (license (list license:gpl2 ;programs
5175 license:lgpl2.1)))) ;library
5176
5177(define-public kbd-neo
5178 (package
5179 (name "kbd-neo")
5180 (version "2486")
5181 (source
5182 (origin
5183 (method url-fetch)
5184 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
5185 version "/linux/console/neo.map"))
5186 (file-name (string-append name "-" version ".map"))
5187 (sha256
5188 (base32
5189 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
5190 (build-system trivial-build-system)
5191 (arguments
5192 `(#:modules ((guix build utils))
5193 #:builder (begin
5194 (use-modules (guix build utils))
5195 (let ((out (string-append %output "/share/keymaps"))
5196 (source (assoc-ref %build-inputs "source")))
5197 (mkdir-p out)
5198 (copy-file source (string-append out "/neo.map"))
5199 #t))))
5200 (home-page "https://neo-layout.org")
5201 (synopsis "Neo2 console layout")
5202 (description
5203 "Kbd-neo provides the Neo2 keyboard layout for use with
5204@command{loadkeys(1)} from @code{kbd(4)}.")
5205 ;; The file is located in an svn directory, the entire content of
5206 ;; the directory is licensed as GPL3.
5207 (license license:gpl3+)))
5208
5209(define-public kbd
5210 (package
5211 (name "kbd")
5212 (version "2.5.1")
5213 (source (origin
5214 (method url-fetch)
5215 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
5216 version ".tar.xz"))
5217 (sha256
5218 (base32
5219 "10s608i4blprgy9nynlid0hglfdrrgln6wwjs9rhjf56hwilbpyc"))
5220 (modules '((guix build utils)))
5221 (snippet
5222 '(begin
5223 (substitute* '("src/unicode_start" "src/unicode_stop")
5224 ;; Assume the Coreutils are in $PATH.
5225 (("/usr/bin/tty")
5226 "tty"))))))
5227 (build-system gnu-build-system)
5228 (arguments
5229 '(#:phases
5230 (modify-phases %standard-phases
5231 (add-before 'build 'pre-build
5232 (lambda* (#:key inputs #:allow-other-keys)
5233 (let ((bzip2 (assoc-ref inputs "bzip2"))
5234 (gzip (assoc-ref inputs "gzip"))
5235 (xz (assoc-ref inputs "xz"))
5236 (zstd (assoc-ref inputs "zstd")))
5237 (substitute* "src/libkbdfile/kbdfile.c"
5238 (("bzip2") (string-append bzip2 "/bin/bzip2"))
5239 (("gzip") (string-append gzip "/bin/gzip"))
5240 (("xz -d") (string-append xz "/bin/xz -d"))
5241 (("zstd") (string-append zstd "/bin/zstd"))))))
5242 (add-after 'install 'post-install
5243 (lambda* (#:key outputs #:allow-other-keys)
5244 ;; Make sure these programs find their comrades.
5245 (let* ((out (assoc-ref outputs "out"))
5246 (bin (string-append out "/bin")))
5247 (for-each (lambda (prog)
5248 (wrap-program (string-append bin "/" prog)
5249 `("PATH" ":" prefix (,bin))))
5250 '("unicode_start" "unicode_stop"))))))))
5251 (native-inputs
5252 (list autoconf pkg-config))
5253 (inputs
5254 `(("bash" ,bash-minimal) ; for wrap-program
5255 ("bzip2" ,bzip2)
5256 ("gzip" ,gzip)
5257 ("pam" ,linux-pam)
5258 ("xz" ,xz)
5259 ("zstd" ,zstd)))
5260 (native-search-paths
5261 (list (search-path-specification
5262 (variable "LOADKEYS_KEYMAP_PATH")
5263 ;; Append ‘/**’ to recursively search all directories. One can then
5264 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
5265 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
5266 (files (list "share/keymaps/**")))))
5267 (home-page "https://kbd-project.org/")
5268 (synopsis "Linux keyboard utilities and keyboard maps")
5269 (description
5270 "This package contains keytable files and keyboard utilities compatible
5271for systems using the Linux kernel. This includes commands such as
5272@code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
5273 (license license:gpl2+)))
5274
5275(define-public loadkeys-static
5276 (package
5277 (inherit kbd)
5278 (name "loadkeys-static")
5279 (arguments
5280 (substitute-keyword-arguments (package-arguments kbd)
5281 ((#:configure-flags flags ''())
5282 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
5283 "--disable-vlock" ;so we don't need libpam
5284 "--disable-libkeymap")
5285 ,flags))
5286 ((#:make-flags flags ''())
5287 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
5288 ((#:phases phases '%standard-phases)
5289 `(modify-phases ,phases
5290 (replace 'install
5291 (lambda* (#:key outputs #:allow-other-keys)
5292 (let ((out (assoc-ref outputs "out")))
5293 ;; The binary keeps references to gzip, among other things,
5294 ;; which we don't need in the initrd, so strip references.
5295 (remove-store-references "src/loadkeys")
5296
5297 (install-file "src/loadkeys"
5298 (string-append out "/bin")))))
5299 (delete 'post-install)))
5300 ((#:strip-flags _ '())
5301 ''("--strip-all"))
5302 ((#:allowed-references _ '())
5303 '())))
5304
5305 (synopsis "Statically-linked @command{loadkeys} program")
5306
5307 ;; This package is meant to be used internally in the initrd so don't
5308 ;; expose it.
5309 (properties '((hidden? . #t)))))
5310
5311(define-public inotify-tools
5312 (package
5313 (name "inotify-tools")
5314 (version "3.22.6.0")
5315 (source (origin
5316 (method git-fetch)
5317 (uri (git-reference
5318 (url "https://github.com/rvoicilas/inotify-tools")
5319 (commit version)))
5320 (file-name (git-file-name name version))
5321 (sha256
5322 (base32
5323 "1j9j8k5zjp8m4cl53zjncnll9z4dnvzr4ygmfcjk0ci81i59b18i"))))
5324 (build-system gnu-build-system)
5325 (native-inputs
5326 (list autoconf automake libtool))
5327 (arguments
5328 `(#:configure-flags
5329 (list "--disable-static")))
5330 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
5331 (synopsis "Monitor file accesses")
5332 (description
5333 "The inotify-tools packages provides a C library and command-line tools
5334to use Linux' inotify mechanism, which allows file accesses to be monitored.")
5335 (license license:gpl2+)))
5336
5337(define-public kmod
5338 (package
5339 (name "kmod")
5340 (version "29")
5341 (source (origin
5342 (method url-fetch)
5343 (uri
5344 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
5345 "kmod-" version ".tar.xz"))
5346 (sha256
5347 (base32
5348 "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
5349 (patches (search-patches "kmod-module-directory.patch"))))
5350 (build-system gnu-build-system)
5351 (arguments
5352 (list #:configure-flags #~(list "--with-xz" "--with-zlib" "--with-zstd"
5353 "--disable-test-modules")
5354 #:phases
5355 #~(modify-phases %standard-phases
5356 (add-after 'unpack 'disable-tests
5357 (lambda _
5358 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
5359 (substitute* "Makefile.in"
5360 (("testsuite/test-modprobe") "")
5361 (("testsuite/test-depmod") "")
5362 (("testsuite/test-blacklist") ""))))
5363 (add-after 'install 'install-modprobe&co
5364 (lambda _
5365 (for-each (lambda (tool)
5366 (symlink "kmod"
5367 (string-append #$output "/bin/" tool)))
5368 '("insmod" "rmmod" "lsmod" "modprobe"
5369 "modinfo" "depmod")))))))
5370 (native-inputs (list pkg-config zstd)) ;zstd needed for tests
5371 (inputs (list xz zlib `(,zstd "lib")))
5372 (supported-systems (remove target-hurd? %supported-systems))
5373 (home-page "https://www.kernel.org/")
5374 (synopsis "Kernel module tools")
5375 (description "Kmod is a set of tools to handle common tasks with Linux
5376kernel modules like insert, remove, list, check properties, resolve
5377dependencies and aliases.
5378
5379These tools are designed on top of libkmod, a library that is shipped with
5380kmod. The aim is to be compatible with tools, configurations and indices
5381from the module-init-tools project.")
5382 (license license:gpl2+))) ; library under lgpl2.1+
5383
5384(define-public earlyoom
5385 (package
5386 (name "earlyoom")
5387 (version "1.7")
5388 (source (origin
5389 (method git-fetch)
5390 (uri (git-reference
5391 (url "https://github.com/rfjakob/earlyoom")
5392 (commit (string-append "v" version))))
5393 (file-name (git-file-name name version))
5394 (sha256
5395 (base32
5396 "1xqrs6wz59ks76hdgfd4vaj010kbvllilgam2xxyn0g56kai71zi"))))
5397 (build-system gnu-build-system)
5398 (arguments
5399 (list
5400 #:phases
5401 #~(modify-phases %standard-phases
5402 (delete 'configure) ; no configure script
5403 (add-before 'check 'set-go-HOME
5404 (lambda _
5405 (setenv "HOME" (getcwd))))
5406 (add-before 'check 'disable-failing-test
5407 (lambda _
5408 ;; This test relies on writing to /proc/%d/oom_score_adj.
5409 (substitute* "testsuite_cli_test.go"
5410 (("TestI" match)
5411 (string-append "skipped" match))))))
5412 #:make-flags
5413 #~(list (string-append "CC=" #$(cc-for-target))
5414 (string-append "VERSION=v" #$version)
5415 (string-append "PREFIX=" #$output)
5416 (string-append "SYSCONFDIR=" #$output "/etc")
5417 "GO111MODULE=off")
5418 #:test-target "test"))
5419 (native-inputs
5420 (append
5421 ;; To generate the manpage.
5422 (if (or (target-x86-64?) (target-x86-32?))
5423 (list pandoc)
5424 '())
5425 (list
5426 ;; For the test suite.
5427 cppcheck
5428 go-1.23)))
5429 (home-page "https://github.com/rfjakob/earlyoom")
5430 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
5431 (description "Early OOM is a minimalist out of memory (OOM) daemon that
5432runs in user space and provides a more responsive and configurable alternative
5433to the in-kernel OOM killer.")
5434 (license license:expat)))
5435
5436(define-public eudev
5437 (package
5438 (name "eudev")
5439 (version "3.2.14")
5440 (source (origin
5441 (method git-fetch)
5442 (uri (git-reference (url "https://github.com/eudev-project/eudev")
5443 (commit (string-append "v" version))))
5444 (file-name (git-file-name name version))
5445 (sha256
5446 (base32
5447 "1f6lz57igi7iw2ls3fpzgw42bfznam4nf9368h7x8yf1mb737yxz"))))
5448 (build-system gnu-build-system)
5449 (arguments
5450 (list
5451 ;; The binary should be built to look for its rules under
5452 ;; /etc/udev/rules.d, which is where the udev-shepherd-service keeps
5453 ;; them.
5454 #:make-flags #~(list "udevrulesdir=/etc/udev/rules.d")
5455 #:phases
5456 #~(modify-phases %standard-phases
5457 (add-before 'bootstrap 'patch-file-names
5458 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5459 (substitute* "man/make.sh"
5460 (("/usr/bin/xsltproc")
5461 (search-input-file (or native-inputs inputs) "/bin/xsltproc")))))
5462 (add-before 'bootstrap 'install-in-lib
5463 (lambda _
5464 ;; When the udev-service-type instantiates /etc, it collects
5465 ;; hardware files from the <package>/lib/udev/hwdb.d directories
5466 ;; of different packages. Since we set sysconfdir to /etc, the
5467 ;; only package-dependent location we can install hwdb files is
5468 ;; in <package>/lib/udev/hwdb.d. Eudev is configured to install
5469 ;; these files in sysconfdir, but they should be placed into
5470 ;; udevlibexecdir.
5471 (copy-file "hwdb/Makefile.am" "hwdb/files.am")
5472 (call-with-output-file "hwdb/Makefile.am"
5473 (lambda (port)
5474 (format port "hardwarelibdir = $(udevlibexecdir)/hwdb.d\n")
5475 (format port "include ./files.am")))
5476 (substitute* "hwdb/files.am"
5477 (("dist_udevhwdb_DATA =")
5478 "dist_hardwarelib_DATA ="))
5479 ;; Do not install the empty udev.conf template.
5480 (substitute* "src/udev/Makefile.am"
5481 (("dist_udevconf_DATA =")
5482 "dist_noinst_DATA ="))
5483 ;; Do not ensure that /etc/udev/rules.d exists.
5484 (substitute* "rules/Makefile.am"
5485 (("\\$\\(MKDIR_P\\) \\$\\(DESTDIR\\)\\$\\(udevconfdir\\)/rules\\.d")
5486 "true"))))
5487 (add-after 'install 'move-static-library
5488 (lambda _
5489 (let ((source (string-append #$output "/lib/libudev.a"))
5490 (target (string-append #$output:static "/lib/libudev.a")))
5491 (mkdir-p (dirname target))
5492 (link source target)
5493 (delete-file source)
5494 ;; Remove reference to the static library from the .la file
5495 ;; such that Libtool looks for it in the usual places.
5496 (substitute* (string-append #$output "/lib/libudev.la")
5497 (("old_library=.*")
5498 "old_library=''\n")))))
5499 (replace 'install
5500 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
5501 ;; Although the runtime udevrulesdir is set to
5502 ;; /etc/udev/rules.d, the package should provide its default
5503 ;; rules under $libdir/udev/rules.d.
5504 (let* ((default-udev-rules.d (string-append #$output
5505 "/lib/udev/rules.d"))
5506 (make-flags (cons (string-append "udevrulesdir="
5507 default-udev-rules.d)
5508 (delete "udevrulesdir=/etc/udev/rules.d"
5509 make-flags))))
5510 (apply (assoc-ref %standard-phases 'install)
5511 `(,@args #:make-flags ,make-flags))))))
5512 #:configure-flags
5513 #~(list "--enable-manpages"
5514 ;; By default, autoconf uses $prefix/etc. The udev-service-type
5515 ;; makes sure /etc is set up with rules and hardware file
5516 ;; descriptions.
5517 "--sysconfdir=/etc")))
5518 (native-search-paths
5519 (list (search-path-specification
5520 (variable "UDEV_HWDB_PATH")
5521 (files '("lib/udev/hwdb.d")))))
5522 (native-inputs
5523 (list autoconf
5524 automake
5525 gperf
5526 libtool
5527 pkg-config
5528 ;; For tests.
5529 perl
5530 python-wrapper
5531 ;; For documentation.
5532 docbook-xml-4.2
5533 docbook-xsl
5534 libxslt))
5535 (inputs
5536 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
5537 ;; and similar; it also installs the '60-persistent-storage.rules' file,
5538 ;; which contains the rules to do that.
5539 (list `(,util-linux "lib") ;for blkid
5540 kmod))
5541 (outputs '("out" "static"))
5542 (home-page "https://github.com/eudev-project/eudev")
5543 (synopsis "Userspace device management")
5544 (description "Udev is a daemon which dynamically creates and removes
5545device nodes from /dev/, handles hotplug events and loads drivers at boot
5546time.")
5547 (license license:gpl2+)))
5548
5549(define-public python-evdev
5550 (package
5551 (name "python-evdev")
5552 (version "1.9.1")
5553 (source
5554 (origin
5555 (method git-fetch) ; no tests data in PyPi package
5556 (uri (git-reference
5557 (url "https://github.com/gvalkov/python-evdev")
5558 (commit (string-append "v" version))))
5559 (file-name (git-file-name name version))
5560 (sha256
5561 (base32 "09p7pj0xhv23hqlpx865klrxrf7x6sw1bdsgs6pq900jvz92pl16"))))
5562 (build-system pyproject-build-system)
5563 (arguments
5564 (list
5565 #:test-flags
5566 ;; Silent tests requiring access to /dev/uinput.
5567 #~(list "-k" (string-append "not test_open"
5568 " and not test_open_context"
5569 " and not test_enable_events"
5570 " and not test_abs_values"
5571 " and not test_write"))
5572 #:phases
5573 #~(modify-phases %standard-phases
5574 (add-before 'build 'fix-hard-coded-directory
5575 (lambda* (#:key inputs #:allow-other-keys)
5576 (substitute* "setup.py"
5577 (("/usr/include/linux")
5578 (string-append
5579 (assoc-ref inputs "kernel-headers") "/include/linux"))))))))
5580 (native-inputs
5581 (list python-pytest python-setuptools python-wheel))
5582 (home-page "https://github.com/gvalkov/python-evdev")
5583 (synopsis "Bindings to the Linux input handling subsystem")
5584 (description
5585 "Python-evdev provides bindings to the generic input event interface in
5586Linux. The @code{evdev} interface serves the purpose of passing events
5587generated in the kernel directly to userspace through character devices that
5588are typically located in @file{/dev/input/}.
5589
5590This package also comes with bindings to @code{uinput}, the userspace input
5591subsystem. @code{uinput} allows userspace programs to create and handle input
5592devices that can inject events directly into the input subsystem.")
5593 (license license:bsd-3)))
5594
5595(define-public interception-tools
5596 (package
5597 (name "interception-tools")
5598 (version "0.6.8")
5599 (home-page "https://gitlab.com/interception/linux/tools")
5600 (source (origin
5601 (method git-fetch)
5602 (uri (git-reference
5603 (url home-page)
5604 (commit (string-append "v" version))))
5605 (file-name (git-file-name name version))
5606 (sha256
5607 (base32
5608 "1sbidym6ld4c8cx2ww5i54zsv8v0kygv15zq1yimz44v4my605wf"))))
5609 (build-system cmake-build-system)
5610 (native-inputs
5611 (list pkg-config))
5612 (inputs
5613 (list boost libevdev eudev yaml-cpp))
5614 (arguments
5615 `(#:tests? #f)) ; no test suite
5616 (synopsis "Utilities for operating on input events of evdev devices")
5617 (description
5618 "Interception Tools provides a composable infrastructure on top of
5619@code{libudev} and @code{libevdev}. The following utilities are provided:
5620
5621@itemize
5622@item @command{udevmon} --- monitor input devices for launching tasks
5623@item @command{intercept} --- redirect device input events to stdout
5624@item @command{uinput} --- redirect device input events from stding to virtual device
5625@item @command{mux} --- mux streams of input events
5626@end itemize")
5627 ;; Dual-licensed under GPLv3+ or "something else" on request, per
5628 ;; 'README.md'.
5629 (license license:gpl3+)))
5630
5631(define-public interception-dual-function-keys
5632 (package
5633 (name "interception-dual-function-keys")
5634 (version "1.4.0")
5635 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
5636 (source (origin
5637 (method git-fetch)
5638 (uri (git-reference
5639 (url home-page)
5640 (commit version)))
5641 (file-name (git-file-name name version))
5642 (sha256
5643 (base32
5644 "0s49vbg3j4rwh78i8rx8qr7myql09p7b3lhrjl0p7dd98xp6ann6"))))
5645 (build-system gnu-build-system)
5646 (inputs
5647 (list libevdev yaml-cpp))
5648 (arguments
5649 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
5650 ,(string-append "CXX=" (cxx-for-target))
5651 (string-append "PREFIX=" %output))
5652 #:phases
5653 (modify-phases %standard-phases
5654 (add-after 'unpack 'fix-libevdev-path
5655 (lambda* (#:key inputs #:allow-other-keys)
5656 (let ((libevdev (assoc-ref inputs "libevdev")))
5657 (substitute* "config.mk"
5658 (("/usr/include/libevdev-1.0")
5659 (string-append libevdev "/include/libevdev-1.0")))
5660 #t)))
5661 ;; No configure script
5662 (delete 'configure))
5663 ;; No tests are included.
5664 #:tests? #f))
5665 (synopsis "Tap for one key, hold for another")
5666 (description
5667 "Dual Function Keys is a plugin for @code{interception-tools} that allows
5668one to send arbitrary keycodes when a given key is tapped or held.")
5669 (license license:expat)))
5670
5671(define-public lvm2
5672 (package
5673 (name "lvm2")
5674 (version "2.03.22")
5675 (source (origin
5676 (method url-fetch)
5677 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
5678 version ".tgz")
5679 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
5680 version ".tgz")))
5681 (sha256
5682 (base32
5683 "0z6w6bknhwh1n3qfkb5ij6x57q3wjf28lq3l8kh7rkhsplinjnjc"))
5684 (patches (search-patches "lvm2-no-systemd.patch"))
5685 (modules '((guix build utils)))
5686 (snippet
5687 '(begin
5688 (use-modules (guix build utils))
5689
5690 ;; Honor sysconfdir.
5691 (substitute* "make.tmpl.in"
5692 (("^confdir = .*$")
5693 "confdir = @sysconfdir@\n")
5694 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
5695 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
5696 (build-system gnu-build-system)
5697 (native-inputs
5698 (list config
5699 pkg-config procps)) ;tests use 'pgrep'
5700 (inputs
5701 `(("libaio" ,libaio)
5702 ("udev" ,eudev)))
5703 (arguments
5704 `(#:phases
5705 (modify-phases %standard-phases
5706 (add-after 'unpack 'update-config
5707 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5708 (install-file (search-input-file
5709 (or native-inputs inputs) "/bin/config.sub")
5710 "autoconf")
5711 (install-file (search-input-file
5712 (or native-inputs inputs) "/bin/config.guess")
5713 "autoconf")))
5714 (add-after 'configure 'set-makefile-shell
5715 (lambda _
5716 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
5717 ;; expected.
5718 (setenv "SHELL" (which "sh"))
5719
5720 ;; Replace /bin/sh with the right file name.
5721 (patch-makefile-SHELL "make.tmpl"))))
5722
5723 #:configure-flags (list (string-append "--sysconfdir="
5724 (assoc-ref %outputs "out")
5725 "/etc/lvm")
5726 "--enable-udev_sync"
5727 "--enable-udev_rules"
5728 "--enable-pkgconfig"
5729 "--enable-cmdlib"
5730 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
5731
5732 ;; Make sure programs such as 'dmsetup' can
5733 ;; find libdevmapper.so.
5734 (string-append "LDFLAGS=-Wl,-rpath="
5735 (assoc-ref %outputs "out")
5736 "/lib,-rpath="
5737 (assoc-ref %outputs "out")
5738 "/lib/device-mapper")
5739 ;; This is needed when cross-compiling.
5740 ,@(if (%current-target-system)
5741 '("ac_cv_func_malloc_0_nonnull=yes"
5742 "ac_cv_func_realloc_0_nonnull=yes")
5743 '()))
5744
5745 ;; The tests use 'mknod', which requires root access.
5746 #:tests? #f))
5747 (supported-systems (remove target-hurd? %supported-systems))
5748 (home-page "https://sourceware.org/lvm2/")
5749 (synopsis "Logical volume management for Linux")
5750 (description
5751 "LVM2 is the logical volume management tool set for Linux-based systems.
5752This package includes the user-space libraries and tools, including the device
5753mapper. Kernel components are part of Linux-libre.")
5754
5755 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
5756 ;; Command-line tools are GPLv2.
5757 (license (list license:gpl2 license:lgpl2.1))))
5758
5759(define-public (libdevmapper-propagated-inputs)
5760 (list eudev))
5761
5762(define-public lvm2-static
5763 (package
5764 (inherit lvm2)
5765 (name "lvm2-static")
5766
5767 (inputs `(,@(package-inputs lvm2)
5768 ("udev:static" ,eudev "static")))
5769
5770 (arguments
5771 (substitute-keyword-arguments (package-arguments lvm2)
5772 ((#:configure-flags flags '())
5773 ;; LVM2 doesn't use Libtool, hence the custom option.
5774 `(append '("--enable-static_link")
5775 ;; Building dmeventd statically is complicated due to a
5776 ;; requirement on libdevmapper.a, which is being phased out
5777 ;; in favor of libdevice-mapper.a, which in turn is is not
5778 ;; easily made available at dmeventd build time. Just ignore
5779 ;; it until the situation improves.
5780 (delete "--enable-dmeventd" ,flags)))
5781 ((#:phases phases)
5782 #~(modify-phases #$phases
5783 (add-before 'configure 'adjust-Makefile
5784 (lambda _
5785 ;; These fixes are related to the upstream libdm->device_mapper
5786 ;; migration and will hopefully be fixed upstream in due time.
5787 (substitute* "tools/Makefile.in"
5788 ;; This variable is empty in a static configuration and causes
5789 ;; an erroneous GCC command line.
5790 (("-L\\$\\(interfacebuilddir\\)") "")
5791 ;; Remove obsolete reference to libdevmapper.a.
5792 (("-ldevmapper") ""))
5793 #t))
5794 (add-after 'install 'adjust-pkgconfig
5795 ;; The static eudev is missing its pkg config file, and I am not
5796 ;; rebuilding it at this point.
5797 (lambda* (#:key inputs #:allow-other-keys)
5798 (substitute* (string-append #$output "/lib/pkgconfig/devmapper.pc")
5799 (("Requires.private: .*") "")
5800 (("Libs.private:")
5801 (format #f "Libs.private: -L~a -ludev"
5802 (dirname (search-input-file inputs "lib/libudev.a")))))))))))
5803 (synopsis "Logical volume management for Linux (statically linked)")))
5804
5805(define-public thin-provisioning-tools
5806 (package
5807 (name "thin-provisioning-tools")
5808 (version "0.8.5")
5809 (source
5810 (origin
5811 (method git-fetch)
5812 (uri (git-reference
5813 (url "https://github.com/jthornber/thin-provisioning-tools")
5814 (commit (string-append "v" version))))
5815 (file-name (git-file-name name version))
5816 (sha256
5817 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
5818 (build-system gnu-build-system)
5819 (arguments
5820 ;; Doesn't build with --enable-testing due to a function name collision
5821 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
5822 `(#:tests? #f))
5823 (native-inputs
5824 `(("automake" ,automake)
5825 ("autoreconf" ,autoconf)))
5826 (inputs
5827 (list boost expat libaio))
5828 (synopsis "Tools for manipulating the metadata of device-mapper targets")
5829 (description "A suite of tools for manipulating the metadata of the
5830dm-thin, dm-cache and dm-era device-mapper targets.")
5831 (home-page "https://github.com/jthornber/thin-provisioning-tools")
5832 (license license:gpl3+)))
5833
5834(define-public watchdogd
5835 (package
5836 (name "watchdogd")
5837 (version "4.1")
5838 (source (origin
5839 (method git-fetch)
5840 (uri (git-reference
5841 (url "https://github.com/troglobit/watchdogd")
5842 (commit version)))
5843 (file-name (git-file-name name version))
5844 (sha256
5845 (base32
5846 "1n5xq5gxrj8b8j2g323k0jpxabjnq9piw8v2fqcyphj33kmgay23"))))
5847 (build-system gnu-build-system)
5848 (native-inputs (list autoconf automake libtool pkg-config))
5849 (inputs (list libconfuse libite libuev))
5850 (synopsis "Advanced system & process supervisor for Linux")
5851 (description "This package provides an advanced monitor of critical system
5852resources, supervises the heartbeat of processes, records deadline
5853transgressions, and initiates a controlled reset if needed.")
5854 (home-page "https://troglobit.com/projects/watchdogd/")
5855 (license license:isc)))
5856
5857(define-public wireless-tools
5858 (package
5859 (name "wireless-tools")
5860 (version "30.pre9")
5861 (source
5862 (origin
5863 (method url-fetch)
5864 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/"
5865 "Linux/wireless_tools." version ".tar.gz"))
5866 (sha256
5867 (base32 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
5868 (snippet
5869 #~(begin
5870 ;; Remove the older header files that are not free software.
5871 (for-each (lambda (n)
5872 (delete-file (format #f "wireless.~a.h" n)))
5873 '(10 11 12 13 14 15 16 17 18 19 20))))))
5874 (build-system gnu-build-system)
5875 (arguments
5876 (list #:make-flags
5877 #~(list (string-append "PREFIX=" #$output)
5878 (string-append "INSTALL_MAN=" #$output "/share/man")
5879 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
5880 "BUILD_STATIC=")
5881 #:phases
5882 #~(modify-phases %standard-phases
5883 (replace 'configure
5884 (lambda* (#:key target #:allow-other-keys)
5885 (when target
5886 ;; Cross-compilation: use the cross tools.
5887 (substitute* (find-files "." "Makefile")
5888 (("CC = .*$")
5889 (string-append "CC = " target "-gcc\n"))
5890 (("AR = .*$")
5891 (string-append "AR = " target "-ar\n"))
5892 (("RANLIB = .*$")
5893 (string-append "RANLIB = " target "-ranlib\n")))))))
5894 #:tests? #f))
5895 (synopsis "Tools for manipulating Linux Wireless Extensions")
5896 (description "Wireless Tools are used to manipulate the now-deprecated
5897Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
5898Extension was an interface allowing you to set Wireless LAN specific
5899parameters and get the specific stats. It is deprecated in favor the nl80211
5900interface.")
5901 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
5902 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
5903 ;; other files are distributed under gpl2.
5904 (license (list license:gpl2 license:lgpl2.1+))))
5905
5906(define-public crda
5907 (package
5908 (name "crda")
5909 (version "4.15")
5910 (source
5911 (origin
5912 (method git-fetch)
5913 (uri (git-reference
5914 (url "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git")
5915 (commit (string-append "v" version))))
5916 (file-name (git-file-name name version))
5917 (sha256
5918 (base32 "1ajh8zx84p15y9wawh764zawniwn059iw9m32v56ajvkz9xbnkp2"))
5919 (patches (search-patches "crda-optional-gcrypt.patch"))))
5920 (build-system gnu-build-system)
5921 (arguments
5922 (list #:phases
5923 #~(modify-phases %standard-phases
5924 (delete 'configure)
5925 (add-after 'unpack 'gzip-deterministically
5926 (lambda _
5927 (substitute* "Makefile"
5928 (("gzip" command)
5929 (string-append command " --no-name")))))
5930 #$@(if (%current-target-system)
5931 #~((add-after 'unpack 'fix-pkg-config
5932 (lambda* (#:key target #:allow-other-keys)
5933 (substitute* "Makefile"
5934 (("pkg-config" command)
5935 (string-append target "-" command))))))
5936 #~())
5937 (add-before 'build 'patch-Makefile
5938 (lambda _
5939 (substitute* "Makefile"
5940 (("ldconfig") "true"))))
5941 (add-before 'build 'set-regulatory-db-file-name
5942 (lambda* (#:key native-inputs inputs #:allow-other-keys)
5943 ;; Tell CRDA where to find our database.
5944 (let ((regdb (assoc-ref (or native-inputs inputs)
5945 "wireless-regdb")))
5946 (substitute* "crda.c"
5947 (("\"/lib/crda/regulatory.bin\"")
5948 (string-append "\"" regdb
5949 "/lib/crda/regulatory.bin\"")))))))
5950 #:test-target "verify"
5951 #:make-flags
5952 #~(list
5953 (string-append "CC=" #$(cc-for-target))
5954 "V=1"
5955
5956 ;; Disable signature-checking on 'regulatory.bin'.
5957 ;; The reason is that this simplifies maintenance
5958 ;; on our side (no need to manage a distro key
5959 ;; pair), and we can guarantee integrity of
5960 ;; 'regulatory.bin' by other means anyway, such as
5961 ;; 'guix gc --verify'. See
5962 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
5963 ;; for a discssion.
5964 "USE_OPENSSL=0"
5965
5966 (string-append "PREFIX=" #$output)
5967 (string-append "SBINDIR=" #$output "/sbin/")
5968 (string-append "UDEV_RULE_DIR="
5969 #$output "/lib/udev/rules.d")
5970 (string-append "LDFLAGS=-Wl,-rpath="
5971 #$output "/lib -L.")
5972 (string-append "REG_BIN="
5973 #$(this-package-native-input "wireless-regdb")
5974 "/lib/crda/regulatory.bin")
5975 "all_noverify")))
5976 (native-inputs (list pkg-config wireless-regdb))
5977 (inputs (list libnl))
5978 (home-page
5979 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
5980 (synopsis "@acronym{CRDA, Central Regulatory Domain Agent} for WiFi")
5981 (description
5982 "The @acronym{CRDA, Central Regulatory Domain Agent} acts as the udev
5983helper for communication between the kernel Linux and user space for regulatory
5984compliance.")
5985 (license license:copyleft-next)))
5986
5987(define-public wireless-regdb
5988 (package
5989 (name "wireless-regdb")
5990 (version "2023.05.03")
5991 (source (origin
5992 (method url-fetch)
5993 (uri (string-append
5994 "mirror://kernel.org/software/network/wireless-regdb/"
5995 "wireless-regdb-" version ".tar.xz"))
5996 (sha256
5997 (base32 "04lc9jp8zxhyqxvkhrm637sswi2xm48jw8jnp3iflnknnf5d0m7j"))
5998
5999 ;; We're building 'regulatory.bin' by ourselves.
6000 (snippet '(begin
6001 (delete-file "regulatory.bin")))))
6002 (build-system gnu-build-system)
6003 (arguments
6004 (list
6005 #:phases
6006 #~(modify-phases %standard-phases
6007 (add-after 'unpack 'gzip-determinism
6008 (lambda _
6009 (substitute* "Makefile"
6010 (("gzip") "gzip --no-name"))))
6011 (add-after 'unpack 'omit-signature
6012 (lambda _
6013 (substitute* "Makefile"
6014 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
6015 ;; don't provide (see below). Disable it.
6016 ((" regulatory\\.db\\.p7s") "")
6017 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
6018 ;; but ‘make install’ depends only on the latter while
6019 ;; installing both (and failing). Depend on it explicitly.
6020 (("^install: " all) (string-append all "regulatory.db ")))))
6021 (delete 'configure)) ; no configure script
6022
6023 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
6024 ;; is computed and can be equal to 'maintainer-clean'; when that
6025 ;; happens, we can end up deleting the 'regulatory.bin' file that we
6026 ;; just built. Thus, build things sequentially.
6027 #:parallel-build? #f
6028
6029 #:tests? #f ; no tests
6030 #:make-flags
6031 #~(list (string-append "PREFIX=" #$output)
6032 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
6033
6034 ;; Leave this empty so that db2bin.py doesn't try to sign
6035 ;; ‘regulatory.bin’. This allows us to avoid managing a key
6036 ;; pair for the whole distribution.
6037 (string-append "REGDB_PRIVKEY=")
6038 ;; Don't generate a public key for the same reason. These are
6039 ;; used as Makefile targets and can't be the empty string.
6040 (string-append "REGDB_PUBCERT=/dev/null")
6041 (string-append "REGDB_PUBKEY=/dev/null"))))
6042 (native-inputs
6043 (list python-wrapper))
6044 (home-page
6045 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
6046 (synopsis "Wireless regulatory database")
6047 (description
6048 "This package contains the wireless regulatory database for the
6049@acronym{CRDA, Central Regulatory Database Agent}. The database contains
6050information on country-specific regulations for the wireless spectrum.")
6051 (license license:isc)))
6052
6053(define-public lm-sensors
6054 (package
6055 (name "lm-sensors")
6056 (version "3.6.2")
6057 (source
6058 (origin
6059 (method git-fetch)
6060 (uri (git-reference
6061 (url "https://github.com/hramrach/lm-sensors")
6062 (commit (string-append "V" (string-join
6063 (string-split version #\.) "-")))))
6064 (file-name (git-file-name name version))
6065 (sha256
6066 (base32 "0p2ck8p9zb1w53l37pvm6c10vi6r8bfz51nd3sdwwsfhfhgvsr0j"))
6067 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
6068 (build-system gnu-build-system)
6069 (outputs '("lib" ; avoid perl in closure
6070 "out"))
6071 (arguments
6072 (list
6073 #:tests? #f ; no 'check' target
6074 #:make-flags
6075 #~(list (string-append "PREFIX=" #$output)
6076 (string-append "ETCDIR=" #$output:lib "/etc")
6077 (string-append "INCLUDEDIR=" #$output:lib "/include")
6078 (string-append "MANDIR=" #$output "/share/man")
6079 (string-append "LIBDIR=" #$output:lib "/lib"))
6080 #:phases
6081 #~(modify-phases %standard-phases
6082 (delete 'configure)
6083 (add-before 'build 'patch-exec-paths
6084 (lambda* (#:key inputs #:allow-other-keys)
6085 (substitute* "prog/detect/sensors-detect"
6086 (("`uname")
6087 (string-append
6088 "`" (assoc-ref inputs "coreutils") "/bin/uname"))
6089 (("(`|\")modprobe" all open-quote)
6090 (string-append
6091 open-quote #$(this-package-input "kmod") "/bin/modprobe")))
6092 (substitute* '("prog/pwm/pwmconfig" "prog/pwm/fancontrol")
6093 (("gnuplot")
6094 (search-input-file inputs "/bin/gnuplot"))
6095 (("cat ")
6096 (string-append (search-input-file inputs "/bin/cat") " "))
6097 (("e?grep " match)
6098 (string-append
6099 (search-input-file
6100 inputs (string-append "/bin/" (string-trim-right match)))
6101 " "))
6102 (("sed -e")
6103 (string-append (search-input-file inputs "/bin/sed") " -e"))
6104 (("cut -d")
6105 (string-append (search-input-file inputs "/bin/cut") " -d"))
6106 (("sleep ")
6107 (string-append (search-input-file inputs "/bin/sleep") " "))
6108 (("readlink -f")
6109 (string-append
6110 (search-input-file inputs "/bin/readlink") " -f"))))))))
6111 (inputs
6112 (list gnuplot kmod perl rrdtool))
6113 (native-inputs
6114 (list bison flex pkg-config which))
6115 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
6116 (synopsis "Utilities to read temperature/voltage/fan sensors")
6117 (description
6118 "Lm-sensors is a hardware health monitoring package for Linux. It allows
6119you to access information from temperature, voltage, and fan speed sensors.
6120It works with most newer systems.")
6121 (license license:gpl2+)))
6122
6123(define-public iucode-tool
6124 (package
6125 (name "iucode-tool")
6126 (version "2.3.1")
6127 (source (origin
6128 (method url-fetch)
6129 (uri (string-append "https://gitlab.com/iucode-tool/releases"
6130 "/raw/latest/iucode-tool_" version ".tar.xz"))
6131 (sha256
6132 (base32
6133 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
6134 (build-system gnu-build-system)
6135 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
6136 (synopsis "Manipulate Intel microcode bundles")
6137 (description
6138 "@command{iucode_tool} is a utility to work with microcode packages for
6139Intel processors. It can convert between formats, extract specific versions,
6140create a firmware image suitable for the Linux kernel, and more.")
6141 ;; cpuid.h is available for i686, x86_64, and ia64.
6142 (supported-systems '("i686-linux" "x86_64-linux"))
6143 (license license:gpl2+)))
6144
6145(define-public i2c-tools
6146 (package
6147 (name "i2c-tools")
6148 (version "4.3")
6149 (source (origin
6150 (method url-fetch)
6151 (uri (string-append
6152 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6153 version ".tar.xz"))
6154 (sha256
6155 (base32
6156 "1y0fphjd5ah2j886x8i175r7viq0hmx666hyca0wi4dzrm290qxk"))))
6157 (build-system gnu-build-system)
6158 (arguments
6159 `(#:tests? #f ; no 'check' target
6160 #:make-flags
6161 ,#~(list (string-append "PREFIX=" #$output)
6162 (string-append "LDFLAGS+=-Wl,-rpath=" #$output "/lib")
6163 (string-append "CC=" #$(cc-for-target)))
6164 ;; No configure script.
6165 #:phases (modify-phases %standard-phases (delete 'configure))))
6166 (inputs
6167 (list perl))
6168 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
6169 (synopsis "I2C tools for Linux")
6170 (description
6171 "The i2c-tools package contains a heterogeneous set of I2C tools for
6172Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
6173EEPROM decoding scripts, EEPROM programming tools, and a python module for
6174SMBus access.")
6175 (license license:gpl2+)))
6176
6177(define-public i2c-tools-3
6178 (package
6179 (inherit i2c-tools)
6180 (name "i2c-tools")
6181 (version "3.1.2")
6182 (source (origin
6183 (method url-fetch)
6184 (uri (string-append
6185 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6186 version ".tar.bz2"))
6187 (sha256
6188 (base32 "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv"))))
6189 (arguments
6190 (substitute-keyword-arguments (package-arguments i2c-tools)
6191 ((#:make-flags _)
6192 #~(list (string-append "prefix=" #$output)
6193 (string-append "CC=" #$(cc-for-target))))))))
6194
6195(define-public python-smbus
6196 (package
6197 (inherit i2c-tools)
6198 (name "python-smbus")
6199 (build-system pyproject-build-system)
6200 (arguments
6201 (list #:tests? #f ;; No test suite.
6202 #:phases
6203 #~(modify-phases %standard-phases
6204 (add-after 'unpack 'change-directory
6205 (lambda _ (chdir "py-smbus")))
6206 (add-after 'change-directory 'set-library-path
6207 (lambda _
6208 (substitute* "setup.py"
6209 (("-L\\.\\./lib")
6210 (string-append "-L" #$(this-package-input "i2c-tools")
6211 "/lib"))))))))
6212 (inputs (list i2c-tools))
6213 (native-inputs (list python-setuptools python-wheel))
6214 (synopsis "I2C/SMBus access for Python")
6215 (description "This package provides a Python library to access
6216@acronym{I2C, Inter-Integrated Circuit} and @acronym{SMBus, System
6217Management Bus} devices on Linux.")))
6218
6219(define-public xsensors
6220 (package
6221 (name "xsensors")
6222 (version "0.70")
6223 (source (origin
6224 (method url-fetch)
6225 (uri (string-append
6226 "http://www.linuxhardware.org/xsensors/xsensors-"
6227 version ".tar.gz"))
6228 (sha256
6229 (base32
6230 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
6231 (build-system gnu-build-system)
6232 (inputs `(("lm-sensors" ,lm-sensors "lib")
6233 ("gtk" ,gtk+-2)))
6234 (native-inputs (list pkg-config))
6235 (arguments
6236 `(#:phases
6237 (modify-phases %standard-phases
6238 (add-before 'configure 'enable-deprecated
6239 (lambda _
6240 (substitute* "src/Makefile.in"
6241 (("-DGDK_DISABLE_DEPRECATED") "")
6242 (("-DGTK_DISABLE_DEPRECATED") ""))
6243 #t))
6244 (add-before 'configure 'remove-Werror
6245 (lambda _
6246 (substitute* '("configure" "src/Makefile.in")
6247 (("-Werror") ""))
6248 #t)))))
6249 (home-page "http://www.linuxhardware.org/xsensors/")
6250 (synopsis "Hardware health information viewer")
6251 (description
6252 "Xsensors reads data from the libsensors library regarding hardware
6253health such as temperature, voltage and fan speed and displays the information
6254in a digital read-out.")
6255 (license license:gpl2+)))
6256
6257(define-public perf
6258 (package
6259 (name "perf")
6260 (version (package-version linux-libre))
6261 (source (package-source linux-libre))
6262 (build-system gnu-build-system)
6263 (arguments
6264 '(#:phases
6265 (modify-phases %standard-phases
6266 (replace 'configure
6267 (lambda* (#:key inputs #:allow-other-keys)
6268 (setenv "SHELL_PATH" (which "bash"))
6269 (chdir "tools/perf")
6270
6271 ;; In Linux 6.10.6, 'Makefile.config' overrides PKG_CONFIG_PATH
6272 ;; when looking for libtraceevent and thus fails to find it.
6273 ;; Remove that.
6274 (substitute* "Makefile.config"
6275 (("PKG_CONFIG_PATH=[[:graph:]]+")
6276 ""))
6277
6278 ;; This file hard-codes file system layouts for specific distros
6279 ;; but not for ours; address that. With this change, one can run
6280 ;; "perf report --symfs=$HOME/.guix-profile" (without
6281 ;; "/lib/debug") and 'perf' should be able to find separate debug
6282 ;; info files.
6283 (substitute* "util/dso.c"
6284 (("/usr/lib/debug")
6285 "/lib/debug")))))
6286 #:make-flags (list (string-append "prefix="
6287 (assoc-ref %outputs "out"))
6288 "CC=gcc"
6289 "WERROR=0"
6290
6291 ;; By default, 'config/Makefile' uses lib64 on
6292 ;; x86_64. Work around that.
6293 "lib=lib")
6294 #:tests? #f)) ;no tests
6295 (native-inputs
6296 (list pkg-config
6297 bison
6298 flex
6299 ;; There are build scripts written in these languages.
6300 perl
6301 python-2
6302 python-3
6303 ;; Documentation
6304 docbook-xsl
6305 xmlto
6306 asciidoc))
6307 (inputs
6308 (list slang ;for the interactive TUI
6309 zlib
6310 ;; newt
6311 python-2 ;'perf' links against libpython
6312 elfutils
6313 libiberty ;used alongside BDF for symbol demangling
6314 libunwind ;better stack walking
6315 libtraceevent
6316 numactl)) ;for 'perf bench numa mem'
6317 (home-page "https://perf.wiki.kernel.org/")
6318 (synopsis "Linux profiling with performance counters")
6319 (description
6320 "perf is a tool suite for profiling using hardware performance counters,
6321with support in the Linux kernel. perf can instrument CPU performance
6322counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
6323of lightweight profiling. This package contains the user-land tools and in
6324particular the @code{perf} command.")
6325 (license (package-license linux-libre))))
6326
6327(define-public pflask
6328 (package
6329 (name "pflask")
6330 (version "0.2")
6331 (source (origin
6332 (method git-fetch)
6333 (uri (git-reference
6334 (url "https://github.com/ghedo/pflask")
6335 (commit (string-append "v" version))))
6336 (file-name (git-file-name name version))
6337 (sha256
6338 (base32
6339 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
6340 (build-system cmake-build-system)
6341 (arguments
6342 '(#:tests? #f)) ; no tests
6343 (home-page "https://ghedo.github.io/pflask/")
6344 (synopsis "Simple tool for creating Linux namespace containers")
6345 (description "pflask is a simple tool for creating Linux namespace
6346containers. It can be used for running a command or even booting an OS inside
6347an isolated container, created with the help of Linux namespaces. It is
6348similar in functionality to chroot, although pflask provides better isolation
6349thanks to the use of namespaces.")
6350 (license license:bsd-2)))
6351
6352(define-public singularity
6353 (package
6354 (name "singularity")
6355 (version "2.6.1")
6356 (source (origin
6357 (method url-fetch)
6358 (uri (string-append "https://github.com/singularityware/singularity/"
6359 "releases/download/" version
6360 "/singularity-" version ".tar.gz"))
6361 (sha256
6362 (base32
6363 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
6364 (modules '((guix build utils)))
6365 (snippet
6366 '(begin
6367 ;; Do not create directories in /var.
6368 (substitute* "Makefile.in"
6369 (("\\$\\(MAKE\\) .*install-data-hook") ""))
6370
6371 ;; The original source overrides PATH so that it points to
6372 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
6373 ;; on Guix System. Leave PATH unchanged so we refer to the
6374 ;; installed Coreutils, grep, etc.
6375 (substitute* "bin/singularity.in"
6376 (("^PATH=.*" all)
6377 (string-append "#" all "\n")))
6378
6379 (substitute* (find-files "libexec/cli" "\\.exec$")
6380 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
6381 _ program)
6382 (string-append "/run/privileged/bin/singularity-"
6383 program "-helper")))
6384
6385 ;; These squashfs mount options are apparently no longer
6386 ;; supported since Linux-libre 5.4.5.
6387 (substitute* "src/lib/image/squashfs/mount.c"
6388 (("\"errors=remount-ro\"")
6389 "NULL"))))))
6390 (build-system gnu-build-system)
6391 (arguments
6392 (list
6393 #:configure-flags #~(list "--localstatedir=/var")
6394 #:phases
6395 #~(modify-phases %standard-phases
6396 (add-after 'unpack 'patch-references
6397 (lambda _
6398 (substitute* "libexec/cli/build.exec.in"
6399 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
6400 (substitute* (append
6401 (find-files "libexec" "functions")
6402 (find-files "libexec/bootstrap-scripts" ".*sh$")
6403 (find-files "libexec/cli" ".*exec$"))
6404 (("\\| grep ")
6405 (string-append "| " (which "grep") " "))
6406 (("egrep ")
6407 (string-append (which "egrep") " "))
6408 ((" sed ")
6409 (string-append " " (which "sed") " ")))))
6410 (add-after 'install 'set-PATH
6411 (lambda _
6412 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
6413 ;; But don't override PATH, so that other tools like zcat and
6414 ;; tar can still be found if they are available.
6415 (let ((coreutils #$(this-package-input "coreutils")))
6416 (wrap-program (string-append #$output "/bin/singularity")
6417 `("PATH" prefix (,(string-append coreutils "/bin"))))
6418 (substitute* (string-append #$output "/bin/run-singularity")
6419 (("/usr/bin/env singularity")
6420 (string-append (which "env") " "
6421 #$output "/bin/singularity")))))))))
6422 (inputs
6423 (list bash-minimal
6424 coreutils
6425 libarchive
6426 python-wrapper
6427 squashfs-tools
6428 zlib))
6429 (home-page "https://singularity.lbl.gov/")
6430 (synopsis "Container platform")
6431 (description "Singularity is a container platform supporting a number of
6432container image formats. It can build SquashFS container images or import
6433existing Docker images. Singularity requires kernel support for container
6434isolation or root privileges.")
6435 (license license:bsd-3)))
6436
6437(define-public python-spython
6438 (package
6439 (name "python-spython")
6440 (version "0.3.13")
6441 (source
6442 (origin
6443 (method url-fetch)
6444 (uri (pypi-uri "spython" version))
6445 (sha256
6446 (base32 "0kly851k6mj7xzcybciav5d0pq5q04pzg7c5a1g712bqbxkha4ck"))))
6447 (build-system pyproject-build-system)
6448 (arguments
6449 (list
6450 #:phases
6451 #~(modify-phases %standard-phases
6452 ;; Configure absolute path to singularity.
6453 (add-after 'unpack 'configure
6454 (lambda* (#:key inputs #:allow-other-keys)
6455 (let ((singularity (search-input-file inputs "bin/singularity")))
6456 (substitute* "spython/utils/terminal.py"
6457 (("software=\"singularity\"")
6458 (string-append "software=\"" singularity "\"")))
6459 (substitute* (list "spython/utils/terminal.py"
6460 "spython/main/help.py"
6461 "spython/main/base/command.py")
6462 (("\\[\"singularity\"")
6463 (string-append "[\"" singularity "\"")))
6464 (substitute* "spython/main/execute.py"
6465 (("shutil.which\\(\"singularity\"\\)")
6466 (string-append "shutil.which(\"" singularity "\")"))))))
6467 ;; Skip tests that require network access.
6468 (add-before 'check 'skip-tests
6469 (lambda _
6470 (delete-file "spython/tests/test_client.py"))))))
6471 (inputs
6472 (list singularity))
6473 (native-inputs
6474 (list python-pytest
6475 python-pytest-runner
6476 python-setuptools
6477 python-wheel))
6478 (home-page "https://github.com/singularityhub/singularity-cli")
6479 (synopsis "Singularity Python client")
6480 (description "@code{python-spython} is a Python library to interact with
6481Singularity containers.")
6482 (license license:mpl2.0)))
6483
6484(define-public libnvme
6485 (package
6486 (name "libnvme")
6487 (version "1.5")
6488 (source (origin
6489 (method git-fetch)
6490 (uri (git-reference
6491 (url "https://github.com/linux-nvme/libnvme.git")
6492 (commit (string-append "v" version))))
6493 (sha256
6494 (base32 "1wq8bw60l090z2kb717wyzk5wz1jrcn31ykdaa7k9pz9w79v0v67"))
6495 (file-name (git-file-name name version))))
6496 (build-system meson-build-system)
6497 (outputs (list "out" "doc")) ; docs are 80% of all output
6498 (arguments
6499 (list
6500 #:configure-flags
6501 #~(let ((doc (string-append #$output:doc "/share/doc/" #$name)))
6502 (list (string-append "-Dhtmldir=" doc "/html")
6503 (string-append "-Drstdir=" doc "/rst")
6504 "-Ddocs-build=true" "-Ddocs=all"))))
6505 (native-inputs (list pkg-config perl python python-sphinx))
6506 ;; libnvme.pc, libnvme-mi.pc lists these in Requires.private.
6507 (propagated-inputs (list dbus json-c openssl))
6508 (home-page "https://github.com/linux-nvme/libnvme")
6509 (synopsis "C Library for NVM Express on Linux")
6510 (description "libnvme provides type definitions for NVMe specification
6511structures, enumerations, and bit fields, helper functions to construct,
6512dispatch, and decode commands and payloads, and utilities to connect, scan,
6513and manage nvme devices on a Linux system.")
6514 (license license:lgpl2.1+)))
6515
6516(define-public nvme-cli
6517 (package
6518 (name "nvme-cli")
6519 (version "2.5")
6520 (home-page "https://github.com/linux-nvme/nvme-cli")
6521 (source (origin
6522 (method git-fetch)
6523 (uri (git-reference
6524 (url home-page)
6525 (commit (string-append "v" version))))
6526 (sha256
6527 (base32 "1jv1xir6gm86yyk5846qqkcjhc1bq103zyxf794fznyinh4nhlbg"))
6528 (file-name (git-file-name name version))))
6529 (build-system meson-build-system)
6530 (outputs (list "out" "doc")) ; docs make up ~70% of total size
6531 (arguments
6532 (list
6533 #:configure-flags #~(list (format #f "-Dhtmldir=~a/share/doc/~a/html"
6534 #$output:doc #$name)
6535 "-Ddocs=all")))
6536 (native-inputs (list pkg-config))
6537 (inputs (list libnvme json-c zlib))
6538 (synopsis "NVM-Express user space tooling for Linux")
6539 (description "Nvme-cli is a utility to provide standards compliant tooling
6540for NVM-Express drives. It was made specifically for Linux as it relies on the
6541IOCTLs defined by the mainline kernel driver.")
6542 (license license:gpl2+)))
6543
6544(define-public rfkill
6545 (package
6546 (name "rfkill")
6547 (version "0.5")
6548 (source (origin
6549 (method url-fetch)
6550 (uri (string-append "mirror://kernel.org/software/network/"
6551 name "/" name "-" version ".tar.xz"))
6552 (sha256
6553 (base32
6554 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
6555 (build-system gnu-build-system)
6556 (arguments
6557 `(#:make-flags (list "CC=gcc"
6558 (string-append "PREFIX=" %output))
6559 #:phases (modify-phases %standard-phases
6560 (delete 'configure))
6561 #:tests? #f))
6562 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
6563 (synopsis "Tool for enabling and disabling wireless devices")
6564 (description
6565 "rfkill is a simple tool for accessing the rfkill device interface,
6566which is used to enable and disable wireless networking devices, typically
6567WLAN, Bluetooth and mobile broadband.")
6568 (license (license:non-copyleft "file://COPYING"
6569 "See COPYING in the distribution."))
6570 ;; rfkill is part of util-linux as of 2.31.
6571 (properties `((superseded . ,util-linux)))))
6572
6573(define-public acpi
6574 (package
6575 (name "acpi")
6576 (version "1.7")
6577 (source (origin
6578 (method url-fetch)
6579 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
6580 version "/" name "-" version ".tar.gz"))
6581 (sha256
6582 (base32
6583 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
6584 (build-system gnu-build-system)
6585 (home-page "http://acpiclient.sourceforge.net")
6586 (synopsis "Display information on ACPI devices")
6587 (description "@code{acpi} attempts to replicate the functionality of the
6588\"old\" @code{apm} command on ACPI systems, including battery and thermal
6589information. It does not support ACPI suspending, only displays information
6590about ACPI devices.")
6591 (license license:gpl2+)))
6592
6593(define-public acpid
6594 (package
6595 (name "acpid")
6596 (version "2.0.34")
6597 (source (origin
6598 (method url-fetch)
6599 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
6600 version ".tar.xz"))
6601 (sha256
6602 (base32
6603 "0cxkdbd087kj9ikprvvjpk0ixzqbipf2rmj6qyp7r15wzj65q29d"))))
6604 (build-system gnu-build-system)
6605 (home-page "https://sourceforge.net/projects/acpid2/")
6606 (synopsis "Daemon for delivering ACPI events to user-space programs")
6607 (description
6608 "acpid is designed to notify user-space programs of Advanced
6609Configuration and Power Interface (ACPI) events. acpid should be started
6610during the system boot, and will run as a background process. When an ACPI
6611event is received from the kernel, acpid will examine the list of rules
6612specified in /etc/acpi/events and execute the rules that match the event.")
6613 (license license:gpl2+)))
6614
6615(define-public sysfsutils
6616 (package
6617 (name "sysfsutils")
6618 (version "2.1.0")
6619 (source
6620 (origin
6621 (method url-fetch)
6622 (uri
6623 (string-append
6624 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
6625 version ".tar.gz"))
6626 (sha256
6627 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
6628 (build-system gnu-build-system)
6629 (home-page "https://linux-diag.sourceforge.net/Sysfsutils.html")
6630 (synopsis "System utilities based on Linux sysfs")
6631 (description
6632 "These are a set of utilities built upon sysfs, a virtual file system in
6633Linux kernel versions 2.5+ that exposes a system's device tree. The package
6634also contains the libsysfs library.")
6635 ;; The library is under lgpl2.1+ (all files say "or any later version").
6636 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
6637 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
6638
6639(define-public cpufrequtils
6640 (let ((commit "a2f0c39d5f21596bb9f5223e895c0ff210b265d0")
6641 (revision "1"))
6642 (package
6643 (name "cpufrequtils")
6644 (version (git-version "008" revision commit ))
6645 (source
6646 (origin
6647 (method git-fetch)
6648 (uri
6649 (git-reference
6650 (url "https://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpufrequtils.git")
6651 (commit commit)))
6652 (file-name (git-file-name name version))
6653 (sha256
6654 (base32 "01n2hp6v89cilqqvqvlcprphyhnljsjclh4h1zf3b1l7ypz29lbp"))))
6655 (build-system gnu-build-system)
6656 (arguments
6657 `(#:tests? #f ; no test suite
6658 #:make-flags
6659 (let ((out (assoc-ref %outputs "out")))
6660 (list "PROC=false" ; obsoleted by sysfs in Linux 2.6(!)
6661 (string-append "CC=" ,(cc-for-target))
6662 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
6663 "INSTALL=install"
6664 (string-append "bindir=" out "/bin")
6665 (string-append "sbindir=" out "/sbin")
6666 (string-append "mandir=" out "/share/man")
6667 (string-append "includedir=" out "/include")
6668 (string-append "libdir=" out "/lib")
6669 (string-append "localedir=" out "/share/locale")
6670 (string-append "docdir=" out "/share/doc/" ,name)))
6671 #:phases
6672 (modify-phases %standard-phases
6673 (delete 'configure)))) ; no configure script
6674 (native-inputs
6675 `(("gettext" ,gettext-minimal)))
6676 (home-page
6677 "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
6678 (synopsis "Utilities to get and set CPU frequency on Linux")
6679 (description
6680 "The cpufrequtils suite contains utilities to retrieve CPU frequency
6681information, and set the CPU frequency if supported, using the cpufreq
6682capabilities of the Linux kernel.")
6683 (license license:gpl2))))
6684
6685(define-public libite
6686 (package
6687 (name "libite")
6688 (version "2.5.2")
6689 (source
6690 (origin
6691 (method git-fetch)
6692 (uri (git-reference
6693 (url "https://github.com/troglobit/libite")
6694 (commit (string-append "v" version))))
6695 (file-name (git-file-name name version))
6696 (sha256
6697 (base32 "0i27ppb557kdc1hm7nf0f5r7sxvqma31pr57h79whl6qcp28gy4a"))))
6698 (build-system gnu-build-system)
6699 (arguments
6700 `(#:configure-flags
6701 (list "--disable-static")
6702 #:phases
6703 (modify-phases %standard-phases
6704 (add-after 'unpack 'fix-tests
6705 (lambda* (#:key inputs #:allow-other-keys)
6706 ;; replace paths to the executables
6707 (substitute* "test/which.c"
6708 (("/usr/bin/which")
6709 (search-input-file inputs "/bin/which"))
6710 (("ls\"")
6711 (string-append
6712 (search-input-file inputs "/bin/ls") "\"")))
6713 ;; create pidfile in /tmp instead of /var
6714 (substitute* "test/pidfile.c" (("/var/tmp") "/tmp")))))))
6715 (native-inputs (list autoconf automake libtool which))
6716 (synopsis "Library providing missing pieces in GNU libc")
6717 (description "This package provides many of the missing pieces in GNU
6718libc. Most notably the string functions: strlcpy(3), strlcat(3) and the *BSD
6719sys/queue.h and sys/tree.h API's.")
6720 (home-page "https://troglobit.com/projects/libite/")
6721 (license license:expat)))
6722
6723(define-public libuev
6724 (package
6725 (name "libuev")
6726 (version "2.4.0")
6727 (source
6728 (origin
6729 (method git-fetch)
6730 (uri (git-reference
6731 (url "https://github.com/troglobit/libuev")
6732 (commit (string-append "v" version))))
6733 (file-name (git-file-name name version))
6734 (sha256
6735 (base32
6736 "0ih82lxfdcq179kknzdl5c8vi1l0n5j7yh68y8f6kwsrm457paf7"))))
6737 (build-system gnu-build-system)
6738 (native-inputs (list autoconf automake libtool))
6739 (synopsis "Lightweight event loop library for epoll family APIs")
6740 (description "This package provides small event loop that wraps the
6741epoll family of APIs.")
6742 (home-page "https://troglobit.com/projects/libuev/")
6743 (license license:expat)))
6744
6745(define-public libraw1394
6746 (package
6747 (name "libraw1394")
6748 (version "2.1.2")
6749 (source (origin
6750 (method url-fetch)
6751 (uri (string-append
6752 "mirror://kernel.org/linux/libs/ieee1394/"
6753 name "-" version ".tar.xz"))
6754 (sha256
6755 (base32
6756 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
6757 (build-system gnu-build-system)
6758 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
6759 (synopsis "Interface library for the Linux IEEE1394 drivers")
6760 (description
6761 "Libraw1394 is the only supported interface to the kernel side raw1394 of
6762the Linux IEEE-1394 subsystem, which provides direct access to the connected
67631394 buses to user space. Through libraw1394/raw1394, applications can directly
6764send to and receive from other nodes without requiring a kernel driver for the
6765protocol in question.")
6766 (license license:lgpl2.1+)))
6767
6768(define-public libavc1394
6769 (package
6770 (name "libavc1394")
6771 (version "0.5.4")
6772 (source (origin
6773 (method url-fetch)
6774 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
6775 name "-" version ".tar.gz"))
6776 (sha256
6777 (base32
6778 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
6779 (build-system gnu-build-system)
6780 (native-inputs
6781 (list pkg-config))
6782 (propagated-inputs
6783 (list libraw1394)) ; required by libavc1394.pc
6784 (home-page "https://sourceforge.net/projects/libavc1394/")
6785 (synopsis "AV/C protocol library for IEEE 1394")
6786 (description
6787 "Libavc1394 is a programming interface to the AV/C specification from
6788the 1394 Trade Association. AV/C stands for Audio/Video Control.")
6789 (license license:lgpl2.1+)))
6790
6791(define-public libiec61883
6792 (package
6793 (name "libiec61883")
6794 (version "1.2.0")
6795 (source (origin
6796 (method url-fetch)
6797 (uri (string-append
6798 "mirror://kernel.org/linux/libs/ieee1394/"
6799 name "-" version ".tar.xz"))
6800 (sha256
6801 (base32
6802 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
6803 (build-system gnu-build-system)
6804 (native-inputs
6805 (list pkg-config))
6806 (propagated-inputs
6807 (list libraw1394)) ; required by libiec61883.pc
6808 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
6809 (synopsis "Isochronous streaming media library for IEEE 1394")
6810 (description
6811 "The libiec61883 library provides a higher level API for streaming DV,
6812MPEG-2 and audio over Linux IEEE 1394.")
6813 (license license:lgpl2.1+)))
6814
6815(define-public mdadm
6816 (package
6817 (name "mdadm")
6818 (version "4.2")
6819 (source (origin
6820 (method url-fetch)
6821 (uri (string-append
6822 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
6823 version ".tar.xz"))
6824 (sha256
6825 (base32
6826 "07ghmibmbnkdy91ng87zdllzicm299l20dhs9m5bfjw6f1b22726"))))
6827 (build-system gnu-build-system)
6828 (arguments
6829 (list #:make-flags
6830 #~(list (string-append "CC=" #$(cc-for-target))
6831 "INSTALL=install"
6832 "CHECK_RUN_DIR=0"
6833 ;; TODO: tell it where to find 'sendmail'
6834 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
6835 (string-append "BINDIR=" #$output "/sbin")
6836 (string-append "MANDIR=" #$output "/share/man")
6837 (string-append "UDEVDIR=" #$output "/lib/udev"))
6838 #:phases
6839 #~(modify-phases %standard-phases
6840 (add-before 'build 'patch-program-paths
6841 (lambda* (#:key native-inputs inputs #:allow-other-keys)
6842 (let ((coreutils (assoc-ref (or native-inputs inputs)
6843 "coreutils")))
6844 (substitute* "udev-md-raid-arrays.rules"
6845 (("/usr/bin/(readlink|basename)" all program)
6846 (string-append coreutils "/bin/" program))))))
6847 (add-before 'build 'remove-W-error
6848 (lambda _
6849 ;; We cannot build with -Werror on i686 due to a
6850 ;; 'sign-compare' warning in util.c.
6851 (substitute* "Makefile"
6852 (("-Werror") ""))))
6853 (delete 'configure))
6854 ;; Tests must be run as root.
6855 #:tests? #f))
6856 (inputs
6857 (list eudev))
6858 (supported-systems (remove target-hurd? %supported-systems))
6859 (home-page "http://neil.brown.name/blog/mdadm")
6860 (synopsis "Tool for managing Linux Software RAID arrays")
6861 (description
6862 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
6863assemble, report on, and monitor arrays. It can also move spares between raid
6864arrays when needed.")
6865 (license license:gpl2+)))
6866
6867(define-public mdadm-static
6868 (package
6869 (inherit mdadm)
6870 (name "mdadm-static")
6871 (arguments
6872 (substitute-keyword-arguments (package-arguments mdadm)
6873 ((#:make-flags flags)
6874 #~(cons* "LDFLAGS = -static"
6875 "CXFLAGS = -DNO_LIBUDEV"
6876 #$flags))
6877 ((#:phases phases)
6878 #~(modify-phases #$phases
6879 (add-after 'install 'remove-cruft
6880 (lambda* (#:key outputs #:allow-other-keys)
6881 (let* ((out (assoc-ref outputs "out"))
6882 (precious? (lambda (file)
6883 (member file '("." ".." "sbin"))))
6884 (directories (scandir out (negate precious?))))
6885 (with-directory-excursion out
6886 (for-each delete-file-recursively directories)
6887 (remove-store-references "sbin/mdadm")
6888 (delete-file "sbin/mdmon")))))))
6889 ((#:modules modules %default-gnu-modules)
6890 `((ice-9 ftw) ,@modules))
6891 ((#:strip-flags _ '())
6892 ''("--strip-all")) ;strip a few extra KiB
6893 ((#:allowed-references _ '("out"))
6894 '("out")))) ;refer only self
6895 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
6896
6897(define-public multipath-tools
6898 (package
6899 (name "multipath-tools")
6900 (version "0.11.0")
6901 (home-page "https://github.com/opensvc/multipath-tools")
6902 (source (origin
6903 (method git-fetch)
6904 (uri (git-reference (url home-page) (commit version)))
6905 (file-name (git-file-name name version))
6906 (sha256
6907 (base32
6908 "1yl2cd4xgw2l5xzx5dbdf7awhrvfbjsrspli9i6bmxc5j4jkvazr"))
6909 (modules '((guix build utils)))
6910 (snippet
6911 '(begin
6912 ;; Drop bundled valgrind headers.
6913 (delete-file-recursively "third-party")
6914 (substitute* '("multipathd/main.c"
6915 "libmpathutil/debug.c")
6916 (("#include \"../third-party/")
6917 "#include \""))))))
6918 (build-system gnu-build-system)
6919 (arguments
6920 (list
6921 #:test-target "test"
6922 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
6923 (string-append "prefix=" #$output)
6924 ;; Install Udev rules below this directory, relative
6925 ;; to the prefix.
6926 (string-append "systemd_prefix=" #$output))
6927 #:phases
6928 #~(modify-phases %standard-phases
6929 (add-after 'unpack 'patch-source
6930 (lambda* (#:key inputs #:allow-other-keys)
6931 (let ((libdevmapper.h
6932 (search-input-file inputs "include/libdevmapper.h"))
6933 (libudev.h
6934 (search-input-file inputs "include/libudev.h")))
6935 (substitute* "Makefile.inc"
6936 (("/bin/echo") "echo")
6937 (("\\$\\(prefix\\)/usr") "$(prefix)")
6938 (("configdir.*:= \\$\\(prefix\\)/etc/multipath/conf.d")
6939 "configdir := /etc/multipath/conf.d")
6940 ;; Do not save timestamp to avoid gzip "timestamp
6941 ;; out-of-range" warnings.
6942 (("gzip -9") "gzip -9n"))
6943 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
6944 (("/usr/include/libdevmapper.h") libdevmapper.h)
6945 (("/usr/include/libudev.h") libudev.h)))))
6946 (add-after 'unpack 'skip-failing-tests
6947 (lambda _
6948 ;; This test and the module's setup() test an arbitrary block
6949 ;; device node name, but the build environment has none.
6950 (substitute* "tests/devt.c"
6951 (("return get_one_devt.*") "return 0;\n")
6952 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
6953 ;; The above triggers -Werror=unused-function. Ignore it.
6954 (substitute* "tests/Makefile"
6955 (("CFLAGS \\+= " match)
6956 (string-append match "-Wno-error=unused-function ")))))
6957 (delete 'configure) ;no configure script
6958 (add-before 'build 'no-fortify-3
6959 (lambda _
6960 ;; NOTE: The check made seems to wrongly assume the
6961 ;; FORTIFY_SOURCE=3 is valid. However, when compiling, warnings
6962 ;; are emitted from glibc, resulting in failed build. Fix this
6963 ;; by forcing the usage of FORTIFY_SOURCE=2.
6964 (substitute* "create-config.mk"
6965 (("FORTIFY_SOURCE=3")
6966 "FORTIFY_SOURCE=2"))))
6967 (add-before 'build 'set-LDFLAGS
6968 (lambda _
6969 ;; Note: this cannot be passed as a make flag because that will
6970 ;; override the build system LDFLAGS.
6971 (setenv "LDFLAGS"
6972 (string-append "-Wl,-rpath=" #$output "/lib")))))))
6973
6974 (native-inputs
6975 (list perl pkg-config valgrind/pinned
6976 ;; For tests.
6977 cmocka))
6978 (inputs
6979 (list json-c
6980 libaio
6981 liburcu
6982 lvm2
6983 readline
6984 eudev
6985 ;; For libmount.
6986 `(,util-linux "lib")))
6987 (synopsis "Access block devices through multiple paths")
6988 (description
6989 "This package provides the following binaries to drive the
6990Linux Device Mapper multipathing driver:
6991@enumerate
6992@item @command{multipath} - Device mapper target autoconfig.
6993@item @command{multipathd} - Multipath daemon.
6994@item @command{mpathpersist} - Manages SCSI persistent reservations on
6995@code{dm} multipath devices.
6996@item @command{kpartx} - Create device maps from partition tables.
6997@end enumerate")
6998 (license (list license:gpl2+ ;main distribution
6999 license:lgpl2.0+)))) ;libmpathcmd/mpath_cmd.h
7000
7001(define-public libaio
7002 (package
7003 (name "libaio")
7004 (version "0.3.113")
7005 (source (origin
7006 (method url-fetch)
7007 (uri (list
7008 (string-append "https://releases.pagure.org/libaio/"
7009 name "-" version ".tar.gz")))
7010 (sha256
7011 (base32
7012 "02r0g2vfv6kfljplm3ga93w4xw13q2wixbn9hwi7ahqdzp2x2i1c"))
7013 (patches (search-patches "libaio-32bit-test.patch"))))
7014 (build-system gnu-build-system)
7015 (arguments
7016 (list #:make-flags
7017 #~(list (string-append "prefix=" #$output)
7018 (string-append "CC=" #$(cc-for-target)))
7019 #:test-target "partcheck" ; need root for a full 'check'
7020 #:phases
7021 #~(modify-phases %standard-phases
7022 (add-after 'unpack 'disable-problematic-tests
7023 (lambda _
7024 (with-directory-excursion "harness/cases"
7025 ;; The 21.t test fails with "Expected 4096, got
7026 ;; 18446744073709551605" (see:
7027 ;; https://pagure.io/libaio/issue/26).
7028 (rename-file "21.t" "21.t.disabled"))))
7029 (delete 'configure) ; no configure script
7030 #$@(if (target-riscv64?)
7031 #~((add-after 'unpack 'patch-test
7032 (lambda* (#:key build-inputs #:allow-other-keys)
7033 (invoke "patch" "-p1" "-i"
7034 #$(local-file
7035 (search-patch
7036 "libaio-riscv-test5.patch"))))))
7037 #~()))))
7038 (native-inputs
7039 (if (target-riscv64?)
7040 (list (search-patch "libaio-riscv-test5.patch")
7041 patch)
7042 '()))
7043 (home-page "https://pagure.io/libaio")
7044 (synopsis "Linux-native asynchronous I/O access library")
7045 (description
7046 "This library enables userspace to use Linux kernel asynchronous I/O
7047system calls, important for the performance of databases and other advanced
7048applications.")
7049 (license license:lgpl2.1+)))
7050
7051(define-public blktrace
7052 ;; Take a newer commit to get the latest patches.
7053 (let ((commit "b9ea6e507e8849f01d06aa48c0c59c5cee4820be")
7054 (revision "1"))
7055 (package
7056 (name "blktrace")
7057 (version (git-version "1.3.0" revision commit))
7058 (home-page
7059 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
7060 (source (origin
7061 (method git-fetch)
7062 (uri (git-reference
7063 (url home-page)
7064 (commit commit)))
7065 (sha256
7066 (base32 "0a4830mlqckbhchar1xcn2w4f24bzb75bigdig5wpm2axl0zc8cq"))
7067 (file-name (git-file-name name version))))
7068 (build-system gnu-build-system)
7069 (arguments
7070 (list #:make-flags
7071 #~(list (string-append "CC=" #$(cc-for-target))
7072 (string-append "prefix=" #$output))
7073 #:tests? #f ; no tests
7074 #:phases
7075 #~(modify-phases %standard-phases
7076 (delete 'configure) ; no configure script
7077 (add-after 'unpack 'fix-gnuplot-path
7078 (lambda* (#:key inputs #:allow-other-keys)
7079 (let ((gnuplot (assoc-ref inputs "gnuplot")))
7080 (substitute* "btt/bno_plot.py"
7081 (("gnuplot %s")
7082 (string-append gnuplot "/bin/gnuplot %s")))))))))
7083 (inputs
7084 `(("libaio" ,libaio)
7085 ("gnuplot" ,gnuplot)
7086 ("python" ,python-wrapper))) ;for 'bno_plot.py'
7087 (synopsis "Block layer IO tracing mechanism")
7088 (description "Blktrace is a block layer IO tracing mechanism which provides
7089detailed information about request queue operations to user space. It extracts
7090event traces from the kernel (via the relaying through the debug file system).")
7091 (license license:gpl2))))
7092
7093(define-public sbc
7094 (package
7095 (name "sbc")
7096 (version "1.5")
7097 (source (origin
7098 (method url-fetch)
7099 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
7100 version ".tar.xz"))
7101 (patches (search-patches "sbc-fix-build-non-x86.patch"))
7102 (sha256
7103 (base32
7104 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
7105 (build-system gnu-build-system)
7106 (inputs
7107 (list libsndfile))
7108 (native-inputs
7109 (list pkg-config))
7110 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
7111 (synopsis "Bluetooth subband audio codec")
7112 (description
7113 "The SBC is a digital audio encoder and decoder used to transfer data to
7114Bluetooth audio output devices like headphones or loudspeakers.")
7115 (license license:gpl2+)))
7116
7117(define-public bluez
7118 (package
7119 (name "bluez")
7120 (version "5.79")
7121 (source (origin
7122 (method url-fetch)
7123 (uri (string-append
7124 "mirror://kernel.org/linux/bluetooth/bluez-"
7125 version ".tar.xz"))
7126 (sha256
7127 (base32
7128 "12pal1m4xlr8k7kxb6isv5lbaca2wc5zcgy0907wfwcz78qaar21"))))
7129 (build-system gnu-build-system)
7130 (arguments
7131 (list
7132 #:configure-flags
7133 #~(list "--sysconfdir=/etc"
7134 "--localstatedir=/var"
7135 "--enable-library"
7136 "--enable-wiimote"
7137 "--disable-systemd"
7138 ;; TODO: is this needed? Not installed by default since 5.55.
7139 "--enable-hid2hci"
7140 ;; Install dbus/udev files to the correct location.
7141 (string-append "--with-dbusconfdir=" #$output "/etc")
7142 (string-append "--with-udevdir=" #$output "/lib/udev"))
7143 #:phases
7144 #~(modify-phases %standard-phases
7145 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
7146 ;; issue (discussion on upstream mailing list:
7147 ;; https://marc.info/?t=149578476300002&r=1&w=2)
7148 (add-before 'check 'skip-wonky-test
7149 (lambda _
7150 (substitute* "unit/test-gatt.c"
7151 (("tester_init\\(&argc, &argv\\);") "return 77;"))))
7152 (replace 'install
7153 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
7154 ;; Override the sysconfdir and localstatedir locations only for
7155 ;; the installation phase. Otherwise, the installation fails when
7156 ;; it tries to write to /etc/bluetooth and /var.
7157 (define make-flags*
7158 (append make-flags (list (string-append "sysconfdir="
7159 #$output "/etc")
7160 (string-append "localstatedir="
7161 #$output "/var"))))
7162 (apply (assoc-ref %standard-phases 'install)
7163 (append args (list #:make-flags make-flags*)))))
7164 (add-after 'install 'post-install
7165 (lambda* (#:key inputs outputs #:allow-other-keys)
7166 (let* ((servicedir (string-append #$output
7167 "/share/dbus-1/services"))
7168 (service "obexd/src/org.bluez.obex.service")
7169 (rule (string-append
7170 #$output "/lib/udev/rules.d/97-hid2hci.rules")))
7171 ;; Install the obex dbus service file.
7172 (substitute* service
7173 (("/bin/false")
7174 (string-append #$output "/libexec/bluetooth/obexd")))
7175 (install-file service servicedir)
7176 ;; Fix paths in the udev rule.
7177 (substitute* rule
7178 (("hid2hci --method")
7179 (string-append #$output "/lib/udev/hid2hci --method"))
7180 (("/sbin/udevadm")
7181 (search-input-file inputs "/bin/udevadm")))))))))
7182 (native-inputs
7183 (list gettext-minimal
7184 pkg-config
7185 python
7186 python-docutils
7187 python-pygments))
7188 (inputs
7189 (list glib dbus eudev libical readline))
7190 (home-page "https://www.bluez.org/")
7191 (synopsis "Linux Bluetooth protocol stack")
7192 (description
7193 "BlueZ provides support for the core Bluetooth layers and protocols. It
7194is flexible, efficient and uses a modular implementation.")
7195 (license license:gpl2+)))
7196
7197(define-public fuse-exfat
7198 (package
7199 (name "fuse-exfat")
7200 (version "1.4.0")
7201 (source (origin
7202 (method url-fetch)
7203 (uri (string-append
7204 "https://github.com/relan/exfat/releases/download/v"
7205 version "/" name "-" version ".tar.gz"))
7206 (sha256
7207 (base32
7208 "07h0ngnydfy8n8h9ni3jn8zlmcj4pzqa0nk0hk0i4yhfbv2yvkx1"))))
7209 (build-system gnu-build-system)
7210 (native-inputs
7211 (list pkg-config))
7212 (inputs
7213 (list fuse-2))
7214 (home-page "https://github.com/relan/exfat")
7215 (synopsis "Mount exFAT file systems")
7216 (description
7217 "This package provides a FUSE-based file system that provides read and
7218write access to exFAT devices.")
7219 (license license:gpl2+)))
7220
7221(define-public fuseiso
7222 (package
7223 (name "fuseiso")
7224 (version "20070708")
7225 (source (origin
7226 (method url-fetch)
7227 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
7228 version "/fuseiso-" version ".tar.bz2"))
7229 (sha256
7230 (base32
7231 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
7232 (build-system gnu-build-system)
7233 (native-inputs
7234 (list pkg-config))
7235 (inputs
7236 (list fuse-2 glib zlib))
7237 (home-page "https://sourceforge.net/projects/fuseiso/")
7238 (synopsis "Mount ISO file system images")
7239 (description
7240 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
7241.bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
7242Ridge, Joliet, and zisofs.")
7243 (license license:gpl2)))
7244
7245(define-public gpm
7246 (package
7247 (name "gpm")
7248 (version "1.20.7")
7249 (source (origin
7250 (method url-fetch)
7251 (uri (string-append
7252 "https://www.nico.schottelius.org/software/gpm/archives/"
7253 "gpm-" version ".tar.bz2"))
7254 (patches (search-patches "gpm-glibc-2.26.patch"))
7255 (sha256
7256 (base32
7257 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
7258 (modules '((guix build utils)))
7259 (snippet
7260 '(begin
7261 ;; Take a patch from upstream to fix building with -fno-common,
7262 ;; which is default in GCC 10:
7263 ;; https://github.com/telmich/gpm/pull/37
7264 (substitute* "src/headers/daemon.h"
7265 (("^time_t[[:blank:]]+last_selection_time;")
7266 "extern time_t last_selection_time;"))))))
7267 (build-system gnu-build-system)
7268 (arguments
7269 '(#:phases (modify-phases %standard-phases
7270 (replace 'bootstrap
7271 (lambda _
7272 ;; The tarball was not generated with 'make dist' so we
7273 ;; need to bootstrap things ourselves.
7274 (substitute* "autogen.sh"
7275 (("/bin/sh") (which "sh")))
7276 (invoke "./autogen.sh")
7277 (patch-makefile-SHELL "Makefile.include.in")
7278 #t)))
7279
7280 ;; Make sure programs find libgpm.so.
7281 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
7282 (assoc-ref %outputs "out")
7283 "/lib"))))
7284 (native-inputs
7285 (list texinfo
7286 bison
7287 flex
7288 autoconf
7289 automake
7290 libtool))
7291 (home-page "https://www.nico.schottelius.org/software/gpm/")
7292 (synopsis "Mouse support for the Linux console")
7293 (description
7294 "The GPM (general-purpose mouse) daemon is a mouse server for
7295applications running on the Linux console. It allows users to select items
7296and copy/paste text in the console and in xterm.")
7297 (license license:gpl2+)))
7298
7299(define-public gamemode
7300 (package
7301 (name "gamemode")
7302 (version "1.8.2")
7303 (source (origin
7304 (method git-fetch)
7305 (uri (git-reference
7306 (url "https://github.com/FeralInteractive/gamemode")
7307 (commit version)))
7308 (file-name (git-file-name name version))
7309 (sha256
7310 (base32 "14i3y385jzpr30lxk38z84rq76sy4cz0pwm54rm62f4mnk0xwjjp"))))
7311 (build-system meson-build-system)
7312 (arguments
7313 (list
7314 #:configure-flags
7315 #~(list
7316 ;; Don't build sample programs.
7317 "-Dwith-examples=false"
7318 ;; Build gamemoderun and other utilities.
7319 "-Dwith-util=true"
7320 ;; Use elogind instead of systemd for sd-bus.
7321 "-Dwith-sd-bus-provider=elogind"
7322 ;; Install PAM limits.d config to the package prefix; a Guix
7323 ;; service can then install it to /etc/security/limits.d/.
7324 (string-append "-Dwith-pam-limits-dir=" #$output
7325 "/etc/security/limits.d")
7326 ;; Guix does not use systemd.
7327 "-Dwith-systemd-user-unit=false"
7328 "-Dwith-systemd-group=false")))
7329 (native-inputs
7330 (list pkg-config))
7331 (inputs
7332 (list
7333 dbus
7334 elogind
7335 libinih))
7336 (synopsis "Optimise Linux system performance on demand")
7337 (description "GameMode is a daemon and library for Linux that allows games to
7338request a set of optimisations be temporarily applied to the host OS and/or a
7339game process. GameMode was designed primarily as a stop-gap solution to problems
7340with the Intel and AMD CPU powersave or ondemand governors, but is now host to a
7341range of optimisation features and configurations, including CPU governor, I/O
7342priority, process niceness, kernel scheduler, screensaver inhibiting, GPU
7343performance mode, and custom scripts.")
7344 (home-page "https://github.com/FeralInteractive/gamemode")
7345 (license license:bsd-3)))
7346
7347(define-public btrfs-progs
7348 (package
7349 (name "btrfs-progs")
7350 (version "6.16")
7351 (source (origin
7352 (method url-fetch)
7353 (uri (string-append "mirror://kernel.org/linux/kernel/"
7354 "people/kdave/btrfs-progs/" "btrfs-progs-v"
7355 version ".tar.xz"))
7356 (sha256
7357 (base32
7358 "1ibg8qrsxzw4qjnsl5da1qz10m1zv3yx2jxd4jl1h9kwfgw31a9i"))))
7359 (build-system gnu-build-system)
7360 (outputs '("out" "static")) ;static versions of the binaries in "out"
7361 (arguments
7362 (list
7363 #:configure-flags
7364 #~(list
7365 ;; Without --disable-documentation, it complains about missing
7366 ;; python-sphinx on systems where this package isn't available
7367 ;; (because it requires Rust).
7368 #$@(if (member (%current-system)
7369 (package-transitive-supported-systems
7370 python-sphinx))
7371 '()
7372 '("--disable-documentation"))
7373 ;; The ‘Python support’ was never actually installed by previous
7374 ;; versions of this package, but did prevent cross-compilation.
7375 "--disable-python")
7376 #:phases #~(modify-phases %standard-phases
7377 (add-after 'unpack 'patch-makefile
7378 (lambda* (#:key outputs #:allow-other-keys)
7379 (substitute* "Makefile"
7380 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
7381 (string-append (assoc-ref outputs "out")
7382 "/lib/udev/rules.d")))))
7383 (add-after 'build 'build-static
7384 (lambda _
7385 (invoke "make" "static")))
7386 (add-after 'install 'install-bash-completion
7387 (lambda* (#:key outputs #:allow-other-keys)
7388 (let* ((out (assoc-ref outputs "out"))
7389 (bashcomp (string-append out
7390 "/etc/bash_completion.d")))
7391 (mkdir-p bashcomp)
7392 (copy-file "btrfs-completion"
7393 (string-append bashcomp "/btrfs")))))
7394 (add-after 'install 'install-static
7395 (let ((staticbin (string-append (assoc-ref %outputs
7396 "static")
7397 "/bin")))
7398 (lambda _
7399 (invoke "make"
7400 (string-append "bindir=" staticbin)
7401 "install-static")))))
7402 #:tests? #f ;XXX: require the 'btrfs' kernel module.
7403 #:test-target "test"
7404 #:parallel-tests? #f)) ;tests fail when run in parallel
7405 (inputs (list e2fsprogs ;for btrfs-convert
7406 eudev
7407 lzo
7408 `(,util-linux "lib") ;for libblkid and libuuid
7409 `(,util-linux "static") ;ditto
7410 zlib
7411 `(,zlib "static")
7412 `(,zstd "lib")
7413 `(,zstd "static")))
7414 (native-inputs
7415 (append
7416 ;; For building documentation. Since python-sphinx requires Rust, add
7417 ;; it conditionally depending on such support.
7418 (if (supported-package? python-sphinx)
7419 (list python-wrapper python-sphinx python-sphinx-rtd-theme)
7420 '())
7421 (list pkg-config
7422 acl ;for tests
7423 lvm2 ;for dmsetup
7424 grep ;need Perl regexp support
7425 libaio
7426 liburing
7427 util-linux ;for fallocate
7428 which)))
7429 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
7430 (synopsis "Create and manage btrfs copy-on-write file systems")
7431 (description
7432 "Btrfs is a @acronym{CoW, copy-on-write} file system for Linux
7433aimed at implementing advanced features while focusing on fault tolerance,
7434repair and easy administration.")
7435 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
7436 ;; GPL2: Everything else.
7437 (license (list license:gpl2 license:gpl2+))))
7438
7439(define-public btrfs-progs/static
7440 (package
7441 (name "btrfs-progs-static")
7442 (version (package-version btrfs-progs))
7443 (source #f)
7444 (build-system trivial-build-system)
7445 (inputs
7446 `(("btrfs-progs:static" ,btrfs-progs "static")))
7447 (arguments
7448 `(#:modules ((guix build utils))
7449 #:builder
7450 (begin
7451 (use-modules (guix build utils)
7452 (ice-9 ftw)
7453 (srfi srfi-26))
7454
7455 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
7456 (out (assoc-ref %outputs "out"))
7457 (source (string-append btrfs "/bin/btrfs.static"))
7458 (target (string-append out "/bin/btrfs")))
7459 (mkdir-p (dirname target))
7460 (copy-file source target)
7461 (remove-store-references target)
7462 (chmod target #o555)
7463 #t))))
7464 (home-page (package-home-page btrfs-progs))
7465 (synopsis "Statically-linked btrfs command from btrfs-progs")
7466 (description "This package provides the statically-linked @command{btrfs}
7467from the btrfs-progs package. It is meant to be used in initrds.")
7468 (license (package-license btrfs-progs))))
7469
7470(define-public cramfs-tools
7471 (package
7472 (name "cramfs-tools")
7473 (home-page "https://github.com/npitre/cramfs-tools")
7474 (version "2.1")
7475 (source (origin
7476 (method git-fetch)
7477 (uri (git-reference
7478 (url home-page)
7479 (commit (string-append "v" version))))
7480 (sha256
7481 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
7482 (file-name (git-file-name name version))))
7483 (build-system gnu-build-system)
7484 (arguments
7485 '(#:tests? #f ; No tests.
7486 #:phases
7487 (modify-phases %standard-phases
7488 (delete 'configure)
7489 (replace 'install
7490 (lambda* (#:key outputs #:allow-other-keys)
7491 (let ((out (assoc-ref outputs "out")))
7492 (install-file "mkcramfs" (string-append out "/sbin"))
7493 (install-file "cramfsck" (string-append out "/sbin")))
7494 #t)))))
7495 (inputs
7496 (list zlib))
7497 (synopsis "Tools to manage Cramfs file systems")
7498 (description "Cramfs is a Linux file system designed to be simple, small,
7499and to compress things well. It is used on a number of embedded systems and
7500small devices. This version has additional features such as uncompressed
7501blocks and random block placement.")
7502 (license license:gpl2+)))
7503
7504(define-public compsize
7505 (let ((commit "d79eacf77abe3b799387bb8a4e07a18f1f1031e8")
7506 (revision "0"))
7507 (package
7508 (name "compsize")
7509 (version (git-version "1.5" revision commit))
7510 (home-page "https://github.com/kilobyte/compsize")
7511 (source (origin
7512 (method git-fetch)
7513 (uri (git-reference
7514 (url home-page)
7515 (commit commit)))
7516 (sha256
7517 (base32 "02fvgy12m50rg1snp555a1kc3cm01g2imb81cih7ikhkbjbca0d7"))
7518 (file-name (git-file-name name version))
7519 (patches
7520 (search-patches "compsize-fix-btrfs-progs-compatibility.patch"))))
7521 (build-system gnu-build-system)
7522 (inputs
7523 (list btrfs-progs))
7524 (arguments
7525 `(#:tests? #f ; No tests.
7526 #:make-flags
7527 (list (string-append "CC=" ,(cc-for-target)))
7528 #:phases
7529 (modify-phases %standard-phases
7530 (delete 'configure)
7531 (replace 'install
7532 (lambda* (#:key outputs #:allow-other-keys)
7533 (let ((out (assoc-ref outputs "out")))
7534 (install-file "compsize" (string-append out "/bin"))
7535 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
7536 (synopsis "Find compression type/ratio on Btrfs files")
7537 (description "@command{compsize} takes a list of files (given as
7538arguments) on a Btrfs file system and measures used compression types and
7539effective compression ratio, producing a report.
7540
7541A directory has no extents but has a (recursive) list of files. A non-regular
7542file is silently ignored.
7543
7544As it makes no sense to talk about compression ratio of a partial extent,
7545every referenced extent is counted whole, exactly once -- no matter if you use
7546only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
7547uncompressed size will not match the number given by @command{tar} or
7548@command{du}. On the other hand, the space used should be accurate (although
7549obviously it can be shared with files outside our set).")
7550 (license license:gpl2+))))
7551
7552(define-public f2fs-tools
7553 (package
7554 (name "f2fs-tools")
7555 (version "1.16.0")
7556 (source (origin
7557 (method git-fetch)
7558 (uri (git-reference
7559 (url "https://git.kernel.org/pub/scm/linux/kernel\
7560/git/jaegeuk/f2fs-tools.git")
7561 (commit (string-append "v" version))))
7562 (file-name (git-file-name name version))
7563 (sha256
7564 (base32
7565 "0832ix3jnmfagx53wr6clc3q4ay7cbashfj7jirk01gyzwbvblfc"))))
7566 (build-system gnu-build-system)
7567 (native-inputs
7568 (list autoconf automake libtool pkg-config))
7569 (inputs
7570 (list `(,util-linux "lib"))) ;for libuuid
7571 (home-page "https://f2fs.wiki.kernel.org/")
7572 (synopsis "Userland tools for f2fs")
7573 (description
7574 "F2FS, the Flash-Friendly File System, is a modern file system
7575designed to be fast and durable on flash devices such as solid-state
7576disks and SD cards. This package provides the userland utilities.")
7577 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
7578 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
7579 (license (list license:gpl2 license:lgpl2.1))))
7580
7581(define-public f2fs-tools-1.7
7582 (package
7583 (inherit f2fs-tools)
7584 (name "f2fs-tools")
7585 (version "1.7.0")
7586 (source (origin
7587 (method git-fetch)
7588 (uri (git-reference
7589 (url (git-reference-url
7590 (origin-uri (package-source f2fs-tools))))
7591 (commit (string-append "v" version))))
7592 (file-name (git-file-name name version))
7593 (sha256
7594 (base32
7595 "0wpzklw8smnngng0dm25jdmi7v5zfhpz02dksyxpz0a7kzzvnqqm"))))
7596 (inputs
7597 (list `(,util-linux "lib") libselinux))
7598 (arguments
7599 '(#:configure-flags '("CFLAGS=-fcommon")
7600 #:phases
7601 (modify-phases %standard-phases
7602 (add-after 'install 'install-headers
7603 (lambda* (#:key outputs #:allow-other-keys)
7604 (let* ((out (assoc-ref outputs "out"))
7605 (out-include (string-append out "/include")))
7606 (install-file "include/f2fs_fs.h" out-include)
7607 (install-file "mkfs/f2fs_format_utils.h" out-include)))))))))
7608
7609(define-public f2fs-tools/static
7610 (static-package
7611 (package
7612 (inherit f2fs-tools)
7613 (name "f2fs-tools-static")
7614 (arguments
7615 `(#:configure-flags
7616 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
7617 (libuuid (assoc-ref %build-inputs "libuuid")))
7618 (list
7619 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
7620 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
7621 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
7622 "-I" libuuid "/include/blkid")
7623 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
7624 #:disallowed-references (,(this-package-input "libuuid"))
7625 #:make-flags '("LDFLAGS=-all-static")
7626 #:phases
7627 (modify-phases %standard-phases ; TODO: f2fs phases.
7628 (add-after 'install 'remove-store-references
7629 (lambda* (#:key outputs #:allow-other-keys)
7630 ;; Work around bug in our util-linux.
7631 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
7632 (remove-store-references (string-append (assoc-ref outputs "out")
7633 "/sbin/mkfs.f2fs"))
7634 #t)))))
7635 (inputs
7636 `(("libuuid:static" ,util-linux "static")
7637 ("libuuid" ,util-linux "lib")))))) ; for include files
7638
7639(define-public f2fs-fsck/static
7640 (package
7641 (name "f2fs-fsck-static")
7642 (version (package-version f2fs-tools/static))
7643 (source #f)
7644 (build-system trivial-build-system)
7645 (arguments
7646 `(#:modules ((guix build utils))
7647 #:builder
7648 (begin
7649 (use-modules (guix build utils)
7650 (ice-9 ftw)
7651 (srfi srfi-26))
7652 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
7653 (fsck "fsck.f2fs")
7654 (out (assoc-ref %outputs "out"))
7655 (sbin (string-append out "/sbin")))
7656 (mkdir-p sbin)
7657 (with-directory-excursion sbin
7658 (install-file (string-append f2fs-tools "/sbin/" fsck)
7659 ".")
7660 (remove-store-references fsck)
7661 (chmod fsck #o555))
7662 #t))))
7663 (inputs
7664 (list f2fs-tools/static))
7665 (home-page (package-home-page f2fs-tools/static))
7666 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
7667 (description "This package provides statically-linked fsck.f2fs command taken
7668from the f2fs-tools package. It is meant to be used in initrds.")
7669 (license (package-license f2fs-tools/static))))
7670
7671(define-public freefall
7672 (package
7673 (name "freefall")
7674 (version (package-version linux-libre))
7675 (source (package-source linux-libre))
7676 (build-system gnu-build-system)
7677 (arguments
7678 '(#:phases (modify-phases %standard-phases
7679 (add-after 'unpack 'enter-subdirectory
7680 (lambda _
7681 (chdir "tools/laptop/freefall")
7682 #t))
7683 (delete 'configure)
7684 (add-before 'build 'increase-timeout
7685 (lambda _
7686 ;; The default of 2 seconds is too low: it assumes an
7687 ;; open lid and AC power without actually checking.
7688 (substitute* "freefall.c"
7689 (("alarm\\(2\\)") "alarm(5)"))
7690 #t)))
7691 #:make-flags (list (string-append "PREFIX="
7692 (assoc-ref %outputs "out"))
7693 "CC=gcc")
7694 #:tests? #f)) ;no tests
7695 (home-page (package-home-page linux-libre))
7696 (synopsis "Free-fall protection for spinning laptop hard drives")
7697 (description
7698 "Prevents shock damage to the internal spinning hard drive(s) of some
7699HP and Dell laptops. When sudden movement is detected, all input/output
7700operations on the drive are suspended and its heads are parked on the ramp,
7701where they are less likely to cause damage to the spinning disc. Requires a
7702drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
7703feature, and a laptop with an accelerometer. It has no effect on SSDs.")
7704 (license license:gpl2)))
7705
7706
7707(define-public nbfc-linux
7708 (let ((version "0.1.7")
7709 (commit "4c2b75e4a875459e86a9892319889ff945e9cadf")
7710 (revision "0"))
7711 (package
7712 (name "nbfc-linux")
7713 (version (git-version version revision commit))
7714 (source (origin
7715 (method git-fetch)
7716 (uri (git-reference
7717 (url "https://github.com/nbfc-linux/nbfc-linux")
7718 (commit commit)))
7719 (file-name (git-file-name name version))
7720 (sha256
7721 (base32
7722 "0mmyfaigrh3fd5v11a8p38km4m02qzsfx8yh72g0z405bzhqn5jk"))))
7723 (build-system gnu-build-system)
7724 (arguments
7725 `(#:make-flags (list (string-append "CC="
7726 ,(cc-for-target))
7727 (string-append "PREFIX="
7728 (assoc-ref %outputs "out")))
7729 #:tests? #f
7730 #:phases (modify-phases %standard-phases
7731 (delete 'configure))))
7732 (native-inputs (list pkg-config))
7733 (propagated-inputs (list python dmidecode))
7734 (synopsis "NoteBook FanControl ported to Linux")
7735 (description
7736 "This package provides a C port of NoteBook FanControl (NBFC), a fan
7737control service for notebooks. It provides the same utilities with the same
7738interfaces as the original NBFC, although the implementation differs.")
7739 (home-page "https://github.com/nbfc-linux/nbfc-linux")
7740 (license license:gpl3+))))
7741
7742(define-public thinkfan
7743 (package
7744 (name "thinkfan")
7745 (version "2.0.0")
7746 (source
7747 (origin
7748 (method git-fetch)
7749 (uri (git-reference
7750 (url "https://github.com/vmatare/thinkfan")
7751 (commit version)))
7752 (file-name (git-file-name name version))
7753 (sha256
7754 (base32 "1jdjqdbv0m7yf9g4rxs7nq1ldh2b81a7qx4vcf9lzw7jwlydd822"))))
7755 (build-system cmake-build-system)
7756 (arguments
7757 (list
7758 #:modules '((guix build cmake-build-system)
7759 (guix build utils)
7760 (srfi srfi-26))
7761 #:tests? #f ; no test target
7762 #:configure-flags
7763 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
7764 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
7765 ;; inefficient’.
7766 #~(list "-DUSE_ATASMART:BOOL=ON")
7767 #:phases
7768 #~(modify-phases %standard-phases
7769 (add-after 'unpack 'create-init-scripts
7770 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
7771 ;; systemd to patch and install their service files. Fake their
7772 ;; presence rather than duplicating the build system below. Leave
7773 ;; things like ‘/bin/kill’ because they're not worth a dependency.
7774 ;; The sysvinit needs manual patching, but since upstream doesn't
7775 ;; even provide the option to install it: don't.
7776 (lambda _
7777 (substitute* "CMakeLists.txt"
7778 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
7779 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
7780 ;; That was easy! Now we just need to fix the destinations.
7781 (("/etc" directory)
7782 (string-append #$output directory))))))))
7783 (native-inputs
7784 (list pkg-config))
7785 (inputs
7786 `(("libatasmart" ,libatasmart)
7787 ("lm-sensors" ,lm-sensors "lib")
7788 ("yaml-cpp" ,yaml-cpp)))
7789 (home-page "https://github.com/vmatare/thinkfan")
7790 (synopsis "Simple fan control program")
7791 (description
7792 "Thinkfan is a simple fan control program. It reads temperatures,
7793checks them against configured limits and switches to appropriate (also
7794pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
7795other @code{hwmon} driver that enables temperature reading and fan control
7796from userspace.")
7797 (license license:gpl3+)))
7798
7799(define-public tpacpi-bat
7800 (package
7801 (name "tpacpi-bat")
7802 (version "3.2")
7803 (source
7804 (origin
7805 (method git-fetch)
7806 (uri (git-reference
7807 (url "https://github.com/teleshoes/tpacpi-bat")
7808 (commit (string-append "v" version))))
7809 (file-name (git-file-name name version))
7810 (sha256
7811 (base32 "0nd8s2bqbhl0sjpflphb4l9ix71p7kvnbvkq4dg9a1v0sxafyygm"))))
7812 (build-system gnu-build-system)
7813 (arguments
7814 `(#:tests? #f ; no test target
7815 #:phases
7816 (modify-phases %standard-phases
7817 (add-after 'unpack 'refer-to-inputs
7818 (lambda* (#:key inputs #:allow-other-keys)
7819 (substitute* "tpacpi-bat"
7820 (("cat ")
7821 (string-append (search-input-file inputs "bin/cat") " "))
7822 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
7823 ;; loaded. That's the administrator's prerogative; disable it.
7824 (("system \"(modprobe .*)\"" _ match)
7825 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))))
7826 (delete 'configure) ; nothing to configure
7827 (delete 'build) ; nothing to build
7828 (replace 'install
7829 (lambda* (#:key outputs #:allow-other-keys)
7830 (let* ((out (assoc-ref outputs "out"))
7831 (bin (string-append out "/bin"))
7832 (doc (string-append out "/share/doc/" ,name "-" ,version)))
7833 (install-file "tpacpi-bat" bin)
7834
7835 ;; There's no man page. Install other forms of documentation.
7836 (for-each (lambda (file)
7837 (let ((target (string-append doc "/" file)))
7838 (mkdir-p (dirname target))
7839 (copy-recursively file target)))
7840 (list "battery_asl" "examples" "README.md"))))))))
7841 (inputs
7842 (list coreutils-minimal
7843 perl))
7844 (home-page "https://github.com/teleshoes/tpacpi-bat")
7845 (synopsis "ThinkPad battery charge controller")
7846 (description
7847 "Tpacpi-bat is a command-line interface to control battery charging on
7848@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
7849ThinkPad models released after 2011}, starting with the xx20 series. It can
7850query and set the thresholds at which one or both batteries will start and stop
7851charging, inhibit charging batteries for a set period of time, or force them to
7852discharge when they otherwise would not.
7853
7854This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
7855kernel module provided by the @code{acpi-call-linux-module} package, which must
7856be installed and loaded separately. Only the original vendor firmware is
7857supported.")
7858 (license license:gpl3+)))
7859
7860(define-public tmon
7861 (package
7862 (name "tmon")
7863 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
7864 (version (package-version linux-libre))
7865 (source (package-source linux-libre))
7866 (build-system gnu-build-system)
7867 (arguments
7868 (list
7869 #:tests? #f ; no test suite
7870 #:make-flags
7871 #~(list (string-append "CC=" #$(cc-for-target))
7872 (string-append "INSTALL_ROOT=" #$output)
7873 "BINDIR=bin")
7874 #:phases
7875 #~(modify-phases %standard-phases
7876 (add-after 'unpack 'enter-subdirectory
7877 (lambda _
7878 (chdir "tools/thermal/tmon")))
7879 (add-after 'install 'install-man-page
7880 (lambda _
7881 (let ((man8 (string-append #$output "/share/man/man8")))
7882 (install-file "tmon.8" man8))))
7883 (delete 'configure)))) ; no configure script
7884 (inputs
7885 (list ncurses))
7886 (home-page (package-home-page linux-libre))
7887 (synopsis "Monitor and test the Linux thermal subsystem in real time")
7888 (description
7889 "Tmon is a tool to interact with the complex thermal subsystem of the
7890kernel Linux. It helps visualize thermal relationships and real-time thermal
7891data, tune and test cooling devices and sensors, and collect thermal data for
7892further analysis.
7893
7894As computers become smaller and more thermally constrained, more sensors are
7895added and new cooling capabilities introduced. Thermal relationships can change
7896dynamically. Their complexity grows exponentially among cooling devices, zones,
7897sensors, and trip points.
7898
7899Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
7900of symbolic links, trip point bindings, and device instances. To traverse it
7901by hand is no trivial task: @command{tmon} aims to make it understandable.")
7902 (license (list license:gpl2 ; the man page
7903 license:gpl2+)))) ; the actual rest
7904
7905(define-public turbostat
7906 (package
7907 (name "turbostat")
7908 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
7909 ;; make it harder to benefit from ‘free’ linux-libre package updates.
7910 (version (package-version linux-libre))
7911 (source (package-source linux-libre))
7912 (build-system gnu-build-system)
7913 (arguments
7914 (list
7915 #:tests? #f ;no test suite
7916 #:make-flags
7917 #~(list (string-append "CC=" #$(cc-for-target))
7918 (string-append "PREFIX=" #$output))
7919 #:phases
7920 #~(modify-phases %standard-phases
7921 (add-after 'unpack 'enter-subdirectory
7922 (lambda _
7923 (chdir "tools/power/x86/turbostat")))
7924 (delete 'configure)))) ;no configure script
7925 (inputs
7926 (list libcap))
7927 (supported-systems '("i686-linux" "x86_64-linux"))
7928 (home-page (package-home-page linux-libre))
7929 (synopsis "Report x86 processor frequency and idle statistics")
7930 (description
7931 "Turbostat reports x86 processor topology, frequency, idle power state
7932statistics, temperature, and power consumption. Some information is unavailable
7933on older processors.
7934
7935It can be used to identify machines that are inefficient in terms of power usage
7936or idle time, report the rate of @acronym{SMI, system management interrupt}s
7937occurring on the system, or verify the effects of power management tuning.
7938
7939@command{turbostat} reads hardware counters but doesn't write to them, so it
7940won't interfere with the OS or other running processes---including multiple
7941invocations of itself.")
7942 (license license:gpl2)))
7943
7944(define-public ntfs-3g
7945 (package
7946 (name "ntfs-3g")
7947 (version "2022.10.3")
7948 (source (origin
7949 (method url-fetch)
7950 (uri (string-append "https://tuxera.com/opensource/"
7951 "ntfs-3g_ntfsprogs-" version ".tgz"))
7952 (sha256
7953 (base32
7954 "030pakw3h1z6p8phdbyb0hw0bb868znvrri96rg88jq7d3p3c3pj"))
7955 (modules '((guix build utils)))
7956 (snippet '(begin
7957 ;; Install under $prefix.
7958 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
7959 (("/sbin")
7960 "@sbindir@"))))))
7961 (build-system gnu-build-system)
7962 (inputs (list util-linux ; libuuid
7963 fuse-2))
7964 (native-inputs (list pkg-config))
7965 (arguments
7966 '(#:configure-flags (list "--disable-static"
7967 "--disable-ldconfig" ;not necessary
7968 "--exec-prefix=${prefix}"
7969 "--with-fuse=external" ;use our own FUSE
7970 "--enable-mount-helper"
7971 "--enable-posix-acls"
7972 "--enable-xattr-mappings")
7973 #:phases
7974 (modify-phases %standard-phases
7975 ;; If users install ntfs-3g, they probably want to make it the
7976 ;; default driver as well, so we opt for sensible defaults and link
7977 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
7978 ;; mount NTFS file systems.)
7979 (add-after 'install 'install-link
7980 (lambda* (#:key outputs #:allow-other-keys)
7981 (let* ((out (assoc-ref outputs "out"))
7982 (sbin (string-append out "/sbin")))
7983 (symlink "mount.ntfs-3g"
7984 (string-append sbin "/mount.ntfs"))))))))
7985 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
7986 (synopsis "Read-write access to NTFS file systems")
7987 (description
7988 "NTFS-3G provides read-write access to NTFS file systems, which are
7989commonly found on Microsoft Windows. It is implemented as a FUSE file system.
7990The package provides additional NTFS tools.")
7991 (properties
7992 '((release-monitoring-url . "https://github.com/tuxera/ntfs-3g/releases")
7993 (upstream-name . "ntfs-3g_ntfsprogs")))
7994 (license license:gpl2+)))
7995
7996(define-public ntfs-3g/static
7997 (static-package
7998 (package
7999 (inherit ntfs-3g)
8000 (name "ntfs-3g-static")
8001 (arguments
8002 (substitute-keyword-arguments (package-arguments ntfs-3g)
8003 ((#:configure-flags flags)
8004 `(append ,flags
8005 (list "--enable-really-static"
8006 ;; The FUSE driver isn't currently used by our initrd.
8007 "--disable-ntfs-3g")))
8008 ((#:phases phases)
8009 `(modify-phases ,phases
8010 (add-after 'unpack 'make-really-static-really-static
8011 (lambda _
8012 (substitute* "ntfsprogs/Makefile.in"
8013 ((" -static") " -all-static"))))
8014 (delete 'install-link))))))))
8015
8016(define-public ntfsfix/static
8017 (package
8018 (name "ntfsfix-static")
8019 (version (package-version ntfs-3g/static))
8020 (source #f)
8021 (build-system trivial-build-system)
8022 (arguments
8023 `(#:modules ((guix build utils))
8024 #:builder
8025 (begin
8026 (use-modules (guix build utils))
8027 (let* ((ntfs-3g (assoc-ref %build-inputs "ntfs-3g"))
8028 (out (assoc-ref %outputs "out"))
8029 (bin (string-append out "/bin")))
8030 (install-file (string-append ntfs-3g "/bin/ntfsfix") bin)
8031 (with-directory-excursion bin
8032 (remove-store-references "ntfsfix"))))))
8033 (inputs
8034 `(("ntfs-3g" ,ntfs-3g/static)))
8035 (home-page (package-home-page ntfs-3g/static))
8036 (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
8037 (description
8038 "This package provides a statically linked @command{ntfsfix} taken
8039from the ntfs-3g package. It is meant to be used in initrds.")
8040 (license (package-license ntfs-3g/static))))
8041
8042(define-public rdma-core
8043 (package
8044 (name "rdma-core")
8045 (version "60.0")
8046 (source (origin
8047 (method url-fetch)
8048 (uri (string-append "https://github.com/linux-rdma/rdma-core"
8049 "/releases/download/v" version "/rdma-core-"
8050 version ".tar.gz"))
8051 (sha256
8052 (base32
8053 "1pi8jf1pibfhh3ps2kvj2y8y6yahpw7jjyp0mpxmvama9qp8j6wv"))))
8054 (build-system cmake-build-system)
8055 (arguments
8056 `(#:tests? #f ;no tests
8057
8058 ;; Upstream uses the "ninja" build system and encourage distros
8059 ;; to do the same for consistency.
8060 #:generator "Ninja"
8061 #:configure-flags
8062 (list (string-append "-DRST2MAN_EXECUTABLE="
8063 (search-input-file
8064 %build-inputs "/bin/rst2man.py")))))
8065 (native-inputs
8066 (list pkg-config python-wrapper python-docutils-0.19)) ;for 'rst2man'
8067 (inputs
8068 (list libnl eudev))
8069 (home-page "https://github.com/linux-rdma/rdma-core")
8070 (synopsis "Utilities and libraries for working with RDMA devices")
8071 (description
8072 "This package provides userspace components for the InfiniBand
8073subsystem of the Linux kernel. Specifically it contains userspace
8074libraries for the following device nodes:
8075
8076@enumerate
8077@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
8078@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
8079@item @file{/dev/infiniband/umadX} (@code{libibumad})
8080@end enumerate
8081
8082The following service daemons are also provided:
8083@enumerate
8084@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
8085@item @code{iwpmd} (for iWARP kernel providers)
8086@item @code{ibacm} (for InfiniBand communication management assistant)
8087@end enumerate")
8088 ;; All library code is dual licensed under GPL2 and a custom MIT
8089 ;; variant. The package also includes some components covered by
8090 ;; other licenses. Consult COPYING.md for full details.
8091 (license
8092 (list license:gpl2
8093 (license:x11-style "See COPYING.BSD_MIT in the distribution")
8094 license:bsd-2 ; Files referring to COPYING.BSD_FB
8095 license:cc0 ; most files in ccan/
8096 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
8097
8098(define-public perftest
8099 (package
8100 (name "perftest")
8101 (version "4.5-0.20")
8102 (home-page "https://github.com/linux-rdma/perftest")
8103 (source (origin
8104 (method git-fetch)
8105 (uri (git-reference (url home-page)
8106 (commit (string-append "v" version))))
8107 (file-name (git-file-name name version))
8108 (sha256
8109 (base32
8110 "1hrpzmkz1kq4jwpy6b5fl8073iy7dllcq2hfzdw6waaf5920vd64"))))
8111 (build-system gnu-build-system)
8112 (native-inputs
8113 (list autoconf automake libtool))
8114 (inputs (list pciutils rdma-core))
8115 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
8116 (description "This is a collection of tests written over uverbs intended
8117for use as a performance micro-benchmark. The tests may be used for hardware
8118or software tuning as well as for functional testing.
8119
8120The collection contains a set of bandwidth and latency benchmark such as:
8121@enumerate
8122@item Send - @code{ib_send_bw} and @code{ib_send_lat}
8123@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
8124@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
8125@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
8126@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
8127@end enumerate")
8128 (license license:gpl2)))
8129
8130(define-public rng-tools
8131 (package
8132 (name "rng-tools")
8133 (home-page "https://github.com/nhorman/rng-tools")
8134 (version "6.17")
8135 (source (origin
8136 (method git-fetch)
8137 (uri (git-reference (url home-page)
8138 (commit (string-append "v" version))))
8139 (file-name (git-file-name name version))
8140 (sha256
8141 (base32
8142 "0vvqi9ha4jbk4086x2q98p4ip3z56sfdpyckdyknsd36zhp6z8n2"))
8143 (patches
8144 (search-patches "rng-tools-revert-build-randstat.patch"))
8145 (patch-flags '("-p0"))))
8146 (build-system gnu-build-system)
8147 (arguments
8148 (list
8149 ;; Disable support for various hardware entropy sources as they need
8150 ;; dependencies that are not yet in Guix, and would significantly
8151 ;; increase closure size.
8152 #:configure-flags #~(list "--without-nistbeacon"
8153 "--without-pkcs11"
8154 "--without-rtlsdr"
8155 "--without-qrypt")
8156 #:phases
8157 #~(modify-phases %standard-phases
8158 (add-before 'check 'disable-failing-test
8159 (lambda _
8160 (substitute* "tests/Makefile"
8161 ;; This test requires a hwrng, rdrand, or tpm device.
8162 ;; Worse, it appears to fail if that isn't sufficiently random.
8163 (("\\brngtestjitter\\.sh\\b") " ")))))))
8164 (native-inputs
8165 (list autoconf automake pkg-config))
8166 (inputs
8167 (list libcap sysfsutils openssl))
8168 (synopsis "Random number generator daemon")
8169 (description
8170 "Monitor a hardware random number generator, and supply entropy
8171from that to the system kernel's @file{/dev/random} machinery.")
8172 ;; The source package is offered under the GPL2+, but the files
8173 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
8174 (license (list license:gpl2 license:gpl2+))))
8175
8176(define-public cpupower
8177 (package
8178 (name "cpupower")
8179 (version (package-version linux-libre))
8180 (source (package-source linux-libre))
8181 (build-system gnu-build-system)
8182 (arguments
8183 (list #:make-flags
8184 #~(list "CC=gcc"
8185 (string-append "DESTDIR=" #$output)
8186 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
8187 "docdir=/share/doc/cpupower" ;drop default ‘packages/’
8188 "confdir=$(docdir)/examples"
8189 ;; The Makefile recommends the following changes.
8190 "DEBUG=false"
8191 "[email protected]")
8192 #:tests? #f ; no tests
8193 #:phases
8194 #~(modify-phases %standard-phases
8195 (add-after 'unpack 'enter-subdirectory
8196 (lambda _
8197 (chdir "tools/power/cpupower")))
8198 (delete 'configure) ; no configure script
8199 (add-before 'build 'fix-makefiles
8200 (lambda _
8201 (substitute* "Makefile"
8202 (("/usr/") "/")
8203 (("/bin/(install)" _ command) command))
8204 (substitute* "bench/Makefile"
8205 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))))
8206 (native-inputs (list gettext-minimal
8207 which)) ;to find gettext
8208 (inputs (list pciutils))
8209 (home-page (package-home-page linux-libre))
8210 (synopsis "CPU frequency and voltage scaling tools for Linux")
8211 (description
8212 "cpupower is a set of user-space tools that use the cpufreq feature of the
8213Linux kernel to retrieve and control processor features related to power saving,
8214such as frequency and voltage scaling.")
8215 (license license:gpl2)))
8216
8217(define-public x86-energy-perf-policy
8218 (package
8219 (name "x86-energy-perf-policy")
8220 (version (package-version linux-libre))
8221 (source (package-source linux-libre))
8222 (build-system gnu-build-system)
8223 (arguments
8224 '(#:tests? #f
8225 #:phases
8226 (modify-phases %standard-phases
8227 (add-after 'unpack 'enter-subdirectory
8228 (lambda _
8229 (chdir "tools/power/x86/x86_energy_perf_policy")
8230 #t))
8231 (delete 'configure)
8232 (add-before 'build 'fix-makefile
8233 (lambda _
8234 (substitute* "Makefile" (("/usr") ""))
8235 #t)))
8236 #:make-flags
8237 (let ((out (assoc-ref %outputs "out")))
8238 (list (string-append "DESTDIR=" out)
8239 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
8240 (supported-systems '("i686-linux" "x86_64-linux"))
8241 (home-page (package-home-page linux-libre))
8242 (synopsis "Display and update Intel-CPU energy-performance policy")
8243 (description
8244 "@command{x86_energy_perf_policy} displays and updates energy-performance
8245policy settings specific to Intel Architecture Processors. Settings are
8246accessed via Model Specific Register (MSR) updates, no matter if the Linux
8247cpufreq sub-system is enabled or not.")
8248 (license license:gpl2)))
8249
8250(define-public haveged
8251 (package
8252 (name "haveged")
8253 (version "1.9.19")
8254 (source
8255 (origin
8256 (method git-fetch)
8257 (uri (git-reference
8258 (url "https://github.com/jirka-h/haveged")
8259 (commit (string-append "v" version))))
8260 (file-name (git-file-name name version))
8261 (sha256
8262 (base32 "1qka68dlfz9z3gjfvfwvh60l2121c1yx0z264jqsf2vjp5f0xbmn"))))
8263 (build-system gnu-build-system)
8264 (arguments
8265 `(#:configure-flags
8266 (list "--disable-static")))
8267 (home-page "https://www.issihosts.com/haveged")
8268 (synopsis "Entropy source for the Linux random number generator")
8269 (description
8270 "haveged generates an unpredictable stream of random numbers for use by
8271Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
8272standard mechanisms for filling the entropy pool may not be sufficient for
8273systems with high needs or limited user interaction, such as headless servers.
8274
8275@command{haveged} runs as a privileged daemon, harvesting randomness from the
8276indirect effects of hardware events on hidden processor state using the
8277@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
8278It tunes itself to its environment and provides the same built-in test suite
8279for the output stream as used on certified hardware security devices.
8280
8281The quality of the randomness produced by this algorithm has not been proven.
8282It is recommended to run it together with another entropy source like rngd, and
8283not as a replacement for it.")
8284 (license (list (license:non-copyleft "file://nist/mconf.h")
8285 (license:non-copyleft "file://nist/packtest.c")
8286 license:public-domain ; nist/dfft.c
8287 license:gpl3+)))) ; everything else
8288
8289(define-public hotspot
8290 ;; Use the latest git commit as it includes unreleased fixes for the test
8291 ;; suite.
8292 (let ((commit "5cec69301a3f34ada86ce9fe01a9538b04b3cf7c")
8293 (revision "0"))
8294 (package
8295 (name "hotspot")
8296 (version (git-version "1.5.1" revision commit))
8297 (source (origin
8298 (method git-fetch)
8299 (uri (git-reference
8300 (url "https://github.com/KDAB/hotspot")
8301 (commit commit)
8302 ;; Include the bundled perfparser and PrefixTickLabels
8303 ;; libraries, which are to be used in source form.
8304 (recursive? #t)))
8305 (file-name (git-file-name name version))
8306 (sha256
8307 (base32
8308 "115gskjdcb1q3mgrnv1qcdrhxabjzl1hhkpk1klk67ayicsk1ym6"))))
8309 (build-system qt-build-system)
8310 (arguments
8311 (list
8312 ;; As mentioned in the option help text, the KAuth helper cannot be
8313 ;; installed to a custom prefix and the build fails with "file cannot
8314 ;; create directory: /polkit-1/actions. Maybe need administrative"
8315 ;; (see: https://bugs.kde.org/show_bug.cgi?id=363678).
8316 #:configure-flags #~(list "-DINSTALL_KAUTH_HELPER=OFF"
8317 "-DQT6_BUILD=ON")
8318 #:qtbase qtbase
8319 ;; The 'tst_models' and 'tst_callgraphgenerator' fail, with
8320 ;; the later seemingly requiring sudo or access to the kernel
8321 ;; trace points.
8322 #:test-exclude
8323 (string-append
8324 "("
8325 (string-join
8326 ;; The 'tst_models' expected output doesn't exactly
8327 ;; match.
8328 '("tst_models"
8329 ;; The 'tst_callgraphgenerator' perf invocation
8330 ;; fails when run in the build container.
8331 "tst_callgraphgenerator"
8332 ;; The 'tst_perfparser' test requires sudo/access
8333 ;; to the kernel scheduler trace points.
8334 "tst_perfparser")
8335 "|")
8336 ")")
8337 #:phases
8338 #~(modify-phases %standard-phases
8339 (add-after 'unpack 'patch-perfparser
8340 ;; XXX: This phase is copied from qt-creator: keep them in sync!
8341 (lambda* (#:key inputs #:allow-other-keys)
8342 ;; perfparser attempts to dynamically load the demangle
8343 ;; libraries; use their absolute file name to avoid having to
8344 ;; set LD_LIBRARY_PATH.
8345 (let ((librustc_demangle.so
8346 (with-exception-handler (lambda (ex)
8347 (if (search-error? ex)
8348 #f
8349 (raise-exception ex)))
8350 (lambda ()
8351 (search-input-file inputs "lib/librustc_demangle.so"))
8352 #:unwind? #t)))
8353 (substitute* "3rdparty/perfparser/app/demangler.cpp"
8354 (("loadDemangleLib\\(QStringLiteral\\(\"rustc_demangle\")"
8355 all)
8356 (if librustc_demangle.so
8357 (format #f "loadDemangleLib(QStringLiteral(~s)"
8358 librustc_demangle.so)
8359 all)) ;no rustc_demangle; leave unchanged
8360 (("loadDemangleLib\\(QStringLiteral\\(\"d_demangle\")")
8361 (format #f "loadDemangleLib(QStringLiteral(~s)"
8362 (search-input-file inputs
8363 "lib/libd_demangle.so")))))))
8364 (add-after 'unpack 'path-paths
8365 (lambda* (#:key inputs #:allow-other-keys)
8366 (substitute* "src/perfoutputwidgetkonsole.cpp"
8367 (("\"tail\"")
8368 (format #f "~s" (search-input-file inputs "bin/tail"))))
8369 (substitute* "src/perfrecord.cpp"
8370 (("\"perf( )?\"" _ space)
8371 (string-append "\"" (search-input-file inputs "bin/perf")
8372 (or space "") "\""))))))))
8373 (native-inputs
8374 (list extra-cmake-modules
8375 vulkan-headers))
8376 (inputs
8377 (append
8378 (list coreutils-minimal
8379 d-demangler
8380 elfutils
8381 karchive
8382 kconfig
8383 kcoreaddons
8384 kddockwidgets
8385 kgraphviewer
8386 ki18n
8387 kio
8388 kiconthemes
8389 kitemmodels
8390 kitemviews
8391 knotifications
8392 kparts
8393 ksyntaxhighlighting
8394 kwindowsystem
8395 libxkbcommon
8396 perf
8397 qtdeclarative
8398 qtsvg
8399 solid
8400 threadweaver
8401 `(,zstd "lib"))
8402 (if (supported-package? rust-rustc-demangle-capi-0.1)
8403 (list rust-rustc-demangle-capi-0.1)
8404 '())))
8405 (home-page "https://github.com/KDAB/hotspot")
8406 (synopsis "Performance analysis GUI for Linux perf")
8407 (description "Hotspot is a standalone GUI for performance data analysis.
8408It aims to be similar to KCachegrind, but for data collected with
8409@command{perf}, a profiler for use with the kernel Linux. Its main feature is
8410graphically visualizing a @file{perf.data} file.")
8411 (license (list license:gpl2+ license:gpl3+))))) ;dual licensed
8412
8413(define-public ecryptfs-utils
8414 (package
8415 (name "ecryptfs-utils")
8416 (version "111")
8417 (source
8418 (origin
8419 (method url-fetch)
8420 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
8421 version "/+download/ecryptfs-utils_"
8422 version ".orig.tar.gz"))
8423 (sha256
8424 (base32
8425 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
8426 (build-system gnu-build-system)
8427 (arguments
8428 `(#:configure-flags (list "--disable-pywrap")
8429 #:modules (,@%default-gnu-modules
8430 (ice-9 binary-ports)
8431 (rnrs bytevectors)
8432 (srfi srfi-26))
8433 #:phases
8434 (modify-phases %standard-phases
8435 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
8436 (lambda* (#:key inputs outputs #:allow-other-keys)
8437 (let ((out (assoc-ref outputs "out"))
8438 (util-linux (assoc-ref inputs "util-linux"))
8439 (cryptsetup (assoc-ref inputs "cryptsetup-minimal"))
8440 (linux-pam (assoc-ref inputs "linux-pam"))
8441 (lvm2 (assoc-ref inputs "lvm2")))
8442 (substitute* '("src/utils/ecryptfs-mount-private"
8443 "src/utils/ecryptfs-umount-private"
8444 "src/utils/ecryptfs-setup-private"
8445 "src/utils/ecryptfs-setup-swap"
8446 "src/utils/mount.ecryptfs.c"
8447 "src/utils/umount.ecryptfs.c"
8448 "src/pam_ecryptfs/pam_ecryptfs.c"
8449 "src/desktop/ecryptfs-mount-private.desktop.in"
8450 "src/desktop/ecryptfs-setup-private.desktop.in")
8451 (("/bin/mount")
8452 (string-append util-linux "/bin/mount"))
8453 (("/bin/umount")
8454 (string-append util-linux "/bin/umount"))
8455 (("/sbin/mount.ecryptfs_private")
8456 (string-append out "/sbin/mount.ecryptfs_private"))
8457 (("/sbin/umount.ecryptfs_private")
8458 (string-append out "/sbin/umount.ecryptfs_private"))
8459 (("/usr/bin/ecryptfs-mount-private")
8460 (string-append out "/bin/ecryptfs-mount-private"))
8461 (("/usr/bin/ecryptfs-rewrite-file")
8462 (string-append out "/bin/ecryptfs-rewrite-file"))
8463 (("/usr/bin/ecryptfs-setup-private")
8464 (string-append out "/bin/ecryptfs-setup-private"))
8465 (("/sbin/cryptsetup")
8466 (string-append cryptsetup "/sbin/cryptsetup"))
8467 (("/sbin/unix_chkpwd")
8468 (string-append linux-pam "/sbin/unix_chkpwd"))
8469 (("/sbin/dmsetup")
8470 (string-append lvm2 "/sbin/dmsetup"))))))
8471 (add-after 'install 'wrap-scripts
8472 (lambda* (#:key inputs outputs #:allow-other-keys)
8473 (let* ((out (assoc-ref outputs "out"))
8474 (bin (string-append out "/bin"))
8475 (add (map (lambda (bin)
8476 (dirname (search-input-file
8477 inputs (string-append "bin/" bin))))
8478 ;; For simplicity, we wrap all scripts the same.
8479 (list "awk" "find" "gettext" "grep" "keyctl" "ls"
8480 "lsof" "mount" "rsync" "sed" "which")))
8481 (script? (lambda (file)
8482 (call-with-input-file file
8483 (lambda (port)
8484 (bytevector=? (string->utf8 "#!")
8485 (get-bytevector-n port 2)))))))
8486 (for-each (lambda (file)
8487 (when (script? file)
8488 (wrap-program file
8489 ;; '= would be better than 'suffix but break
8490 ;; setuid binaries.
8491 `("PATH" ":" suffix (,@add
8492 ,(string-append bin))))))
8493 (find-files bin "."))))))))
8494 (native-inputs
8495 (list intltool perl ; for pod2man
8496 pkg-config))
8497 (inputs
8498 (list coreutils
8499 cryptsetup-minimal
8500 findutils
8501 gawk
8502 grep
8503 keyutils
8504 linux-pam
8505 lsof
8506 lvm2
8507 nss
8508 rsync
8509 sed
8510 util-linux
8511 which))
8512 (home-page "https://ecryptfs.org/")
8513 (synopsis "Cryptographic file system utilities")
8514 (description
8515 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
8516Each file's cryptographic meta-data is stored inside the file itself, along
8517with the encrypted contents. This allows individual encrypted files to be
8518copied between hosts and still be decrypted with the proper key. eCryptfs is a
8519native Linux file system, and has been part of the Linux kernel since version
85202.6.19. This package contains the userland utilities to manage it.")
8521 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
8522 ;; grant additional permission to link with OpenSSL.
8523 (license license:gpl2+)))
8524
8525(define-public libnfsidmap
8526 (package
8527 (name "libnfsidmap")
8528 (version "0.27")
8529 (source
8530 (origin
8531 (method url-fetch)
8532 (uri (string-append "https://fedorapeople.org/~steved/"
8533 name "/" version "/" name "-" version ".tar.bz2"))
8534 (sha256
8535 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
8536 (build-system gnu-build-system)
8537 (arguments
8538 `(#:configure-flags (list
8539 (string-append "--with-pluginpath="
8540 (assoc-ref %outputs "out")
8541 "/lib/libnfsidmap"))))
8542 (native-inputs
8543 (list autoconf)) ; 0.27 still needs autoheader
8544 (home-page
8545 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
8546 (synopsis "NFSv4 support library for name/ID mapping")
8547 (description "Libnfsidmap is a library holding multiple methods of
8548mapping names to ids and visa versa, mainly for NFSv4. It provides an
8549extensible array of mapping functions, currently consisting of two choices:
8550the default @code{nsswitch} and the experimental @code{umich_ldap}.")
8551 (license (license:non-copyleft "file://COPYING"
8552 "See COPYING in the distribution."))))
8553
8554(define-public module-init-tools
8555 (package
8556 (name "module-init-tools")
8557 (version "3.16")
8558 (source (origin
8559 (method url-fetch)
8560 (uri (string-append
8561 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
8562 "module-init-tools-" version ".tar.bz2"))
8563 (sha256
8564 (base32
8565 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
8566 (patches (search-patches "module-init-tools-moduledir.patch"))))
8567 (build-system gnu-build-system)
8568 (arguments
8569 ;; FIXME: The upstream tarball lacks man pages, and building them would
8570 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
8571 ;; but they vanished. In the meantime, fake it.
8572 '(#:phases
8573 (modify-phases %standard-phases
8574 (add-before 'configure 'fake-docbook
8575 (lambda _
8576 (substitute* "Makefile.in"
8577 (("^DOCBOOKTOMAN.*$")
8578 "DOCBOOKTOMAN = true\n"))
8579 #t)))))
8580 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
8581 (synopsis "Tools for loading and managing Linux kernel modules")
8582 (description
8583 "Tools for loading and managing Linux kernel modules, such as
8584@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
8585 (license license:gpl2+)))
8586
8587(define-public mce-inject
8588 (let ((revision "0") ; no git tags :-/
8589 (commit "4cbe46321b4a81365ff3aafafe63967264dbfec5"))
8590 (package
8591 (name "mce-inject")
8592 (version (git-version "0.0.0" revision commit))
8593 (source
8594 (origin
8595 (method git-fetch)
8596 (uri (git-reference
8597 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git")
8598 (commit commit)))
8599 (file-name (git-file-name name version))
8600 (sha256
8601 (base32 "0gjapg2hrlxp8ssrnhvc19i3r1xpcnql7xv0zjgbv09zyha08g6z"))))
8602 (build-system gnu-build-system)
8603 (arguments
8604 ;; There is no test suite. There's a test/ directory, but it just holds
8605 ;; example text files you could feed to the programme to crash something.
8606 (list #:tests? #f
8607 #:make-flags
8608 #~(list (string-append "prefix=" #$output)
8609 (string-append "CC=" #$(cc-for-target)))
8610 #:phases
8611 #~(modify-phases %standard-phases
8612 (delete 'configure) ; no configure script
8613 (add-after 'install 'install-examples
8614 (lambda* (#:key outputs #:allow-other-keys)
8615 (let* ((out (assoc-ref outputs "out"))
8616 (doc (string-append out "/share/doc/" #$name))
8617 (dir (string-append doc "/examples")))
8618 (copy-recursively "test" dir )))))))
8619 (native-inputs
8620 (list bison flex))
8621 (supported-systems (list "i686-linux" "x86_64-linux"))
8622 (home-page
8623 "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git/about/")
8624 (synopsis
8625 "Inject x86 @acronym{MCEs, machine-check exceptions} into Linux")
8626 (description
8627 "This simple tool injects fake @acronym{MCEs, machine-check exceptions}
8628into a running Linux kernel, to debug or test the kernel's @acronym{EDAC, error
8629detection and correction}-handling code specific to x86 and x86_64 platforms.
8630
8631Real MCEs are internal CPU errors. Handling them correctly can be important to
8632system stability and even prevent physical damage. In contrast, simulated MCEs
8633produced by @command{mce-inject} are purely synthetic: injection happens only at
8634the software level, inside the kernel, and is not visible to the platform
8635hardware or firmware.
8636
8637A convenient feature of @command{mce-inject} is that the input language used to
8638describe MCEs is similar to the format used in Linux panic messages, with a few
8639extensions. In general, you should be able to pipe in any logged MCE panic to
8640simulate that same MCE.
8641
8642The target kernel must have the @code{CONFIG_X86_MCE_INJECT} option enabled and
8643the @code{mce-inject} module loaded if it exists.")
8644 (license license:gpl2))))
8645
8646(define-public mcelog
8647 (package
8648 (name "mcelog")
8649 (version "195")
8650 (source
8651 (origin
8652 (method git-fetch)
8653 (uri (git-reference
8654 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
8655 (commit (string-append "v" version))))
8656 (file-name (git-file-name name version))
8657 (sha256
8658 (base32 "1bg2bj8flybd8kzmmaaslisc6lc1fs9nbv09im6r32dq48skx5aj"))
8659 (modules '((guix build utils)))
8660 (snippet
8661 `(begin
8662 ;; The checkout lacks a .git directory, breaking ‘git describe’.
8663 (substitute* "Makefile"
8664 (("\"unknown\"") (string-append "\"v" ,version "\"")))))))
8665 (build-system gnu-build-system)
8666 (arguments
8667 (list
8668 ;; The tests will only run as root on certain supported CPU models.
8669 #:tests? #f
8670 #:make-flags
8671 #~(list (string-append "CC=" #$(cc-for-target))
8672 (string-append "prefix=" #$output)
8673 (string-append "DOCDIR=" #$output "/share/doc/"
8674 #$name "-" #$version)
8675 "etcprefix=$(DOCDIR)/examples")
8676 #:phases
8677 #~(modify-phases %standard-phases
8678 (delete 'configure)))) ; no configure script
8679 (native-inputs
8680 (list python-wrapper)) ; to generate example mcelog.conf
8681 (supported-systems (list "i686-linux" "x86_64-linux"))
8682 (home-page "https://mcelog.org/")
8683 (synopsis "Machine check monitor for x86 Linux systems")
8684 (description
8685 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
8686systems running the kernel Linux. It can also perform user-defined tasks, such
8687as bringing bad pages off-line, when configurable error thresholds are
8688exceeded.")
8689 (license license:gpl2)))
8690
8691(define-public mtd-utils
8692 (package
8693 (name "mtd-utils")
8694 (version "2.1.5")
8695 (source (origin
8696 (method url-fetch)
8697 (uri (string-append
8698 "ftp://ftp.infradead.org/pub/mtd-utils/"
8699 "mtd-utils-" version ".tar.bz2"))
8700 (sha256
8701 (base32
8702 "0ilz8hkcyvfcnqpy25kbr8fb71x9vl28wbmw56vvd68n2byjfviq"))))
8703 (arguments
8704 (list #:configure-flags
8705 (if (%current-target-system) ; When cross-compiling.
8706 #~(list)
8707 #~(list "--enable-unit-tests"))
8708
8709 #:parallel-tests? #f)) ;tests may fail when running in parallel
8710 (native-inputs
8711 (list cmocka pkg-config))
8712 (inputs
8713 (list acl ; extended attributes (xattr)
8714 lzo
8715 openssl ; optional crypto support
8716 `(,util-linux "lib")
8717 zlib
8718 `(,zstd "lib")))
8719 (build-system gnu-build-system)
8720 (synopsis "MTD Flash Storage Utilities")
8721 (description "This package provides utilities for testing, partitioning, etc
8722of flash storage.")
8723 (home-page "http://www.linux-mtd.infradead.org/")
8724 (license
8725 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
8726 license:mpl1.1 ; All ftl* files
8727 license:expat)))) ; libiniparser
8728
8729(define-public libseccomp
8730 (package
8731 (name "libseccomp")
8732 (version "2.6.0")
8733 (source (origin
8734 (method git-fetch)
8735 (uri (git-reference
8736 (url "https://github.com/seccomp/libseccomp")
8737 (commit (string-append "v" version))))
8738 (file-name (git-file-name name version))
8739 (sha256
8740 (base32
8741 "189yh66aj3z3jvns739qbj504f3mcl3w44pxxizw877pbj3kal11"))))
8742 (build-system gnu-build-system)
8743 (arguments
8744 (list
8745 #:configure-flags #~(list "--disable-static")
8746 #:phases #~(modify-phases %standard-phases
8747 #$@(if (target-ppc32?)
8748 ;; This test is removed upstream. See upstream commit
8749 ;; 7db46d72f13c172b290818f624c2966bd0db5677
8750 #~((add-after 'unpack 'skip-62-sim-arch-tests
8751 (lambda _
8752 (substitute*
8753 "tests/62-sim-arch_transactions.tests"
8754 (("test type: bpf-sim-fuzz") "")
8755 (("62-sim-arch_transactions 5") "")))))
8756 #~())
8757 (add-before 'check 'skip-load-test
8758 (lambda _
8759 ;; This test does a native system call and fails when
8760 ;; run under QEMU user-mode emulation. Just skip it.
8761 (delete-file "tests/52-basic-load.tests"))))))
8762 (native-inputs
8763 (list autoconf automake gperf libtool which))
8764 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
8765 (description "The libseccomp library provides an easy to use, platform
8766independent, interface to the Linux Kernel's syscall filtering mechanism. The
8767libseccomp API is designed to abstract away the underlying BPF based syscall
8768filter language and present a more conventional function-call based filtering
8769interface that should be familiar to, and easily adopted by, application
8770developers.")
8771 (home-page "https://github.com/seccomp/libseccomp")
8772 (license license:lgpl2.1)))
8773
8774(define-public radeontop
8775 (package
8776 (name "radeontop")
8777 (version "1.4")
8778 (source
8779 (origin
8780 (method git-fetch)
8781 (uri (git-reference
8782 (url "https://github.com/clbr/radeontop")
8783 (commit (string-append "v" version))))
8784 (file-name (git-file-name name version))
8785 (sha256
8786 (base32 "0kwqddidr45s1blp0h8r8h1dd1p50l516yb6mb4s6zsc827xzgg3"))))
8787 (build-system gnu-build-system)
8788 (arguments
8789 `(#:phases (modify-phases %standard-phases
8790 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
8791 ;; dependency, and doesn't even work on release(!) tarballs.
8792 (add-after 'unpack 'report-correct-version
8793 (lambda _
8794 (substitute* "getver.sh"
8795 (("ver=unknown")
8796 (string-append "ver=" ,version)))))
8797 (delete 'configure)) ; no configure script
8798 #:make-flags (list (string-append "CC=" ,(cc-for-target))
8799 (string-append "PREFIX=" %output))
8800 #:tests? #f)) ; no tests
8801 (native-inputs
8802 (list gettext-minimal pkg-config))
8803 (inputs
8804 (list libdrm libpciaccess libxcb ncurses))
8805 (home-page "https://github.com/clbr/radeontop/")
8806 (synopsis "Usage monitor for AMD Radeon graphics")
8807 (description "RadeonTop monitors resource consumption on supported AMD
8808Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
8809a terminal or saved to a file for further processing. It measures both the
8810activity of the GPU as a whole, which is also accurate during OpenCL
8811computations, as well as separate component statistics that are only meaningful
8812under OpenGL graphics workloads.")
8813 (license license:gpl3)))
8814
8815(define-public efivar
8816 (package
8817 (name "efivar")
8818 (version "39")
8819 (source (origin
8820 (method git-fetch)
8821 (uri (git-reference
8822 (url "https://github.com/rhboot/efivar")
8823 (commit version)))
8824 (file-name (git-file-name name version))
8825 (sha256
8826 (base32
8827 "1zd9dghg1z2rrsazv3d9rj7nik6kdqz42jiak65pipz7mpjn9zdk"))
8828 (patches (search-patches "efivar-fix-fprint-format.patch"))))
8829 (build-system gnu-build-system)
8830 (arguments
8831 (list
8832 ;; Tests require a UEFI system and is not detected in the chroot.
8833 #:tests? #f
8834 #:make-flags #~(list (string-append "prefix="
8835 #$output)
8836 (string-append "libdir="
8837 #$output "/lib")
8838 (string-append "CC="
8839 #$(cc-for-target))
8840 "HOSTCC=gcc"
8841 (string-append "LDFLAGS=-Wl,-rpath="
8842 #$output "/lib")
8843 ;; Strictly only needed for i686-linux/32bit
8844 "CFLAGS=-g -O2 -Wno-error=format")
8845 #:phases #~(modify-phases %standard-phases
8846 (add-after 'unpack 'build-deterministically
8847 (lambda _
8848 (substitute* "src/include/defaults.mk"
8849 ;; Don't use -march=native.
8850 (("-march=native")
8851 ""))))
8852 (delete 'configure))))
8853 (native-inputs (list mandoc pkg-config))
8854 (inputs (list popt))
8855 (home-page "https://github.com/rhboot/efivar")
8856 (synopsis "Tool and library to manipulate EFI variables")
8857 (description "This package provides a library and a command line
8858interface to the variable facility of UEFI boot firmware.")
8859 (license license:lgpl2.1+)))
8860
8861(define-public efibootmgr
8862 (package
8863 (name "efibootmgr")
8864 (version "18")
8865 (source
8866 (origin
8867 (method git-fetch)
8868 (uri (git-reference
8869 (url "https://github.com/rhboot/efibootmgr")
8870 (commit version)))
8871 (file-name (git-file-name name version))
8872 (sha256
8873 (base32 "1j19m3dngcb7jl88ib32phbh5r7c02dhhakq8jk6z7y408c111hd"))))
8874 (build-system gnu-build-system)
8875 (arguments
8876 (list
8877 #:tests? #f ;no tests
8878 #:make-flags
8879 #~(append (list (string-append "prefix=" #$output)
8880 (string-append "libdir=" #$output "/lib")
8881 ;; EFIDIR denotes a subdirectory relative to the
8882 ;; EFI System Partition where the loader will be
8883 ;; installed (known as OS_VENDOR in the code).
8884 ;; GRUB overrides this, as such it's only used if
8885 ;; nothing else is specified on the command line.
8886 "EFIDIR=gnu")
8887 #$(if (%current-target-system)
8888 #~(list
8889 (string-append "CC=" #$(cc-for-target))
8890 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
8891 (string-append "EXTRAINCDIRS="
8892 #$(this-package-input "efivar") "/include"))
8893 #~'()))
8894 #:phases #~(modify-phases %standard-phases (delete 'configure))))
8895 (native-inputs
8896 (list pkg-config))
8897 (inputs
8898 (list efivar popt))
8899 (home-page "https://github.com/rhboot/efibootmgr")
8900 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
8901 (description
8902 "@code{efibootmgr} is a user-space application to modify the Intel
8903Extensible Firmware Interface (EFI) Boot Manager. This application can
8904create and destroy boot entries, change the boot order, change the next
8905running boot option, and more.")
8906 (license license:gpl2+)))
8907
8908(define-public sysstat
8909 (package
8910 (name "sysstat")
8911 (version "12.7.5")
8912 (source
8913 (origin
8914 (method url-fetch)
8915 (uri (string-append "https://sysstat.github.io/sysstat-packages/"
8916 "sysstat-" version ".tar.xz"))
8917 (sha256
8918 (base32 "0ssdrm3k0fclq5b5i0aznfwdkbac9l9cf88idaq3pls9lm040rjp"))))
8919 (build-system gnu-build-system)
8920 (native-inputs (list gettext-minimal))
8921 (arguments
8922 `(#:tests? #f ; no test suite.
8923 ;; Without this flag, it tries to install the man pages with group 'root'
8924 ;; and fails because /etc/passwd lacks an entry for the root user.
8925 #:configure-flags
8926 (list "--disable-file-attr"
8927 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
8928 #:phases
8929 (modify-phases %standard-phases
8930 ;; The build process tries to create '/var/lib/sa', so we skip that
8931 ;; instruction.
8932 (add-after 'build 'skip-touching-var
8933 (lambda _
8934 (substitute* "Makefile"
8935 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
8936 "")))))))
8937 (home-page "https://sysstat.github.io")
8938 (synopsis "Performance monitoring tools for Linux")
8939 (description "The sysstat utilities are a collection of performance
8940monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
8941@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
8942@code{sadf} and @code{sa}.")
8943 (license license:gpl2+)))
8944
8945(define-public acpilight
8946 (package
8947 (name "acpilight")
8948 (version "1.2")
8949 (source (origin
8950 (method git-fetch)
8951 (uri (git-reference
8952 (url "https://gitlab.com/wavexx/acpilight.git")
8953 (commit (string-append "v" version))))
8954 (file-name (git-file-name name version))
8955 (sha256
8956 (base32
8957 "1r0r3nx6x6vkpal6vci0zaa1n9dfacypldf6k8fxg7919vzxdn1w"))))
8958 (build-system gnu-build-system)
8959 (arguments
8960 (list #:tests? #f ; no tests
8961 #:make-flags
8962 #~(list (string-append "prefix=" #$output)
8963 (string-append "sysconfdir=" #$output "/lib")) ;udev rule
8964 #:phases
8965 #~(modify-phases %standard-phases
8966 (delete 'configure)
8967 (add-after 'unpack 'patch
8968 (lambda* (#:key inputs #:allow-other-keys)
8969 ;; Prevent reloading udev at build time
8970 (substitute* "Makefile"
8971 (("udevadm") "true"))
8972 (substitute* "90-backlight.rules"
8973 (("/bin")
8974 (string-append #$(this-package-input "coreutils")
8975 "/bin"))))))))
8976 (inputs (list coreutils python))
8977 (home-page "https://gitlab.com/wavexx/acpilight")
8978 (synopsis "Backward-compatibile xbacklight replacement")
8979 (description "acpilight is a backward-compatibile replacement for
8980xbacklight that uses the ACPI interface to set the display brightness. On
8981modern laptops acpilight can control both display and keyboard backlight
8982uniformly on either X11, the console or Wayland.")
8983 (license license:gpl3+)))
8984
8985(define-public light
8986 (package
8987 (name "light")
8988 (version "1.2.2")
8989 (source
8990 (origin
8991 (method git-fetch)
8992 (uri (git-reference
8993 (url "https://github.com/haikarainen/light")
8994 (commit (string-append "v" version))))
8995 (sha256
8996 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
8997 (file-name (git-file-name name version))))
8998 (build-system gnu-build-system)
8999 (arguments
9000 `(#:configure-flags '("CFLAGS=-fcommon")
9001 #:phases
9002 (modify-phases %standard-phases
9003 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
9004 (lambda* (#:key inputs #:allow-other-keys)
9005 (substitute* "90-backlight.rules"
9006 (("/bin/chgrp") (which "chgrp"))
9007 (("/bin/chmod") (which "chmod")))
9008 #t))
9009 (add-after 'install 'install-udev-rules
9010 (lambda* (#:key outputs #:allow-other-keys)
9011 (let ((out (assoc-ref outputs "out")))
9012 (install-file
9013 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
9014 #t))))))
9015 (native-inputs
9016 (list autoconf automake))
9017 (home-page "https://haikarainen.github.io/light/")
9018 (synopsis "GNU/Linux application to control backlights")
9019 (description
9020 "Light is a program to send commands to screen backlight controllers
9021under GNU/Linux. Features include:
9022
9023@itemize
9024@item It does not rely on X.
9025@item Light can automatically figure out the best controller to use, making
9026full use of underlying hardware.
9027@item It is possible to set a minimum brightness value, as some controllers
9028set the screen to be pitch black at a value of 0 (or higher).
9029@end itemize\n")
9030 (license license:gpl3+)))
9031
9032(define-public brightnessctl
9033 (package
9034 (name "brightnessctl")
9035 (version "0.5.1")
9036 (home-page "https://github.com/Hummer12007/brightnessctl")
9037 (source (origin
9038 (method git-fetch)
9039 (uri (git-reference (url home-page) (commit version)))
9040 (file-name (git-file-name name version))
9041 (sha256
9042 (base32
9043 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
9044 (patches (search-patches "brightnessctl-elogind-support.patch"))))
9045 (build-system gnu-build-system)
9046 (arguments
9047 `(#:tests? #f ; no tests
9048 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9049 (string-append "PREFIX=" %output)
9050 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
9051 "ENABLE_SYSTEMD=1")
9052 #:phases
9053 (modify-phases %standard-phases
9054 (delete 'configure)
9055 (add-after 'unpack 'adjust-udev-rules
9056 (lambda _
9057 (substitute* "Makefile"
9058 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
9059 (substitute* "90-brightnessctl.rules"
9060 (("/bin/") "/run/current-system/profile/bin/"))
9061 #t)))))
9062 (native-inputs
9063 (list pkg-config))
9064 (inputs
9065 (list elogind))
9066 (synopsis "Backlight and LED brightness control")
9067 (description
9068 "This program allows you read and control device brightness. Devices
9069include backlight and LEDs. It can also preserve current brightness before
9070applying the operation, such as on lid close.
9071
9072The appropriate permissions must be set on the backlight or LED control
9073interface in sysfs, which can be accomplished with the included udev rules.")
9074 (license license:expat)))
9075
9076(define-public tlp
9077 (package
9078 (name "tlp")
9079 (version "1.9.0")
9080 (source
9081 (origin
9082 (method git-fetch)
9083 (uri (git-reference
9084 (url "https://github.com/linrunner/TLP")
9085 (commit version)))
9086 (file-name (git-file-name name version))
9087 (sha256
9088 (base32 "0msskz42yy0ddq6gqak0dsl77wsym24ly3bkpymfwl9dr3wzikv8"))))
9089 (native-inputs
9090 (list shellcheck))
9091 (inputs
9092 `(("dbus" ,dbus)
9093 ("ethtool" ,ethtool)
9094 ("eudev" ,eudev)
9095 ("grep" ,grep)
9096 ("guile" ,guile-3.0) ;for wrap-script
9097 ("hdparm" ,hdparm)
9098 ("inetutils" ,inetutils)
9099 ("iw" ,iw)
9100 ("kmod" ,kmod)
9101 ("pciutils" ,pciutils)
9102 ("perl" ,perl)
9103 ("rfkill" ,rfkill)
9104 ("sed" ,sed)
9105 ("usbutils" ,usbutils)
9106 ("util-linux" ,util-linux)
9107 ("wireless-tools" ,wireless-tools)
9108 ,@(if (let ((system (or (%current-target-system)
9109 (%current-system))))
9110 (or (string-prefix? "i686-" system)
9111 (string-prefix? "x86_64-" system)))
9112 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
9113 '())))
9114 (build-system gnu-build-system)
9115 (arguments
9116 ;; XXX: The full test suite is run with "checkall" but it requires
9117 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
9118 (list
9119 #:make-flags
9120 #~(list "TLP_CONFUSR=/etc/tlp.conf" "TLP_CONFDIR=/etc/tlp.d")
9121 #:test-target "shellcheck"
9122 #:modules '((guix build gnu-build-system)
9123 (guix build utils)
9124 (srfi srfi-1))
9125 #:phases
9126 #~(modify-phases %standard-phases
9127 (delete 'configure) ; no configure script
9128 (add-before 'build 'setenv
9129 (lambda _
9130 (setenv "TLP_WITH_SYSTEMD" "0")
9131 (setenv "TLP_NO_INIT" "1")))
9132 (add-before 'build 'fix-installation
9133 (lambda _
9134 ;; Stop the Makefile from trying to create system directories.
9135 (substitute* "Makefile"
9136 (("= /usr") (string-append "= " #$output))
9137 (("= /etc") (string-append "= " #$output "/etc"))
9138 (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
9139 (add-before 'build 'fix-perl-calls
9140 ;; Shell scripts in "bat.d" and "func.d" call "perl". Fix
9141 ;; invocation without wrapping every one of them.
9142 (lambda* (#:key inputs #:allow-other-keys)
9143 (substitute* (append (find-files "bat.d" ".")
9144 (find-files "func.d" "."))
9145 (("(^|[^/])perl" _ prefix)
9146 (string-append prefix
9147 (search-input-file inputs "bin/perl"))))))
9148 (replace 'install
9149 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
9150 (add-after 'install 'wrap
9151 (lambda* (#:key inputs outputs #:allow-other-keys)
9152 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
9153 (sbin (string-append (assoc-ref outputs "out") "/sbin"))
9154 ;; Used to ignore symlinks which don't need wrapping
9155 (regular-file-predicate
9156 (lambda (file stat) (eq? 'regular (stat:type stat))))
9157 (bin-files (find-files bin regular-file-predicate))
9158 (sbin-files (find-files sbin regular-file-predicate)))
9159 (define (bin-directory input-name)
9160 (let ((p (assoc-ref inputs input-name)))
9161 (and p (string-append p "/bin"))))
9162 (define (sbin-directory input-name)
9163 (string-append (assoc-ref inputs input-name) "/sbin"))
9164 (for-each (lambda (program)
9165 ;; Programs rely on $0 so we use wrap-script
9166 ;; instead of wrap-program
9167 (wrap-script program
9168 `("PATH" ":" prefix
9169 ,(append
9170 (filter-map bin-directory
9171 '("bash"
9172 "coreutils"
9173 "dbus"
9174 "eudev"
9175 "grep"
9176 "inetutils"
9177 "kmod"
9178 "perl"
9179 "sed"
9180 "usbutils"
9181 "util-linux"
9182 "x86-energy-perf-policy"))
9183 (filter-map sbin-directory
9184 '("ethtool"
9185 "hdparm"
9186 "iw"
9187 "pciutils"
9188 "rfkill"
9189 "wireless-tools"))))))
9190 (append bin-files sbin-files))))))))
9191 (home-page "https://linrunner.de/en/tlp/tlp.html")
9192 (synopsis "Power management tool for Linux")
9193 (description "TLP is a power management tool for Linux. It comes with
9194a default configuration already optimized for battery life. Nevertheless,
9195TLP is customizable to fulfil system requirements. TLP settings are applied
9196every time the power supply source is changed.")
9197 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
9198 ;; rest is GPLv2+.
9199 (license (list license:gpl2+ license:gpl3+))))
9200
9201(define-public tlpui
9202 (package
9203 (name "tlpui")
9204 (version "1.9.0")
9205 (source
9206 (origin
9207 (method git-fetch)
9208 (uri (git-reference
9209 (url "https://github.com/d4nj1/TLPUI")
9210 (commit (string-append "tlpui-" version))))
9211 (file-name (git-file-name name version))
9212 (sha256
9213 (base32 "00rkq389zs525s7ckjj6cm34s25rsrgz47p28pp43ld35i538g9w"))))
9214 (build-system pyproject-build-system)
9215 (arguments
9216 (list
9217 #:phases
9218 #~(modify-phases %standard-phases
9219 (add-after 'unpack 'set-absolute-locations
9220 (lambda* (#:key inputs #:allow-other-keys)
9221 (let ((defaults.conf
9222 (search-input-file inputs "/share/tlp/defaults.conf"))
9223 (lspci (search-input-file inputs "/bin/lspci"))
9224 (lsusb (search-input-file inputs "/bin/lsusb"))
9225 (tlp-stat (search-input-file inputs "/bin/tlp-stat")))
9226 (with-directory-excursion "tlpui"
9227 (substitute* '("file.py" "settingshelper.py" "statui.py")
9228 (("\"tlp-stat\"")
9229 (string-append "'" tlp-stat "'"))
9230 (("/usr/share/tlp/defaults.conf")
9231 defaults.conf))
9232 (substitute* "ui_config_objects/gtkusblist.py"
9233 (("\"lsusb\"")
9234 (string-append "'" lsusb "'")))
9235 (substitute* "ui_config_objects/gtkpcilist.py"
9236 (("\"lspci\"")
9237 (string-append "'" lspci "'")))
9238 ;; Settings check if various tlp executables, lspci and
9239 ;; usbutils are available. Skip this phase since we know
9240 ;; for sure they are (and it avoids patching each location).
9241 (substitute* "settingshelper.py"
9242 (("(command_exists = ).*" _ lead)
9243 (string-append lead "True\n")))))))
9244 (add-after 'install 'install-desktop-file
9245 (lambda _
9246 (let ((dir (string-append #$output "/share/applications")))
9247 (install-file "tlpui.desktop" dir))))
9248 (add-after 'wrap 'wrap-gi-python
9249 (lambda _
9250 (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
9251 (wrap-program (string-append #$output "/bin/tlpui")
9252 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
9253 (native-inputs
9254 (list `(,glib "bin")
9255 gobject-introspection
9256 python-poetry-core
9257 python-pytest
9258 python-pyyaml))
9259 (inputs
9260 (list gtk+
9261 pciutils
9262 python-pygobject
9263 tlp
9264 usbutils))
9265 (propagated-inputs (list (librsvg-for-system)))
9266 (home-page "https://github.com/d4nj1/TLPUI")
9267 (synopsis "User interface for TLP written in Python")
9268 (description
9269 "The Python scripts in this project generate a GTK-UI to change
9270TLP configuration files easily. It aims to protect users from setting
9271bad configuration and to deliver a basic overview of all the valid
9272configuration values.")
9273 (license license:gpl2+)))
9274
9275(define-public lshw
9276 (package
9277 (name "lshw")
9278 (version "B.02.19.2")
9279 (source (origin
9280 (method url-fetch)
9281 (uri (string-append "https://www.ezix.org/software/"
9282 "files/lshw-" version
9283 ".tar.gz"))
9284 (sha256
9285 (base32
9286 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
9287 (build-system gnu-build-system)
9288 (arguments
9289 `(#:phases (modify-phases %standard-phases (delete 'configure))
9290 #:tests? #f ; no tests
9291 #:make-flags
9292 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
9293 (synopsis "List hardware information")
9294 (description
9295 "@command{lshw} (Hardware Lister) is a small tool to provide
9296detailed information on the hardware configuration of the machine.
9297It can report exact memory configuration, firmware version, mainboard
9298configuration, CPU version and speed, cache configuration, bus speed,
9299and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
9300machines (PowerMac G4 is known to work).")
9301 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
9302 (license license:gpl2+)))
9303
9304(define-public libmnl
9305 (package
9306 (name "libmnl")
9307 (version "1.0.5")
9308 (source
9309 (origin
9310 (method url-fetch)
9311 (uri (string-append "mirror://netfilter.org/libmnl/"
9312 "libmnl-" version ".tar.bz2"))
9313 (sha256
9314 (base32
9315 "09851ns07399rbz0y8slrlmnw3fn1nakr8d37pxjn5gkks8rnjr7"))))
9316 (build-system gnu-build-system)
9317 (home-page "https://www.netfilter.org/projects/libmnl/")
9318 (synopsis "Netlink utility library")
9319 (description "Libmnl is a minimalistic user-space library oriented to
9320Netlink developers. There are a lot of common tasks in parsing, validating,
9321constructing of both the Netlink header and TLVs that are repetitive and easy to
9322get wrong. This library aims to provide simple helpers that allows you to
9323re-use code and to avoid re-inventing the wheel.")
9324 (properties
9325 '((release-monitoring-url . "https://www.netfilter.org/pub/libmnl/")))
9326 (license license:lgpl2.1+)))
9327
9328(define-public libnftnl
9329 (package
9330 (name "libnftnl")
9331 (version "1.2.8")
9332 (source
9333 (origin
9334 (method url-fetch)
9335 (uri (string-append "mirror://netfilter.org/libnftnl/"
9336 "libnftnl-" version ".tar.xz"))
9337 (sha256
9338 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9339 (build-system gnu-build-system)
9340 (native-inputs
9341 (list pkg-config))
9342 (inputs
9343 (list libmnl))
9344 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
9345 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
9346 (description "Libnftnl is a userspace library providing a low-level netlink
9347programming interface to the in-kernel nf_tables subsystem. The library
9348libnftnl has been previously known as libnftables. This library is currently
9349used by nftables.")
9350 (license license:gpl2+)))
9351
9352;;; The symbol libnftl/fixed should be used when libnftnl needs fixes
9353;;; (security or else) and this deprecation could be removed.
9354(define-deprecated/public-alias libnftnl/fixed libnftnl/pinned)
9355
9356;; This is used in iptables, which contributes to rust. We're pinning this
9357;; variant to avoid accidental rebuilds of rust.
9358(define-public libnftnl/pinned
9359 (package
9360 (inherit libnftnl)
9361 (version "1.2.8")
9362 (source
9363 (origin
9364 (method url-fetch)
9365 (uri (string-append "mirror://netfilter.org/libnftnl/"
9366 "libnftnl-" version ".tar.xz"))
9367 (sha256
9368 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9369 (build-system gnu-build-system)
9370 (native-inputs
9371 (list pkg-config))
9372 (inputs
9373 (list libmnl))))
9374
9375(define-public nftables
9376 (package
9377 (name "nftables")
9378 (version "1.0.8")
9379 (source
9380 (origin
9381 (method url-fetch)
9382 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
9383 version ".tar.xz")
9384 (string-append "https://www.nftables.org/projects/nftables"
9385 "/files/nftables-" version ".tar.xz")))
9386 (sha256
9387 (base32 "0l1xpwr9qfbl3bxa97v8s2lbibiz0xma9q0qi34xp0hswh6p8wwk"))))
9388 (build-system gnu-build-system)
9389 (arguments `(#:configure-flags
9390 '("--disable-static"
9391 "--with-cli=readline"
9392 "--with-json")
9393 #:phases
9394 (modify-phases %standard-phases
9395 (add-before 'configure 'autoreconf
9396 (lambda _
9397 (invoke "autoreconf" "-fi"))))))
9398 (inputs (list gmp libmnl libnftnl readline jansson))
9399 (native-inputs (list pkg-config
9400 bison
9401 flex
9402 docbook2x
9403 autoconf
9404 automake
9405 libtool))
9406 (home-page "https://www.nftables.org")
9407 (synopsis "Userspace utility for Linux packet filtering")
9408 (description "nftables is the project that aims to replace the existing
9409{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
9410filtering framework, a new userspace utility and also a compatibility layer for
9411{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
9412infrastructure such as the existing hooks, the connection tracking system, the
9413userspace queueing component and the logging subsystem.")
9414 (license license:gpl2)))
9415
9416(define-public libnetfilter-conntrack
9417 (package
9418 (name "libnetfilter-conntrack")
9419 (version "1.0.9")
9420 (source
9421 (origin
9422 (method url-fetch)
9423 (uri (string-append "https://netfilter.org/projects/"
9424 "libnetfilter_conntrack/files/"
9425 "libnetfilter_conntrack-"
9426 version ".tar.bz2"))
9427 (sha256
9428 (base32 "1a3rnpsba64dzy97wwjrxal89wr0nf9znvag2j18nkp3kzs9vgb7"))))
9429 (build-system gnu-build-system)
9430 (native-inputs (list pkg-config))
9431 (inputs (list libnfnetlink libmnl))
9432 (synopsis "Library for kernel connection tracking state table")
9433 (description "libnetfilter_conntrack is a userspace library providing a
9434programming interface (API) to the in-kernel connection tracking state table.
9435The library libnetfilter_conntrack has been previously known as
9436libnfnetlink_conntrack and libctnetlink. This library is currently used by
9437conntrack-tools among many other applications.")
9438 (home-page "https://netfilter.org/projects/libnetfilter_conntrack/index.html")
9439 (supported-systems (filter target-linux? %supported-systems))
9440 (properties '((upstream-name . "libnetfilter_conntrack")))
9441 (license license:gpl2+)))
9442
9443(define-public libnetfilter-cttimeout
9444 (package
9445 (name "libnetfilter-cttimeout")
9446 (version "1.0.1")
9447 (source
9448 (origin
9449 (method url-fetch)
9450 (uri (string-append "https://netfilter.org/projects/"
9451 "libnetfilter_cttimeout/files/"
9452 "libnetfilter_cttimeout-" version ".tar.bz2"))
9453 (sha256
9454 (base32 "0983cpyvxyycbnzqlrzml80pph2z51r6s7sxp06ciq8468pxln8b"))))
9455 (build-system gnu-build-system)
9456 (native-inputs (list pkg-config))
9457 (inputs (list libmnl))
9458 (synopsis "Library for kernel connection tracking timeout infrastructure")
9459 (description "libnetfilter_cttimeout is the userspace library that
9460provides the programming interface to the fine-grain connection tracking
9461timeout infrastructure. With this library, you can create, update and delete
9462timeout policies that can be attached to traffic flows. This library is used
9463by conntrack-tools.")
9464 (home-page "https://netfilter.org/projects/libnetfilter_cttimeout/index.html")
9465 (supported-systems (filter target-linux? %supported-systems))
9466 (properties '((upstream-name . "libnetfilter_cttimeout")))
9467 (license license:gpl2)))
9468
9469(define-public libnetfilter-cthelper
9470 (package
9471 (name "libnetfilter-cthelper")
9472 (version "1.0.1")
9473 (source
9474 (origin
9475 (method url-fetch)
9476 (uri (string-append "https://netfilter.org/projects/"
9477 "libnetfilter_cthelper/files/"
9478 "libnetfilter_cthelper-" version ".tar.bz2"))
9479 (sha256
9480 (base32 "04n95ngil5l8m8v64dfjm1dwq0wd3kf4vw1zblsrff13hxa3s1ql"))))
9481 (build-system gnu-build-system)
9482 (native-inputs (list pkg-config))
9483 (inputs (list libmnl))
9484 (synopsis "Library for user-space connection tracking helpers")
9485 (description "libnetfilter_cthelper is a userspace library that provides a
9486programming interface to user-space connection tracking helpers.
9487@enumerate
9488@item
9489register new user-space connection tracking helpers
9490@item
9491unregister user-space connection tracking helpers
9492@item
9493list existing registered user-space connection tracking helpers
9494@end enumerate")
9495 (home-page "https://netfilter.org/projects/libnetfilter_cthelper/index.html")
9496 (supported-systems (filter target-linux? %supported-systems))
9497 (properties '((upstream-name . "libnetfilter_cthelper")))
9498 (license license:gpl2+)))
9499
9500(define-public libnetfilter-queue
9501 (package
9502 (name "libnetfilter-queue")
9503 (version "1.0.5")
9504 (source
9505 (origin
9506 (method url-fetch)
9507 (uri (string-append "https://netfilter.org/projects/"
9508 "libnetfilter_queue/files/"
9509 "libnetfilter_queue-" version ".tar.bz2"))
9510 (sha256
9511 (base32
9512 "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr"))))
9513 (build-system gnu-build-system)
9514 (native-inputs (list pkg-config))
9515 (inputs (list libmnl libnfnetlink))
9516 (synopsis "Library for kernel netfilter infrastructure and state")
9517 (description "libnetfilter_queue is a userspace library providing an API
9518to packets that have been queued by the kernel packet filter. It is is part
9519of a system that deprecates the old ip_queue/libipq mechanism.")
9520 (home-page "https://netfilter.org/projects/libnetfilter_queue/index.html")
9521 (supported-systems (filter target-linux? %supported-systems))
9522 (properties '((upstream-name . "libnetfilter_queue")))
9523 (license license:gpl2+)))
9524
9525(define-public conntrack-tools
9526 (package
9527 (name "conntrack-tools")
9528 (version "1.4.8")
9529 (source
9530 (origin
9531 (method url-fetch)
9532 (uri (string-append "https://netfilter.org/projects/"
9533 "conntrack-tools/files/"
9534 "conntrack-tools-" version ".tar.xz"))
9535 (sha256
9536 (base32 "1mnynl5a63j25arapwvkjbm3a2cqm3aaklwfwwclhmpnqps7fxh6"))))
9537 (build-system gnu-build-system)
9538 (native-inputs (list bison flex pkg-config))
9539 (inputs (list libtirpc
9540 libnetfilter-conntrack
9541 libnetfilter-cttimeout
9542 libnetfilter-cthelper
9543 libnetfilter-queue
9544 libnfnetlink
9545 libmnl))
9546 (synopsis "Set of tools targeting the conntrack kernel subsystem")
9547 (description "The tool conntrack provides a full featured interface that
9548is intended to replace the old @file{/proc/net/ip_conntrack} interface. Using
9549conntrack, you can view and manage the in-kernel connection tracking state
9550table from userspace. On the other hand, conntrackd covers the specific
9551aspects of stateful firewalls to enable highly available scenarios, and can be
9552used as statistics collector as well.
9553
9554Since 1.2.0, the conntrack-tools includes the @command{nfct} command line
9555utility. This utility only supports the nfnetlink_cttimeout by now. In the
9556long run, we expect that it will replace conntrack by providing a syntax
9557similar to nftables.")
9558 (home-page "https://netfilter.org/projects/conntrack-tools/index.html")
9559 (supported-systems (filter target-linux? %supported-systems))
9560 (license license:gpl2+)))
9561
9562(define-public libnetfilter-acct
9563 (package
9564 (name "libnetfilter-acct")
9565 (version "1.0.3")
9566 (source
9567 (origin
9568 (method url-fetch)
9569 (uri (string-append "https://netfilter.org/projects/"
9570 "libnetfilter_acct/files/"
9571 "libnetfilter_acct-" version ".tar.bz2"))
9572 (sha256
9573 (base32
9574 "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22"))))
9575 (build-system gnu-build-system)
9576 (native-inputs (list pkg-config))
9577 (inputs (list libmnl))
9578 (synopsis "Library providing interface to extended accounting infrastructure")
9579 (description "libnetfilter_acct is the userspace library providing interface
9580to extended accounting infrastructure.
9581
9582@enumerate
9583@item
9584creating accounting objects
9585@item
9586retrieving accounting objects (and atomically set to zero)
9587@item
9588deleting accounting objects
9589@end enumerate
9590For the nfnetlink_acct subsystem.")
9591 (home-page "https://netfilter.org/projects/libnetfilter_acct/index.html")
9592 (supported-systems (filter target-linux? %supported-systems))
9593 (properties '((upstream-name . "libnetfilter_acct")))
9594 (license license:lgpl2.1+)))
9595
9596(define-public nfacct
9597 (package
9598 (name "nfacct")
9599 (version "1.0.2")
9600 (source
9601 (origin
9602 (method url-fetch)
9603 (uri (string-append "https://netfilter.org/projects/" name
9604 "/files/nfacct-" version ".tar.bz2"))
9605 (sha256
9606 (base32
9607 "0sdxbxjyapbqcp2ami5jd10vz4xbbdvx39f3wfy1iqsbflc25zzc"))))
9608 (build-system gnu-build-system)
9609 (native-inputs (list pkg-config))
9610 (inputs (list libmnl libnetfilter-acct))
9611 (synopsis "Command line tool to create/retrieve/delete accounting objects")
9612 (description "nfacct is the command line tool to create/retrieve/delete
9613accounting objects
9614@enumerate
9615@item
9616listing the objects of the nfacct table in plain text/XML
9617@item
9618atomically get and reset objects of the nfacct table
9619@item
9620adding new objects to the nfacct table
9621@item
9622deleting objects from the nfacct table
9623@end enumerate")
9624 (home-page "https://netfilter.org/projects/nfacct/index.html")
9625 (supported-systems (filter target-linux? %supported-systems))
9626 (license license:gpl2+)))
9627
9628(define-public libnetfilter-log
9629 (package
9630 (name "libnetfilter-log")
9631 (version "1.0.2")
9632 (source
9633 (origin
9634 (method url-fetch)
9635 (uri (string-append "https://netfilter.org/projects/"
9636 "libnetfilter_log/files/"
9637 "libnetfilter_log-" version ".tar.bz2"))
9638 (sha256
9639 (base32
9640 "1spy9xs41v76kid5ana8n126f3mvgq6fjibbfbj4kn0larbhix73"))))
9641 (build-system gnu-build-system)
9642 (native-inputs (list pkg-config))
9643 (inputs (list libnfnetlink libmnl))
9644 (synopsis "Library providing interface to packets logged by netfilter")
9645 (description "libnetfilter_log is a userspace library providing interface to
9646packets that have been logged by the kernel packet filter. It is is part of a
9647system that deprecates the old syslog/dmesg based packet logging. This library
9648has been previously known as libnfnetlink_log.
9649
9650@enumerate
9651@item
9652receiving to-be-logged packets from the kernel nfnetlink_log subsystem
9653@end enumerate")
9654 (home-page "https://netfilter.org/projects/libnetfilter_log/index.html")
9655 (supported-systems (filter target-linux? %supported-systems))
9656 (properties '((upstream-name . "libnetfilter_log")))
9657 (license license:gpl2+)))
9658
9659(define-public ulogd
9660 (package
9661 (name "ulogd")
9662 (version "2.0.7")
9663 (source
9664 (origin
9665 (method url-fetch)
9666 (uri (string-append "https://netfilter.org/projects/" name
9667 "/files/ulogd-" version ".tar.bz2"))
9668 (sha256
9669 (base32
9670 "0ax9959c4bapq78n13bbaibcf1gwjir3ngx8l2dh45lw9m4ha2lr"))))
9671 (build-system gnu-build-system)
9672 (outputs '("out"
9673 ;; additional non-default output plugins
9674 "json" "pcap" "sqlite3" "pgsql" "mysql"))
9675 (native-inputs (list pkg-config))
9676 (inputs (list libnfnetlink
9677 libmnl
9678 libnetfilter-log
9679 libnetfilter-conntrack
9680 libnetfilter-acct
9681 sqlite
9682 libpcap
9683 jansson
9684 postgresql
9685 (list mariadb "dev")
9686 zlib
9687 openssl))
9688 (arguments
9689 (list #:configure-flags
9690 #~(list (string-append "--with-pgsql="
9691 (assoc-ref %build-inputs "postgresql"))
9692 (string-append "--with-mysql="
9693 (assoc-ref %build-inputs "mariadb")))
9694 #:phases
9695 #~(modify-phases %standard-phases
9696 (add-after 'install 'install-doc
9697 (lambda _
9698 (let ((out-etc (string-append #$output "/etc"))
9699 (ulogd.conf "ulogd.conf"))
9700 (mkdir-p out-etc)
9701 (copy-file ulogd.conf (string-append out-etc "/"
9702 ulogd.conf)))))
9703 (add-after 'install 'setup-plugin-outputs
9704 (lambda* (#:key outputs #:allow-other-keys)
9705 (with-directory-excursion
9706 (string-append #$output "/lib/ulogd/")
9707 (for-each
9708 (lambda (output-name)
9709 (let ((output-dir (string-append
9710 (assoc-ref outputs output-name)
9711 "/lib/ulogd/")))
9712 (mkdir-p output-dir)
9713 (for-each
9714 (lambda (plugin)
9715 (copy-file plugin (string-append output-dir plugin))
9716 (delete-file plugin))
9717 (find-files "."
9718 (string-append "ulogd_output_"
9719 (string-upcase output-name)
9720 ".*$")))))
9721 (list "json" "pcap" "sqlite3" "pgsql" "mysql"))))))))
9722 (synopsis "Logging daemon for netfilter and iptables")
9723 (description "ulogd is a userspace logging daemon for netfilter/iptables
9724related logging. This includes per-packet logging of security violations,
9725per-packet logging for accounting, per-flow logging and flexible user-defined
9726accounting.
9727
9728@enumerate
9729@item
9730Packet and flow-based traffic accounting
9731@item
9732Flexible user-defined traffic accounting via nfacct infrastructure
9733@item
9734SQL database back-end support: SQLite3, PostgreSQL, MySQL
9735@item
9736Text-based output formats: CSV, XML, Netfilter's LOG, Netfilter's conntrack
9737@end enumerate")
9738 (home-page "https://netfilter.org/projects/nfacct/index.html")
9739 (supported-systems (filter target-linux? %supported-systems))
9740 (license license:gpl2)))
9741
9742(define-public proot
9743 (package
9744 (name "proot")
9745 (version "5.4.0")
9746 (source
9747 (origin
9748 (method git-fetch)
9749 (uri (git-reference
9750 (url "https://github.com/proot-me/PRoot")
9751 (commit (string-append "v" version))))
9752 (file-name (git-file-name name version))
9753 (sha256
9754 (base32 "186qsg4yvisqjgf8w5jxhnlig7x341vpqwcgp8as3r59qmqkpmk7"))
9755 ;; Waiting for upstream inclusion at
9756 ;; https://github.com/proot-me/proot/pull/355
9757 (patches (search-patches "proot-add-clone3.patch"
9758 "proot-add-missing-include.patch"))))
9759 (build-system gnu-build-system)
9760 ;; Many architectures are not supported (see:
9761 ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
9762 (supported-systems '("x86_64-linux" "i686-linux"
9763 "armhf-linux" "aarch64-linux" "i586-gnu" "x86_64-gnu"))
9764 (arguments
9765 ;; Disable the test suite on armhf-linux, as there are too many
9766 ;; failures to keep track of (see for example:
9767 ;; https://github.com/proot-me/proot/issues/286).
9768 `(#:tests? ,(not (or (%current-target-system)
9769 (string-prefix? "armhf"
9770 (or (%current-system)))))
9771 #:make-flags '("-C" "src")
9772 #:phases (modify-phases %standard-phases
9773 (add-after 'unpack 'patch-sources
9774 (lambda* (#:key inputs #:allow-other-keys)
9775 (substitute* (find-files "src" "\\.[ch]$")
9776 (("\"/bin/sh\"")
9777 (string-append "\"" (assoc-ref inputs "bash")
9778 "/bin/sh\"")))
9779
9780 (substitute* "src/GNUmakefile"
9781 (("/bin/echo") (which "echo"))
9782 (("^VERSION = .*")
9783 (string-append "VERSION := " ,version "\n")))
9784
9785 (substitute* (find-files "test" "\\.sh$")
9786 ;; Some of the tests try to "bind-mount" /bin/true.
9787 (("-b /bin/true:")
9788 (string-append "-b " (which "true") ":"))
9789 ;; Likewise for /bin.
9790 (("-b /bin:") "-b /gnu:")
9791 ;; Others try to run /bin/sh.
9792 (("/bin/sh") (which "sh"))
9793 ;; Others assume /etc/fstab exists.
9794 (("/etc/fstab") "/etc/passwd"))
9795 (substitute* "test/GNUmakefile"
9796 (("-b /bin:") "-b /gnu:"))
9797 (substitute* "test/test-c6b77b77.mk"
9798 (("/bin/bash") (which "bash"))
9799 (("/usr/bin/test") (which "test")))
9800 (substitute* "test/test-16573e73.c"
9801 (("/bin/([a-z-]+)" _ program)
9802 (which program)))
9803 (substitute* "test/test-5467b986.sh"
9804 (("-w /usr") "-w /gnu")
9805 (("-w usr") "-w gnu")
9806 (("/usr/share") "/gnu/store")
9807 (("share") "store"))
9808 (substitute* "test/test-092c5e26.sh"
9809 (("-q echo ")
9810 "-q $(which echo) "))
9811
9812 ;; The socket tests requires networking.
9813 (for-each delete-file
9814 (find-files "test" "test-socket.*\\.sh$"))))
9815 (delete 'configure)
9816 (add-after 'build 'build-manpage
9817 (lambda _
9818 (with-directory-excursion "doc"
9819 (invoke "make" "proot/man.1" "SUFFIX=.py"))))
9820 (replace 'check
9821 (lambda* (#:key tests? #:allow-other-keys)
9822 (when tests?
9823 (let ((n (parallel-job-count)))
9824 ;; Most of the tests expect "/bin" to be in $PATH so
9825 ;; they can run things that live in $ROOTFS/bin.
9826 (setenv "PATH"
9827 (string-append (getenv "PATH") ":/bin"))
9828 (invoke "make" "check" "-C" "test"
9829 ;;"V=1"
9830 "-j" (number->string n))))))
9831 (replace 'install
9832 (lambda* (#:key outputs #:allow-other-keys)
9833 ;; The 'install' rule does nearly nothing.
9834 (let* ((out (assoc-ref outputs "out"))
9835 (man1 (string-append out "/share/man/man1")))
9836 ;; TODO: 'make install-care' (does not even
9837 ;; build currently.)
9838 (invoke "make" "-C" "src" "install"
9839 (string-append "PREFIX=" out))
9840 (mkdir-p man1)
9841 (copy-file "doc/proot/man.1"
9842 (string-append man1 "/proot.1"))))))))
9843 (native-inputs (list which
9844 ;; For 'mcookie', used by some of the tests.
9845 util-linux
9846 coreutils
9847 pkg-config
9848 ;; For rst2man, used to generate the manual page.
9849 python-docutils-0.19))
9850 (inputs (list libarchive talloc))
9851 (home-page "https://github.com/proot-me/PRoot")
9852 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
9853 (description
9854 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
9855and @code{binfmt_misc}. This means that users don't need any privileges or
9856setup to do things like using an arbitrary directory as the new root
9857file system, making files accessible somewhere else in the file system
9858hierarchy, or executing programs built for another CPU architecture
9859transparently through QEMU user-mode. Also, developers can use PRoot as a
9860generic process instrumentation engine thanks to its extension mechanism.
9861Technically PRoot relies on @code{ptrace}, an unprivileged system-call
9862available in the kernel Linux.")
9863 (license license:gpl2+)))
9864
9865(define-public proot-static
9866 (package
9867 (inherit proot)
9868 (name "proot-static")
9869 (synopsis
9870 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
9871 (inputs `(("talloc" ,talloc/static)))
9872 (arguments
9873 (substitute-keyword-arguments (package-arguments proot)
9874 ((#:make-flags flags)
9875 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
9876 ((#:phases phases)
9877 `(modify-phases ,phases
9878 (add-after 'strip 'remove-store-references
9879 (lambda* (#:key outputs #:allow-other-keys)
9880 (let* ((out (assoc-ref outputs "out")))
9881 (with-directory-excursion out
9882 (remove-store-references "bin/proot")
9883 #t))))))
9884 ((#:allowed-references _ '("out"))
9885 '("out"))))))
9886
9887(define-public cpuid
9888 (package
9889 (name "cpuid")
9890 (version "20260220")
9891 (source (origin
9892 (method url-fetch)
9893 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
9894 version ".src.tar.gz"))
9895 (sha256
9896 (base32
9897 "1ywg1fzbk153sil3n0mdrah3728j76dbjj8c24gig4g5bbbhyqp7"))))
9898 (build-system gnu-build-system)
9899 (arguments
9900 (list #:make-flags
9901 #~(list (string-append "CC=" #$(cc-for-target)))
9902 #:tests? #f ; no tests
9903 #:phases
9904 #~(modify-phases %standard-phases
9905 (delete 'configure) ; no configure script
9906 (add-before 'install 'fix-makefile
9907 (lambda* (#:key outputs #:allow-other-keys)
9908 (substitute* "Makefile"
9909 (("\\$\\(BUILDROOT\\)/usr")
9910 (assoc-ref outputs "out"))))))))
9911 (inputs (list perl))
9912 (supported-systems '("i686-linux" "x86_64-linux"))
9913 (home-page "https://www.etallen.com/cpuid.html")
9914 (synopsis "Dump x86 CPUID processor information")
9915 (description "cpuid dumps detailed information about the CPU(s) gathered
9916from the CPUID instruction, and also determines the exact model of CPU(s). It
9917supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
9918NexGen, Rise, and SiS CPUs.")
9919 (license license:gpl2+)))
9920
9921(define-public jmtpfs
9922 (package
9923 (name "jmtpfs")
9924 (version "0.5")
9925 (source
9926 (origin
9927 (method git-fetch)
9928 (uri (git-reference
9929 (url "https://github.com/JasonFerrara/jmtpfs")
9930 (commit (string-append "v" version))))
9931 (file-name (git-file-name name version))
9932 (sha256
9933 (base32
9934 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
9935 (build-system gnu-build-system)
9936 (inputs
9937 (list file fuse-2 libmtp))
9938 (native-inputs
9939 (list pkg-config))
9940 (home-page "https://github.com/JasonFerrara/jmtpfs")
9941 (synopsis "Use a FUSE file system to access data over MTP")
9942 (description "jmtpfs uses @acronym{FUSE, File system in USEr space} to
9943provide access to data over @acronym{MTP, the Media Transfer Protocol}.
9944Unprivileged users can mount the MTP device as a file system.")
9945 (license license:gpl3)))
9946
9947(define-public procenv
9948 (package
9949 (name "procenv")
9950 (version "0.60")
9951 (source
9952 (origin
9953 (method git-fetch)
9954 (uri (git-reference
9955 (url "https://github.com/jamesodhunt/procenv")
9956 (commit version)))
9957 (file-name (git-file-name name version))
9958 (sha256
9959 (base32 "00d7q0h4qjc8lg435lq77lp2fx6ikm5piq90m81mr1dqqna1g6pz"))))
9960 (build-system gnu-build-system)
9961 (native-inputs
9962 (list pkg-config
9963 ;; For tests.
9964 check groff))
9965 (inputs
9966 (list expat libcap libselinux))
9967 (synopsis "Utility to show process environment")
9968 (description
9969 "Procenv is a command-line tool that displays as much detail about
9970itself and its environment as possible. It can be used as a test
9971tool, to understand the type of environment a process runs in, and for
9972comparing system environments.")
9973 (home-page "https://github.com/jamesodhunt/procenv/")
9974 (license license:gpl3+)))
9975
9976(define-public cassini-headers
9977 (package
9978 (name "cassini-headers")
9979 (version "12.0.1")
9980 (home-page "https://github.com/HewlettPackard/shs-cassini-headers")
9981 (source (origin
9982 (method git-fetch)
9983 (uri (git-reference
9984 (url home-page)
9985 (commit (string-append "release/shs-" version))))
9986 (file-name (git-file-name name version))
9987 (sha256
9988 (base32
9989 "0fvhk42pssw67zba4zq1b73d1m9ysc4g8sfibjmmhc0fwr92iamp"))))
9990 (build-system copy-build-system)
9991 (arguments
9992 (list #:install-plan
9993 #~'(("include" "include")
9994 ("share/cassini-headers" "share/cassini-headers"))))
9995 (synopsis "Cassini network hardware definitions and headers")
9996 (description
9997 "This package provides hardware definitions and C headers for use by
9998the Linux driver and by user-space applications for the Cassini/Slingshot
9999high-speed network interconnect made by HPE (formerly Cray). User-land
10000software uses @file{cxi_prov_hw.h} from this package.")
10001 ;; As per include/cxi_prov_hw.h it is __aarch64__ or __x86_64__ only.
10002 (supported-systems '("x86_64-linux" "aarch64-linux"))
10003 (license (list license:gpl2 license:bsd-2)))) ;dual-licensed
10004
10005(define-public cxi-driver
10006 (package
10007 (name "cxi-driver")
10008 (version "13.0.0")
10009 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10010 (source
10011 (origin
10012 (method git-fetch)
10013 (uri (git-reference
10014 (url home-page)
10015 (commit (string-append "release/shs-" version))))
10016 (file-name (git-file-name name version))
10017 (sha256
10018 (base32
10019 "1md6ammah7ywk5k9gsxix945w5498hpdfwzr603aiirlz2x4m4wh"))))
10020 ;; TODO: Actually build the Linux driver.
10021 (build-system copy-build-system)
10022 (arguments
10023 (list #:install-plan #~'(("include" "include"))))
10024 (propagated-inputs (list cassini-headers))
10025 (synopsis "Linux driver for the Cassini/Slingshot interconnect")
10026 (description
10027 "This is the Linux driver for the Cray/HPE Cassini 1 and 2 high-speed
10028network interconnect (aka. Slingshot), and its Ethernet driver. It includes
10029the @file{uapi/misc/cxi.h} C header file for use by user-land software.
10030
10031Currently the Linux driver itself is missing from this package.")
10032 (license license:gpl2+)))
10033
10034(define-public cxi-driver-for-libfabric-1
10035 ;; This old version defines constants such as 'CXI_MAP_IOVA_ALLOC' that
10036 ;; libfabric 1.22.0 relies on.
10037 (let ((commit "5f0ec0ead6ef3f98542a2ef5e76b89d14dd22150")
10038 (revision "0"))
10039 (package
10040 (inherit cxi-driver)
10041 (name "cxi-driver")
10042 (version (git-version "1.0.0" ;per .spec file
10043 revision commit))
10044 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10045 (source
10046 (origin
10047 (method git-fetch)
10048 (uri (git-reference (url home-page) (commit commit)))
10049 (file-name (git-file-name name version))
10050 (sha256
10051 (base32
10052 "19cly014ihgdidrc1aki2xsbfhpc0g73v0vxcky8r27xza7rz5bg")))))))
10053
10054(define-public libcxi
10055 (package
10056 (name "libcxi")
10057 (version "13.0.0")
10058 (home-page "https://github.com/HewlettPackard/shs-libcxi")
10059 (source
10060 (origin
10061 (method git-fetch)
10062 (uri (git-reference (url home-page)
10063 (commit (string-append "release/shs-" version))))
10064 (file-name (git-file-name name version))
10065 (sha256
10066 (base32 "1m8mds1h8plhfn2ja9br31xaiy82ky69685cp1rznanl18inaiff"))))
10067 (build-system gnu-build-system)
10068 (arguments
10069 (list #:configure-flags
10070 #~(list "--disable-static"
10071 (string-append "--with-udevrulesdir="
10072 #$output "/lib/udev/rules.d"))
10073
10074 #:phases
10075 #~(modify-phases %standard-phases
10076 (add-before 'configure 'set-cassini-file-names
10077 (lambda* (#:key inputs #:allow-other-keys)
10078 (substitute* "utils/cxi_dump_csrs.py"
10079 (("/usr/share/cassini-headers/csr_defs.json")
10080 (search-input-file
10081 inputs
10082 "/share/cassini-headers/csr_defs.json"))))))))
10083 (native-inputs (list autoconf
10084 automake
10085 libtool
10086 pkg-config
10087 python-wrapper))
10088 (inputs (list libconfig
10089 libuv
10090 fuse-2
10091 libyaml
10092 libnl
10093 numactl
10094 eudev
10095 (list lm-sensors "lib")))
10096 (propagated-inputs (list cassini-headers cxi-driver))
10097 (synopsis "Interface to the Cassini/Slingshot high-speed interconnect")
10098 (description
10099 "Libcxi provides applications with a low-level interface to the
10100Cray/HPE Cassini high-speed @acronym{NIC, network interface controller}, also
10101known as Slingshot.")
10102
10103 ;; License is spelled out in 'cray-libcxi.spec' and in source file
10104 ;; headers.
10105 (license (list license:lgpl2.1+ license:bsd-3)))) ;dual-licensed
10106
10107(define-public libfabric
10108 (package
10109 (name "libfabric")
10110 (version "2.3.1")
10111 (source
10112 (origin
10113 (method url-fetch)
10114 (uri
10115 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
10116 version "/libfabric-" version ".tar.bz2"))
10117 (sha256
10118 (base32 "0npkfkkhyir31r2p1zsfi7yrvcam60fp8ps4s2csjc2drqbrz4rf"))))
10119 (build-system gnu-build-system)
10120 (inputs
10121 (let ((if-supported ;XXX: modified from openmpi
10122 (lambda (package . extra)
10123 (if (and (not (%current-target-system))
10124 (member (%current-system)
10125 (package-transitive-supported-systems package)))
10126 (cons package extra)
10127 '()))))
10128 (append (list rdma-core libnl)
10129 (if-supported psm)
10130 (if-supported psm2)
10131 (if-supported libcxi curl json-c))))
10132 (arguments
10133 (list #:configure-flags
10134 #~(append (if #$(target-64bit?)
10135 (list "--enable-efa")
10136 '())
10137 (list #$@(if (this-package-input "libcxi")
10138 #~("--enable-cxi")
10139 #~())
10140 "--enable-verbs"))
10141 #:phases
10142 #~(modify-phases %standard-phases
10143 (add-after 'install 'remove-libtool-archive
10144 (lambda _
10145 ;; 'libfabric.la' has '-ljson-c' without a corresponding
10146 ;; '-L' in 'dependency_libs', which in turn causes users
10147 ;; such as Open MPI to fail at link time due to '-ljson-c'
10148 ;; not being found, even when building a shared library.
10149 ;; So, remove the .la file.
10150 (delete-file
10151 (string-append #$output
10152 "/lib/libfabric.la")))))))
10153 (home-page "https://ofiwg.github.io/libfabric/")
10154 (synopsis "Open Fabric Interfaces")
10155 (description
10156 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
10157communication services to applications. OFI is best described as a collection
10158of libraries and applications used to export fabric services. The key
10159components of OFI are: application interfaces, provider libraries, kernel
10160services, daemons, and test applications.
10161
10162Libfabric is a core component of OFI. It is the library that defines and
10163exports the user-space API of OFI, and is typically the only software that
10164applications deal with directly. It works in conjunction with provider
10165libraries, which are often integrated directly into libfabric.")
10166 (license (list license:bsd-2 license:gpl2)))) ;dual
10167
10168(define-public libfabric-1 ;needed by Open MPI 4.x
10169 (package
10170 (inherit libfabric)
10171 (version "1.22.0")
10172 (source
10173 (origin
10174 (method url-fetch)
10175 (uri
10176 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
10177 version "/libfabric-" version ".tar.bz2"))
10178 (sha256
10179 (base32 "1znmw83rmippv0fwz0x7lgylfk17dr9ckll8lrm4z7kclspnqpj8"))))
10180 (inputs
10181 (modify-inputs (package-inputs libfabric)
10182 (append cxi-driver-for-libfabric-1)))))
10183
10184(define-public psm
10185 (package
10186 (name "psm")
10187 (version "3.3.20170428")
10188 (home-page "https://github.com/intel/psm")
10189 (source
10190 (origin
10191 (method git-fetch)
10192 (uri (git-reference (url home-page)
10193 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
10194 (file-name (string-append "psm-" version ".tar.gz"))
10195 (sha256
10196 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
10197 (patches (search-patches
10198 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
10199 "psm-ldflags.patch" ; build shared lib with LDFLAGS
10200 "psm-repro.patch" ; reproducibility
10201 "psm-disable-memory-stats.patch"))
10202 (modules '((guix build utils)))
10203 (snippet
10204 ;; That file declares its own 'strlcat' as static. To avoid a
10205 ;; conflict with the function now in glibc 2.39, give it a
10206 ;; different name.
10207 #~(substitute* "ptl_ips/ips_proto_dump.c"
10208 (("strlcat")
10209 "psm_custom_strlcat")))))
10210 (build-system gnu-build-system)
10211 (outputs '("out" "debug"))
10212 (inputs `(("libuuid" ,util-linux "lib")))
10213 (arguments
10214 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
10215 ,(string-append "INSTALL_PREFIX=" %output)
10216 ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
10217 " -funwind-tables -O3 -g3"
10218 " -DPSM_USE_SYS_UUID"
10219 " -Wno-strict-aliasing -DNVALGRIND"
10220 " -fcommon")
10221 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
10222 #:tests? #f
10223 #:phases (modify-phases %standard-phases
10224 (delete 'configure)
10225 (add-after 'unpack 'patch-/usr/include
10226 (lambda _
10227 (substitute* "Makefile"
10228 (("\\$\\{DESTDIR}/usr/include")
10229 (string-append %output "/include")))
10230 (substitute* "Makefile"
10231 (("/lib64") "/lib"))
10232 #t))
10233 (add-after 'unpack 'patch-sysmacros
10234 (lambda _
10235 (substitute* "ipath/ipath_proto.c"
10236 (("#include <sys/poll.h>" m)
10237 (string-append m "\n"
10238 "#include <sys/sysmacros.h>")))
10239 #t)))))
10240 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
10241 (description
10242 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
10243communications interface for the True Scale family of products. PSM users are
10244enabled with mechanisms necessary to implement higher level communications
10245interfaces in parallel environments.")
10246 ;; Only Intel-compatible processors are supported.
10247 (supported-systems '("i686-linux" "x86_64-linux"))
10248 (license (list license:bsd-2 license:gpl2)))) ;dual
10249
10250(define-public snapscreenshot
10251 (package
10252 (name "snapscreenshot")
10253 (version "1.0.14.3")
10254 (source
10255 (origin
10256 (method url-fetch)
10257 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
10258 name "-" version ".tar.bz2"))
10259 (sha256
10260 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
10261 (build-system gnu-build-system)
10262 (arguments
10263 `(#:make-flags
10264 (let ((out (assoc-ref %outputs "out")))
10265 (list (string-append "BINDIR=" out "/bin")
10266 (string-append "MANDIR=" out "/share/man")))
10267 #:tests? #f ; no test suite
10268 #:phases
10269 (modify-phases %standard-phases
10270 (delete 'configure) ; ./configure is a snarky no-op
10271 (add-before 'install 'fix-ownership
10272 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
10273 (lambda _
10274 (substitute* "depfun.mak"
10275 ((" -o bin -g bin ") " "))
10276 #t))
10277 (add-before 'install 'create-output-directories
10278 (lambda* (#:key outputs #:allow-other-keys)
10279 (let ((out (assoc-ref outputs "out")))
10280 (mkdir-p (string-append out "/share/man/man1"))
10281 #t))))))
10282 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
10283 (synopsis "Take screenshots of one or more Linux text consoles")
10284 (description
10285 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
10286Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
10287relevant @file{/dev/vcs*} file(s).")
10288 (license license:gpl2)))
10289
10290(define-public fbcat
10291 (package
10292 (name "fbcat")
10293 (version "0.5.2")
10294 (source
10295 (origin
10296 (method url-fetch)
10297 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
10298 version "/" name "-" version ".tar.gz"))
10299 (sha256
10300 (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
10301 (build-system gnu-build-system)
10302 (inputs
10303 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
10304 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
10305 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
10306 `(("pnmtopng" ,netpbm)))
10307 (outputs (list "out" "fbgrab"))
10308 (arguments
10309 `(#:make-flags
10310 (list "CC=gcc"
10311 (string-append "PREFIX=" (assoc-ref %outputs "out")))
10312 #:tests? #f ; no tests
10313 #:phases
10314 (modify-phases %standard-phases
10315 (delete 'configure) ; no configure script
10316 (add-after 'build 'qualify-references
10317 (lambda* (#:key inputs outputs #:allow-other-keys)
10318 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
10319 (out (assoc-ref outputs "out")))
10320 (substitute* "fbgrab"
10321 (("fbcat" all)
10322 (string-append out "/bin/" all))
10323 (("pnmtopng" all)
10324 (string-append pnmtopng "/bin/" all))))))
10325 (add-after 'install 'split-fbgrab-output
10326 (lambda* (#:key outputs #:allow-other-keys)
10327 (let* ((out (assoc-ref outputs "out"))
10328 (out:fbgrab (assoc-ref outputs "fbgrab")))
10329 (for-each (lambda (file)
10330 (let ((old (string-append out "/" file))
10331 (new (string-append out:fbgrab "/" file)))
10332 (mkdir-p (dirname new))
10333 (rename-file old new)))
10334 (list "bin/fbgrab"
10335 "share/man/man1/fbgrab.1"))))))))
10336 (home-page "https://jwilk.net/software/fbcat")
10337 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
10338 (description
10339 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
10340a dump thereof. It supports a wide range of drivers and pixel formats.
10341
10342@command{fbcat} can take screenshots of virtually any application that can be
10343made to write its output to the framebuffer, including (but not limited to)
10344text-mode or graphical applications that don't use a display server.
10345
10346Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
10347emulates the behaviour of Gunnar Monell's older fbgrab utility.")
10348 (license license:gpl2)))
10349
10350(define-public fbgrab
10351 (package
10352 (name "fbgrab")
10353 (version "1.5")
10354 (source (origin
10355 (method git-fetch)
10356 (uri (git-reference
10357 (url "https://github.com/GunnarMonell/fbgrab")
10358 (commit version)))
10359 (file-name (git-file-name name version))
10360 (sha256
10361 (base32
10362 "1npn7l8jg0nhjraybjl38v8635zawzmn06ql3hs3vhci1vi1r90r"))))
10363 (build-system gnu-build-system)
10364 (arguments
10365 (list #:tests? #f ;no test suite
10366 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
10367 (string-append "DESTDIR=" #$output))
10368 #:phases #~(modify-phases %standard-phases
10369 (add-after 'unpack 'strip-/usr-prefix
10370 (lambda _
10371 (substitute* "Makefile"
10372 (("/usr") ""))))
10373 (delete 'configure))))
10374 (inputs (list libpng zlib))
10375 (home-page "https://github.com/GunnarMonell/fbgrab")
10376 (synopsis "Linux framebuffer screenshot/conversion utility")
10377 (description "FBGrab is a framebuffer screenshot program that captures the
10378Linux framebuffer and converts it to a PNG image. It can also convert a
10379framebuffer dump file (copy) to a PNG image.")
10380 (license license:gpl2))) ;GPL 2.0 only (per SPDX identifier in fbgrab.c)
10381
10382(define-public libcgroup
10383 (package
10384 (name "libcgroup")
10385 (version "3.2.0")
10386 (home-page "https://github.com/libcgroup/libcgroup")
10387 (source
10388 (origin
10389 (method url-fetch)
10390 (uri (string-append
10391 "https://github.com/libcgroup/libcgroup/releases/download/v"
10392 version "/" name "-" version ".tar.gz"))
10393 (sha256
10394 (base32 "1zmxhqp8kj2n7yvj82nsy5sx07yrxj4r37w41lz5q8bpqgbc43ws"))))
10395 (build-system gnu-build-system)
10396 (arguments
10397 ;; Tests are virtualized with lxc, it is not very feasible
10398 ;; to make them executable under guix build. Also, note that
10399 ;; origin is using source tarball release which is prepared
10400 ;; after testing.
10401 (list #:tests? #f
10402 #:configure-flags
10403 #~'("--disable-systemd")))
10404 (native-inputs
10405 (list bison flex))
10406 (inputs
10407 (list linux-pam))
10408 (synopsis "Control groups management tools")
10409 (description "Control groups is Linux kernel method for process resource
10410restriction, permission handling and more. This package provides userspace
10411interface to this kernel feature.")
10412 (license license:lgpl2.1)))
10413
10414(define-public mbpfan
10415 (package
10416 (name "mbpfan")
10417 (version "2.4.0")
10418 (source
10419 (origin
10420 (method git-fetch)
10421 (uri (git-reference
10422 (url "https://github.com/dgraziotin/mbpfan")
10423 (commit (string-append "v" version))))
10424 (file-name (git-file-name name version))
10425 (sha256
10426 (base32 "146sshsjafi26n741jvi9mdbazwf74jlacxfwkky4fhbq98idlhp"))))
10427 (build-system gnu-build-system)
10428 (arguments
10429 (list #:tests? #f ; tests ask to be run as root
10430 #:make-flags
10431 #~(list (string-append "DESTDIR=" #$output)
10432 (string-append "CC=" #$(cc-for-target)))
10433 #:phases
10434 #~(modify-phases %standard-phases
10435 (add-after 'unpack 'patch-paths
10436 (lambda _
10437 (substitute* "Makefile"
10438 (("/usr") ""))))
10439 (delete 'configure)))) ; there's no configure phase
10440 (home-page "https://github.com/dgraziotin/mbpfan")
10441 (synopsis "Control fan speed on Macbooks")
10442 (description
10443 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
10444the @code{coretemp} module and sets the fan speed using the @code{applesmc}
10445module. It can be executed as a daemon or in the foreground with root
10446privileges.")
10447 (license license:gpl3+)))
10448
10449(define-public psm2
10450 (package
10451 (name "psm2")
10452 (version "12.0")
10453 (source (origin
10454 (method git-fetch)
10455 (uri (git-reference
10456 (url "https://github.com/intel/opa-psm2")
10457 ;; tag 'psm-v12.0' = commit ad5dd1b
10458 (commit (string-append "psm-v" version))))
10459 (file-name (git-file-name name version))
10460 (sha256
10461 (base32
10462 "04nar65ac11qqx41vkfs7iip8kfiah0zms7l4rmsxncpiz2iqfik"))
10463 (patches
10464 (search-patches
10465 "psm2-compile-ctor-without-avx.patch"))
10466 (modules '((guix build utils)))
10467 (snippet
10468 ;; That file declares its own 'strlcat' as static. To avoid a
10469 ;; conflict with the function now in glibc 2.39, give it a
10470 ;; different name.
10471 #~(substitute* "ptl_ips/ips_proto_dump.c"
10472 (("strlcat")
10473 "psm2_custom_strlcat")))))
10474 (build-system gnu-build-system)
10475 (arguments
10476 (list #:make-flags
10477 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
10478 #:tests? #f
10479 #:phases #~(modify-phases %standard-phases
10480 (delete 'configure)
10481 (add-after 'unpack 'patch-Makefiles
10482 (lambda _
10483 (substitute* "Makefile"
10484 (("/lib64") "/lib")
10485 (("/usr") ""))
10486 (substitute* "compat/Makefile"
10487 (("/lib64") "/lib")
10488 (("/usr") ""))))
10489 (replace 'install
10490 (lambda _
10491 (setenv "DESTDIR" #$output)
10492 (invoke "make" "install"))))))
10493 (inputs
10494 (list rdma-core numactl))
10495 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
10496 (description
10497 "This package is low-level user-level Intel's communications interface.
10498The PSM2 API is a high-performance vendor-specific protocol that provides a
10499low-level communications interface for the Intel Omni-Path family of
10500high-speed networking devices.")
10501 (home-page "https://github.com/intel/opa-psm2")
10502 ;; Only the x86_64 architecture is supported.
10503 (supported-systems '("x86_64-linux"))
10504 (license (list license:bsd-3 license:gpl2)))) ; dual
10505
10506(define-public libpfm4
10507 (package
10508 (name "libpfm4")
10509 (version "4.9.0")
10510 (source (origin
10511 (method url-fetch)
10512 (uri (string-append "mirror://sourceforge/perfmon2/"
10513 name "/libpfm-" version ".tar.gz"))
10514 (sha256
10515 (base32
10516 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
10517 (build-system gnu-build-system)
10518 (arguments
10519 '(#:modules ((guix build utils)
10520 (guix build gnu-build-system))
10521 #:phases (modify-phases %standard-phases
10522 (delete 'configure)
10523 (delete 'check)
10524 (replace 'build
10525 (lambda* (#:key inputs outputs #:allow-other-keys)
10526 (let* ((out (assoc-ref outputs "out")))
10527 (setenv "CC" "gcc")
10528 (setenv "CFLAGS" "-Wno-format-truncation")
10529 (invoke "make")
10530 #t)))
10531 (replace 'install
10532 (lambda* (#:key outputs #:allow-other-keys)
10533 (let* ((out (assoc-ref outputs "out")))
10534 (invoke "make"
10535 (string-append "PREFIX=" out)
10536 "install")
10537 #t))))))
10538 (synopsis "Performance event monitoring library")
10539 (description
10540 "This package provides a library called libpfm4, which is used to develop
10541monitoring tools exploiting the performance monitoring events such as those
10542provided by the Performance Monitoring Unit (PMU) of modern processors.
10543
10544Libpfm4 helps convert from an event name, expressed as a string, to the event
10545encoding that is either the raw event as documented by the hardware vendor or
10546the OS-specific encoding. In the latter case, the library is able to prepare
10547the OS-specific data structures needed by the kernel to setup the event.
10548
10549libpfm4 provides support for the @code{perf_events} interface, which was
10550introduced in Linux 2.6.31.")
10551 (home-page "https://perfmon2.sourceforge.net/")
10552 (license license:expat)))
10553
10554(define-public libnfnetlink
10555 (package
10556 (name "libnfnetlink")
10557 (version "1.0.2")
10558 (source (origin
10559 (method url-fetch)
10560 (uri (string-append
10561 "https://www.netfilter.org/projects/libnfnetlink/files/"
10562 "libnfnetlink-" version ".tar.bz2"))
10563 (sha256
10564 (base32
10565 "0xn3rcrzxr6g82kfxzs9bqn2zvl2kf2yda30drwb9vr6sk1wfr5h"))))
10566 (build-system gnu-build-system)
10567 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
10568 (synopsis "Low-level netfilter netlink communication library")
10569 (description
10570 "@code{libnfnetlink} is the low-level library for netfilter related
10571kernel/userspace communication. It provides a generic messaging
10572infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
10573nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
10574management tools in userspace.")
10575 (license license:gpl2)))
10576
10577(define-public libinih
10578 (package
10579 (name "libinih")
10580 (version "57")
10581 (source (origin
10582 (method git-fetch)
10583 (uri (git-reference
10584 (url "https://github.com/benhoyt/inih")
10585 (commit (string-append "r" version))))
10586 (file-name (git-file-name name version))
10587 (sha256
10588 (base32
10589 "03hpyahdkipm5wfalj2xkz6y9ncd9zrlhnf7vap6lr56jj2fz2bb"))))
10590 (build-system meson-build-system)
10591 ;; Install static libraries for use by the initrd's xfsprogs/static.
10592 (outputs (list "out" "static"))
10593 (arguments
10594 `(#:configure-flags
10595 (list "-Ddistro_install=true"
10596 "-Ddefault_library=both")
10597 #:phases
10598 (modify-phases %standard-phases
10599 (add-after 'install 'separate-static
10600 (lambda* (#:key outputs #:allow-other-keys)
10601 (let ((out (assoc-ref outputs "out"))
10602 (static (assoc-ref outputs "static")))
10603 (with-directory-excursion out
10604 (for-each (lambda (source)
10605 (let ((target (string-append static "/" source)))
10606 (mkdir-p (dirname target))
10607 (rename-file source target)))
10608 (find-files "lib" "\\.a$")))))))))
10609 (home-page "https://github.com/benhoyt/inih")
10610 (synopsis "Simple .INI parser library for C")
10611 (description "The inih (INI Not Invented Here) library is a simple .INI file
10612parser written in C. It's only a couple of pages of code, and it was designed to
10613be small and simple, so it's good for embedded systems. It's also more or less
10614compatible with Python's ConfigParser style of .INI files, including RFC
10615822-style multi-line syntax and name: value entries.")
10616 (license license:bsd-3)))
10617
10618(define-public simpleini
10619 (let ((commit "6048871ea9ee0ec24be5bd099d161a10567d7dc2")
10620 (revision "1"))
10621 (package
10622 (name "simpleini")
10623 (version (git-version "4.22" revision commit))
10624 (source (origin
10625 (method git-fetch)
10626 (uri (git-reference
10627 (url "https://github.com/brofield/simpleini")
10628 (commit commit)))
10629 (file-name (git-file-name name version))
10630 (sha256
10631 (base32
10632 "1szaflnrzw1zx9v5g6mbbiaf9wfglp4n4jjq2793k9ryz3qxil9j"))))
10633 (build-system cmake-build-system)
10634 (arguments
10635 (list #:configure-flags #~(list "-DSIMPLEINI_USE_SYSTEM_GTEST=ON")))
10636 (native-inputs (list googletest))
10637 (home-page "https://github.com/brofield/simpleini")
10638 (synopsis "Simple API to read and write INI-style files")
10639 (description
10640 "SimpleIni provides a simple API to read and write INI-style
10641configuration files. It supports data files in ASCII, MBCS and Unicode.")
10642 (license license:expat))))
10643
10644(define-public xfsprogs
10645 (package
10646 (name "xfsprogs")
10647 (version "6.12.0")
10648 (source (origin
10649 (method url-fetch)
10650 (uri (string-append
10651 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
10652 "xfsprogs-" version ".tar.gz"))
10653 (sha256
10654 (base32
10655 "1n46n27fxx1137kni3drrhzhp1l8ksxabcsmi8yzxbhpbnl4q293"))))
10656 (build-system gnu-build-system)
10657 (outputs (list "out" "python"))
10658 (arguments
10659 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
10660 #:configure-flags
10661 (list "--disable-static")
10662 #:make-flags
10663 (list "V=1")
10664 #:phases
10665 (modify-phases %standard-phases
10666 (add-after 'install 'separate-python-output
10667 (lambda* (#:key outputs #:allow-other-keys)
10668 (let ((out (assoc-ref outputs "out"))
10669 (python (assoc-ref outputs "python")))
10670 (for-each
10671 (lambda (script)
10672 (mkdir-p (string-append python (dirname script)))
10673 (rename-file (string-append out script)
10674 (string-append python script)))
10675 (list "/sbin/xfs_scrub_all")))))
10676 (add-after 'install 'install-headers
10677 (lambda* (#:key make-flags #:allow-other-keys)
10678 (apply invoke "make" "install-dev" make-flags))))))
10679 (native-inputs
10680 ;; riscv64 needs >= gcc-13.3.0 for liburcu.
10681 (append
10682 (if (target-riscv64?)
10683 (list gcc-14)
10684 '())
10685 (list gettext-minimal)))
10686 (inputs
10687 `(("libinih" ,libinih)
10688 ("liburcu" ,liburcu)
10689 ("libuuid" ,util-linux "lib")
10690 ("python" ,python-wrapper)))
10691 (home-page "https://xfs.wiki.kernel.org/")
10692 (synopsis "XFS file system tools")
10693 (description "This package provides commands to create and check XFS
10694file systems.")
10695 ;; The library "libhandle" and the headers in "xfslibs-dev" are
10696 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
10697 (license (list license:gpl2 license:lgpl2.1))))
10698
10699(define-public xfsprogs-5.9
10700 (package
10701 (inherit xfsprogs)
10702 (name "xfsprogs")
10703 (version "5.9.0")
10704 (source (origin
10705 (method url-fetch)
10706 (uri (string-append
10707 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
10708 "xfsprogs-" version ".tar.gz"))
10709 (sha256
10710 (base32
10711 "13xkn9jpmwp4fm9r68vhgznkmxhnv83n2b39mhy2qdaph90w2a1l"))))
10712 (arguments
10713 (substitute-keyword-arguments (package-arguments xfsprogs)
10714 ((#:configure-flags configure-flags '())
10715 `(cons "--enable-gettext=no"
10716 ,configure-flags))))
10717 (native-inputs
10718 (modify-inputs (package-native-inputs xfsprogs)
10719 (delete "gettext-minimal")))))
10720
10721(define-public xfsprogs/static
10722 (package
10723 (inherit xfsprogs)
10724 (name "xfsprogs-static")
10725 (outputs (list "out"))
10726 (arguments
10727 (substitute-keyword-arguments (package-arguments xfsprogs)
10728 ((#:configure-flags configure-flags '())
10729 `(append ,configure-flags
10730 (list "--enable-static")))
10731 ((#:make-flags make-flags ''())
10732 `(cons* "LLDFLAGS=-all-static" ,make-flags))
10733 ((#:phases _ ''())
10734 `(modify-phases %standard-phases
10735 (add-after 'install 'delete-useless-files
10736 (lambda* (#:key outputs #:allow-other-keys)
10737 (with-directory-excursion (assoc-ref outputs "out")
10738 (for-each delete-file-recursively
10739 (list "include" "lib")))))))))
10740 (inputs
10741 `(("libinih:static" ,libinih "static")
10742 ("util-linux:static" ,util-linux "static")
10743 ,@(remove (match-lambda
10744 ((label . _)
10745 (member label '("python"))))
10746 (package-inputs xfsprogs))))
10747 (synopsis "Statically linked XFS file system tools")))
10748
10749(define-public xfs_repair/static
10750 (package
10751 (name "xfs_repair-static")
10752 (version (package-version xfsprogs/static))
10753 (source #f)
10754 (build-system trivial-build-system)
10755 (arguments
10756 `(#:modules ((guix build utils))
10757 #:builder
10758 (begin
10759 (use-modules (guix build utils))
10760 (let* ((xfsprogs (assoc-ref %build-inputs "xfsprogs"))
10761 (out (assoc-ref %outputs "out"))
10762 (sbin (string-append out "/sbin")))
10763 (install-file (string-append xfsprogs "/sbin/xfs_repair") sbin)
10764 (with-directory-excursion sbin
10765 (remove-store-references "xfs_repair"))))))
10766 (inputs
10767 `(("xfsprogs" ,xfsprogs/static)))
10768 (home-page (package-home-page xfsprogs/static))
10769 (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
10770 (description
10771 "This package provides a statically linked @command{xfs_repair} taken
10772from the xfsprogs package. It is meant to be used in initrds.")
10773 (license (package-license xfsprogs/static))))
10774
10775(define-public genext2fs
10776 (package
10777 (name "genext2fs")
10778 (version "1.5.0")
10779 (source (origin
10780 (method git-fetch)
10781 (uri (git-reference
10782 (url "https://github.com/bestouff/genext2fs")
10783 (commit "474111097321f03de9e009aa9f7d4a8948e310b2")))
10784 (file-name (git-file-name name version))
10785 (sha256
10786 (base32 "14lgvml5zz99845ja47jpf4iirjzfqv36ffzachh3hw2ggji9c7l"))))
10787 (build-system gnu-build-system)
10788 (native-inputs
10789 (list autoconf automake))
10790 (home-page "https://github.com/bestouff/genext2fs")
10791 (synopsis "Generate ext2 file system as a normal user")
10792 (description "This package provides a program to generate an ext2
10793file system as a normal (non-root) user. It does not require you to mount
10794the image file to copy files on it, nor does it require that you become
10795the superuser to make device nodes.")
10796 (license license:gpl2)))
10797
10798(define-public fakeroot
10799 (package
10800 (name "fakeroot")
10801 (version "1.37.1.2")
10802 (source
10803 (origin
10804 ;; There are no tags in the repository, so take this snapshot.
10805 (method url-fetch)
10806 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
10807 "fakeroot/fakeroot_" version ".orig.tar.gz"))
10808 (file-name (string-append name "-" version ".tar.gz"))
10809 (sha256
10810 (base32 "091jym16c4m4qjf5yclksvx7nw4sl7v5yrkz6z46wrwaij99d54m"))
10811 (modules '((guix build utils)
10812 (ice-9 ftw)))
10813 (snippet
10814 `(begin
10815 ;; Delete pregenerated man page translations, but not the originals.
10816 (with-directory-excursion "doc"
10817 (for-each (lambda (language)
10818 (for-each delete-file
10819 (find-files language "\\.[0-9]$")))
10820 (scandir "."
10821 (lambda (file)
10822 (and (not (string-prefix? "." file))
10823 (eq? 'directory
10824 (stat:type (lstat file))))))))))))
10825 (build-system gnu-build-system)
10826 (arguments
10827 `(#:configure-flags
10828 (list "--disable-static")
10829 #:phases
10830 (modify-phases %standard-phases
10831 (add-after 'unpack 'patch-Makefile.am
10832 (lambda _
10833 (substitute* "Makefile.am"
10834 (("/bin/sh") (which "sh")))))
10835 (add-after 'unpack 'patch-script
10836 (lambda* (#:key inputs #:allow-other-keys)
10837 (substitute* "scripts/fakeroot.in"
10838 (("getopt")
10839 (string-append (assoc-ref inputs "util-linux")
10840 "/bin/getopt"))
10841 (("sed")
10842 (string-append (assoc-ref inputs "sed")
10843 "/bin/sed"))
10844 (("cat|cut" command)
10845 (string-append (assoc-ref inputs "coreutils")
10846 "/bin/" command)) )))
10847 (replace 'bootstrap
10848 (lambda _
10849 ;; The "preroll" script takes care of Autoconf and also
10850 ;; prepares the translated manuals.
10851 (invoke "sh" "./preroll")))
10852 (add-before 'configure 'setenv
10853 (lambda _
10854 (setenv "LIBS" "-lacl")))
10855 (add-before 'check 'prepare-check
10856 (lambda _
10857 (setenv "SHELL" (which "bash"))
10858 (setenv "VERBOSE" "1")
10859 (substitute* "test/t.touchinstall"
10860 ;; We don't have the name of the root user, so use ID=0.
10861 (("grep root") "grep \"\\<0\\>\""))
10862 (substitute* "test/tartest"
10863 ;; We don't have the name of the root group, so use ID=0.
10864 (("ROOTGROUP=root") "ROOTGROUP=0")
10865 ;; We don't have the name of the daemon user, so use IDs.
10866 (("daemon:sys") "1:3")
10867 (("daemon:") "1:"))
10868 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
10869 (substitute* "test/compare-tar"
10870 (("tar -tvf") "tar --numeric-owner -tvf")))))))
10871 (native-inputs
10872 (list autoconf-2.71 automake gettext-minimal libtool po4a
10873 perl sharutils xz)) ; for tests
10874 (inputs
10875 (list acl libcap util-linux sed coreutils))
10876 (synopsis "Run commands in an environment with fake root privileges")
10877 (description
10878 "@command{fakeroot} runs a command in an environment where it appears to
10879have root privileges for file manipulation. This is useful for allowing users
10880to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
10881them with root permissions and/or ownership.
10882
10883Without fakeroot, one would have to have root privileges to create the
10884constituent files of the archives with the correct permissions and ownership,
10885and then pack them up, or one would have to construct the archives directly,
10886without using the archiver.")
10887 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
10888 (license license:gpl3+)))
10889
10890(define-public fakechroot
10891 ;; XXX: Build from the change submitted at
10892 ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
10893 ;; against glibc 2.33. Switch back to the official repository on the next
10894 ;; release.
10895 (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
10896 (revision "0"))
10897 (package
10898 (name "fakechroot")
10899 (version (git-version "2.20.1" revision commit))
10900 (source (origin
10901 (method git-fetch)
10902 (uri (git-reference
10903 (url "https://github.com/lipnitsk/fakechroot")
10904 (commit commit)))
10905 (file-name (git-file-name name version))
10906 (sha256
10907 (base32
10908 "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
10909 (build-system gnu-build-system)
10910 (arguments
10911 ;; XXX: The tests heavily assume they run on an FHS system so for now
10912 ;; skip them.
10913 '(#:tests? #f
10914 #:configure-flags '("--disable-static")))
10915 (native-inputs (list autoconf automake libtool perl))
10916 (synopsis "Emulate @code{chroot} by overriding file system calls")
10917 (description
10918 "@command{fakechroot} runs a command in an environment were is additional
10919possibility to use @code{chroot} command without root privileges. This is
10920useful for allowing users to create own chrooted environment with possibility
10921to install another packages without need for root privileges.
10922
10923It works by providing @file{libfakechroot.so}, a shared library meant to be
10924set as @code{LD_PRELOAD} to override the C library file system functions.")
10925 (home-page "https://github.com/dex4er/fakechroot/")
10926 (license license:lgpl2.1+))))
10927
10928(define-public falcosecurity-libs
10929 (package
10930 (name "falcosecurity-libs")
10931 (version "0.20.0")
10932 (source (origin
10933 (method git-fetch)
10934 (uri (git-reference
10935 (url "https://github.com/falcosecurity/libs/")
10936 (commit version)))
10937 (file-name (git-file-name name version))
10938 (sha256
10939 (base32
10940 "041ir9wk44v7isidwl7fzxrjvs85j637wcr7xirasd8ysxa0r4qv"))
10941 (patches
10942 (search-patches
10943 "falcosecurity-libs-bpf-probes-fix.patch"
10944 "falcosecurity-libs-shared-build.patch"))))
10945 (build-system cmake-build-system)
10946 (arguments
10947 (list
10948 #:configure-flags
10949 #~(list "-DUSE_BUNDLED_DEPS=OFF"
10950 "-DBUILD_DRIVER=OFF"
10951 "-DENABLE_DKMS=OFF"
10952 "-DBUILD_LIBSCAP_MODERN_BPF=ON"
10953 "-DSCAP_FILES_SUITE_ENABLE=OFF" ;attempts to download scap files
10954 "-DBUILD_SHARED_LIBS=ON"
10955 #$(string-append "-DFALCOSECURITY_LIBS_VERSION=" version))
10956 ;; Only the libsinsp test suite is run, as the one for libscap requires
10957 ;; elevated privileges.
10958 #:modules '((guix build cmake-build-system)
10959 ((guix build gnu-build-system) #:prefix gnu:)
10960 (guix build utils))
10961 #:phases
10962 #~(modify-phases %standard-phases
10963 (add-after 'unpack 'disable-problematic-tests
10964 (lambda _
10965 (substitute* "userspace/libsinsp/test/user.ut.cpp"
10966 ;; The 'system_lookup' test assumes a root user
10967 ;; exists in the build environment.
10968 (("TEST_F\\(usergroup_manager_test, system_lookup)")
10969 "TEST_F(usergroup_manager_test, DISABLED_system_lookup)"))))
10970 (replace 'check
10971 (lambda* (#:rest args)
10972 (apply (assoc-ref gnu:%standard-phases 'check)
10973 #:test-target "run-unit-test-libsinsp" args)))
10974 (add-after 'install 'delete-src
10975 (lambda _
10976 (delete-file-recursively
10977 (string-append #$output "/src")))))))
10978 (native-inputs
10979 (list bpftool
10980 clang-18 ;avoid stack limit exceeded build error
10981 googletest
10982 pkg-config
10983 valijson)) ;header-only library
10984 (inputs
10985 (list elfutils))
10986 (propagated-inputs
10987 ;; The following inputs are in the 'Requires' field of libscap.pc,
10988 ;; libsinp.pc or libpman.pc.
10989 (list c-ares
10990 grpc
10991 jsoncpp
10992 libbpf
10993 libelf
10994 openssl
10995 protobuf
10996 uthash ;included in libscap headers
10997 zlib
10998 ;; These are in the 'Requires.private' field of libscap.pc and
10999 ;; libsinp.pc. They are required because the headers are installed
11000 ;; to a non-standard directory, and thus need to be found via the
11001 ;; 'Cflags' field, which in turn mandates that both the pkg-config
11002 ;; modules listed in the 'Requires' and 'Requires.private' be
11003 ;; available.
11004 curl
11005 re2
11006 onetbb))
11007 (home-page "https://github.com/falcosecurity/libs/")
11008 (synopsis "Falco security libraries")
11009 (description "The Falco security libraries include @code{libsinsp} and
11010@code{libscap}. @code{libscap} manages the data capture process, while
11011@code{libsinsp} is a system inspection library that enriches events from
11012@code{libscap} with machine state. @code{libsinsp} also performs events
11013filtering with rule evaluation through its internal rule engine. These
11014libraries are used by the @command{sysdig} command-line utility.")
11015 (license license:asl2.0)))
11016
11017(define-public inputattach
11018 (package
11019 (name "inputattach")
11020 (version "0.42.0")
11021 (source (origin
11022 (method git-fetch)
11023 (uri (git-reference
11024 (url "https://github.com/linuxwacom/input-wacom")
11025 (commit (string-append "input-wacom-" version))))
11026 (file-name (git-file-name name version))
11027 (sha256
11028 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
11029 (build-system gnu-build-system)
11030 (arguments
11031 `(#:phases
11032 (modify-phases %standard-phases
11033 (delete 'bootstrap)
11034 (delete 'configure)
11035 (replace 'build
11036 (lambda* (#:key inputs #:allow-other-keys)
11037 (with-directory-excursion "inputattach"
11038 (invoke "gcc" "-O2" "-o" "inputattach"
11039 "inputattach.c"))))
11040 (delete 'check)
11041 (replace 'install
11042 (lambda* (#:key outputs #:allow-other-keys)
11043 (let ((target-dir (string-append
11044 (assoc-ref outputs "out")
11045 "/bin/")))
11046 (mkdir-p target-dir)
11047 (copy-file "inputattach/inputattach"
11048 (string-append target-dir
11049 "inputattach"))
11050 #t))))))
11051 (home-page "https://linuxwacom.github.io/")
11052 (synopsis "Dispatch input peripherals events to a device file")
11053 (description "inputattach dispatches input events from several device
11054types and interfaces and translates so that the X server can use them.")
11055 (license license:gpl2+)))
11056
11057(define-public keyd
11058 (package
11059 (name "keyd")
11060 (version "2.6.0")
11061 (source
11062 (origin
11063 (method git-fetch)
11064 (uri (git-reference
11065 (url "https://github.com/rvaiya/keyd")
11066 (commit (string-append "v" version))))
11067 (sha256
11068 (base32
11069 "14rgrg8d1ys1cqq46mgi34yqg9jd1q3yw1acw5r5jpwwk0da7g4p"))))
11070 (arguments
11071 (list #:tests? #f ; tests require root
11072 #:make-flags
11073 #~(list (string-append "CC=" #$(cc-for-target))
11074 "PREFIX="
11075 (string-append "DESTDIR=" #$output))
11076 #:phases
11077 '(modify-phases
11078 %standard-phases
11079 (delete 'configure)))) ; no autoconf
11080 (build-system gnu-build-system)
11081 (inputs (list linux-libre-headers))
11082 (synopsis "Key remapping daemon for Linux")
11083 (description
11084 "Keyd is a keyboard remapping utility with intuitive ini configuration
11085file format. Keyd has several features, many of which are traditionally only
11086found in custom keyboard firmware like QMK.")
11087 (home-page "https://github.com/rvaiya/keyd")
11088 (license license:expat)))
11089
11090(define-public pipewire
11091 (package
11092 (name "pipewire")
11093 (version "1.5.85")
11094 (source (origin
11095 (method git-fetch)
11096 (uri (git-reference
11097 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11098 (commit version)))
11099 (file-name (git-file-name name version))
11100 (sha256
11101 (base32
11102 "1nd74wjy16bw8ng00acc26rakpqabcq1z64h23w97i18pb7z64xq"))))
11103 (build-system meson-build-system)
11104 (arguments
11105 (list
11106 #:configure-flags
11107 #~(list (string-append "-Dudevrulesdir=" #$output "/lib/udev/rules.d")
11108 "-Dman=enabled"
11109 "-Drlimits-install=false"
11110 "-Dsession-managers=[]"
11111 "-Dsysconfdir=/etc"
11112 "-Dlibsystemd=disabled"
11113
11114 ;; XXX: link with -Wl,--no-as-needed so that libgcc_s.so.1 does not get dropped
11115 ;; Otherwise test_loop will fail with:
11116 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11117 "-Db_asneeded=false")))
11118 (native-inputs
11119 (list `(,glib "bin")
11120 pkg-config
11121 doxygen
11122 python
11123 python-docutils))
11124 (inputs (list alsa-lib
11125 avahi
11126 bluez
11127 dbus
11128 eudev
11129 ffmpeg
11130 gst-plugins-base
11131 gstreamer
11132 jack-2
11133 ldacbt
11134 libcamera
11135 libdrm
11136 libfdk
11137 libfreeaptx
11138 libsndfile
11139 libusb
11140 openssl ; raop sink
11141 libva
11142 pulseaudio
11143 readline ; for pw-cli
11144 sbc
11145 vulkan-headers
11146 vulkan-loader
11147 webrtc-audio-processing))
11148 (home-page "https://pipewire.org/")
11149 (synopsis "Server and user space API to deal with multimedia pipelines")
11150 (description
11151 "PipeWire is a project that aims to greatly improve handling of audio and
11152video under Linux. It aims to support the usecases currently handled by both
11153PulseAudio and Jack and at the same time provide same level of powerful handling
11154of Video input and output. It also introduces a security model that makes
11155interacting with audio and video devices from containerized applications easy,
11156with supporting Flatpak applications being the primary goal. Alongside Wayland
11157and Flatpak we expect PipeWire to provide a core building block for the future
11158of Linux application development.")
11159 (license license:lgpl2.0+)))
11160
11161(define-public pipewire-minimal
11162 ;; Used as libpipewire to reduce closure size and avoid dependency cycles.
11163 (hidden-package
11164 (package
11165 (inherit pipewire)
11166 (name "pipewire-minimal")
11167 (arguments
11168 (list
11169 #:configure-flags
11170 #~(list "-Dsession-managers=[]"
11171 "-Ddbus=disabled"
11172 "-Dflatpak=disabled"
11173 ;; XXX: Otherwise test_loop will fail with:
11174 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11175 "-Db_asneeded=false")))
11176 (native-inputs '())
11177 (inputs '()))))
11178
11179(define-public pipewire-minimal-1.4
11180 (package
11181 (inherit pipewire-minimal)
11182 (name "pipewire")
11183 (version "1.4.10")
11184 (source (origin
11185 (method git-fetch)
11186 (uri (git-reference
11187 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11188 (commit version)))
11189 (file-name (git-file-name name version))
11190 (sha256
11191 (base32
11192 "14rsdbcsyyhjh7hvbq3d84f6s0fllvq6vpg39cxcd7l8fn4zc2zw"))))))
11193
11194(define-public wireplumber
11195 (package
11196 (name "wireplumber")
11197 (version "0.5.12")
11198 (source
11199 (origin
11200 (method git-fetch)
11201 (uri (git-reference
11202 (url
11203 "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
11204 (commit version)))
11205 (file-name (git-file-name name version))
11206 (sha256
11207 (base32 "1dljz669ywy1lvvn0jh14ymynmbii45q5vay71zajpcg31249dyw"))))
11208 (build-system meson-build-system)
11209 (arguments
11210 `(#:configure-flags '("-Dsystemd=disabled"
11211 "-Dsystem-lua=true")))
11212 (native-inputs
11213 (list `(,glib "bin")
11214 pkg-config python-minimal))
11215 (inputs (list dbus elogind glib lua pipewire))
11216 (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
11217 (synopsis "Session / policy manager implementation for PipeWire")
11218 (description "WirePlumber is a modular session / policy manager for
11219PipeWire and a GObject-based high-level library that wraps PipeWire's API,
11220providing convenience for writing the daemon's modules as well as external
11221tools for managing PipeWire.")
11222 (license license:expat)))
11223
11224(define-public wireplumber-minimal
11225 (let ((base wireplumber))
11226 (package
11227 (inherit base)
11228 (name "wireplumber-minimal")
11229 (arguments
11230 (substitute-keyword-arguments (package-arguments base)
11231 ((#:configure-flags flags ''())
11232 #~(cons "-Delogind=disabled" #$flags))))
11233 (inputs
11234 (modify-inputs (package-inputs base)
11235 (delete "elogind"))))))
11236
11237(define-public ell
11238 (package
11239 (name "ell")
11240 (version "0.79")
11241 (source (origin
11242 (method git-fetch)
11243 (uri (git-reference
11244 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
11245 (commit version)))
11246 (file-name (git-file-name name version))
11247 (sha256
11248 (base32
11249 "0l8pbgnza58ivknzl3nd6y46mfminhnb3iwq82msi6g282wv7np4"))
11250 (modules '((guix build utils)))
11251 (snippet
11252 #~(begin
11253 (substitute* "Makefile.am"
11254 ;; requires hwdb.bin
11255 (("unit/test-hwdb.*") ""))))))
11256 (build-system gnu-build-system)
11257 (arguments
11258 ;; Tests launch dbus-daemon instances that all try to bind to
11259 ;; "/tmp/ell-test-bus". Thus, we need to run them sequentially.
11260 '(#:parallel-tests? #f))
11261 (inputs
11262 (list dbus))
11263 (native-inputs
11264 (list autoconf automake libtool pkg-config procps))
11265 (home-page "https://01.org/ell")
11266 (synopsis "Embedded Linux Library")
11267 (description "The Embedded Linux* Library (ELL) provides core, low-level
11268functionality for system daemons. It typically has no dependencies other than
11269the Linux kernel, C standard library, and libdl (for dynamic linking). While
11270ELL is designed to be efficient and compact enough for use on embedded Linux
11271platforms, it is not limited to resource-constrained systems.")
11272 (license license:lgpl2.1+)))
11273
11274(define-public kexec-tools
11275 (package
11276 (name "kexec-tools")
11277 (version "2.0.31")
11278 (source (origin
11279 (method url-fetch)
11280 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
11281 "/kexec/kexec-tools-" version ".tar.xz"))
11282 (sha256
11283 (base32
11284 "0c9cj9xvcm81gcwnkvvh9vh82v59kdz5llmblc2wkqb6vh6kb3wa"))))
11285 (build-system gnu-build-system)
11286 (arguments
11287 ;; There are no automated tests.
11288 '(#:tests? #f))
11289 ;; This variant of binutils is used for the 64 bit support needed to
11290 ;; assemble the `purgatory/arch/i386/compat_x86_64.S' program on i686-linux.
11291 (native-inputs (list (make-ld-wrapper "ld-wrapper"
11292 #:binutils binutils)
11293 binutils))
11294 (home-page "https://projects.horms.net/projects/kexec/")
11295 (synopsis "Tools for booting directly into different kernels")
11296 (description "This package provides the @code{kexec} program and ancillary
11297utilities. Using @code{kexec}, it is possible to boot directly into a new
11298kernel from the context of an already-running kernel, bypassing the normal
11299system boot process.")
11300 (supported-systems (delete "riscv64-linux" %supported-systems))
11301 (license license:gpl2)))
11302
11303(define-public cachefilesd
11304 (package
11305 (name "cachefilesd")
11306 (version "0.10.10")
11307 (source (origin
11308 (method url-fetch)
11309 (uri (string-append
11310 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
11311 "/cachefilesd.git/snapshot/cachefilesd-"
11312 version ".tar.gz"))
11313 (sha256
11314 (base32
11315 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
11316 (build-system gnu-build-system)
11317 (outputs '("out"))
11318 (arguments
11319 `(#:tests? #f ; there are no tests
11320 #:make-flags
11321 (let ((prefix-dir (lambda (var dir)
11322 (string-append var "=" %output "/" dir))))
11323 (list (string-append "CC=" ,(cc-for-target))
11324 (prefix-dir "SBINDIR" "sbin/")
11325 (prefix-dir "ETCDIR" "etc/")
11326 (prefix-dir "MANDIR" "share/man/")))
11327 #:phases (modify-phases %standard-phases (delete 'configure))))
11328 (home-page "https://people.redhat.com/~dhowells/cachefs/")
11329 (synopsis "CacheFiles userspace management daemon")
11330 (description "@code{cachefilesd} is a userspace daemon that manages the
11331cache data store that is used by network file systems such as @code{AFS} and
11332@code{NFS} to cache data locally on disk. The content of the cache is
11333persistent over reboots.")
11334 (license license:gpl2+)))
11335
11336(define-public libbpf
11337 (package
11338 (name "libbpf")
11339 (version "1.5.0")
11340 (source
11341 (origin
11342 (method git-fetch)
11343 (uri (git-reference
11344 (url "https://github.com/libbpf/libbpf")
11345 (commit (string-append "v" version))))
11346 (file-name (git-file-name name version))
11347 (sha256
11348 (base32
11349 "0j7rm76g2ss09vksm4nm2g5yq7df2z5qpjr4h6kd3959sc1rvxnh"))))
11350 (build-system gnu-build-system)
11351 (arguments
11352 (list
11353 #:tests? #f ;self-tests run in QEMU
11354 #:make-flags
11355 #~(list (string-append "PREFIX=" #$output)
11356 (string-append "LIBDIR=$(PREFIX)/lib")
11357 (string-append "CC=" #$(cc-for-target)))
11358 #:phases
11359 #~(modify-phases %standard-phases
11360 (delete 'configure)
11361 (add-before 'build 'pre-build
11362 (lambda _
11363 (chdir "src")))
11364 (replace 'install
11365 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
11366 (apply (assoc-ref %standard-phases 'install)
11367 (append args
11368 (list #:make-flags
11369 (append (list "install"
11370 ;; Also install the kernel
11371 ;; user API (uAPI) headers.
11372 "install_uapi_headers")
11373 make-flags)))))))))
11374 (native-inputs (list pkg-config))
11375 (propagated-inputs (list elfutils zlib)) ;in Requires.private of libbpf.pc
11376 (home-page "https://github.com/libbpf/libbpf")
11377 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
11378 (description
11379 "Libbpf supports building BPF CO-RE-enabled applications, which, in
11380contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
11381headers.")
11382 (license (list license:lgpl2.1 license:bsd-2))))
11383
11384(define-public libbpf-0.8
11385 (package
11386 (inherit libbpf)
11387 (name "libbpf")
11388 (version "0.8.1")
11389 (source
11390 (origin
11391 (method git-fetch)
11392 (uri (git-reference
11393 (url "https://github.com/libbpf/libbpf")
11394 (commit (string-append "v" version))))
11395 (file-name (git-file-name name version))
11396 (sha256
11397 (base32
11398 "1zzpkk4x3f20483dzw43b3ml03d63vvkmqf4j8y3b61b67wm59bm"))))
11399 (arguments
11400 (list
11401 #:tests? #f ;self-tests run in QEMU
11402 #:make-flags
11403 #~(list (string-append "PREFIX=" #$output)
11404 (string-append "LIBDIR=$(PREFIX)/lib")
11405 (string-append "CC=" #$(cc-for-target)))
11406 #:phases #~(modify-phases %standard-phases
11407 (delete 'configure)
11408 (add-before 'build 'pre-build
11409 (lambda _
11410 (chdir "src"))))))
11411 (native-inputs (list pkg-config))
11412 (propagated-inputs (list elfutils zlib)))) ;in Requires.private of libbpf.pc
11413
11414(define-public bcc
11415 (package
11416 (name "bcc")
11417 (version "0.30.0")
11418 (source
11419 (origin
11420 (method git-fetch)
11421 (uri (git-reference
11422 (url "https://github.com/iovisor/bcc")
11423 (commit (string-append "v" version))))
11424 (file-name (git-file-name name version))
11425 (sha256
11426 (base32
11427 "0b5la0yn6x6ll73drnrm5v5yibbrzkvl86hqivkrmnpgy8cqn0cy"))))
11428 (build-system cmake-build-system)
11429 (native-inputs
11430 (list bison
11431 flex
11432 (@ (gnu packages compression) zip)))
11433 (inputs
11434 (list bash-minimal ;for wrap-program
11435 clang-15
11436 elfutils
11437 luajit
11438 libbpf
11439 python-wrapper))
11440 (arguments
11441 (list
11442 ;; Tests all require root permissions and a "standard" file hierarchy.
11443 #:tests? #f
11444 #:configure-flags #~(list (string-append "-DREVISION=" #$version)
11445 "-DCMAKE_USE_LIBBPF_PACKAGE=ON")
11446 #:phases
11447 #~(modify-phases %standard-phases
11448 (add-after 'unpack 'substitute-libbc
11449 (lambda _
11450 (substitute* "src/python/bcc/libbcc.py"
11451 (("(libbcc\\.so.*)\\b" _ libbcc)
11452 (string-append #$output "/lib/" libbcc)))))
11453 (add-after 'install 'wrap-tools
11454 (lambda _
11455 (use-modules (ice-9 textual-ports))
11456 (let* ((out #$output)
11457 (lib (string-append out "/lib"))
11458 (tools (string-append out "/share/bcc/tools"))
11459 (python-executable?
11460 (lambda (filename _)
11461 (call-with-input-file filename
11462 (lambda (port)
11463 (string-contains (get-line port)
11464 "/bin/python"))))))
11465 (for-each (lambda (python-executable)
11466 (format #t "Wrapping: ~A.~%" python-executable)
11467 (wrap-program python-executable
11468 `("GUIX_PYTHONPATH" ":" prefix
11469 (,(string-append lib
11470 "/python"
11471 #$(version-major+minor
11472 (package-version python))
11473 "/site-packages")))))
11474 (find-files tools python-executable?))))))))
11475 (home-page "https://github.com/iovisor/bcc")
11476 (synopsis "Tools for BPF on Linux")
11477 (description
11478 "BCC is a toolkit for creating efficient kernel tracing and manipulation
11479programs, and includes several useful tools and examples. It makes use of
11480extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
11481that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
11482and above.")
11483 (license license:asl2.0)))
11484
11485(define-public bpftool
11486 (package
11487 (name "bpftool")
11488 (version (package-version linux-libre))
11489 (source (package-source linux-libre))
11490 (build-system gnu-build-system)
11491 (arguments
11492 `(#:tests? #f ;This package has no tests.
11493 #:phases (modify-phases %standard-phases
11494 (delete 'configure)
11495 (replace 'build
11496 (lambda* (#:key inputs #:allow-other-keys)
11497 (invoke "make" "-C" "tools/bpf/bpftool"
11498 ,(string-append "CC=" (cc-for-target)))))
11499 (replace 'install
11500 (lambda* (#:key outputs #:allow-other-keys)
11501 (let* ((out (assoc-ref outputs "out")))
11502 (mkdir-p (string-append out "/sbin"))
11503 (mkdir-p (string-append out
11504 "/share/bash-completion/completions"))
11505 (invoke "make"
11506 (string-append "prefix=" out)
11507 (string-append
11508 "bash_compdir=" out
11509 "/share/bash-completion/completions")
11510 "-C" "tools/bpf/bpftool"
11511 "install")))))))
11512 (inputs (list elfutils ;provides libelf
11513 libcap openssl readline zlib))
11514 (native-inputs (list bison python))
11515 ;; This tool does not have a proper web page.
11516 (home-page
11517 "https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/bpf/bpftool")
11518 (synopsis "Tool for inspection and manipulation of eBPF programs and maps")
11519 (description "@command{bpftool} allows for inspection and simple
11520modification of BPF objects on the system.")
11521 (license (package-license linux-libre))))
11522
11523(define-public bpftrace
11524 (package
11525 (name "bpftrace")
11526 (version "0.21.2")
11527 (source
11528 (origin
11529 (method git-fetch)
11530 (uri (git-reference
11531 (url "https://github.com/bpftrace/bpftrace")
11532 (commit (string-append "v" version))))
11533 (file-name (git-file-name name version))
11534 (sha256
11535 (base32 "0icbhf1wk523a7lcmwqa67zc6hl6h02p5mfg26cizva447kbwsgz"))))
11536 (build-system cmake-build-system)
11537 (arguments
11538 (list
11539 #:test-exclude "(runtime_tests|tools-parsing-test)"
11540 #:phases
11541 #~(modify-phases %standard-phases
11542 ;; This patch also fixes broken compilation due to improper detection
11543 ;; of bfd features. This is taken from following upstream PR:
11544 ;; https://github.com/bpftrace/bpftrace/pull/3332
11545 (add-after 'unpack 'patch-paths-and-bfd-defs
11546 (lambda _
11547 (substitute* '("cmake/FindLibBfd.cmake"
11548 "src/CMakeLists.txt")
11549 (("LIBSFRAME_FOUND")
11550 "LIBSFRAME_LIBRARIES")
11551 (("LIBZSTD_FOUND")
11552 "LIBZSTD_LIBRARIES"))
11553 (with-directory-excursion "tests"
11554 (substitute* (find-files ".")
11555 (("/bin/sh")
11556 (which "sh")))
11557 (substitute* '("child.cpp"
11558 "runtime/call"
11559 "procmon.cpp")
11560 (("/bin/ls")
11561 (which "ls"))))))
11562 (add-after 'unpack 'fix-paths
11563 (lambda* (#:key inputs outputs #:allow-other-keys)
11564 (substitute* '("tests/child.cpp")
11565 (("/bin/sleep")
11566 (search-input-file inputs "bin/sleep")))))
11567 (add-before 'check 'set-test-filter
11568 (lambda _
11569 (setenv "GTEST_FILTER"
11570 (string-join
11571 (list ; "-" disables all following tests
11572 "-ast.probe_name_uprobe"
11573 "bpftrace.add_probes_uprobe_wildcard_file"
11574 "bpftrace.add_probes_uprobe_wildcard_file_uprobe_multi"
11575 "bpftrace.add_probes_usdt_wildcard"
11576 "Parser.multiple_attach_points_kprobe"
11577 "Parser.uretprobe_offset"
11578 "semantic_analyser.builtin_functions"
11579 "semantic_analyser.call_func"
11580 "semantic_analyser.call_uaddr")
11581 ":")))))))
11582 (native-inputs (list bison coreutils dwarves flex googletest xxd))
11583 (inputs (list bcc clang-15 elfutils libbpf libiberty cereal))
11584 (home-page "https://github.com/bpftrace/bpftrace")
11585 (synopsis "High-level tracing language for Linux eBPF")
11586 (description
11587 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
11588Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
11589LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
11590interacting with the Linux BPF system, as well as existing Linux tracing
11591capabilities: kernel dynamic tracing (kprobes), user-level dynamic
11592tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
11593and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
11594created by Alastair Robertson.")
11595 (license license:asl2.0)))
11596
11597(define-public ttyebus-linux-module
11598 (let ((revision "0")
11599 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
11600 (package
11601 (name "ttyebus-linux-module")
11602 (version (git-version "1.5" revision commit))
11603 (source
11604 (origin
11605 (method git-fetch)
11606 (uri (git-reference
11607 (url "https://github.com/eBUS/ttyebus")
11608 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
11609 (file-name (git-file-name name version))
11610 (sha256
11611 (base32
11612 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
11613 (supported-systems '("armhf-linux" "aarch64-linux"))
11614 (build-system linux-module-build-system)
11615 (arguments
11616 `(#:tests? #f))
11617 (home-page "https://github.com/eBUS/ttyebus")
11618 (synopsis "Low-latency Raspberry Pi UART driver")
11619 (description "This package provides a Linux kernel module that will
11620provide a serial device @code{/dev/ttyebus} with almost no latency upon
11621receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
11622 (license license:gpl3+))))
11623
11624(define-public ipset
11625 (package
11626 (name "ipset")
11627 (version "7.17")
11628 (source
11629 (origin
11630 (method url-fetch)
11631 (uri (string-append "https://ipset.netfilter.org/"
11632 "ipset-" version ".tar.bz2"))
11633 (sha256
11634 (base32 "1n34mkrdha9rggd0fizjx6baqkiqqd1yfhb5ml663mlx93zwjjdy"))))
11635 (build-system gnu-build-system)
11636 (inputs
11637 (list libmnl))
11638 (native-inputs
11639 (list pkg-config))
11640 (arguments
11641 `(#:configure-flags '("--disable-static"
11642 "--with-kmod=no")))
11643 (home-page "https://ipset.netfilter.org/")
11644 (synopsis "Administration tool for IP sets")
11645 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
11646can be administered by the ipset utility. Depending on the type,
11647currently an IP set may store IP addresses, (TCP/UDP) port numbers or
11648IP addresses with MAC addresses in a way which ensures lightning speed
11649when matching an entry against a set.
11650
11651If you want to
11652@itemize @bullet
11653@item store multiple IP addresses or port numbers and match against the entire
11654collection using a single iptables rule.
11655@item dynamically update iptables rules against IP addresses or ports without
11656performance penalty.
11657@item express complex IP address and ports based rulesets with a single
11658iptables rule and benefit from the speed of IP sets.
11659@end itemize\n
11660then IP sets may be the proper tool for you.")
11661 (license license:gpl2+)))
11662
11663(define-public liburing
11664 (package
11665 (name "liburing")
11666 (version "2.12")
11667 (source (origin
11668 (method git-fetch)
11669 (uri (git-reference
11670 (url "https://git.kernel.dk/liburing")
11671 (commit (string-append "liburing-" version))))
11672 (file-name (git-file-name name version))
11673 (sha256
11674 (base32
11675 "0vz3p7g0nzcg5bag7kqkdncigl9nc0vrzm07l8yww2gb529k6hxh"))))
11676 (build-system gnu-build-system)
11677 (arguments
11678 `(;; Tests are dependent on kernel version and features
11679 #:tests? #f
11680 #:phases
11681 (modify-phases %standard-phases
11682 (replace 'configure
11683 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
11684 ;; --enable-fast-install, and --build
11685 (lambda* (#:key outputs #:allow-other-keys)
11686 (let ((out (assoc-ref outputs "out")))
11687 (setenv "SHELL" (which "sh"))
11688 (setenv "CONFIG_SHELL" (which "sh"))
11689 (invoke "./configure" (string-append "--prefix=" out))))))))
11690 (home-page "https://github.com/axboe/liburing")
11691 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
11692 (description "This is the io_uring library, liburing. liburing provides
11693helpers to setup and teardown io_uring instances, and also a simplified
11694interface for applications that don't need (or want) to deal with the full
11695kernel side implementation.")
11696 (license license:expat)))
11697
11698(define-public erofs-utils
11699 (package
11700 (name "erofs-utils")
11701 (version "1.8.10")
11702 (source
11703 (origin
11704 (method git-fetch)
11705 (uri (git-reference
11706 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
11707 (commit (string-append "v" version))))
11708 (file-name (git-file-name name version))
11709 (sha256
11710 (base32 "1qlig9q1fdjl0zn7206dbv7w5ssjg4az4hg7y3vk69ly0zbmwkil"))))
11711 (build-system gnu-build-system)
11712 (inputs
11713 (list lz4
11714 `(,util-linux "lib")
11715 zlib))
11716 (native-inputs
11717 (list autoconf automake libtool pkg-config))
11718 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
11719 (synopsis "User-space tools for the EROFS file system")
11720 (description
11721 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
11722read-only file system optimized for resource-scarce devices. This package
11723provides user-space tools for creating EROFS file systems.")
11724 (license license:gpl2+)))
11725
11726(define-public rasdaemon
11727 (package
11728 (name "rasdaemon")
11729 (version "0.8.3")
11730 (source
11731 (origin
11732 (method git-fetch)
11733 (uri (git-reference
11734 (url "https://github.com/mchehab/rasdaemon")
11735 (commit (string-append "v" version))))
11736 (file-name (git-file-name name version))
11737 (sha256
11738 (base32 "0vfw4vf75fnpbxnfsmpdwdzhplnccz24j23bg6nsb3b4wa8hv4sa"))))
11739 (native-inputs (list autoconf automake libtool pkg-config))
11740 (inputs (list bash-minimal libtraceevent perl perl-dbd-sqlite sqlite dmidecode kmod))
11741 (arguments
11742 (list
11743 #:configure-flags
11744 #~(list "--enable-all"
11745 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
11746 "--with-sysconfdefdir=."
11747 "--localstatedir=/var")
11748 #:phases
11749 #~(modify-phases %standard-phases
11750 (add-after 'unpack 'rename-README
11751 (lambda _
11752 ;; Required by autoreconf
11753 (rename-file "README.md" "README")))
11754 (add-before 'configure 'munge-autotools
11755 (lambda _
11756 ;; For some reason upstream forces sysconfdir=/etc. This results
11757 ;; in EPERM during the install phase. Removing the offending
11758 ;; line lets sysconfdir correctly pick up DESTDIR.
11759 (substitute* "configure.ac"
11760 (("^test .* sysconfdir=/etc\n$") ""))))
11761 (add-after 'install 'wrap-rasdaemon
11762 (lambda* (#:key inputs #:allow-other-keys)
11763 (let ((path (map dirname
11764 (list (search-input-file inputs "/sbin/dmidecode")
11765 (search-input-file inputs "/bin/modprobe")))))
11766 (wrap-program (string-append #$output "/sbin/ras-mc-ctl")
11767 `("PATH" ":" prefix ,path)
11768 `("PERL5LIB" ":" prefix ,(string-split (getenv "PERL5LIB") #\:)))))))))
11769 (build-system gnu-build-system)
11770 (home-page "https://github.com/mchehab/rasdaemon")
11771 (synopsis "Platform Reliability, Availability, and Serviceability tools")
11772 (description
11773 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
11774Availability and Serviceability} reports from Linux kernel trace events.
11775These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
11776through standard log mechanisms like syslog.")
11777 (license license:gpl2)))
11778
11779(define-public renameat2
11780 ;; This is a Gist, with no release or tags.
11781 (let ((revision "0")
11782 (commit "5c5193f20142511a5fc7069a539f4e5aba0ea470"))
11783 (package
11784 (name "renameat2")
11785 (version (git-version "0.0.0" revision commit))
11786 (source (origin
11787 (method url-fetch)
11788 (uri (string-append "https://gist.githubusercontent.com/"
11789 "eatnumber1/f97ac7dad7b1f5a9721f/raw/"
11790 commit "/renameat2.c"))
11791 (sha256
11792 (base32
11793 "07b4hsxqjm610sdkm4nxhp0gnl2s7gzlh4zdnja5ay40v4x24bb9"))))
11794 (build-system gnu-build-system)
11795 (arguments
11796 (list
11797 #:tests? #f ;no test suite
11798 #:phases #~(modify-phases %standard-phases
11799 (delete 'configure)
11800 (replace 'build
11801 (lambda _
11802 (invoke #$(cc-for-target) "renameat2.c"
11803 "-o" "renameat2")))
11804 (replace 'install
11805 (lambda _
11806 (install-file "renameat2"
11807 (string-append #$output "/bin")))))))
11808 (home-page "https://gist.github.com/eatnumber1/f97ac7dad7b1f5a9721f")
11809 (synopsis "Command to call the renameat2 Linux system call")
11810 (description "This package provides a @command{renameat2} command that
11811calls the Linux-specific @code{renameat2} system call.")
11812 (license license:expat))))
11813
11814(define-public libgpiod
11815 (package
11816 (name "libgpiod")
11817 (version "2.2.2")
11818 (source
11819 (origin
11820 (method git-fetch)
11821 (uri
11822 (git-reference
11823 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
11824 (commit (string-append "v" version))))
11825 (file-name (git-file-name name version))
11826 (sha256 (base32 "10yiwrw80x0057w825zxmdbd54w9lbyf49bgqk1cryqapglfzqri"))))
11827 (build-system gnu-build-system)
11828 (arguments
11829 (list #:configure-flags
11830 #~(list "--enable-tools=yes"
11831 "--enable-bindings-cxx")))
11832 (native-inputs
11833 (list automake
11834 autoconf-2.71
11835 libtool
11836 autoconf-archive
11837 pkg-config))
11838 (synopsis "Interact with the Linux GPIO character device")
11839 (description
11840 "This package provides a C library with C++ bindings and
11841command-line tools for interacting with GPIO devices that avoids the usage of
11842older system-wide @file{/sys} interface.")
11843 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
11844 (license (list license:lgpl2.1+ ;; libgpiod
11845 license:gpl2+ ;; gpio-tools
11846 license:lgpl3+)))) ;; C++ bindings
11847
11848(define-public python-libgpiod
11849 (package
11850 (name "python-libgpiod")
11851 (version "2.3.0")
11852 (source
11853 (origin
11854 (method git-fetch)
11855 (uri
11856 (git-reference
11857 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
11858 (commit (string-append "python-v" version))))
11859 (file-name (git-file-name name version))
11860 (sha256 (base32 "1lkd7lgpb28pqf7p6lrwl0ss7r5ryiddmdcisnz6ixy796qhr8kr"))))
11861 (build-system pyproject-build-system)
11862 (arguments
11863 (list
11864 #:tests? #f ; tests require root, see README.md
11865 #:phases
11866 #~(modify-phases %standard-phases
11867 (add-after 'unpack 'cd-to-python-bindings
11868 (lambda _
11869 (chdir "bindings/python"))))))
11870 (native-inputs
11871 (list python-setuptools
11872 python-wheel
11873 libgpiod))
11874 (synopsis "Interact with the Linux GPIO character device")
11875 (description
11876 "This package provides Python bindings for interacting with GPIO devices
11877that avoids the usage of older system-wide @file{/sys} interface.")
11878 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
11879 (license (list license:lgpl2.1+ ;; libgpiod
11880 license:gpl2+ ;; gpio-tools
11881 license:lgpl3+)))) ;; C++ bindings
11882
11883(define-public libtraceevent
11884 (package
11885 (name "libtraceevent")
11886 (version "1.7.3")
11887 (source
11888 (origin
11889 (method git-fetch)
11890 (uri (git-reference
11891 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git")
11892 (commit (string-append name "-" version))))
11893 (file-name (git-file-name name version))
11894 (sha256
11895 (base32 "06mw2f0xnk6dy9w2z0n4dz7lnm02qfsmnmj2h24453qxlw57x0d6"))
11896 (modules '((guix build utils)))
11897 (snippet
11898 #~(begin
11899 (substitute* (list "Makefile" "scripts/utils.mk")
11900 (("/bin/(pwd)" _ command) command))))))
11901 (build-system gnu-build-system)
11902 (arguments
11903 (list
11904 #:tests? #f ; no test suite
11905 #:make-flags
11906 #~(list
11907 (string-append "pkgconfig_dir=" #$output "/lib/pkgconfig")
11908 (string-append "prefix=" #$output))
11909 #:phases
11910 #~(modify-phases %standard-phases
11911 (delete 'configure)))) ; no configure script
11912 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/")
11913 (synopsis "Linux kernel trace event library")
11914 (description
11915 "This library parses raw Linux kernel trace event formats.")
11916 (license (list license:gpl2
11917 license:lgpl2.1))))
11918
11919(define-public libtracefs
11920 (package
11921 (name "libtracefs")
11922 (version "1.7.0")
11923 (source
11924 (origin
11925 (method git-fetch)
11926 (uri (git-reference
11927 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git")
11928 (commit (string-append name "-" version))))
11929 (file-name (git-file-name name version))
11930 (sha256
11931 (base32 "0v896n3q0df0nxx5drbwyaqhrqiyxl06rvrdw3gp2r37awa9g1zb"))
11932 (modules '((guix build utils)))
11933 (snippet
11934 #~(begin
11935 (substitute* (list "Makefile" "scripts/utils.mk")
11936 (("/bin/(pwd)" _ command) command))))))
11937 (build-system gnu-build-system)
11938 (arguments
11939 (list
11940 #:tests? #f ; no test suite
11941 #:make-flags
11942 #~(list
11943 (string-append "CC=" #$(cc-for-target))
11944 (string-append "pkgconfig_dir=" #$output "/lib/pkgconfig")
11945 (string-append "prefix=" #$output))
11946 #:phases
11947 #~(modify-phases %standard-phases
11948 (delete 'configure)))) ; no configure script
11949 (native-inputs (list pkg-config))
11950 (inputs (list libtraceevent))
11951 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/")
11952 (synopsis "Linux kernel trace file system library")
11953 (description
11954 "This library provides APIs to access the Linux kernel's trace file
11955system.")
11956 (license (list license:gpl2
11957 license:lgpl2.1))))
11958
11959(define-public libtree
11960 (package
11961 (name "libtree")
11962 (version "3.1.1")
11963 (source
11964 (origin
11965 (method git-fetch)
11966 (uri (git-reference
11967 (url "https://github.com/haampie/libtree")
11968 (commit (string-append "v" version))))
11969 (file-name (git-file-name name version))
11970 (patches (search-patches "libtree-fix-check-non-x86.patch"))
11971 (sha256
11972 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb"))))
11973 (arguments
11974 (list #:make-flags
11975 ;; NOTE: Official documentation recommends to build libtree with
11976 ;; "-static" flag.
11977 #~(list (string-append "CC=" #$(cc-for-target))
11978 (string-append "PREFIX=" #$output))
11979 #:phases
11980 #~(modify-phases %standard-phases
11981 (add-after 'unpack 'fix-tests
11982 ;; XXX: '08_nodeflib' fails as 'libtree' returns a non-zero
11983 ;; code in one of the tests.
11984 ;;
11985 ;; See <https://github.com/haampie/libtree/issues/80>).
11986 (lambda _
11987 (substitute* "tests/08_nodeflib/Makefile"
11988 (("! ../../libtree -vvv exe_b")
11989 "../../libtree -vvv exe_b"))))
11990 (delete 'configure))))
11991 (build-system gnu-build-system)
11992 (home-page "https://github.com/haampie/libtree")
11993 (synopsis "Show output of @command{ldd} as a tree")
11994 (description
11995 "This tool turns @command{ldd} into a tree and explains how shared
11996libraries are found or why they cannot be located.")
11997 (license license:expat)))
11998
11999(define-public touchegg
12000 (package
12001 (name "touchegg")
12002 (version "2.0.18")
12003 (source
12004 (origin
12005 (method git-fetch)
12006 (uri (git-reference
12007 (url "https://github.com/JoseExposito/touchegg")
12008 (commit version)))
12009 (file-name (git-file-name name version))
12010 (sha256
12011 (base32 "0m8zgihij14b8dxrxxvpl8sdsx49mjlnxnm0fhgfxscy7n07kcpc"))))
12012 (build-system cmake-build-system)
12013 (arguments
12014 `(#:tests? #f ; No tests exist
12015 #:configure-flags
12016 (list "-DUSE_SYSTEMD=OFF"))) ; No systemd
12017 (native-inputs
12018 (list
12019 pkg-config))
12020 (inputs
12021 (list
12022 cairo
12023 gtk+
12024 libgudev
12025 libinput
12026 libxrandr
12027 libxtst
12028 pugixml))
12029 (home-page "https://github.com/JoseExposito/touchegg")
12030 (synopsis "Multitouch gesture recognizer")
12031 (description
12032 "Touchégg is an application that runs in the background and transform the
12033gestures you make on your touchpad or touchscreen into visible actions in your
12034desktop.")
12035 (license license:gpl3+)))
12036
12037(define-public evtest
12038 (package
12039 (name "evtest")
12040 (version "1.36")
12041 (source (origin
12042 (method git-fetch)
12043 (uri (git-reference
12044 (url "https://gitlab.freedesktop.org/libevdev/evtest")
12045 (commit (string-append "evtest-" version))))
12046 (file-name (git-file-name name version))
12047 (sha256
12048 (base32
12049 "0mwjvz0fwwcwm4fpw0m4x8bcxpnzjkiy7fpb438vf4i5g5q0dc1k"))))
12050 (build-system gnu-build-system)
12051 (arguments
12052 (list #:tests? #f ;No tests exist
12053 #:make-flags #~(list (string-append "CC="
12054 #$(cc-for-target))
12055 (string-append "PREFIX="
12056 #$output))
12057 #:phases #~(modify-phases %standard-phases
12058 (add-after 'unpack 'generate-doc
12059 (lambda _
12060 (invoke "asciidoc" "-d" "manpage"
12061 "-b" "docbook"
12062 "-o" "evtest.1.xml"
12063 "evtest.txt")
12064 (invoke "xsltproc" "--nonet"
12065 (string-append
12066 #$(this-package-native-input "docbook-xsl")
12067 "/xml/xsl/docbook-xsl-"
12068 #$(package-version
12069 (this-package-native-input "docbook-xsl"))
12070 "/manpages/docbook.xsl")
12071 "evtest.1.xml")))
12072 (replace 'bootstrap
12073 (lambda _
12074 (setenv "CONFIG_SHELL" (which "sh"))
12075 (invoke "autoreconf" "-fi"))))))
12076 (native-inputs (list autoconf
12077 automake
12078 bash-minimal
12079 xmlto
12080 docbook-xsl
12081 libxslt
12082 asciidoc))
12083 (home-page "https://gitlab.freedesktop.org/libevdev/evtest")
12084 (synopsis "Kernel evdev device information and monitor")
12085 (description
12086 "@code{evtest} is a tool to print @code{evdev} kernel events. It reads
12087directly from the kernel device and prints a device description and the events
12088with the value and the symbolic name.")
12089 (license license:gpl2+)))
12090
12091(define-public tp-smapi-module
12092 (package
12093 (name "tp-smapi-module")
12094 (version "0.44")
12095 (source (origin
12096 (method git-fetch)
12097 (uri (git-reference
12098 (url "https://github.com/linux-thinkpad/tp_smapi")
12099 (commit (string-append "tp-smapi/" version))))
12100 (file-name (git-file-name name version))
12101 (sha256
12102 (base32
12103 "0kzbks07bh5jbi1n311zp9cbp1xxyzi7nys8wq1k0k5ig81h9w6k"))))
12104 (build-system linux-module-build-system)
12105 (arguments
12106 `(#:tests? #f)) ;there are none.
12107 (home-page "https://github.com/linux-thinkpad/tp_smapi")
12108 (synopsis
12109 "Linux Kernel module exposing features of ThinkPad hardware")
12110 (description
12111 "This package provides a Linux Kernel module that controls
12112battery charging of specific ThinkPad laptops. It also includes an improved
12113version of the HDAPS driver. The underlying hardware interfaces are
12114@acronym{SMAPI, System Management Application Program Interface} and direct
12115access to the embedded controller.")
12116 (license license:gpl2+)))
12117
12118(define-public modprobed-db
12119 (package
12120 (name "modprobed-db")
12121 (version "2.48")
12122 (source (origin
12123 (method git-fetch)
12124 (uri (git-reference
12125 (url "https://github.com/graysky2/modprobed-db")
12126 (commit (string-append "v" version))))
12127 (file-name (git-file-name name version))
12128 (sha256
12129 (base32
12130 "0jscinga32jjvy3vwl4s1pyd5fjgqhmmk010k665nhil302hzjdc"))))
12131 (build-system gnu-build-system)
12132 (arguments
12133 (list #:tests? #f ;no tests
12134 #:make-flags
12135 #~(list (string-append "PREFIX=" #$output)
12136 "INITDIR_SYSTEMD=no-thanks")
12137 #:phases
12138 #~(modify-phases %standard-phases
12139 (delete 'configure)
12140 (add-after 'install 'fix-path
12141 (lambda* (#:key inputs #:allow-other-keys)
12142 (substitute* (string-append #$output "/bin/modprobed-db")
12143 (("/usr") #$output)
12144 (((string-append "(" (string-join (list "awk"
12145 "cp"
12146 "cut"
12147 "getent"
12148 "grep"
12149 "logname"
12150 "md5sum"
12151 "mkdir"
12152 "mv"
12153 "sed"
12154 "sort"
12155 "uniq"
12156 "wc")
12157 "|") ")") m)
12158 (search-input-file inputs (string-append "/bin/" m)))
12159 (("modprobe ")
12160 (string-append
12161 (search-input-file inputs "/bin/modprobe") " "))))))))
12162 (inputs (list coreutils kmod gawk glibc grep sed))
12163 (home-page "https://wiki.archlinux.org/title/Modprobed-db")
12164 (synopsis "Keep track of Linux modules that have been probed")
12165 (description
12166 "Modprobed-db is a useful utility for users wishing to build a minimal
12167kernel via a @code{make localmodconfig}. In a nutshell, this @command{make}
12168target creates a config based on the current config and a list of modules you
12169define (that @command{modprobed-db} keeps for you). It then disables any
12170module option that is not needed thus not building extraneous modules. This
12171results in a system-specific, streamlined kernel package and footprint as well
12172as reduced compilation times.
12173
12174Modprobed-db simply logs every module ever probed on the target system to a
12175text-based database (@file{$XDG_CONFIG_HOME/modprobed-db}), which can be read
12176directly by @code{make localmodconfig} as described above.")
12177 (license license:expat)))
12178
12179(define-public kernel-hardening-checker
12180 (package
12181 (name "kernel-hardening-checker")
12182 (version "0.6.17.1")
12183 (source (origin
12184 (method git-fetch)
12185 (uri (git-reference
12186 (url "https://github.com/a13xp0p0v/kernel-hardening-checker")
12187 (commit (string-append "v" version))))
12188 (file-name (git-file-name name version))
12189 (sha256
12190 (base32
12191 "04r9bbayhs1ik84908q148k9djawy69zarxw0vc31dfbf64mni62"))))
12192 (build-system pyproject-build-system)
12193 (arguments
12194 (list #:tests? #f)) ;no active tests, runtime only, see GitHub Actions
12195 (native-inputs
12196 (list python-setuptools))
12197 (home-page "https://github.com/a13xp0p0v/kernel-hardening-checker")
12198 (synopsis
12199 "Tool for checking the security hardening options of the Linux kernel")
12200 (description
12201 "@code{kernel-hardening-checker} is a tool for checking the security
12202hardening options of the Linux kernel. Provided preferences are based on
12203suggestions from various sources, including:
12204
12205@itemize
12206@item KSPP recommended settings
12207@item CLIP OS kernel configuration
12208@item Last public grsecurity patch (options which they disable)
12209@item SECURITY_LOCKDOWN_LSM patchset
12210@item Direct feedback from the Linux kernel maintainers
12211@end itemize\n
12212This tool supports checking Kconfig options and kernel cmdline parameters.")
12213 (license license:gpl3)))
12214
12215(define-deprecated-package kconfig-hardened-check
12216 kernel-hardening-checker)
12217
12218(define-public firejail
12219 (package
12220 (name "firejail")
12221 (version "0.9.78")
12222 (source (origin
12223 (method git-fetch)
12224 (uri (git-reference
12225 (url "https://github.com/netblue30/firejail")
12226 (commit version)))
12227 (file-name (git-file-name name version))
12228 (sha256
12229 (base32
12230 "18bsnwyg7aidm74qckrp437gr0zy9bpq1b1wr6mfnj61v74fwwxs"))))
12231 (arguments
12232 (list #:phases
12233 #~(modify-phases %standard-phases
12234 (replace 'check
12235 (lambda* (#:key tests? #:allow-other-keys)
12236 (when tests?
12237 (with-directory-excursion "test"
12238 (invoke "make"))))))))
12239 (build-system gnu-build-system)
12240 (inputs
12241 (list apparmor xdg-dbus-proxy))
12242 (synopsis "Linux namespaces sandbox program")
12243 (description
12244 "Firejail is a SUID sandbox program that reduces the risk of security
12245breaches by restricting the running environment of untrusted applications
12246using Linux namespaces, seccomp-bpf and Linux capabilities. The software
12247includes sandbox profiles for a number of common Linux programs. Firejail
12248should be added to the list of setuid programs in the system configuration to
12249work properly.")
12250 (home-page "https://github.com/netblue30/firejail")
12251 (supported-systems
12252 (filter (cut string-suffix? "-linux" <>) %supported-systems))
12253 (license license:gpl2+)))
12254
12255(define-public firejail-disable-sandbox-check
12256 (package/inherit
12257 firejail
12258 (name "firejail-disable-sandbox-check")
12259 (arguments
12260 (substitute-keyword-arguments (package-arguments firejail)
12261 ((#:configure-flags flags #~'())
12262 #~(append #$flags
12263 (list "--disable-sandbox-check")))))
12264 (description
12265 (string-append (package-description firejail)
12266 " Builded with @code{--disable-sandbox-check}, which is
12267 only intended for development."))))
12268
12269(define-public edac-utils
12270 (package
12271 (name "edac-utils")
12272 (version "0.18")
12273 (source (origin
12274 (method git-fetch)
12275 (uri (git-reference
12276 (url "https://github.com/grondo/edac-utils.git")
12277 (commit version)))
12278 (file-name (string-append name "-" version "-checkout"))
12279 (sha256
12280 (base32
12281 "04j686m58wsnyy5di7rz0sw9jahlm4ziwxjmgs31pjb87vzw3xgp"))))
12282 (build-system gnu-build-system)
12283 (native-inputs
12284 (list perl))
12285 (inputs
12286 (list sysfsutils))
12287 (synopsis "Memory error detection and correction userspace helpers")
12288 (description "This package provides userspace helpers for memory
12289error detection and correction (EDAC).")
12290 (home-page "https://github.com/grondo/edac-utils")
12291 (license license:gpl2+)))
12292
12293(define-public spectre-meltdown-checker
12294 (package
12295 (name "spectre-meltdown-checker")
12296 (version "0.46")
12297 (source (origin
12298 (method git-fetch)
12299 (uri (git-reference
12300 (url "https://github.com/speed47/spectre-meltdown-checker")
12301 (commit (string-append "v" version))))
12302 (file-name (git-file-name name version))
12303 (patches
12304 (search-patches
12305 "spectre-meltdown-checker-externalize-fwdb.patch"))
12306 ;; Remove builtin firmware database.
12307 (modules '((guix build utils)))
12308 (snippet '(substitute* "spectre-meltdown-checker.sh"
12309 (("^# [AI],.*") "")))
12310 (sha256
12311 (base32
12312 "0j42p6dayb7k87kf8sqimxlaswis3qh0569a15zccyknv9vf129k"))))
12313 (build-system copy-build-system)
12314 (arguments
12315 (list
12316 #:install-plan
12317 #~'(("spectre-meltdown-checker.sh" "bin/spectre-meltdown-checker"))
12318 #:phases
12319 #~(modify-phases %standard-phases
12320 (add-after 'unpack 'fixpath
12321 (lambda* (#:key inputs #:allow-other-keys)
12322 (define* (find-command inputs cmd #:optional (bin "bin"))
12323 (search-input-file inputs (string-append bin "/" cmd)))
12324 (substitute* "spectre-meltdown-checker.sh"
12325 ;; ${opt_arch_prefix}CMD
12326 (("\\$\\{opt_arch_prefix\\}\\<(nm|objdump|readelf|strings)\\>"
12327 all cmd)
12328 (find-command inputs cmd))
12329
12330 ;; Commands safe to substitute directly.
12331 (("\\<(awk|(base|dir)name|bunzip2|g(un)?zip|lz4)\\>" all cmd)
12332 (find-command inputs cmd))
12333 (("\\<(lzop|mktemp|modprobe|pgrep|rmmod|umount)\\>" all cmd)
12334 (find-command inputs cmd))
12335 (("\\<(unlzma|unxz|unzstd|uuencode)\\>" all cmd)
12336 (find-command inputs cmd))
12337
12338 ;; Commands which should only be substituted based on their
12339 ;; surroundings: First up, dd.
12340 (("\\<(dd)\\> if=" all cmd)
12341 (string-append
12342 (find-command inputs cmd)
12343 " if="))
12344
12345 ;; Another special case: sysctl is in sbin.
12346 (("(if |\\$\\( *)\\<(sysctl)\\>" all pre cmd)
12347 (string-append pre (find-command inputs cmd "sbin")))
12348
12349 ;; Meow
12350 (("cat (<<EOF|\"\\$)" all what)
12351 (string-append (find-command inputs "cat") " " what))
12352 (("'cat'")
12353 (string-append "'" (find-command inputs "cat") "'"))
12354 (("\"cat\"")
12355 (string-append "\"" (find-command inputs "cat") "\""))
12356
12357 ;; ${COMMAND} -
12358 ;; ${COMMAND} ^
12359 (("\\<(base64|cut|grep|head|id|mount)\\> ([-^])" all cmd suffix)
12360 (string-append (find-command inputs cmd) " " suffix))
12361 (("\\<(od|perl|rm|uname|xargs)\\> ([-^])" all cmd suffix)
12362 (string-append (find-command inputs cmd) " " suffix))
12363
12364 ;; ${COMMAND} |
12365 (("\\<(dmesg)\\> \\|" all cmd)
12366 (string-append (find-command inputs cmd) " |"))
12367 ;; | ${COMMAND}
12368 (("\\| \\<(grep|sed|sort|stat|tr)\\>" all cmd)
12369 (string-append "| " (find-command inputs cmd)))
12370
12371 ;; Command in sub-shell, i.e. $($COMMAND ...)
12372 (("\\$\\( *(\\<cat|find|grep|mount|nproc|stat|tr\\>)"
12373 all cmd)
12374 (string-append "$(" (find-command inputs cmd)))
12375
12376 ;; command -v
12377 (("command -v \"*\\<(base64|nproc|perl|printf)\\>\"*" all cmd)
12378 (string-append "command -v " (find-command inputs cmd)))))))))
12379 (inputs (list kmod lz4 lzop perl procps sharutils util-linux zstd))
12380 (home-page "https://github.com/speed47/spectre-meltdown-checker")
12381 (synopsis "CPU vulnerability / mitigation checker")
12382 (description
12383 "This package provides a shell script to assess your system's resilience
12384against the several transient execution CVEs that were published since early
123852018, and gives guidance as to how to mitigate them.")
12386 (license license:gpl3)))
12387
12388(define-public csmith
12389 (package
12390 (name "csmith")
12391 (version "2.3.0")
12392 (source (origin
12393 (method git-fetch)
12394 (uri (git-reference
12395 (url "https://github.com/csmith-project/csmith")
12396 (commit (string-append "csmith-" version))))
12397 (file-name (git-file-name name version))
12398 (sha256
12399 (base32
12400 "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
12401 (build-system gnu-build-system)
12402 (native-inputs
12403 (list autoconf automake libtool m4 perl))
12404 (arguments
12405 (list
12406 #:tests? #f ;no test suite
12407 ;; Do not install headers under 'include/csmith-VERSION' but in
12408 ;; 'include/csmith'.
12409 #:phases
12410 `(modify-phases %standard-phases
12411 (add-after 'unpack 'patch-includedir
12412 (lambda _
12413 (substitute* "runtime/Makefile.am"
12414 (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
12415 "$(includedir)/$(PACKAGE)"))))
12416 (add-before 'bootstrap 'force-bootstrap
12417 (lambda _
12418 (delete-file "configure"))))))
12419 (home-page "https://github.com/csmith-project/csmith")
12420 (synopsis "Random generator of C programs")
12421 (description "The primary purpose of Csmith is to find compiler bugs with
12422random programs using differential testing.")
12423 (license license:bsd-4)))
12424
12425(define-public ipvsadm
12426 (package
12427 (name "ipvsadm")
12428 (version "1.31")
12429 (source
12430 (origin
12431 (method url-fetch)
12432 (uri (string-append "https://kernel.org/pub/linux/utils/kernel"
12433 "/ipvsadm/ipvsadm-" version ".tar.xz"))
12434 (sha256
12435 (base32 "1nyzpv1hx75k9lh0vfxfhc0p2fpqaqb38xpvs8sn88m1nljmw2hs"))))
12436 (build-system gnu-build-system)
12437 (native-inputs (list linux-libre-headers pkg-config which))
12438 (inputs (list libnl popt))
12439 (arguments
12440 (list #:tests? #f
12441 #:parallel-build? #f ;build fails randomly with '-j'
12442 #:make-flags
12443 #~(list (string-join
12444 (list "CFLAGS="
12445 (string-append "-I"
12446 #$(this-package-input "libnl")
12447 "/include/libnl3")
12448 (string-append "-L" #$(this-package-input "libnl")
12449 "/lib")
12450 "-fPIC")
12451 " ")
12452 (string-append "CC=" #$(cc-for-target))
12453 (string-append "SBIN=" #$output "/sbin")
12454 (string-append "INIT=" #$output "/etc/init.d")
12455 (string-append "MANDIR=" #$output "/share/man"))
12456 #:phases #~(modify-phases %standard-phases
12457 (delete 'configure))))
12458 (home-page "http://www.linuxvirtualserver.org/software/ipvs.html")
12459 (synopsis "IP virtual server administration utility")
12460 (description "@code{ipvsadm(8)} is used to set up, maintain or inspect the
12461virtual server table in the Linux kernel. The Linux Virtual Server can be used
12462to build scalable network services based on a cluster of two or more nodes.")
12463 (license license:gpl2+)))
12464
12465(define-public ryzenadj
12466 (package
12467 (name "ryzenadj")
12468 (version "0.17.0")
12469 (source (origin
12470 (method url-fetch)
12471 (uri (string-append "https://github.com/flygoat/ryzenadj/archive/refs/tags/"
12472 "v" version ".tar.gz"))
12473 (sha256
12474 (base32 "0i2x6kbn2ix52vjz1mmh0c0g3w0k4sn0lq68wbsk0pgndzcck2l4"))
12475 (modules '((guix build utils)))
12476 (snippet
12477 '(begin (delete-file-recursively "win32")
12478 #t))))
12479 (build-system cmake-build-system)
12480 (inputs (list pciutils))
12481 (arguments
12482 (list #:tests? #f ; No test suite
12483 #:phases #~(modify-phases %standard-phases
12484 (add-before 'install 'build
12485 (lambda _
12486 (invoke "cmake" "-DCMAKE_BUILD_TYPE=Release" "."))))))
12487 (home-page "https://github.com/flygoat/ryzenadj")
12488 (synopsis "Power management tool for AMD Ryzen APUs")
12489 (description
12490 "@command{ryzenadj} is an utility to adjust power management settings for
12491AMD Ryzen mobile processors. You will need to ensure it can access /dev/mem,
12492for instance by using the \"iomem=relaxed\" kernel argument.")
12493 (license license:lgpl3)))
12494
12495(define-public ryzen-smu
12496 (package
12497 (name "ryzen-smu")
12498 (version "0.1.5")
12499 (source (origin
12500 (method git-fetch)
12501 (uri (git-reference
12502 (url "https://gitlab.com/leogx9r/ryzen_smu.git")
12503 (commit (string-append "v" version))))
12504 (file-name (git-file-name name version))
12505 (sha256
12506 (base32
12507 "010la2a8zp7rljlg5ssc9ragzva4ca05gvzlicjagl508659d2wz"))))
12508 (build-system linux-module-build-system)
12509 (arguments
12510 `(#:tests? #f)) ; no tests
12511 (synopsis "System Management Unit driver for AMD Ryzen processors")
12512 (description "This package provides a way to access the
12513System Management Unit for certain AMD Ryzen processors.
12514This includes access to the System Management Network.")
12515 (home-page "https://gitlab.com/leogx9r/ryzen_smu")
12516 (license license:gpl2)))
12517
12518(define-public hid-wiimote-plus
12519 (package
12520 (name "hid-wiimote-plus")
12521 (version "0.9.2")
12522 (source (origin
12523 (method git-fetch)
12524 (uri (git-reference
12525 (url "https://github.com/dkosmari/hid-wiimote-plus.git")
12526 (commit (string-append "v" version))))
12527 (file-name (git-file-name name version))
12528 (sha256
12529 (base32
12530 "1rkp311x60jm73xlqypxsp375rx3fa55jyrspz1aqjga0q6cvswi"))))
12531 (build-system linux-module-build-system)
12532 (arguments
12533 (list #:tests? #f)) ; No tests.
12534 (synopsis "WiiMote HID kernel module")
12535 (description "This package provides a WiiMote driver that follows the
12536Linux input convention. Specifically, that allows you to use the D-pad
12537as a gamepad.")
12538 (home-page "https://github.com/dkosmari/hid-wiimote-plus")
12539 (license license:gpl2+)))
12540
12541(define-public python-evemu
12542 (package
12543 (name "python-evemu")
12544 (version "2.7.0")
12545 (source (origin
12546 (method git-fetch)
12547 (uri (git-reference
12548 (url "https://gitlab.freedesktop.org/libevdev/evemu")
12549 (commit (string-append "v" version))))
12550 (file-name (git-file-name name version))
12551 (sha256
12552 (base32
12553 "1sxf6v2wnajj9srlkfjfymjmmp4dlq73gzjcjmaw015a3c0xl029"))))
12554 (build-system gnu-build-system)
12555 (arguments
12556 (list #:tests? #f ; would open device files
12557 #:phases
12558 #~(modify-phases %standard-phases
12559 (add-after 'unpack 'patch
12560 (lambda* (#:key inputs #:allow-other-keys)
12561 (substitute* "python/evemu/base.py"
12562 (("\"libevdev.so\"")
12563 (string-append "\"" (assoc-ref inputs "libevdev")
12564 "/lib/libevdev.so\""))))))))
12565 (native-inputs
12566 (list asciidoc autoconf automake libtool docbook-xsl pkg-config
12567 python-wrapper xmlto))
12568 (inputs
12569 (list libevdev))
12570 (synopsis "Record and replay input device events")
12571 (description "This package provides a way to record and replay device
12572descriptions and events, making it possible to emulate input devices
12573through the Linux kernel's input system. Emulated devices are for most
12574practical purposes indistinguishable from real devices.
12575
12576It provides a command line program and also a Python library.")
12577 (home-page "https://www.freedesktop.org/wiki/Evemu/")
12578 (license license:gpl3)))
12579
12580(define-public dualsensectl
12581 (package
12582 (name "dualsensectl")
12583 (version "0.7")
12584 (source (origin
12585 (method git-fetch)
12586 (uri (git-reference
12587 (url "https://github.com/nowrep/dualsensectl.git")
12588 (commit (string-append "v" version))))
12589 (file-name (git-file-name name version))
12590 (sha256
12591 (base32
12592 "05snsp5r3hc2yc1nf0w4aam1my4h0lkxnmy7k4glxvasd9jwahzw"))))
12593 (build-system meson-build-system)
12594 (native-inputs
12595 (list pkg-config))
12596 (inputs
12597 (list eudev dbus hidapi))
12598 (synopsis "Linux tool for controlling PS5 DualSense controller")
12599 (description "This package provides a Linux tool for controlling a PS5
12600DualSense controller. It has to be already connected via USB or connected
12601via Bluetooth.")
12602 (home-page "https://github.com/nowrep/dualsensectl")
12603 (license license:gpl2)))