projects/guix·blob bootstrap-team · refs

12631 lines · 549.3 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.31")
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 "19ccdiw3flzk7gki90rc1nifmma79g2l87vhls4d2xr4z763m4nc"))))
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-3.18
4989 (package
4990 (inherit fuse)
4991 (name "fuse")
4992 (version "3.18.1")
4993 (source (origin
4994 (method url-fetch)
4995 (uri
4996 (string-append "https://github.com/libfuse/libfuse/releases/"
4997 "download/fuse-" version
4998 "/fuse-" version ".tar.gz"))
4999 (sha256
5000 (base32
5001 "0b1jp5gp2gv40gv6cvmv86rcr4l0mdh050qbvnxl0xcwya45qffx"))))))
5002
5003(define-public fuse-2
5004 (package
5005 (inherit fuse)
5006 (name "fuse")
5007 (version "2.9.9")
5008 (source
5009 (origin
5010 (method url-fetch)
5011 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
5012 "download/fuse-" version
5013 "/fuse-" version ".tar.gz"))
5014 (sha256
5015 (base32 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
5016 (patches (search-patches "fuse-overlapping-headers.patch"
5017 "fuse-glibc-2.34.patch"))))
5018 (build-system gnu-build-system)
5019 (native-inputs
5020 (list autoconf automake gettext-minimal libtool))
5021 (arguments
5022 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
5023 (assoc-ref %outputs "out")
5024 "/sbin")
5025 (string-append "INIT_D_PATH="
5026 (assoc-ref %outputs "out")
5027 "/etc/init.d")
5028
5029 ;; The rule makes /dev/fuse 666.
5030 (string-append "UDEV_RULES_PATH="
5031 (assoc-ref %outputs "out")
5032 "/lib/udev/rules.d"))
5033 #:phases
5034 (modify-phases %standard-phases
5035 (add-before 'bootstrap 'force-bootstrap
5036 (lambda _
5037 ;; Force a bootstrap to make the patch changes effective.
5038 (delete-file "configure")))
5039 (add-before 'build 'set-file-names
5040 (lambda* (#:key inputs #:allow-other-keys)
5041 ;; libfuse calls out to mount(8) and umount(8). Make sure
5042 ;; it refers to the right ones.
5043 (substitute* '("lib/mount_util.c" "util/mount_util.c")
5044 (("/bin/(u?)mount" _ maybe-u)
5045 (search-input-file inputs
5046 (string-append "bin/"
5047 maybe-u "mount"))))
5048 (substitute* '("util/mount.fuse.c")
5049 (("/bin/sh")
5050 (search-input-file inputs "/bin/sh")))
5051
5052 ;; This hack leads libfuse to search for 'fusermount' in
5053 ;; $PATH, where it may find a setuid-root binary, instead of
5054 ;; trying solely $out/sbin/fusermount and failing because
5055 ;; it's not setuid.
5056 (substitute* "lib/Makefile"
5057 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5058 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))))
5059
5060(define-public fuse-for-appimage
5061 (package
5062 (inherit fuse)
5063 (name "fuse")
5064 (version "3.16.2")
5065 (source
5066 (origin
5067 (method url-fetch)
5068 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
5069 "download/fuse-" version "/fuse-" version ".tar.gz"))
5070 (sha256
5071 (base32 "11yfl2w2a445hllyzlakq97n32g06972vxpmh7lpbclnj9fhb5zp"))))
5072 (arguments
5073 (substitute-keyword-arguments (package-arguments fuse)
5074 ((#:configure-flags original-flags #~(list))
5075 #~(append #$original-flags '("--default-library=static")))))))
5076
5077(define-public unionfs-fuse
5078 (package
5079 (name "unionfs-fuse")
5080 (version "3.3")
5081 (source (origin
5082 (method git-fetch)
5083 (uri (git-reference
5084 (url "https://github.com/rpodgorny/unionfs-fuse")
5085 (commit (string-append "v" version))))
5086 (file-name (git-file-name name version))
5087 (sha256
5088 (base32
5089 "1wl5m5qnwf3s1792xphr35pb80sx8ybaqi3n3ddi5vvk3qjc4iws"))))
5090 (build-system cmake-build-system)
5091 (arguments
5092 (list
5093 #:phases
5094 #~(modify-phases %standard-phases
5095 (replace 'check
5096 ;; The epitome of ‘I tried’: run the 2 trivial tests that don't rely
5097 ;; on the fuse kernel module being loaded. All others would fail.
5098 (lambda* (#:key tests? #:allow-other-keys)
5099 (when tests?
5100 (invoke "pytest" "../source/test_all.py" "-k" "test_help")))))))
5101 (native-inputs
5102 (list pkg-config
5103
5104 ;; Only for the test ‘suite’.
5105 python
5106 python-pytest))
5107 (inputs
5108 (list fuse))
5109 (home-page "https://github.com/rpodgorny/unionfs-fuse")
5110 (synopsis "User-space union file system")
5111 (description
5112 "UnionFS-FUSE is a flexible union file system implementation in user
5113space, using the FUSE library. Mounting a union file system allows you to
5114\"aggregate\" the contents of several directories into a single mount point.
5115UnionFS-FUSE additionally supports copy-on-write.")
5116 (license license:bsd-3)))
5117
5118(define fuse-static
5119 (package (inherit fuse)
5120 (name "fuse-static")
5121 (source
5122 (origin
5123 (inherit (package-source fuse))
5124 (modules '((guix build utils)))
5125 (snippet
5126 #~(begin
5127 ;; Normally libfuse invokes mount(8) so that /etc/mtab is updated.
5128 ;; Change calls to 'mtab_needs_update' to 0 so that it doesn't do
5129 ;; that, allowing us to remove the dependency on util-linux
5130 ;; (something that is useful in initrds.)
5131 (substitute* "lib/mount_util.c"
5132 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") "0")
5133 (("/bin/") ""))))))
5134 (arguments
5135 (substitute-keyword-arguments (package-arguments fuse)
5136 ((#:configure-flags flags '())
5137 #~(cons "-Ddefault_library=static"
5138 #$flags))))))
5139
5140(define-public unionfs-fuse/static
5141 (package (inherit unionfs-fuse)
5142 (synopsis "User-space union file system (statically linked)")
5143 (name (string-append (package-name unionfs-fuse) "-static"))
5144 (source
5145 (origin
5146 (inherit (package-source unionfs-fuse))
5147 (modules '((guix build utils)))
5148 (snippet
5149 #~(begin
5150 ;; Add -ldl to the libraries, because libfuse.a needs that.
5151 (substitute* "src/CMakeLists.txt"
5152 (("target_link_libraries(.*)\\)" _ libs)
5153 (string-append "target_link_libraries"
5154 libs " dl)")))))))
5155 (arguments
5156 (substitute-keyword-arguments (package-arguments unionfs-fuse)
5157 ((#:configure-flags flags #~'())
5158 #~(cons "-DCMAKE_EXE_LINKER_FLAGS=-static" #$flags))
5159 ((#:phases phases #~%standard-phases)
5160 #~(modify-phases #$phases
5161 (add-after 'install 'post-install
5162 (lambda _
5163 ;; By default, 'unionfs' keeps references to
5164 ;; $glibc/share/locale and similar stuff. Remove them.
5165 (remove-store-references (string-append #$output "/bin/unionfs"))
5166 ;; 'unionfsctl' has references to glibc as well. Since
5167 ;; we don't need it, remove it.
5168 (delete-file (string-append #$output "/bin/unionfsctl"))))))))
5169 (inputs (list fuse-static))))
5170
5171(define-public sshfs
5172 (package
5173 (name "sshfs")
5174 (version "3.7.5")
5175 (source (origin
5176 (method url-fetch)
5177 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
5178 "download/sshfs-" version "/sshfs-" version
5179 ".tar.xz"))
5180 (sha256
5181 (base32
5182 "1fx8c4fkvmfi29iw8wz5dwnniq666ji4y4vl67dij2fhq9ixni8f"))))
5183 (build-system meson-build-system)
5184 (arguments
5185 ;; XXX: tests are skipped: FUSE kernel module does not seem to be loaded
5186 '(#:tests? #f))
5187 (inputs
5188 (list fuse glib))
5189 (native-inputs
5190 (list pkg-config
5191 ;; man page
5192 python-docutils))
5193 (home-page "https://github.com/libfuse/sshfs")
5194 (synopsis "Mount remote file systems over SSH")
5195 (description
5196 "This is a file system client based on the SSH File Transfer Protocol.
5197Since most SSH servers already support this protocol it is very easy to set
5198up: on the server side there's nothing to do; on the client side mounting the
5199file system is as easy as logging into the server with an SSH client.")
5200 (license license:gpl2+)))
5201
5202(define-public sshfs-fuse
5203 (package (inherit sshfs)
5204 (name "sshfs-fuse")
5205 (properties `((superseded . ,sshfs)))))
5206
5207(define-public archivemount
5208 (package
5209 (name "archivemount")
5210 (version "0.9.1")
5211 (source
5212 (origin
5213 (method url-fetch)
5214 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
5215 "archivemount-" version ".tar.gz"))
5216 (sha256
5217 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
5218 (build-system gnu-build-system)
5219 (inputs (list fuse-2 libarchive))
5220 (native-inputs (list pkg-config))
5221 (home-page "https://www.cybernoia.de/software/archivemount.html")
5222 (synopsis "Tool for mounting archive files with FUSE")
5223 (description "archivemount is a FUSE-based file system for Unix variants,
5224including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
5225mount point where it can be read from or written to as with any other file
5226system. This makes accessing the contents of the archive, which may be
5227compressed, transparent to other programs, without decompressing them.")
5228 (license license:lgpl2.0+)))
5229
5230(define-public numactl
5231 (package
5232 (name "numactl")
5233 (version "2.0.16")
5234 (source (origin
5235 (method url-fetch)
5236 (uri (string-append
5237 "https://github.com/numactl/numactl/releases/download/v"
5238 version "/numactl-" version ".tar.gz"))
5239 (sha256
5240 (base32
5241 "1j67wx3383fwqbvhg4nwqf72vpdgimmrvkpn3b9s2xzr7a4jy90v"))))
5242 (build-system gnu-build-system)
5243 (arguments
5244 `(,@(if (target-riscv64?)
5245 `(#:make-flags (list "LDFLAGS=-latomic"))
5246 '())
5247 ;; There's a 'test' target, but it requires NUMA support in the kernel
5248 ;; to run, which we can't assume to have.
5249 #:tests? #f))
5250 (home-page "https://github.com/numactl/numactl")
5251 (synopsis "Tools for non-uniform memory access (NUMA) machines")
5252 (description
5253 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
5254memory is not all in one place. The @command{numactl} program allows you to
5255run your application program on specific CPUs and memory nodes. It does this
5256by supplying a NUMA memory policy to the operating system before running your
5257program.
5258
5259The package contains other commands, such as @command{numastat},
5260@command{memhog}, and @command{numademo} which provides a quick overview of
5261NUMA performance on your system.")
5262 (license (list license:gpl2 ;programs
5263 license:lgpl2.1)))) ;library
5264
5265(define-public kbd-neo
5266 (package
5267 (name "kbd-neo")
5268 (version "2486")
5269 (source
5270 (origin
5271 (method url-fetch)
5272 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
5273 version "/linux/console/neo.map"))
5274 (file-name (string-append name "-" version ".map"))
5275 (sha256
5276 (base32
5277 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
5278 (build-system trivial-build-system)
5279 (arguments
5280 `(#:modules ((guix build utils))
5281 #:builder (begin
5282 (use-modules (guix build utils))
5283 (let ((out (string-append %output "/share/keymaps"))
5284 (source (assoc-ref %build-inputs "source")))
5285 (mkdir-p out)
5286 (copy-file source (string-append out "/neo.map"))
5287 #t))))
5288 (home-page "https://neo-layout.org")
5289 (synopsis "Neo2 console layout")
5290 (description
5291 "Kbd-neo provides the Neo2 keyboard layout for use with
5292@command{loadkeys(1)} from @code{kbd(4)}.")
5293 ;; The file is located in an svn directory, the entire content of
5294 ;; the directory is licensed as GPL3.
5295 (license license:gpl3+)))
5296
5297(define-public kbd
5298 (package
5299 (name "kbd")
5300 (version "2.5.1")
5301 (source (origin
5302 (method url-fetch)
5303 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
5304 version ".tar.xz"))
5305 (sha256
5306 (base32
5307 "10s608i4blprgy9nynlid0hglfdrrgln6wwjs9rhjf56hwilbpyc"))
5308 (modules '((guix build utils)))
5309 (snippet
5310 '(begin
5311 (substitute* '("src/unicode_start" "src/unicode_stop")
5312 ;; Assume the Coreutils are in $PATH.
5313 (("/usr/bin/tty")
5314 "tty"))))))
5315 (build-system gnu-build-system)
5316 (arguments
5317 '(#:phases
5318 (modify-phases %standard-phases
5319 (add-before 'build 'pre-build
5320 (lambda* (#:key inputs #:allow-other-keys)
5321 (let ((bzip2 (assoc-ref inputs "bzip2"))
5322 (gzip (assoc-ref inputs "gzip"))
5323 (xz (assoc-ref inputs "xz"))
5324 (zstd (assoc-ref inputs "zstd")))
5325 (substitute* "src/libkbdfile/kbdfile.c"
5326 (("bzip2") (string-append bzip2 "/bin/bzip2"))
5327 (("gzip") (string-append gzip "/bin/gzip"))
5328 (("xz -d") (string-append xz "/bin/xz -d"))
5329 (("zstd") (string-append zstd "/bin/zstd"))))))
5330 (add-after 'install 'post-install
5331 (lambda* (#:key outputs #:allow-other-keys)
5332 ;; Make sure these programs find their comrades.
5333 (let* ((out (assoc-ref outputs "out"))
5334 (bin (string-append out "/bin")))
5335 (for-each (lambda (prog)
5336 (wrap-program (string-append bin "/" prog)
5337 `("PATH" ":" prefix (,bin))))
5338 '("unicode_start" "unicode_stop"))))))))
5339 (native-inputs
5340 (list autoconf pkg-config))
5341 (inputs
5342 `(("bash" ,bash-minimal) ; for wrap-program
5343 ("bzip2" ,bzip2)
5344 ("gzip" ,gzip)
5345 ("pam" ,linux-pam)
5346 ("xz" ,xz)
5347 ("zstd" ,zstd)))
5348 (native-search-paths
5349 (list (search-path-specification
5350 (variable "LOADKEYS_KEYMAP_PATH")
5351 ;; Append ‘/**’ to recursively search all directories. One can then
5352 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
5353 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
5354 (files (list "share/keymaps/**")))))
5355 (home-page "https://kbd-project.org/")
5356 (synopsis "Linux keyboard utilities and keyboard maps")
5357 (description
5358 "This package contains keytable files and keyboard utilities compatible
5359for systems using the Linux kernel. This includes commands such as
5360@code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
5361 (license license:gpl2+)))
5362
5363(define-public loadkeys-static
5364 (package
5365 (inherit kbd)
5366 (name "loadkeys-static")
5367 (arguments
5368 (substitute-keyword-arguments (package-arguments kbd)
5369 ((#:configure-flags flags ''())
5370 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
5371 "--disable-vlock" ;so we don't need libpam
5372 "--disable-libkeymap")
5373 ,flags))
5374 ((#:make-flags flags ''())
5375 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
5376 ((#:phases phases '%standard-phases)
5377 `(modify-phases ,phases
5378 (replace 'install
5379 (lambda* (#:key outputs #:allow-other-keys)
5380 (let ((out (assoc-ref outputs "out")))
5381 ;; The binary keeps references to gzip, among other things,
5382 ;; which we don't need in the initrd, so strip references.
5383 (remove-store-references "src/loadkeys")
5384
5385 (install-file "src/loadkeys"
5386 (string-append out "/bin")))))
5387 (delete 'post-install)))
5388 ((#:strip-flags _ '())
5389 ''("--strip-all"))
5390 ((#:allowed-references _ '())
5391 '())))
5392
5393 (synopsis "Statically-linked @command{loadkeys} program")
5394
5395 ;; This package is meant to be used internally in the initrd so don't
5396 ;; expose it.
5397 (properties '((hidden? . #t)))))
5398
5399(define-public inotify-tools
5400 (package
5401 (name "inotify-tools")
5402 (version "3.22.6.0")
5403 (source (origin
5404 (method git-fetch)
5405 (uri (git-reference
5406 (url "https://github.com/rvoicilas/inotify-tools")
5407 (commit version)))
5408 (file-name (git-file-name name version))
5409 (sha256
5410 (base32
5411 "1j9j8k5zjp8m4cl53zjncnll9z4dnvzr4ygmfcjk0ci81i59b18i"))))
5412 (build-system gnu-build-system)
5413 (native-inputs
5414 (list autoconf automake libtool))
5415 (arguments
5416 `(#:configure-flags
5417 (list "--disable-static")))
5418 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
5419 (synopsis "Monitor file accesses")
5420 (description
5421 "The inotify-tools packages provides a C library and command-line tools
5422to use Linux' inotify mechanism, which allows file accesses to be monitored.")
5423 (license license:gpl2+)))
5424
5425(define-public kmod
5426 (package
5427 (name "kmod")
5428 (version "29")
5429 (source (origin
5430 (method url-fetch)
5431 (uri
5432 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
5433 "kmod-" version ".tar.xz"))
5434 (sha256
5435 (base32
5436 "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
5437 (patches (search-patches "kmod-module-directory.patch"))))
5438 (build-system gnu-build-system)
5439 (arguments
5440 (list #:configure-flags #~(list "--with-xz" "--with-zlib" "--with-zstd"
5441 "--disable-test-modules")
5442 #:phases
5443 #~(modify-phases %standard-phases
5444 (add-after 'unpack 'disable-tests
5445 (lambda _
5446 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
5447 (substitute* "Makefile.in"
5448 (("testsuite/test-modprobe") "")
5449 (("testsuite/test-depmod") "")
5450 (("testsuite/test-blacklist") ""))))
5451 (add-after 'install 'install-modprobe&co
5452 (lambda _
5453 (for-each (lambda (tool)
5454 (symlink "kmod"
5455 (string-append #$output "/bin/" tool)))
5456 '("insmod" "rmmod" "lsmod" "modprobe"
5457 "modinfo" "depmod")))))))
5458 (native-inputs (list pkg-config zstd)) ;zstd needed for tests
5459 (inputs (list xz zlib `(,zstd "lib")))
5460 (supported-systems (remove target-hurd? %supported-systems))
5461 (home-page "https://www.kernel.org/")
5462 (synopsis "Kernel module tools")
5463 (description "Kmod is a set of tools to handle common tasks with Linux
5464kernel modules like insert, remove, list, check properties, resolve
5465dependencies and aliases.
5466
5467These tools are designed on top of libkmod, a library that is shipped with
5468kmod. The aim is to be compatible with tools, configurations and indices
5469from the module-init-tools project.")
5470 (license license:gpl2+))) ; library under lgpl2.1+
5471
5472(define-public earlyoom
5473 (package
5474 (name "earlyoom")
5475 (version "1.7")
5476 (source (origin
5477 (method git-fetch)
5478 (uri (git-reference
5479 (url "https://github.com/rfjakob/earlyoom")
5480 (commit (string-append "v" version))))
5481 (file-name (git-file-name name version))
5482 (sha256
5483 (base32
5484 "1xqrs6wz59ks76hdgfd4vaj010kbvllilgam2xxyn0g56kai71zi"))))
5485 (build-system gnu-build-system)
5486 (arguments
5487 (list
5488 #:phases
5489 #~(modify-phases %standard-phases
5490 (delete 'configure) ; no configure script
5491 (add-before 'check 'set-go-HOME
5492 (lambda _
5493 (setenv "HOME" (getcwd))))
5494 (add-before 'check 'disable-failing-test
5495 (lambda _
5496 ;; This test relies on writing to /proc/%d/oom_score_adj.
5497 (substitute* "testsuite_cli_test.go"
5498 (("TestI" match)
5499 (string-append "skipped" match))))))
5500 #:make-flags
5501 #~(list (string-append "CC=" #$(cc-for-target))
5502 (string-append "VERSION=v" #$version)
5503 (string-append "PREFIX=" #$output)
5504 (string-append "SYSCONFDIR=" #$output "/etc")
5505 "GO111MODULE=off")
5506 #:test-target "test"))
5507 (native-inputs
5508 (append
5509 ;; To generate the manpage.
5510 (if (or (target-x86-64?) (target-x86-32?))
5511 (list pandoc)
5512 '())
5513 (list
5514 ;; For the test suite.
5515 cppcheck
5516 go-1.23)))
5517 (home-page "https://github.com/rfjakob/earlyoom")
5518 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
5519 (description "Early OOM is a minimalist out of memory (OOM) daemon that
5520runs in user space and provides a more responsive and configurable alternative
5521to the in-kernel OOM killer.")
5522 (license license:expat)))
5523
5524(define-public eudev
5525 (package
5526 (name "eudev")
5527 (version "3.2.14")
5528 (source (origin
5529 (method git-fetch)
5530 (uri (git-reference (url "https://github.com/eudev-project/eudev")
5531 (commit (string-append "v" version))))
5532 (file-name (git-file-name name version))
5533 (sha256
5534 (base32
5535 "1f6lz57igi7iw2ls3fpzgw42bfznam4nf9368h7x8yf1mb737yxz"))))
5536 (build-system gnu-build-system)
5537 (arguments
5538 (list
5539 ;; The binary should be built to look for its rules under
5540 ;; /etc/udev/rules.d, which is where the udev-shepherd-service keeps
5541 ;; them.
5542 #:make-flags #~(list "udevrulesdir=/etc/udev/rules.d")
5543 #:phases
5544 #~(modify-phases %standard-phases
5545 (add-before 'bootstrap 'patch-file-names
5546 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5547 (substitute* "man/make.sh"
5548 (("/usr/bin/xsltproc")
5549 (search-input-file (or native-inputs inputs) "/bin/xsltproc")))))
5550 (add-before 'bootstrap 'install-in-lib
5551 (lambda _
5552 ;; When the udev-service-type instantiates /etc, it collects
5553 ;; hardware files from the <package>/lib/udev/hwdb.d directories
5554 ;; of different packages. Since we set sysconfdir to /etc, the
5555 ;; only package-dependent location we can install hwdb files is
5556 ;; in <package>/lib/udev/hwdb.d. Eudev is configured to install
5557 ;; these files in sysconfdir, but they should be placed into
5558 ;; udevlibexecdir.
5559 (copy-file "hwdb/Makefile.am" "hwdb/files.am")
5560 (call-with-output-file "hwdb/Makefile.am"
5561 (lambda (port)
5562 (format port "hardwarelibdir = $(udevlibexecdir)/hwdb.d\n")
5563 (format port "include ./files.am")))
5564 (substitute* "hwdb/files.am"
5565 (("dist_udevhwdb_DATA =")
5566 "dist_hardwarelib_DATA ="))
5567 ;; Do not install the empty udev.conf template.
5568 (substitute* "src/udev/Makefile.am"
5569 (("dist_udevconf_DATA =")
5570 "dist_noinst_DATA ="))
5571 ;; Do not ensure that /etc/udev/rules.d exists.
5572 (substitute* "rules/Makefile.am"
5573 (("\\$\\(MKDIR_P\\) \\$\\(DESTDIR\\)\\$\\(udevconfdir\\)/rules\\.d")
5574 "true"))))
5575 (add-after 'install 'move-static-library
5576 (lambda _
5577 (let ((source (string-append #$output "/lib/libudev.a"))
5578 (target (string-append #$output:static "/lib/libudev.a")))
5579 (mkdir-p (dirname target))
5580 (link source target)
5581 (delete-file source)
5582 ;; Remove reference to the static library from the .la file
5583 ;; such that Libtool looks for it in the usual places.
5584 (substitute* (string-append #$output "/lib/libudev.la")
5585 (("old_library=.*")
5586 "old_library=''\n")))))
5587 (replace 'install
5588 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
5589 ;; Although the runtime udevrulesdir is set to
5590 ;; /etc/udev/rules.d, the package should provide its default
5591 ;; rules under $libdir/udev/rules.d.
5592 (let* ((default-udev-rules.d (string-append #$output
5593 "/lib/udev/rules.d"))
5594 (make-flags (cons (string-append "udevrulesdir="
5595 default-udev-rules.d)
5596 (delete "udevrulesdir=/etc/udev/rules.d"
5597 make-flags))))
5598 (apply (assoc-ref %standard-phases 'install)
5599 `(,@args #:make-flags ,make-flags))))))
5600 #:configure-flags
5601 #~(list "--enable-manpages"
5602 ;; By default, autoconf uses $prefix/etc. The udev-service-type
5603 ;; makes sure /etc is set up with rules and hardware file
5604 ;; descriptions.
5605 "--sysconfdir=/etc")))
5606 (native-search-paths
5607 (list (search-path-specification
5608 (variable "UDEV_HWDB_PATH")
5609 (files '("lib/udev/hwdb.d")))))
5610 (native-inputs
5611 (list autoconf
5612 automake
5613 gperf
5614 libtool
5615 pkg-config
5616 ;; For tests.
5617 perl
5618 python-wrapper
5619 ;; For documentation.
5620 docbook-xml-4.2
5621 docbook-xsl
5622 libxslt))
5623 (inputs
5624 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
5625 ;; and similar; it also installs the '60-persistent-storage.rules' file,
5626 ;; which contains the rules to do that.
5627 (list `(,util-linux "lib") ;for blkid
5628 kmod))
5629 (outputs '("out" "static"))
5630 (home-page "https://github.com/eudev-project/eudev")
5631 (synopsis "Userspace device management")
5632 (description "Udev is a daemon which dynamically creates and removes
5633device nodes from /dev/, handles hotplug events and loads drivers at boot
5634time.")
5635 (license license:gpl2+)))
5636
5637(define-public python-evdev
5638 (package
5639 (name "python-evdev")
5640 (version "1.9.1")
5641 (source
5642 (origin
5643 (method git-fetch) ; no tests data in PyPi package
5644 (uri (git-reference
5645 (url "https://github.com/gvalkov/python-evdev")
5646 (commit (string-append "v" version))))
5647 (file-name (git-file-name name version))
5648 (sha256
5649 (base32 "09p7pj0xhv23hqlpx865klrxrf7x6sw1bdsgs6pq900jvz92pl16"))))
5650 (build-system pyproject-build-system)
5651 (arguments
5652 (list
5653 #:test-flags
5654 ;; Silent tests requiring access to /dev/uinput.
5655 #~(list "-k" (string-append "not test_open"
5656 " and not test_open_context"
5657 " and not test_enable_events"
5658 " and not test_abs_values"
5659 " and not test_write"))
5660 #:phases
5661 #~(modify-phases %standard-phases
5662 (add-before 'build 'fix-hard-coded-directory
5663 (lambda* (#:key inputs #:allow-other-keys)
5664 (substitute* "setup.py"
5665 (("/usr/include/linux")
5666 (string-append
5667 (assoc-ref inputs "kernel-headers") "/include/linux"))))))))
5668 (native-inputs
5669 (list python-pytest python-setuptools python-wheel))
5670 (home-page "https://github.com/gvalkov/python-evdev")
5671 (synopsis "Bindings to the Linux input handling subsystem")
5672 (description
5673 "Python-evdev provides bindings to the generic input event interface in
5674Linux. The @code{evdev} interface serves the purpose of passing events
5675generated in the kernel directly to userspace through character devices that
5676are typically located in @file{/dev/input/}.
5677
5678This package also comes with bindings to @code{uinput}, the userspace input
5679subsystem. @code{uinput} allows userspace programs to create and handle input
5680devices that can inject events directly into the input subsystem.")
5681 (license license:bsd-3)))
5682
5683(define-public interception-tools
5684 (package
5685 (name "interception-tools")
5686 (version "0.6.8")
5687 (home-page "https://gitlab.com/interception/linux/tools")
5688 (source (origin
5689 (method git-fetch)
5690 (uri (git-reference
5691 (url home-page)
5692 (commit (string-append "v" version))))
5693 (file-name (git-file-name name version))
5694 (sha256
5695 (base32
5696 "1sbidym6ld4c8cx2ww5i54zsv8v0kygv15zq1yimz44v4my605wf"))))
5697 (build-system cmake-build-system)
5698 (native-inputs
5699 (list pkg-config))
5700 (inputs
5701 (list boost libevdev eudev yaml-cpp))
5702 (arguments
5703 `(#:tests? #f)) ; no test suite
5704 (synopsis "Utilities for operating on input events of evdev devices")
5705 (description
5706 "Interception Tools provides a composable infrastructure on top of
5707@code{libudev} and @code{libevdev}. The following utilities are provided:
5708
5709@itemize
5710@item @command{udevmon} --- monitor input devices for launching tasks
5711@item @command{intercept} --- redirect device input events to stdout
5712@item @command{uinput} --- redirect device input events from stding to virtual device
5713@item @command{mux} --- mux streams of input events
5714@end itemize")
5715 ;; Dual-licensed under GPLv3+ or "something else" on request, per
5716 ;; 'README.md'.
5717 (license license:gpl3+)))
5718
5719(define-public interception-dual-function-keys
5720 (package
5721 (name "interception-dual-function-keys")
5722 (version "1.4.0")
5723 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
5724 (source (origin
5725 (method git-fetch)
5726 (uri (git-reference
5727 (url home-page)
5728 (commit version)))
5729 (file-name (git-file-name name version))
5730 (sha256
5731 (base32
5732 "0s49vbg3j4rwh78i8rx8qr7myql09p7b3lhrjl0p7dd98xp6ann6"))))
5733 (build-system gnu-build-system)
5734 (inputs
5735 (list libevdev yaml-cpp))
5736 (arguments
5737 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
5738 ,(string-append "CXX=" (cxx-for-target))
5739 (string-append "PREFIX=" %output))
5740 #:phases
5741 (modify-phases %standard-phases
5742 (add-after 'unpack 'fix-libevdev-path
5743 (lambda* (#:key inputs #:allow-other-keys)
5744 (let ((libevdev (assoc-ref inputs "libevdev")))
5745 (substitute* "config.mk"
5746 (("/usr/include/libevdev-1.0")
5747 (string-append libevdev "/include/libevdev-1.0")))
5748 #t)))
5749 ;; No configure script
5750 (delete 'configure))
5751 ;; No tests are included.
5752 #:tests? #f))
5753 (synopsis "Tap for one key, hold for another")
5754 (description
5755 "Dual Function Keys is a plugin for @code{interception-tools} that allows
5756one to send arbitrary keycodes when a given key is tapped or held.")
5757 (license license:expat)))
5758
5759(define-public lvm2
5760 (package
5761 (name "lvm2")
5762 (version "2.03.22")
5763 (source (origin
5764 (method url-fetch)
5765 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
5766 version ".tgz")
5767 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
5768 version ".tgz")))
5769 (sha256
5770 (base32
5771 "0z6w6bknhwh1n3qfkb5ij6x57q3wjf28lq3l8kh7rkhsplinjnjc"))
5772 (patches (search-patches "lvm2-no-systemd.patch"))
5773 (modules '((guix build utils)))
5774 (snippet
5775 '(begin
5776 (use-modules (guix build utils))
5777
5778 ;; Honor sysconfdir.
5779 (substitute* "make.tmpl.in"
5780 (("^confdir = .*$")
5781 "confdir = @sysconfdir@\n")
5782 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
5783 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
5784 (build-system gnu-build-system)
5785 (native-inputs
5786 (list config
5787 pkg-config procps)) ;tests use 'pgrep'
5788 (inputs
5789 `(("libaio" ,libaio)
5790 ("udev" ,eudev)))
5791 (arguments
5792 `(#:phases
5793 (modify-phases %standard-phases
5794 (add-after 'unpack 'update-config
5795 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5796 (install-file (search-input-file
5797 (or native-inputs inputs) "/bin/config.sub")
5798 "autoconf")
5799 (install-file (search-input-file
5800 (or native-inputs inputs) "/bin/config.guess")
5801 "autoconf")))
5802 (add-after 'configure 'set-makefile-shell
5803 (lambda _
5804 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
5805 ;; expected.
5806 (setenv "SHELL" (which "sh"))
5807
5808 ;; Replace /bin/sh with the right file name.
5809 (patch-makefile-SHELL "make.tmpl"))))
5810
5811 #:configure-flags (list (string-append "--sysconfdir="
5812 (assoc-ref %outputs "out")
5813 "/etc/lvm")
5814 "--enable-udev_sync"
5815 "--enable-udev_rules"
5816 "--enable-pkgconfig"
5817 "--enable-cmdlib"
5818 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
5819
5820 ;; Make sure programs such as 'dmsetup' can
5821 ;; find libdevmapper.so.
5822 (string-append "LDFLAGS=-Wl,-rpath="
5823 (assoc-ref %outputs "out")
5824 "/lib,-rpath="
5825 (assoc-ref %outputs "out")
5826 "/lib/device-mapper")
5827 ;; This is needed when cross-compiling.
5828 ,@(if (%current-target-system)
5829 '("ac_cv_func_malloc_0_nonnull=yes"
5830 "ac_cv_func_realloc_0_nonnull=yes")
5831 '()))
5832
5833 ;; The tests use 'mknod', which requires root access.
5834 #:tests? #f))
5835 (supported-systems (remove target-hurd? %supported-systems))
5836 (home-page "https://sourceware.org/lvm2/")
5837 (synopsis "Logical volume management for Linux")
5838 (description
5839 "LVM2 is the logical volume management tool set for Linux-based systems.
5840This package includes the user-space libraries and tools, including the device
5841mapper. Kernel components are part of Linux-libre.")
5842
5843 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
5844 ;; Command-line tools are GPLv2.
5845 (license (list license:gpl2 license:lgpl2.1))))
5846
5847(define-public (libdevmapper-propagated-inputs)
5848 (list eudev))
5849
5850(define-public lvm2-static
5851 (package
5852 (inherit lvm2)
5853 (name "lvm2-static")
5854
5855 (inputs `(,@(package-inputs lvm2)
5856 ("udev:static" ,eudev "static")))
5857
5858 (arguments
5859 (substitute-keyword-arguments (package-arguments lvm2)
5860 ((#:configure-flags flags '())
5861 ;; LVM2 doesn't use Libtool, hence the custom option.
5862 `(append '("--enable-static_link")
5863 ;; Building dmeventd statically is complicated due to a
5864 ;; requirement on libdevmapper.a, which is being phased out
5865 ;; in favor of libdevice-mapper.a, which in turn is is not
5866 ;; easily made available at dmeventd build time. Just ignore
5867 ;; it until the situation improves.
5868 (delete "--enable-dmeventd" ,flags)))
5869 ((#:phases phases)
5870 #~(modify-phases #$phases
5871 (add-before 'configure 'adjust-Makefile
5872 (lambda _
5873 ;; These fixes are related to the upstream libdm->device_mapper
5874 ;; migration and will hopefully be fixed upstream in due time.
5875 (substitute* "tools/Makefile.in"
5876 ;; This variable is empty in a static configuration and causes
5877 ;; an erroneous GCC command line.
5878 (("-L\\$\\(interfacebuilddir\\)") "")
5879 ;; Remove obsolete reference to libdevmapper.a.
5880 (("-ldevmapper") ""))
5881 #t))
5882 (add-after 'install 'adjust-pkgconfig
5883 ;; The static eudev is missing its pkg config file, and I am not
5884 ;; rebuilding it at this point.
5885 (lambda* (#:key inputs #:allow-other-keys)
5886 (substitute* (string-append #$output "/lib/pkgconfig/devmapper.pc")
5887 (("Requires.private: .*") "")
5888 (("Libs.private:")
5889 (format #f "Libs.private: -L~a -ludev"
5890 (dirname (search-input-file inputs "lib/libudev.a")))))))))))
5891 (synopsis "Logical volume management for Linux (statically linked)")))
5892
5893(define-public thin-provisioning-tools
5894 (package
5895 (name "thin-provisioning-tools")
5896 (version "0.8.5")
5897 (source
5898 (origin
5899 (method git-fetch)
5900 (uri (git-reference
5901 (url "https://github.com/jthornber/thin-provisioning-tools")
5902 (commit (string-append "v" version))))
5903 (file-name (git-file-name name version))
5904 (sha256
5905 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
5906 (build-system gnu-build-system)
5907 (arguments
5908 ;; Doesn't build with --enable-testing due to a function name collision
5909 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
5910 `(#:tests? #f))
5911 (native-inputs
5912 `(("automake" ,automake)
5913 ("autoreconf" ,autoconf)))
5914 (inputs
5915 (list boost expat libaio))
5916 (synopsis "Tools for manipulating the metadata of device-mapper targets")
5917 (description "A suite of tools for manipulating the metadata of the
5918dm-thin, dm-cache and dm-era device-mapper targets.")
5919 (home-page "https://github.com/jthornber/thin-provisioning-tools")
5920 (license license:gpl3+)))
5921
5922(define-public watchdogd
5923 (package
5924 (name "watchdogd")
5925 (version "4.0")
5926 (source (origin
5927 (method git-fetch)
5928 (uri (git-reference
5929 (url "https://github.com/troglobit/watchdogd")
5930 (commit version)))
5931 (file-name (git-file-name name version))
5932 (sha256
5933 (base32
5934 "112mdhqykl78qk8l7nx7h19nnd58v0axj6ws8s47n9a64b867li4"))))
5935 (build-system gnu-build-system)
5936 (native-inputs (list autoconf automake libtool pkg-config))
5937 (inputs (list libconfuse libite libuev))
5938 (synopsis "Advanced system & process supervisor for Linux")
5939 (description "This package provides an advanced monitor of critical system
5940resources, supervises the heartbeat of processes, records deadline
5941transgressions, and initiates a controlled reset if needed.")
5942 (home-page "https://troglobit.com/projects/watchdogd/")
5943 (license license:isc)))
5944
5945(define-public wireless-tools
5946 (package
5947 (name "wireless-tools")
5948 (version "30.pre9")
5949 (source
5950 (origin
5951 (method url-fetch)
5952 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/"
5953 "Linux/wireless_tools." version ".tar.gz"))
5954 (sha256
5955 (base32 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
5956 (snippet
5957 #~(begin
5958 ;; Remove the older header files that are not free software.
5959 (for-each (lambda (n)
5960 (delete-file (format #f "wireless.~a.h" n)))
5961 '(10 11 12 13 14 15 16 17 18 19 20))))))
5962 (build-system gnu-build-system)
5963 (arguments
5964 (list #:make-flags
5965 #~(list (string-append "PREFIX=" #$output)
5966 (string-append "INSTALL_MAN=" #$output "/share/man")
5967 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
5968 "BUILD_STATIC=")
5969 #:phases
5970 #~(modify-phases %standard-phases
5971 (replace 'configure
5972 (lambda* (#:key target #:allow-other-keys)
5973 (when target
5974 ;; Cross-compilation: use the cross tools.
5975 (substitute* (find-files "." "Makefile")
5976 (("CC = .*$")
5977 (string-append "CC = " target "-gcc\n"))
5978 (("AR = .*$")
5979 (string-append "AR = " target "-ar\n"))
5980 (("RANLIB = .*$")
5981 (string-append "RANLIB = " target "-ranlib\n")))))))
5982 #:tests? #f))
5983 (synopsis "Tools for manipulating Linux Wireless Extensions")
5984 (description "Wireless Tools are used to manipulate the now-deprecated
5985Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
5986Extension was an interface allowing you to set Wireless LAN specific
5987parameters and get the specific stats. It is deprecated in favor the nl80211
5988interface.")
5989 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
5990 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
5991 ;; other files are distributed under gpl2.
5992 (license (list license:gpl2 license:lgpl2.1+))))
5993
5994(define-public crda
5995 (package
5996 (name "crda")
5997 (version "4.15")
5998 (source
5999 (origin
6000 (method git-fetch)
6001 (uri (git-reference
6002 (url "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git")
6003 (commit (string-append "v" version))))
6004 (file-name (git-file-name name version))
6005 (sha256
6006 (base32 "1ajh8zx84p15y9wawh764zawniwn059iw9m32v56ajvkz9xbnkp2"))
6007 (patches (search-patches "crda-optional-gcrypt.patch"))))
6008 (build-system gnu-build-system)
6009 (arguments
6010 (list #:phases
6011 #~(modify-phases %standard-phases
6012 (delete 'configure)
6013 (add-after 'unpack 'gzip-deterministically
6014 (lambda _
6015 (substitute* "Makefile"
6016 (("gzip" command)
6017 (string-append command " --no-name")))))
6018 #$@(if (%current-target-system)
6019 #~((add-after 'unpack 'fix-pkg-config
6020 (lambda* (#:key target #:allow-other-keys)
6021 (substitute* "Makefile"
6022 (("pkg-config" command)
6023 (string-append target "-" command))))))
6024 #~())
6025 (add-before 'build 'patch-Makefile
6026 (lambda _
6027 (substitute* "Makefile"
6028 (("ldconfig") "true"))))
6029 (add-before 'build 'set-regulatory-db-file-name
6030 (lambda* (#:key native-inputs inputs #:allow-other-keys)
6031 ;; Tell CRDA where to find our database.
6032 (let ((regdb (assoc-ref (or native-inputs inputs)
6033 "wireless-regdb")))
6034 (substitute* "crda.c"
6035 (("\"/lib/crda/regulatory.bin\"")
6036 (string-append "\"" regdb
6037 "/lib/crda/regulatory.bin\"")))))))
6038 #:test-target "verify"
6039 #:make-flags
6040 #~(list
6041 (string-append "CC=" #$(cc-for-target))
6042 "V=1"
6043
6044 ;; Disable signature-checking on 'regulatory.bin'.
6045 ;; The reason is that this simplifies maintenance
6046 ;; on our side (no need to manage a distro key
6047 ;; pair), and we can guarantee integrity of
6048 ;; 'regulatory.bin' by other means anyway, such as
6049 ;; 'guix gc --verify'. See
6050 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
6051 ;; for a discssion.
6052 "USE_OPENSSL=0"
6053
6054 (string-append "PREFIX=" #$output)
6055 (string-append "SBINDIR=" #$output "/sbin/")
6056 (string-append "UDEV_RULE_DIR="
6057 #$output "/lib/udev/rules.d")
6058 (string-append "LDFLAGS=-Wl,-rpath="
6059 #$output "/lib -L.")
6060 (string-append "REG_BIN="
6061 #$(this-package-native-input "wireless-regdb")
6062 "/lib/crda/regulatory.bin")
6063 "all_noverify")))
6064 (native-inputs (list pkg-config wireless-regdb))
6065 (inputs (list libnl))
6066 (home-page
6067 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
6068 (synopsis "@acronym{CRDA, Central Regulatory Domain Agent} for WiFi")
6069 (description
6070 "The @acronym{CRDA, Central Regulatory Domain Agent} acts as the udev
6071helper for communication between the kernel Linux and user space for regulatory
6072compliance.")
6073 (license license:copyleft-next)))
6074
6075(define-public wireless-regdb
6076 (package
6077 (name "wireless-regdb")
6078 (version "2023.05.03")
6079 (source (origin
6080 (method url-fetch)
6081 (uri (string-append
6082 "mirror://kernel.org/software/network/wireless-regdb/"
6083 "wireless-regdb-" version ".tar.xz"))
6084 (sha256
6085 (base32 "04lc9jp8zxhyqxvkhrm637sswi2xm48jw8jnp3iflnknnf5d0m7j"))
6086
6087 ;; We're building 'regulatory.bin' by ourselves.
6088 (snippet '(begin
6089 (delete-file "regulatory.bin")))))
6090 (build-system gnu-build-system)
6091 (arguments
6092 (list
6093 #:phases
6094 #~(modify-phases %standard-phases
6095 (add-after 'unpack 'gzip-determinism
6096 (lambda _
6097 (substitute* "Makefile"
6098 (("gzip") "gzip --no-name"))))
6099 (add-after 'unpack 'omit-signature
6100 (lambda _
6101 (substitute* "Makefile"
6102 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
6103 ;; don't provide (see below). Disable it.
6104 ((" regulatory\\.db\\.p7s") "")
6105 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
6106 ;; but ‘make install’ depends only on the latter while
6107 ;; installing both (and failing). Depend on it explicitly.
6108 (("^install: " all) (string-append all "regulatory.db ")))))
6109 (delete 'configure)) ; no configure script
6110
6111 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
6112 ;; is computed and can be equal to 'maintainer-clean'; when that
6113 ;; happens, we can end up deleting the 'regulatory.bin' file that we
6114 ;; just built. Thus, build things sequentially.
6115 #:parallel-build? #f
6116
6117 #:tests? #f ; no tests
6118 #:make-flags
6119 #~(list (string-append "PREFIX=" #$output)
6120 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
6121
6122 ;; Leave this empty so that db2bin.py doesn't try to sign
6123 ;; ‘regulatory.bin’. This allows us to avoid managing a key
6124 ;; pair for the whole distribution.
6125 (string-append "REGDB_PRIVKEY=")
6126 ;; Don't generate a public key for the same reason. These are
6127 ;; used as Makefile targets and can't be the empty string.
6128 (string-append "REGDB_PUBCERT=/dev/null")
6129 (string-append "REGDB_PUBKEY=/dev/null"))))
6130 (native-inputs
6131 (list python-wrapper))
6132 (home-page
6133 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
6134 (synopsis "Wireless regulatory database")
6135 (description
6136 "This package contains the wireless regulatory database for the
6137@acronym{CRDA, Central Regulatory Database Agent}. The database contains
6138information on country-specific regulations for the wireless spectrum.")
6139 (license license:isc)))
6140
6141(define-public lm-sensors
6142 (package
6143 (name "lm-sensors")
6144 (version "3.6.2")
6145 (source
6146 (origin
6147 (method git-fetch)
6148 (uri (git-reference
6149 (url "https://github.com/hramrach/lm-sensors")
6150 (commit (string-append "V" (string-join
6151 (string-split version #\.) "-")))))
6152 (file-name (git-file-name name version))
6153 (sha256
6154 (base32 "0p2ck8p9zb1w53l37pvm6c10vi6r8bfz51nd3sdwwsfhfhgvsr0j"))
6155 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
6156 (build-system gnu-build-system)
6157 (outputs '("lib" ; avoid perl in closure
6158 "out"))
6159 (arguments
6160 (list
6161 #:tests? #f ; no 'check' target
6162 #:make-flags
6163 #~(list (string-append "PREFIX=" #$output)
6164 (string-append "ETCDIR=" #$output:lib "/etc")
6165 (string-append "INCLUDEDIR=" #$output:lib "/include")
6166 (string-append "MANDIR=" #$output "/share/man")
6167 (string-append "LIBDIR=" #$output:lib "/lib"))
6168 #:phases
6169 #~(modify-phases %standard-phases
6170 (delete 'configure)
6171 (add-before 'build 'patch-exec-paths
6172 (lambda* (#:key inputs #:allow-other-keys)
6173 (substitute* "prog/detect/sensors-detect"
6174 (("`uname")
6175 (string-append
6176 "`" (assoc-ref inputs "coreutils") "/bin/uname"))
6177 (("(`|\")modprobe" all open-quote)
6178 (string-append
6179 open-quote #$(this-package-input "kmod") "/bin/modprobe")))
6180 (substitute* '("prog/pwm/pwmconfig" "prog/pwm/fancontrol")
6181 (("gnuplot")
6182 (search-input-file inputs "/bin/gnuplot"))
6183 (("cat ")
6184 (string-append (search-input-file inputs "/bin/cat") " "))
6185 (("e?grep " match)
6186 (string-append
6187 (search-input-file
6188 inputs (string-append "/bin/" (string-trim-right match)))
6189 " "))
6190 (("sed -e")
6191 (string-append (search-input-file inputs "/bin/sed") " -e"))
6192 (("cut -d")
6193 (string-append (search-input-file inputs "/bin/cut") " -d"))
6194 (("sleep ")
6195 (string-append (search-input-file inputs "/bin/sleep") " "))
6196 (("readlink -f")
6197 (string-append
6198 (search-input-file inputs "/bin/readlink") " -f"))))))))
6199 (inputs
6200 (list gnuplot kmod perl rrdtool))
6201 (native-inputs
6202 (list bison flex pkg-config which))
6203 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
6204 (synopsis "Utilities to read temperature/voltage/fan sensors")
6205 (description
6206 "Lm-sensors is a hardware health monitoring package for Linux. It allows
6207you to access information from temperature, voltage, and fan speed sensors.
6208It works with most newer systems.")
6209 (license license:gpl2+)))
6210
6211(define-public iucode-tool
6212 (package
6213 (name "iucode-tool")
6214 (version "2.3.1")
6215 (source (origin
6216 (method url-fetch)
6217 (uri (string-append "https://gitlab.com/iucode-tool/releases"
6218 "/raw/latest/iucode-tool_" version ".tar.xz"))
6219 (sha256
6220 (base32
6221 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
6222 (build-system gnu-build-system)
6223 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
6224 (synopsis "Manipulate Intel microcode bundles")
6225 (description
6226 "@command{iucode_tool} is a utility to work with microcode packages for
6227Intel processors. It can convert between formats, extract specific versions,
6228create a firmware image suitable for the Linux kernel, and more.")
6229 ;; cpuid.h is available for i686, x86_64, and ia64.
6230 (supported-systems '("i686-linux" "x86_64-linux"))
6231 (license license:gpl2+)))
6232
6233(define-public i2c-tools
6234 (package
6235 (name "i2c-tools")
6236 (version "4.3")
6237 (source (origin
6238 (method url-fetch)
6239 (uri (string-append
6240 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6241 version ".tar.xz"))
6242 (sha256
6243 (base32
6244 "1y0fphjd5ah2j886x8i175r7viq0hmx666hyca0wi4dzrm290qxk"))))
6245 (build-system gnu-build-system)
6246 (arguments
6247 `(#:tests? #f ; no 'check' target
6248 #:make-flags
6249 ,#~(list (string-append "PREFIX=" #$output)
6250 (string-append "LDFLAGS+=-Wl,-rpath=" #$output "/lib")
6251 (string-append "CC=" #$(cc-for-target)))
6252 ;; No configure script.
6253 #:phases (modify-phases %standard-phases (delete 'configure))))
6254 (inputs
6255 (list perl))
6256 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
6257 (synopsis "I2C tools for Linux")
6258 (description
6259 "The i2c-tools package contains a heterogeneous set of I2C tools for
6260Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
6261EEPROM decoding scripts, EEPROM programming tools, and a python module for
6262SMBus access.")
6263 (license license:gpl2+)))
6264
6265(define-public i2c-tools-3
6266 (package
6267 (inherit i2c-tools)
6268 (name "i2c-tools")
6269 (version "3.1.2")
6270 (source (origin
6271 (method url-fetch)
6272 (uri (string-append
6273 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6274 version ".tar.bz2"))
6275 (sha256
6276 (base32 "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv"))))
6277 (arguments
6278 (substitute-keyword-arguments (package-arguments i2c-tools)
6279 ((#:make-flags _)
6280 #~(list (string-append "prefix=" #$output)
6281 (string-append "CC=" #$(cc-for-target))))))))
6282
6283(define-public python-smbus
6284 (package
6285 (inherit i2c-tools)
6286 (name "python-smbus")
6287 (build-system pyproject-build-system)
6288 (arguments
6289 (list #:tests? #f ;; No test suite.
6290 #:phases
6291 #~(modify-phases %standard-phases
6292 (add-after 'unpack 'change-directory
6293 (lambda _ (chdir "py-smbus")))
6294 (add-after 'change-directory 'set-library-path
6295 (lambda _
6296 (substitute* "setup.py"
6297 (("-L\\.\\./lib")
6298 (string-append "-L" #$(this-package-input "i2c-tools")
6299 "/lib"))))))))
6300 (inputs (list i2c-tools))
6301 (native-inputs (list python-setuptools python-wheel))
6302 (synopsis "I2C/SMBus access for Python")
6303 (description "This package provides a Python library to access
6304@acronym{I2C, Inter-Integrated Circuit} and @acronym{SMBus, System
6305Management Bus} devices on Linux.")))
6306
6307(define-public xsensors
6308 (package
6309 (name "xsensors")
6310 (version "0.70")
6311 (source (origin
6312 (method url-fetch)
6313 (uri (string-append
6314 "http://www.linuxhardware.org/xsensors/xsensors-"
6315 version ".tar.gz"))
6316 (sha256
6317 (base32
6318 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
6319 (build-system gnu-build-system)
6320 (inputs `(("lm-sensors" ,lm-sensors "lib")
6321 ("gtk" ,gtk+-2)))
6322 (native-inputs (list pkg-config))
6323 (arguments
6324 `(#:phases
6325 (modify-phases %standard-phases
6326 (add-before 'configure 'enable-deprecated
6327 (lambda _
6328 (substitute* "src/Makefile.in"
6329 (("-DGDK_DISABLE_DEPRECATED") "")
6330 (("-DGTK_DISABLE_DEPRECATED") ""))
6331 #t))
6332 (add-before 'configure 'remove-Werror
6333 (lambda _
6334 (substitute* '("configure" "src/Makefile.in")
6335 (("-Werror") ""))
6336 #t)))))
6337 (home-page "http://www.linuxhardware.org/xsensors/")
6338 (synopsis "Hardware health information viewer")
6339 (description
6340 "Xsensors reads data from the libsensors library regarding hardware
6341health such as temperature, voltage and fan speed and displays the information
6342in a digital read-out.")
6343 (license license:gpl2+)))
6344
6345(define-public perf
6346 (package
6347 (name "perf")
6348 (version (package-version linux-libre))
6349 (source (package-source linux-libre))
6350 (build-system gnu-build-system)
6351 (arguments
6352 '(#:phases
6353 (modify-phases %standard-phases
6354 (replace 'configure
6355 (lambda* (#:key inputs #:allow-other-keys)
6356 (setenv "SHELL_PATH" (which "bash"))
6357 (chdir "tools/perf")
6358
6359 ;; In Linux 6.10.6, 'Makefile.config' overrides PKG_CONFIG_PATH
6360 ;; when looking for libtraceevent and thus fails to find it.
6361 ;; Remove that.
6362 (substitute* "Makefile.config"
6363 (("PKG_CONFIG_PATH=[[:graph:]]+")
6364 ""))
6365
6366 ;; This file hard-codes file system layouts for specific distros
6367 ;; but not for ours; address that. With this change, one can run
6368 ;; "perf report --symfs=$HOME/.guix-profile" (without
6369 ;; "/lib/debug") and 'perf' should be able to find separate debug
6370 ;; info files.
6371 (substitute* "util/dso.c"
6372 (("/usr/lib/debug")
6373 "/lib/debug")))))
6374 #:make-flags (list (string-append "prefix="
6375 (assoc-ref %outputs "out"))
6376 "CC=gcc"
6377 "WERROR=0"
6378
6379 ;; By default, 'config/Makefile' uses lib64 on
6380 ;; x86_64. Work around that.
6381 "lib=lib")
6382 #:tests? #f)) ;no tests
6383 (native-inputs
6384 (list pkg-config
6385 bison
6386 flex
6387 ;; There are build scripts written in these languages.
6388 perl
6389 python-2
6390 python-3
6391 ;; Documentation
6392 docbook-xsl
6393 xmlto
6394 asciidoc))
6395 (inputs
6396 (list slang ;for the interactive TUI
6397 zlib
6398 ;; newt
6399 python-2 ;'perf' links against libpython
6400 elfutils
6401 libiberty ;used alongside BDF for symbol demangling
6402 libunwind ;better stack walking
6403 libtraceevent
6404 numactl)) ;for 'perf bench numa mem'
6405 (home-page "https://perf.wiki.kernel.org/")
6406 (synopsis "Linux profiling with performance counters")
6407 (description
6408 "perf is a tool suite for profiling using hardware performance counters,
6409with support in the Linux kernel. perf can instrument CPU performance
6410counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
6411of lightweight profiling. This package contains the user-land tools and in
6412particular the @code{perf} command.")
6413 (license (package-license linux-libre))))
6414
6415(define-public pflask
6416 (package
6417 (name "pflask")
6418 (version "0.2")
6419 (source (origin
6420 (method git-fetch)
6421 (uri (git-reference
6422 (url "https://github.com/ghedo/pflask")
6423 (commit (string-append "v" version))))
6424 (file-name (git-file-name name version))
6425 (sha256
6426 (base32
6427 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
6428 (build-system cmake-build-system)
6429 (arguments
6430 '(#:tests? #f)) ; no tests
6431 (home-page "https://ghedo.github.io/pflask/")
6432 (synopsis "Simple tool for creating Linux namespace containers")
6433 (description "pflask is a simple tool for creating Linux namespace
6434containers. It can be used for running a command or even booting an OS inside
6435an isolated container, created with the help of Linux namespaces. It is
6436similar in functionality to chroot, although pflask provides better isolation
6437thanks to the use of namespaces.")
6438 (license license:bsd-2)))
6439
6440(define-public singularity
6441 (package
6442 (name "singularity")
6443 (version "2.6.1")
6444 (source (origin
6445 (method url-fetch)
6446 (uri (string-append "https://github.com/singularityware/singularity/"
6447 "releases/download/" version
6448 "/singularity-" version ".tar.gz"))
6449 (sha256
6450 (base32
6451 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
6452 (modules '((guix build utils)))
6453 (snippet
6454 '(begin
6455 ;; Do not create directories in /var.
6456 (substitute* "Makefile.in"
6457 (("\\$\\(MAKE\\) .*install-data-hook") ""))
6458
6459 ;; The original source overrides PATH so that it points to
6460 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
6461 ;; on Guix System. Leave PATH unchanged so we refer to the
6462 ;; installed Coreutils, grep, etc.
6463 (substitute* "bin/singularity.in"
6464 (("^PATH=.*" all)
6465 (string-append "#" all "\n")))
6466
6467 (substitute* (find-files "libexec/cli" "\\.exec$")
6468 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
6469 _ program)
6470 (string-append "/run/privileged/bin/singularity-"
6471 program "-helper")))
6472
6473 ;; These squashfs mount options are apparently no longer
6474 ;; supported since Linux-libre 5.4.5.
6475 (substitute* "src/lib/image/squashfs/mount.c"
6476 (("\"errors=remount-ro\"")
6477 "NULL"))))))
6478 (build-system gnu-build-system)
6479 (arguments
6480 (list
6481 #:configure-flags #~(list "--localstatedir=/var")
6482 #:phases
6483 #~(modify-phases %standard-phases
6484 (add-after 'unpack 'patch-references
6485 (lambda _
6486 (substitute* "libexec/cli/build.exec.in"
6487 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
6488 (substitute* (append
6489 (find-files "libexec" "functions")
6490 (find-files "libexec/bootstrap-scripts" ".*sh$")
6491 (find-files "libexec/cli" ".*exec$"))
6492 (("\\| grep ")
6493 (string-append "| " (which "grep") " "))
6494 (("egrep ")
6495 (string-append (which "egrep") " "))
6496 ((" sed ")
6497 (string-append " " (which "sed") " ")))))
6498 (add-after 'install 'set-PATH
6499 (lambda _
6500 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
6501 ;; But don't override PATH, so that other tools like zcat and
6502 ;; tar can still be found if they are available.
6503 (let ((coreutils #$(this-package-input "coreutils")))
6504 (wrap-program (string-append #$output "/bin/singularity")
6505 `("PATH" prefix (,(string-append coreutils "/bin"))))
6506 (substitute* (string-append #$output "/bin/run-singularity")
6507 (("/usr/bin/env singularity")
6508 (string-append (which "env") " "
6509 #$output "/bin/singularity")))))))))
6510 (inputs
6511 (list bash-minimal
6512 coreutils
6513 libarchive
6514 python-wrapper
6515 squashfs-tools
6516 zlib))
6517 (home-page "https://singularity.lbl.gov/")
6518 (synopsis "Container platform")
6519 (description "Singularity is a container platform supporting a number of
6520container image formats. It can build SquashFS container images or import
6521existing Docker images. Singularity requires kernel support for container
6522isolation or root privileges.")
6523 (license license:bsd-3)))
6524
6525(define-public python-spython
6526 (package
6527 (name "python-spython")
6528 (version "0.3.13")
6529 (source
6530 (origin
6531 (method url-fetch)
6532 (uri (pypi-uri "spython" version))
6533 (sha256
6534 (base32 "0kly851k6mj7xzcybciav5d0pq5q04pzg7c5a1g712bqbxkha4ck"))))
6535 (build-system pyproject-build-system)
6536 (arguments
6537 (list
6538 #:phases
6539 #~(modify-phases %standard-phases
6540 ;; Configure absolute path to singularity.
6541 (add-after 'unpack 'configure
6542 (lambda* (#:key inputs #:allow-other-keys)
6543 (let ((singularity (search-input-file inputs "bin/singularity")))
6544 (substitute* "spython/utils/terminal.py"
6545 (("software=\"singularity\"")
6546 (string-append "software=\"" singularity "\"")))
6547 (substitute* (list "spython/utils/terminal.py"
6548 "spython/main/help.py"
6549 "spython/main/base/command.py")
6550 (("\\[\"singularity\"")
6551 (string-append "[\"" singularity "\"")))
6552 (substitute* "spython/main/execute.py"
6553 (("shutil.which\\(\"singularity\"\\)")
6554 (string-append "shutil.which(\"" singularity "\")"))))))
6555 ;; Skip tests that require network access.
6556 (add-before 'check 'skip-tests
6557 (lambda _
6558 (delete-file "spython/tests/test_client.py"))))))
6559 (inputs
6560 (list singularity))
6561 (native-inputs
6562 (list python-pytest
6563 python-pytest-runner
6564 python-setuptools
6565 python-wheel))
6566 (home-page "https://github.com/singularityhub/singularity-cli")
6567 (synopsis "Singularity Python client")
6568 (description "@code{python-spython} is a Python library to interact with
6569Singularity containers.")
6570 (license license:mpl2.0)))
6571
6572(define-public libnvme
6573 (package
6574 (name "libnvme")
6575 (version "1.5")
6576 (source (origin
6577 (method git-fetch)
6578 (uri (git-reference
6579 (url "https://github.com/linux-nvme/libnvme.git")
6580 (commit (string-append "v" version))))
6581 (sha256
6582 (base32 "1wq8bw60l090z2kb717wyzk5wz1jrcn31ykdaa7k9pz9w79v0v67"))
6583 (file-name (git-file-name name version))))
6584 (build-system meson-build-system)
6585 (outputs (list "out" "doc")) ; docs are 80% of all output
6586 (arguments
6587 (list
6588 #:configure-flags
6589 #~(let ((doc (string-append #$output:doc "/share/doc/" #$name)))
6590 (list (string-append "-Dhtmldir=" doc "/html")
6591 (string-append "-Drstdir=" doc "/rst")
6592 "-Ddocs-build=true" "-Ddocs=all"))))
6593 (native-inputs (list pkg-config perl python python-sphinx))
6594 ;; libnvme.pc, libnvme-mi.pc lists these in Requires.private.
6595 (propagated-inputs (list dbus json-c openssl))
6596 (home-page "https://github.com/linux-nvme/libnvme")
6597 (synopsis "C Library for NVM Express on Linux")
6598 (description "libnvme provides type definitions for NVMe specification
6599structures, enumerations, and bit fields, helper functions to construct,
6600dispatch, and decode commands and payloads, and utilities to connect, scan,
6601and manage nvme devices on a Linux system.")
6602 (license license:lgpl2.1+)))
6603
6604(define-public nvme-cli
6605 (package
6606 (name "nvme-cli")
6607 (version "2.5")
6608 (home-page "https://github.com/linux-nvme/nvme-cli")
6609 (source (origin
6610 (method git-fetch)
6611 (uri (git-reference
6612 (url home-page)
6613 (commit (string-append "v" version))))
6614 (sha256
6615 (base32 "1jv1xir6gm86yyk5846qqkcjhc1bq103zyxf794fznyinh4nhlbg"))
6616 (file-name (git-file-name name version))))
6617 (build-system meson-build-system)
6618 (outputs (list "out" "doc")) ; docs make up ~70% of total size
6619 (arguments
6620 (list
6621 #:configure-flags #~(list (format #f "-Dhtmldir=~a/share/doc/~a/html"
6622 #$output:doc #$name)
6623 "-Ddocs=all")))
6624 (native-inputs (list pkg-config))
6625 (inputs (list libnvme json-c zlib))
6626 (synopsis "NVM-Express user space tooling for Linux")
6627 (description "Nvme-cli is a utility to provide standards compliant tooling
6628for NVM-Express drives. It was made specifically for Linux as it relies on the
6629IOCTLs defined by the mainline kernel driver.")
6630 (license license:gpl2+)))
6631
6632(define-public rfkill
6633 (package
6634 (name "rfkill")
6635 (version "0.5")
6636 (source (origin
6637 (method url-fetch)
6638 (uri (string-append "mirror://kernel.org/software/network/"
6639 name "/" name "-" version ".tar.xz"))
6640 (sha256
6641 (base32
6642 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
6643 (build-system gnu-build-system)
6644 (arguments
6645 `(#:make-flags (list "CC=gcc"
6646 (string-append "PREFIX=" %output))
6647 #:phases (modify-phases %standard-phases
6648 (delete 'configure))
6649 #:tests? #f))
6650 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
6651 (synopsis "Tool for enabling and disabling wireless devices")
6652 (description
6653 "rfkill is a simple tool for accessing the rfkill device interface,
6654which is used to enable and disable wireless networking devices, typically
6655WLAN, Bluetooth and mobile broadband.")
6656 (license (license:non-copyleft "file://COPYING"
6657 "See COPYING in the distribution."))
6658 ;; rfkill is part of util-linux as of 2.31.
6659 (properties `((superseded . ,util-linux)))))
6660
6661(define-public acpi
6662 (package
6663 (name "acpi")
6664 (version "1.7")
6665 (source (origin
6666 (method url-fetch)
6667 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
6668 version "/" name "-" version ".tar.gz"))
6669 (sha256
6670 (base32
6671 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
6672 (build-system gnu-build-system)
6673 (home-page "http://acpiclient.sourceforge.net")
6674 (synopsis "Display information on ACPI devices")
6675 (description "@code{acpi} attempts to replicate the functionality of the
6676\"old\" @code{apm} command on ACPI systems, including battery and thermal
6677information. It does not support ACPI suspending, only displays information
6678about ACPI devices.")
6679 (license license:gpl2+)))
6680
6681(define-public acpid
6682 (package
6683 (name "acpid")
6684 (version "2.0.34")
6685 (source (origin
6686 (method url-fetch)
6687 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
6688 version ".tar.xz"))
6689 (sha256
6690 (base32
6691 "0cxkdbd087kj9ikprvvjpk0ixzqbipf2rmj6qyp7r15wzj65q29d"))))
6692 (build-system gnu-build-system)
6693 (home-page "https://sourceforge.net/projects/acpid2/")
6694 (synopsis "Daemon for delivering ACPI events to user-space programs")
6695 (description
6696 "acpid is designed to notify user-space programs of Advanced
6697Configuration and Power Interface (ACPI) events. acpid should be started
6698during the system boot, and will run as a background process. When an ACPI
6699event is received from the kernel, acpid will examine the list of rules
6700specified in /etc/acpi/events and execute the rules that match the event.")
6701 (license license:gpl2+)))
6702
6703(define-public sysfsutils
6704 (package
6705 (name "sysfsutils")
6706 (version "2.1.0")
6707 (source
6708 (origin
6709 (method url-fetch)
6710 (uri
6711 (string-append
6712 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
6713 version ".tar.gz"))
6714 (sha256
6715 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
6716 (build-system gnu-build-system)
6717 (home-page "https://linux-diag.sourceforge.net/Sysfsutils.html")
6718 (synopsis "System utilities based on Linux sysfs")
6719 (description
6720 "These are a set of utilities built upon sysfs, a virtual file system in
6721Linux kernel versions 2.5+ that exposes a system's device tree. The package
6722also contains the libsysfs library.")
6723 ;; The library is under lgpl2.1+ (all files say "or any later version").
6724 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
6725 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
6726
6727(define-public cpufrequtils
6728 (let ((commit "a2f0c39d5f21596bb9f5223e895c0ff210b265d0")
6729 (revision "1"))
6730 (package
6731 (name "cpufrequtils")
6732 (version (git-version "008" revision commit ))
6733 (source
6734 (origin
6735 (method git-fetch)
6736 (uri
6737 (git-reference
6738 (url "https://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpufrequtils.git")
6739 (commit commit)))
6740 (file-name (git-file-name name version))
6741 (sha256
6742 (base32 "01n2hp6v89cilqqvqvlcprphyhnljsjclh4h1zf3b1l7ypz29lbp"))))
6743 (build-system gnu-build-system)
6744 (arguments
6745 `(#:tests? #f ; no test suite
6746 #:make-flags
6747 (let ((out (assoc-ref %outputs "out")))
6748 (list "PROC=false" ; obsoleted by sysfs in Linux 2.6(!)
6749 (string-append "CC=" ,(cc-for-target))
6750 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
6751 "INSTALL=install"
6752 (string-append "bindir=" out "/bin")
6753 (string-append "sbindir=" out "/sbin")
6754 (string-append "mandir=" out "/share/man")
6755 (string-append "includedir=" out "/include")
6756 (string-append "libdir=" out "/lib")
6757 (string-append "localedir=" out "/share/locale")
6758 (string-append "docdir=" out "/share/doc/" ,name)))
6759 #:phases
6760 (modify-phases %standard-phases
6761 (delete 'configure)))) ; no configure script
6762 (native-inputs
6763 `(("gettext" ,gettext-minimal)))
6764 (home-page
6765 "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
6766 (synopsis "Utilities to get and set CPU frequency on Linux")
6767 (description
6768 "The cpufrequtils suite contains utilities to retrieve CPU frequency
6769information, and set the CPU frequency if supported, using the cpufreq
6770capabilities of the Linux kernel.")
6771 (license license:gpl2))))
6772
6773(define-public libite
6774 (package
6775 (name "libite")
6776 (version "2.5.2")
6777 (source
6778 (origin
6779 (method git-fetch)
6780 (uri (git-reference
6781 (url "https://github.com/troglobit/libite")
6782 (commit (string-append "v" version))))
6783 (file-name (git-file-name name version))
6784 (sha256
6785 (base32 "0i27ppb557kdc1hm7nf0f5r7sxvqma31pr57h79whl6qcp28gy4a"))))
6786 (build-system gnu-build-system)
6787 (arguments
6788 `(#:configure-flags
6789 (list "--disable-static")
6790 #:phases
6791 (modify-phases %standard-phases
6792 (add-after 'unpack 'fix-tests
6793 (lambda* (#:key inputs #:allow-other-keys)
6794 ;; replace paths to the executables
6795 (substitute* "test/which.c"
6796 (("/usr/bin/which")
6797 (search-input-file inputs "/bin/which"))
6798 (("ls\"")
6799 (string-append
6800 (search-input-file inputs "/bin/ls") "\"")))
6801 ;; create pidfile in /tmp instead of /var
6802 (substitute* "test/pidfile.c" (("/var/tmp") "/tmp")))))))
6803 (native-inputs (list autoconf automake libtool which))
6804 (synopsis "Library providing missing pieces in GNU libc")
6805 (description "This package provides many of the missing pieces in GNU
6806libc. Most notably the string functions: strlcpy(3), strlcat(3) and the *BSD
6807sys/queue.h and sys/tree.h API's.")
6808 (home-page "https://troglobit.com/projects/libite/")
6809 (license license:expat)))
6810
6811(define-public libuev
6812 (package
6813 (name "libuev")
6814 (version "2.4.0")
6815 (source
6816 (origin
6817 (method git-fetch)
6818 (uri (git-reference
6819 (url "https://github.com/troglobit/libuev")
6820 (commit (string-append "v" version))))
6821 (file-name (git-file-name name version))
6822 (sha256
6823 (base32
6824 "0ih82lxfdcq179kknzdl5c8vi1l0n5j7yh68y8f6kwsrm457paf7"))))
6825 (build-system gnu-build-system)
6826 (native-inputs (list autoconf automake libtool))
6827 (synopsis "Lightweight event loop library for epoll family APIs")
6828 (description "This package provides small event loop that wraps the
6829epoll family of APIs.")
6830 (home-page "https://troglobit.com/projects/libuev/")
6831 (license license:expat)))
6832
6833(define-public libraw1394
6834 (package
6835 (name "libraw1394")
6836 (version "2.1.2")
6837 (source (origin
6838 (method url-fetch)
6839 (uri (string-append
6840 "mirror://kernel.org/linux/libs/ieee1394/"
6841 name "-" version ".tar.xz"))
6842 (sha256
6843 (base32
6844 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
6845 (build-system gnu-build-system)
6846 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
6847 (synopsis "Interface library for the Linux IEEE1394 drivers")
6848 (description
6849 "Libraw1394 is the only supported interface to the kernel side raw1394 of
6850the Linux IEEE-1394 subsystem, which provides direct access to the connected
68511394 buses to user space. Through libraw1394/raw1394, applications can directly
6852send to and receive from other nodes without requiring a kernel driver for the
6853protocol in question.")
6854 (license license:lgpl2.1+)))
6855
6856(define-public libavc1394
6857 (package
6858 (name "libavc1394")
6859 (version "0.5.4")
6860 (source (origin
6861 (method url-fetch)
6862 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
6863 name "-" version ".tar.gz"))
6864 (sha256
6865 (base32
6866 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
6867 (build-system gnu-build-system)
6868 (native-inputs
6869 (list pkg-config))
6870 (propagated-inputs
6871 (list libraw1394)) ; required by libavc1394.pc
6872 (home-page "https://sourceforge.net/projects/libavc1394/")
6873 (synopsis "AV/C protocol library for IEEE 1394")
6874 (description
6875 "Libavc1394 is a programming interface to the AV/C specification from
6876the 1394 Trade Association. AV/C stands for Audio/Video Control.")
6877 (license license:lgpl2.1+)))
6878
6879(define-public libiec61883
6880 (package
6881 (name "libiec61883")
6882 (version "1.2.0")
6883 (source (origin
6884 (method url-fetch)
6885 (uri (string-append
6886 "mirror://kernel.org/linux/libs/ieee1394/"
6887 name "-" version ".tar.xz"))
6888 (sha256
6889 (base32
6890 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
6891 (build-system gnu-build-system)
6892 (native-inputs
6893 (list pkg-config))
6894 (propagated-inputs
6895 (list libraw1394)) ; required by libiec61883.pc
6896 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
6897 (synopsis "Isochronous streaming media library for IEEE 1394")
6898 (description
6899 "The libiec61883 library provides a higher level API for streaming DV,
6900MPEG-2 and audio over Linux IEEE 1394.")
6901 (license license:lgpl2.1+)))
6902
6903(define-public mdadm
6904 (package
6905 (name "mdadm")
6906 (version "4.2")
6907 (source (origin
6908 (method url-fetch)
6909 (uri (string-append
6910 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
6911 version ".tar.xz"))
6912 (sha256
6913 (base32
6914 "07ghmibmbnkdy91ng87zdllzicm299l20dhs9m5bfjw6f1b22726"))))
6915 (build-system gnu-build-system)
6916 (arguments
6917 (list #:make-flags
6918 #~(list (string-append "CC=" #$(cc-for-target))
6919 "INSTALL=install"
6920 "CHECK_RUN_DIR=0"
6921 ;; TODO: tell it where to find 'sendmail'
6922 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
6923 (string-append "BINDIR=" #$output "/sbin")
6924 (string-append "MANDIR=" #$output "/share/man")
6925 (string-append "UDEVDIR=" #$output "/lib/udev"))
6926 #:phases
6927 #~(modify-phases %standard-phases
6928 (add-before 'build 'patch-program-paths
6929 (lambda* (#:key native-inputs inputs #:allow-other-keys)
6930 (let ((coreutils (assoc-ref (or native-inputs inputs)
6931 "coreutils")))
6932 (substitute* "udev-md-raid-arrays.rules"
6933 (("/usr/bin/(readlink|basename)" all program)
6934 (string-append coreutils "/bin/" program))))))
6935 (add-before 'build 'remove-W-error
6936 (lambda _
6937 ;; We cannot build with -Werror on i686 due to a
6938 ;; 'sign-compare' warning in util.c.
6939 (substitute* "Makefile"
6940 (("-Werror") ""))))
6941 (delete 'configure))
6942 ;; Tests must be run as root.
6943 #:tests? #f))
6944 (inputs
6945 (list eudev))
6946 (supported-systems (remove target-hurd? %supported-systems))
6947 (home-page "http://neil.brown.name/blog/mdadm")
6948 (synopsis "Tool for managing Linux Software RAID arrays")
6949 (description
6950 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
6951assemble, report on, and monitor arrays. It can also move spares between raid
6952arrays when needed.")
6953 (license license:gpl2+)))
6954
6955(define-public mdadm-static
6956 (package
6957 (inherit mdadm)
6958 (name "mdadm-static")
6959 (arguments
6960 (substitute-keyword-arguments (package-arguments mdadm)
6961 ((#:make-flags flags)
6962 #~(cons* "LDFLAGS = -static"
6963 "CXFLAGS = -DNO_LIBUDEV"
6964 #$flags))
6965 ((#:phases phases)
6966 #~(modify-phases #$phases
6967 (add-after 'install 'remove-cruft
6968 (lambda* (#:key outputs #:allow-other-keys)
6969 (let* ((out (assoc-ref outputs "out"))
6970 (precious? (lambda (file)
6971 (member file '("." ".." "sbin"))))
6972 (directories (scandir out (negate precious?))))
6973 (with-directory-excursion out
6974 (for-each delete-file-recursively directories)
6975 (remove-store-references "sbin/mdadm")
6976 (delete-file "sbin/mdmon")))))))
6977 ((#:modules modules %default-gnu-modules)
6978 `((ice-9 ftw) ,@modules))
6979 ((#:strip-flags _ '())
6980 ''("--strip-all")) ;strip a few extra KiB
6981 ((#:allowed-references _ '("out"))
6982 '("out")))) ;refer only self
6983 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
6984
6985(define-public multipath-tools
6986 (package
6987 (name "multipath-tools")
6988 (version "0.11.0")
6989 (home-page "https://github.com/opensvc/multipath-tools")
6990 (source (origin
6991 (method git-fetch)
6992 (uri (git-reference (url home-page) (commit version)))
6993 (file-name (git-file-name name version))
6994 (sha256
6995 (base32
6996 "1yl2cd4xgw2l5xzx5dbdf7awhrvfbjsrspli9i6bmxc5j4jkvazr"))
6997 (modules '((guix build utils)))
6998 (snippet
6999 '(begin
7000 ;; Drop bundled valgrind headers.
7001 (delete-file-recursively "third-party")
7002 (substitute* '("multipathd/main.c"
7003 "libmpathutil/debug.c")
7004 (("#include \"../third-party/")
7005 "#include \""))))))
7006 (build-system gnu-build-system)
7007 (arguments
7008 (list
7009 #:test-target "test"
7010 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
7011 (string-append "prefix=" #$output)
7012 ;; Install Udev rules below this directory, relative
7013 ;; to the prefix.
7014 (string-append "systemd_prefix=" #$output))
7015 #:phases
7016 #~(modify-phases %standard-phases
7017 (add-after 'unpack 'patch-source
7018 (lambda* (#:key inputs #:allow-other-keys)
7019 (let ((libdevmapper.h
7020 (search-input-file inputs "include/libdevmapper.h"))
7021 (libudev.h
7022 (search-input-file inputs "include/libudev.h")))
7023 (substitute* "Makefile.inc"
7024 (("/bin/echo") "echo")
7025 (("\\$\\(prefix\\)/usr") "$(prefix)")
7026 (("configdir.*:= \\$\\(prefix\\)/etc/multipath/conf.d")
7027 "configdir := /etc/multipath/conf.d")
7028 ;; Do not save timestamp to avoid gzip "timestamp
7029 ;; out-of-range" warnings.
7030 (("gzip -9") "gzip -9n"))
7031 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
7032 (("/usr/include/libdevmapper.h") libdevmapper.h)
7033 (("/usr/include/libudev.h") libudev.h)))))
7034 (add-after 'unpack 'skip-failing-tests
7035 (lambda _
7036 ;; This test and the module's setup() test an arbitrary block
7037 ;; device node name, but the build environment has none.
7038 (substitute* "tests/devt.c"
7039 (("return get_one_devt.*") "return 0;\n")
7040 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
7041 ;; The above triggers -Werror=unused-function. Ignore it.
7042 (substitute* "tests/Makefile"
7043 (("CFLAGS \\+= " match)
7044 (string-append match "-Wno-error=unused-function ")))))
7045 (delete 'configure) ;no configure script
7046 (add-before 'build 'no-fortify-3
7047 (lambda _
7048 ;; NOTE: The check made seems to wrongly assume the
7049 ;; FORTIFY_SOURCE=3 is valid. However, when compiling, warnings
7050 ;; are emitted from glibc, resulting in failed build. Fix this
7051 ;; by forcing the usage of FORTIFY_SOURCE=2.
7052 (substitute* "create-config.mk"
7053 (("FORTIFY_SOURCE=3")
7054 "FORTIFY_SOURCE=2"))))
7055 (add-before 'build 'set-LDFLAGS
7056 (lambda _
7057 ;; Note: this cannot be passed as a make flag because that will
7058 ;; override the build system LDFLAGS.
7059 (setenv "LDFLAGS"
7060 (string-append "-Wl,-rpath=" #$output "/lib")))))))
7061
7062 (native-inputs
7063 (list perl pkg-config valgrind/pinned
7064 ;; For tests.
7065 cmocka))
7066 (inputs
7067 (list json-c
7068 libaio
7069 liburcu
7070 lvm2
7071 readline
7072 eudev
7073 ;; For libmount.
7074 `(,util-linux "lib")))
7075 (synopsis "Access block devices through multiple paths")
7076 (description
7077 "This package provides the following binaries to drive the
7078Linux Device Mapper multipathing driver:
7079@enumerate
7080@item @command{multipath} - Device mapper target autoconfig.
7081@item @command{multipathd} - Multipath daemon.
7082@item @command{mpathpersist} - Manages SCSI persistent reservations on
7083@code{dm} multipath devices.
7084@item @command{kpartx} - Create device maps from partition tables.
7085@end enumerate")
7086 (license (list license:gpl2+ ;main distribution
7087 license:lgpl2.0+)))) ;libmpathcmd/mpath_cmd.h
7088
7089(define-public libaio
7090 (package
7091 (name "libaio")
7092 (version "0.3.113")
7093 (source (origin
7094 (method url-fetch)
7095 (uri (list
7096 (string-append "https://releases.pagure.org/libaio/"
7097 name "-" version ".tar.gz")))
7098 (sha256
7099 (base32
7100 "02r0g2vfv6kfljplm3ga93w4xw13q2wixbn9hwi7ahqdzp2x2i1c"))
7101 (patches (search-patches "libaio-32bit-test.patch"))))
7102 (build-system gnu-build-system)
7103 (arguments
7104 (list #:make-flags
7105 #~(list (string-append "prefix=" #$output)
7106 (string-append "CC=" #$(cc-for-target)))
7107 #:test-target "partcheck" ; need root for a full 'check'
7108 #:phases
7109 #~(modify-phases %standard-phases
7110 (add-after 'unpack 'disable-problematic-tests
7111 (lambda _
7112 (with-directory-excursion "harness/cases"
7113 ;; The 21.t test fails with "Expected 4096, got
7114 ;; 18446744073709551605" (see:
7115 ;; https://pagure.io/libaio/issue/26).
7116 (rename-file "21.t" "21.t.disabled"))))
7117 (delete 'configure) ; no configure script
7118 #$@(if (target-riscv64?)
7119 #~((add-after 'unpack 'patch-test
7120 (lambda* (#:key build-inputs #:allow-other-keys)
7121 (invoke "patch" "-p1" "-i"
7122 #$(local-file
7123 (search-patch
7124 "libaio-riscv-test5.patch"))))))
7125 #~()))))
7126 (native-inputs
7127 (if (target-riscv64?)
7128 (list (search-patch "libaio-riscv-test5.patch")
7129 patch)
7130 '()))
7131 (home-page "https://pagure.io/libaio")
7132 (synopsis "Linux-native asynchronous I/O access library")
7133 (description
7134 "This library enables userspace to use Linux kernel asynchronous I/O
7135system calls, important for the performance of databases and other advanced
7136applications.")
7137 (license license:lgpl2.1+)))
7138
7139(define-public blktrace
7140 ;; Take a newer commit to get the latest patches.
7141 (let ((commit "b9ea6e507e8849f01d06aa48c0c59c5cee4820be")
7142 (revision "1"))
7143 (package
7144 (name "blktrace")
7145 (version (git-version "1.3.0" revision commit))
7146 (home-page
7147 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
7148 (source (origin
7149 (method git-fetch)
7150 (uri (git-reference
7151 (url home-page)
7152 (commit commit)))
7153 (sha256
7154 (base32 "0a4830mlqckbhchar1xcn2w4f24bzb75bigdig5wpm2axl0zc8cq"))
7155 (file-name (git-file-name name version))))
7156 (build-system gnu-build-system)
7157 (arguments
7158 (list #:make-flags
7159 #~(list (string-append "CC=" #$(cc-for-target))
7160 (string-append "prefix=" #$output))
7161 #:tests? #f ; no tests
7162 #:phases
7163 #~(modify-phases %standard-phases
7164 (delete 'configure) ; no configure script
7165 (add-after 'unpack 'fix-gnuplot-path
7166 (lambda* (#:key inputs #:allow-other-keys)
7167 (let ((gnuplot (assoc-ref inputs "gnuplot")))
7168 (substitute* "btt/bno_plot.py"
7169 (("gnuplot %s")
7170 (string-append gnuplot "/bin/gnuplot %s")))))))))
7171 (inputs
7172 `(("libaio" ,libaio)
7173 ("gnuplot" ,gnuplot)
7174 ("python" ,python-wrapper))) ;for 'bno_plot.py'
7175 (synopsis "Block layer IO tracing mechanism")
7176 (description "Blktrace is a block layer IO tracing mechanism which provides
7177detailed information about request queue operations to user space. It extracts
7178event traces from the kernel (via the relaying through the debug file system).")
7179 (license license:gpl2))))
7180
7181(define-public sbc
7182 (package
7183 (name "sbc")
7184 (version "1.5")
7185 (source (origin
7186 (method url-fetch)
7187 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
7188 version ".tar.xz"))
7189 (patches (search-patches "sbc-fix-build-non-x86.patch"))
7190 (sha256
7191 (base32
7192 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
7193 (build-system gnu-build-system)
7194 (inputs
7195 (list libsndfile))
7196 (native-inputs
7197 (list pkg-config))
7198 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
7199 (synopsis "Bluetooth subband audio codec")
7200 (description
7201 "The SBC is a digital audio encoder and decoder used to transfer data to
7202Bluetooth audio output devices like headphones or loudspeakers.")
7203 (license license:gpl2+)))
7204
7205(define-public bluez
7206 (package
7207 (name "bluez")
7208 (version "5.79")
7209 (source (origin
7210 (method url-fetch)
7211 (uri (string-append
7212 "mirror://kernel.org/linux/bluetooth/bluez-"
7213 version ".tar.xz"))
7214 (sha256
7215 (base32
7216 "12pal1m4xlr8k7kxb6isv5lbaca2wc5zcgy0907wfwcz78qaar21"))))
7217 (build-system gnu-build-system)
7218 (arguments
7219 (list
7220 #:configure-flags
7221 #~(list "--sysconfdir=/etc"
7222 "--localstatedir=/var"
7223 "--enable-library"
7224 "--enable-wiimote"
7225 "--disable-systemd"
7226 ;; TODO: is this needed? Not installed by default since 5.55.
7227 "--enable-hid2hci"
7228 ;; Install dbus/udev files to the correct location.
7229 (string-append "--with-dbusconfdir=" #$output "/etc")
7230 (string-append "--with-udevdir=" #$output "/lib/udev"))
7231 #:phases
7232 #~(modify-phases %standard-phases
7233 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
7234 ;; issue (discussion on upstream mailing list:
7235 ;; https://marc.info/?t=149578476300002&r=1&w=2)
7236 (add-before 'check 'skip-wonky-test
7237 (lambda _
7238 (substitute* "unit/test-gatt.c"
7239 (("tester_init\\(&argc, &argv\\);") "return 77;"))))
7240 (replace 'install
7241 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
7242 ;; Override the sysconfdir and localstatedir locations only for
7243 ;; the installation phase. Otherwise, the installation fails when
7244 ;; it tries to write to /etc/bluetooth and /var.
7245 (define make-flags*
7246 (append make-flags (list (string-append "sysconfdir="
7247 #$output "/etc")
7248 (string-append "localstatedir="
7249 #$output "/var"))))
7250 (apply (assoc-ref %standard-phases 'install)
7251 (append args (list #:make-flags make-flags*)))))
7252 (add-after 'install 'post-install
7253 (lambda* (#:key inputs outputs #:allow-other-keys)
7254 (let* ((servicedir (string-append #$output
7255 "/share/dbus-1/services"))
7256 (service "obexd/src/org.bluez.obex.service")
7257 (rule (string-append
7258 #$output "/lib/udev/rules.d/97-hid2hci.rules")))
7259 ;; Install the obex dbus service file.
7260 (substitute* service
7261 (("/bin/false")
7262 (string-append #$output "/libexec/bluetooth/obexd")))
7263 (install-file service servicedir)
7264 ;; Fix paths in the udev rule.
7265 (substitute* rule
7266 (("hid2hci --method")
7267 (string-append #$output "/lib/udev/hid2hci --method"))
7268 (("/sbin/udevadm")
7269 (search-input-file inputs "/bin/udevadm")))))))))
7270 (native-inputs
7271 (list gettext-minimal
7272 pkg-config
7273 python
7274 python-docutils
7275 python-pygments))
7276 (inputs
7277 (list glib dbus eudev libical readline))
7278 (home-page "https://www.bluez.org/")
7279 (synopsis "Linux Bluetooth protocol stack")
7280 (description
7281 "BlueZ provides support for the core Bluetooth layers and protocols. It
7282is flexible, efficient and uses a modular implementation.")
7283 (license license:gpl2+)))
7284
7285(define-public fuse-exfat
7286 (package
7287 (name "fuse-exfat")
7288 (version "1.4.0")
7289 (source (origin
7290 (method url-fetch)
7291 (uri (string-append
7292 "https://github.com/relan/exfat/releases/download/v"
7293 version "/" name "-" version ".tar.gz"))
7294 (sha256
7295 (base32
7296 "07h0ngnydfy8n8h9ni3jn8zlmcj4pzqa0nk0hk0i4yhfbv2yvkx1"))))
7297 (build-system gnu-build-system)
7298 (native-inputs
7299 (list pkg-config))
7300 (inputs
7301 (list fuse-2))
7302 (home-page "https://github.com/relan/exfat")
7303 (synopsis "Mount exFAT file systems")
7304 (description
7305 "This package provides a FUSE-based file system that provides read and
7306write access to exFAT devices.")
7307 (license license:gpl2+)))
7308
7309(define-public fuseiso
7310 (package
7311 (name "fuseiso")
7312 (version "20070708")
7313 (source (origin
7314 (method url-fetch)
7315 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
7316 version "/fuseiso-" version ".tar.bz2"))
7317 (sha256
7318 (base32
7319 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
7320 (build-system gnu-build-system)
7321 (native-inputs
7322 (list pkg-config))
7323 (inputs
7324 (list fuse-2 glib zlib))
7325 (home-page "https://sourceforge.net/projects/fuseiso/")
7326 (synopsis "Mount ISO file system images")
7327 (description
7328 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
7329.bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
7330Ridge, Joliet, and zisofs.")
7331 (license license:gpl2)))
7332
7333(define-public gpm
7334 (package
7335 (name "gpm")
7336 (version "1.20.7")
7337 (source (origin
7338 (method url-fetch)
7339 (uri (string-append
7340 "https://www.nico.schottelius.org/software/gpm/archives/"
7341 "gpm-" version ".tar.bz2"))
7342 (patches (search-patches "gpm-glibc-2.26.patch"))
7343 (sha256
7344 (base32
7345 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
7346 (modules '((guix build utils)))
7347 (snippet
7348 '(begin
7349 ;; Take a patch from upstream to fix building with -fno-common,
7350 ;; which is default in GCC 10:
7351 ;; https://github.com/telmich/gpm/pull/37
7352 (substitute* "src/headers/daemon.h"
7353 (("^time_t[[:blank:]]+last_selection_time;")
7354 "extern time_t last_selection_time;"))))))
7355 (build-system gnu-build-system)
7356 (arguments
7357 '(#:phases (modify-phases %standard-phases
7358 (replace 'bootstrap
7359 (lambda _
7360 ;; The tarball was not generated with 'make dist' so we
7361 ;; need to bootstrap things ourselves.
7362 (substitute* "autogen.sh"
7363 (("/bin/sh") (which "sh")))
7364 (invoke "./autogen.sh")
7365 (patch-makefile-SHELL "Makefile.include.in")
7366 #t)))
7367
7368 ;; Make sure programs find libgpm.so.
7369 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
7370 (assoc-ref %outputs "out")
7371 "/lib"))))
7372 (native-inputs
7373 (list texinfo
7374 bison
7375 flex
7376 autoconf
7377 automake
7378 libtool))
7379 (home-page "https://www.nico.schottelius.org/software/gpm/")
7380 (synopsis "Mouse support for the Linux console")
7381 (description
7382 "The GPM (general-purpose mouse) daemon is a mouse server for
7383applications running on the Linux console. It allows users to select items
7384and copy/paste text in the console and in xterm.")
7385 (license license:gpl2+)))
7386
7387(define-public btrfs-progs
7388 (package
7389 (name "btrfs-progs")
7390 (version "6.16")
7391 (source (origin
7392 (method url-fetch)
7393 (uri (string-append "mirror://kernel.org/linux/kernel/"
7394 "people/kdave/btrfs-progs/" "btrfs-progs-v"
7395 version ".tar.xz"))
7396 (sha256
7397 (base32
7398 "1ibg8qrsxzw4qjnsl5da1qz10m1zv3yx2jxd4jl1h9kwfgw31a9i"))))
7399 (build-system gnu-build-system)
7400 (outputs '("out" "static")) ;static versions of the binaries in "out"
7401 (arguments
7402 (list
7403 #:configure-flags
7404 #~(list
7405 ;; Without --disable-documentation, it complains about missing
7406 ;; python-sphinx on systems where this package isn't available
7407 ;; (because it requires Rust).
7408 #$@(if (member (%current-system)
7409 (package-transitive-supported-systems
7410 python-sphinx))
7411 '()
7412 '("--disable-documentation"))
7413 ;; The ‘Python support’ was never actually installed by previous
7414 ;; versions of this package, but did prevent cross-compilation.
7415 "--disable-python")
7416 #:phases #~(modify-phases %standard-phases
7417 (add-after 'unpack 'patch-makefile
7418 (lambda* (#:key outputs #:allow-other-keys)
7419 (substitute* "Makefile"
7420 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
7421 (string-append (assoc-ref outputs "out")
7422 "/lib/udev/rules.d")))))
7423 (add-after 'build 'build-static
7424 (lambda _
7425 (invoke "make" "static")))
7426 (add-after 'install 'install-bash-completion
7427 (lambda* (#:key outputs #:allow-other-keys)
7428 (let* ((out (assoc-ref outputs "out"))
7429 (bashcomp (string-append out
7430 "/etc/bash_completion.d")))
7431 (mkdir-p bashcomp)
7432 (copy-file "btrfs-completion"
7433 (string-append bashcomp "/btrfs")))))
7434 (add-after 'install 'install-static
7435 (let ((staticbin (string-append (assoc-ref %outputs
7436 "static")
7437 "/bin")))
7438 (lambda _
7439 (invoke "make"
7440 (string-append "bindir=" staticbin)
7441 "install-static")))))
7442 #:tests? #f ;XXX: require the 'btrfs' kernel module.
7443 #:test-target "test"
7444 #:parallel-tests? #f)) ;tests fail when run in parallel
7445 (inputs (list e2fsprogs ;for btrfs-convert
7446 eudev
7447 lzo
7448 `(,util-linux "lib") ;for libblkid and libuuid
7449 `(,util-linux "static") ;ditto
7450 zlib
7451 `(,zlib "static")
7452 `(,zstd "lib")
7453 `(,zstd "static")))
7454 (native-inputs
7455 (append
7456 ;; For building documentation. Since python-sphinx requires Rust, add
7457 ;; it conditionally depending on such support.
7458 (if (supported-package? python-sphinx)
7459 (list python-wrapper python-sphinx python-sphinx-rtd-theme)
7460 '())
7461 (list pkg-config
7462 acl ;for tests
7463 lvm2 ;for dmsetup
7464 grep ;need Perl regexp support
7465 libaio
7466 liburing
7467 util-linux ;for fallocate
7468 which)))
7469 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
7470 (synopsis "Create and manage btrfs copy-on-write file systems")
7471 (description
7472 "Btrfs is a @acronym{CoW, copy-on-write} file system for Linux
7473aimed at implementing advanced features while focusing on fault tolerance,
7474repair and easy administration.")
7475 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
7476 ;; GPL2: Everything else.
7477 (license (list license:gpl2 license:gpl2+))))
7478
7479(define-public btrfs-progs/static
7480 (package
7481 (name "btrfs-progs-static")
7482 (version (package-version btrfs-progs))
7483 (source #f)
7484 (build-system trivial-build-system)
7485 (inputs
7486 `(("btrfs-progs:static" ,btrfs-progs "static")))
7487 (arguments
7488 `(#:modules ((guix build utils))
7489 #:builder
7490 (begin
7491 (use-modules (guix build utils)
7492 (ice-9 ftw)
7493 (srfi srfi-26))
7494
7495 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
7496 (out (assoc-ref %outputs "out"))
7497 (source (string-append btrfs "/bin/btrfs.static"))
7498 (target (string-append out "/bin/btrfs")))
7499 (mkdir-p (dirname target))
7500 (copy-file source target)
7501 (remove-store-references target)
7502 (chmod target #o555)
7503 #t))))
7504 (home-page (package-home-page btrfs-progs))
7505 (synopsis "Statically-linked btrfs command from btrfs-progs")
7506 (description "This package provides the statically-linked @command{btrfs}
7507from the btrfs-progs package. It is meant to be used in initrds.")
7508 (license (package-license btrfs-progs))))
7509
7510(define-public cramfs-tools
7511 (package
7512 (name "cramfs-tools")
7513 (home-page "https://github.com/npitre/cramfs-tools")
7514 (version "2.1")
7515 (source (origin
7516 (method git-fetch)
7517 (uri (git-reference
7518 (url home-page)
7519 (commit (string-append "v" version))))
7520 (sha256
7521 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
7522 (file-name (git-file-name name version))))
7523 (build-system gnu-build-system)
7524 (arguments
7525 '(#:tests? #f ; No tests.
7526 #:phases
7527 (modify-phases %standard-phases
7528 (delete 'configure)
7529 (replace 'install
7530 (lambda* (#:key outputs #:allow-other-keys)
7531 (let ((out (assoc-ref outputs "out")))
7532 (install-file "mkcramfs" (string-append out "/sbin"))
7533 (install-file "cramfsck" (string-append out "/sbin")))
7534 #t)))))
7535 (inputs
7536 (list zlib))
7537 (synopsis "Tools to manage Cramfs file systems")
7538 (description "Cramfs is a Linux file system designed to be simple, small,
7539and to compress things well. It is used on a number of embedded systems and
7540small devices. This version has additional features such as uncompressed
7541blocks and random block placement.")
7542 (license license:gpl2+)))
7543
7544(define-public compsize
7545 (let ((commit "d79eacf77abe3b799387bb8a4e07a18f1f1031e8")
7546 (revision "0"))
7547 (package
7548 (name "compsize")
7549 (version (git-version "1.5" revision commit))
7550 (home-page "https://github.com/kilobyte/compsize")
7551 (source (origin
7552 (method git-fetch)
7553 (uri (git-reference
7554 (url home-page)
7555 (commit commit)))
7556 (sha256
7557 (base32 "02fvgy12m50rg1snp555a1kc3cm01g2imb81cih7ikhkbjbca0d7"))
7558 (file-name (git-file-name name version))
7559 (patches
7560 (search-patches "compsize-fix-btrfs-progs-compatibility.patch"))))
7561 (build-system gnu-build-system)
7562 (inputs
7563 (list btrfs-progs))
7564 (arguments
7565 `(#:tests? #f ; No tests.
7566 #:make-flags
7567 (list (string-append "CC=" ,(cc-for-target)))
7568 #:phases
7569 (modify-phases %standard-phases
7570 (delete 'configure)
7571 (replace 'install
7572 (lambda* (#:key outputs #:allow-other-keys)
7573 (let ((out (assoc-ref outputs "out")))
7574 (install-file "compsize" (string-append out "/bin"))
7575 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
7576 (synopsis "Find compression type/ratio on Btrfs files")
7577 (description "@command{compsize} takes a list of files (given as
7578arguments) on a Btrfs file system and measures used compression types and
7579effective compression ratio, producing a report.
7580
7581A directory has no extents but has a (recursive) list of files. A non-regular
7582file is silently ignored.
7583
7584As it makes no sense to talk about compression ratio of a partial extent,
7585every referenced extent is counted whole, exactly once -- no matter if you use
7586only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
7587uncompressed size will not match the number given by @command{tar} or
7588@command{du}. On the other hand, the space used should be accurate (although
7589obviously it can be shared with files outside our set).")
7590 (license license:gpl2+))))
7591
7592(define-public f2fs-tools
7593 (package
7594 (name "f2fs-tools")
7595 (version "1.16.0")
7596 (source (origin
7597 (method git-fetch)
7598 (uri (git-reference
7599 (url "https://git.kernel.org/pub/scm/linux/kernel\
7600/git/jaegeuk/f2fs-tools.git")
7601 (commit (string-append "v" version))))
7602 (file-name (git-file-name name version))
7603 (sha256
7604 (base32
7605 "0832ix3jnmfagx53wr6clc3q4ay7cbashfj7jirk01gyzwbvblfc"))))
7606 (build-system gnu-build-system)
7607 (native-inputs
7608 (list autoconf automake libtool pkg-config))
7609 (inputs
7610 (list `(,util-linux "lib"))) ;for libuuid
7611 (home-page "https://f2fs.wiki.kernel.org/")
7612 (synopsis "Userland tools for f2fs")
7613 (description
7614 "F2FS, the Flash-Friendly File System, is a modern file system
7615designed to be fast and durable on flash devices such as solid-state
7616disks and SD cards. This package provides the userland utilities.")
7617 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
7618 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
7619 (license (list license:gpl2 license:lgpl2.1))))
7620
7621(define-public f2fs-tools-1.7
7622 (package
7623 (inherit f2fs-tools)
7624 (name "f2fs-tools")
7625 (version "1.7.0")
7626 (source (origin
7627 (method git-fetch)
7628 (uri (git-reference
7629 (url (git-reference-url
7630 (origin-uri (package-source f2fs-tools))))
7631 (commit (string-append "v" version))))
7632 (file-name (git-file-name name version))
7633 (sha256
7634 (base32
7635 "0wpzklw8smnngng0dm25jdmi7v5zfhpz02dksyxpz0a7kzzvnqqm"))))
7636 (inputs
7637 (list `(,util-linux "lib") libselinux))
7638 (arguments
7639 '(#:configure-flags '("CFLAGS=-fcommon")
7640 #:phases
7641 (modify-phases %standard-phases
7642 (add-after 'install 'install-headers
7643 (lambda* (#:key outputs #:allow-other-keys)
7644 (let* ((out (assoc-ref outputs "out"))
7645 (out-include (string-append out "/include")))
7646 (install-file "include/f2fs_fs.h" out-include)
7647 (install-file "mkfs/f2fs_format_utils.h" out-include)))))))))
7648
7649(define-public f2fs-tools/static
7650 (static-package
7651 (package
7652 (inherit f2fs-tools)
7653 (name "f2fs-tools-static")
7654 (arguments
7655 `(#:configure-flags
7656 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
7657 (libuuid (assoc-ref %build-inputs "libuuid")))
7658 (list
7659 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
7660 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
7661 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
7662 "-I" libuuid "/include/blkid")
7663 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
7664 #:disallowed-references (,(this-package-input "libuuid"))
7665 #:make-flags '("LDFLAGS=-all-static")
7666 #:phases
7667 (modify-phases %standard-phases ; TODO: f2fs phases.
7668 (add-after 'install 'remove-store-references
7669 (lambda* (#:key outputs #:allow-other-keys)
7670 ;; Work around bug in our util-linux.
7671 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
7672 (remove-store-references (string-append (assoc-ref outputs "out")
7673 "/sbin/mkfs.f2fs"))
7674 #t)))))
7675 (inputs
7676 `(("libuuid:static" ,util-linux "static")
7677 ("libuuid" ,util-linux "lib")))))) ; for include files
7678
7679(define-public f2fs-fsck/static
7680 (package
7681 (name "f2fs-fsck-static")
7682 (version (package-version f2fs-tools/static))
7683 (source #f)
7684 (build-system trivial-build-system)
7685 (arguments
7686 `(#:modules ((guix build utils))
7687 #:builder
7688 (begin
7689 (use-modules (guix build utils)
7690 (ice-9 ftw)
7691 (srfi srfi-26))
7692 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
7693 (fsck "fsck.f2fs")
7694 (out (assoc-ref %outputs "out"))
7695 (sbin (string-append out "/sbin")))
7696 (mkdir-p sbin)
7697 (with-directory-excursion sbin
7698 (install-file (string-append f2fs-tools "/sbin/" fsck)
7699 ".")
7700 (remove-store-references fsck)
7701 (chmod fsck #o555))
7702 #t))))
7703 (inputs
7704 (list f2fs-tools/static))
7705 (home-page (package-home-page f2fs-tools/static))
7706 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
7707 (description "This package provides statically-linked fsck.f2fs command taken
7708from the f2fs-tools package. It is meant to be used in initrds.")
7709 (license (package-license f2fs-tools/static))))
7710
7711(define-public freefall
7712 (package
7713 (name "freefall")
7714 (version (package-version linux-libre))
7715 (source (package-source linux-libre))
7716 (build-system gnu-build-system)
7717 (arguments
7718 '(#:phases (modify-phases %standard-phases
7719 (add-after 'unpack 'enter-subdirectory
7720 (lambda _
7721 (chdir "tools/laptop/freefall")
7722 #t))
7723 (delete 'configure)
7724 (add-before 'build 'increase-timeout
7725 (lambda _
7726 ;; The default of 2 seconds is too low: it assumes an
7727 ;; open lid and AC power without actually checking.
7728 (substitute* "freefall.c"
7729 (("alarm\\(2\\)") "alarm(5)"))
7730 #t)))
7731 #:make-flags (list (string-append "PREFIX="
7732 (assoc-ref %outputs "out"))
7733 "CC=gcc")
7734 #:tests? #f)) ;no tests
7735 (home-page (package-home-page linux-libre))
7736 (synopsis "Free-fall protection for spinning laptop hard drives")
7737 (description
7738 "Prevents shock damage to the internal spinning hard drive(s) of some
7739HP and Dell laptops. When sudden movement is detected, all input/output
7740operations on the drive are suspended and its heads are parked on the ramp,
7741where they are less likely to cause damage to the spinning disc. Requires a
7742drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
7743feature, and a laptop with an accelerometer. It has no effect on SSDs.")
7744 (license license:gpl2)))
7745
7746
7747(define-public nbfc-linux
7748 (let ((version "0.1.7")
7749 (commit "4c2b75e4a875459e86a9892319889ff945e9cadf")
7750 (revision "0"))
7751 (package
7752 (name "nbfc-linux")
7753 (version (git-version version revision commit))
7754 (source (origin
7755 (method git-fetch)
7756 (uri (git-reference
7757 (url "https://github.com/nbfc-linux/nbfc-linux")
7758 (commit commit)))
7759 (file-name (git-file-name name version))
7760 (sha256
7761 (base32
7762 "0mmyfaigrh3fd5v11a8p38km4m02qzsfx8yh72g0z405bzhqn5jk"))))
7763 (build-system gnu-build-system)
7764 (arguments
7765 `(#:make-flags (list (string-append "CC="
7766 ,(cc-for-target))
7767 (string-append "PREFIX="
7768 (assoc-ref %outputs "out")))
7769 #:tests? #f
7770 #:phases (modify-phases %standard-phases
7771 (delete 'configure))))
7772 (native-inputs (list pkg-config))
7773 (propagated-inputs (list python dmidecode))
7774 (synopsis "NoteBook FanControl ported to Linux")
7775 (description
7776 "This package provides a C port of NoteBook FanControl (NBFC), a fan
7777control service for notebooks. It provides the same utilities with the same
7778interfaces as the original NBFC, although the implementation differs.")
7779 (home-page "https://github.com/nbfc-linux/nbfc-linux")
7780 (license license:gpl3+))))
7781
7782(define-public thinkfan
7783 (package
7784 (name "thinkfan")
7785 (version "2.0.0")
7786 (source
7787 (origin
7788 (method git-fetch)
7789 (uri (git-reference
7790 (url "https://github.com/vmatare/thinkfan")
7791 (commit version)))
7792 (file-name (git-file-name name version))
7793 (sha256
7794 (base32 "1jdjqdbv0m7yf9g4rxs7nq1ldh2b81a7qx4vcf9lzw7jwlydd822"))))
7795 (build-system cmake-build-system)
7796 (arguments
7797 (list
7798 #:modules '((guix build cmake-build-system)
7799 (guix build utils)
7800 (srfi srfi-26))
7801 #:tests? #f ; no test target
7802 #:configure-flags
7803 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
7804 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
7805 ;; inefficient’.
7806 #~(list "-DUSE_ATASMART:BOOL=ON")
7807 #:phases
7808 #~(modify-phases %standard-phases
7809 (add-after 'unpack 'create-init-scripts
7810 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
7811 ;; systemd to patch and install their service files. Fake their
7812 ;; presence rather than duplicating the build system below. Leave
7813 ;; things like ‘/bin/kill’ because they're not worth a dependency.
7814 ;; The sysvinit needs manual patching, but since upstream doesn't
7815 ;; even provide the option to install it: don't.
7816 (lambda _
7817 (substitute* "CMakeLists.txt"
7818 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
7819 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
7820 ;; That was easy! Now we just need to fix the destinations.
7821 (("/etc" directory)
7822 (string-append #$output directory))))))))
7823 (native-inputs
7824 (list pkg-config))
7825 (inputs
7826 `(("libatasmart" ,libatasmart)
7827 ("lm-sensors" ,lm-sensors "lib")
7828 ("yaml-cpp" ,yaml-cpp)))
7829 (home-page "https://github.com/vmatare/thinkfan")
7830 (synopsis "Simple fan control program")
7831 (description
7832 "Thinkfan is a simple fan control program. It reads temperatures,
7833checks them against configured limits and switches to appropriate (also
7834pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
7835other @code{hwmon} driver that enables temperature reading and fan control
7836from userspace.")
7837 (license license:gpl3+)))
7838
7839(define-public tpacpi-bat
7840 (package
7841 (name "tpacpi-bat")
7842 (version "3.2")
7843 (source
7844 (origin
7845 (method git-fetch)
7846 (uri (git-reference
7847 (url "https://github.com/teleshoes/tpacpi-bat")
7848 (commit (string-append "v" version))))
7849 (file-name (git-file-name name version))
7850 (sha256
7851 (base32 "0nd8s2bqbhl0sjpflphb4l9ix71p7kvnbvkq4dg9a1v0sxafyygm"))))
7852 (build-system gnu-build-system)
7853 (arguments
7854 `(#:tests? #f ; no test target
7855 #:phases
7856 (modify-phases %standard-phases
7857 (add-after 'unpack 'refer-to-inputs
7858 (lambda* (#:key inputs #:allow-other-keys)
7859 (substitute* "tpacpi-bat"
7860 (("cat ")
7861 (string-append (search-input-file inputs "bin/cat") " "))
7862 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
7863 ;; loaded. That's the administrator's prerogative; disable it.
7864 (("system \"(modprobe .*)\"" _ match)
7865 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))))
7866 (delete 'configure) ; nothing to configure
7867 (delete 'build) ; nothing to build
7868 (replace 'install
7869 (lambda* (#:key outputs #:allow-other-keys)
7870 (let* ((out (assoc-ref outputs "out"))
7871 (bin (string-append out "/bin"))
7872 (doc (string-append out "/share/doc/" ,name "-" ,version)))
7873 (install-file "tpacpi-bat" bin)
7874
7875 ;; There's no man page. Install other forms of documentation.
7876 (for-each (lambda (file)
7877 (let ((target (string-append doc "/" file)))
7878 (mkdir-p (dirname target))
7879 (copy-recursively file target)))
7880 (list "battery_asl" "examples" "README.md"))))))))
7881 (inputs
7882 (list coreutils-minimal
7883 perl))
7884 (home-page "https://github.com/teleshoes/tpacpi-bat")
7885 (synopsis "ThinkPad battery charge controller")
7886 (description
7887 "Tpacpi-bat is a command-line interface to control battery charging on
7888@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
7889ThinkPad models released after 2011}, starting with the xx20 series. It can
7890query and set the thresholds at which one or both batteries will start and stop
7891charging, inhibit charging batteries for a set period of time, or force them to
7892discharge when they otherwise would not.
7893
7894This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
7895kernel module provided by the @code{acpi-call-linux-module} package, which must
7896be installed and loaded separately. Only the original vendor firmware is
7897supported.")
7898 (license license:gpl3+)))
7899
7900(define-public tmon
7901 (package
7902 (name "tmon")
7903 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
7904 (version (package-version linux-libre))
7905 (source (package-source linux-libre))
7906 (build-system gnu-build-system)
7907 (arguments
7908 (list
7909 #:tests? #f ; no test suite
7910 #:make-flags
7911 #~(list (string-append "CC=" #$(cc-for-target))
7912 (string-append "INSTALL_ROOT=" #$output)
7913 "BINDIR=bin")
7914 #:phases
7915 #~(modify-phases %standard-phases
7916 (add-after 'unpack 'enter-subdirectory
7917 (lambda _
7918 (chdir "tools/thermal/tmon")))
7919 (add-after 'install 'install-man-page
7920 (lambda _
7921 (let ((man8 (string-append #$output "/share/man/man8")))
7922 (install-file "tmon.8" man8))))
7923 (delete 'configure)))) ; no configure script
7924 (inputs
7925 (list ncurses))
7926 (home-page (package-home-page linux-libre))
7927 (synopsis "Monitor and test the Linux thermal subsystem in real time")
7928 (description
7929 "Tmon is a tool to interact with the complex thermal subsystem of the
7930kernel Linux. It helps visualize thermal relationships and real-time thermal
7931data, tune and test cooling devices and sensors, and collect thermal data for
7932further analysis.
7933
7934As computers become smaller and more thermally constrained, more sensors are
7935added and new cooling capabilities introduced. Thermal relationships can change
7936dynamically. Their complexity grows exponentially among cooling devices, zones,
7937sensors, and trip points.
7938
7939Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
7940of symbolic links, trip point bindings, and device instances. To traverse it
7941by hand is no trivial task: @command{tmon} aims to make it understandable.")
7942 (license (list license:gpl2 ; the man page
7943 license:gpl2+)))) ; the actual rest
7944
7945(define-public turbostat
7946 (package
7947 (name "turbostat")
7948 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
7949 ;; make it harder to benefit from ‘free’ linux-libre package updates.
7950 (version (package-version linux-libre))
7951 (source (package-source linux-libre))
7952 (build-system gnu-build-system)
7953 (arguments
7954 (list
7955 #:tests? #f ;no test suite
7956 #:make-flags
7957 #~(list (string-append "CC=" #$(cc-for-target))
7958 (string-append "PREFIX=" #$output))
7959 #:phases
7960 #~(modify-phases %standard-phases
7961 (add-after 'unpack 'enter-subdirectory
7962 (lambda _
7963 (chdir "tools/power/x86/turbostat")))
7964 (delete 'configure)))) ;no configure script
7965 (inputs
7966 (list libcap))
7967 (supported-systems '("i686-linux" "x86_64-linux"))
7968 (home-page (package-home-page linux-libre))
7969 (synopsis "Report x86 processor frequency and idle statistics")
7970 (description
7971 "Turbostat reports x86 processor topology, frequency, idle power state
7972statistics, temperature, and power consumption. Some information is unavailable
7973on older processors.
7974
7975It can be used to identify machines that are inefficient in terms of power usage
7976or idle time, report the rate of @acronym{SMI, system management interrupt}s
7977occurring on the system, or verify the effects of power management tuning.
7978
7979@command{turbostat} reads hardware counters but doesn't write to them, so it
7980won't interfere with the OS or other running processes---including multiple
7981invocations of itself.")
7982 (license license:gpl2)))
7983
7984(define-public ntfs-3g
7985 (package
7986 (name "ntfs-3g")
7987 (version "2022.10.3")
7988 (source (origin
7989 (method url-fetch)
7990 (uri (string-append "https://tuxera.com/opensource/"
7991 "ntfs-3g_ntfsprogs-" version ".tgz"))
7992 (sha256
7993 (base32
7994 "030pakw3h1z6p8phdbyb0hw0bb868znvrri96rg88jq7d3p3c3pj"))
7995 (modules '((guix build utils)))
7996 (snippet '(begin
7997 ;; Install under $prefix.
7998 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
7999 (("/sbin")
8000 "@sbindir@"))))))
8001 (build-system gnu-build-system)
8002 (inputs (list util-linux ; libuuid
8003 fuse-2))
8004 (native-inputs (list pkg-config))
8005 (arguments
8006 '(#:configure-flags (list "--disable-static"
8007 "--disable-ldconfig" ;not necessary
8008 "--exec-prefix=${prefix}"
8009 "--with-fuse=external" ;use our own FUSE
8010 "--enable-mount-helper"
8011 "--enable-posix-acls"
8012 "--enable-xattr-mappings")
8013 #:phases
8014 (modify-phases %standard-phases
8015 ;; If users install ntfs-3g, they probably want to make it the
8016 ;; default driver as well, so we opt for sensible defaults and link
8017 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
8018 ;; mount NTFS file systems.)
8019 (add-after 'install 'install-link
8020 (lambda* (#:key outputs #:allow-other-keys)
8021 (let* ((out (assoc-ref outputs "out"))
8022 (sbin (string-append out "/sbin")))
8023 (symlink "mount.ntfs-3g"
8024 (string-append sbin "/mount.ntfs"))))))))
8025 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
8026 (synopsis "Read-write access to NTFS file systems")
8027 (description
8028 "NTFS-3G provides read-write access to NTFS file systems, which are
8029commonly found on Microsoft Windows. It is implemented as a FUSE file system.
8030The package provides additional NTFS tools.")
8031 (properties
8032 '((release-monitoring-url . "https://github.com/tuxera/ntfs-3g/releases")
8033 (upstream-name . "ntfs-3g_ntfsprogs")))
8034 (license license:gpl2+)))
8035
8036(define-public ntfs-3g/static
8037 (static-package
8038 (package
8039 (inherit ntfs-3g)
8040 (name "ntfs-3g-static")
8041 (arguments
8042 (substitute-keyword-arguments (package-arguments ntfs-3g)
8043 ((#:configure-flags flags)
8044 `(append ,flags
8045 (list "--enable-really-static"
8046 ;; The FUSE driver isn't currently used by our initrd.
8047 "--disable-ntfs-3g")))
8048 ((#:phases phases)
8049 `(modify-phases ,phases
8050 (add-after 'unpack 'make-really-static-really-static
8051 (lambda _
8052 (substitute* "ntfsprogs/Makefile.in"
8053 ((" -static") " -all-static"))))
8054 (delete 'install-link))))))))
8055
8056(define-public ntfsfix/static
8057 (package
8058 (name "ntfsfix-static")
8059 (version (package-version ntfs-3g/static))
8060 (source #f)
8061 (build-system trivial-build-system)
8062 (arguments
8063 `(#:modules ((guix build utils))
8064 #:builder
8065 (begin
8066 (use-modules (guix build utils))
8067 (let* ((ntfs-3g (assoc-ref %build-inputs "ntfs-3g"))
8068 (out (assoc-ref %outputs "out"))
8069 (bin (string-append out "/bin")))
8070 (install-file (string-append ntfs-3g "/bin/ntfsfix") bin)
8071 (with-directory-excursion bin
8072 (remove-store-references "ntfsfix"))))))
8073 (inputs
8074 `(("ntfs-3g" ,ntfs-3g/static)))
8075 (home-page (package-home-page ntfs-3g/static))
8076 (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
8077 (description
8078 "This package provides a statically linked @command{ntfsfix} taken
8079from the ntfs-3g package. It is meant to be used in initrds.")
8080 (license (package-license ntfs-3g/static))))
8081
8082(define-public rdma-core
8083 (package
8084 (name "rdma-core")
8085 (version "60.0")
8086 (source (origin
8087 (method url-fetch)
8088 (uri (string-append "https://github.com/linux-rdma/rdma-core"
8089 "/releases/download/v" version "/rdma-core-"
8090 version ".tar.gz"))
8091 (sha256
8092 (base32
8093 "1pi8jf1pibfhh3ps2kvj2y8y6yahpw7jjyp0mpxmvama9qp8j6wv"))))
8094 (build-system cmake-build-system)
8095 (arguments
8096 `(#:tests? #f ;no tests
8097
8098 ;; Upstream uses the "ninja" build system and encourage distros
8099 ;; to do the same for consistency.
8100 #:generator "Ninja"
8101 #:configure-flags (list ,@(if (%current-target-system)
8102 `((string-append
8103 "-DPKG_CONFIG_EXECUTABLE="
8104 (search-input-file
8105 %build-inputs
8106 (string-append "/bin/"
8107 ,(pkg-config-for-target)))))
8108 '())
8109 (string-append "-DRST2MAN_EXECUTABLE="
8110 (search-input-file
8111 %build-inputs "/bin/rst2man.py")))))
8112 (native-inputs
8113 (list pkg-config python-wrapper python-docutils-0.19)) ;for 'rst2man'
8114 (inputs
8115 (list libnl eudev))
8116 (home-page "https://github.com/linux-rdma/rdma-core")
8117 (synopsis "Utilities and libraries for working with RDMA devices")
8118 (description
8119 "This package provides userspace components for the InfiniBand
8120subsystem of the Linux kernel. Specifically it contains userspace
8121libraries for the following device nodes:
8122
8123@enumerate
8124@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
8125@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
8126@item @file{/dev/infiniband/umadX} (@code{libibumad})
8127@end enumerate
8128
8129The following service daemons are also provided:
8130@enumerate
8131@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
8132@item @code{iwpmd} (for iWARP kernel providers)
8133@item @code{ibacm} (for InfiniBand communication management assistant)
8134@end enumerate")
8135 ;; All library code is dual licensed under GPL2 and a custom MIT
8136 ;; variant. The package also includes some components covered by
8137 ;; other licenses. Consult COPYING.md for full details.
8138 (license
8139 (list license:gpl2
8140 (license:x11-style "See COPYING.BSD_MIT in the distribution")
8141 license:bsd-2 ; Files referring to COPYING.BSD_FB
8142 license:cc0 ; most files in ccan/
8143 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
8144
8145(define-public perftest
8146 (package
8147 (name "perftest")
8148 (version "4.5-0.20")
8149 (home-page "https://github.com/linux-rdma/perftest")
8150 (source (origin
8151 (method git-fetch)
8152 (uri (git-reference (url home-page)
8153 (commit (string-append "v" version))))
8154 (file-name (git-file-name name version))
8155 (sha256
8156 (base32
8157 "1hrpzmkz1kq4jwpy6b5fl8073iy7dllcq2hfzdw6waaf5920vd64"))))
8158 (build-system gnu-build-system)
8159 (native-inputs
8160 (list autoconf automake libtool))
8161 (inputs (list pciutils rdma-core))
8162 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
8163 (description "This is a collection of tests written over uverbs intended
8164for use as a performance micro-benchmark. The tests may be used for hardware
8165or software tuning as well as for functional testing.
8166
8167The collection contains a set of bandwidth and latency benchmark such as:
8168@enumerate
8169@item Send - @code{ib_send_bw} and @code{ib_send_lat}
8170@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
8171@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
8172@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
8173@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
8174@end enumerate")
8175 (license license:gpl2)))
8176
8177(define-public rng-tools
8178 (package
8179 (name "rng-tools")
8180 (home-page "https://github.com/nhorman/rng-tools")
8181 (version "6.17")
8182 (source (origin
8183 (method git-fetch)
8184 (uri (git-reference (url home-page)
8185 (commit (string-append "v" version))))
8186 (file-name (git-file-name name version))
8187 (sha256
8188 (base32
8189 "0vvqi9ha4jbk4086x2q98p4ip3z56sfdpyckdyknsd36zhp6z8n2"))
8190 (patches
8191 (search-patches "rng-tools-revert-build-randstat.patch"))
8192 (patch-flags '("-p0"))))
8193 (build-system gnu-build-system)
8194 (arguments
8195 (list
8196 ;; Disable support for various hardware entropy sources as they need
8197 ;; dependencies that are not yet in Guix, and would significantly
8198 ;; increase closure size.
8199 #:configure-flags #~(list "--without-nistbeacon"
8200 "--without-pkcs11"
8201 "--without-rtlsdr"
8202 "--without-qrypt")
8203 #:phases
8204 #~(modify-phases %standard-phases
8205 (add-before 'check 'disable-failing-test
8206 (lambda _
8207 (substitute* "tests/Makefile"
8208 ;; This test requires a hwrng, rdrand, or tpm device.
8209 ;; Worse, it appears to fail if that isn't sufficiently random.
8210 (("\\brngtestjitter\\.sh\\b") " ")))))))
8211 (native-inputs
8212 (list autoconf automake pkg-config))
8213 (inputs
8214 (list libcap sysfsutils openssl))
8215 (synopsis "Random number generator daemon")
8216 (description
8217 "Monitor a hardware random number generator, and supply entropy
8218from that to the system kernel's @file{/dev/random} machinery.")
8219 ;; The source package is offered under the GPL2+, but the files
8220 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
8221 (license (list license:gpl2 license:gpl2+))))
8222
8223(define-public cpupower
8224 (package
8225 (name "cpupower")
8226 (version (package-version linux-libre))
8227 (source (package-source linux-libre))
8228 (build-system gnu-build-system)
8229 (arguments
8230 (list #:make-flags
8231 #~(list "CC=gcc"
8232 (string-append "DESTDIR=" #$output)
8233 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
8234 "docdir=/share/doc/cpupower" ;drop default ‘packages/’
8235 "confdir=$(docdir)/examples"
8236 ;; The Makefile recommends the following changes.
8237 "DEBUG=false"
8238 "[email protected]")
8239 #:tests? #f ; no tests
8240 #:phases
8241 #~(modify-phases %standard-phases
8242 (add-after 'unpack 'enter-subdirectory
8243 (lambda _
8244 (chdir "tools/power/cpupower")))
8245 (delete 'configure) ; no configure script
8246 (add-before 'build 'fix-makefiles
8247 (lambda _
8248 (substitute* "Makefile"
8249 (("/usr/") "/")
8250 (("/bin/(install)" _ command) command))
8251 (substitute* "bench/Makefile"
8252 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))))
8253 (native-inputs (list gettext-minimal
8254 which)) ;to find gettext
8255 (inputs (list pciutils))
8256 (home-page (package-home-page linux-libre))
8257 (synopsis "CPU frequency and voltage scaling tools for Linux")
8258 (description
8259 "cpupower is a set of user-space tools that use the cpufreq feature of the
8260Linux kernel to retrieve and control processor features related to power saving,
8261such as frequency and voltage scaling.")
8262 (license license:gpl2)))
8263
8264(define-public x86-energy-perf-policy
8265 (package
8266 (name "x86-energy-perf-policy")
8267 (version (package-version linux-libre))
8268 (source (package-source linux-libre))
8269 (build-system gnu-build-system)
8270 (arguments
8271 '(#:tests? #f
8272 #:phases
8273 (modify-phases %standard-phases
8274 (add-after 'unpack 'enter-subdirectory
8275 (lambda _
8276 (chdir "tools/power/x86/x86_energy_perf_policy")
8277 #t))
8278 (delete 'configure)
8279 (add-before 'build 'fix-makefile
8280 (lambda _
8281 (substitute* "Makefile" (("/usr") ""))
8282 #t)))
8283 #:make-flags
8284 (let ((out (assoc-ref %outputs "out")))
8285 (list (string-append "DESTDIR=" out)
8286 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
8287 (supported-systems '("i686-linux" "x86_64-linux"))
8288 (home-page (package-home-page linux-libre))
8289 (synopsis "Display and update Intel-CPU energy-performance policy")
8290 (description
8291 "@command{x86_energy_perf_policy} displays and updates energy-performance
8292policy settings specific to Intel Architecture Processors. Settings are
8293accessed via Model Specific Register (MSR) updates, no matter if the Linux
8294cpufreq sub-system is enabled or not.")
8295 (license license:gpl2)))
8296
8297(define-public haveged
8298 (package
8299 (name "haveged")
8300 (version "1.9.19")
8301 (source
8302 (origin
8303 (method git-fetch)
8304 (uri (git-reference
8305 (url "https://github.com/jirka-h/haveged")
8306 (commit (string-append "v" version))))
8307 (file-name (git-file-name name version))
8308 (sha256
8309 (base32 "1qka68dlfz9z3gjfvfwvh60l2121c1yx0z264jqsf2vjp5f0xbmn"))))
8310 (build-system gnu-build-system)
8311 (arguments
8312 `(#:configure-flags
8313 (list "--disable-static")))
8314 (home-page "https://www.issihosts.com/haveged")
8315 (synopsis "Entropy source for the Linux random number generator")
8316 (description
8317 "haveged generates an unpredictable stream of random numbers for use by
8318Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
8319standard mechanisms for filling the entropy pool may not be sufficient for
8320systems with high needs or limited user interaction, such as headless servers.
8321
8322@command{haveged} runs as a privileged daemon, harvesting randomness from the
8323indirect effects of hardware events on hidden processor state using the
8324@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
8325It tunes itself to its environment and provides the same built-in test suite
8326for the output stream as used on certified hardware security devices.
8327
8328The quality of the randomness produced by this algorithm has not been proven.
8329It is recommended to run it together with another entropy source like rngd, and
8330not as a replacement for it.")
8331 (license (list (license:non-copyleft "file://nist/mconf.h")
8332 (license:non-copyleft "file://nist/packtest.c")
8333 license:public-domain ; nist/dfft.c
8334 license:gpl3+)))) ; everything else
8335
8336(define-public hotspot
8337 ;; Use the latest git commit as it includes unreleased fixes for the test
8338 ;; suite.
8339 (let ((commit "5cec69301a3f34ada86ce9fe01a9538b04b3cf7c")
8340 (revision "0"))
8341 (package
8342 (name "hotspot")
8343 (version (git-version "1.5.1" revision commit))
8344 (source (origin
8345 (method git-fetch)
8346 (uri (git-reference
8347 (url "https://github.com/KDAB/hotspot")
8348 (commit commit)
8349 ;; Include the bundled perfparser and PrefixTickLabels
8350 ;; libraries, which are to be used in source form.
8351 (recursive? #t)))
8352 (file-name (git-file-name name version))
8353 (sha256
8354 (base32
8355 "115gskjdcb1q3mgrnv1qcdrhxabjzl1hhkpk1klk67ayicsk1ym6"))))
8356 (build-system qt-build-system)
8357 (arguments
8358 (list
8359 ;; As mentioned in the option help text, the KAuth helper cannot be
8360 ;; installed to a custom prefix and the build fails with "file cannot
8361 ;; create directory: /polkit-1/actions. Maybe need administrative"
8362 ;; (see: https://bugs.kde.org/show_bug.cgi?id=363678).
8363 #:configure-flags #~(list "-DINSTALL_KAUTH_HELPER=OFF"
8364 "-DQT6_BUILD=ON")
8365 #:qtbase qtbase
8366 ;; The 'tst_models' and 'tst_callgraphgenerator' fail, with
8367 ;; the later seemingly requiring sudo or access to the kernel
8368 ;; trace points.
8369 #:test-exclude
8370 (string-append
8371 "("
8372 (string-join
8373 ;; The 'tst_models' expected output doesn't exactly
8374 ;; match.
8375 '("tst_models"
8376 ;; The 'tst_callgraphgenerator' perf invocation
8377 ;; fails when run in the build container.
8378 "tst_callgraphgenerator"
8379 ;; The 'tst_perfparser' test requires sudo/access
8380 ;; to the kernel scheduler trace points.
8381 "tst_perfparser")
8382 "|")
8383 ")")
8384 #:phases
8385 #~(modify-phases %standard-phases
8386 (add-after 'unpack 'patch-perfparser
8387 ;; XXX: This phase is copied from qt-creator: keep them in sync!
8388 (lambda* (#:key inputs #:allow-other-keys)
8389 ;; perfparser attempts to dynamically load the demangle
8390 ;; libraries; use their absolute file name to avoid having to
8391 ;; set LD_LIBRARY_PATH.
8392 (let ((librustc_demangle.so
8393 (with-exception-handler (lambda (ex)
8394 (if (search-error? ex)
8395 #f
8396 (raise-exception ex)))
8397 (lambda ()
8398 (search-input-file inputs "lib/librustc_demangle.so"))
8399 #:unwind? #t)))
8400 (substitute* "3rdparty/perfparser/app/demangler.cpp"
8401 (("loadDemangleLib\\(QStringLiteral\\(\"rustc_demangle\")"
8402 all)
8403 (if librustc_demangle.so
8404 (format #f "loadDemangleLib(QStringLiteral(~s)"
8405 librustc_demangle.so)
8406 all)) ;no rustc_demangle; leave unchanged
8407 (("loadDemangleLib\\(QStringLiteral\\(\"d_demangle\")")
8408 (format #f "loadDemangleLib(QStringLiteral(~s)"
8409 (search-input-file inputs
8410 "lib/libd_demangle.so")))))))
8411 (add-after 'unpack 'path-paths
8412 (lambda* (#:key inputs #:allow-other-keys)
8413 (substitute* "src/perfoutputwidgetkonsole.cpp"
8414 (("\"tail\"")
8415 (format #f "~s" (search-input-file inputs "bin/tail"))))
8416 (substitute* "src/perfrecord.cpp"
8417 (("\"perf( )?\"" _ space)
8418 (string-append "\"" (search-input-file inputs "bin/perf")
8419 (or space "") "\""))))))))
8420 (native-inputs
8421 (list extra-cmake-modules
8422 vulkan-headers))
8423 (inputs
8424 (append
8425 (list coreutils-minimal
8426 d-demangler
8427 elfutils
8428 karchive
8429 kconfig
8430 kcoreaddons
8431 kddockwidgets
8432 kgraphviewer
8433 ki18n
8434 kio
8435 kiconthemes
8436 kitemmodels
8437 kitemviews
8438 knotifications
8439 kparts
8440 ksyntaxhighlighting
8441 kwindowsystem
8442 libxkbcommon
8443 perf
8444 qtdeclarative
8445 qtsvg
8446 solid
8447 threadweaver
8448 `(,zstd "lib"))
8449 (if (supported-package? rust-rustc-demangle-capi-0.1)
8450 (list rust-rustc-demangle-capi-0.1)
8451 '())))
8452 (home-page "https://github.com/KDAB/hotspot")
8453 (synopsis "Performance analysis GUI for Linux perf")
8454 (description "Hotspot is a standalone GUI for performance data analysis.
8455It aims to be similar to KCachegrind, but for data collected with
8456@command{perf}, a profiler for use with the kernel Linux. Its main feature is
8457graphically visualizing a @file{perf.data} file.")
8458 (license (list license:gpl2+ license:gpl3+))))) ;dual licensed
8459
8460(define-public ecryptfs-utils
8461 (package
8462 (name "ecryptfs-utils")
8463 (version "111")
8464 (source
8465 (origin
8466 (method url-fetch)
8467 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
8468 version "/+download/ecryptfs-utils_"
8469 version ".orig.tar.gz"))
8470 (sha256
8471 (base32
8472 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
8473 (build-system gnu-build-system)
8474 (arguments
8475 `(#:configure-flags (list "--disable-pywrap")
8476 #:modules (,@%default-gnu-modules
8477 (ice-9 binary-ports)
8478 (rnrs bytevectors)
8479 (srfi srfi-26))
8480 #:phases
8481 (modify-phases %standard-phases
8482 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
8483 (lambda* (#:key inputs outputs #:allow-other-keys)
8484 (let ((out (assoc-ref outputs "out"))
8485 (util-linux (assoc-ref inputs "util-linux"))
8486 (cryptsetup (assoc-ref inputs "cryptsetup-minimal"))
8487 (linux-pam (assoc-ref inputs "linux-pam"))
8488 (lvm2 (assoc-ref inputs "lvm2")))
8489 (substitute* '("src/utils/ecryptfs-mount-private"
8490 "src/utils/ecryptfs-umount-private"
8491 "src/utils/ecryptfs-setup-private"
8492 "src/utils/ecryptfs-setup-swap"
8493 "src/utils/mount.ecryptfs.c"
8494 "src/utils/umount.ecryptfs.c"
8495 "src/pam_ecryptfs/pam_ecryptfs.c"
8496 "src/desktop/ecryptfs-mount-private.desktop.in"
8497 "src/desktop/ecryptfs-setup-private.desktop.in")
8498 (("/bin/mount")
8499 (string-append util-linux "/bin/mount"))
8500 (("/bin/umount")
8501 (string-append util-linux "/bin/umount"))
8502 (("/sbin/mount.ecryptfs_private")
8503 (string-append out "/sbin/mount.ecryptfs_private"))
8504 (("/sbin/umount.ecryptfs_private")
8505 (string-append out "/sbin/umount.ecryptfs_private"))
8506 (("/usr/bin/ecryptfs-mount-private")
8507 (string-append out "/bin/ecryptfs-mount-private"))
8508 (("/usr/bin/ecryptfs-rewrite-file")
8509 (string-append out "/bin/ecryptfs-rewrite-file"))
8510 (("/usr/bin/ecryptfs-setup-private")
8511 (string-append out "/bin/ecryptfs-setup-private"))
8512 (("/sbin/cryptsetup")
8513 (string-append cryptsetup "/sbin/cryptsetup"))
8514 (("/sbin/unix_chkpwd")
8515 (string-append linux-pam "/sbin/unix_chkpwd"))
8516 (("/sbin/dmsetup")
8517 (string-append lvm2 "/sbin/dmsetup"))))))
8518 (add-after 'install 'wrap-scripts
8519 (lambda* (#:key inputs outputs #:allow-other-keys)
8520 (let* ((out (assoc-ref outputs "out"))
8521 (bin (string-append out "/bin"))
8522 (add (map (lambda (bin)
8523 (dirname (search-input-file
8524 inputs (string-append "bin/" bin))))
8525 ;; For simplicity, we wrap all scripts the same.
8526 (list "awk" "find" "gettext" "grep" "keyctl" "ls"
8527 "lsof" "mount" "rsync" "sed" "which")))
8528 (script? (lambda (file)
8529 (call-with-input-file file
8530 (lambda (port)
8531 (bytevector=? (string->utf8 "#!")
8532 (get-bytevector-n port 2)))))))
8533 (for-each (lambda (file)
8534 (when (script? file)
8535 (wrap-program file
8536 ;; '= would be better than 'suffix but break
8537 ;; setuid binaries.
8538 `("PATH" ":" suffix (,@add
8539 ,(string-append bin))))))
8540 (find-files bin "."))))))))
8541 (native-inputs
8542 (list intltool perl ; for pod2man
8543 pkg-config))
8544 (inputs
8545 (list coreutils
8546 cryptsetup-minimal
8547 findutils
8548 gawk
8549 grep
8550 keyutils
8551 linux-pam
8552 lsof
8553 lvm2
8554 nss
8555 rsync
8556 sed
8557 util-linux
8558 which))
8559 (home-page "https://ecryptfs.org/")
8560 (synopsis "Cryptographic file system utilities")
8561 (description
8562 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
8563Each file's cryptographic meta-data is stored inside the file itself, along
8564with the encrypted contents. This allows individual encrypted files to be
8565copied between hosts and still be decrypted with the proper key. eCryptfs is a
8566native Linux file system, and has been part of the Linux kernel since version
85672.6.19. This package contains the userland utilities to manage it.")
8568 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
8569 ;; grant additional permission to link with OpenSSL.
8570 (license license:gpl2+)))
8571
8572(define-public libnfsidmap
8573 (package
8574 (name "libnfsidmap")
8575 (version "0.27")
8576 (source
8577 (origin
8578 (method url-fetch)
8579 (uri (string-append "https://fedorapeople.org/~steved/"
8580 name "/" version "/" name "-" version ".tar.bz2"))
8581 (sha256
8582 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
8583 (build-system gnu-build-system)
8584 (arguments
8585 `(#:configure-flags (list
8586 (string-append "--with-pluginpath="
8587 (assoc-ref %outputs "out")
8588 "/lib/libnfsidmap"))))
8589 (native-inputs
8590 (list autoconf)) ; 0.27 still needs autoheader
8591 (home-page
8592 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
8593 (synopsis "NFSv4 support library for name/ID mapping")
8594 (description "Libnfsidmap is a library holding multiple methods of
8595mapping names to ids and visa versa, mainly for NFSv4. It provides an
8596extensible array of mapping functions, currently consisting of two choices:
8597the default @code{nsswitch} and the experimental @code{umich_ldap}.")
8598 (license (license:non-copyleft "file://COPYING"
8599 "See COPYING in the distribution."))))
8600
8601(define-public module-init-tools
8602 (package
8603 (name "module-init-tools")
8604 (version "3.16")
8605 (source (origin
8606 (method url-fetch)
8607 (uri (string-append
8608 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
8609 "module-init-tools-" version ".tar.bz2"))
8610 (sha256
8611 (base32
8612 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
8613 (patches (search-patches "module-init-tools-moduledir.patch"))))
8614 (build-system gnu-build-system)
8615 (arguments
8616 ;; FIXME: The upstream tarball lacks man pages, and building them would
8617 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
8618 ;; but they vanished. In the meantime, fake it.
8619 '(#:phases
8620 (modify-phases %standard-phases
8621 (add-before 'configure 'fake-docbook
8622 (lambda _
8623 (substitute* "Makefile.in"
8624 (("^DOCBOOKTOMAN.*$")
8625 "DOCBOOKTOMAN = true\n"))
8626 #t)))))
8627 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
8628 (synopsis "Tools for loading and managing Linux kernel modules")
8629 (description
8630 "Tools for loading and managing Linux kernel modules, such as
8631@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
8632 (license license:gpl2+)))
8633
8634(define-public mce-inject
8635 (let ((revision "0") ; no git tags :-/
8636 (commit "4cbe46321b4a81365ff3aafafe63967264dbfec5"))
8637 (package
8638 (name "mce-inject")
8639 (version (git-version "0.0.0" revision commit))
8640 (source
8641 (origin
8642 (method git-fetch)
8643 (uri (git-reference
8644 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git")
8645 (commit commit)))
8646 (file-name (git-file-name name version))
8647 (sha256
8648 (base32 "0gjapg2hrlxp8ssrnhvc19i3r1xpcnql7xv0zjgbv09zyha08g6z"))))
8649 (build-system gnu-build-system)
8650 (arguments
8651 ;; There is no test suite. There's a test/ directory, but it just holds
8652 ;; example text files you could feed to the programme to crash something.
8653 (list #:tests? #f
8654 #:make-flags
8655 #~(list (string-append "prefix=" #$output)
8656 (string-append "CC=" #$(cc-for-target)))
8657 #:phases
8658 #~(modify-phases %standard-phases
8659 (delete 'configure) ; no configure script
8660 (add-after 'install 'install-examples
8661 (lambda* (#:key outputs #:allow-other-keys)
8662 (let* ((out (assoc-ref outputs "out"))
8663 (doc (string-append out "/share/doc/" #$name))
8664 (dir (string-append doc "/examples")))
8665 (copy-recursively "test" dir )))))))
8666 (native-inputs
8667 (list bison flex))
8668 (supported-systems (list "i686-linux" "x86_64-linux"))
8669 (home-page
8670 "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git/about/")
8671 (synopsis
8672 "Inject x86 @acronym{MCEs, machine-check exceptions} into Linux")
8673 (description
8674 "This simple tool injects fake @acronym{MCEs, machine-check exceptions}
8675into a running Linux kernel, to debug or test the kernel's @acronym{EDAC, error
8676detection and correction}-handling code specific to x86 and x86_64 platforms.
8677
8678Real MCEs are internal CPU errors. Handling them correctly can be important to
8679system stability and even prevent physical damage. In contrast, simulated MCEs
8680produced by @command{mce-inject} are purely synthetic: injection happens only at
8681the software level, inside the kernel, and is not visible to the platform
8682hardware or firmware.
8683
8684A convenient feature of @command{mce-inject} is that the input language used to
8685describe MCEs is similar to the format used in Linux panic messages, with a few
8686extensions. In general, you should be able to pipe in any logged MCE panic to
8687simulate that same MCE.
8688
8689The target kernel must have the @code{CONFIG_X86_MCE_INJECT} option enabled and
8690the @code{mce-inject} module loaded if it exists.")
8691 (license license:gpl2))))
8692
8693(define-public mcelog
8694 (package
8695 (name "mcelog")
8696 (version "195")
8697 (source
8698 (origin
8699 (method git-fetch)
8700 (uri (git-reference
8701 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
8702 (commit (string-append "v" version))))
8703 (file-name (git-file-name name version))
8704 (sha256
8705 (base32 "1bg2bj8flybd8kzmmaaslisc6lc1fs9nbv09im6r32dq48skx5aj"))
8706 (modules '((guix build utils)))
8707 (snippet
8708 `(begin
8709 ;; The checkout lacks a .git directory, breaking ‘git describe’.
8710 (substitute* "Makefile"
8711 (("\"unknown\"") (string-append "\"v" ,version "\"")))))))
8712 (build-system gnu-build-system)
8713 (arguments
8714 (list
8715 ;; The tests will only run as root on certain supported CPU models.
8716 #:tests? #f
8717 #:make-flags
8718 #~(list (string-append "CC=" #$(cc-for-target))
8719 (string-append "prefix=" #$output)
8720 (string-append "DOCDIR=" #$output "/share/doc/"
8721 #$name "-" #$version)
8722 "etcprefix=$(DOCDIR)/examples")
8723 #:phases
8724 #~(modify-phases %standard-phases
8725 (delete 'configure)))) ; no configure script
8726 (native-inputs
8727 (list python-wrapper)) ; to generate example mcelog.conf
8728 (supported-systems (list "i686-linux" "x86_64-linux"))
8729 (home-page "https://mcelog.org/")
8730 (synopsis "Machine check monitor for x86 Linux systems")
8731 (description
8732 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
8733systems running the kernel Linux. It can also perform user-defined tasks, such
8734as bringing bad pages off-line, when configurable error thresholds are
8735exceeded.")
8736 (license license:gpl2)))
8737
8738(define-public mtd-utils
8739 (package
8740 (name "mtd-utils")
8741 (version "2.1.5")
8742 (source (origin
8743 (method url-fetch)
8744 (uri (string-append
8745 "ftp://ftp.infradead.org/pub/mtd-utils/"
8746 "mtd-utils-" version ".tar.bz2"))
8747 (sha256
8748 (base32
8749 "0ilz8hkcyvfcnqpy25kbr8fb71x9vl28wbmw56vvd68n2byjfviq"))))
8750 (arguments
8751 (list #:configure-flags
8752 (if (%current-target-system) ; When cross-compiling.
8753 #~(list)
8754 #~(list "--enable-unit-tests"))
8755
8756 #:parallel-tests? #f)) ;tests may fail when running in parallel
8757 (native-inputs
8758 (list cmocka pkg-config))
8759 (inputs
8760 (list acl ; extended attributes (xattr)
8761 lzo
8762 openssl ; optional crypto support
8763 `(,util-linux "lib")
8764 zlib
8765 `(,zstd "lib")))
8766 (build-system gnu-build-system)
8767 (synopsis "MTD Flash Storage Utilities")
8768 (description "This package provides utilities for testing, partitioning, etc
8769of flash storage.")
8770 (home-page "http://www.linux-mtd.infradead.org/")
8771 (license
8772 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
8773 license:mpl1.1 ; All ftl* files
8774 license:expat)))) ; libiniparser
8775
8776(define-public libseccomp
8777 (package
8778 (name "libseccomp")
8779 (version "2.6.0")
8780 (source (origin
8781 (method git-fetch)
8782 (uri (git-reference
8783 (url "https://github.com/seccomp/libseccomp")
8784 (commit (string-append "v" version))))
8785 (file-name (git-file-name name version))
8786 (sha256
8787 (base32
8788 "189yh66aj3z3jvns739qbj504f3mcl3w44pxxizw877pbj3kal11"))))
8789 (build-system gnu-build-system)
8790 (arguments
8791 (list
8792 #:configure-flags #~(list "--disable-static")
8793 #:phases #~(modify-phases %standard-phases
8794 #$@(if (target-ppc32?)
8795 ;; This test is removed upstream. See upstream commit
8796 ;; 7db46d72f13c172b290818f624c2966bd0db5677
8797 #~((add-after 'unpack 'skip-62-sim-arch-tests
8798 (lambda _
8799 (substitute*
8800 "tests/62-sim-arch_transactions.tests"
8801 (("test type: bpf-sim-fuzz") "")
8802 (("62-sim-arch_transactions 5") "")))))
8803 #~())
8804 (add-before 'check 'skip-load-test
8805 (lambda _
8806 ;; This test does a native system call and fails when
8807 ;; run under QEMU user-mode emulation. Just skip it.
8808 (delete-file "tests/52-basic-load.tests"))))))
8809 (native-inputs
8810 (list autoconf automake gperf libtool which))
8811 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
8812 (description "The libseccomp library provides an easy to use, platform
8813independent, interface to the Linux Kernel's syscall filtering mechanism. The
8814libseccomp API is designed to abstract away the underlying BPF based syscall
8815filter language and present a more conventional function-call based filtering
8816interface that should be familiar to, and easily adopted by, application
8817developers.")
8818 (home-page "https://github.com/seccomp/libseccomp")
8819 (license license:lgpl2.1)))
8820
8821(define-public radeontop
8822 (package
8823 (name "radeontop")
8824 (version "1.4")
8825 (source
8826 (origin
8827 (method git-fetch)
8828 (uri (git-reference
8829 (url "https://github.com/clbr/radeontop")
8830 (commit (string-append "v" version))))
8831 (file-name (git-file-name name version))
8832 (sha256
8833 (base32 "0kwqddidr45s1blp0h8r8h1dd1p50l516yb6mb4s6zsc827xzgg3"))))
8834 (build-system gnu-build-system)
8835 (arguments
8836 `(#:phases (modify-phases %standard-phases
8837 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
8838 ;; dependency, and doesn't even work on release(!) tarballs.
8839 (add-after 'unpack 'report-correct-version
8840 (lambda _
8841 (substitute* "getver.sh"
8842 (("ver=unknown")
8843 (string-append "ver=" ,version)))))
8844 (delete 'configure)) ; no configure script
8845 #:make-flags (list (string-append "CC=" ,(cc-for-target))
8846 (string-append "PREFIX=" %output))
8847 #:tests? #f)) ; no tests
8848 (native-inputs
8849 (list gettext-minimal pkg-config))
8850 (inputs
8851 (list libdrm libpciaccess libxcb ncurses))
8852 (home-page "https://github.com/clbr/radeontop/")
8853 (synopsis "Usage monitor for AMD Radeon graphics")
8854 (description "RadeonTop monitors resource consumption on supported AMD
8855Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
8856a terminal or saved to a file for further processing. It measures both the
8857activity of the GPU as a whole, which is also accurate during OpenCL
8858computations, as well as separate component statistics that are only meaningful
8859under OpenGL graphics workloads.")
8860 (license license:gpl3)))
8861
8862(define-public efivar
8863 (package
8864 (name "efivar")
8865 (version "39")
8866 (source (origin
8867 (method git-fetch)
8868 (uri (git-reference
8869 (url "https://github.com/rhboot/efivar")
8870 (commit version)))
8871 (file-name (git-file-name name version))
8872 (sha256
8873 (base32
8874 "1zd9dghg1z2rrsazv3d9rj7nik6kdqz42jiak65pipz7mpjn9zdk"))
8875 (patches (search-patches "efivar-fix-fprint-format.patch"))))
8876 (build-system gnu-build-system)
8877 (arguments
8878 (list
8879 ;; Tests require a UEFI system and is not detected in the chroot.
8880 #:tests? #f
8881 #:make-flags #~(list (string-append "prefix="
8882 #$output)
8883 (string-append "libdir="
8884 #$output "/lib")
8885 (string-append "CC="
8886 #$(cc-for-target))
8887 "HOSTCC=gcc"
8888 (string-append "LDFLAGS=-Wl,-rpath="
8889 #$output "/lib")
8890 ;; Strictly only needed for i686-linux/32bit
8891 "CFLAGS=-g -O2 -Wno-error=format")
8892 #:phases #~(modify-phases %standard-phases
8893 (add-after 'unpack 'build-deterministically
8894 (lambda _
8895 (substitute* "src/include/defaults.mk"
8896 ;; Don't use -march=native.
8897 (("-march=native")
8898 ""))))
8899 (delete 'configure))))
8900 (native-inputs (list mandoc pkg-config))
8901 (inputs (list popt))
8902 (home-page "https://github.com/rhboot/efivar")
8903 (synopsis "Tool and library to manipulate EFI variables")
8904 (description "This package provides a library and a command line
8905interface to the variable facility of UEFI boot firmware.")
8906 (license license:lgpl2.1+)))
8907
8908(define-public efibootmgr
8909 (package
8910 (name "efibootmgr")
8911 (version "18")
8912 (source
8913 (origin
8914 (method git-fetch)
8915 (uri (git-reference
8916 (url "https://github.com/rhboot/efibootmgr")
8917 (commit version)))
8918 (file-name (git-file-name name version))
8919 (sha256
8920 (base32 "1j19m3dngcb7jl88ib32phbh5r7c02dhhakq8jk6z7y408c111hd"))))
8921 (build-system gnu-build-system)
8922 (arguments
8923 (list
8924 #:tests? #f ;no tests
8925 #:make-flags
8926 #~(append (list (string-append "prefix=" #$output)
8927 (string-append "libdir=" #$output "/lib")
8928 ;; EFIDIR denotes a subdirectory relative to the
8929 ;; EFI System Partition where the loader will be
8930 ;; installed (known as OS_VENDOR in the code).
8931 ;; GRUB overrides this, as such it's only used if
8932 ;; nothing else is specified on the command line.
8933 "EFIDIR=gnu")
8934 #$(if (%current-target-system)
8935 #~(list
8936 (string-append "CC=" #$(cc-for-target))
8937 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
8938 (string-append "EXTRAINCDIRS="
8939 #$(this-package-input "efivar") "/include"))
8940 #~'()))
8941 #:phases #~(modify-phases %standard-phases (delete 'configure))))
8942 (native-inputs
8943 (list pkg-config))
8944 (inputs
8945 (list efivar popt))
8946 (home-page "https://github.com/rhboot/efibootmgr")
8947 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
8948 (description
8949 "@code{efibootmgr} is a user-space application to modify the Intel
8950Extensible Firmware Interface (EFI) Boot Manager. This application can
8951create and destroy boot entries, change the boot order, change the next
8952running boot option, and more.")
8953 (license license:gpl2+)))
8954
8955(define-public sysstat
8956 (package
8957 (name "sysstat")
8958 (version "12.7.5")
8959 (source
8960 (origin
8961 (method url-fetch)
8962 (uri (string-append "https://sysstat.github.io/sysstat-packages/"
8963 "sysstat-" version ".tar.xz"))
8964 (sha256
8965 (base32 "0ssdrm3k0fclq5b5i0aznfwdkbac9l9cf88idaq3pls9lm040rjp"))))
8966 (build-system gnu-build-system)
8967 (native-inputs (list gettext-minimal))
8968 (arguments
8969 `(#:tests? #f ; no test suite.
8970 ;; Without this flag, it tries to install the man pages with group 'root'
8971 ;; and fails because /etc/passwd lacks an entry for the root user.
8972 #:configure-flags
8973 (list "--disable-file-attr"
8974 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
8975 #:phases
8976 (modify-phases %standard-phases
8977 ;; The build process tries to create '/var/lib/sa', so we skip that
8978 ;; instruction.
8979 (add-after 'build 'skip-touching-var
8980 (lambda _
8981 (substitute* "Makefile"
8982 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
8983 "")))))))
8984 (home-page "https://sysstat.github.io")
8985 (synopsis "Performance monitoring tools for Linux")
8986 (description "The sysstat utilities are a collection of performance
8987monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
8988@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
8989@code{sadf} and @code{sa}.")
8990 (license license:gpl2+)))
8991
8992(define-public acpilight
8993 (package
8994 (name "acpilight")
8995 (version "1.2")
8996 (source (origin
8997 (method git-fetch)
8998 (uri (git-reference
8999 (url "https://gitlab.com/wavexx/acpilight.git")
9000 (commit (string-append "v" version))))
9001 (file-name (git-file-name name version))
9002 (sha256
9003 (base32
9004 "1r0r3nx6x6vkpal6vci0zaa1n9dfacypldf6k8fxg7919vzxdn1w"))))
9005 (build-system gnu-build-system)
9006 (arguments
9007 (list #:tests? #f ; no tests
9008 #:make-flags
9009 #~(list (string-append "prefix=" #$output)
9010 (string-append "sysconfdir=" #$output "/lib")) ;udev rule
9011 #:phases
9012 #~(modify-phases %standard-phases
9013 (delete 'configure)
9014 (add-after 'unpack 'patch
9015 (lambda* (#:key inputs #:allow-other-keys)
9016 ;; Prevent reloading udev at build time
9017 (substitute* "Makefile"
9018 (("udevadm") "true"))
9019 (substitute* "90-backlight.rules"
9020 (("/bin")
9021 (string-append #$(this-package-input "coreutils")
9022 "/bin"))))))))
9023 (inputs (list coreutils python))
9024 (home-page "https://gitlab.com/wavexx/acpilight")
9025 (synopsis "Backward-compatibile xbacklight replacement")
9026 (description "acpilight is a backward-compatibile replacement for
9027xbacklight that uses the ACPI interface to set the display brightness. On
9028modern laptops acpilight can control both display and keyboard backlight
9029uniformly on either X11, the console or Wayland.")
9030 (license license:gpl3+)))
9031
9032(define-public light
9033 (package
9034 (name "light")
9035 (version "1.2.2")
9036 (source
9037 (origin
9038 (method git-fetch)
9039 (uri (git-reference
9040 (url "https://github.com/haikarainen/light")
9041 (commit (string-append "v" version))))
9042 (sha256
9043 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
9044 (file-name (git-file-name name version))))
9045 (build-system gnu-build-system)
9046 (arguments
9047 `(#:configure-flags '("CFLAGS=-fcommon")
9048 #:phases
9049 (modify-phases %standard-phases
9050 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
9051 (lambda* (#:key inputs #:allow-other-keys)
9052 (substitute* "90-backlight.rules"
9053 (("/bin/chgrp") (which "chgrp"))
9054 (("/bin/chmod") (which "chmod")))
9055 #t))
9056 (add-after 'install 'install-udev-rules
9057 (lambda* (#:key outputs #:allow-other-keys)
9058 (let ((out (assoc-ref outputs "out")))
9059 (install-file
9060 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
9061 #t))))))
9062 (native-inputs
9063 (list autoconf automake))
9064 (home-page "https://haikarainen.github.io/light/")
9065 (synopsis "GNU/Linux application to control backlights")
9066 (description
9067 "Light is a program to send commands to screen backlight controllers
9068under GNU/Linux. Features include:
9069
9070@itemize
9071@item It does not rely on X.
9072@item Light can automatically figure out the best controller to use, making
9073full use of underlying hardware.
9074@item It is possible to set a minimum brightness value, as some controllers
9075set the screen to be pitch black at a value of 0 (or higher).
9076@end itemize\n")
9077 (license license:gpl3+)))
9078
9079(define-public brightnessctl
9080 (package
9081 (name "brightnessctl")
9082 (version "0.5.1")
9083 (home-page "https://github.com/Hummer12007/brightnessctl")
9084 (source (origin
9085 (method git-fetch)
9086 (uri (git-reference (url home-page) (commit version)))
9087 (file-name (git-file-name name version))
9088 (sha256
9089 (base32
9090 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
9091 (patches (search-patches "brightnessctl-elogind-support.patch"))))
9092 (build-system gnu-build-system)
9093 (arguments
9094 `(#:tests? #f ; no tests
9095 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9096 (string-append "PREFIX=" %output)
9097 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
9098 "ENABLE_SYSTEMD=1")
9099 #:phases
9100 (modify-phases %standard-phases
9101 (delete 'configure)
9102 (add-after 'unpack 'adjust-udev-rules
9103 (lambda _
9104 (substitute* "Makefile"
9105 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
9106 (substitute* "90-brightnessctl.rules"
9107 (("/bin/") "/run/current-system/profile/bin/"))
9108 #t)))))
9109 (native-inputs
9110 (list pkg-config))
9111 (inputs
9112 (list elogind))
9113 (synopsis "Backlight and LED brightness control")
9114 (description
9115 "This program allows you read and control device brightness. Devices
9116include backlight and LEDs. It can also preserve current brightness before
9117applying the operation, such as on lid close.
9118
9119The appropriate permissions must be set on the backlight or LED control
9120interface in sysfs, which can be accomplished with the included udev rules.")
9121 (license license:expat)))
9122
9123(define-public tlp
9124 (package
9125 (name "tlp")
9126 (version "1.8.0")
9127 (source
9128 (origin
9129 (method git-fetch)
9130 (uri (git-reference
9131 (url "https://github.com/linrunner/TLP")
9132 (commit version)))
9133 (file-name (git-file-name name version))
9134 (sha256
9135 (base32 "0r8r95wjb1sl5v8mli7kba2py9hc0ps915fx4lap5pg108ik9a06"))))
9136 (native-inputs
9137 (list shellcheck))
9138 (inputs
9139 `(("dbus" ,dbus)
9140 ("ethtool" ,ethtool)
9141 ("eudev" ,eudev)
9142 ("grep" ,grep)
9143 ("guile" ,guile-3.0) ;for wrap-script
9144 ("hdparm" ,hdparm)
9145 ("inetutils" ,inetutils)
9146 ("iw" ,iw)
9147 ("kmod" ,kmod)
9148 ("pciutils" ,pciutils)
9149 ("perl" ,perl)
9150 ("rfkill" ,rfkill)
9151 ("sed" ,sed)
9152 ("usbutils" ,usbutils)
9153 ("util-linux" ,util-linux)
9154 ("wireless-tools" ,wireless-tools)
9155 ,@(if (let ((system (or (%current-target-system)
9156 (%current-system))))
9157 (or (string-prefix? "i686-" system)
9158 (string-prefix? "x86_64-" system)))
9159 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
9160 '())))
9161 (build-system gnu-build-system)
9162 (arguments
9163 ;; XXX: The full test suite is run with "checkall" but it requires
9164 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
9165 (list
9166 #:make-flags
9167 #~(list "TLP_CONFUSR=/etc/tlp.conf" "TLP_CONFDIR=/etc/tlp.d")
9168 #:test-target "shellcheck"
9169 #:modules '((guix build gnu-build-system)
9170 (guix build utils)
9171 (srfi srfi-1))
9172 #:phases
9173 #~(modify-phases %standard-phases
9174 (delete 'configure) ; no configure script
9175 (add-before 'build 'setenv
9176 (lambda _
9177 (setenv "TLP_WITH_SYSTEMD" "0")
9178 (setenv "TLP_NO_INIT" "1")))
9179 (add-before 'build 'fix-installation
9180 (lambda _
9181 ;; Stop the Makefile from trying to create system directories.
9182 (substitute* "Makefile"
9183 (("= /usr") (string-append "= " #$output))
9184 (("= /etc") (string-append "= " #$output "/etc"))
9185 (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
9186 (add-before 'build 'fix-perl-calls
9187 ;; Shell scripts in "bat.d" and "func.d" call "perl". Fix
9188 ;; invocation without wrapping every one of them.
9189 (lambda* (#:key inputs #:allow-other-keys)
9190 (substitute* (append (find-files "bat.d" ".")
9191 (find-files "func.d" "."))
9192 (("(^|[^/])perl" _ prefix)
9193 (string-append prefix
9194 (search-input-file inputs "bin/perl"))))))
9195 (replace 'install
9196 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
9197 (add-after 'install 'wrap
9198 (lambda* (#:key inputs outputs #:allow-other-keys)
9199 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
9200 (sbin (string-append (assoc-ref outputs "out") "/sbin"))
9201 ;; Used to ignore symlinks which don't need wrapping
9202 (regular-file-predicate
9203 (lambda (file stat) (eq? 'regular (stat:type stat))))
9204 (bin-files (find-files bin regular-file-predicate))
9205 (sbin-files (find-files sbin regular-file-predicate)))
9206 (define (bin-directory input-name)
9207 (let ((p (assoc-ref inputs input-name)))
9208 (and p (string-append p "/bin"))))
9209 (define (sbin-directory input-name)
9210 (string-append (assoc-ref inputs input-name) "/sbin"))
9211 (for-each (lambda (program)
9212 ;; Programs rely on $0 so we use wrap-script
9213 ;; instead of wrap-program
9214 (wrap-script program
9215 `("PATH" ":" prefix
9216 ,(append
9217 (filter-map bin-directory
9218 '("bash"
9219 "coreutils"
9220 "dbus"
9221 "eudev"
9222 "grep"
9223 "inetutils"
9224 "kmod"
9225 "perl"
9226 "sed"
9227 "usbutils"
9228 "util-linux"
9229 "x86-energy-perf-policy"))
9230 (filter-map sbin-directory
9231 '("ethtool"
9232 "hdparm"
9233 "iw"
9234 "pciutils"
9235 "rfkill"
9236 "wireless-tools"))))))
9237 (append bin-files sbin-files))))))))
9238 (home-page "https://linrunner.de/en/tlp/tlp.html")
9239 (synopsis "Power management tool for Linux")
9240 (description "TLP is a power management tool for Linux. It comes with
9241a default configuration already optimized for battery life. Nevertheless,
9242TLP is customizable to fulfil system requirements. TLP settings are applied
9243every time the power supply source is changed.")
9244 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
9245 ;; rest is GPLv2+.
9246 (license (list license:gpl2+ license:gpl3+))))
9247
9248(define-public tlpui
9249 (package
9250 (name "tlpui")
9251 (version "1.8.0")
9252 (source
9253 (origin
9254 (method git-fetch)
9255 (uri (git-reference
9256 (url "https://github.com/d4nj1/TLPUI")
9257 (commit (string-append "tlpui-" version))))
9258 (file-name (git-file-name name version))
9259 (sha256
9260 (base32 "1q33p4gf5ii53wlgs61gghqxp3js5c45pn5nlibg2ygw069225r5"))))
9261 (build-system pyproject-build-system)
9262 (arguments
9263 (list
9264 #:phases
9265 #~(modify-phases %standard-phases
9266 (add-after 'unpack 'set-absolute-locations
9267 (lambda* (#:key inputs #:allow-other-keys)
9268 (let ((defaults.conf
9269 (search-input-file inputs "/share/tlp/defaults.conf"))
9270 (lspci (search-input-file inputs "/bin/lspci"))
9271 (lsusb (search-input-file inputs "/bin/lsusb"))
9272 (tlp-stat (search-input-file inputs "/bin/tlp-stat")))
9273 (with-directory-excursion "tlpui"
9274 (substitute* '("file.py" "settingshelper.py" "statui.py")
9275 (("\"tlp-stat\"")
9276 (string-append "'" tlp-stat "'"))
9277 (("/usr/share/tlp/defaults.conf")
9278 defaults.conf))
9279 (substitute* "ui_config_objects/gtkusblist.py"
9280 (("\"lsusb\"")
9281 (string-append "'" lsusb "'")))
9282 (substitute* "ui_config_objects/gtkpcilist.py"
9283 (("\"lspci\"")
9284 (string-append "'" lspci "'")))
9285 ;; Settings check if various tlp executables, lspci and
9286 ;; usbutils are available. Skip this phase since we know
9287 ;; for sure they are (and it avoids patching each location).
9288 (substitute* "settingshelper.py"
9289 (("(command_exists = ).*" _ lead)
9290 (string-append lead "True\n")))))))
9291 (add-after 'install 'install-desktop-file
9292 (lambda _
9293 (let ((dir (string-append #$output "/share/applications")))
9294 (install-file "tlpui.desktop" dir))))
9295 (add-after 'wrap 'wrap-gi-python
9296 (lambda _
9297 (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
9298 (wrap-program (string-append #$output "/bin/tlpui")
9299 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
9300 (native-inputs
9301 (list `(,glib "bin")
9302 gobject-introspection
9303 python-poetry-core
9304 python-pytest
9305 python-pyyaml))
9306 (inputs
9307 (list gtk+
9308 pciutils
9309 python-pygobject
9310 tlp
9311 usbutils))
9312 (propagated-inputs (list (librsvg-for-system)))
9313 (home-page "https://github.com/d4nj1/TLPUI")
9314 (synopsis "User interface for TLP written in Python")
9315 (description
9316 "The Python scripts in this project generate a GTK-UI to change
9317TLP configuration files easily. It aims to protect users from setting
9318bad configuration and to deliver a basic overview of all the valid
9319configuration values.")
9320 (license license:gpl2+)))
9321
9322(define-public lshw
9323 (package
9324 (name "lshw")
9325 (version "B.02.19.2")
9326 (source (origin
9327 (method url-fetch)
9328 (uri (string-append "https://www.ezix.org/software/"
9329 "files/lshw-" version
9330 ".tar.gz"))
9331 (sha256
9332 (base32
9333 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
9334 (build-system gnu-build-system)
9335 (arguments
9336 `(#:phases (modify-phases %standard-phases (delete 'configure))
9337 #:tests? #f ; no tests
9338 #:make-flags
9339 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
9340 (synopsis "List hardware information")
9341 (description
9342 "@command{lshw} (Hardware Lister) is a small tool to provide
9343detailed information on the hardware configuration of the machine.
9344It can report exact memory configuration, firmware version, mainboard
9345configuration, CPU version and speed, cache configuration, bus speed,
9346and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
9347machines (PowerMac G4 is known to work).")
9348 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
9349 (license license:gpl2+)))
9350
9351(define-public libmnl
9352 (package
9353 (name "libmnl")
9354 (version "1.0.5")
9355 (source
9356 (origin
9357 (method url-fetch)
9358 (uri (string-append "mirror://netfilter.org/libmnl/"
9359 "libmnl-" version ".tar.bz2"))
9360 (sha256
9361 (base32
9362 "09851ns07399rbz0y8slrlmnw3fn1nakr8d37pxjn5gkks8rnjr7"))))
9363 (build-system gnu-build-system)
9364 (home-page "https://www.netfilter.org/projects/libmnl/")
9365 (synopsis "Netlink utility library")
9366 (description "Libmnl is a minimalistic user-space library oriented to
9367Netlink developers. There are a lot of common tasks in parsing, validating,
9368constructing of both the Netlink header and TLVs that are repetitive and easy to
9369get wrong. This library aims to provide simple helpers that allows you to
9370re-use code and to avoid re-inventing the wheel.")
9371 (properties
9372 '((release-monitoring-url . "https://www.netfilter.org/pub/libmnl/")))
9373 (license license:lgpl2.1+)))
9374
9375(define-public libnftnl
9376 (package
9377 (name "libnftnl")
9378 (version "1.2.8")
9379 (source
9380 (origin
9381 (method url-fetch)
9382 (uri (string-append "mirror://netfilter.org/libnftnl/"
9383 "libnftnl-" version ".tar.xz"))
9384 (sha256
9385 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9386 (build-system gnu-build-system)
9387 (native-inputs
9388 (list pkg-config))
9389 (inputs
9390 (list libmnl))
9391 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
9392 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
9393 (description "Libnftnl is a userspace library providing a low-level netlink
9394programming interface to the in-kernel nf_tables subsystem. The library
9395libnftnl has been previously known as libnftables. This library is currently
9396used by nftables.")
9397 (license license:gpl2+)))
9398
9399;;; The symbol libnftl/fixed should be used when libnftnl needs fixes
9400;;; (security or else) and this deprecation could be removed.
9401(define-deprecated/public-alias libnftnl/fixed libnftnl/pinned)
9402
9403;; This is used in iptables, which contributes to rust. We're pinning this
9404;; variant to avoid accidental rebuilds of rust.
9405(define-public libnftnl/pinned
9406 (package
9407 (inherit libnftnl)
9408 (version "1.2.8")
9409 (source
9410 (origin
9411 (method url-fetch)
9412 (uri (string-append "mirror://netfilter.org/libnftnl/"
9413 "libnftnl-" version ".tar.xz"))
9414 (sha256
9415 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9416 (build-system gnu-build-system)
9417 (native-inputs
9418 (list pkg-config))
9419 (inputs
9420 (list libmnl))))
9421
9422(define-public nftables
9423 (package
9424 (name "nftables")
9425 (version "1.0.8")
9426 (source
9427 (origin
9428 (method url-fetch)
9429 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
9430 version ".tar.xz")
9431 (string-append "https://www.nftables.org/projects/nftables"
9432 "/files/nftables-" version ".tar.xz")))
9433 (sha256
9434 (base32 "0l1xpwr9qfbl3bxa97v8s2lbibiz0xma9q0qi34xp0hswh6p8wwk"))))
9435 (build-system gnu-build-system)
9436 (arguments `(#:configure-flags
9437 '("--disable-static"
9438 "--with-cli=readline"
9439 "--with-json")
9440 #:phases
9441 (modify-phases %standard-phases
9442 (add-before 'configure 'autoreconf
9443 (lambda _
9444 (invoke "autoreconf" "-fi"))))))
9445 (inputs (list gmp libmnl libnftnl readline jansson))
9446 (native-inputs (list pkg-config
9447 bison
9448 flex
9449 docbook2x
9450 autoconf
9451 automake
9452 libtool))
9453 (home-page "https://www.nftables.org")
9454 (synopsis "Userspace utility for Linux packet filtering")
9455 (description "nftables is the project that aims to replace the existing
9456{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
9457filtering framework, a new userspace utility and also a compatibility layer for
9458{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
9459infrastructure such as the existing hooks, the connection tracking system, the
9460userspace queueing component and the logging subsystem.")
9461 (license license:gpl2)))
9462
9463(define-public libnetfilter-conntrack
9464 (package
9465 (name "libnetfilter-conntrack")
9466 (version "1.0.9")
9467 (source
9468 (origin
9469 (method url-fetch)
9470 (uri (string-append "https://netfilter.org/projects/"
9471 "libnetfilter_conntrack/files/"
9472 "libnetfilter_conntrack-"
9473 version ".tar.bz2"))
9474 (sha256
9475 (base32 "1a3rnpsba64dzy97wwjrxal89wr0nf9znvag2j18nkp3kzs9vgb7"))))
9476 (build-system gnu-build-system)
9477 (native-inputs (list pkg-config))
9478 (inputs (list libnfnetlink libmnl))
9479 (synopsis "Library for kernel connection tracking state table")
9480 (description "libnetfilter_conntrack is a userspace library providing a
9481programming interface (API) to the in-kernel connection tracking state table.
9482The library libnetfilter_conntrack has been previously known as
9483libnfnetlink_conntrack and libctnetlink. This library is currently used by
9484conntrack-tools among many other applications.")
9485 (home-page "https://netfilter.org/projects/libnetfilter_conntrack/index.html")
9486 (supported-systems (filter target-linux? %supported-systems))
9487 (properties '((upstream-name . "libnetfilter_conntrack")))
9488 (license license:gpl2+)))
9489
9490(define-public libnetfilter-cttimeout
9491 (package
9492 (name "libnetfilter-cttimeout")
9493 (version "1.0.1")
9494 (source
9495 (origin
9496 (method url-fetch)
9497 (uri (string-append "https://netfilter.org/projects/"
9498 "libnetfilter_cttimeout/files/"
9499 "libnetfilter_cttimeout-" version ".tar.bz2"))
9500 (sha256
9501 (base32 "0983cpyvxyycbnzqlrzml80pph2z51r6s7sxp06ciq8468pxln8b"))))
9502 (build-system gnu-build-system)
9503 (native-inputs (list pkg-config))
9504 (inputs (list libmnl))
9505 (synopsis "Library for kernel connection tracking timeout infrastructure")
9506 (description "libnetfilter_cttimeout is the userspace library that
9507provides the programming interface to the fine-grain connection tracking
9508timeout infrastructure. With this library, you can create, update and delete
9509timeout policies that can be attached to traffic flows. This library is used
9510by conntrack-tools.")
9511 (home-page "https://netfilter.org/projects/libnetfilter_cttimeout/index.html")
9512 (supported-systems (filter target-linux? %supported-systems))
9513 (properties '((upstream-name . "libnetfilter_cttimeout")))
9514 (license license:gpl2)))
9515
9516(define-public libnetfilter-cthelper
9517 (package
9518 (name "libnetfilter-cthelper")
9519 (version "1.0.1")
9520 (source
9521 (origin
9522 (method url-fetch)
9523 (uri (string-append "https://netfilter.org/projects/"
9524 "libnetfilter_cthelper/files/"
9525 "libnetfilter_cthelper-" version ".tar.bz2"))
9526 (sha256
9527 (base32 "04n95ngil5l8m8v64dfjm1dwq0wd3kf4vw1zblsrff13hxa3s1ql"))))
9528 (build-system gnu-build-system)
9529 (native-inputs (list pkg-config))
9530 (inputs (list libmnl))
9531 (synopsis "Library for user-space connection tracking helpers")
9532 (description "libnetfilter_cthelper is a userspace library that provides a
9533programming interface to user-space connection tracking helpers.
9534@enumerate
9535@item
9536register new user-space connection tracking helpers
9537@item
9538unregister user-space connection tracking helpers
9539@item
9540list existing registered user-space connection tracking helpers
9541@end enumerate")
9542 (home-page "https://netfilter.org/projects/libnetfilter_cthelper/index.html")
9543 (supported-systems (filter target-linux? %supported-systems))
9544 (properties '((upstream-name . "libnetfilter_cthelper")))
9545 (license license:gpl2+)))
9546
9547(define-public libnetfilter-queue
9548 (package
9549 (name "libnetfilter-queue")
9550 (version "1.0.5")
9551 (source
9552 (origin
9553 (method url-fetch)
9554 (uri (string-append "https://netfilter.org/projects/"
9555 "libnetfilter_queue/files/"
9556 "libnetfilter_queue-" version ".tar.bz2"))
9557 (sha256
9558 (base32
9559 "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr"))))
9560 (build-system gnu-build-system)
9561 (native-inputs (list pkg-config))
9562 (inputs (list libmnl libnfnetlink))
9563 (synopsis "Library for kernel netfilter infrastructure and state")
9564 (description "libnetfilter_queue is a userspace library providing an API
9565to packets that have been queued by the kernel packet filter. It is is part
9566of a system that deprecates the old ip_queue/libipq mechanism.")
9567 (home-page "https://netfilter.org/projects/libnetfilter_queue/index.html")
9568 (supported-systems (filter target-linux? %supported-systems))
9569 (properties '((upstream-name . "libnetfilter_queue")))
9570 (license license:gpl2+)))
9571
9572(define-public conntrack-tools
9573 (package
9574 (name "conntrack-tools")
9575 (version "1.4.8")
9576 (source
9577 (origin
9578 (method url-fetch)
9579 (uri (string-append "https://netfilter.org/projects/"
9580 "conntrack-tools/files/"
9581 "conntrack-tools-" version ".tar.xz"))
9582 (sha256
9583 (base32 "1mnynl5a63j25arapwvkjbm3a2cqm3aaklwfwwclhmpnqps7fxh6"))))
9584 (build-system gnu-build-system)
9585 (native-inputs (list bison flex pkg-config))
9586 (inputs (list libtirpc
9587 libnetfilter-conntrack
9588 libnetfilter-cttimeout
9589 libnetfilter-cthelper
9590 libnetfilter-queue
9591 libnfnetlink
9592 libmnl))
9593 (synopsis "Set of tools targeting the conntrack kernel subsystem")
9594 (description "The tool conntrack provides a full featured interface that
9595is intended to replace the old @file{/proc/net/ip_conntrack} interface. Using
9596conntrack, you can view and manage the in-kernel connection tracking state
9597table from userspace. On the other hand, conntrackd covers the specific
9598aspects of stateful firewalls to enable highly available scenarios, and can be
9599used as statistics collector as well.
9600
9601Since 1.2.0, the conntrack-tools includes the @command{nfct} command line
9602utility. This utility only supports the nfnetlink_cttimeout by now. In the
9603long run, we expect that it will replace conntrack by providing a syntax
9604similar to nftables.")
9605 (home-page "https://netfilter.org/projects/conntrack-tools/index.html")
9606 (supported-systems (filter target-linux? %supported-systems))
9607 (license license:gpl2+)))
9608
9609(define-public libnetfilter-acct
9610 (package
9611 (name "libnetfilter-acct")
9612 (version "1.0.3")
9613 (source
9614 (origin
9615 (method url-fetch)
9616 (uri (string-append "https://netfilter.org/projects/"
9617 "libnetfilter_acct/files/"
9618 "libnetfilter_acct-" version ".tar.bz2"))
9619 (sha256
9620 (base32
9621 "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22"))))
9622 (build-system gnu-build-system)
9623 (native-inputs (list pkg-config))
9624 (inputs (list libmnl))
9625 (synopsis "Library providing interface to extended accounting infrastructure")
9626 (description "libnetfilter_acct is the userspace library providing interface
9627to extended accounting infrastructure.
9628
9629@enumerate
9630@item
9631creating accounting objects
9632@item
9633retrieving accounting objects (and atomically set to zero)
9634@item
9635deleting accounting objects
9636@end enumerate
9637For the nfnetlink_acct subsystem.")
9638 (home-page "https://netfilter.org/projects/libnetfilter_acct/index.html")
9639 (supported-systems (filter target-linux? %supported-systems))
9640 (properties '((upstream-name . "libnetfilter_acct")))
9641 (license license:lgpl2.1+)))
9642
9643(define-public nfacct
9644 (package
9645 (name "nfacct")
9646 (version "1.0.2")
9647 (source
9648 (origin
9649 (method url-fetch)
9650 (uri (string-append "https://netfilter.org/projects/" name
9651 "/files/nfacct-" version ".tar.bz2"))
9652 (sha256
9653 (base32
9654 "0sdxbxjyapbqcp2ami5jd10vz4xbbdvx39f3wfy1iqsbflc25zzc"))))
9655 (build-system gnu-build-system)
9656 (native-inputs (list pkg-config))
9657 (inputs (list libmnl libnetfilter-acct))
9658 (synopsis "Command line tool to create/retrieve/delete accounting objects")
9659 (description "nfacct is the command line tool to create/retrieve/delete
9660accounting objects
9661@enumerate
9662@item
9663listing the objects of the nfacct table in plain text/XML
9664@item
9665atomically get and reset objects of the nfacct table
9666@item
9667adding new objects to the nfacct table
9668@item
9669deleting objects from the nfacct table
9670@end enumerate")
9671 (home-page "https://netfilter.org/projects/nfacct/index.html")
9672 (supported-systems (filter target-linux? %supported-systems))
9673 (license license:gpl2+)))
9674
9675(define-public libnetfilter-log
9676 (package
9677 (name "libnetfilter-log")
9678 (version "1.0.2")
9679 (source
9680 (origin
9681 (method url-fetch)
9682 (uri (string-append "https://netfilter.org/projects/"
9683 "libnetfilter_log/files/"
9684 "libnetfilter_log-" version ".tar.bz2"))
9685 (sha256
9686 (base32
9687 "1spy9xs41v76kid5ana8n126f3mvgq6fjibbfbj4kn0larbhix73"))))
9688 (build-system gnu-build-system)
9689 (native-inputs (list pkg-config))
9690 (inputs (list libnfnetlink libmnl))
9691 (synopsis "Library providing interface to packets logged by netfilter")
9692 (description "libnetfilter_log is a userspace library providing interface to
9693packets that have been logged by the kernel packet filter. It is is part of a
9694system that deprecates the old syslog/dmesg based packet logging. This library
9695has been previously known as libnfnetlink_log.
9696
9697@enumerate
9698@item
9699receiving to-be-logged packets from the kernel nfnetlink_log subsystem
9700@end enumerate")
9701 (home-page "https://netfilter.org/projects/libnetfilter_log/index.html")
9702 (supported-systems (filter target-linux? %supported-systems))
9703 (properties '((upstream-name . "libnetfilter_log")))
9704 (license license:gpl2+)))
9705
9706(define-public ulogd
9707 (package
9708 (name "ulogd")
9709 (version "2.0.7")
9710 (source
9711 (origin
9712 (method url-fetch)
9713 (uri (string-append "https://netfilter.org/projects/" name
9714 "/files/ulogd-" version ".tar.bz2"))
9715 (sha256
9716 (base32
9717 "0ax9959c4bapq78n13bbaibcf1gwjir3ngx8l2dh45lw9m4ha2lr"))))
9718 (build-system gnu-build-system)
9719 (outputs '("out"
9720 ;; additional non-default output plugins
9721 "json" "pcap" "sqlite3" "pgsql" "mysql"))
9722 (native-inputs (list pkg-config))
9723 (inputs (list libnfnetlink
9724 libmnl
9725 libnetfilter-log
9726 libnetfilter-conntrack
9727 libnetfilter-acct
9728 sqlite
9729 libpcap
9730 jansson
9731 postgresql
9732 (list mariadb "dev")
9733 zlib
9734 openssl))
9735 (arguments
9736 (list #:configure-flags
9737 #~(list (string-append "--with-pgsql="
9738 (assoc-ref %build-inputs "postgresql"))
9739 (string-append "--with-mysql="
9740 (assoc-ref %build-inputs "mariadb")))
9741 #:phases
9742 #~(modify-phases %standard-phases
9743 (add-after 'install 'install-doc
9744 (lambda _
9745 (let ((out-etc (string-append #$output "/etc"))
9746 (ulogd.conf "ulogd.conf"))
9747 (mkdir-p out-etc)
9748 (copy-file ulogd.conf (string-append out-etc "/"
9749 ulogd.conf)))))
9750 (add-after 'install 'setup-plugin-outputs
9751 (lambda* (#:key outputs #:allow-other-keys)
9752 (with-directory-excursion
9753 (string-append #$output "/lib/ulogd/")
9754 (for-each
9755 (lambda (output-name)
9756 (let ((output-dir (string-append
9757 (assoc-ref outputs output-name)
9758 "/lib/ulogd/")))
9759 (mkdir-p output-dir)
9760 (for-each
9761 (lambda (plugin)
9762 (copy-file plugin (string-append output-dir plugin))
9763 (delete-file plugin))
9764 (find-files "."
9765 (string-append "ulogd_output_"
9766 (string-upcase output-name)
9767 ".*$")))))
9768 (list "json" "pcap" "sqlite3" "pgsql" "mysql"))))))))
9769 (synopsis "Logging daemon for netfilter and iptables")
9770 (description "ulogd is a userspace logging daemon for netfilter/iptables
9771related logging. This includes per-packet logging of security violations,
9772per-packet logging for accounting, per-flow logging and flexible user-defined
9773accounting.
9774
9775@enumerate
9776@item
9777Packet and flow-based traffic accounting
9778@item
9779Flexible user-defined traffic accounting via nfacct infrastructure
9780@item
9781SQL database back-end support: SQLite3, PostgreSQL, MySQL
9782@item
9783Text-based output formats: CSV, XML, Netfilter's LOG, Netfilter's conntrack
9784@end enumerate")
9785 (home-page "https://netfilter.org/projects/nfacct/index.html")
9786 (supported-systems (filter target-linux? %supported-systems))
9787 (license license:gpl2)))
9788
9789(define-public proot
9790 (package
9791 (name "proot")
9792 (version "5.4.0")
9793 (source
9794 (origin
9795 (method git-fetch)
9796 (uri (git-reference
9797 (url "https://github.com/proot-me/PRoot")
9798 (commit (string-append "v" version))))
9799 (file-name (git-file-name name version))
9800 (sha256
9801 (base32 "186qsg4yvisqjgf8w5jxhnlig7x341vpqwcgp8as3r59qmqkpmk7"))
9802 ;; Waiting for upstream inclusion at
9803 ;; https://github.com/proot-me/proot/pull/355
9804 (patches (search-patches "proot-add-clone3.patch"
9805 "proot-add-missing-include.patch"))))
9806 (build-system gnu-build-system)
9807 ;; Many architectures are not supported (see:
9808 ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
9809 (supported-systems '("x86_64-linux" "i686-linux"
9810 "armhf-linux" "aarch64-linux" "i586-gnu" "x86_64-gnu"))
9811 (arguments
9812 ;; Disable the test suite on armhf-linux, as there are too many
9813 ;; failures to keep track of (see for example:
9814 ;; https://github.com/proot-me/proot/issues/286).
9815 `(#:tests? ,(not (or (%current-target-system)
9816 (string-prefix? "armhf"
9817 (or (%current-system)))))
9818 #:make-flags '("-C" "src")
9819 #:phases (modify-phases %standard-phases
9820 (add-after 'unpack 'patch-sources
9821 (lambda* (#:key inputs #:allow-other-keys)
9822 (substitute* (find-files "src" "\\.[ch]$")
9823 (("\"/bin/sh\"")
9824 (string-append "\"" (assoc-ref inputs "bash")
9825 "/bin/sh\"")))
9826
9827 (substitute* "src/GNUmakefile"
9828 (("/bin/echo") (which "echo"))
9829 (("^VERSION = .*")
9830 (string-append "VERSION := " ,version "\n")))
9831
9832 (substitute* (find-files "test" "\\.sh$")
9833 ;; Some of the tests try to "bind-mount" /bin/true.
9834 (("-b /bin/true:")
9835 (string-append "-b " (which "true") ":"))
9836 ;; Likewise for /bin.
9837 (("-b /bin:") "-b /gnu:")
9838 ;; Others try to run /bin/sh.
9839 (("/bin/sh") (which "sh"))
9840 ;; Others assume /etc/fstab exists.
9841 (("/etc/fstab") "/etc/passwd"))
9842 (substitute* "test/GNUmakefile"
9843 (("-b /bin:") "-b /gnu:"))
9844 (substitute* "test/test-c6b77b77.mk"
9845 (("/bin/bash") (which "bash"))
9846 (("/usr/bin/test") (which "test")))
9847 (substitute* "test/test-16573e73.c"
9848 (("/bin/([a-z-]+)" _ program)
9849 (which program)))
9850 (substitute* "test/test-5467b986.sh"
9851 (("-w /usr") "-w /gnu")
9852 (("-w usr") "-w gnu")
9853 (("/usr/share") "/gnu/store")
9854 (("share") "store"))
9855 (substitute* "test/test-092c5e26.sh"
9856 (("-q echo ")
9857 "-q $(which echo) "))
9858
9859 ;; The socket tests requires networking.
9860 (for-each delete-file
9861 (find-files "test" "test-socket.*\\.sh$"))))
9862 (delete 'configure)
9863 (add-after 'build 'build-manpage
9864 (lambda _
9865 (with-directory-excursion "doc"
9866 (invoke "make" "proot/man.1" "SUFFIX=.py"))))
9867 (replace 'check
9868 (lambda* (#:key tests? #:allow-other-keys)
9869 (when tests?
9870 (let ((n (parallel-job-count)))
9871 ;; Most of the tests expect "/bin" to be in $PATH so
9872 ;; they can run things that live in $ROOTFS/bin.
9873 (setenv "PATH"
9874 (string-append (getenv "PATH") ":/bin"))
9875 (invoke "make" "check" "-C" "test"
9876 ;;"V=1"
9877 "-j" (number->string n))))))
9878 (replace 'install
9879 (lambda* (#:key outputs #:allow-other-keys)
9880 ;; The 'install' rule does nearly nothing.
9881 (let* ((out (assoc-ref outputs "out"))
9882 (man1 (string-append out "/share/man/man1")))
9883 ;; TODO: 'make install-care' (does not even
9884 ;; build currently.)
9885 (invoke "make" "-C" "src" "install"
9886 (string-append "PREFIX=" out))
9887 (mkdir-p man1)
9888 (copy-file "doc/proot/man.1"
9889 (string-append man1 "/proot.1"))))))))
9890 (native-inputs (list which
9891 ;; For 'mcookie', used by some of the tests.
9892 util-linux
9893 coreutils
9894 pkg-config
9895 ;; For rst2man, used to generate the manual page.
9896 python-docutils-0.19))
9897 (inputs (list libarchive talloc))
9898 (home-page "https://github.com/proot-me/PRoot")
9899 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
9900 (description
9901 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
9902and @code{binfmt_misc}. This means that users don't need any privileges or
9903setup to do things like using an arbitrary directory as the new root
9904file system, making files accessible somewhere else in the file system
9905hierarchy, or executing programs built for another CPU architecture
9906transparently through QEMU user-mode. Also, developers can use PRoot as a
9907generic process instrumentation engine thanks to its extension mechanism.
9908Technically PRoot relies on @code{ptrace}, an unprivileged system-call
9909available in the kernel Linux.")
9910 (license license:gpl2+)))
9911
9912(define-public proot-static
9913 (package
9914 (inherit proot)
9915 (name "proot-static")
9916 (synopsis
9917 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
9918 (inputs `(("talloc" ,talloc/static)))
9919 (arguments
9920 (substitute-keyword-arguments (package-arguments proot)
9921 ((#:make-flags flags)
9922 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
9923 ((#:phases phases)
9924 `(modify-phases ,phases
9925 (add-after 'strip 'remove-store-references
9926 (lambda* (#:key outputs #:allow-other-keys)
9927 (let* ((out (assoc-ref outputs "out")))
9928 (with-directory-excursion out
9929 (remove-store-references "bin/proot")
9930 #t))))))
9931 ((#:allowed-references _ '("out"))
9932 '("out"))))))
9933
9934(define-public cpuid
9935 (package
9936 (name "cpuid")
9937 (version "20230614")
9938 (source (origin
9939 (method url-fetch)
9940 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
9941 version ".src.tar.gz"))
9942 (sha256
9943 (base32
9944 "1s54qc1j10d765r05kw9pzwzaxq2b0nndq2ifwq7cq62xx2k1j5i"))))
9945 (build-system gnu-build-system)
9946 (arguments
9947 (list #:make-flags
9948 #~(list (string-append "CC=" #$(cc-for-target)))
9949 #:tests? #f ; no tests
9950 #:phases
9951 #~(modify-phases %standard-phases
9952 (delete 'configure) ; no configure script
9953 (add-before 'install 'fix-makefile
9954 (lambda* (#:key outputs #:allow-other-keys)
9955 (substitute* "Makefile"
9956 (("\\$\\(BUILDROOT\\)/usr")
9957 (assoc-ref outputs "out"))))))))
9958 (inputs (list perl))
9959 (supported-systems '("i686-linux" "x86_64-linux"))
9960 (home-page "https://www.etallen.com/cpuid.html")
9961 (synopsis "Dump x86 CPUID processor information")
9962 (description "cpuid dumps detailed information about the CPU(s) gathered
9963from the CPUID instruction, and also determines the exact model of CPU(s). It
9964supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
9965NexGen, Rise, and SiS CPUs.")
9966 (license license:gpl2+)))
9967
9968(define-public jmtpfs
9969 (package
9970 (name "jmtpfs")
9971 (version "0.5")
9972 (source
9973 (origin
9974 (method git-fetch)
9975 (uri (git-reference
9976 (url "https://github.com/JasonFerrara/jmtpfs")
9977 (commit (string-append "v" version))))
9978 (file-name (git-file-name name version))
9979 (sha256
9980 (base32
9981 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
9982 (build-system gnu-build-system)
9983 (inputs
9984 (list file fuse-2 libmtp))
9985 (native-inputs
9986 (list pkg-config))
9987 (home-page "https://github.com/JasonFerrara/jmtpfs")
9988 (synopsis "Use a FUSE file system to access data over MTP")
9989 (description "jmtpfs uses @acronym{FUSE, File system in USEr space} to
9990provide access to data over @acronym{MTP, the Media Transfer Protocol}.
9991Unprivileged users can mount the MTP device as a file system.")
9992 (license license:gpl3)))
9993
9994(define-public procenv
9995 (package
9996 (name "procenv")
9997 (version "0.60")
9998 (source
9999 (origin
10000 (method git-fetch)
10001 (uri (git-reference
10002 (url "https://github.com/jamesodhunt/procenv")
10003 (commit version)))
10004 (file-name (git-file-name name version))
10005 (sha256
10006 (base32 "00d7q0h4qjc8lg435lq77lp2fx6ikm5piq90m81mr1dqqna1g6pz"))))
10007 (build-system gnu-build-system)
10008 (native-inputs
10009 (list pkg-config
10010 ;; For tests.
10011 check groff))
10012 (inputs
10013 (list expat libcap libselinux))
10014 (synopsis "Utility to show process environment")
10015 (description
10016 "Procenv is a command-line tool that displays as much detail about
10017itself and its environment as possible. It can be used as a test
10018tool, to understand the type of environment a process runs in, and for
10019comparing system environments.")
10020 (home-page "https://github.com/jamesodhunt/procenv/")
10021 (license license:gpl3+)))
10022
10023(define-public cassini-headers
10024 (package
10025 (name "cassini-headers")
10026 (version "12.0.1")
10027 (home-page "https://github.com/HewlettPackard/shs-cassini-headers")
10028 (source (origin
10029 (method git-fetch)
10030 (uri (git-reference
10031 (url home-page)
10032 (commit (string-append "release/shs-" version))))
10033 (file-name (git-file-name name version))
10034 (sha256
10035 (base32
10036 "0fvhk42pssw67zba4zq1b73d1m9ysc4g8sfibjmmhc0fwr92iamp"))))
10037 (build-system copy-build-system)
10038 (arguments
10039 (list #:install-plan
10040 #~'(("include" "include")
10041 ("share/cassini-headers" "share/cassini-headers"))))
10042 (synopsis "Cassini network hardware definitions and headers")
10043 (description
10044 "This package provides hardware definitions and C headers for use by
10045the Linux driver and by user-space applications for the Cassini/Slingshot
10046high-speed network interconnect made by HPE (formerly Cray). User-land
10047software uses @file{cxi_prov_hw.h} from this package.")
10048 ;; As per include/cxi_prov_hw.h it is __aarch64__ or __x86_64__ only.
10049 (supported-systems '("x86_64-linux" "aarch64-linux"))
10050 (license (list license:gpl2 license:bsd-2)))) ;dual-licensed
10051
10052(define-public cxi-driver
10053 (package
10054 (name "cxi-driver")
10055 (version "13.0.0")
10056 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10057 (source
10058 (origin
10059 (method git-fetch)
10060 (uri (git-reference
10061 (url home-page)
10062 (commit (string-append "release/shs-" version))))
10063 (file-name (git-file-name name version))
10064 (sha256
10065 (base32
10066 "1md6ammah7ywk5k9gsxix945w5498hpdfwzr603aiirlz2x4m4wh"))))
10067 ;; TODO: Actually build the Linux driver.
10068 (build-system copy-build-system)
10069 (arguments
10070 (list #:install-plan #~'(("include" "include"))))
10071 (propagated-inputs (list cassini-headers))
10072 (synopsis "Linux driver for the Cassini/Slingshot interconnect")
10073 (description
10074 "This is the Linux driver for the Cray/HPE Cassini 1 and 2 high-speed
10075network interconnect (aka. Slingshot), and its Ethernet driver. It includes
10076the @file{uapi/misc/cxi.h} C header file for use by user-land software.
10077
10078Currently the Linux driver itself is missing from this package.")
10079 (license license:gpl2+)))
10080
10081(define-public cxi-driver-for-libfabric-1
10082 ;; This old version defines constants such as 'CXI_MAP_IOVA_ALLOC' that
10083 ;; libfabric 1.22.0 relies on.
10084 (let ((commit "5f0ec0ead6ef3f98542a2ef5e76b89d14dd22150")
10085 (revision "0"))
10086 (package
10087 (inherit cxi-driver)
10088 (name "cxi-driver")
10089 (version (git-version "1.0.0" ;per .spec file
10090 revision commit))
10091 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10092 (source
10093 (origin
10094 (method git-fetch)
10095 (uri (git-reference (url home-page) (commit commit)))
10096 (file-name (git-file-name name version))
10097 (sha256
10098 (base32
10099 "19cly014ihgdidrc1aki2xsbfhpc0g73v0vxcky8r27xza7rz5bg")))))))
10100
10101(define-public libcxi
10102 (package
10103 (name "libcxi")
10104 (version "13.0.0")
10105 (home-page "https://github.com/HewlettPackard/shs-libcxi")
10106 (source
10107 (origin
10108 (method git-fetch)
10109 (uri (git-reference (url home-page)
10110 (commit (string-append "release/shs-" version))))
10111 (file-name (git-file-name name version))
10112 (sha256
10113 (base32 "1m8mds1h8plhfn2ja9br31xaiy82ky69685cp1rznanl18inaiff"))))
10114 (build-system gnu-build-system)
10115 (arguments
10116 (list #:configure-flags
10117 #~(list "--disable-static"
10118 (string-append "--with-udevrulesdir="
10119 #$output "/lib/udev/rules.d"))
10120
10121 #:phases
10122 #~(modify-phases %standard-phases
10123 (add-before 'configure 'set-cassini-file-names
10124 (lambda* (#:key inputs #:allow-other-keys)
10125 (substitute* "utils/cxi_dump_csrs.py"
10126 (("/usr/share/cassini-headers/csr_defs.json")
10127 (search-input-file
10128 inputs
10129 "/share/cassini-headers/csr_defs.json"))))))))
10130 (native-inputs (list autoconf
10131 automake
10132 libtool
10133 pkg-config
10134 python-wrapper))
10135 (inputs (list libconfig
10136 libuv
10137 fuse-2
10138 libyaml
10139 libnl
10140 numactl
10141 eudev
10142 (list lm-sensors "lib")))
10143 (propagated-inputs (list cassini-headers cxi-driver))
10144 (synopsis "Interface to the Cassini/Slingshot high-speed interconnect")
10145 (description
10146 "Libcxi provides applications with a low-level interface to the
10147Cray/HPE Cassini high-speed @acronym{NIC, network interface controller}, also
10148known as Slingshot.")
10149
10150 ;; License is spelled out in 'cray-libcxi.spec' and in source file
10151 ;; headers.
10152 (license (list license:lgpl2.1+ license:bsd-3)))) ;dual-licensed
10153
10154(define-public libfabric
10155 (package
10156 (name "libfabric")
10157 (version "2.3.1")
10158 (source
10159 (origin
10160 (method url-fetch)
10161 (uri
10162 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
10163 version "/libfabric-" version ".tar.bz2"))
10164 (sha256
10165 (base32 "0npkfkkhyir31r2p1zsfi7yrvcam60fp8ps4s2csjc2drqbrz4rf"))))
10166 (build-system gnu-build-system)
10167 (inputs
10168 (let ((if-supported ;XXX: modified from openmpi
10169 (lambda (package . extra)
10170 (if (and (not (%current-target-system))
10171 (member (%current-system)
10172 (package-transitive-supported-systems package)))
10173 (cons package extra)
10174 '()))))
10175 (append (list rdma-core libnl)
10176 (if-supported psm)
10177 (if-supported psm2)
10178 (if-supported libcxi curl json-c))))
10179 (arguments
10180 (list #:configure-flags
10181 #~(append (if #$(target-64bit?)
10182 (list "--enable-efa")
10183 '())
10184 (list #$@(if (this-package-input "libcxi")
10185 #~("--enable-cxi")
10186 #~())
10187 "--enable-verbs"))
10188 #:phases
10189 #~(modify-phases %standard-phases
10190 (add-after 'install 'remove-libtool-archive
10191 (lambda _
10192 ;; 'libfabric.la' has '-ljson-c' without a corresponding
10193 ;; '-L' in 'dependency_libs', which in turn causes users
10194 ;; such as Open MPI to fail at link time due to '-ljson-c'
10195 ;; not being found, even when building a shared library.
10196 ;; So, remove the .la file.
10197 (delete-file
10198 (string-append #$output
10199 "/lib/libfabric.la")))))))
10200 (home-page "https://ofiwg.github.io/libfabric/")
10201 (synopsis "Open Fabric Interfaces")
10202 (description
10203 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
10204communication services to applications. OFI is best described as a collection
10205of libraries and applications used to export fabric services. The key
10206components of OFI are: application interfaces, provider libraries, kernel
10207services, daemons, and test applications.
10208
10209Libfabric is a core component of OFI. It is the library that defines and
10210exports the user-space API of OFI, and is typically the only software that
10211applications deal with directly. It works in conjunction with provider
10212libraries, which are often integrated directly into libfabric.")
10213 (license (list license:bsd-2 license:gpl2)))) ;dual
10214
10215(define-public libfabric-1 ;needed by Open MPI 4.x
10216 (package
10217 (inherit libfabric)
10218 (version "1.22.0")
10219 (source
10220 (origin
10221 (method url-fetch)
10222 (uri
10223 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
10224 version "/libfabric-" version ".tar.bz2"))
10225 (sha256
10226 (base32 "1znmw83rmippv0fwz0x7lgylfk17dr9ckll8lrm4z7kclspnqpj8"))))
10227 (inputs
10228 (modify-inputs (package-inputs libfabric)
10229 (append cxi-driver-for-libfabric-1)))))
10230
10231(define-public psm
10232 (package
10233 (name "psm")
10234 (version "3.3.20170428")
10235 (home-page "https://github.com/intel/psm")
10236 (source
10237 (origin
10238 (method git-fetch)
10239 (uri (git-reference (url home-page)
10240 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
10241 (file-name (string-append "psm-" version ".tar.gz"))
10242 (sha256
10243 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
10244 (patches (search-patches
10245 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
10246 "psm-ldflags.patch" ; build shared lib with LDFLAGS
10247 "psm-repro.patch" ; reproducibility
10248 "psm-disable-memory-stats.patch"))
10249 (modules '((guix build utils)))
10250 (snippet
10251 ;; That file declares its own 'strlcat' as static. To avoid a
10252 ;; conflict with the function now in glibc 2.39, give it a
10253 ;; different name.
10254 #~(substitute* "ptl_ips/ips_proto_dump.c"
10255 (("strlcat")
10256 "psm_custom_strlcat")))))
10257 (build-system gnu-build-system)
10258 (outputs '("out" "debug"))
10259 (inputs `(("libuuid" ,util-linux "lib")))
10260 (arguments
10261 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
10262 ,(string-append "INSTALL_PREFIX=" %output)
10263 ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
10264 " -funwind-tables -O3 -g3"
10265 " -DPSM_USE_SYS_UUID"
10266 " -Wno-strict-aliasing -DNVALGRIND"
10267 " -fcommon")
10268 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
10269 #:tests? #f
10270 #:phases (modify-phases %standard-phases
10271 (delete 'configure)
10272 (add-after 'unpack 'patch-/usr/include
10273 (lambda _
10274 (substitute* "Makefile"
10275 (("\\$\\{DESTDIR}/usr/include")
10276 (string-append %output "/include")))
10277 (substitute* "Makefile"
10278 (("/lib64") "/lib"))
10279 #t))
10280 (add-after 'unpack 'patch-sysmacros
10281 (lambda _
10282 (substitute* "ipath/ipath_proto.c"
10283 (("#include <sys/poll.h>" m)
10284 (string-append m "\n"
10285 "#include <sys/sysmacros.h>")))
10286 #t)))))
10287 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
10288 (description
10289 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
10290communications interface for the True Scale family of products. PSM users are
10291enabled with mechanisms necessary to implement higher level communications
10292interfaces in parallel environments.")
10293 ;; Only Intel-compatible processors are supported.
10294 (supported-systems '("i686-linux" "x86_64-linux"))
10295 (license (list license:bsd-2 license:gpl2)))) ;dual
10296
10297(define-public snapscreenshot
10298 (package
10299 (name "snapscreenshot")
10300 (version "1.0.14.3")
10301 (source
10302 (origin
10303 (method url-fetch)
10304 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
10305 name "-" version ".tar.bz2"))
10306 (sha256
10307 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
10308 (build-system gnu-build-system)
10309 (arguments
10310 `(#:make-flags
10311 (let ((out (assoc-ref %outputs "out")))
10312 (list (string-append "BINDIR=" out "/bin")
10313 (string-append "MANDIR=" out "/share/man")))
10314 #:tests? #f ; no test suite
10315 #:phases
10316 (modify-phases %standard-phases
10317 (delete 'configure) ; ./configure is a snarky no-op
10318 (add-before 'install 'fix-ownership
10319 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
10320 (lambda _
10321 (substitute* "depfun.mak"
10322 ((" -o bin -g bin ") " "))
10323 #t))
10324 (add-before 'install 'create-output-directories
10325 (lambda* (#:key outputs #:allow-other-keys)
10326 (let ((out (assoc-ref outputs "out")))
10327 (mkdir-p (string-append out "/share/man/man1"))
10328 #t))))))
10329 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
10330 (synopsis "Take screenshots of one or more Linux text consoles")
10331 (description
10332 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
10333Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
10334relevant @file{/dev/vcs*} file(s).")
10335 (license license:gpl2)))
10336
10337(define-public fbcat
10338 (package
10339 (name "fbcat")
10340 (version "0.5.2")
10341 (source
10342 (origin
10343 (method url-fetch)
10344 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
10345 version "/" name "-" version ".tar.gz"))
10346 (sha256
10347 (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
10348 (build-system gnu-build-system)
10349 (inputs
10350 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
10351 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
10352 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
10353 `(("pnmtopng" ,netpbm)))
10354 (outputs (list "out" "fbgrab"))
10355 (arguments
10356 `(#:make-flags
10357 (list "CC=gcc"
10358 (string-append "PREFIX=" (assoc-ref %outputs "out")))
10359 #:tests? #f ; no tests
10360 #:phases
10361 (modify-phases %standard-phases
10362 (delete 'configure) ; no configure script
10363 (add-after 'build 'qualify-references
10364 (lambda* (#:key inputs outputs #:allow-other-keys)
10365 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
10366 (out (assoc-ref outputs "out")))
10367 (substitute* "fbgrab"
10368 (("fbcat" all)
10369 (string-append out "/bin/" all))
10370 (("pnmtopng" all)
10371 (string-append pnmtopng "/bin/" all))))))
10372 (add-after 'install 'split-fbgrab-output
10373 (lambda* (#:key outputs #:allow-other-keys)
10374 (let* ((out (assoc-ref outputs "out"))
10375 (out:fbgrab (assoc-ref outputs "fbgrab")))
10376 (for-each (lambda (file)
10377 (let ((old (string-append out "/" file))
10378 (new (string-append out:fbgrab "/" file)))
10379 (mkdir-p (dirname new))
10380 (rename-file old new)))
10381 (list "bin/fbgrab"
10382 "share/man/man1/fbgrab.1"))))))))
10383 (home-page "https://jwilk.net/software/fbcat")
10384 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
10385 (description
10386 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
10387a dump thereof. It supports a wide range of drivers and pixel formats.
10388
10389@command{fbcat} can take screenshots of virtually any application that can be
10390made to write its output to the framebuffer, including (but not limited to)
10391text-mode or graphical applications that don't use a display server.
10392
10393Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
10394emulates the behaviour of Gunnar Monell's older fbgrab utility.")
10395 (license license:gpl2)))
10396
10397(define-public fbgrab
10398 (package
10399 (name "fbgrab")
10400 (version "1.5")
10401 (source (origin
10402 (method git-fetch)
10403 (uri (git-reference
10404 (url "https://github.com/GunnarMonell/fbgrab")
10405 (commit version)))
10406 (file-name (git-file-name name version))
10407 (sha256
10408 (base32
10409 "1npn7l8jg0nhjraybjl38v8635zawzmn06ql3hs3vhci1vi1r90r"))))
10410 (build-system gnu-build-system)
10411 (arguments
10412 (list #:tests? #f ;no test suite
10413 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
10414 (string-append "DESTDIR=" #$output))
10415 #:phases #~(modify-phases %standard-phases
10416 (add-after 'unpack 'strip-/usr-prefix
10417 (lambda _
10418 (substitute* "Makefile"
10419 (("/usr") ""))))
10420 (delete 'configure))))
10421 (inputs (list libpng zlib))
10422 (home-page "https://github.com/GunnarMonell/fbgrab")
10423 (synopsis "Linux framebuffer screenshot/conversion utility")
10424 (description "FBGrab is a framebuffer screenshot program that captures the
10425Linux framebuffer and converts it to a PNG image. It can also convert a
10426framebuffer dump file (copy) to a PNG image.")
10427 (license license:gpl2))) ;GPL 2.0 only (per SPDX identifier in fbgrab.c)
10428
10429(define-public libcgroup
10430 (package
10431 (name "libcgroup")
10432 (version "3.2.0")
10433 (home-page "https://github.com/libcgroup/libcgroup")
10434 (source
10435 (origin
10436 (method url-fetch)
10437 (uri (string-append
10438 "https://github.com/libcgroup/libcgroup/releases/download/v"
10439 version "/" name "-" version ".tar.gz"))
10440 (sha256
10441 (base32 "1zmxhqp8kj2n7yvj82nsy5sx07yrxj4r37w41lz5q8bpqgbc43ws"))))
10442 (build-system gnu-build-system)
10443 (arguments
10444 ;; Tests are virtualized with lxc, it is not very feasible
10445 ;; to make them executable under guix build. Also, note that
10446 ;; origin is using source tarball release which is prepared
10447 ;; after testing.
10448 (list #:tests? #f
10449 #:configure-flags
10450 #~'("--disable-systemd")))
10451 (native-inputs
10452 (list bison flex))
10453 (inputs
10454 (list linux-pam))
10455 (synopsis "Control groups management tools")
10456 (description "Control groups is Linux kernel method for process resource
10457restriction, permission handling and more. This package provides userspace
10458interface to this kernel feature.")
10459 (license license:lgpl2.1)))
10460
10461(define-public mbpfan
10462 (package
10463 (name "mbpfan")
10464 (version "2.4.0")
10465 (source
10466 (origin
10467 (method git-fetch)
10468 (uri (git-reference
10469 (url "https://github.com/dgraziotin/mbpfan")
10470 (commit (string-append "v" version))))
10471 (file-name (git-file-name name version))
10472 (sha256
10473 (base32 "146sshsjafi26n741jvi9mdbazwf74jlacxfwkky4fhbq98idlhp"))))
10474 (build-system gnu-build-system)
10475 (arguments
10476 (list #:tests? #f ; tests ask to be run as root
10477 #:make-flags
10478 #~(list (string-append "DESTDIR=" #$output)
10479 (string-append "CC=" #$(cc-for-target)))
10480 #:phases
10481 #~(modify-phases %standard-phases
10482 (add-after 'unpack 'patch-paths
10483 (lambda _
10484 (substitute* "Makefile"
10485 (("/usr") ""))))
10486 (delete 'configure)))) ; there's no configure phase
10487 (home-page "https://github.com/dgraziotin/mbpfan")
10488 (synopsis "Control fan speed on Macbooks")
10489 (description
10490 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
10491the @code{coretemp} module and sets the fan speed using the @code{applesmc}
10492module. It can be executed as a daemon or in the foreground with root
10493privileges.")
10494 (license license:gpl3+)))
10495
10496(define-public psm2
10497 (package
10498 (name "psm2")
10499 (version "12.0")
10500 (source (origin
10501 (method git-fetch)
10502 (uri (git-reference
10503 (url "https://github.com/intel/opa-psm2")
10504 ;; tag 'psm-v12.0' = commit ad5dd1b
10505 (commit (string-append "psm-v" version))))
10506 (file-name (git-file-name name version))
10507 (sha256
10508 (base32
10509 "04nar65ac11qqx41vkfs7iip8kfiah0zms7l4rmsxncpiz2iqfik"))
10510 (patches
10511 (search-patches
10512 "psm2-compile-ctor-without-avx.patch"))
10513 (modules '((guix build utils)))
10514 (snippet
10515 ;; That file declares its own 'strlcat' as static. To avoid a
10516 ;; conflict with the function now in glibc 2.39, give it a
10517 ;; different name.
10518 #~(substitute* "ptl_ips/ips_proto_dump.c"
10519 (("strlcat")
10520 "psm2_custom_strlcat")))))
10521 (build-system gnu-build-system)
10522 (arguments
10523 (list #:make-flags
10524 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
10525 #:tests? #f
10526 #:phases #~(modify-phases %standard-phases
10527 (delete 'configure)
10528 (add-after 'unpack 'patch-Makefiles
10529 (lambda _
10530 (substitute* "Makefile"
10531 (("/lib64") "/lib")
10532 (("/usr") ""))
10533 (substitute* "compat/Makefile"
10534 (("/lib64") "/lib")
10535 (("/usr") ""))))
10536 (replace 'install
10537 (lambda _
10538 (setenv "DESTDIR" #$output)
10539 (invoke "make" "install"))))))
10540 (inputs
10541 (list rdma-core numactl))
10542 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
10543 (description
10544 "This package is low-level user-level Intel's communications interface.
10545The PSM2 API is a high-performance vendor-specific protocol that provides a
10546low-level communications interface for the Intel Omni-Path family of
10547high-speed networking devices.")
10548 (home-page "https://github.com/intel/opa-psm2")
10549 ;; Only the x86_64 architecture is supported.
10550 (supported-systems '("x86_64-linux"))
10551 (license (list license:bsd-3 license:gpl2)))) ; dual
10552
10553(define-public libpfm4
10554 (package
10555 (name "libpfm4")
10556 (version "4.9.0")
10557 (source (origin
10558 (method url-fetch)
10559 (uri (string-append "mirror://sourceforge/perfmon2/"
10560 name "/libpfm-" version ".tar.gz"))
10561 (sha256
10562 (base32
10563 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
10564 (build-system gnu-build-system)
10565 (arguments
10566 '(#:modules ((guix build utils)
10567 (guix build gnu-build-system))
10568 #:phases (modify-phases %standard-phases
10569 (delete 'configure)
10570 (delete 'check)
10571 (replace 'build
10572 (lambda* (#:key inputs outputs #:allow-other-keys)
10573 (let* ((out (assoc-ref outputs "out")))
10574 (setenv "CC" "gcc")
10575 (setenv "CFLAGS" "-Wno-format-truncation")
10576 (invoke "make")
10577 #t)))
10578 (replace 'install
10579 (lambda* (#:key outputs #:allow-other-keys)
10580 (let* ((out (assoc-ref outputs "out")))
10581 (invoke "make"
10582 (string-append "PREFIX=" out)
10583 "install")
10584 #t))))))
10585 (synopsis "Performance event monitoring library")
10586 (description
10587 "This package provides a library called libpfm4, which is used to develop
10588monitoring tools exploiting the performance monitoring events such as those
10589provided by the Performance Monitoring Unit (PMU) of modern processors.
10590
10591Libpfm4 helps convert from an event name, expressed as a string, to the event
10592encoding that is either the raw event as documented by the hardware vendor or
10593the OS-specific encoding. In the latter case, the library is able to prepare
10594the OS-specific data structures needed by the kernel to setup the event.
10595
10596libpfm4 provides support for the @code{perf_events} interface, which was
10597introduced in Linux 2.6.31.")
10598 (home-page "https://perfmon2.sourceforge.net/")
10599 (license license:expat)))
10600
10601(define-public libnfnetlink
10602 (package
10603 (name "libnfnetlink")
10604 (version "1.0.2")
10605 (source (origin
10606 (method url-fetch)
10607 (uri (string-append
10608 "https://www.netfilter.org/projects/libnfnetlink/files/"
10609 "libnfnetlink-" version ".tar.bz2"))
10610 (sha256
10611 (base32
10612 "0xn3rcrzxr6g82kfxzs9bqn2zvl2kf2yda30drwb9vr6sk1wfr5h"))))
10613 (build-system gnu-build-system)
10614 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
10615 (synopsis "Low-level netfilter netlink communication library")
10616 (description
10617 "@code{libnfnetlink} is the low-level library for netfilter related
10618kernel/userspace communication. It provides a generic messaging
10619infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
10620nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
10621management tools in userspace.")
10622 (license license:gpl2)))
10623
10624(define-public libinih
10625 (package
10626 (name "libinih")
10627 (version "57")
10628 (source (origin
10629 (method git-fetch)
10630 (uri (git-reference
10631 (url "https://github.com/benhoyt/inih")
10632 (commit (string-append "r" version))))
10633 (file-name (git-file-name name version))
10634 (sha256
10635 (base32
10636 "03hpyahdkipm5wfalj2xkz6y9ncd9zrlhnf7vap6lr56jj2fz2bb"))))
10637 (build-system meson-build-system)
10638 ;; Install static libraries for use by the initrd's xfsprogs/static.
10639 (outputs (list "out" "static"))
10640 (arguments
10641 `(#:configure-flags
10642 (list "-Ddistro_install=true"
10643 "-Ddefault_library=both")
10644 #:phases
10645 (modify-phases %standard-phases
10646 (add-after 'install 'separate-static
10647 (lambda* (#:key outputs #:allow-other-keys)
10648 (let ((out (assoc-ref outputs "out"))
10649 (static (assoc-ref outputs "static")))
10650 (with-directory-excursion out
10651 (for-each (lambda (source)
10652 (let ((target (string-append static "/" source)))
10653 (mkdir-p (dirname target))
10654 (rename-file source target)))
10655 (find-files "lib" "\\.a$")))))))))
10656 (home-page "https://github.com/benhoyt/inih")
10657 (synopsis "Simple .INI parser library for C")
10658 (description "The inih (INI Not Invented Here) library is a simple .INI file
10659parser written in C. It's only a couple of pages of code, and it was designed to
10660be small and simple, so it's good for embedded systems. It's also more or less
10661compatible with Python's ConfigParser style of .INI files, including RFC
10662822-style multi-line syntax and name: value entries.")
10663 (license license:bsd-3)))
10664
10665(define-public simpleini
10666 (let ((commit "6048871ea9ee0ec24be5bd099d161a10567d7dc2")
10667 (revision "1"))
10668 (package
10669 (name "simpleini")
10670 (version (git-version "4.22" revision commit))
10671 (source (origin
10672 (method git-fetch)
10673 (uri (git-reference
10674 (url "https://github.com/brofield/simpleini")
10675 (commit commit)))
10676 (file-name (git-file-name name version))
10677 (sha256
10678 (base32
10679 "1szaflnrzw1zx9v5g6mbbiaf9wfglp4n4jjq2793k9ryz3qxil9j"))))
10680 (build-system cmake-build-system)
10681 (arguments
10682 (list #:configure-flags #~(list "-DSIMPLEINI_USE_SYSTEM_GTEST=ON")))
10683 (native-inputs (list googletest))
10684 (home-page "https://github.com/brofield/simpleini")
10685 (synopsis "Simple API to read and write INI-style files")
10686 (description
10687 "SimpleIni provides a simple API to read and write INI-style
10688configuration files. It supports data files in ASCII, MBCS and Unicode.")
10689 (license license:expat))))
10690
10691(define-public xfsprogs
10692 (package
10693 (name "xfsprogs")
10694 (version "6.12.0")
10695 (source (origin
10696 (method url-fetch)
10697 (uri (string-append
10698 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
10699 "xfsprogs-" version ".tar.gz"))
10700 (sha256
10701 (base32
10702 "1n46n27fxx1137kni3drrhzhp1l8ksxabcsmi8yzxbhpbnl4q293"))))
10703 (build-system gnu-build-system)
10704 (outputs (list "out" "python"))
10705 (arguments
10706 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
10707 #:configure-flags
10708 (list "--disable-static")
10709 #:make-flags
10710 (list "V=1")
10711 #:phases
10712 (modify-phases %standard-phases
10713 (add-after 'install 'separate-python-output
10714 (lambda* (#:key outputs #:allow-other-keys)
10715 (let ((out (assoc-ref outputs "out"))
10716 (python (assoc-ref outputs "python")))
10717 (for-each
10718 (lambda (script)
10719 (mkdir-p (string-append python (dirname script)))
10720 (rename-file (string-append out script)
10721 (string-append python script)))
10722 (list "/sbin/xfs_scrub_all")))))
10723 (add-after 'install 'install-headers
10724 (lambda* (#:key make-flags #:allow-other-keys)
10725 (apply invoke "make" "install-dev" make-flags))))))
10726 (native-inputs
10727 ;; riscv64 needs >= gcc-13.3.0 for liburcu.
10728 (append
10729 (if (target-riscv64?)
10730 (list gcc-14)
10731 '())
10732 (list gettext-minimal)))
10733 (inputs
10734 `(("libinih" ,libinih)
10735 ("liburcu" ,liburcu)
10736 ("libuuid" ,util-linux "lib")
10737 ("python" ,python-wrapper)))
10738 (home-page "https://xfs.wiki.kernel.org/")
10739 (synopsis "XFS file system tools")
10740 (description "This package provides commands to create and check XFS
10741file systems.")
10742 ;; The library "libhandle" and the headers in "xfslibs-dev" are
10743 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
10744 (license (list license:gpl2 license:lgpl2.1))))
10745
10746(define-public xfsprogs-5.9
10747 (package
10748 (inherit xfsprogs)
10749 (name "xfsprogs")
10750 (version "5.9.0")
10751 (source (origin
10752 (method url-fetch)
10753 (uri (string-append
10754 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
10755 "xfsprogs-" version ".tar.gz"))
10756 (sha256
10757 (base32
10758 "13xkn9jpmwp4fm9r68vhgznkmxhnv83n2b39mhy2qdaph90w2a1l"))))
10759 (arguments
10760 (substitute-keyword-arguments (package-arguments xfsprogs)
10761 ((#:configure-flags configure-flags '())
10762 `(cons "--enable-gettext=no"
10763 ,configure-flags))))
10764 (native-inputs
10765 (modify-inputs (package-native-inputs xfsprogs)
10766 (delete "gettext-minimal")))))
10767
10768(define-public xfsprogs/static
10769 (package
10770 (inherit xfsprogs)
10771 (name "xfsprogs-static")
10772 (outputs (list "out"))
10773 (arguments
10774 (substitute-keyword-arguments (package-arguments xfsprogs)
10775 ((#:configure-flags configure-flags '())
10776 `(append ,configure-flags
10777 (list "--enable-static")))
10778 ((#:make-flags make-flags ''())
10779 `(cons* "LLDFLAGS=-all-static" ,make-flags))
10780 ((#:phases _ ''())
10781 `(modify-phases %standard-phases
10782 (add-after 'install 'delete-useless-files
10783 (lambda* (#:key outputs #:allow-other-keys)
10784 (with-directory-excursion (assoc-ref outputs "out")
10785 (for-each delete-file-recursively
10786 (list "include" "lib")))))))))
10787 (inputs
10788 `(("libinih:static" ,libinih "static")
10789 ("util-linux:static" ,util-linux "static")
10790 ,@(remove (match-lambda
10791 ((label . _)
10792 (member label '("python"))))
10793 (package-inputs xfsprogs))))
10794 (synopsis "Statically linked XFS file system tools")))
10795
10796(define-public xfs_repair/static
10797 (package
10798 (name "xfs_repair-static")
10799 (version (package-version xfsprogs/static))
10800 (source #f)
10801 (build-system trivial-build-system)
10802 (arguments
10803 `(#:modules ((guix build utils))
10804 #:builder
10805 (begin
10806 (use-modules (guix build utils))
10807 (let* ((xfsprogs (assoc-ref %build-inputs "xfsprogs"))
10808 (out (assoc-ref %outputs "out"))
10809 (sbin (string-append out "/sbin")))
10810 (install-file (string-append xfsprogs "/sbin/xfs_repair") sbin)
10811 (with-directory-excursion sbin
10812 (remove-store-references "xfs_repair"))))))
10813 (inputs
10814 `(("xfsprogs" ,xfsprogs/static)))
10815 (home-page (package-home-page xfsprogs/static))
10816 (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
10817 (description
10818 "This package provides a statically linked @command{xfs_repair} taken
10819from the xfsprogs package. It is meant to be used in initrds.")
10820 (license (package-license xfsprogs/static))))
10821
10822(define-public genext2fs
10823 (package
10824 (name "genext2fs")
10825 (version "1.5.0")
10826 (source (origin
10827 (method git-fetch)
10828 (uri (git-reference
10829 (url "https://github.com/bestouff/genext2fs")
10830 (commit "474111097321f03de9e009aa9f7d4a8948e310b2")))
10831 (file-name (git-file-name name version))
10832 (sha256
10833 (base32 "14lgvml5zz99845ja47jpf4iirjzfqv36ffzachh3hw2ggji9c7l"))))
10834 (build-system gnu-build-system)
10835 (native-inputs
10836 (list autoconf automake))
10837 (home-page "https://github.com/bestouff/genext2fs")
10838 (synopsis "Generate ext2 file system as a normal user")
10839 (description "This package provides a program to generate an ext2
10840file system as a normal (non-root) user. It does not require you to mount
10841the image file to copy files on it, nor does it require that you become
10842the superuser to make device nodes.")
10843 (license license:gpl2)))
10844
10845(define-public fakeroot
10846 (package
10847 (name "fakeroot")
10848 (version "1.37.1.2")
10849 (source
10850 (origin
10851 ;; There are no tags in the repository, so take this snapshot.
10852 (method url-fetch)
10853 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
10854 "fakeroot/fakeroot_" version ".orig.tar.gz"))
10855 (file-name (string-append name "-" version ".tar.gz"))
10856 (sha256
10857 (base32 "091jym16c4m4qjf5yclksvx7nw4sl7v5yrkz6z46wrwaij99d54m"))
10858 (modules '((guix build utils)
10859 (ice-9 ftw)))
10860 (snippet
10861 `(begin
10862 ;; Delete pregenerated man page translations, but not the originals.
10863 (with-directory-excursion "doc"
10864 (for-each (lambda (language)
10865 (for-each delete-file
10866 (find-files language "\\.[0-9]$")))
10867 (scandir "."
10868 (lambda (file)
10869 (and (not (string-prefix? "." file))
10870 (eq? 'directory
10871 (stat:type (lstat file))))))))))))
10872 (build-system gnu-build-system)
10873 (arguments
10874 `(#:configure-flags
10875 (list "--disable-static")
10876 #:phases
10877 (modify-phases %standard-phases
10878 (add-after 'unpack 'patch-Makefile.am
10879 (lambda _
10880 (substitute* "Makefile.am"
10881 (("/bin/sh") (which "sh")))))
10882 (add-after 'unpack 'patch-script
10883 (lambda* (#:key inputs #:allow-other-keys)
10884 (substitute* "scripts/fakeroot.in"
10885 (("getopt")
10886 (string-append (assoc-ref inputs "util-linux")
10887 "/bin/getopt"))
10888 (("sed")
10889 (string-append (assoc-ref inputs "sed")
10890 "/bin/sed"))
10891 (("cat|cut" command)
10892 (string-append (assoc-ref inputs "coreutils")
10893 "/bin/" command)) )))
10894 (replace 'bootstrap
10895 (lambda _
10896 ;; The "preroll" script takes care of Autoconf and also
10897 ;; prepares the translated manuals.
10898 (invoke "sh" "./preroll")))
10899 (add-before 'configure 'setenv
10900 (lambda _
10901 (setenv "LIBS" "-lacl")))
10902 (add-before 'check 'prepare-check
10903 (lambda _
10904 (setenv "SHELL" (which "bash"))
10905 (setenv "VERBOSE" "1")
10906 (substitute* "test/t.touchinstall"
10907 ;; We don't have the name of the root user, so use ID=0.
10908 (("grep root") "grep \"\\<0\\>\""))
10909 (substitute* "test/tartest"
10910 ;; We don't have the name of the root group, so use ID=0.
10911 (("ROOTGROUP=root") "ROOTGROUP=0")
10912 ;; We don't have the name of the daemon user, so use IDs.
10913 (("daemon:sys") "1:3")
10914 (("daemon:") "1:"))
10915 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
10916 (substitute* "test/compare-tar"
10917 (("tar -tvf") "tar --numeric-owner -tvf")))))))
10918 (native-inputs
10919 (list autoconf-2.71 automake gettext-minimal libtool po4a
10920 perl sharutils xz)) ; for tests
10921 (inputs
10922 (list acl libcap util-linux sed coreutils))
10923 (synopsis "Run commands in an environment with fake root privileges")
10924 (description
10925 "@command{fakeroot} runs a command in an environment where it appears to
10926have root privileges for file manipulation. This is useful for allowing users
10927to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
10928them with root permissions and/or ownership.
10929
10930Without fakeroot, one would have to have root privileges to create the
10931constituent files of the archives with the correct permissions and ownership,
10932and then pack them up, or one would have to construct the archives directly,
10933without using the archiver.")
10934 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
10935 (license license:gpl3+)))
10936
10937(define-public fakechroot
10938 ;; XXX: Build from the change submitted at
10939 ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
10940 ;; against glibc 2.33. Switch back to the official repository on the next
10941 ;; release.
10942 (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
10943 (revision "0"))
10944 (package
10945 (name "fakechroot")
10946 (version (git-version "2.20.1" revision commit))
10947 (source (origin
10948 (method git-fetch)
10949 (uri (git-reference
10950 (url "https://github.com/lipnitsk/fakechroot")
10951 (commit commit)))
10952 (file-name (git-file-name name version))
10953 (sha256
10954 (base32
10955 "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
10956 (build-system gnu-build-system)
10957 (arguments
10958 ;; XXX: The tests heavily assume they run on an FHS system so for now
10959 ;; skip them.
10960 '(#:tests? #f
10961 #:configure-flags '("--disable-static")))
10962 (native-inputs (list autoconf automake libtool perl))
10963 (synopsis "Emulate @code{chroot} by overriding file system calls")
10964 (description
10965 "@command{fakechroot} runs a command in an environment were is additional
10966possibility to use @code{chroot} command without root privileges. This is
10967useful for allowing users to create own chrooted environment with possibility
10968to install another packages without need for root privileges.
10969
10970It works by providing @file{libfakechroot.so}, a shared library meant to be
10971set as @code{LD_PRELOAD} to override the C library file system functions.")
10972 (home-page "https://github.com/dex4er/fakechroot/")
10973 (license license:lgpl2.1+))))
10974
10975(define-public falcosecurity-libs
10976 (package
10977 (name "falcosecurity-libs")
10978 (version "0.20.0")
10979 (source (origin
10980 (method git-fetch)
10981 (uri (git-reference
10982 (url "https://github.com/falcosecurity/libs/")
10983 (commit version)))
10984 (file-name (git-file-name name version))
10985 (sha256
10986 (base32
10987 "041ir9wk44v7isidwl7fzxrjvs85j637wcr7xirasd8ysxa0r4qv"))
10988 (patches
10989 (search-patches
10990 "falcosecurity-libs-bpf-probes-fix.patch"
10991 "falcosecurity-libs-shared-build.patch"))))
10992 (build-system cmake-build-system)
10993 (arguments
10994 (list
10995 #:configure-flags
10996 #~(list "-DUSE_BUNDLED_DEPS=OFF"
10997 "-DBUILD_DRIVER=OFF"
10998 "-DENABLE_DKMS=OFF"
10999 "-DBUILD_LIBSCAP_MODERN_BPF=ON"
11000 "-DSCAP_FILES_SUITE_ENABLE=OFF" ;attempts to download scap files
11001 "-DBUILD_SHARED_LIBS=ON"
11002 #$(string-append "-DFALCOSECURITY_LIBS_VERSION=" version))
11003 ;; Only the libsinsp test suite is run, as the one for libscap requires
11004 ;; elevated privileges.
11005 #:modules '((guix build cmake-build-system)
11006 ((guix build gnu-build-system) #:prefix gnu:)
11007 (guix build utils))
11008 #:phases
11009 #~(modify-phases %standard-phases
11010 (add-after 'unpack 'disable-problematic-tests
11011 (lambda _
11012 (substitute* "userspace/libsinsp/test/user.ut.cpp"
11013 ;; The 'system_lookup' test assumes a root user
11014 ;; exists in the build environment.
11015 (("TEST_F\\(usergroup_manager_test, system_lookup)")
11016 "TEST_F(usergroup_manager_test, DISABLED_system_lookup)"))))
11017 (replace 'check
11018 (lambda* (#:rest args)
11019 (apply (assoc-ref gnu:%standard-phases 'check)
11020 #:test-target "run-unit-test-libsinsp" args)))
11021 (add-after 'install 'delete-src
11022 (lambda _
11023 (delete-file-recursively
11024 (string-append #$output "/src")))))))
11025 (native-inputs
11026 (list bpftool
11027 clang-18 ;avoid stack limit exceeded build error
11028 googletest
11029 pkg-config
11030 valijson)) ;header-only library
11031 (inputs
11032 (list elfutils))
11033 (propagated-inputs
11034 ;; The following inputs are in the 'Requires' field of libscap.pc,
11035 ;; libsinp.pc or libpman.pc.
11036 (list c-ares
11037 grpc
11038 jsoncpp
11039 libbpf
11040 libelf
11041 openssl
11042 protobuf
11043 uthash ;included in libscap headers
11044 zlib
11045 ;; These are in the 'Requires.private' field of libscap.pc and
11046 ;; libsinp.pc. They are required because the headers are installed
11047 ;; to a non-standard directory, and thus need to be found via the
11048 ;; 'Cflags' field, which in turn mandates that both the pkg-config
11049 ;; modules listed in the 'Requires' and 'Requires.private' be
11050 ;; available.
11051 curl
11052 re2
11053 tbb))
11054 (home-page "https://github.com/falcosecurity/libs/")
11055 (synopsis "Falco security libraries")
11056 (description "The Falco security libraries include @code{libsinsp} and
11057@code{libscap}. @code{libscap} manages the data capture process, while
11058@code{libsinsp} is a system inspection library that enriches events from
11059@code{libscap} with machine state. @code{libsinsp} also performs events
11060filtering with rule evaluation through its internal rule engine. These
11061libraries are used by the @command{sysdig} command-line utility.")
11062 (license license:asl2.0)))
11063
11064(define-public inputattach
11065 (package
11066 (name "inputattach")
11067 (version "0.42.0")
11068 (source (origin
11069 (method git-fetch)
11070 (uri (git-reference
11071 (url "https://github.com/linuxwacom/input-wacom")
11072 (commit (string-append "input-wacom-" version))))
11073 (file-name (git-file-name name version))
11074 (sha256
11075 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
11076 (build-system gnu-build-system)
11077 (arguments
11078 `(#:phases
11079 (modify-phases %standard-phases
11080 (delete 'bootstrap)
11081 (delete 'configure)
11082 (replace 'build
11083 (lambda* (#:key inputs #:allow-other-keys)
11084 (with-directory-excursion "inputattach"
11085 (invoke "gcc" "-O2" "-o" "inputattach"
11086 "inputattach.c"))))
11087 (delete 'check)
11088 (replace 'install
11089 (lambda* (#:key outputs #:allow-other-keys)
11090 (let ((target-dir (string-append
11091 (assoc-ref outputs "out")
11092 "/bin/")))
11093 (mkdir-p target-dir)
11094 (copy-file "inputattach/inputattach"
11095 (string-append target-dir
11096 "inputattach"))
11097 #t))))))
11098 (home-page "https://linuxwacom.github.io/")
11099 (synopsis "Dispatch input peripherals events to a device file")
11100 (description "inputattach dispatches input events from several device
11101types and interfaces and translates so that the X server can use them.")
11102 (license license:gpl2+)))
11103
11104(define-public keyd
11105 (package
11106 (name "keyd")
11107 (version "2.5.0")
11108 (source
11109 (origin
11110 (method git-fetch)
11111 (uri (git-reference
11112 (url "https://github.com/rvaiya/keyd")
11113 (commit (string-append "v" version))))
11114 (sha256
11115 (base32
11116 "0nkra6lwdjhjcwj6486cgy562n4bcp98fjgl52rj8pp76i15yad7"))))
11117 (arguments
11118 (list #:tests? #f ; tests require root
11119 #:make-flags
11120 #~(list (string-append "CC=" #$(cc-for-target))
11121 "PREFIX="
11122 (string-append "DESTDIR=" #$output))
11123 #:phases
11124 '(modify-phases
11125 %standard-phases
11126 (delete 'configure)))) ; no autoconf
11127 (build-system gnu-build-system)
11128 (inputs (list linux-libre-headers))
11129 (synopsis "Key remapping daemon for Linux")
11130 (description
11131 "Keyd is a keyboard remapping utility with intuitive ini configuration
11132file format. Keyd has several features, many of which are traditionally only
11133found in custom keyboard firmware like QMK.")
11134 (home-page "https://github.com/rvaiya/keyd")
11135 (license license:expat)))
11136
11137(define-public pipewire
11138 (package
11139 (name "pipewire")
11140 (version "1.4.5")
11141 (source (origin
11142 (method git-fetch)
11143 (uri (git-reference
11144 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11145 (commit version)))
11146 (file-name (git-file-name name version))
11147 (sha256
11148 (base32
11149 "1k3b412zspmx2v0finb5g8kns8xsynlnz48cmlcg7ch62av6kw75"))))
11150 (build-system meson-build-system)
11151 (arguments
11152 (list
11153 #:configure-flags
11154 #~(list (string-append "-Dudevrulesdir=" #$output "/lib/udev/rules.d")
11155 "-Dman=enabled"
11156 "-Drlimits-install=false"
11157 "-Dsession-managers=[]"
11158 "-Dsysconfdir=/etc"
11159 "-Dsystemd=disabled")))
11160 (native-inputs
11161 (list `(,glib "bin")
11162 pkg-config
11163 doxygen
11164 python
11165 python-docutils))
11166 (inputs (list alsa-lib
11167 avahi
11168 bluez
11169 dbus
11170 eudev
11171 ffmpeg
11172 gst-plugins-base
11173 gstreamer
11174 jack-2
11175 ldacbt
11176 libcamera
11177 libdrm
11178 libfdk
11179 libfreeaptx
11180 libsndfile
11181 libusb
11182 openssl ; raop sink
11183 libva
11184 pulseaudio
11185 readline ; for pw-cli
11186 sbc
11187 vulkan-headers
11188 vulkan-loader
11189 webrtc-audio-processing))
11190 (home-page "https://pipewire.org/")
11191 (synopsis "Server and user space API to deal with multimedia pipelines")
11192 (description
11193 "PipeWire is a project that aims to greatly improve handling of audio and
11194video under Linux. It aims to support the usecases currently handled by both
11195PulseAudio and Jack and at the same time provide same level of powerful handling
11196of Video input and output. It also introduces a security model that makes
11197interacting with audio and video devices from containerized applications easy,
11198with supporting Flatpak applications being the primary goal. Alongside Wayland
11199and Flatpak we expect PipeWire to provide a core building block for the future
11200of Linux application development.")
11201 (license license:lgpl2.0+)))
11202
11203(define-public pipewire-minimal
11204 ;; Used as libpipewire to reduce closure size and avoid dependency cycles.
11205 (hidden-package
11206 (package
11207 (inherit pipewire)
11208 (name "pipewire-minimal")
11209 (arguments
11210 (list
11211 #:configure-flags
11212 #~(list "-Dsession-managers=[]"
11213 "-Ddbus=disabled"
11214 "-Dflatpak=disabled"
11215 ;; XXX: Otherwise test_loop will fail with:
11216 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11217 (string-append "-Dc_link_args=-Wl,-rpath=" #$output "/lib"
11218 " -lgcc_s")
11219 "-Db_asneeded=false")))
11220 (native-inputs '())
11221 (inputs '()))))
11222
11223(define-public wireplumber
11224 (package
11225 (name "wireplumber")
11226 (version "0.5.12")
11227 (source
11228 (origin
11229 (method git-fetch)
11230 (uri (git-reference
11231 (url
11232 "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
11233 (commit version)))
11234 (file-name (git-file-name name version))
11235 (sha256
11236 (base32 "1dljz669ywy1lvvn0jh14ymynmbii45q5vay71zajpcg31249dyw"))))
11237 (build-system meson-build-system)
11238 (arguments
11239 `(#:configure-flags '("-Dsystemd=disabled"
11240 "-Dsystem-lua=true")))
11241 (native-inputs
11242 (list `(,glib "bin")
11243 pkg-config python-minimal))
11244 (inputs (list dbus elogind glib lua pipewire))
11245 (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
11246 (synopsis "Session / policy manager implementation for PipeWire")
11247 (description "WirePlumber is a modular session / policy manager for
11248PipeWire and a GObject-based high-level library that wraps PipeWire's API,
11249providing convenience for writing the daemon's modules as well as external
11250tools for managing PipeWire.")
11251 (license license:expat)))
11252
11253(define-public wireplumber-minimal
11254 (let ((base wireplumber))
11255 (package
11256 (inherit base)
11257 (name "wireplumber-minimal")
11258 (arguments
11259 (substitute-keyword-arguments (package-arguments base)
11260 ((#:configure-flags flags ''())
11261 #~(cons "-Delogind=disabled" #$flags))))
11262 (inputs
11263 (modify-inputs (package-inputs base)
11264 (delete "elogind"))))))
11265
11266(define-public ell
11267 (package
11268 (name "ell")
11269 (version "0.79")
11270 (source (origin
11271 (method git-fetch)
11272 (uri (git-reference
11273 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
11274 (commit version)))
11275 (file-name (git-file-name name version))
11276 (sha256
11277 (base32
11278 "0l8pbgnza58ivknzl3nd6y46mfminhnb3iwq82msi6g282wv7np4"))
11279 (modules '((guix build utils)))
11280 (snippet
11281 #~(begin
11282 (substitute* "Makefile.am"
11283 ;; requires hwdb.bin
11284 (("unit/test-hwdb.*") ""))))))
11285 (build-system gnu-build-system)
11286 (arguments
11287 ;; Tests launch dbus-daemon instances that all try to bind to
11288 ;; "/tmp/ell-test-bus". Thus, we need to run them sequentially.
11289 '(#:parallel-tests? #f))
11290 (inputs
11291 (list dbus))
11292 (native-inputs
11293 (list autoconf automake libtool pkg-config procps))
11294 (home-page "https://01.org/ell")
11295 (synopsis "Embedded Linux Library")
11296 (description "The Embedded Linux* Library (ELL) provides core, low-level
11297functionality for system daemons. It typically has no dependencies other than
11298the Linux kernel, C standard library, and libdl (for dynamic linking). While
11299ELL is designed to be efficient and compact enough for use on embedded Linux
11300platforms, it is not limited to resource-constrained systems.")
11301 (license license:lgpl2.1+)))
11302
11303(define-public kexec-tools
11304 (package
11305 (name "kexec-tools")
11306 (version "2.0.31")
11307 (source (origin
11308 (method url-fetch)
11309 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
11310 "/kexec/kexec-tools-" version ".tar.xz"))
11311 (sha256
11312 (base32
11313 "0c9cj9xvcm81gcwnkvvh9vh82v59kdz5llmblc2wkqb6vh6kb3wa"))))
11314 (build-system gnu-build-system)
11315 (arguments
11316 ;; There are no automated tests.
11317 '(#:tests? #f))
11318 ;; This variant of binutils is used for the 64 bit support needed to
11319 ;; assemble the `purgatory/arch/i386/compat_x86_64.S' program on i686-linux.
11320 (native-inputs (list (make-ld-wrapper "ld-wrapper"
11321 #:binutils binutils)
11322 binutils))
11323 (home-page "https://projects.horms.net/projects/kexec/")
11324 (synopsis "Tools for booting directly into different kernels")
11325 (description "This package provides the @code{kexec} program and ancillary
11326utilities. Using @code{kexec}, it is possible to boot directly into a new
11327kernel from the context of an already-running kernel, bypassing the normal
11328system boot process.")
11329 (supported-systems (delete "riscv64-linux" %supported-systems))
11330 (license license:gpl2)))
11331
11332(define-public cachefilesd
11333 (package
11334 (name "cachefilesd")
11335 (version "0.10.10")
11336 (source (origin
11337 (method url-fetch)
11338 (uri (string-append
11339 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
11340 "/cachefilesd.git/snapshot/cachefilesd-"
11341 version ".tar.gz"))
11342 (sha256
11343 (base32
11344 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
11345 (build-system gnu-build-system)
11346 (outputs '("out"))
11347 (arguments
11348 `(#:tests? #f ; there are no tests
11349 #:make-flags
11350 (let ((prefix-dir (lambda (var dir)
11351 (string-append var "=" %output "/" dir))))
11352 (list (string-append "CC=" ,(cc-for-target))
11353 (prefix-dir "SBINDIR" "sbin/")
11354 (prefix-dir "ETCDIR" "etc/")
11355 (prefix-dir "MANDIR" "share/man/")))
11356 #:phases (modify-phases %standard-phases (delete 'configure))))
11357 (home-page "https://people.redhat.com/~dhowells/cachefs/")
11358 (synopsis "CacheFiles userspace management daemon")
11359 (description "@code{cachefilesd} is a userspace daemon that manages the
11360cache data store that is used by network file systems such as @code{AFS} and
11361@code{NFS} to cache data locally on disk. The content of the cache is
11362persistent over reboots.")
11363 (license license:gpl2+)))
11364
11365(define-public libbpf
11366 (package
11367 (name "libbpf")
11368 (version "1.5.0")
11369 (source
11370 (origin
11371 (method git-fetch)
11372 (uri (git-reference
11373 (url "https://github.com/libbpf/libbpf")
11374 (commit (string-append "v" version))))
11375 (file-name (git-file-name name version))
11376 (sha256
11377 (base32
11378 "0j7rm76g2ss09vksm4nm2g5yq7df2z5qpjr4h6kd3959sc1rvxnh"))))
11379 (build-system gnu-build-system)
11380 (arguments
11381 (list
11382 #:tests? #f ;self-tests run in QEMU
11383 #:make-flags
11384 #~(list (string-append "PREFIX=" #$output)
11385 (string-append "LIBDIR=$(PREFIX)/lib")
11386 (string-append "CC=" #$(cc-for-target)))
11387 #:phases
11388 #~(modify-phases %standard-phases
11389 (delete 'configure)
11390 (add-before 'build 'pre-build
11391 (lambda _
11392 (chdir "src")))
11393 (replace 'install
11394 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
11395 (apply (assoc-ref %standard-phases 'install)
11396 (append args
11397 (list #:make-flags
11398 (append (list "install"
11399 ;; Also install the kernel
11400 ;; user API (uAPI) headers.
11401 "install_uapi_headers")
11402 make-flags)))))))))
11403 (native-inputs (list pkg-config))
11404 (propagated-inputs (list elfutils zlib)) ;in Requires.private of libbpf.pc
11405 (home-page "https://github.com/libbpf/libbpf")
11406 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
11407 (description
11408 "Libbpf supports building BPF CO-RE-enabled applications, which, in
11409contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
11410headers.")
11411 (license (list license:lgpl2.1 license:bsd-2))))
11412
11413(define-public libbpf-0.8
11414 (package
11415 (inherit libbpf)
11416 (name "libbpf")
11417 (version "0.8.1")
11418 (source
11419 (origin
11420 (method git-fetch)
11421 (uri (git-reference
11422 (url "https://github.com/libbpf/libbpf")
11423 (commit (string-append "v" version))))
11424 (file-name (git-file-name name version))
11425 (sha256
11426 (base32
11427 "1zzpkk4x3f20483dzw43b3ml03d63vvkmqf4j8y3b61b67wm59bm"))))
11428 (arguments
11429 (list
11430 #:tests? #f ;self-tests run in QEMU
11431 #:make-flags
11432 #~(list (string-append "PREFIX=" #$output)
11433 (string-append "LIBDIR=$(PREFIX)/lib")
11434 (string-append "CC=" #$(cc-for-target)))
11435 #:phases #~(modify-phases %standard-phases
11436 (delete 'configure)
11437 (add-before 'build 'pre-build
11438 (lambda _
11439 (chdir "src"))))))
11440 (native-inputs (list pkg-config))
11441 (propagated-inputs (list elfutils zlib)))) ;in Requires.private of libbpf.pc
11442
11443(define-public bcc
11444 (package
11445 (name "bcc")
11446 (version "0.30.0")
11447 (source
11448 (origin
11449 (method git-fetch)
11450 (uri (git-reference
11451 (url "https://github.com/iovisor/bcc")
11452 (commit (string-append "v" version))))
11453 (file-name (git-file-name name version))
11454 (sha256
11455 (base32
11456 "0b5la0yn6x6ll73drnrm5v5yibbrzkvl86hqivkrmnpgy8cqn0cy"))))
11457 (build-system cmake-build-system)
11458 (native-inputs
11459 (list bison
11460 flex
11461 (@ (gnu packages compression) zip)))
11462 (inputs
11463 (list bash-minimal ;for wrap-program
11464 clang-15
11465 elfutils
11466 luajit
11467 libbpf
11468 python-wrapper))
11469 (arguments
11470 (list
11471 ;; Tests all require root permissions and a "standard" file hierarchy.
11472 #:tests? #f
11473 #:configure-flags #~(list (string-append "-DREVISION=" #$version)
11474 "-DCMAKE_USE_LIBBPF_PACKAGE=ON")
11475 #:phases
11476 #~(modify-phases %standard-phases
11477 (add-after 'unpack 'substitute-libbc
11478 (lambda _
11479 (substitute* "src/python/bcc/libbcc.py"
11480 (("(libbcc\\.so.*)\\b" _ libbcc)
11481 (string-append #$output "/lib/" libbcc)))))
11482 (add-after 'install 'wrap-tools
11483 (lambda _
11484 (use-modules (ice-9 textual-ports))
11485 (let* ((out #$output)
11486 (lib (string-append out "/lib"))
11487 (tools (string-append out "/share/bcc/tools"))
11488 (python-executable?
11489 (lambda (filename _)
11490 (call-with-input-file filename
11491 (lambda (port)
11492 (string-contains (get-line port)
11493 "/bin/python"))))))
11494 (for-each (lambda (python-executable)
11495 (format #t "Wrapping: ~A.~%" python-executable)
11496 (wrap-program python-executable
11497 `("GUIX_PYTHONPATH" ":" prefix
11498 (,(string-append lib
11499 "/python"
11500 #$(version-major+minor
11501 (package-version python))
11502 "/site-packages")))))
11503 (find-files tools python-executable?))))))))
11504 (home-page "https://github.com/iovisor/bcc")
11505 (synopsis "Tools for BPF on Linux")
11506 (description
11507 "BCC is a toolkit for creating efficient kernel tracing and manipulation
11508programs, and includes several useful tools and examples. It makes use of
11509extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
11510that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
11511and above.")
11512 (license license:asl2.0)))
11513
11514(define-public bpftool
11515 (package
11516 (name "bpftool")
11517 (version (package-version linux-libre))
11518 (source (package-source linux-libre))
11519 (build-system gnu-build-system)
11520 (arguments
11521 `(#:tests? #f ;This package has no tests.
11522 #:phases (modify-phases %standard-phases
11523 (delete 'configure)
11524 (replace 'build
11525 (lambda* (#:key inputs #:allow-other-keys)
11526 (invoke "make" "-C" "tools/bpf/bpftool"
11527 ,(string-append "CC=" (cc-for-target)))))
11528 (replace 'install
11529 (lambda* (#:key outputs #:allow-other-keys)
11530 (let* ((out (assoc-ref outputs "out")))
11531 (mkdir-p (string-append out "/sbin"))
11532 (mkdir-p (string-append out
11533 "/share/bash-completion/completions"))
11534 (invoke "make"
11535 (string-append "prefix=" out)
11536 (string-append
11537 "bash_compdir=" out
11538 "/share/bash-completion/completions")
11539 "-C" "tools/bpf/bpftool"
11540 "install")))))))
11541 (inputs (list elfutils ;provides libelf
11542 readline libcap zlib))
11543 (native-inputs (list bison python-3))
11544 ;; This tool does not have a proper web page.
11545 (home-page
11546 "https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/bpf/bpftool")
11547 (synopsis "Tool for inspection and manipulation of eBPF programs and maps")
11548 (description "@command{bpftool} allows for inspection and simple
11549modification of BPF objects on the system.")
11550 (license (package-license linux-libre))))
11551
11552(define-public bpftrace
11553 (package
11554 (name "bpftrace")
11555 (version "0.21.2")
11556 (source
11557 (origin
11558 (method git-fetch)
11559 (uri (git-reference
11560 (url "https://github.com/bpftrace/bpftrace")
11561 (commit (string-append "v" version))))
11562 (file-name (git-file-name name version))
11563 (sha256
11564 (base32 "0icbhf1wk523a7lcmwqa67zc6hl6h02p5mfg26cizva447kbwsgz"))))
11565 (build-system cmake-build-system)
11566 (arguments
11567 (list
11568 #:test-exclude "(runtime_tests|tools-parsing-test)"
11569 #:phases
11570 #~(modify-phases %standard-phases
11571 ;; This patch also fixes broken compilation due to improper detection
11572 ;; of bfd features. This is taken from following upstream PR:
11573 ;; https://github.com/bpftrace/bpftrace/pull/3332
11574 (add-after 'unpack 'patch-paths-and-bfd-defs
11575 (lambda _
11576 (substitute* '("cmake/FindLibBfd.cmake"
11577 "src/CMakeLists.txt")
11578 (("LIBSFRAME_FOUND")
11579 "LIBSFRAME_LIBRARIES")
11580 (("LIBZSTD_FOUND")
11581 "LIBZSTD_LIBRARIES"))
11582 (with-directory-excursion "tests"
11583 (substitute* (find-files ".")
11584 (("/bin/sh")
11585 (which "sh")))
11586 (substitute* '("child.cpp"
11587 "runtime/call"
11588 "procmon.cpp")
11589 (("/bin/ls")
11590 (which "ls"))))))
11591 (add-after 'unpack 'fix-paths
11592 (lambda* (#:key inputs outputs #:allow-other-keys)
11593 (substitute* '("tests/child.cpp")
11594 (("/bin/sleep")
11595 (search-input-file inputs "bin/sleep")))))
11596 (add-before 'check 'set-test-filter
11597 (lambda _
11598 (setenv "GTEST_FILTER"
11599 (string-join
11600 (list ; "-" disables all following tests
11601 "-ast.probe_name_uprobe"
11602 "bpftrace.add_probes_uprobe_wildcard_file"
11603 "bpftrace.add_probes_uprobe_wildcard_file_uprobe_multi"
11604 "bpftrace.add_probes_usdt_wildcard"
11605 "Parser.multiple_attach_points_kprobe"
11606 "Parser.uretprobe_offset"
11607 "semantic_analyser.builtin_functions"
11608 "semantic_analyser.call_func"
11609 "semantic_analyser.call_uaddr")
11610 ":")))))))
11611 (native-inputs (list bison coreutils dwarves flex googletest xxd))
11612 (inputs (list bcc clang-15 elfutils libbpf libiberty cereal))
11613 (home-page "https://github.com/bpftrace/bpftrace")
11614 (synopsis "High-level tracing language for Linux eBPF")
11615 (description
11616 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
11617Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
11618LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
11619interacting with the Linux BPF system, as well as existing Linux tracing
11620capabilities: kernel dynamic tracing (kprobes), user-level dynamic
11621tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
11622and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
11623created by Alastair Robertson.")
11624 (license license:asl2.0)))
11625
11626(define-public ttyebus-linux-module
11627 (let ((revision "0")
11628 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
11629 (package
11630 (name "ttyebus-linux-module")
11631 (version (git-version "1.5" revision commit))
11632 (source
11633 (origin
11634 (method git-fetch)
11635 (uri (git-reference
11636 (url "https://github.com/eBUS/ttyebus")
11637 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
11638 (file-name (git-file-name name version))
11639 (sha256
11640 (base32
11641 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
11642 (supported-systems '("armhf-linux" "aarch64-linux"))
11643 (build-system linux-module-build-system)
11644 (arguments
11645 `(#:tests? #f))
11646 (home-page "https://github.com/eBUS/ttyebus")
11647 (synopsis "Low-latency Raspberry Pi UART driver")
11648 (description "This package provides a Linux kernel module that will
11649provide a serial device @code{/dev/ttyebus} with almost no latency upon
11650receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
11651 (license license:gpl3+))))
11652
11653(define-public ipset
11654 (package
11655 (name "ipset")
11656 (version "7.17")
11657 (source
11658 (origin
11659 (method url-fetch)
11660 (uri (string-append "https://ipset.netfilter.org/"
11661 "ipset-" version ".tar.bz2"))
11662 (sha256
11663 (base32 "1n34mkrdha9rggd0fizjx6baqkiqqd1yfhb5ml663mlx93zwjjdy"))))
11664 (build-system gnu-build-system)
11665 (inputs
11666 (list libmnl))
11667 (native-inputs
11668 (list pkg-config))
11669 (arguments
11670 `(#:configure-flags '("--disable-static"
11671 "--with-kmod=no")))
11672 (home-page "https://ipset.netfilter.org/")
11673 (synopsis "Administration tool for IP sets")
11674 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
11675can be administered by the ipset utility. Depending on the type,
11676currently an IP set may store IP addresses, (TCP/UDP) port numbers or
11677IP addresses with MAC addresses in a way which ensures lightning speed
11678when matching an entry against a set.
11679
11680If you want to
11681@itemize @bullet
11682@item store multiple IP addresses or port numbers and match against the entire
11683collection using a single iptables rule.
11684@item dynamically update iptables rules against IP addresses or ports without
11685performance penalty.
11686@item express complex IP address and ports based rulesets with a single
11687iptables rule and benefit from the speed of IP sets.
11688@end itemize\n
11689then IP sets may be the proper tool for you.")
11690 (license license:gpl2+)))
11691
11692(define-public liburing
11693 (package
11694 (name "liburing")
11695 (version "2.12")
11696 (source (origin
11697 (method git-fetch)
11698 (uri (git-reference
11699 (url "https://git.kernel.dk/liburing")
11700 (commit (string-append "liburing-" version))))
11701 (file-name (git-file-name name version))
11702 (sha256
11703 (base32
11704 "0vz3p7g0nzcg5bag7kqkdncigl9nc0vrzm07l8yww2gb529k6hxh"))))
11705 (build-system gnu-build-system)
11706 (arguments
11707 `(;; Tests are dependent on kernel version and features
11708 #:tests? #f
11709 #:phases
11710 (modify-phases %standard-phases
11711 (replace 'configure
11712 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
11713 ;; --enable-fast-install, and --build
11714 (lambda* (#:key outputs #:allow-other-keys)
11715 (let ((out (assoc-ref outputs "out")))
11716 (setenv "SHELL" (which "sh"))
11717 (setenv "CONFIG_SHELL" (which "sh"))
11718 (invoke "./configure" (string-append "--prefix=" out))))))))
11719 (home-page "https://github.com/axboe/liburing")
11720 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
11721 (description "This is the io_uring library, liburing. liburing provides
11722helpers to setup and teardown io_uring instances, and also a simplified
11723interface for applications that don't need (or want) to deal with the full
11724kernel side implementation.")
11725 (license license:expat)))
11726
11727(define-public erofs-utils
11728 (package
11729 (name "erofs-utils")
11730 (version "1.8.10")
11731 (source
11732 (origin
11733 (method git-fetch)
11734 (uri (git-reference
11735 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
11736 (commit (string-append "v" version))))
11737 (file-name (git-file-name name version))
11738 (sha256
11739 (base32 "1qlig9q1fdjl0zn7206dbv7w5ssjg4az4hg7y3vk69ly0zbmwkil"))))
11740 (build-system gnu-build-system)
11741 (inputs
11742 (list lz4
11743 `(,util-linux "lib")
11744 zlib))
11745 (native-inputs
11746 (list autoconf automake libtool pkg-config))
11747 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
11748 (synopsis "User-space tools for the EROFS file system")
11749 (description
11750 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
11751read-only file system optimized for resource-scarce devices. This package
11752provides user-space tools for creating EROFS file systems.")
11753 (license license:gpl2+)))
11754
11755(define-public rasdaemon
11756 (package
11757 (name "rasdaemon")
11758 (version "0.8.3")
11759 (source
11760 (origin
11761 (method git-fetch)
11762 (uri (git-reference
11763 (url "https://github.com/mchehab/rasdaemon")
11764 (commit (string-append "v" version))))
11765 (file-name (git-file-name name version))
11766 (sha256
11767 (base32 "0vfw4vf75fnpbxnfsmpdwdzhplnccz24j23bg6nsb3b4wa8hv4sa"))))
11768 (native-inputs (list autoconf automake libtool pkg-config))
11769 (inputs (list bash-minimal libtraceevent perl perl-dbd-sqlite sqlite dmidecode kmod))
11770 (arguments
11771 (list
11772 #:configure-flags
11773 #~(list "--enable-all"
11774 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
11775 "--with-sysconfdefdir=."
11776 "--localstatedir=/var")
11777 #:phases
11778 #~(modify-phases %standard-phases
11779 (add-after 'unpack 'rename-README
11780 (lambda _
11781 ;; Required by autoreconf
11782 (rename-file "README.md" "README")))
11783 (add-before 'configure 'munge-autotools
11784 (lambda _
11785 ;; For some reason upstream forces sysconfdir=/etc. This results
11786 ;; in EPERM during the install phase. Removing the offending
11787 ;; line lets sysconfdir correctly pick up DESTDIR.
11788 (substitute* "configure.ac"
11789 (("^test .* sysconfdir=/etc\n$") ""))))
11790 (add-after 'install 'wrap-rasdaemon
11791 (lambda* (#:key inputs #:allow-other-keys)
11792 (let ((path (map dirname
11793 (list (search-input-file inputs "/sbin/dmidecode")
11794 (search-input-file inputs "/bin/modprobe")))))
11795 (wrap-program (string-append #$output "/sbin/ras-mc-ctl")
11796 `("PATH" ":" prefix ,path)
11797 `("PERL5LIB" ":" prefix ,(string-split (getenv "PERL5LIB") #\:)))))))))
11798 (build-system gnu-build-system)
11799 (home-page "https://github.com/mchehab/rasdaemon")
11800 (synopsis "Platform Reliability, Availability, and Serviceability tools")
11801 (description
11802 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
11803Availability and Serviceability} reports from Linux kernel trace events.
11804These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
11805through standard log mechanisms like syslog.")
11806 (license license:gpl2)))
11807
11808(define-public renameat2
11809 ;; This is a Gist, with no release or tags.
11810 (let ((revision "0")
11811 (commit "5c5193f20142511a5fc7069a539f4e5aba0ea470"))
11812 (package
11813 (name "renameat2")
11814 (version (git-version "0.0.0" revision commit))
11815 (source (origin
11816 (method url-fetch)
11817 (uri (string-append "https://gist.githubusercontent.com/"
11818 "eatnumber1/f97ac7dad7b1f5a9721f/raw/"
11819 commit "/renameat2.c"))
11820 (sha256
11821 (base32
11822 "07b4hsxqjm610sdkm4nxhp0gnl2s7gzlh4zdnja5ay40v4x24bb9"))))
11823 (build-system gnu-build-system)
11824 (arguments
11825 (list
11826 #:tests? #f ;no test suite
11827 #:phases #~(modify-phases %standard-phases
11828 (delete 'configure)
11829 (replace 'build
11830 (lambda _
11831 (invoke #$(cc-for-target) "renameat2.c"
11832 "-o" "renameat2")))
11833 (replace 'install
11834 (lambda _
11835 (install-file "renameat2"
11836 (string-append #$output "/bin")))))))
11837 (home-page "https://gist.github.com/eatnumber1/f97ac7dad7b1f5a9721f")
11838 (synopsis "Command to call the renameat2 Linux system call")
11839 (description "This package provides a @command{renameat2} command that
11840calls the Linux-specific @code{renameat2} system call.")
11841 (license license:expat))))
11842
11843(define-public libgpiod
11844 (package
11845 (name "libgpiod")
11846 (version "2.2.2")
11847 (source
11848 (origin
11849 (method git-fetch)
11850 (uri
11851 (git-reference
11852 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
11853 (commit (string-append "v" version))))
11854 (file-name (git-file-name name version))
11855 (sha256 (base32 "10yiwrw80x0057w825zxmdbd54w9lbyf49bgqk1cryqapglfzqri"))))
11856 (build-system gnu-build-system)
11857 (arguments
11858 (list #:configure-flags
11859 #~(list "--enable-tools=yes"
11860 "--enable-bindings-cxx")))
11861 (native-inputs
11862 (list automake
11863 autoconf-2.71
11864 libtool
11865 autoconf-archive
11866 pkg-config))
11867 (synopsis "Interact with the Linux GPIO character device")
11868 (description
11869 "This package provides a C library with C++ bindings and
11870command-line tools for interacting with GPIO devices that avoids the usage of
11871older system-wide @file{/sys} interface.")
11872 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
11873 (license (list license:lgpl2.1+ ;; libgpiod
11874 license:gpl2+ ;; gpio-tools
11875 license:lgpl3+)))) ;; C++ bindings
11876
11877(define-public python-libgpiod
11878 (package
11879 (name "python-libgpiod")
11880 (version "2.3.0")
11881 (source
11882 (origin
11883 (method git-fetch)
11884 (uri
11885 (git-reference
11886 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
11887 (commit (string-append "python-v" version))))
11888 (file-name (git-file-name name version))
11889 (sha256 (base32 "1lkd7lgpb28pqf7p6lrwl0ss7r5ryiddmdcisnz6ixy796qhr8kr"))))
11890 (build-system pyproject-build-system)
11891 (arguments
11892 (list
11893 #:tests? #f ; tests require root, see README.md
11894 #:phases
11895 #~(modify-phases %standard-phases
11896 (add-after 'unpack 'cd-to-python-bindings
11897 (lambda _
11898 (chdir "bindings/python"))))))
11899 (native-inputs
11900 (list python-setuptools
11901 python-wheel
11902 libgpiod))
11903 (synopsis "Interact with the Linux GPIO character device")
11904 (description
11905 "This package provides Python bindings for interacting with GPIO devices
11906that avoids the usage of older system-wide @file{/sys} interface.")
11907 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
11908 (license (list license:lgpl2.1+ ;; libgpiod
11909 license:gpl2+ ;; gpio-tools
11910 license:lgpl3+)))) ;; C++ bindings
11911
11912(define-public libtraceevent
11913 (package
11914 (name "libtraceevent")
11915 (version "1.7.3")
11916 (source
11917 (origin
11918 (method git-fetch)
11919 (uri (git-reference
11920 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git")
11921 (commit (string-append name "-" version))))
11922 (file-name (git-file-name name version))
11923 (sha256
11924 (base32 "06mw2f0xnk6dy9w2z0n4dz7lnm02qfsmnmj2h24453qxlw57x0d6"))
11925 (modules '((guix build utils)))
11926 (snippet
11927 #~(begin
11928 (substitute* (list "Makefile" "scripts/utils.mk")
11929 (("/bin/(pwd)" _ command) command))))))
11930 (build-system gnu-build-system)
11931 (arguments
11932 (list
11933 #:tests? #f ; no test suite
11934 #:make-flags
11935 #~(list
11936 (string-append "pkgconfig_dir=" #$output "/lib/pkgconfig")
11937 (string-append "prefix=" #$output))
11938 #:phases
11939 #~(modify-phases %standard-phases
11940 (delete 'configure)))) ; no configure script
11941 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/")
11942 (synopsis "Linux kernel trace event library")
11943 (description
11944 "This library parses raw Linux kernel trace event formats.")
11945 (license (list license:gpl2
11946 license:lgpl2.1))))
11947
11948(define-public libtracefs
11949 (package
11950 (name "libtracefs")
11951 (version "1.7.0")
11952 (source
11953 (origin
11954 (method git-fetch)
11955 (uri (git-reference
11956 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git")
11957 (commit (string-append name "-" version))))
11958 (file-name (git-file-name name version))
11959 (sha256
11960 (base32 "0v896n3q0df0nxx5drbwyaqhrqiyxl06rvrdw3gp2r37awa9g1zb"))
11961 (modules '((guix build utils)))
11962 (snippet
11963 #~(begin
11964 (substitute* (list "Makefile" "scripts/utils.mk")
11965 (("/bin/(pwd)" _ command) command))))))
11966 (build-system gnu-build-system)
11967 (arguments
11968 (list
11969 #:tests? #f ; no test suite
11970 #:make-flags
11971 #~(list
11972 (string-append "CC=" #$(cc-for-target))
11973 (string-append "pkgconfig_dir=" #$output "/lib/pkgconfig")
11974 (string-append "prefix=" #$output))
11975 #:phases
11976 #~(modify-phases %standard-phases
11977 (delete 'configure)))) ; no configure script
11978 (native-inputs (list pkg-config))
11979 (inputs (list libtraceevent))
11980 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/")
11981 (synopsis "Linux kernel trace file system library")
11982 (description
11983 "This library provides APIs to access the Linux kernel's trace file
11984system.")
11985 (license (list license:gpl2
11986 license:lgpl2.1))))
11987
11988(define-public libtree
11989 (package
11990 (name "libtree")
11991 (version "3.1.1")
11992 (source
11993 (origin
11994 (method git-fetch)
11995 (uri (git-reference
11996 (url "https://github.com/haampie/libtree")
11997 (commit (string-append "v" version))))
11998 (file-name (git-file-name name version))
11999 (patches (search-patches "libtree-fix-check-non-x86.patch"))
12000 (sha256
12001 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb"))))
12002 (arguments
12003 (list #:make-flags
12004 ;; NOTE: Official documentation recommends to build libtree with
12005 ;; "-static" flag.
12006 #~(list (string-append "CC=" #$(cc-for-target))
12007 (string-append "PREFIX=" #$output))
12008 #:phases
12009 #~(modify-phases %standard-phases
12010 (add-after 'unpack 'fix-tests
12011 ;; XXX: '08_nodeflib' fails as 'libtree' returns a non-zero
12012 ;; code in one of the tests.
12013 ;;
12014 ;; See <https://github.com/haampie/libtree/issues/80>).
12015 (lambda _
12016 (substitute* "tests/08_nodeflib/Makefile"
12017 (("! ../../libtree -vvv exe_b")
12018 "../../libtree -vvv exe_b"))))
12019 (delete 'configure))))
12020 (build-system gnu-build-system)
12021 (home-page "https://github.com/haampie/libtree")
12022 (synopsis "Show output of @command{ldd} as a tree")
12023 (description
12024 "This tool turns @command{ldd} into a tree and explains how shared
12025libraries are found or why they cannot be located.")
12026 (license license:expat)))
12027
12028(define-public touchegg
12029 (package
12030 (name "touchegg")
12031 (version "2.0.18")
12032 (source
12033 (origin
12034 (method git-fetch)
12035 (uri (git-reference
12036 (url "https://github.com/JoseExposito/touchegg")
12037 (commit version)))
12038 (file-name (git-file-name name version))
12039 (sha256
12040 (base32 "0m8zgihij14b8dxrxxvpl8sdsx49mjlnxnm0fhgfxscy7n07kcpc"))))
12041 (build-system cmake-build-system)
12042 (arguments
12043 `(#:tests? #f ; No tests exist
12044 #:configure-flags
12045 (list "-DUSE_SYSTEMD=OFF"))) ; No systemd
12046 (native-inputs
12047 (list
12048 pkg-config))
12049 (inputs
12050 (list
12051 cairo
12052 gtk+
12053 libgudev
12054 libinput
12055 libxrandr
12056 libxtst
12057 pugixml))
12058 (home-page "https://github.com/JoseExposito/touchegg")
12059 (synopsis "Multitouch gesture recognizer")
12060 (description
12061 "Touchégg is an application that runs in the background and transform the
12062gestures you make on your touchpad or touchscreen into visible actions in your
12063desktop.")
12064 (license license:gpl3+)))
12065
12066(define-public evtest
12067 (package
12068 (name "evtest")
12069 (version "1.36")
12070 (source (origin
12071 (method git-fetch)
12072 (uri (git-reference
12073 (url "https://gitlab.freedesktop.org/libevdev/evtest")
12074 (commit (string-append "evtest-" version))))
12075 (file-name (git-file-name name version))
12076 (sha256
12077 (base32
12078 "0mwjvz0fwwcwm4fpw0m4x8bcxpnzjkiy7fpb438vf4i5g5q0dc1k"))))
12079 (build-system gnu-build-system)
12080 (arguments
12081 (list #:tests? #f ;No tests exist
12082 #:make-flags #~(list (string-append "CC="
12083 #$(cc-for-target))
12084 (string-append "PREFIX="
12085 #$output))
12086 #:phases #~(modify-phases %standard-phases
12087 (add-after 'unpack 'generate-doc
12088 (lambda _
12089 (invoke "asciidoc" "-d" "manpage"
12090 "-b" "docbook"
12091 "-o" "evtest.1.xml"
12092 "evtest.txt")
12093 (invoke "xsltproc" "--nonet"
12094 (string-append
12095 #$(this-package-native-input "docbook-xsl")
12096 "/xml/xsl/docbook-xsl-"
12097 #$(package-version
12098 (this-package-native-input "docbook-xsl"))
12099 "/manpages/docbook.xsl")
12100 "evtest.1.xml")))
12101 (replace 'bootstrap
12102 (lambda _
12103 (setenv "CONFIG_SHELL" (which "sh"))
12104 (invoke "autoreconf" "-fi"))))))
12105 (native-inputs (list autoconf
12106 automake
12107 bash-minimal
12108 xmlto
12109 docbook-xsl
12110 libxslt
12111 asciidoc))
12112 (home-page "https://gitlab.freedesktop.org/libevdev/evtest")
12113 (synopsis "Kernel evdev device information and monitor")
12114 (description
12115 "@code{evtest} is a tool to print @code{evdev} kernel events. It reads
12116directly from the kernel device and prints a device description and the events
12117with the value and the symbolic name.")
12118 (license license:gpl2+)))
12119
12120(define-public tp-smapi-module
12121 (package
12122 (name "tp-smapi-module")
12123 (version "0.44")
12124 (source (origin
12125 (method git-fetch)
12126 (uri (git-reference
12127 (url "https://github.com/linux-thinkpad/tp_smapi")
12128 (commit (string-append "tp-smapi/" version))))
12129 (file-name (git-file-name name version))
12130 (sha256
12131 (base32
12132 "0kzbks07bh5jbi1n311zp9cbp1xxyzi7nys8wq1k0k5ig81h9w6k"))))
12133 (build-system linux-module-build-system)
12134 (arguments
12135 `(#:tests? #f)) ;there are none.
12136 (home-page "https://github.com/linux-thinkpad/tp_smapi")
12137 (synopsis
12138 "Linux Kernel module exposing features of ThinkPad hardware")
12139 (description
12140 "This package provides a Linux Kernel module that controls
12141battery charging of specific ThinkPad laptops. It also includes an improved
12142version of the HDAPS driver. The underlying hardware interfaces are
12143@acronym{SMAPI, System Management Application Program Interface} and direct
12144access to the embedded controller.")
12145 (license license:gpl2+)))
12146
12147(define-public modprobed-db
12148 (package
12149 (name "modprobed-db")
12150 (version "2.48")
12151 (source (origin
12152 (method git-fetch)
12153 (uri (git-reference
12154 (url "https://github.com/graysky2/modprobed-db")
12155 (commit (string-append "v" version))))
12156 (file-name (git-file-name name version))
12157 (sha256
12158 (base32
12159 "0jscinga32jjvy3vwl4s1pyd5fjgqhmmk010k665nhil302hzjdc"))))
12160 (build-system gnu-build-system)
12161 (arguments
12162 (list #:tests? #f ;no tests
12163 #:make-flags
12164 #~(list (string-append "PREFIX=" #$output)
12165 "INITDIR_SYSTEMD=no-thanks")
12166 #:phases
12167 #~(modify-phases %standard-phases
12168 (delete 'configure)
12169 (add-after 'install 'fix-path
12170 (lambda* (#:key inputs #:allow-other-keys)
12171 (substitute* (string-append #$output "/bin/modprobed-db")
12172 (("/usr") #$output)
12173 (((string-append "(" (string-join (list "awk"
12174 "cp"
12175 "cut"
12176 "getent"
12177 "grep"
12178 "logname"
12179 "md5sum"
12180 "mkdir"
12181 "mv"
12182 "sed"
12183 "sort"
12184 "uniq"
12185 "wc")
12186 "|") ")") m)
12187 (search-input-file inputs (string-append "/bin/" m)))
12188 (("modprobe ")
12189 (string-append
12190 (search-input-file inputs "/bin/modprobe") " "))))))))
12191 (inputs (list coreutils kmod gawk glibc grep sed))
12192 (home-page "https://wiki.archlinux.org/title/Modprobed-db")
12193 (synopsis "Keep track of Linux modules that have been probed")
12194 (description
12195 "Modprobed-db is a useful utility for users wishing to build a minimal
12196kernel via a @code{make localmodconfig}. In a nutshell, this @command{make}
12197target creates a config based on the current config and a list of modules you
12198define (that @command{modprobed-db} keeps for you). It then disables any
12199module option that is not needed thus not building extraneous modules. This
12200results in a system-specific, streamlined kernel package and footprint as well
12201as reduced compilation times.
12202
12203Modprobed-db simply logs every module ever probed on the target system to a
12204text-based database (@file{$XDG_CONFIG_HOME/modprobed-db}), which can be read
12205directly by @code{make localmodconfig} as described above.")
12206 (license license:expat)))
12207
12208(define-public kernel-hardening-checker
12209 (package
12210 (name "kernel-hardening-checker")
12211 (version "0.6.17.1")
12212 (source (origin
12213 (method git-fetch)
12214 (uri (git-reference
12215 (url "https://github.com/a13xp0p0v/kernel-hardening-checker")
12216 (commit (string-append "v" version))))
12217 (file-name (git-file-name name version))
12218 (sha256
12219 (base32
12220 "04r9bbayhs1ik84908q148k9djawy69zarxw0vc31dfbf64mni62"))))
12221 (build-system pyproject-build-system)
12222 (arguments
12223 (list #:tests? #f)) ;no active tests, runtime only, see GitHub Actions
12224 (native-inputs
12225 (list python-setuptools))
12226 (home-page "https://github.com/a13xp0p0v/kernel-hardening-checker")
12227 (synopsis
12228 "Tool for checking the security hardening options of the Linux kernel")
12229 (description
12230 "@code{kernel-hardening-checker} is a tool for checking the security
12231hardening options of the Linux kernel. Provided preferences are based on
12232suggestions from various sources, including:
12233
12234@itemize
12235@item KSPP recommended settings
12236@item CLIP OS kernel configuration
12237@item Last public grsecurity patch (options which they disable)
12238@item SECURITY_LOCKDOWN_LSM patchset
12239@item Direct feedback from the Linux kernel maintainers
12240@end itemize\n
12241This tool supports checking Kconfig options and kernel cmdline parameters.")
12242 (license license:gpl3)))
12243
12244(define-deprecated-package kconfig-hardened-check
12245 kernel-hardening-checker)
12246
12247(define-public firejail
12248 (package
12249 (name "firejail")
12250 (version "0.9.74")
12251 (source (origin
12252 (method url-fetch)
12253 (uri (string-append
12254 "https://github.com/netblue30/firejail/releases/download/" version
12255 "/firejail-" version ".tar.xz" ))
12256 (sha256
12257 (base32
12258 "04w11jjh62ghs66ippw5xlg3l7l9mi3b5cpch1cg3fw7gxnbbn3h"))))
12259 (arguments
12260 (list #:phases
12261 #~(modify-phases %standard-phases
12262 (replace 'check
12263 (lambda* (#:key tests? #:allow-other-keys)
12264 (when tests?
12265 (with-directory-excursion "test"
12266 (invoke "make"))))))))
12267 (build-system gnu-build-system)
12268 (inputs
12269 (list apparmor xdg-dbus-proxy))
12270 (synopsis "Linux namespaces sandbox program")
12271 (description
12272 "Firejail is a SUID sandbox program that reduces the risk of security
12273breaches by restricting the running environment of untrusted applications
12274using Linux namespaces, seccomp-bpf and Linux capabilities. The software
12275includes sandbox profiles for a number of common Linux programs. Firejail
12276should be added to the list of setuid programs in the system configuration to
12277work properly.")
12278 (home-page "https://github.com/netblue30/firejail")
12279 (supported-systems
12280 (filter (cut string-suffix? "-linux" <>) %supported-systems))
12281 (license license:gpl2+)))
12282
12283(define-public firejail-disable-sandbox-check
12284 (package/inherit
12285 firejail
12286 (name "firejail-disable-sandbox-check")
12287 (arguments
12288 (substitute-keyword-arguments (package-arguments firejail)
12289 ((#:configure-flags flags #~'())
12290 #~(append #$flags
12291 (list "--disable-sandbox-check")))))
12292 (description
12293 (string-append (package-description firejail)
12294 " Builded with @code{--disable-sandbox-check}, which is
12295 only intended for development."))))
12296
12297(define-public edac-utils
12298 (package
12299 (name "edac-utils")
12300 (version "0.18")
12301 (source (origin
12302 (method git-fetch)
12303 (uri (git-reference
12304 (url "https://github.com/grondo/edac-utils.git")
12305 (commit version)))
12306 (file-name (string-append name "-" version "-checkout"))
12307 (sha256
12308 (base32
12309 "04j686m58wsnyy5di7rz0sw9jahlm4ziwxjmgs31pjb87vzw3xgp"))))
12310 (build-system gnu-build-system)
12311 (native-inputs
12312 (list perl))
12313 (inputs
12314 (list sysfsutils))
12315 (synopsis "Memory error detection and correction userspace helpers")
12316 (description "This package provides userspace helpers for memory
12317error detection and correction (EDAC).")
12318 (home-page "https://github.com/grondo/edac-utils")
12319 (license license:gpl2+)))
12320
12321(define-public spectre-meltdown-checker
12322 (package
12323 (name "spectre-meltdown-checker")
12324 (version "0.46")
12325 (source (origin
12326 (method git-fetch)
12327 (uri (git-reference
12328 (url "https://github.com/speed47/spectre-meltdown-checker")
12329 (commit (string-append "v" version))))
12330 (file-name (git-file-name name version))
12331 (patches
12332 (search-patches
12333 "spectre-meltdown-checker-externalize-fwdb.patch"))
12334 ;; Remove builtin firmware database.
12335 (modules '((guix build utils)))
12336 (snippet '(substitute* "spectre-meltdown-checker.sh"
12337 (("^# [AI],.*") "")))
12338 (sha256
12339 (base32
12340 "0j42p6dayb7k87kf8sqimxlaswis3qh0569a15zccyknv9vf129k"))))
12341 (build-system copy-build-system)
12342 (arguments
12343 (list
12344 #:install-plan
12345 #~'(("spectre-meltdown-checker.sh" "bin/spectre-meltdown-checker"))
12346 #:phases
12347 #~(modify-phases %standard-phases
12348 (add-after 'unpack 'fixpath
12349 (lambda* (#:key inputs #:allow-other-keys)
12350 (define* (find-command inputs cmd #:optional (bin "bin"))
12351 (search-input-file inputs (string-append bin "/" cmd)))
12352 (substitute* "spectre-meltdown-checker.sh"
12353 ;; ${opt_arch_prefix}CMD
12354 (("\\$\\{opt_arch_prefix\\}\\<(nm|objdump|readelf|strings)\\>"
12355 all cmd)
12356 (find-command inputs cmd))
12357
12358 ;; Commands safe to substitute directly.
12359 (("\\<(awk|(base|dir)name|bunzip2|g(un)?zip|lz4)\\>" all cmd)
12360 (find-command inputs cmd))
12361 (("\\<(lzop|mktemp|modprobe|pgrep|rmmod|umount)\\>" all cmd)
12362 (find-command inputs cmd))
12363 (("\\<(unlzma|unxz|unzstd|uuencode)\\>" all cmd)
12364 (find-command inputs cmd))
12365
12366 ;; Commands which should only be substituted based on their
12367 ;; surroundings: First up, dd.
12368 (("\\<(dd)\\> if=" all cmd)
12369 (string-append
12370 (find-command inputs cmd)
12371 " if="))
12372
12373 ;; Another special case: sysctl is in sbin.
12374 (("(if |\\$\\( *)\\<(sysctl)\\>" all pre cmd)
12375 (string-append pre (find-command inputs cmd "sbin")))
12376
12377 ;; Meow
12378 (("cat (<<EOF|\"\\$)" all what)
12379 (string-append (find-command inputs "cat") " " what))
12380 (("'cat'")
12381 (string-append "'" (find-command inputs "cat") "'"))
12382 (("\"cat\"")
12383 (string-append "\"" (find-command inputs "cat") "\""))
12384
12385 ;; ${COMMAND} -
12386 ;; ${COMMAND} ^
12387 (("\\<(base64|cut|grep|head|id|mount)\\> ([-^])" all cmd suffix)
12388 (string-append (find-command inputs cmd) " " suffix))
12389 (("\\<(od|perl|rm|uname|xargs)\\> ([-^])" all cmd suffix)
12390 (string-append (find-command inputs cmd) " " suffix))
12391
12392 ;; ${COMMAND} |
12393 (("\\<(dmesg)\\> \\|" all cmd)
12394 (string-append (find-command inputs cmd) " |"))
12395 ;; | ${COMMAND}
12396 (("\\| \\<(grep|sed|sort|stat|tr)\\>" all cmd)
12397 (string-append "| " (find-command inputs cmd)))
12398
12399 ;; Command in sub-shell, i.e. $($COMMAND ...)
12400 (("\\$\\( *(\\<cat|find|grep|mount|nproc|stat|tr\\>)"
12401 all cmd)
12402 (string-append "$(" (find-command inputs cmd)))
12403
12404 ;; command -v
12405 (("command -v \"*\\<(base64|nproc|perl|printf)\\>\"*" all cmd)
12406 (string-append "command -v " (find-command inputs cmd)))))))))
12407 (inputs (list kmod lz4 lzop perl procps sharutils util-linux zstd))
12408 (home-page "https://github.com/speed47/spectre-meltdown-checker")
12409 (synopsis "CPU vulnerability / mitigation checker")
12410 (description
12411 "This package provides a shell script to assess your system's resilience
12412against the several transient execution CVEs that were published since early
124132018, and gives guidance as to how to mitigate them.")
12414 (license license:gpl3)))
12415
12416(define-public csmith
12417 (package
12418 (name "csmith")
12419 (version "2.3.0")
12420 (source (origin
12421 (method git-fetch)
12422 (uri (git-reference
12423 (url "https://github.com/csmith-project/csmith")
12424 (commit (string-append "csmith-" version))))
12425 (file-name (git-file-name name version))
12426 (sha256
12427 (base32
12428 "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
12429 (build-system gnu-build-system)
12430 (native-inputs
12431 (list autoconf automake libtool m4 perl))
12432 (arguments
12433 (list
12434 #:tests? #f ;no test suite
12435 ;; Do not install headers under 'include/csmith-VERSION' but in
12436 ;; 'include/csmith'.
12437 #:phases
12438 `(modify-phases %standard-phases
12439 (add-after 'unpack 'patch-includedir
12440 (lambda _
12441 (substitute* "runtime/Makefile.am"
12442 (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
12443 "$(includedir)/$(PACKAGE)"))))
12444 (add-before 'bootstrap 'force-bootstrap
12445 (lambda _
12446 (delete-file "configure"))))))
12447 (home-page "https://github.com/csmith-project/csmith")
12448 (synopsis "Random generator of C programs")
12449 (description "The primary purpose of Csmith is to find compiler bugs with
12450random programs using differential testing.")
12451 (license license:bsd-4)))
12452
12453(define-public ipvsadm
12454 (package
12455 (name "ipvsadm")
12456 (version "1.31")
12457 (source
12458 (origin
12459 (method url-fetch)
12460 (uri (string-append "https://kernel.org/pub/linux/utils/kernel"
12461 "/ipvsadm/ipvsadm-" version ".tar.xz"))
12462 (sha256
12463 (base32 "1nyzpv1hx75k9lh0vfxfhc0p2fpqaqb38xpvs8sn88m1nljmw2hs"))))
12464 (build-system gnu-build-system)
12465 (native-inputs (list linux-libre-headers pkg-config which))
12466 (inputs (list libnl popt))
12467 (arguments
12468 (list #:tests? #f
12469 #:parallel-build? #f ;build fails randomly with '-j'
12470 #:make-flags
12471 #~(list (string-join
12472 (list "CFLAGS="
12473 (string-append "-I"
12474 #$(this-package-input "libnl")
12475 "/include/libnl3")
12476 (string-append "-L" #$(this-package-input "libnl")
12477 "/lib")
12478 "-fPIC")
12479 " ")
12480 (string-append "CC=" #$(cc-for-target))
12481 (string-append "SBIN=" #$output "/sbin")
12482 (string-append "INIT=" #$output "/etc/init.d")
12483 (string-append "MANDIR=" #$output "/share/man"))
12484 #:phases #~(modify-phases %standard-phases
12485 (delete 'configure))))
12486 (home-page "http://www.linuxvirtualserver.org/software/ipvs.html")
12487 (synopsis "IP virtual server administration utility")
12488 (description "@code{ipvsadm(8)} is used to set up, maintain or inspect the
12489virtual server table in the Linux kernel. The Linux Virtual Server can be used
12490to build scalable network services based on a cluster of two or more nodes.")
12491 (license license:gpl2+)))
12492
12493(define-public ryzenadj
12494 (package
12495 (name "ryzenadj")
12496 (version "0.17.0")
12497 (source (origin
12498 (method url-fetch)
12499 (uri (string-append "https://github.com/flygoat/ryzenadj/archive/refs/tags/"
12500 "v" version ".tar.gz"))
12501 (sha256
12502 (base32 "0i2x6kbn2ix52vjz1mmh0c0g3w0k4sn0lq68wbsk0pgndzcck2l4"))
12503 (modules '((guix build utils)))
12504 (snippet
12505 '(begin (delete-file-recursively "win32")
12506 #t))))
12507 (build-system cmake-build-system)
12508 (inputs (list pciutils))
12509 (arguments
12510 (list #:tests? #f ; No test suite
12511 #:phases #~(modify-phases %standard-phases
12512 (add-before 'install 'build
12513 (lambda _
12514 (invoke "cmake" "-DCMAKE_BUILD_TYPE=Release" "."))))))
12515 (home-page "https://github.com/flygoat/ryzenadj")
12516 (synopsis "Power management tool for AMD Ryzen APUs")
12517 (description
12518 "@command{ryzenadj} is an utility to adjust power management settings for
12519AMD Ryzen mobile processors. You will need to ensure it can access /dev/mem,
12520for instance by using the \"iomem=relaxed\" kernel argument.")
12521 (license license:lgpl3)))
12522
12523(define-public ryzen-smu
12524 (package
12525 (name "ryzen-smu")
12526 (version "0.1.5")
12527 (source (origin
12528 (method git-fetch)
12529 (uri (git-reference
12530 (url "https://gitlab.com/leogx9r/ryzen_smu.git")
12531 (commit (string-append "v" version))))
12532 (file-name (git-file-name name version))
12533 (sha256
12534 (base32
12535 "010la2a8zp7rljlg5ssc9ragzva4ca05gvzlicjagl508659d2wz"))))
12536 (build-system linux-module-build-system)
12537 (arguments
12538 `(#:tests? #f)) ; no tests
12539 (synopsis "System Management Unit driver for AMD Ryzen processors")
12540 (description "This package provides a way to access the
12541System Management Unit for certain AMD Ryzen processors.
12542This includes access to the System Management Network.")
12543 (home-page "https://gitlab.com/leogx9r/ryzen_smu")
12544 (license license:gpl2)))
12545
12546(define-public hid-wiimote-plus
12547 (package
12548 (name "hid-wiimote-plus")
12549 (version "0.9.2")
12550 (source (origin
12551 (method git-fetch)
12552 (uri (git-reference
12553 (url "https://github.com/dkosmari/hid-wiimote-plus.git")
12554 (commit (string-append "v" version))))
12555 (file-name (git-file-name name version))
12556 (sha256
12557 (base32
12558 "1rkp311x60jm73xlqypxsp375rx3fa55jyrspz1aqjga0q6cvswi"))))
12559 (build-system linux-module-build-system)
12560 (arguments
12561 (list #:tests? #f)) ; No tests.
12562 (synopsis "WiiMote HID kernel module")
12563 (description "This package provides a WiiMote driver that follows the
12564Linux input convention. Specifically, that allows you to use the D-pad
12565as a gamepad.")
12566 (home-page "https://github.com/dkosmari/hid-wiimote-plus")
12567 (license license:gpl2+)))
12568
12569(define-public python-evemu
12570 (package
12571 (name "python-evemu")
12572 (version "2.7.0")
12573 (source (origin
12574 (method git-fetch)
12575 (uri (git-reference
12576 (url "https://gitlab.freedesktop.org/libevdev/evemu")
12577 (commit (string-append "v" version))))
12578 (file-name (git-file-name name version))
12579 (sha256
12580 (base32
12581 "1sxf6v2wnajj9srlkfjfymjmmp4dlq73gzjcjmaw015a3c0xl029"))))
12582 (build-system gnu-build-system)
12583 (arguments
12584 (list #:tests? #f ; would open device files
12585 #:phases
12586 #~(modify-phases %standard-phases
12587 (add-after 'unpack 'patch
12588 (lambda* (#:key inputs #:allow-other-keys)
12589 (substitute* "python/evemu/base.py"
12590 (("\"libevdev.so\"")
12591 (string-append "\"" (assoc-ref inputs "libevdev")
12592 "/lib/libevdev.so\""))))))))
12593 (native-inputs
12594 (list asciidoc autoconf automake libtool docbook-xsl pkg-config
12595 python-wrapper xmlto))
12596 (inputs
12597 (list libevdev))
12598 (synopsis "Record and replay input device events")
12599 (description "This package provides a way to record and replay device
12600descriptions and events, making it possible to emulate input devices
12601through the Linux kernel's input system. Emulated devices are for most
12602practical purposes indistinguishable from real devices.
12603
12604It provides a command line program and also a Python library.")
12605 (home-page "https://www.freedesktop.org/wiki/Evemu/")
12606 (license license:gpl3)))
12607
12608(define-public dualsensectl
12609 (package
12610 (name "dualsensectl")
12611 (version "0.7")
12612 (source (origin
12613 (method git-fetch)
12614 (uri (git-reference
12615 (url "https://github.com/nowrep/dualsensectl.git")
12616 (commit (string-append "v" version))))
12617 (file-name (git-file-name name version))
12618 (sha256
12619 (base32
12620 "05snsp5r3hc2yc1nf0w4aam1my4h0lkxnmy7k4glxvasd9jwahzw"))))
12621 (build-system meson-build-system)
12622 (native-inputs
12623 (list pkg-config))
12624 (inputs
12625 (list eudev dbus hidapi))
12626 (synopsis "Linux tool for controlling PS5 DualSense controller")
12627 (description "This package provides a Linux tool for controlling a PS5
12628DualSense controller. It has to be already connected via USB or connected
12629via Bluetooth.")
12630 (home-page "https://github.com/nowrep/dualsensectl")
12631 (license license:gpl2)))