projects/guix·blob next-master · refs

12616 lines · 548.8 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-2025 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 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;;;
90;;; This file is part of GNU Guix.
91;;;
92;;; GNU Guix is free software; you can redistribute it and/or modify it
93;;; under the terms of the GNU General Public License as published by
94;;; the Free Software Foundation; either version 3 of the License, or (at
95;;; your option) any later version.
96;;;
97;;; GNU Guix is distributed in the hope that it will be useful, but
98;;; WITHOUT ANY WARRANTY; without even the implied warranty of
99;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
100;;; GNU General Public License for more details.
101;;;
102;;; You should have received a copy of the GNU General Public License
103;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
104
105(define-module (gnu packages linux)
106 #:use-module (gnu packages)
107 #:use-module (gnu packages acl)
108 #:use-module (gnu packages adns)
109 #:use-module (gnu packages admin)
110 #:use-module (gnu packages algebra)
111 #:use-module (gnu packages apparmor)
112 #:use-module (gnu packages audio)
113 #:use-module (gnu packages autotools)
114 #:use-module (gnu packages avahi)
115 #:use-module (gnu packages backup)
116 #:use-module (gnu packages base)
117 #:use-module (gnu packages bash)
118 #:use-module (gnu packages bison)
119 #:use-module (gnu packages boost)
120 #:use-module (gnu packages calendar)
121 #:use-module (gnu packages check)
122 #:use-module (gnu packages cpio)
123 #:use-module (gnu packages cpp)
124 #:use-module (gnu packages crypto)
125 #:use-module (gnu packages cryptsetup)
126 #:use-module (gnu packages compression)
127 #:use-module (gnu packages curl)
128 #:use-module (gnu packages databases)
129 #:use-module (gnu packages datastructures)
130 #:use-module (gnu packages dbm)
131 #:use-module (gnu packages disk)
132 #:use-module (gnu packages docbook)
133 #:use-module (gnu packages documentation)
134 #:use-module (gnu packages dlang)
135 #:use-module (gnu packages elf)
136 #:use-module (gnu packages file)
137 #:use-module (gnu packages flex)
138 #:use-module (gnu packages fontutils)
139 #:use-module (gnu packages freedesktop)
140 #:use-module (gnu packages gawk)
141 #:use-module (gnu packages gcc)
142 #:use-module (gnu packages gettext)
143 #:use-module (gnu packages glib)
144 #:use-module (gnu packages gnome)
145 #:use-module (gnu packages gnupg)
146 #:use-module (gnu packages golang)
147 #:use-module (gnu packages gperf)
148 #:use-module (gnu packages graphviz)
149 #:use-module (gnu packages gstreamer)
150 #:use-module (gnu packages gtk)
151 #:use-module (gnu packages guile)
152 #:use-module (gnu packages haskell-apps)
153 #:use-module (gnu packages haskell-xyz)
154 #:use-module (gnu packages image)
155 #:use-module (gnu packages kde-frameworks)
156 #:use-module (gnu packages libedit)
157 #:use-module (gnu packages kde-graphics)
158 #:use-module (gnu packages libevent)
159 #:use-module (gnu packages libunwind)
160 #:use-module (gnu packages libusb)
161 #:use-module (gnu packages llvm)
162 #:use-module (gnu packages lsof)
163 #:use-module (gnu packages lua)
164 #:use-module (gnu packages m4)
165 #:use-module (gnu packages man)
166 #:use-module (gnu packages maths)
167 #:use-module (gnu packages multiprecision)
168 #:use-module (gnu packages ncurses)
169 #:use-module (gnu packages netpbm)
170 #:use-module (gnu packages networking)
171 #:use-module (gnu packages nss)
172 #:use-module (gnu packages onc-rpc)
173 #:use-module (gnu packages perl)
174 #:use-module (gnu packages pciutils)
175 #:use-module (gnu packages pkg-config)
176 #:use-module (gnu packages polkit)
177 #:use-module (gnu packages popt)
178 #:use-module (gnu packages protobuf)
179 #:use-module (gnu packages pulseaudio)
180 #:use-module (gnu packages python)
181 #:use-module (gnu packages python-build)
182 #:use-module (gnu packages python-xyz)
183 #:use-module (gnu packages qt)
184 #:use-module (gnu packages readline)
185 #:use-module (gnu packages regex)
186 #:use-module (gnu packages rpc)
187 #:use-module (gnu packages rrdtool)
188 #:use-module (gnu packages rsync)
189 #:use-module (gnu packages rust-sources)
190 #:use-module (gnu packages samba)
191 #:use-module (gnu packages sdl)
192 #:use-module (gnu packages serialization)
193 #:use-module (gnu packages slang)
194 #:use-module (gnu packages sqlite)
195 #:use-module (gnu packages tbb)
196 #:use-module (gnu packages texinfo)
197 #:use-module (gnu packages textutils)
198 #:use-module (gnu packages tls)
199 #:use-module (gnu packages valgrind)
200 #:use-module (gnu packages video)
201 #:use-module (gnu packages vim)
202 #:use-module (gnu packages vulkan)
203 #:use-module (gnu packages web)
204 #:use-module (gnu packages xiph)
205 #:use-module (gnu packages xml)
206 #:use-module (gnu packages xdisorg)
207 #:use-module (gnu packages xorg)
208 #:use-module (gnu packages groff)
209 #:use-module (gnu packages selinux)
210 #:use-module (gnu packages sphinx)
211 #:use-module (gnu packages swig)
212 #:use-module (guix platform)
213 #:use-module (guix build-system cmake)
214 #:use-module (guix build-system copy)
215 #:use-module (guix build-system gnu)
216 #:use-module (guix build-system go)
217 #:use-module (guix build-system meson)
218 #:use-module (guix build-system pyproject)
219 #:use-module (guix build-system python)
220 #:use-module (guix build-system qt)
221 #:use-module (guix build-system trivial)
222 #:use-module (guix build-system linux-module)
223 #:use-module (guix download)
224 #:use-module (guix git-download)
225 #:use-module ((guix licenses) #:prefix license:)
226 #:use-module (guix packages)
227 #:use-module (guix gexp)
228 #:use-module (guix store)
229 #:use-module (guix monads)
230 #:use-module (guix utils)
231 #:use-module (guix deprecation) ;for libcap/next
232 #:use-module (srfi srfi-1)
233 #:use-module (srfi srfi-2)
234 #:use-module (srfi srfi-26)
235 #:use-module (ice-9 match)
236 #:use-module (ice-9 regex)
237 #:export (customize-linux
238 make-defconfig))
239
240
241
242;;;
243;;; Linux kernel customization functions.
244;;;
245
246(define* (customize-linux #:key name
247 (linux linux-libre)
248 source
249 defconfig
250 modconfig
251 (configs "")
252 extra-version)
253 "Make a customized Linux package NAME derived from the LINUX package.
254
255If NAME is not given, then it defaults to the same name as the LINUX package.
256
257Unless SOURCE is given the source of LINUX is used.
258
259A DEFCONFIG file to be used can be given as an origin, as a file-like object
260(file-append, local-file etc.), or as a string with the name of a defconfig file
261available in the Linux sources. If DEFCONFIG is not given, then a defconfig
262file will be saved from the LINUX package configuration.
263
264MODCONFIG is an origin or file-like object used for make localmodconfig to
265disable unlisted modules. For instance, this can come from using modprobed-db
266periodically on a running machine to find all loaded modules.
267
268Additional CONFIGS will be used to modify the given or saved defconfig, which
269will finally be used to build Linux.
270
271CONFIGS can be a list of strings, with one configuration per line. The usual
272defconfig syntax has to be used, but there is a special extension to ease the
273removal of configurations. Comment lines are supported as well.
274
275Here is an example:
276
277 '(;; This string defines the version tail in 'uname -r'.
278 \"CONFIG_LOCALVERSION=\\\"-handcrafted\\\"
279 ;; This '# CONFIG_... is not set' syntax has to match exactly!
280 \"# CONFIG_BOOT_CONFIG is not set\"
281 \"CONFIG_NFS_SWAP=y\"
282 ;; This is a multiline configuration:
283 \"CONFIG_E1000=y
284# This is a comment, below follows an extension to unset a configuration:
285CONFIG_CMDLINE_EXTEND\")
286
287A string of configurations instead of a list of configuration strings is also
288possible.
289
290EXTRA-VERSION can be a string overwriting the EXTRAVERSION setting of the LINUX
291package, after being prepended by a hyphen. It will be visible in the output
292of 'uname -r' behind the Linux version numbers."
293 (package
294 (inherit linux)
295 (name (or name (package-name linux)))
296 (source (or source (package-source linux)))
297 (arguments
298 (substitute-keyword-arguments
299 (package-arguments linux)
300 ((#:imported-modules imported-modules %default-gnu-imported-modules)
301 `((guix build kconfig) ,@imported-modules))
302 ((#:modules modules)
303 `((guix build kconfig) ,@modules))
304 ((#:phases phases)
305 #~(modify-phases #$phases
306 (replace 'configure
307 (lambda* (#:key inputs #:allow-other-keys #:rest arguments)
308 (setenv "EXTRAVERSION"
309 #$(and extra-version
310 (not (string-null? extra-version))
311 (string-append "-" extra-version)))
312 (let* ((configs (string-append "arch/" #$(linux-srcarch)
313 "/configs/"))
314 (guix_defconfig (string-append configs
315 "guix_defconfig")))
316 #$(cond
317 ((not defconfig)
318 #~(begin
319 ;; Call the original 'configure phase.
320 (apply (assoc-ref #$phases 'configure) arguments)
321 ;; Save a defconfig file.
322 (invoke "make" "savedefconfig")
323 ;; Move the saved defconfig to the proper location.
324 (rename-file "defconfig"
325 guix_defconfig)))
326 ((string? defconfig)
327 ;; Use another existing defconfig from the Linux sources.
328 #~(rename-file (string-append configs #$defconfig)
329 guix_defconfig))
330 (else
331 ;; Copy the defconfig input to the proper location.
332 #~(copy-file #$defconfig guix_defconfig)))
333 (chmod guix_defconfig #o644)
334 (modify-defconfig guix_defconfig '#$configs)
335 (invoke "make" "guix_defconfig")
336 (verify-config ".config" guix_defconfig)
337 ;; Minimize module building if provided e.g. a modprobed-db
338 ;; database.
339 (if #$modconfig
340 (invoke "make" (string-append "LSMOD=" #$modconfig)
341 "localmodconfig")))))))))))
342
343(define (make-defconfig uri sha256-as-base32)
344 (origin (method url-fetch)
345 (uri uri)
346 (sha256 (base32 sha256-as-base32))))
347
348(define (linux-srcarch)
349 "Return the linux SRCARCH name, which is set in the toplevel Makefile of
350Linux and denotes the architecture-specific directory name below arch/ in its
351source code. Some few architectures share a common folder. It resembles the
352definition of SRCARCH based on ARCH in the Makefile and may be used to place a
353defconfig file in the proper path."
354 (let ((linux-arch (platform-linux-architecture
355 (lookup-platform-by-target-or-system
356 (or (%current-target-system)
357 (%current-system))))))
358 (match linux-arch
359 ("i386" "x86")
360 ("x86_64" "x86")
361 ("sparc32" "sparc")
362 ("sparc64" "sparc")
363 ("sh64" "sh")
364 (_ linux-arch))))
365
366(define-public (system->defconfig system)
367 "Some systems (notably powerpc-linux) require a special target for kernel
368defconfig. Return the appropriate Make target if applicable, otherwise return
369\"defconfig\"."
370 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
371 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
372 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
373 (else "defconfig")))
374
375
376;;;
377;;; Kernel source code deblobbing.
378;;;
379
380(define (linux-libre-deblob-scripts version gnu-revision
381 deblob-hash
382 deblob-check-hash)
383 (list (version-major+minor version)
384 (origin
385 (method url-fetch)
386 (uri (string-append "https://linux-libre.fsfla.org"
387 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
388 "deblob-" (version-major+minor version)))
389 (file-name (string-append "linux-libre-deblob-"
390 version "-" gnu-revision))
391 (sha256 deblob-hash))
392 (origin
393 (method url-fetch)
394 (uri (string-append "https://linux-libre.fsfla.org"
395 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
396 "deblob-check"))
397 (file-name (string-append "linux-libre-deblob-check-" version "-" gnu-revision))
398 (sha256 deblob-check-hash))))
399
400;; XXXX: Workaround 'snippet' limitations
401(define computed-origin-method (@@ (guix packages) computed-origin-method))
402
403(define (make-linux-libre-source version
404 upstream-source
405 deblob-scripts)
406 "Return a 'computed' origin that generates a Linux-libre tarball from the
407corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
408 (match deblob-scripts
409 ((deblob-version (? origin? deblob) (? origin? deblob-check))
410 (unless (string=? deblob-version (version-major+minor version))
411 ;; The deblob script cannot be expected to work properly on a
412 ;; different version (major+minor) of Linux, even if no errors
413 ;; are signaled during execution.
414 (error "deblob major+minor version mismatch"))
415 (origin
416 (method computed-origin-method)
417 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
418 (sha256 #f)
419 (uri
420 (delay
421 (with-imported-modules '((guix build utils))
422 #~(begin
423 (use-modules (guix build utils)
424 (srfi srfi-1)
425 (ice-9 match)
426 (ice-9 ftw))
427
428 (setvbuf (current-output-port) 'line)
429
430 (let ((dir (string-append "linux-" #$version)))
431
432 (mkdir "/tmp/bin")
433 (set-path-environment-variable
434 "PATH" '("bin")
435 (list "/tmp"
436 #+(canonical-package bash)
437 #+(canonical-package coreutils)
438 #+(canonical-package diffutils)
439 #+(canonical-package findutils)
440 #+(canonical-package patch)
441 #+(canonical-package xz)
442 #+(canonical-package sed)
443 #+(canonical-package grep)
444 #+(canonical-package bzip2)
445 #+(canonical-package gzip)
446 #+(canonical-package tar)
447 #+(canonical-package gawk)
448 #+python-wrapper))
449
450 (with-directory-excursion "/tmp/bin"
451
452 (copy-file #+deblob "deblob")
453 (chmod "deblob" #o755)
454 (substitute* "deblob"
455 (("/bin/sh") (which "sh")))
456
457 (copy-file #+deblob-check "deblob-check")
458 (chmod "deblob-check" #o755)
459 (substitute* "deblob-check"
460 (("/bin/sh") (which "sh"))
461 (("/bin/sed") (which "sed"))
462 (("/usr/bin/python") (which "python"))))
463
464 (if (file-is-directory? #+upstream-source)
465 (begin
466 (format #t "Copying upstream linux source...~%")
467 (invoke "cp" "--archive" #+upstream-source dir)
468 (invoke "chmod" "--recursive" "u+w" dir))
469 (begin
470 (format #t "Unpacking upstream linux tarball...~%")
471 (invoke "tar" "xf" #$upstream-source)
472 (match (scandir "."
473 (lambda (name)
474 (and (not (member name '("." "..")))
475 (file-is-directory? name))))
476 ((unpacked-dir)
477 (unless (string=? dir unpacked-dir)
478 (rename-file unpacked-dir dir)))
479 (dirs
480 (error "multiple directories found" dirs)))))
481
482 (with-directory-excursion dir
483 (format #t "Running deblob script...~%")
484 (invoke "/tmp/bin/deblob"))
485
486 (format #t "~%Packing new Linux-libre tarball...~%")
487 (invoke "tar" "cvfa" #$output
488 ;; Avoid non-determinism in the archive.
489 "--mtime=@0"
490 "--owner=root:0"
491 "--group=root:0"
492 "--sort=name"
493 "--hard-dereference"
494 dir)
495
496 (format #t "~%Scanning the generated tarball for blobs...~%")
497 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
498 #$output))))))))))
499
500
501;;;
502;;; Kernel sources.
503;;;
504
505(define (linux-libre-urls version gnu-revision)
506 "Return a list of URLs for Linux-Libre VERSION."
507 (list (string-append
508 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
509 version "-" gnu-revision "/linux-libre-" version "-" gnu-revision ".tar.xz")
510
511 ;; XXX: Work around <http://bugs.gnu.org/14851>.
512 (string-append
513 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
514 version "-" gnu-revision ".tar.xz")
515
516 ;; Maybe this URL will become valid eventually.
517 (string-append
518 "mirror://gnu/linux-libre/" version "-" gnu-revision "/linux-libre-"
519 version "-" gnu-revision ".tar.xz")))
520
521(define (%upstream-linux-source version hash)
522 (origin
523 (method url-fetch)
524 (uri (string-append "mirror://kernel.org"
525 "/linux/kernel/v" (version-major version) ".x/"
526 "linux-" version ".tar.xz"))
527 (sha256 hash)))
528
529;; The current "stable" kernels. That is, the most recently released major
530;; versions that are still supported upstream.
531
532(define-public linux-libre-6.17-version "6.17.12")
533(define-public linux-libre-6.17-gnu-revision "gnu")
534(define deblob-scripts-6.17
535 (linux-libre-deblob-scripts
536 linux-libre-6.17-version
537 linux-libre-6.17-gnu-revision
538 (base32 "15qc7p6axs5l9syizbcbnksw8lxm8nnlcrl3q4k8cbs3lrxacpjv")
539 (base32 "14fypjidk49l0799dbi1pacy37ks94k0bs38cck2y4glxfpbfqr6")))
540(define-public linux-libre-6.17-pristine-source
541 (let ((version linux-libre-6.17-version)
542 (hash (base32 "1mlqirjzyx3zvvm87gf7slj2d5gdpp13vw91dgbfk54iz6b08y22")))
543 (make-linux-libre-source version
544 (%upstream-linux-source version hash)
545 deblob-scripts-6.17)))
546
547;; The "longterm" kernels — the older releases with long-term upstream support.
548;; Here are the support timelines:
549;; <https://www.kernel.org/category/releases.html>
550
551(define-public linux-libre-6.12-version "6.12.62")
552(define-public linux-libre-6.12-gnu-revision "gnu")
553(define deblob-scripts-6.12
554 (linux-libre-deblob-scripts
555 linux-libre-6.12-version
556 linux-libre-6.12-gnu-revision
557 (base32 "168aykyvyyp34549hqhlprl0n052q8wdb2y3vyxqw40wpf2vw3ln")
558 (base32 "1yl447396g454116j8v17wsqg5i0gyb2rrxvaygw6xdkbwrrj28j")))
559(define-public linux-libre-6.12-pristine-source
560 (let ((version linux-libre-6.12-version)
561 (hash (base32 "04rcnr7bgrqqfj62l31mxx553bjdalr5f46xjbcmvawgmj2wdqhk")))
562 (make-linux-libre-source version
563 (%upstream-linux-source version hash)
564 deblob-scripts-6.12)))
565
566(define-public linux-libre-6.6-version "6.6.119")
567(define-public linux-libre-6.6-gnu-revision "gnu")
568(define deblob-scripts-6.6
569 (linux-libre-deblob-scripts
570 linux-libre-6.6-version
571 linux-libre-6.6-gnu-revision
572 (base32 "0y3lawljby2rl0mb0yjdyaasci4pl935y8xa0dnmbzff23knkxlw")
573 (base32 "11i7pvm5n31rvp05msbm3ciclr84cz9c94f5r5aa6mmzhslwpbxk")))
574(define-public linux-libre-6.6-pristine-source
575 (let ((version linux-libre-6.6-version)
576 (hash (base32 "1s75ad95g4y80idadzqmj9kj4rb3dhnvny9lg4lcq15l1fc9p81x")))
577 (make-linux-libre-source version
578 (%upstream-linux-source version hash)
579 deblob-scripts-6.6)))
580
581(define-public linux-libre-6.1-version "6.1.159")
582(define-public linux-libre-6.1-gnu-revision "gnu")
583(define deblob-scripts-6.1
584 (linux-libre-deblob-scripts
585 linux-libre-6.1-version
586 linux-libre-6.1-gnu-revision
587 (base32 "10gcbkd5jxfspa712kvb3qmsjgsapd9cz47pmpfk03bbfzf8ydlv")
588 (base32 "0f3jgbfd2j7sz7h1hb30s1r9147g1cbb3ia09k9834fvbiz1ihaa")))
589(define-public linux-libre-6.1-pristine-source
590 (let ((version linux-libre-6.1-version)
591 (hash (base32 "17ib6ila2s8rclqpfxlkk1g72azj2r46k2x1q3n2j24qjfz7w80z")))
592 (make-linux-libre-source version
593 (%upstream-linux-source version hash)
594 deblob-scripts-6.1)))
595
596(define-public linux-libre-5.15-version "5.15.197")
597(define-public linux-libre-5.15-gnu-revision "gnu")
598(define deblob-scripts-5.15
599 (linux-libre-deblob-scripts
600 linux-libre-5.15-version
601 linux-libre-5.15-gnu-revision
602 (base32 "0b2gd83ihxlq490gpgq930misc6jrckw4rzl7fvwd0qzczqjvff5")
603 (base32 "0rg65s6kd9gxxa3wl6180pr39rb6zbcicwjik4kygs2ns0247y56")))
604(define-public linux-libre-5.15-pristine-source
605 (let ((version linux-libre-5.15-version)
606 (hash (base32 "12k6c09lgs4ahmxbrg8g3q1ngldajmzyz7y2nr1l8yhhwbw8s8gx")))
607 (make-linux-libre-source version
608 (%upstream-linux-source version hash)
609 deblob-scripts-5.15)))
610
611(define-public linux-libre-5.10-version "5.10.247")
612(define-public linux-libre-5.10-gnu-revision "gnu1")
613(define deblob-scripts-5.10
614 (linux-libre-deblob-scripts
615 linux-libre-5.10-version
616 linux-libre-5.10-gnu-revision
617 (base32 "1wn9k4lbxcc9rzl1rqidlnb472wyayillrh57gyxnghi7j9ghqna")
618 (base32 "0r1whrfhhhjyvppiidhihcvyzcab6dva6g9a4div8jkxm62s2cq3")))
619(define-public linux-libre-5.10-pristine-source
620 (let ((version linux-libre-5.10-version)
621 (hash (base32 "037yv5lryfanpfbk3z60yfsx14nskgf386b6cfkbzn7wl5xvij3h")))
622 (make-linux-libre-source version
623 (%upstream-linux-source version hash)
624 deblob-scripts-5.10)))
625
626(define-public linux-libre-5.4-version "5.4.302")
627(define-public linux-libre-5.4-gnu-revision "gnu1")
628(define deblob-scripts-5.4
629 (linux-libre-deblob-scripts
630 linux-libre-5.4-version
631 linux-libre-5.4-gnu-revision
632 (base32 "168ysrpcbfhm6s71l9w8ibjq2frjmiaixc2wbsq86gx2zw6zyb5p")
633 (base32 "0l7pwhgw9laxfypcpqlz411x3hybcw2269abh3lpcw96bgv5m1k2")))
634(define-public linux-libre-5.4-pristine-source
635 (let ((version linux-libre-5.4-version)
636 (hash (base32 "0ga2q6lf6xvb7pb6kn2prgywsvsavb4kwygsn37xd91ay43k4smf")))
637 (make-linux-libre-source version
638 (%upstream-linux-source version hash)
639 deblob-scripts-5.4)))
640
641(define %boot-logo-patch
642 ;; Linux-Libre boot logo featuring Freedo and a gnu.
643 (origin
644 (method url-fetch)
645 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
646 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
647 (sha256
648 (base32
649 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
650
651(define %linux-libre-arm-export-__sync_icache_dcache-patch
652 (origin
653 (method url-fetch)
654 (uri (string-append
655 "https://salsa.debian.org/kernel-team/linux"
656 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
657 "/debian/patches/bugfix/arm/"
658 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
659 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
660 (sha256
661 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
662
663(define (source-with-patches source patches)
664 (origin
665 (inherit source)
666 (patches (append (origin-patches source)
667 patches))))
668
669(define-public linux-libre-6.17-source
670 (source-with-patches linux-libre-6.17-pristine-source
671 (list %boot-logo-patch
672 %linux-libre-arm-export-__sync_icache_dcache-patch)))
673
674(define-public linux-libre-6.12-source
675 (source-with-patches linux-libre-6.12-pristine-source
676 (list %boot-logo-patch
677 %linux-libre-arm-export-__sync_icache_dcache-patch)))
678
679(define-public linux-libre-6.6-source
680 (source-with-patches linux-libre-6.6-pristine-source
681 (list %boot-logo-patch
682 %linux-libre-arm-export-__sync_icache_dcache-patch)))
683
684(define-public linux-libre-6.1-source
685 (source-with-patches linux-libre-6.1-pristine-source
686 (append
687 (list %boot-logo-patch
688 %linux-libre-arm-export-__sync_icache_dcache-patch)
689 (search-patches
690 "linux-libre-infodocs-target.patch"))))
691
692(define-public linux-libre-5.15-source
693 (source-with-patches linux-libre-5.15-pristine-source
694 (list %boot-logo-patch
695 %linux-libre-arm-export-__sync_icache_dcache-patch)))
696
697(define-public linux-libre-5.10-source
698 (source-with-patches linux-libre-5.10-pristine-source
699 (list %boot-logo-patch
700 %linux-libre-arm-export-__sync_icache_dcache-patch)))
701
702(define-public linux-libre-5.4-source
703 (source-with-patches linux-libre-5.4-pristine-source
704 (list %boot-logo-patch
705 %linux-libre-arm-export-__sync_icache_dcache-patch
706 ;; Pinebook Pro patch from linux-next,
707 ;; can be dropped for linux-libre 5.7
708 (search-patch
709 "linux-libre-support-for-Pinebook-Pro.patch"))))
710
711
712;;;
713;;; Kernel headers.
714;;;
715
716(define %linux-libre-timeout-properties
717 ;; Package properties for 'linux-libre' and 'linux-libre-headers' packages.
718 `((timeout . ,(* 8 3600)) ;deblob takes >5h on AArch64
719 (max-silent-time . ,(* 3 3600)))) ;don't time out on blob scan
720
721(define (make-linux-libre-headers version gnu-revision hash-string)
722 (make-linux-libre-headers* version gnu-revision
723 (origin
724 (method url-fetch)
725 (uri (linux-libre-urls version gnu-revision))
726 (sha256 (base32 hash-string)))))
727
728(define (make-linux-libre-headers* version gnu-revision source)
729 (package
730 (name "linux-libre-headers")
731 (version version)
732 (source source)
733 (build-system gnu-build-system)
734 (native-inputs `(("perl" ,perl)
735 ,@(if (version>=? version "4.16")
736 `(("flex" ,flex)
737 ("bison" ,bison))
738 '())))
739 (arguments
740 `(#:modules ((guix build gnu-build-system)
741 (guix build utils)
742 (srfi srfi-1)
743 (ice-9 match))
744 #:phases
745 (modify-phases %standard-phases
746 (delete 'configure)
747 (replace 'build
748 (lambda _
749 (let ((arch ,(platform-linux-architecture
750 (lookup-platform-by-target-or-system
751 (or (%current-target-system)
752 (%current-system)))))
753 (defconfig ,(system->defconfig
754 (or (%current-target-system)
755 (%current-system))))
756 (make-target ,(if (version>=? version "5.3")
757 "headers"
758 "headers_check")))
759 (setenv "ARCH" arch)
760 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
761 (invoke "make" defconfig)
762 (invoke "make" "mrproper" make-target))))
763 (replace 'install
764 (lambda* (#:key outputs #:allow-other-keys)
765 (let ((out (assoc-ref outputs "out")))
766
767 ;; Mimic the quiet_cmd_headers_install target to avoid a
768 ;; dependency on rsync.
769 (for-each (lambda (file)
770 (let ((destination (string-append
771 out "/include/"
772 ;; Drop the 'usr/include' prefix.
773 (match (string-split file #\/)
774 ((_ _ path ...)
775 (string-join path "/"))))))
776 (format #t "`~a' -> `~a'~%" file destination)
777 (install-file file (dirname destination))))
778 (find-files "usr/include" "\\.h$"))
779
780 (mkdir (string-append out "/include/config"))
781 (call-with-output-file
782 (string-append out
783 "/include/config/kernel.release")
784 (lambda (p)
785 (format p "~a-default~%" ,version)))))))
786 #:allowed-references ()
787 #:tests? #f))
788 (supported-systems (remove target-hurd? %supported-systems))
789 (properties %linux-libre-timeout-properties)
790 (home-page "https://www.gnu.org/software/linux-libre/")
791 (synopsis "GNU Linux-Libre kernel headers")
792 (description "Headers of the Linux-Libre kernel.")
793 (license license:gpl2)))
794
795(define-public linux-libre-headers-6.17
796 (make-linux-libre-headers* linux-libre-6.17-version
797 linux-libre-6.17-gnu-revision
798 linux-libre-6.17-source))
799
800(define-public linux-libre-headers-6.12
801 (make-linux-libre-headers* linux-libre-6.12-version
802 linux-libre-6.12-gnu-revision
803 linux-libre-6.12-source))
804
805(define-public linux-libre-headers-6.6
806 (make-linux-libre-headers* linux-libre-6.6-version
807 linux-libre-6.6-gnu-revision
808 linux-libre-6.6-source))
809
810(define-public linux-libre-headers-6.1
811 (make-linux-libre-headers* linux-libre-6.1-version
812 linux-libre-6.1-gnu-revision
813 linux-libre-6.1-source))
814
815(define-public linux-libre-headers-5.15
816 (make-linux-libre-headers* linux-libre-5.15-version
817 linux-libre-5.15-gnu-revision
818 linux-libre-5.15-source))
819
820(define-public linux-libre-headers-5.10
821 (make-linux-libre-headers* linux-libre-5.10-version
822 linux-libre-5.10-gnu-revision
823 linux-libre-5.10-source))
824
825(define-public linux-libre-headers-5.4
826 (make-linux-libre-headers* linux-libre-5.4-version
827 linux-libre-5.4-gnu-revision
828 linux-libre-5.4-source))
829
830;; The following package is used in the early bootstrap, and thus must be kept
831;; stable and with minimal build requirements.
832(define-public linux-libre-headers-6.12.17
833 (make-linux-libre-headers "6.12.17" "gnu"
834 "1j3iyivh8h9abryjqksf4k51wgwnwqy2l3zsc019bm84xmka38xm"))
835
836(define-public linux-libre-headers linux-libre-headers-6.12.17)
837;; linux-libre-headers-latest points to the latest headers package
838;; and should be used as a dependency for packages that depend on
839;; the headers.
840(define-public linux-libre-headers-latest linux-libre-headers-6.17)
841
842
843;;;
844;;; Kernel configurations.
845;;;
846
847(define* (kernel-config arch #:key variant)
848 "Return a file-like object of the Linux-Libre build configuration file for
849ARCH and optionally VARIANT, or #f if there is no such configuration."
850 (let* ((name (string-append (if variant (string-append variant "-") "")
851 (if (string=? "i386" arch) "i686" arch) ".conf"))
852 (file (string-append "linux-libre/" name))
853 (config (search-auxiliary-file file)))
854 (and config (local-file config))))
855
856(define (default-extra-linux-options version)
857 `(;; Make the kernel config available at /proc/config.gz
858 ("CONFIG_IKCONFIG" . #t)
859 ("CONFIG_IKCONFIG_PROC" . #t)
860 ;; Debugging options.
861 ("CONFIG_DEBUG_INFO" . #t) ;required by BTF
862 ,@(if (version>=? version "5.1")
863 '(("CONFIG_DEBUG_INFO_BTF" . #t))
864 '())
865 ,@(if (version>=? version "5.12")
866 '(("CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT" . #t))
867 '())
868 ("CONFIG_DEBUG_INFO_REDUCED" . #f) ;incompatible with BTF
869 ;; Tracing and related options.
870 ,@(if (version>=? version "5.1")
871 '(("CONFIG_BPF_JIT" . #t)
872 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
873 ("CONFIG_BPF_SYSCALL" . #t))
874 '())
875 ,@(if (version>=? version "5.13")
876 '(("CONFIG_BPF_UNPRIV_DEFAULT_OFF" . #t))
877 '())
878 ("CONFIG_NET_CLS_BPF" . m) ;classify packets based on BPF filters
879 ("CONFIG_NET_ACT_BPF" . m) ;to execute BPF code on packets
880 ;; Compress kernel modules via Zstd.
881 ,(if (version>=? version "5.13")
882 '("CONFIG_MODULE_COMPRESS_ZSTD" . #t)
883 '("CONFIG_MODULE_COMPRESS_GZIP" . #t))
884 ;; Some very mild hardening.
885 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
886 ;; All kernels should have NAMESPACES options enabled
887 ("CONFIG_NAMESPACES" . #t)
888 ("CONFIG_UTS_NS" . #t)
889 ("CONFIG_IPC_NS" . #t)
890 ("CONFIG_USER_NS" . #t)
891 ("CONFIG_PID_NS" . #t)
892 ("CONFIG_NET_NS" . #t)
893 ;; Various options needed for elogind service:
894 ;; https://issues.guix.gnu.org/43078
895 ("CONFIG_CGROUP_FREEZER" . #t)
896 ("CONFIG_BLK_CGROUP" . #t)
897 ("CONFIG_CGROUP_WRITEBACK" . #t)
898 ("CONFIG_CGROUP_SCHED" . #t)
899 ("CONFIG_CGROUP_PIDS" . #t)
900 ("CONFIG_CGROUP_FREEZER" . #t)
901 ("CONFIG_CGROUP_DEVICE" . #t)
902 ("CONFIG_CGROUP_CPUACCT" . #t)
903 ("CONFIG_CGROUP_PERF" . #t)
904 ("CONFIG_SOCK_CGROUP_DATA" . #t)
905 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
906 ("CONFIG_CGROUP_NET_PRIO" . #t)
907 ("CONFIG_CGROUP_NET_CLASSID" . #t)
908 ("CONFIG_MEMCG" . #t)
909 ("CONFIG_MEMCG_SWAP" . #t)
910 ("CONFIG_MEMCG_KMEM" . #t)
911 ("CONFIG_CPUSETS" . #t)
912 ("CONFIG_PROC_PID_CPUSET" . #t)
913 ;; Allow disk encryption by default
914 ("CONFIG_DM_CRYPT" . m)
915 ;; Allow fscrypt filesystem encryption by default
916 ("CONFIG_FS_ENCRYPTION" . #t)
917 ;; Support zram on all kernel configs
918 ("CONFIG_ZSWAP" . #t)
919 ("CONFIG_ZSMALLOC" . #t)
920 ("CONFIG_ZRAM" . m)
921 ;; Accessibility support.
922 ("CONFIG_ACCESSIBILITY" . #t)
923 ("CONFIG_A11Y_BRAILLE_CONSOLE" . #t)
924 ("CONFIG_SPEAKUP" . m)
925 ("CONFIG_SPEAKUP_SYNTH_SOFT" . m)
926 ;; Modules required for initrd:
927 ("CONFIG_NET_9P" . m)
928 ("CONFIG_NET_9P_VIRTIO" . m)
929 ("CONFIG_VIRTIO_BLK" . m)
930 ("CONFIG_VIRTIO_NET" . m)
931 ("CONFIG_VIRTIO_PCI" . m)
932 ("CONFIG_VIRTIO_BALLOON" . m)
933 ("CONFIG_VIRTIO_MMIO" . m)
934 ("CONFIG_FUSE_FS" . m)
935 ("CONFIG_CIFS" . m)
936 ("CONFIG_9P_FS" . m)
937 ;; Disable the EFI pstore storage backend to avoid causing
938 ;; unrecoverable failures on some EFI systems:
939 ;; https://lists.gnu.org/archive/html/help-guix/2025-01/msg00173.html
940 ("CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE" . #t)))
941
942(define (config->string options)
943 (string-join (map (match-lambda
944 ((option . 'm)
945 (string-append option "=m"))
946 ((option . #t)
947 (string-append option "=y"))
948 ((option . #f)
949 (string-append option "=n"))
950 ((option . string)
951 (string-append option "=\"" string "\"")))
952 options)
953 "\n"))
954
955
956;;;
957;;; Kernel package utilities.
958;;;
959
960(define (apply-infodoc-patch? version)
961 ;; Versions older than 5.10 have different enough build scripts that the
962 ;; infodocs patch doesn't apply.
963 (and (version>=? version "5.10")
964 (not (version>=? version "6.2")))) ;patch applied upstream
965
966
967(define* (make-linux-libre version gnu-revision hash-string supported-systems
968 #:key
969 (extra-version #f)
970 ;; A function that takes an arch and a variant, and
971 ;; return a file-like object. See kernel-config
972 ;; for an example.
973 (configuration-file #f)
974 (defconfig "defconfig")
975 (extra-options (default-extra-linux-options version))
976 (patches
977 `(,%boot-logo-patch
978 ,@(if (apply-infodoc-patch? version)
979 (list (search-patch
980 "linux-libre-infodocs-target.patch"))
981 '()))))
982 (make-linux-libre* version gnu-revision
983 (origin
984 (method url-fetch)
985 (uri (linux-libre-urls version gnu-revision))
986 (sha256 (base32 hash-string))
987 (patches patches))
988 supported-systems
989 #:extra-version extra-version
990 #:configuration-file configuration-file
991 #:defconfig defconfig
992 #:extra-options extra-options))
993
994(define* (make-linux-libre* version gnu-revision source supported-systems
995 #:key
996 (extra-version #f)
997 ;; A function that takes an arch and a variant.
998 ;; See kernel-config for an example.
999 (configuration-file #f)
1000 (defconfig "defconfig")
1001 (extra-options (default-extra-linux-options version)))
1002 (package
1003 (name (if extra-version
1004 (string-append "linux-libre-" extra-version)
1005 "linux-libre"))
1006 (version version)
1007 (source source)
1008 (supported-systems supported-systems)
1009 (build-system gnu-build-system)
1010 (arguments
1011 (list
1012 #:modules '((guix build gnu-build-system)
1013 (guix build utils)
1014 (srfi srfi-1)
1015 (srfi srfi-26)
1016 (ice-9 ftw)
1017 (ice-9 match))
1018 #:tests? #f
1019 #:phases
1020 #~(modify-phases %standard-phases
1021 (add-after 'unpack 'patch-/bin/pwd
1022 (lambda _
1023 (substitute* (find-files
1024 "." "^Makefile(\\.include)?$")
1025 (("/bin/pwd") "pwd"))))
1026 (add-before 'configure 'set-environment
1027 (lambda* (#:key target #:allow-other-keys)
1028 ;; Avoid introducing timestamps.
1029 (setenv "KCONFIG_NOTIMESTAMP" "1")
1030 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
1031
1032 ;; Other variables useful for reproducibility.
1033 (setenv "KBUILD_BUILD_VERSION" "1")
1034 (setenv "KBUILD_BUILD_USER" "guix")
1035 (setenv "KBUILD_BUILD_HOST" "guix")
1036
1037 ;; Set ARCH and CROSS_COMPILE.
1038 (let ((arch #$(platform-linux-architecture
1039 (lookup-platform-by-target-or-system
1040 (or (%current-target-system)
1041 (%current-system))))))
1042 (setenv "ARCH" arch)
1043 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
1044 (when target
1045 (setenv "CROSS_COMPILE" (string-append target "-"))
1046 (format #t "`CROSS_COMPILE' set to `~a'~%"
1047 (getenv "CROSS_COMPILE"))))
1048
1049 ;; Allow EXTRAVERSION to be set via the environment.
1050 (substitute* "Makefile"
1051 (("^ *EXTRAVERSION[[:blank:]]*=")
1052 "EXTRAVERSION ?="))
1053 (setenv "EXTRAVERSION"
1054 #$(and extra-version
1055 (string-append "-" extra-version)))
1056 ;; Use the maximum compression available for Zstd-compressed
1057 ;; modules.
1058 (setenv "ZSTD_CLEVEL" "19")))
1059 (replace 'configure
1060 (lambda _
1061 (let ((config
1062 #$(match (let ((arch (platform-linux-architecture
1063 (lookup-platform-by-target-or-system
1064 (or (%current-target-system)
1065 (%current-system))))))
1066 (and configuration-file arch
1067 (configuration-file
1068 arch
1069 #:variant (version-major+minor version))))
1070 (#f ;no config for this platform
1071 #f)
1072 ((? file-like? config)
1073 config))))
1074 ;; Use a custom kernel configuration file or a default
1075 ;; configuration file.
1076 (if config
1077 (begin
1078 (copy-file config ".config")
1079 (chmod ".config" #o666))
1080 (invoke "make" #$defconfig))
1081 ;; Appending works even when the option wasn't in the file.
1082 ;; The last one prevails if duplicated.
1083 (let ((port (open-file ".config" "a"))
1084 (extra-configuration #$(config->string extra-options)))
1085 (display extra-configuration port)
1086 (close-port port))
1087 (invoke "make" "oldconfig"))))
1088 (replace 'install
1089 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1090 (let ((moddir (string-append #$output "/lib/modules"))
1091 (dtbdir (string-append #$output "/lib/dtbs"))
1092 (make-flags
1093 (append make-flags
1094 (list "-j"
1095 (if parallel-build?
1096 (number->string (parallel-job-count))
1097 "1")))))
1098 ;; Install kernel image, kernel configuration and link map.
1099 (for-each (lambda (file) (install-file file #$output))
1100 (find-files "." "^(\\.config|bzImage|zImage|Image\
1101|vmlinuz|System\\.map|Module\\.symvers)$"))
1102 ;; Install device tree files
1103 (unless (null? (find-files "." "\\.dtb$"))
1104 (mkdir-p dtbdir)
1105 (apply invoke "make"
1106 (string-append "INSTALL_DTBS_PATH=" dtbdir)
1107 "dtbs_install" make-flags))
1108 ;; Install kernel modules
1109 (mkdir-p moddir)
1110 (apply invoke "make"
1111 ;; Disable depmod because the Guix system's module
1112 ;; directory is an union of potentially multiple
1113 ;; packages. It is not possible to use depmod to
1114 ;; usefully calculate a dependency graph while building
1115 ;; only one of them.
1116 "DEPMOD=true"
1117 (string-append "MODULE_DIR=" moddir)
1118 (string-append "INSTALL_PATH=" #$output)
1119 (string-append "INSTALL_MOD_PATH=" #$output)
1120 "INSTALL_MOD_STRIP=1"
1121 "modules_install" make-flags)
1122 (let* ((versions (filter (lambda (name)
1123 (not (string-prefix? "." name)))
1124 (scandir moddir)))
1125 (version (match versions
1126 ((x) x))))
1127 ;; There are symlinks to the build and source directory.
1128 ;; Both will point to target /tmp/guix-build* and thus not
1129 ;; be useful in a profile. Delete the symlinks.
1130 (false-if-file-not-found
1131 (delete-file
1132 (string-append moddir "/" version "/build")))
1133 (false-if-file-not-found
1134 (delete-file
1135 (string-append moddir "/" version "/source"))))))))))
1136 (native-inputs
1137 (list perl
1138 bc
1139 openssl
1140 elfutils ;needed to enable CONFIG_STACK_VALIDATION
1141 flex
1142 bison
1143 util-linux ;needed for hexdump
1144 ;; These are needed to compile the GCC plugins.
1145 gmp
1146 mpfr
1147 mpc
1148 ;; These are needed when building with the CONFIG_DEBUG_INFO_BTF
1149 ;; support.
1150 dwarves ;for pahole
1151 python-wrapper
1152 zlib
1153 ;; For Zstd compression of kernel modules.
1154 zstd))
1155 (home-page "https://www.gnu.org/software/linux-libre/")
1156 (synopsis "100% free redistribution of a cleaned Linux kernel")
1157 (description "GNU Linux-Libre is a free (as in freedom) variant of the
1158Linux kernel. It has been modified to remove all non-free binary blobs.")
1159 (license license:gpl2)
1160 (properties %linux-libre-timeout-properties)))
1161
1162
1163;;;
1164;;; Generic kernel packages.
1165;;;
1166
1167(define-public linux-libre-6.17
1168 (make-linux-libre* linux-libre-6.17-version
1169 linux-libre-6.17-gnu-revision
1170 linux-libre-6.17-source
1171 '("x86_64-linux" "i686-linux" "armhf-linux"
1172 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1173 #:configuration-file kernel-config))
1174
1175(define-public linux-libre-version linux-libre-6.17-version)
1176(define-public linux-libre-gnu-revision linux-libre-6.17-gnu-revision)
1177(define-public linux-libre-pristine-source linux-libre-6.17-pristine-source)
1178(define-public linux-libre-source linux-libre-6.17-source)
1179(define-public linux-libre linux-libre-6.17)
1180
1181(define-public linux-libre-6.12
1182 (make-linux-libre* linux-libre-6.12-version
1183 linux-libre-6.12-gnu-revision
1184 linux-libre-6.12-source
1185 '("x86_64-linux" "i686-linux" "armhf-linux"
1186 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1187 #:configuration-file kernel-config))
1188
1189(define-public linux-libre-6.6
1190 (make-linux-libre* linux-libre-6.6-version
1191 linux-libre-6.6-gnu-revision
1192 linux-libre-6.6-source
1193 '("x86_64-linux" "i686-linux" "armhf-linux"
1194 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1195 #:configuration-file kernel-config))
1196
1197(define-public linux-libre-6.1
1198 (make-linux-libre* linux-libre-6.1-version
1199 linux-libre-6.1-gnu-revision
1200 linux-libre-6.1-source
1201 '("x86_64-linux" "i686-linux" "armhf-linux"
1202 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1203 #:configuration-file kernel-config))
1204
1205(define-public linux-libre-5.15
1206 (make-linux-libre* linux-libre-5.15-version
1207 linux-libre-5.15-gnu-revision
1208 linux-libre-5.15-source
1209 '("x86_64-linux" "i686-linux" "armhf-linux"
1210 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1211 #:configuration-file kernel-config))
1212
1213(define-public linux-libre-5.10
1214 (make-linux-libre* linux-libre-5.10-version
1215 linux-libre-5.10-gnu-revision
1216 linux-libre-5.10-source
1217 '("x86_64-linux" "i686-linux" "armhf-linux"
1218 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1219 #:configuration-file kernel-config))
1220
1221(define-public linux-libre-5.4
1222 (make-linux-libre* linux-libre-5.4-version
1223 linux-libre-5.4-gnu-revision
1224 linux-libre-5.4-source
1225 '("x86_64-linux" "i686-linux" "armhf-linux"
1226 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1227 #:configuration-file kernel-config))
1228
1229;; Linux-Libre-LTS points to the *newest* released long-term support version of
1230;; Linux-Libre.
1231;; Reference: <https://www.kernel.org/category/releases.html>
1232
1233(define-public linux-libre-lts-version linux-libre-6.12-version)
1234(define-public linux-libre-lts-gnu-revision linux-libre-6.12-gnu-revision)
1235(define-public linux-libre-lts-pristine-source linux-libre-6.12-pristine-source)
1236(define-public linux-libre-lts-source linux-libre-6.12-source)
1237(define-public linux-libre-lts linux-libre-6.12)
1238
1239
1240;;;
1241;;; Specialized kernel variants.
1242;;;
1243
1244(define-public %dummy-linux-kernel-for-container
1245 (hidden-package
1246 (package
1247 (name "linux-dummy")
1248 (version "0.0.0")
1249 (source #f)
1250 (build-system copy-build-system)
1251 (arguments
1252 (list #:phases
1253 #~(modify-phases %standard-phases
1254 (delete 'unpack)
1255 (replace 'install
1256 (lambda _
1257 (mkdir-p #$output))))))
1258 (home-page "")
1259 (synopsis "Dummy Linux kernel for @command{guix system container}")
1260 (description "")
1261 (license #f))))
1262
1263(define-public linux-libre-arm-generic
1264 (make-linux-libre* linux-libre-version
1265 linux-libre-gnu-revision
1266 linux-libre-source
1267 '("armhf-linux")
1268 #:defconfig "multi_v7_defconfig"
1269 #:extra-version "arm-generic"
1270 #:extra-options
1271 (append
1272 `(;; needed to fix the RTC on rockchip platforms
1273 ("CONFIG_RTC_DRV_RK808" . #t))
1274 (default-extra-linux-options linux-libre-version))))
1275
1276(define-public linux-libre-arm-generic-5.10
1277 (make-linux-libre* linux-libre-5.10-version
1278 linux-libre-5.10-gnu-revision
1279 linux-libre-5.10-source
1280 '("armhf-linux")
1281 #:defconfig "multi_v7_defconfig"
1282 #:extra-version "arm-generic"
1283 #:extra-options
1284 (append
1285 `(;; needed to fix the RTC on rockchip platforms
1286 ("CONFIG_RTC_DRV_RK808" . #t))
1287 (default-extra-linux-options linux-libre-5.10-version))))
1288
1289(define-public linux-libre-arm-generic-5.4
1290 (make-linux-libre* linux-libre-5.4-version
1291 linux-libre-5.4-gnu-revision
1292 linux-libre-5.4-source
1293 '("armhf-linux")
1294 #:defconfig "multi_v7_defconfig"
1295 #:extra-version "arm-generic"
1296 #:extra-options
1297 (append
1298 `(;; needed to fix the RTC on rockchip platforms
1299 ("CONFIG_RTC_DRV_RK808" . #t))
1300 (default-extra-linux-options linux-libre-5.4-version))))
1301
1302(define-public linux-libre-arm-omap2plus
1303 (make-linux-libre* linux-libre-version
1304 linux-libre-gnu-revision
1305 linux-libre-source
1306 '("armhf-linux")
1307 #:defconfig "omap2plus_defconfig"
1308 #:extra-version "arm-omap2plus"))
1309
1310(define-public linux-libre-arm64-generic
1311 (make-linux-libre* linux-libre-version
1312 linux-libre-gnu-revision
1313 linux-libre-source
1314 '("aarch64-linux")
1315 #:defconfig "defconfig"
1316 #:extra-version "arm64-generic"
1317 #:extra-options
1318 (append
1319 `(;; Provide support for ath9k wireless
1320 ("CONFIG_ATH9K_HTC" . m)
1321 ;; Support Orange Pi R1 Plus LTS ethernet PHY.
1322 ("CONFIG_MOTORCOMM_PHY" . m)
1323 ;; needed to fix the RTC on rockchip platforms
1324 ("CONFIG_RTC_DRV_RK808" . #t)
1325 ;; Pinebook display, battery, charger and usb
1326 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1327 ("CONFIG_CHARGER_AXP20X" . m)
1328 ("CONFIG_INPUT_AXP20X_PEK" . m)
1329 ("CONFIG_CHARGER_AXP20X" . m)
1330 ("CONFIG_BATTERY_AXP20X" . m)
1331 ("CONFIG_PINCTRL_AXP209" . m)
1332 ("CONFIG_AXP20X_POWER" . m)
1333 ("CONFIG_AXP20X_ADC" . m)
1334 ;; Pinebook PRO battery and sound support
1335 ("CONFIG_BATTERY_CW2015" . m)
1336 ("CONFIG_CHARGER_GPIO" . m)
1337 ("CONFIG_SND_SOC_ES8316" . m))
1338 (default-extra-linux-options linux-libre-version))))
1339
1340(define-public linux-libre-lts-arm64-generic
1341 (if (string=? linux-libre-lts-version linux-libre-version)
1342
1343 ;; Make it a strict alias so that the user interface does not see two
1344 ;; packages with the exact same name and version.
1345 linux-libre-arm64-generic
1346
1347 (make-linux-libre* linux-libre-lts-version
1348 linux-libre-lts-gnu-revision
1349 linux-libre-lts-source
1350 '("aarch64-linux")
1351 #:defconfig "defconfig"
1352 #:extra-version "arm64-generic"
1353 #:extra-options
1354 (append
1355 `( ;; Provide support for ath9k wireless
1356 ("CONFIG_ATH9K_HTC" . m)
1357 ;; Support Orange Pi R1 Plus LTS ethernet PHY.
1358 ("CONFIG_MOTORCOMM_PHY" . m)
1359 ;; needed to fix the RTC on rockchip platforms
1360 ("CONFIG_RTC_DRV_RK808" . #t)
1361 ;; Pinebook display, battery, charger and usb
1362 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1363 ("CONFIG_CHARGER_AXP20X" . m)
1364 ("CONFIG_INPUT_AXP20X_PEK" . m)
1365 ("CONFIG_CHARGER_AXP20X" . m)
1366 ("CONFIG_BATTERY_AXP20X" . m)
1367 ("CONFIG_PINCTRL_AXP209" . m)
1368 ("CONFIG_AXP20X_POWER" . m)
1369 ("CONFIG_AXP20X_ADC" . m)
1370 ;; Pinebook PRO battery and sound support
1371 ("CONFIG_BATTERY_CW2015" . m)
1372 ("CONFIG_CHARGER_GPIO" . m)
1373 ("CONFIG_SND_SOC_ES8316" . m))
1374 (default-extra-linux-options linux-libre-lts-version)))))
1375
1376(define-public linux-libre-arm64-generic-5.10
1377 (make-linux-libre* linux-libre-5.10-version
1378 linux-libre-5.10-gnu-revision
1379 linux-libre-5.10-source
1380 '("aarch64-linux")
1381 #:defconfig "defconfig"
1382 #:extra-version "arm64-generic"
1383 #:extra-options
1384 (append
1385 `(;; needed to fix the RTC on rockchip platforms
1386 ("CONFIG_RTC_DRV_RK808" . #t)
1387 ;; Pinebook display, battery, charger and usb
1388 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1389 ("CONFIG_CHARGER_AXP20X" . m)
1390 ("CONFIG_INPUT_AXP20X_PEK" . m)
1391 ("CONFIG_CHARGER_AXP20X" . m)
1392 ("CONFIG_BATTERY_AXP20X" . m)
1393 ("CONFIG_PINCTRL_AXP209" . m)
1394 ("CONFIG_AXP20X_POWER" . m)
1395 ("CONFIG_AXP20X_ADC" . m)
1396 ;; Pinebook PRO battery and sound support
1397 ("CONFIG_BATTERY_CW2015" . m)
1398 ("CONFIG_CHARGER_GPIO" . m)
1399 ("CONFIG_SND_SOC_ES8316" . m))
1400 (default-extra-linux-options linux-libre-5.10-version))))
1401
1402(define-public linux-libre-arm64-generic-5.4
1403 (make-linux-libre* linux-libre-5.4-version
1404 linux-libre-5.4-gnu-revision
1405 linux-libre-5.4-source
1406 '("aarch64-linux")
1407 #:defconfig "defconfig"
1408 #:extra-version "arm64-generic"
1409 #:extra-options
1410 (append
1411 `(;; needed to fix the RTC on rockchip platforms
1412 ("CONFIG_RTC_DRV_RK808" . #t))
1413 (default-extra-linux-options linux-libre-5.4-version))))
1414
1415(define-public linux-libre-arm64-honeycomb
1416 ;; Kernel for use on the HoneyComb LX2 boards:
1417 ;; <https://shop.solid-run.com/product/SRCFTXE000IV13/>.
1418 (make-linux-libre* linux-libre-lts-version
1419 linux-libre-lts-gnu-revision
1420 linux-libre-lts-source
1421 '("aarch64-linux")
1422 #:extra-version "arm64-honeycomb"
1423 #:extra-options
1424 ;; See
1425 ;; https://github.com/SolidRun/lx2160a_build/blob/master/configs/linux/lx2k_additions.config
1426 (append
1427 `(("CONFIG_GPIO_SYSFS" . #true)
1428 ("CONFIG_GPIO_MPC8XXX" . #true)
1429 ("CONFIG_NET_PKTGEN" . #true)
1430 ("CONFIG_USB_SERIAL" . #true)
1431 ("CONFIG_USB_SERIAL_CONSOLE" . #true)
1432 ("CONFIG_USB_SERIAL_GENERIC" . #true)
1433 ("CONFIG_USB_SERIAL_SIMPLE" . #true)
1434 ("CONFIG_USB_SERIAL_FTDI_SIO" . #true)
1435 ("CONFIG_USB_ACM" . #true)
1436 ("CONFIG_USB_NET_DRIVERS" . #true)
1437 ("CONFIG_USB_USBNET" . #true)
1438 ("CONFIG_USB_NET_CDCETHER" . #true)
1439 ("CONFIG_USB_NET_CDC_NCM" . #true)
1440 ("CONFIG_USB_NET_NET1080" . #true)
1441 ("CONFIG_USB_NET_CDC_SUBSET_ENABLE" . #true)
1442 ("CONFIG_USB_NET_CDC_SUBSET" . #true)
1443 ("CONFIG_USB_ARMLINUX" . #true)
1444 ("CONFIG_BLK_DEV_NVME" . #true)
1445 ("CONFIG_NVMEM_BCM_OCOTP" . #true)
1446 ("CONFIG_DRM_AMDGPU" . #true)
1447 ("CONFIG_DRM_AMDGPU_SI" . #true)
1448 ("CONFIG_DRM_AMDGPU_CIK" . #true)
1449 ("CONFIG_DRM_AMDGPU_USERPTR" . #true)
1450 ("CONFIG_DRM_AMD_DC" . #true)
1451 ("CONFIG_CHASH" . #true)
1452 ("CONFIG_PMBUS" . #true)
1453 ("CONFIG_SENSORS_PMBUS" . #true)
1454 ("CONFIG_REGULATOR" . #true)
1455 ("CONFIG_REGULATOR_FIXED_VOLTAGE" . #true)
1456 ("CONFIG_REGULATOR_PWM" . #true)
1457 ("CONFIG_SENSORS_AMC6821" . #true)
1458 ("CONFIG_SENSORS_LM90" . #true)
1459 ("CONFIG_SENSORS_LTC2978" . #true)
1460 ("CONFIG_SENSORS_LTC2978_REGULATOR" . #true)
1461 ("CONFIG_TMPFS" . #true)
1462 ("CONFIG_TMPFS_POSIX_ACL" . #true)
1463 ("CONFIG_TMPFS_XATTR" . #true)
1464 ;;("CONFIG_BLK_DEV_RAM_SIZE" . 524288)
1465 ("CONFIG_POWER_RESET_GPIO" . #true)
1466 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1467 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1468 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1469 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1470
1471 ;; Fixes https://codeberg.org/guix/guix/issues/101
1472 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1473
1474 ;; For connecting to ci.guix.gnu.org over VPN.
1475 ("CONFIG_WIREGUARD" . m)
1476
1477 ;; restool support
1478 ("CONFIG_FSL_MC_UAPI_SUPPORT" . #t)
1479 ("CONFIG_FSL_MC_BUS" . #t)
1480 ("CONFIG_VFIO_FSL_MC" . #t)
1481 ("CONFIG_FSL_MC_DPIO" . #t)
1482 ("CONFIG_ARM_GIC_V3_ITS_FSL_MC" . #t)
1483
1484 ;; vsockets support
1485 ;; TODO This seems to be enabled by default on other
1486 ;; architectures?
1487 ("CONFIG_VSOCKETS" . m)
1488 ("CONFIG_VSOCKETS_DIAG" . m)
1489 ("CONFIG_VSOCKETS_LOOPBACK" . m)
1490 ("CONFIG_VMWARE_VMCI_VSOCKETS" . m)
1491 ("CONFIG_VIRTIO_VSOCKETS" . m)
1492 ("CONFIG_VIRTIO_VSOCKETS_COMMON" . m)
1493 ("CONFIG_HYPERV_VSOCKETS" . m)
1494 ("CONFIG_VHOST_IOTLB" . m)
1495 ("CONFIG_VHOST_RING" . m)
1496 ("CONFIG_VHOST_TASK" . #true)
1497 ("CONFIG_VHOST" . m)
1498 ("CONFIG_VHOST_MENU" . #true)
1499 ("CONFIG_VHOST_NET" . m)
1500 ("CONFIG_VHOST_SCSI" . m)
1501 ("CONFIG_VHOST_VSOCK" . m)
1502 ("CONFIG_VHOST_VDPA" . m))
1503 (default-extra-linux-options linux-libre-lts-version))))
1504
1505(define-public reform-debian-packages
1506 (package
1507 (name "reform-debian-packages")
1508 (version "2023-07-10-475-ge469c2a") ;from git describe
1509 (source
1510 (origin
1511 (method git-fetch)
1512 (uri (git-reference
1513 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1514 (commit "e469c2ad131054c7afe4f9f059eb2eb575545b1a")))
1515 (file-name (git-file-name name version))
1516 (sha256
1517 (base32 "0pv24b317n4h71rn25v2wa3qhs1i0wjfpys899cpm5lf0irvis7q"))))
1518 (build-system copy-build-system)
1519 (arguments
1520 (list
1521 #:install-plan
1522 #~'(("linux/patches6.16/" "/patches6.16")
1523 ("linux/patches6.17/" "/patches6.17")
1524 ("linux/" "/dts/amlogic"
1525 #:include-regexp ("meson.*\\.dts$"))
1526 ("linux/" "/dts/freescale"
1527 #:include-regexp ("imx8.*\\.dts$"))
1528 ("linux/" "/dts/freescale"
1529 #:include-regexp ("fsl.*\\.dts$"))
1530 ("linux/" "/dts/rockchip"
1531 #:include-regexp ("rk3588.*\\.dts$"))
1532 ("linux/config" "config"))))
1533 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1534 (synopsis
1535 "Linux kernel patches and device-trees used for MNT Reform systems")
1536 (description
1537 "Linux kernel patches and device-trees used for the MNT Reform systems")
1538 (license (list
1539 (license:fsf-free "file://filter-output"
1540 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1541 license:bsd-2
1542 license:expat
1543 license:gpl2
1544 license:gpl2+
1545 license:gpl3
1546 license:x11))))
1547
1548(define-public reform-debian-packages-for-6.12
1549 (package
1550 (name "reform-debian-packages")
1551 (version "2023-07-10-320-gaf0a461") ;from git describe
1552 (source
1553 (origin
1554 (method git-fetch)
1555 (uri (git-reference
1556 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1557 (commit "af0a461d38e13481323f061d9ff6827d1d13873b")))
1558 (file-name (git-file-name name version))
1559 (sha256
1560 (base32 "1cylprld2ri3mprj5cgwla1l8qv9iqqvcra7h64yarzs49zaa16m"))))
1561 (build-system copy-build-system)
1562 (arguments
1563 (list
1564 #:install-plan
1565 #~'(("linux/patches6.12/" "/patches6.12")
1566 ("linux/" "/dts/amlogic"
1567 #:include-regexp ("meson.*\\.dts$"))
1568 ("linux/" "/dts/freescale"
1569 #:include-regexp ("imx8.*\\.dts$"))
1570 ("linux/" "/dts/freescale"
1571 #:include-regexp ("fsl.*\\.dts$"))
1572 ("linux/" "/dts/rockchip"
1573 #:include-regexp ("rk3588.*\\.dts$"))
1574 ("linux/config" "config"))))
1575 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1576 (synopsis
1577 "Linux kernel patches and device-trees used for MNT Reform systems")
1578 (description
1579 "Linux kernel patches and device-trees used for the MNT Reform systems")
1580 (license (list
1581 (license:fsf-free "file://filter-output"
1582 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1583 license:bsd-2
1584 license:expat
1585 license:gpl2
1586 license:gpl2+
1587 license:gpl3
1588 license:x11))))
1589
1590(define-public reform-debian-packages-for-6.17
1591 (package
1592 (name "reform-debian-packages")
1593 (version "2023-07-10-485-g133081d") ;from git describe
1594 (source
1595 (origin
1596 (method git-fetch)
1597 (uri (git-reference
1598 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1599 (commit "133081db414ee31ea2751e5152223859d709751f")))
1600 (file-name (git-file-name name version))
1601 (sha256
1602 (base32 "06234a91mkriyx8afm6dppr35r47wsm61dacwixlna22zbxgicgc"))))
1603 (build-system copy-build-system)
1604 (arguments
1605 (list
1606 #:install-plan
1607 #~'(("linux/patches6.17/" "/patches6.17")
1608 ("linux/" "/dts/amlogic"
1609 #:include-regexp ("meson.*\\.dts$"))
1610 ("linux/" "/dts/freescale"
1611 #:include-regexp ("imx8.*\\.dts$"))
1612 ("linux/" "/dts/freescale"
1613 #:include-regexp ("fsl.*\\.dts$"))
1614 ("linux/" "/dts/rockchip"
1615 #:include-regexp ("rk3588.*\\.dts$"))
1616 ("linux/config" "config"))))
1617 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1618 (synopsis
1619 "Linux kernel patches and device-trees used for MNT Reform systems")
1620 (description
1621 "Linux kernel patches and device-trees used for the MNT Reform systems")
1622 (license (list
1623 (license:fsf-free "file://filter-output"
1624 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1625 license:bsd-2
1626 license:expat
1627 license:gpl2
1628 license:gpl2+
1629 license:gpl3
1630 license:x11))))
1631
1632(define-public linux-libre-arm64-mnt-reform-6.17
1633 ;; Kernel for use on the MNT/Reform systems
1634 ;; https://mntre.com/reform.html
1635 (let ((base (make-linux-libre* linux-libre-6.17-version
1636 linux-libre-6.17-gnu-revision
1637 linux-libre-6.17-source
1638 '("aarch64-linux")
1639 #:extra-version "arm64-mnt-reform"
1640 #:extra-options
1641 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
1642 (append `(("CONFIG_DRM_LVDS_CODEC" . m)
1643 ("CONFIG_DRM_CDNS_MHDP8546" . m)
1644 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
1645 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
1646 ("CONFIG_DRM_IMX_DCSS" . m)
1647 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
1648 ("CONFIG_DRM_PANEL_LVDS" . m)
1649 ("CONFIG_I2C_IMX_LPI2C" . m)
1650 ("CONFIG_I2C_MUX_REG" . m)
1651 ("CONFIG_INTERCONNECT_IMX" . #true)
1652 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
1653 ("CONFIG_MFD_WM8994" . m)
1654 ("CONFIG_MUX_GPIO" . m)
1655 ("CONFIG_MUX_MMIO" . m)
1656 ("CONFIG_RTC_DRV_PCF8523" . m)
1657 ("CONFIG_USB_EHCI_FSL" . m)
1658 ("CONFIG_NO_HZ_IDLE" . #true)
1659 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
1660 ("CONFIG_SND_IMX_SOC" . m)
1661 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
1662 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
1663 ("CONFIG_SND_SOC_IMX_HDMI" . m)
1664 ("CONFIG_INPUT_JOYSTICK" . #true)
1665 ("CONFIG_JOYSTICK_XPAD" . m)
1666 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
1667 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
1668 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
1669 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
1670 ("CONFIG_DRM_IMX_LCDIF" . #true)
1671 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
1672 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
1673 ("CONFIG_IMX8MM_THERMAL" . #true)
1674 ("CONFIG_IMX2_WDT" . #true)
1675 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
1676 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
1677 ("CONFIG_DRM" . #true)
1678 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . #true)
1679 ("CONFIG_IMX8M_BLK_CTRL" . #true)
1680 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
1681 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
1682 ("CONFIG_DRM_FSL_LDB" . #true)
1683 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
1684 ("CONFIG_BACKLIGHT_PWM" . #true)
1685 ("CONFIG_BACKLIGHT_GPIO" . #true)
1686 ("CONFIG_BACKLIGHT_LED" . #true)
1687 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
1688 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
1689 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
1690 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
1691 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
1692 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
1693 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
1694 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
1695 ("CONFIG_IMX_IRQSTEER" . #true)
1696 ("CONFIG_PCI_MESON" . #true)
1697 ("CONFIG_DWMAC_MESON" . #true)
1698 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . #true)
1699 ("CONFIG_GPIO_ROCKCHIP" . #true)
1700 ("CONFIG_PL330_DMA" . #true)
1701 ("CONFIG_I2C_MESON" . #true)
1702 ("CONFIG_PWM_MESON" . #true)
1703 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
1704 ("CONFIG_MMC_MESON_GX" . #true)
1705 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
1706 ("CONFIG_MESON_DDR_PMU" . #true)
1707 ("CONFIG_RTW88_8822CS" . m)
1708 ("CONFIG_PWM_FSL_FTM" . #true)
1709 ("CONFIG_FSL_RCPM" . #true)
1710 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
1711 ("CONFIG_DRM_PANTHOR" . m)
1712 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
1713 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
1714 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
1715 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
1716 ("CONFIG_SPI_ROCKCHIP" . #true)
1717 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
1718 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
1719 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . #true)
1720 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
1721 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
1722 ("CONFIG_ROCKCHIP_DW_MIPI_DSI2" . #true)
1723 ;; Fixes https://codeberg.org/guix/guix/issues/101
1724 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1725 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1726 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1727 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1728 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1729 ;; nftables support
1730 ("CONFIG_NF_TABLES" . m)
1731 ("CONFIG_NF_TABLES_INET" . #true)
1732 ("CONFIG_NF_TABLES_NETDEV" . #true)
1733 ("CONFIG_NF_TABLES_IPV4" . #true)
1734 ("CONFIG_NF_TABLES_ARP" . #true)
1735 ("CONFIG_NF_TABLES_IPV6" . #true)
1736 ("CONFIG_NF_TABLES_BRIDGE" . m)
1737 ("CONFIG_NFT_NUMGEN" . m)
1738 ("CONFIG_NFT_CT" . m)
1739 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
1740 ("CONFIG_NFT_CONNLIMIT" . m)
1741 ("CONFIG_NFT_LOG" . m)
1742 ("CONFIG_NFT_LIMIT" . m)
1743 ("CONFIG_NFT_MASQ" . m)
1744 ("CONFIG_NFT_REDIR" . m)
1745 ("CONFIG_NFT_NAT" . m)
1746 ("CONFIG_NFT_TUNNEL" . m)
1747 ("CONFIG_NFT_QUEUE" . m)
1748 ("CONFIG_NFT_QUOTA" . m)
1749 ("CONFIG_NFT_REJECT" . m)
1750 ("CONFIG_NFT_REJECT_INET" . m)
1751 ("CONFIG_NFT_COMPAT" . m)
1752 ("CONFIG_NFT_HASH" . m)
1753 ("CONFIG_NFT_FIB" . m)
1754 ("CONFIG_NFT_FIB_INET" . m)
1755 ("CONFIG_NFT_XFRM" . m)
1756 ("CONFIG_NFT_SOCKET" . m)
1757 ("CONFIG_NFT_OSF" . m)
1758 ("CONFIG_NFT_TPROXY" . m)
1759 ("CONFIG_NFT_SYNPROXY" . m)
1760 ("CONFIG_NFT_DUP_NETDEV" . m)
1761 ("CONFIG_NFT_FWD_NETDEV" . m)
1762 ("CONFIG_NFT_FIB_NETDEV" . m)
1763 ("CONFIG_NFT_REJECT_NETDEV" . m)
1764 ("CONFIG_NFT_REJECT_IPV4" . m)
1765 ("CONFIG_NFT_DUP_IPV4" . m)
1766 ("CONFIG_NFT_FIB_IPV4" . m)
1767 ("CONFIG_NFT_COMPAT_ARP" . m)
1768 ("CONFIG_NFT_REJECT_IPV6" . m)
1769 ("CONFIG_NFT_DUP_IPV6" . m)
1770 ("CONFIG_NFT_FIB_IPV6" . m)
1771 ("CONFIG_NFT_BRIDGE_META" . m)
1772 ("CONFIG_NFT_BRIDGE_REJECT" . m)
1773 ;; Provide support for ath9k wireless
1774 ("CONFIG_ATH9K" . m)
1775 ("CONFIG_ATH9K_HTC" . m))
1776 (default-extra-linux-options
1777 linux-libre-6.17-version)))))
1778 (package
1779 (inherit base)
1780 (inputs (list reform-debian-packages-for-6.17))
1781 (synopsis (string-append (package-synopsis base)
1782 " for MNT/Reform systems"))
1783 (description (string-append (package-description base)
1784 " Configuration options and patches have been applied for use with MNT/Reform systems."))
1785 (arguments
1786 (substitute-keyword-arguments (package-arguments base)
1787 ((#:phases phases)
1788 #~(modify-phases #$phases
1789 (add-after 'unpack 'apply-reform-patches
1790 (lambda* (#:key inputs #:allow-other-keys)
1791 (for-each (lambda (patch)
1792 (invoke "patch" "-p1" "-i"
1793 (search-input-file inputs
1794 (string-append
1795 "patches6.17/" patch))))
1796 (list
1797 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
1798 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
1799 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
1800 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
1801 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
1802 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
1803 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
1804 "imx8mp-mnt-pocket-reform/pocket-panel/0002-pocket-panel-fix-sleep-add-orientation.patch"
1805 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
1806 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
1807 "imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch"
1808 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
1809 "imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch"
1810 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
1811 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
1812 "imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
1813 "imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch"
1814 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
1815 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
1816 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
1817 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
1818 "meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch"
1819 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
1820 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
1821 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
1822 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
1823 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
1824 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
1825 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
1826 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
1827 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
1828 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
1829 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
1830 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
1831 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
1832 "meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch"
1833 "rk3588-mnt-reform2/0001-MERGED-drm-bridge-Pass-down-connector-to-drm-bridge-.patch"
1834 "rk3588-mnt-reform2/0024-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
1835 "rk3588-mnt-reform2/0025-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
1836 "rk3588-mnt-reform2/0026-clk-composite-replace-open-coded-abs_diff.patch"
1837 "rk3588-mnt-reform2/0030-mfd-rk8xx-Fix-shutdown-handler.patch"
1838 "rk3588-mnt-reform2/0031-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
1839 "rk3588-mnt-reform2/0032-drm-rockchip-vop2-Add-clock-resets-support.patch"
1840 "rk3588-mnt-reform2/0033-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
1841 "rk3588-mnt-reform2/0035-drm-rockchip-vop2-Add-core-reset-support.patch"
1842 "rk3588-mnt-reform2/0036-dt-bindings-display-rockchip-Add-schema-for-RK3588-D.patch"
1843 "rk3588-mnt-reform2/0037-drm-bridge-synopsys-Add-DW-DPTX-Controller-support-l.patch"
1844 "rk3588-mnt-reform2/0038-drm-rockchip-Add-RK3588-DPTX-output-support.patch"
1845 "rk3588-mnt-reform2/0042-arm64-dts-rockchip-Add-DP0-for-rk3588.patch"
1846 "rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-DP1-for-rk3588.patch"
1847 "rk3588-mnt-reform2/0046-arm64-defconfig-Enable-Rockchip-RK3588-DisplayPort-C.patch"
1848 "rk3588-mnt-reform2/0055-phy-rockchip-usbdp-move-orientation-handling-further.patch"
1849 "rk3588-mnt-reform2/0056-phy-rockchip-usbdp-reset-USB3-and-reinit-on-orientat.patch"
1850 "rk3588-mnt-reform2/0063-thermal-rockchip-unify-struct-rockchip_tsadc_chip-fo.patch"
1851 "rk3588-mnt-reform2/0064-thermal-rockchip-shut-up-GRF-warning.patch"
1852 "rk3588-mnt-reform2/0065-thermal-rockchip-simplify-GRF-logic.patch"
1853 "rk3588-mnt-reform2/0067-PCI-dw-rockchip-Add-system-PM-support.patch"
1854 "rk3588-mnt-reform2/0068-drm-bridge-dw-hdmi-qp-Add-CEC-support.patch"
1855 "rk3588-mnt-reform2/0069-drm-bridge-dw-hdmi-qp-Fixup-timer-base-setup.patch"
1856 "rk3588-mnt-reform2/0070-drm-rockchip-dw_hdmi_qp-Improve-error-handling-with-.patch"
1857 "rk3588-mnt-reform2/0071-drm-rockchip-dw_hdmi_qp-Provide-CEC-IRQ-in-dw_hdmi_q.patch"
1858 "rk3588-mnt-reform2/0072-drm-rockchip-dw_hdmi_qp-Provide-ref-clock-rate-in-dw.patch"
1859 "rk3588-mnt-reform2/0073-arm64-defconfig-Enable-DW-HDMI-QP-CEC-support.patch"
1860 "rk3588-mnt-reform2/0075-phy-hdmi-Add-HDMI-2.1-FRL-configuration-options.patch"
1861 "rk3588-mnt-reform2/0076-phy-rockchip-samsung-hdptx-Fix-reported-clock-rate-i.patch"
1862 "rk3588-mnt-reform2/0077-phy-rockchip-samsung-hdptx-Reduce-ROPLL-loop-bandwid.patch"
1863 "rk3588-mnt-reform2/0078-phy-rockchip-samsung-hdptx-Prevent-Inter-Pair-Skew-f.patch"
1864 "rk3588-mnt-reform2/0079-phy-rockchip-samsung-hdptx-Use-usleep_range-instead-.patch"
1865 "rk3588-mnt-reform2/0080-phy-rockchip-samsung-hdptx-Fix-coding-style-alignmen.patch"
1866 "rk3588-mnt-reform2/0081-phy-rockchip-samsung-hdptx-Consistently-use-rk_-hdpt.patch"
1867 "rk3588-mnt-reform2/0082-phy-rockchip-samsung-hdptx-Enable-lane-output-in-com.patch"
1868 "rk3588-mnt-reform2/0083-phy-rockchip-samsung-hdptx-Cleanup-_cmn_init_seq-lis.patch"
1869 "rk3588-mnt-reform2/0084-phy-rockchip-samsung-hdptx-Compute-clk-rate-from-PLL.patch"
1870 "rk3588-mnt-reform2/0085-phy-rockchip-samsung-hdptx-Drop-hw_rate-driver-data.patch"
1871 "rk3588-mnt-reform2/0086-phy-rockchip-samsung-hdptx-Switch-to-driver-specific.patch"
1872 "rk3588-mnt-reform2/0087-phy-rockchip-samsung-hdptx-Extend-rk_hdptx_phy_verif.patch"
1873 "rk3588-mnt-reform2/0088-phy-rockchip-samsung-hdptx-Add-HDMI-2.1-FRL-support.patch"
1874 "rk3588-mnt-reform2/0089-drm-rockchip-vop2-Check-bpc-before-switching-DCLK-so.patch"
1875 "rk3588-mnt-reform2/0090-drm-bridge-dw-hdmi-qp-Handle-platform-supported-form.patch"
1876 "rk3588-mnt-reform2/0091-drm-rockchip-dw_hdmi_qp-Switch-to-phy_configure.patch"
1877 "rk3588-mnt-reform2/0092-drm-rockchip-dw_hdmi_qp-Use-bit-macros-for-RK3576-re.patch"
1878 "rk3588-mnt-reform2/0093-drm-rockchip-dw_hdmi_qp-Add-high-color-depth-support.patch"
1879 "rk3588-mnt-reform2/0094-DEBUG-phy-rockchip-samsung-hdptx-Add-verbose-logging.patch"
1880 "rk3588-mnt-reform2/0095-WIP-SCRAMB-drm-bridge-Add-detect_ctx-hook.patch"
1881 "rk3588-mnt-reform2/0096-WIP-SCRAMB-drm-bridge-connector-Switch-from-detect-t.patch"
1882 "rk3588-mnt-reform2/0097-WIP-SCRAMB-drm-bridge-dw-hdmi-qp-Add-high-TMDS-clock.patch"
1883 "rk3588-mnt-reform2/0098-WIP-YUV420-drm-rockchip-vop2-Add-YUV420-output-forma.patch"
1884 "rk3588-mnt-reform2/0099-WIP-YUV420-drm-rockchip-dw_hdmi_qp-Add-YUV420-output.patch"
1885 "rk3588-mnt-reform2/0100-WIP-FRL-dt-bindings-display-rockchip-Add-tmds-enable.patch"
1886 "rk3588-mnt-reform2/0101-WIP-FRL-drm-rockchip-dw_hdmi_qp-Fixup-usage-of-enabl.patch"
1887 "rk3588-mnt-reform2/0103-WIP-FRL-arm64-dts-rockchip-Assign-ACLK_VOP-to-750-MH.patch"
1888 "rk3588-mnt-reform2/0104-WIP-FRL-drm-connector-hdmi-Handle-FRL-in-hdmi_clock_.patch"
1889 "rk3588-mnt-reform2/0105-WIP-FRL-drm-bridge-dw-hdmi-qp-Add-HDMI-2.1-FRL-suppo.patch"
1890 "rk3588-mnt-reform2/0106-WIP-FRL-drm-rockchip-dw_hdmi_qp-Add-HDMI-2.1-FRL-sup.patch"
1891 "rk3588-mnt-reform2/0107-WIP-FRL-drm-rockchip-vop2-Add-HDMI-2.1-FRL-support.patch"
1892 "rk3588-mnt-reform2/0108-dt-bindings-phy-rockchip-usbdp-add-improved-ports-sc.patch"
1893 "rk3588-mnt-reform2/0114-media-dt-bindings-video-interfaces-add-defines-for-s.patch"
1894 "rk3588-mnt-reform2/0142-drm-bridge-dw-hdmi-qp-Fix-spurious-IRQ-on-resume.patch"
1895 "rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch"
1896 "rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch"
1897 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
1898 (add-after 'apply-reform-patches 'copy-reform-dts-files
1899 (lambda* (#:key inputs #:allow-other-keys)
1900 (for-each (lambda (dts)
1901 (copy-file (search-input-file inputs
1902 (string-append
1903 "/dts/" dts))
1904 (string-append "arch/arm64/boot/dts/"
1905 dts)))
1906 (list
1907 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
1908 "freescale/fsl-ls1028a-mnt-reform2.dts"
1909 "freescale/imx8mp-mnt-pocket-reform.dts"
1910 "freescale/imx8mp-mnt-reform2.dts"
1911 "freescale/imx8mq-mnt-reform2-hdmi.dts"
1912 "rockchip/rk3588-mnt-pocket-reform.dts"
1913 "rockchip/rk3588-mnt-reform-next.dts"
1914 "rockchip/rk3588-mnt-reform2.dts"
1915 "rockchip/rk3588-mnt-reform2-dsi.dts"
1916 ))))
1917 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
1918 (lambda _
1919 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
1920 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
1921 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
1922dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
1923 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
1924 (("fsl-ls1028a-rdb.dtb")
1925 "fsl-ls1028a-rdb.dtb
1926dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
1927 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
1928 (("imx8mq-mnt-reform2.dtb")
1929 "imx8mq-mnt-reform2.dtb
1930dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
1931dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
1932dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
1933 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
1934 (("rk3588-mnt-reform2.dtb")
1935 "rk3588-mnt-reform2.dtb
1936dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb
1937dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
1938dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
1939
1940(define-public linux-libre-arm64-mnt-reform linux-libre-arm64-mnt-reform-6.17)
1941
1942(define-public linux-libre-arm64-mnt-reform-6.12
1943 ;; Kernel for use on the MNT/Reform systems
1944 ;; https://mntre.com/reform.html
1945 (let ((base (make-linux-libre* linux-libre-6.12-version
1946 linux-libre-6.12-gnu-revision
1947 (source-with-patches linux-libre-6.12-source
1948 ;; Revert upstream patches
1949 ;; that conflict with
1950 ;; MNT/Reform patches
1951 (search-patches
1952 "linux-libre-arm64-mnt-reform-revert-vop2-display-modes.patch"
1953 "linux-libre-arm64-mnt-reform-revert-phy-rockchip-samsung.patch"
1954 "linux-libre-arm64-mnt-reform-revert-rk-samsung-hdptx.patch"))
1955 '("aarch64-linux")
1956 #:extra-version "arm64-mnt-reform"
1957 #:extra-options
1958 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
1959 (append `(("CONFIG_DRM_LVDS_CODEC" . m)
1960 ("CONFIG_DRM_CDNS_MHDP8546" . m)
1961 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
1962 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
1963 ("CONFIG_DRM_IMX_DCSS" . m)
1964 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
1965 ("CONFIG_DRM_PANEL_LVDS" . m)
1966 ("CONFIG_I2C_IMX_LPI2C" . m)
1967 ("CONFIG_I2C_MUX_REG" . m)
1968 ("CONFIG_INTERCONNECT_IMX" . #true)
1969 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
1970 ("CONFIG_MFD_WM8994" . m)
1971 ("CONFIG_MUX_GPIO" . m)
1972 ("CONFIG_MUX_MMIO" . m)
1973 ("CONFIG_RTC_DRV_PCF8523" . m)
1974 ("CONFIG_USB_EHCI_FSL" . m)
1975 ("CONFIG_NO_HZ_IDLE" . #true)
1976 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
1977 ("CONFIG_SND_IMX_SOC" . m)
1978 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
1979 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
1980 ("CONFIG_SND_SOC_IMX_HDMI" . m)
1981 ("CONFIG_INPUT_JOYSTICK" . #true)
1982 ("CONFIG_JOYSTICK_XPAD" . m)
1983 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
1984 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
1985 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
1986 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
1987 ("CONFIG_DRM_IMX_LCDIF" . #true)
1988 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
1989 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
1990 ("CONFIG_IMX8MM_THERMAL" . #true)
1991 ("CONFIG_IMX2_WDT" . #true)
1992 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
1993 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
1994 ("CONFIG_DRM" . #true)
1995 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . #true)
1996 ("CONFIG_IMX8M_BLK_CTRL" . #true)
1997 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
1998 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
1999 ("CONFIG_DRM_FSL_LDB" . #true)
2000 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
2001 ("CONFIG_BACKLIGHT_PWM" . #true)
2002 ("CONFIG_BACKLIGHT_GPIO" . #true)
2003 ("CONFIG_BACKLIGHT_LED" . #true)
2004 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
2005 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
2006 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
2007 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
2008 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
2009 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
2010 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
2011 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
2012 ("CONFIG_IMX_IRQSTEER" . #true)
2013 ("CONFIG_PCI_MESON" . #true)
2014 ("CONFIG_DWMAC_MESON" . #true)
2015 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . #true)
2016 ("CONFIG_I2C_MESON" . #true)
2017 ("CONFIG_PWM_MESON" . #true)
2018 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
2019 ("CONFIG_MMC_MESON_GX" . #true)
2020 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
2021 ("CONFIG_MESON_DDR_PMU" . #true)
2022 ("CONFIG_RTW88_8822CS" . m)
2023 ("CONFIG_PWM_FSL_FTM" . #true)
2024 ("CONFIG_FSL_RCPM" . #true)
2025 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
2026 ("CONFIG_DRM_PANTHOR" . m)
2027 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
2028 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
2029 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
2030 ("CONFIG_ROCKCHIP_INNO_HDMI" . #true)
2031 ("CONFIG_ROCKCHIP_LVDS" . #true)
2032 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
2033 ("CONFIG_SPI_ROCKCHIP" . #true)
2034 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
2035 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
2036 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . m)
2037 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
2038 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
2039 ("CONFIG_ROCKCHIP_DW_MIPI_DSI" . #true)
2040 ;; Fixes https://codeberg.org/guix/guix/issues/101
2041 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
2042 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
2043 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
2044 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
2045 ("CONFIG_KEY_DH_OPERATIONS" . #true)
2046 ;; nftables support
2047 ("CONFIG_NF_TABLES" . m)
2048 ("CONFIG_NF_TABLES_INET" . #true)
2049 ("CONFIG_NF_TABLES_NETDEV" . #true)
2050 ("CONFIG_NF_TABLES_IPV4" . #true)
2051 ("CONFIG_NF_TABLES_ARP" . #true)
2052 ("CONFIG_NF_TABLES_IPV6" . #true)
2053 ("CONFIG_NF_TABLES_BRIDGE" . m)
2054 ("CONFIG_NFT_NUMGEN" . m)
2055 ("CONFIG_NFT_CT" . m)
2056 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
2057 ("CONFIG_NFT_CONNLIMIT" . m)
2058 ("CONFIG_NFT_LOG" . m)
2059 ("CONFIG_NFT_LIMIT" . m)
2060 ("CONFIG_NFT_MASQ" . m)
2061 ("CONFIG_NFT_REDIR" . m)
2062 ("CONFIG_NFT_NAT" . m)
2063 ("CONFIG_NFT_TUNNEL" . m)
2064 ("CONFIG_NFT_QUEUE" . m)
2065 ("CONFIG_NFT_QUOTA" . m)
2066 ("CONFIG_NFT_REJECT" . m)
2067 ("CONFIG_NFT_REJECT_INET" . m)
2068 ("CONFIG_NFT_COMPAT" . m)
2069 ("CONFIG_NFT_HASH" . m)
2070 ("CONFIG_NFT_FIB" . m)
2071 ("CONFIG_NFT_FIB_INET" . m)
2072 ("CONFIG_NFT_XFRM" . m)
2073 ("CONFIG_NFT_SOCKET" . m)
2074 ("CONFIG_NFT_OSF" . m)
2075 ("CONFIG_NFT_TPROXY" . m)
2076 ("CONFIG_NFT_SYNPROXY" . m)
2077 ("CONFIG_NFT_DUP_NETDEV" . m)
2078 ("CONFIG_NFT_FWD_NETDEV" . m)
2079 ("CONFIG_NFT_FIB_NETDEV" . m)
2080 ("CONFIG_NFT_REJECT_NETDEV" . m)
2081 ("CONFIG_NFT_REJECT_IPV4" . m)
2082 ("CONFIG_NFT_DUP_IPV4" . m)
2083 ("CONFIG_NFT_FIB_IPV4" . m)
2084 ("CONFIG_NFT_COMPAT_ARP" . m)
2085 ("CONFIG_NFT_REJECT_IPV6" . m)
2086 ("CONFIG_NFT_DUP_IPV6" . m)
2087 ("CONFIG_NFT_FIB_IPV6" . m)
2088 ("CONFIG_NFT_BRIDGE_META" . m)
2089 ("CONFIG_NFT_BRIDGE_REJECT" . m)
2090 ;; Provide support for ath9k wireless
2091 ("CONFIG_ATH9K" . m)
2092 ("CONFIG_ATH9K_HTC" . m))
2093 (default-extra-linux-options
2094 linux-libre-6.12-version)))))
2095 (package
2096 (inherit base)
2097 (inputs (list reform-debian-packages-for-6.12))
2098 (synopsis (string-append (package-synopsis base)
2099 " for MNT/Reform systems"))
2100 (description (string-append (package-description base)
2101 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2102 (arguments
2103 (substitute-keyword-arguments (package-arguments base)
2104 ((#:phases phases)
2105 #~(modify-phases #$phases
2106 (add-after 'unpack 'apply-reform-patches
2107 (lambda* (#:key inputs #:allow-other-keys)
2108 (for-each (lambda (patch)
2109 (invoke "patch" "-p1" "-i"
2110 (search-input-file inputs
2111 (string-append
2112 "patches6.12/" patch))))
2113 (list
2114 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2115 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2116 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
2117 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2118 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2119 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2120 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2121 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2122 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2123 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2124 "imx8mq-mnt-reform2/0002-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2125 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2126 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2127 ;; Does not apply, needs further investigation
2128 ;; "imx8mq-mnt-reform2/v19_20241126_sandor_yu_initial_support_cadence_mhdp8501_hdmi_dp_for_i_mx8mq.mbx"
2129 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2130 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2131 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2132 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2133 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2134 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2135 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2136 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2137 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2138 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2139 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2140 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2141 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2142 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2143 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2144 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2145 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2146 "rk3588-mnt-reform2/0001-regulator-Add-of_regulator_get_optional-for-pure-DT-.patch"
2147 "rk3588-mnt-reform2/0001-scripts-package-builddeb-allow-hooks-also-in-usr-sha.patch"
2148 "rk3588-mnt-reform2/0002-regulator-Add-devres-version-of-of_regulator_get_opt.patch"
2149 "rk3588-mnt-reform2/0004-arm64-dts-rockchip-rk3588-rock5b-add-USB-C-support.patch"
2150 "rk3588-mnt-reform2/0005-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2151 "rk3588-mnt-reform2/0006-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2152 "rk3588-mnt-reform2/0007-clk-composite-replace-open-coded-abs_diff.patch"
2153 "rk3588-mnt-reform2/0008-clk-rockchip-support-clocks-registered-late.patch"
2154 "rk3588-mnt-reform2/0009-clk-rockchip-rk3588-register-GATE_LINK-later.patch"
2155 "rk3588-mnt-reform2/0010-clk-rockchip-expose-rockchip_clk_set_lookup.patch"
2156 "rk3588-mnt-reform2/0011-clk-rockchip-implement-linked-gate-clock-support.patch"
2157 "rk3588-mnt-reform2/0012-clk-rockchip-rk3588-drop-RK3588_LINKED_CLK.patch"
2158 "rk3588-mnt-reform2/0013-arm64-dts-rockchip-rk3588-evb1-add-bluetooth-rfkill.patch"
2159 "rk3588-mnt-reform2/0014-arm64-dts-rockchip-rk3588-evb1-improve-PCIe-ethernet.patch"
2160 "rk3588-mnt-reform2/0015-arm64-dts-rockchip-Slow-down-EMMC-a-bit-to-keep-IO-s.patch"
2161 "rk3588-mnt-reform2/0016-vop2-Add-clock-resets-support.patch"
2162 "rk3588-mnt-reform2/0017-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2163 "rk3588-mnt-reform2/0018-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2164 "rk3588-mnt-reform2/0019-media-v4l2-ctrls-core-Set-frame_mbs_only_flag-by-def.patch"
2165 "rk3588-mnt-reform2/0020-media-rockchip-Move-H264-CABAC-table-to-header-file.patch"
2166 "rk3588-mnt-reform2/0021-media-rockchip-Introduce-the-rkvdec2-driver.patch"
2167 "rk3588-mnt-reform2/0022-media-dt-bindings-rockchip-Document-RK3588-Video-Dec.patch"
2168 "rk3588-mnt-reform2/0023-arm64-dts-rockchip-Add-rkvdec2-Video-Decoder-on-rk35.patch"
2169 "rk3588-mnt-reform2/0024-arm64-defconfig-enable-Rockchip-RK3588-video-decoder.patch"
2170 "rk3588-mnt-reform2/0025-mfd-rk8xx-Fix-shutdown-handler.patch"
2171 "rk3588-mnt-reform2/0026-WIP-phy-phy-rockchip-samsung-hdptx-Add-FRL-EARC-supp.patch"
2172 "rk3588-mnt-reform2/0027-TESTING-phy-phy-rockchip-samsung-hdptx-Add-verbose-l.patch"
2173 "rk3588-mnt-reform2/0028-WIP-dt-bindings-display-rockchip-drm-Add-optional-cl.patch"
2174 "rk3588-mnt-reform2/0029-WIP-drm-rockchip-vop2-Improve-display-modes-handling.patch"
2175 "rk3588-mnt-reform2/0030-arm64-dts-rockchip-Add-HDMI0-bridge-to-rk3588.patch"
2176 "rk3588-mnt-reform2/0031-arm64-dts-rockchip-Enable-HDMI0-on-rock-5b.patch"
2177 "rk3588-mnt-reform2/0032-arm64-dts-rockchip-Enable-HDMI0-on-rk3588-evb1.patch"
2178 "rk3588-mnt-reform2/0033-WIP-arm64-dts-rockchip-Enable-HDMI0-PHY-clk-provider.patch"
2179 "rk3588-mnt-reform2/0034-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2180 "rk3588-mnt-reform2/0035-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2181 "rk3588-mnt-reform2/0036-dt-bindings-display-bridge-Add-schema-for-Synopsys-D.patch"
2182 "rk3588-mnt-reform2/0037-dt-bindings-display-rockchip-Add-schema-for-RK3588-H.patch"
2183 "rk3588-mnt-reform2/0038-drm-bridge-synopsys-Add-DW-HDMI-QP-TX-controller-dri.patch"
2184 "rk3588-mnt-reform2/0039-drm-rockchip-Add-basic-RK3588-HDMI-output-support.patch"
2185 "rk3588-mnt-reform2/0040-arm64-defconfig-Enable-Rockchip-extensions-for-Synop.patch"
2186 "rk3588-mnt-reform2/0041-MAINTAINERS-Add-entry-for-Synopsys-DesignWare-HDMI-R.patch"
2187 "rk3588-mnt-reform2/0042-dt-bindings-media-Document-bindings-for-HDMI-RX-Cont.patch"
2188 "rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-device-tree-support-for-HDMI-.patch"
2189 "rk3588-mnt-reform2/0044-media-platform-synopsys-Add-support-for-HDMI-input-d.patch"
2190 "rk3588-mnt-reform2/0045-arm64-defconfig-Enable-Synopsys-HDMI-receiver.patch"
2191 "rk3588-mnt-reform2/0046-arm64-dts-rockchip-Enable-HDMI-receiver-on-rock-5b.patch"
2192 "rk3588-mnt-reform2/0047-arm64-dts-rockchip-Enable-HDMI-receiver-on-RK3588-EV.patch"
2193 "rk3588-mnt-reform2/0048-arm64-defconfig-Enable-default-EDID-for-Synopsys-HDM.patch"
2194 "rk3588-mnt-reform2/0049-regulator-Add-devm_-of_regulator_get.patch"
2195 "rk3588-mnt-reform2/0050-pmdomain-rockchip-cleanup-mutex-handling-in-rockchip.patch"
2196 "rk3588-mnt-reform2/0051-pmdomain-rockchip-forward-rockchip_do_pmu_set_power_.patch"
2197 "rk3588-mnt-reform2/0052-pmdomain-rockchip-reduce-indentation-in-rockchip_pd_.patch"
2198 "rk3588-mnt-reform2/0053-dt-bindings-power-rockchip-add-regulator-support.patch"
2199 "rk3588-mnt-reform2/0054-pmdomain-rockchip-add-regulator-support.patch"
2200 "rk3588-mnt-reform2/0055-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch"
2201 "rk3588-mnt-reform2/0056-dt-bindings-net-wireless-brcm4329-fmac-add-pci14e4-4.patch"
2202 "rk3588-mnt-reform2/0057-dt-bindings-net-wireless-brcm4329-fmac-add-clock-des.patch"
2203 "rk3588-mnt-reform2/0058-wifi-brcmfmac-Add-optional-lpo-clock-enable-support.patch"
2204 ;; does not apply cleanly due to DEBLOBBING
2205 ;; "rk3588-mnt-reform2/0059-wifi-brcmfmac-add-flag-for-random-seed-during-firmwa.patch"
2206 "rk3588-mnt-reform2/0060-arm64-dts-rockchip-rk3588-evb1-add-WLAN-controller.patch"
2207 "rk3588-mnt-reform2/0061-arm64-dts-rockchip-add-and-enable-gpu-node-for-Radxa.patch"
2208 "rk3588-mnt-reform2/0062-arm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch"
2209 "rk3588-mnt-reform2/0100-rk3588-dtsi-add-hdmi1-controller.patch"
2210 "rk3588-mnt-reform2/0102-drm-panthor-Actually-suspend-IRQs-in-the-unplug-path.patch"
2211 "rk3588-mnt-reform2/3001-display-rockchip-add-schema-for-rk3588-hdmi-tx.patch"
2212 "rk3588-mnt-reform2/4000-mnt-rk3588-dual-hdmi-qp-rockchip.patch"
2213 "rk3588-mnt-reform2/4001-mnt-rk3588-dual-hdmi-vop2-pll.patch"
2214 "rk3588-mnt-reform2/5001-rk3588-dsi2-driver.patch"
2215 "rk3588-mnt-reform2/5002-rk3588-dsi-dts-nodes.patch"
2216 "rk3588-mnt-reform2/5100-modernize-hdmi1-in-dtsi.patch"
2217 "rk3588-mnt-reform2/5110-hdptx-crash-workaround.patch"
2218 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
2219 (add-after 'apply-reform-patches 'copy-reform-dts-files
2220 (lambda* (#:key inputs #:allow-other-keys)
2221 (for-each (lambda (dts)
2222 (copy-file (search-input-file inputs
2223 (string-append
2224 "/dts/" dts))
2225 (string-append "arch/arm64/boot/dts/"
2226 dts)))
2227 (list
2228 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2229 "amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts"
2230 "freescale/fsl-ls1028a-mnt-reform2.dts"
2231 "freescale/imx8mp-mnt-pocket-reform.dts"
2232 "freescale/imx8mp-mnt-reform2.dts"
2233 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2234 "freescale/imx8mq-mnt-reform2.dts"
2235 "rockchip/rk3588-mnt-pocket-reform.dts"
2236 "rockchip/rk3588-mnt-reform-next.dts"
2237 "rockchip/rk3588-mnt-reform2.dts"))))
2238 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2239 (lambda _
2240 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2241 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2242 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2243dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2244 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2245 (("fsl-ls1028a-rdb.dtb")
2246 "fsl-ls1028a-rdb.dtb
2247dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2248 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2249 (("imx8mq-mnt-reform2.dtb")
2250 "imx8mq-mnt-reform2.dtb
2251dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2252dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2253dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2254 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2255 (("rk3588-rock-5b.dtb")
2256 "rk3588-rock-5b.dtb
2257dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2.dtb
2258dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2259dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
2260
2261(define-public linux-libre-riscv64-generic
2262 (make-linux-libre* linux-libre-version
2263 linux-libre-gnu-revision
2264 linux-libre-source
2265 '("riscv64-linux")
2266 #:extra-version "riscv64-generic"
2267 #:extra-options
2268 (append
2269 ;; required `guix system vm'
2270 `(("CONFIG_USB_HID" . m)
2271 ("CONFIG_HID_GEMBIRD" . m)
2272 ("CONFIG_AHCI_DWC" . m)
2273 ("CONFIG_SATA_AHCI" . m)
2274 ("CONFIG_CRYPTO_SERPENT" . m)
2275 ("CONFIG_CRYPTO_WP512" . m)
2276 ("CONFIG_USB_UAS" . m)
2277 ("CONFIG_USB_STORAGE" . m)
2278 ("CONFIG_HID_GENERIC" . m)
2279 ("CONFIG_DRM_CIRRUS_QEMU" . m)
2280 ("CONFIG_HW_RANDOM_VIRTIO" . m)
2281 ("CONFIG_VIRTIO_CONSOLE" . m)
2282 ("CONFIG_CRYPTO_XTS" . m))
2283 (default-extra-linux-options linux-libre-version))))
2284
2285(define-public linux-libre-mips64el-fuloong2e
2286 (make-linux-libre* linux-libre-version
2287 linux-libre-gnu-revision
2288 linux-libre-source
2289 '("mips64el-linux")
2290 #:defconfig "fuloong2e_defconfig"
2291 #:extra-version "mips64el-fuloong2e"
2292 #:extra-options
2293 (append
2294 `(("CONFIG_OVERLAY_FS" . m))
2295 (default-extra-linux-options linux-libre-version))))
2296
2297(define-deprecated-package linux-libre-with-bpf
2298 linux-libre)
2299
2300
2301;;;
2302;;; Linux kernel modules.
2303;;;
2304
2305(define-public acpi-call-linux-module
2306 (package
2307 (name "acpi-call-linux-module")
2308 (version "1.2.2")
2309 (source
2310 (origin
2311 (method git-fetch)
2312 (uri (git-reference
2313 (url "https://github.com/nix-community/acpi_call")
2314 (commit (string-append "v" version))))
2315 (file-name (git-file-name name version))
2316 (sha256
2317 (base32 "09ljx0jl987753r2kjqj5kxms95bijw0xn14kf82ryn38ck5c8cf"))))
2318 (build-system linux-module-build-system)
2319 (arguments
2320 (list #:tests? #f ; no tests
2321 #:phases
2322 #~(modify-phases %standard-phases
2323 (add-before 'install 'patch-shebangs-harder
2324 ;; The (only) shebangs in examples/ don't justify a reference.
2325 ;; However, do substitute a slightly more portable one.
2326 (lambda _
2327 (substitute* (find-files "examples" ".")
2328 (("^(#! *)/[^ ]*/" _ shebang)
2329 (string-append shebang "/usr/bin/env ")))))
2330 (add-after 'install 'install-documentation
2331 (lambda _
2332 (let* ((doc (string-append #$output "/share/doc/"
2333 #$name "-" #$version)))
2334 (for-each (lambda (file)
2335 (let ((target (string-append doc "/" file)))
2336 (mkdir-p (dirname target))
2337 (copy-recursively file target)))
2338 (list "README.md" "examples"))))))))
2339 (home-page "https://github.com/nix-community/acpi_call")
2340 (synopsis "Linux kernel module to perform ACPI method calls")
2341 (description
2342 "This simple Linux kernel module allows calls from user space to any
2343@acronym{ACPI, Advanced Configuration and Power Interface} method provided by
2344your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
2345any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
2346and @code{ACPI_BUFFER}.
2347
2348It grants direct and undocumented access to your hardware that may cause damage
2349and should be used with caution, especially on untested models.")
2350 (license license:gpl3+))) ; see README.md (no licence headers)
2351
2352(define-public corefreq
2353 (package
2354 (name "corefreq")
2355 (version "1.98.4")
2356 (source
2357 (origin
2358 (method git-fetch)
2359 (uri (git-reference
2360 (url "https://github.com/cyring/CoreFreq")
2361 (commit version)))
2362 (file-name (git-file-name name version))
2363 (sha256
2364 (base32 "0mxp5h23y09674syaj5gpdifr53zvgjv7g7hargwg6897883qfln"))))
2365 ;; The upstream Makefile is now such a proprietary mess that standard builds
2366 ;; as performed by our linux-module-build-system are more or less impossible
2367 ;; without heavy patching. However, we still keep it as the main build
2368 ;; system because lifting out LINUX-MODULE-BUILDER would be even messier.
2369 (build-system linux-module-build-system)
2370 (outputs (list "out" "linux-module"))
2371 (arguments
2372 (list #:imported-modules `((guix build gnu-build-system)
2373 ,@%linux-module-build-system-modules)
2374 #:modules `((guix build linux-module-build-system)
2375 ((guix build gnu-build-system) #:prefix gnu:)
2376 (guix build utils))
2377 #:make-flags
2378 #~(list (string-append "CC=" #$(cc-for-target))
2379 "OPTIM_LVL=3"
2380 (string-append "PREFIX=" #$output))
2381 #:tests? #f ;no test suite
2382 #:source-directory "../build" ;must contain modules.order
2383 #:phases
2384 #~(modify-phases %standard-phases
2385 (add-after 'unpack 'patch-Makefile
2386 (lambda* (#:key inputs #:allow-other-keys)
2387 (let ((dir (search-input-directory
2388 inputs "lib/modules/build")))
2389 (substitute* "Makefile"
2390 (("^(KERNELREL \\?= ).*" _ =)
2391 (string-append = (dirname dir) "\n"))
2392 (("^(KERNELDIR \\?= ).*" _ =)
2393 (string-append = dir "\n"))
2394 (("^([[:space:]]+)(.* modules_install.*)"
2395 _ indent command)
2396 (string-append indent "@echo skipping " command))))))
2397 (add-before 'build 'prepare
2398 (lambda* (#:key source-directory make-flags #:allow-other-keys)
2399 ;; Lazily fix another mismatch between what the kernel module
2400 ;; build system expects and what this package provides.
2401 (symlink "source/build" source-directory) ;$(BUILD)
2402 ;; Set up symbolic links inside $(BUILD), for some reason.
2403 (apply invoke "make" "prepare" make-flags)))
2404 (replace 'build (assoc-ref gnu:%standard-phases 'build))
2405 (add-before 'install 'resolve-symlink
2406 ;; The build system silently fails to install from a symlink.
2407 (lambda _
2408 (delete-file "../build")
2409 (copy-recursively "build" "../build")))
2410 (add-before 'install 'create-output
2411 (lambda _
2412 ;; Avoid installing the corefreq binary as …/bin.
2413 (mkdir-p (string-append #$output "/bin"))))
2414 (add-after 'install 'gnu:install
2415 (assoc-ref gnu:%standard-phases 'install))
2416 (add-after 'install 'separate-module
2417 (lambda* (#:key outputs #:allow-other-keys)
2418 ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an
2419 ;; empty <out>/lib/modules directory, so just do it all by hand.
2420 (let* ((output (assoc-ref outputs "out"))
2421 (module (assoc-ref outputs "linux-module")))
2422 (mkdir-p module)
2423 (rename-file (string-append output "/lib")
2424 (string-append module "/lib")))))
2425 (add-after 'install 'install-README
2426 ;; There is no proper documentation. Provide something.
2427 (lambda* (#:key outputs #:allow-other-keys)
2428 (let* ((out (assoc-ref outputs "out"))
2429 (doc (string-append out "/share/doc/"
2430 #$name "-" #$version)))
2431 (install-file "README.md" doc)))))))
2432 (home-page "https://github.com/cyring/CoreFreq")
2433 (synopsis
2434 "Measure performance data & tweak low-level settings on x86-64 CPUs")
2435 (description
2436 "CoreFreq is a CPU monitor that reports low-level processor settings and
2437performance data with notably high precision by using a loadable Linux kernel
2438module. Unlike most similar tools, it can be used to modify some settings if
2439supported by the hardware and at your own risk. It's designed for 64-bit x86
2440Intel processors (Atom, Core2, Nehalem, SandyBridge, and newer) and compatible
2441architectures like AMD@tie{}Zen and Hygon@tie{}Dhyana.
2442
2443Supported processor features include:
2444@enumerate
2445@item time spent in C-states, including C1/C3 Auto- and UnDemotion;
2446@item core temperatures, voltage, and tweaking thermal limits;
2447@item core frequencies, ratios, and base clock rate;
2448@item enabling, disabling, and testing SpeedStep (EIST), Turbo Boost, and
2449Hyper-Threading or SMT;
2450@item enabling or disabling data cache prefetching;
2451@item kernel assembly code to keep as near as possible readings of performance
2452counters such as the @acronym{TSC, Time Stamp Counter}, @acronym{UCC, Unhalted
2453Core Cycles}, and @acronym{URC, Unhalted Reference Cycles};
2454@item the number of instructions per cycle or second (IPS, IPC, and CPI);
2455@item memory controller geometry and RAM timings;
2456@item running processes' CPU affinity.
2457@end enumerate
2458
2459This package provides the @command{corefreqd} data collection daemon, the
2460@command{corefreq-cli} client to visualise and control it in real time, and the
2461@code{corefreqk} kernel module in its own separate output. Read the included
2462@file{README.md} before loading it.")
2463 (supported-systems (list "x86_64-linux"))
2464 (license license:gpl2)))
2465
2466(define-public librem-ec-acpi-linux-module
2467 (package
2468 (name "librem-ec-acpi-linux-module")
2469 (version "0.9.2")
2470 (source
2471 (origin
2472 (method git-fetch)
2473 (uri (git-reference
2474 (url "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
2475 (commit (string-append "v" version))))
2476 (file-name (git-file-name name version))
2477 (sha256
2478 (base32 "0m8hamf0550083jnk5q4hv20l8lfiardnkxbib4hhvqghpzzbxl0"))))
2479 (build-system linux-module-build-system)
2480 (arguments
2481 (list #:tests? #f)) ; no test suite
2482 (home-page "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
2483 (synopsis "Linux kernel module to control the Librem Embedded Controller")
2484 (description
2485 "This is the Linux kernel @acronym{ACPI, Advanced Configuration and Power
2486Interface} platform driver for the @acronym{EC, Embedded Controller} firmware
2487on Purism Librem laptop computers. It allows user-space control over the
2488battery charging thresholds, keyboard backlight, fans and thermal monitors,
2489and the notification, WiFi, and Bluetooth LED.")
2490 (license license:gpl2)))
2491
2492(define-public tuxedo-keyboard
2493 (package
2494 (name "tuxedo-keyboard")
2495 (version "4.15.4")
2496 (source
2497 (origin
2498 (method git-fetch)
2499 (uri (git-reference
2500 (url "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers.git")
2501 (commit (string-append "v" version))))
2502 (file-name (git-file-name name version))
2503 (sha256
2504 (base32 "0mimgcbp57gp3smd439g8040sl80qqnfzmh2vhs2qv1kwyxs75sq"))))
2505 (build-system linux-module-build-system)
2506 (arguments
2507 (list #:tests? #f)) ; no test suite
2508 ;; This package fails to build on aarch64, and the manufacturer only sells
2509 ;; machines based on Intel-compatible processors. For more information, see
2510 ;; <https://codeberg.org/guix/guix/pulls/1795>.
2511 (supported-systems '("i686-linux" "x86_64-linux"))
2512 (home-page "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers")
2513 (synopsis "Linux kernel modules to control keyboard on most Tuxedo computers")
2514 (description
2515 "This package provides the @code{tuxedo_keyboard}, @code{tuxedo_io},
2516@code{clevo_wmi} @acronym{WMI, Windows Management Engine} and the
2517@code{clevo_acpi} @acronym{ACPI, Advanced Configuration and Power Interface}
2518kernel modules to control the keyboard on most Tuxedo computers. The @code{tuxedo_io}
2519module is also needed for the @code{tuxedo-control-center} (short tcc) package.")
2520 (license license:gpl2+)))
2521
2522(define-public evdi
2523 (package
2524 (name "evdi")
2525 (version "1.14.8") ;inherited by libevdi
2526 (source
2527 (origin
2528 (method git-fetch)
2529 (uri (git-reference
2530 (url "https://github.com/DisplayLink/evdi")
2531 (commit (string-append "v" version))))
2532 (file-name (git-file-name name version))
2533 (sha256
2534 (base32 "18n8kk4gbbj252a2dqb7mbpscfb437x42flh1fsl4g5c8brczc77"))))
2535 (build-system linux-module-build-system)
2536 (arguments
2537 (list #:tests? #f ;no test suite
2538 #:phases #~(modify-phases %standard-phases
2539 (add-after 'unpack 'chdir
2540 (lambda _
2541 (chdir "module"))))))
2542 (home-page "https://github.com/DisplayLink/evdi")
2543 (synopsis
2544 "@acronym{EVDI, Extensible Virtual Display Interface} Linux kernel module")
2545 (description
2546 "The @acronym{EVDI, Extensible Virtual Display Interface} is a Linux kernel
2547module that enables management of multiple screens, allowing user-space programs
2548to take control over what happens with the image. It is essentially a virtual
2549display for which applications using the @code{libevdi} library can add, remove,
2550and receive screen updates.
2551
2552The EVDI driver uses the standard Linux @acronym{DRM, Direct Rendering Manager}.
2553Its displays can be controlled by standard tools such as @command{xrandr} and
2554display settings applets in graphical environments")
2555 (license license:gpl2)))
2556
2557(define-public libevdi
2558 (package
2559 (inherit evdi)
2560 (name "libevdi")
2561 (build-system gnu-build-system)
2562 (arguments
2563 (list #:tests? #f ;no test suite
2564 #:make-flags
2565 #~(list (string-append "CC=" #$(cc-for-target)))
2566 #:phases #~(modify-phases %standard-phases
2567 (delete 'configure)
2568 (add-after 'unpack 'chdir
2569 (lambda _
2570 (chdir "library")))
2571 (replace 'install
2572 (lambda* _
2573 (let* ((lib (string-append #$output "/lib")))
2574 (mkdir-p lib)
2575 (install-file "libevdi.so" lib)))))))
2576 (inputs (list libdrm))
2577 (native-inputs (list pkg-config))
2578 (synopsis
2579 "@acronym{EVDI, Extensible Virtual Display Interface} user-space library")
2580 (description
2581 "Libevdi is a library that gives applications easy access to
2582@acronym{EVDI, Extensible Virtual Display Interface} devices provided by the
2583@code{evdi} driver package.")
2584 (license license:lgpl2.1)))
2585
2586(define-public ec
2587 (package
2588 (name "ec")
2589 (version (package-version linux-libre))
2590 (source (package-source linux-libre))
2591 (build-system gnu-build-system)
2592 (arguments
2593 (list #:make-flags #~(list (string-append "sbindir="
2594 #$output "/sbin")
2595 "INSTALL=install" "STRIPCMD=true")
2596 #:phases #~(modify-phases %standard-phases
2597 (add-after 'unpack 'enter-subdirectory
2598 (lambda _
2599 (chdir "tools/power/acpi/tools/ec")))
2600 (delete 'configure)) ;no configure script
2601 #:tests? #f)) ;no tests
2602 (home-page (package-home-page linux-libre))
2603 (synopsis
2604 "Utility for reading or writing @acronym{EC, Embedded Controller} registers")
2605 (description
2606 "This utility can read or write specific registers or all the available
2607registers of the @acronym{EC, Embedded Controller} supported by the
2608@code{ec_sys} Linux driver.")
2609 (license license:gpl2)))
2610
2611(define-public lkrg
2612 (package
2613 (name "lkrg")
2614 (version "0.9.7")
2615 (source (origin
2616 (method git-fetch)
2617 (uri (git-reference
2618 (url "https://github.com/lkrg-org/lkrg")
2619 (commit (string-append "v" version))))
2620 (file-name (git-file-name name version))
2621 (sha256
2622 (base32
2623 "0k0z9caj48nqjwk3bapgfcdzi1lkizxcjj4r1dvkvwsk38mbk1c4"))))
2624 (build-system linux-module-build-system)
2625 (arguments
2626 (list #:linux linux-libre
2627 #:tests? #f
2628 #:make-flags #~(list (string-append "CC="
2629 #$(cc-for-target))
2630 (string-append "SYSSRC="
2631 (assoc-ref %build-inputs
2632 "linux-module-builder")
2633 "/lib/modules/build"))))
2634 (inputs (list bash-minimal))
2635 (home-page "https://lkrg.org/")
2636 (synopsis "Linux Kernel Runtime Guard")
2637 (description
2638 "This package performs runtime integrity checking of the Linux kernel and
2639detection of security vulnerability exploits against the kernel.")
2640 (license license:gpl2)))
2641
2642(define-public vhba-module
2643 (package
2644 (name "vhba-module")
2645 (version "20211218")
2646 (source
2647 (origin
2648 (method url-fetch)
2649 (uri (string-append
2650 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
2651 version ".tar.xz"))
2652 (sha256
2653 (base32 "1dkprnnya0i8121p7ip4g8cww99drk7fzbwcxx65x02jqk0siibj"))))
2654 (build-system linux-module-build-system)
2655 (arguments
2656 (list #:tests? #f)) ; no test suite
2657 (home-page "https://cdemu.sourceforge.io/")
2658 (synopsis "Linux kernel module that emulates SCSI devices")
2659 (description
2660 "The @acronym{VHBA, Virtual SCSI Host Bus Adapter} module is the link
2661between the CDemu user-space daemon and the kernel Linux. It acts as a
2662low-level SCSI driver that emulates a virtual SCSI adapter which can have
2663multiple virtual devices attached to it. Its typical use with CDEmu is to
2664emulate optical devices such as DVD and CD-ROM drives.")
2665 (license license:gpl2+)))
2666
2667(define-public bbswitch-module
2668 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
2669 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
2670 (let ((commit "19f60204596a6463b162fc7ca11f4946f5c20cea"))
2671 (package
2672 (name "bbswitch-module")
2673 (version (git-version "0.8" "2" commit))
2674 (source (origin
2675 (method git-fetch)
2676 (uri (git-reference
2677 ;; Use fork until
2678 ;; https://github.com/Bumblebee-Project/bbswitch/pull/219
2679 ;; is merged.
2680 (url "https://github.com/madchic/bbswitch")
2681 (commit commit)))
2682 (file-name (git-file-name name version))
2683 (sha256
2684 (base32
2685 "1pv41y02c9xg9k1bg4i4ll3w7hxxzdr651i08f092b9q5hr57mqn"))))
2686 (build-system linux-module-build-system)
2687 (arguments
2688 (list #:tests? #f)) ; no test suite
2689 (home-page "https://github.com/Bumblebee-Project/bbswitch")
2690 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
2691 (description "The bbswitch module provides a way to toggle the Nvidia
2692graphics card on Optimus laptops.")
2693 (license license:gpl2))))
2694
2695(define-public bin-graph
2696 (package
2697 (name "bin-graph")
2698 (version "1.2.0")
2699 (source
2700 (origin
2701 (method git-fetch)
2702 (uri (git-reference
2703 (url "https://github.com/8dcc/bin-graph")
2704 (commit (string-append "v" version))))
2705 (file-name (git-file-name name version))
2706 (sha256
2707 (base32 "1msr4fj1nh6hf5h6j5pimfrgd37xy4xbik3iml9gd3b1fdkxsdv7"))))
2708 (arguments
2709 (list #:tests? #f ; no tests
2710 #:make-flags
2711 #~(list (string-append "CC=" #$(cc-for-target))
2712 (string-append "PREFIX=" #$output)
2713 (string-append "INSTALL_DIR=" #$output "/bin"))
2714 #:phases
2715 #~(modify-phases %standard-phases
2716 (delete 'configure)))) ; no configure script
2717 (build-system gnu-build-system)
2718 (inputs (list libpng))
2719 (home-page "https://github.com/8dcc/bin-graph")
2720 (synopsis "Visualize binary files")
2721 (description
2722 "@code{bin-graph} provides a simple way of visualizing the different regions
2723of a binary file.")
2724 (license license:gpl3)))
2725
2726(define-public ddcci-driver-linux
2727 (let ((revision "0")
2728 (commit "7f8f8e6c221a286d57a643c2909109a54e084eed"))
2729 (package
2730 (name "ddcci-driver-linux")
2731 (version (git-version "0.4.5" revision commit))
2732 (source
2733 (origin
2734 (method git-fetch)
2735 (uri
2736 (git-reference
2737 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
2738 (commit commit)))
2739 (file-name (git-file-name name version))
2740 (sha256
2741 (base32 "0sgldghd8n4qjm5nv9dgxjibj1hg4kkk1811wndf3vx3dacsmkl9"))))
2742 (build-system linux-module-build-system)
2743 (arguments
2744 (list #:tests? #f ; no tests
2745 #:phases
2746 #~(modify-phases %standard-phases
2747 (replace 'build
2748 (lambda args
2749 (for-each
2750 (lambda (module)
2751 (with-directory-excursion module
2752 (apply (assoc-ref %standard-phases 'build) args)))
2753 '("ddcci" "ddcci-backlight"))))
2754 (replace 'install
2755 (lambda args
2756 (for-each
2757 (lambda (module)
2758 (with-directory-excursion module
2759 (apply (assoc-ref %standard-phases 'install) args)))
2760 '("ddcci" "ddcci-backlight")))))))
2761 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
2762 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
2763 (description "This package provides two Linux kernel drivers, ddcci and
2764ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
2765interface. The ddcci module creates a character device for each DDC/CI
2766monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
2767module allows the control of the backlight level or luminance property when
2768supported under @file{/sys/class/backlight/}.")
2769 (license license:gpl2+))))
2770
2771(define-public reform2-lpc-module
2772 (package
2773 (name "reform2-lpc-module")
2774 (version "1.79")
2775 (source
2776 (origin
2777 (method git-fetch)
2778 (uri (git-reference
2779 (url "https://source.mnt.re/reform/reform-tools.git")
2780 (commit version)))
2781 (file-name (git-file-name name version))
2782 (sha256
2783 (base32 "16xzdygf14zksvqjbp5gwiqsn0mb7kphvzrmqbl9db4kvyj4ajqa"))))
2784 (build-system linux-module-build-system)
2785 (arguments
2786 '(#:tests? #f ;no tests
2787 #:source-directory "lpc"))
2788 (synopsis "Linux kernel module for the Reform 2 system controller")
2789 (description
2790 "The reform2_lpc module allows for interaction with the NXP LPC11U24
2791Cortex-M0 MCU system controller in the Reform 2 open hardware laptop. It
2792provides battery status information and is necessary to completely shut down
2793the system when powering it off via userspace.")
2794 (home-page "https://source.mnt.re/reform/reform-tools/")
2795 (license license:gpl3+)))
2796
2797(define-public v4l2loopback-linux-module
2798 (package
2799 (name "v4l2loopback-linux-module")
2800 (version "0.15.1")
2801 (source (origin
2802 (method git-fetch)
2803 (uri (git-reference
2804 (url "https://github.com/v4l2loopback/v4l2loopback")
2805 (commit (string-append "v" version))))
2806 (file-name (git-file-name name version))
2807 (sha256
2808 (base32
2809 "00vkn4c1wlfmf8kqklklxj5kalwgiwwnxwbh4pw7dj9l1ivycm4f"))))
2810 (build-system linux-module-build-system)
2811 (arguments
2812 (list #:tests? #f)) ; no test suite
2813 (home-page "https://github.com/v4l2loopback/v4l2loopback")
2814 (synopsis "Linux kernel module to create virtual V4L2 video devices")
2815 (description
2816 "This Linux module creates virtual video devices. @acronym{V4L2, Video
2817for Linux 2} applications will treat these as ordinary video devices but read
2818video data generated by another application, instead of a hardware device such
2819as a capture card.
2820
2821This lets you apply nifty effects to your Jitsi video, for example, but also
2822allows some more serious things like adding streaming capabilities to an
2823application by hooking GStreamer into the loopback device.")
2824 (license license:gpl2+)))
2825
2826(define-public xpadneo
2827 (package
2828 (name "xpadneo")
2829 (version "0.9.7")
2830 (source (origin
2831 (method git-fetch)
2832 (uri (git-reference
2833 (url "https://github.com/atar-axis/xpadneo")
2834 (commit (string-append "v" version))))
2835 (file-name (git-file-name name version))
2836 (sha256
2837 (base32
2838 "1v5akvz14izxk3fav6x4l50gi8xzsjwxjddczc2yy78gni1a7ybs"))))
2839 (build-system linux-module-build-system)
2840 (arguments
2841 (list #:tests? #f ; no `check' target
2842 #:source-directory "hid-xpadneo/src"
2843 #:phases
2844 #~(modify-phases %standard-phases
2845 (add-after 'install 'post-install
2846 (lambda _
2847 (copy-recursively "hid-xpadneo/etc-modprobe.d"
2848 (string-append #$output "/etc/modprobe.d"))
2849 ;; udev-service-type takes its rules from /lib rather than
2850 ;; /etc, so copy it there instead
2851 (copy-recursively "hid-xpadneo/etc-udev-rules.d"
2852 (string-append #$output
2853 "/lib/udev/rules.d")))))))
2854 (home-page "https://atar-axis.github.io/xpadneo/")
2855 (synopsis "Xbox One Wireless Controller driver for the kernel Linux")
2856 (description
2857 "This package provides a driver for the XBox One S Wireless controller
2858and some newer models when connected via Bluetooth. In addition to the included
2859Linux kernel module, it also contains a modprobe configuration and udev rules,
2860which need to be installed separately.")
2861 (license license:gpl3+)))
2862
2863(define-public vendor-reset-linux-module
2864 (let ((commit "4b466e92a2d9f76ce1082cde982c7be0be91e248")
2865 (revision "0"))
2866 (package
2867 (name "vendor-reset-linux-module")
2868 (version (git-version "0.1.0" revision commit))
2869 (source (origin
2870 (method git-fetch)
2871 (uri (git-reference
2872 (url "https://github.com/gnif/vendor-reset")
2873 (commit commit)))
2874 (file-name (git-file-name name version))
2875 (sha256
2876 (base32
2877 "1gaf4j20grng689c9fylcqri3j9ycnhr2bsva2z6qcdqvzl6yxbi"))))
2878 (build-system linux-module-build-system)
2879 (arguments
2880 (list #:tests? #f)) ;no test suite
2881 (home-page "https://github.com/gnif/vendor-reset")
2882 (synopsis
2883 "Kernel module that resets GPUs that are affected by the reset bug")
2884 (description
2885 "This package provides a kernel module that is capable of
2886resetting hardware devices into a state where they can be
2887re-initialized or passed through into a virtual machine (VFIO).
2888While it would be great to have these in the kernel as PCI quirks,
2889some of the reset procedures are very complex and would never be
2890accepted as a quirk (ie AMD Vega 10).")
2891 (license license:gpl2))))
2892
2893
2894;;;
2895;;; Pluggable authentication modules (PAM).
2896;;;
2897
2898(define-public linux-pam
2899 (package
2900 (name "linux-pam")
2901 (version "1.5.2")
2902 (source
2903 (origin
2904 (method url-fetch)
2905 (uri (string-append
2906 "https://github.com/linux-pam/linux-pam/releases/download/v"
2907 version "/Linux-PAM-" version ".tar.xz"))
2908 (sha256
2909 (base32
2910 "0kgrsj2scv5mx6w925h9hxf11jnqqs9z8s22aw94b90xm4qp3v74"))
2911 (patches (search-patches "linux-pam-unix_chkpwd.patch"
2912 "linux-pam-no-setfsuid.patch"))))
2913
2914 (build-system gnu-build-system)
2915 (inputs (list libxcrypt))
2916 (native-inputs
2917 (list flex
2918 ;; TODO: optional dependencies
2919 ;; ("cracklib" ,cracklib)
2920 ))
2921 (arguments
2922 (list
2923 ;; Most users, such as `shadow', expect the headers to be under
2924 ;; `security'.
2925 #:configure-flags #~(list (string-append "--includedir="
2926 (assoc-ref %outputs "out")
2927 "/include/security")
2928 ;; explicit libdir for pkgconfig files
2929 ;; drop with 1.5.3, which fixes
2930 ;; https://github.com/linux-pam/linux-pam/issues/466
2931 (string-append "--libdir="
2932 (assoc-ref %outputs "out")
2933 "/lib")
2934
2935 ;; XXX: <rpc/rpc.h> is missing from glibc when
2936 ;; cross-compiling, so we have to disable NIS
2937 ;; support altogether.
2938 #$@(if (%current-target-system)
2939 #~("--disable-nis")
2940 #~()))
2941
2942 #:phases (if (target-hurd?)
2943 #~(modify-phases %standard-phases
2944 (add-after 'unpack 'skip-pam-limits
2945 (lambda _
2946 ;; 'pam_limits.c' uses <sys/prctl.h>, which is
2947 ;; Linux-specific. Skip it on GNU/Hurd.
2948 (substitute* "modules/Makefile.in"
2949 (("pam_limits") "")))))
2950 #~%standard-phases)
2951
2952 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
2953 ;; isn't available.
2954 #:tests? #f))
2955 (home-page "http://www.linux-pam.org/")
2956 (synopsis "Pluggable authentication modules for Linux")
2957 (description
2958 "A *Free* project to implement OSF's RFC 86.0.
2959Pluggable authentication modules are small shared object files that can
2960be used through the PAM API to perform tasks, like authenticating a user
2961at login. Local and dynamic reconfiguration are its key features.")
2962 (license license:bsd-3)))
2963
2964(define-public python-pamela
2965 (package
2966 (name "python-pamela")
2967 (version "1.0.0")
2968 (source
2969 (origin
2970 (method git-fetch)
2971 (uri (git-reference
2972 (url "https://github.com/minrk/pamela")
2973 (commit version)))
2974 (file-name (git-file-name name version))
2975 (sha256
2976 (base32 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
2977 (build-system pyproject-build-system)
2978 (arguments
2979 (list
2980 #:tests? #f ;Test suite isn't designed to be run inside a container.
2981 #:phases
2982 #~(modify-phases %standard-phases
2983 (add-after 'unpack 'hardcode-pam.so
2984 (lambda* (#:key inputs #:allow-other-keys)
2985 (substitute* "pamela.py"
2986 (("find_library\\(\"pam\")")
2987 (format #f "~s"
2988 (search-input-file inputs "lib/libpam.so"))))))
2989 (replace 'check
2990 (lambda* (#:key tests? #:allow-other-keys)
2991 (when (and tests? (file-exists? "test_pamela.py"))
2992 (invoke "pytest" "--assert=plain" "test_pamela.py")
2993 (invoke "python" "-m" "pamela" "-a" "`whoami`")))))))
2994 (inputs (list linux-pam))
2995 (native-inputs (list python-pytest python-setuptools))
2996 (home-page "https://github.com/minrk/pamela")
2997 (synopsis "PAM interface using ctypes")
2998 (description "This package provides a PAM interface using @code{ctypes}.")
2999 (license license:expat)))
3000
3001(define-public pam-gnupg
3002 (package
3003 (name "pam-gnupg")
3004 (version "0.3")
3005 (source (origin
3006 (method git-fetch)
3007 (uri (git-reference
3008 (url "https://github.com/cruegge/pam-gnupg")
3009 (commit (string-append "v" version))))
3010 (file-name (git-file-name name version))
3011 (sha256
3012 (base32
3013 "1bf91gi6zmfzzmczxm7pajxdlgnikasvg5xsd3j0a368rcr7lf9l"))))
3014 (build-system gnu-build-system)
3015 (inputs
3016 (list gnupg linux-pam))
3017 (native-inputs
3018 (list autoconf automake libtool))
3019 (arguments
3020 `(#:tests? #f ;no tests suite
3021 #:configure-flags
3022 (list (string-append "--with-moduledir="
3023 (assoc-ref %outputs "out") "/lib/security"))))
3024
3025 (home-page "https://github.com/cruegge/pam-gnupg")
3026 (synopsis "Unlock GnuPG keys on login")
3027 (description "This package provides a PAM module that hands over your
3028login password to @code{gpg-agent}. This can be useful if you are using a
3029GnuPG-based password manager like @code{pass}.")
3030 (license license:gpl3+)))
3031
3032
3033;;;
3034;;; Kernel documentation
3035;;;
3036
3037(define-public linux-libre-documentation
3038 (package
3039 (inherit linux-libre)
3040 (name "linux-libre-documentation")
3041 (arguments
3042 (list
3043 #:tests? #f
3044 #:phases #~(modify-phases %standard-phases
3045 (delete 'configure)
3046 (replace 'build
3047 (lambda* (#:key parallel-build? #:allow-other-keys)
3048 (substitute* "Documentation/Makefile"
3049 ;; Remove problematic environment check script.
3050 ((".*scripts/sphinx-pre-install.*") ""))
3051 (invoke "make" "infodocs"
3052 "-j" (if parallel-build?
3053 (number->string (parallel-job-count))
3054 "1"))))
3055 (replace 'install
3056 (lambda _
3057 (let* ((info-dir (string-append #$output "/share/info"))
3058 (info (string-append info-dir
3059 "/TheLinuxKernel.info.gz")))
3060 (with-directory-excursion "Documentation/output"
3061 (invoke "make" "-C" "texinfo" "install-info"
3062 (string-append "infodir=" info-dir)))
3063 ;; Create a symlink, for convenience.
3064 (symlink info (string-append info-dir
3065 "/linux.info.gz"))))))))
3066 (native-inputs
3067 (list graphviz
3068 perl
3069 python
3070 python-sphinx
3071 python-pyyaml
3072 texinfo
3073 which))
3074 (synopsis "Documentation for the kernel Linux-Libre")
3075 (description "This package provides the documentation for the kernel
3076Linux-Libre, as an Info manual. To consult it, run @samp{info linux}.")))
3077
3078;;;
3079;;; Miscellaneous.
3080;;;
3081
3082(define-public powercap
3083 (package
3084 (name "powercap")
3085 (version "0.6.0")
3086 (source
3087 (origin
3088 (method git-fetch)
3089 (uri (git-reference
3090 (url "https://github.com/powercap/powercap")
3091 (commit (string-append "v" version))))
3092 (file-name (git-file-name name version))
3093 (sha256
3094 (base32 "087almlx34nzjbv8a40kxlmgy8691z2zlzkfyca8a2b7l0b2kqlp"))))
3095 (build-system cmake-build-system)
3096 (arguments
3097 (list #:configure-flags
3098 #~(list "-DBUILD_SHARED_LIBS=ON")))
3099 (home-page "https://github.com/powercap/powercap")
3100 (synopsis "Utilities for accessing the powercap Linux kernel feature")
3101 (description "This package contains utilities for accessing the powercap
3102Linux kernel feature through sysfs. It includes an implementation for working
3103with Intel @acronym{RAPL, Running Average Power Limit}.
3104It provides the commands @code{powercap-info} and @code{powercap-set}.")
3105 (license license:bsd-3)))
3106
3107(define-public powerstat
3108 (package
3109 (name "powerstat")
3110 (version "0.04.03")
3111 (source
3112 (origin
3113 (method git-fetch)
3114 (uri (git-reference
3115 (url "https://github.com/ColinIanKing/powerstat")
3116 (commit (string-append "V" version))))
3117 (file-name (git-file-name name version))
3118 (sha256
3119 (base32 "1a1fnw4rb8fx4wrcl0yc6dbjj49k6vagnq7diyw4fs4i5nin7mv3"))))
3120 (build-system gnu-build-system)
3121 (arguments
3122 `(#:make-flags
3123 (list (string-append "CC=" ,(cc-for-target))
3124 (string-append "prefix=" (assoc-ref %outputs "out")))
3125 #:tests? #f ; no test suite
3126 #:phases
3127 (modify-phases %standard-phases
3128 (delete 'configure)))) ; no configure script
3129 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
3130 (synopsis "Measure system power consumption")
3131 (description
3132 "Powerstat measures and reports your computer's power consumption in real
3133time. On mobile PCs, it uses ACPI battery information to measure the power
3134drain of the entire system.
3135
3136Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
3137domain measurements. These are available only on some hardware such as Intel
3138Sandybridge and newer, and cover only part of the machine's components such as
3139CPU, DRAM, and graphics. However, they provide accurate and immediate readings
3140and don't require a battery at all.
3141
3142The output is like @command{vmstat} but also shows power consumption statistics:
3143at the end of a run, @command{powerstat} will calculate the average, standard
3144deviation, and minimum and maximum values. It can show a nice histogram too.")
3145 (license license:gpl2)))
3146
3147(define-public psmisc
3148 (package
3149 (name "psmisc")
3150 (version "23.7")
3151 (source
3152 (origin
3153 (method url-fetch)
3154 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
3155 version ".tar.xz"))
3156 (sha256
3157 (base32 "09y30ywh1d4s4f0wgvki115kgpliq48rarmfmmjl0iq22jf5viaq"))))
3158 (build-system gnu-build-system)
3159 (arguments
3160 (list
3161 #:configure-flags
3162 (if (%current-target-system)
3163 #~(list "ac_cv_func_malloc_0_nonnull=yes"
3164 "ac_cv_func_realloc_0_nonnull=yes")
3165 #~'())))
3166 (inputs (list ncurses))
3167 (home-page "https://gitlab.com/psmisc/psmisc")
3168 (synopsis "Small utilities that use the proc file system")
3169 (description
3170 "psmisc is a set of small utilities that use the proc file system.
3171@itemize @bullet
3172@item @command{fuser} identifies processes using files or sockets;
3173@item @command{killall} kills processes by name;
3174@item @command{prtstat} prints statistics of a process;
3175@item @command{pslog} prints the log file(s) of a process;
3176@item @command{pstree} shows the currently running processes as a tree;
3177@item @command{peekfd} shows the data travelling over a file descriptor.
3178@end itemize")
3179 (license license:gpl2+)))
3180
3181(define-public util-linux
3182 (package
3183 (name "util-linux")
3184 (version "2.40.4")
3185 (source (origin
3186 (method url-fetch)
3187 (uri (string-append "mirror://kernel.org/linux/utils/"
3188 "util-linux/v" (version-major+minor version) "/"
3189 "util-linux-" version ".tar.xz"))
3190 (sha256
3191 (base32
3192 "0ygvflcr7v7x2rmr9h5mi07yx00i9368ggf3znd8bs847drsy7aw"))
3193 (patches (search-patches "util-linux-tests.patch"))
3194 (modules '((guix build utils)))
3195 (snippet
3196 ;; We take 'nologin' from Shadow, the 'logger' program from
3197 ;; GNU Inetutils and 'kill' from GNU Coreutils.
3198 '(begin
3199 (substitute* "configure"
3200 (("build_nologin=yes") "build_nologin=no")
3201 (("build_logger=yes") "build_logger=no")
3202 (("build_kill=yes") "build_kill=no"))))))
3203 (build-system gnu-build-system)
3204 (outputs '("out" ;6.4 MiB executables and documentation
3205 "lib" ;8.8 MiB shared libraries, headers and locales
3206 "static")) ;2.9 MiB static .a libraries
3207 (arguments
3208 (list #:configure-flags
3209 #~(list "--disable-use-tty-group"
3210 (string-append
3211 "--enable-fs-paths-default="
3212 "/run/setuid-programs"
3213 ":/run/current-system/profile/sbin")
3214 ;; Don't try to chown root:root mount and umount
3215 "--disable-makeinstall-chown"
3216 "--localstatedir=/var"
3217 (string-append "--localedir=" #$output:lib
3218 "/share/locale")
3219 ;; Install completions where our bash-completion package
3220 ;; expects them.
3221 (string-append "--with-bashcompletiondir=" #$output
3222 "/etc/bash_completion.d")
3223 ;; XXX: 32-bit Hurd platforms don't support 64bit time_t
3224 #$@(if (target-hurd32?)
3225 '("--disable-year2038")
3226 '()))
3227
3228 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
3229 ;; <https://bugs.gnu.org/47791>.
3230 #:tests? (and (not (%current-target-system))
3231 (not (system-hurd?)))
3232
3233 #:phases
3234 #~(modify-phases %standard-phases
3235 (add-before 'configure 'patch-build-scripts
3236 (lambda _
3237 (substitute* "configure"
3238 ;; The build system assumes that we want to install
3239 ;; libraries below $exec_prefix when $libdir does not
3240 ;; match any of the "usual" locations. Fix that.
3241 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
3242 "usrlib_execdir=$libdir"))))
3243 (add-before 'build 'set-umount-file-name
3244 (lambda _
3245 ;; Tell 'eject' the right file name of 'umount'.
3246 (substitute* "sys-utils/eject.c"
3247 (("\"/bin/umount\"")
3248 (string-append "\"" #$output "/bin/umount\"")))))
3249 (add-before 'check 'pre-check
3250 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3251 (let ((services (search-input-file (or native-inputs inputs)
3252 "etc/services")))
3253 ;; Change the test to refer to the right file.
3254 (substitute* "tests/ts/misc/mcookie"
3255 (("/etc/services")
3256 services))
3257 (substitute* "tests/helpers/test_mkfds.c"
3258 (("/etc/fstab")
3259 (which "sh")))
3260 (substitute* "tests/helpers/test_enosys.c"
3261 (("/bin/false")
3262 (which "false"))))))
3263 (add-before 'check 'disable-setarch-test
3264 (lambda _
3265 ;; The setarch tests are unreliable in QEMU's user-mode
3266 ;; emulation, which is our primary method of building
3267 ;; ARMv7 packages. See
3268 ;; <https://github.com/karelzak/util-linux/issues/601>.
3269 (substitute* "tests/ts/misc/setarch"
3270 (("ts_init_subtest.*" all)
3271 (string-append
3272 all "\n"
3273 "ts_skip \"setarch tests are unreliable under QEMU\"")))))
3274 (add-before 'check 'disable-lsns-test
3275 (lambda _
3276 ;; The lsns tests can fail due to ioctl(_, NS_GET_USERNS)
3277 ;; returning ENOTTY, indicating this kernel does not
3278 ;; support user namespaces. Curiously, this test can fail
3279 ;; on i686 even if the same test passes on x86_64 on the
3280 ;; same machine. See <https://issues.guix.gnu.org/49933>.
3281 (delete-file "tests/ts/lsns/ioctl_ns")))
3282 #$@(if (target-ppc32?)
3283 #~((add-before 'check 'disable-enosys-ioctl
3284 ;; It is unclear why this test specifically
3285 ;; fails in Guix's port of powerpc-linux.
3286 (lambda _
3287 (substitute* "tests/ts/misc/enosys"
3288 (("ts_init_subtest ioctl")
3289 (string-append
3290 "ts_init_subtest ioctl\n\n"
3291 "ts_skip \"unexplained failure on powerpc\"\n"))))))
3292 #~())
3293 (add-after 'install 'move-static-libraries
3294 (lambda _
3295 (let ((lib #$output:lib)
3296 (static #$output:static))
3297
3298 ;; Move static libraries to the "static" output.
3299 (mkdir-p (string-append static "/lib"))
3300 (with-directory-excursion lib
3301 (for-each (lambda (file)
3302 (rename-file file
3303 (string-append static "/"
3304 file)))
3305 (find-files "lib" "\\.a$"))
3306
3307 ;; Remove references to the static library from the '.la'
3308 ;; files so that Libtool does the right thing when both
3309 ;; the shared and static library is available.
3310 (substitute* (find-files "lib" "\\.la$")
3311 (("old_library=.*") "old_library=''\n"))))))
3312 (add-after 'install 'adjust-pkg-config-files
3313 (lambda _
3314 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
3315 ;; the pkg-config files to avoid a cyclic reference on "out".
3316 (substitute* (find-files (string-append #$output:lib
3317 "/lib/pkgconfig")
3318 "\\.pc$")
3319 (("^(exec_)?prefix=.*") "")))))))
3320 (inputs
3321 (list file ;for libmagic
3322 ncurses
3323 sqlite
3324 zlib))
3325 (native-inputs
3326 (list net-base ;for tests
3327 perl
3328 pkg-config))
3329 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
3330 (synopsis "Collection of utilities for the Linux kernel")
3331 (description "Util-linux is a diverse collection of Linux kernel
3332utilities. It provides dmesg and includes tools for working with file systems,
3333block devices, UUIDs, TTYs, and many other tools.")
3334
3335 (properties '((upstream-name . "util-linux")))
3336 ;; Note that util-linux doesn't use the same license for all the
3337 ;; code. GPLv2+ is the default license for a code without an
3338 ;; explicitly defined license.
3339 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
3340 license:bsd-4 license:public-domain))))
3341
3342;; util-linux optionally supports udev, which allows lsblk to read file system
3343;; metadata without special privileges. Add it as a separate package to avoid
3344;; a circular dependency, and to keep the size small.
3345(define-public util-linux+udev
3346 (package/inherit
3347 util-linux
3348 (name "util-linux-with-udev")
3349 (inputs
3350 (modify-inputs (package-inputs util-linux)
3351 (prepend eudev)))))
3352
3353(define-public chimerautils
3354 (package
3355 (name "chimerautils")
3356 (version "14.3.1")
3357 (source
3358 (origin
3359 (method git-fetch)
3360 (uri (git-reference
3361 (url "https://github.com/chimera-linux/chimerautils")
3362 (commit (string-append "v" version))))
3363 (file-name (git-file-name name version))
3364 (sha256
3365 (base32 "10xs9i9w9an9jjq7vgkyfqfyzdisbb57c8c1rryjpfiz8dmi8g41"))))
3366 (build-system meson-build-system)
3367 (arguments
3368 (list
3369 #:tests? #f)) ;no test suite
3370 (inputs (list acl
3371 libedit
3372 libxo
3373 ncurses
3374 openssl
3375 zlib
3376 (list zstd "lib")))
3377 (native-inputs (list flex bison pkg-config))
3378 (home-page "https://github.com/chimera-linux/chimerautils")
3379 (synopsis "The FreeBSD-based core Linux userland from Chimera Linux")
3380 (description
3381 "This is a port of the FreeBSD userland for Linux provided by
3382the Chimera Linux distribution. Essentially, it is a collection of UNIX tools
3383such as @command{grep}, @command{cp}, @command{vi}, etc. and can be used as an
3384alternative to the corresponding implementations from the GNU project.")
3385 (license license:bsd-2)))
3386
3387(define-public ddate
3388 (package
3389 (name "ddate")
3390 (version "0.2.2")
3391 (source (origin
3392 (method git-fetch)
3393 (uri (git-reference
3394 (url "https://github.com/bo0ts/ddate")
3395 (commit (string-append "v" version))))
3396 (file-name (git-file-name name version))
3397 (sha256
3398 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
3399 (build-system cmake-build-system)
3400 (arguments '(#:tests? #f))
3401 (home-page "https://github.com/bo0ts/ddate")
3402 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
3403 (description
3404 "ddate displays the Discordian date and holidays of a given date.
3405The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
3406by Robert Shea and Robert Anton Wilson.")
3407 (license license:public-domain)))
3408
3409(define-public dislocker
3410 (package
3411 (name "dislocker")
3412 (version "0.7.3")
3413 (home-page "https://github.com/Aorimn/dislocker")
3414 (source (origin
3415 (method git-fetch)
3416 (uri (git-reference
3417 (url home-page)
3418 (commit (string-append "v" version))))
3419 (file-name (git-file-name name version))
3420 (sha256
3421 (base32
3422 "1ak68s1v5dwh8y2dy5zjybmrh0pnqralmyqzis67y21m87g47h2k"))))
3423 (build-system cmake-build-system)
3424 (arguments
3425 '(#:tests? #f)) ;no test suite
3426 (inputs (list fuse-2 mbedtls-lts))
3427 (synopsis "FUSE driver to read/write Windows BitLocker drives")
3428 (description
3429 "This package provides means to to read BitLocker encrypted
3430partitions. Write functionality is also provided but check the README.")
3431 (license license:gpl2+)))
3432
3433(define-public dwarves
3434 (package
3435 (name "dwarves")
3436 (version "1.29")
3437 (source (origin
3438 (method git-fetch)
3439 (uri (git-reference
3440 (url "https://github.com/acmel/dwarves")
3441 (commit (string-append "v" version))))
3442 (file-name (git-file-name name version))
3443 (sha256
3444 (base32
3445 "1ia3r77zyw7r8mydy1zrrdnqzm9ginsvf9pqviq48rglihhddvli"))
3446 (patches
3447 (search-patches "dwarves-threading-reproducibility.patch"))))
3448 (build-system cmake-build-system)
3449 (arguments (list #:configure-flags #~(list "-D__LIB=lib"
3450 "-DLIBBPF_EMBEDDED=OFF")
3451 #:tests? #f)) ;no test suite
3452 (native-inputs (list pkg-config))
3453 (inputs (list libbpf))
3454 (home-page "https://github.com/acmel/dwarves")
3455 (synopsis "Debugging information processing library and utilities")
3456 (description "Dwarves is a set of tools that use the debugging information
3457inserted in ELF binaries by compilers such as GCC, used by well known
3458debuggers such as GDB.
3459
3460Utilities in the Dwarves suite include @command{pahole}, that can be used to
3461find alignment holes in structures and classes in languages such as C, C++,
3462but not limited to these. These tools can also be used to encode and read the
3463BTF type information format used with the kernel Linux @code{bpf} syscall.
3464
3465The @command{codiff} command can be used to compare the effects changes in
3466source code generate on the resulting binaries.
3467
3468The @command{pfunct} command can be used to find all sorts of information
3469about functions, inlines, decisions made by the compiler about inlining, etc.
3470
3471The @command{pahole} command can be used to use all this type information to
3472pretty print raw data according to command line directions.
3473
3474Headers can have its data format described from debugging info and offsets from
3475it can be used to further format a number of records.
3476
3477Finally, the @command{btfdiff} command can be used to compare the output of
3478pahole from BTF and DWARF, to make sure they produce the same results.")
3479 (license license:gpl2+)))
3480
3481(define-public fbset
3482 (package
3483 (name "fbset")
3484 (version "2.1")
3485 (source
3486 (origin
3487 (method url-fetch)
3488 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
3489 version ".tar.gz"))
3490 (sha256
3491 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
3492 (build-system gnu-build-system)
3493 (arguments
3494 '(#:modules ((guix build gnu-build-system)
3495 (guix build utils)
3496 (srfi srfi-26))
3497 #:phases
3498 (modify-phases %standard-phases
3499 (delete 'configure) ; no configure script
3500 (add-before 'install 'pre-install
3501 (lambda* (#:key outputs #:allow-other-keys)
3502 (let ((out (assoc-ref outputs "out")))
3503 (substitute* "Makefile"
3504 (("mknod ") "true ")
3505 ;; The Makefile doesn't honour PREFIX or similar.
3506 (("/usr") out))
3507 (mkdir out)
3508 (with-directory-excursion out
3509 (for-each mkdir-p (list "sbin"
3510 "man/man5"
3511 "man/man8")))
3512 #t)))
3513 (add-after 'install 'install-fb.modes
3514 (lambda* (#:key outputs #:allow-other-keys)
3515 (let* ((out (assoc-ref outputs "out"))
3516 (etc (string-append out "/etc")))
3517 (for-each (cut install-file <> etc)
3518 (find-files "etc" "^fb\\.modes"))
3519 (symlink "fb.modes.ATI"
3520 (string-append etc "/fb.modes"))
3521 #t))))
3522 ;; Parallel building races to create modes.tab.c.
3523 #:parallel-build? #f
3524 #:tests? #f)) ; no test suite
3525 (native-inputs
3526 (list bison flex))
3527 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
3528 (synopsis "Show and modify Linux frame buffer settings")
3529 (description
3530 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
3531different kinds of graphic displays. The @command{fbset} utility can query and
3532change various device settings such as depth, virtual resolution, and timing
3533parameters.")
3534 (license license:gpl2)))
3535
3536(define-public procps
3537 (package
3538 (name "procps")
3539 (version "4.0.3")
3540 (source (origin
3541 (method url-fetch)
3542 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
3543 "procps-ng-" version ".tar.xz"))
3544 (sha256
3545 (base32
3546 "14ms9mkqr1mgl3h5yl6w8m57cf39k382nv7qms78vqbaz728wg1h"))
3547 (patches (search-patches "procps-strtod-test.patch"))))
3548 (build-system gnu-build-system)
3549 (arguments
3550 (list #:modules '((guix build utils)
3551 (guix build gnu-build-system)
3552 (srfi srfi-1)
3553 (srfi srfi-26))
3554 #:configure-flags
3555 (if (%current-target-system)
3556 #~'("ac_cv_func_malloc_0_nonnull=yes"
3557 "ac_cv_func_realloc_0_nonnull=yes")
3558 #~'())
3559 #:phases
3560 #~(modify-phases %standard-phases
3561 (add-after 'install 'post-install
3562 ;; Remove commands and man pages redudant with
3563 ;; Coreutils.
3564 (lambda* (#:key outputs #:allow-other-keys)
3565 (let* ((out #$output)
3566 (dup (append-map (cut find-files out <>)
3567 '("^kill" "^uptime"))))
3568 (for-each delete-file dup))))
3569 #$@(if (system-hurd?)
3570 #~((add-after 'unpack 'skip-tests
3571 (lambda _
3572 (substitute* "library/tests/test_version.c"
3573 (("^int main\\(.*" all)
3574 (string-append all "{\n exit (77);//"))))))
3575 #~()))))
3576 (inputs (list ncurses))
3577 (native-inputs (list pkg-config))
3578 (home-page "https://gitlab.com/procps-ng/procps/")
3579 (synopsis "Utilities that give information about processes")
3580 (description
3581 "Procps is the package that has a bunch of small useful utilities
3582that give information about processes using the Linux /proc file system.
3583The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
3584slabtop, tload, top, vmstat, w, watch and sysctl.")
3585 (properties '((upstream-name . "procps-ng")))
3586 (license license:gpl2)))
3587
3588(define-public usbutils
3589 (package
3590 (name "usbutils")
3591 (version "018")
3592 (source
3593 (origin
3594 (method url-fetch)
3595 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
3596 "usbutils-" version ".tar.xz"))
3597 (sha256
3598 (base32 "14xd7j9fl3pm0z4dhqj3mf9paqk431kq4vi602f5hiw5nmcqpxl3"))))
3599 (build-system meson-build-system)
3600 (outputs (list "out" "python"))
3601 (arguments
3602 (list
3603 #:phases
3604 #~(modify-phases %standard-phases
3605 (add-after 'install 'separate-python-output
3606 ;; Separating one Python script shaves more than 106 MiB from :out.
3607 (lambda _
3608 (for-each (lambda (file)
3609 (let ((old (string-append #$output "/" file))
3610 (new (string-append #$output:python "/" file)))
3611 (mkdir-p (dirname new))
3612 (rename-file old new)))
3613 (list "bin/lsusb.py"))))
3614 (add-after 'install 'install-usbreset
3615 (lambda _
3616 (install-file "usbreset"
3617 (string-append #$output "/bin")))))))
3618 (native-inputs (list pkg-config))
3619 (inputs (list eudev libusb python))
3620 (home-page "http://www.linux-usb.org/")
3621 (synopsis
3622 "Tools for working with USB devices")
3623 (description
3624 "Collection of tools to query what type of USB devices are connected to
3625the system, including @command{lsusb}. The experimental @command{usbreset}
3626command included in the package, but be aware that it may not work for all
3627devices.")
3628 (license license:gpl2+)))
3629
3630(define-public usbip-utils
3631 (package
3632 (name "usbip-utils")
3633 (version (package-version linux-libre))
3634 (source (package-source linux-libre))
3635 (build-system gnu-build-system)
3636 (arguments
3637 '(#:configure-flags '("--disable-static")
3638 #:phases (modify-phases %standard-phases
3639 (add-after 'unpack 'enter-subdirectory
3640 (lambda _
3641 (chdir "tools/usb/usbip")
3642 #t)))))
3643 (native-inputs
3644 `(("automake" ,automake)
3645 ("autoreconf" ,autoconf)
3646 ("libtool" ,libtool)))
3647 (inputs (list eudev))
3648 (home-page (package-home-page linux-libre))
3649 (synopsis "Utilities for sharing USB devices over IP networks")
3650 (description
3651 "The USB/IP protocol enables to pass USB device from a server to
3652a client over the network. The server is a machine which shares an
3653USB device and the client is a machine which uses USB device provided by
3654a server over the network. The USB device may be either physical device
3655connected to a server or software entity created on a server using USB
3656gadget subsystem. The usbip-utils are userspace tools to used to handle
3657connection and management on both side. The client needs the @file{vhci-hcd}
3658Linux kernel module and the server needs the @file{usbip_host} Linux kernel
3659module.")
3660 (license license:gpl2)))
3661
3662(define-public e2fsprogs
3663 (package
3664 (name "e2fsprogs")
3665 (version "1.47.2")
3666 (source (origin
3667 (method url-fetch)
3668 (uri (string-append
3669 "mirror://kernel.org/linux/kernel/people/tytso/"
3670 "e2fsprogs/v" version "/"
3671 "e2fsprogs-" version ".tar.xz"))
3672 (sha256
3673 (base32
3674 "0g76fhnyzr2awwybd6c16439l80r5dv4kbfaq7cr908fr9j2w908"))))
3675 (build-system gnu-build-system)
3676 (inputs (list `(,util-linux "lib")))
3677 (native-inputs (list pkg-config
3678 texinfo ;for the libext2fs Info manual
3679 ;; For tests.
3680 perl
3681 procps))
3682 (arguments
3683 `(;; util-linux is the preferred source for some of the libraries and
3684 ;; commands, so disable them (see, e.g.,
3685 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
3686 #:configure-flags (list "--disable-libblkid"
3687 "--disable-libuuid" "--disable-uuidd"
3688 "--disable-fsck"
3689
3690 ;; Use symlinks instead of hard links for
3691 ;; 'fsck.extN' etc. This makes the resulting nar
3692 ;; smaller and is preserved across copies.
3693 "--enable-symlink-install"
3694
3695 (string-append "LDFLAGS=-Wl,-rpath="
3696 (assoc-ref %outputs "out")
3697 "/lib")
3698
3699 ;; Install libext2fs et al.
3700 "--enable-elf-shlibs")
3701
3702 #:phases
3703 (modify-phases %standard-phases
3704 (add-before 'configure 'patch-shells
3705 (lambda _
3706 (substitute* "configure"
3707 (("/bin/sh (.*)parse-types.sh" _ dir)
3708 (string-append (which "sh") " " dir
3709 "parse-types.sh")))
3710 (substitute* "MCONFIG.in"
3711 (("INSTALL_SYMLINK = /bin/sh")
3712 "INSTALL_SYMLINK = sh"))
3713 (substitute* (find-files "." "^Makefile.in$")
3714 (("#!/bin/sh")
3715 (string-append "#!" (which "sh"))))))
3716 (add-after 'install 'install-libs
3717 (lambda* (#:key outputs #:allow-other-keys)
3718 (let* ((out (assoc-ref outputs "out"))
3719 (lib (string-append out "/lib")))
3720 (invoke "make" "install-libs")
3721
3722 ;; Make the .a writable so that 'strip' works.
3723 ;; Failing to do that, due to debug symbols, we
3724 ;; retain a reference to the final
3725 ;; linux-libre-headers, which refer to the
3726 ;; bootstrap binaries.
3727 (let ((archives (find-files lib "\\.a$")))
3728 (for-each (lambda (file)
3729 (chmod file #o666))
3730 archives)))))
3731 ,@(if (system-hurd?)
3732 '((add-after 'unpack 'skip-tests
3733 (lambda _
3734 (with-directory-excursion "tests"
3735 (for-each
3736 (lambda (directory)
3737 (delete-file-recursively directory))
3738 '("d_bad_ostype"
3739 "f_detect_junk"
3740 "f_extent_oobounds"
3741 "j_ext_long_revoke_trans"
3742 "j_ext_long_trans"
3743 "j_long_revoke_trans"
3744 "j_long_revoke_trans_mcsum_32bit"
3745 "j_long_revoke_trans_mcsum_64bit"
3746 "j_long_trans"
3747 "j_long_trans_mcsum_32bit"
3748 "j_long_trans_mcsum_64bit"
3749 "j_short_revoke_trans"
3750 "j_short_revoke_trans_mcsum_64bit"
3751 "j_short_trans_64bit"
3752 "j_short_trans"
3753 "j_short_trans_mcsum_64bit"
3754 "j_short_trans_old_csum"
3755 "j_short_trans_open_recover"
3756 "j_short_trans_recover"
3757 "j_short_trans_recover_mcsum_64bit"
3758 "j_short_uncommitted_trans"
3759 "j_short_uncommitted_trans_mcsum_64bit"
3760 "m_error_behavior"
3761 "m_minrootdir"
3762 "m_rootdir"
3763 "r_32to64bit_expand_full"
3764 "r_expand_full"
3765 "r_fixup_lastbg_big"
3766 "t_change_uuid"
3767 "t_change_uuid_mcsum"
3768 "t_change_uuid_mcsum_mounted"
3769 "t_change_uuid_mcsum_seed_mounted"
3770 "t_change_uuid_mounted"
3771 "t_disable_changed_csum_seed"
3772 "t_disable_changed_csum_seed_mounted"
3773 "t_disable_csum_seed"
3774 "t_disable_meta_csum_and_seed"
3775 "t_enable_csum_seed"
3776 "t_format_csum_seed"
3777 "t_replay_and_set"
3778 "u_compound_rollback"
3779 "u_corrupt_blk_csum"
3780 "u_corrupt_blk_csum_force"
3781 "u_corrupt_key_csum"
3782 "u_debugfs_opt"
3783 "u_dryrun"
3784 "u_e2fsck_opt"
3785 "u_errorout"
3786 "u_force"
3787 "u_force_dryrun"
3788 "u_incomplete"
3789 "u_mke2fs_opt"
3790 "u_mke2fs_opt_oddsize"
3791 "u_offset"
3792 "u_onefile_bad"
3793 "u_resize2fs_opt"
3794 "u_revert_64bitmcsum_onefile"
3795 "u_revert_all_onefile"
3796 "u_revert_upgrade_to_64bitmcsum"
3797 "u_tune2fs_opt"
3798 "u_undo_undo"
3799 "u_wrong_fs"))))))
3800 '()))))
3801 (home-page "https://e2fsprogs.sourceforge.net/")
3802 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
3803 (description
3804 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
3805 (license (list license:gpl2 ;programs
3806 license:lgpl2.0 ;libext2fs
3807 license:x11)))) ;libuuid
3808
3809(define e2fsprogs/static
3810 (static-package
3811 (package (inherit e2fsprogs)
3812 (arguments
3813 ;; Do not build shared libraries.
3814 (substitute-keyword-arguments (package-arguments e2fsprogs)
3815 ((#:configure-flags _)
3816 '(list "--disable-blkid"))
3817 ((#:make-flags _)
3818 '(list)))))))
3819
3820(define-public e2fsck/static
3821 (package
3822 (name "e2fsck-static")
3823 (version (package-version e2fsprogs))
3824 (build-system trivial-build-system)
3825 (source #f)
3826 (inputs
3827 (list e2fsprogs/static))
3828 (arguments
3829 `(#:modules ((guix build utils))
3830 #:builder
3831 (begin
3832 (use-modules (guix build utils)
3833 (ice-9 ftw)
3834 (srfi srfi-26))
3835
3836 (let ((e2fsck (search-input-file %build-inputs "/sbin/e2fsck"))
3837 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
3838 (mkdir-p bin)
3839 (with-directory-excursion bin
3840 (copy-file e2fsck "e2fsck")
3841 (remove-store-references "e2fsck")
3842 (chmod "e2fsck" #o555))
3843 #t))))
3844 (home-page (package-home-page e2fsprogs))
3845 (synopsis "Statically-linked e2fsck command from e2fsprogs")
3846 (description "This package provides statically-linked e2fsck command taken
3847from the e2fsprogs package. It is meant to be used in initrds.")
3848 (license (package-license e2fsprogs))))
3849
3850(define-public extundelete
3851 (package
3852 (name "extundelete")
3853 (version "0.2.4")
3854 (source
3855 (origin
3856 (method url-fetch)
3857 (uri (string-append "mirror://sourceforge/extundelete/"
3858 "extundelete/" version "/extundelete-"
3859 version ".tar.bz2"))
3860 (sha256
3861 (base32
3862 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
3863 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
3864 (build-system gnu-build-system)
3865 (inputs (list e2fsprogs))
3866 (home-page "https://extundelete.sourceforge.net/")
3867 (synopsis "Recover deleted files from ext2/3/4 partitions")
3868 (description
3869 "Extundelete is a set of tools that can recover deleted files from an
3870ext3 or ext4 partition.")
3871 (license license:gpl2)))
3872
3873(define-public zerofree
3874 (package
3875 (name "zerofree")
3876 (version "1.1.1")
3877 (home-page "https://frippery.org/uml/")
3878 (source (origin
3879 (method url-fetch)
3880 (uri (string-append home-page name "-" version
3881 ".tgz"))
3882 (sha256
3883 (base32
3884 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
3885 (build-system gnu-build-system)
3886 (arguments
3887 '(#:phases
3888 (modify-phases %standard-phases
3889 (delete 'configure) ; no configure script
3890 (replace 'install
3891 ;; The Makefile lacks an ‘install’ target.
3892 (lambda* (#:key outputs #:allow-other-keys)
3893 (let* ((out (assoc-ref outputs "out"))
3894 (bin (string-append out "/bin")))
3895 (chmod "zerofree" #o555)
3896 (install-file "zerofree" bin)
3897 #t))))
3898 #:tests? #f)) ; no tests
3899 (inputs `(("libext2fs" ,e2fsprogs)))
3900 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
3901 (description
3902 "Zerofree finds the unallocated blocks with non-zero value content in an
3903ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
3904This is a simple way to make disk images more compressible.
3905Zerofree requires the file system to be unmounted or mounted read-only.")
3906 (license license:gpl2)))
3907
3908(define-public strace
3909 (package
3910 (name "strace")
3911 (version "6.16")
3912 (source
3913 (origin
3914 (method git-fetch)
3915 (uri (git-reference
3916 (url "https://github.com/strace/strace")
3917 (commit (string-append "v" version))))
3918 (file-name (git-file-name name version))
3919 (sha256
3920 (base32 "0p405lf76vksa3ldlq8fjjz5760q2rgr0dvms6bdp3dvc72kr82i"))
3921 (patches (search-patches "strace-readlink-tests.patch"))))
3922 (build-system gnu-build-system)
3923 (arguments
3924 (list
3925 #:phases
3926 #~(modify-phases %standard-phases
3927 ;; Needed for the 'bootstrap phase.
3928 (add-after 'unpack 'patch-source-shebangs-initial
3929 (assoc-ref %standard-phases 'patch-source-shebangs))
3930 (add-after 'unpack 'patch-test-shebangs
3931 (lambda _
3932 (substitute* '("tests/detach-vfork.test"
3933 "tests/gen_tests.sh"
3934 "tests/kill-on-exit.sh")
3935 (("#!/bin/sh")
3936 (string-append "#!" (which "sh")))))))
3937 #:configure-flags
3938 ''("--with-libunwind"
3939 ;; Don't fail if the architecture doesn't support different
3940 ;; personalities.
3941 "--enable-mpers=check")
3942 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
3943 #:parallel-tests? #f)) ; undeterministic failures
3944 (inputs (list libunwind))
3945 (native-inputs
3946 (list autoconf
3947 automake
3948 perl
3949 m4
3950 ;; For some tests
3951 util-linux))
3952 (home-page "https://strace.io")
3953 (synopsis "System call tracer for Linux")
3954 (description
3955 "strace is a system call tracer, i.e. a debugging tool which prints out a
3956trace of all the system calls made by a another process/program.")
3957 (license license:lgpl2.1+)))
3958
3959(define-public ltrace
3960 (package
3961 (name "ltrace")
3962 (version "0.7.3")
3963 (source (origin
3964 (method url-fetch)
3965 (uri (string-append "http://www.ltrace.org/ltrace_" version
3966 ".orig.tar.bz2"))
3967 (sha256
3968 (base32
3969 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
3970 (build-system gnu-build-system)
3971 (inputs `(("libelf" ,elfutils)))
3972 (arguments
3973 ;; Compilation uses -Werror by default, but it fails.
3974 '(#:configure-flags '("--disable-werror")))
3975 (home-page "https://www.ltrace.org/")
3976 (synopsis "Library call tracer for Linux")
3977 (description
3978 "ltrace intercepts and records dynamic library calls which are called by
3979an executed process and the signals received by that process. It can also
3980intercept and print the system calls executed by the program.")
3981 (license license:gpl2+)))
3982
3983(define-public alsa-ucm-conf
3984 (package
3985 (name "alsa-ucm-conf")
3986 (version "1.2.11")
3987 (source (origin
3988 (method url-fetch)
3989 (uri (string-append
3990 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
3991 version ".tar.bz2"))
3992 (sha256
3993 (base32
3994 "10dfzvrmpp9swflw47nxf35an6gj3ilb4wlggdnng8g2637h2z1q"))))
3995 (build-system copy-build-system)
3996 (arguments
3997 '(#:install-plan
3998 '(("ucm" "share/alsa/ucm")
3999 ("ucm2" "share/alsa/ucm2"))))
4000 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4001 (synopsis "The Advanced Linux Sound Architecture Use Case Manager")
4002 (description
4003 "This package contains Advanced Linux Sound Architecture Use Case Manager
4004configuration of audio input/output names and routing for specific audio
4005hardware.")
4006 (license license:bsd-3)))
4007
4008(define-public alsa-topology-conf
4009 (package
4010 (name "alsa-topology-conf")
4011 (version "1.2.4")
4012 (source (origin
4013 (method url-fetch)
4014 (uri (string-append
4015 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
4016 version ".tar.bz2"))
4017 (sha256
4018 (base32
4019 "01zdg6q4s6d01k39z96wi4vbhrfw1i2g4yi5dijwfk6a5vjfdq2m"))))
4020 (build-system copy-build-system)
4021 (arguments
4022 '(#:install-plan
4023 '(("topology" "share/alsa/topology"))))
4024 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4025 (synopsis "The Advanced Linux Sound Architecture libraries")
4026 (description
4027 "This package contains Advanced Linux Sound Architecture topology
4028configuration files that can be used for specific audio hardware.")
4029 (license license:bsd-3)))
4030
4031(define-public alsa-lib
4032 (package
4033 (name "alsa-lib")
4034 (version "1.2.11")
4035 (source (origin
4036 (method url-fetch)
4037 (uri (string-append
4038 "https://www.alsa-project.org/files/pub/lib/"
4039 name "-" version ".tar.bz2"))
4040 (sha256
4041 (base32
4042 "0kdvjlknc50fwfdkxj0z12xbz21skb3gnwlh6lvsvycmp5ljygwz"))))
4043 (build-system gnu-build-system)
4044 (arguments
4045 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4046 (assoc-ref %outputs "out")
4047 "/lib"))
4048 #:phases
4049 (modify-phases %standard-phases
4050 (add-before 'install 'pre-install
4051 (lambda* (#:key inputs outputs #:allow-other-keys)
4052 (let* ((ucm
4053 (string-append (assoc-ref inputs "alsa-ucm-conf")))
4054 (topology
4055 (string-append (assoc-ref inputs "alsa-topology-conf")))
4056 (alsa
4057 (string-append (assoc-ref outputs "out") "/share/alsa"))
4058 (ucm-share
4059 (string-append ucm "/share/alsa/ucm"))
4060 (ucm2-share
4061 (string-append ucm "/share/alsa/ucm2"))
4062 (topology-share
4063 (string-append topology "/share/alsa/topology")))
4064 (mkdir-p alsa)
4065 (symlink ucm-share (string-append alsa "/ucm"))
4066 (symlink ucm2-share (string-append alsa "/ucm2"))
4067 (symlink topology-share (string-append alsa "/topology")))
4068 #t)))))
4069 (inputs
4070 (list alsa-ucm-conf alsa-topology-conf))
4071 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4072 (synopsis "The Advanced Linux Sound Architecture libraries")
4073 (description
4074 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4075MIDI functionality to the Linux-based operating system.")
4076 (license license:lgpl2.1+)))
4077
4078(define-public alsa-utils
4079 (package
4080 (name "alsa-utils")
4081 (version "1.2.11")
4082 (source (origin
4083 (method url-fetch)
4084 (uri (string-append
4085 "https://www.alsa-project.org/files/pub/utils/"
4086 name "-" version ".tar.bz2"))
4087 (sha256
4088 (base32
4089 "19r8qi6b7sd2p1mhxfqrp18wrgjw5s6rp5ygimb1w59zi0xcmils"))))
4090 (build-system gnu-build-system)
4091 (arguments
4092 (list
4093 #:configure-flags
4094 #~(list
4095 ;; The udev rule is responsible for restoring the volume.
4096 (string-append "--with-udev-rules-dir=" #$output "/lib/udev/rules.d"))
4097 #:phases
4098 #~(modify-phases %standard-phases
4099 (add-before 'install 'pre-install
4100 (lambda _
4101 ;; Don't try to mkdir /var/lib/alsa.
4102 (substitute* "Makefile"
4103 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
4104 "true\n")))))))
4105 (native-inputs
4106 (list docbook-xml-4.2 docbook-xsl xmlto
4107 gettext-minimal))
4108 (inputs
4109 (list libsamplerate ncurses alsa-lib))
4110 (home-page "http://www.alsa-project.org/")
4111 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
4112 (description
4113 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4114MIDI functionality to the Linux-based operating system.")
4115
4116 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
4117 ;; GPLv2-only.
4118 (license license:gpl2)))
4119
4120(define-public alsa-plugins
4121 (package
4122 (name "alsa-plugins")
4123 (version "1.2.2")
4124 (source (origin
4125 (method url-fetch)
4126 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
4127 name "-" version ".tar.bz2"))
4128 (sha256
4129 (base32
4130 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
4131 (build-system gnu-build-system)
4132 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
4133 ;; be split, there are references to both in files.
4134 ;; TODO: Remove OSS related plugins, they add support to run native
4135 ;; ALSA applications on OSS however we do not offer OSS and OSS is
4136 ;; obsolete.
4137 (outputs '("out" "pulseaudio" "jack"))
4138 (native-search-paths
4139 (list (search-path-specification
4140 (variable "ALSA_PLUGIN_DIR")
4141 (files '("lib/alsa-lib"))
4142 (separator #f))))
4143 (arguments
4144 `(#:configure-flags '(;; Do not install a "local" configuration targeted
4145 ;; for /etc/alsa. On Guix System plugins are loaded from
4146 ;; the ALSA service, and other distributions likely
4147 ;; won't use these files.
4148 "--with-alsalconfdir=/tmp/noop")
4149 #:phases
4150 (modify-phases %standard-phases
4151 (add-after 'install 'split
4152 (lambda* (#:key inputs outputs #:allow-other-keys)
4153 ;; Distribute the binaries to the various outputs.
4154 (let* ((out (assoc-ref outputs "out"))
4155 (jack (assoc-ref outputs "jack"))
4156 (jacklib (string-append jack "/lib/alsa-lib"))
4157 (pua (assoc-ref outputs "pulseaudio"))
4158 (pualib (string-append pua "/lib/alsa-lib")))
4159 ;; For jack.
4160 (mkdir-p jacklib)
4161 (for-each (lambda (file)
4162 (rename-file file (string-append jacklib "/" (basename file))))
4163 (find-files out ".*jack\\.(la|so)"))
4164 ;; For pulseaudio.
4165 (mkdir-p pualib)
4166 (for-each (lambda (file)
4167 (rename-file file (string-append pualib "/" (basename file))))
4168 (find-files out ".*pulse\\.(la|so)"))
4169 #t))))))
4170 (inputs
4171 (list alsa-lib
4172 jack-1
4173 speex ; libspeexdsp resampling plugin
4174 libsamplerate ; libsamplerate resampling plugin
4175 ffmpeg ; libavcodec resampling plugin, a52 plugin
4176 pulseaudio)) ; PulseAudio plugin
4177 (native-inputs
4178 (list pkg-config))
4179 (home-page "http://www.alsa-project.org/")
4180 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
4181 (description
4182 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4183MIDI functionality to the Linux-based operating system. This package enhances ALSA
4184by providing additional plugins which include: upmixing, downmixing, jackd and
4185pulseaudio support for native alsa applications, format conversion (s16 to a52), and
4186external rate conversion.")
4187 (license (list license:gpl2+
4188 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
4189 license:lgpl2.1+))))
4190
4191(define-public iptables
4192 (package
4193 (name "iptables")
4194 (version "1.8.11")
4195 (source
4196 (origin
4197 (method url-fetch)
4198 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
4199 version ".tar.xz")))
4200 (sha256
4201 (base32 "1cp7kw0d3fpmfmbl4adh88v02wnj4s5rfgyxsk52pjgqbvah6wyq"))))
4202 (build-system gnu-build-system)
4203 (native-inputs
4204 (list pkg-config flex bison))
4205 (inputs
4206 (list libmnl libnftnl/pinned))
4207 (arguments
4208 (list #:tests? #f ; no test suite
4209 #:configure-flags ; add $libdir to the RUNPATH of executables
4210 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))))
4211 (home-page "https://www.netfilter.org/projects/iptables/index.html")
4212 (synopsis "Programs to configure Linux IP packet filtering rules")
4213 (description
4214 "@command{iptables} is the user-space command line program used to
4215configure the Linux 2.4.x and later IPv4 packet filtering ruleset
4216(@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
4217
4218This package also includes @command{ip6tables}, which is used to configure the
4219IPv6 packet filter.
4220
4221Both commands are targeted at system administrators.")
4222 (properties
4223 '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
4224 (license license:gpl2+)))
4225
4226(define-public iptables-nft
4227 (package
4228 (inherit iptables)
4229 (name "iptables-nft")
4230 (source #f)
4231 (build-system copy-build-system)
4232 (arguments
4233 (list
4234 #:phases
4235 #~(modify-phases %standard-phases
4236 (delete 'unpack)
4237 (replace 'install
4238 (lambda* (#:key inputs #:allow-other-keys)
4239 (for-each
4240 (lambda (command-path)
4241 (let ((link-path (string-append #$output command-path)))
4242 (mkdir-p (dirname link-path))
4243 (symlink (search-input-file inputs "sbin/xtables-nft-multi")
4244 link-path)))
4245 (apply append
4246 '("/bin/iptables-xml")
4247 (map (lambda (xtables)
4248 (list (string-append "/sbin/" xtables)
4249 (string-append "/sbin/" xtables "-restore")
4250 (string-append "/sbin/" xtables "-save")))
4251 '("arptables"
4252 "ebtables"
4253 "iptables"
4254 "ip6tables")))))))))
4255 (inputs (list iptables))
4256 (native-inputs '())
4257 (synopsis
4258 "Programs to configure Linux IP packet filtering rules (nftables API)")))
4259
4260(define-public irqbalance
4261 (package
4262 (name "irqbalance")
4263 (version "1.9.4")
4264 (source
4265 (origin
4266 (method git-fetch)
4267 (uri (git-reference
4268 (url "https://github.com/irqbalance/irqbalance")
4269 (commit (string-append "v" version))))
4270 (file-name (git-file-name name version))
4271 (sha256
4272 (base32 "1jswxr0jcxz83j1nanl6xaxpw001l0hfb2xvvy2k970g1g1kpszd"))))
4273 (build-system gnu-build-system)
4274 (inputs (list glib ncurses libnl libcap-ng))
4275 (native-inputs (list autoconf automake libtool pkg-config))
4276 (home-page "https://irqbalance.github.io/irqbalance/")
4277 (synopsis "Daemon used to load balance CPU interrupts")
4278 (description
4279 "Irqbalance is a daemon to help balance the CPU load generated by
4280interrupts across all of a systems CPUs. Irqbalance identifies the highest
4281volume interrupt sources, and isolates each of them to a single unique CPU, so
4282that load is spread as much as possible over an entire processor set, while
4283minimizing cache miss rates for irq handlers.")
4284 (license license:gpl2)))
4285
4286(define-public bolt
4287 (package
4288 (name "bolt")
4289 (version "0.9.10")
4290 (source (origin
4291 (method git-fetch)
4292 (uri (git-reference
4293 (url "https://gitlab.freedesktop.org/bolt/bolt")
4294 (commit version)))
4295 (file-name (git-file-name name version))
4296 (sha256
4297 (base32
4298 "1vw4vzyhkpm73snnfciy7x88ja72cv5isc27k91jvmy2350b29yx"))))
4299 (build-system meson-build-system)
4300 (arguments
4301 (list #:configure-flags '(list "--localstatedir=/var")
4302 #:glib-or-gtk? #t ;To wrap binaries and/or compile schemas
4303 #:phases #~(modify-phases %standard-phases
4304 (add-after 'unpack 'replace-directories
4305 (lambda* (#:key outputs #:allow-other-keys)
4306 (substitute* "meson.build"
4307 (("udev.get_variable\\(pkgconfig: 'udevdir'\\)")
4308 (string-append "'" #$output "/lib/udev'"))
4309 ;; Don't install in /var
4310 (("not systemd\\.found\\(\\)")
4311 "false"))))
4312 (add-before 'install 'no-polkit-magic
4313 (lambda* (#:key outputs #:allow-other-keys)
4314 (setenv "PKEXEC_UID" "something"))))))
4315 (native-inputs (list pkg-config
4316 `(,glib "bin") python asciidoc umockdev))
4317 (inputs (list eudev dbus polkit))
4318 (synopsis "Thunderbolt 3 device manager")
4319 (description
4320 "This package provides @command{boltd}, a userspace daemon
4321for Thunderbolt devices, and @command{boltctl}, a command-line utility for
4322managing those devices.
4323
4324The daemon @command{boltd} exposes devices via D-Bus to clients. It also
4325stores a database of previously authorized devices and will, depending on the
4326policy set for the individual devices, automatically authorize newly connected
4327devices without user interaction.
4328
4329The command-line utility @command{boltctl} manages Thunderbolt devices via
4330@command{boltd}. It can list devices, monitor changes, and initiate
4331authorization of devices.")
4332 (home-page "https://gitlab.freedesktop.org/bolt/bolt")
4333 (properties `((lint-hidden-cpe-vendors . ("boltcms" "puppet"))))
4334 (license license:gpl2+)))
4335
4336(define-public jitterentropy-rngd
4337 (package
4338 (name "jitterentropy-rngd")
4339 (version "1.2.8")
4340 (source
4341 (origin
4342 (method git-fetch)
4343 (uri (git-reference
4344 (url "https://github.com/smuellerDD/jitterentropy-rngd")
4345 (commit (string-append "v" version))))
4346 (file-name (git-file-name name version))
4347 (sha256
4348 (base32 "13br8s6gqnfc844ps38ya5nny3pndsmskszv3dsp1cxcgvmscg1c"))))
4349 (build-system gnu-build-system)
4350 (arguments
4351 (list
4352 #:tests? #f ; no test suite
4353 #:make-flags
4354 #~(list (string-append "CC=" #$(cc-for-target))
4355 (string-append "PREFIX=" #$output)
4356 "UNITDIR=$(PREFIX)/lib/systemd/system")
4357 #:phases
4358 #~(modify-phases %standard-phases
4359 (delete 'configure)))) ; no ./configure script
4360 (home-page "https://www.chronox.de/jent.html")
4361 (synopsis "CPU jitter random number generator daemon")
4362 (description
4363 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
4364number generator} core to the kernel Linux's entropy estimator. This prevents
4365the @file{/dev/random} device from blocking and should benefit users of the
4366preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
4367
4368The CPU Jitter RNG itself is part of the kernel and claims to provide good
4369entropy by collecting and magnifying differences in CPU execution time as
4370measured by the high-resolution timer built into modern CPUs. It requires no
4371additional hardware or external entropy source.
4372
4373The random bit stream generated by @command{jitterentropy-rngd} is not processed
4374by a cryptographically secure whitening function. Nonetheless, its authors
4375believe it to be a suitable source of cryptographically secure key material or
4376other cryptographically sensitive data.
4377
4378If you agree with them, start this daemon as early as possible to provide
4379properly seeded random numbers to services like SSH or those using TLS during
4380early boot when entropy may be low, especially in virtualised environments.")
4381 (license (list license:bsd-3 ; or
4382 license:gpl2+))))
4383
4384(define-public ebtables
4385 (package
4386 (name "ebtables")
4387 (version "2.0.11")
4388 (source (origin
4389 (method url-fetch)
4390 (uri (string-append
4391 "mirror://netfilter.org/ebtables/ebtables-"
4392 version ".tar.gz"))
4393 (sha256
4394 (base32
4395 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
4396 (build-system gnu-build-system)
4397 (inputs
4398 (list perl iptables))
4399 (synopsis "Ethernet bridge frame table administration")
4400 (home-page "https://ebtables.netfilter.org/")
4401 (description
4402 "ebtables is an application program used to set up and maintain the
4403tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
4404analogous to the iptables application, but less complicated, due to the fact
4405that the Ethernet protocol is much simpler than the IP protocol.")
4406 (license license:gpl2+)))
4407
4408(define-public iproute
4409 (package
4410 (name "iproute2")
4411 (version "6.4.0")
4412 (source (origin
4413 (method url-fetch)
4414 (uri (string-append
4415 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
4416 version ".tar.xz"))
4417 (sha256
4418 (base32
4419 "0wm2g70vfhnf8wb6py3zmzwxp4zv1icny1pvkwaxmr67rggbhlac"))))
4420 (build-system gnu-build-system)
4421 (arguments
4422 (list
4423 ;; There is a test suite, but it wants network namespaces and sudo.
4424 #:tests? #f
4425 #:make-flags
4426 #~(let ((out #$output))
4427 (list (string-append "CC=" #$(cc-for-target))
4428 "HOSTCC=gcc"
4429 (string-append "BASH_COMPDIR=" out
4430 "/etc/bash_completion.d")
4431 (string-append "LIBDIR=" out "/lib")
4432 (string-append "HDRDIR=" out "/include")
4433 (string-append "SBINDIR=" out "/sbin")
4434 (string-append "CONFDIR=" out "/etc")
4435 (string-append "MANDIR=" out "/share/man")
4436 #$@(if (target-ppc64le?)
4437 '("CCOPTS=-O2 -pipe -Wno-incompatible-pointer-types")
4438 '())))
4439 #:phases
4440 #~(modify-phases %standard-phases
4441 (replace 'configure
4442 (lambda* (#:key (configure-flags #~'()) #:allow-other-keys)
4443 ;; The configure script does not understand some of the
4444 ;; default options of gnu-build-system.
4445 (setenv "PKG_CONFIG" #$(pkg-config-for-target))
4446 (apply invoke "./configure"
4447 "--prefix" #$output
4448 configure-flags)))
4449 (add-before 'install 'pre-install
4450 (lambda _
4451 ;; Don't attempt to create /var/lib/arpd.
4452 (substitute* "Makefile"
4453 (("^.*ARPDDIR.*$") "")))))))
4454 (inputs
4455 (list bdb iptables libmnl))
4456 (native-inputs
4457 (list bison flex pkg-config))
4458 ;; For tests.
4459 ;; ("libmnl" ,libmnl)
4460 ;; ("util-linux" ,util-linux)
4461 (home-page
4462 "https://wiki.linuxfoundation.org/networking/iproute2")
4463 (synopsis
4464 "Utilities for controlling TCP/IP networking and traffic in Linux")
4465 (description
4466 "Iproute2 is a collection of utilities for controlling TCP/IP networking
4467and traffic with the Linux kernel. The most important of these are
4468@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
4469control.
4470
4471Most network configuration manuals still refer to ifconfig and route as the
4472primary network configuration tools, but ifconfig is known to behave
4473inadequately in modern network environments, and both should be deprecated.")
4474 (license license:gpl2+)))
4475
4476(define-public net-tools
4477 ;; XXX: This package is basically unmaintained, but it provides a few
4478 ;; commands not yet provided by Inetutils, such as 'route', so we have to
4479 ;; live with it.
4480 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
4481 (revision "0"))
4482 (package
4483 (name "net-tools")
4484 (version (string-append "1.60-" revision "." (string-take commit 7)))
4485 (source (origin
4486 (method url-fetch)
4487 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
4488 "n/ne/net-tools/code.git/net-tools-code-"
4489 commit ".zip"))
4490 (file-name (string-append name "-" version ".zip"))
4491 (sha256
4492 (base32
4493 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
4494 (home-page "https://net-tools.sourceforge.net/")
4495 (build-system gnu-build-system)
4496 (arguments
4497 `(#:modules ((guix build gnu-build-system)
4498 (guix build utils)
4499 (srfi srfi-1)
4500 (srfi srfi-26))
4501 #:phases
4502 (modify-phases %standard-phases
4503 (replace 'configure
4504 (lambda* (#:key outputs #:allow-other-keys)
4505 (let ((out (assoc-ref outputs "out")))
4506 (mkdir-p (string-append out "/bin"))
4507 (mkdir-p (string-append out "/sbin"))
4508
4509 ;; Pretend we have everything...
4510 (system "yes | make config")
4511
4512 ;; ... except for the things we don't have.
4513 ;; HAVE_AFDECnet requires libdnet, which we don't have.
4514 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
4515 ;; that have been removed.
4516 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
4517 ;; think about adding them later.
4518 (substitute* '("config.make" "config.h")
4519 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
4520 ""))
4521 #t)))
4522 (add-after 'install 'remove-redundant-commands
4523 (lambda* (#:key outputs #:allow-other-keys)
4524 ;; Remove commands and man pages redundant with Inetutils.
4525 (let* ((out (assoc-ref outputs "out"))
4526 (dup (append-map (cut find-files out <>)
4527 '("^hostname"
4528 "^(yp|nis|dns)?domainname"))))
4529 (for-each delete-file dup)
4530 #t))))
4531 ;; Binaries that depend on libnet-tools.a don't declare that
4532 ;; dependency, making it parallel-unsafe.
4533 #:parallel-build? #f
4534
4535 #:tests? #f ; no test suite
4536 #:make-flags (let ((out (assoc-ref %outputs "out")))
4537 (list ,(string-append "CC=" (cc-for-target))
4538 (string-append "BASEDIR=" out)
4539 (string-append "INSTALLNLSDIR=" out "/share/locale")
4540 (string-append "mandir=/share/man")))))
4541 (native-inputs `(("gettext" ,gettext-minimal)
4542 ("unzip" ,unzip)))
4543 (supported-systems (remove target-hurd? %supported-systems))
4544 (synopsis "Tools for controlling the network subsystem in Linux")
4545 (description
4546 "This package includes the important tools for controlling the network
4547subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
4548route. Additionally, this package contains utilities relating to particular
4549network hardware types (plipconfig, slattach) and advanced aspects of IP
4550configuration (iptunnel, ipmaddr).")
4551 (license license:gpl2+))))
4552
4553(define-public libcap
4554 (package
4555 (name "libcap")
4556 (version "2.64")
4557 (source (origin
4558 (method url-fetch)
4559 (uri (string-append
4560 "mirror://kernel.org/linux/libs/security/linux-privs/"
4561 "libcap2/libcap-" version ".tar.xz"))
4562 (sha256
4563 (base32
4564 "04qy0z6yhlljb29xxcb2srbdnymcrhsi28wrc705z3861cgmwin8"))))
4565 (build-system gnu-build-system)
4566 (arguments
4567 (list #:phases
4568 #~(modify-phases %standard-phases
4569 (delete 'configure)
4570 #$@(if (target-ppc32?)
4571 #~((add-after 'unpack 'apply-patch
4572 (lambda _
4573 (let ((patch
4574 #$(local-file
4575 (search-patch
4576 "libcap-magic-glibc-constant.patch"))))
4577 (invoke "patch" "--force" "-p1" "-i" patch)))))
4578 #~()))
4579 #:test-target "test"
4580 #:make-flags
4581 #~(list "lib=lib"
4582 (string-append "prefix=" #$output)
4583 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
4584 "RAISE_SETFCAP=no"
4585 ;; Tell the makefile to use TARGET-gcc and friends
4586 ;; when cross-compiling.
4587 #$@(if (%current-target-system)
4588 `((string-append "CROSS_COMPILE="
4589 ,(%current-target-system) "-")
4590 "BUILD_CC=gcc")
4591 '()))))
4592 (native-inputs (list perl))
4593 (supported-systems (remove target-hurd? %supported-systems))
4594 (home-page "https://sites.google.com/site/fullycapable/")
4595 (synopsis "Library for working with POSIX capabilities")
4596 (description
4597 "Libcap2 provides a programming interface to POSIX capabilities on
4598Linux-based operating systems.")
4599
4600 ;; License is BSD-3 or GPLv2, at the user's choice.
4601 (license (list license:bsd-3 license:gpl2))))
4602
4603(define-public bridge-utils
4604 (package
4605 (name "bridge-utils")
4606 (version "1.7.1")
4607 (source
4608 (origin
4609 (method url-fetch)
4610 (uri (string-append "mirror://kernel.org/linux/utils/net/"
4611 "bridge-utils/bridge-utils-" version ".tar.xz"))
4612 (sha256
4613 (base32 "03p6cmhm6cqhnfsfa1wv7frhb361y12daf7gr1h5qh51y7j8n7d6"))))
4614 (build-system gnu-build-system)
4615
4616 ;; The tarball lacks all the generated files.
4617 (native-inputs (list autoconf automake))
4618 (arguments
4619 '(#:tests? #f)) ; no 'check' target
4620
4621 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
4622 (synopsis "Manipulate Ethernet bridges")
4623 (description
4624 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
4625to connect two Ethernet segments together in a protocol independent way.
4626Packets are forwarded based on Ethernet address, rather than IP address (like
4627a router). Since forwarding is done at Layer 2, all protocols can go
4628transparently through a bridge.")
4629 (license license:gpl2+)))
4630
4631(define-public libnl
4632 (package
4633 (name "libnl")
4634 (version "3.5.0")
4635 (source (origin
4636 (method url-fetch)
4637 (uri (string-append
4638 "https://github.com/thom311/libnl/releases/download/"
4639 "libnl" (string-join (string-split version #\.) "_")
4640 "/libnl-" version ".tar.gz"))
4641 (sha256
4642 (base32
4643 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
4644 (build-system gnu-build-system)
4645 (native-inputs
4646 `(("bison" ,bison)
4647 ("flex" ,flex)
4648 ("pkg-config" ,pkg-config)
4649 ("swig" ,swig)
4650 ("libnl3-doc"
4651 ,(origin
4652 (method url-fetch)
4653 (uri (string-append
4654 "https://github.com/thom311/libnl/releases/download/libnl"
4655 (string-join (string-split version #\.) "_")
4656 "/libnl-doc-" version ".tar.gz"))
4657 (sha256
4658 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
4659 (outputs `("out" "doc"))
4660 (arguments
4661 `(#:phases
4662 (modify-phases %standard-phases
4663 (add-after 'install 'install-doc
4664 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
4665 (let ((dest (string-append (assoc-ref outputs "doc")
4666 "/share/doc/libnl")))
4667 (mkdir-p dest)
4668 (invoke "tar" "xf" (assoc-ref
4669 (or native-inputs inputs)
4670 "libnl3-doc")
4671 "--strip-components=1" "-C" dest)))))))
4672 (home-page "https://www.infradead.org/~tgr/libnl/")
4673 (synopsis "NetLink protocol library suite")
4674 (description
4675 "The libnl suite is a collection of libraries providing APIs to netlink
4676protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
4677between the kernel and user space processes. It was designed to be a more
4678flexible successor to ioctl to provide mainly networking related kernel
4679configuration and monitoring interfaces.")
4680
4681 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
4682 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
4683 (license license:gpl2)))
4684
4685;; libnl python extensions used to be outputs of libnl. However, as
4686;; cross-compiling python extensions is currently broken, create separate
4687;; packages for libnl python extensions.
4688(define (libnl-python-package python)
4689 (let ((name (string-append "libnl-" python)))
4690 (package
4691 (inherit libnl)
4692 (name name)
4693 (inputs `(,@(cond
4694 ((string=? python "python2")
4695 `(("python-2" ,python-2)))
4696 ((string=? python "python3")
4697 `(("python-3" ,python-3))))
4698 ("libxcrypt" ,libxcrypt))) ;required by Python.h
4699 (propagated-inputs (list libnl))
4700 (outputs '("out"))
4701 (arguments
4702 `(#:modules ((guix build gnu-build-system)
4703 (guix build utils)
4704 (srfi srfi-1))
4705 #:phases
4706 (modify-phases %standard-phases
4707 (replace 'install
4708 (lambda* (#:key inputs outputs #:allow-other-keys)
4709 (define (python-inst python)
4710 (invoke python "setup.py" "build")
4711 (invoke python "setup.py" "install"
4712 (string-append "--prefix="
4713 (assoc-ref %outputs "out")))
4714 (invoke python "setup.py" "clean"))
4715 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
4716 (assoc-ref inputs "libnl")))
4717 (with-directory-excursion "./python" (python-inst ,python))
4718 #t))))))))
4719
4720(define-public libnl-python2 (libnl-python-package "python2"))
4721(define-public libnl-python3 (libnl-python-package "python3"))
4722
4723(define-public iw
4724 (package
4725 (name "iw")
4726 (version "5.19")
4727 (source (origin
4728 (method url-fetch)
4729 (uri (string-append
4730 "mirror://kernel.org/software/network/iw/iw-"
4731 version ".tar.xz"))
4732 (sha256
4733 (base32
4734 "0kjdrihc7ibnjdpjqkq8sv0kmmvavgsww78cpjgbnlyx8zlvnrzi"))))
4735 (build-system gnu-build-system)
4736 (native-inputs (list pkg-config))
4737 (inputs (list libnl))
4738 (arguments
4739 (list #:make-flags
4740 #~(list
4741 (string-append "CC=" #$(cc-for-target))
4742 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
4743 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4744 #:phases
4745 #~(modify-phases %standard-phases
4746 (delete 'configure)))) ; no configure script
4747 (home-page "https://wireless.wiki.kernel.org/")
4748 (synopsis "Tool for configuring wireless devices")
4749 (description
4750 "iw is a new nl80211 based CLI configuration utility for wireless
4751devices. It replaces @code{iwconfig}, which is deprecated.")
4752 (license license:isc)))
4753
4754(define-public powertop
4755 (package
4756 (name "powertop")
4757 (version "2.15")
4758 (source
4759 (origin
4760 (method git-fetch)
4761 (uri (git-reference
4762 (url "https://github.com/fenrus75/powertop")
4763 (commit (string-append "v" version))))
4764 (file-name (git-file-name name version))
4765 (sha256
4766 (base32 "10vbk4vplmzp3p1mhwnhj81g6i5xvam9pdvmiy6cmd0xvnmdyy77"))))
4767 (build-system gnu-build-system)
4768 (arguments
4769 (list
4770 #:configure-flags #~(list "LDFLAGS=-pthread")
4771 #:phases
4772 #~(modify-phases %standard-phases
4773 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
4774 ;; allow calibrating the network interface in Guix System.
4775 (add-after 'unpack 'patch-absolute-file-names
4776 (lambda* (#:key inputs #:allow-other-keys)
4777 (let ((kmod (assoc-ref inputs "kmod")))
4778 ;; Fix for using a more modern gettext.
4779 (substitute* "autogen.sh"
4780 (("autoreconf")
4781 "autoreconf --force"))
4782 (substitute* "configure.ac"
4783 (("^AM_GNU_GETTEXT_VERSION.*$")
4784 (string-append "AM_GNU_GETTEXT_VERSION(["
4785 #$(package-version (this-package-native-input "gettext-minimal"))
4786 "])\n")))
4787 ;; Give the right 'modprobe' file name so that essential
4788 ;; modules such as msr.ko can be loaded.
4789 (substitute* (find-files "src" "\\.cpp$")
4790 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
4791 ;; These programs are only needed to calibrate, so using
4792 ;; relative file names avoids adding extra inputs. When they
4793 ;; are missing powertop gracefully handles it.
4794 (("/usr/s?bin/(hciconfig|hcitool|xset)" _ command)
4795 command
4796 command))))))))
4797 (native-inputs
4798 (list autoconf
4799 autoconf-archive
4800 automake
4801 gettext-minimal
4802 libtool
4803 pkg-config))
4804 (inputs
4805 (list kmod libnl ncurses pciutils zlib))
4806 (home-page "https://01.org/powertop/")
4807 (synopsis "Analyze power consumption on x86-based laptops")
4808 (description
4809 "PowerTOP is a Linux tool to diagnose issues with power consumption and
4810power management. In addition to being a diagnostic tool, PowerTOP also has
4811an interactive mode where the user can experiment various power management
4812settings for cases where the operating system has not enabled these
4813settings.")
4814 (license license:gpl2)))
4815
4816(define-public aumix
4817 (package
4818 (name "aumix")
4819 (version "2.9.1")
4820 (source (origin
4821 (method url-fetch)
4822 (uri (string-append
4823 "https://web.archive.org/web/20211201184543/"
4824 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
4825 version ".tar.bz2"))
4826 (sha256
4827 (base32
4828 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
4829 (build-system gnu-build-system)
4830 (arguments
4831 ;; Allow compilation with GCC 10.
4832 '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
4833 (inputs (list ncurses))
4834 (home-page (string-append "https://web.archive.org/web/20211201184543/"
4835 "http://jpj.net/~trevor/aumix.html"))
4836 (synopsis "Audio mixer for X and the console")
4837 (description
4838 "Aumix adjusts an audio mixer from X, the console, a terminal,
4839the command line or a script.")
4840 (license license:gpl2+)))
4841
4842(define-public iotop-python
4843 ;; The last release is from 2013 and gives a misleading CONFIG_TASK_DELAY_ACCT
4844 ;; error on ‘newer’ kernels.
4845 (let ((revision "0")
4846 (commit "a14256a3ff74eeee59493ac088561f1bafab85a7"))
4847 (package
4848 (name "iotop-python")
4849 (version (git-version "0.6" revision commit))
4850 (source
4851 (origin
4852 (method git-fetch)
4853 (uri (git-reference
4854 (url "https://repo.or.cz/iotop.git")
4855 (commit commit)))
4856 (file-name (git-file-name name version))
4857 (sha256
4858 (base32 "00h5p8fk1zi237q8mqds8apqbis9iw0yih1hl0pr63dsnyzmmrpw"))))
4859 (build-system pyproject-build-system)
4860 (arguments
4861 (list
4862 #:tests? #f ; No tests.
4863 #:phases
4864 #~(modify-phases %standard-phases
4865 (add-after 'unpack 'fix-build-with-python3
4866 (lambda _
4867 (substitute* "setup.py"
4868 (("itervalues")
4869 "values")))))))
4870 (native-inputs (list python python-setuptools))
4871 (home-page "http://guichaz.free.fr/iotop/")
4872 (synopsis "Displays the IO activity of running processes")
4873 (description
4874 "Iotop is a Python program with a top like user interface to show the
4875processes currently causing I/O.")
4876 (license license:gpl2+))))
4877
4878(define-public iotop
4879 (package
4880 (name "iotop")
4881 (version "1.30")
4882 (source
4883 (origin
4884 (method git-fetch)
4885 (uri (git-reference
4886 (url "https://github.com/Tomas-M/iotop")
4887 (commit (string-append "v" version))))
4888 (file-name (git-file-name name version))
4889 (sha256
4890 (base32 "1sijsk13bkrhsc5bc8f5i97a1ayhivak9pfinnyli57dh22w4k1g"))))
4891 (build-system gnu-build-system)
4892 (arguments
4893 (list #:make-flags
4894 #~(list (string-append "CC=" #$(cc-for-target))
4895 (string-append "PREFIX=" #$output))
4896 #:tests? #f ; no tests
4897 #:phases
4898 #~(modify-phases %standard-phases
4899 (delete 'configure)))) ; no configure script
4900 (native-inputs (list pkg-config))
4901 (inputs (list ncurses))
4902 (home-page "https://github.com/Tomas-M/iotop")
4903 (synopsis "Interactive @command{top}-like input/output activity monitor")
4904 (description
4905 "iotop identifies which processes and threads are most responsible for
4906@acronym{I/O, input/output} activity such as disc reads and writes. It sorts
4907them in a live, interactive table overview similar to that of the well-known
4908@command{top}.
4909
4910This information makes it much easier for an administrator to see which tasks
4911are blocking others and adjust their priority (using @command{ionice}) or stop
4912or kill them altogether.")
4913 (license license:gpl2+)))
4914
4915(define-public fuse
4916 (package
4917 (name "fuse")
4918 (version "3.10.5")
4919 (source (origin
4920 (method url-fetch)
4921 (uri
4922 (string-append "https://github.com/libfuse/libfuse/releases/"
4923 "download/fuse-" version
4924 "/fuse-" version ".tar.xz"))
4925 (sha256
4926 (base32
4927 "0rlnnsiw614qcmgy8xz67044gqc1pbvvf2yxjv44lh27bm487qmj"))))
4928 (build-system meson-build-system)
4929 (inputs
4930 (list bash-minimal util-linux))
4931 (arguments
4932 `(#:configure-flags
4933 ,#~(list
4934 (string-append "-Dudevrulesdir=" #$output "/udev/rules.d")
4935 "-Duseroot=false")
4936 #:tests? #f
4937 #:phases
4938 ,#~(modify-phases %standard-phases
4939 (add-after 'unpack 'set-file-names
4940 (lambda* (#:key inputs #:allow-other-keys)
4941 ;; libfuse calls out to mount(8) and umount(8). Make sure
4942 ;; it refers to the right ones.
4943 (substitute* '("lib/mount_util.c")
4944 (("/bin/(u?)mount" _ maybe-u)
4945 (search-input-file inputs
4946 (string-append "bin/"
4947 maybe-u "mount"))))
4948 (substitute* '("util/mount.fuse.c")
4949 (("/bin/sh")
4950 (search-input-file inputs "/bin/sh")))
4951
4952 ;; This hack leads libfuse to search for 'fusermount' in
4953 ;; $PATH, where it may find a setuid-root binary, instead of
4954 ;; trying solely $out/sbin/fusermount and failing because
4955 ;; it's not setuid.
4956 (substitute* "lib/meson.build"
4957 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
4958 "-DFUSERMOUNT_DIR=\"/var/empty\"'"))))
4959 (add-after 'unpack 'fix-install
4960 (lambda* (#:key inputs #:allow-other-keys)
4961 (substitute* '("util/meson.build")
4962 (("install_helper.sh") "true"))
4963 (substitute* '("util/meson.build")
4964 (("fuseconf_path = .*")
4965 "fuseconf_path = '/etc/fuse.conf'"))))
4966 (add-before 'configure 'set-paths
4967 (lambda* (#:key inputs outputs #:allow-other-keys)
4968 (let ((dummy-init.d
4969 (string-append (getcwd) "/etc/init.d")))
4970 (setenv "MOUNT_FUSE_PATH"
4971 (string-append #$output "/sbin"))
4972 (setenv "UDEV_RULES_PATH"
4973 (string-append #$output
4974 "/lib/udev/rules.d"))))))))
4975 (supported-systems (remove target-hurd? %supported-systems))
4976 (home-page "https://github.com/libfuse/libfuse")
4977 (synopsis "Support file systems implemented in user space")
4978 (description
4979 "As a consequence of its monolithic design, file system code for Linux
4980normally goes into the kernel itself---which is not only a robustness issue,
4981but also an impediment to system extensibility. FUSE, for \"file systems in
4982user space\", is a kernel module and user-space library that tries to address
4983part of this problem by allowing users to run file system implementations as
4984user-space processes.")
4985 (license (list license:lgpl2.1 ; library
4986 license:gpl2+)))) ; command-line utilities
4987
4988(define-public fuse-2
4989 (package
4990 (inherit fuse)
4991 (name "fuse")
4992 (version "2.9.9")
4993 (source
4994 (origin
4995 (method url-fetch)
4996 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
4997 "download/fuse-" version
4998 "/fuse-" version ".tar.gz"))
4999 (sha256
5000 (base32 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
5001 (patches (search-patches "fuse-overlapping-headers.patch"
5002 "fuse-glibc-2.34.patch"))))
5003 (build-system gnu-build-system)
5004 (native-inputs
5005 (list autoconf automake gettext-minimal libtool))
5006 (arguments
5007 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
5008 (assoc-ref %outputs "out")
5009 "/sbin")
5010 (string-append "INIT_D_PATH="
5011 (assoc-ref %outputs "out")
5012 "/etc/init.d")
5013
5014 ;; The rule makes /dev/fuse 666.
5015 (string-append "UDEV_RULES_PATH="
5016 (assoc-ref %outputs "out")
5017 "/lib/udev/rules.d"))
5018 #:phases
5019 (modify-phases %standard-phases
5020 (add-before 'bootstrap 'force-bootstrap
5021 (lambda _
5022 ;; Force a bootstrap to make the patch changes effective.
5023 (delete-file "configure")))
5024 (add-before 'build 'set-file-names
5025 (lambda* (#:key inputs #:allow-other-keys)
5026 ;; libfuse calls out to mount(8) and umount(8). Make sure
5027 ;; it refers to the right ones.
5028 (substitute* '("lib/mount_util.c" "util/mount_util.c")
5029 (("/bin/(u?)mount" _ maybe-u)
5030 (search-input-file inputs
5031 (string-append "bin/"
5032 maybe-u "mount"))))
5033 (substitute* '("util/mount.fuse.c")
5034 (("/bin/sh")
5035 (search-input-file inputs "/bin/sh")))
5036
5037 ;; This hack leads libfuse to search for 'fusermount' in
5038 ;; $PATH, where it may find a setuid-root binary, instead of
5039 ;; trying solely $out/sbin/fusermount and failing because
5040 ;; it's not setuid.
5041 (substitute* "lib/Makefile"
5042 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5043 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))))
5044
5045(define-public fuse-for-appimage
5046 (package
5047 (inherit fuse)
5048 (name "fuse")
5049 (version "3.16.2")
5050 (source
5051 (origin
5052 (method url-fetch)
5053 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
5054 "download/fuse-" version "/fuse-" version ".tar.gz"))
5055 (sha256
5056 (base32 "11yfl2w2a445hllyzlakq97n32g06972vxpmh7lpbclnj9fhb5zp"))))
5057 (arguments
5058 (substitute-keyword-arguments (package-arguments fuse)
5059 ((#:configure-flags original-flags #~(list))
5060 #~(append #$original-flags '("--default-library=static")))))))
5061
5062(define-public unionfs-fuse
5063 (package
5064 (name "unionfs-fuse")
5065 (version "3.3")
5066 (source (origin
5067 (method git-fetch)
5068 (uri (git-reference
5069 (url "https://github.com/rpodgorny/unionfs-fuse")
5070 (commit (string-append "v" version))))
5071 (file-name (git-file-name name version))
5072 (sha256
5073 (base32
5074 "1wl5m5qnwf3s1792xphr35pb80sx8ybaqi3n3ddi5vvk3qjc4iws"))))
5075 (build-system cmake-build-system)
5076 (arguments
5077 (list
5078 #:phases
5079 #~(modify-phases %standard-phases
5080 (replace 'check
5081 ;; The epitome of ‘I tried’: run the 2 trivial tests that don't rely
5082 ;; on the fuse kernel module being loaded. All others would fail.
5083 (lambda* (#:key tests? #:allow-other-keys)
5084 (when tests?
5085 (invoke "pytest" "../source/test_all.py" "-k" "test_help")))))))
5086 (native-inputs
5087 (list pkg-config
5088
5089 ;; Only for the test ‘suite’.
5090 python
5091 python-pytest))
5092 (inputs
5093 (list fuse))
5094 (home-page "https://github.com/rpodgorny/unionfs-fuse")
5095 (synopsis "User-space union file system")
5096 (description
5097 "UnionFS-FUSE is a flexible union file system implementation in user
5098space, using the FUSE library. Mounting a union file system allows you to
5099\"aggregate\" the contents of several directories into a single mount point.
5100UnionFS-FUSE additionally supports copy-on-write.")
5101 (license license:bsd-3)))
5102
5103(define fuse-static
5104 (package (inherit fuse)
5105 (name "fuse-static")
5106 (source
5107 (origin
5108 (inherit (package-source fuse))
5109 (modules '((guix build utils)))
5110 (snippet
5111 #~(begin
5112 ;; Normally libfuse invokes mount(8) so that /etc/mtab is updated.
5113 ;; Change calls to 'mtab_needs_update' to 0 so that it doesn't do
5114 ;; that, allowing us to remove the dependency on util-linux
5115 ;; (something that is useful in initrds.)
5116 (substitute* "lib/mount_util.c"
5117 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") "0")
5118 (("/bin/") ""))))))
5119 (arguments
5120 (substitute-keyword-arguments (package-arguments fuse)
5121 ((#:configure-flags flags '())
5122 #~(cons "-Ddefault_library=static"
5123 #$flags))))))
5124
5125(define-public unionfs-fuse/static
5126 (package (inherit unionfs-fuse)
5127 (synopsis "User-space union file system (statically linked)")
5128 (name (string-append (package-name unionfs-fuse) "-static"))
5129 (source
5130 (origin
5131 (inherit (package-source unionfs-fuse))
5132 (modules '((guix build utils)))
5133 (snippet
5134 #~(begin
5135 ;; Add -ldl to the libraries, because libfuse.a needs that.
5136 (substitute* "src/CMakeLists.txt"
5137 (("target_link_libraries(.*)\\)" _ libs)
5138 (string-append "target_link_libraries"
5139 libs " dl)")))))))
5140 (arguments
5141 (substitute-keyword-arguments (package-arguments unionfs-fuse)
5142 ((#:configure-flags flags #~'())
5143 #~(cons "-DCMAKE_EXE_LINKER_FLAGS=-static" #$flags))
5144 ((#:phases phases #~%standard-phases)
5145 #~(modify-phases #$phases
5146 (add-after 'install 'post-install
5147 (lambda _
5148 ;; By default, 'unionfs' keeps references to
5149 ;; $glibc/share/locale and similar stuff. Remove them.
5150 (remove-store-references (string-append #$output "/bin/unionfs"))
5151 ;; 'unionfsctl' has references to glibc as well. Since
5152 ;; we don't need it, remove it.
5153 (delete-file (string-append #$output "/bin/unionfsctl"))))))))
5154 (inputs (list fuse-static))))
5155
5156(define-public sshfs
5157 (package
5158 (name "sshfs")
5159 (version "3.7.5")
5160 (source (origin
5161 (method url-fetch)
5162 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
5163 "download/sshfs-" version "/sshfs-" version
5164 ".tar.xz"))
5165 (sha256
5166 (base32
5167 "1fx8c4fkvmfi29iw8wz5dwnniq666ji4y4vl67dij2fhq9ixni8f"))))
5168 (build-system meson-build-system)
5169 (arguments
5170 ;; XXX: tests are skipped: FUSE kernel module does not seem to be loaded
5171 '(#:tests? #f))
5172 (inputs
5173 (list fuse glib))
5174 (native-inputs
5175 (list pkg-config
5176 ;; man page
5177 python-docutils))
5178 (home-page "https://github.com/libfuse/sshfs")
5179 (synopsis "Mount remote file systems over SSH")
5180 (description
5181 "This is a file system client based on the SSH File Transfer Protocol.
5182Since most SSH servers already support this protocol it is very easy to set
5183up: on the server side there's nothing to do; on the client side mounting the
5184file system is as easy as logging into the server with an SSH client.")
5185 (license license:gpl2+)))
5186
5187(define-public sshfs-fuse
5188 (package (inherit sshfs)
5189 (name "sshfs-fuse")
5190 (properties `((superseded . ,sshfs)))))
5191
5192(define-public archivemount
5193 (package
5194 (name "archivemount")
5195 (version "0.9.1")
5196 (source
5197 (origin
5198 (method url-fetch)
5199 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
5200 "archivemount-" version ".tar.gz"))
5201 (sha256
5202 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
5203 (build-system gnu-build-system)
5204 (inputs (list fuse-2 libarchive))
5205 (native-inputs (list pkg-config))
5206 (home-page "https://www.cybernoia.de/software/archivemount.html")
5207 (synopsis "Tool for mounting archive files with FUSE")
5208 (description "archivemount is a FUSE-based file system for Unix variants,
5209including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
5210mount point where it can be read from or written to as with any other file
5211system. This makes accessing the contents of the archive, which may be
5212compressed, transparent to other programs, without decompressing them.")
5213 (license license:lgpl2.0+)))
5214
5215(define-public numactl
5216 (package
5217 (name "numactl")
5218 (version "2.0.16")
5219 (source (origin
5220 (method url-fetch)
5221 (uri (string-append
5222 "https://github.com/numactl/numactl/releases/download/v"
5223 version "/numactl-" version ".tar.gz"))
5224 (sha256
5225 (base32
5226 "1j67wx3383fwqbvhg4nwqf72vpdgimmrvkpn3b9s2xzr7a4jy90v"))))
5227 (build-system gnu-build-system)
5228 (arguments
5229 `(,@(if (target-riscv64?)
5230 `(#:make-flags (list "LDFLAGS=-latomic"))
5231 '())
5232 ;; There's a 'test' target, but it requires NUMA support in the kernel
5233 ;; to run, which we can't assume to have.
5234 #:tests? #f))
5235 (home-page "https://github.com/numactl/numactl")
5236 (synopsis "Tools for non-uniform memory access (NUMA) machines")
5237 (description
5238 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
5239memory is not all in one place. The @command{numactl} program allows you to
5240run your application program on specific CPUs and memory nodes. It does this
5241by supplying a NUMA memory policy to the operating system before running your
5242program.
5243
5244The package contains other commands, such as @command{numastat},
5245@command{memhog}, and @command{numademo} which provides a quick overview of
5246NUMA performance on your system.")
5247 (license (list license:gpl2 ;programs
5248 license:lgpl2.1)))) ;library
5249
5250(define-public kbd-neo
5251 (package
5252 (name "kbd-neo")
5253 (version "2486")
5254 (source
5255 (origin
5256 (method url-fetch)
5257 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
5258 version "/linux/console/neo.map"))
5259 (file-name (string-append name "-" version ".map"))
5260 (sha256
5261 (base32
5262 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
5263 (build-system trivial-build-system)
5264 (arguments
5265 `(#:modules ((guix build utils))
5266 #:builder (begin
5267 (use-modules (guix build utils))
5268 (let ((out (string-append %output "/share/keymaps"))
5269 (source (assoc-ref %build-inputs "source")))
5270 (mkdir-p out)
5271 (copy-file source (string-append out "/neo.map"))
5272 #t))))
5273 (home-page "https://neo-layout.org")
5274 (synopsis "Neo2 console layout")
5275 (description
5276 "Kbd-neo provides the Neo2 keyboard layout for use with
5277@command{loadkeys(1)} from @code{kbd(4)}.")
5278 ;; The file is located in an svn directory, the entire content of
5279 ;; the directory is licensed as GPL3.
5280 (license license:gpl3+)))
5281
5282(define-public kbd
5283 (package
5284 (name "kbd")
5285 (version "2.5.1")
5286 (source (origin
5287 (method url-fetch)
5288 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
5289 version ".tar.xz"))
5290 (sha256
5291 (base32
5292 "10s608i4blprgy9nynlid0hglfdrrgln6wwjs9rhjf56hwilbpyc"))
5293 (modules '((guix build utils)))
5294 (snippet
5295 '(begin
5296 (substitute* '("src/unicode_start" "src/unicode_stop")
5297 ;; Assume the Coreutils are in $PATH.
5298 (("/usr/bin/tty")
5299 "tty"))))))
5300 (build-system gnu-build-system)
5301 (arguments
5302 '(#:phases
5303 (modify-phases %standard-phases
5304 (add-before 'build 'pre-build
5305 (lambda* (#:key inputs #:allow-other-keys)
5306 (let ((bzip2 (assoc-ref inputs "bzip2"))
5307 (gzip (assoc-ref inputs "gzip"))
5308 (xz (assoc-ref inputs "xz"))
5309 (zstd (assoc-ref inputs "zstd")))
5310 (substitute* "src/libkbdfile/kbdfile.c"
5311 (("bzip2") (string-append bzip2 "/bin/bzip2"))
5312 (("gzip") (string-append gzip "/bin/gzip"))
5313 (("xz -d") (string-append xz "/bin/xz -d"))
5314 (("zstd") (string-append zstd "/bin/zstd"))))))
5315 (add-after 'install 'post-install
5316 (lambda* (#:key outputs #:allow-other-keys)
5317 ;; Make sure these programs find their comrades.
5318 (let* ((out (assoc-ref outputs "out"))
5319 (bin (string-append out "/bin")))
5320 (for-each (lambda (prog)
5321 (wrap-program (string-append bin "/" prog)
5322 `("PATH" ":" prefix (,bin))))
5323 '("unicode_start" "unicode_stop"))))))))
5324 (native-inputs
5325 (list autoconf pkg-config))
5326 (inputs
5327 `(("bash" ,bash-minimal) ; for wrap-program
5328 ("bzip2" ,bzip2)
5329 ("gzip" ,gzip)
5330 ("pam" ,linux-pam)
5331 ("xz" ,xz)
5332 ("zstd" ,zstd)))
5333 (native-search-paths
5334 (list (search-path-specification
5335 (variable "LOADKEYS_KEYMAP_PATH")
5336 ;; Append ‘/**’ to recursively search all directories. One can then
5337 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
5338 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
5339 (files (list "share/keymaps/**")))))
5340 (home-page "https://kbd-project.org/")
5341 (synopsis "Linux keyboard utilities and keyboard maps")
5342 (description
5343 "This package contains keytable files and keyboard utilities compatible
5344for systems using the Linux kernel. This includes commands such as
5345@code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
5346 (license license:gpl2+)))
5347
5348(define-public loadkeys-static
5349 (package
5350 (inherit kbd)
5351 (name "loadkeys-static")
5352 (arguments
5353 (substitute-keyword-arguments (package-arguments kbd)
5354 ((#:configure-flags flags ''())
5355 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
5356 "--disable-vlock" ;so we don't need libpam
5357 "--disable-libkeymap")
5358 ,flags))
5359 ((#:make-flags flags ''())
5360 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
5361 ((#:phases phases '%standard-phases)
5362 `(modify-phases ,phases
5363 (replace 'install
5364 (lambda* (#:key outputs #:allow-other-keys)
5365 (let ((out (assoc-ref outputs "out")))
5366 ;; The binary keeps references to gzip, among other things,
5367 ;; which we don't need in the initrd, so strip references.
5368 (remove-store-references "src/loadkeys")
5369
5370 (install-file "src/loadkeys"
5371 (string-append out "/bin")))))
5372 (delete 'post-install)))
5373 ((#:strip-flags _ '())
5374 ''("--strip-all"))
5375 ((#:allowed-references _ '())
5376 '())))
5377
5378 (synopsis "Statically-linked @command{loadkeys} program")
5379
5380 ;; This package is meant to be used internally in the initrd so don't
5381 ;; expose it.
5382 (properties '((hidden? . #t)))))
5383
5384(define-public inotify-tools
5385 (package
5386 (name "inotify-tools")
5387 (version "3.22.6.0")
5388 (source (origin
5389 (method git-fetch)
5390 (uri (git-reference
5391 (url "https://github.com/rvoicilas/inotify-tools")
5392 (commit version)))
5393 (file-name (git-file-name name version))
5394 (sha256
5395 (base32
5396 "1j9j8k5zjp8m4cl53zjncnll9z4dnvzr4ygmfcjk0ci81i59b18i"))))
5397 (build-system gnu-build-system)
5398 (native-inputs
5399 (list autoconf automake libtool))
5400 (arguments
5401 `(#:configure-flags
5402 (list "--disable-static")))
5403 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
5404 (synopsis "Monitor file accesses")
5405 (description
5406 "The inotify-tools packages provides a C library and command-line tools
5407to use Linux' inotify mechanism, which allows file accesses to be monitored.")
5408 (license license:gpl2+)))
5409
5410(define-public kmod
5411 (package
5412 (name "kmod")
5413 (version "29")
5414 (source (origin
5415 (method url-fetch)
5416 (uri
5417 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
5418 "kmod-" version ".tar.xz"))
5419 (sha256
5420 (base32
5421 "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
5422 (patches (search-patches "kmod-module-directory.patch"))))
5423 (build-system gnu-build-system)
5424 (arguments
5425 (list #:configure-flags #~(list "--with-xz" "--with-zlib" "--with-zstd"
5426 "--disable-test-modules")
5427 #:phases
5428 #~(modify-phases %standard-phases
5429 (add-after 'unpack 'disable-tests
5430 (lambda _
5431 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
5432 (substitute* "Makefile.in"
5433 (("testsuite/test-modprobe") "")
5434 (("testsuite/test-depmod") "")
5435 (("testsuite/test-blacklist") ""))))
5436 (add-after 'install 'install-modprobe&co
5437 (lambda _
5438 (for-each (lambda (tool)
5439 (symlink "kmod"
5440 (string-append #$output "/bin/" tool)))
5441 '("insmod" "rmmod" "lsmod" "modprobe"
5442 "modinfo" "depmod")))))))
5443 (native-inputs (list pkg-config zstd)) ;zstd needed for tests
5444 (inputs (list xz zlib `(,zstd "lib")))
5445 (supported-systems (remove target-hurd? %supported-systems))
5446 (home-page "https://www.kernel.org/")
5447 (synopsis "Kernel module tools")
5448 (description "Kmod is a set of tools to handle common tasks with Linux
5449kernel modules like insert, remove, list, check properties, resolve
5450dependencies and aliases.
5451
5452These tools are designed on top of libkmod, a library that is shipped with
5453kmod. The aim is to be compatible with tools, configurations and indices
5454from the module-init-tools project.")
5455 (license license:gpl2+))) ; library under lgpl2.1+
5456
5457(define-public earlyoom
5458 (package
5459 (name "earlyoom")
5460 (version "1.7")
5461 (source (origin
5462 (method git-fetch)
5463 (uri (git-reference
5464 (url "https://github.com/rfjakob/earlyoom")
5465 (commit (string-append "v" version))))
5466 (file-name (git-file-name name version))
5467 (sha256
5468 (base32
5469 "1xqrs6wz59ks76hdgfd4vaj010kbvllilgam2xxyn0g56kai71zi"))))
5470 (build-system gnu-build-system)
5471 (arguments
5472 (list
5473 #:phases
5474 #~(modify-phases %standard-phases
5475 (delete 'configure) ; no configure script
5476 (add-before 'check 'set-go-HOME
5477 (lambda _
5478 (setenv "HOME" (getcwd))))
5479 (add-before 'check 'disable-failing-test
5480 (lambda _
5481 ;; This test relies on writing to /proc/%d/oom_score_adj.
5482 (substitute* "testsuite_cli_test.go"
5483 (("TestI" match)
5484 (string-append "skipped" match))))))
5485 #:make-flags
5486 #~(list (string-append "CC=" #$(cc-for-target))
5487 (string-append "VERSION=v" #$version)
5488 (string-append "PREFIX=" #$output)
5489 (string-append "SYSCONFDIR=" #$output "/etc")
5490 "GO111MODULE=off")
5491 #:test-target "test"))
5492 (native-inputs
5493 (append
5494 ;; To generate the manpage.
5495 (if (or (target-x86-64?) (target-x86-32?))
5496 (list pandoc)
5497 '())
5498 (list
5499 ;; For the test suite.
5500 cppcheck
5501 go-1.23)))
5502 (home-page "https://github.com/rfjakob/earlyoom")
5503 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
5504 (description "Early OOM is a minimalist out of memory (OOM) daemon that
5505runs in user space and provides a more responsive and configurable alternative
5506to the in-kernel OOM killer.")
5507 (license license:expat)))
5508
5509(define-public eudev
5510 (package
5511 (name "eudev")
5512 (version "3.2.14")
5513 (source (origin
5514 (method git-fetch)
5515 (uri (git-reference (url "https://github.com/eudev-project/eudev")
5516 (commit (string-append "v" version))))
5517 (file-name (git-file-name name version))
5518 (sha256
5519 (base32
5520 "1f6lz57igi7iw2ls3fpzgw42bfznam4nf9368h7x8yf1mb737yxz"))))
5521 (build-system gnu-build-system)
5522 (arguments
5523 (list
5524 ;; The binary should be built to look for its rules under
5525 ;; /etc/udev/rules.d, which is where the udev-shepherd-service keeps
5526 ;; them.
5527 #:make-flags #~(list "udevrulesdir=/etc/udev/rules.d")
5528 #:phases
5529 #~(modify-phases %standard-phases
5530 (add-before 'bootstrap 'patch-file-names
5531 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5532 (substitute* "man/make.sh"
5533 (("/usr/bin/xsltproc")
5534 (search-input-file (or native-inputs inputs) "/bin/xsltproc")))))
5535 (add-before 'bootstrap 'install-in-lib
5536 (lambda _
5537 ;; When the udev-service-type instantiates /etc, it collects
5538 ;; hardware files from the <package>/lib/udev/hwdb.d directories
5539 ;; of different packages. Since we set sysconfdir to /etc, the
5540 ;; only package-dependent location we can install hwdb files is
5541 ;; in <package>/lib/udev/hwdb.d. Eudev is configured to install
5542 ;; these files in sysconfdir, but they should be placed into
5543 ;; udevlibexecdir.
5544 (copy-file "hwdb/Makefile.am" "hwdb/files.am")
5545 (call-with-output-file "hwdb/Makefile.am"
5546 (lambda (port)
5547 (format port "hardwarelibdir = $(udevlibexecdir)/hwdb.d\n")
5548 (format port "include ./files.am")))
5549 (substitute* "hwdb/files.am"
5550 (("dist_udevhwdb_DATA =")
5551 "dist_hardwarelib_DATA ="))
5552 ;; Do not install the empty udev.conf template.
5553 (substitute* "src/udev/Makefile.am"
5554 (("dist_udevconf_DATA =")
5555 "dist_noinst_DATA ="))
5556 ;; Do not ensure that /etc/udev/rules.d exists.
5557 (substitute* "rules/Makefile.am"
5558 (("\\$\\(MKDIR_P\\) \\$\\(DESTDIR\\)\\$\\(udevconfdir\\)/rules\\.d")
5559 "true"))))
5560 (add-after 'install 'move-static-library
5561 (lambda _
5562 (let ((source (string-append #$output "/lib/libudev.a"))
5563 (target (string-append #$output:static "/lib/libudev.a")))
5564 (mkdir-p (dirname target))
5565 (link source target)
5566 (delete-file source)
5567 ;; Remove reference to the static library from the .la file
5568 ;; such that Libtool looks for it in the usual places.
5569 (substitute* (string-append #$output "/lib/libudev.la")
5570 (("old_library=.*")
5571 "old_library=''\n")))))
5572 (replace 'install
5573 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
5574 ;; Although the runtime udevrulesdir is set to
5575 ;; /etc/udev/rules.d, the package should provide its default
5576 ;; rules under $libdir/udev/rules.d.
5577 (let* ((default-udev-rules.d (string-append #$output
5578 "/lib/udev/rules.d"))
5579 (make-flags (cons (string-append "udevrulesdir="
5580 default-udev-rules.d)
5581 (delete "udevrulesdir=/etc/udev/rules.d"
5582 make-flags))))
5583 (apply (assoc-ref %standard-phases 'install)
5584 `(,@args #:make-flags ,make-flags))))))
5585 #:configure-flags
5586 #~(list "--enable-manpages"
5587 ;; By default, autoconf uses $prefix/etc. The udev-service-type
5588 ;; makes sure /etc is set up with rules and hardware file
5589 ;; descriptions.
5590 "--sysconfdir=/etc")))
5591 (native-search-paths
5592 (list (search-path-specification
5593 (variable "UDEV_HWDB_PATH")
5594 (files '("lib/udev/hwdb.d")))))
5595 (native-inputs
5596 (list autoconf
5597 automake
5598 gperf
5599 libtool
5600 pkg-config
5601 ;; For tests.
5602 perl
5603 python-wrapper
5604 ;; For documentation.
5605 docbook-xml-4.2
5606 docbook-xsl
5607 libxslt))
5608 (inputs
5609 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
5610 ;; and similar; it also installs the '60-persistent-storage.rules' file,
5611 ;; which contains the rules to do that.
5612 (list `(,util-linux "lib") ;for blkid
5613 kmod))
5614 (outputs '("out" "static"))
5615 (home-page "https://github.com/eudev-project/eudev")
5616 (synopsis "Userspace device management")
5617 (description "Udev is a daemon which dynamically creates and removes
5618device nodes from /dev/, handles hotplug events and loads drivers at boot
5619time.")
5620 (license license:gpl2+)))
5621
5622(define-public python-evdev
5623 (package
5624 (name "python-evdev")
5625 (version "1.9.1")
5626 (source
5627 (origin
5628 (method git-fetch) ; no tests data in PyPi package
5629 (uri (git-reference
5630 (url "https://github.com/gvalkov/python-evdev")
5631 (commit (string-append "v" version))))
5632 (file-name (git-file-name name version))
5633 (sha256
5634 (base32 "09p7pj0xhv23hqlpx865klrxrf7x6sw1bdsgs6pq900jvz92pl16"))))
5635 (build-system pyproject-build-system)
5636 (arguments
5637 (list
5638 #:test-flags
5639 ;; Silent tests requiring access to /dev/uinput.
5640 #~(list "-k" (string-append "not test_open"
5641 " and not test_open_context"
5642 " and not test_enable_events"
5643 " and not test_abs_values"
5644 " and not test_write"))
5645 #:phases
5646 #~(modify-phases %standard-phases
5647 (add-before 'build 'fix-hard-coded-directory
5648 (lambda* (#:key inputs #:allow-other-keys)
5649 (substitute* "setup.py"
5650 (("/usr/include/linux")
5651 (string-append
5652 (assoc-ref inputs "kernel-headers") "/include/linux"))))))))
5653 (native-inputs
5654 (list python-pytest python-setuptools python-wheel))
5655 (home-page "https://github.com/gvalkov/python-evdev")
5656 (synopsis "Bindings to the Linux input handling subsystem")
5657 (description
5658 "Python-evdev provides bindings to the generic input event interface in
5659Linux. The @code{evdev} interface serves the purpose of passing events
5660generated in the kernel directly to userspace through character devices that
5661are typically located in @file{/dev/input/}.
5662
5663This package also comes with bindings to @code{uinput}, the userspace input
5664subsystem. @code{uinput} allows userspace programs to create and handle input
5665devices that can inject events directly into the input subsystem.")
5666 (license license:bsd-3)))
5667
5668(define-public interception-tools
5669 (package
5670 (name "interception-tools")
5671 (version "0.6.8")
5672 (home-page "https://gitlab.com/interception/linux/tools")
5673 (source (origin
5674 (method git-fetch)
5675 (uri (git-reference
5676 (url home-page)
5677 (commit (string-append "v" version))))
5678 (file-name (git-file-name name version))
5679 (sha256
5680 (base32
5681 "1sbidym6ld4c8cx2ww5i54zsv8v0kygv15zq1yimz44v4my605wf"))))
5682 (build-system cmake-build-system)
5683 (native-inputs
5684 (list pkg-config))
5685 (inputs
5686 (list boost libevdev eudev yaml-cpp))
5687 (arguments
5688 `(#:tests? #f)) ; no test suite
5689 (synopsis "Utilities for operating on input events of evdev devices")
5690 (description
5691 "Interception Tools provides a composable infrastructure on top of
5692@code{libudev} and @code{libevdev}. The following utilities are provided:
5693
5694@itemize
5695@item @command{udevmon} --- monitor input devices for launching tasks
5696@item @command{intercept} --- redirect device input events to stdout
5697@item @command{uinput} --- redirect device input events from stding to virtual device
5698@item @command{mux} --- mux streams of input events
5699@end itemize")
5700 ;; Dual-licensed under GPLv3+ or "something else" on request, per
5701 ;; 'README.md'.
5702 (license license:gpl3+)))
5703
5704(define-public interception-dual-function-keys
5705 (package
5706 (name "interception-dual-function-keys")
5707 (version "1.4.0")
5708 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
5709 (source (origin
5710 (method git-fetch)
5711 (uri (git-reference
5712 (url home-page)
5713 (commit version)))
5714 (file-name (git-file-name name version))
5715 (sha256
5716 (base32
5717 "0s49vbg3j4rwh78i8rx8qr7myql09p7b3lhrjl0p7dd98xp6ann6"))))
5718 (build-system gnu-build-system)
5719 (inputs
5720 (list libevdev yaml-cpp))
5721 (arguments
5722 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
5723 ,(string-append "CXX=" (cxx-for-target))
5724 (string-append "PREFIX=" %output))
5725 #:phases
5726 (modify-phases %standard-phases
5727 (add-after 'unpack 'fix-libevdev-path
5728 (lambda* (#:key inputs #:allow-other-keys)
5729 (let ((libevdev (assoc-ref inputs "libevdev")))
5730 (substitute* "config.mk"
5731 (("/usr/include/libevdev-1.0")
5732 (string-append libevdev "/include/libevdev-1.0")))
5733 #t)))
5734 ;; No configure script
5735 (delete 'configure))
5736 ;; No tests are included.
5737 #:tests? #f))
5738 (synopsis "Tap for one key, hold for another")
5739 (description
5740 "Dual Function Keys is a plugin for @code{interception-tools} that allows
5741one to send arbitrary keycodes when a given key is tapped or held.")
5742 (license license:expat)))
5743
5744(define-public lvm2
5745 (package
5746 (name "lvm2")
5747 (version "2.03.22")
5748 (source (origin
5749 (method url-fetch)
5750 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
5751 version ".tgz")
5752 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
5753 version ".tgz")))
5754 (sha256
5755 (base32
5756 "0z6w6bknhwh1n3qfkb5ij6x57q3wjf28lq3l8kh7rkhsplinjnjc"))
5757 (patches (search-patches "lvm2-no-systemd.patch"))
5758 (modules '((guix build utils)))
5759 (snippet
5760 '(begin
5761 (use-modules (guix build utils))
5762
5763 ;; Honor sysconfdir.
5764 (substitute* "make.tmpl.in"
5765 (("^confdir = .*$")
5766 "confdir = @sysconfdir@\n")
5767 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
5768 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
5769 (build-system gnu-build-system)
5770 (native-inputs
5771 (list config
5772 pkg-config procps)) ;tests use 'pgrep'
5773 (inputs
5774 `(("libaio" ,libaio)
5775 ("udev" ,eudev)))
5776 (arguments
5777 `(#:phases
5778 (modify-phases %standard-phases
5779 (add-after 'unpack 'update-config
5780 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5781 (install-file (search-input-file
5782 (or native-inputs inputs) "/bin/config.sub")
5783 "autoconf")
5784 (install-file (search-input-file
5785 (or native-inputs inputs) "/bin/config.guess")
5786 "autoconf")))
5787 (add-after 'configure 'set-makefile-shell
5788 (lambda _
5789 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
5790 ;; expected.
5791 (setenv "SHELL" (which "sh"))
5792
5793 ;; Replace /bin/sh with the right file name.
5794 (patch-makefile-SHELL "make.tmpl"))))
5795
5796 #:configure-flags (list (string-append "--sysconfdir="
5797 (assoc-ref %outputs "out")
5798 "/etc/lvm")
5799 "--enable-udev_sync"
5800 "--enable-udev_rules"
5801 "--enable-pkgconfig"
5802 "--enable-cmdlib"
5803 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
5804
5805 ;; Make sure programs such as 'dmsetup' can
5806 ;; find libdevmapper.so.
5807 (string-append "LDFLAGS=-Wl,-rpath="
5808 (assoc-ref %outputs "out")
5809 "/lib,-rpath="
5810 (assoc-ref %outputs "out")
5811 "/lib/device-mapper")
5812 ;; This is needed when cross-compiling.
5813 ,@(if (%current-target-system)
5814 '("ac_cv_func_malloc_0_nonnull=yes"
5815 "ac_cv_func_realloc_0_nonnull=yes")
5816 '()))
5817
5818 ;; The tests use 'mknod', which requires root access.
5819 #:tests? #f))
5820 (supported-systems (remove target-hurd? %supported-systems))
5821 (home-page "https://sourceware.org/lvm2/")
5822 (synopsis "Logical volume management for Linux")
5823 (description
5824 "LVM2 is the logical volume management tool set for Linux-based systems.
5825This package includes the user-space libraries and tools, including the device
5826mapper. Kernel components are part of Linux-libre.")
5827
5828 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
5829 ;; Command-line tools are GPLv2.
5830 (license (list license:gpl2 license:lgpl2.1))))
5831
5832(define-public (libdevmapper-propagated-inputs)
5833 (list eudev))
5834
5835(define-public lvm2-static
5836 (package
5837 (inherit lvm2)
5838 (name "lvm2-static")
5839
5840 (inputs `(,@(package-inputs lvm2)
5841 ("udev:static" ,eudev "static")))
5842
5843 (arguments
5844 (substitute-keyword-arguments (package-arguments lvm2)
5845 ((#:configure-flags flags '())
5846 ;; LVM2 doesn't use Libtool, hence the custom option.
5847 `(append '("--enable-static_link")
5848 ;; Building dmeventd statically is complicated due to a
5849 ;; requirement on libdevmapper.a, which is being phased out
5850 ;; in favor of libdevice-mapper.a, which in turn is is not
5851 ;; easily made available at dmeventd build time. Just ignore
5852 ;; it until the situation improves.
5853 (delete "--enable-dmeventd" ,flags)))
5854 ((#:phases phases)
5855 #~(modify-phases #$phases
5856 (add-before 'configure 'adjust-Makefile
5857 (lambda _
5858 ;; These fixes are related to the upstream libdm->device_mapper
5859 ;; migration and will hopefully be fixed upstream in due time.
5860 (substitute* "tools/Makefile.in"
5861 ;; This variable is empty in a static configuration and causes
5862 ;; an erroneous GCC command line.
5863 (("-L\\$\\(interfacebuilddir\\)") "")
5864 ;; Remove obsolete reference to libdevmapper.a.
5865 (("-ldevmapper") ""))
5866 #t))
5867 (add-after 'install 'adjust-pkgconfig
5868 ;; The static eudev is missing its pkg config file, and I am not
5869 ;; rebuilding it at this point.
5870 (lambda* (#:key inputs #:allow-other-keys)
5871 (substitute* (string-append #$output "/lib/pkgconfig/devmapper.pc")
5872 (("Requires.private: .*") "")
5873 (("Libs.private:")
5874 (format #f "Libs.private: -L~a -ludev"
5875 (dirname (search-input-file inputs "lib/libudev.a")))))))))))
5876 (synopsis "Logical volume management for Linux (statically linked)")))
5877
5878(define-public thin-provisioning-tools
5879 (package
5880 (name "thin-provisioning-tools")
5881 (version "0.8.5")
5882 (source
5883 (origin
5884 (method git-fetch)
5885 (uri (git-reference
5886 (url "https://github.com/jthornber/thin-provisioning-tools")
5887 (commit (string-append "v" version))))
5888 (file-name (git-file-name name version))
5889 (sha256
5890 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
5891 (build-system gnu-build-system)
5892 (arguments
5893 ;; Doesn't build with --enable-testing due to a function name collision
5894 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
5895 `(#:tests? #f))
5896 (native-inputs
5897 `(("automake" ,automake)
5898 ("autoreconf" ,autoconf)))
5899 (inputs
5900 (list boost expat libaio))
5901 (synopsis "Tools for manipulating the metadata of device-mapper targets")
5902 (description "A suite of tools for manipulating the metadata of the
5903dm-thin, dm-cache and dm-era device-mapper targets.")
5904 (home-page "https://github.com/jthornber/thin-provisioning-tools")
5905 (license license:gpl3+)))
5906
5907(define-public watchdogd
5908 (package
5909 (name "watchdogd")
5910 (version "4.0")
5911 (source (origin
5912 (method git-fetch)
5913 (uri (git-reference
5914 (url "https://github.com/troglobit/watchdogd")
5915 (commit version)))
5916 (file-name (git-file-name name version))
5917 (sha256
5918 (base32
5919 "112mdhqykl78qk8l7nx7h19nnd58v0axj6ws8s47n9a64b867li4"))))
5920 (build-system gnu-build-system)
5921 (native-inputs (list autoconf automake libtool pkg-config))
5922 (inputs (list libconfuse libite libuev))
5923 (synopsis "Advanced system & process supervisor for Linux")
5924 (description "This package provides an advanced monitor of critical system
5925resources, supervises the heartbeat of processes, records deadline
5926transgressions, and initiates a controlled reset if needed.")
5927 (home-page "https://troglobit.com/projects/watchdogd/")
5928 (license license:isc)))
5929
5930(define-public wireless-tools
5931 (package
5932 (name "wireless-tools")
5933 (version "30.pre9")
5934 (source
5935 (origin
5936 (method url-fetch)
5937 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/"
5938 "Linux/wireless_tools." version ".tar.gz"))
5939 (sha256
5940 (base32 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
5941 (snippet
5942 #~(begin
5943 ;; Remove the older header files that are not free software.
5944 (for-each (lambda (n)
5945 (delete-file (format #f "wireless.~a.h" n)))
5946 '(10 11 12 13 14 15 16 17 18 19 20))))))
5947 (build-system gnu-build-system)
5948 (arguments
5949 (list #:make-flags
5950 #~(list (string-append "PREFIX=" #$output)
5951 (string-append "INSTALL_MAN=" #$output "/share/man")
5952 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
5953 "BUILD_STATIC=")
5954 #:phases
5955 #~(modify-phases %standard-phases
5956 (replace 'configure
5957 (lambda* (#:key target #:allow-other-keys)
5958 (when target
5959 ;; Cross-compilation: use the cross tools.
5960 (substitute* (find-files "." "Makefile")
5961 (("CC = .*$")
5962 (string-append "CC = " target "-gcc\n"))
5963 (("AR = .*$")
5964 (string-append "AR = " target "-ar\n"))
5965 (("RANLIB = .*$")
5966 (string-append "RANLIB = " target "-ranlib\n")))))))
5967 #:tests? #f))
5968 (synopsis "Tools for manipulating Linux Wireless Extensions")
5969 (description "Wireless Tools are used to manipulate the now-deprecated
5970Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
5971Extension was an interface allowing you to set Wireless LAN specific
5972parameters and get the specific stats. It is deprecated in favor the nl80211
5973interface.")
5974 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
5975 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
5976 ;; other files are distributed under gpl2.
5977 (license (list license:gpl2 license:lgpl2.1+))))
5978
5979(define-public crda
5980 (package
5981 (name "crda")
5982 (version "4.15")
5983 (source
5984 (origin
5985 (method git-fetch)
5986 (uri (git-reference
5987 (url "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git")
5988 (commit (string-append "v" version))))
5989 (file-name (git-file-name name version))
5990 (sha256
5991 (base32 "1ajh8zx84p15y9wawh764zawniwn059iw9m32v56ajvkz9xbnkp2"))
5992 (patches (search-patches "crda-optional-gcrypt.patch"))))
5993 (build-system gnu-build-system)
5994 (arguments
5995 (list #:phases
5996 #~(modify-phases %standard-phases
5997 (delete 'configure)
5998 (add-after 'unpack 'gzip-deterministically
5999 (lambda _
6000 (substitute* "Makefile"
6001 (("gzip" command)
6002 (string-append command " --no-name")))))
6003 #$@(if (%current-target-system)
6004 #~((add-after 'unpack 'fix-pkg-config
6005 (lambda* (#:key target #:allow-other-keys)
6006 (substitute* "Makefile"
6007 (("pkg-config" command)
6008 (string-append target "-" command))))))
6009 #~())
6010 (add-before 'build 'patch-Makefile
6011 (lambda _
6012 (substitute* "Makefile"
6013 (("ldconfig") "true"))))
6014 (add-before 'build 'set-regulatory-db-file-name
6015 (lambda* (#:key native-inputs inputs #:allow-other-keys)
6016 ;; Tell CRDA where to find our database.
6017 (let ((regdb (assoc-ref (or native-inputs inputs)
6018 "wireless-regdb")))
6019 (substitute* "crda.c"
6020 (("\"/lib/crda/regulatory.bin\"")
6021 (string-append "\"" regdb
6022 "/lib/crda/regulatory.bin\"")))))))
6023 #:test-target "verify"
6024 #:make-flags
6025 #~(list
6026 (string-append "CC=" #$(cc-for-target))
6027 "V=1"
6028
6029 ;; Disable signature-checking on 'regulatory.bin'.
6030 ;; The reason is that this simplifies maintenance
6031 ;; on our side (no need to manage a distro key
6032 ;; pair), and we can guarantee integrity of
6033 ;; 'regulatory.bin' by other means anyway, such as
6034 ;; 'guix gc --verify'. See
6035 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
6036 ;; for a discssion.
6037 "USE_OPENSSL=0"
6038
6039 (string-append "PREFIX=" #$output)
6040 (string-append "SBINDIR=" #$output "/sbin/")
6041 (string-append "UDEV_RULE_DIR="
6042 #$output "/lib/udev/rules.d")
6043 (string-append "LDFLAGS=-Wl,-rpath="
6044 #$output "/lib -L.")
6045 (string-append "REG_BIN="
6046 #$(this-package-native-input "wireless-regdb")
6047 "/lib/crda/regulatory.bin")
6048 "all_noverify")))
6049 (native-inputs (list pkg-config wireless-regdb))
6050 (inputs (list libnl))
6051 (home-page
6052 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
6053 (synopsis "@acronym{CRDA, Central Regulatory Domain Agent} for WiFi")
6054 (description
6055 "The @acronym{CRDA, Central Regulatory Domain Agent} acts as the udev
6056helper for communication between the kernel Linux and user space for regulatory
6057compliance.")
6058 (license license:copyleft-next)))
6059
6060(define-public wireless-regdb
6061 (package
6062 (name "wireless-regdb")
6063 (version "2023.05.03")
6064 (source (origin
6065 (method url-fetch)
6066 (uri (string-append
6067 "mirror://kernel.org/software/network/wireless-regdb/"
6068 "wireless-regdb-" version ".tar.xz"))
6069 (sha256
6070 (base32 "04lc9jp8zxhyqxvkhrm637sswi2xm48jw8jnp3iflnknnf5d0m7j"))
6071
6072 ;; We're building 'regulatory.bin' by ourselves.
6073 (snippet '(begin
6074 (delete-file "regulatory.bin")))))
6075 (build-system gnu-build-system)
6076 (arguments
6077 (list
6078 #:phases
6079 #~(modify-phases %standard-phases
6080 (add-after 'unpack 'gzip-determinism
6081 (lambda _
6082 (substitute* "Makefile"
6083 (("gzip") "gzip --no-name"))))
6084 (add-after 'unpack 'omit-signature
6085 (lambda _
6086 (substitute* "Makefile"
6087 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
6088 ;; don't provide (see below). Disable it.
6089 ((" regulatory\\.db\\.p7s") "")
6090 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
6091 ;; but ‘make install’ depends only on the latter while
6092 ;; installing both (and failing). Depend on it explicitly.
6093 (("^install: " all) (string-append all "regulatory.db ")))))
6094 (delete 'configure)) ; no configure script
6095
6096 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
6097 ;; is computed and can be equal to 'maintainer-clean'; when that
6098 ;; happens, we can end up deleting the 'regulatory.bin' file that we
6099 ;; just built. Thus, build things sequentially.
6100 #:parallel-build? #f
6101
6102 #:tests? #f ; no tests
6103 #:make-flags
6104 #~(list (string-append "PREFIX=" #$output)
6105 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
6106
6107 ;; Leave this empty so that db2bin.py doesn't try to sign
6108 ;; ‘regulatory.bin’. This allows us to avoid managing a key
6109 ;; pair for the whole distribution.
6110 (string-append "REGDB_PRIVKEY=")
6111 ;; Don't generate a public key for the same reason. These are
6112 ;; used as Makefile targets and can't be the empty string.
6113 (string-append "REGDB_PUBCERT=/dev/null")
6114 (string-append "REGDB_PUBKEY=/dev/null"))))
6115 (native-inputs
6116 (list python-wrapper))
6117 (home-page
6118 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
6119 (synopsis "Wireless regulatory database")
6120 (description
6121 "This package contains the wireless regulatory database for the
6122@acronym{CRDA, Central Regulatory Database Agent}. The database contains
6123information on country-specific regulations for the wireless spectrum.")
6124 (license license:isc)))
6125
6126(define-public lm-sensors
6127 (package
6128 (name "lm-sensors")
6129 (version "3.6.2")
6130 (source
6131 (origin
6132 (method git-fetch)
6133 (uri (git-reference
6134 (url "https://github.com/hramrach/lm-sensors")
6135 (commit (string-append "V" (string-join
6136 (string-split version #\.) "-")))))
6137 (file-name (git-file-name name version))
6138 (sha256
6139 (base32 "0p2ck8p9zb1w53l37pvm6c10vi6r8bfz51nd3sdwwsfhfhgvsr0j"))
6140 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
6141 (build-system gnu-build-system)
6142 (outputs '("lib" ; avoid perl in closure
6143 "out"))
6144 (arguments
6145 (list
6146 #:tests? #f ; no 'check' target
6147 #:make-flags
6148 #~(list (string-append "PREFIX=" #$output)
6149 (string-append "ETCDIR=" #$output:lib "/etc")
6150 (string-append "INCLUDEDIR=" #$output:lib "/include")
6151 (string-append "MANDIR=" #$output "/share/man")
6152 (string-append "LIBDIR=" #$output:lib "/lib"))
6153 #:phases
6154 #~(modify-phases %standard-phases
6155 (delete 'configure)
6156 (add-before 'build 'patch-exec-paths
6157 (lambda* (#:key inputs #:allow-other-keys)
6158 (substitute* "prog/detect/sensors-detect"
6159 (("`uname")
6160 (string-append
6161 "`" (assoc-ref inputs "coreutils") "/bin/uname"))
6162 (("(`|\")modprobe" all open-quote)
6163 (string-append
6164 open-quote #$(this-package-input "kmod") "/bin/modprobe")))
6165 (substitute* '("prog/pwm/pwmconfig" "prog/pwm/fancontrol")
6166 (("gnuplot")
6167 (search-input-file inputs "/bin/gnuplot"))
6168 (("cat ")
6169 (string-append (search-input-file inputs "/bin/cat") " "))
6170 (("e?grep " match)
6171 (string-append
6172 (search-input-file
6173 inputs (string-append "/bin/" (string-trim-right match)))
6174 " "))
6175 (("sed -e")
6176 (string-append (search-input-file inputs "/bin/sed") " -e"))
6177 (("cut -d")
6178 (string-append (search-input-file inputs "/bin/cut") " -d"))
6179 (("sleep ")
6180 (string-append (search-input-file inputs "/bin/sleep") " "))
6181 (("readlink -f")
6182 (string-append
6183 (search-input-file inputs "/bin/readlink") " -f"))))))))
6184 (inputs
6185 (list gnuplot kmod perl rrdtool))
6186 (native-inputs
6187 (list bison flex pkg-config which))
6188 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
6189 (synopsis "Utilities to read temperature/voltage/fan sensors")
6190 (description
6191 "Lm-sensors is a hardware health monitoring package for Linux. It allows
6192you to access information from temperature, voltage, and fan speed sensors.
6193It works with most newer systems.")
6194 (license license:gpl2+)))
6195
6196(define-public iucode-tool
6197 (package
6198 (name "iucode-tool")
6199 (version "2.3.1")
6200 (source (origin
6201 (method url-fetch)
6202 (uri (string-append "https://gitlab.com/iucode-tool/releases"
6203 "/raw/latest/iucode-tool_" version ".tar.xz"))
6204 (sha256
6205 (base32
6206 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
6207 (build-system gnu-build-system)
6208 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
6209 (synopsis "Manipulate Intel microcode bundles")
6210 (description
6211 "@command{iucode_tool} is a utility to work with microcode packages for
6212Intel processors. It can convert between formats, extract specific versions,
6213create a firmware image suitable for the Linux kernel, and more.")
6214 ;; cpuid.h is available for i686, x86_64, and ia64.
6215 (supported-systems '("i686-linux" "x86_64-linux"))
6216 (license license:gpl2+)))
6217
6218(define-public i2c-tools
6219 (package
6220 (name "i2c-tools")
6221 (version "4.3")
6222 (source (origin
6223 (method url-fetch)
6224 (uri (string-append
6225 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6226 version ".tar.xz"))
6227 (sha256
6228 (base32
6229 "1y0fphjd5ah2j886x8i175r7viq0hmx666hyca0wi4dzrm290qxk"))))
6230 (build-system gnu-build-system)
6231 (arguments
6232 `(#:tests? #f ; no 'check' target
6233 #:make-flags
6234 ,#~(list (string-append "PREFIX=" #$output)
6235 (string-append "LDFLAGS+=-Wl,-rpath=" #$output "/lib")
6236 (string-append "CC=" #$(cc-for-target)))
6237 ;; No configure script.
6238 #:phases (modify-phases %standard-phases (delete 'configure))))
6239 (inputs
6240 (list perl))
6241 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
6242 (synopsis "I2C tools for Linux")
6243 (description
6244 "The i2c-tools package contains a heterogeneous set of I2C tools for
6245Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
6246EEPROM decoding scripts, EEPROM programming tools, and a python module for
6247SMBus access.")
6248 (license license:gpl2+)))
6249
6250(define-public i2c-tools-3
6251 (package
6252 (inherit i2c-tools)
6253 (name "i2c-tools")
6254 (version "3.1.2")
6255 (source (origin
6256 (method url-fetch)
6257 (uri (string-append
6258 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6259 version ".tar.bz2"))
6260 (sha256
6261 (base32 "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv"))))
6262 (arguments
6263 (substitute-keyword-arguments (package-arguments i2c-tools)
6264 ((#:make-flags _)
6265 #~(list (string-append "prefix=" #$output)
6266 (string-append "CC=" #$(cc-for-target))))))))
6267
6268(define-public python-smbus
6269 (package
6270 (inherit i2c-tools)
6271 (name "python-smbus")
6272 (build-system pyproject-build-system)
6273 (arguments
6274 (list #:tests? #f ;; No test suite.
6275 #:phases
6276 #~(modify-phases %standard-phases
6277 (add-after 'unpack 'change-directory
6278 (lambda _ (chdir "py-smbus")))
6279 (add-after 'change-directory 'set-library-path
6280 (lambda _
6281 (substitute* "setup.py"
6282 (("-L\\.\\./lib")
6283 (string-append "-L" #$(this-package-input "i2c-tools")
6284 "/lib"))))))))
6285 (inputs (list i2c-tools))
6286 (native-inputs (list python-setuptools python-wheel))
6287 (synopsis "I2C/SMBus access for Python")
6288 (description "This package provides a Python library to access
6289@acronym{I2C, Inter-Integrated Circuit} and @acronym{SMBus, System
6290Management Bus} devices on Linux.")))
6291
6292(define-public xsensors
6293 (package
6294 (name "xsensors")
6295 (version "0.70")
6296 (source (origin
6297 (method url-fetch)
6298 (uri (string-append
6299 "http://www.linuxhardware.org/xsensors/xsensors-"
6300 version ".tar.gz"))
6301 (sha256
6302 (base32
6303 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
6304 (build-system gnu-build-system)
6305 (inputs `(("lm-sensors" ,lm-sensors "lib")
6306 ("gtk" ,gtk+-2)))
6307 (native-inputs (list pkg-config))
6308 (arguments
6309 `(#:phases
6310 (modify-phases %standard-phases
6311 (add-before 'configure 'enable-deprecated
6312 (lambda _
6313 (substitute* "src/Makefile.in"
6314 (("-DGDK_DISABLE_DEPRECATED") "")
6315 (("-DGTK_DISABLE_DEPRECATED") ""))
6316 #t))
6317 (add-before 'configure 'remove-Werror
6318 (lambda _
6319 (substitute* '("configure" "src/Makefile.in")
6320 (("-Werror") ""))
6321 #t)))))
6322 (home-page "http://www.linuxhardware.org/xsensors/")
6323 (synopsis "Hardware health information viewer")
6324 (description
6325 "Xsensors reads data from the libsensors library regarding hardware
6326health such as temperature, voltage and fan speed and displays the information
6327in a digital read-out.")
6328 (license license:gpl2+)))
6329
6330(define-public perf
6331 (package
6332 (name "perf")
6333 (version (package-version linux-libre))
6334 (source (package-source linux-libre))
6335 (build-system gnu-build-system)
6336 (arguments
6337 '(#:phases
6338 (modify-phases %standard-phases
6339 (replace 'configure
6340 (lambda* (#:key inputs #:allow-other-keys)
6341 (setenv "SHELL_PATH" (which "bash"))
6342 (chdir "tools/perf")
6343
6344 ;; In Linux 6.10.6, 'Makefile.config' overrides PKG_CONFIG_PATH
6345 ;; when looking for libtraceevent and thus fails to find it.
6346 ;; Remove that.
6347 (substitute* "Makefile.config"
6348 (("PKG_CONFIG_PATH=[[:graph:]]+")
6349 ""))
6350
6351 ;; This file hard-codes file system layouts for specific distros
6352 ;; but not for ours; address that. With this change, one can run
6353 ;; "perf report --symfs=$HOME/.guix-profile" (without
6354 ;; "/lib/debug") and 'perf' should be able to find separate debug
6355 ;; info files.
6356 (substitute* "util/dso.c"
6357 (("/usr/lib/debug")
6358 "/lib/debug")))))
6359 #:make-flags (list (string-append "prefix="
6360 (assoc-ref %outputs "out"))
6361 "CC=gcc"
6362 "WERROR=0"
6363
6364 ;; By default, 'config/Makefile' uses lib64 on
6365 ;; x86_64. Work around that.
6366 "lib=lib")
6367 #:tests? #f)) ;no tests
6368 (native-inputs
6369 (list pkg-config
6370 bison
6371 flex
6372 ;; There are build scripts written in these languages.
6373 perl
6374 python-2
6375 python-3
6376 ;; Documentation
6377 docbook-xsl
6378 xmlto
6379 asciidoc))
6380 (inputs
6381 (list slang ;for the interactive TUI
6382 zlib
6383 ;; newt
6384 python-2 ;'perf' links against libpython
6385 elfutils
6386 libiberty ;used alongside BDF for symbol demangling
6387 libunwind ;better stack walking
6388 libtraceevent
6389 numactl)) ;for 'perf bench numa mem'
6390 (home-page "https://perf.wiki.kernel.org/")
6391 (synopsis "Linux profiling with performance counters")
6392 (description
6393 "perf is a tool suite for profiling using hardware performance counters,
6394with support in the Linux kernel. perf can instrument CPU performance
6395counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
6396of lightweight profiling. This package contains the user-land tools and in
6397particular the @code{perf} command.")
6398 (license (package-license linux-libre))))
6399
6400(define-public pflask
6401 (package
6402 (name "pflask")
6403 (version "0.2")
6404 (source (origin
6405 (method git-fetch)
6406 (uri (git-reference
6407 (url "https://github.com/ghedo/pflask")
6408 (commit (string-append "v" version))))
6409 (file-name (git-file-name name version))
6410 (sha256
6411 (base32
6412 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
6413 (build-system cmake-build-system)
6414 (arguments
6415 '(#:tests? #f)) ; no tests
6416 (home-page "https://ghedo.github.io/pflask/")
6417 (synopsis "Simple tool for creating Linux namespace containers")
6418 (description "pflask is a simple tool for creating Linux namespace
6419containers. It can be used for running a command or even booting an OS inside
6420an isolated container, created with the help of Linux namespaces. It is
6421similar in functionality to chroot, although pflask provides better isolation
6422thanks to the use of namespaces.")
6423 (license license:bsd-2)))
6424
6425(define-public singularity
6426 (package
6427 (name "singularity")
6428 (version "2.6.1")
6429 (source (origin
6430 (method url-fetch)
6431 (uri (string-append "https://github.com/singularityware/singularity/"
6432 "releases/download/" version
6433 "/singularity-" version ".tar.gz"))
6434 (sha256
6435 (base32
6436 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
6437 (modules '((guix build utils)))
6438 (snippet
6439 '(begin
6440 ;; Do not create directories in /var.
6441 (substitute* "Makefile.in"
6442 (("\\$\\(MAKE\\) .*install-data-hook") ""))
6443
6444 ;; The original source overrides PATH so that it points to
6445 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
6446 ;; on Guix System. Leave PATH unchanged so we refer to the
6447 ;; installed Coreutils, grep, etc.
6448 (substitute* "bin/singularity.in"
6449 (("^PATH=.*" all)
6450 (string-append "#" all "\n")))
6451
6452 (substitute* (find-files "libexec/cli" "\\.exec$")
6453 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
6454 _ program)
6455 (string-append "/run/privileged/bin/singularity-"
6456 program "-helper")))
6457
6458 ;; These squashfs mount options are apparently no longer
6459 ;; supported since Linux-libre 5.4.5.
6460 (substitute* "src/lib/image/squashfs/mount.c"
6461 (("\"errors=remount-ro\"")
6462 "NULL"))))))
6463 (build-system gnu-build-system)
6464 (arguments
6465 (list
6466 #:configure-flags #~(list "--localstatedir=/var")
6467 #:phases
6468 #~(modify-phases %standard-phases
6469 (add-after 'unpack 'patch-references
6470 (lambda _
6471 (substitute* "libexec/cli/build.exec.in"
6472 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
6473 (substitute* (append
6474 (find-files "libexec" "functions")
6475 (find-files "libexec/bootstrap-scripts" ".*sh$")
6476 (find-files "libexec/cli" ".*exec$"))
6477 (("\\| grep ")
6478 (string-append "| " (which "grep") " "))
6479 (("egrep ")
6480 (string-append (which "egrep") " "))
6481 ((" sed ")
6482 (string-append " " (which "sed") " ")))))
6483 (add-after 'install 'set-PATH
6484 (lambda _
6485 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
6486 ;; But don't override PATH, so that other tools like zcat and
6487 ;; tar can still be found if they are available.
6488 (let ((coreutils #$(this-package-input "coreutils")))
6489 (wrap-program (string-append #$output "/bin/singularity")
6490 `("PATH" prefix (,(string-append coreutils "/bin"))))
6491 (substitute* (string-append #$output "/bin/run-singularity")
6492 (("/usr/bin/env singularity")
6493 (string-append (which "env") " "
6494 #$output "/bin/singularity")))))))))
6495 (inputs
6496 (list bash-minimal
6497 coreutils
6498 libarchive
6499 python-wrapper
6500 squashfs-tools
6501 zlib))
6502 (home-page "https://singularity.lbl.gov/")
6503 (synopsis "Container platform")
6504 (description "Singularity is a container platform supporting a number of
6505container image formats. It can build SquashFS container images or import
6506existing Docker images. Singularity requires kernel support for container
6507isolation or root privileges.")
6508 (license license:bsd-3)))
6509
6510(define-public python-spython
6511 (package
6512 (name "python-spython")
6513 (version "0.3.13")
6514 (source
6515 (origin
6516 (method url-fetch)
6517 (uri (pypi-uri "spython" version))
6518 (sha256
6519 (base32 "0kly851k6mj7xzcybciav5d0pq5q04pzg7c5a1g712bqbxkha4ck"))))
6520 (build-system pyproject-build-system)
6521 (arguments
6522 (list
6523 #:phases
6524 #~(modify-phases %standard-phases
6525 ;; Configure absolute path to singularity.
6526 (add-after 'unpack 'configure
6527 (lambda* (#:key inputs #:allow-other-keys)
6528 (let ((singularity (search-input-file inputs "bin/singularity")))
6529 (substitute* "spython/utils/terminal.py"
6530 (("software=\"singularity\"")
6531 (string-append "software=\"" singularity "\"")))
6532 (substitute* (list "spython/utils/terminal.py"
6533 "spython/main/help.py"
6534 "spython/main/base/command.py")
6535 (("\\[\"singularity\"")
6536 (string-append "[\"" singularity "\"")))
6537 (substitute* "spython/main/execute.py"
6538 (("shutil.which\\(\"singularity\"\\)")
6539 (string-append "shutil.which(\"" singularity "\")"))))))
6540 ;; Skip tests that require network access.
6541 (add-before 'check 'skip-tests
6542 (lambda _
6543 (delete-file "spython/tests/test_client.py"))))))
6544 (inputs
6545 (list singularity))
6546 (native-inputs
6547 (list python-pytest
6548 python-pytest-runner
6549 python-setuptools
6550 python-wheel))
6551 (home-page "https://github.com/singularityhub/singularity-cli")
6552 (synopsis "Singularity Python client")
6553 (description "@code{python-spython} is a Python library to interact with
6554Singularity containers.")
6555 (license license:mpl2.0)))
6556
6557(define-public libnvme
6558 (package
6559 (name "libnvme")
6560 (version "1.5")
6561 (source (origin
6562 (method git-fetch)
6563 (uri (git-reference
6564 (url "https://github.com/linux-nvme/libnvme.git")
6565 (commit (string-append "v" version))))
6566 (sha256
6567 (base32 "1wq8bw60l090z2kb717wyzk5wz1jrcn31ykdaa7k9pz9w79v0v67"))
6568 (file-name (git-file-name name version))))
6569 (build-system meson-build-system)
6570 (outputs (list "out" "doc")) ; docs are 80% of all output
6571 (arguments
6572 (list
6573 #:configure-flags
6574 #~(let ((doc (string-append #$output:doc "/share/doc/" #$name)))
6575 (list (string-append "-Dhtmldir=" doc "/html")
6576 (string-append "-Drstdir=" doc "/rst")
6577 "-Ddocs-build=true" "-Ddocs=all"))))
6578 (native-inputs (list pkg-config perl python python-sphinx))
6579 ;; libnvme.pc, libnvme-mi.pc lists these in Requires.private.
6580 (propagated-inputs (list dbus json-c openssl))
6581 (home-page "https://github.com/linux-nvme/libnvme")
6582 (synopsis "C Library for NVM Express on Linux")
6583 (description "libnvme provides type definitions for NVMe specification
6584structures, enumerations, and bit fields, helper functions to construct,
6585dispatch, and decode commands and payloads, and utilities to connect, scan,
6586and manage nvme devices on a Linux system.")
6587 (license license:lgpl2.1+)))
6588
6589(define-public nvme-cli
6590 (package
6591 (name "nvme-cli")
6592 (version "2.5")
6593 (home-page "https://github.com/linux-nvme/nvme-cli")
6594 (source (origin
6595 (method git-fetch)
6596 (uri (git-reference
6597 (url home-page)
6598 (commit (string-append "v" version))))
6599 (sha256
6600 (base32 "1jv1xir6gm86yyk5846qqkcjhc1bq103zyxf794fznyinh4nhlbg"))
6601 (file-name (git-file-name name version))))
6602 (build-system meson-build-system)
6603 (outputs (list "out" "doc")) ; docs make up ~70% of total size
6604 (arguments
6605 (list
6606 #:configure-flags #~(list (format #f "-Dhtmldir=~a/share/doc/~a/html"
6607 #$output:doc #$name)
6608 "-Ddocs=all")))
6609 (native-inputs (list pkg-config))
6610 (inputs (list libnvme json-c zlib))
6611 (synopsis "NVM-Express user space tooling for Linux")
6612 (description "Nvme-cli is a utility to provide standards compliant tooling
6613for NVM-Express drives. It was made specifically for Linux as it relies on the
6614IOCTLs defined by the mainline kernel driver.")
6615 (license license:gpl2+)))
6616
6617(define-public rfkill
6618 (package
6619 (name "rfkill")
6620 (version "0.5")
6621 (source (origin
6622 (method url-fetch)
6623 (uri (string-append "mirror://kernel.org/software/network/"
6624 name "/" name "-" version ".tar.xz"))
6625 (sha256
6626 (base32
6627 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
6628 (build-system gnu-build-system)
6629 (arguments
6630 `(#:make-flags (list "CC=gcc"
6631 (string-append "PREFIX=" %output))
6632 #:phases (modify-phases %standard-phases
6633 (delete 'configure))
6634 #:tests? #f))
6635 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
6636 (synopsis "Tool for enabling and disabling wireless devices")
6637 (description
6638 "rfkill is a simple tool for accessing the rfkill device interface,
6639which is used to enable and disable wireless networking devices, typically
6640WLAN, Bluetooth and mobile broadband.")
6641 (license (license:non-copyleft "file://COPYING"
6642 "See COPYING in the distribution."))
6643 ;; rfkill is part of util-linux as of 2.31.
6644 (properties `((superseded . ,util-linux)))))
6645
6646(define-public acpi
6647 (package
6648 (name "acpi")
6649 (version "1.7")
6650 (source (origin
6651 (method url-fetch)
6652 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
6653 version "/" name "-" version ".tar.gz"))
6654 (sha256
6655 (base32
6656 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
6657 (build-system gnu-build-system)
6658 (home-page "http://acpiclient.sourceforge.net")
6659 (synopsis "Display information on ACPI devices")
6660 (description "@code{acpi} attempts to replicate the functionality of the
6661\"old\" @code{apm} command on ACPI systems, including battery and thermal
6662information. It does not support ACPI suspending, only displays information
6663about ACPI devices.")
6664 (license license:gpl2+)))
6665
6666(define-public acpid
6667 (package
6668 (name "acpid")
6669 (version "2.0.34")
6670 (source (origin
6671 (method url-fetch)
6672 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
6673 version ".tar.xz"))
6674 (sha256
6675 (base32
6676 "0cxkdbd087kj9ikprvvjpk0ixzqbipf2rmj6qyp7r15wzj65q29d"))))
6677 (build-system gnu-build-system)
6678 (home-page "https://sourceforge.net/projects/acpid2/")
6679 (synopsis "Daemon for delivering ACPI events to user-space programs")
6680 (description
6681 "acpid is designed to notify user-space programs of Advanced
6682Configuration and Power Interface (ACPI) events. acpid should be started
6683during the system boot, and will run as a background process. When an ACPI
6684event is received from the kernel, acpid will examine the list of rules
6685specified in /etc/acpi/events and execute the rules that match the event.")
6686 (license license:gpl2+)))
6687
6688(define-public sysfsutils
6689 (package
6690 (name "sysfsutils")
6691 (version "2.1.0")
6692 (source
6693 (origin
6694 (method url-fetch)
6695 (uri
6696 (string-append
6697 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
6698 version ".tar.gz"))
6699 (sha256
6700 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
6701 (build-system gnu-build-system)
6702 (home-page "https://linux-diag.sourceforge.net/Sysfsutils.html")
6703 (synopsis "System utilities based on Linux sysfs")
6704 (description
6705 "These are a set of utilities built upon sysfs, a virtual file system in
6706Linux kernel versions 2.5+ that exposes a system's device tree. The package
6707also contains the libsysfs library.")
6708 ;; The library is under lgpl2.1+ (all files say "or any later version").
6709 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
6710 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
6711
6712(define-public cpufrequtils
6713 (let ((commit "a2f0c39d5f21596bb9f5223e895c0ff210b265d0")
6714 (revision "1"))
6715 (package
6716 (name "cpufrequtils")
6717 (version (git-version "008" revision commit ))
6718 (source
6719 (origin
6720 (method git-fetch)
6721 (uri
6722 (git-reference
6723 (url "https://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpufrequtils.git")
6724 (commit commit)))
6725 (file-name (git-file-name name version))
6726 (sha256
6727 (base32 "01n2hp6v89cilqqvqvlcprphyhnljsjclh4h1zf3b1l7ypz29lbp"))))
6728 (build-system gnu-build-system)
6729 (arguments
6730 `(#:tests? #f ; no test suite
6731 #:make-flags
6732 (let ((out (assoc-ref %outputs "out")))
6733 (list "PROC=false" ; obsoleted by sysfs in Linux 2.6(!)
6734 (string-append "CC=" ,(cc-for-target))
6735 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
6736 "INSTALL=install"
6737 (string-append "bindir=" out "/bin")
6738 (string-append "sbindir=" out "/sbin")
6739 (string-append "mandir=" out "/share/man")
6740 (string-append "includedir=" out "/include")
6741 (string-append "libdir=" out "/lib")
6742 (string-append "localedir=" out "/share/locale")
6743 (string-append "docdir=" out "/share/doc/" ,name)))
6744 #:phases
6745 (modify-phases %standard-phases
6746 (delete 'configure)))) ; no configure script
6747 (native-inputs
6748 `(("gettext" ,gettext-minimal)))
6749 (home-page
6750 "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
6751 (synopsis "Utilities to get and set CPU frequency on Linux")
6752 (description
6753 "The cpufrequtils suite contains utilities to retrieve CPU frequency
6754information, and set the CPU frequency if supported, using the cpufreq
6755capabilities of the Linux kernel.")
6756 (license license:gpl2))))
6757
6758(define-public libite
6759 (package
6760 (name "libite")
6761 (version "2.5.2")
6762 (source
6763 (origin
6764 (method git-fetch)
6765 (uri (git-reference
6766 (url "https://github.com/troglobit/libite")
6767 (commit (string-append "v" version))))
6768 (file-name (git-file-name name version))
6769 (sha256
6770 (base32 "0i27ppb557kdc1hm7nf0f5r7sxvqma31pr57h79whl6qcp28gy4a"))))
6771 (build-system gnu-build-system)
6772 (arguments
6773 `(#:configure-flags
6774 (list "--disable-static")
6775 #:phases
6776 (modify-phases %standard-phases
6777 (add-after 'unpack 'fix-tests
6778 (lambda* (#:key inputs #:allow-other-keys)
6779 ;; replace paths to the executables
6780 (substitute* "test/which.c"
6781 (("/usr/bin/which")
6782 (search-input-file inputs "/bin/which"))
6783 (("ls\"")
6784 (string-append
6785 (search-input-file inputs "/bin/ls") "\"")))
6786 ;; create pidfile in /tmp instead of /var
6787 (substitute* "test/pidfile.c" (("/var/tmp") "/tmp")))))))
6788 (native-inputs (list autoconf automake libtool which))
6789 (synopsis "Library providing missing pieces in GNU libc")
6790 (description "This package provides many of the missing pieces in GNU
6791libc. Most notably the string functions: strlcpy(3), strlcat(3) and the *BSD
6792sys/queue.h and sys/tree.h API's.")
6793 (home-page "https://troglobit.com/projects/libite/")
6794 (license license:expat)))
6795
6796(define-public libuev
6797 (package
6798 (name "libuev")
6799 (version "2.4.0")
6800 (source
6801 (origin
6802 (method git-fetch)
6803 (uri (git-reference
6804 (url "https://github.com/troglobit/libuev")
6805 (commit (string-append "v" version))))
6806 (file-name (git-file-name name version))
6807 (sha256
6808 (base32
6809 "0ih82lxfdcq179kknzdl5c8vi1l0n5j7yh68y8f6kwsrm457paf7"))))
6810 (build-system gnu-build-system)
6811 (native-inputs (list autoconf automake libtool))
6812 (synopsis "Lightweight event loop library for epoll family APIs")
6813 (description "This package provides small event loop that wraps the
6814epoll family of APIs.")
6815 (home-page "https://troglobit.com/projects/libuev/")
6816 (license license:expat)))
6817
6818(define-public libraw1394
6819 (package
6820 (name "libraw1394")
6821 (version "2.1.2")
6822 (source (origin
6823 (method url-fetch)
6824 (uri (string-append
6825 "mirror://kernel.org/linux/libs/ieee1394/"
6826 name "-" version ".tar.xz"))
6827 (sha256
6828 (base32
6829 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
6830 (build-system gnu-build-system)
6831 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
6832 (synopsis "Interface library for the Linux IEEE1394 drivers")
6833 (description
6834 "Libraw1394 is the only supported interface to the kernel side raw1394 of
6835the Linux IEEE-1394 subsystem, which provides direct access to the connected
68361394 buses to user space. Through libraw1394/raw1394, applications can directly
6837send to and receive from other nodes without requiring a kernel driver for the
6838protocol in question.")
6839 (license license:lgpl2.1+)))
6840
6841(define-public libavc1394
6842 (package
6843 (name "libavc1394")
6844 (version "0.5.4")
6845 (source (origin
6846 (method url-fetch)
6847 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
6848 name "-" version ".tar.gz"))
6849 (sha256
6850 (base32
6851 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
6852 (build-system gnu-build-system)
6853 (native-inputs
6854 (list pkg-config))
6855 (propagated-inputs
6856 (list libraw1394)) ; required by libavc1394.pc
6857 (home-page "https://sourceforge.net/projects/libavc1394/")
6858 (synopsis "AV/C protocol library for IEEE 1394")
6859 (description
6860 "Libavc1394 is a programming interface to the AV/C specification from
6861the 1394 Trade Association. AV/C stands for Audio/Video Control.")
6862 (license license:lgpl2.1+)))
6863
6864(define-public libiec61883
6865 (package
6866 (name "libiec61883")
6867 (version "1.2.0")
6868 (source (origin
6869 (method url-fetch)
6870 (uri (string-append
6871 "mirror://kernel.org/linux/libs/ieee1394/"
6872 name "-" version ".tar.xz"))
6873 (sha256
6874 (base32
6875 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
6876 (build-system gnu-build-system)
6877 (native-inputs
6878 (list pkg-config))
6879 (propagated-inputs
6880 (list libraw1394)) ; required by libiec61883.pc
6881 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
6882 (synopsis "Isochronous streaming media library for IEEE 1394")
6883 (description
6884 "The libiec61883 library provides a higher level API for streaming DV,
6885MPEG-2 and audio over Linux IEEE 1394.")
6886 (license license:lgpl2.1+)))
6887
6888(define-public mdadm
6889 (package
6890 (name "mdadm")
6891 (version "4.2")
6892 (source (origin
6893 (method url-fetch)
6894 (uri (string-append
6895 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
6896 version ".tar.xz"))
6897 (sha256
6898 (base32
6899 "07ghmibmbnkdy91ng87zdllzicm299l20dhs9m5bfjw6f1b22726"))))
6900 (build-system gnu-build-system)
6901 (arguments
6902 (list #:make-flags
6903 #~(list (string-append "CC=" #$(cc-for-target))
6904 "INSTALL=install"
6905 "CHECK_RUN_DIR=0"
6906 ;; TODO: tell it where to find 'sendmail'
6907 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
6908 (string-append "BINDIR=" #$output "/sbin")
6909 (string-append "MANDIR=" #$output "/share/man")
6910 (string-append "UDEVDIR=" #$output "/lib/udev"))
6911 #:phases
6912 #~(modify-phases %standard-phases
6913 (add-before 'build 'patch-program-paths
6914 (lambda* (#:key native-inputs inputs #:allow-other-keys)
6915 (let ((coreutils (assoc-ref (or native-inputs inputs)
6916 "coreutils")))
6917 (substitute* "udev-md-raid-arrays.rules"
6918 (("/usr/bin/(readlink|basename)" all program)
6919 (string-append coreutils "/bin/" program))))))
6920 (add-before 'build 'remove-W-error
6921 (lambda _
6922 ;; We cannot build with -Werror on i686 due to a
6923 ;; 'sign-compare' warning in util.c.
6924 (substitute* "Makefile"
6925 (("-Werror") ""))))
6926 (delete 'configure))
6927 ;; Tests must be run as root.
6928 #:tests? #f))
6929 (inputs
6930 (list eudev))
6931 (supported-systems (remove target-hurd? %supported-systems))
6932 (home-page "http://neil.brown.name/blog/mdadm")
6933 (synopsis "Tool for managing Linux Software RAID arrays")
6934 (description
6935 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
6936assemble, report on, and monitor arrays. It can also move spares between raid
6937arrays when needed.")
6938 (license license:gpl2+)))
6939
6940(define-public mdadm-static
6941 (package
6942 (inherit mdadm)
6943 (name "mdadm-static")
6944 (arguments
6945 (substitute-keyword-arguments (package-arguments mdadm)
6946 ((#:make-flags flags)
6947 #~(cons* "LDFLAGS = -static"
6948 "CXFLAGS = -DNO_LIBUDEV"
6949 #$flags))
6950 ((#:phases phases)
6951 #~(modify-phases #$phases
6952 (add-after 'install 'remove-cruft
6953 (lambda* (#:key outputs #:allow-other-keys)
6954 (let* ((out (assoc-ref outputs "out"))
6955 (precious? (lambda (file)
6956 (member file '("." ".." "sbin"))))
6957 (directories (scandir out (negate precious?))))
6958 (with-directory-excursion out
6959 (for-each delete-file-recursively directories)
6960 (remove-store-references "sbin/mdadm")
6961 (delete-file "sbin/mdmon")))))))
6962 ((#:modules modules %default-gnu-modules)
6963 `((ice-9 ftw) ,@modules))
6964 ((#:strip-flags _ '())
6965 ''("--strip-all")) ;strip a few extra KiB
6966 ((#:allowed-references _ '("out"))
6967 '("out")))) ;refer only self
6968 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
6969
6970(define-public multipath-tools
6971 (package
6972 (name "multipath-tools")
6973 (version "0.11.0")
6974 (home-page "https://github.com/opensvc/multipath-tools")
6975 (source (origin
6976 (method git-fetch)
6977 (uri (git-reference (url home-page) (commit version)))
6978 (file-name (git-file-name name version))
6979 (sha256
6980 (base32
6981 "1yl2cd4xgw2l5xzx5dbdf7awhrvfbjsrspli9i6bmxc5j4jkvazr"))
6982 (modules '((guix build utils)))
6983 (snippet
6984 '(begin
6985 ;; Drop bundled valgrind headers.
6986 (delete-file-recursively "third-party")
6987 (substitute* '("multipathd/main.c"
6988 "libmpathutil/debug.c")
6989 (("#include \"../third-party/")
6990 "#include \""))))))
6991 (build-system gnu-build-system)
6992 (arguments
6993 (list
6994 #:test-target "test"
6995 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
6996 (string-append "prefix=" #$output)
6997 ;; Install Udev rules below this directory, relative
6998 ;; to the prefix.
6999 (string-append "systemd_prefix=" #$output))
7000 #:phases
7001 #~(modify-phases %standard-phases
7002 (add-after 'unpack 'patch-source
7003 (lambda* (#:key inputs #:allow-other-keys)
7004 (let ((libdevmapper.h
7005 (search-input-file inputs "include/libdevmapper.h"))
7006 (libudev.h
7007 (search-input-file inputs "include/libudev.h")))
7008 (substitute* "Makefile.inc"
7009 (("/bin/echo") "echo")
7010 (("\\$\\(prefix\\)/usr") "$(prefix)")
7011 (("configdir.*:= \\$\\(prefix\\)/etc/multipath/conf.d")
7012 "configdir := /etc/multipath/conf.d")
7013 ;; Do not save timestamp to avoid gzip "timestamp
7014 ;; out-of-range" warnings.
7015 (("gzip -9") "gzip -9n"))
7016 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
7017 (("/usr/include/libdevmapper.h") libdevmapper.h)
7018 (("/usr/include/libudev.h") libudev.h)))))
7019 (add-after 'unpack 'skip-failing-tests
7020 (lambda _
7021 ;; This test and the module's setup() test an arbitrary block
7022 ;; device node name, but the build environment has none.
7023 (substitute* "tests/devt.c"
7024 (("return get_one_devt.*") "return 0;\n")
7025 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
7026 ;; The above triggers -Werror=unused-function. Ignore it.
7027 (substitute* "tests/Makefile"
7028 (("CFLAGS \\+= " match)
7029 (string-append match "-Wno-error=unused-function ")))))
7030 (delete 'configure) ;no configure script
7031 (add-before 'build 'no-fortify-3
7032 (lambda _
7033 ;; NOTE: The check made seems to wrongly assume the
7034 ;; FORTIFY_SOURCE=3 is valid. However, when compiling, warnings
7035 ;; are emitted from glibc, resulting in failed build. Fix this
7036 ;; by forcing the usage of FORTIFY_SOURCE=2.
7037 (substitute* "create-config.mk"
7038 (("FORTIFY_SOURCE=3")
7039 "FORTIFY_SOURCE=2"))))
7040 (add-before 'build 'set-LDFLAGS
7041 (lambda _
7042 ;; Note: this cannot be passed as a make flag because that will
7043 ;; override the build system LDFLAGS.
7044 (setenv "LDFLAGS"
7045 (string-append "-Wl,-rpath=" #$output "/lib")))))))
7046
7047 (native-inputs
7048 (list perl pkg-config valgrind/pinned
7049 ;; For tests.
7050 cmocka))
7051 (inputs
7052 (list json-c
7053 libaio
7054 liburcu
7055 lvm2
7056 readline
7057 eudev
7058 ;; For libmount.
7059 `(,util-linux "lib")))
7060 (synopsis "Access block devices through multiple paths")
7061 (description
7062 "This package provides the following binaries to drive the
7063Linux Device Mapper multipathing driver:
7064@enumerate
7065@item @command{multipath} - Device mapper target autoconfig.
7066@item @command{multipathd} - Multipath daemon.
7067@item @command{mpathpersist} - Manages SCSI persistent reservations on
7068@code{dm} multipath devices.
7069@item @command{kpartx} - Create device maps from partition tables.
7070@end enumerate")
7071 (license (list license:gpl2+ ;main distribution
7072 license:lgpl2.0+)))) ;libmpathcmd/mpath_cmd.h
7073
7074(define-public libaio
7075 (package
7076 (name "libaio")
7077 (version "0.3.113")
7078 (source (origin
7079 (method url-fetch)
7080 (uri (list
7081 (string-append "https://releases.pagure.org/libaio/"
7082 name "-" version ".tar.gz")))
7083 (sha256
7084 (base32
7085 "02r0g2vfv6kfljplm3ga93w4xw13q2wixbn9hwi7ahqdzp2x2i1c"))
7086 (patches (search-patches "libaio-32bit-test.patch"))))
7087 (build-system gnu-build-system)
7088 (arguments
7089 (list #:make-flags
7090 #~(list (string-append "prefix=" #$output)
7091 (string-append "CC=" #$(cc-for-target)))
7092 #:test-target "partcheck" ; need root for a full 'check'
7093 #:phases
7094 #~(modify-phases %standard-phases
7095 (add-after 'unpack 'disable-problematic-tests
7096 (lambda _
7097 (with-directory-excursion "harness/cases"
7098 ;; The 21.t test fails with "Expected 4096, got
7099 ;; 18446744073709551605" (see:
7100 ;; https://pagure.io/libaio/issue/26).
7101 (rename-file "21.t" "21.t.disabled"))))
7102 (delete 'configure) ; no configure script
7103 #$@(if (target-riscv64?)
7104 #~((add-after 'unpack 'patch-test
7105 (lambda* (#:key build-inputs #:allow-other-keys)
7106 (invoke "patch" "-p1" "-i"
7107 #$(local-file
7108 (search-patch
7109 "libaio-riscv-test5.patch"))))))
7110 #~()))))
7111 (native-inputs
7112 (if (target-riscv64?)
7113 (list (search-patch "libaio-riscv-test5.patch")
7114 patch)
7115 '()))
7116 (home-page "https://pagure.io/libaio")
7117 (synopsis "Linux-native asynchronous I/O access library")
7118 (description
7119 "This library enables userspace to use Linux kernel asynchronous I/O
7120system calls, important for the performance of databases and other advanced
7121applications.")
7122 (license license:lgpl2.1+)))
7123
7124(define-public blktrace
7125 ;; Take a newer commit to get the latest patches.
7126 (let ((commit "b9ea6e507e8849f01d06aa48c0c59c5cee4820be")
7127 (revision "1"))
7128 (package
7129 (name "blktrace")
7130 (version (git-version "1.3.0" revision commit))
7131 (home-page
7132 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
7133 (source (origin
7134 (method git-fetch)
7135 (uri (git-reference
7136 (url home-page)
7137 (commit commit)))
7138 (sha256
7139 (base32 "0a4830mlqckbhchar1xcn2w4f24bzb75bigdig5wpm2axl0zc8cq"))
7140 (file-name (git-file-name name version))))
7141 (build-system gnu-build-system)
7142 (arguments
7143 (list #:make-flags
7144 #~(list (string-append "CC=" #$(cc-for-target))
7145 (string-append "prefix=" #$output))
7146 #:tests? #f ; no tests
7147 #:phases
7148 #~(modify-phases %standard-phases
7149 (delete 'configure) ; no configure script
7150 (add-after 'unpack 'fix-gnuplot-path
7151 (lambda* (#:key inputs #:allow-other-keys)
7152 (let ((gnuplot (assoc-ref inputs "gnuplot")))
7153 (substitute* "btt/bno_plot.py"
7154 (("gnuplot %s")
7155 (string-append gnuplot "/bin/gnuplot %s")))))))))
7156 (inputs
7157 `(("libaio" ,libaio)
7158 ("gnuplot" ,gnuplot)
7159 ("python" ,python-wrapper))) ;for 'bno_plot.py'
7160 (synopsis "Block layer IO tracing mechanism")
7161 (description "Blktrace is a block layer IO tracing mechanism which provides
7162detailed information about request queue operations to user space. It extracts
7163event traces from the kernel (via the relaying through the debug file system).")
7164 (license license:gpl2))))
7165
7166(define-public sbc
7167 (package
7168 (name "sbc")
7169 (version "1.5")
7170 (source (origin
7171 (method url-fetch)
7172 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
7173 version ".tar.xz"))
7174 (patches (search-patches "sbc-fix-build-non-x86.patch"))
7175 (sha256
7176 (base32
7177 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
7178 (build-system gnu-build-system)
7179 (inputs
7180 (list libsndfile))
7181 (native-inputs
7182 (list pkg-config))
7183 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
7184 (synopsis "Bluetooth subband audio codec")
7185 (description
7186 "The SBC is a digital audio encoder and decoder used to transfer data to
7187Bluetooth audio output devices like headphones or loudspeakers.")
7188 (license license:gpl2+)))
7189
7190(define-public bluez
7191 (package
7192 (name "bluez")
7193 (version "5.79")
7194 (source (origin
7195 (method url-fetch)
7196 (uri (string-append
7197 "mirror://kernel.org/linux/bluetooth/bluez-"
7198 version ".tar.xz"))
7199 (sha256
7200 (base32
7201 "12pal1m4xlr8k7kxb6isv5lbaca2wc5zcgy0907wfwcz78qaar21"))))
7202 (build-system gnu-build-system)
7203 (arguments
7204 (list
7205 #:configure-flags
7206 #~(list "--sysconfdir=/etc"
7207 "--localstatedir=/var"
7208 "--enable-library"
7209 "--enable-wiimote"
7210 "--disable-systemd"
7211 ;; TODO: is this needed? Not installed by default since 5.55.
7212 "--enable-hid2hci"
7213 ;; Install dbus/udev files to the correct location.
7214 (string-append "--with-dbusconfdir=" #$output "/etc")
7215 (string-append "--with-udevdir=" #$output "/lib/udev"))
7216 #:phases
7217 #~(modify-phases %standard-phases
7218 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
7219 ;; issue (discussion on upstream mailing list:
7220 ;; https://marc.info/?t=149578476300002&r=1&w=2)
7221 (add-before 'check 'skip-wonky-test
7222 (lambda _
7223 (substitute* "unit/test-gatt.c"
7224 (("tester_init\\(&argc, &argv\\);") "return 77;"))))
7225 (replace 'install
7226 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
7227 ;; Override the sysconfdir and localstatedir locations only for
7228 ;; the installation phase. Otherwise, the installation fails when
7229 ;; it tries to write to /etc/bluetooth and /var.
7230 (define make-flags*
7231 (append make-flags (list (string-append "sysconfdir="
7232 #$output "/etc")
7233 (string-append "localstatedir="
7234 #$output "/var"))))
7235 (apply (assoc-ref %standard-phases 'install)
7236 (append args (list #:make-flags make-flags*)))))
7237 (add-after 'install 'post-install
7238 (lambda* (#:key inputs outputs #:allow-other-keys)
7239 (let* ((servicedir (string-append #$output
7240 "/share/dbus-1/services"))
7241 (service "obexd/src/org.bluez.obex.service")
7242 (rule (string-append
7243 #$output "/lib/udev/rules.d/97-hid2hci.rules")))
7244 ;; Install the obex dbus service file.
7245 (substitute* service
7246 (("/bin/false")
7247 (string-append #$output "/libexec/bluetooth/obexd")))
7248 (install-file service servicedir)
7249 ;; Fix paths in the udev rule.
7250 (substitute* rule
7251 (("hid2hci --method")
7252 (string-append #$output "/lib/udev/hid2hci --method"))
7253 (("/sbin/udevadm")
7254 (search-input-file inputs "/bin/udevadm")))))))))
7255 (native-inputs
7256 (list gettext-minimal
7257 pkg-config
7258 python
7259 python-docutils
7260 python-pygments))
7261 (inputs
7262 (list glib dbus eudev libical readline))
7263 (home-page "https://www.bluez.org/")
7264 (synopsis "Linux Bluetooth protocol stack")
7265 (description
7266 "BlueZ provides support for the core Bluetooth layers and protocols. It
7267is flexible, efficient and uses a modular implementation.")
7268 (license license:gpl2+)))
7269
7270(define-public fuse-exfat
7271 (package
7272 (name "fuse-exfat")
7273 (version "1.4.0")
7274 (source (origin
7275 (method url-fetch)
7276 (uri (string-append
7277 "https://github.com/relan/exfat/releases/download/v"
7278 version "/" name "-" version ".tar.gz"))
7279 (sha256
7280 (base32
7281 "07h0ngnydfy8n8h9ni3jn8zlmcj4pzqa0nk0hk0i4yhfbv2yvkx1"))))
7282 (build-system gnu-build-system)
7283 (native-inputs
7284 (list pkg-config))
7285 (inputs
7286 (list fuse-2))
7287 (home-page "https://github.com/relan/exfat")
7288 (synopsis "Mount exFAT file systems")
7289 (description
7290 "This package provides a FUSE-based file system that provides read and
7291write access to exFAT devices.")
7292 (license license:gpl2+)))
7293
7294(define-public fuseiso
7295 (package
7296 (name "fuseiso")
7297 (version "20070708")
7298 (source (origin
7299 (method url-fetch)
7300 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
7301 version "/fuseiso-" version ".tar.bz2"))
7302 (sha256
7303 (base32
7304 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
7305 (build-system gnu-build-system)
7306 (native-inputs
7307 (list pkg-config))
7308 (inputs
7309 (list fuse-2 glib zlib))
7310 (home-page "https://sourceforge.net/projects/fuseiso/")
7311 (synopsis "Mount ISO file system images")
7312 (description
7313 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
7314.bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
7315Ridge, Joliet, and zisofs.")
7316 (license license:gpl2)))
7317
7318(define-public gpm
7319 (package
7320 (name "gpm")
7321 (version "1.20.7")
7322 (source (origin
7323 (method url-fetch)
7324 (uri (string-append
7325 "https://www.nico.schottelius.org/software/gpm/archives/"
7326 "gpm-" version ".tar.bz2"))
7327 (patches (search-patches "gpm-glibc-2.26.patch"))
7328 (sha256
7329 (base32
7330 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
7331 (modules '((guix build utils)))
7332 (snippet
7333 '(begin
7334 ;; Take a patch from upstream to fix building with -fno-common,
7335 ;; which is default in GCC 10:
7336 ;; https://github.com/telmich/gpm/pull/37
7337 (substitute* "src/headers/daemon.h"
7338 (("^time_t[[:blank:]]+last_selection_time;")
7339 "extern time_t last_selection_time;"))))))
7340 (build-system gnu-build-system)
7341 (arguments
7342 '(#:phases (modify-phases %standard-phases
7343 (replace 'bootstrap
7344 (lambda _
7345 ;; The tarball was not generated with 'make dist' so we
7346 ;; need to bootstrap things ourselves.
7347 (substitute* "autogen.sh"
7348 (("/bin/sh") (which "sh")))
7349 (invoke "./autogen.sh")
7350 (patch-makefile-SHELL "Makefile.include.in")
7351 #t)))
7352
7353 ;; Make sure programs find libgpm.so.
7354 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
7355 (assoc-ref %outputs "out")
7356 "/lib"))))
7357 (native-inputs
7358 (list texinfo
7359 bison
7360 flex
7361 autoconf
7362 automake
7363 libtool))
7364 (home-page "https://www.nico.schottelius.org/software/gpm/")
7365 (synopsis "Mouse support for the Linux console")
7366 (description
7367 "The GPM (general-purpose mouse) daemon is a mouse server for
7368applications running on the Linux console. It allows users to select items
7369and copy/paste text in the console and in xterm.")
7370 (license license:gpl2+)))
7371
7372(define-public btrfs-progs
7373 (package
7374 (name "btrfs-progs")
7375 (version "6.16")
7376 (source (origin
7377 (method url-fetch)
7378 (uri (string-append "mirror://kernel.org/linux/kernel/"
7379 "people/kdave/btrfs-progs/" "btrfs-progs-v"
7380 version ".tar.xz"))
7381 (sha256
7382 (base32
7383 "1ibg8qrsxzw4qjnsl5da1qz10m1zv3yx2jxd4jl1h9kwfgw31a9i"))))
7384 (build-system gnu-build-system)
7385 (outputs '("out" "static")) ;static versions of the binaries in "out"
7386 (arguments
7387 (list
7388 #:configure-flags
7389 #~(list
7390 ;; Without --disable-documentation, it complains about missing
7391 ;; python-sphinx on systems where this package isn't available
7392 ;; (because it requires Rust).
7393 #$@(if (member (%current-system)
7394 (package-transitive-supported-systems
7395 python-sphinx))
7396 '()
7397 '("--disable-documentation"))
7398 ;; The ‘Python support’ was never actually installed by previous
7399 ;; versions of this package, but did prevent cross-compilation.
7400 "--disable-python")
7401 #:phases #~(modify-phases %standard-phases
7402 (add-after 'unpack 'patch-makefile
7403 (lambda* (#:key outputs #:allow-other-keys)
7404 (substitute* "Makefile"
7405 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
7406 (string-append (assoc-ref outputs "out")
7407 "/lib/udev/rules.d")))))
7408 (add-after 'build 'build-static
7409 (lambda _
7410 (invoke "make" "static")))
7411 (add-after 'install 'install-bash-completion
7412 (lambda* (#:key outputs #:allow-other-keys)
7413 (let* ((out (assoc-ref outputs "out"))
7414 (bashcomp (string-append out
7415 "/etc/bash_completion.d")))
7416 (mkdir-p bashcomp)
7417 (copy-file "btrfs-completion"
7418 (string-append bashcomp "/btrfs")))))
7419 (add-after 'install 'install-static
7420 (let ((staticbin (string-append (assoc-ref %outputs
7421 "static")
7422 "/bin")))
7423 (lambda _
7424 (invoke "make"
7425 (string-append "bindir=" staticbin)
7426 "install-static")))))
7427 #:tests? #f ;XXX: require the 'btrfs' kernel module.
7428 #:test-target "test"
7429 #:parallel-tests? #f)) ;tests fail when run in parallel
7430 (inputs (list e2fsprogs ;for btrfs-convert
7431 eudev
7432 lzo
7433 `(,util-linux "lib") ;for libblkid and libuuid
7434 `(,util-linux "static") ;ditto
7435 zlib
7436 `(,zlib "static")
7437 `(,zstd "lib")
7438 `(,zstd "static")))
7439 (native-inputs
7440 (append
7441 ;; For building documentation. Since python-sphinx requires Rust, add
7442 ;; it conditionally depending on such support.
7443 (if (supported-package? python-sphinx)
7444 (list python-wrapper python-sphinx python-sphinx-rtd-theme)
7445 '())
7446 (list pkg-config
7447 acl ;for tests
7448 lvm2 ;for dmsetup
7449 grep ;need Perl regexp support
7450 libaio
7451 liburing
7452 util-linux ;for fallocate
7453 which)))
7454 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
7455 (synopsis "Create and manage btrfs copy-on-write file systems")
7456 (description
7457 "Btrfs is a @acronym{CoW, copy-on-write} file system for Linux
7458aimed at implementing advanced features while focusing on fault tolerance,
7459repair and easy administration.")
7460 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
7461 ;; GPL2: Everything else.
7462 (license (list license:gpl2 license:gpl2+))))
7463
7464(define-public btrfs-progs/static
7465 (package
7466 (name "btrfs-progs-static")
7467 (version (package-version btrfs-progs))
7468 (source #f)
7469 (build-system trivial-build-system)
7470 (inputs
7471 `(("btrfs-progs:static" ,btrfs-progs "static")))
7472 (arguments
7473 `(#:modules ((guix build utils))
7474 #:builder
7475 (begin
7476 (use-modules (guix build utils)
7477 (ice-9 ftw)
7478 (srfi srfi-26))
7479
7480 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
7481 (out (assoc-ref %outputs "out"))
7482 (source (string-append btrfs "/bin/btrfs.static"))
7483 (target (string-append out "/bin/btrfs")))
7484 (mkdir-p (dirname target))
7485 (copy-file source target)
7486 (remove-store-references target)
7487 (chmod target #o555)
7488 #t))))
7489 (home-page (package-home-page btrfs-progs))
7490 (synopsis "Statically-linked btrfs command from btrfs-progs")
7491 (description "This package provides the statically-linked @command{btrfs}
7492from the btrfs-progs package. It is meant to be used in initrds.")
7493 (license (package-license btrfs-progs))))
7494
7495(define-public cramfs-tools
7496 (package
7497 (name "cramfs-tools")
7498 (home-page "https://github.com/npitre/cramfs-tools")
7499 (version "2.1")
7500 (source (origin
7501 (method git-fetch)
7502 (uri (git-reference
7503 (url home-page)
7504 (commit (string-append "v" version))))
7505 (sha256
7506 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
7507 (file-name (git-file-name name version))))
7508 (build-system gnu-build-system)
7509 (arguments
7510 '(#:tests? #f ; No tests.
7511 #:phases
7512 (modify-phases %standard-phases
7513 (delete 'configure)
7514 (replace 'install
7515 (lambda* (#:key outputs #:allow-other-keys)
7516 (let ((out (assoc-ref outputs "out")))
7517 (install-file "mkcramfs" (string-append out "/sbin"))
7518 (install-file "cramfsck" (string-append out "/sbin")))
7519 #t)))))
7520 (inputs
7521 (list zlib))
7522 (synopsis "Tools to manage Cramfs file systems")
7523 (description "Cramfs is a Linux file system designed to be simple, small,
7524and to compress things well. It is used on a number of embedded systems and
7525small devices. This version has additional features such as uncompressed
7526blocks and random block placement.")
7527 (license license:gpl2+)))
7528
7529(define-public compsize
7530 (let ((commit "d79eacf77abe3b799387bb8a4e07a18f1f1031e8")
7531 (revision "0"))
7532 (package
7533 (name "compsize")
7534 (version (git-version "1.5" revision commit))
7535 (home-page "https://github.com/kilobyte/compsize")
7536 (source (origin
7537 (method git-fetch)
7538 (uri (git-reference
7539 (url home-page)
7540 (commit commit)))
7541 (sha256
7542 (base32 "02fvgy12m50rg1snp555a1kc3cm01g2imb81cih7ikhkbjbca0d7"))
7543 (file-name (git-file-name name version))
7544 (patches
7545 (search-patches "compsize-fix-btrfs-progs-compatibility.patch"))))
7546 (build-system gnu-build-system)
7547 (inputs
7548 (list btrfs-progs))
7549 (arguments
7550 `(#:tests? #f ; No tests.
7551 #:make-flags
7552 (list (string-append "CC=" ,(cc-for-target)))
7553 #:phases
7554 (modify-phases %standard-phases
7555 (delete 'configure)
7556 (replace 'install
7557 (lambda* (#:key outputs #:allow-other-keys)
7558 (let ((out (assoc-ref outputs "out")))
7559 (install-file "compsize" (string-append out "/bin"))
7560 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
7561 (synopsis "Find compression type/ratio on Btrfs files")
7562 (description "@command{compsize} takes a list of files (given as
7563arguments) on a Btrfs file system and measures used compression types and
7564effective compression ratio, producing a report.
7565
7566A directory has no extents but has a (recursive) list of files. A non-regular
7567file is silently ignored.
7568
7569As it makes no sense to talk about compression ratio of a partial extent,
7570every referenced extent is counted whole, exactly once -- no matter if you use
7571only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
7572uncompressed size will not match the number given by @command{tar} or
7573@command{du}. On the other hand, the space used should be accurate (although
7574obviously it can be shared with files outside our set).")
7575 (license license:gpl2+))))
7576
7577(define-public f2fs-tools
7578 (package
7579 (name "f2fs-tools")
7580 (version "1.16.0")
7581 (source (origin
7582 (method git-fetch)
7583 (uri (git-reference
7584 (url "https://git.kernel.org/pub/scm/linux/kernel\
7585/git/jaegeuk/f2fs-tools.git")
7586 (commit (string-append "v" version))))
7587 (file-name (git-file-name name version))
7588 (sha256
7589 (base32
7590 "0832ix3jnmfagx53wr6clc3q4ay7cbashfj7jirk01gyzwbvblfc"))))
7591 (build-system gnu-build-system)
7592 (native-inputs
7593 (list autoconf automake libtool pkg-config))
7594 (inputs
7595 (list `(,util-linux "lib"))) ;for libuuid
7596 (home-page "https://f2fs.wiki.kernel.org/")
7597 (synopsis "Userland tools for f2fs")
7598 (description
7599 "F2FS, the Flash-Friendly File System, is a modern file system
7600designed to be fast and durable on flash devices such as solid-state
7601disks and SD cards. This package provides the userland utilities.")
7602 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
7603 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
7604 (license (list license:gpl2 license:lgpl2.1))))
7605
7606(define-public f2fs-tools-1.7
7607 (package
7608 (inherit f2fs-tools)
7609 (name "f2fs-tools")
7610 (version "1.7.0")
7611 (source (origin
7612 (method git-fetch)
7613 (uri (git-reference
7614 (url (git-reference-url
7615 (origin-uri (package-source f2fs-tools))))
7616 (commit (string-append "v" version))))
7617 (file-name (git-file-name name version))
7618 (sha256
7619 (base32
7620 "0wpzklw8smnngng0dm25jdmi7v5zfhpz02dksyxpz0a7kzzvnqqm"))))
7621 (inputs
7622 (list `(,util-linux "lib") libselinux))
7623 (arguments
7624 '(#:configure-flags '("CFLAGS=-fcommon")
7625 #:phases
7626 (modify-phases %standard-phases
7627 (add-after 'install 'install-headers
7628 (lambda* (#:key outputs #:allow-other-keys)
7629 (let* ((out (assoc-ref outputs "out"))
7630 (out-include (string-append out "/include")))
7631 (install-file "include/f2fs_fs.h" out-include)
7632 (install-file "mkfs/f2fs_format_utils.h" out-include)))))))))
7633
7634(define-public f2fs-tools/static
7635 (static-package
7636 (package
7637 (inherit f2fs-tools)
7638 (name "f2fs-tools-static")
7639 (arguments
7640 `(#:configure-flags
7641 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
7642 (libuuid (assoc-ref %build-inputs "libuuid")))
7643 (list
7644 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
7645 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
7646 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
7647 "-I" libuuid "/include/blkid")
7648 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
7649 #:disallowed-references (,(this-package-input "libuuid"))
7650 #:make-flags '("LDFLAGS=-all-static")
7651 #:phases
7652 (modify-phases %standard-phases ; TODO: f2fs phases.
7653 (add-after 'install 'remove-store-references
7654 (lambda* (#:key outputs #:allow-other-keys)
7655 ;; Work around bug in our util-linux.
7656 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
7657 (remove-store-references (string-append (assoc-ref outputs "out")
7658 "/sbin/mkfs.f2fs"))
7659 #t)))))
7660 (inputs
7661 `(("libuuid:static" ,util-linux "static")
7662 ("libuuid" ,util-linux "lib")))))) ; for include files
7663
7664(define-public f2fs-fsck/static
7665 (package
7666 (name "f2fs-fsck-static")
7667 (version (package-version f2fs-tools/static))
7668 (source #f)
7669 (build-system trivial-build-system)
7670 (arguments
7671 `(#:modules ((guix build utils))
7672 #:builder
7673 (begin
7674 (use-modules (guix build utils)
7675 (ice-9 ftw)
7676 (srfi srfi-26))
7677 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
7678 (fsck "fsck.f2fs")
7679 (out (assoc-ref %outputs "out"))
7680 (sbin (string-append out "/sbin")))
7681 (mkdir-p sbin)
7682 (with-directory-excursion sbin
7683 (install-file (string-append f2fs-tools "/sbin/" fsck)
7684 ".")
7685 (remove-store-references fsck)
7686 (chmod fsck #o555))
7687 #t))))
7688 (inputs
7689 (list f2fs-tools/static))
7690 (home-page (package-home-page f2fs-tools/static))
7691 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
7692 (description "This package provides statically-linked fsck.f2fs command taken
7693from the f2fs-tools package. It is meant to be used in initrds.")
7694 (license (package-license f2fs-tools/static))))
7695
7696(define-public freefall
7697 (package
7698 (name "freefall")
7699 (version (package-version linux-libre))
7700 (source (package-source linux-libre))
7701 (build-system gnu-build-system)
7702 (arguments
7703 '(#:phases (modify-phases %standard-phases
7704 (add-after 'unpack 'enter-subdirectory
7705 (lambda _
7706 (chdir "tools/laptop/freefall")
7707 #t))
7708 (delete 'configure)
7709 (add-before 'build 'increase-timeout
7710 (lambda _
7711 ;; The default of 2 seconds is too low: it assumes an
7712 ;; open lid and AC power without actually checking.
7713 (substitute* "freefall.c"
7714 (("alarm\\(2\\)") "alarm(5)"))
7715 #t)))
7716 #:make-flags (list (string-append "PREFIX="
7717 (assoc-ref %outputs "out"))
7718 "CC=gcc")
7719 #:tests? #f)) ;no tests
7720 (home-page (package-home-page linux-libre))
7721 (synopsis "Free-fall protection for spinning laptop hard drives")
7722 (description
7723 "Prevents shock damage to the internal spinning hard drive(s) of some
7724HP and Dell laptops. When sudden movement is detected, all input/output
7725operations on the drive are suspended and its heads are parked on the ramp,
7726where they are less likely to cause damage to the spinning disc. Requires a
7727drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
7728feature, and a laptop with an accelerometer. It has no effect on SSDs.")
7729 (license license:gpl2)))
7730
7731
7732(define-public nbfc-linux
7733 (let ((version "0.1.7")
7734 (commit "4c2b75e4a875459e86a9892319889ff945e9cadf")
7735 (revision "0"))
7736 (package
7737 (name "nbfc-linux")
7738 (version (git-version version revision commit))
7739 (source (origin
7740 (method git-fetch)
7741 (uri (git-reference
7742 (url "https://github.com/nbfc-linux/nbfc-linux")
7743 (commit commit)))
7744 (file-name (git-file-name name version))
7745 (sha256
7746 (base32
7747 "0mmyfaigrh3fd5v11a8p38km4m02qzsfx8yh72g0z405bzhqn5jk"))))
7748 (build-system gnu-build-system)
7749 (arguments
7750 `(#:make-flags (list (string-append "CC="
7751 ,(cc-for-target))
7752 (string-append "PREFIX="
7753 (assoc-ref %outputs "out")))
7754 #:tests? #f
7755 #:phases (modify-phases %standard-phases
7756 (delete 'configure))))
7757 (native-inputs (list pkg-config))
7758 (propagated-inputs (list python dmidecode))
7759 (synopsis "NoteBook FanControl ported to Linux")
7760 (description
7761 "This package provides a C port of NoteBook FanControl (NBFC), a fan
7762control service for notebooks. It provides the same utilities with the same
7763interfaces as the original NBFC, although the implementation differs.")
7764 (home-page "https://github.com/nbfc-linux/nbfc-linux")
7765 (license license:gpl3+))))
7766
7767(define-public thinkfan
7768 (package
7769 (name "thinkfan")
7770 (version "2.0.0")
7771 (source
7772 (origin
7773 (method git-fetch)
7774 (uri (git-reference
7775 (url "https://github.com/vmatare/thinkfan")
7776 (commit version)))
7777 (file-name (git-file-name name version))
7778 (sha256
7779 (base32 "1jdjqdbv0m7yf9g4rxs7nq1ldh2b81a7qx4vcf9lzw7jwlydd822"))))
7780 (build-system cmake-build-system)
7781 (arguments
7782 (list
7783 #:modules '((guix build cmake-build-system)
7784 (guix build utils)
7785 (srfi srfi-26))
7786 #:tests? #f ; no test target
7787 #:configure-flags
7788 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
7789 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
7790 ;; inefficient’.
7791 #~(list "-DUSE_ATASMART:BOOL=ON")
7792 #:phases
7793 #~(modify-phases %standard-phases
7794 (add-after 'unpack 'create-init-scripts
7795 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
7796 ;; systemd to patch and install their service files. Fake their
7797 ;; presence rather than duplicating the build system below. Leave
7798 ;; things like ‘/bin/kill’ because they're not worth a dependency.
7799 ;; The sysvinit needs manual patching, but since upstream doesn't
7800 ;; even provide the option to install it: don't.
7801 (lambda _
7802 (substitute* "CMakeLists.txt"
7803 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
7804 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
7805 ;; That was easy! Now we just need to fix the destinations.
7806 (("/etc" directory)
7807 (string-append #$output directory))))))))
7808 (native-inputs
7809 (list pkg-config))
7810 (inputs
7811 `(("libatasmart" ,libatasmart)
7812 ("lm-sensors" ,lm-sensors "lib")
7813 ("yaml-cpp" ,yaml-cpp)))
7814 (home-page "https://github.com/vmatare/thinkfan")
7815 (synopsis "Simple fan control program")
7816 (description
7817 "Thinkfan is a simple fan control program. It reads temperatures,
7818checks them against configured limits and switches to appropriate (also
7819pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
7820other @code{hwmon} driver that enables temperature reading and fan control
7821from userspace.")
7822 (license license:gpl3+)))
7823
7824(define-public tpacpi-bat
7825 (package
7826 (name "tpacpi-bat")
7827 (version "3.2")
7828 (source
7829 (origin
7830 (method git-fetch)
7831 (uri (git-reference
7832 (url "https://github.com/teleshoes/tpacpi-bat")
7833 (commit (string-append "v" version))))
7834 (file-name (git-file-name name version))
7835 (sha256
7836 (base32 "0nd8s2bqbhl0sjpflphb4l9ix71p7kvnbvkq4dg9a1v0sxafyygm"))))
7837 (build-system gnu-build-system)
7838 (arguments
7839 `(#:tests? #f ; no test target
7840 #:phases
7841 (modify-phases %standard-phases
7842 (add-after 'unpack 'refer-to-inputs
7843 (lambda* (#:key inputs #:allow-other-keys)
7844 (substitute* "tpacpi-bat"
7845 (("cat ")
7846 (string-append (search-input-file inputs "bin/cat") " "))
7847 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
7848 ;; loaded. That's the administrator's prerogative; disable it.
7849 (("system \"(modprobe .*)\"" _ match)
7850 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))))
7851 (delete 'configure) ; nothing to configure
7852 (delete 'build) ; nothing to build
7853 (replace 'install
7854 (lambda* (#:key outputs #:allow-other-keys)
7855 (let* ((out (assoc-ref outputs "out"))
7856 (bin (string-append out "/bin"))
7857 (doc (string-append out "/share/doc/" ,name "-" ,version)))
7858 (install-file "tpacpi-bat" bin)
7859
7860 ;; There's no man page. Install other forms of documentation.
7861 (for-each (lambda (file)
7862 (let ((target (string-append doc "/" file)))
7863 (mkdir-p (dirname target))
7864 (copy-recursively file target)))
7865 (list "battery_asl" "examples" "README.md"))))))))
7866 (inputs
7867 (list coreutils-minimal
7868 perl))
7869 (home-page "https://github.com/teleshoes/tpacpi-bat")
7870 (synopsis "ThinkPad battery charge controller")
7871 (description
7872 "Tpacpi-bat is a command-line interface to control battery charging on
7873@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
7874ThinkPad models released after 2011}, starting with the xx20 series. It can
7875query and set the thresholds at which one or both batteries will start and stop
7876charging, inhibit charging batteries for a set period of time, or force them to
7877discharge when they otherwise would not.
7878
7879This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
7880kernel module provided by the @code{acpi-call-linux-module} package, which must
7881be installed and loaded separately. Only the original vendor firmware is
7882supported.")
7883 (license license:gpl3+)))
7884
7885(define-public tmon
7886 (package
7887 (name "tmon")
7888 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
7889 (version (package-version linux-libre))
7890 (source (package-source linux-libre))
7891 (build-system gnu-build-system)
7892 (arguments
7893 (list
7894 #:tests? #f ; no test suite
7895 #:make-flags
7896 #~(list (string-append "CC=" #$(cc-for-target))
7897 (string-append "INSTALL_ROOT=" #$output)
7898 "BINDIR=bin")
7899 #:phases
7900 #~(modify-phases %standard-phases
7901 (add-after 'unpack 'enter-subdirectory
7902 (lambda _
7903 (chdir "tools/thermal/tmon")))
7904 (add-after 'install 'install-man-page
7905 (lambda _
7906 (let ((man8 (string-append #$output "/share/man/man8")))
7907 (install-file "tmon.8" man8))))
7908 (delete 'configure)))) ; no configure script
7909 (inputs
7910 (list ncurses))
7911 (home-page (package-home-page linux-libre))
7912 (synopsis "Monitor and test the Linux thermal subsystem in real time")
7913 (description
7914 "Tmon is a tool to interact with the complex thermal subsystem of the
7915kernel Linux. It helps visualize thermal relationships and real-time thermal
7916data, tune and test cooling devices and sensors, and collect thermal data for
7917further analysis.
7918
7919As computers become smaller and more thermally constrained, more sensors are
7920added and new cooling capabilities introduced. Thermal relationships can change
7921dynamically. Their complexity grows exponentially among cooling devices, zones,
7922sensors, and trip points.
7923
7924Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
7925of symbolic links, trip point bindings, and device instances. To traverse it
7926by hand is no trivial task: @command{tmon} aims to make it understandable.")
7927 (license (list license:gpl2 ; the man page
7928 license:gpl2+)))) ; the actual rest
7929
7930(define-public turbostat
7931 (package
7932 (name "turbostat")
7933 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
7934 ;; make it harder to benefit from ‘free’ linux-libre package updates.
7935 (version (package-version linux-libre))
7936 (source (package-source linux-libre))
7937 (build-system gnu-build-system)
7938 (arguments
7939 (list
7940 #:tests? #f ;no test suite
7941 #:make-flags
7942 #~(list (string-append "CC=" #$(cc-for-target))
7943 (string-append "PREFIX=" #$output))
7944 #:phases
7945 #~(modify-phases %standard-phases
7946 (add-after 'unpack 'enter-subdirectory
7947 (lambda _
7948 (chdir "tools/power/x86/turbostat")))
7949 (delete 'configure)))) ;no configure script
7950 (inputs
7951 (list libcap))
7952 (supported-systems '("i686-linux" "x86_64-linux"))
7953 (home-page (package-home-page linux-libre))
7954 (synopsis "Report x86 processor frequency and idle statistics")
7955 (description
7956 "Turbostat reports x86 processor topology, frequency, idle power state
7957statistics, temperature, and power consumption. Some information is unavailable
7958on older processors.
7959
7960It can be used to identify machines that are inefficient in terms of power usage
7961or idle time, report the rate of @acronym{SMI, system management interrupt}s
7962occurring on the system, or verify the effects of power management tuning.
7963
7964@command{turbostat} reads hardware counters but doesn't write to them, so it
7965won't interfere with the OS or other running processes---including multiple
7966invocations of itself.")
7967 (license license:gpl2)))
7968
7969(define-public ntfs-3g
7970 (package
7971 (name "ntfs-3g")
7972 (version "2022.10.3")
7973 (source (origin
7974 (method url-fetch)
7975 (uri (string-append "https://tuxera.com/opensource/"
7976 "ntfs-3g_ntfsprogs-" version ".tgz"))
7977 (sha256
7978 (base32
7979 "030pakw3h1z6p8phdbyb0hw0bb868znvrri96rg88jq7d3p3c3pj"))
7980 (modules '((guix build utils)))
7981 (snippet '(begin
7982 ;; Install under $prefix.
7983 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
7984 (("/sbin")
7985 "@sbindir@"))))))
7986 (build-system gnu-build-system)
7987 (inputs (list util-linux ; libuuid
7988 fuse-2))
7989 (native-inputs (list pkg-config))
7990 (arguments
7991 '(#:configure-flags (list "--disable-static"
7992 "--disable-ldconfig" ;not necessary
7993 "--exec-prefix=${prefix}"
7994 "--with-fuse=external" ;use our own FUSE
7995 "--enable-mount-helper"
7996 "--enable-posix-acls"
7997 "--enable-xattr-mappings")
7998 #:phases
7999 (modify-phases %standard-phases
8000 ;; If users install ntfs-3g, they probably want to make it the
8001 ;; default driver as well, so we opt for sensible defaults and link
8002 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
8003 ;; mount NTFS file systems.)
8004 (add-after 'install 'install-link
8005 (lambda* (#:key outputs #:allow-other-keys)
8006 (let* ((out (assoc-ref outputs "out"))
8007 (sbin (string-append out "/sbin")))
8008 (symlink "mount.ntfs-3g"
8009 (string-append sbin "/mount.ntfs"))))))))
8010 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
8011 (synopsis "Read-write access to NTFS file systems")
8012 (description
8013 "NTFS-3G provides read-write access to NTFS file systems, which are
8014commonly found on Microsoft Windows. It is implemented as a FUSE file system.
8015The package provides additional NTFS tools.")
8016 (properties
8017 '((release-monitoring-url . "https://github.com/tuxera/ntfs-3g/releases")
8018 (upstream-name . "ntfs-3g_ntfsprogs")))
8019 (license license:gpl2+)))
8020
8021(define-public ntfs-3g/static
8022 (static-package
8023 (package
8024 (inherit ntfs-3g)
8025 (name "ntfs-3g-static")
8026 (arguments
8027 (substitute-keyword-arguments (package-arguments ntfs-3g)
8028 ((#:configure-flags flags)
8029 `(append ,flags
8030 (list "--enable-really-static"
8031 ;; The FUSE driver isn't currently used by our initrd.
8032 "--disable-ntfs-3g")))
8033 ((#:phases phases)
8034 `(modify-phases ,phases
8035 (add-after 'unpack 'make-really-static-really-static
8036 (lambda _
8037 (substitute* "ntfsprogs/Makefile.in"
8038 ((" -static") " -all-static"))))
8039 (delete 'install-link))))))))
8040
8041(define-public ntfsfix/static
8042 (package
8043 (name "ntfsfix-static")
8044 (version (package-version ntfs-3g/static))
8045 (source #f)
8046 (build-system trivial-build-system)
8047 (arguments
8048 `(#:modules ((guix build utils))
8049 #:builder
8050 (begin
8051 (use-modules (guix build utils))
8052 (let* ((ntfs-3g (assoc-ref %build-inputs "ntfs-3g"))
8053 (out (assoc-ref %outputs "out"))
8054 (bin (string-append out "/bin")))
8055 (install-file (string-append ntfs-3g "/bin/ntfsfix") bin)
8056 (with-directory-excursion bin
8057 (remove-store-references "ntfsfix"))))))
8058 (inputs
8059 `(("ntfs-3g" ,ntfs-3g/static)))
8060 (home-page (package-home-page ntfs-3g/static))
8061 (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
8062 (description
8063 "This package provides a statically linked @command{ntfsfix} taken
8064from the ntfs-3g package. It is meant to be used in initrds.")
8065 (license (package-license ntfs-3g/static))))
8066
8067(define-public rdma-core
8068 (package
8069 (name "rdma-core")
8070 (version "60.0")
8071 (source (origin
8072 (method url-fetch)
8073 (uri (string-append "https://github.com/linux-rdma/rdma-core"
8074 "/releases/download/v" version "/rdma-core-"
8075 version ".tar.gz"))
8076 (sha256
8077 (base32
8078 "1pi8jf1pibfhh3ps2kvj2y8y6yahpw7jjyp0mpxmvama9qp8j6wv"))))
8079 (build-system cmake-build-system)
8080 (arguments
8081 `(#:tests? #f ;no tests
8082
8083 ;; Upstream uses the "ninja" build system and encourage distros
8084 ;; to do the same for consistency.
8085 #:generator "Ninja"
8086 #:configure-flags (list ,@(if (%current-target-system)
8087 `((string-append
8088 "-DPKG_CONFIG_EXECUTABLE="
8089 (search-input-file
8090 %build-inputs
8091 (string-append "/bin/"
8092 ,(pkg-config-for-target)))))
8093 '())
8094 (string-append "-DRST2MAN_EXECUTABLE="
8095 (search-input-file
8096 %build-inputs "/bin/rst2man.py")))))
8097 (native-inputs
8098 (list pkg-config python-wrapper python-docutils-0.19)) ;for 'rst2man'
8099 (inputs
8100 (list libnl eudev))
8101 (home-page "https://github.com/linux-rdma/rdma-core")
8102 (synopsis "Utilities and libraries for working with RDMA devices")
8103 (description
8104 "This package provides userspace components for the InfiniBand
8105subsystem of the Linux kernel. Specifically it contains userspace
8106libraries for the following device nodes:
8107
8108@enumerate
8109@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
8110@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
8111@item @file{/dev/infiniband/umadX} (@code{libibumad})
8112@end enumerate
8113
8114The following service daemons are also provided:
8115@enumerate
8116@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
8117@item @code{iwpmd} (for iWARP kernel providers)
8118@item @code{ibacm} (for InfiniBand communication management assistant)
8119@end enumerate")
8120 ;; All library code is dual licensed under GPL2 and a custom MIT
8121 ;; variant. The package also includes some components covered by
8122 ;; other licenses. Consult COPYING.md for full details.
8123 (license
8124 (list license:gpl2
8125 (license:x11-style "See COPYING.BSD_MIT in the distribution")
8126 license:bsd-2 ; Files referring to COPYING.BSD_FB
8127 license:cc0 ; most files in ccan/
8128 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
8129
8130(define-public perftest
8131 (package
8132 (name "perftest")
8133 (version "4.5-0.20")
8134 (home-page "https://github.com/linux-rdma/perftest")
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 "1hrpzmkz1kq4jwpy6b5fl8073iy7dllcq2hfzdw6waaf5920vd64"))))
8143 (build-system gnu-build-system)
8144 (native-inputs
8145 (list autoconf automake libtool))
8146 (inputs (list pciutils rdma-core))
8147 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
8148 (description "This is a collection of tests written over uverbs intended
8149for use as a performance micro-benchmark. The tests may be used for hardware
8150or software tuning as well as for functional testing.
8151
8152The collection contains a set of bandwidth and latency benchmark such as:
8153@enumerate
8154@item Send - @code{ib_send_bw} and @code{ib_send_lat}
8155@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
8156@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
8157@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
8158@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
8159@end enumerate")
8160 (license license:gpl2)))
8161
8162(define-public rng-tools
8163 (package
8164 (name "rng-tools")
8165 (home-page "https://github.com/nhorman/rng-tools")
8166 (version "6.17")
8167 (source (origin
8168 (method git-fetch)
8169 (uri (git-reference (url home-page)
8170 (commit (string-append "v" version))))
8171 (file-name (git-file-name name version))
8172 (sha256
8173 (base32
8174 "0vvqi9ha4jbk4086x2q98p4ip3z56sfdpyckdyknsd36zhp6z8n2"))
8175 (patches
8176 (search-patches "rng-tools-revert-build-randstat.patch"))
8177 (patch-flags '("-p0"))))
8178 (build-system gnu-build-system)
8179 (arguments
8180 (list
8181 ;; Disable support for various hardware entropy sources as they need
8182 ;; dependencies that are not yet in Guix, and would significantly
8183 ;; increase closure size.
8184 #:configure-flags #~(list "--without-nistbeacon"
8185 "--without-pkcs11"
8186 "--without-rtlsdr"
8187 "--without-qrypt")
8188 #:phases
8189 #~(modify-phases %standard-phases
8190 (add-before 'check 'disable-failing-test
8191 (lambda _
8192 (substitute* "tests/Makefile"
8193 ;; This test requires a hwrng, rdrand, or tpm device.
8194 ;; Worse, it appears to fail if that isn't sufficiently random.
8195 (("\\brngtestjitter\\.sh\\b") " ")))))))
8196 (native-inputs
8197 (list autoconf automake pkg-config))
8198 (inputs
8199 (list libcap sysfsutils openssl))
8200 (synopsis "Random number generator daemon")
8201 (description
8202 "Monitor a hardware random number generator, and supply entropy
8203from that to the system kernel's @file{/dev/random} machinery.")
8204 ;; The source package is offered under the GPL2+, but the files
8205 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
8206 (license (list license:gpl2 license:gpl2+))))
8207
8208(define-public cpupower
8209 (package
8210 (name "cpupower")
8211 (version (package-version linux-libre))
8212 (source (package-source linux-libre))
8213 (build-system gnu-build-system)
8214 (arguments
8215 (list #:make-flags
8216 #~(list "CC=gcc"
8217 (string-append "DESTDIR=" #$output)
8218 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
8219 "docdir=/share/doc/cpupower" ;drop default ‘packages/’
8220 "confdir=$(docdir)/examples"
8221 ;; The Makefile recommends the following changes.
8222 "DEBUG=false"
8223 "[email protected]")
8224 #:tests? #f ; no tests
8225 #:phases
8226 #~(modify-phases %standard-phases
8227 (add-after 'unpack 'enter-subdirectory
8228 (lambda _
8229 (chdir "tools/power/cpupower")))
8230 (delete 'configure) ; no configure script
8231 (add-before 'build 'fix-makefiles
8232 (lambda _
8233 (substitute* "Makefile"
8234 (("/usr/") "/")
8235 (("/bin/(install)" _ command) command))
8236 (substitute* "bench/Makefile"
8237 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))))
8238 (native-inputs (list gettext-minimal
8239 which)) ;to find gettext
8240 (inputs (list pciutils))
8241 (home-page (package-home-page linux-libre))
8242 (synopsis "CPU frequency and voltage scaling tools for Linux")
8243 (description
8244 "cpupower is a set of user-space tools that use the cpufreq feature of the
8245Linux kernel to retrieve and control processor features related to power saving,
8246such as frequency and voltage scaling.")
8247 (license license:gpl2)))
8248
8249(define-public x86-energy-perf-policy
8250 (package
8251 (name "x86-energy-perf-policy")
8252 (version (package-version linux-libre))
8253 (source (package-source linux-libre))
8254 (build-system gnu-build-system)
8255 (arguments
8256 '(#:tests? #f
8257 #:phases
8258 (modify-phases %standard-phases
8259 (add-after 'unpack 'enter-subdirectory
8260 (lambda _
8261 (chdir "tools/power/x86/x86_energy_perf_policy")
8262 #t))
8263 (delete 'configure)
8264 (add-before 'build 'fix-makefile
8265 (lambda _
8266 (substitute* "Makefile" (("/usr") ""))
8267 #t)))
8268 #:make-flags
8269 (let ((out (assoc-ref %outputs "out")))
8270 (list (string-append "DESTDIR=" out)
8271 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
8272 (supported-systems '("i686-linux" "x86_64-linux"))
8273 (home-page (package-home-page linux-libre))
8274 (synopsis "Display and update Intel-CPU energy-performance policy")
8275 (description
8276 "@command{x86_energy_perf_policy} displays and updates energy-performance
8277policy settings specific to Intel Architecture Processors. Settings are
8278accessed via Model Specific Register (MSR) updates, no matter if the Linux
8279cpufreq sub-system is enabled or not.")
8280 (license license:gpl2)))
8281
8282(define-public haveged
8283 (package
8284 (name "haveged")
8285 (version "1.9.19")
8286 (source
8287 (origin
8288 (method git-fetch)
8289 (uri (git-reference
8290 (url "https://github.com/jirka-h/haveged")
8291 (commit (string-append "v" version))))
8292 (file-name (git-file-name name version))
8293 (sha256
8294 (base32 "1qka68dlfz9z3gjfvfwvh60l2121c1yx0z264jqsf2vjp5f0xbmn"))))
8295 (build-system gnu-build-system)
8296 (arguments
8297 `(#:configure-flags
8298 (list "--disable-static")))
8299 (home-page "https://www.issihosts.com/haveged")
8300 (synopsis "Entropy source for the Linux random number generator")
8301 (description
8302 "haveged generates an unpredictable stream of random numbers for use by
8303Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
8304standard mechanisms for filling the entropy pool may not be sufficient for
8305systems with high needs or limited user interaction, such as headless servers.
8306
8307@command{haveged} runs as a privileged daemon, harvesting randomness from the
8308indirect effects of hardware events on hidden processor state using the
8309@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
8310It tunes itself to its environment and provides the same built-in test suite
8311for the output stream as used on certified hardware security devices.
8312
8313The quality of the randomness produced by this algorithm has not been proven.
8314It is recommended to run it together with another entropy source like rngd, and
8315not as a replacement for it.")
8316 (license (list (license:non-copyleft "file://nist/mconf.h")
8317 (license:non-copyleft "file://nist/packtest.c")
8318 license:public-domain ; nist/dfft.c
8319 license:gpl3+)))) ; everything else
8320
8321(define-public hotspot
8322 ;; Use the latest git commit as it includes unreleased fixes for the test
8323 ;; suite.
8324 (let ((commit "5cec69301a3f34ada86ce9fe01a9538b04b3cf7c")
8325 (revision "0"))
8326 (package
8327 (name "hotspot")
8328 (version (git-version "1.5.1" revision commit))
8329 (source (origin
8330 (method git-fetch)
8331 (uri (git-reference
8332 (url "https://github.com/KDAB/hotspot")
8333 (commit commit)
8334 ;; Include the bundled perfparser and PrefixTickLabels
8335 ;; libraries, which are to be used in source form.
8336 (recursive? #t)))
8337 (file-name (git-file-name name version))
8338 (sha256
8339 (base32
8340 "115gskjdcb1q3mgrnv1qcdrhxabjzl1hhkpk1klk67ayicsk1ym6"))))
8341 (build-system qt-build-system)
8342 (arguments
8343 (list
8344 ;; As mentioned in the option help text, the KAuth helper cannot be
8345 ;; installed to a custom prefix and the build fails with "file cannot
8346 ;; create directory: /polkit-1/actions. Maybe need administrative"
8347 ;; (see: https://bugs.kde.org/show_bug.cgi?id=363678).
8348 #:configure-flags #~(list "-DINSTALL_KAUTH_HELPER=OFF"
8349 "-DQT6_BUILD=ON")
8350 #:qtbase qtbase
8351 ;; The 'tst_models' and 'tst_callgraphgenerator' fail, with
8352 ;; the later seemingly requiring sudo or access to the kernel
8353 ;; trace points.
8354 #:test-exclude
8355 (string-append
8356 "("
8357 (string-join
8358 ;; The 'tst_models' expected output doesn't exactly
8359 ;; match.
8360 '("tst_models"
8361 ;; The 'tst_callgraphgenerator' perf invocation
8362 ;; fails when run in the build container.
8363 "tst_callgraphgenerator"
8364 ;; The 'tst_perfparser' test requires sudo/access
8365 ;; to the kernel scheduler trace points.
8366 "tst_perfparser")
8367 "|")
8368 ")")
8369 #:phases
8370 #~(modify-phases %standard-phases
8371 (add-after 'unpack 'patch-perfparser
8372 ;; XXX: This phase is copied from qt-creator: keep them in sync!
8373 (lambda* (#:key inputs #:allow-other-keys)
8374 ;; perfparser attempts to dynamically load the demangle
8375 ;; libraries; use their absolute file name to avoid having to
8376 ;; set LD_LIBRARY_PATH.
8377 (let ((librustc_demangle.so
8378 (with-exception-handler (lambda (ex)
8379 (if (search-error? ex)
8380 #f
8381 (raise-exception ex)))
8382 (lambda ()
8383 (search-input-file inputs "lib/librustc_demangle.so"))
8384 #:unwind? #t)))
8385 (substitute* "3rdparty/perfparser/app/demangler.cpp"
8386 (("loadDemangleLib\\(QStringLiteral\\(\"rustc_demangle\")"
8387 all)
8388 (if librustc_demangle.so
8389 (format #f "loadDemangleLib(QStringLiteral(~s)"
8390 librustc_demangle.so)
8391 all)) ;no rustc_demangle; leave unchanged
8392 (("loadDemangleLib\\(QStringLiteral\\(\"d_demangle\")")
8393 (format #f "loadDemangleLib(QStringLiteral(~s)"
8394 (search-input-file inputs
8395 "lib/libd_demangle.so")))))))
8396 (add-after 'unpack 'path-paths
8397 (lambda* (#:key inputs #:allow-other-keys)
8398 (substitute* "src/perfoutputwidgetkonsole.cpp"
8399 (("\"tail\"")
8400 (format #f "~s" (search-input-file inputs "bin/tail"))))
8401 (substitute* "src/perfrecord.cpp"
8402 (("\"perf( )?\"" _ space)
8403 (string-append "\"" (search-input-file inputs "bin/perf")
8404 (or space "") "\""))))))))
8405 (native-inputs
8406 (list extra-cmake-modules
8407 vulkan-headers))
8408 (inputs
8409 (append
8410 (list coreutils-minimal
8411 d-demangler
8412 elfutils
8413 karchive
8414 kconfig
8415 kcoreaddons
8416 kddockwidgets
8417 kgraphviewer
8418 ki18n
8419 kio
8420 kiconthemes
8421 kitemmodels
8422 kitemviews
8423 knotifications
8424 kparts
8425 ksyntaxhighlighting
8426 kwindowsystem
8427 libxkbcommon
8428 perf
8429 qtdeclarative
8430 qtsvg
8431 solid
8432 threadweaver
8433 `(,zstd "lib"))
8434 (if (supported-package? rust-rustc-demangle-capi-0.1)
8435 (list rust-rustc-demangle-capi-0.1)
8436 '())))
8437 (home-page "https://github.com/KDAB/hotspot")
8438 (synopsis "Performance analysis GUI for Linux perf")
8439 (description "Hotspot is a standalone GUI for performance data analysis.
8440It aims to be similar to KCachegrind, but for data collected with
8441@command{perf}, a profiler for use with the kernel Linux. Its main feature is
8442graphically visualizing a @file{perf.data} file.")
8443 (license (list license:gpl2+ license:gpl3+))))) ;dual licensed
8444
8445(define-public ecryptfs-utils
8446 (package
8447 (name "ecryptfs-utils")
8448 (version "111")
8449 (source
8450 (origin
8451 (method url-fetch)
8452 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
8453 version "/+download/ecryptfs-utils_"
8454 version ".orig.tar.gz"))
8455 (sha256
8456 (base32
8457 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
8458 (build-system gnu-build-system)
8459 (arguments
8460 `(#:configure-flags (list "--disable-pywrap")
8461 #:modules (,@%default-gnu-modules
8462 (ice-9 binary-ports)
8463 (rnrs bytevectors)
8464 (srfi srfi-26))
8465 #:phases
8466 (modify-phases %standard-phases
8467 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
8468 (lambda* (#:key inputs outputs #:allow-other-keys)
8469 (let ((out (assoc-ref outputs "out"))
8470 (util-linux (assoc-ref inputs "util-linux"))
8471 (cryptsetup (assoc-ref inputs "cryptsetup-minimal"))
8472 (linux-pam (assoc-ref inputs "linux-pam"))
8473 (lvm2 (assoc-ref inputs "lvm2")))
8474 (substitute* '("src/utils/ecryptfs-mount-private"
8475 "src/utils/ecryptfs-umount-private"
8476 "src/utils/ecryptfs-setup-private"
8477 "src/utils/ecryptfs-setup-swap"
8478 "src/utils/mount.ecryptfs.c"
8479 "src/utils/umount.ecryptfs.c"
8480 "src/pam_ecryptfs/pam_ecryptfs.c"
8481 "src/desktop/ecryptfs-mount-private.desktop.in"
8482 "src/desktop/ecryptfs-setup-private.desktop.in")
8483 (("/bin/mount")
8484 (string-append util-linux "/bin/mount"))
8485 (("/bin/umount")
8486 (string-append util-linux "/bin/umount"))
8487 (("/sbin/mount.ecryptfs_private")
8488 (string-append out "/sbin/mount.ecryptfs_private"))
8489 (("/sbin/umount.ecryptfs_private")
8490 (string-append out "/sbin/umount.ecryptfs_private"))
8491 (("/usr/bin/ecryptfs-mount-private")
8492 (string-append out "/bin/ecryptfs-mount-private"))
8493 (("/usr/bin/ecryptfs-rewrite-file")
8494 (string-append out "/bin/ecryptfs-rewrite-file"))
8495 (("/usr/bin/ecryptfs-setup-private")
8496 (string-append out "/bin/ecryptfs-setup-private"))
8497 (("/sbin/cryptsetup")
8498 (string-append cryptsetup "/sbin/cryptsetup"))
8499 (("/sbin/unix_chkpwd")
8500 (string-append linux-pam "/sbin/unix_chkpwd"))
8501 (("/sbin/dmsetup")
8502 (string-append lvm2 "/sbin/dmsetup"))))))
8503 (add-after 'install 'wrap-scripts
8504 (lambda* (#:key inputs outputs #:allow-other-keys)
8505 (let* ((out (assoc-ref outputs "out"))
8506 (bin (string-append out "/bin"))
8507 (add (map (lambda (bin)
8508 (dirname (search-input-file
8509 inputs (string-append "bin/" bin))))
8510 ;; For simplicity, we wrap all scripts the same.
8511 (list "awk" "find" "gettext" "grep" "keyctl" "ls"
8512 "lsof" "mount" "rsync" "sed" "which")))
8513 (script? (lambda (file)
8514 (call-with-input-file file
8515 (lambda (port)
8516 (bytevector=? (string->utf8 "#!")
8517 (get-bytevector-n port 2)))))))
8518 (for-each (lambda (file)
8519 (when (script? file)
8520 (wrap-program file
8521 ;; '= would be better than 'suffix but break
8522 ;; setuid binaries.
8523 `("PATH" ":" suffix (,@add
8524 ,(string-append bin))))))
8525 (find-files bin "."))))))))
8526 (native-inputs
8527 (list intltool perl ; for pod2man
8528 pkg-config))
8529 (inputs
8530 (list coreutils
8531 cryptsetup-minimal
8532 findutils
8533 gawk
8534 grep
8535 keyutils
8536 linux-pam
8537 lsof
8538 lvm2
8539 nss
8540 rsync
8541 sed
8542 util-linux
8543 which))
8544 (home-page "https://ecryptfs.org/")
8545 (synopsis "Cryptographic file system utilities")
8546 (description
8547 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
8548Each file's cryptographic meta-data is stored inside the file itself, along
8549with the encrypted contents. This allows individual encrypted files to be
8550copied between hosts and still be decrypted with the proper key. eCryptfs is a
8551native Linux file system, and has been part of the Linux kernel since version
85522.6.19. This package contains the userland utilities to manage it.")
8553 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
8554 ;; grant additional permission to link with OpenSSL.
8555 (license license:gpl2+)))
8556
8557(define-public libnfsidmap
8558 (package
8559 (name "libnfsidmap")
8560 (version "0.27")
8561 (source
8562 (origin
8563 (method url-fetch)
8564 (uri (string-append "https://fedorapeople.org/~steved/"
8565 name "/" version "/" name "-" version ".tar.bz2"))
8566 (sha256
8567 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
8568 (build-system gnu-build-system)
8569 (arguments
8570 `(#:configure-flags (list
8571 (string-append "--with-pluginpath="
8572 (assoc-ref %outputs "out")
8573 "/lib/libnfsidmap"))))
8574 (native-inputs
8575 (list autoconf)) ; 0.27 still needs autoheader
8576 (home-page
8577 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
8578 (synopsis "NFSv4 support library for name/ID mapping")
8579 (description "Libnfsidmap is a library holding multiple methods of
8580mapping names to ids and visa versa, mainly for NFSv4. It provides an
8581extensible array of mapping functions, currently consisting of two choices:
8582the default @code{nsswitch} and the experimental @code{umich_ldap}.")
8583 (license (license:non-copyleft "file://COPYING"
8584 "See COPYING in the distribution."))))
8585
8586(define-public module-init-tools
8587 (package
8588 (name "module-init-tools")
8589 (version "3.16")
8590 (source (origin
8591 (method url-fetch)
8592 (uri (string-append
8593 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
8594 "module-init-tools-" version ".tar.bz2"))
8595 (sha256
8596 (base32
8597 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
8598 (patches (search-patches "module-init-tools-moduledir.patch"))))
8599 (build-system gnu-build-system)
8600 (arguments
8601 ;; FIXME: The upstream tarball lacks man pages, and building them would
8602 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
8603 ;; but they vanished. In the meantime, fake it.
8604 '(#:phases
8605 (modify-phases %standard-phases
8606 (add-before 'configure 'fake-docbook
8607 (lambda _
8608 (substitute* "Makefile.in"
8609 (("^DOCBOOKTOMAN.*$")
8610 "DOCBOOKTOMAN = true\n"))
8611 #t)))))
8612 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
8613 (synopsis "Tools for loading and managing Linux kernel modules")
8614 (description
8615 "Tools for loading and managing Linux kernel modules, such as
8616@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
8617 (license license:gpl2+)))
8618
8619(define-public mce-inject
8620 (let ((revision "0") ; no git tags :-/
8621 (commit "4cbe46321b4a81365ff3aafafe63967264dbfec5"))
8622 (package
8623 (name "mce-inject")
8624 (version (git-version "0.0.0" revision commit))
8625 (source
8626 (origin
8627 (method git-fetch)
8628 (uri (git-reference
8629 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git")
8630 (commit commit)))
8631 (file-name (git-file-name name version))
8632 (sha256
8633 (base32 "0gjapg2hrlxp8ssrnhvc19i3r1xpcnql7xv0zjgbv09zyha08g6z"))))
8634 (build-system gnu-build-system)
8635 (arguments
8636 ;; There is no test suite. There's a test/ directory, but it just holds
8637 ;; example text files you could feed to the programme to crash something.
8638 (list #:tests? #f
8639 #:make-flags
8640 #~(list (string-append "prefix=" #$output)
8641 (string-append "CC=" #$(cc-for-target)))
8642 #:phases
8643 #~(modify-phases %standard-phases
8644 (delete 'configure) ; no configure script
8645 (add-after 'install 'install-examples
8646 (lambda* (#:key outputs #:allow-other-keys)
8647 (let* ((out (assoc-ref outputs "out"))
8648 (doc (string-append out "/share/doc/" #$name))
8649 (dir (string-append doc "/examples")))
8650 (copy-recursively "test" dir )))))))
8651 (native-inputs
8652 (list bison flex))
8653 (supported-systems (list "i686-linux" "x86_64-linux"))
8654 (home-page
8655 "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git/about/")
8656 (synopsis
8657 "Inject x86 @acronym{MCEs, machine-check exceptions} into Linux")
8658 (description
8659 "This simple tool injects fake @acronym{MCEs, machine-check exceptions}
8660into a running Linux kernel, to debug or test the kernel's @acronym{EDAC, error
8661detection and correction}-handling code specific to x86 and x86_64 platforms.
8662
8663Real MCEs are internal CPU errors. Handling them correctly can be important to
8664system stability and even prevent physical damage. In contrast, simulated MCEs
8665produced by @command{mce-inject} are purely synthetic: injection happens only at
8666the software level, inside the kernel, and is not visible to the platform
8667hardware or firmware.
8668
8669A convenient feature of @command{mce-inject} is that the input language used to
8670describe MCEs is similar to the format used in Linux panic messages, with a few
8671extensions. In general, you should be able to pipe in any logged MCE panic to
8672simulate that same MCE.
8673
8674The target kernel must have the @code{CONFIG_X86_MCE_INJECT} option enabled and
8675the @code{mce-inject} module loaded if it exists.")
8676 (license license:gpl2))))
8677
8678(define-public mcelog
8679 (package
8680 (name "mcelog")
8681 (version "195")
8682 (source
8683 (origin
8684 (method git-fetch)
8685 (uri (git-reference
8686 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
8687 (commit (string-append "v" version))))
8688 (file-name (git-file-name name version))
8689 (sha256
8690 (base32 "1bg2bj8flybd8kzmmaaslisc6lc1fs9nbv09im6r32dq48skx5aj"))
8691 (modules '((guix build utils)))
8692 (snippet
8693 `(begin
8694 ;; The checkout lacks a .git directory, breaking ‘git describe’.
8695 (substitute* "Makefile"
8696 (("\"unknown\"") (string-append "\"v" ,version "\"")))))))
8697 (build-system gnu-build-system)
8698 (arguments
8699 (list
8700 ;; The tests will only run as root on certain supported CPU models.
8701 #:tests? #f
8702 #:make-flags
8703 #~(list (string-append "CC=" #$(cc-for-target))
8704 (string-append "prefix=" #$output)
8705 (string-append "DOCDIR=" #$output "/share/doc/"
8706 #$name "-" #$version)
8707 "etcprefix=$(DOCDIR)/examples")
8708 #:phases
8709 #~(modify-phases %standard-phases
8710 (delete 'configure)))) ; no configure script
8711 (native-inputs
8712 (list python-wrapper)) ; to generate example mcelog.conf
8713 (supported-systems (list "i686-linux" "x86_64-linux"))
8714 (home-page "https://mcelog.org/")
8715 (synopsis "Machine check monitor for x86 Linux systems")
8716 (description
8717 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
8718systems running the kernel Linux. It can also perform user-defined tasks, such
8719as bringing bad pages off-line, when configurable error thresholds are
8720exceeded.")
8721 (license license:gpl2)))
8722
8723(define-public mtd-utils
8724 (package
8725 (name "mtd-utils")
8726 (version "2.1.5")
8727 (source (origin
8728 (method url-fetch)
8729 (uri (string-append
8730 "ftp://ftp.infradead.org/pub/mtd-utils/"
8731 "mtd-utils-" version ".tar.bz2"))
8732 (sha256
8733 (base32
8734 "0ilz8hkcyvfcnqpy25kbr8fb71x9vl28wbmw56vvd68n2byjfviq"))))
8735 (arguments
8736 (list #:configure-flags
8737 (if (%current-target-system) ; When cross-compiling.
8738 #~(list)
8739 #~(list "--enable-unit-tests"))
8740
8741 #:parallel-tests? #f)) ;tests may fail when running in parallel
8742 (native-inputs
8743 (list cmocka pkg-config))
8744 (inputs
8745 (list acl ; extended attributes (xattr)
8746 lzo
8747 openssl ; optional crypto support
8748 `(,util-linux "lib")
8749 zlib
8750 `(,zstd "lib")))
8751 (build-system gnu-build-system)
8752 (synopsis "MTD Flash Storage Utilities")
8753 (description "This package provides utilities for testing, partitioning, etc
8754of flash storage.")
8755 (home-page "http://www.linux-mtd.infradead.org/")
8756 (license
8757 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
8758 license:mpl1.1 ; All ftl* files
8759 license:expat)))) ; libiniparser
8760
8761(define-public libseccomp
8762 (package
8763 (name "libseccomp")
8764 (version "2.6.0")
8765 (source (origin
8766 (method git-fetch)
8767 (uri (git-reference
8768 (url "https://github.com/seccomp/libseccomp")
8769 (commit (string-append "v" version))))
8770 (file-name (git-file-name name version))
8771 (sha256
8772 (base32
8773 "189yh66aj3z3jvns739qbj504f3mcl3w44pxxizw877pbj3kal11"))))
8774 (build-system gnu-build-system)
8775 (arguments
8776 (list
8777 #:configure-flags #~(list "--disable-static")
8778 #:phases #~(modify-phases %standard-phases
8779 #$@(if (target-ppc32?)
8780 ;; This test is removed upstream. See upstream commit
8781 ;; 7db46d72f13c172b290818f624c2966bd0db5677
8782 #~((add-after 'unpack 'skip-62-sim-arch-tests
8783 (lambda _
8784 (substitute*
8785 "tests/62-sim-arch_transactions.tests"
8786 (("test type: bpf-sim-fuzz") "")
8787 (("62-sim-arch_transactions 5") "")))))
8788 #~())
8789 (add-before 'check 'skip-load-test
8790 (lambda _
8791 ;; This test does a native system call and fails when
8792 ;; run under QEMU user-mode emulation. Just skip it.
8793 (delete-file "tests/52-basic-load.tests"))))))
8794 (native-inputs
8795 (list autoconf automake gperf libtool which))
8796 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
8797 (description "The libseccomp library provides an easy to use, platform
8798independent, interface to the Linux Kernel's syscall filtering mechanism. The
8799libseccomp API is designed to abstract away the underlying BPF based syscall
8800filter language and present a more conventional function-call based filtering
8801interface that should be familiar to, and easily adopted by, application
8802developers.")
8803 (home-page "https://github.com/seccomp/libseccomp")
8804 (license license:lgpl2.1)))
8805
8806(define-public radeontop
8807 (package
8808 (name "radeontop")
8809 (version "1.4")
8810 (source
8811 (origin
8812 (method git-fetch)
8813 (uri (git-reference
8814 (url "https://github.com/clbr/radeontop")
8815 (commit (string-append "v" version))))
8816 (file-name (git-file-name name version))
8817 (sha256
8818 (base32 "0kwqddidr45s1blp0h8r8h1dd1p50l516yb6mb4s6zsc827xzgg3"))))
8819 (build-system gnu-build-system)
8820 (arguments
8821 `(#:phases (modify-phases %standard-phases
8822 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
8823 ;; dependency, and doesn't even work on release(!) tarballs.
8824 (add-after 'unpack 'report-correct-version
8825 (lambda _
8826 (substitute* "getver.sh"
8827 (("ver=unknown")
8828 (string-append "ver=" ,version)))))
8829 (delete 'configure)) ; no configure script
8830 #:make-flags (list (string-append "CC=" ,(cc-for-target))
8831 (string-append "PREFIX=" %output))
8832 #:tests? #f)) ; no tests
8833 (native-inputs
8834 (list gettext-minimal pkg-config))
8835 (inputs
8836 (list libdrm libpciaccess libxcb ncurses))
8837 (home-page "https://github.com/clbr/radeontop/")
8838 (synopsis "Usage monitor for AMD Radeon graphics")
8839 (description "RadeonTop monitors resource consumption on supported AMD
8840Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
8841a terminal or saved to a file for further processing. It measures both the
8842activity of the GPU as a whole, which is also accurate during OpenCL
8843computations, as well as separate component statistics that are only meaningful
8844under OpenGL graphics workloads.")
8845 (license license:gpl3)))
8846
8847(define-public efivar
8848 (package
8849 (name "efivar")
8850 (version "39")
8851 (source (origin
8852 (method git-fetch)
8853 (uri (git-reference
8854 (url "https://github.com/rhboot/efivar")
8855 (commit version)))
8856 (file-name (git-file-name name version))
8857 (sha256
8858 (base32
8859 "1zd9dghg1z2rrsazv3d9rj7nik6kdqz42jiak65pipz7mpjn9zdk"))
8860 (patches (search-patches "efivar-fix-fprint-format.patch"))))
8861 (build-system gnu-build-system)
8862 (arguments
8863 (list
8864 ;; Tests require a UEFI system and is not detected in the chroot.
8865 #:tests? #f
8866 #:make-flags #~(list (string-append "prefix="
8867 #$output)
8868 (string-append "libdir="
8869 #$output "/lib")
8870 (string-append "CC="
8871 #$(cc-for-target))
8872 "HOSTCC=gcc"
8873 (string-append "LDFLAGS=-Wl,-rpath="
8874 #$output "/lib")
8875 ;; Strictly only needed for i686-linux/32bit
8876 "CFLAGS=-g -O2 -Wno-error=format")
8877 #:phases #~(modify-phases %standard-phases
8878 (add-after 'unpack 'build-deterministically
8879 (lambda _
8880 (substitute* "src/include/defaults.mk"
8881 ;; Don't use -march=native.
8882 (("-march=native")
8883 ""))))
8884 (delete 'configure))))
8885 (native-inputs (list mandoc pkg-config))
8886 (inputs (list popt))
8887 (home-page "https://github.com/rhboot/efivar")
8888 (synopsis "Tool and library to manipulate EFI variables")
8889 (description "This package provides a library and a command line
8890interface to the variable facility of UEFI boot firmware.")
8891 (license license:lgpl2.1+)))
8892
8893(define-public efibootmgr
8894 (package
8895 (name "efibootmgr")
8896 (version "18")
8897 (source
8898 (origin
8899 (method git-fetch)
8900 (uri (git-reference
8901 (url "https://github.com/rhboot/efibootmgr")
8902 (commit version)))
8903 (file-name (git-file-name name version))
8904 (sha256
8905 (base32 "1j19m3dngcb7jl88ib32phbh5r7c02dhhakq8jk6z7y408c111hd"))))
8906 (build-system gnu-build-system)
8907 (arguments
8908 (list
8909 #:tests? #f ;no tests
8910 #:make-flags
8911 #~(append (list (string-append "prefix=" #$output)
8912 (string-append "libdir=" #$output "/lib")
8913 ;; EFIDIR denotes a subdirectory relative to the
8914 ;; EFI System Partition where the loader will be
8915 ;; installed (known as OS_VENDOR in the code).
8916 ;; GRUB overrides this, as such it's only used if
8917 ;; nothing else is specified on the command line.
8918 "EFIDIR=gnu")
8919 #$(if (%current-target-system)
8920 #~(list
8921 (string-append "CC=" #$(cc-for-target))
8922 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
8923 (string-append "EXTRAINCDIRS="
8924 #$(this-package-input "efivar") "/include"))
8925 #~'()))
8926 #:phases #~(modify-phases %standard-phases (delete 'configure))))
8927 (native-inputs
8928 (list pkg-config))
8929 (inputs
8930 (list efivar popt))
8931 (home-page "https://github.com/rhboot/efibootmgr")
8932 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
8933 (description
8934 "@code{efibootmgr} is a user-space application to modify the Intel
8935Extensible Firmware Interface (EFI) Boot Manager. This application can
8936create and destroy boot entries, change the boot order, change the next
8937running boot option, and more.")
8938 (license license:gpl2+)))
8939
8940(define-public sysstat
8941 (package
8942 (name "sysstat")
8943 (version "12.7.5")
8944 (source
8945 (origin
8946 (method url-fetch)
8947 (uri (string-append "https://sysstat.github.io/sysstat-packages/"
8948 "sysstat-" version ".tar.xz"))
8949 (sha256
8950 (base32 "0ssdrm3k0fclq5b5i0aznfwdkbac9l9cf88idaq3pls9lm040rjp"))))
8951 (build-system gnu-build-system)
8952 (native-inputs (list gettext-minimal))
8953 (arguments
8954 `(#:tests? #f ; no test suite.
8955 ;; Without this flag, it tries to install the man pages with group 'root'
8956 ;; and fails because /etc/passwd lacks an entry for the root user.
8957 #:configure-flags
8958 (list "--disable-file-attr"
8959 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
8960 #:phases
8961 (modify-phases %standard-phases
8962 ;; The build process tries to create '/var/lib/sa', so we skip that
8963 ;; instruction.
8964 (add-after 'build 'skip-touching-var
8965 (lambda _
8966 (substitute* "Makefile"
8967 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
8968 "")))))))
8969 (home-page "https://sysstat.github.io")
8970 (synopsis "Performance monitoring tools for Linux")
8971 (description "The sysstat utilities are a collection of performance
8972monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
8973@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
8974@code{sadf} and @code{sa}.")
8975 (license license:gpl2+)))
8976
8977(define-public acpilight
8978 (package
8979 (name "acpilight")
8980 (version "1.2")
8981 (source (origin
8982 (method git-fetch)
8983 (uri (git-reference
8984 (url "https://gitlab.com/wavexx/acpilight.git")
8985 (commit (string-append "v" version))))
8986 (file-name (git-file-name name version))
8987 (sha256
8988 (base32
8989 "1r0r3nx6x6vkpal6vci0zaa1n9dfacypldf6k8fxg7919vzxdn1w"))))
8990 (build-system gnu-build-system)
8991 (arguments
8992 (list #:tests? #f ; no tests
8993 #:make-flags
8994 #~(list (string-append "prefix=" #$output)
8995 (string-append "sysconfdir=" #$output "/lib")) ;udev rule
8996 #:phases
8997 #~(modify-phases %standard-phases
8998 (delete 'configure)
8999 (add-after 'unpack 'patch
9000 (lambda* (#:key inputs #:allow-other-keys)
9001 ;; Prevent reloading udev at build time
9002 (substitute* "Makefile"
9003 (("udevadm") "true"))
9004 (substitute* "90-backlight.rules"
9005 (("/bin")
9006 (string-append #$(this-package-input "coreutils")
9007 "/bin"))))))))
9008 (inputs (list coreutils python))
9009 (home-page "https://gitlab.com/wavexx/acpilight")
9010 (synopsis "Backward-compatibile xbacklight replacement")
9011 (description "acpilight is a backward-compatibile replacement for
9012xbacklight that uses the ACPI interface to set the display brightness. On
9013modern laptops acpilight can control both display and keyboard backlight
9014uniformly on either X11, the console or Wayland.")
9015 (license license:gpl3+)))
9016
9017(define-public light
9018 (package
9019 (name "light")
9020 (version "1.2.2")
9021 (source
9022 (origin
9023 (method git-fetch)
9024 (uri (git-reference
9025 (url "https://github.com/haikarainen/light")
9026 (commit (string-append "v" version))))
9027 (sha256
9028 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
9029 (file-name (git-file-name name version))))
9030 (build-system gnu-build-system)
9031 (arguments
9032 `(#:configure-flags '("CFLAGS=-fcommon")
9033 #:phases
9034 (modify-phases %standard-phases
9035 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
9036 (lambda* (#:key inputs #:allow-other-keys)
9037 (substitute* "90-backlight.rules"
9038 (("/bin/chgrp") (which "chgrp"))
9039 (("/bin/chmod") (which "chmod")))
9040 #t))
9041 (add-after 'install 'install-udev-rules
9042 (lambda* (#:key outputs #:allow-other-keys)
9043 (let ((out (assoc-ref outputs "out")))
9044 (install-file
9045 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
9046 #t))))))
9047 (native-inputs
9048 (list autoconf automake))
9049 (home-page "https://haikarainen.github.io/light/")
9050 (synopsis "GNU/Linux application to control backlights")
9051 (description
9052 "Light is a program to send commands to screen backlight controllers
9053under GNU/Linux. Features include:
9054
9055@itemize
9056@item It does not rely on X.
9057@item Light can automatically figure out the best controller to use, making
9058full use of underlying hardware.
9059@item It is possible to set a minimum brightness value, as some controllers
9060set the screen to be pitch black at a value of 0 (or higher).
9061@end itemize\n")
9062 (license license:gpl3+)))
9063
9064(define-public brightnessctl
9065 (package
9066 (name "brightnessctl")
9067 (version "0.5.1")
9068 (home-page "https://github.com/Hummer12007/brightnessctl")
9069 (source (origin
9070 (method git-fetch)
9071 (uri (git-reference (url home-page) (commit version)))
9072 (file-name (git-file-name name version))
9073 (sha256
9074 (base32
9075 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
9076 (patches (search-patches "brightnessctl-elogind-support.patch"))))
9077 (build-system gnu-build-system)
9078 (arguments
9079 `(#:tests? #f ; no tests
9080 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9081 (string-append "PREFIX=" %output)
9082 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
9083 "ENABLE_SYSTEMD=1")
9084 #:phases
9085 (modify-phases %standard-phases
9086 (delete 'configure)
9087 (add-after 'unpack 'adjust-udev-rules
9088 (lambda _
9089 (substitute* "Makefile"
9090 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
9091 (substitute* "90-brightnessctl.rules"
9092 (("/bin/") "/run/current-system/profile/bin/"))
9093 #t)))))
9094 (native-inputs
9095 (list pkg-config))
9096 (inputs
9097 (list elogind))
9098 (synopsis "Backlight and LED brightness control")
9099 (description
9100 "This program allows you read and control device brightness. Devices
9101include backlight and LEDs. It can also preserve current brightness before
9102applying the operation, such as on lid close.
9103
9104The appropriate permissions must be set on the backlight or LED control
9105interface in sysfs, which can be accomplished with the included udev rules.")
9106 (license license:expat)))
9107
9108(define-public tlp
9109 (package
9110 (name "tlp")
9111 (version "1.8.0")
9112 (source
9113 (origin
9114 (method git-fetch)
9115 (uri (git-reference
9116 (url "https://github.com/linrunner/TLP")
9117 (commit version)))
9118 (file-name (git-file-name name version))
9119 (sha256
9120 (base32 "0r8r95wjb1sl5v8mli7kba2py9hc0ps915fx4lap5pg108ik9a06"))))
9121 (native-inputs
9122 (list shellcheck))
9123 (inputs
9124 `(("dbus" ,dbus)
9125 ("ethtool" ,ethtool)
9126 ("eudev" ,eudev)
9127 ("grep" ,grep)
9128 ("guile" ,guile-3.0) ;for wrap-script
9129 ("hdparm" ,hdparm)
9130 ("inetutils" ,inetutils)
9131 ("iw" ,iw)
9132 ("kmod" ,kmod)
9133 ("pciutils" ,pciutils)
9134 ("perl" ,perl)
9135 ("rfkill" ,rfkill)
9136 ("sed" ,sed)
9137 ("usbutils" ,usbutils)
9138 ("util-linux" ,util-linux)
9139 ("wireless-tools" ,wireless-tools)
9140 ,@(if (let ((system (or (%current-target-system)
9141 (%current-system))))
9142 (or (string-prefix? "i686-" system)
9143 (string-prefix? "x86_64-" system)))
9144 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
9145 '())))
9146 (build-system gnu-build-system)
9147 (arguments
9148 ;; XXX: The full test suite is run with "checkall" but it requires
9149 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
9150 (list
9151 #:make-flags
9152 #~(list "TLP_CONFUSR=/etc/tlp.conf" "TLP_CONFDIR=/etc/tlp.d")
9153 #:test-target "shellcheck"
9154 #:modules '((guix build gnu-build-system)
9155 (guix build utils)
9156 (srfi srfi-1))
9157 #:phases
9158 #~(modify-phases %standard-phases
9159 (delete 'configure) ; no configure script
9160 (add-before 'build 'setenv
9161 (lambda _
9162 (setenv "TLP_WITH_SYSTEMD" "0")
9163 (setenv "TLP_NO_INIT" "1")))
9164 (add-before 'build 'fix-installation
9165 (lambda _
9166 ;; Stop the Makefile from trying to create system directories.
9167 (substitute* "Makefile"
9168 (("= /usr") (string-append "= " #$output))
9169 (("= /etc") (string-append "= " #$output "/etc"))
9170 (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
9171 (add-before 'build 'fix-perl-calls
9172 ;; Shell scripts in "bat.d" and "func.d" call "perl". Fix
9173 ;; invocation without wrapping every one of them.
9174 (lambda* (#:key inputs #:allow-other-keys)
9175 (substitute* (append (find-files "bat.d" ".")
9176 (find-files "func.d" "."))
9177 (("(^|[^/])perl" _ prefix)
9178 (string-append prefix
9179 (search-input-file inputs "bin/perl"))))))
9180 (replace 'install
9181 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
9182 (add-after 'install 'wrap
9183 (lambda* (#:key inputs outputs #:allow-other-keys)
9184 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
9185 (sbin (string-append (assoc-ref outputs "out") "/sbin"))
9186 ;; Used to ignore symlinks which don't need wrapping
9187 (regular-file-predicate
9188 (lambda (file stat) (eq? 'regular (stat:type stat))))
9189 (bin-files (find-files bin regular-file-predicate))
9190 (sbin-files (find-files sbin regular-file-predicate)))
9191 (define (bin-directory input-name)
9192 (let ((p (assoc-ref inputs input-name)))
9193 (and p (string-append p "/bin"))))
9194 (define (sbin-directory input-name)
9195 (string-append (assoc-ref inputs input-name) "/sbin"))
9196 (for-each (lambda (program)
9197 ;; Programs rely on $0 so we use wrap-script
9198 ;; instead of wrap-program
9199 (wrap-script program
9200 `("PATH" ":" prefix
9201 ,(append
9202 (filter-map bin-directory
9203 '("bash"
9204 "coreutils"
9205 "dbus"
9206 "eudev"
9207 "grep"
9208 "inetutils"
9209 "kmod"
9210 "perl"
9211 "sed"
9212 "usbutils"
9213 "util-linux"
9214 "x86-energy-perf-policy"))
9215 (filter-map sbin-directory
9216 '("ethtool"
9217 "hdparm"
9218 "iw"
9219 "pciutils"
9220 "rfkill"
9221 "wireless-tools"))))))
9222 (append bin-files sbin-files))))))))
9223 (home-page "https://linrunner.de/en/tlp/tlp.html")
9224 (synopsis "Power management tool for Linux")
9225 (description "TLP is a power management tool for Linux. It comes with
9226a default configuration already optimized for battery life. Nevertheless,
9227TLP is customizable to fulfil system requirements. TLP settings are applied
9228every time the power supply source is changed.")
9229 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
9230 ;; rest is GPLv2+.
9231 (license (list license:gpl2+ license:gpl3+))))
9232
9233(define-public tlpui
9234 (package
9235 (name "tlpui")
9236 (version "1.8.0")
9237 (source
9238 (origin
9239 (method git-fetch)
9240 (uri (git-reference
9241 (url "https://github.com/d4nj1/TLPUI")
9242 (commit (string-append "tlpui-" version))))
9243 (file-name (git-file-name name version))
9244 (sha256
9245 (base32 "1q33p4gf5ii53wlgs61gghqxp3js5c45pn5nlibg2ygw069225r5"))))
9246 (build-system pyproject-build-system)
9247 (arguments
9248 (list
9249 #:phases
9250 #~(modify-phases %standard-phases
9251 (add-after 'unpack 'set-absolute-locations
9252 (lambda* (#:key inputs #:allow-other-keys)
9253 (let ((defaults.conf
9254 (search-input-file inputs "/share/tlp/defaults.conf"))
9255 (lspci (search-input-file inputs "/bin/lspci"))
9256 (lsusb (search-input-file inputs "/bin/lsusb"))
9257 (tlp-stat (search-input-file inputs "/bin/tlp-stat")))
9258 (with-directory-excursion "tlpui"
9259 (substitute* '("file.py" "settingshelper.py" "statui.py")
9260 (("\"tlp-stat\"")
9261 (string-append "'" tlp-stat "'"))
9262 (("/usr/share/tlp/defaults.conf")
9263 defaults.conf))
9264 (substitute* "ui_config_objects/gtkusblist.py"
9265 (("\"lsusb\"")
9266 (string-append "'" lsusb "'")))
9267 (substitute* "ui_config_objects/gtkpcilist.py"
9268 (("\"lspci\"")
9269 (string-append "'" lspci "'")))
9270 ;; Settings check if various tlp executables, lspci and
9271 ;; usbutils are available. Skip this phase since we know
9272 ;; for sure they are (and it avoids patching each location).
9273 (substitute* "settingshelper.py"
9274 (("(command_exists = ).*" _ lead)
9275 (string-append lead "True\n")))))))
9276 (add-after 'install 'install-desktop-file
9277 (lambda _
9278 (let ((dir (string-append #$output "/share/applications")))
9279 (install-file "tlpui.desktop" dir))))
9280 (add-after 'wrap 'wrap-gi-python
9281 (lambda _
9282 (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
9283 (wrap-program (string-append #$output "/bin/tlpui")
9284 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
9285 (native-inputs
9286 (list `(,glib "bin")
9287 gobject-introspection
9288 python-poetry-core
9289 python-pytest
9290 python-pyyaml))
9291 (inputs
9292 (list gtk+
9293 pciutils
9294 python-pygobject
9295 tlp
9296 usbutils))
9297 (propagated-inputs (list (librsvg-for-system)))
9298 (home-page "https://github.com/d4nj1/TLPUI")
9299 (synopsis "User interface for TLP written in Python")
9300 (description
9301 "The Python scripts in this project generate a GTK-UI to change
9302TLP configuration files easily. It aims to protect users from setting
9303bad configuration and to deliver a basic overview of all the valid
9304configuration values.")
9305 (license license:gpl2+)))
9306
9307(define-public lshw
9308 (package
9309 (name "lshw")
9310 (version "B.02.19.2")
9311 (source (origin
9312 (method url-fetch)
9313 (uri (string-append "https://www.ezix.org/software/"
9314 "files/lshw-" version
9315 ".tar.gz"))
9316 (sha256
9317 (base32
9318 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
9319 (build-system gnu-build-system)
9320 (arguments
9321 `(#:phases (modify-phases %standard-phases (delete 'configure))
9322 #:tests? #f ; no tests
9323 #:make-flags
9324 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
9325 (synopsis "List hardware information")
9326 (description
9327 "@command{lshw} (Hardware Lister) is a small tool to provide
9328detailed information on the hardware configuration of the machine.
9329It can report exact memory configuration, firmware version, mainboard
9330configuration, CPU version and speed, cache configuration, bus speed,
9331and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
9332machines (PowerMac G4 is known to work).")
9333 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
9334 (license license:gpl2+)))
9335
9336(define-public libmnl
9337 (package
9338 (name "libmnl")
9339 (version "1.0.5")
9340 (source
9341 (origin
9342 (method url-fetch)
9343 (uri (string-append "mirror://netfilter.org/libmnl/"
9344 "libmnl-" version ".tar.bz2"))
9345 (sha256
9346 (base32
9347 "09851ns07399rbz0y8slrlmnw3fn1nakr8d37pxjn5gkks8rnjr7"))))
9348 (build-system gnu-build-system)
9349 (home-page "https://www.netfilter.org/projects/libmnl/")
9350 (synopsis "Netlink utility library")
9351 (description "Libmnl is a minimalistic user-space library oriented to
9352Netlink developers. There are a lot of common tasks in parsing, validating,
9353constructing of both the Netlink header and TLVs that are repetitive and easy to
9354get wrong. This library aims to provide simple helpers that allows you to
9355re-use code and to avoid re-inventing the wheel.")
9356 (properties
9357 '((release-monitoring-url . "https://www.netfilter.org/pub/libmnl/")))
9358 (license license:lgpl2.1+)))
9359
9360(define-public libnftnl
9361 (package
9362 (name "libnftnl")
9363 (version "1.2.8")
9364 (source
9365 (origin
9366 (method url-fetch)
9367 (uri (string-append "mirror://netfilter.org/libnftnl/"
9368 "libnftnl-" version ".tar.xz"))
9369 (sha256
9370 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9371 (build-system gnu-build-system)
9372 (native-inputs
9373 (list pkg-config))
9374 (inputs
9375 (list libmnl))
9376 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
9377 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
9378 (description "Libnftnl is a userspace library providing a low-level netlink
9379programming interface to the in-kernel nf_tables subsystem. The library
9380libnftnl has been previously known as libnftables. This library is currently
9381used by nftables.")
9382 (license license:gpl2+)))
9383
9384;;; The symbol libnftl/fixed should be used when libnftnl needs fixes
9385;;; (security or else) and this deprecation could be removed.
9386(define-deprecated/public-alias libnftnl/fixed libnftnl/pinned)
9387
9388;; This is used in iptables, which contributes to rust. We're pinning this
9389;; variant to avoid accidental rebuilds of rust.
9390(define-public libnftnl/pinned
9391 (package
9392 (inherit libnftnl)
9393 (version "1.2.8")
9394 (source
9395 (origin
9396 (method url-fetch)
9397 (uri (string-append "mirror://netfilter.org/libnftnl/"
9398 "libnftnl-" version ".tar.xz"))
9399 (sha256
9400 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9401 (build-system gnu-build-system)
9402 (native-inputs
9403 (list pkg-config))
9404 (inputs
9405 (list libmnl))))
9406
9407(define-public nftables
9408 (package
9409 (name "nftables")
9410 (version "1.0.8")
9411 (source
9412 (origin
9413 (method url-fetch)
9414 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
9415 version ".tar.xz")
9416 (string-append "https://www.nftables.org/projects/nftables"
9417 "/files/nftables-" version ".tar.xz")))
9418 (sha256
9419 (base32 "0l1xpwr9qfbl3bxa97v8s2lbibiz0xma9q0qi34xp0hswh6p8wwk"))))
9420 (build-system gnu-build-system)
9421 (arguments `(#:configure-flags
9422 '("--disable-static"
9423 "--with-cli=readline"
9424 "--with-json")
9425 #:phases
9426 (modify-phases %standard-phases
9427 (add-before 'configure 'autoreconf
9428 (lambda _
9429 (invoke "autoreconf" "-fi"))))))
9430 (inputs (list gmp libmnl libnftnl readline jansson))
9431 (native-inputs (list pkg-config
9432 bison
9433 flex
9434 docbook2x
9435 autoconf
9436 automake
9437 libtool))
9438 (home-page "https://www.nftables.org")
9439 (synopsis "Userspace utility for Linux packet filtering")
9440 (description "nftables is the project that aims to replace the existing
9441{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
9442filtering framework, a new userspace utility and also a compatibility layer for
9443{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
9444infrastructure such as the existing hooks, the connection tracking system, the
9445userspace queueing component and the logging subsystem.")
9446 (license license:gpl2)))
9447
9448(define-public libnetfilter-conntrack
9449 (package
9450 (name "libnetfilter-conntrack")
9451 (version "1.0.9")
9452 (source
9453 (origin
9454 (method url-fetch)
9455 (uri (string-append "https://netfilter.org/projects/"
9456 "libnetfilter_conntrack/files/"
9457 "libnetfilter_conntrack-"
9458 version ".tar.bz2"))
9459 (sha256
9460 (base32 "1a3rnpsba64dzy97wwjrxal89wr0nf9znvag2j18nkp3kzs9vgb7"))))
9461 (build-system gnu-build-system)
9462 (native-inputs (list pkg-config))
9463 (inputs (list libnfnetlink libmnl))
9464 (synopsis "Library for kernel connection tracking state table")
9465 (description "libnetfilter_conntrack is a userspace library providing a
9466programming interface (API) to the in-kernel connection tracking state table.
9467The library libnetfilter_conntrack has been previously known as
9468libnfnetlink_conntrack and libctnetlink. This library is currently used by
9469conntrack-tools among many other applications.")
9470 (home-page "https://netfilter.org/projects/libnetfilter_conntrack/index.html")
9471 (supported-systems (filter target-linux? %supported-systems))
9472 (properties '((upstream-name . "libnetfilter_conntrack")))
9473 (license license:gpl2+)))
9474
9475(define-public libnetfilter-cttimeout
9476 (package
9477 (name "libnetfilter-cttimeout")
9478 (version "1.0.1")
9479 (source
9480 (origin
9481 (method url-fetch)
9482 (uri (string-append "https://netfilter.org/projects/"
9483 "libnetfilter_cttimeout/files/"
9484 "libnetfilter_cttimeout-" version ".tar.bz2"))
9485 (sha256
9486 (base32 "0983cpyvxyycbnzqlrzml80pph2z51r6s7sxp06ciq8468pxln8b"))))
9487 (build-system gnu-build-system)
9488 (native-inputs (list pkg-config))
9489 (inputs (list libmnl))
9490 (synopsis "Library for kernel connection tracking timeout infrastructure")
9491 (description "libnetfilter_cttimeout is the userspace library that
9492provides the programming interface to the fine-grain connection tracking
9493timeout infrastructure. With this library, you can create, update and delete
9494timeout policies that can be attached to traffic flows. This library is used
9495by conntrack-tools.")
9496 (home-page "https://netfilter.org/projects/libnetfilter_cttimeout/index.html")
9497 (supported-systems (filter target-linux? %supported-systems))
9498 (properties '((upstream-name . "libnetfilter_cttimeout")))
9499 (license license:gpl2)))
9500
9501(define-public libnetfilter-cthelper
9502 (package
9503 (name "libnetfilter-cthelper")
9504 (version "1.0.1")
9505 (source
9506 (origin
9507 (method url-fetch)
9508 (uri (string-append "https://netfilter.org/projects/"
9509 "libnetfilter_cthelper/files/"
9510 "libnetfilter_cthelper-" version ".tar.bz2"))
9511 (sha256
9512 (base32 "04n95ngil5l8m8v64dfjm1dwq0wd3kf4vw1zblsrff13hxa3s1ql"))))
9513 (build-system gnu-build-system)
9514 (native-inputs (list pkg-config))
9515 (inputs (list libmnl))
9516 (synopsis "Library for user-space connection tracking helpers")
9517 (description "libnetfilter_cthelper is a userspace library that provides a
9518programming interface to user-space connection tracking helpers.
9519@enumerate
9520@item
9521register new user-space connection tracking helpers
9522@item
9523unregister user-space connection tracking helpers
9524@item
9525list existing registered user-space connection tracking helpers
9526@end enumerate")
9527 (home-page "https://netfilter.org/projects/libnetfilter_cthelper/index.html")
9528 (supported-systems (filter target-linux? %supported-systems))
9529 (properties '((upstream-name . "libnetfilter_cthelper")))
9530 (license license:gpl2+)))
9531
9532(define-public libnetfilter-queue
9533 (package
9534 (name "libnetfilter-queue")
9535 (version "1.0.5")
9536 (source
9537 (origin
9538 (method url-fetch)
9539 (uri (string-append "https://netfilter.org/projects/"
9540 "libnetfilter_queue/files/"
9541 "libnetfilter_queue-" version ".tar.bz2"))
9542 (sha256
9543 (base32
9544 "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr"))))
9545 (build-system gnu-build-system)
9546 (native-inputs (list pkg-config))
9547 (inputs (list libmnl libnfnetlink))
9548 (synopsis "Library for kernel netfilter infrastructure and state")
9549 (description "libnetfilter_queue is a userspace library providing an API
9550to packets that have been queued by the kernel packet filter. It is is part
9551of a system that deprecates the old ip_queue/libipq mechanism.")
9552 (home-page "https://netfilter.org/projects/libnetfilter_queue/index.html")
9553 (supported-systems (filter target-linux? %supported-systems))
9554 (properties '((upstream-name . "libnetfilter_queue")))
9555 (license license:gpl2+)))
9556
9557(define-public conntrack-tools
9558 (package
9559 (name "conntrack-tools")
9560 (version "1.4.8")
9561 (source
9562 (origin
9563 (method url-fetch)
9564 (uri (string-append "https://netfilter.org/projects/"
9565 "conntrack-tools/files/"
9566 "conntrack-tools-" version ".tar.xz"))
9567 (sha256
9568 (base32 "1mnynl5a63j25arapwvkjbm3a2cqm3aaklwfwwclhmpnqps7fxh6"))))
9569 (build-system gnu-build-system)
9570 (native-inputs (list bison flex pkg-config))
9571 (inputs (list libtirpc
9572 libnetfilter-conntrack
9573 libnetfilter-cttimeout
9574 libnetfilter-cthelper
9575 libnetfilter-queue
9576 libnfnetlink
9577 libmnl))
9578 (synopsis "Set of tools targeting the conntrack kernel subsystem")
9579 (description "The tool conntrack provides a full featured interface that
9580is intended to replace the old @file{/proc/net/ip_conntrack} interface. Using
9581conntrack, you can view and manage the in-kernel connection tracking state
9582table from userspace. On the other hand, conntrackd covers the specific
9583aspects of stateful firewalls to enable highly available scenarios, and can be
9584used as statistics collector as well.
9585
9586Since 1.2.0, the conntrack-tools includes the @command{nfct} command line
9587utility. This utility only supports the nfnetlink_cttimeout by now. In the
9588long run, we expect that it will replace conntrack by providing a syntax
9589similar to nftables.")
9590 (home-page "https://netfilter.org/projects/conntrack-tools/index.html")
9591 (supported-systems (filter target-linux? %supported-systems))
9592 (license license:gpl2+)))
9593
9594(define-public libnetfilter-acct
9595 (package
9596 (name "libnetfilter-acct")
9597 (version "1.0.3")
9598 (source
9599 (origin
9600 (method url-fetch)
9601 (uri (string-append "https://netfilter.org/projects/"
9602 "libnetfilter_acct/files/"
9603 "libnetfilter_acct-" version ".tar.bz2"))
9604 (sha256
9605 (base32
9606 "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22"))))
9607 (build-system gnu-build-system)
9608 (native-inputs (list pkg-config))
9609 (inputs (list libmnl))
9610 (synopsis "Library providing interface to extended accounting infrastructure")
9611 (description "libnetfilter_acct is the userspace library providing interface
9612to extended accounting infrastructure.
9613
9614@enumerate
9615@item
9616creating accounting objects
9617@item
9618retrieving accounting objects (and atomically set to zero)
9619@item
9620deleting accounting objects
9621@end enumerate
9622For the nfnetlink_acct subsystem.")
9623 (home-page "https://netfilter.org/projects/libnetfilter_acct/index.html")
9624 (supported-systems (filter target-linux? %supported-systems))
9625 (properties '((upstream-name . "libnetfilter_acct")))
9626 (license license:lgpl2.1+)))
9627
9628(define-public nfacct
9629 (package
9630 (name "nfacct")
9631 (version "1.0.2")
9632 (source
9633 (origin
9634 (method url-fetch)
9635 (uri (string-append "https://netfilter.org/projects/" name
9636 "/files/nfacct-" version ".tar.bz2"))
9637 (sha256
9638 (base32
9639 "0sdxbxjyapbqcp2ami5jd10vz4xbbdvx39f3wfy1iqsbflc25zzc"))))
9640 (build-system gnu-build-system)
9641 (native-inputs (list pkg-config))
9642 (inputs (list libmnl libnetfilter-acct))
9643 (synopsis "Command line tool to create/retrieve/delete accounting objects")
9644 (description "nfacct is the command line tool to create/retrieve/delete
9645accounting objects
9646@enumerate
9647@item
9648listing the objects of the nfacct table in plain text/XML
9649@item
9650atomically get and reset objects of the nfacct table
9651@item
9652adding new objects to the nfacct table
9653@item
9654deleting objects from the nfacct table
9655@end enumerate")
9656 (home-page "https://netfilter.org/projects/nfacct/index.html")
9657 (supported-systems (filter target-linux? %supported-systems))
9658 (license license:gpl2+)))
9659
9660(define-public libnetfilter-log
9661 (package
9662 (name "libnetfilter-log")
9663 (version "1.0.2")
9664 (source
9665 (origin
9666 (method url-fetch)
9667 (uri (string-append "https://netfilter.org/projects/"
9668 "libnetfilter_log/files/"
9669 "libnetfilter_log-" version ".tar.bz2"))
9670 (sha256
9671 (base32
9672 "1spy9xs41v76kid5ana8n126f3mvgq6fjibbfbj4kn0larbhix73"))))
9673 (build-system gnu-build-system)
9674 (native-inputs (list pkg-config))
9675 (inputs (list libnfnetlink libmnl))
9676 (synopsis "Library providing interface to packets logged by netfilter")
9677 (description "libnetfilter_log is a userspace library providing interface to
9678packets that have been logged by the kernel packet filter. It is is part of a
9679system that deprecates the old syslog/dmesg based packet logging. This library
9680has been previously known as libnfnetlink_log.
9681
9682@enumerate
9683@item
9684receiving to-be-logged packets from the kernel nfnetlink_log subsystem
9685@end enumerate")
9686 (home-page "https://netfilter.org/projects/libnetfilter_log/index.html")
9687 (supported-systems (filter target-linux? %supported-systems))
9688 (properties '((upstream-name . "libnetfilter_log")))
9689 (license license:gpl2+)))
9690
9691(define-public ulogd
9692 (package
9693 (name "ulogd")
9694 (version "2.0.7")
9695 (source
9696 (origin
9697 (method url-fetch)
9698 (uri (string-append "https://netfilter.org/projects/" name
9699 "/files/ulogd-" version ".tar.bz2"))
9700 (sha256
9701 (base32
9702 "0ax9959c4bapq78n13bbaibcf1gwjir3ngx8l2dh45lw9m4ha2lr"))))
9703 (build-system gnu-build-system)
9704 (outputs '("out"
9705 ;; additional non-default output plugins
9706 "json" "pcap" "sqlite3" "pgsql" "mysql"))
9707 (native-inputs (list pkg-config))
9708 (inputs (list libnfnetlink
9709 libmnl
9710 libnetfilter-log
9711 libnetfilter-conntrack
9712 libnetfilter-acct
9713 sqlite
9714 libpcap
9715 jansson
9716 postgresql
9717 (list mariadb "dev")
9718 zlib
9719 openssl))
9720 (arguments
9721 (list #:configure-flags
9722 #~(list (string-append "--with-pgsql="
9723 (assoc-ref %build-inputs "postgresql"))
9724 (string-append "--with-mysql="
9725 (assoc-ref %build-inputs "mariadb")))
9726 #:phases
9727 #~(modify-phases %standard-phases
9728 (add-after 'install 'install-doc
9729 (lambda _
9730 (let ((out-etc (string-append #$output "/etc"))
9731 (ulogd.conf "ulogd.conf"))
9732 (mkdir-p out-etc)
9733 (copy-file ulogd.conf (string-append out-etc "/"
9734 ulogd.conf)))))
9735 (add-after 'install 'setup-plugin-outputs
9736 (lambda* (#:key outputs #:allow-other-keys)
9737 (with-directory-excursion
9738 (string-append #$output "/lib/ulogd/")
9739 (for-each
9740 (lambda (output-name)
9741 (let ((output-dir (string-append
9742 (assoc-ref outputs output-name)
9743 "/lib/ulogd/")))
9744 (mkdir-p output-dir)
9745 (for-each
9746 (lambda (plugin)
9747 (copy-file plugin (string-append output-dir plugin))
9748 (delete-file plugin))
9749 (find-files "."
9750 (string-append "ulogd_output_"
9751 (string-upcase output-name)
9752 ".*$")))))
9753 (list "json" "pcap" "sqlite3" "pgsql" "mysql"))))))))
9754 (synopsis "Logging daemon for netfilter and iptables")
9755 (description "ulogd is a userspace logging daemon for netfilter/iptables
9756related logging. This includes per-packet logging of security violations,
9757per-packet logging for accounting, per-flow logging and flexible user-defined
9758accounting.
9759
9760@enumerate
9761@item
9762Packet and flow-based traffic accounting
9763@item
9764Flexible user-defined traffic accounting via nfacct infrastructure
9765@item
9766SQL database back-end support: SQLite3, PostgreSQL, MySQL
9767@item
9768Text-based output formats: CSV, XML, Netfilter's LOG, Netfilter's conntrack
9769@end enumerate")
9770 (home-page "https://netfilter.org/projects/nfacct/index.html")
9771 (supported-systems (filter target-linux? %supported-systems))
9772 (license license:gpl2)))
9773
9774(define-public proot
9775 (package
9776 (name "proot")
9777 (version "5.4.0")
9778 (source
9779 (origin
9780 (method git-fetch)
9781 (uri (git-reference
9782 (url "https://github.com/proot-me/PRoot")
9783 (commit (string-append "v" version))))
9784 (file-name (git-file-name name version))
9785 (sha256
9786 (base32 "186qsg4yvisqjgf8w5jxhnlig7x341vpqwcgp8as3r59qmqkpmk7"))
9787 ;; Waiting for upstream inclusion at
9788 ;; https://github.com/proot-me/proot/pull/355
9789 (patches (search-patches "proot-add-clone3.patch"
9790 "proot-add-missing-include.patch"))))
9791 (build-system gnu-build-system)
9792 ;; Many architectures are not supported (see:
9793 ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
9794 (supported-systems '("x86_64-linux" "i686-linux"
9795 "armhf-linux" "aarch64-linux" "i586-gnu" "x86_64-gnu"))
9796 (arguments
9797 ;; Disable the test suite on armhf-linux, as there are too many
9798 ;; failures to keep track of (see for example:
9799 ;; https://github.com/proot-me/proot/issues/286).
9800 `(#:tests? ,(not (or (%current-target-system)
9801 (string-prefix? "armhf"
9802 (or (%current-system)))))
9803 #:make-flags '("-C" "src")
9804 #:phases (modify-phases %standard-phases
9805 (add-after 'unpack 'patch-sources
9806 (lambda* (#:key inputs #:allow-other-keys)
9807 (substitute* (find-files "src" "\\.[ch]$")
9808 (("\"/bin/sh\"")
9809 (string-append "\"" (assoc-ref inputs "bash")
9810 "/bin/sh\"")))
9811
9812 (substitute* "src/GNUmakefile"
9813 (("/bin/echo") (which "echo"))
9814 (("^VERSION = .*")
9815 (string-append "VERSION := " ,version "\n")))
9816
9817 (substitute* (find-files "test" "\\.sh$")
9818 ;; Some of the tests try to "bind-mount" /bin/true.
9819 (("-b /bin/true:")
9820 (string-append "-b " (which "true") ":"))
9821 ;; Likewise for /bin.
9822 (("-b /bin:") "-b /gnu:")
9823 ;; Others try to run /bin/sh.
9824 (("/bin/sh") (which "sh"))
9825 ;; Others assume /etc/fstab exists.
9826 (("/etc/fstab") "/etc/passwd"))
9827 (substitute* "test/GNUmakefile"
9828 (("-b /bin:") "-b /gnu:"))
9829 (substitute* "test/test-c6b77b77.mk"
9830 (("/bin/bash") (which "bash"))
9831 (("/usr/bin/test") (which "test")))
9832 (substitute* "test/test-16573e73.c"
9833 (("/bin/([a-z-]+)" _ program)
9834 (which program)))
9835 (substitute* "test/test-5467b986.sh"
9836 (("-w /usr") "-w /gnu")
9837 (("-w usr") "-w gnu")
9838 (("/usr/share") "/gnu/store")
9839 (("share") "store"))
9840 (substitute* "test/test-092c5e26.sh"
9841 (("-q echo ")
9842 "-q $(which echo) "))
9843
9844 ;; The socket tests requires networking.
9845 (for-each delete-file
9846 (find-files "test" "test-socket.*\\.sh$"))))
9847 (delete 'configure)
9848 (add-after 'build 'build-manpage
9849 (lambda _
9850 (with-directory-excursion "doc"
9851 (invoke "make" "proot/man.1" "SUFFIX=.py"))))
9852 (replace 'check
9853 (lambda* (#:key tests? #:allow-other-keys)
9854 (when tests?
9855 (let ((n (parallel-job-count)))
9856 ;; Most of the tests expect "/bin" to be in $PATH so
9857 ;; they can run things that live in $ROOTFS/bin.
9858 (setenv "PATH"
9859 (string-append (getenv "PATH") ":/bin"))
9860 (invoke "make" "check" "-C" "test"
9861 ;;"V=1"
9862 "-j" (number->string n))))))
9863 (replace 'install
9864 (lambda* (#:key outputs #:allow-other-keys)
9865 ;; The 'install' rule does nearly nothing.
9866 (let* ((out (assoc-ref outputs "out"))
9867 (man1 (string-append out "/share/man/man1")))
9868 ;; TODO: 'make install-care' (does not even
9869 ;; build currently.)
9870 (invoke "make" "-C" "src" "install"
9871 (string-append "PREFIX=" out))
9872 (mkdir-p man1)
9873 (copy-file "doc/proot/man.1"
9874 (string-append man1 "/proot.1"))))))))
9875 (native-inputs (list which
9876 ;; For 'mcookie', used by some of the tests.
9877 util-linux
9878 coreutils
9879 pkg-config
9880 ;; For rst2man, used to generate the manual page.
9881 python-docutils-0.19))
9882 (inputs (list libarchive talloc))
9883 (home-page "https://github.com/proot-me/PRoot")
9884 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
9885 (description
9886 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
9887and @code{binfmt_misc}. This means that users don't need any privileges or
9888setup to do things like using an arbitrary directory as the new root
9889file system, making files accessible somewhere else in the file system
9890hierarchy, or executing programs built for another CPU architecture
9891transparently through QEMU user-mode. Also, developers can use PRoot as a
9892generic process instrumentation engine thanks to its extension mechanism.
9893Technically PRoot relies on @code{ptrace}, an unprivileged system-call
9894available in the kernel Linux.")
9895 (license license:gpl2+)))
9896
9897(define-public proot-static
9898 (package
9899 (inherit proot)
9900 (name "proot-static")
9901 (synopsis
9902 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
9903 (inputs `(("talloc" ,talloc/static)))
9904 (arguments
9905 (substitute-keyword-arguments (package-arguments proot)
9906 ((#:make-flags flags)
9907 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
9908 ((#:phases phases)
9909 `(modify-phases ,phases
9910 (add-after 'strip 'remove-store-references
9911 (lambda* (#:key outputs #:allow-other-keys)
9912 (let* ((out (assoc-ref outputs "out")))
9913 (with-directory-excursion out
9914 (remove-store-references "bin/proot")
9915 #t))))))
9916 ((#:allowed-references _ '("out"))
9917 '("out"))))))
9918
9919(define-public cpuid
9920 (package
9921 (name "cpuid")
9922 (version "20230614")
9923 (source (origin
9924 (method url-fetch)
9925 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
9926 version ".src.tar.gz"))
9927 (sha256
9928 (base32
9929 "1s54qc1j10d765r05kw9pzwzaxq2b0nndq2ifwq7cq62xx2k1j5i"))))
9930 (build-system gnu-build-system)
9931 (arguments
9932 (list #:make-flags
9933 #~(list (string-append "CC=" #$(cc-for-target)))
9934 #:tests? #f ; no tests
9935 #:phases
9936 #~(modify-phases %standard-phases
9937 (delete 'configure) ; no configure script
9938 (add-before 'install 'fix-makefile
9939 (lambda* (#:key outputs #:allow-other-keys)
9940 (substitute* "Makefile"
9941 (("\\$\\(BUILDROOT\\)/usr")
9942 (assoc-ref outputs "out"))))))))
9943 (inputs (list perl))
9944 (supported-systems '("i686-linux" "x86_64-linux"))
9945 (home-page "https://www.etallen.com/cpuid.html")
9946 (synopsis "Dump x86 CPUID processor information")
9947 (description "cpuid dumps detailed information about the CPU(s) gathered
9948from the CPUID instruction, and also determines the exact model of CPU(s). It
9949supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
9950NexGen, Rise, and SiS CPUs.")
9951 (license license:gpl2+)))
9952
9953(define-public jmtpfs
9954 (package
9955 (name "jmtpfs")
9956 (version "0.5")
9957 (source
9958 (origin
9959 (method git-fetch)
9960 (uri (git-reference
9961 (url "https://github.com/JasonFerrara/jmtpfs")
9962 (commit (string-append "v" version))))
9963 (file-name (git-file-name name version))
9964 (sha256
9965 (base32
9966 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
9967 (build-system gnu-build-system)
9968 (inputs
9969 (list file fuse-2 libmtp))
9970 (native-inputs
9971 (list pkg-config))
9972 (home-page "https://github.com/JasonFerrara/jmtpfs")
9973 (synopsis "Use a FUSE file system to access data over MTP")
9974 (description "jmtpfs uses @acronym{FUSE, File system in USEr space} to
9975provide access to data over @acronym{MTP, the Media Transfer Protocol}.
9976Unprivileged users can mount the MTP device as a file system.")
9977 (license license:gpl3)))
9978
9979(define-public procenv
9980 (package
9981 (name "procenv")
9982 (version "0.60")
9983 (source
9984 (origin
9985 (method git-fetch)
9986 (uri (git-reference
9987 (url "https://github.com/jamesodhunt/procenv")
9988 (commit version)))
9989 (file-name (git-file-name name version))
9990 (sha256
9991 (base32 "00d7q0h4qjc8lg435lq77lp2fx6ikm5piq90m81mr1dqqna1g6pz"))))
9992 (build-system gnu-build-system)
9993 (native-inputs
9994 (list pkg-config
9995 ;; For tests.
9996 check groff))
9997 (inputs
9998 (list expat libcap libselinux))
9999 (synopsis "Utility to show process environment")
10000 (description
10001 "Procenv is a command-line tool that displays as much detail about
10002itself and its environment as possible. It can be used as a test
10003tool, to understand the type of environment a process runs in, and for
10004comparing system environments.")
10005 (home-page "https://github.com/jamesodhunt/procenv/")
10006 (license license:gpl3+)))
10007
10008(define-public cassini-headers
10009 (package
10010 (name "cassini-headers")
10011 (version "12.0.1")
10012 (home-page "https://github.com/HewlettPackard/shs-cassini-headers")
10013 (source (origin
10014 (method git-fetch)
10015 (uri (git-reference
10016 (url home-page)
10017 (commit (string-append "release/shs-" version))))
10018 (file-name (git-file-name name version))
10019 (sha256
10020 (base32
10021 "0fvhk42pssw67zba4zq1b73d1m9ysc4g8sfibjmmhc0fwr92iamp"))))
10022 (build-system copy-build-system)
10023 (arguments
10024 (list #:install-plan
10025 #~'(("include" "include")
10026 ("share/cassini-headers" "share/cassini-headers"))))
10027 (synopsis "Cassini network hardware definitions and headers")
10028 (description
10029 "This package provides hardware definitions and C headers for use by
10030the Linux driver and by user-space applications for the Cassini/Slingshot
10031high-speed network interconnect made by HPE (formerly Cray). User-land
10032software uses @file{cxi_prov_hw.h} from this package.")
10033 ;; As per include/cxi_prov_hw.h it is __aarch64__ or __x86_64__ only.
10034 (supported-systems '("x86_64-linux" "aarch64-linux"))
10035 (license (list license:gpl2 license:bsd-2)))) ;dual-licensed
10036
10037(define-public cxi-driver
10038 (package
10039 (name "cxi-driver")
10040 (version "13.0.0")
10041 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10042 (source
10043 (origin
10044 (method git-fetch)
10045 (uri (git-reference
10046 (url home-page)
10047 (commit (string-append "release/shs-" version))))
10048 (file-name (git-file-name name version))
10049 (sha256
10050 (base32
10051 "1md6ammah7ywk5k9gsxix945w5498hpdfwzr603aiirlz2x4m4wh"))))
10052 ;; TODO: Actually build the Linux driver.
10053 (build-system copy-build-system)
10054 (arguments
10055 (list #:install-plan #~'(("include" "include"))))
10056 (propagated-inputs (list cassini-headers))
10057 (synopsis "Linux driver for the Cassini/Slingshot interconnect")
10058 (description
10059 "This is the Linux driver for the Cray/HPE Cassini 1 and 2 high-speed
10060network interconnect (aka. Slingshot), and its Ethernet driver. It includes
10061the @file{uapi/misc/cxi.h} C header file for use by user-land software.
10062
10063Currently the Linux driver itself is missing from this package.")
10064 (license license:gpl2+)))
10065
10066(define-public cxi-driver-for-libfabric-1
10067 ;; This old version defines constants such as 'CXI_MAP_IOVA_ALLOC' that
10068 ;; libfabric 1.22.0 relies on.
10069 (let ((commit "5f0ec0ead6ef3f98542a2ef5e76b89d14dd22150")
10070 (revision "0"))
10071 (package
10072 (inherit cxi-driver)
10073 (name "cxi-driver")
10074 (version (git-version "1.0.0" ;per .spec file
10075 revision commit))
10076 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10077 (source
10078 (origin
10079 (method git-fetch)
10080 (uri (git-reference (url home-page) (commit commit)))
10081 (file-name (git-file-name name version))
10082 (sha256
10083 (base32
10084 "19cly014ihgdidrc1aki2xsbfhpc0g73v0vxcky8r27xza7rz5bg")))))))
10085
10086(define-public libcxi
10087 (package
10088 (name "libcxi")
10089 (version "13.0.0")
10090 (home-page "https://github.com/HewlettPackard/shs-libcxi")
10091 (source
10092 (origin
10093 (method git-fetch)
10094 (uri (git-reference (url home-page)
10095 (commit (string-append "release/shs-" version))))
10096 (file-name (git-file-name name version))
10097 (sha256
10098 (base32 "1m8mds1h8plhfn2ja9br31xaiy82ky69685cp1rznanl18inaiff"))))
10099 (build-system gnu-build-system)
10100 (arguments
10101 (list #:configure-flags
10102 #~(list "--disable-static"
10103 (string-append "--with-udevrulesdir="
10104 #$output "/lib/udev/rules.d"))
10105
10106 #:phases
10107 #~(modify-phases %standard-phases
10108 (add-before 'configure 'set-cassini-file-names
10109 (lambda* (#:key inputs #:allow-other-keys)
10110 (substitute* "utils/cxi_dump_csrs.py"
10111 (("/usr/share/cassini-headers/csr_defs.json")
10112 (search-input-file
10113 inputs
10114 "/share/cassini-headers/csr_defs.json"))))))))
10115 (native-inputs (list autoconf
10116 automake
10117 libtool
10118 pkg-config
10119 python-wrapper))
10120 (inputs (list libconfig
10121 libuv
10122 fuse-2
10123 libyaml
10124 libnl
10125 numactl
10126 eudev
10127 (list lm-sensors "lib")))
10128 (propagated-inputs (list cassini-headers cxi-driver))
10129 (synopsis "Interface to the Cassini/Slingshot high-speed interconnect")
10130 (description
10131 "Libcxi provides applications with a low-level interface to the
10132Cray/HPE Cassini high-speed @acronym{NIC, network interface controller}, also
10133known as Slingshot.")
10134
10135 ;; License is spelled out in 'cray-libcxi.spec' and in source file
10136 ;; headers.
10137 (license (list license:lgpl2.1+ license:bsd-3)))) ;dual-licensed
10138
10139(define-public libfabric
10140 (package
10141 (name "libfabric")
10142 (version "2.3.1")
10143 (source
10144 (origin
10145 (method url-fetch)
10146 (uri
10147 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
10148 version "/libfabric-" version ".tar.bz2"))
10149 (sha256
10150 (base32 "0npkfkkhyir31r2p1zsfi7yrvcam60fp8ps4s2csjc2drqbrz4rf"))))
10151 (build-system gnu-build-system)
10152 (inputs
10153 (let ((if-supported ;XXX: modified from openmpi
10154 (lambda (package . extra)
10155 (if (and (not (%current-target-system))
10156 (member (%current-system)
10157 (package-transitive-supported-systems package)))
10158 (cons package extra)
10159 '()))))
10160 (append (list rdma-core libnl)
10161 (if-supported psm)
10162 (if-supported psm2)
10163 (if-supported libcxi curl json-c))))
10164 (arguments
10165 (list #:configure-flags
10166 #~(append (if #$(target-64bit?)
10167 (list "--enable-efa")
10168 '())
10169 (list #$@(if (this-package-input "libcxi")
10170 #~("--enable-cxi")
10171 #~())
10172 "--enable-verbs"))
10173 #:phases
10174 #~(modify-phases %standard-phases
10175 (add-after 'install 'remove-libtool-archive
10176 (lambda _
10177 ;; 'libfabric.la' has '-ljson-c' without a corresponding
10178 ;; '-L' in 'dependency_libs', which in turn causes users
10179 ;; such as Open MPI to fail at link time due to '-ljson-c'
10180 ;; not being found, even when building a shared library.
10181 ;; So, remove the .la file.
10182 (delete-file
10183 (string-append #$output
10184 "/lib/libfabric.la")))))))
10185 (home-page "https://ofiwg.github.io/libfabric/")
10186 (synopsis "Open Fabric Interfaces")
10187 (description
10188 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
10189communication services to applications. OFI is best described as a collection
10190of libraries and applications used to export fabric services. The key
10191components of OFI are: application interfaces, provider libraries, kernel
10192services, daemons, and test applications.
10193
10194Libfabric is a core component of OFI. It is the library that defines and
10195exports the user-space API of OFI, and is typically the only software that
10196applications deal with directly. It works in conjunction with provider
10197libraries, which are often integrated directly into libfabric.")
10198 (license (list license:bsd-2 license:gpl2)))) ;dual
10199
10200(define-public libfabric-1 ;needed by Open MPI 4.x
10201 (package
10202 (inherit libfabric)
10203 (version "1.22.0")
10204 (source
10205 (origin
10206 (method url-fetch)
10207 (uri
10208 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
10209 version "/libfabric-" version ".tar.bz2"))
10210 (sha256
10211 (base32 "1znmw83rmippv0fwz0x7lgylfk17dr9ckll8lrm4z7kclspnqpj8"))))
10212 (inputs
10213 (modify-inputs (package-inputs libfabric)
10214 (append cxi-driver-for-libfabric-1)))))
10215
10216(define-public psm
10217 (package
10218 (name "psm")
10219 (version "3.3.20170428")
10220 (home-page "https://github.com/intel/psm")
10221 (source
10222 (origin
10223 (method git-fetch)
10224 (uri (git-reference (url home-page)
10225 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
10226 (file-name (string-append "psm-" version ".tar.gz"))
10227 (sha256
10228 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
10229 (patches (search-patches
10230 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
10231 "psm-ldflags.patch" ; build shared lib with LDFLAGS
10232 "psm-repro.patch" ; reproducibility
10233 "psm-disable-memory-stats.patch"))
10234 (modules '((guix build utils)))
10235 (snippet
10236 ;; That file declares its own 'strlcat' as static. To avoid a
10237 ;; conflict with the function now in glibc 2.39, give it a
10238 ;; different name.
10239 #~(substitute* "ptl_ips/ips_proto_dump.c"
10240 (("strlcat")
10241 "psm_custom_strlcat")))))
10242 (build-system gnu-build-system)
10243 (outputs '("out" "debug"))
10244 (inputs `(("libuuid" ,util-linux "lib")))
10245 (arguments
10246 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
10247 ,(string-append "INSTALL_PREFIX=" %output)
10248 ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
10249 " -funwind-tables -O3 -g3"
10250 " -DPSM_USE_SYS_UUID"
10251 " -Wno-strict-aliasing -DNVALGRIND"
10252 " -fcommon")
10253 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
10254 #:tests? #f
10255 #:phases (modify-phases %standard-phases
10256 (delete 'configure)
10257 (add-after 'unpack 'patch-/usr/include
10258 (lambda _
10259 (substitute* "Makefile"
10260 (("\\$\\{DESTDIR}/usr/include")
10261 (string-append %output "/include")))
10262 (substitute* "Makefile"
10263 (("/lib64") "/lib"))
10264 #t))
10265 (add-after 'unpack 'patch-sysmacros
10266 (lambda _
10267 (substitute* "ipath/ipath_proto.c"
10268 (("#include <sys/poll.h>" m)
10269 (string-append m "\n"
10270 "#include <sys/sysmacros.h>")))
10271 #t)))))
10272 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
10273 (description
10274 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
10275communications interface for the True Scale family of products. PSM users are
10276enabled with mechanisms necessary to implement higher level communications
10277interfaces in parallel environments.")
10278 ;; Only Intel-compatible processors are supported.
10279 (supported-systems '("i686-linux" "x86_64-linux"))
10280 (license (list license:bsd-2 license:gpl2)))) ;dual
10281
10282(define-public snapscreenshot
10283 (package
10284 (name "snapscreenshot")
10285 (version "1.0.14.3")
10286 (source
10287 (origin
10288 (method url-fetch)
10289 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
10290 name "-" version ".tar.bz2"))
10291 (sha256
10292 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
10293 (build-system gnu-build-system)
10294 (arguments
10295 `(#:make-flags
10296 (let ((out (assoc-ref %outputs "out")))
10297 (list (string-append "BINDIR=" out "/bin")
10298 (string-append "MANDIR=" out "/share/man")))
10299 #:tests? #f ; no test suite
10300 #:phases
10301 (modify-phases %standard-phases
10302 (delete 'configure) ; ./configure is a snarky no-op
10303 (add-before 'install 'fix-ownership
10304 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
10305 (lambda _
10306 (substitute* "depfun.mak"
10307 ((" -o bin -g bin ") " "))
10308 #t))
10309 (add-before 'install 'create-output-directories
10310 (lambda* (#:key outputs #:allow-other-keys)
10311 (let ((out (assoc-ref outputs "out")))
10312 (mkdir-p (string-append out "/share/man/man1"))
10313 #t))))))
10314 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
10315 (synopsis "Take screenshots of one or more Linux text consoles")
10316 (description
10317 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
10318Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
10319relevant @file{/dev/vcs*} file(s).")
10320 (license license:gpl2)))
10321
10322(define-public fbcat
10323 (package
10324 (name "fbcat")
10325 (version "0.5.2")
10326 (source
10327 (origin
10328 (method url-fetch)
10329 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
10330 version "/" name "-" version ".tar.gz"))
10331 (sha256
10332 (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
10333 (build-system gnu-build-system)
10334 (inputs
10335 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
10336 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
10337 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
10338 `(("pnmtopng" ,netpbm)))
10339 (outputs (list "out" "fbgrab"))
10340 (arguments
10341 `(#:make-flags
10342 (list "CC=gcc"
10343 (string-append "PREFIX=" (assoc-ref %outputs "out")))
10344 #:tests? #f ; no tests
10345 #:phases
10346 (modify-phases %standard-phases
10347 (delete 'configure) ; no configure script
10348 (add-after 'build 'qualify-references
10349 (lambda* (#:key inputs outputs #:allow-other-keys)
10350 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
10351 (out (assoc-ref outputs "out")))
10352 (substitute* "fbgrab"
10353 (("fbcat" all)
10354 (string-append out "/bin/" all))
10355 (("pnmtopng" all)
10356 (string-append pnmtopng "/bin/" all))))))
10357 (add-after 'install 'split-fbgrab-output
10358 (lambda* (#:key outputs #:allow-other-keys)
10359 (let* ((out (assoc-ref outputs "out"))
10360 (out:fbgrab (assoc-ref outputs "fbgrab")))
10361 (for-each (lambda (file)
10362 (let ((old (string-append out "/" file))
10363 (new (string-append out:fbgrab "/" file)))
10364 (mkdir-p (dirname new))
10365 (rename-file old new)))
10366 (list "bin/fbgrab"
10367 "share/man/man1/fbgrab.1"))))))))
10368 (home-page "https://jwilk.net/software/fbcat")
10369 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
10370 (description
10371 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
10372a dump thereof. It supports a wide range of drivers and pixel formats.
10373
10374@command{fbcat} can take screenshots of virtually any application that can be
10375made to write its output to the framebuffer, including (but not limited to)
10376text-mode or graphical applications that don't use a display server.
10377
10378Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
10379emulates the behaviour of Gunnar Monell's older fbgrab utility.")
10380 (license license:gpl2)))
10381
10382(define-public fbgrab
10383 (package
10384 (name "fbgrab")
10385 (version "1.5")
10386 (source (origin
10387 (method git-fetch)
10388 (uri (git-reference
10389 (url "https://github.com/GunnarMonell/fbgrab")
10390 (commit version)))
10391 (file-name (git-file-name name version))
10392 (sha256
10393 (base32
10394 "1npn7l8jg0nhjraybjl38v8635zawzmn06ql3hs3vhci1vi1r90r"))))
10395 (build-system gnu-build-system)
10396 (arguments
10397 (list #:tests? #f ;no test suite
10398 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
10399 (string-append "DESTDIR=" #$output))
10400 #:phases #~(modify-phases %standard-phases
10401 (add-after 'unpack 'strip-/usr-prefix
10402 (lambda _
10403 (substitute* "Makefile"
10404 (("/usr") ""))))
10405 (delete 'configure))))
10406 (inputs (list libpng zlib))
10407 (home-page "https://github.com/GunnarMonell/fbgrab")
10408 (synopsis "Linux framebuffer screenshot/conversion utility")
10409 (description "FBGrab is a framebuffer screenshot program that captures the
10410Linux framebuffer and converts it to a PNG image. It can also convert a
10411framebuffer dump file (copy) to a PNG image.")
10412 (license license:gpl2))) ;GPL 2.0 only (per SPDX identifier in fbgrab.c)
10413
10414(define-public libcgroup
10415 (package
10416 (name "libcgroup")
10417 (version "3.2.0")
10418 (home-page "https://github.com/libcgroup/libcgroup")
10419 (source
10420 (origin
10421 (method url-fetch)
10422 (uri (string-append
10423 "https://github.com/libcgroup/libcgroup/releases/download/v"
10424 version "/" name "-" version ".tar.gz"))
10425 (sha256
10426 (base32 "1zmxhqp8kj2n7yvj82nsy5sx07yrxj4r37w41lz5q8bpqgbc43ws"))))
10427 (build-system gnu-build-system)
10428 (arguments
10429 ;; Tests are virtualized with lxc, it is not very feasible
10430 ;; to make them executable under guix build. Also, note that
10431 ;; origin is using source tarball release which is prepared
10432 ;; after testing.
10433 (list #:tests? #f
10434 #:configure-flags
10435 #~'("--disable-systemd")))
10436 (native-inputs
10437 (list bison flex))
10438 (inputs
10439 (list linux-pam))
10440 (synopsis "Control groups management tools")
10441 (description "Control groups is Linux kernel method for process resource
10442restriction, permission handling and more. This package provides userspace
10443interface to this kernel feature.")
10444 (license license:lgpl2.1)))
10445
10446(define-public mbpfan
10447 (package
10448 (name "mbpfan")
10449 (version "2.4.0")
10450 (source
10451 (origin
10452 (method git-fetch)
10453 (uri (git-reference
10454 (url "https://github.com/dgraziotin/mbpfan")
10455 (commit (string-append "v" version))))
10456 (file-name (git-file-name name version))
10457 (sha256
10458 (base32 "146sshsjafi26n741jvi9mdbazwf74jlacxfwkky4fhbq98idlhp"))))
10459 (build-system gnu-build-system)
10460 (arguments
10461 (list #:tests? #f ; tests ask to be run as root
10462 #:make-flags
10463 #~(list (string-append "DESTDIR=" #$output)
10464 (string-append "CC=" #$(cc-for-target)))
10465 #:phases
10466 #~(modify-phases %standard-phases
10467 (add-after 'unpack 'patch-paths
10468 (lambda _
10469 (substitute* "Makefile"
10470 (("/usr") ""))))
10471 (delete 'configure)))) ; there's no configure phase
10472 (home-page "https://github.com/dgraziotin/mbpfan")
10473 (synopsis "Control fan speed on Macbooks")
10474 (description
10475 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
10476the @code{coretemp} module and sets the fan speed using the @code{applesmc}
10477module. It can be executed as a daemon or in the foreground with root
10478privileges.")
10479 (license license:gpl3+)))
10480
10481(define-public psm2
10482 (package
10483 (name "psm2")
10484 (version "12.0")
10485 (source (origin
10486 (method git-fetch)
10487 (uri (git-reference
10488 (url "https://github.com/intel/opa-psm2")
10489 ;; tag 'psm-v12.0' = commit ad5dd1b
10490 (commit (string-append "psm-v" version))))
10491 (file-name (git-file-name name version))
10492 (sha256
10493 (base32
10494 "04nar65ac11qqx41vkfs7iip8kfiah0zms7l4rmsxncpiz2iqfik"))
10495 (patches
10496 (search-patches
10497 "psm2-compile-ctor-without-avx.patch"))
10498 (modules '((guix build utils)))
10499 (snippet
10500 ;; That file declares its own 'strlcat' as static. To avoid a
10501 ;; conflict with the function now in glibc 2.39, give it a
10502 ;; different name.
10503 #~(substitute* "ptl_ips/ips_proto_dump.c"
10504 (("strlcat")
10505 "psm2_custom_strlcat")))))
10506 (build-system gnu-build-system)
10507 (arguments
10508 (list #:make-flags
10509 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
10510 #:tests? #f
10511 #:phases #~(modify-phases %standard-phases
10512 (delete 'configure)
10513 (add-after 'unpack 'patch-Makefiles
10514 (lambda _
10515 (substitute* "Makefile"
10516 (("/lib64") "/lib")
10517 (("/usr") ""))
10518 (substitute* "compat/Makefile"
10519 (("/lib64") "/lib")
10520 (("/usr") ""))))
10521 (replace 'install
10522 (lambda _
10523 (setenv "DESTDIR" #$output)
10524 (invoke "make" "install"))))))
10525 (inputs
10526 (list rdma-core numactl))
10527 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
10528 (description
10529 "This package is low-level user-level Intel's communications interface.
10530The PSM2 API is a high-performance vendor-specific protocol that provides a
10531low-level communications interface for the Intel Omni-Path family of
10532high-speed networking devices.")
10533 (home-page "https://github.com/intel/opa-psm2")
10534 ;; Only the x86_64 architecture is supported.
10535 (supported-systems '("x86_64-linux"))
10536 (license (list license:bsd-3 license:gpl2)))) ; dual
10537
10538(define-public libpfm4
10539 (package
10540 (name "libpfm4")
10541 (version "4.9.0")
10542 (source (origin
10543 (method url-fetch)
10544 (uri (string-append "mirror://sourceforge/perfmon2/"
10545 name "/libpfm-" version ".tar.gz"))
10546 (sha256
10547 (base32
10548 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
10549 (build-system gnu-build-system)
10550 (arguments
10551 '(#:modules ((guix build utils)
10552 (guix build gnu-build-system))
10553 #:phases (modify-phases %standard-phases
10554 (delete 'configure)
10555 (delete 'check)
10556 (replace 'build
10557 (lambda* (#:key inputs outputs #:allow-other-keys)
10558 (let* ((out (assoc-ref outputs "out")))
10559 (setenv "CC" "gcc")
10560 (setenv "CFLAGS" "-Wno-format-truncation")
10561 (invoke "make")
10562 #t)))
10563 (replace 'install
10564 (lambda* (#:key outputs #:allow-other-keys)
10565 (let* ((out (assoc-ref outputs "out")))
10566 (invoke "make"
10567 (string-append "PREFIX=" out)
10568 "install")
10569 #t))))))
10570 (synopsis "Performance event monitoring library")
10571 (description
10572 "This package provides a library called libpfm4, which is used to develop
10573monitoring tools exploiting the performance monitoring events such as those
10574provided by the Performance Monitoring Unit (PMU) of modern processors.
10575
10576Libpfm4 helps convert from an event name, expressed as a string, to the event
10577encoding that is either the raw event as documented by the hardware vendor or
10578the OS-specific encoding. In the latter case, the library is able to prepare
10579the OS-specific data structures needed by the kernel to setup the event.
10580
10581libpfm4 provides support for the @code{perf_events} interface, which was
10582introduced in Linux 2.6.31.")
10583 (home-page "https://perfmon2.sourceforge.net/")
10584 (license license:expat)))
10585
10586(define-public libnfnetlink
10587 (package
10588 (name "libnfnetlink")
10589 (version "1.0.2")
10590 (source (origin
10591 (method url-fetch)
10592 (uri (string-append
10593 "https://www.netfilter.org/projects/libnfnetlink/files/"
10594 "libnfnetlink-" version ".tar.bz2"))
10595 (sha256
10596 (base32
10597 "0xn3rcrzxr6g82kfxzs9bqn2zvl2kf2yda30drwb9vr6sk1wfr5h"))))
10598 (build-system gnu-build-system)
10599 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
10600 (synopsis "Low-level netfilter netlink communication library")
10601 (description
10602 "@code{libnfnetlink} is the low-level library for netfilter related
10603kernel/userspace communication. It provides a generic messaging
10604infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
10605nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
10606management tools in userspace.")
10607 (license license:gpl2)))
10608
10609(define-public libinih
10610 (package
10611 (name "libinih")
10612 (version "57")
10613 (source (origin
10614 (method git-fetch)
10615 (uri (git-reference
10616 (url "https://github.com/benhoyt/inih")
10617 (commit (string-append "r" version))))
10618 (file-name (git-file-name name version))
10619 (sha256
10620 (base32
10621 "03hpyahdkipm5wfalj2xkz6y9ncd9zrlhnf7vap6lr56jj2fz2bb"))))
10622 (build-system meson-build-system)
10623 ;; Install static libraries for use by the initrd's xfsprogs/static.
10624 (outputs (list "out" "static"))
10625 (arguments
10626 `(#:configure-flags
10627 (list "-Ddistro_install=true"
10628 "-Ddefault_library=both")
10629 #:phases
10630 (modify-phases %standard-phases
10631 (add-after 'install 'separate-static
10632 (lambda* (#:key outputs #:allow-other-keys)
10633 (let ((out (assoc-ref outputs "out"))
10634 (static (assoc-ref outputs "static")))
10635 (with-directory-excursion out
10636 (for-each (lambda (source)
10637 (let ((target (string-append static "/" source)))
10638 (mkdir-p (dirname target))
10639 (rename-file source target)))
10640 (find-files "lib" "\\.a$")))))))))
10641 (home-page "https://github.com/benhoyt/inih")
10642 (synopsis "Simple .INI parser library for C")
10643 (description "The inih (INI Not Invented Here) library is a simple .INI file
10644parser written in C. It's only a couple of pages of code, and it was designed to
10645be small and simple, so it's good for embedded systems. It's also more or less
10646compatible with Python's ConfigParser style of .INI files, including RFC
10647822-style multi-line syntax and name: value entries.")
10648 (license license:bsd-3)))
10649
10650(define-public simpleini
10651 (let ((commit "6048871ea9ee0ec24be5bd099d161a10567d7dc2")
10652 (revision "1"))
10653 (package
10654 (name "simpleini")
10655 (version (git-version "4.22" revision commit))
10656 (source (origin
10657 (method git-fetch)
10658 (uri (git-reference
10659 (url "https://github.com/brofield/simpleini")
10660 (commit commit)))
10661 (file-name (git-file-name name version))
10662 (sha256
10663 (base32
10664 "1szaflnrzw1zx9v5g6mbbiaf9wfglp4n4jjq2793k9ryz3qxil9j"))))
10665 (build-system cmake-build-system)
10666 (arguments
10667 (list #:configure-flags #~(list "-DSIMPLEINI_USE_SYSTEM_GTEST=ON")))
10668 (native-inputs (list googletest))
10669 (home-page "https://github.com/brofield/simpleini")
10670 (synopsis "Simple API to read and write INI-style files")
10671 (description
10672 "SimpleIni provides a simple API to read and write INI-style
10673configuration files. It supports data files in ASCII, MBCS and Unicode.")
10674 (license license:expat))))
10675
10676(define-public xfsprogs
10677 (package
10678 (name "xfsprogs")
10679 (version "6.12.0")
10680 (source (origin
10681 (method url-fetch)
10682 (uri (string-append
10683 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
10684 "xfsprogs-" version ".tar.gz"))
10685 (sha256
10686 (base32
10687 "1n46n27fxx1137kni3drrhzhp1l8ksxabcsmi8yzxbhpbnl4q293"))))
10688 (build-system gnu-build-system)
10689 (outputs (list "out" "python"))
10690 (arguments
10691 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
10692 #:configure-flags
10693 (list "--disable-static")
10694 #:make-flags
10695 (list "V=1")
10696 #:phases
10697 (modify-phases %standard-phases
10698 (add-after 'install 'separate-python-output
10699 (lambda* (#:key outputs #:allow-other-keys)
10700 (let ((out (assoc-ref outputs "out"))
10701 (python (assoc-ref outputs "python")))
10702 (for-each
10703 (lambda (script)
10704 (mkdir-p (string-append python (dirname script)))
10705 (rename-file (string-append out script)
10706 (string-append python script)))
10707 (list "/sbin/xfs_scrub_all")))))
10708 (add-after 'install 'install-headers
10709 (lambda* (#:key make-flags #:allow-other-keys)
10710 (apply invoke "make" "install-dev" make-flags))))))
10711 (native-inputs
10712 ;; riscv64 needs >= gcc-13.3.0 for liburcu.
10713 (append
10714 (if (target-riscv64?)
10715 (list gcc-14)
10716 '())
10717 (list gettext-minimal)))
10718 (inputs
10719 `(("libinih" ,libinih)
10720 ("liburcu" ,liburcu)
10721 ("libuuid" ,util-linux "lib")
10722 ("python" ,python-wrapper)))
10723 (home-page "https://xfs.wiki.kernel.org/")
10724 (synopsis "XFS file system tools")
10725 (description "This package provides commands to create and check XFS
10726file systems.")
10727 ;; The library "libhandle" and the headers in "xfslibs-dev" are
10728 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
10729 (license (list license:gpl2 license:lgpl2.1))))
10730
10731(define-public xfsprogs-5.9
10732 (package
10733 (inherit xfsprogs)
10734 (name "xfsprogs")
10735 (version "5.9.0")
10736 (source (origin
10737 (method url-fetch)
10738 (uri (string-append
10739 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
10740 "xfsprogs-" version ".tar.gz"))
10741 (sha256
10742 (base32
10743 "13xkn9jpmwp4fm9r68vhgznkmxhnv83n2b39mhy2qdaph90w2a1l"))))
10744 (arguments
10745 (substitute-keyword-arguments (package-arguments xfsprogs)
10746 ((#:configure-flags configure-flags '())
10747 `(cons "--enable-gettext=no"
10748 ,configure-flags))))
10749 (native-inputs
10750 (modify-inputs (package-native-inputs xfsprogs)
10751 (delete "gettext-minimal")))))
10752
10753(define-public xfsprogs/static
10754 (package
10755 (inherit xfsprogs)
10756 (name "xfsprogs-static")
10757 (outputs (list "out"))
10758 (arguments
10759 (substitute-keyword-arguments (package-arguments xfsprogs)
10760 ((#:configure-flags configure-flags '())
10761 `(append ,configure-flags
10762 (list "--enable-static")))
10763 ((#:make-flags make-flags ''())
10764 `(cons* "LLDFLAGS=-all-static" ,make-flags))
10765 ((#:phases _ ''())
10766 `(modify-phases %standard-phases
10767 (add-after 'install 'delete-useless-files
10768 (lambda* (#:key outputs #:allow-other-keys)
10769 (with-directory-excursion (assoc-ref outputs "out")
10770 (for-each delete-file-recursively
10771 (list "include" "lib")))))))))
10772 (inputs
10773 `(("libinih:static" ,libinih "static")
10774 ("util-linux:static" ,util-linux "static")
10775 ,@(remove (match-lambda
10776 ((label . _)
10777 (member label '("python"))))
10778 (package-inputs xfsprogs))))
10779 (synopsis "Statically linked XFS file system tools")))
10780
10781(define-public xfs_repair/static
10782 (package
10783 (name "xfs_repair-static")
10784 (version (package-version xfsprogs/static))
10785 (source #f)
10786 (build-system trivial-build-system)
10787 (arguments
10788 `(#:modules ((guix build utils))
10789 #:builder
10790 (begin
10791 (use-modules (guix build utils))
10792 (let* ((xfsprogs (assoc-ref %build-inputs "xfsprogs"))
10793 (out (assoc-ref %outputs "out"))
10794 (sbin (string-append out "/sbin")))
10795 (install-file (string-append xfsprogs "/sbin/xfs_repair") sbin)
10796 (with-directory-excursion sbin
10797 (remove-store-references "xfs_repair"))))))
10798 (inputs
10799 `(("xfsprogs" ,xfsprogs/static)))
10800 (home-page (package-home-page xfsprogs/static))
10801 (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
10802 (description
10803 "This package provides a statically linked @command{xfs_repair} taken
10804from the xfsprogs package. It is meant to be used in initrds.")
10805 (license (package-license xfsprogs/static))))
10806
10807(define-public genext2fs
10808 (package
10809 (name "genext2fs")
10810 (version "1.5.0")
10811 (source (origin
10812 (method git-fetch)
10813 (uri (git-reference
10814 (url "https://github.com/bestouff/genext2fs")
10815 (commit "474111097321f03de9e009aa9f7d4a8948e310b2")))
10816 (file-name (git-file-name name version))
10817 (sha256
10818 (base32 "14lgvml5zz99845ja47jpf4iirjzfqv36ffzachh3hw2ggji9c7l"))))
10819 (build-system gnu-build-system)
10820 (native-inputs
10821 (list autoconf automake))
10822 (home-page "https://github.com/bestouff/genext2fs")
10823 (synopsis "Generate ext2 file system as a normal user")
10824 (description "This package provides a program to generate an ext2
10825file system as a normal (non-root) user. It does not require you to mount
10826the image file to copy files on it, nor does it require that you become
10827the superuser to make device nodes.")
10828 (license license:gpl2)))
10829
10830(define-public fakeroot
10831 (package
10832 (name "fakeroot")
10833 (version "1.37.1.2")
10834 (source
10835 (origin
10836 ;; There are no tags in the repository, so take this snapshot.
10837 (method url-fetch)
10838 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
10839 "fakeroot/fakeroot_" version ".orig.tar.gz"))
10840 (file-name (string-append name "-" version ".tar.gz"))
10841 (sha256
10842 (base32 "091jym16c4m4qjf5yclksvx7nw4sl7v5yrkz6z46wrwaij99d54m"))
10843 (modules '((guix build utils)
10844 (ice-9 ftw)))
10845 (snippet
10846 `(begin
10847 ;; Delete pregenerated man page translations, but not the originals.
10848 (with-directory-excursion "doc"
10849 (for-each (lambda (language)
10850 (for-each delete-file
10851 (find-files language "\\.[0-9]$")))
10852 (scandir "."
10853 (lambda (file)
10854 (and (not (string-prefix? "." file))
10855 (eq? 'directory
10856 (stat:type (lstat file))))))))))))
10857 (build-system gnu-build-system)
10858 (arguments
10859 `(#:configure-flags
10860 (list "--disable-static")
10861 #:phases
10862 (modify-phases %standard-phases
10863 (add-after 'unpack 'patch-Makefile.am
10864 (lambda _
10865 (substitute* "Makefile.am"
10866 (("/bin/sh") (which "sh")))))
10867 (add-after 'unpack 'patch-script
10868 (lambda* (#:key inputs #:allow-other-keys)
10869 (substitute* "scripts/fakeroot.in"
10870 (("getopt")
10871 (string-append (assoc-ref inputs "util-linux")
10872 "/bin/getopt"))
10873 (("sed")
10874 (string-append (assoc-ref inputs "sed")
10875 "/bin/sed"))
10876 (("cat|cut" command)
10877 (string-append (assoc-ref inputs "coreutils")
10878 "/bin/" command)) )))
10879 (replace 'bootstrap
10880 (lambda _
10881 ;; The "preroll" script takes care of Autoconf and also
10882 ;; prepares the translated manuals.
10883 (invoke "sh" "./preroll")))
10884 (add-before 'configure 'setenv
10885 (lambda _
10886 (setenv "LIBS" "-lacl")))
10887 (add-before 'check 'prepare-check
10888 (lambda _
10889 (setenv "SHELL" (which "bash"))
10890 (setenv "VERBOSE" "1")
10891 (substitute* "test/t.touchinstall"
10892 ;; We don't have the name of the root user, so use ID=0.
10893 (("grep root") "grep \"\\<0\\>\""))
10894 (substitute* "test/tartest"
10895 ;; We don't have the name of the root group, so use ID=0.
10896 (("ROOTGROUP=root") "ROOTGROUP=0")
10897 ;; We don't have the name of the daemon user, so use IDs.
10898 (("daemon:sys") "1:3")
10899 (("daemon:") "1:"))
10900 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
10901 (substitute* "test/compare-tar"
10902 (("tar -tvf") "tar --numeric-owner -tvf")))))))
10903 (native-inputs
10904 (list autoconf-2.71 automake gettext-minimal libtool po4a
10905 perl sharutils xz)) ; for tests
10906 (inputs
10907 (list acl libcap util-linux sed coreutils))
10908 (synopsis "Run commands in an environment with fake root privileges")
10909 (description
10910 "@command{fakeroot} runs a command in an environment where it appears to
10911have root privileges for file manipulation. This is useful for allowing users
10912to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
10913them with root permissions and/or ownership.
10914
10915Without fakeroot, one would have to have root privileges to create the
10916constituent files of the archives with the correct permissions and ownership,
10917and then pack them up, or one would have to construct the archives directly,
10918without using the archiver.")
10919 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
10920 (license license:gpl3+)))
10921
10922(define-public fakechroot
10923 ;; XXX: Build from the change submitted at
10924 ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
10925 ;; against glibc 2.33. Switch back to the official repository on the next
10926 ;; release.
10927 (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
10928 (revision "0"))
10929 (package
10930 (name "fakechroot")
10931 (version (git-version "2.20.1" revision commit))
10932 (source (origin
10933 (method git-fetch)
10934 (uri (git-reference
10935 (url "https://github.com/lipnitsk/fakechroot")
10936 (commit commit)))
10937 (file-name (git-file-name name version))
10938 (sha256
10939 (base32
10940 "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
10941 (build-system gnu-build-system)
10942 (arguments
10943 ;; XXX: The tests heavily assume they run on an FHS system so for now
10944 ;; skip them.
10945 '(#:tests? #f
10946 #:configure-flags '("--disable-static")))
10947 (native-inputs (list autoconf automake libtool perl))
10948 (synopsis "Emulate @code{chroot} by overriding file system calls")
10949 (description
10950 "@command{fakechroot} runs a command in an environment were is additional
10951possibility to use @code{chroot} command without root privileges. This is
10952useful for allowing users to create own chrooted environment with possibility
10953to install another packages without need for root privileges.
10954
10955It works by providing @file{libfakechroot.so}, a shared library meant to be
10956set as @code{LD_PRELOAD} to override the C library file system functions.")
10957 (home-page "https://github.com/dex4er/fakechroot/")
10958 (license license:lgpl2.1+))))
10959
10960(define-public falcosecurity-libs
10961 (package
10962 (name "falcosecurity-libs")
10963 (version "0.20.0")
10964 (source (origin
10965 (method git-fetch)
10966 (uri (git-reference
10967 (url "https://github.com/falcosecurity/libs/")
10968 (commit version)))
10969 (file-name (git-file-name name version))
10970 (sha256
10971 (base32
10972 "041ir9wk44v7isidwl7fzxrjvs85j637wcr7xirasd8ysxa0r4qv"))
10973 (patches
10974 (search-patches
10975 "falcosecurity-libs-bpf-probes-fix.patch"
10976 "falcosecurity-libs-shared-build.patch"))))
10977 (build-system cmake-build-system)
10978 (arguments
10979 (list
10980 #:configure-flags
10981 #~(list "-DUSE_BUNDLED_DEPS=OFF"
10982 "-DBUILD_DRIVER=OFF"
10983 "-DENABLE_DKMS=OFF"
10984 "-DBUILD_LIBSCAP_MODERN_BPF=ON"
10985 "-DSCAP_FILES_SUITE_ENABLE=OFF" ;attempts to download scap files
10986 "-DBUILD_SHARED_LIBS=ON"
10987 #$(string-append "-DFALCOSECURITY_LIBS_VERSION=" version))
10988 ;; Only the libsinsp test suite is run, as the one for libscap requires
10989 ;; elevated privileges.
10990 #:modules '((guix build cmake-build-system)
10991 ((guix build gnu-build-system) #:prefix gnu:)
10992 (guix build utils))
10993 #:phases
10994 #~(modify-phases %standard-phases
10995 (add-after 'unpack 'disable-problematic-tests
10996 (lambda _
10997 (substitute* "userspace/libsinsp/test/user.ut.cpp"
10998 ;; The 'system_lookup' test assumes a root user
10999 ;; exists in the build environment.
11000 (("TEST_F\\(usergroup_manager_test, system_lookup)")
11001 "TEST_F(usergroup_manager_test, DISABLED_system_lookup)"))))
11002 (replace 'check
11003 (lambda* (#:rest args)
11004 (apply (assoc-ref gnu:%standard-phases 'check)
11005 #:test-target "run-unit-test-libsinsp" args)))
11006 (add-after 'install 'delete-src
11007 (lambda _
11008 (delete-file-recursively
11009 (string-append #$output "/src")))))))
11010 (native-inputs
11011 (list bpftool
11012 clang-18 ;avoid stack limit exceeded build error
11013 googletest
11014 pkg-config
11015 valijson)) ;header-only library
11016 (inputs
11017 (list elfutils))
11018 (propagated-inputs
11019 ;; The following inputs are in the 'Requires' field of libscap.pc,
11020 ;; libsinp.pc or libpman.pc.
11021 (list c-ares
11022 grpc
11023 jsoncpp
11024 libbpf
11025 libelf
11026 openssl
11027 protobuf
11028 uthash ;included in libscap headers
11029 zlib
11030 ;; These are in the 'Requires.private' field of libscap.pc and
11031 ;; libsinp.pc. They are required because the headers are installed
11032 ;; to a non-standard directory, and thus need to be found via the
11033 ;; 'Cflags' field, which in turn mandates that both the pkg-config
11034 ;; modules listed in the 'Requires' and 'Requires.private' be
11035 ;; available.
11036 curl
11037 re2
11038 tbb))
11039 (home-page "https://github.com/falcosecurity/libs/")
11040 (synopsis "Falco security libraries")
11041 (description "The Falco security libraries include @code{libsinsp} and
11042@code{libscap}. @code{libscap} manages the data capture process, while
11043@code{libsinsp} is a system inspection library that enriches events from
11044@code{libscap} with machine state. @code{libsinsp} also performs events
11045filtering with rule evaluation through its internal rule engine. These
11046libraries are used by the @command{sysdig} command-line utility.")
11047 (license license:asl2.0)))
11048
11049(define-public inputattach
11050 (package
11051 (name "inputattach")
11052 (version "0.42.0")
11053 (source (origin
11054 (method git-fetch)
11055 (uri (git-reference
11056 (url "https://github.com/linuxwacom/input-wacom")
11057 (commit (string-append "input-wacom-" version))))
11058 (file-name (git-file-name name version))
11059 (sha256
11060 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
11061 (build-system gnu-build-system)
11062 (arguments
11063 `(#:phases
11064 (modify-phases %standard-phases
11065 (delete 'bootstrap)
11066 (delete 'configure)
11067 (replace 'build
11068 (lambda* (#:key inputs #:allow-other-keys)
11069 (with-directory-excursion "inputattach"
11070 (invoke "gcc" "-O2" "-o" "inputattach"
11071 "inputattach.c"))))
11072 (delete 'check)
11073 (replace 'install
11074 (lambda* (#:key outputs #:allow-other-keys)
11075 (let ((target-dir (string-append
11076 (assoc-ref outputs "out")
11077 "/bin/")))
11078 (mkdir-p target-dir)
11079 (copy-file "inputattach/inputattach"
11080 (string-append target-dir
11081 "inputattach"))
11082 #t))))))
11083 (home-page "https://linuxwacom.github.io/")
11084 (synopsis "Dispatch input peripherals events to a device file")
11085 (description "inputattach dispatches input events from several device
11086types and interfaces and translates so that the X server can use them.")
11087 (license license:gpl2+)))
11088
11089(define-public keyd
11090 (package
11091 (name "keyd")
11092 (version "2.5.0")
11093 (source
11094 (origin
11095 (method git-fetch)
11096 (uri (git-reference
11097 (url "https://github.com/rvaiya/keyd")
11098 (commit (string-append "v" version))))
11099 (sha256
11100 (base32
11101 "0nkra6lwdjhjcwj6486cgy562n4bcp98fjgl52rj8pp76i15yad7"))))
11102 (arguments
11103 (list #:tests? #f ; tests require root
11104 #:make-flags
11105 #~(list (string-append "CC=" #$(cc-for-target))
11106 "PREFIX="
11107 (string-append "DESTDIR=" #$output))
11108 #:phases
11109 '(modify-phases
11110 %standard-phases
11111 (delete 'configure)))) ; no autoconf
11112 (build-system gnu-build-system)
11113 (inputs (list linux-libre-headers))
11114 (synopsis "Key remapping daemon for Linux")
11115 (description
11116 "Keyd is a keyboard remapping utility with intuitive ini configuration
11117file format. Keyd has several features, many of which are traditionally only
11118found in custom keyboard firmware like QMK.")
11119 (home-page "https://github.com/rvaiya/keyd")
11120 (license license:expat)))
11121
11122(define-public pipewire
11123 (package
11124 (name "pipewire")
11125 (version "1.4.5")
11126 (source (origin
11127 (method git-fetch)
11128 (uri (git-reference
11129 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11130 (commit version)))
11131 (file-name (git-file-name name version))
11132 (sha256
11133 (base32
11134 "1k3b412zspmx2v0finb5g8kns8xsynlnz48cmlcg7ch62av6kw75"))))
11135 (build-system meson-build-system)
11136 (arguments
11137 (list
11138 #:configure-flags
11139 #~(list (string-append "-Dudevrulesdir=" #$output "/lib/udev/rules.d")
11140 "-Dman=enabled"
11141 "-Drlimits-install=false"
11142 "-Dsession-managers=[]"
11143 "-Dsysconfdir=/etc"
11144 "-Dsystemd=disabled")))
11145 (native-inputs
11146 (list `(,glib "bin")
11147 pkg-config
11148 doxygen
11149 python
11150 python-docutils))
11151 (inputs (list alsa-lib
11152 avahi
11153 bluez
11154 dbus
11155 eudev
11156 ffmpeg
11157 gst-plugins-base
11158 gstreamer
11159 jack-2
11160 ldacbt
11161 libcamera
11162 libdrm
11163 libfdk
11164 libfreeaptx
11165 libsndfile
11166 libusb
11167 openssl ; raop sink
11168 libva
11169 pulseaudio
11170 readline ; for pw-cli
11171 sbc
11172 vulkan-headers
11173 vulkan-loader
11174 webrtc-audio-processing))
11175 (home-page "https://pipewire.org/")
11176 (synopsis "Server and user space API to deal with multimedia pipelines")
11177 (description
11178 "PipeWire is a project that aims to greatly improve handling of audio and
11179video under Linux. It aims to support the usecases currently handled by both
11180PulseAudio and Jack and at the same time provide same level of powerful handling
11181of Video input and output. It also introduces a security model that makes
11182interacting with audio and video devices from containerized applications easy,
11183with supporting Flatpak applications being the primary goal. Alongside Wayland
11184and Flatpak we expect PipeWire to provide a core building block for the future
11185of Linux application development.")
11186 (license license:lgpl2.0+)))
11187
11188(define-public pipewire-minimal
11189 ;; Used as libpipewire to reduce closure size and avoid dependency cycles.
11190 (hidden-package
11191 (package
11192 (inherit pipewire)
11193 (name "pipewire-minimal")
11194 (arguments
11195 (list
11196 #:configure-flags
11197 #~(list "-Dsession-managers=[]"
11198 "-Ddbus=disabled"
11199 "-Dflatpak=disabled"
11200 ;; XXX: Otherwise test_loop will fail with:
11201 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11202 (string-append "-Dc_link_args=-Wl,-rpath=" #$output "/lib"
11203 " -lgcc_s")
11204 "-Db_asneeded=false")))
11205 (native-inputs '())
11206 (inputs '()))))
11207
11208(define-public wireplumber
11209 (package
11210 (name "wireplumber")
11211 (version "0.5.12")
11212 (source
11213 (origin
11214 (method git-fetch)
11215 (uri (git-reference
11216 (url
11217 "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
11218 (commit version)))
11219 (file-name (git-file-name name version))
11220 (sha256
11221 (base32 "1dljz669ywy1lvvn0jh14ymynmbii45q5vay71zajpcg31249dyw"))))
11222 (build-system meson-build-system)
11223 (arguments
11224 `(#:configure-flags '("-Dsystemd=disabled"
11225 "-Dsystem-lua=true")))
11226 (native-inputs
11227 (list `(,glib "bin")
11228 pkg-config python-minimal))
11229 (inputs (list dbus elogind glib lua pipewire))
11230 (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
11231 (synopsis "Session / policy manager implementation for PipeWire")
11232 (description "WirePlumber is a modular session / policy manager for
11233PipeWire and a GObject-based high-level library that wraps PipeWire's API,
11234providing convenience for writing the daemon's modules as well as external
11235tools for managing PipeWire.")
11236 (license license:expat)))
11237
11238(define-public wireplumber-minimal
11239 (let ((base wireplumber))
11240 (package
11241 (inherit base)
11242 (name "wireplumber-minimal")
11243 (arguments
11244 (substitute-keyword-arguments (package-arguments base)
11245 ((#:configure-flags flags ''())
11246 #~(cons "-Delogind=disabled" #$flags))))
11247 (inputs
11248 (modify-inputs (package-inputs base)
11249 (delete "elogind"))))))
11250
11251(define-public ell
11252 (package
11253 (name "ell")
11254 (version "0.79")
11255 (source (origin
11256 (method git-fetch)
11257 (uri (git-reference
11258 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
11259 (commit version)))
11260 (file-name (git-file-name name version))
11261 (sha256
11262 (base32
11263 "0l8pbgnza58ivknzl3nd6y46mfminhnb3iwq82msi6g282wv7np4"))
11264 (modules '((guix build utils)))
11265 (snippet
11266 #~(begin
11267 (substitute* "Makefile.am"
11268 ;; requires hwdb.bin
11269 (("unit/test-hwdb.*") ""))))))
11270 (build-system gnu-build-system)
11271 (arguments
11272 ;; Tests launch dbus-daemon instances that all try to bind to
11273 ;; "/tmp/ell-test-bus". Thus, we need to run them sequentially.
11274 '(#:parallel-tests? #f))
11275 (inputs
11276 (list dbus))
11277 (native-inputs
11278 (list autoconf automake libtool pkg-config procps))
11279 (home-page "https://01.org/ell")
11280 (synopsis "Embedded Linux Library")
11281 (description "The Embedded Linux* Library (ELL) provides core, low-level
11282functionality for system daemons. It typically has no dependencies other than
11283the Linux kernel, C standard library, and libdl (for dynamic linking). While
11284ELL is designed to be efficient and compact enough for use on embedded Linux
11285platforms, it is not limited to resource-constrained systems.")
11286 (license license:lgpl2.1+)))
11287
11288(define-public kexec-tools
11289 (package
11290 (name "kexec-tools")
11291 (version "2.0.31")
11292 (source (origin
11293 (method url-fetch)
11294 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
11295 "/kexec/kexec-tools-" version ".tar.xz"))
11296 (sha256
11297 (base32
11298 "0c9cj9xvcm81gcwnkvvh9vh82v59kdz5llmblc2wkqb6vh6kb3wa"))))
11299 (build-system gnu-build-system)
11300 (arguments
11301 ;; There are no automated tests.
11302 '(#:tests? #f))
11303 ;; This variant of binutils is used for the 64 bit support needed to
11304 ;; assemble the `purgatory/arch/i386/compat_x86_64.S' program on i686-linux.
11305 (native-inputs (list (make-ld-wrapper "ld-wrapper"
11306 #:binutils binutils)
11307 binutils))
11308 (home-page "https://projects.horms.net/projects/kexec/")
11309 (synopsis "Tools for booting directly into different kernels")
11310 (description "This package provides the @code{kexec} program and ancillary
11311utilities. Using @code{kexec}, it is possible to boot directly into a new
11312kernel from the context of an already-running kernel, bypassing the normal
11313system boot process.")
11314 (supported-systems (delete "riscv64-linux" %supported-systems))
11315 (license license:gpl2)))
11316
11317(define-public cachefilesd
11318 (package
11319 (name "cachefilesd")
11320 (version "0.10.10")
11321 (source (origin
11322 (method url-fetch)
11323 (uri (string-append
11324 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
11325 "/cachefilesd.git/snapshot/cachefilesd-"
11326 version ".tar.gz"))
11327 (sha256
11328 (base32
11329 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
11330 (build-system gnu-build-system)
11331 (outputs '("out"))
11332 (arguments
11333 `(#:tests? #f ; there are no tests
11334 #:make-flags
11335 (let ((prefix-dir (lambda (var dir)
11336 (string-append var "=" %output "/" dir))))
11337 (list (string-append "CC=" ,(cc-for-target))
11338 (prefix-dir "SBINDIR" "sbin/")
11339 (prefix-dir "ETCDIR" "etc/")
11340 (prefix-dir "MANDIR" "share/man/")))
11341 #:phases (modify-phases %standard-phases (delete 'configure))))
11342 (home-page "https://people.redhat.com/~dhowells/cachefs/")
11343 (synopsis "CacheFiles userspace management daemon")
11344 (description "@code{cachefilesd} is a userspace daemon that manages the
11345cache data store that is used by network file systems such as @code{AFS} and
11346@code{NFS} to cache data locally on disk. The content of the cache is
11347persistent over reboots.")
11348 (license license:gpl2+)))
11349
11350(define-public libbpf
11351 (package
11352 (name "libbpf")
11353 (version "1.5.0")
11354 (source
11355 (origin
11356 (method git-fetch)
11357 (uri (git-reference
11358 (url "https://github.com/libbpf/libbpf")
11359 (commit (string-append "v" version))))
11360 (file-name (git-file-name name version))
11361 (sha256
11362 (base32
11363 "0j7rm76g2ss09vksm4nm2g5yq7df2z5qpjr4h6kd3959sc1rvxnh"))))
11364 (build-system gnu-build-system)
11365 (arguments
11366 (list
11367 #:tests? #f ;self-tests run in QEMU
11368 #:make-flags
11369 #~(list (string-append "PREFIX=" #$output)
11370 (string-append "LIBDIR=$(PREFIX)/lib")
11371 (string-append "CC=" #$(cc-for-target)))
11372 #:phases
11373 #~(modify-phases %standard-phases
11374 (delete 'configure)
11375 (add-before 'build 'pre-build
11376 (lambda _
11377 (chdir "src")))
11378 (replace 'install
11379 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
11380 (apply (assoc-ref %standard-phases 'install)
11381 (append args
11382 (list #:make-flags
11383 (append (list "install"
11384 ;; Also install the kernel
11385 ;; user API (uAPI) headers.
11386 "install_uapi_headers")
11387 make-flags)))))))))
11388 (native-inputs (list pkg-config))
11389 (propagated-inputs (list elfutils zlib)) ;in Requires.private of libbpf.pc
11390 (home-page "https://github.com/libbpf/libbpf")
11391 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
11392 (description
11393 "Libbpf supports building BPF CO-RE-enabled applications, which, in
11394contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
11395headers.")
11396 (license (list license:lgpl2.1 license:bsd-2))))
11397
11398(define-public libbpf-0.8
11399 (package
11400 (inherit libbpf)
11401 (name "libbpf")
11402 (version "0.8.1")
11403 (source
11404 (origin
11405 (method git-fetch)
11406 (uri (git-reference
11407 (url "https://github.com/libbpf/libbpf")
11408 (commit (string-append "v" version))))
11409 (file-name (git-file-name name version))
11410 (sha256
11411 (base32
11412 "1zzpkk4x3f20483dzw43b3ml03d63vvkmqf4j8y3b61b67wm59bm"))))
11413 (arguments
11414 (list
11415 #:tests? #f ;self-tests run in QEMU
11416 #:make-flags
11417 #~(list (string-append "PREFIX=" #$output)
11418 (string-append "LIBDIR=$(PREFIX)/lib")
11419 (string-append "CC=" #$(cc-for-target)))
11420 #:phases #~(modify-phases %standard-phases
11421 (delete 'configure)
11422 (add-before 'build 'pre-build
11423 (lambda _
11424 (chdir "src"))))))
11425 (native-inputs (list pkg-config))
11426 (propagated-inputs (list elfutils zlib)))) ;in Requires.private of libbpf.pc
11427
11428(define-public bcc
11429 (package
11430 (name "bcc")
11431 (version "0.30.0")
11432 (source
11433 (origin
11434 (method git-fetch)
11435 (uri (git-reference
11436 (url "https://github.com/iovisor/bcc")
11437 (commit (string-append "v" version))))
11438 (file-name (git-file-name name version))
11439 (sha256
11440 (base32
11441 "0b5la0yn6x6ll73drnrm5v5yibbrzkvl86hqivkrmnpgy8cqn0cy"))))
11442 (build-system cmake-build-system)
11443 (native-inputs
11444 (list bison
11445 flex
11446 (@ (gnu packages compression) zip)))
11447 (inputs
11448 (list bash-minimal ;for wrap-program
11449 clang-15
11450 elfutils
11451 luajit
11452 libbpf
11453 python-wrapper))
11454 (arguments
11455 (list
11456 ;; Tests all require root permissions and a "standard" file hierarchy.
11457 #:tests? #f
11458 #:configure-flags #~(list (string-append "-DREVISION=" #$version)
11459 "-DCMAKE_USE_LIBBPF_PACKAGE=ON")
11460 #:phases
11461 #~(modify-phases %standard-phases
11462 (add-after 'unpack 'substitute-libbc
11463 (lambda _
11464 (substitute* "src/python/bcc/libbcc.py"
11465 (("(libbcc\\.so.*)\\b" _ libbcc)
11466 (string-append #$output "/lib/" libbcc)))))
11467 (add-after 'install 'wrap-tools
11468 (lambda _
11469 (use-modules (ice-9 textual-ports))
11470 (let* ((out #$output)
11471 (lib (string-append out "/lib"))
11472 (tools (string-append out "/share/bcc/tools"))
11473 (python-executable?
11474 (lambda (filename _)
11475 (call-with-input-file filename
11476 (lambda (port)
11477 (string-contains (get-line port)
11478 "/bin/python"))))))
11479 (for-each (lambda (python-executable)
11480 (format #t "Wrapping: ~A.~%" python-executable)
11481 (wrap-program python-executable
11482 `("GUIX_PYTHONPATH" ":" prefix
11483 (,(string-append lib
11484 "/python"
11485 #$(version-major+minor
11486 (package-version python))
11487 "/site-packages")))))
11488 (find-files tools python-executable?))))))))
11489 (home-page "https://github.com/iovisor/bcc")
11490 (synopsis "Tools for BPF on Linux")
11491 (description
11492 "BCC is a toolkit for creating efficient kernel tracing and manipulation
11493programs, and includes several useful tools and examples. It makes use of
11494extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
11495that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
11496and above.")
11497 (license license:asl2.0)))
11498
11499(define-public bpftool
11500 (package
11501 (name "bpftool")
11502 (version (package-version linux-libre))
11503 (source (package-source linux-libre))
11504 (build-system gnu-build-system)
11505 (arguments
11506 `(#:tests? #f ;This package has no tests.
11507 #:phases (modify-phases %standard-phases
11508 (delete 'configure)
11509 (replace 'build
11510 (lambda* (#:key inputs #:allow-other-keys)
11511 (invoke "make" "-C" "tools/bpf/bpftool"
11512 ,(string-append "CC=" (cc-for-target)))))
11513 (replace 'install
11514 (lambda* (#:key outputs #:allow-other-keys)
11515 (let* ((out (assoc-ref outputs "out")))
11516 (mkdir-p (string-append out "/sbin"))
11517 (mkdir-p (string-append out
11518 "/share/bash-completion/completions"))
11519 (invoke "make"
11520 (string-append "prefix=" out)
11521 (string-append
11522 "bash_compdir=" out
11523 "/share/bash-completion/completions")
11524 "-C" "tools/bpf/bpftool"
11525 "install")))))))
11526 (inputs (list elfutils ;provides libelf
11527 readline libcap zlib))
11528 (native-inputs (list bison python-3))
11529 ;; This tool does not have a proper web page.
11530 (home-page
11531 "https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/bpf/bpftool")
11532 (synopsis "Tool for inspection and manipulation of eBPF programs and maps")
11533 (description "@command{bpftool} allows for inspection and simple
11534modification of BPF objects on the system.")
11535 (license (package-license linux-libre))))
11536
11537(define-public bpftrace
11538 (package
11539 (name "bpftrace")
11540 (version "0.21.2")
11541 (source
11542 (origin
11543 (method git-fetch)
11544 (uri (git-reference
11545 (url "https://github.com/bpftrace/bpftrace")
11546 (commit (string-append "v" version))))
11547 (file-name (git-file-name name version))
11548 (sha256
11549 (base32 "0icbhf1wk523a7lcmwqa67zc6hl6h02p5mfg26cizva447kbwsgz"))))
11550 (build-system cmake-build-system)
11551 (arguments
11552 (list
11553 #:test-exclude "(runtime_tests|tools-parsing-test)"
11554 #:phases
11555 #~(modify-phases %standard-phases
11556 ;; This patch also fixes broken compilation due to improper detection
11557 ;; of bfd features. This is taken from following upstream PR:
11558 ;; https://github.com/bpftrace/bpftrace/pull/3332
11559 (add-after 'unpack 'patch-paths-and-bfd-defs
11560 (lambda _
11561 (substitute* '("cmake/FindLibBfd.cmake"
11562 "src/CMakeLists.txt")
11563 (("LIBSFRAME_FOUND")
11564 "LIBSFRAME_LIBRARIES")
11565 (("LIBZSTD_FOUND")
11566 "LIBZSTD_LIBRARIES"))
11567 (with-directory-excursion "tests"
11568 (substitute* (find-files ".")
11569 (("/bin/sh")
11570 (which "sh")))
11571 (substitute* '("child.cpp"
11572 "runtime/call"
11573 "procmon.cpp")
11574 (("/bin/ls")
11575 (which "ls"))))))
11576 (add-after 'unpack 'fix-paths
11577 (lambda* (#:key inputs outputs #:allow-other-keys)
11578 (substitute* '("tests/child.cpp")
11579 (("/bin/sleep")
11580 (search-input-file inputs "bin/sleep")))))
11581 (add-before 'check 'set-test-filter
11582 (lambda _
11583 (setenv "GTEST_FILTER"
11584 (string-join
11585 (list ; "-" disables all following tests
11586 "-ast.probe_name_uprobe"
11587 "bpftrace.add_probes_uprobe_wildcard_file"
11588 "bpftrace.add_probes_uprobe_wildcard_file_uprobe_multi"
11589 "bpftrace.add_probes_usdt_wildcard"
11590 "Parser.multiple_attach_points_kprobe"
11591 "Parser.uretprobe_offset"
11592 "semantic_analyser.builtin_functions"
11593 "semantic_analyser.call_func"
11594 "semantic_analyser.call_uaddr")
11595 ":")))))))
11596 (native-inputs (list bison coreutils dwarves flex googletest xxd))
11597 (inputs (list bcc clang-15 elfutils libbpf libiberty cereal))
11598 (home-page "https://github.com/bpftrace/bpftrace")
11599 (synopsis "High-level tracing language for Linux eBPF")
11600 (description
11601 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
11602Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
11603LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
11604interacting with the Linux BPF system, as well as existing Linux tracing
11605capabilities: kernel dynamic tracing (kprobes), user-level dynamic
11606tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
11607and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
11608created by Alastair Robertson.")
11609 (license license:asl2.0)))
11610
11611(define-public ttyebus-linux-module
11612 (let ((revision "0")
11613 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
11614 (package
11615 (name "ttyebus-linux-module")
11616 (version (git-version "1.5" revision commit))
11617 (source
11618 (origin
11619 (method git-fetch)
11620 (uri (git-reference
11621 (url "https://github.com/eBUS/ttyebus")
11622 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
11623 (file-name (git-file-name name version))
11624 (sha256
11625 (base32
11626 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
11627 (supported-systems '("armhf-linux" "aarch64-linux"))
11628 (build-system linux-module-build-system)
11629 (arguments
11630 `(#:tests? #f))
11631 (home-page "https://github.com/eBUS/ttyebus")
11632 (synopsis "Low-latency Raspberry Pi UART driver")
11633 (description "This package provides a Linux kernel module that will
11634provide a serial device @code{/dev/ttyebus} with almost no latency upon
11635receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
11636 (license license:gpl3+))))
11637
11638(define-public ipset
11639 (package
11640 (name "ipset")
11641 (version "7.17")
11642 (source
11643 (origin
11644 (method url-fetch)
11645 (uri (string-append "https://ipset.netfilter.org/"
11646 "ipset-" version ".tar.bz2"))
11647 (sha256
11648 (base32 "1n34mkrdha9rggd0fizjx6baqkiqqd1yfhb5ml663mlx93zwjjdy"))))
11649 (build-system gnu-build-system)
11650 (inputs
11651 (list libmnl))
11652 (native-inputs
11653 (list pkg-config))
11654 (arguments
11655 `(#:configure-flags '("--disable-static"
11656 "--with-kmod=no")))
11657 (home-page "https://ipset.netfilter.org/")
11658 (synopsis "Administration tool for IP sets")
11659 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
11660can be administered by the ipset utility. Depending on the type,
11661currently an IP set may store IP addresses, (TCP/UDP) port numbers or
11662IP addresses with MAC addresses in a way which ensures lightning speed
11663when matching an entry against a set.
11664
11665If you want to
11666@itemize @bullet
11667@item store multiple IP addresses or port numbers and match against the entire
11668collection using a single iptables rule.
11669@item dynamically update iptables rules against IP addresses or ports without
11670performance penalty.
11671@item express complex IP address and ports based rulesets with a single
11672iptables rule and benefit from the speed of IP sets.
11673@end itemize\n
11674then IP sets may be the proper tool for you.")
11675 (license license:gpl2+)))
11676
11677(define-public liburing
11678 (package
11679 (name "liburing")
11680 (version "2.12")
11681 (source (origin
11682 (method git-fetch)
11683 (uri (git-reference
11684 (url "https://git.kernel.dk/liburing")
11685 (commit (string-append "liburing-" version))))
11686 (file-name (git-file-name name version))
11687 (sha256
11688 (base32
11689 "0vz3p7g0nzcg5bag7kqkdncigl9nc0vrzm07l8yww2gb529k6hxh"))))
11690 (build-system gnu-build-system)
11691 (arguments
11692 `(;; Tests are dependent on kernel version and features
11693 #:tests? #f
11694 #:phases
11695 (modify-phases %standard-phases
11696 (replace 'configure
11697 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
11698 ;; --enable-fast-install, and --build
11699 (lambda* (#:key outputs #:allow-other-keys)
11700 (let ((out (assoc-ref outputs "out")))
11701 (setenv "SHELL" (which "sh"))
11702 (setenv "CONFIG_SHELL" (which "sh"))
11703 (invoke "./configure" (string-append "--prefix=" out))))))))
11704 (home-page "https://github.com/axboe/liburing")
11705 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
11706 (description "This is the io_uring library, liburing. liburing provides
11707helpers to setup and teardown io_uring instances, and also a simplified
11708interface for applications that don't need (or want) to deal with the full
11709kernel side implementation.")
11710 (license license:expat)))
11711
11712(define-public erofs-utils
11713 (package
11714 (name "erofs-utils")
11715 (version "1.8.10")
11716 (source
11717 (origin
11718 (method git-fetch)
11719 (uri (git-reference
11720 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
11721 (commit (string-append "v" version))))
11722 (file-name (git-file-name name version))
11723 (sha256
11724 (base32 "1qlig9q1fdjl0zn7206dbv7w5ssjg4az4hg7y3vk69ly0zbmwkil"))))
11725 (build-system gnu-build-system)
11726 (inputs
11727 (list lz4
11728 `(,util-linux "lib")
11729 zlib))
11730 (native-inputs
11731 (list autoconf automake libtool pkg-config))
11732 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
11733 (synopsis "User-space tools for the EROFS file system")
11734 (description
11735 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
11736read-only file system optimized for resource-scarce devices. This package
11737provides user-space tools for creating EROFS file systems.")
11738 (license license:gpl2+)))
11739
11740(define-public rasdaemon
11741 (package
11742 (name "rasdaemon")
11743 (version "0.8.3")
11744 (source
11745 (origin
11746 (method git-fetch)
11747 (uri (git-reference
11748 (url "https://github.com/mchehab/rasdaemon")
11749 (commit (string-append "v" version))))
11750 (file-name (git-file-name name version))
11751 (sha256
11752 (base32 "0vfw4vf75fnpbxnfsmpdwdzhplnccz24j23bg6nsb3b4wa8hv4sa"))))
11753 (native-inputs (list autoconf automake libtool pkg-config))
11754 (inputs (list bash-minimal libtraceevent perl perl-dbd-sqlite sqlite dmidecode kmod))
11755 (arguments
11756 (list
11757 #:configure-flags
11758 #~(list "--enable-all"
11759 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
11760 "--with-sysconfdefdir=."
11761 "--localstatedir=/var")
11762 #:phases
11763 #~(modify-phases %standard-phases
11764 (add-after 'unpack 'rename-README
11765 (lambda _
11766 ;; Required by autoreconf
11767 (rename-file "README.md" "README")))
11768 (add-before 'configure 'munge-autotools
11769 (lambda _
11770 ;; For some reason upstream forces sysconfdir=/etc. This results
11771 ;; in EPERM during the install phase. Removing the offending
11772 ;; line lets sysconfdir correctly pick up DESTDIR.
11773 (substitute* "configure.ac"
11774 (("^test .* sysconfdir=/etc\n$") ""))))
11775 (add-after 'install 'wrap-rasdaemon
11776 (lambda* (#:key inputs #:allow-other-keys)
11777 (let ((path (map dirname
11778 (list (search-input-file inputs "/sbin/dmidecode")
11779 (search-input-file inputs "/bin/modprobe")))))
11780 (wrap-program (string-append #$output "/sbin/ras-mc-ctl")
11781 `("PATH" ":" prefix ,path)
11782 `("PERL5LIB" ":" prefix ,(string-split (getenv "PERL5LIB") #\:)))))))))
11783 (build-system gnu-build-system)
11784 (home-page "https://github.com/mchehab/rasdaemon")
11785 (synopsis "Platform Reliability, Availability, and Serviceability tools")
11786 (description
11787 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
11788Availability and Serviceability} reports from Linux kernel trace events.
11789These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
11790through standard log mechanisms like syslog.")
11791 (license license:gpl2)))
11792
11793(define-public renameat2
11794 ;; This is a Gist, with no release or tags.
11795 (let ((revision "0")
11796 (commit "5c5193f20142511a5fc7069a539f4e5aba0ea470"))
11797 (package
11798 (name "renameat2")
11799 (version (git-version "0.0.0" revision commit))
11800 (source (origin
11801 (method url-fetch)
11802 (uri (string-append "https://gist.githubusercontent.com/"
11803 "eatnumber1/f97ac7dad7b1f5a9721f/raw/"
11804 commit "/renameat2.c"))
11805 (sha256
11806 (base32
11807 "07b4hsxqjm610sdkm4nxhp0gnl2s7gzlh4zdnja5ay40v4x24bb9"))))
11808 (build-system gnu-build-system)
11809 (arguments
11810 (list
11811 #:tests? #f ;no test suite
11812 #:phases #~(modify-phases %standard-phases
11813 (delete 'configure)
11814 (replace 'build
11815 (lambda _
11816 (invoke #$(cc-for-target) "renameat2.c"
11817 "-o" "renameat2")))
11818 (replace 'install
11819 (lambda _
11820 (install-file "renameat2"
11821 (string-append #$output "/bin")))))))
11822 (home-page "https://gist.github.com/eatnumber1/f97ac7dad7b1f5a9721f")
11823 (synopsis "Command to call the renameat2 Linux system call")
11824 (description "This package provides a @command{renameat2} command that
11825calls the Linux-specific @code{renameat2} system call.")
11826 (license license:expat))))
11827
11828(define-public libgpiod
11829 (package
11830 (name "libgpiod")
11831 (version "2.2.2")
11832 (source
11833 (origin
11834 (method git-fetch)
11835 (uri
11836 (git-reference
11837 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
11838 (commit (string-append "v" version))))
11839 (file-name (git-file-name name version))
11840 (sha256 (base32 "10yiwrw80x0057w825zxmdbd54w9lbyf49bgqk1cryqapglfzqri"))))
11841 (build-system gnu-build-system)
11842 (arguments
11843 (list #:configure-flags
11844 #~(list "--enable-tools=yes"
11845 "--enable-bindings-cxx")))
11846 (native-inputs
11847 (list automake
11848 autoconf-2.71
11849 libtool
11850 autoconf-archive
11851 pkg-config))
11852 (synopsis "Interact with the Linux GPIO character device")
11853 (description
11854 "This package provides a C library with C++ bindings and
11855command-line tools for interacting with GPIO devices that avoids the usage of
11856older system-wide @file{/sys} interface.")
11857 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
11858 (license (list license:lgpl2.1+ ;; libgpiod
11859 license:gpl2+ ;; gpio-tools
11860 license:lgpl3+)))) ;; C++ bindings
11861
11862(define-public python-libgpiod
11863 (package
11864 (name "python-libgpiod")
11865 (version "2.3.0")
11866 (source
11867 (origin
11868 (method git-fetch)
11869 (uri
11870 (git-reference
11871 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
11872 (commit (string-append "python-v" version))))
11873 (file-name (git-file-name name version))
11874 (sha256 (base32 "1lkd7lgpb28pqf7p6lrwl0ss7r5ryiddmdcisnz6ixy796qhr8kr"))))
11875 (build-system pyproject-build-system)
11876 (arguments
11877 (list
11878 #:tests? #f ; tests require root, see README.md
11879 #:phases
11880 #~(modify-phases %standard-phases
11881 (add-after 'unpack 'cd-to-python-bindings
11882 (lambda _
11883 (chdir "bindings/python"))))))
11884 (native-inputs
11885 (list python-setuptools
11886 python-wheel
11887 libgpiod))
11888 (synopsis "Interact with the Linux GPIO character device")
11889 (description
11890 "This package provides Python bindings for interacting with GPIO devices
11891that avoids the usage of older system-wide @file{/sys} interface.")
11892 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
11893 (license (list license:lgpl2.1+ ;; libgpiod
11894 license:gpl2+ ;; gpio-tools
11895 license:lgpl3+)))) ;; C++ bindings
11896
11897(define-public libtraceevent
11898 (package
11899 (name "libtraceevent")
11900 (version "1.7.3")
11901 (source
11902 (origin
11903 (method git-fetch)
11904 (uri (git-reference
11905 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git")
11906 (commit (string-append name "-" version))))
11907 (file-name (git-file-name name version))
11908 (sha256
11909 (base32 "06mw2f0xnk6dy9w2z0n4dz7lnm02qfsmnmj2h24453qxlw57x0d6"))
11910 (modules '((guix build utils)))
11911 (snippet
11912 #~(begin
11913 (substitute* (list "Makefile" "scripts/utils.mk")
11914 (("/bin/(pwd)" _ command) command))))))
11915 (build-system gnu-build-system)
11916 (arguments
11917 (list
11918 #:tests? #f ; no test suite
11919 #:make-flags
11920 #~(list
11921 (string-append "pkgconfig_dir=" #$output "/lib/pkgconfig")
11922 (string-append "prefix=" #$output))
11923 #:phases
11924 #~(modify-phases %standard-phases
11925 (delete 'configure)))) ; no configure script
11926 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/")
11927 (synopsis "Linux kernel trace event library")
11928 (description
11929 "This library parses raw Linux kernel trace event formats.")
11930 (license (list license:gpl2
11931 license:lgpl2.1))))
11932
11933(define-public libtracefs
11934 (package
11935 (name "libtracefs")
11936 (version "1.7.0")
11937 (source
11938 (origin
11939 (method git-fetch)
11940 (uri (git-reference
11941 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git")
11942 (commit (string-append name "-" version))))
11943 (file-name (git-file-name name version))
11944 (sha256
11945 (base32 "0v896n3q0df0nxx5drbwyaqhrqiyxl06rvrdw3gp2r37awa9g1zb"))
11946 (modules '((guix build utils)))
11947 (snippet
11948 #~(begin
11949 (substitute* (list "Makefile" "scripts/utils.mk")
11950 (("/bin/(pwd)" _ command) command))))))
11951 (build-system gnu-build-system)
11952 (arguments
11953 (list
11954 #:tests? #f ; no test suite
11955 #:make-flags
11956 #~(list
11957 (string-append "CC=" #$(cc-for-target))
11958 (string-append "pkgconfig_dir=" #$output "/lib/pkgconfig")
11959 (string-append "prefix=" #$output))
11960 #:phases
11961 #~(modify-phases %standard-phases
11962 (delete 'configure)))) ; no configure script
11963 (native-inputs (list pkg-config))
11964 (inputs (list libtraceevent))
11965 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/")
11966 (synopsis "Linux kernel trace file system library")
11967 (description
11968 "This library provides APIs to access the Linux kernel's trace file
11969system.")
11970 (license (list license:gpl2
11971 license:lgpl2.1))))
11972
11973(define-public libtree
11974 (package
11975 (name "libtree")
11976 (version "3.1.1")
11977 (source
11978 (origin
11979 (method git-fetch)
11980 (uri (git-reference
11981 (url "https://github.com/haampie/libtree")
11982 (commit (string-append "v" version))))
11983 (file-name (git-file-name name version))
11984 (patches (search-patches "libtree-fix-check-non-x86.patch"))
11985 (sha256
11986 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb"))))
11987 (arguments
11988 (list #:make-flags
11989 ;; NOTE: Official documentation recommends to build libtree with
11990 ;; "-static" flag.
11991 #~(list (string-append "CC=" #$(cc-for-target))
11992 (string-append "PREFIX=" #$output))
11993 #:phases
11994 #~(modify-phases %standard-phases
11995 (add-after 'unpack 'fix-tests
11996 ;; XXX: '08_nodeflib' fails as 'libtree' returns a non-zero
11997 ;; code in one of the tests.
11998 ;;
11999 ;; See <https://github.com/haampie/libtree/issues/80>).
12000 (lambda _
12001 (substitute* "tests/08_nodeflib/Makefile"
12002 (("! ../../libtree -vvv exe_b")
12003 "../../libtree -vvv exe_b"))))
12004 (delete 'configure))))
12005 (build-system gnu-build-system)
12006 (home-page "https://github.com/haampie/libtree")
12007 (synopsis "Show output of @command{ldd} as a tree")
12008 (description
12009 "This tool turns @command{ldd} into a tree and explains how shared
12010libraries are found or why they cannot be located.")
12011 (license license:expat)))
12012
12013(define-public touchegg
12014 (package
12015 (name "touchegg")
12016 (version "2.0.18")
12017 (source
12018 (origin
12019 (method git-fetch)
12020 (uri (git-reference
12021 (url "https://github.com/JoseExposito/touchegg")
12022 (commit version)))
12023 (file-name (git-file-name name version))
12024 (sha256
12025 (base32 "0m8zgihij14b8dxrxxvpl8sdsx49mjlnxnm0fhgfxscy7n07kcpc"))))
12026 (build-system cmake-build-system)
12027 (arguments
12028 `(#:tests? #f ; No tests exist
12029 #:configure-flags
12030 (list "-DUSE_SYSTEMD=OFF"))) ; No systemd
12031 (native-inputs
12032 (list
12033 pkg-config))
12034 (inputs
12035 (list
12036 cairo
12037 gtk+
12038 libgudev
12039 libinput
12040 libxrandr
12041 libxtst
12042 pugixml))
12043 (home-page "https://github.com/JoseExposito/touchegg")
12044 (synopsis "Multitouch gesture recognizer")
12045 (description
12046 "Touchégg is an application that runs in the background and transform the
12047gestures you make on your touchpad or touchscreen into visible actions in your
12048desktop.")
12049 (license license:gpl3+)))
12050
12051(define-public evtest
12052 (package
12053 (name "evtest")
12054 (version "1.36")
12055 (source (origin
12056 (method git-fetch)
12057 (uri (git-reference
12058 (url "https://gitlab.freedesktop.org/libevdev/evtest")
12059 (commit (string-append "evtest-" version))))
12060 (file-name (git-file-name name version))
12061 (sha256
12062 (base32
12063 "0mwjvz0fwwcwm4fpw0m4x8bcxpnzjkiy7fpb438vf4i5g5q0dc1k"))))
12064 (build-system gnu-build-system)
12065 (arguments
12066 (list #:tests? #f ;No tests exist
12067 #:make-flags #~(list (string-append "CC="
12068 #$(cc-for-target))
12069 (string-append "PREFIX="
12070 #$output))
12071 #:phases #~(modify-phases %standard-phases
12072 (add-after 'unpack 'generate-doc
12073 (lambda _
12074 (invoke "asciidoc" "-d" "manpage"
12075 "-b" "docbook"
12076 "-o" "evtest.1.xml"
12077 "evtest.txt")
12078 (invoke "xsltproc" "--nonet"
12079 (string-append
12080 #$(this-package-native-input "docbook-xsl")
12081 "/xml/xsl/docbook-xsl-"
12082 #$(package-version
12083 (this-package-native-input "docbook-xsl"))
12084 "/manpages/docbook.xsl")
12085 "evtest.1.xml")))
12086 (replace 'bootstrap
12087 (lambda _
12088 (setenv "CONFIG_SHELL" (which "sh"))
12089 (invoke "autoreconf" "-fi"))))))
12090 (native-inputs (list autoconf
12091 automake
12092 bash-minimal
12093 xmlto
12094 docbook-xsl
12095 libxslt
12096 asciidoc))
12097 (home-page "https://gitlab.freedesktop.org/libevdev/evtest")
12098 (synopsis "Kernel evdev device information and monitor")
12099 (description
12100 "@code{evtest} is a tool to print @code{evdev} kernel events. It reads
12101directly from the kernel device and prints a device description and the events
12102with the value and the symbolic name.")
12103 (license license:gpl2+)))
12104
12105(define-public tp-smapi-module
12106 (package
12107 (name "tp-smapi-module")
12108 (version "0.44")
12109 (source (origin
12110 (method git-fetch)
12111 (uri (git-reference
12112 (url "https://github.com/linux-thinkpad/tp_smapi")
12113 (commit (string-append "tp-smapi/" version))))
12114 (file-name (git-file-name name version))
12115 (sha256
12116 (base32
12117 "0kzbks07bh5jbi1n311zp9cbp1xxyzi7nys8wq1k0k5ig81h9w6k"))))
12118 (build-system linux-module-build-system)
12119 (arguments
12120 `(#:tests? #f)) ;there are none.
12121 (home-page "https://github.com/linux-thinkpad/tp_smapi")
12122 (synopsis
12123 "Linux Kernel module exposing features of ThinkPad hardware")
12124 (description
12125 "This package provides a Linux Kernel module that controls
12126battery charging of specific ThinkPad laptops. It also includes an improved
12127version of the HDAPS driver. The underlying hardware interfaces are
12128@acronym{SMAPI, System Management Application Program Interface} and direct
12129access to the embedded controller.")
12130 (license license:gpl2+)))
12131
12132(define-public modprobed-db
12133 (package
12134 (name "modprobed-db")
12135 (version "2.48")
12136 (source (origin
12137 (method git-fetch)
12138 (uri (git-reference
12139 (url "https://github.com/graysky2/modprobed-db")
12140 (commit (string-append "v" version))))
12141 (file-name (git-file-name name version))
12142 (sha256
12143 (base32
12144 "0jscinga32jjvy3vwl4s1pyd5fjgqhmmk010k665nhil302hzjdc"))))
12145 (build-system gnu-build-system)
12146 (arguments
12147 (list #:tests? #f ;no tests
12148 #:make-flags
12149 #~(list (string-append "PREFIX=" #$output)
12150 "INITDIR_SYSTEMD=no-thanks")
12151 #:phases
12152 #~(modify-phases %standard-phases
12153 (delete 'configure)
12154 (add-after 'install 'fix-path
12155 (lambda* (#:key inputs #:allow-other-keys)
12156 (substitute* (string-append #$output "/bin/modprobed-db")
12157 (("/usr") #$output)
12158 (((string-append "(" (string-join (list "awk"
12159 "cp"
12160 "cut"
12161 "getent"
12162 "grep"
12163 "logname"
12164 "md5sum"
12165 "mkdir"
12166 "mv"
12167 "sed"
12168 "sort"
12169 "uniq"
12170 "wc")
12171 "|") ")") m)
12172 (search-input-file inputs (string-append "/bin/" m)))
12173 (("modprobe ")
12174 (string-append
12175 (search-input-file inputs "/bin/modprobe") " "))))))))
12176 (inputs (list coreutils kmod gawk glibc grep sed))
12177 (home-page "https://wiki.archlinux.org/title/Modprobed-db")
12178 (synopsis "Keep track of Linux modules that have been probed")
12179 (description
12180 "Modprobed-db is a useful utility for users wishing to build a minimal
12181kernel via a @code{make localmodconfig}. In a nutshell, this @command{make}
12182target creates a config based on the current config and a list of modules you
12183define (that @command{modprobed-db} keeps for you). It then disables any
12184module option that is not needed thus not building extraneous modules. This
12185results in a system-specific, streamlined kernel package and footprint as well
12186as reduced compilation times.
12187
12188Modprobed-db simply logs every module ever probed on the target system to a
12189text-based database (@file{$XDG_CONFIG_HOME/modprobed-db}), which can be read
12190directly by @code{make localmodconfig} as described above.")
12191 (license license:expat)))
12192
12193(define-public kernel-hardening-checker
12194 (package
12195 (name "kernel-hardening-checker")
12196 (version "0.6.17.1")
12197 (source (origin
12198 (method git-fetch)
12199 (uri (git-reference
12200 (url "https://github.com/a13xp0p0v/kernel-hardening-checker")
12201 (commit (string-append "v" version))))
12202 (file-name (git-file-name name version))
12203 (sha256
12204 (base32
12205 "04r9bbayhs1ik84908q148k9djawy69zarxw0vc31dfbf64mni62"))))
12206 (build-system pyproject-build-system)
12207 (arguments
12208 (list #:tests? #f)) ;no active tests, runtime only, see GitHub Actions
12209 (native-inputs
12210 (list python-setuptools))
12211 (home-page "https://github.com/a13xp0p0v/kernel-hardening-checker")
12212 (synopsis
12213 "Tool for checking the security hardening options of the Linux kernel")
12214 (description
12215 "@code{kernel-hardening-checker} is a tool for checking the security
12216hardening options of the Linux kernel. Provided preferences are based on
12217suggestions from various sources, including:
12218
12219@itemize
12220@item KSPP recommended settings
12221@item CLIP OS kernel configuration
12222@item Last public grsecurity patch (options which they disable)
12223@item SECURITY_LOCKDOWN_LSM patchset
12224@item Direct feedback from the Linux kernel maintainers
12225@end itemize\n
12226This tool supports checking Kconfig options and kernel cmdline parameters.")
12227 (license license:gpl3)))
12228
12229(define-deprecated-package kconfig-hardened-check
12230 kernel-hardening-checker)
12231
12232(define-public firejail
12233 (package
12234 (name "firejail")
12235 (version "0.9.74")
12236 (source (origin
12237 (method url-fetch)
12238 (uri (string-append
12239 "https://github.com/netblue30/firejail/releases/download/" version
12240 "/firejail-" version ".tar.xz" ))
12241 (sha256
12242 (base32
12243 "04w11jjh62ghs66ippw5xlg3l7l9mi3b5cpch1cg3fw7gxnbbn3h"))))
12244 (arguments
12245 (list #:phases
12246 #~(modify-phases %standard-phases
12247 (replace 'check
12248 (lambda* (#:key tests? #:allow-other-keys)
12249 (when tests?
12250 (with-directory-excursion "test"
12251 (invoke "make"))))))))
12252 (build-system gnu-build-system)
12253 (inputs
12254 (list apparmor xdg-dbus-proxy))
12255 (synopsis "Linux namespaces sandbox program")
12256 (description
12257 "Firejail is a SUID sandbox program that reduces the risk of security
12258breaches by restricting the running environment of untrusted applications
12259using Linux namespaces, seccomp-bpf and Linux capabilities. The software
12260includes sandbox profiles for a number of common Linux programs. Firejail
12261should be added to the list of setuid programs in the system configuration to
12262work properly.")
12263 (home-page "https://github.com/netblue30/firejail")
12264 (supported-systems
12265 (filter (cut string-suffix? "-linux" <>) %supported-systems))
12266 (license license:gpl2+)))
12267
12268(define-public firejail-disable-sandbox-check
12269 (package/inherit
12270 firejail
12271 (name "firejail-disable-sandbox-check")
12272 (arguments
12273 (substitute-keyword-arguments (package-arguments firejail)
12274 ((#:configure-flags flags #~'())
12275 #~(append #$flags
12276 (list "--disable-sandbox-check")))))
12277 (description
12278 (string-append (package-description firejail)
12279 " Builded with @code{--disable-sandbox-check}, which is
12280 only intended for development."))))
12281
12282(define-public edac-utils
12283 (package
12284 (name "edac-utils")
12285 (version "0.18")
12286 (source (origin
12287 (method git-fetch)
12288 (uri (git-reference
12289 (url "https://github.com/grondo/edac-utils.git")
12290 (commit version)))
12291 (file-name (string-append name "-" version "-checkout"))
12292 (sha256
12293 (base32
12294 "04j686m58wsnyy5di7rz0sw9jahlm4ziwxjmgs31pjb87vzw3xgp"))))
12295 (build-system gnu-build-system)
12296 (native-inputs
12297 (list perl))
12298 (inputs
12299 (list sysfsutils))
12300 (synopsis "Memory error detection and correction userspace helpers")
12301 (description "This package provides userspace helpers for memory
12302error detection and correction (EDAC).")
12303 (home-page "https://github.com/grondo/edac-utils")
12304 (license license:gpl2+)))
12305
12306(define-public spectre-meltdown-checker
12307 (package
12308 (name "spectre-meltdown-checker")
12309 (version "0.46")
12310 (source (origin
12311 (method git-fetch)
12312 (uri (git-reference
12313 (url "https://github.com/speed47/spectre-meltdown-checker")
12314 (commit (string-append "v" version))))
12315 (file-name (git-file-name name version))
12316 (patches
12317 (search-patches
12318 "spectre-meltdown-checker-externalize-fwdb.patch"))
12319 ;; Remove builtin firmware database.
12320 (modules '((guix build utils)))
12321 (snippet '(substitute* "spectre-meltdown-checker.sh"
12322 (("^# [AI],.*") "")))
12323 (sha256
12324 (base32
12325 "0j42p6dayb7k87kf8sqimxlaswis3qh0569a15zccyknv9vf129k"))))
12326 (build-system copy-build-system)
12327 (arguments
12328 (list
12329 #:install-plan
12330 #~'(("spectre-meltdown-checker.sh" "bin/spectre-meltdown-checker"))
12331 #:phases
12332 #~(modify-phases %standard-phases
12333 (add-after 'unpack 'fixpath
12334 (lambda* (#:key inputs #:allow-other-keys)
12335 (define* (find-command inputs cmd #:optional (bin "bin"))
12336 (search-input-file inputs (string-append bin "/" cmd)))
12337 (substitute* "spectre-meltdown-checker.sh"
12338 ;; ${opt_arch_prefix}CMD
12339 (("\\$\\{opt_arch_prefix\\}\\<(nm|objdump|readelf|strings)\\>"
12340 all cmd)
12341 (find-command inputs cmd))
12342
12343 ;; Commands safe to substitute directly.
12344 (("\\<(awk|(base|dir)name|bunzip2|g(un)?zip|lz4)\\>" all cmd)
12345 (find-command inputs cmd))
12346 (("\\<(lzop|mktemp|modprobe|pgrep|rmmod|umount)\\>" all cmd)
12347 (find-command inputs cmd))
12348 (("\\<(unlzma|unxz|unzstd|uuencode)\\>" all cmd)
12349 (find-command inputs cmd))
12350
12351 ;; Commands which should only be substituted based on their
12352 ;; surroundings: First up, dd.
12353 (("\\<(dd)\\> if=" all cmd)
12354 (string-append
12355 (find-command inputs cmd)
12356 " if="))
12357
12358 ;; Another special case: sysctl is in sbin.
12359 (("(if |\\$\\( *)\\<(sysctl)\\>" all pre cmd)
12360 (string-append pre (find-command inputs cmd "sbin")))
12361
12362 ;; Meow
12363 (("cat (<<EOF|\"\\$)" all what)
12364 (string-append (find-command inputs "cat") " " what))
12365 (("'cat'")
12366 (string-append "'" (find-command inputs "cat") "'"))
12367 (("\"cat\"")
12368 (string-append "\"" (find-command inputs "cat") "\""))
12369
12370 ;; ${COMMAND} -
12371 ;; ${COMMAND} ^
12372 (("\\<(base64|cut|grep|head|id|mount)\\> ([-^])" all cmd suffix)
12373 (string-append (find-command inputs cmd) " " suffix))
12374 (("\\<(od|perl|rm|uname|xargs)\\> ([-^])" all cmd suffix)
12375 (string-append (find-command inputs cmd) " " suffix))
12376
12377 ;; ${COMMAND} |
12378 (("\\<(dmesg)\\> \\|" all cmd)
12379 (string-append (find-command inputs cmd) " |"))
12380 ;; | ${COMMAND}
12381 (("\\| \\<(grep|sed|sort|stat|tr)\\>" all cmd)
12382 (string-append "| " (find-command inputs cmd)))
12383
12384 ;; Command in sub-shell, i.e. $($COMMAND ...)
12385 (("\\$\\( *(\\<cat|find|grep|mount|nproc|stat|tr\\>)"
12386 all cmd)
12387 (string-append "$(" (find-command inputs cmd)))
12388
12389 ;; command -v
12390 (("command -v \"*\\<(base64|nproc|perl|printf)\\>\"*" all cmd)
12391 (string-append "command -v " (find-command inputs cmd)))))))))
12392 (inputs (list kmod lz4 lzop perl procps sharutils util-linux zstd))
12393 (home-page "https://github.com/speed47/spectre-meltdown-checker")
12394 (synopsis "CPU vulnerability / mitigation checker")
12395 (description
12396 "This package provides a shell script to assess your system's resilience
12397against the several transient execution CVEs that were published since early
123982018, and gives guidance as to how to mitigate them.")
12399 (license license:gpl3)))
12400
12401(define-public csmith
12402 (package
12403 (name "csmith")
12404 (version "2.3.0")
12405 (source (origin
12406 (method git-fetch)
12407 (uri (git-reference
12408 (url "https://github.com/csmith-project/csmith")
12409 (commit (string-append "csmith-" version))))
12410 (file-name (git-file-name name version))
12411 (sha256
12412 (base32
12413 "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
12414 (build-system gnu-build-system)
12415 (native-inputs
12416 (list autoconf automake libtool m4 perl))
12417 (arguments
12418 (list
12419 #:tests? #f ;no test suite
12420 ;; Do not install headers under 'include/csmith-VERSION' but in
12421 ;; 'include/csmith'.
12422 #:phases
12423 `(modify-phases %standard-phases
12424 (add-after 'unpack 'patch-includedir
12425 (lambda _
12426 (substitute* "runtime/Makefile.am"
12427 (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
12428 "$(includedir)/$(PACKAGE)"))))
12429 (add-before 'bootstrap 'force-bootstrap
12430 (lambda _
12431 (delete-file "configure"))))))
12432 (home-page "https://github.com/csmith-project/csmith")
12433 (synopsis "Random generator of C programs")
12434 (description "The primary purpose of Csmith is to find compiler bugs with
12435random programs using differential testing.")
12436 (license license:bsd-4)))
12437
12438(define-public ipvsadm
12439 (package
12440 (name "ipvsadm")
12441 (version "1.31")
12442 (source
12443 (origin
12444 (method url-fetch)
12445 (uri (string-append "https://kernel.org/pub/linux/utils/kernel"
12446 "/ipvsadm/ipvsadm-" version ".tar.xz"))
12447 (sha256
12448 (base32 "1nyzpv1hx75k9lh0vfxfhc0p2fpqaqb38xpvs8sn88m1nljmw2hs"))))
12449 (build-system gnu-build-system)
12450 (native-inputs (list linux-libre-headers pkg-config which))
12451 (inputs (list libnl popt))
12452 (arguments
12453 (list #:tests? #f
12454 #:parallel-build? #f ;build fails randomly with '-j'
12455 #:make-flags
12456 #~(list (string-join
12457 (list "CFLAGS="
12458 (string-append "-I"
12459 #$(this-package-input "libnl")
12460 "/include/libnl3")
12461 (string-append "-L" #$(this-package-input "libnl")
12462 "/lib")
12463 "-fPIC")
12464 " ")
12465 (string-append "CC=" #$(cc-for-target))
12466 (string-append "SBIN=" #$output "/sbin")
12467 (string-append "INIT=" #$output "/etc/init.d")
12468 (string-append "MANDIR=" #$output "/share/man"))
12469 #:phases #~(modify-phases %standard-phases
12470 (delete 'configure))))
12471 (home-page "http://www.linuxvirtualserver.org/software/ipvs.html")
12472 (synopsis "IP virtual server administration utility")
12473 (description "@code{ipvsadm(8)} is used to set up, maintain or inspect the
12474virtual server table in the Linux kernel. The Linux Virtual Server can be used
12475to build scalable network services based on a cluster of two or more nodes.")
12476 (license license:gpl2+)))
12477
12478(define-public ryzenadj
12479 (package
12480 (name "ryzenadj")
12481 (version "0.17.0")
12482 (source (origin
12483 (method url-fetch)
12484 (uri (string-append "https://github.com/flygoat/ryzenadj/archive/refs/tags/"
12485 "v" version ".tar.gz"))
12486 (sha256
12487 (base32 "0i2x6kbn2ix52vjz1mmh0c0g3w0k4sn0lq68wbsk0pgndzcck2l4"))
12488 (modules '((guix build utils)))
12489 (snippet
12490 '(begin (delete-file-recursively "win32")
12491 #t))))
12492 (build-system cmake-build-system)
12493 (inputs (list pciutils))
12494 (arguments
12495 (list #:tests? #f ; No test suite
12496 #:phases #~(modify-phases %standard-phases
12497 (add-before 'install 'build
12498 (lambda _
12499 (invoke "cmake" "-DCMAKE_BUILD_TYPE=Release" "."))))))
12500 (home-page "https://github.com/flygoat/ryzenadj")
12501 (synopsis "Power management tool for AMD Ryzen APUs")
12502 (description
12503 "@command{ryzenadj} is an utility to adjust power management settings for
12504AMD Ryzen mobile processors. You will need to ensure it can access /dev/mem,
12505for instance by using the \"iomem=relaxed\" kernel argument.")
12506 (license license:lgpl3)))
12507
12508(define-public ryzen-smu
12509 (package
12510 (name "ryzen-smu")
12511 (version "0.1.5")
12512 (source (origin
12513 (method git-fetch)
12514 (uri (git-reference
12515 (url "https://gitlab.com/leogx9r/ryzen_smu.git")
12516 (commit (string-append "v" version))))
12517 (file-name (git-file-name name version))
12518 (sha256
12519 (base32
12520 "010la2a8zp7rljlg5ssc9ragzva4ca05gvzlicjagl508659d2wz"))))
12521 (build-system linux-module-build-system)
12522 (arguments
12523 `(#:tests? #f)) ; no tests
12524 (synopsis "System Management Unit driver for AMD Ryzen processors")
12525 (description "This package provides a way to access the
12526System Management Unit for certain AMD Ryzen processors.
12527This includes access to the System Management Network.")
12528 (home-page "https://gitlab.com/leogx9r/ryzen_smu")
12529 (license license:gpl2)))
12530
12531(define-public hid-wiimote-plus
12532 (package
12533 (name "hid-wiimote-plus")
12534 (version "0.9.2")
12535 (source (origin
12536 (method git-fetch)
12537 (uri (git-reference
12538 (url "https://github.com/dkosmari/hid-wiimote-plus.git")
12539 (commit (string-append "v" version))))
12540 (file-name (git-file-name name version))
12541 (sha256
12542 (base32
12543 "1rkp311x60jm73xlqypxsp375rx3fa55jyrspz1aqjga0q6cvswi"))))
12544 (build-system linux-module-build-system)
12545 (arguments
12546 (list #:tests? #f)) ; No tests.
12547 (synopsis "WiiMote HID kernel module")
12548 (description "This package provides a WiiMote driver that follows the
12549Linux input convention. Specifically, that allows you to use the D-pad
12550as a gamepad.")
12551 (home-page "https://github.com/dkosmari/hid-wiimote-plus")
12552 (license license:gpl2+)))
12553
12554(define-public python-evemu
12555 (package
12556 (name "python-evemu")
12557 (version "2.7.0")
12558 (source (origin
12559 (method git-fetch)
12560 (uri (git-reference
12561 (url "https://gitlab.freedesktop.org/libevdev/evemu")
12562 (commit (string-append "v" version))))
12563 (file-name (git-file-name name version))
12564 (sha256
12565 (base32
12566 "1sxf6v2wnajj9srlkfjfymjmmp4dlq73gzjcjmaw015a3c0xl029"))))
12567 (build-system gnu-build-system)
12568 (arguments
12569 (list #:tests? #f ; would open device files
12570 #:phases
12571 #~(modify-phases %standard-phases
12572 (add-after 'unpack 'patch
12573 (lambda* (#:key inputs #:allow-other-keys)
12574 (substitute* "python/evemu/base.py"
12575 (("\"libevdev.so\"")
12576 (string-append "\"" (assoc-ref inputs "libevdev")
12577 "/lib/libevdev.so\""))))))))
12578 (native-inputs
12579 (list asciidoc autoconf automake libtool docbook-xsl pkg-config
12580 python-wrapper xmlto))
12581 (inputs
12582 (list libevdev))
12583 (synopsis "Record and replay input device events")
12584 (description "This package provides a way to record and replay device
12585descriptions and events, making it possible to emulate input devices
12586through the Linux kernel's input system. Emulated devices are for most
12587practical purposes indistinguishable from real devices.
12588
12589It provides a command line program and also a Python library.")
12590 (home-page "https://www.freedesktop.org/wiki/Evemu/")
12591 (license license:gpl3)))
12592
12593(define-public dualsensectl
12594 (package
12595 (name "dualsensectl")
12596 (version "0.7")
12597 (source (origin
12598 (method git-fetch)
12599 (uri (git-reference
12600 (url "https://github.com/nowrep/dualsensectl.git")
12601 (commit (string-append "v" version))))
12602 (file-name (git-file-name name version))
12603 (sha256
12604 (base32
12605 "05snsp5r3hc2yc1nf0w4aam1my4h0lkxnmy7k4glxvasd9jwahzw"))))
12606 (build-system meson-build-system)
12607 (native-inputs
12608 (list pkg-config))
12609 (inputs
12610 (list eudev dbus hidapi))
12611 (synopsis "Linux tool for controlling PS5 DualSense controller")
12612 (description "This package provides a Linux tool for controlling a PS5
12613DualSense controller. It has to be already connected via USB or connected
12614via Bluetooth.")
12615 (home-page "https://github.com/nowrep/dualsensectl")
12616 (license license:gpl2)))