projects/guix·blob mpd-fix-groups · refs

12848 lines · 568.7 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.7")
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 "03lxl2p8hvi4hdzbf72v3xh8yigr58826dmy6rqxbq9r8h6ymwnx")))
543 (make-linux-libre-source version
544 (%upstream-linux-source version hash)
545 deblob-scripts-6.17)))
546
547(define-public linux-libre-6.16-version "6.16.12")
548(define-public linux-libre-6.16-gnu-revision "gnu")
549(define deblob-scripts-6.16
550 (linux-libre-deblob-scripts
551 linux-libre-6.16-version
552 linux-libre-6.16-gnu-revision
553 (base32 "0qwh82z5bjmq7hhx7s41mnybpr8ihdk2g0bgjb3hzd95x6pw4w51")
554 (base32 "1i4kba2wpkc7jmj7b2qjkrgqsl0g0s1h7j9pfvc7zqyyn9v3kkqr")))
555(define-public linux-libre-6.16-pristine-source
556 (let ((version linux-libre-6.16-version)
557 (hash (base32 "0vm257d76hmimnac8hzg66gd1mdg330sai39lywfn4m9bjydx93w")))
558 (make-linux-libre-source version
559 (%upstream-linux-source version hash)
560 deblob-scripts-6.16)))
561
562;; The "longterm" kernels — the older releases with long-term upstream support.
563;; Here are the support timelines:
564;; <https://www.kernel.org/category/releases.html>
565
566(define-public linux-libre-6.12-version "6.12.57")
567(define-public linux-libre-6.12-gnu-revision "gnu")
568(define deblob-scripts-6.12
569 (linux-libre-deblob-scripts
570 linux-libre-6.12-version
571 linux-libre-6.12-gnu-revision
572 (base32 "0y6i9ifax1a8bxih3rr9xzy3mj61ssgx9yfsy6fh94mni6wl51gp")
573 (base32 "1yl447396g454116j8v17wsqg5i0gyb2rrxvaygw6xdkbwrrj28j")))
574(define-public linux-libre-6.12-pristine-source
575 (let ((version linux-libre-6.12-version)
576 (hash (base32 "06jlsawz1wgk13gyxphkglb8a4iiwg0vg5hrfc7bj1s6gk1s2p0n")))
577 (make-linux-libre-source version
578 (%upstream-linux-source version hash)
579 deblob-scripts-6.12)))
580
581(define-public linux-libre-6.6-version "6.6.116")
582(define-public linux-libre-6.6-gnu-revision "gnu")
583(define deblob-scripts-6.6
584 (linux-libre-deblob-scripts
585 linux-libre-6.6-version
586 linux-libre-6.6-gnu-revision
587 (base32 "1fph0cf5vwkxcyz2cay4d70sqw1y02dx3shfclhp9y4nmkk169pq")
588 (base32 "11i7pvm5n31rvp05msbm3ciclr84cz9c94f5r5aa6mmzhslwpbxk")))
589(define-public linux-libre-6.6-pristine-source
590 (let ((version linux-libre-6.6-version)
591 (hash (base32 "07d5629579apc1d8yb0ki226iyb5n3lwp1yw0p189qlvq919g9d9")))
592 (make-linux-libre-source version
593 (%upstream-linux-source version hash)
594 deblob-scripts-6.6)))
595
596(define-public linux-libre-6.1-version "6.1.158")
597(define-public linux-libre-6.1-gnu-revision "gnu")
598(define deblob-scripts-6.1
599 (linux-libre-deblob-scripts
600 linux-libre-6.1-version
601 linux-libre-6.1-gnu-revision
602 (base32 "00yh14z7sr9pkakkkpdyp8fj41d56a306xsf5yb2lzm0sgl6lvza")
603 (base32 "0f3jgbfd2j7sz7h1hb30s1r9147g1cbb3ia09k9834fvbiz1ihaa")))
604(define-public linux-libre-6.1-pristine-source
605 (let ((version linux-libre-6.1-version)
606 (hash (base32 "1nmz4rknw82k9ylyrbm4g2m0hh4lmgkwi1g3gm7hzv04nvyqn1md")))
607 (make-linux-libre-source version
608 (%upstream-linux-source version hash)
609 deblob-scripts-6.1)))
610
611(define-public linux-libre-5.15-version "5.15.196")
612(define-public linux-libre-5.15-gnu-revision "gnu")
613(define deblob-scripts-5.15
614 (linux-libre-deblob-scripts
615 linux-libre-5.15-version
616 linux-libre-5.15-gnu-revision
617 (base32 "14dajb391lr4y2llvjihilmzwvrq4gjbgvrha7dvh6vv4jmbi28v")
618 (base32 "0rg65s6kd9gxxa3wl6180pr39rb6zbcicwjik4kygs2ns0247y56")))
619(define-public linux-libre-5.15-pristine-source
620 (let ((version linux-libre-5.15-version)
621 (hash (base32 "018ffzi91xh46l7r3fgc4mpri3pxzl6wc1n946vny0lbb59pj5c3")))
622 (make-linux-libre-source version
623 (%upstream-linux-source version hash)
624 deblob-scripts-5.15)))
625
626(define-public linux-libre-5.10-version "5.10.246")
627(define-public linux-libre-5.10-gnu-revision "gnu1")
628(define deblob-scripts-5.10
629 (linux-libre-deblob-scripts
630 linux-libre-5.10-version
631 linux-libre-5.10-gnu-revision
632 (base32 "1wn9k4lbxcc9rzl1rqidlnb472wyayillrh57gyxnghi7j9ghqna")
633 (base32 "0r1whrfhhhjyvppiidhihcvyzcab6dva6g9a4div8jkxm62s2cq3")))
634(define-public linux-libre-5.10-pristine-source
635 (let ((version linux-libre-5.10-version)
636 (hash (base32 "0xd8r8qqgxh3zhqkl4a5plmgsycxrffhpc9q2rwhkp6jd717cszb")))
637 (make-linux-libre-source version
638 (%upstream-linux-source version hash)
639 deblob-scripts-5.10)))
640
641(define-public linux-libre-5.4-version "5.4.301")
642(define-public linux-libre-5.4-gnu-revision "gnu1")
643(define deblob-scripts-5.4
644 (linux-libre-deblob-scripts
645 linux-libre-5.4-version
646 linux-libre-5.4-gnu-revision
647 (base32 "168ysrpcbfhm6s71l9w8ibjq2frjmiaixc2wbsq86gx2zw6zyb5p")
648 (base32 "0l7pwhgw9laxfypcpqlz411x3hybcw2269abh3lpcw96bgv5m1k2")))
649(define-public linux-libre-5.4-pristine-source
650 (let ((version linux-libre-5.4-version)
651 (hash (base32 "0qkra8ci2mx5p8ngdys2ixsl9s30qdqlq027pr5p3rk0s1k8fwdp")))
652 (make-linux-libre-source version
653 (%upstream-linux-source version hash)
654 deblob-scripts-5.4)))
655
656(define %boot-logo-patch
657 ;; Linux-Libre boot logo featuring Freedo and a gnu.
658 (origin
659 (method url-fetch)
660 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
661 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
662 (sha256
663 (base32
664 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
665
666(define %linux-libre-arm-export-__sync_icache_dcache-patch
667 (origin
668 (method url-fetch)
669 (uri (string-append
670 "https://salsa.debian.org/kernel-team/linux"
671 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
672 "/debian/patches/bugfix/arm/"
673 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
674 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
675 (sha256
676 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
677
678(define (source-with-patches source patches)
679 (origin
680 (inherit source)
681 (patches (append (origin-patches source)
682 patches))))
683
684(define-public linux-libre-6.17-source
685 (source-with-patches linux-libre-6.17-pristine-source
686 (list %boot-logo-patch
687 %linux-libre-arm-export-__sync_icache_dcache-patch)))
688
689(define-public linux-libre-6.16-source
690 (source-with-patches linux-libre-6.16-pristine-source
691 (list %boot-logo-patch
692 %linux-libre-arm-export-__sync_icache_dcache-patch)))
693
694(define-public linux-libre-6.12-source
695 (source-with-patches linux-libre-6.12-pristine-source
696 (list %boot-logo-patch
697 %linux-libre-arm-export-__sync_icache_dcache-patch)))
698
699(define-public linux-libre-6.6-source
700 (source-with-patches linux-libre-6.6-pristine-source
701 (list %boot-logo-patch
702 %linux-libre-arm-export-__sync_icache_dcache-patch)))
703
704(define-public linux-libre-6.1-source
705 (source-with-patches linux-libre-6.1-pristine-source
706 (append
707 (list %boot-logo-patch
708 %linux-libre-arm-export-__sync_icache_dcache-patch)
709 (search-patches
710 "linux-libre-infodocs-target.patch"))))
711
712(define-public linux-libre-5.15-source
713 (source-with-patches linux-libre-5.15-pristine-source
714 (list %boot-logo-patch
715 %linux-libre-arm-export-__sync_icache_dcache-patch)))
716
717(define-public linux-libre-5.10-source
718 (source-with-patches linux-libre-5.10-pristine-source
719 (list %boot-logo-patch
720 %linux-libre-arm-export-__sync_icache_dcache-patch)))
721
722(define-public linux-libre-5.4-source
723 (source-with-patches linux-libre-5.4-pristine-source
724 (list %boot-logo-patch
725 %linux-libre-arm-export-__sync_icache_dcache-patch
726 ;; Pinebook Pro patch from linux-next,
727 ;; can be dropped for linux-libre 5.7
728 (search-patch
729 "linux-libre-support-for-Pinebook-Pro.patch"))))
730
731
732;;;
733;;; Kernel headers.
734;;;
735
736(define %linux-libre-timeout-properties
737 ;; Package properties for 'linux-libre' and 'linux-libre-headers' packages.
738 `((timeout . ,(* 8 3600)) ;deblob takes >5h on AArch64
739 (max-silent-time . ,(* 3 3600)))) ;don't time out on blob scan
740
741(define (make-linux-libre-headers version gnu-revision hash-string)
742 (make-linux-libre-headers* version gnu-revision
743 (origin
744 (method url-fetch)
745 (uri (linux-libre-urls version gnu-revision))
746 (sha256 (base32 hash-string)))))
747
748(define (make-linux-libre-headers* version gnu-revision source)
749 (package
750 (name "linux-libre-headers")
751 (version version)
752 (source source)
753 (build-system gnu-build-system)
754 (native-inputs `(("perl" ,perl)
755 ,@(if (version>=? version "4.16")
756 `(("flex" ,flex)
757 ("bison" ,bison))
758 '())))
759 (arguments
760 `(#:modules ((guix build gnu-build-system)
761 (guix build utils)
762 (srfi srfi-1)
763 (ice-9 match))
764 #:phases
765 (modify-phases %standard-phases
766 (delete 'configure)
767 (replace 'build
768 (lambda _
769 (let ((arch ,(platform-linux-architecture
770 (lookup-platform-by-target-or-system
771 (or (%current-target-system)
772 (%current-system)))))
773 (defconfig ,(system->defconfig
774 (or (%current-target-system)
775 (%current-system))))
776 (make-target ,(if (version>=? version "5.3")
777 "headers"
778 "headers_check")))
779 (setenv "ARCH" arch)
780 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
781 (invoke "make" defconfig)
782 (invoke "make" "mrproper" make-target))))
783 (replace 'install
784 (lambda* (#:key outputs #:allow-other-keys)
785 (let ((out (assoc-ref outputs "out")))
786
787 ;; Mimic the quiet_cmd_headers_install target to avoid a
788 ;; dependency on rsync.
789 (for-each (lambda (file)
790 (let ((destination (string-append
791 out "/include/"
792 ;; Drop the 'usr/include' prefix.
793 (match (string-split file #\/)
794 ((_ _ path ...)
795 (string-join path "/"))))))
796 (format #t "`~a' -> `~a'~%" file destination)
797 (install-file file (dirname destination))))
798 (find-files "usr/include" "\\.h$"))
799
800 (mkdir (string-append out "/include/config"))
801 (call-with-output-file
802 (string-append out
803 "/include/config/kernel.release")
804 (lambda (p)
805 (format p "~a-default~%" ,version)))))))
806 #:allowed-references ()
807 #:tests? #f))
808 (supported-systems (remove target-hurd? %supported-systems))
809 (properties %linux-libre-timeout-properties)
810 (home-page "https://www.gnu.org/software/linux-libre/")
811 (synopsis "GNU Linux-Libre kernel headers")
812 (description "Headers of the Linux-Libre kernel.")
813 (license license:gpl2)))
814
815(define-public linux-libre-headers-6.17
816 (make-linux-libre-headers* linux-libre-6.17-version
817 linux-libre-6.17-gnu-revision
818 linux-libre-6.17-source))
819
820(define-public linux-libre-headers-6.16
821 (make-linux-libre-headers* linux-libre-6.16-version
822 linux-libre-6.16-gnu-revision
823 linux-libre-6.16-source))
824
825(define-public linux-libre-headers-6.12
826 (make-linux-libre-headers* linux-libre-6.12-version
827 linux-libre-6.12-gnu-revision
828 linux-libre-6.12-source))
829
830(define-public linux-libre-headers-6.6
831 (make-linux-libre-headers* linux-libre-6.6-version
832 linux-libre-6.6-gnu-revision
833 linux-libre-6.6-source))
834
835(define-public linux-libre-headers-6.1
836 (make-linux-libre-headers* linux-libre-6.1-version
837 linux-libre-6.1-gnu-revision
838 linux-libre-6.1-source))
839
840(define-public linux-libre-headers-5.15
841 (make-linux-libre-headers* linux-libre-5.15-version
842 linux-libre-5.15-gnu-revision
843 linux-libre-5.15-source))
844
845(define-public linux-libre-headers-5.10
846 (make-linux-libre-headers* linux-libre-5.10-version
847 linux-libre-5.10-gnu-revision
848 linux-libre-5.10-source))
849
850(define-public linux-libre-headers-5.4
851 (make-linux-libre-headers* linux-libre-5.4-version
852 linux-libre-5.4-gnu-revision
853 linux-libre-5.4-source))
854
855;; The following package is used in the early bootstrap, and thus must be kept
856;; stable and with minimal build requirements.
857(define-public linux-libre-headers-6.12.17
858 (make-linux-libre-headers "6.12.17" "gnu"
859 "1j3iyivh8h9abryjqksf4k51wgwnwqy2l3zsc019bm84xmka38xm"))
860
861(define-public linux-libre-headers linux-libre-headers-6.12.17)
862;; linux-libre-headers-latest points to the latest headers package
863;; and should be used as a dependency for packages that depend on
864;; the headers.
865(define-public linux-libre-headers-latest linux-libre-headers-6.17)
866
867
868;;;
869;;; Kernel configurations.
870;;;
871
872(define* (kernel-config arch #:key variant)
873 "Return a file-like object of the Linux-Libre build configuration file for
874ARCH and optionally VARIANT, or #f if there is no such configuration."
875 (let* ((name (string-append (if variant (string-append variant "-") "")
876 (if (string=? "i386" arch) "i686" arch) ".conf"))
877 (file (string-append "linux-libre/" name))
878 (config (search-auxiliary-file file)))
879 (and config (local-file config))))
880
881(define (default-extra-linux-options version)
882 `(;; Make the kernel config available at /proc/config.gz
883 ("CONFIG_IKCONFIG" . #t)
884 ("CONFIG_IKCONFIG_PROC" . #t)
885 ;; Debugging options.
886 ("CONFIG_DEBUG_INFO" . #t) ;required by BTF
887 ,@(if (version>=? version "5.1")
888 '(("CONFIG_DEBUG_INFO_BTF" . #t))
889 '())
890 ,@(if (version>=? version "5.12")
891 '(("CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT" . #t))
892 '())
893 ("CONFIG_DEBUG_INFO_REDUCED" . #f) ;incompatible with BTF
894 ;; Tracing and related options.
895 ,@(if (version>=? version "5.1")
896 '(("CONFIG_BPF_JIT" . #t)
897 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
898 ("CONFIG_BPF_SYSCALL" . #t))
899 '())
900 ,@(if (version>=? version "5.13")
901 '(("CONFIG_BPF_UNPRIV_DEFAULT_OFF" . #t))
902 '())
903 ("CONFIG_NET_CLS_BPF" . m) ;classify packets based on BPF filters
904 ("CONFIG_NET_ACT_BPF" . m) ;to execute BPF code on packets
905 ;; Compress kernel modules via Zstd.
906 ,(if (version>=? version "5.13")
907 '("CONFIG_MODULE_COMPRESS_ZSTD" . #t)
908 '("CONFIG_MODULE_COMPRESS_GZIP" . #t))
909 ;; Some very mild hardening.
910 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
911 ;; All kernels should have NAMESPACES options enabled
912 ("CONFIG_NAMESPACES" . #t)
913 ("CONFIG_UTS_NS" . #t)
914 ("CONFIG_IPC_NS" . #t)
915 ("CONFIG_USER_NS" . #t)
916 ("CONFIG_PID_NS" . #t)
917 ("CONFIG_NET_NS" . #t)
918 ;; Various options needed for elogind service:
919 ;; https://issues.guix.gnu.org/43078
920 ("CONFIG_CGROUP_FREEZER" . #t)
921 ("CONFIG_BLK_CGROUP" . #t)
922 ("CONFIG_CGROUP_WRITEBACK" . #t)
923 ("CONFIG_CGROUP_SCHED" . #t)
924 ("CONFIG_CGROUP_PIDS" . #t)
925 ("CONFIG_CGROUP_FREEZER" . #t)
926 ("CONFIG_CGROUP_DEVICE" . #t)
927 ("CONFIG_CGROUP_CPUACCT" . #t)
928 ("CONFIG_CGROUP_PERF" . #t)
929 ("CONFIG_SOCK_CGROUP_DATA" . #t)
930 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
931 ("CONFIG_CGROUP_NET_PRIO" . #t)
932 ("CONFIG_CGROUP_NET_CLASSID" . #t)
933 ("CONFIG_MEMCG" . #t)
934 ("CONFIG_MEMCG_SWAP" . #t)
935 ("CONFIG_MEMCG_KMEM" . #t)
936 ("CONFIG_CPUSETS" . #t)
937 ("CONFIG_PROC_PID_CPUSET" . #t)
938 ;; Allow disk encryption by default
939 ("CONFIG_DM_CRYPT" . m)
940 ;; Allow fscrypt filesystem encryption by default
941 ("CONFIG_FS_ENCRYPTION" . #t)
942 ;; Support zram on all kernel configs
943 ("CONFIG_ZSWAP" . #t)
944 ("CONFIG_ZSMALLOC" . #t)
945 ("CONFIG_ZRAM" . m)
946 ;; Accessibility support.
947 ("CONFIG_ACCESSIBILITY" . #t)
948 ("CONFIG_A11Y_BRAILLE_CONSOLE" . #t)
949 ("CONFIG_SPEAKUP" . m)
950 ("CONFIG_SPEAKUP_SYNTH_SOFT" . m)
951 ;; Modules required for initrd:
952 ("CONFIG_NET_9P" . m)
953 ("CONFIG_NET_9P_VIRTIO" . m)
954 ("CONFIG_VIRTIO_BLK" . m)
955 ("CONFIG_VIRTIO_NET" . m)
956 ("CONFIG_VIRTIO_PCI" . m)
957 ("CONFIG_VIRTIO_BALLOON" . m)
958 ("CONFIG_VIRTIO_MMIO" . m)
959 ("CONFIG_FUSE_FS" . m)
960 ("CONFIG_CIFS" . m)
961 ("CONFIG_9P_FS" . m)
962 ;; Disable the EFI pstore storage backend to avoid causing
963 ;; unrecoverable failures on some EFI systems:
964 ;; https://lists.gnu.org/archive/html/help-guix/2025-01/msg00173.html
965 ("CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE" . #t)))
966
967(define (config->string options)
968 (string-join (map (match-lambda
969 ((option . 'm)
970 (string-append option "=m"))
971 ((option . #t)
972 (string-append option "=y"))
973 ((option . #f)
974 (string-append option "=n"))
975 ((option . string)
976 (string-append option "=\"" string "\"")))
977 options)
978 "\n"))
979
980
981;;;
982;;; Kernel package utilities.
983;;;
984
985(define (apply-infodoc-patch? version)
986 ;; Versions older than 5.10 have different enough build scripts that the
987 ;; infodocs patch doesn't apply.
988 (and (version>=? version "5.10")
989 (not (version>=? version "6.2")))) ;patch applied upstream
990
991
992(define* (make-linux-libre version gnu-revision hash-string supported-systems
993 #:key
994 (extra-version #f)
995 ;; A function that takes an arch and a variant, and
996 ;; return a file-like object. See kernel-config
997 ;; for an example.
998 (configuration-file #f)
999 (defconfig "defconfig")
1000 (extra-options (default-extra-linux-options version))
1001 (patches
1002 `(,%boot-logo-patch
1003 ,@(if (apply-infodoc-patch? version)
1004 (list (search-patch
1005 "linux-libre-infodocs-target.patch"))
1006 '()))))
1007 (make-linux-libre* version gnu-revision
1008 (origin
1009 (method url-fetch)
1010 (uri (linux-libre-urls version gnu-revision))
1011 (sha256 (base32 hash-string))
1012 (patches patches))
1013 supported-systems
1014 #:extra-version extra-version
1015 #:configuration-file configuration-file
1016 #:defconfig defconfig
1017 #:extra-options extra-options))
1018
1019(define* (make-linux-libre* version gnu-revision source supported-systems
1020 #:key
1021 (extra-version #f)
1022 ;; A function that takes an arch and a variant.
1023 ;; See kernel-config for an example.
1024 (configuration-file #f)
1025 (defconfig "defconfig")
1026 (extra-options (default-extra-linux-options version)))
1027 (package
1028 (name (if extra-version
1029 (string-append "linux-libre-" extra-version)
1030 "linux-libre"))
1031 (version version)
1032 (source source)
1033 (supported-systems supported-systems)
1034 (build-system gnu-build-system)
1035 (arguments
1036 (list
1037 #:modules '((guix build gnu-build-system)
1038 (guix build utils)
1039 (srfi srfi-1)
1040 (srfi srfi-26)
1041 (ice-9 ftw)
1042 (ice-9 match))
1043 #:tests? #f
1044 #:phases
1045 #~(modify-phases %standard-phases
1046 (add-after 'unpack 'patch-/bin/pwd
1047 (lambda _
1048 (substitute* (find-files
1049 "." "^Makefile(\\.include)?$")
1050 (("/bin/pwd") "pwd"))))
1051 (add-before 'configure 'set-environment
1052 (lambda* (#:key target #:allow-other-keys)
1053 ;; Avoid introducing timestamps.
1054 (setenv "KCONFIG_NOTIMESTAMP" "1")
1055 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
1056
1057 ;; Other variables useful for reproducibility.
1058 (setenv "KBUILD_BUILD_VERSION" "1")
1059 (setenv "KBUILD_BUILD_USER" "guix")
1060 (setenv "KBUILD_BUILD_HOST" "guix")
1061
1062 ;; Set ARCH and CROSS_COMPILE.
1063 (let ((arch #$(platform-linux-architecture
1064 (lookup-platform-by-target-or-system
1065 (or (%current-target-system)
1066 (%current-system))))))
1067 (setenv "ARCH" arch)
1068 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
1069 (when target
1070 (setenv "CROSS_COMPILE" (string-append target "-"))
1071 (format #t "`CROSS_COMPILE' set to `~a'~%"
1072 (getenv "CROSS_COMPILE"))))
1073
1074 ;; Allow EXTRAVERSION to be set via the environment.
1075 (substitute* "Makefile"
1076 (("^ *EXTRAVERSION[[:blank:]]*=")
1077 "EXTRAVERSION ?="))
1078 (setenv "EXTRAVERSION"
1079 #$(and extra-version
1080 (string-append "-" extra-version)))
1081 ;; Use the maximum compression available for Zstd-compressed
1082 ;; modules.
1083 (setenv "ZSTD_CLEVEL" "19")))
1084 (replace 'configure
1085 (lambda _
1086 (let ((config
1087 #$(match (let ((arch (platform-linux-architecture
1088 (lookup-platform-by-target-or-system
1089 (or (%current-target-system)
1090 (%current-system))))))
1091 (and configuration-file arch
1092 (configuration-file
1093 arch
1094 #:variant (version-major+minor version))))
1095 (#f ;no config for this platform
1096 #f)
1097 ((? file-like? config)
1098 config))))
1099 ;; Use a custom kernel configuration file or a default
1100 ;; configuration file.
1101 (if config
1102 (begin
1103 (copy-file config ".config")
1104 (chmod ".config" #o666))
1105 (invoke "make" #$defconfig))
1106 ;; Appending works even when the option wasn't in the file.
1107 ;; The last one prevails if duplicated.
1108 (let ((port (open-file ".config" "a"))
1109 (extra-configuration #$(config->string extra-options)))
1110 (display extra-configuration port)
1111 (close-port port))
1112 (invoke "make" "oldconfig"))))
1113 (replace 'install
1114 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1115 (let ((moddir (string-append #$output "/lib/modules"))
1116 (dtbdir (string-append #$output "/lib/dtbs"))
1117 (make-flags
1118 (append make-flags
1119 (list "-j"
1120 (if parallel-build?
1121 (number->string (parallel-job-count))
1122 "1")))))
1123 ;; Install kernel image, kernel configuration and link map.
1124 (for-each (lambda (file) (install-file file #$output))
1125 (find-files "." "^(\\.config|bzImage|zImage|Image\
1126|vmlinuz|System\\.map|Module\\.symvers)$"))
1127 ;; Install device tree files
1128 (unless (null? (find-files "." "\\.dtb$"))
1129 (mkdir-p dtbdir)
1130 (apply invoke "make"
1131 (string-append "INSTALL_DTBS_PATH=" dtbdir)
1132 "dtbs_install" make-flags))
1133 ;; Install kernel modules
1134 (mkdir-p moddir)
1135 (apply invoke "make"
1136 ;; Disable depmod because the Guix system's module
1137 ;; directory is an union of potentially multiple
1138 ;; packages. It is not possible to use depmod to
1139 ;; usefully calculate a dependency graph while building
1140 ;; only one of them.
1141 "DEPMOD=true"
1142 (string-append "MODULE_DIR=" moddir)
1143 (string-append "INSTALL_PATH=" #$output)
1144 (string-append "INSTALL_MOD_PATH=" #$output)
1145 "INSTALL_MOD_STRIP=1"
1146 "modules_install" make-flags)
1147 (let* ((versions (filter (lambda (name)
1148 (not (string-prefix? "." name)))
1149 (scandir moddir)))
1150 (version (match versions
1151 ((x) x))))
1152 ;; There are symlinks to the build and source directory.
1153 ;; Both will point to target /tmp/guix-build* and thus not
1154 ;; be useful in a profile. Delete the symlinks.
1155 (false-if-file-not-found
1156 (delete-file
1157 (string-append moddir "/" version "/build")))
1158 (false-if-file-not-found
1159 (delete-file
1160 (string-append moddir "/" version "/source"))))))))))
1161 (native-inputs
1162 (list perl
1163 bc
1164 openssl
1165 elfutils ;needed to enable CONFIG_STACK_VALIDATION
1166 flex
1167 bison
1168 util-linux ;needed for hexdump
1169 ;; These are needed to compile the GCC plugins.
1170 gmp
1171 mpfr
1172 mpc
1173 ;; These are needed when building with the CONFIG_DEBUG_INFO_BTF
1174 ;; support.
1175 dwarves ;for pahole
1176 python-wrapper
1177 zlib
1178 ;; For Zstd compression of kernel modules.
1179 zstd))
1180 (home-page "https://www.gnu.org/software/linux-libre/")
1181 (synopsis "100% free redistribution of a cleaned Linux kernel")
1182 (description "GNU Linux-Libre is a free (as in freedom) variant of the
1183Linux kernel. It has been modified to remove all non-free binary blobs.")
1184 (license license:gpl2)
1185 (properties %linux-libre-timeout-properties)))
1186
1187
1188;;;
1189;;; Generic kernel packages.
1190;;;
1191
1192(define-public linux-libre-6.17
1193 (make-linux-libre* linux-libre-6.17-version
1194 linux-libre-6.17-gnu-revision
1195 linux-libre-6.17-source
1196 '("x86_64-linux" "i686-linux" "armhf-linux"
1197 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1198 #:configuration-file kernel-config))
1199
1200(define-public linux-libre-6.16
1201 (make-linux-libre* linux-libre-6.16-version
1202 linux-libre-6.16-gnu-revision
1203 linux-libre-6.16-source
1204 '("x86_64-linux" "i686-linux" "armhf-linux"
1205 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1206 #:configuration-file kernel-config))
1207
1208(define-public linux-libre-version linux-libre-6.17-version)
1209(define-public linux-libre-gnu-revision linux-libre-6.17-gnu-revision)
1210(define-public linux-libre-pristine-source linux-libre-6.17-pristine-source)
1211(define-public linux-libre-source linux-libre-6.17-source)
1212(define-public linux-libre linux-libre-6.17)
1213
1214(define-public linux-libre-6.12
1215 (make-linux-libre* linux-libre-6.12-version
1216 linux-libre-6.12-gnu-revision
1217 linux-libre-6.12-source
1218 '("x86_64-linux" "i686-linux" "armhf-linux"
1219 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1220 #:configuration-file kernel-config))
1221
1222(define-public linux-libre-6.6
1223 (make-linux-libre* linux-libre-6.6-version
1224 linux-libre-6.6-gnu-revision
1225 linux-libre-6.6-source
1226 '("x86_64-linux" "i686-linux" "armhf-linux"
1227 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1228 #:configuration-file kernel-config))
1229
1230(define-public linux-libre-6.1
1231 (make-linux-libre* linux-libre-6.1-version
1232 linux-libre-6.1-gnu-revision
1233 linux-libre-6.1-source
1234 '("x86_64-linux" "i686-linux" "armhf-linux"
1235 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1236 #:configuration-file kernel-config))
1237
1238(define-public linux-libre-5.15
1239 (make-linux-libre* linux-libre-5.15-version
1240 linux-libre-5.15-gnu-revision
1241 linux-libre-5.15-source
1242 '("x86_64-linux" "i686-linux" "armhf-linux"
1243 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1244 #:configuration-file kernel-config))
1245
1246(define-public linux-libre-5.10
1247 (make-linux-libre* linux-libre-5.10-version
1248 linux-libre-5.10-gnu-revision
1249 linux-libre-5.10-source
1250 '("x86_64-linux" "i686-linux" "armhf-linux"
1251 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1252 #:configuration-file kernel-config))
1253
1254(define-public linux-libre-5.4
1255 (make-linux-libre* linux-libre-5.4-version
1256 linux-libre-5.4-gnu-revision
1257 linux-libre-5.4-source
1258 '("x86_64-linux" "i686-linux" "armhf-linux"
1259 "aarch64-linux" "powerpc64le-linux" "riscv64-linux")
1260 #:configuration-file kernel-config))
1261
1262;; Linux-Libre-LTS points to the *newest* released long-term support version of
1263;; Linux-Libre.
1264;; Reference: <https://www.kernel.org/category/releases.html>
1265
1266(define-public linux-libre-lts-version linux-libre-6.12-version)
1267(define-public linux-libre-lts-gnu-revision linux-libre-6.12-gnu-revision)
1268(define-public linux-libre-lts-pristine-source linux-libre-6.12-pristine-source)
1269(define-public linux-libre-lts-source linux-libre-6.12-source)
1270(define-public linux-libre-lts linux-libre-6.12)
1271
1272
1273;;;
1274;;; Specialized kernel variants.
1275;;;
1276
1277(define-public %dummy-linux-kernel-for-container
1278 (hidden-package
1279 (package
1280 (name "linux-dummy")
1281 (version "0.0.0")
1282 (source #f)
1283 (build-system copy-build-system)
1284 (arguments
1285 (list #:phases
1286 #~(modify-phases %standard-phases
1287 (delete 'unpack)
1288 (replace 'install
1289 (lambda _
1290 (mkdir-p #$output))))))
1291 (home-page "")
1292 (synopsis "Dummy Linux kernel for @command{guix system container}")
1293 (description "")
1294 (license #f))))
1295
1296(define-public linux-libre-arm-generic
1297 (make-linux-libre* linux-libre-version
1298 linux-libre-gnu-revision
1299 linux-libre-source
1300 '("armhf-linux")
1301 #:defconfig "multi_v7_defconfig"
1302 #:extra-version "arm-generic"
1303 #:extra-options
1304 (append
1305 `(;; needed to fix the RTC on rockchip platforms
1306 ("CONFIG_RTC_DRV_RK808" . #t))
1307 (default-extra-linux-options linux-libre-version))))
1308
1309(define-public linux-libre-arm-generic-5.10
1310 (make-linux-libre* linux-libre-5.10-version
1311 linux-libre-5.10-gnu-revision
1312 linux-libre-5.10-source
1313 '("armhf-linux")
1314 #:defconfig "multi_v7_defconfig"
1315 #:extra-version "arm-generic"
1316 #:extra-options
1317 (append
1318 `(;; needed to fix the RTC on rockchip platforms
1319 ("CONFIG_RTC_DRV_RK808" . #t))
1320 (default-extra-linux-options linux-libre-5.10-version))))
1321
1322(define-public linux-libre-arm-generic-5.4
1323 (make-linux-libre* linux-libre-5.4-version
1324 linux-libre-5.4-gnu-revision
1325 linux-libre-5.4-source
1326 '("armhf-linux")
1327 #:defconfig "multi_v7_defconfig"
1328 #:extra-version "arm-generic"
1329 #:extra-options
1330 (append
1331 `(;; needed to fix the RTC on rockchip platforms
1332 ("CONFIG_RTC_DRV_RK808" . #t))
1333 (default-extra-linux-options linux-libre-5.4-version))))
1334
1335(define-public linux-libre-arm-omap2plus
1336 (make-linux-libre* linux-libre-version
1337 linux-libre-gnu-revision
1338 linux-libre-source
1339 '("armhf-linux")
1340 #:defconfig "omap2plus_defconfig"
1341 #:extra-version "arm-omap2plus"))
1342
1343(define-public linux-libre-arm64-generic
1344 (make-linux-libre* linux-libre-version
1345 linux-libre-gnu-revision
1346 linux-libre-source
1347 '("aarch64-linux")
1348 #:defconfig "defconfig"
1349 #:extra-version "arm64-generic"
1350 #:extra-options
1351 (append
1352 `(;; Provide support for ath9k wireless
1353 ("CONFIG_ATH9K_HTC" . m)
1354 ;; Support Orange Pi R1 Plus LTS ethernet PHY.
1355 ("CONFIG_MOTORCOMM_PHY" . m)
1356 ;; needed to fix the RTC on rockchip platforms
1357 ("CONFIG_RTC_DRV_RK808" . #t)
1358 ;; Pinebook display, battery, charger and usb
1359 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1360 ("CONFIG_CHARGER_AXP20X" . m)
1361 ("CONFIG_INPUT_AXP20X_PEK" . m)
1362 ("CONFIG_CHARGER_AXP20X" . m)
1363 ("CONFIG_BATTERY_AXP20X" . m)
1364 ("CONFIG_PINCTRL_AXP209" . m)
1365 ("CONFIG_AXP20X_POWER" . m)
1366 ("CONFIG_AXP20X_ADC" . m)
1367 ;; Pinebook PRO battery and sound support
1368 ("CONFIG_BATTERY_CW2015" . m)
1369 ("CONFIG_CHARGER_GPIO" . m)
1370 ("CONFIG_SND_SOC_ES8316" . m))
1371 (default-extra-linux-options linux-libre-version))))
1372
1373(define-public linux-libre-lts-arm64-generic
1374 (if (string=? linux-libre-lts-version linux-libre-version)
1375
1376 ;; Make it a strict alias so that the user interface does not see two
1377 ;; packages with the exact same name and version.
1378 linux-libre-arm64-generic
1379
1380 (make-linux-libre* linux-libre-lts-version
1381 linux-libre-lts-gnu-revision
1382 linux-libre-lts-source
1383 '("aarch64-linux")
1384 #:defconfig "defconfig"
1385 #:extra-version "arm64-generic"
1386 #:extra-options
1387 (append
1388 `( ;; Provide support for ath9k wireless
1389 ("CONFIG_ATH9K_HTC" . m)
1390 ;; Support Orange Pi R1 Plus LTS ethernet PHY.
1391 ("CONFIG_MOTORCOMM_PHY" . m)
1392 ;; needed to fix the RTC on rockchip platforms
1393 ("CONFIG_RTC_DRV_RK808" . #t)
1394 ;; Pinebook display, battery, charger and usb
1395 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1396 ("CONFIG_CHARGER_AXP20X" . m)
1397 ("CONFIG_INPUT_AXP20X_PEK" . m)
1398 ("CONFIG_CHARGER_AXP20X" . m)
1399 ("CONFIG_BATTERY_AXP20X" . m)
1400 ("CONFIG_PINCTRL_AXP209" . m)
1401 ("CONFIG_AXP20X_POWER" . m)
1402 ("CONFIG_AXP20X_ADC" . m)
1403 ;; Pinebook PRO battery and sound support
1404 ("CONFIG_BATTERY_CW2015" . m)
1405 ("CONFIG_CHARGER_GPIO" . m)
1406 ("CONFIG_SND_SOC_ES8316" . m))
1407 (default-extra-linux-options linux-libre-lts-version)))))
1408
1409(define-public linux-libre-arm64-generic-5.10
1410 (make-linux-libre* linux-libre-5.10-version
1411 linux-libre-5.10-gnu-revision
1412 linux-libre-5.10-source
1413 '("aarch64-linux")
1414 #:defconfig "defconfig"
1415 #:extra-version "arm64-generic"
1416 #:extra-options
1417 (append
1418 `(;; needed to fix the RTC on rockchip platforms
1419 ("CONFIG_RTC_DRV_RK808" . #t)
1420 ;; Pinebook display, battery, charger and usb
1421 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1422 ("CONFIG_CHARGER_AXP20X" . m)
1423 ("CONFIG_INPUT_AXP20X_PEK" . m)
1424 ("CONFIG_CHARGER_AXP20X" . m)
1425 ("CONFIG_BATTERY_AXP20X" . m)
1426 ("CONFIG_PINCTRL_AXP209" . m)
1427 ("CONFIG_AXP20X_POWER" . m)
1428 ("CONFIG_AXP20X_ADC" . m)
1429 ;; Pinebook PRO battery and sound support
1430 ("CONFIG_BATTERY_CW2015" . m)
1431 ("CONFIG_CHARGER_GPIO" . m)
1432 ("CONFIG_SND_SOC_ES8316" . m))
1433 (default-extra-linux-options linux-libre-5.10-version))))
1434
1435(define-public linux-libre-arm64-generic-5.4
1436 (make-linux-libre* linux-libre-5.4-version
1437 linux-libre-5.4-gnu-revision
1438 linux-libre-5.4-source
1439 '("aarch64-linux")
1440 #:defconfig "defconfig"
1441 #:extra-version "arm64-generic"
1442 #:extra-options
1443 (append
1444 `(;; needed to fix the RTC on rockchip platforms
1445 ("CONFIG_RTC_DRV_RK808" . #t))
1446 (default-extra-linux-options linux-libre-5.4-version))))
1447
1448(define-public linux-libre-arm64-honeycomb
1449 ;; Kernel for use on the HoneyComb LX2 boards:
1450 ;; <https://shop.solid-run.com/product/SRCFTXE000IV13/>.
1451 (make-linux-libre* linux-libre-lts-version
1452 linux-libre-lts-gnu-revision
1453 linux-libre-lts-source
1454 '("aarch64-linux")
1455 #:extra-version "arm64-honeycomb"
1456 #:extra-options
1457 ;; See
1458 ;; https://github.com/SolidRun/lx2160a_build/blob/master/configs/linux/lx2k_additions.config
1459 (append
1460 `(("CONFIG_GPIO_SYSFS" . #true)
1461 ("CONFIG_GPIO_MPC8XXX" . #true)
1462 ("CONFIG_NET_PKTGEN" . #true)
1463 ("CONFIG_USB_SERIAL" . #true)
1464 ("CONFIG_USB_SERIAL_CONSOLE" . #true)
1465 ("CONFIG_USB_SERIAL_GENERIC" . #true)
1466 ("CONFIG_USB_SERIAL_SIMPLE" . #true)
1467 ("CONFIG_USB_SERIAL_FTDI_SIO" . #true)
1468 ("CONFIG_USB_ACM" . #true)
1469 ("CONFIG_USB_NET_DRIVERS" . #true)
1470 ("CONFIG_USB_USBNET" . #true)
1471 ("CONFIG_USB_NET_CDCETHER" . #true)
1472 ("CONFIG_USB_NET_CDC_NCM" . #true)
1473 ("CONFIG_USB_NET_NET1080" . #true)
1474 ("CONFIG_USB_NET_CDC_SUBSET_ENABLE" . #true)
1475 ("CONFIG_USB_NET_CDC_SUBSET" . #true)
1476 ("CONFIG_USB_ARMLINUX" . #true)
1477 ("CONFIG_BLK_DEV_NVME" . #true)
1478 ("CONFIG_NVMEM_BCM_OCOTP" . #true)
1479 ("CONFIG_DRM_AMDGPU" . #true)
1480 ("CONFIG_DRM_AMDGPU_SI" . #true)
1481 ("CONFIG_DRM_AMDGPU_CIK" . #true)
1482 ("CONFIG_DRM_AMDGPU_USERPTR" . #true)
1483 ("CONFIG_DRM_AMD_DC" . #true)
1484 ("CONFIG_CHASH" . #true)
1485 ("CONFIG_PMBUS" . #true)
1486 ("CONFIG_SENSORS_PMBUS" . #true)
1487 ("CONFIG_REGULATOR" . #true)
1488 ("CONFIG_REGULATOR_FIXED_VOLTAGE" . #true)
1489 ("CONFIG_REGULATOR_PWM" . #true)
1490 ("CONFIG_SENSORS_AMC6821" . #true)
1491 ("CONFIG_SENSORS_LM90" . #true)
1492 ("CONFIG_SENSORS_LTC2978" . #true)
1493 ("CONFIG_SENSORS_LTC2978_REGULATOR" . #true)
1494 ("CONFIG_TMPFS" . #true)
1495 ("CONFIG_TMPFS_POSIX_ACL" . #true)
1496 ("CONFIG_TMPFS_XATTR" . #true)
1497 ;;("CONFIG_BLK_DEV_RAM_SIZE" . 524288)
1498 ("CONFIG_POWER_RESET_GPIO" . #true)
1499 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1500 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1501 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1502 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1503
1504 ;; Fixes https://codeberg.org/guix/guix/issues/101
1505 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1506
1507 ;; For connecting to ci.guix.gnu.org over VPN.
1508 ("CONFIG_WIREGUARD" . m)
1509
1510 ;; restool support
1511 ("CONFIG_FSL_MC_UAPI_SUPPORT" . #t)
1512 ("CONFIG_FSL_MC_BUS" . #t)
1513 ("CONFIG_VFIO_FSL_MC" . #t)
1514 ("CONFIG_FSL_MC_DPIO" . #t)
1515 ("CONFIG_ARM_GIC_V3_ITS_FSL_MC" . #t)
1516
1517 ;; vsockets support
1518 ;; TODO This seems to be enabled by default on other
1519 ;; architectures?
1520 ("CONFIG_VSOCKETS" . m)
1521 ("CONFIG_VSOCKETS_DIAG" . m)
1522 ("CONFIG_VSOCKETS_LOOPBACK" . m)
1523 ("CONFIG_VMWARE_VMCI_VSOCKETS" . m)
1524 ("CONFIG_VIRTIO_VSOCKETS" . m)
1525 ("CONFIG_VIRTIO_VSOCKETS_COMMON" . m)
1526 ("CONFIG_HYPERV_VSOCKETS" . m)
1527 ("CONFIG_VHOST_IOTLB" . m)
1528 ("CONFIG_VHOST_RING" . m)
1529 ("CONFIG_VHOST_TASK" . #true)
1530 ("CONFIG_VHOST" . m)
1531 ("CONFIG_VHOST_MENU" . #true)
1532 ("CONFIG_VHOST_NET" . m)
1533 ("CONFIG_VHOST_SCSI" . m)
1534 ("CONFIG_VHOST_VSOCK" . m)
1535 ("CONFIG_VHOST_VDPA" . m))
1536 (default-extra-linux-options linux-libre-lts-version))))
1537
1538(define-public reform-debian-packages
1539 (package
1540 (name "reform-debian-packages")
1541 (version "2023-07-10-475-ge469c2a") ;from git describe
1542 (source
1543 (origin
1544 (method git-fetch)
1545 (uri (git-reference
1546 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1547 (commit "e469c2ad131054c7afe4f9f059eb2eb575545b1a")))
1548 (file-name (git-file-name name version))
1549 (sha256
1550 (base32 "0pv24b317n4h71rn25v2wa3qhs1i0wjfpys899cpm5lf0irvis7q"))))
1551 (build-system copy-build-system)
1552 (arguments
1553 (list
1554 #:install-plan
1555 #~'(("linux/patches6.16/" "/patches6.16")
1556 ("linux/patches6.17/" "/patches6.17")
1557 ("linux/" "/dts/amlogic"
1558 #:include-regexp ("meson.*\\.dts$"))
1559 ("linux/" "/dts/freescale"
1560 #:include-regexp ("imx8.*\\.dts$"))
1561 ("linux/" "/dts/freescale"
1562 #:include-regexp ("fsl.*\\.dts$"))
1563 ("linux/" "/dts/rockchip"
1564 #:include-regexp ("rk3588.*\\.dts$"))
1565 ("linux/config" "config"))))
1566 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1567 (synopsis
1568 "Linux kernel patches and device-trees used for MNT Reform systems")
1569 (description
1570 "Linux kernel patches and device-trees used for the MNT Reform systems")
1571 (license (list
1572 (license:fsf-free "file://filter-output"
1573 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1574 license:bsd-2
1575 license:expat
1576 license:gpl2
1577 license:gpl2+
1578 license:gpl3
1579 license:x11))))
1580
1581(define-public reform-debian-packages-for-6.12
1582 (package
1583 (name "reform-debian-packages")
1584 (version "2023-07-10-320-gaf0a461") ;from git describe
1585 (source
1586 (origin
1587 (method git-fetch)
1588 (uri (git-reference
1589 (url "https://source.mnt.re/reform/reform-debian-packages.git")
1590 (commit "af0a461d38e13481323f061d9ff6827d1d13873b")))
1591 (file-name (git-file-name name version))
1592 (sha256
1593 (base32 "1cylprld2ri3mprj5cgwla1l8qv9iqqvcra7h64yarzs49zaa16m"))))
1594 (build-system copy-build-system)
1595 (arguments
1596 (list
1597 #:install-plan
1598 #~'(("linux/patches6.12/" "/patches6.12")
1599 ("linux/" "/dts/amlogic"
1600 #:include-regexp ("meson.*\\.dts$"))
1601 ("linux/" "/dts/freescale"
1602 #:include-regexp ("imx8.*\\.dts$"))
1603 ("linux/" "/dts/freescale"
1604 #:include-regexp ("fsl.*\\.dts$"))
1605 ("linux/" "/dts/rockchip"
1606 #:include-regexp ("rk3588.*\\.dts$"))
1607 ("linux/config" "config"))))
1608 (home-page "https://source.mnt.re/reform/reform-debian-packages")
1609 (synopsis
1610 "Linux kernel patches and device-trees used for MNT Reform systems")
1611 (description
1612 "Linux kernel patches and device-trees used for the MNT Reform systems")
1613 (license (list
1614 (license:fsf-free "file://filter-output"
1615 "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html")
1616 license:bsd-2
1617 license:expat
1618 license:gpl2
1619 license:gpl2+
1620 license:gpl3
1621 license:x11))))
1622
1623(define-public linux-libre-arm64-mnt-reform-6.17
1624 ;; Kernel for use on the MNT/Reform systems
1625 ;; https://mntre.com/reform.html
1626 (let ((base (make-linux-libre* linux-libre-6.17-version
1627 linux-libre-6.17-gnu-revision
1628 linux-libre-6.17-source
1629 '("aarch64-linux")
1630 #:extra-version "arm64-mnt-reform"
1631 #:extra-options
1632 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
1633 (append `(("CONFIG_DRM_LVDS_CODEC" . m)
1634 ("CONFIG_DRM_CDNS_MHDP8546" . m)
1635 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
1636 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
1637 ("CONFIG_DRM_IMX_DCSS" . m)
1638 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
1639 ("CONFIG_DRM_PANEL_LVDS" . m)
1640 ("CONFIG_I2C_IMX_LPI2C" . m)
1641 ("CONFIG_I2C_MUX_REG" . m)
1642 ("CONFIG_INTERCONNECT_IMX" . #true)
1643 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
1644 ("CONFIG_MFD_WM8994" . m)
1645 ("CONFIG_MUX_GPIO" . m)
1646 ("CONFIG_MUX_MMIO" . m)
1647 ("CONFIG_RTC_DRV_PCF8523" . m)
1648 ("CONFIG_USB_EHCI_FSL" . m)
1649 ("CONFIG_NO_HZ_IDLE" . #true)
1650 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
1651 ("CONFIG_SND_IMX_SOC" . m)
1652 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
1653 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
1654 ("CONFIG_SND_SOC_IMX_HDMI" . m)
1655 ("CONFIG_INPUT_JOYSTICK" . #true)
1656 ("CONFIG_JOYSTICK_XPAD" . m)
1657 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
1658 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
1659 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
1660 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
1661 ("CONFIG_DRM_IMX_LCDIF" . #true)
1662 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
1663 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
1664 ("CONFIG_IMX8MM_THERMAL" . #true)
1665 ("CONFIG_IMX2_WDT" . #true)
1666 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
1667 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
1668 ("CONFIG_DRM" . #true)
1669 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . #true)
1670 ("CONFIG_IMX8M_BLK_CTRL" . #true)
1671 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
1672 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
1673 ("CONFIG_DRM_FSL_LDB" . #true)
1674 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
1675 ("CONFIG_BACKLIGHT_PWM" . #true)
1676 ("CONFIG_BACKLIGHT_GPIO" . #true)
1677 ("CONFIG_BACKLIGHT_LED" . #true)
1678 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
1679 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
1680 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
1681 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
1682 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
1683 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
1684 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
1685 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
1686 ("CONFIG_IMX_IRQSTEER" . #true)
1687 ("CONFIG_PCI_MESON" . #true)
1688 ("CONFIG_DWMAC_MESON" . #true)
1689 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . #true)
1690 ("CONFIG_GPIO_ROCKCHIP" . #true)
1691 ("CONFIG_PL330_DMA" . #true)
1692 ("CONFIG_I2C_MESON" . #true)
1693 ("CONFIG_PWM_MESON" . #true)
1694 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
1695 ("CONFIG_MMC_MESON_GX" . #true)
1696 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
1697 ("CONFIG_MESON_DDR_PMU" . #true)
1698 ("CONFIG_RTW88_8822CS" . m)
1699 ("CONFIG_PWM_FSL_FTM" . #true)
1700 ("CONFIG_FSL_RCPM" . #true)
1701 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
1702 ("CONFIG_DRM_PANTHOR" . m)
1703 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
1704 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
1705 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
1706 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
1707 ("CONFIG_SPI_ROCKCHIP" . #true)
1708 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
1709 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
1710 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . #true)
1711 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
1712 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
1713 ("CONFIG_ROCKCHIP_DW_MIPI_DSI2" . #true)
1714 ;; Fixes https://codeberg.org/guix/guix/issues/101
1715 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
1716 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
1717 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
1718 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
1719 ("CONFIG_KEY_DH_OPERATIONS" . #true)
1720 ;; nftables support
1721 ("CONFIG_NF_TABLES" . m)
1722 ("CONFIG_NF_TABLES_INET" . #true)
1723 ("CONFIG_NF_TABLES_NETDEV" . #true)
1724 ("CONFIG_NF_TABLES_IPV4" . #true)
1725 ("CONFIG_NF_TABLES_ARP" . #true)
1726 ("CONFIG_NF_TABLES_IPV6" . #true)
1727 ("CONFIG_NF_TABLES_BRIDGE" . m)
1728 ("CONFIG_NFT_NUMGEN" . m)
1729 ("CONFIG_NFT_CT" . m)
1730 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
1731 ("CONFIG_NFT_CONNLIMIT" . m)
1732 ("CONFIG_NFT_LOG" . m)
1733 ("CONFIG_NFT_LIMIT" . m)
1734 ("CONFIG_NFT_MASQ" . m)
1735 ("CONFIG_NFT_REDIR" . m)
1736 ("CONFIG_NFT_NAT" . m)
1737 ("CONFIG_NFT_TUNNEL" . m)
1738 ("CONFIG_NFT_QUEUE" . m)
1739 ("CONFIG_NFT_QUOTA" . m)
1740 ("CONFIG_NFT_REJECT" . m)
1741 ("CONFIG_NFT_REJECT_INET" . m)
1742 ("CONFIG_NFT_COMPAT" . m)
1743 ("CONFIG_NFT_HASH" . m)
1744 ("CONFIG_NFT_FIB" . m)
1745 ("CONFIG_NFT_FIB_INET" . m)
1746 ("CONFIG_NFT_XFRM" . m)
1747 ("CONFIG_NFT_SOCKET" . m)
1748 ("CONFIG_NFT_OSF" . m)
1749 ("CONFIG_NFT_TPROXY" . m)
1750 ("CONFIG_NFT_SYNPROXY" . m)
1751 ("CONFIG_NFT_DUP_NETDEV" . m)
1752 ("CONFIG_NFT_FWD_NETDEV" . m)
1753 ("CONFIG_NFT_FIB_NETDEV" . m)
1754 ("CONFIG_NFT_REJECT_NETDEV" . m)
1755 ("CONFIG_NFT_REJECT_IPV4" . m)
1756 ("CONFIG_NFT_DUP_IPV4" . m)
1757 ("CONFIG_NFT_FIB_IPV4" . m)
1758 ("CONFIG_NFT_COMPAT_ARP" . m)
1759 ("CONFIG_NFT_REJECT_IPV6" . m)
1760 ("CONFIG_NFT_DUP_IPV6" . m)
1761 ("CONFIG_NFT_FIB_IPV6" . m)
1762 ("CONFIG_NFT_BRIDGE_META" . m)
1763 ("CONFIG_NFT_BRIDGE_REJECT" . m)
1764 ;; Provide support for ath9k wireless
1765 ("CONFIG_ATH9K" . m)
1766 ("CONFIG_ATH9K_HTC" . m))
1767 (default-extra-linux-options
1768 linux-libre-6.17-version)))))
1769 (package
1770 (inherit base)
1771 (inputs (list reform-debian-packages))
1772 (synopsis (string-append (package-synopsis base)
1773 " for MNT/Reform systems"))
1774 (description (string-append (package-description base)
1775 " Configuration options and patches have been applied for use with MNT/Reform systems."))
1776 (arguments
1777 (substitute-keyword-arguments (package-arguments base)
1778 ((#:phases phases)
1779 #~(modify-phases #$phases
1780 (add-after 'unpack 'apply-reform-patches
1781 (lambda* (#:key inputs #:allow-other-keys)
1782 (for-each (lambda (patch)
1783 (invoke "patch" "-p1" "-i"
1784 (search-input-file inputs
1785 (string-append
1786 "patches6.17/" patch))))
1787 (list
1788 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
1789 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
1790 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
1791 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
1792 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
1793 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
1794 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
1795 "imx8mp-mnt-pocket-reform/pocket-panel/0002-pocket-panel-fix-sleep-add-orientation.patch"
1796 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
1797 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
1798 "imx8mq-mnt-reform2/0001-drm-etnaviv-Fix-flush-sequence-logic.patch"
1799 "imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch"
1800 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
1801 "imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch"
1802 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
1803 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
1804 "imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
1805 "imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch"
1806 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
1807 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
1808 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
1809 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
1810 "meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch"
1811 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
1812 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
1813 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
1814 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
1815 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
1816 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
1817 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
1818 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
1819 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
1820 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
1821 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
1822 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
1823 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
1824 "meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch"
1825 "rk3588-mnt-reform2/0001-MERGED-drm-bridge-Pass-down-connector-to-drm-bridge-.patch"
1826 "rk3588-mnt-reform2/0010-MERGED-arm64-dts-rockchip-add-pd_npu-label-for-RK358.patch"
1827 "rk3588-mnt-reform2/0011-MERGED-arm64-dts-rockchip-Add-nodes-for-NPU-and-its-.patch"
1828 "rk3588-mnt-reform2/0024-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
1829 "rk3588-mnt-reform2/0025-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
1830 "rk3588-mnt-reform2/0026-clk-composite-replace-open-coded-abs_diff.patch"
1831 "rk3588-mnt-reform2/0030-mfd-rk8xx-Fix-shutdown-handler.patch"
1832 "rk3588-mnt-reform2/0033-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
1833 "rk3588-mnt-reform2/0035-drm-rockchip-vop2-Add-core-reset-support.patch"
1834 "rk3588-mnt-reform2/0037-drm-bridge-synopsys-Add-DW-DPTX-Controller-support-l.patch"
1835 "rk3588-mnt-reform2/0038-drm-rockchip-Add-RK3588-DPTX-output-support.patch"
1836 "rk3588-mnt-reform2/0041-drm-birdge-simple-bridge-Add-support-for-radxa-ra620.patch"
1837 "rk3588-mnt-reform2/0042-arm64-dts-rockchip-Add-DP0-for-rk3588.patch"
1838 "rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-DP1-for-rk3588.patch"
1839 "rk3588-mnt-reform2/0046-arm64-defconfig-Enable-Rockchip-RK3588-DisplayPort-C.patch"
1840 "rk3588-mnt-reform2/0048-arm64-dts-rockchip-Fix-USB-C-description-for-RK3588-.patch"
1841 "rk3588-mnt-reform2/0068-drm-bridge-dw-hdmi-qp-Add-CEC-support.patch"
1842 "rk3588-mnt-reform2/0069-drm-bridge-dw-hdmi-qp-Fixup-timer-base-setup.patch"
1843 "rk3588-mnt-reform2/0070-drm-rockchip-dw_hdmi_qp-Improve-error-handling-with-.patch"
1844 "rk3588-mnt-reform2/0071-drm-rockchip-dw_hdmi_qp-Provide-CEC-IRQ-in-dw_hdmi_q.patch"
1845 "rk3588-mnt-reform2/0072-drm-rockchip-dw_hdmi_qp-Provide-ref-clock-rate-in-dw.patch"
1846 "rk3588-mnt-reform2/0075-phy-hdmi-Add-HDMI-2.1-FRL-configuration-options.patch"
1847 "rk3588-mnt-reform2/0076-phy-rockchip-samsung-hdptx-Fix-reported-clock-rate-i.patch"
1848 "rk3588-mnt-reform2/0077-phy-rockchip-samsung-hdptx-Reduce-ROPLL-loop-bandwid.patch"
1849 "rk3588-mnt-reform2/0078-phy-rockchip-samsung-hdptx-Prevent-Inter-Pair-Skew-f.patch"
1850 "rk3588-mnt-reform2/0079-phy-rockchip-samsung-hdptx-Use-usleep_range-instead-.patch"
1851 "rk3588-mnt-reform2/0080-phy-rockchip-samsung-hdptx-Fix-coding-style-alignmen.patch"
1852 "rk3588-mnt-reform2/0081-phy-rockchip-samsung-hdptx-Consistently-use-rk_-hdpt.patch"
1853 "rk3588-mnt-reform2/0082-phy-rockchip-samsung-hdptx-Enable-lane-output-in-com.patch"
1854 "rk3588-mnt-reform2/0083-phy-rockchip-samsung-hdptx-Cleanup-_cmn_init_seq-lis.patch"
1855 "rk3588-mnt-reform2/0084-phy-rockchip-samsung-hdptx-Compute-clk-rate-from-PLL.patch"
1856 "rk3588-mnt-reform2/0085-phy-rockchip-samsung-hdptx-Drop-hw_rate-driver-data.patch"
1857 "rk3588-mnt-reform2/0086-phy-rockchip-samsung-hdptx-Switch-to-driver-specific.patch"
1858 "rk3588-mnt-reform2/0087-phy-rockchip-samsung-hdptx-Extend-rk_hdptx_phy_verif.patch"
1859 "rk3588-mnt-reform2/0088-phy-rockchip-samsung-hdptx-Add-HDMI-2.1-FRL-support.patch"
1860 "rk3588-mnt-reform2/0089-drm-rockchip-vop2-Check-bpc-before-switching-DCLK-so.patch"
1861 "rk3588-mnt-reform2/0091-drm-rockchip-dw_hdmi_qp-Switch-to-phy_configure.patch"
1862 "rk3588-mnt-reform2/0114-media-dt-bindings-video-interfaces-add-defines-for-s.patch"
1863 "rk3588-mnt-reform2/0123-phy-rockchip-phy-rockchip-inno-csidphy-allow-writes-.patch"
1864 "rk3588-mnt-reform2/0126-arm64-defconfig-enable-rockchip-camera-interface-and.patch"
1865 "rk3588-mnt-reform2/0127-arm64-dts-rockchip-add-the-vip-node-to-px30.patch"
1866 "rk3588-mnt-reform2/0131-arm64-dts-rockchip-add-mipi-csi-2-dphy-nodes-to-rk35.patch"
1867 "rk3588-mnt-reform2/0142-drm-bridge-dw-hdmi-qp-Fix-spurious-IRQ-on-resume.patch"
1868 "rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch"
1869 "rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch"
1870 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
1871 (add-after 'apply-reform-patches 'copy-reform-dts-files
1872 (lambda* (#:key inputs #:allow-other-keys)
1873 (for-each (lambda (dts)
1874 (copy-file (search-input-file inputs
1875 (string-append
1876 "/dts/" dts))
1877 (string-append "arch/arm64/boot/dts/"
1878 dts)))
1879 (list
1880 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
1881 "freescale/fsl-ls1028a-mnt-reform2.dts"
1882 "freescale/imx8mp-mnt-pocket-reform.dts"
1883 "freescale/imx8mp-mnt-reform2.dts"
1884 "freescale/imx8mq-mnt-reform2-hdmi.dts"
1885 "rockchip/rk3588-mnt-pocket-reform.dts"
1886 "rockchip/rk3588-mnt-reform-next.dts"
1887 "rockchip/rk3588-mnt-reform2.dts"
1888 "rockchip/rk3588-mnt-reform2-dsi.dts"
1889 ))))
1890 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
1891 (lambda _
1892 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
1893 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
1894 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
1895dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
1896 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
1897 (("fsl-ls1028a-rdb.dtb")
1898 "fsl-ls1028a-rdb.dtb
1899dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
1900 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
1901 (("imx8mq-mnt-reform2.dtb")
1902 "imx8mq-mnt-reform2.dtb
1903dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
1904dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
1905dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
1906 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
1907 (("rk3588-mnt-reform2.dtb")
1908 "rk3588-mnt-reform2.dtb
1909dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb
1910dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
1911dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
1912
1913(define-public linux-libre-arm64-mnt-reform linux-libre-arm64-mnt-reform-6.17)
1914
1915(define-public linux-libre-arm64-mnt-reform-6.16
1916 ;; Kernel for use on the MNT/Reform systems
1917 ;; https://mntre.com/reform.html
1918 (let ((base (make-linux-libre* linux-libre-6.16-version
1919 linux-libre-6.16-gnu-revision
1920 linux-libre-6.16-source
1921 '("aarch64-linux")
1922 #:extra-version "arm64-mnt-reform"
1923 #:extra-options
1924 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
1925 (append `(("CONFIG_DRM_LVDS_CODEC" . m)
1926 ("CONFIG_DRM_CDNS_MHDP8546" . m)
1927 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
1928 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
1929 ("CONFIG_DRM_IMX_DCSS" . m)
1930 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
1931 ("CONFIG_DRM_PANEL_LVDS" . m)
1932 ("CONFIG_I2C_IMX_LPI2C" . m)
1933 ("CONFIG_I2C_MUX_REG" . m)
1934 ("CONFIG_INTERCONNECT_IMX" . #true)
1935 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
1936 ("CONFIG_MFD_WM8994" . m)
1937 ("CONFIG_MUX_GPIO" . m)
1938 ("CONFIG_MUX_MMIO" . m)
1939 ("CONFIG_RTC_DRV_PCF8523" . m)
1940 ("CONFIG_USB_EHCI_FSL" . m)
1941 ("CONFIG_NO_HZ_IDLE" . #true)
1942 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
1943 ("CONFIG_SND_IMX_SOC" . m)
1944 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
1945 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
1946 ("CONFIG_SND_SOC_IMX_HDMI" . m)
1947 ("CONFIG_INPUT_JOYSTICK" . #true)
1948 ("CONFIG_JOYSTICK_XPAD" . m)
1949 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
1950 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
1951 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
1952 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
1953 ("CONFIG_DRM_IMX_LCDIF" . #true)
1954 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
1955 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
1956 ("CONFIG_IMX8MM_THERMAL" . #true)
1957 ("CONFIG_IMX2_WDT" . #true)
1958 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
1959 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
1960 ("CONFIG_DRM" . #true)
1961 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . #true)
1962 ("CONFIG_IMX8M_BLK_CTRL" . #true)
1963 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
1964 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
1965 ("CONFIG_DRM_FSL_LDB" . #true)
1966 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
1967 ("CONFIG_BACKLIGHT_PWM" . #true)
1968 ("CONFIG_BACKLIGHT_GPIO" . #true)
1969 ("CONFIG_BACKLIGHT_LED" . #true)
1970 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
1971 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
1972 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
1973 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
1974 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
1975 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
1976 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
1977 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
1978 ("CONFIG_IMX_IRQSTEER" . #true)
1979 ("CONFIG_PCI_MESON" . #true)
1980 ("CONFIG_DWMAC_MESON" . #true)
1981 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . #true)
1982 ("CONFIG_GPIO_ROCKCHIP" . #true)
1983 ("CONFIG_PL330_DMA" . #true)
1984 ("CONFIG_I2C_MESON" . #true)
1985 ("CONFIG_PWM_MESON" . #true)
1986 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
1987 ("CONFIG_MMC_MESON_GX" . #true)
1988 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
1989 ("CONFIG_MESON_DDR_PMU" . #true)
1990 ("CONFIG_RTW88_8822CS" . m)
1991 ("CONFIG_PWM_FSL_FTM" . #true)
1992 ("CONFIG_FSL_RCPM" . #true)
1993 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
1994 ("CONFIG_DRM_PANTHOR" . m)
1995 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
1996 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
1997 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
1998 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
1999 ("CONFIG_SPI_ROCKCHIP" . #true)
2000 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
2001 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
2002 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . #true)
2003 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
2004 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
2005 ("CONFIG_ROCKCHIP_DW_MIPI_DSI2" . #true)
2006 ;; Fixes https://codeberg.org/guix/guix/issues/101
2007 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
2008 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
2009 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
2010 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
2011 ("CONFIG_KEY_DH_OPERATIONS" . #true)
2012 ;; nftables support
2013 ("CONFIG_NF_TABLES" . m)
2014 ("CONFIG_NF_TABLES_INET" . #true)
2015 ("CONFIG_NF_TABLES_NETDEV" . #true)
2016 ("CONFIG_NF_TABLES_IPV4" . #true)
2017 ("CONFIG_NF_TABLES_ARP" . #true)
2018 ("CONFIG_NF_TABLES_IPV6" . #true)
2019 ("CONFIG_NF_TABLES_BRIDGE" . m)
2020 ("CONFIG_NFT_NUMGEN" . m)
2021 ("CONFIG_NFT_CT" . m)
2022 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
2023 ("CONFIG_NFT_CONNLIMIT" . m)
2024 ("CONFIG_NFT_LOG" . m)
2025 ("CONFIG_NFT_LIMIT" . m)
2026 ("CONFIG_NFT_MASQ" . m)
2027 ("CONFIG_NFT_REDIR" . m)
2028 ("CONFIG_NFT_NAT" . m)
2029 ("CONFIG_NFT_TUNNEL" . m)
2030 ("CONFIG_NFT_QUEUE" . m)
2031 ("CONFIG_NFT_QUOTA" . m)
2032 ("CONFIG_NFT_REJECT" . m)
2033 ("CONFIG_NFT_REJECT_INET" . m)
2034 ("CONFIG_NFT_COMPAT" . m)
2035 ("CONFIG_NFT_HASH" . m)
2036 ("CONFIG_NFT_FIB" . m)
2037 ("CONFIG_NFT_FIB_INET" . m)
2038 ("CONFIG_NFT_XFRM" . m)
2039 ("CONFIG_NFT_SOCKET" . m)
2040 ("CONFIG_NFT_OSF" . m)
2041 ("CONFIG_NFT_TPROXY" . m)
2042 ("CONFIG_NFT_SYNPROXY" . m)
2043 ("CONFIG_NFT_DUP_NETDEV" . m)
2044 ("CONFIG_NFT_FWD_NETDEV" . m)
2045 ("CONFIG_NFT_FIB_NETDEV" . m)
2046 ("CONFIG_NFT_REJECT_NETDEV" . m)
2047 ("CONFIG_NFT_REJECT_IPV4" . m)
2048 ("CONFIG_NFT_DUP_IPV4" . m)
2049 ("CONFIG_NFT_FIB_IPV4" . m)
2050 ("CONFIG_NFT_COMPAT_ARP" . m)
2051 ("CONFIG_NFT_REJECT_IPV6" . m)
2052 ("CONFIG_NFT_DUP_IPV6" . m)
2053 ("CONFIG_NFT_FIB_IPV6" . m)
2054 ("CONFIG_NFT_BRIDGE_META" . m)
2055 ("CONFIG_NFT_BRIDGE_REJECT" . m)
2056 ;; Provide support for ath9k wireless
2057 ("CONFIG_ATH9K" . m)
2058 ("CONFIG_ATH9K_HTC" . m))
2059 (default-extra-linux-options
2060 linux-libre-6.16-version)))))
2061 (package
2062 (inherit base)
2063 (inputs (list reform-debian-packages))
2064 (synopsis (string-append (package-synopsis base)
2065 " for MNT/Reform systems"))
2066 (description (string-append (package-description base)
2067 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2068 (arguments
2069 (substitute-keyword-arguments (package-arguments base)
2070 ((#:phases phases)
2071 #~(modify-phases #$phases
2072 (add-after 'unpack 'apply-reform-patches
2073 (lambda* (#:key inputs #:allow-other-keys)
2074 (for-each (lambda (patch)
2075 (invoke "patch" "-p1" "-i"
2076 (search-input-file inputs
2077 (string-append
2078 "patches6.16/" patch))))
2079 (list
2080 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2081 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2082 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
2083 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2084 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2085 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2086 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2087 "imx8mp-mnt-pocket-reform/pocket-panel/0002-pocket-panel-fix-sleep-add-orientation.patch"
2088 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2089 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2090 "imx8mq-mnt-reform2/0001-drm-etnaviv-Fix-flush-sequence-logic.patch"
2091 "imx8mq-mnt-reform2/0001-imx8mq-mnt-reform2.dts-multiple-fixes-for-display-wi.patch"
2092 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2093 "imx8mq-mnt-reform2/0002-Revert-drm-bridge-nwl-dsi-Use-vsync-hsync-polarity-f.patch"
2094 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2095 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2096 "imx8mq-mnt-reform2/0005-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2097 "imx8mq-mnt-reform2/0006-imx8mq-import-HDMI-driver-and-make-DCSS-compatible-w.patch"
2098 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2099 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2100 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2101 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2102 "meson-g12b-bananapi-cm4-mnt-reform2/0001-meson-g12b-bananapi-cm4-mnt-reform2.dts-fix-audio-an.patch"
2103 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2104 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2105 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2106 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2107 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2108 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2109 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2110 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2111 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2112 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2113 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2114 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2115 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2116 "meson-g12b-bananapi-cm4-mnt-reform2/0030-WORKAROUND-meson-plane-disable-afbc-32x8.patch"
2117 "rk3588-mnt-reform2/0002-MERGED-drm-connector-hdmi-Add-support-for-YUV420-for.patch"
2118 "rk3588-mnt-reform2/0003-MERGED-drm-connector-hdmi-Improve-debug-message-for-.patch"
2119 "rk3588-mnt-reform2/0004-MERGED-drm-connector-hdmi-Add-missing-bpc-debug-info.patch"
2120 "rk3588-mnt-reform2/0005-MERGED-drm-connector-hdmi-Factor-out-bpc-and-format-.patch"
2121 "rk3588-mnt-reform2/0006-MERGED-drm-connector-hdmi-Use-YUV420-output-format-a.patch"
2122 "rk3588-mnt-reform2/0020-MERGED-thermal-rockchip-rename-rk_tsadcv3_tshut_mode.patch"
2123 "rk3588-mnt-reform2/0023-MERGED-dt-bindings-thermal-rockchip-document-otp-the.patch"
2124 "rk3588-mnt-reform2/0024-MERGED-thermal-rockchip-support-reading-trim-values-.patch"
2125 "rk3588-mnt-reform2/0029-MERGED-drm-bridge-Pass-down-connector-to-drm-bridge-.patch"
2126 "rk3588-mnt-reform2/0040-MERGED-arm64-defconfig-enable-further-Rockchip-platf.patch"
2127 "rk3588-mnt-reform2/0041-MERGED-dt-bindings-pinctrl-rockchip-increase-max-amo.patch"
2128 "rk3588-mnt-reform2/0045-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2129 "rk3588-mnt-reform2/0046-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2130 "rk3588-mnt-reform2/0047-clk-composite-replace-open-coded-abs_diff.patch"
2131 "rk3588-mnt-reform2/0051-media-v4l2-ctrls-core-Set-frame_mbs_only_flag-by-def.patch"
2132 "rk3588-mnt-reform2/0052-media-rockchip-Move-H264-CABAC-table-to-header-file.patch"
2133 "rk3588-mnt-reform2/0053-media-rockchip-Introduce-the-rkvdec2-driver.patch"
2134 "rk3588-mnt-reform2/0054-media-dt-bindings-rockchip-Document-RK3588-Video-Dec.patch"
2135 "rk3588-mnt-reform2/0055-arm64-dts-rockchip-Add-rkvdec2-Video-Decoder-on-rk35.patch"
2136 "rk3588-mnt-reform2/0056-arm64-defconfig-enable-Rockchip-RK3588-video-decoder.patch"
2137 "rk3588-mnt-reform2/0057-mfd-rk8xx-Fix-shutdown-handler.patch"
2138 "rk3588-mnt-reform2/0058-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2139 "rk3588-mnt-reform2/0059-drm-rockchip-vop2-Add-clock-resets-support.patch"
2140 "rk3588-mnt-reform2/0060-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2141 "rk3588-mnt-reform2/0062-drm-rockchip-vop2-Add-core-reset-support.patch"
2142 "rk3588-mnt-reform2/0063-WIP-drm-rockchip-dw_hdmi_qp-Make-use-of-phy_configur.patch"
2143 "rk3588-mnt-reform2/0064-WIP-drm-bridge-Add-detect_ctx-hook.patch"
2144 "rk3588-mnt-reform2/0065-WIP-drm-bridge-connector-Switch-from-detect-to-detec.patch"
2145 "rk3588-mnt-reform2/0066-WIP-drm-bridge-dw-hdmi-qp-Add-high-TMDS-clock-ratio-.patch"
2146 "rk3588-mnt-reform2/0067-dt-bindings-display-rockchip-Add-schema-for-RK3588-D.patch"
2147 "rk3588-mnt-reform2/0068-drm-bridge-synopsys-Add-DW-DPTX-Controller-support-l.patch"
2148 "rk3588-mnt-reform2/0069-drm-rockchip-Add-RK3588-DPTX-output-support.patch"
2149 "rk3588-mnt-reform2/0070-MAINTAINERS-Add-entry-for-DW-DPTX-Controller-bridge.patch"
2150 "rk3588-mnt-reform2/0072-drm-birdge-simple-bridge-Add-support-for-radxa-ra620.patch"
2151 "rk3588-mnt-reform2/0073-arm64-dts-rockchip-Add-DP0-for-rk3588.patch"
2152 "rk3588-mnt-reform2/0074-arm64-dts-rockchip-Add-DP1-for-rk3588.patch"
2153 "rk3588-mnt-reform2/0077-arm64-defconfig-Enable-Rockchip-RK3588-DisplayPort-C.patch"
2154 "rk3588-mnt-reform2/0080-accel-rocket-Add-registers-header.patch"
2155 "rk3588-mnt-reform2/0081-accel-rocket-Add-a-new-driver-for-Rockchip-s-NPU.patch"
2156 "rk3588-mnt-reform2/0082-accel-rocket-Add-IOCTL-for-BO-creation.patch"
2157 "rk3588-mnt-reform2/0083-accel-rocket-Add-job-submission-IOCTL.patch"
2158 "rk3588-mnt-reform2/0084-accel-rocket-Add-IOCTLs-for-synchronizing-memory-acc.patch"
2159 "rk3588-mnt-reform2/0085-dt-bindings-npu-rockchip-rknn-Add-bindings.patch"
2160 "rk3588-mnt-reform2/0086-arm64-dts-rockchip-add-pd_npu-label-for-RK3588-power.patch"
2161 "rk3588-mnt-reform2/0087-arm64-dts-rockchip-Add-nodes-for-NPU-and-its-MMU-to-.patch"
2162 "rk3588-mnt-reform2/0091-PM-devfreq-rockchip-dfi-double-count-on-RK3588.patch"
2163 "rk3588-mnt-reform2/0092-PM-devfreq-rockchip-dfi-add-support-for-LPDDR5.patch"
2164 "rk3588-mnt-reform2/0098-drm-bridge-dw-hdmi-qp-Add-CEC-driver.patch"
2165 "rk3588-mnt-reform2/0101-defconfig-Enable-watchdog-sysfs-for-testing.patch"
2166 "rk3588-mnt-reform2/0108-arm64-dts-rockchip-use-downstream-PHY-timing-setup.patch"
2167 "rk3588-mnt-reform2/0111-net-stmmac-dwmac-rk-Fix-disabling-set_clock_selectio.patch"
2168 "rk3588-mnt-reform2/2001-drm-bridge-dw-hdmi-qp-Return-0-in-audio-prepare-when.patch"
2169 "rk3588-mnt-reform2/2003-drm-bridge-synopsys-Do-not-warn-about-audio-params-c.patch"
2170 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
2171 (add-after 'apply-reform-patches 'copy-reform-dts-files
2172 (lambda* (#:key inputs #:allow-other-keys)
2173 (for-each (lambda (dts)
2174 (copy-file (search-input-file inputs
2175 (string-append
2176 "/dts/" dts))
2177 (string-append "arch/arm64/boot/dts/"
2178 dts)))
2179 (list
2180 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2181 "freescale/fsl-ls1028a-mnt-reform2.dts"
2182 "freescale/imx8mp-mnt-pocket-reform.dts"
2183 "freescale/imx8mp-mnt-reform2.dts"
2184 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2185 "rockchip/rk3588-mnt-pocket-reform.dts"
2186 "rockchip/rk3588-mnt-reform-next.dts"
2187 "rockchip/rk3588-mnt-reform2.dts"
2188 "rockchip/rk3588-mnt-reform2-dsi.dts"
2189 ))))
2190 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2191 (lambda _
2192 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2193 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2194 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2195dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2196 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2197 (("fsl-ls1028a-rdb.dtb")
2198 "fsl-ls1028a-rdb.dtb
2199dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2200 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2201 (("imx8mq-mnt-reform2.dtb")
2202 "imx8mq-mnt-reform2.dtb
2203dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2204dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2205dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2206 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2207 (("rk3588-mnt-reform2.dtb")
2208 "rk3588-mnt-reform2.dtb
2209dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2-dsi.dtb
2210dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2211dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
2212
2213(define-public linux-libre-arm64-mnt-reform-6.12
2214 ;; Kernel for use on the MNT/Reform systems
2215 ;; https://mntre.com/reform.html
2216 (let ((base (make-linux-libre* linux-libre-6.12-version
2217 linux-libre-6.12-gnu-revision
2218 (source-with-patches linux-libre-6.12-source
2219 ;; Revert upstream patches
2220 ;; that conflict with
2221 ;; MNT/Reform patches
2222 (search-patches
2223 "linux-libre-arm64-mnt-reform-revert-vop2-display-modes.patch"
2224 "linux-libre-arm64-mnt-reform-revert-phy-rockchip-samsung.patch"
2225 "linux-libre-arm64-mnt-reform-revert-rk-samsung-hdptx.patch"))
2226 '("aarch64-linux")
2227 #:extra-version "arm64-mnt-reform"
2228 #:extra-options
2229 ;; https://source.mnt.re/reform/reform-debian-packages/-/blob/main/linux/config
2230 (append `(("CONFIG_DRM_LVDS_CODEC" . m)
2231 ("CONFIG_DRM_CDNS_MHDP8546" . m)
2232 ("CONFIG_DRM_CDNS_HDMI_CEC" . m)
2233 ("CONFIG_DRM_IMX_CDNS_MHDP" . m)
2234 ("CONFIG_DRM_IMX_DCSS" . m)
2235 ("CONFIG_PHY_FSL_IMX8MQ_HDPTX" . m)
2236 ("CONFIG_DRM_PANEL_LVDS" . m)
2237 ("CONFIG_I2C_IMX_LPI2C" . m)
2238 ("CONFIG_I2C_MUX_REG" . m)
2239 ("CONFIG_INTERCONNECT_IMX" . #true)
2240 ("CONFIG_INTERCONNECT_IMX8MQ" . #true)
2241 ("CONFIG_MFD_WM8994" . m)
2242 ("CONFIG_MUX_GPIO" . m)
2243 ("CONFIG_MUX_MMIO" . m)
2244 ("CONFIG_RTC_DRV_PCF8523" . m)
2245 ("CONFIG_USB_EHCI_FSL" . m)
2246 ("CONFIG_NO_HZ_IDLE" . #true)
2247 ("CONFIG_SND_SOC_FSL_MICFIL" . m)
2248 ("CONFIG_SND_IMX_SOC" . m)
2249 ("CONFIG_SND_SOC_FSL_ASOC_CARD" . m)
2250 ("CONFIG_SND_SOC_IMX_AUDMIX" . m)
2251 ("CONFIG_SND_SOC_IMX_HDMI" . m)
2252 ("CONFIG_INPUT_JOYSTICK" . #true)
2253 ("CONFIG_JOYSTICK_XPAD" . m)
2254 ("CONFIG_JOYSTICK_XPAD_FF" . #true)
2255 ("CONFIG_JOYSTICK_XPAD_LEDS" . #true)
2256 ("CONFIG_INTERCONNECT_IMX8MP" . #true)
2257 ("CONFIG_SND_SOC_FSL_ASRC" . #true)
2258 ("CONFIG_DRM_IMX_LCDIF" . #true)
2259 ("CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE" . #true)
2260 ("CONFIG_DRM_IMX8MP_HDMI_PVI" . #true)
2261 ("CONFIG_IMX8MM_THERMAL" . #true)
2262 ("CONFIG_IMX2_WDT" . #true)
2263 ("CONFIG_DRM_SAMSUNG_DSIM" . #true)
2264 ("CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY" . #true)
2265 ("CONFIG_DRM" . #true)
2266 ("CONFIG_DRM_PANEL_MNT_POCKET_REFORM" . #true)
2267 ("CONFIG_IMX8M_BLK_CTRL" . #true)
2268 ("CONFIG_IMX_GPCV2_PM_DOMAINS" . #true)
2269 ("CONFIG_DRM_DISPLAY_CONNECTOR" . #true)
2270 ("CONFIG_DRM_FSL_LDB" . #true)
2271 ("CONFIG_BACKLIGHT_CLASS_DEVICE" . #true)
2272 ("CONFIG_BACKLIGHT_PWM" . #true)
2273 ("CONFIG_BACKLIGHT_GPIO" . #true)
2274 ("CONFIG_BACKLIGHT_LED" . #true)
2275 ("CONFIG_CPU_FREQ_GOV_PERFORMANCE" . #true)
2276 ("CONFIG_CPU_FREQ_GOV_POWERSAVE" . #true)
2277 ("CONFIG_CPU_FREQ_GOV_USERSPACE" . #true)
2278 ("CONFIG_CPU_FREQ_GOV_ONDEMAND" . #true)
2279 ("CONFIG_CPU_FREQ_GOV_CONSERVATIVE" . #true)
2280 ("CONFIG_CPU_FREQ_GOV_SCHEDUTIL" . #true)
2281 ("CONFIG_ARM_IMX_CPUFREQ_DT" . #true)
2282 ("CONFIG_ARM_IMX_BUS_DEVFREQ" . #true)
2283 ("CONFIG_IMX_IRQSTEER" . #true)
2284 ("CONFIG_PCI_MESON" . #true)
2285 ("CONFIG_DWMAC_MESON" . #true)
2286 ("CONFIG_MDIO_BUS_MUX_MESON_G12A" . #true)
2287 ("CONFIG_I2C_MESON" . #true)
2288 ("CONFIG_PWM_MESON" . #true)
2289 ("CONFIG_USB_DWC3_MESON_G12A" . #true)
2290 ("CONFIG_MMC_MESON_GX" . #true)
2291 ("CONFIG_MMC_MESON_MX_SDIO" . #true)
2292 ("CONFIG_MESON_DDR_PMU" . #true)
2293 ("CONFIG_RTW88_8822CS" . m)
2294 ("CONFIG_PWM_FSL_FTM" . #true)
2295 ("CONFIG_FSL_RCPM" . #true)
2296 ("CONFIG_ARM_ROCKCHIP_CPUFREQ" . m)
2297 ("CONFIG_DRM_PANTHOR" . m)
2298 ("CONFIG_NVMEM_ROCKCHIP_OTP" . #true)
2299 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX" . m)
2300 ("CONFIG_PHY_ROCKCHIP_USBDP" . m)
2301 ("CONFIG_ROCKCHIP_INNO_HDMI" . #true)
2302 ("CONFIG_ROCKCHIP_LVDS" . #true)
2303 ("CONFIG_ROCKCHIP_REGULATOR_COUPLER" . #true)
2304 ("CONFIG_SPI_ROCKCHIP" . #true)
2305 ("CONFIG_SPI_ROCKCHIP_SFC" . m)
2306 ("CONFIG_ARM_SCMI_CPUFREQ" . m)
2307 ("CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY" . m)
2308 ("CONFIG_VIDEO_ROCKCHIP_VDEC2" . m)
2309 ("CONFIG_ROCKCHIP_DW_HDMI_QP" . #true)
2310 ("CONFIG_ROCKCHIP_DW_MIPI_DSI" . #true)
2311 ;; Fixes https://codeberg.org/guix/guix/issues/101
2312 ("CONFIG_CRYPTO_USER_API_HASH" . #true)
2313 ("CONFIG_CRYPTO_USER_API_SKCIPHER" . #true)
2314 ("CONFIG_CRYPTO_USER_API_RNG" . #true)
2315 ("CONFIG_CRYPTO_USER_API_AEAD" . #true)
2316 ("CONFIG_KEY_DH_OPERATIONS" . #true)
2317 ;; nftables support
2318 ("CONFIG_NF_TABLES" . m)
2319 ("CONFIG_NF_TABLES_INET" . #true)
2320 ("CONFIG_NF_TABLES_NETDEV" . #true)
2321 ("CONFIG_NF_TABLES_IPV4" . #true)
2322 ("CONFIG_NF_TABLES_ARP" . #true)
2323 ("CONFIG_NF_TABLES_IPV6" . #true)
2324 ("CONFIG_NF_TABLES_BRIDGE" . m)
2325 ("CONFIG_NFT_NUMGEN" . m)
2326 ("CONFIG_NFT_CT" . m)
2327 ("CONFIG_NFT_FLOW_OFFLOAD" . m)
2328 ("CONFIG_NFT_CONNLIMIT" . m)
2329 ("CONFIG_NFT_LOG" . m)
2330 ("CONFIG_NFT_LIMIT" . m)
2331 ("CONFIG_NFT_MASQ" . m)
2332 ("CONFIG_NFT_REDIR" . m)
2333 ("CONFIG_NFT_NAT" . m)
2334 ("CONFIG_NFT_TUNNEL" . m)
2335 ("CONFIG_NFT_QUEUE" . m)
2336 ("CONFIG_NFT_QUOTA" . m)
2337 ("CONFIG_NFT_REJECT" . m)
2338 ("CONFIG_NFT_REJECT_INET" . m)
2339 ("CONFIG_NFT_COMPAT" . m)
2340 ("CONFIG_NFT_HASH" . m)
2341 ("CONFIG_NFT_FIB" . m)
2342 ("CONFIG_NFT_FIB_INET" . m)
2343 ("CONFIG_NFT_XFRM" . m)
2344 ("CONFIG_NFT_SOCKET" . m)
2345 ("CONFIG_NFT_OSF" . m)
2346 ("CONFIG_NFT_TPROXY" . m)
2347 ("CONFIG_NFT_SYNPROXY" . m)
2348 ("CONFIG_NFT_DUP_NETDEV" . m)
2349 ("CONFIG_NFT_FWD_NETDEV" . m)
2350 ("CONFIG_NFT_FIB_NETDEV" . m)
2351 ("CONFIG_NFT_REJECT_NETDEV" . m)
2352 ("CONFIG_NFT_REJECT_IPV4" . m)
2353 ("CONFIG_NFT_DUP_IPV4" . m)
2354 ("CONFIG_NFT_FIB_IPV4" . m)
2355 ("CONFIG_NFT_COMPAT_ARP" . m)
2356 ("CONFIG_NFT_REJECT_IPV6" . m)
2357 ("CONFIG_NFT_DUP_IPV6" . m)
2358 ("CONFIG_NFT_FIB_IPV6" . m)
2359 ("CONFIG_NFT_BRIDGE_META" . m)
2360 ("CONFIG_NFT_BRIDGE_REJECT" . m)
2361 ;; Provide support for ath9k wireless
2362 ("CONFIG_ATH9K" . m)
2363 ("CONFIG_ATH9K_HTC" . m))
2364 (default-extra-linux-options
2365 linux-libre-6.12-version)))))
2366 (package
2367 (inherit base)
2368 (inputs (list reform-debian-packages-for-6.12))
2369 (synopsis (string-append (package-synopsis base)
2370 " for MNT/Reform systems"))
2371 (description (string-append (package-description base)
2372 " Configuration options and patches have been applied for use with MNT/Reform systems."))
2373 (arguments
2374 (substitute-keyword-arguments (package-arguments base)
2375 ((#:phases phases)
2376 #~(modify-phases #$phases
2377 (add-after 'unpack 'apply-reform-patches
2378 (lambda* (#:key inputs #:allow-other-keys)
2379 (for-each (lambda (patch)
2380 (invoke "patch" "-p1" "-i"
2381 (search-input-file inputs
2382 (string-append
2383 "patches6.12/" patch))))
2384 (list
2385 "imx8mp-mnt-pocket-reform/2ghz/0001-imx8mp-2ghz-clk.patch"
2386 "imx8mp-mnt-pocket-reform/2ghz/0002-imx8mp-2ghz-opp.patch"
2387 "imx8mp-mnt-pocket-reform/audio/0000-revert-crashy-audiomix-pm-support.patch"
2388 "imx8mp-mnt-pocket-reform/mmc-sdio/0001-sdhci-add-no-sd-uhs-sdr104-devicetree-property.patch"
2389 "imx8mp-mnt-pocket-reform/mmc-sdio/0002-During-the-card-init-the-host-side-sometimes-may-nee.patch"
2390 "imx8mp-mnt-pocket-reform/mmc-sdio/0003-USDHC-IP-has-one-limitation-the-tuning-circuit-can-t.patch"
2391 "imx8mp-mnt-pocket-reform/pocket-panel/0001-v5-add-multi-display-panel-driver.patch"
2392 "imx8mp-mnt-reform2/0001-sn65dsi86-use-hs-clock-of-samsung-dsim-host-directly.patch"
2393 "imx8mp-mnt-reform2/0002-lcdif-dont-exceed-desired-pixel-clock.patch"
2394 "imx8mq-mnt-reform2/0001-nwl-dsi-fixup-mode-only-for-LCDIF-input-not-DCSS.patch"
2395 "imx8mq-mnt-reform2/0002-pci-imx6-add-support-for-internal-refclk-imx8mq.patch"
2396 "imx8mq-mnt-reform2/0003-lcdif-fix-pcie-interference.patch"
2397 "imx8mq-mnt-reform2/0004-mnt4002-imx-gpcv2-wake-smccc.patch.patch"
2398 ;; Does not apply, needs further investigation
2399 ;; "imx8mq-mnt-reform2/v19_20241126_sandor_yu_initial_support_cadence_mhdp8501_hdmi_dp_for_i_mx8mq.mbx"
2400 "ls1028a-mnt-reform2/0000-dtsi-add-hdptx.patch"
2401 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0001-a311d-viu-fifo-lines-config.patch"
2402 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0002-a311d-viu-fifo-lines-config-header.patch"
2403 "meson-g12b-bananapi-cm4-mnt-pocket-reform/0003-tlv320aic31xx-add-1228800hz-support.patch"
2404 "meson-g12b-bananapi-cm4-mnt-reform2/0001-Revert-drm-bridge-synopsys-dw-mipi-dsi-enable-EoTp-b.patch"
2405 "meson-g12b-bananapi-cm4-mnt-reform2/0011-dw-mipi-dsi-phy-stop-wait-time.patch"
2406 "meson-g12b-bananapi-cm4-mnt-reform2/0012-innolux-n125hce-gn1-timing-tweaks.patch"
2407 "meson-g12b-bananapi-cm4-mnt-reform2/0013-meson-viu-hold-fifo-lines.patch"
2408 "meson-g12b-bananapi-cm4-mnt-reform2/0014-meson-venc-sync.patch.patch"
2409 "meson-g12b-bananapi-cm4-mnt-reform2/0015-meson-dw-mipi-dsi-sync-invert.patch"
2410 "meson-g12b-bananapi-cm4-mnt-reform2/0016-sn65dsi86-burst-mode-support.patch"
2411 "meson-g12b-bananapi-cm4-mnt-reform2/0018-sn65dsi86-never-turn-off.patch"
2412 "meson-g12b-bananapi-cm4-mnt-reform2/0020-LOCAL-ALSA-Assign-internal-PCM-chmap-ELD-IEC958-kctl.patch"
2413 "meson-g12b-bananapi-cm4-mnt-reform2/0021-HACK-of-partial-revert-of-fdt.c-changes.patch"
2414 "meson-g12b-bananapi-cm4-mnt-reform2/0022-add-bt-and-eth-resets.patch"
2415 "meson-g12b-bananapi-cm4-mnt-reform2/0023-sdio-pullups.patch"
2416 "meson-g12b-bananapi-cm4-mnt-reform2/0024-sdio-improve-wifi-speed.patch"
2417 "rk3588-mnt-reform2/0001-regulator-Add-of_regulator_get_optional-for-pure-DT-.patch"
2418 "rk3588-mnt-reform2/0001-scripts-package-builddeb-allow-hooks-also-in-usr-sha.patch"
2419 "rk3588-mnt-reform2/0002-regulator-Add-devres-version-of-of_regulator_get_opt.patch"
2420 "rk3588-mnt-reform2/0004-arm64-dts-rockchip-rk3588-rock5b-add-USB-C-support.patch"
2421 "rk3588-mnt-reform2/0005-math.h-add-DIV_ROUND_UP_NO_OVERFLOW.patch"
2422 "rk3588-mnt-reform2/0006-clk-divider-Fix-divisor-masking-on-64-bit-platforms.patch"
2423 "rk3588-mnt-reform2/0007-clk-composite-replace-open-coded-abs_diff.patch"
2424 "rk3588-mnt-reform2/0008-clk-rockchip-support-clocks-registered-late.patch"
2425 "rk3588-mnt-reform2/0009-clk-rockchip-rk3588-register-GATE_LINK-later.patch"
2426 "rk3588-mnt-reform2/0010-clk-rockchip-expose-rockchip_clk_set_lookup.patch"
2427 "rk3588-mnt-reform2/0011-clk-rockchip-implement-linked-gate-clock-support.patch"
2428 "rk3588-mnt-reform2/0012-clk-rockchip-rk3588-drop-RK3588_LINKED_CLK.patch"
2429 "rk3588-mnt-reform2/0013-arm64-dts-rockchip-rk3588-evb1-add-bluetooth-rfkill.patch"
2430 "rk3588-mnt-reform2/0014-arm64-dts-rockchip-rk3588-evb1-improve-PCIe-ethernet.patch"
2431 "rk3588-mnt-reform2/0015-arm64-dts-rockchip-Slow-down-EMMC-a-bit-to-keep-IO-s.patch"
2432 "rk3588-mnt-reform2/0016-vop2-Add-clock-resets-support.patch"
2433 "rk3588-mnt-reform2/0017-arm64-dts-rockchip-Add-VOP-clock-resets-for-rk3588s.patch"
2434 "rk3588-mnt-reform2/0018-dt-bindings-display-vop2-Add-VP-clock-resets.patch"
2435 "rk3588-mnt-reform2/0019-media-v4l2-ctrls-core-Set-frame_mbs_only_flag-by-def.patch"
2436 "rk3588-mnt-reform2/0020-media-rockchip-Move-H264-CABAC-table-to-header-file.patch"
2437 "rk3588-mnt-reform2/0021-media-rockchip-Introduce-the-rkvdec2-driver.patch"
2438 "rk3588-mnt-reform2/0022-media-dt-bindings-rockchip-Document-RK3588-Video-Dec.patch"
2439 "rk3588-mnt-reform2/0023-arm64-dts-rockchip-Add-rkvdec2-Video-Decoder-on-rk35.patch"
2440 "rk3588-mnt-reform2/0024-arm64-defconfig-enable-Rockchip-RK3588-video-decoder.patch"
2441 "rk3588-mnt-reform2/0025-mfd-rk8xx-Fix-shutdown-handler.patch"
2442 "rk3588-mnt-reform2/0026-WIP-phy-phy-rockchip-samsung-hdptx-Add-FRL-EARC-supp.patch"
2443 "rk3588-mnt-reform2/0027-TESTING-phy-phy-rockchip-samsung-hdptx-Add-verbose-l.patch"
2444 "rk3588-mnt-reform2/0028-WIP-dt-bindings-display-rockchip-drm-Add-optional-cl.patch"
2445 "rk3588-mnt-reform2/0029-WIP-drm-rockchip-vop2-Improve-display-modes-handling.patch"
2446 "rk3588-mnt-reform2/0030-arm64-dts-rockchip-Add-HDMI0-bridge-to-rk3588.patch"
2447 "rk3588-mnt-reform2/0031-arm64-dts-rockchip-Enable-HDMI0-on-rock-5b.patch"
2448 "rk3588-mnt-reform2/0032-arm64-dts-rockchip-Enable-HDMI0-on-rk3588-evb1.patch"
2449 "rk3588-mnt-reform2/0033-WIP-arm64-dts-rockchip-Enable-HDMI0-PHY-clk-provider.patch"
2450 "rk3588-mnt-reform2/0034-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2451 "rk3588-mnt-reform2/0035-WIP-arm64-dts-rockchip-Make-use-of-HDMI0-PHY-PLL-on-.patch"
2452 "rk3588-mnt-reform2/0036-dt-bindings-display-bridge-Add-schema-for-Synopsys-D.patch"
2453 "rk3588-mnt-reform2/0037-dt-bindings-display-rockchip-Add-schema-for-RK3588-H.patch"
2454 "rk3588-mnt-reform2/0038-drm-bridge-synopsys-Add-DW-HDMI-QP-TX-controller-dri.patch"
2455 "rk3588-mnt-reform2/0039-drm-rockchip-Add-basic-RK3588-HDMI-output-support.patch"
2456 "rk3588-mnt-reform2/0040-arm64-defconfig-Enable-Rockchip-extensions-for-Synop.patch"
2457 "rk3588-mnt-reform2/0041-MAINTAINERS-Add-entry-for-Synopsys-DesignWare-HDMI-R.patch"
2458 "rk3588-mnt-reform2/0042-dt-bindings-media-Document-bindings-for-HDMI-RX-Cont.patch"
2459 "rk3588-mnt-reform2/0043-arm64-dts-rockchip-Add-device-tree-support-for-HDMI-.patch"
2460 "rk3588-mnt-reform2/0044-media-platform-synopsys-Add-support-for-HDMI-input-d.patch"
2461 "rk3588-mnt-reform2/0045-arm64-defconfig-Enable-Synopsys-HDMI-receiver.patch"
2462 "rk3588-mnt-reform2/0046-arm64-dts-rockchip-Enable-HDMI-receiver-on-rock-5b.patch"
2463 "rk3588-mnt-reform2/0047-arm64-dts-rockchip-Enable-HDMI-receiver-on-RK3588-EV.patch"
2464 "rk3588-mnt-reform2/0048-arm64-defconfig-Enable-default-EDID-for-Synopsys-HDM.patch"
2465 "rk3588-mnt-reform2/0049-regulator-Add-devm_-of_regulator_get.patch"
2466 "rk3588-mnt-reform2/0050-pmdomain-rockchip-cleanup-mutex-handling-in-rockchip.patch"
2467 "rk3588-mnt-reform2/0051-pmdomain-rockchip-forward-rockchip_do_pmu_set_power_.patch"
2468 "rk3588-mnt-reform2/0052-pmdomain-rockchip-reduce-indentation-in-rockchip_pd_.patch"
2469 "rk3588-mnt-reform2/0053-dt-bindings-power-rockchip-add-regulator-support.patch"
2470 "rk3588-mnt-reform2/0054-pmdomain-rockchip-add-regulator-support.patch"
2471 "rk3588-mnt-reform2/0055-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch"
2472 "rk3588-mnt-reform2/0056-dt-bindings-net-wireless-brcm4329-fmac-add-pci14e4-4.patch"
2473 "rk3588-mnt-reform2/0057-dt-bindings-net-wireless-brcm4329-fmac-add-clock-des.patch"
2474 "rk3588-mnt-reform2/0058-wifi-brcmfmac-Add-optional-lpo-clock-enable-support.patch"
2475 ;; does not apply cleanly due to DEBLOBBING
2476 ;; "rk3588-mnt-reform2/0059-wifi-brcmfmac-add-flag-for-random-seed-during-firmwa.patch"
2477 "rk3588-mnt-reform2/0060-arm64-dts-rockchip-rk3588-evb1-add-WLAN-controller.patch"
2478 "rk3588-mnt-reform2/0061-arm64-dts-rockchip-add-and-enable-gpu-node-for-Radxa.patch"
2479 "rk3588-mnt-reform2/0062-arm64-dts-rockchip-Enable-HDMI0-on-rock-5a.patch"
2480 "rk3588-mnt-reform2/0100-rk3588-dtsi-add-hdmi1-controller.patch"
2481 "rk3588-mnt-reform2/0102-drm-panthor-Actually-suspend-IRQs-in-the-unplug-path.patch"
2482 "rk3588-mnt-reform2/3001-display-rockchip-add-schema-for-rk3588-hdmi-tx.patch"
2483 "rk3588-mnt-reform2/4000-mnt-rk3588-dual-hdmi-qp-rockchip.patch"
2484 "rk3588-mnt-reform2/4001-mnt-rk3588-dual-hdmi-vop2-pll.patch"
2485 "rk3588-mnt-reform2/5001-rk3588-dsi2-driver.patch"
2486 "rk3588-mnt-reform2/5002-rk3588-dsi-dts-nodes.patch"
2487 "rk3588-mnt-reform2/5100-modernize-hdmi1-in-dtsi.patch"
2488 "rk3588-mnt-reform2/5110-hdptx-crash-workaround.patch"
2489 "rk3588-mnt-reform2/5200-drm-rockchip-Set-dma-mask-to-64-bit.patch"))))
2490 (add-after 'apply-reform-patches 'copy-reform-dts-files
2491 (lambda* (#:key inputs #:allow-other-keys)
2492 (for-each (lambda (dts)
2493 (copy-file (search-input-file inputs
2494 (string-append
2495 "/dts/" dts))
2496 (string-append "arch/arm64/boot/dts/"
2497 dts)))
2498 (list
2499 "amlogic/meson-g12b-bananapi-cm4-mnt-pocket-reform.dts"
2500 "amlogic/meson-g12b-bananapi-cm4-mnt-reform2.dts"
2501 "freescale/fsl-ls1028a-mnt-reform2.dts"
2502 "freescale/imx8mp-mnt-pocket-reform.dts"
2503 "freescale/imx8mp-mnt-reform2.dts"
2504 "freescale/imx8mq-mnt-reform2-hdmi.dts"
2505 "freescale/imx8mq-mnt-reform2.dts"
2506 "rockchip/rk3588-mnt-pocket-reform.dts"
2507 "rockchip/rk3588-mnt-reform-next.dts"
2508 "rockchip/rk3588-mnt-reform2.dts"))))
2509 (add-after 'apply-reform-patches 'adjust-makefiles-with-new-dtb
2510 (lambda _
2511 (substitute* "arch/arm64/boot/dts/amlogic/Makefile"
2512 (("meson-g12b-bananapi-cm4-mnt-reform2.dtb")
2513 "meson-g12b-bananapi-cm4-mnt-reform2.dtb
2514dtb-$(CONFIG_ARCH_MESON) += meson-g12b-bananapi-cm4-mnt-pocket-reform.dtb"))
2515 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2516 (("fsl-ls1028a-rdb.dtb")
2517 "fsl-ls1028a-rdb.dtb
2518dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-mnt-reform2.dtb"))
2519 (substitute* "arch/arm64/boot/dts/freescale/Makefile"
2520 (("imx8mq-mnt-reform2.dtb")
2521 "imx8mq-mnt-reform2.dtb
2522dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-reform2.dtb
2523dtb-$(CONFIG_ARCH_MXC) += imx8mp-mnt-pocket-reform.dtb
2524dtb-$(CONFIG_ARCH_MXC) += imx8mq-mnt-reform2-hdmi.dtb"))
2525 (substitute* "arch/arm64/boot/dts/rockchip/Makefile"
2526 (("rk3588-rock-5b.dtb")
2527 "rk3588-rock-5b.dtb
2528dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform2.dtb
2529dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-reform-next.dtb
2530dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-mnt-pocket-reform.dtb")))))))))))
2531
2532(define-public linux-libre-riscv64-generic
2533 (make-linux-libre* linux-libre-version
2534 linux-libre-gnu-revision
2535 linux-libre-source
2536 '("riscv64-linux")
2537 #:extra-version "riscv64-generic"
2538 #:extra-options
2539 (append
2540 ;; required `guix system vm'
2541 `(("CONFIG_USB_HID" . m)
2542 ("CONFIG_HID_GEMBIRD" . m)
2543 ("CONFIG_AHCI_DWC" . m)
2544 ("CONFIG_SATA_AHCI" . m)
2545 ("CONFIG_CRYPTO_SERPENT" . m)
2546 ("CONFIG_CRYPTO_WP512" . m)
2547 ("CONFIG_USB_UAS" . m)
2548 ("CONFIG_USB_STORAGE" . m)
2549 ("CONFIG_HID_GENERIC" . m)
2550 ("CONFIG_DRM_CIRRUS_QEMU" . m)
2551 ("CONFIG_HW_RANDOM_VIRTIO" . m)
2552 ("CONFIG_VIRTIO_CONSOLE" . m)
2553 ("CONFIG_CRYPTO_XTS" . m))
2554 (default-extra-linux-options linux-libre-version))))
2555
2556(define-public linux-libre-mips64el-fuloong2e
2557 (make-linux-libre* linux-libre-version
2558 linux-libre-gnu-revision
2559 linux-libre-source
2560 '("mips64el-linux")
2561 #:defconfig "fuloong2e_defconfig"
2562 #:extra-version "mips64el-fuloong2e"
2563 #:extra-options
2564 (append
2565 `(("CONFIG_OVERLAY_FS" . m))
2566 (default-extra-linux-options linux-libre-version))))
2567
2568(define-deprecated-package linux-libre-with-bpf
2569 linux-libre)
2570
2571
2572;;;
2573;;; Linux kernel modules.
2574;;;
2575
2576(define-public acpi-call-linux-module
2577 (package
2578 (name "acpi-call-linux-module")
2579 (version "1.2.2")
2580 (source
2581 (origin
2582 (method git-fetch)
2583 (uri (git-reference
2584 (url "https://github.com/nix-community/acpi_call")
2585 (commit (string-append "v" version))))
2586 (file-name (git-file-name name version))
2587 (sha256
2588 (base32 "09ljx0jl987753r2kjqj5kxms95bijw0xn14kf82ryn38ck5c8cf"))))
2589 (build-system linux-module-build-system)
2590 (arguments
2591 (list #:tests? #f ; no tests
2592 #:phases
2593 #~(modify-phases %standard-phases
2594 (add-before 'install 'patch-shebangs-harder
2595 ;; The (only) shebangs in examples/ don't justify a reference.
2596 ;; However, do substitute a slightly more portable one.
2597 (lambda _
2598 (substitute* (find-files "examples" ".")
2599 (("^(#! *)/[^ ]*/" _ shebang)
2600 (string-append shebang "/usr/bin/env ")))))
2601 (add-after 'install 'install-documentation
2602 (lambda _
2603 (let* ((doc (string-append #$output "/share/doc/"
2604 #$name "-" #$version)))
2605 (for-each (lambda (file)
2606 (let ((target (string-append doc "/" file)))
2607 (mkdir-p (dirname target))
2608 (copy-recursively file target)))
2609 (list "README.md" "examples"))))))))
2610 (home-page "https://github.com/nix-community/acpi_call")
2611 (synopsis "Linux kernel module to perform ACPI method calls")
2612 (description
2613 "This simple Linux kernel module allows calls from user space to any
2614@acronym{ACPI, Advanced Configuration and Power Interface} method provided by
2615your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
2616any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
2617and @code{ACPI_BUFFER}.
2618
2619It grants direct and undocumented access to your hardware that may cause damage
2620and should be used with caution, especially on untested models.")
2621 (license license:gpl3+))) ; see README.md (no licence headers)
2622
2623(define-public corefreq
2624 (package
2625 (name "corefreq")
2626 (version "1.98.4")
2627 (source
2628 (origin
2629 (method git-fetch)
2630 (uri (git-reference
2631 (url "https://github.com/cyring/CoreFreq")
2632 (commit version)))
2633 (file-name (git-file-name name version))
2634 (sha256
2635 (base32 "0mxp5h23y09674syaj5gpdifr53zvgjv7g7hargwg6897883qfln"))))
2636 ;; The upstream Makefile is now such a proprietary mess that standard builds
2637 ;; as performed by our linux-module-build-system are more or less impossible
2638 ;; without heavy patching. However, we still keep it as the main build
2639 ;; system because lifting out LINUX-MODULE-BUILDER would be even messier.
2640 (build-system linux-module-build-system)
2641 (outputs (list "out" "linux-module"))
2642 (arguments
2643 (list #:imported-modules `((guix build gnu-build-system)
2644 ,@%linux-module-build-system-modules)
2645 #:modules `((guix build linux-module-build-system)
2646 ((guix build gnu-build-system) #:prefix gnu:)
2647 (guix build utils))
2648 #:make-flags
2649 #~(list (string-append "CC=" #$(cc-for-target))
2650 "OPTIM_LVL=3"
2651 (string-append "PREFIX=" #$output))
2652 #:tests? #f ;no test suite
2653 #:source-directory "../build" ;must contain modules.order
2654 #:phases
2655 #~(modify-phases %standard-phases
2656 (add-after 'unpack 'patch-Makefile
2657 (lambda* (#:key inputs #:allow-other-keys)
2658 (let ((dir (search-input-directory
2659 inputs "lib/modules/build")))
2660 (substitute* "Makefile"
2661 (("^(KERNELREL \\?= ).*" _ =)
2662 (string-append = (dirname dir) "\n"))
2663 (("^(KERNELDIR \\?= ).*" _ =)
2664 (string-append = dir "\n"))
2665 (("^([[:space:]]+)(.* modules_install.*)"
2666 _ indent command)
2667 (string-append indent "@echo skipping " command))))))
2668 (add-before 'build 'prepare
2669 (lambda* (#:key source-directory make-flags #:allow-other-keys)
2670 ;; Lazily fix another mismatch between what the kernel module
2671 ;; build system expects and what this package provides.
2672 (symlink "source/build" source-directory) ;$(BUILD)
2673 ;; Set up symbolic links inside $(BUILD), for some reason.
2674 (apply invoke "make" "prepare" make-flags)))
2675 (replace 'build (assoc-ref gnu:%standard-phases 'build))
2676 (add-before 'install 'resolve-symlink
2677 ;; The build system silently fails to install from a symlink.
2678 (lambda _
2679 (delete-file "../build")
2680 (copy-recursively "build" "../build")))
2681 (add-before 'install 'create-output
2682 (lambda _
2683 ;; Avoid installing the corefreq binary as …/bin.
2684 (mkdir-p (string-append #$output "/bin"))))
2685 (add-after 'install 'gnu:install
2686 (assoc-ref gnu:%standard-phases 'install))
2687 (add-after 'install 'separate-module
2688 (lambda* (#:key outputs #:allow-other-keys)
2689 ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an
2690 ;; empty <out>/lib/modules directory, so just do it all by hand.
2691 (let* ((output (assoc-ref outputs "out"))
2692 (module (assoc-ref outputs "linux-module")))
2693 (mkdir-p module)
2694 (rename-file (string-append output "/lib")
2695 (string-append module "/lib")))))
2696 (add-after 'install 'install-README
2697 ;; There is no proper documentation. Provide something.
2698 (lambda* (#:key outputs #:allow-other-keys)
2699 (let* ((out (assoc-ref outputs "out"))
2700 (doc (string-append out "/share/doc/"
2701 #$name "-" #$version)))
2702 (install-file "README.md" doc)))))))
2703 (home-page "https://github.com/cyring/CoreFreq")
2704 (synopsis
2705 "Measure performance data & tweak low-level settings on x86-64 CPUs")
2706 (description
2707 "CoreFreq is a CPU monitor that reports low-level processor settings and
2708performance data with notably high precision by using a loadable Linux kernel
2709module. Unlike most similar tools, it can be used to modify some settings if
2710supported by the hardware and at your own risk. It's designed for 64-bit x86
2711Intel processors (Atom, Core2, Nehalem, SandyBridge, and newer) and compatible
2712architectures like AMD@tie{}Zen and Hygon@tie{}Dhyana.
2713
2714Supported processor features include:
2715@enumerate
2716@item time spent in C-states, including C1/C3 Auto- and UnDemotion;
2717@item core temperatures, voltage, and tweaking thermal limits;
2718@item core frequencies, ratios, and base clock rate;
2719@item enabling, disabling, and testing SpeedStep (EIST), Turbo Boost, and
2720Hyper-Threading or SMT;
2721@item enabling or disabling data cache prefetching;
2722@item kernel assembly code to keep as near as possible readings of performance
2723counters such as the @acronym{TSC, Time Stamp Counter}, @acronym{UCC, Unhalted
2724Core Cycles}, and @acronym{URC, Unhalted Reference Cycles};
2725@item the number of instructions per cycle or second (IPS, IPC, and CPI);
2726@item memory controller geometry and RAM timings;
2727@item running processes' CPU affinity.
2728@end enumerate
2729
2730This package provides the @command{corefreqd} data collection daemon, the
2731@command{corefreq-cli} client to visualise and control it in real time, and the
2732@code{corefreqk} kernel module in its own separate output. Read the included
2733@file{README.md} before loading it.")
2734 (supported-systems (list "x86_64-linux"))
2735 (license license:gpl2)))
2736
2737(define-public librem-ec-acpi-linux-module
2738 (package
2739 (name "librem-ec-acpi-linux-module")
2740 (version "0.9.2")
2741 (source
2742 (origin
2743 (method git-fetch)
2744 (uri (git-reference
2745 (url "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
2746 (commit (string-append "v" version))))
2747 (file-name (git-file-name name version))
2748 (sha256
2749 (base32 "0m8hamf0550083jnk5q4hv20l8lfiardnkxbib4hhvqghpzzbxl0"))))
2750 (build-system linux-module-build-system)
2751 (arguments
2752 (list #:tests? #f)) ; no test suite
2753 (home-page "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
2754 (synopsis "Linux kernel module to control the Librem Embedded Controller")
2755 (description
2756 "This is the Linux kernel @acronym{ACPI, Advanced Configuration and Power
2757Interface} platform driver for the @acronym{EC, Embedded Controller} firmware
2758on Purism Librem laptop computers. It allows user-space control over the
2759battery charging thresholds, keyboard backlight, fans and thermal monitors,
2760and the notification, WiFi, and Bluetooth LED.")
2761 (license license:gpl2)))
2762
2763(define-public tuxedo-keyboard
2764 (package
2765 (name "tuxedo-keyboard")
2766 (version "4.15.4")
2767 (source
2768 (origin
2769 (method git-fetch)
2770 (uri (git-reference
2771 (url "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers.git")
2772 (commit (string-append "v" version))))
2773 (file-name (git-file-name name version))
2774 (sha256
2775 (base32 "0mimgcbp57gp3smd439g8040sl80qqnfzmh2vhs2qv1kwyxs75sq"))))
2776 (build-system linux-module-build-system)
2777 (arguments
2778 (list #:tests? #f)) ; no test suite
2779 ;; This package fails to build on aarch64, and the manufacturer only sells
2780 ;; machines based on Intel-compatible processors. For more information, see
2781 ;; <https://codeberg.org/guix/guix/pulls/1795>.
2782 (supported-systems '("i686-linux" "x86_64-linux"))
2783 (home-page "https://gitlab.com/tuxedocomputers/development/packages/tuxedo-drivers")
2784 (synopsis "Linux kernel modules to control keyboard on most Tuxedo computers")
2785 (description
2786 "This package provides the @code{tuxedo_keyboard}, @code{tuxedo_io},
2787@code{clevo_wmi} @acronym{WMI, Windows Management Engine} and the
2788@code{clevo_acpi} @acronym{ACPI, Advanced Configuration and Power Interface}
2789kernel modules to control the keyboard on most Tuxedo computers. The @code{tuxedo_io}
2790module is also needed for the @code{tuxedo-control-center} (short tcc) package.")
2791 (license license:gpl2+)))
2792
2793(define-public evdi
2794 (package
2795 (name "evdi")
2796 (version "1.14.8") ;inherited by libevdi
2797 (source
2798 (origin
2799 (method git-fetch)
2800 (uri (git-reference
2801 (url "https://github.com/DisplayLink/evdi")
2802 (commit (string-append "v" version))))
2803 (file-name (git-file-name name version))
2804 (sha256
2805 (base32 "18n8kk4gbbj252a2dqb7mbpscfb437x42flh1fsl4g5c8brczc77"))))
2806 (build-system linux-module-build-system)
2807 (arguments
2808 (list #:tests? #f ;no test suite
2809 #:phases #~(modify-phases %standard-phases
2810 (add-after 'unpack 'chdir
2811 (lambda _
2812 (chdir "module"))))))
2813 (home-page "https://github.com/DisplayLink/evdi")
2814 (synopsis
2815 "@acronym{EVDI, Extensible Virtual Display Interface} Linux kernel module")
2816 (description
2817 "The @acronym{EVDI, Extensible Virtual Display Interface} is a Linux kernel
2818module that enables management of multiple screens, allowing user-space programs
2819to take control over what happens with the image. It is essentially a virtual
2820display for which applications using the @code{libevdi} library can add, remove,
2821and receive screen updates.
2822
2823The EVDI driver uses the standard Linux @acronym{DRM, Direct Rendering Manager}.
2824Its displays can be controlled by standard tools such as @command{xrandr} and
2825display settings applets in graphical environments")
2826 (license license:gpl2)))
2827
2828(define-public libevdi
2829 (package
2830 (inherit evdi)
2831 (name "libevdi")
2832 (build-system gnu-build-system)
2833 (arguments
2834 (list #:tests? #f ;no test suite
2835 #:make-flags
2836 #~(list (string-append "CC=" #$(cc-for-target)))
2837 #:phases #~(modify-phases %standard-phases
2838 (delete 'configure)
2839 (add-after 'unpack 'chdir
2840 (lambda _
2841 (chdir "library")))
2842 (replace 'install
2843 (lambda* _
2844 (let* ((lib (string-append #$output "/lib")))
2845 (mkdir-p lib)
2846 (install-file "libevdi.so" lib)))))))
2847 (inputs (list libdrm))
2848 (native-inputs (list pkg-config))
2849 (synopsis
2850 "@acronym{EVDI, Extensible Virtual Display Interface} user-space library")
2851 (description
2852 "Libevdi is a library that gives applications easy access to
2853@acronym{EVDI, Extensible Virtual Display Interface} devices provided by the
2854@code{evdi} driver package.")
2855 (license license:lgpl2.1)))
2856
2857(define-public ec
2858 (package
2859 (name "ec")
2860 (version (package-version linux-libre))
2861 (source (package-source linux-libre))
2862 (build-system gnu-build-system)
2863 (arguments
2864 (list #:make-flags #~(list (string-append "sbindir="
2865 #$output "/sbin")
2866 "INSTALL=install" "STRIPCMD=true")
2867 #:phases #~(modify-phases %standard-phases
2868 (add-after 'unpack 'enter-subdirectory
2869 (lambda _
2870 (chdir "tools/power/acpi/tools/ec")))
2871 (delete 'configure)) ;no configure script
2872 #:tests? #f)) ;no tests
2873 (home-page (package-home-page linux-libre))
2874 (synopsis
2875 "Utility for reading or writing @acronym{EC, Embedded Controller} registers")
2876 (description
2877 "This utility can read or write specific registers or all the available
2878registers of the @acronym{EC, Embedded Controller} supported by the
2879@code{ec_sys} Linux driver.")
2880 (license license:gpl2)))
2881
2882(define-public lkrg
2883 (package
2884 (name "lkrg")
2885 (version "0.9.7")
2886 (source (origin
2887 (method git-fetch)
2888 (uri (git-reference
2889 (url "https://github.com/lkrg-org/lkrg")
2890 (commit (string-append "v" version))))
2891 (file-name (git-file-name name version))
2892 (sha256
2893 (base32
2894 "0k0z9caj48nqjwk3bapgfcdzi1lkizxcjj4r1dvkvwsk38mbk1c4"))))
2895 (build-system linux-module-build-system)
2896 (arguments
2897 (list #:linux linux-libre
2898 #:tests? #f
2899 #:make-flags #~(list (string-append "CC="
2900 #$(cc-for-target))
2901 (string-append "SYSSRC="
2902 (assoc-ref %build-inputs
2903 "linux-module-builder")
2904 "/lib/modules/build"))))
2905 (inputs (list bash-minimal))
2906 (home-page "https://lkrg.org/")
2907 (synopsis "Linux Kernel Runtime Guard")
2908 (description
2909 "This package performs runtime integrity checking of the Linux kernel and
2910detection of security vulnerability exploits against the kernel.")
2911 (license license:gpl2)))
2912
2913(define-public vhba-module
2914 (package
2915 (name "vhba-module")
2916 (version "20211218")
2917 (source
2918 (origin
2919 (method url-fetch)
2920 (uri (string-append
2921 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
2922 version ".tar.xz"))
2923 (sha256
2924 (base32 "1dkprnnya0i8121p7ip4g8cww99drk7fzbwcxx65x02jqk0siibj"))))
2925 (build-system linux-module-build-system)
2926 (arguments
2927 (list #:tests? #f)) ; no test suite
2928 (home-page "https://cdemu.sourceforge.io/")
2929 (synopsis "Linux kernel module that emulates SCSI devices")
2930 (description
2931 "The @acronym{VHBA, Virtual SCSI Host Bus Adapter} module is the link
2932between the CDemu user-space daemon and the kernel Linux. It acts as a
2933low-level SCSI driver that emulates a virtual SCSI adapter which can have
2934multiple virtual devices attached to it. Its typical use with CDEmu is to
2935emulate optical devices such as DVD and CD-ROM drives.")
2936 (license license:gpl2+)))
2937
2938(define-public bbswitch-module
2939 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
2940 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
2941 (let ((commit "19f60204596a6463b162fc7ca11f4946f5c20cea"))
2942 (package
2943 (name "bbswitch-module")
2944 (version (git-version "0.8" "2" commit))
2945 (source (origin
2946 (method git-fetch)
2947 (uri (git-reference
2948 ;; Use fork until
2949 ;; https://github.com/Bumblebee-Project/bbswitch/pull/219
2950 ;; is merged.
2951 (url "https://github.com/madchic/bbswitch")
2952 (commit commit)))
2953 (file-name (git-file-name name version))
2954 (sha256
2955 (base32
2956 "1pv41y02c9xg9k1bg4i4ll3w7hxxzdr651i08f092b9q5hr57mqn"))))
2957 (build-system linux-module-build-system)
2958 (arguments
2959 (list #:tests? #f)) ; no test suite
2960 (home-page "https://github.com/Bumblebee-Project/bbswitch")
2961 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
2962 (description "The bbswitch module provides a way to toggle the Nvidia
2963graphics card on Optimus laptops.")
2964 (license license:gpl2))))
2965
2966(define-public bin-graph
2967 (package
2968 (name "bin-graph")
2969 (version "1.2.0")
2970 (source
2971 (origin
2972 (method git-fetch)
2973 (uri (git-reference
2974 (url "https://github.com/8dcc/bin-graph")
2975 (commit (string-append "v" version))))
2976 (file-name (git-file-name name version))
2977 (sha256
2978 (base32 "1msr4fj1nh6hf5h6j5pimfrgd37xy4xbik3iml9gd3b1fdkxsdv7"))))
2979 (arguments
2980 (list #:tests? #f ; no tests
2981 #:make-flags
2982 #~(list (string-append "CC=" #$(cc-for-target))
2983 (string-append "PREFIX=" #$output)
2984 (string-append "INSTALL_DIR=" #$output "/bin"))
2985 #:phases
2986 #~(modify-phases %standard-phases
2987 (delete 'configure)))) ; no configure script
2988 (build-system gnu-build-system)
2989 (inputs (list libpng))
2990 (home-page "https://github.com/8dcc/bin-graph")
2991 (synopsis "Visualize binary files")
2992 (description
2993 "@code{bin-graph} provides a simple way of visualizing the different regions
2994of a binary file.")
2995 (license license:gpl3)))
2996
2997(define-public ddcci-driver-linux
2998 (let ((revision "0")
2999 (commit "7f8f8e6c221a286d57a643c2909109a54e084eed"))
3000 (package
3001 (name "ddcci-driver-linux")
3002 (version (git-version "0.4.5" revision commit))
3003 (source
3004 (origin
3005 (method git-fetch)
3006 (uri
3007 (git-reference
3008 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
3009 (commit commit)))
3010 (file-name (git-file-name name version))
3011 (sha256
3012 (base32 "0sgldghd8n4qjm5nv9dgxjibj1hg4kkk1811wndf3vx3dacsmkl9"))))
3013 (build-system linux-module-build-system)
3014 (arguments
3015 (list #:tests? #f ; no tests
3016 #:phases
3017 #~(modify-phases %standard-phases
3018 (replace 'build
3019 (lambda args
3020 (for-each
3021 (lambda (module)
3022 (with-directory-excursion module
3023 (apply (assoc-ref %standard-phases 'build) args)))
3024 '("ddcci" "ddcci-backlight"))))
3025 (replace 'install
3026 (lambda args
3027 (for-each
3028 (lambda (module)
3029 (with-directory-excursion module
3030 (apply (assoc-ref %standard-phases 'install) args)))
3031 '("ddcci" "ddcci-backlight")))))))
3032 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
3033 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
3034 (description "This package provides two Linux kernel drivers, ddcci and
3035ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
3036interface. The ddcci module creates a character device for each DDC/CI
3037monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
3038module allows the control of the backlight level or luminance property when
3039supported under @file{/sys/class/backlight/}.")
3040 (license license:gpl2+))))
3041
3042(define-public reform2-lpc-module
3043 (package
3044 (name "reform2-lpc-module")
3045 (version "1.79")
3046 (source
3047 (origin
3048 (method git-fetch)
3049 (uri (git-reference
3050 (url "https://source.mnt.re/reform/reform-tools.git")
3051 (commit version)))
3052 (file-name (git-file-name name version))
3053 (sha256
3054 (base32 "16xzdygf14zksvqjbp5gwiqsn0mb7kphvzrmqbl9db4kvyj4ajqa"))))
3055 (build-system linux-module-build-system)
3056 (arguments
3057 '(#:tests? #f ;no tests
3058 #:source-directory "lpc"))
3059 (synopsis "Linux kernel module for the Reform 2 system controller")
3060 (description
3061 "The reform2_lpc module allows for interaction with the NXP LPC11U24
3062Cortex-M0 MCU system controller in the Reform 2 open hardware laptop. It
3063provides battery status information and is necessary to completely shut down
3064the system when powering it off via userspace.")
3065 (home-page "https://source.mnt.re/reform/reform-tools/")
3066 (license license:gpl3+)))
3067
3068(define-public v4l2loopback-linux-module
3069 (package
3070 (name "v4l2loopback-linux-module")
3071 (version "0.15.1")
3072 (source (origin
3073 (method git-fetch)
3074 (uri (git-reference
3075 (url "https://github.com/v4l2loopback/v4l2loopback")
3076 (commit (string-append "v" version))))
3077 (file-name (git-file-name name version))
3078 (sha256
3079 (base32
3080 "00vkn4c1wlfmf8kqklklxj5kalwgiwwnxwbh4pw7dj9l1ivycm4f"))))
3081 (build-system linux-module-build-system)
3082 (arguments
3083 (list #:tests? #f)) ; no test suite
3084 (home-page "https://github.com/v4l2loopback/v4l2loopback")
3085 (synopsis "Linux kernel module to create virtual V4L2 video devices")
3086 (description
3087 "This Linux module creates virtual video devices. @acronym{V4L2, Video
3088for Linux 2} applications will treat these as ordinary video devices but read
3089video data generated by another application, instead of a hardware device such
3090as a capture card.
3091
3092This lets you apply nifty effects to your Jitsi video, for example, but also
3093allows some more serious things like adding streaming capabilities to an
3094application by hooking GStreamer into the loopback device.")
3095 (license license:gpl2+)))
3096
3097(define-public xpadneo
3098 (package
3099 (name "xpadneo")
3100 (version "0.9.7")
3101 (source (origin
3102 (method git-fetch)
3103 (uri (git-reference
3104 (url "https://github.com/atar-axis/xpadneo")
3105 (commit (string-append "v" version))))
3106 (file-name (git-file-name name version))
3107 (sha256
3108 (base32
3109 "1v5akvz14izxk3fav6x4l50gi8xzsjwxjddczc2yy78gni1a7ybs"))))
3110 (build-system linux-module-build-system)
3111 (arguments
3112 (list #:tests? #f ; no `check' target
3113 #:source-directory "hid-xpadneo/src"
3114 #:phases
3115 #~(modify-phases %standard-phases
3116 (add-after 'install 'post-install
3117 (lambda _
3118 (copy-recursively "hid-xpadneo/etc-modprobe.d"
3119 (string-append #$output "/etc/modprobe.d"))
3120 ;; udev-service-type takes its rules from /lib rather than
3121 ;; /etc, so copy it there instead
3122 (copy-recursively "hid-xpadneo/etc-udev-rules.d"
3123 (string-append #$output
3124 "/lib/udev/rules.d")))))))
3125 (home-page "https://atar-axis.github.io/xpadneo/")
3126 (synopsis "Xbox One Wireless Controller driver for the kernel Linux")
3127 (description
3128 "This package provides a driver for the XBox One S Wireless controller
3129and some newer models when connected via Bluetooth. In addition to the included
3130Linux kernel module, it also contains a modprobe configuration and udev rules,
3131which need to be installed separately.")
3132 (license license:gpl3+)))
3133
3134(define-public vendor-reset-linux-module
3135 (let ((commit "4b466e92a2d9f76ce1082cde982c7be0be91e248")
3136 (revision "0"))
3137 (package
3138 (name "vendor-reset-linux-module")
3139 (version (git-version "0.1.0" revision commit))
3140 (source (origin
3141 (method git-fetch)
3142 (uri (git-reference
3143 (url "https://github.com/gnif/vendor-reset")
3144 (commit commit)))
3145 (file-name (git-file-name name version))
3146 (sha256
3147 (base32
3148 "1gaf4j20grng689c9fylcqri3j9ycnhr2bsva2z6qcdqvzl6yxbi"))))
3149 (build-system linux-module-build-system)
3150 (arguments
3151 (list #:tests? #f)) ;no test suite
3152 (home-page "https://github.com/gnif/vendor-reset")
3153 (synopsis
3154 "Kernel module that resets GPUs that are affected by the reset bug")
3155 (description
3156 "This package provides a kernel module that is capable of
3157resetting hardware devices into a state where they can be
3158re-initialized or passed through into a virtual machine (VFIO).
3159While it would be great to have these in the kernel as PCI quirks,
3160some of the reset procedures are very complex and would never be
3161accepted as a quirk (ie AMD Vega 10).")
3162 (license license:gpl2))))
3163
3164
3165;;;
3166;;; Pluggable authentication modules (PAM).
3167;;;
3168
3169(define-public linux-pam
3170 (package
3171 (name "linux-pam")
3172 (version "1.5.2")
3173 (source
3174 (origin
3175 (method url-fetch)
3176 (uri (string-append
3177 "https://github.com/linux-pam/linux-pam/releases/download/v"
3178 version "/Linux-PAM-" version ".tar.xz"))
3179 (sha256
3180 (base32
3181 "0kgrsj2scv5mx6w925h9hxf11jnqqs9z8s22aw94b90xm4qp3v74"))
3182 (patches (search-patches "linux-pam-unix_chkpwd.patch"
3183 "linux-pam-no-setfsuid.patch"))))
3184
3185 (build-system gnu-build-system)
3186 (inputs (list libxcrypt))
3187 (native-inputs
3188 (list flex
3189 ;; TODO: optional dependencies
3190 ;; ("cracklib" ,cracklib)
3191 ))
3192 (arguments
3193 (list
3194 ;; Most users, such as `shadow', expect the headers to be under
3195 ;; `security'.
3196 #:configure-flags #~(list (string-append "--includedir="
3197 (assoc-ref %outputs "out")
3198 "/include/security")
3199 ;; explicit libdir for pkgconfig files
3200 ;; drop with 1.5.3, which fixes
3201 ;; https://github.com/linux-pam/linux-pam/issues/466
3202 (string-append "--libdir="
3203 (assoc-ref %outputs "out")
3204 "/lib")
3205
3206 ;; XXX: <rpc/rpc.h> is missing from glibc when
3207 ;; cross-compiling, so we have to disable NIS
3208 ;; support altogether.
3209 #$@(if (%current-target-system)
3210 #~("--disable-nis")
3211 #~()))
3212
3213 #:phases (if (target-hurd?)
3214 #~(modify-phases %standard-phases
3215 (add-after 'unpack 'skip-pam-limits
3216 (lambda _
3217 ;; 'pam_limits.c' uses <sys/prctl.h>, which is
3218 ;; Linux-specific. Skip it on GNU/Hurd.
3219 (substitute* "modules/Makefile.in"
3220 (("pam_limits") "")))))
3221 #~%standard-phases)
3222
3223 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
3224 ;; isn't available.
3225 #:tests? #f))
3226 (home-page "http://www.linux-pam.org/")
3227 (synopsis "Pluggable authentication modules for Linux")
3228 (description
3229 "A *Free* project to implement OSF's RFC 86.0.
3230Pluggable authentication modules are small shared object files that can
3231be used through the PAM API to perform tasks, like authenticating a user
3232at login. Local and dynamic reconfiguration are its key features.")
3233 (license license:bsd-3)))
3234
3235(define-public python-pamela
3236 (package
3237 (name "python-pamela")
3238 (version "1.0.0")
3239 (source
3240 (origin
3241 ;; Tests not distributed in pypi release.
3242 (method git-fetch)
3243 (uri (git-reference
3244 (url "https://github.com/minrk/pamela")
3245 (commit version)))
3246 (file-name (git-file-name name version))
3247 (sha256
3248 (base32
3249 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
3250 (build-system python-build-system)
3251 (arguments
3252 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
3253 #:phases
3254 (modify-phases %standard-phases
3255 (add-after 'unpack 'hardcode-pam.so
3256 (lambda* (#:key inputs #:allow-other-keys)
3257 (let ((pam (assoc-ref inputs "linux-pam")))
3258 (substitute* "pamela.py"
3259 (("find_library\\(\"pam\")")
3260 (string-append "'" pam "/lib/libpam.so'")))
3261 #t)))
3262 (replace 'check
3263 (lambda* (#:key tests? #:allow-other-keys)
3264 (if tests?
3265 (if (file-exists? "test_pamela.py")
3266 (invoke "py.test" "--assert=plain" "test_pamela.py")
3267 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
3268 #t))))))
3269 (inputs
3270 (list linux-pam))
3271 (native-inputs
3272 (list python-pytest))
3273 (home-page "https://github.com/minrk/pamela")
3274 (synopsis "PAM interface using ctypes")
3275 (description "This package provides a PAM interface using @code{ctypes}.")
3276 (license license:expat)))
3277
3278(define-public pam-gnupg
3279 (package
3280 (name "pam-gnupg")
3281 (version "0.3")
3282 (source (origin
3283 (method git-fetch)
3284 (uri (git-reference
3285 (url "https://github.com/cruegge/pam-gnupg")
3286 (commit (string-append "v" version))))
3287 (file-name (git-file-name name version))
3288 (sha256
3289 (base32
3290 "1bf91gi6zmfzzmczxm7pajxdlgnikasvg5xsd3j0a368rcr7lf9l"))))
3291 (build-system gnu-build-system)
3292 (inputs
3293 (list gnupg linux-pam))
3294 (native-inputs
3295 (list autoconf automake libtool))
3296 (arguments
3297 `(#:tests? #f ;no tests suite
3298 #:configure-flags
3299 (list (string-append "--with-moduledir="
3300 (assoc-ref %outputs "out") "/lib/security"))))
3301
3302 (home-page "https://github.com/cruegge/pam-gnupg")
3303 (synopsis "Unlock GnuPG keys on login")
3304 (description "This package provides a PAM module that hands over your
3305login password to @code{gpg-agent}. This can be useful if you are using a
3306GnuPG-based password manager like @code{pass}.")
3307 (license license:gpl3+)))
3308
3309
3310;;;
3311;;; Kernel documentation
3312;;;
3313
3314(define-public linux-libre-documentation
3315 (package
3316 (inherit linux-libre)
3317 (name "linux-libre-documentation")
3318 (arguments
3319 (list
3320 #:tests? #f
3321 #:phases #~(modify-phases %standard-phases
3322 (delete 'configure)
3323 (replace 'build
3324 (lambda* (#:key parallel-build? #:allow-other-keys)
3325 (substitute* "Documentation/Makefile"
3326 ;; Remove problematic environment check script.
3327 ((".*scripts/sphinx-pre-install.*") ""))
3328 (invoke "make" "infodocs"
3329 "-j" (if parallel-build?
3330 (number->string (parallel-job-count))
3331 "1"))))
3332 (replace 'install
3333 (lambda _
3334 (let* ((info-dir (string-append #$output "/share/info"))
3335 (info (string-append info-dir
3336 "/TheLinuxKernel.info.gz")))
3337 (with-directory-excursion "Documentation/output"
3338 (invoke "make" "-C" "texinfo" "install-info"
3339 (string-append "infodir=" info-dir)))
3340 ;; Create a symlink, for convenience.
3341 (symlink info (string-append info-dir
3342 "/linux.info.gz"))))))))
3343 (native-inputs
3344 (list graphviz
3345 perl
3346 python
3347 python-sphinx
3348 python-pyyaml
3349 texinfo
3350 which))
3351 (synopsis "Documentation for the kernel Linux-Libre")
3352 (description "This package provides the documentation for the kernel
3353Linux-Libre, as an Info manual. To consult it, run @samp{info linux}.")))
3354
3355;;;
3356;;; Miscellaneous.
3357;;;
3358
3359(define-public powercap
3360 (package
3361 (name "powercap")
3362 (version "0.6.0")
3363 (source
3364 (origin
3365 (method git-fetch)
3366 (uri (git-reference
3367 (url "https://github.com/powercap/powercap")
3368 (commit (string-append "v" version))))
3369 (file-name (git-file-name name version))
3370 (sha256
3371 (base32 "087almlx34nzjbv8a40kxlmgy8691z2zlzkfyca8a2b7l0b2kqlp"))))
3372 (build-system cmake-build-system)
3373 (arguments
3374 (list #:configure-flags
3375 #~(list "-DBUILD_SHARED_LIBS=ON")))
3376 (home-page "https://github.com/powercap/powercap")
3377 (synopsis "Utilities for accessing the powercap Linux kernel feature")
3378 (description "This package contains utilities for accessing the powercap
3379Linux kernel feature through sysfs. It includes an implementation for working
3380with Intel @acronym{RAPL, Running Average Power Limit}.
3381It provides the commands @code{powercap-info} and @code{powercap-set}.")
3382 (license license:bsd-3)))
3383
3384(define-public powerstat
3385 (package
3386 (name "powerstat")
3387 (version "0.04.03")
3388 (source
3389 (origin
3390 (method git-fetch)
3391 (uri (git-reference
3392 (url "https://github.com/ColinIanKing/powerstat")
3393 (commit (string-append "V" version))))
3394 (file-name (git-file-name name version))
3395 (sha256
3396 (base32 "1a1fnw4rb8fx4wrcl0yc6dbjj49k6vagnq7diyw4fs4i5nin7mv3"))))
3397 (build-system gnu-build-system)
3398 (arguments
3399 `(#:make-flags
3400 (list (string-append "CC=" ,(cc-for-target))
3401 (string-append "prefix=" (assoc-ref %outputs "out")))
3402 #:tests? #f ; no test suite
3403 #:phases
3404 (modify-phases %standard-phases
3405 (delete 'configure)))) ; no configure script
3406 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
3407 (synopsis "Measure system power consumption")
3408 (description
3409 "Powerstat measures and reports your computer's power consumption in real
3410time. On mobile PCs, it uses ACPI battery information to measure the power
3411drain of the entire system.
3412
3413Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
3414domain measurements. These are available only on some hardware such as Intel
3415Sandybridge and newer, and cover only part of the machine's components such as
3416CPU, DRAM, and graphics. However, they provide accurate and immediate readings
3417and don't require a battery at all.
3418
3419The output is like @command{vmstat} but also shows power consumption statistics:
3420at the end of a run, @command{powerstat} will calculate the average, standard
3421deviation, and minimum and maximum values. It can show a nice histogram too.")
3422 (license license:gpl2)))
3423
3424(define-public psmisc
3425 (package
3426 (name "psmisc")
3427 (version "23.7")
3428 (source
3429 (origin
3430 (method url-fetch)
3431 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
3432 version ".tar.xz"))
3433 (sha256
3434 (base32 "09y30ywh1d4s4f0wgvki115kgpliq48rarmfmmjl0iq22jf5viaq"))))
3435 (build-system gnu-build-system)
3436 (arguments
3437 (list
3438 #:configure-flags
3439 (if (%current-target-system)
3440 #~(list "ac_cv_func_malloc_0_nonnull=yes"
3441 "ac_cv_func_realloc_0_nonnull=yes")
3442 #~'())))
3443 (inputs (list ncurses))
3444 (home-page "https://gitlab.com/psmisc/psmisc")
3445 (synopsis "Small utilities that use the proc file system")
3446 (description
3447 "psmisc is a set of small utilities that use the proc file system.
3448@itemize @bullet
3449@item @command{fuser} identifies processes using files or sockets;
3450@item @command{killall} kills processes by name;
3451@item @command{prtstat} prints statistics of a process;
3452@item @command{pslog} prints the log file(s) of a process;
3453@item @command{pstree} shows the currently running processes as a tree;
3454@item @command{peekfd} shows the data travelling over a file descriptor.
3455@end itemize")
3456 (license license:gpl2+)))
3457
3458(define-public util-linux
3459 (package
3460 (name "util-linux")
3461 (version "2.40.4")
3462 (source (origin
3463 (method url-fetch)
3464 (uri (string-append "mirror://kernel.org/linux/utils/"
3465 "util-linux/v" (version-major+minor version) "/"
3466 "util-linux-" version ".tar.xz"))
3467 (sha256
3468 (base32
3469 "0ygvflcr7v7x2rmr9h5mi07yx00i9368ggf3znd8bs847drsy7aw"))
3470 (patches (search-patches "util-linux-tests.patch"))
3471 (modules '((guix build utils)))
3472 (snippet
3473 ;; We take 'nologin' from Shadow, the 'logger' program from
3474 ;; GNU Inetutils and 'kill' from GNU Coreutils.
3475 '(begin
3476 (substitute* "configure"
3477 (("build_nologin=yes") "build_nologin=no")
3478 (("build_logger=yes") "build_logger=no")
3479 (("build_kill=yes") "build_kill=no"))))))
3480 (build-system gnu-build-system)
3481 (outputs '("out" ;6.4 MiB executables and documentation
3482 "lib" ;8.8 MiB shared libraries, headers and locales
3483 "static")) ;2.9 MiB static .a libraries
3484 (arguments
3485 (list #:configure-flags
3486 #~(list "--disable-use-tty-group"
3487 (string-append
3488 "--enable-fs-paths-default="
3489 "/run/setuid-programs"
3490 ":/run/current-system/profile/sbin")
3491 ;; Don't try to chown root:root mount and umount
3492 "--disable-makeinstall-chown"
3493 "--localstatedir=/var"
3494 (string-append "--localedir=" #$output:lib
3495 "/share/locale")
3496 ;; Install completions where our bash-completion package
3497 ;; expects them.
3498 (string-append "--with-bashcompletiondir=" #$output
3499 "/etc/bash_completion.d")
3500 ;; XXX: 32-bit Hurd platforms don't support 64bit time_t
3501 #$@(if (target-hurd32?)
3502 '("--disable-year2038")
3503 '()))
3504
3505 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
3506 ;; <https://bugs.gnu.org/47791>.
3507 #:tests? (and (not (%current-target-system))
3508 (not (system-hurd?)))
3509
3510 #:phases
3511 #~(modify-phases %standard-phases
3512 (add-before 'configure 'patch-build-scripts
3513 (lambda _
3514 (substitute* "configure"
3515 ;; The build system assumes that we want to install
3516 ;; libraries below $exec_prefix when $libdir does not
3517 ;; match any of the "usual" locations. Fix that.
3518 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
3519 "usrlib_execdir=$libdir"))))
3520 (add-before 'build 'set-umount-file-name
3521 (lambda _
3522 ;; Tell 'eject' the right file name of 'umount'.
3523 (substitute* "sys-utils/eject.c"
3524 (("\"/bin/umount\"")
3525 (string-append "\"" #$output "/bin/umount\"")))))
3526 (add-before 'check 'pre-check
3527 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3528 (let ((services (search-input-file (or native-inputs inputs)
3529 "etc/services")))
3530 ;; Change the test to refer to the right file.
3531 (substitute* "tests/ts/misc/mcookie"
3532 (("/etc/services")
3533 services))
3534 (substitute* "tests/helpers/test_mkfds.c"
3535 (("/etc/fstab")
3536 (which "sh")))
3537 (substitute* "tests/helpers/test_enosys.c"
3538 (("/bin/false")
3539 (which "false"))))))
3540 (add-before 'check 'disable-setarch-test
3541 (lambda _
3542 ;; The setarch tests are unreliable in QEMU's user-mode
3543 ;; emulation, which is our primary method of building
3544 ;; ARMv7 packages. See
3545 ;; <https://github.com/karelzak/util-linux/issues/601>.
3546 (substitute* "tests/ts/misc/setarch"
3547 (("ts_init_subtest.*" all)
3548 (string-append
3549 all "\n"
3550 "ts_skip \"setarch tests are unreliable under QEMU\"")))))
3551 (add-before 'check 'disable-lsns-test
3552 (lambda _
3553 ;; The lsns tests can fail due to ioctl(_, NS_GET_USERNS)
3554 ;; returning ENOTTY, indicating this kernel does not
3555 ;; support user namespaces. Curiously, this test can fail
3556 ;; on i686 even if the same test passes on x86_64 on the
3557 ;; same machine. See <https://issues.guix.gnu.org/49933>.
3558 (delete-file "tests/ts/lsns/ioctl_ns")))
3559 #$@(if (target-ppc32?)
3560 #~((add-before 'check 'disable-enosys-ioctl
3561 ;; It is unclear why this test specifically
3562 ;; fails in Guix's port of powerpc-linux.
3563 (lambda _
3564 (substitute* "tests/ts/misc/enosys"
3565 (("ts_init_subtest ioctl")
3566 (string-append
3567 "ts_init_subtest ioctl\n\n"
3568 "ts_skip \"unexplained failure on powerpc\"\n"))))))
3569 #~())
3570 (add-after 'install 'move-static-libraries
3571 (lambda _
3572 (let ((lib #$output:lib)
3573 (static #$output:static))
3574
3575 ;; Move static libraries to the "static" output.
3576 (mkdir-p (string-append static "/lib"))
3577 (with-directory-excursion lib
3578 (for-each (lambda (file)
3579 (rename-file file
3580 (string-append static "/"
3581 file)))
3582 (find-files "lib" "\\.a$"))
3583
3584 ;; Remove references to the static library from the '.la'
3585 ;; files so that Libtool does the right thing when both
3586 ;; the shared and static library is available.
3587 (substitute* (find-files "lib" "\\.la$")
3588 (("old_library=.*") "old_library=''\n"))))))
3589 (add-after 'install 'adjust-pkg-config-files
3590 (lambda _
3591 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
3592 ;; the pkg-config files to avoid a cyclic reference on "out".
3593 (substitute* (find-files (string-append #$output:lib
3594 "/lib/pkgconfig")
3595 "\\.pc$")
3596 (("^(exec_)?prefix=.*") "")))))))
3597 (inputs
3598 (list file ;for libmagic
3599 ncurses
3600 sqlite
3601 zlib))
3602 (native-inputs
3603 (list net-base ;for tests
3604 perl
3605 pkg-config))
3606 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
3607 (synopsis "Collection of utilities for the Linux kernel")
3608 (description "Util-linux is a diverse collection of Linux kernel
3609utilities. It provides dmesg and includes tools for working with file systems,
3610block devices, UUIDs, TTYs, and many other tools.")
3611
3612 (properties '((upstream-name . "util-linux")))
3613 ;; Note that util-linux doesn't use the same license for all the
3614 ;; code. GPLv2+ is the default license for a code without an
3615 ;; explicitly defined license.
3616 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
3617 license:bsd-4 license:public-domain))))
3618
3619;; util-linux optionally supports udev, which allows lsblk to read file system
3620;; metadata without special privileges. Add it as a separate package to avoid
3621;; a circular dependency, and to keep the size small.
3622(define-public util-linux+udev
3623 (package/inherit
3624 util-linux
3625 (name "util-linux-with-udev")
3626 (inputs
3627 (modify-inputs (package-inputs util-linux)
3628 (prepend eudev)))))
3629
3630(define-public chimerautils
3631 (package
3632 (name "chimerautils")
3633 (version "14.3.1")
3634 (source
3635 (origin
3636 (method git-fetch)
3637 (uri (git-reference
3638 (url "https://github.com/chimera-linux/chimerautils")
3639 (commit (string-append "v" version))))
3640 (file-name (git-file-name name version))
3641 (sha256
3642 (base32 "10xs9i9w9an9jjq7vgkyfqfyzdisbb57c8c1rryjpfiz8dmi8g41"))))
3643 (build-system meson-build-system)
3644 (arguments
3645 (list
3646 #:tests? #f)) ;no test suite
3647 (inputs (list acl
3648 libedit
3649 libxo
3650 ncurses
3651 openssl
3652 zlib
3653 (list zstd "lib")))
3654 (native-inputs (list flex bison pkg-config))
3655 (home-page "https://github.com/chimera-linux/chimerautils")
3656 (synopsis "The FreeBSD-based core Linux userland from Chimera Linux")
3657 (description
3658 "This is a port of the FreeBSD userland for Linux provided by
3659the Chimera Linux distribution. Essentially, it is a collection of UNIX tools
3660such as @command{grep}, @command{cp}, @command{vi}, etc. and can be used as an
3661alternative to the corresponding implementations from the GNU project.")
3662 (license license:bsd-2)))
3663
3664(define-public ddate
3665 (package
3666 (name "ddate")
3667 (version "0.2.2")
3668 (source (origin
3669 (method git-fetch)
3670 (uri (git-reference
3671 (url "https://github.com/bo0ts/ddate")
3672 (commit (string-append "v" version))))
3673 (file-name (git-file-name name version))
3674 (sha256
3675 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
3676 (build-system cmake-build-system)
3677 (arguments '(#:tests? #f))
3678 (home-page "https://github.com/bo0ts/ddate")
3679 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
3680 (description
3681 "ddate displays the Discordian date and holidays of a given date.
3682The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
3683by Robert Shea and Robert Anton Wilson.")
3684 (license license:public-domain)))
3685
3686(define-public dislocker
3687 (package
3688 (name "dislocker")
3689 (version "0.7.3")
3690 (home-page "https://github.com/Aorimn/dislocker")
3691 (source (origin
3692 (method git-fetch)
3693 (uri (git-reference
3694 (url home-page)
3695 (commit (string-append "v" version))))
3696 (file-name (git-file-name name version))
3697 (sha256
3698 (base32
3699 "1ak68s1v5dwh8y2dy5zjybmrh0pnqralmyqzis67y21m87g47h2k"))))
3700 (build-system cmake-build-system)
3701 (arguments
3702 '(#:tests? #f)) ;no test suite
3703 (inputs (list fuse-2 mbedtls-lts))
3704 (synopsis "FUSE driver to read/write Windows BitLocker drives")
3705 (description
3706 "This package provides means to to read BitLocker encrypted
3707partitions. Write functionality is also provided but check the README.")
3708 (license license:gpl2+)))
3709
3710(define-public dwarves
3711 (package
3712 (name "dwarves")
3713 (version "1.29")
3714 (source (origin
3715 (method git-fetch)
3716 (uri (git-reference
3717 (url "https://github.com/acmel/dwarves")
3718 (commit (string-append "v" version))))
3719 (file-name (git-file-name name version))
3720 (sha256
3721 (base32
3722 "1ia3r77zyw7r8mydy1zrrdnqzm9ginsvf9pqviq48rglihhddvli"))
3723 (patches
3724 (search-patches "dwarves-threading-reproducibility.patch"))))
3725 (build-system cmake-build-system)
3726 (arguments (list #:configure-flags #~(list "-D__LIB=lib"
3727 "-DLIBBPF_EMBEDDED=OFF")
3728 #:tests? #f)) ;no test suite
3729 (native-inputs (list pkg-config))
3730 (inputs (list libbpf))
3731 (home-page "https://github.com/acmel/dwarves")
3732 (synopsis "Debugging information processing library and utilities")
3733 (description "Dwarves is a set of tools that use the debugging information
3734inserted in ELF binaries by compilers such as GCC, used by well known
3735debuggers such as GDB.
3736
3737Utilities in the Dwarves suite include @command{pahole}, that can be used to
3738find alignment holes in structures and classes in languages such as C, C++,
3739but not limited to these. These tools can also be used to encode and read the
3740BTF type information format used with the kernel Linux @code{bpf} syscall.
3741
3742The @command{codiff} command can be used to compare the effects changes in
3743source code generate on the resulting binaries.
3744
3745The @command{pfunct} command can be used to find all sorts of information
3746about functions, inlines, decisions made by the compiler about inlining, etc.
3747
3748The @command{pahole} command can be used to use all this type information to
3749pretty print raw data according to command line directions.
3750
3751Headers can have its data format described from debugging info and offsets from
3752it can be used to further format a number of records.
3753
3754Finally, the @command{btfdiff} command can be used to compare the output of
3755pahole from BTF and DWARF, to make sure they produce the same results.")
3756 (license license:gpl2+)))
3757
3758(define-public fbset
3759 (package
3760 (name "fbset")
3761 (version "2.1")
3762 (source
3763 (origin
3764 (method url-fetch)
3765 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
3766 version ".tar.gz"))
3767 (sha256
3768 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
3769 (build-system gnu-build-system)
3770 (arguments
3771 '(#:modules ((guix build gnu-build-system)
3772 (guix build utils)
3773 (srfi srfi-26))
3774 #:phases
3775 (modify-phases %standard-phases
3776 (delete 'configure) ; no configure script
3777 (add-before 'install 'pre-install
3778 (lambda* (#:key outputs #:allow-other-keys)
3779 (let ((out (assoc-ref outputs "out")))
3780 (substitute* "Makefile"
3781 (("mknod ") "true ")
3782 ;; The Makefile doesn't honour PREFIX or similar.
3783 (("/usr") out))
3784 (mkdir out)
3785 (with-directory-excursion out
3786 (for-each mkdir-p (list "sbin"
3787 "man/man5"
3788 "man/man8")))
3789 #t)))
3790 (add-after 'install 'install-fb.modes
3791 (lambda* (#:key outputs #:allow-other-keys)
3792 (let* ((out (assoc-ref outputs "out"))
3793 (etc (string-append out "/etc")))
3794 (for-each (cut install-file <> etc)
3795 (find-files "etc" "^fb\\.modes"))
3796 (symlink "fb.modes.ATI"
3797 (string-append etc "/fb.modes"))
3798 #t))))
3799 ;; Parallel building races to create modes.tab.c.
3800 #:parallel-build? #f
3801 #:tests? #f)) ; no test suite
3802 (native-inputs
3803 (list bison flex))
3804 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
3805 (synopsis "Show and modify Linux frame buffer settings")
3806 (description
3807 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
3808different kinds of graphic displays. The @command{fbset} utility can query and
3809change various device settings such as depth, virtual resolution, and timing
3810parameters.")
3811 (license license:gpl2)))
3812
3813(define-public procps
3814 (package
3815 (name "procps")
3816 (version "4.0.3")
3817 (source (origin
3818 (method url-fetch)
3819 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
3820 "procps-ng-" version ".tar.xz"))
3821 (sha256
3822 (base32
3823 "14ms9mkqr1mgl3h5yl6w8m57cf39k382nv7qms78vqbaz728wg1h"))
3824 (patches (search-patches "procps-strtod-test.patch"))))
3825 (build-system gnu-build-system)
3826 (arguments
3827 (list #:modules '((guix build utils)
3828 (guix build gnu-build-system)
3829 (srfi srfi-1)
3830 (srfi srfi-26))
3831 #:configure-flags
3832 (if (%current-target-system)
3833 #~'("ac_cv_func_malloc_0_nonnull=yes"
3834 "ac_cv_func_realloc_0_nonnull=yes")
3835 #~'())
3836 #:phases
3837 #~(modify-phases %standard-phases
3838 (add-after 'install 'post-install
3839 ;; Remove commands and man pages redudant with
3840 ;; Coreutils.
3841 (lambda* (#:key outputs #:allow-other-keys)
3842 (let* ((out #$output)
3843 (dup (append-map (cut find-files out <>)
3844 '("^kill" "^uptime"))))
3845 (for-each delete-file dup))))
3846 #$@(if (system-hurd?)
3847 #~((add-after 'unpack 'skip-tests
3848 (lambda _
3849 (substitute* "library/tests/test_version.c"
3850 (("^int main\\(.*" all)
3851 (string-append all "{\n exit (77);//"))))))
3852 #~()))))
3853 (inputs (list ncurses))
3854 (native-inputs (list pkg-config))
3855 (home-page "https://gitlab.com/procps-ng/procps/")
3856 (synopsis "Utilities that give information about processes")
3857 (description
3858 "Procps is the package that has a bunch of small useful utilities
3859that give information about processes using the Linux /proc file system.
3860The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
3861slabtop, tload, top, vmstat, w, watch and sysctl.")
3862 (properties '((upstream-name . "procps-ng")))
3863 (license license:gpl2)))
3864
3865(define-public usbutils
3866 (package
3867 (name "usbutils")
3868 (version "018")
3869 (source
3870 (origin
3871 (method url-fetch)
3872 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
3873 "usbutils-" version ".tar.xz"))
3874 (sha256
3875 (base32 "14xd7j9fl3pm0z4dhqj3mf9paqk431kq4vi602f5hiw5nmcqpxl3"))))
3876 (build-system meson-build-system)
3877 (outputs (list "out" "python"))
3878 (arguments
3879 (list
3880 #:phases
3881 #~(modify-phases %standard-phases
3882 (add-after 'install 'separate-python-output
3883 ;; Separating one Python script shaves more than 106 MiB from :out.
3884 (lambda _
3885 (for-each (lambda (file)
3886 (let ((old (string-append #$output "/" file))
3887 (new (string-append #$output:python "/" file)))
3888 (mkdir-p (dirname new))
3889 (rename-file old new)))
3890 (list "bin/lsusb.py"))))
3891 (add-after 'install 'install-usbreset
3892 (lambda _
3893 (install-file "usbreset"
3894 (string-append #$output "/bin")))))))
3895 (native-inputs (list pkg-config))
3896 (inputs (list eudev libusb python))
3897 (home-page "http://www.linux-usb.org/")
3898 (synopsis
3899 "Tools for working with USB devices")
3900 (description
3901 "Collection of tools to query what type of USB devices are connected to
3902the system, including @command{lsusb}. The experimental @command{usbreset}
3903command included in the package, but be aware that it may not work for all
3904devices.")
3905 (license license:gpl2+)))
3906
3907(define-public usbip-utils
3908 (package
3909 (name "usbip-utils")
3910 (version (package-version linux-libre))
3911 (source (package-source linux-libre))
3912 (build-system gnu-build-system)
3913 (arguments
3914 '(#:configure-flags '("--disable-static")
3915 #:phases (modify-phases %standard-phases
3916 (add-after 'unpack 'enter-subdirectory
3917 (lambda _
3918 (chdir "tools/usb/usbip")
3919 #t)))))
3920 (native-inputs
3921 `(("automake" ,automake)
3922 ("autoreconf" ,autoconf)
3923 ("libtool" ,libtool)))
3924 (inputs (list eudev))
3925 (home-page (package-home-page linux-libre))
3926 (synopsis "Utilities for sharing USB devices over IP networks")
3927 (description
3928 "The USB/IP protocol enables to pass USB device from a server to
3929a client over the network. The server is a machine which shares an
3930USB device and the client is a machine which uses USB device provided by
3931a server over the network. The USB device may be either physical device
3932connected to a server or software entity created on a server using USB
3933gadget subsystem. The usbip-utils are userspace tools to used to handle
3934connection and management on both side. The client needs the @file{vhci-hcd}
3935Linux kernel module and the server needs the @file{usbip_host} Linux kernel
3936module.")
3937 (license license:gpl2)))
3938
3939(define-public e2fsprogs
3940 (package
3941 (name "e2fsprogs")
3942 (version "1.47.2")
3943 (source (origin
3944 (method url-fetch)
3945 (uri (string-append
3946 "mirror://kernel.org/linux/kernel/people/tytso/"
3947 "e2fsprogs/v" version "/"
3948 "e2fsprogs-" version ".tar.xz"))
3949 (sha256
3950 (base32
3951 "0g76fhnyzr2awwybd6c16439l80r5dv4kbfaq7cr908fr9j2w908"))))
3952 (build-system gnu-build-system)
3953 (inputs (list `(,util-linux "lib")))
3954 (native-inputs (list pkg-config
3955 texinfo ;for the libext2fs Info manual
3956 ;; For tests.
3957 perl
3958 procps))
3959 (arguments
3960 `(;; util-linux is the preferred source for some of the libraries and
3961 ;; commands, so disable them (see, e.g.,
3962 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
3963 #:configure-flags (list "--disable-libblkid"
3964 "--disable-libuuid" "--disable-uuidd"
3965 "--disable-fsck"
3966
3967 ;; Use symlinks instead of hard links for
3968 ;; 'fsck.extN' etc. This makes the resulting nar
3969 ;; smaller and is preserved across copies.
3970 "--enable-symlink-install"
3971
3972 (string-append "LDFLAGS=-Wl,-rpath="
3973 (assoc-ref %outputs "out")
3974 "/lib")
3975
3976 ;; Install libext2fs et al.
3977 "--enable-elf-shlibs")
3978
3979 #:phases
3980 (modify-phases %standard-phases
3981 (add-before 'configure 'patch-shells
3982 (lambda _
3983 (substitute* "configure"
3984 (("/bin/sh (.*)parse-types.sh" _ dir)
3985 (string-append (which "sh") " " dir
3986 "parse-types.sh")))
3987 (substitute* "MCONFIG.in"
3988 (("INSTALL_SYMLINK = /bin/sh")
3989 "INSTALL_SYMLINK = sh"))
3990 (substitute* (find-files "." "^Makefile.in$")
3991 (("#!/bin/sh")
3992 (string-append "#!" (which "sh"))))))
3993 (add-after 'install 'install-libs
3994 (lambda* (#:key outputs #:allow-other-keys)
3995 (let* ((out (assoc-ref outputs "out"))
3996 (lib (string-append out "/lib")))
3997 (invoke "make" "install-libs")
3998
3999 ;; Make the .a writable so that 'strip' works.
4000 ;; Failing to do that, due to debug symbols, we
4001 ;; retain a reference to the final
4002 ;; linux-libre-headers, which refer to the
4003 ;; bootstrap binaries.
4004 (let ((archives (find-files lib "\\.a$")))
4005 (for-each (lambda (file)
4006 (chmod file #o666))
4007 archives)))))
4008 ,@(if (system-hurd?)
4009 '((add-after 'unpack 'skip-tests
4010 (lambda _
4011 (with-directory-excursion "tests"
4012 (for-each
4013 (lambda (directory)
4014 (delete-file-recursively directory))
4015 '("d_bad_ostype"
4016 "f_detect_junk"
4017 "f_extent_oobounds"
4018 "j_ext_long_revoke_trans"
4019 "j_ext_long_trans"
4020 "j_long_revoke_trans"
4021 "j_long_revoke_trans_mcsum_32bit"
4022 "j_long_revoke_trans_mcsum_64bit"
4023 "j_long_trans"
4024 "j_long_trans_mcsum_32bit"
4025 "j_long_trans_mcsum_64bit"
4026 "j_short_revoke_trans"
4027 "j_short_revoke_trans_mcsum_64bit"
4028 "j_short_trans_64bit"
4029 "j_short_trans"
4030 "j_short_trans_mcsum_64bit"
4031 "j_short_trans_old_csum"
4032 "j_short_trans_open_recover"
4033 "j_short_trans_recover"
4034 "j_short_trans_recover_mcsum_64bit"
4035 "j_short_uncommitted_trans"
4036 "j_short_uncommitted_trans_mcsum_64bit"
4037 "m_error_behavior"
4038 "m_minrootdir"
4039 "m_rootdir"
4040 "r_32to64bit_expand_full"
4041 "r_expand_full"
4042 "r_fixup_lastbg_big"
4043 "t_change_uuid"
4044 "t_change_uuid_mcsum"
4045 "t_change_uuid_mcsum_mounted"
4046 "t_change_uuid_mcsum_seed_mounted"
4047 "t_change_uuid_mounted"
4048 "t_disable_changed_csum_seed"
4049 "t_disable_changed_csum_seed_mounted"
4050 "t_disable_csum_seed"
4051 "t_disable_meta_csum_and_seed"
4052 "t_enable_csum_seed"
4053 "t_format_csum_seed"
4054 "t_replay_and_set"
4055 "u_compound_rollback"
4056 "u_corrupt_blk_csum"
4057 "u_corrupt_blk_csum_force"
4058 "u_corrupt_key_csum"
4059 "u_debugfs_opt"
4060 "u_dryrun"
4061 "u_e2fsck_opt"
4062 "u_errorout"
4063 "u_force"
4064 "u_force_dryrun"
4065 "u_incomplete"
4066 "u_mke2fs_opt"
4067 "u_mke2fs_opt_oddsize"
4068 "u_offset"
4069 "u_onefile_bad"
4070 "u_resize2fs_opt"
4071 "u_revert_64bitmcsum_onefile"
4072 "u_revert_all_onefile"
4073 "u_revert_upgrade_to_64bitmcsum"
4074 "u_tune2fs_opt"
4075 "u_undo_undo"
4076 "u_wrong_fs"))))))
4077 '()))))
4078 (home-page "https://e2fsprogs.sourceforge.net/")
4079 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
4080 (description
4081 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
4082 (license (list license:gpl2 ;programs
4083 license:lgpl2.0 ;libext2fs
4084 license:x11)))) ;libuuid
4085
4086(define e2fsprogs/static
4087 (static-package
4088 (package (inherit e2fsprogs)
4089 (arguments
4090 ;; Do not build shared libraries.
4091 (substitute-keyword-arguments (package-arguments e2fsprogs)
4092 ((#:configure-flags _)
4093 '(list "--disable-blkid"))
4094 ((#:make-flags _)
4095 '(list)))))))
4096
4097(define-public e2fsck/static
4098 (package
4099 (name "e2fsck-static")
4100 (version (package-version e2fsprogs))
4101 (build-system trivial-build-system)
4102 (source #f)
4103 (inputs
4104 (list e2fsprogs/static))
4105 (arguments
4106 `(#:modules ((guix build utils))
4107 #:builder
4108 (begin
4109 (use-modules (guix build utils)
4110 (ice-9 ftw)
4111 (srfi srfi-26))
4112
4113 (let ((e2fsck (search-input-file %build-inputs "/sbin/e2fsck"))
4114 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
4115 (mkdir-p bin)
4116 (with-directory-excursion bin
4117 (copy-file e2fsck "e2fsck")
4118 (remove-store-references "e2fsck")
4119 (chmod "e2fsck" #o555))
4120 #t))))
4121 (home-page (package-home-page e2fsprogs))
4122 (synopsis "Statically-linked e2fsck command from e2fsprogs")
4123 (description "This package provides statically-linked e2fsck command taken
4124from the e2fsprogs package. It is meant to be used in initrds.")
4125 (license (package-license e2fsprogs))))
4126
4127(define-public extundelete
4128 (package
4129 (name "extundelete")
4130 (version "0.2.4")
4131 (source
4132 (origin
4133 (method url-fetch)
4134 (uri (string-append "mirror://sourceforge/extundelete/"
4135 "extundelete/" version "/extundelete-"
4136 version ".tar.bz2"))
4137 (sha256
4138 (base32
4139 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
4140 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
4141 (build-system gnu-build-system)
4142 (inputs (list e2fsprogs))
4143 (home-page "https://extundelete.sourceforge.net/")
4144 (synopsis "Recover deleted files from ext2/3/4 partitions")
4145 (description
4146 "Extundelete is a set of tools that can recover deleted files from an
4147ext3 or ext4 partition.")
4148 (license license:gpl2)))
4149
4150(define-public zerofree
4151 (package
4152 (name "zerofree")
4153 (version "1.1.1")
4154 (home-page "https://frippery.org/uml/")
4155 (source (origin
4156 (method url-fetch)
4157 (uri (string-append home-page name "-" version
4158 ".tgz"))
4159 (sha256
4160 (base32
4161 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
4162 (build-system gnu-build-system)
4163 (arguments
4164 '(#:phases
4165 (modify-phases %standard-phases
4166 (delete 'configure) ; no configure script
4167 (replace 'install
4168 ;; The Makefile lacks an ‘install’ target.
4169 (lambda* (#:key outputs #:allow-other-keys)
4170 (let* ((out (assoc-ref outputs "out"))
4171 (bin (string-append out "/bin")))
4172 (chmod "zerofree" #o555)
4173 (install-file "zerofree" bin)
4174 #t))))
4175 #:tests? #f)) ; no tests
4176 (inputs `(("libext2fs" ,e2fsprogs)))
4177 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
4178 (description
4179 "Zerofree finds the unallocated blocks with non-zero value content in an
4180ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
4181This is a simple way to make disk images more compressible.
4182Zerofree requires the file system to be unmounted or mounted read-only.")
4183 (license license:gpl2)))
4184
4185(define-public strace
4186 (package
4187 (name "strace")
4188 (version "6.16")
4189 (source
4190 (origin
4191 (method git-fetch)
4192 (uri (git-reference
4193 (url "https://github.com/strace/strace")
4194 (commit (string-append "v" version))))
4195 (file-name (git-file-name name version))
4196 (sha256
4197 (base32 "0p405lf76vksa3ldlq8fjjz5760q2rgr0dvms6bdp3dvc72kr82i"))
4198 (patches (search-patches "strace-readlink-tests.patch"))))
4199 (build-system gnu-build-system)
4200 (arguments
4201 (list
4202 #:phases
4203 #~(modify-phases %standard-phases
4204 ;; Needed for the 'bootstrap phase.
4205 (add-after 'unpack 'patch-source-shebangs-initial
4206 (assoc-ref %standard-phases 'patch-source-shebangs))
4207 (add-after 'unpack 'patch-test-shebangs
4208 (lambda _
4209 (substitute* '("tests/detach-vfork.test"
4210 "tests/gen_tests.sh"
4211 "tests/kill-on-exit.sh")
4212 (("#!/bin/sh")
4213 (string-append "#!" (which "sh")))))))
4214 #:configure-flags
4215 ''("--with-libunwind"
4216 ;; Don't fail if the architecture doesn't support different
4217 ;; personalities.
4218 "--enable-mpers=check")
4219 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
4220 #:parallel-tests? #f)) ; undeterministic failures
4221 (inputs (list libunwind))
4222 (native-inputs
4223 (list autoconf
4224 automake
4225 perl
4226 m4
4227 ;; For some tests
4228 util-linux))
4229 (home-page "https://strace.io")
4230 (synopsis "System call tracer for Linux")
4231 (description
4232 "strace is a system call tracer, i.e. a debugging tool which prints out a
4233trace of all the system calls made by a another process/program.")
4234 (license license:lgpl2.1+)))
4235
4236(define-public ltrace
4237 (package
4238 (name "ltrace")
4239 (version "0.7.3")
4240 (source (origin
4241 (method url-fetch)
4242 (uri (string-append "http://www.ltrace.org/ltrace_" version
4243 ".orig.tar.bz2"))
4244 (sha256
4245 (base32
4246 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
4247 (build-system gnu-build-system)
4248 (inputs `(("libelf" ,elfutils)))
4249 (arguments
4250 ;; Compilation uses -Werror by default, but it fails.
4251 '(#:configure-flags '("--disable-werror")))
4252 (home-page "https://www.ltrace.org/")
4253 (synopsis "Library call tracer for Linux")
4254 (description
4255 "ltrace intercepts and records dynamic library calls which are called by
4256an executed process and the signals received by that process. It can also
4257intercept and print the system calls executed by the program.")
4258 (license license:gpl2+)))
4259
4260(define-public alsa-ucm-conf
4261 (package
4262 (name "alsa-ucm-conf")
4263 (version "1.2.11")
4264 (source (origin
4265 (method url-fetch)
4266 (uri (string-append
4267 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
4268 version ".tar.bz2"))
4269 (sha256
4270 (base32
4271 "10dfzvrmpp9swflw47nxf35an6gj3ilb4wlggdnng8g2637h2z1q"))))
4272 (build-system copy-build-system)
4273 (arguments
4274 '(#:install-plan
4275 '(("ucm" "share/alsa/ucm")
4276 ("ucm2" "share/alsa/ucm2"))))
4277 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4278 (synopsis "The Advanced Linux Sound Architecture Use Case Manager")
4279 (description
4280 "This package contains Advanced Linux Sound Architecture Use Case Manager
4281configuration of audio input/output names and routing for specific audio
4282hardware.")
4283 (license license:bsd-3)))
4284
4285(define-public alsa-topology-conf
4286 (package
4287 (name "alsa-topology-conf")
4288 (version "1.2.4")
4289 (source (origin
4290 (method url-fetch)
4291 (uri (string-append
4292 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
4293 version ".tar.bz2"))
4294 (sha256
4295 (base32
4296 "01zdg6q4s6d01k39z96wi4vbhrfw1i2g4yi5dijwfk6a5vjfdq2m"))))
4297 (build-system copy-build-system)
4298 (arguments
4299 '(#:install-plan
4300 '(("topology" "share/alsa/topology"))))
4301 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4302 (synopsis "The Advanced Linux Sound Architecture libraries")
4303 (description
4304 "This package contains Advanced Linux Sound Architecture topology
4305configuration files that can be used for specific audio hardware.")
4306 (license license:bsd-3)))
4307
4308(define-public alsa-lib
4309 (package
4310 (name "alsa-lib")
4311 (version "1.2.11")
4312 (source (origin
4313 (method url-fetch)
4314 (uri (string-append
4315 "https://www.alsa-project.org/files/pub/lib/"
4316 name "-" version ".tar.bz2"))
4317 (sha256
4318 (base32
4319 "0kdvjlknc50fwfdkxj0z12xbz21skb3gnwlh6lvsvycmp5ljygwz"))))
4320 (build-system gnu-build-system)
4321 (arguments
4322 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4323 (assoc-ref %outputs "out")
4324 "/lib"))
4325 #:phases
4326 (modify-phases %standard-phases
4327 (add-before 'install 'pre-install
4328 (lambda* (#:key inputs outputs #:allow-other-keys)
4329 (let* ((ucm
4330 (string-append (assoc-ref inputs "alsa-ucm-conf")))
4331 (topology
4332 (string-append (assoc-ref inputs "alsa-topology-conf")))
4333 (alsa
4334 (string-append (assoc-ref outputs "out") "/share/alsa"))
4335 (ucm-share
4336 (string-append ucm "/share/alsa/ucm"))
4337 (ucm2-share
4338 (string-append ucm "/share/alsa/ucm2"))
4339 (topology-share
4340 (string-append topology "/share/alsa/topology")))
4341 (mkdir-p alsa)
4342 (symlink ucm-share (string-append alsa "/ucm"))
4343 (symlink ucm2-share (string-append alsa "/ucm2"))
4344 (symlink topology-share (string-append alsa "/topology")))
4345 #t)))))
4346 (inputs
4347 (list alsa-ucm-conf alsa-topology-conf))
4348 (home-page "https://www.alsa-project.org/wiki/Main_Page")
4349 (synopsis "The Advanced Linux Sound Architecture libraries")
4350 (description
4351 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4352MIDI functionality to the Linux-based operating system.")
4353 (license license:lgpl2.1+)))
4354
4355(define-public alsa-utils
4356 (package
4357 (name "alsa-utils")
4358 (version "1.2.11")
4359 (source (origin
4360 (method url-fetch)
4361 (uri (string-append
4362 "https://www.alsa-project.org/files/pub/utils/"
4363 name "-" version ".tar.bz2"))
4364 (sha256
4365 (base32
4366 "19r8qi6b7sd2p1mhxfqrp18wrgjw5s6rp5ygimb1w59zi0xcmils"))))
4367 (build-system gnu-build-system)
4368 (arguments
4369 (list
4370 #:configure-flags
4371 #~(list
4372 ;; The udev rule is responsible for restoring the volume.
4373 (string-append "--with-udev-rules-dir=" #$output "/lib/udev/rules.d"))
4374 #:phases
4375 #~(modify-phases %standard-phases
4376 (add-before 'install 'pre-install
4377 (lambda _
4378 ;; Don't try to mkdir /var/lib/alsa.
4379 (substitute* "Makefile"
4380 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
4381 "true\n")))))))
4382 (native-inputs
4383 (list docbook-xml-4.2 docbook-xsl xmlto
4384 gettext-minimal))
4385 (inputs
4386 (list libsamplerate ncurses alsa-lib))
4387 (home-page "http://www.alsa-project.org/")
4388 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
4389 (description
4390 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4391MIDI functionality to the Linux-based operating system.")
4392
4393 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
4394 ;; GPLv2-only.
4395 (license license:gpl2)))
4396
4397(define-public alsa-plugins
4398 (package
4399 (name "alsa-plugins")
4400 (version "1.2.2")
4401 (source (origin
4402 (method url-fetch)
4403 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
4404 name "-" version ".tar.bz2"))
4405 (sha256
4406 (base32
4407 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
4408 (build-system gnu-build-system)
4409 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
4410 ;; be split, there are references to both in files.
4411 ;; TODO: Remove OSS related plugins, they add support to run native
4412 ;; ALSA applications on OSS however we do not offer OSS and OSS is
4413 ;; obsolete.
4414 (outputs '("out" "pulseaudio" "jack"))
4415 (native-search-paths
4416 (list (search-path-specification
4417 (variable "ALSA_PLUGIN_DIR")
4418 (files '("lib/alsa-lib"))
4419 (separator #f))))
4420 (arguments
4421 `(#:configure-flags '(;; Do not install a "local" configuration targeted
4422 ;; for /etc/alsa. On Guix System plugins are loaded from
4423 ;; the ALSA service, and other distributions likely
4424 ;; won't use these files.
4425 "--with-alsalconfdir=/tmp/noop")
4426 #:phases
4427 (modify-phases %standard-phases
4428 (add-after 'install 'split
4429 (lambda* (#:key inputs outputs #:allow-other-keys)
4430 ;; Distribute the binaries to the various outputs.
4431 (let* ((out (assoc-ref outputs "out"))
4432 (jack (assoc-ref outputs "jack"))
4433 (jacklib (string-append jack "/lib/alsa-lib"))
4434 (pua (assoc-ref outputs "pulseaudio"))
4435 (pualib (string-append pua "/lib/alsa-lib")))
4436 ;; For jack.
4437 (mkdir-p jacklib)
4438 (for-each (lambda (file)
4439 (rename-file file (string-append jacklib "/" (basename file))))
4440 (find-files out ".*jack\\.(la|so)"))
4441 ;; For pulseaudio.
4442 (mkdir-p pualib)
4443 (for-each (lambda (file)
4444 (rename-file file (string-append pualib "/" (basename file))))
4445 (find-files out ".*pulse\\.(la|so)"))
4446 #t))))))
4447 (inputs
4448 (list alsa-lib
4449 jack-1
4450 speex ; libspeexdsp resampling plugin
4451 libsamplerate ; libsamplerate resampling plugin
4452 ffmpeg ; libavcodec resampling plugin, a52 plugin
4453 pulseaudio)) ; PulseAudio plugin
4454 (native-inputs
4455 (list pkg-config))
4456 (home-page "http://www.alsa-project.org/")
4457 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
4458 (description
4459 "The Advanced Linux Sound Architecture (ALSA) provides audio and
4460MIDI functionality to the Linux-based operating system. This package enhances ALSA
4461by providing additional plugins which include: upmixing, downmixing, jackd and
4462pulseaudio support for native alsa applications, format conversion (s16 to a52), and
4463external rate conversion.")
4464 (license (list license:gpl2+
4465 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
4466 license:lgpl2.1+))))
4467
4468(define-public iptables
4469 (package
4470 (name "iptables")
4471 (version "1.8.11")
4472 (source
4473 (origin
4474 (method url-fetch)
4475 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
4476 version ".tar.xz")))
4477 (sha256
4478 (base32 "1cp7kw0d3fpmfmbl4adh88v02wnj4s5rfgyxsk52pjgqbvah6wyq"))))
4479 (build-system gnu-build-system)
4480 (native-inputs
4481 (list pkg-config flex bison))
4482 (inputs
4483 (list libmnl libnftnl/pinned))
4484 (arguments
4485 (list #:tests? #f ; no test suite
4486 #:configure-flags ; add $libdir to the RUNPATH of executables
4487 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))))
4488 (home-page "https://www.netfilter.org/projects/iptables/index.html")
4489 (synopsis "Programs to configure Linux IP packet filtering rules")
4490 (description
4491 "@command{iptables} is the user-space command line program used to
4492configure the Linux 2.4.x and later IPv4 packet filtering ruleset
4493(@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
4494
4495This package also includes @command{ip6tables}, which is used to configure the
4496IPv6 packet filter.
4497
4498Both commands are targeted at system administrators.")
4499 (properties
4500 '((release-monitoring-url . "https://www.netfilter.org/pub/iptables/")))
4501 (license license:gpl2+)))
4502
4503(define-public iptables-nft
4504 (package
4505 (inherit iptables)
4506 (name "iptables-nft")
4507 (source #f)
4508 (build-system copy-build-system)
4509 (arguments
4510 (list
4511 #:phases
4512 #~(modify-phases %standard-phases
4513 (delete 'unpack)
4514 (replace 'install
4515 (lambda* (#:key inputs #:allow-other-keys)
4516 (for-each
4517 (lambda (command-path)
4518 (let ((link-path (string-append #$output command-path)))
4519 (mkdir-p (dirname link-path))
4520 (symlink (search-input-file inputs "sbin/xtables-nft-multi")
4521 link-path)))
4522 (apply append
4523 '("/bin/iptables-xml")
4524 (map (lambda (xtables)
4525 (list (string-append "/sbin/" xtables)
4526 (string-append "/sbin/" xtables "-restore")
4527 (string-append "/sbin/" xtables "-save")))
4528 '("arptables"
4529 "ebtables"
4530 "iptables"
4531 "ip6tables")))))))))
4532 (inputs (list iptables))
4533 (native-inputs '())
4534 (synopsis
4535 "Programs to configure Linux IP packet filtering rules (nftables API)")))
4536
4537(define-public irqbalance
4538 (package
4539 (name "irqbalance")
4540 (version "1.9.4")
4541 (source
4542 (origin
4543 (method git-fetch)
4544 (uri (git-reference
4545 (url "https://github.com/irqbalance/irqbalance")
4546 (commit (string-append "v" version))))
4547 (file-name (git-file-name name version))
4548 (sha256
4549 (base32 "1jswxr0jcxz83j1nanl6xaxpw001l0hfb2xvvy2k970g1g1kpszd"))))
4550 (build-system gnu-build-system)
4551 (inputs (list glib ncurses libnl libcap-ng))
4552 (native-inputs (list autoconf automake libtool pkg-config))
4553 (home-page "https://irqbalance.github.io/irqbalance/")
4554 (synopsis "Daemon used to load balance CPU interrupts")
4555 (description
4556 "Irqbalance is a daemon to help balance the CPU load generated by
4557interrupts across all of a systems CPUs. Irqbalance identifies the highest
4558volume interrupt sources, and isolates each of them to a single unique CPU, so
4559that load is spread as much as possible over an entire processor set, while
4560minimizing cache miss rates for irq handlers.")
4561 (license license:gpl2)))
4562
4563(define-public bolt
4564 (package
4565 (name "bolt")
4566 (version "0.9.10")
4567 (source (origin
4568 (method git-fetch)
4569 (uri (git-reference
4570 (url "https://gitlab.freedesktop.org/bolt/bolt")
4571 (commit version)))
4572 (file-name (git-file-name name version))
4573 (sha256
4574 (base32
4575 "1vw4vzyhkpm73snnfciy7x88ja72cv5isc27k91jvmy2350b29yx"))))
4576 (build-system meson-build-system)
4577 (arguments
4578 (list #:configure-flags '(list "--localstatedir=/var")
4579 #:glib-or-gtk? #t ;To wrap binaries and/or compile schemas
4580 #:phases #~(modify-phases %standard-phases
4581 (add-after 'unpack 'replace-directories
4582 (lambda* (#:key outputs #:allow-other-keys)
4583 (substitute* "meson.build"
4584 (("udev.get_variable\\(pkgconfig: 'udevdir'\\)")
4585 (string-append "'" #$output "/lib/udev'"))
4586 ;; Don't install in /var
4587 (("not systemd\\.found\\(\\)")
4588 "false"))))
4589 (add-before 'install 'no-polkit-magic
4590 (lambda* (#:key outputs #:allow-other-keys)
4591 (setenv "PKEXEC_UID" "something"))))))
4592 (native-inputs (list pkg-config
4593 `(,glib "bin") python asciidoc umockdev))
4594 (inputs (list eudev dbus polkit))
4595 (synopsis "Thunderbolt 3 device manager")
4596 (description
4597 "This package provides @command{boltd}, a userspace daemon
4598for Thunderbolt devices, and @command{boltctl}, a command-line utility for
4599managing those devices.
4600
4601The daemon @command{boltd} exposes devices via D-Bus to clients. It also
4602stores a database of previously authorized devices and will, depending on the
4603policy set for the individual devices, automatically authorize newly connected
4604devices without user interaction.
4605
4606The command-line utility @command{boltctl} manages Thunderbolt devices via
4607@command{boltd}. It can list devices, monitor changes, and initiate
4608authorization of devices.")
4609 (home-page "https://gitlab.freedesktop.org/bolt/bolt")
4610 (properties `((lint-hidden-cpe-vendors . ("boltcms" "puppet"))))
4611 (license license:gpl2+)))
4612
4613(define-public jitterentropy-rngd
4614 (package
4615 (name "jitterentropy-rngd")
4616 (version "1.2.8")
4617 (source
4618 (origin
4619 (method git-fetch)
4620 (uri (git-reference
4621 (url "https://github.com/smuellerDD/jitterentropy-rngd")
4622 (commit (string-append "v" version))))
4623 (file-name (git-file-name name version))
4624 (sha256
4625 (base32 "13br8s6gqnfc844ps38ya5nny3pndsmskszv3dsp1cxcgvmscg1c"))))
4626 (build-system gnu-build-system)
4627 (arguments
4628 (list
4629 #:tests? #f ; no test suite
4630 #:make-flags
4631 #~(list (string-append "CC=" #$(cc-for-target))
4632 (string-append "PREFIX=" #$output)
4633 "UNITDIR=$(PREFIX)/lib/systemd/system")
4634 #:phases
4635 #~(modify-phases %standard-phases
4636 (delete 'configure)))) ; no ./configure script
4637 (home-page "https://www.chronox.de/jent.html")
4638 (synopsis "CPU jitter random number generator daemon")
4639 (description
4640 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
4641number generator} core to the kernel Linux's entropy estimator. This prevents
4642the @file{/dev/random} device from blocking and should benefit users of the
4643preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
4644
4645The CPU Jitter RNG itself is part of the kernel and claims to provide good
4646entropy by collecting and magnifying differences in CPU execution time as
4647measured by the high-resolution timer built into modern CPUs. It requires no
4648additional hardware or external entropy source.
4649
4650The random bit stream generated by @command{jitterentropy-rngd} is not processed
4651by a cryptographically secure whitening function. Nonetheless, its authors
4652believe it to be a suitable source of cryptographically secure key material or
4653other cryptographically sensitive data.
4654
4655If you agree with them, start this daemon as early as possible to provide
4656properly seeded random numbers to services like SSH or those using TLS during
4657early boot when entropy may be low, especially in virtualised environments.")
4658 (license (list license:bsd-3 ; or
4659 license:gpl2+))))
4660
4661(define-public ebtables
4662 (package
4663 (name "ebtables")
4664 (version "2.0.11")
4665 (source (origin
4666 (method url-fetch)
4667 (uri (string-append
4668 "mirror://netfilter.org/ebtables/ebtables-"
4669 version ".tar.gz"))
4670 (sha256
4671 (base32
4672 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
4673 (build-system gnu-build-system)
4674 (inputs
4675 (list perl iptables))
4676 (synopsis "Ethernet bridge frame table administration")
4677 (home-page "https://ebtables.netfilter.org/")
4678 (description
4679 "ebtables is an application program used to set up and maintain the
4680tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
4681analogous to the iptables application, but less complicated, due to the fact
4682that the Ethernet protocol is much simpler than the IP protocol.")
4683 (license license:gpl2+)))
4684
4685(define-public iproute
4686 (package
4687 (name "iproute2")
4688 (version "6.4.0")
4689 (source (origin
4690 (method url-fetch)
4691 (uri (string-append
4692 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
4693 version ".tar.xz"))
4694 (sha256
4695 (base32
4696 "0wm2g70vfhnf8wb6py3zmzwxp4zv1icny1pvkwaxmr67rggbhlac"))))
4697 (build-system gnu-build-system)
4698 (arguments
4699 (list
4700 ;; There is a test suite, but it wants network namespaces and sudo.
4701 #:tests? #f
4702 #:make-flags
4703 #~(let ((out #$output))
4704 (list (string-append "CC=" #$(cc-for-target))
4705 "HOSTCC=gcc"
4706 (string-append "BASH_COMPDIR=" out
4707 "/etc/bash_completion.d")
4708 (string-append "LIBDIR=" out "/lib")
4709 (string-append "HDRDIR=" out "/include")
4710 (string-append "SBINDIR=" out "/sbin")
4711 (string-append "CONFDIR=" out "/etc")
4712 (string-append "MANDIR=" out "/share/man")
4713 #$@(if (target-ppc64le?)
4714 '("CCOPTS=-O2 -pipe -Wno-incompatible-pointer-types")
4715 '())))
4716 #:phases
4717 #~(modify-phases %standard-phases
4718 (replace 'configure
4719 (lambda* (#:key (configure-flags #~'()) #:allow-other-keys)
4720 ;; The configure script does not understand some of the
4721 ;; default options of gnu-build-system.
4722 (setenv "PKG_CONFIG" #$(pkg-config-for-target))
4723 (apply invoke "./configure"
4724 "--prefix" #$output
4725 configure-flags)))
4726 (add-before 'install 'pre-install
4727 (lambda _
4728 ;; Don't attempt to create /var/lib/arpd.
4729 (substitute* "Makefile"
4730 (("^.*ARPDDIR.*$") "")))))))
4731 (inputs
4732 (list bdb iptables libmnl))
4733 (native-inputs
4734 (list bison flex pkg-config))
4735 ;; For tests.
4736 ;; ("libmnl" ,libmnl)
4737 ;; ("util-linux" ,util-linux)
4738 (home-page
4739 "https://wiki.linuxfoundation.org/networking/iproute2")
4740 (synopsis
4741 "Utilities for controlling TCP/IP networking and traffic in Linux")
4742 (description
4743 "Iproute2 is a collection of utilities for controlling TCP/IP networking
4744and traffic with the Linux kernel. The most important of these are
4745@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
4746control.
4747
4748Most network configuration manuals still refer to ifconfig and route as the
4749primary network configuration tools, but ifconfig is known to behave
4750inadequately in modern network environments, and both should be deprecated.")
4751 (license license:gpl2+)))
4752
4753(define-public net-tools
4754 ;; XXX: This package is basically unmaintained, but it provides a few
4755 ;; commands not yet provided by Inetutils, such as 'route', so we have to
4756 ;; live with it.
4757 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
4758 (revision "0"))
4759 (package
4760 (name "net-tools")
4761 (version (string-append "1.60-" revision "." (string-take commit 7)))
4762 (source (origin
4763 (method url-fetch)
4764 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
4765 "n/ne/net-tools/code.git/net-tools-code-"
4766 commit ".zip"))
4767 (file-name (string-append name "-" version ".zip"))
4768 (sha256
4769 (base32
4770 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
4771 (home-page "https://net-tools.sourceforge.net/")
4772 (build-system gnu-build-system)
4773 (arguments
4774 `(#:modules ((guix build gnu-build-system)
4775 (guix build utils)
4776 (srfi srfi-1)
4777 (srfi srfi-26))
4778 #:phases
4779 (modify-phases %standard-phases
4780 (replace 'configure
4781 (lambda* (#:key outputs #:allow-other-keys)
4782 (let ((out (assoc-ref outputs "out")))
4783 (mkdir-p (string-append out "/bin"))
4784 (mkdir-p (string-append out "/sbin"))
4785
4786 ;; Pretend we have everything...
4787 (system "yes | make config")
4788
4789 ;; ... except for the things we don't have.
4790 ;; HAVE_AFDECnet requires libdnet, which we don't have.
4791 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
4792 ;; that have been removed.
4793 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
4794 ;; think about adding them later.
4795 (substitute* '("config.make" "config.h")
4796 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
4797 ""))
4798 #t)))
4799 (add-after 'install 'remove-redundant-commands
4800 (lambda* (#:key outputs #:allow-other-keys)
4801 ;; Remove commands and man pages redundant with Inetutils.
4802 (let* ((out (assoc-ref outputs "out"))
4803 (dup (append-map (cut find-files out <>)
4804 '("^hostname"
4805 "^(yp|nis|dns)?domainname"))))
4806 (for-each delete-file dup)
4807 #t))))
4808 ;; Binaries that depend on libnet-tools.a don't declare that
4809 ;; dependency, making it parallel-unsafe.
4810 #:parallel-build? #f
4811
4812 #:tests? #f ; no test suite
4813 #:make-flags (let ((out (assoc-ref %outputs "out")))
4814 (list ,(string-append "CC=" (cc-for-target))
4815 (string-append "BASEDIR=" out)
4816 (string-append "INSTALLNLSDIR=" out "/share/locale")
4817 (string-append "mandir=/share/man")))))
4818 (native-inputs `(("gettext" ,gettext-minimal)
4819 ("unzip" ,unzip)))
4820 (supported-systems (remove target-hurd? %supported-systems))
4821 (synopsis "Tools for controlling the network subsystem in Linux")
4822 (description
4823 "This package includes the important tools for controlling the network
4824subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
4825route. Additionally, this package contains utilities relating to particular
4826network hardware types (plipconfig, slattach) and advanced aspects of IP
4827configuration (iptunnel, ipmaddr).")
4828 (license license:gpl2+))))
4829
4830(define-public libcap
4831 (package
4832 (name "libcap")
4833 (version "2.64")
4834 (source (origin
4835 (method url-fetch)
4836 (uri (string-append
4837 "mirror://kernel.org/linux/libs/security/linux-privs/"
4838 "libcap2/libcap-" version ".tar.xz"))
4839 (sha256
4840 (base32
4841 "04qy0z6yhlljb29xxcb2srbdnymcrhsi28wrc705z3861cgmwin8"))))
4842 (build-system gnu-build-system)
4843 (arguments
4844 (list #:phases
4845 #~(modify-phases %standard-phases
4846 (delete 'configure))
4847 #:test-target "test"
4848 #:make-flags
4849 #~(list "lib=lib"
4850 (string-append "prefix=" #$output)
4851 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
4852 "RAISE_SETFCAP=no"
4853 ;; Tell the makefile to use TARGET-gcc and friends
4854 ;; when cross-compiling.
4855 #$@(if (%current-target-system)
4856 `((string-append "CROSS_COMPILE="
4857 ,(%current-target-system) "-")
4858 "BUILD_CC=gcc")
4859 '()))))
4860 (native-inputs (list perl))
4861 (supported-systems (remove target-hurd? %supported-systems))
4862 (home-page "https://sites.google.com/site/fullycapable/")
4863 (synopsis "Library for working with POSIX capabilities")
4864 (description
4865 "Libcap2 provides a programming interface to POSIX capabilities on
4866Linux-based operating systems.")
4867
4868 ;; License is BSD-3 or GPLv2, at the user's choice.
4869 (license (list license:bsd-3 license:gpl2))))
4870
4871(define-public bridge-utils
4872 (package
4873 (name "bridge-utils")
4874 (version "1.7.1")
4875 (source
4876 (origin
4877 (method url-fetch)
4878 (uri (string-append "mirror://kernel.org/linux/utils/net/"
4879 "bridge-utils/bridge-utils-" version ".tar.xz"))
4880 (sha256
4881 (base32 "03p6cmhm6cqhnfsfa1wv7frhb361y12daf7gr1h5qh51y7j8n7d6"))))
4882 (build-system gnu-build-system)
4883
4884 ;; The tarball lacks all the generated files.
4885 (native-inputs (list autoconf automake))
4886 (arguments
4887 '(#:tests? #f)) ; no 'check' target
4888
4889 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
4890 (synopsis "Manipulate Ethernet bridges")
4891 (description
4892 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
4893to connect two Ethernet segments together in a protocol independent way.
4894Packets are forwarded based on Ethernet address, rather than IP address (like
4895a router). Since forwarding is done at Layer 2, all protocols can go
4896transparently through a bridge.")
4897 (license license:gpl2+)))
4898
4899(define-public libnl
4900 (package
4901 (name "libnl")
4902 (version "3.5.0")
4903 (source (origin
4904 (method url-fetch)
4905 (uri (string-append
4906 "https://github.com/thom311/libnl/releases/download/"
4907 "libnl" (string-join (string-split version #\.) "_")
4908 "/libnl-" version ".tar.gz"))
4909 (sha256
4910 (base32
4911 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
4912 (build-system gnu-build-system)
4913 (native-inputs
4914 `(("bison" ,bison)
4915 ("flex" ,flex)
4916 ("pkg-config" ,pkg-config)
4917 ("swig" ,swig)
4918 ("libnl3-doc"
4919 ,(origin
4920 (method url-fetch)
4921 (uri (string-append
4922 "https://github.com/thom311/libnl/releases/download/libnl"
4923 (string-join (string-split version #\.) "_")
4924 "/libnl-doc-" version ".tar.gz"))
4925 (sha256
4926 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
4927 (outputs `("out" "doc"))
4928 (arguments
4929 `(#:phases
4930 (modify-phases %standard-phases
4931 (add-after 'install 'install-doc
4932 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
4933 (let ((dest (string-append (assoc-ref outputs "doc")
4934 "/share/doc/libnl")))
4935 (mkdir-p dest)
4936 (invoke "tar" "xf" (assoc-ref
4937 (or native-inputs inputs)
4938 "libnl3-doc")
4939 "--strip-components=1" "-C" dest)))))))
4940 (home-page "https://www.infradead.org/~tgr/libnl/")
4941 (synopsis "NetLink protocol library suite")
4942 (description
4943 "The libnl suite is a collection of libraries providing APIs to netlink
4944protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
4945between the kernel and user space processes. It was designed to be a more
4946flexible successor to ioctl to provide mainly networking related kernel
4947configuration and monitoring interfaces.")
4948
4949 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
4950 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
4951 (license license:gpl2)))
4952
4953;; libnl python extensions used to be outputs of libnl. However, as
4954;; cross-compiling python extensions is currently broken, create separate
4955;; packages for libnl python extensions.
4956(define (libnl-python-package python)
4957 (let ((name (string-append "libnl-" python)))
4958 (package
4959 (inherit libnl)
4960 (name name)
4961 (inputs `(,@(cond
4962 ((string=? python "python2")
4963 `(("python-2" ,python-2)))
4964 ((string=? python "python3")
4965 `(("python-3" ,python-3))))
4966 ("libxcrypt" ,libxcrypt))) ;required by Python.h
4967 (propagated-inputs (list libnl))
4968 (outputs '("out"))
4969 (arguments
4970 `(#:modules ((guix build gnu-build-system)
4971 (guix build utils)
4972 (srfi srfi-1))
4973 #:phases
4974 (modify-phases %standard-phases
4975 (replace 'install
4976 (lambda* (#:key inputs outputs #:allow-other-keys)
4977 (define (python-inst python)
4978 (invoke python "setup.py" "build")
4979 (invoke python "setup.py" "install"
4980 (string-append "--prefix="
4981 (assoc-ref %outputs "out")))
4982 (invoke python "setup.py" "clean"))
4983 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
4984 (assoc-ref inputs "libnl")))
4985 (with-directory-excursion "./python" (python-inst ,python))
4986 #t))))))))
4987
4988(define-public libnl-python2 (libnl-python-package "python2"))
4989(define-public libnl-python3 (libnl-python-package "python3"))
4990
4991(define-public iw
4992 (package
4993 (name "iw")
4994 (version "5.19")
4995 (source (origin
4996 (method url-fetch)
4997 (uri (string-append
4998 "mirror://kernel.org/software/network/iw/iw-"
4999 version ".tar.xz"))
5000 (sha256
5001 (base32
5002 "0kjdrihc7ibnjdpjqkq8sv0kmmvavgsww78cpjgbnlyx8zlvnrzi"))))
5003 (build-system gnu-build-system)
5004 (native-inputs (list pkg-config))
5005 (inputs (list libnl))
5006 (arguments
5007 (list #:make-flags
5008 #~(list
5009 (string-append "CC=" #$(cc-for-target))
5010 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
5011 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5012 #:phases
5013 #~(modify-phases %standard-phases
5014 (delete 'configure)))) ; no configure script
5015 (home-page "https://wireless.wiki.kernel.org/")
5016 (synopsis "Tool for configuring wireless devices")
5017 (description
5018 "iw is a new nl80211 based CLI configuration utility for wireless
5019devices. It replaces @code{iwconfig}, which is deprecated.")
5020 (license license:isc)))
5021
5022(define-public powertop
5023 (package
5024 (name "powertop")
5025 (version "2.15")
5026 (source
5027 (origin
5028 (method git-fetch)
5029 (uri (git-reference
5030 (url "https://github.com/fenrus75/powertop")
5031 (commit (string-append "v" version))))
5032 (file-name (git-file-name name version))
5033 (sha256
5034 (base32 "10vbk4vplmzp3p1mhwnhj81g6i5xvam9pdvmiy6cmd0xvnmdyy77"))))
5035 (build-system gnu-build-system)
5036 (arguments
5037 (list
5038 #:configure-flags #~(list "LDFLAGS=-pthread")
5039 #:phases
5040 #~(modify-phases %standard-phases
5041 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
5042 ;; allow calibrating the network interface in Guix System.
5043 (add-after 'unpack 'patch-absolute-file-names
5044 (lambda* (#:key inputs #:allow-other-keys)
5045 (let ((kmod (assoc-ref inputs "kmod")))
5046 ;; Fix for using a more modern gettext.
5047 (substitute* "autogen.sh"
5048 (("autoreconf")
5049 "autoreconf --force"))
5050 (substitute* "configure.ac"
5051 (("^AM_GNU_GETTEXT_VERSION.*$")
5052 (string-append "AM_GNU_GETTEXT_VERSION(["
5053 #$(package-version (this-package-native-input "gettext-minimal"))
5054 "])\n")))
5055 ;; Give the right 'modprobe' file name so that essential
5056 ;; modules such as msr.ko can be loaded.
5057 (substitute* (find-files "src" "\\.cpp$")
5058 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
5059 ;; These programs are only needed to calibrate, so using
5060 ;; relative file names avoids adding extra inputs. When they
5061 ;; are missing powertop gracefully handles it.
5062 (("/usr/s?bin/(hciconfig|hcitool|xset)" _ command)
5063 command
5064 command))))))))
5065 (native-inputs
5066 (list autoconf
5067 autoconf-archive
5068 automake
5069 gettext-minimal
5070 libtool
5071 pkg-config))
5072 (inputs
5073 (list kmod libnl ncurses pciutils zlib))
5074 (home-page "https://01.org/powertop/")
5075 (synopsis "Analyze power consumption on x86-based laptops")
5076 (description
5077 "PowerTOP is a Linux tool to diagnose issues with power consumption and
5078power management. In addition to being a diagnostic tool, PowerTOP also has
5079an interactive mode where the user can experiment various power management
5080settings for cases where the operating system has not enabled these
5081settings.")
5082 (license license:gpl2)))
5083
5084(define-public aumix
5085 (package
5086 (name "aumix")
5087 (version "2.9.1")
5088 (source (origin
5089 (method url-fetch)
5090 (uri (string-append
5091 "https://web.archive.org/web/20211201184543/"
5092 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
5093 version ".tar.bz2"))
5094 (sha256
5095 (base32
5096 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
5097 (build-system gnu-build-system)
5098 (arguments
5099 ;; Allow compilation with GCC 10.
5100 '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
5101 (inputs (list ncurses))
5102 (home-page (string-append "https://web.archive.org/web/20211201184543/"
5103 "http://jpj.net/~trevor/aumix.html"))
5104 (synopsis "Audio mixer for X and the console")
5105 (description
5106 "Aumix adjusts an audio mixer from X, the console, a terminal,
5107the command line or a script.")
5108 (license license:gpl2+)))
5109
5110(define-public iotop-python
5111 ;; The last release is from 2013 and gives a misleading CONFIG_TASK_DELAY_ACCT
5112 ;; error on ‘newer’ kernels.
5113 (let ((revision "0")
5114 (commit "a14256a3ff74eeee59493ac088561f1bafab85a7"))
5115 (package
5116 (name "iotop-python")
5117 (version (git-version "0.6" revision commit))
5118 (source
5119 (origin
5120 (method git-fetch)
5121 (uri (git-reference
5122 (url "https://repo.or.cz/iotop.git")
5123 (commit commit)))
5124 (file-name (git-file-name name version))
5125 (sha256
5126 (base32 "00h5p8fk1zi237q8mqds8apqbis9iw0yih1hl0pr63dsnyzmmrpw"))))
5127 (build-system python-build-system)
5128 (arguments
5129 '(#:phases
5130 (modify-phases %standard-phases
5131 (add-after 'unpack 'fix-build-with-python3
5132 (lambda _
5133 (substitute* "setup.py"
5134 (("itervalues") "values")))))
5135 ;; There are currently no checks in the package.
5136 #:tests? #f))
5137 (native-inputs (list python))
5138 (home-page "http://guichaz.free.fr/iotop/")
5139 (synopsis
5140 "Displays the IO activity of running processes")
5141 (description
5142 "Iotop is a Python program with a top like user interface to show the
5143processes currently causing I/O.")
5144 (license license:gpl2+))))
5145
5146(define-public iotop
5147 (package
5148 (name "iotop")
5149 (version "1.30")
5150 (source
5151 (origin
5152 (method git-fetch)
5153 (uri (git-reference
5154 (url "https://github.com/Tomas-M/iotop")
5155 (commit (string-append "v" version))))
5156 (file-name (git-file-name name version))
5157 (sha256
5158 (base32 "1sijsk13bkrhsc5bc8f5i97a1ayhivak9pfinnyli57dh22w4k1g"))))
5159 (build-system gnu-build-system)
5160 (arguments
5161 (list #:make-flags
5162 #~(list (string-append "CC=" #$(cc-for-target))
5163 (string-append "PREFIX=" #$output))
5164 #:tests? #f ; no tests
5165 #:phases
5166 #~(modify-phases %standard-phases
5167 (delete 'configure)))) ; no configure script
5168 (native-inputs (list pkg-config))
5169 (inputs (list ncurses))
5170 (home-page "https://github.com/Tomas-M/iotop")
5171 (synopsis "Interactive @command{top}-like input/output activity monitor")
5172 (description
5173 "iotop identifies which processes and threads are most responsible for
5174@acronym{I/O, input/output} activity such as disc reads and writes. It sorts
5175them in a live, interactive table overview similar to that of the well-known
5176@command{top}.
5177
5178This information makes it much easier for an administrator to see which tasks
5179are blocking others and adjust their priority (using @command{ionice}) or stop
5180or kill them altogether.")
5181 (license license:gpl2+)))
5182
5183(define-public fuse
5184 (package
5185 (name "fuse")
5186 (version "3.10.5")
5187 (source (origin
5188 (method url-fetch)
5189 (uri
5190 (string-append "https://github.com/libfuse/libfuse/releases/"
5191 "download/fuse-" version
5192 "/fuse-" version ".tar.xz"))
5193 (sha256
5194 (base32
5195 "0rlnnsiw614qcmgy8xz67044gqc1pbvvf2yxjv44lh27bm487qmj"))))
5196 (build-system meson-build-system)
5197 (inputs
5198 (list bash-minimal util-linux))
5199 (arguments
5200 `(#:configure-flags
5201 ,#~(list
5202 (string-append "-Dudevrulesdir=" #$output "/udev/rules.d")
5203 "-Duseroot=false")
5204 #:tests? #f
5205 #:phases
5206 ,#~(modify-phases %standard-phases
5207 (add-after 'unpack 'set-file-names
5208 (lambda* (#:key inputs #:allow-other-keys)
5209 ;; libfuse calls out to mount(8) and umount(8). Make sure
5210 ;; it refers to the right ones.
5211 (substitute* '("lib/mount_util.c")
5212 (("/bin/(u?)mount" _ maybe-u)
5213 (search-input-file inputs
5214 (string-append "bin/"
5215 maybe-u "mount"))))
5216 (substitute* '("util/mount.fuse.c")
5217 (("/bin/sh")
5218 (search-input-file inputs "/bin/sh")))
5219
5220 ;; This hack leads libfuse to search for 'fusermount' in
5221 ;; $PATH, where it may find a setuid-root binary, instead of
5222 ;; trying solely $out/sbin/fusermount and failing because
5223 ;; it's not setuid.
5224 (substitute* "lib/meson.build"
5225 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5226 "-DFUSERMOUNT_DIR=\"/var/empty\"'"))))
5227 (add-after 'unpack 'fix-install
5228 (lambda* (#:key inputs #:allow-other-keys)
5229 (substitute* '("util/meson.build")
5230 (("install_helper.sh") "true"))
5231 (substitute* '("util/meson.build")
5232 (("fuseconf_path = .*")
5233 "fuseconf_path = '/etc/fuse.conf'"))))
5234 (add-before 'configure 'set-paths
5235 (lambda* (#:key inputs outputs #:allow-other-keys)
5236 (let ((dummy-init.d
5237 (string-append (getcwd) "/etc/init.d")))
5238 (setenv "MOUNT_FUSE_PATH"
5239 (string-append #$output "/sbin"))
5240 (setenv "UDEV_RULES_PATH"
5241 (string-append #$output
5242 "/lib/udev/rules.d"))))))))
5243 (supported-systems (remove target-hurd? %supported-systems))
5244 (home-page "https://github.com/libfuse/libfuse")
5245 (synopsis "Support file systems implemented in user space")
5246 (description
5247 "As a consequence of its monolithic design, file system code for Linux
5248normally goes into the kernel itself---which is not only a robustness issue,
5249but also an impediment to system extensibility. FUSE, for \"file systems in
5250user space\", is a kernel module and user-space library that tries to address
5251part of this problem by allowing users to run file system implementations as
5252user-space processes.")
5253 (license (list license:lgpl2.1 ; library
5254 license:gpl2+)))) ; command-line utilities
5255
5256(define-public fuse-2
5257 (package
5258 (inherit fuse)
5259 (name "fuse")
5260 (version "2.9.9")
5261 (source
5262 (origin
5263 (method url-fetch)
5264 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
5265 "download/fuse-" version
5266 "/fuse-" version ".tar.gz"))
5267 (sha256
5268 (base32 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
5269 (patches (search-patches "fuse-overlapping-headers.patch"
5270 "fuse-glibc-2.34.patch"))))
5271 (build-system gnu-build-system)
5272 (native-inputs
5273 (list autoconf automake gettext-minimal libtool))
5274 (arguments
5275 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
5276 (assoc-ref %outputs "out")
5277 "/sbin")
5278 (string-append "INIT_D_PATH="
5279 (assoc-ref %outputs "out")
5280 "/etc/init.d")
5281
5282 ;; The rule makes /dev/fuse 666.
5283 (string-append "UDEV_RULES_PATH="
5284 (assoc-ref %outputs "out")
5285 "/lib/udev/rules.d"))
5286 #:phases
5287 (modify-phases %standard-phases
5288 (add-before 'bootstrap 'force-bootstrap
5289 (lambda _
5290 ;; Force a bootstrap to make the patch changes effective.
5291 (delete-file "configure")))
5292 (add-before 'build 'set-file-names
5293 (lambda* (#:key inputs #:allow-other-keys)
5294 ;; libfuse calls out to mount(8) and umount(8). Make sure
5295 ;; it refers to the right ones.
5296 (substitute* '("lib/mount_util.c" "util/mount_util.c")
5297 (("/bin/(u?)mount" _ maybe-u)
5298 (search-input-file inputs
5299 (string-append "bin/"
5300 maybe-u "mount"))))
5301 (substitute* '("util/mount.fuse.c")
5302 (("/bin/sh")
5303 (search-input-file inputs "/bin/sh")))
5304
5305 ;; This hack leads libfuse to search for 'fusermount' in
5306 ;; $PATH, where it may find a setuid-root binary, instead of
5307 ;; trying solely $out/sbin/fusermount and failing because
5308 ;; it's not setuid.
5309 (substitute* "lib/Makefile"
5310 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
5311 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))))
5312
5313(define-public fuse-for-appimage
5314 (package
5315 (inherit fuse)
5316 (name "fuse")
5317 (version "3.16.2")
5318 (source
5319 (origin
5320 (method url-fetch)
5321 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
5322 "download/fuse-" version "/fuse-" version ".tar.gz"))
5323 (sha256
5324 (base32 "11yfl2w2a445hllyzlakq97n32g06972vxpmh7lpbclnj9fhb5zp"))))
5325 (arguments
5326 (substitute-keyword-arguments (package-arguments fuse)
5327 ((#:configure-flags original-flags #~(list))
5328 #~(append #$original-flags '("--default-library=static")))))))
5329
5330(define-public unionfs-fuse
5331 (package
5332 (name "unionfs-fuse")
5333 (version "3.3")
5334 (source (origin
5335 (method git-fetch)
5336 (uri (git-reference
5337 (url "https://github.com/rpodgorny/unionfs-fuse")
5338 (commit (string-append "v" version))))
5339 (file-name (git-file-name name version))
5340 (sha256
5341 (base32
5342 "1wl5m5qnwf3s1792xphr35pb80sx8ybaqi3n3ddi5vvk3qjc4iws"))))
5343 (build-system cmake-build-system)
5344 (arguments
5345 (list
5346 #:phases
5347 #~(modify-phases %standard-phases
5348 (replace 'check
5349 ;; The epitome of ‘I tried’: run the 2 trivial tests that don't rely
5350 ;; on the fuse kernel module being loaded. All others would fail.
5351 (lambda* (#:key tests? #:allow-other-keys)
5352 (when tests?
5353 (invoke "pytest" "../source/test_all.py" "-k" "test_help")))))))
5354 (native-inputs
5355 (list pkg-config
5356
5357 ;; Only for the test ‘suite’.
5358 python
5359 python-pytest))
5360 (inputs
5361 (list fuse))
5362 (home-page "https://github.com/rpodgorny/unionfs-fuse")
5363 (synopsis "User-space union file system")
5364 (description
5365 "UnionFS-FUSE is a flexible union file system implementation in user
5366space, using the FUSE library. Mounting a union file system allows you to
5367\"aggregate\" the contents of several directories into a single mount point.
5368UnionFS-FUSE additionally supports copy-on-write.")
5369 (license license:bsd-3)))
5370
5371(define fuse-static
5372 (package (inherit fuse)
5373 (name "fuse-static")
5374 (source
5375 (origin
5376 (inherit (package-source fuse))
5377 (modules '((guix build utils)))
5378 (snippet
5379 #~(begin
5380 ;; Normally libfuse invokes mount(8) so that /etc/mtab is updated.
5381 ;; Change calls to 'mtab_needs_update' to 0 so that it doesn't do
5382 ;; that, allowing us to remove the dependency on util-linux
5383 ;; (something that is useful in initrds.)
5384 (substitute* "lib/mount_util.c"
5385 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") "0")
5386 (("/bin/") ""))))))
5387 (arguments
5388 (substitute-keyword-arguments (package-arguments fuse)
5389 ((#:configure-flags flags '())
5390 #~(cons "-Ddefault_library=static"
5391 #$flags))))))
5392
5393(define-public unionfs-fuse/static
5394 (package (inherit unionfs-fuse)
5395 (synopsis "User-space union file system (statically linked)")
5396 (name (string-append (package-name unionfs-fuse) "-static"))
5397 (source
5398 (origin
5399 (inherit (package-source unionfs-fuse))
5400 (modules '((guix build utils)))
5401 (snippet
5402 #~(begin
5403 ;; Add -ldl to the libraries, because libfuse.a needs that.
5404 (substitute* "src/CMakeLists.txt"
5405 (("target_link_libraries(.*)\\)" _ libs)
5406 (string-append "target_link_libraries"
5407 libs " dl)")))))))
5408 (arguments
5409 (substitute-keyword-arguments (package-arguments unionfs-fuse)
5410 ((#:configure-flags flags #~'())
5411 #~(cons "-DCMAKE_EXE_LINKER_FLAGS=-static" #$flags))
5412 ((#:phases phases #~%standard-phases)
5413 #~(modify-phases #$phases
5414 (add-after 'install 'post-install
5415 (lambda _
5416 ;; By default, 'unionfs' keeps references to
5417 ;; $glibc/share/locale and similar stuff. Remove them.
5418 (remove-store-references (string-append #$output "/bin/unionfs"))
5419 ;; 'unionfsctl' has references to glibc as well. Since
5420 ;; we don't need it, remove it.
5421 (delete-file (string-append #$output "/bin/unionfsctl"))))))))
5422 (inputs (list fuse-static))))
5423
5424(define-public sshfs
5425 (package
5426 (name "sshfs")
5427 (version "3.7.3")
5428 (source (origin
5429 (method url-fetch)
5430 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
5431 "download/sshfs-" version "/sshfs-" version
5432 ".tar.xz"))
5433 (sha256
5434 (base32
5435 "169fkilv060afgp9h7hvsbkg02bd1y77kmx06x0s7q1cvmxww62j"))))
5436 (build-system meson-build-system)
5437 (arguments
5438 ;; XXX: tests are skipped: FUSE kernel module does not seem to be loaded
5439 '(#:tests? #f))
5440 (inputs
5441 (list fuse glib))
5442 (native-inputs
5443 (list pkg-config
5444 ;; man page
5445 python-docutils))
5446 (home-page "https://github.com/libfuse/sshfs")
5447 (synopsis "Mount remote file systems over SSH")
5448 (description
5449 "This is a file system client based on the SSH File Transfer Protocol.
5450Since most SSH servers already support this protocol it is very easy to set
5451up: on the server side there's nothing to do; on the client side mounting the
5452file system is as easy as logging into the server with an SSH client.")
5453 (license license:gpl2+)))
5454
5455(define-public sshfs-fuse
5456 (package (inherit sshfs)
5457 (name "sshfs-fuse")
5458 (properties `((superseded . ,sshfs)))))
5459
5460(define-public archivemount
5461 (package
5462 (name "archivemount")
5463 (version "0.9.1")
5464 (source
5465 (origin
5466 (method url-fetch)
5467 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
5468 "archivemount-" version ".tar.gz"))
5469 (sha256
5470 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
5471 (build-system gnu-build-system)
5472 (inputs (list fuse-2 libarchive))
5473 (native-inputs (list pkg-config))
5474 (home-page "https://www.cybernoia.de/software/archivemount.html")
5475 (synopsis "Tool for mounting archive files with FUSE")
5476 (description "archivemount is a FUSE-based file system for Unix variants,
5477including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
5478mount point where it can be read from or written to as with any other file
5479system. This makes accessing the contents of the archive, which may be
5480compressed, transparent to other programs, without decompressing them.")
5481 (license license:lgpl2.0+)))
5482
5483(define-public numactl
5484 (package
5485 (name "numactl")
5486 (version "2.0.16")
5487 (source (origin
5488 (method url-fetch)
5489 (uri (string-append
5490 "https://github.com/numactl/numactl/releases/download/v"
5491 version "/numactl-" version ".tar.gz"))
5492 (sha256
5493 (base32
5494 "1j67wx3383fwqbvhg4nwqf72vpdgimmrvkpn3b9s2xzr7a4jy90v"))))
5495 (build-system gnu-build-system)
5496 (arguments
5497 `(,@(if (target-riscv64?)
5498 `(#:make-flags (list "LDFLAGS=-latomic"))
5499 '())
5500 ;; There's a 'test' target, but it requires NUMA support in the kernel
5501 ;; to run, which we can't assume to have.
5502 #:tests? #f))
5503 (home-page "https://github.com/numactl/numactl")
5504 (synopsis "Tools for non-uniform memory access (NUMA) machines")
5505 (description
5506 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
5507memory is not all in one place. The @command{numactl} program allows you to
5508run your application program on specific CPUs and memory nodes. It does this
5509by supplying a NUMA memory policy to the operating system before running your
5510program.
5511
5512The package contains other commands, such as @command{numastat},
5513@command{memhog}, and @command{numademo} which provides a quick overview of
5514NUMA performance on your system.")
5515 (license (list license:gpl2 ;programs
5516 license:lgpl2.1)))) ;library
5517
5518(define-public kbd-neo
5519 (package
5520 (name "kbd-neo")
5521 (version "2486")
5522 (source
5523 (origin
5524 (method url-fetch)
5525 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
5526 version "/linux/console/neo.map"))
5527 (file-name (string-append name "-" version ".map"))
5528 (sha256
5529 (base32
5530 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
5531 (build-system trivial-build-system)
5532 (arguments
5533 `(#:modules ((guix build utils))
5534 #:builder (begin
5535 (use-modules (guix build utils))
5536 (let ((out (string-append %output "/share/keymaps"))
5537 (source (assoc-ref %build-inputs "source")))
5538 (mkdir-p out)
5539 (copy-file source (string-append out "/neo.map"))
5540 #t))))
5541 (home-page "https://neo-layout.org")
5542 (synopsis "Neo2 console layout")
5543 (description
5544 "Kbd-neo provides the Neo2 keyboard layout for use with
5545@command{loadkeys(1)} from @code{kbd(4)}.")
5546 ;; The file is located in an svn directory, the entire content of
5547 ;; the directory is licensed as GPL3.
5548 (license license:gpl3+)))
5549
5550(define-public kbd
5551 (package
5552 (name "kbd")
5553 (version "2.5.1")
5554 (source (origin
5555 (method url-fetch)
5556 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
5557 version ".tar.xz"))
5558 (sha256
5559 (base32
5560 "10s608i4blprgy9nynlid0hglfdrrgln6wwjs9rhjf56hwilbpyc"))
5561 (modules '((guix build utils)))
5562 (snippet
5563 '(begin
5564 (substitute* '("src/unicode_start" "src/unicode_stop")
5565 ;; Assume the Coreutils are in $PATH.
5566 (("/usr/bin/tty")
5567 "tty"))))))
5568 (build-system gnu-build-system)
5569 (arguments
5570 '(#:phases
5571 (modify-phases %standard-phases
5572 (add-before 'build 'pre-build
5573 (lambda* (#:key inputs #:allow-other-keys)
5574 (let ((bzip2 (assoc-ref inputs "bzip2"))
5575 (gzip (assoc-ref inputs "gzip"))
5576 (xz (assoc-ref inputs "xz"))
5577 (zstd (assoc-ref inputs "zstd")))
5578 (substitute* "src/libkbdfile/kbdfile.c"
5579 (("bzip2") (string-append bzip2 "/bin/bzip2"))
5580 (("gzip") (string-append gzip "/bin/gzip"))
5581 (("xz -d") (string-append xz "/bin/xz -d"))
5582 (("zstd") (string-append zstd "/bin/zstd"))))))
5583 (add-after 'install 'post-install
5584 (lambda* (#:key outputs #:allow-other-keys)
5585 ;; Make sure these programs find their comrades.
5586 (let* ((out (assoc-ref outputs "out"))
5587 (bin (string-append out "/bin")))
5588 (for-each (lambda (prog)
5589 (wrap-program (string-append bin "/" prog)
5590 `("PATH" ":" prefix (,bin))))
5591 '("unicode_start" "unicode_stop"))))))))
5592 (native-inputs
5593 (list autoconf pkg-config))
5594 (inputs
5595 `(("bash" ,bash-minimal) ; for wrap-program
5596 ("bzip2" ,bzip2)
5597 ("gzip" ,gzip)
5598 ("pam" ,linux-pam)
5599 ("xz" ,xz)
5600 ("zstd" ,zstd)))
5601 (native-search-paths
5602 (list (search-path-specification
5603 (variable "LOADKEYS_KEYMAP_PATH")
5604 ;; Append ‘/**’ to recursively search all directories. One can then
5605 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
5606 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
5607 (files (list "share/keymaps/**")))))
5608 (home-page "https://kbd-project.org/")
5609 (synopsis "Linux keyboard utilities and keyboard maps")
5610 (description
5611 "This package contains keytable files and keyboard utilities compatible
5612for systems using the Linux kernel. This includes commands such as
5613@code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
5614 (license license:gpl2+)))
5615
5616(define-public loadkeys-static
5617 (package
5618 (inherit kbd)
5619 (name "loadkeys-static")
5620 (arguments
5621 (substitute-keyword-arguments (package-arguments kbd)
5622 ((#:configure-flags flags ''())
5623 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
5624 "--disable-vlock" ;so we don't need libpam
5625 "--disable-libkeymap")
5626 ,flags))
5627 ((#:make-flags flags ''())
5628 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
5629 ((#:phases phases '%standard-phases)
5630 `(modify-phases ,phases
5631 (replace 'install
5632 (lambda* (#:key outputs #:allow-other-keys)
5633 (let ((out (assoc-ref outputs "out")))
5634 ;; The binary keeps references to gzip, among other things,
5635 ;; which we don't need in the initrd, so strip references.
5636 (remove-store-references "src/loadkeys")
5637
5638 (install-file "src/loadkeys"
5639 (string-append out "/bin")))))
5640 (delete 'post-install)))
5641 ((#:strip-flags _ '())
5642 ''("--strip-all"))
5643 ((#:allowed-references _ '())
5644 '())))
5645
5646 (synopsis "Statically-linked @command{loadkeys} program")
5647
5648 ;; This package is meant to be used internally in the initrd so don't
5649 ;; expose it.
5650 (properties '((hidden? . #t)))))
5651
5652(define-public inotify-tools
5653 (package
5654 (name "inotify-tools")
5655 (version "3.22.6.0")
5656 (source (origin
5657 (method git-fetch)
5658 (uri (git-reference
5659 (url "https://github.com/rvoicilas/inotify-tools")
5660 (commit version)))
5661 (file-name (git-file-name name version))
5662 (sha256
5663 (base32
5664 "1j9j8k5zjp8m4cl53zjncnll9z4dnvzr4ygmfcjk0ci81i59b18i"))))
5665 (build-system gnu-build-system)
5666 (native-inputs
5667 (list autoconf automake libtool))
5668 (arguments
5669 `(#:configure-flags
5670 (list "--disable-static")))
5671 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
5672 (synopsis "Monitor file accesses")
5673 (description
5674 "The inotify-tools packages provides a C library and command-line tools
5675to use Linux' inotify mechanism, which allows file accesses to be monitored.")
5676 (license license:gpl2+)))
5677
5678(define-public kmod
5679 (package
5680 (name "kmod")
5681 (version "29")
5682 (source (origin
5683 (method url-fetch)
5684 (uri
5685 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
5686 "kmod-" version ".tar.xz"))
5687 (sha256
5688 (base32
5689 "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
5690 (patches (search-patches "kmod-module-directory.patch"))))
5691 (build-system gnu-build-system)
5692 (arguments
5693 (list #:configure-flags #~(list "--with-xz" "--with-zlib" "--with-zstd"
5694 "--disable-test-modules")
5695 #:phases
5696 #~(modify-phases %standard-phases
5697 (add-after 'unpack 'disable-tests
5698 (lambda _
5699 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
5700 (substitute* "Makefile.in"
5701 (("testsuite/test-modprobe") "")
5702 (("testsuite/test-depmod") "")
5703 (("testsuite/test-blacklist") ""))))
5704 (add-after 'install 'install-modprobe&co
5705 (lambda _
5706 (for-each (lambda (tool)
5707 (symlink "kmod"
5708 (string-append #$output "/bin/" tool)))
5709 '("insmod" "rmmod" "lsmod" "modprobe"
5710 "modinfo" "depmod")))))))
5711 (native-inputs (list pkg-config zstd)) ;zstd needed for tests
5712 (inputs (list xz zlib `(,zstd "lib")))
5713 (supported-systems (remove target-hurd? %supported-systems))
5714 (home-page "https://www.kernel.org/")
5715 (synopsis "Kernel module tools")
5716 (description "Kmod is a set of tools to handle common tasks with Linux
5717kernel modules like insert, remove, list, check properties, resolve
5718dependencies and aliases.
5719
5720These tools are designed on top of libkmod, a library that is shipped with
5721kmod. The aim is to be compatible with tools, configurations and indices
5722from the module-init-tools project.")
5723 (license license:gpl2+))) ; library under lgpl2.1+
5724
5725(define-public earlyoom
5726 (package
5727 (name "earlyoom")
5728 (version "1.7")
5729 (source (origin
5730 (method git-fetch)
5731 (uri (git-reference
5732 (url "https://github.com/rfjakob/earlyoom")
5733 (commit (string-append "v" version))))
5734 (file-name (git-file-name name version))
5735 (sha256
5736 (base32
5737 "1xqrs6wz59ks76hdgfd4vaj010kbvllilgam2xxyn0g56kai71zi"))))
5738 (build-system gnu-build-system)
5739 (arguments
5740 (list
5741 #:phases
5742 #~(modify-phases %standard-phases
5743 (delete 'configure) ; no configure script
5744 (add-before 'check 'set-go-HOME
5745 (lambda _
5746 (setenv "HOME" (getcwd))))
5747 (add-before 'check 'disable-failing-test
5748 (lambda _
5749 ;; This test relies on writing to /proc/%d/oom_score_adj.
5750 (substitute* "testsuite_cli_test.go"
5751 (("TestI" match)
5752 (string-append "skipped" match))))))
5753 #:make-flags
5754 #~(list (string-append "CC=" #$(cc-for-target))
5755 (string-append "VERSION=v" #$version)
5756 (string-append "PREFIX=" #$output)
5757 (string-append "SYSCONFDIR=" #$output "/etc")
5758 "GO111MODULE=off")
5759 #:test-target "test"))
5760 (native-inputs
5761 (append
5762 ;; To generate the manpage.
5763 (if (or (target-x86-64?) (target-x86-32?))
5764 (list pandoc)
5765 '())
5766 (list
5767 ;; For the test suite.
5768 cppcheck
5769 go-1.23)))
5770 (home-page "https://github.com/rfjakob/earlyoom")
5771 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
5772 (description "Early OOM is a minimalist out of memory (OOM) daemon that
5773runs in user space and provides a more responsive and configurable alternative
5774to the in-kernel OOM killer.")
5775 (license license:expat)))
5776
5777(define-public eudev
5778 (package
5779 (name "eudev")
5780 (version "3.2.14")
5781 (source (origin
5782 (method git-fetch)
5783 (uri (git-reference (url "https://github.com/eudev-project/eudev")
5784 (commit (string-append "v" version))))
5785 (file-name (git-file-name name version))
5786 (sha256
5787 (base32
5788 "1f6lz57igi7iw2ls3fpzgw42bfznam4nf9368h7x8yf1mb737yxz"))))
5789 (build-system gnu-build-system)
5790 (arguments
5791 (list
5792 ;; The binary should be built to look for its rules under
5793 ;; /etc/udev/rules.d, which is where the udev-shepherd-service keeps
5794 ;; them.
5795 #:make-flags #~(list "udevrulesdir=/etc/udev/rules.d")
5796 #:phases
5797 #~(modify-phases %standard-phases
5798 (add-before 'bootstrap 'patch-file-names
5799 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5800 (substitute* "man/make.sh"
5801 (("/usr/bin/xsltproc")
5802 (search-input-file (or native-inputs inputs) "/bin/xsltproc")))))
5803 (add-before 'bootstrap 'install-in-lib
5804 (lambda _
5805 ;; When the udev-service-type instantiates /etc, it collects
5806 ;; hardware files from the <package>/lib/udev/hwdb.d directories
5807 ;; of different packages. Since we set sysconfdir to /etc, the
5808 ;; only package-dependent location we can install hwdb files is
5809 ;; in <package>/lib/udev/hwdb.d. Eudev is configured to install
5810 ;; these files in sysconfdir, but they should be placed into
5811 ;; udevlibexecdir.
5812 (copy-file "hwdb/Makefile.am" "hwdb/files.am")
5813 (call-with-output-file "hwdb/Makefile.am"
5814 (lambda (port)
5815 (format port "hardwarelibdir = $(udevlibexecdir)/hwdb.d\n")
5816 (format port "include ./files.am")))
5817 (substitute* "hwdb/files.am"
5818 (("dist_udevhwdb_DATA =")
5819 "dist_hardwarelib_DATA ="))
5820 ;; Do not install the empty udev.conf template.
5821 (substitute* "src/udev/Makefile.am"
5822 (("dist_udevconf_DATA =")
5823 "dist_noinst_DATA ="))
5824 ;; Do not ensure that /etc/udev/rules.d exists.
5825 (substitute* "rules/Makefile.am"
5826 (("\\$\\(MKDIR_P\\) \\$\\(DESTDIR\\)\\$\\(udevconfdir\\)/rules\\.d")
5827 "true"))))
5828 (add-after 'install 'move-static-library
5829 (lambda _
5830 (let ((source (string-append #$output "/lib/libudev.a"))
5831 (target (string-append #$output:static "/lib/libudev.a")))
5832 (mkdir-p (dirname target))
5833 (link source target)
5834 (delete-file source)
5835 ;; Remove reference to the static library from the .la file
5836 ;; such that Libtool looks for it in the usual places.
5837 (substitute* (string-append #$output "/lib/libudev.la")
5838 (("old_library=.*")
5839 "old_library=''\n")))))
5840 (replace 'install
5841 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
5842 ;; Although the runtime udevrulesdir is set to
5843 ;; /etc/udev/rules.d, the package should provide its default
5844 ;; rules under $libdir/udev/rules.d.
5845 (let* ((default-udev-rules.d (string-append #$output
5846 "/lib/udev/rules.d"))
5847 (make-flags (cons (string-append "udevrulesdir="
5848 default-udev-rules.d)
5849 (delete "udevrulesdir=/etc/udev/rules.d"
5850 make-flags))))
5851 (apply (assoc-ref %standard-phases 'install)
5852 `(,@args #:make-flags ,make-flags))))))
5853 #:configure-flags
5854 #~(list "--enable-manpages"
5855 ;; By default, autoconf uses $prefix/etc. The udev-service-type
5856 ;; makes sure /etc is set up with rules and hardware file
5857 ;; descriptions.
5858 "--sysconfdir=/etc")))
5859 (native-search-paths
5860 (list (search-path-specification
5861 (variable "UDEV_HWDB_PATH")
5862 (files '("lib/udev/hwdb.d")))))
5863 (native-inputs
5864 (list autoconf
5865 automake
5866 gperf
5867 libtool
5868 pkg-config
5869 ;; For tests.
5870 perl
5871 python-wrapper
5872 ;; For documentation.
5873 docbook-xml-4.2
5874 docbook-xsl
5875 libxslt))
5876 (inputs
5877 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
5878 ;; and similar; it also installs the '60-persistent-storage.rules' file,
5879 ;; which contains the rules to do that.
5880 (list `(,util-linux "lib") ;for blkid
5881 kmod))
5882 (outputs '("out" "static"))
5883 (home-page "https://github.com/eudev-project/eudev")
5884 (synopsis "Userspace device management")
5885 (description "Udev is a daemon which dynamically creates and removes
5886device nodes from /dev/, handles hotplug events and loads drivers at boot
5887time.")
5888 (license license:gpl2+)))
5889
5890(define-public python-evdev
5891 (package
5892 (name "python-evdev")
5893 (version "1.9.1")
5894 (source
5895 (origin
5896 (method git-fetch) ; no tests data in PyPi package
5897 (uri (git-reference
5898 (url "https://github.com/gvalkov/python-evdev")
5899 (commit (string-append "v" version))))
5900 (file-name (git-file-name name version))
5901 (sha256
5902 (base32 "09p7pj0xhv23hqlpx865klrxrf7x6sw1bdsgs6pq900jvz92pl16"))))
5903 (build-system pyproject-build-system)
5904 (arguments
5905 (list
5906 #:test-flags
5907 ;; Silent tests requiring access to /dev/uinput.
5908 #~(list "-k" (string-append "not test_open"
5909 " and not test_open_context"
5910 " and not test_enable_events"
5911 " and not test_abs_values"
5912 " and not test_write"))
5913 #:phases
5914 #~(modify-phases %standard-phases
5915 (add-before 'build 'fix-hard-coded-directory
5916 (lambda* (#:key inputs #:allow-other-keys)
5917 (substitute* "setup.py"
5918 (("/usr/include/linux")
5919 (string-append
5920 (assoc-ref inputs "kernel-headers") "/include/linux"))))))))
5921 (native-inputs
5922 (list python-pytest python-setuptools python-wheel))
5923 (home-page "https://github.com/gvalkov/python-evdev")
5924 (synopsis "Bindings to the Linux input handling subsystem")
5925 (description
5926 "Python-evdev provides bindings to the generic input event interface in
5927Linux. The @code{evdev} interface serves the purpose of passing events
5928generated in the kernel directly to userspace through character devices that
5929are typically located in @file{/dev/input/}.
5930
5931This package also comes with bindings to @code{uinput}, the userspace input
5932subsystem. @code{uinput} allows userspace programs to create and handle input
5933devices that can inject events directly into the input subsystem.")
5934 (license license:bsd-3)))
5935
5936(define-public interception-tools
5937 (package
5938 (name "interception-tools")
5939 (version "0.6.8")
5940 (home-page "https://gitlab.com/interception/linux/tools")
5941 (source (origin
5942 (method git-fetch)
5943 (uri (git-reference
5944 (url home-page)
5945 (commit (string-append "v" version))))
5946 (file-name (git-file-name name version))
5947 (sha256
5948 (base32
5949 "1sbidym6ld4c8cx2ww5i54zsv8v0kygv15zq1yimz44v4my605wf"))))
5950 (build-system cmake-build-system)
5951 (native-inputs
5952 (list pkg-config))
5953 (inputs
5954 (list boost libevdev eudev yaml-cpp))
5955 (arguments
5956 `(#:tests? #f)) ; no test suite
5957 (synopsis "Utilities for operating on input events of evdev devices")
5958 (description
5959 "Interception Tools provides a composable infrastructure on top of
5960@code{libudev} and @code{libevdev}. The following utilities are provided:
5961
5962@itemize
5963@item @command{udevmon} --- monitor input devices for launching tasks
5964@item @command{intercept} --- redirect device input events to stdout
5965@item @command{uinput} --- redirect device input events from stding to virtual device
5966@item @command{mux} --- mux streams of input events
5967@end itemize")
5968 ;; Dual-licensed under GPLv3+ or "something else" on request, per
5969 ;; 'README.md'.
5970 (license license:gpl3+)))
5971
5972(define-public interception-dual-function-keys
5973 (package
5974 (name "interception-dual-function-keys")
5975 (version "1.4.0")
5976 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
5977 (source (origin
5978 (method git-fetch)
5979 (uri (git-reference
5980 (url home-page)
5981 (commit version)))
5982 (file-name (git-file-name name version))
5983 (sha256
5984 (base32
5985 "0s49vbg3j4rwh78i8rx8qr7myql09p7b3lhrjl0p7dd98xp6ann6"))))
5986 (build-system gnu-build-system)
5987 (inputs
5988 (list libevdev yaml-cpp))
5989 (arguments
5990 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
5991 ,(string-append "CXX=" (cxx-for-target))
5992 (string-append "PREFIX=" %output))
5993 #:phases
5994 (modify-phases %standard-phases
5995 (add-after 'unpack 'fix-libevdev-path
5996 (lambda* (#:key inputs #:allow-other-keys)
5997 (let ((libevdev (assoc-ref inputs "libevdev")))
5998 (substitute* "config.mk"
5999 (("/usr/include/libevdev-1.0")
6000 (string-append libevdev "/include/libevdev-1.0")))
6001 #t)))
6002 ;; No configure script
6003 (delete 'configure))
6004 ;; No tests are included.
6005 #:tests? #f))
6006 (synopsis "Tap for one key, hold for another")
6007 (description
6008 "Dual Function Keys is a plugin for @code{interception-tools} that allows
6009one to send arbitrary keycodes when a given key is tapped or held.")
6010 (license license:expat)))
6011
6012(define-public lvm2
6013 (package
6014 (name "lvm2")
6015 (version "2.03.22")
6016 (source (origin
6017 (method url-fetch)
6018 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
6019 version ".tgz")
6020 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
6021 version ".tgz")))
6022 (sha256
6023 (base32
6024 "0z6w6bknhwh1n3qfkb5ij6x57q3wjf28lq3l8kh7rkhsplinjnjc"))
6025 (patches (search-patches "lvm2-no-systemd.patch"))
6026 (modules '((guix build utils)))
6027 (snippet
6028 '(begin
6029 (use-modules (guix build utils))
6030
6031 ;; Honor sysconfdir.
6032 (substitute* "make.tmpl.in"
6033 (("^confdir = .*$")
6034 "confdir = @sysconfdir@\n")
6035 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
6036 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
6037 (build-system gnu-build-system)
6038 (native-inputs
6039 (list config
6040 pkg-config procps)) ;tests use 'pgrep'
6041 (inputs
6042 `(("libaio" ,libaio)
6043 ("udev" ,eudev)))
6044 (arguments
6045 `(#:phases
6046 (modify-phases %standard-phases
6047 (add-after 'unpack 'update-config
6048 (lambda* (#:key inputs native-inputs #:allow-other-keys)
6049 (install-file (search-input-file
6050 (or native-inputs inputs) "/bin/config.sub")
6051 "autoconf")
6052 (install-file (search-input-file
6053 (or native-inputs inputs) "/bin/config.guess")
6054 "autoconf")))
6055 (add-after 'configure 'set-makefile-shell
6056 (lambda _
6057 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
6058 ;; expected.
6059 (setenv "SHELL" (which "sh"))
6060
6061 ;; Replace /bin/sh with the right file name.
6062 (patch-makefile-SHELL "make.tmpl"))))
6063
6064 #:configure-flags (list (string-append "--sysconfdir="
6065 (assoc-ref %outputs "out")
6066 "/etc/lvm")
6067 "--enable-udev_sync"
6068 "--enable-udev_rules"
6069 "--enable-pkgconfig"
6070 "--enable-cmdlib"
6071 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
6072
6073 ;; Make sure programs such as 'dmsetup' can
6074 ;; find libdevmapper.so.
6075 (string-append "LDFLAGS=-Wl,-rpath="
6076 (assoc-ref %outputs "out")
6077 "/lib,-rpath="
6078 (assoc-ref %outputs "out")
6079 "/lib/device-mapper")
6080 ;; This is needed when cross-compiling.
6081 ,@(if (%current-target-system)
6082 '("ac_cv_func_malloc_0_nonnull=yes"
6083 "ac_cv_func_realloc_0_nonnull=yes")
6084 '()))
6085
6086 ;; The tests use 'mknod', which requires root access.
6087 #:tests? #f))
6088 (supported-systems (remove target-hurd? %supported-systems))
6089 (home-page "https://sourceware.org/lvm2/")
6090 (synopsis "Logical volume management for Linux")
6091 (description
6092 "LVM2 is the logical volume management tool set for Linux-based systems.
6093This package includes the user-space libraries and tools, including the device
6094mapper. Kernel components are part of Linux-libre.")
6095
6096 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
6097 ;; Command-line tools are GPLv2.
6098 (license (list license:gpl2 license:lgpl2.1))))
6099
6100(define-public (libdevmapper-propagated-inputs)
6101 (list eudev))
6102
6103(define-public lvm2-static
6104 (package
6105 (inherit lvm2)
6106 (name "lvm2-static")
6107
6108 (inputs `(,@(package-inputs lvm2)
6109 ("udev:static" ,eudev "static")))
6110
6111 (arguments
6112 (substitute-keyword-arguments (package-arguments lvm2)
6113 ((#:configure-flags flags '())
6114 ;; LVM2 doesn't use Libtool, hence the custom option.
6115 `(append '("--enable-static_link")
6116 ;; Building dmeventd statically is complicated due to a
6117 ;; requirement on libdevmapper.a, which is being phased out
6118 ;; in favor of libdevice-mapper.a, which in turn is is not
6119 ;; easily made available at dmeventd build time. Just ignore
6120 ;; it until the situation improves.
6121 (delete "--enable-dmeventd" ,flags)))
6122 ((#:phases phases)
6123 #~(modify-phases #$phases
6124 (add-before 'configure 'adjust-Makefile
6125 (lambda _
6126 ;; These fixes are related to the upstream libdm->device_mapper
6127 ;; migration and will hopefully be fixed upstream in due time.
6128 (substitute* "tools/Makefile.in"
6129 ;; This variable is empty in a static configuration and causes
6130 ;; an erroneous GCC command line.
6131 (("-L\\$\\(interfacebuilddir\\)") "")
6132 ;; Remove obsolete reference to libdevmapper.a.
6133 (("-ldevmapper") ""))
6134 #t))
6135 (add-after 'install 'adjust-pkgconfig
6136 ;; The static eudev is missing its pkg config file, and I am not
6137 ;; rebuilding it at this point.
6138 (lambda* (#:key inputs #:allow-other-keys)
6139 (substitute* (string-append #$output "/lib/pkgconfig/devmapper.pc")
6140 (("Requires.private: .*") "")
6141 (("Libs.private:")
6142 (format #f "Libs.private: -L~a -ludev"
6143 (dirname (search-input-file inputs "lib/libudev.a")))))))))))
6144 (synopsis "Logical volume management for Linux (statically linked)")))
6145
6146(define-public thin-provisioning-tools
6147 (package
6148 (name "thin-provisioning-tools")
6149 (version "0.8.5")
6150 (source
6151 (origin
6152 (method git-fetch)
6153 (uri (git-reference
6154 (url "https://github.com/jthornber/thin-provisioning-tools")
6155 (commit (string-append "v" version))))
6156 (file-name (git-file-name name version))
6157 (sha256
6158 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
6159 (build-system gnu-build-system)
6160 (arguments
6161 ;; Doesn't build with --enable-testing due to a function name collision
6162 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
6163 `(#:tests? #f))
6164 (native-inputs
6165 `(("automake" ,automake)
6166 ("autoreconf" ,autoconf)))
6167 (inputs
6168 (list boost expat libaio))
6169 (synopsis "Tools for manipulating the metadata of device-mapper targets")
6170 (description "A suite of tools for manipulating the metadata of the
6171dm-thin, dm-cache and dm-era device-mapper targets.")
6172 (home-page "https://github.com/jthornber/thin-provisioning-tools")
6173 (license license:gpl3+)))
6174
6175(define-public watchdogd
6176 (package
6177 (name "watchdogd")
6178 (version "4.0")
6179 (source (origin
6180 (method git-fetch)
6181 (uri (git-reference
6182 (url "https://github.com/troglobit/watchdogd")
6183 (commit version)))
6184 (file-name (git-file-name name version))
6185 (sha256
6186 (base32
6187 "112mdhqykl78qk8l7nx7h19nnd58v0axj6ws8s47n9a64b867li4"))))
6188 (build-system gnu-build-system)
6189 (native-inputs (list autoconf automake libtool pkg-config))
6190 (inputs (list libconfuse libite libuev))
6191 (synopsis "Advanced system & process supervisor for Linux")
6192 (description "This package provides an advanced monitor of critical system
6193resources, supervises the heartbeat of processes, records deadline
6194transgressions, and initiates a controlled reset if needed.")
6195 (home-page "https://troglobit.com/projects/watchdogd/")
6196 (license license:isc)))
6197
6198(define-public wireless-tools
6199 (package
6200 (name "wireless-tools")
6201 (version "30.pre9")
6202 (source
6203 (origin
6204 (method url-fetch)
6205 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/"
6206 "Linux/wireless_tools." version ".tar.gz"))
6207 (sha256
6208 (base32 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
6209 (snippet
6210 #~(begin
6211 ;; Remove the older header files that are not free software.
6212 (for-each (lambda (n)
6213 (delete-file (format #f "wireless.~a.h" n)))
6214 '(10 11 12 13 14 15 16 17 18 19 20))))))
6215 (build-system gnu-build-system)
6216 (arguments
6217 (list #:make-flags
6218 #~(list (string-append "PREFIX=" #$output)
6219 (string-append "INSTALL_MAN=" #$output "/share/man")
6220 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
6221 "BUILD_STATIC=")
6222 #:phases
6223 #~(modify-phases %standard-phases
6224 (replace 'configure
6225 (lambda* (#:key target #:allow-other-keys)
6226 (when target
6227 ;; Cross-compilation: use the cross tools.
6228 (substitute* (find-files "." "Makefile")
6229 (("CC = .*$")
6230 (string-append "CC = " target "-gcc\n"))
6231 (("AR = .*$")
6232 (string-append "AR = " target "-ar\n"))
6233 (("RANLIB = .*$")
6234 (string-append "RANLIB = " target "-ranlib\n")))))))
6235 #:tests? #f))
6236 (synopsis "Tools for manipulating Linux Wireless Extensions")
6237 (description "Wireless Tools are used to manipulate the now-deprecated
6238Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
6239Extension was an interface allowing you to set Wireless LAN specific
6240parameters and get the specific stats. It is deprecated in favor the nl80211
6241interface.")
6242 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
6243 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
6244 ;; other files are distributed under gpl2.
6245 (license (list license:gpl2 license:lgpl2.1+))))
6246
6247(define-public crda
6248 (package
6249 (name "crda")
6250 (version "4.15")
6251 (source
6252 (origin
6253 (method git-fetch)
6254 (uri (git-reference
6255 (url "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git")
6256 (commit (string-append "v" version))))
6257 (file-name (git-file-name name version))
6258 (sha256
6259 (base32 "1ajh8zx84p15y9wawh764zawniwn059iw9m32v56ajvkz9xbnkp2"))
6260 (patches (search-patches "crda-optional-gcrypt.patch"))))
6261 (build-system gnu-build-system)
6262 (arguments
6263 (list #:phases
6264 #~(modify-phases %standard-phases
6265 (delete 'configure)
6266 (add-after 'unpack 'gzip-deterministically
6267 (lambda _
6268 (substitute* "Makefile"
6269 (("gzip" command)
6270 (string-append command " --no-name")))))
6271 #$@(if (%current-target-system)
6272 #~((add-after 'unpack 'fix-pkg-config
6273 (lambda* (#:key target #:allow-other-keys)
6274 (substitute* "Makefile"
6275 (("pkg-config" command)
6276 (string-append target "-" command))))))
6277 #~())
6278 (add-before 'build 'patch-Makefile
6279 (lambda _
6280 (substitute* "Makefile"
6281 (("ldconfig") "true"))))
6282 (add-before 'build 'set-regulatory-db-file-name
6283 (lambda* (#:key native-inputs inputs #:allow-other-keys)
6284 ;; Tell CRDA where to find our database.
6285 (let ((regdb (assoc-ref (or native-inputs inputs)
6286 "wireless-regdb")))
6287 (substitute* "crda.c"
6288 (("\"/lib/crda/regulatory.bin\"")
6289 (string-append "\"" regdb
6290 "/lib/crda/regulatory.bin\"")))))))
6291 #:test-target "verify"
6292 #:make-flags
6293 #~(list
6294 (string-append "CC=" #$(cc-for-target))
6295 "V=1"
6296
6297 ;; Disable signature-checking on 'regulatory.bin'.
6298 ;; The reason is that this simplifies maintenance
6299 ;; on our side (no need to manage a distro key
6300 ;; pair), and we can guarantee integrity of
6301 ;; 'regulatory.bin' by other means anyway, such as
6302 ;; 'guix gc --verify'. See
6303 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
6304 ;; for a discssion.
6305 "USE_OPENSSL=0"
6306
6307 (string-append "PREFIX=" #$output)
6308 (string-append "SBINDIR=" #$output "/sbin/")
6309 (string-append "UDEV_RULE_DIR="
6310 #$output "/lib/udev/rules.d")
6311 (string-append "LDFLAGS=-Wl,-rpath="
6312 #$output "/lib -L.")
6313 (string-append "REG_BIN="
6314 #$(this-package-native-input "wireless-regdb")
6315 "/lib/crda/regulatory.bin")
6316 "all_noverify")))
6317 (native-inputs (list pkg-config wireless-regdb))
6318 (inputs (list libnl))
6319 (home-page
6320 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
6321 (synopsis "@acronym{CRDA, Central Regulatory Domain Agent} for WiFi")
6322 (description
6323 "The @acronym{CRDA, Central Regulatory Domain Agent} acts as the udev
6324helper for communication between the kernel Linux and user space for regulatory
6325compliance.")
6326 (license license:copyleft-next)))
6327
6328(define-public wireless-regdb
6329 (package
6330 (name "wireless-regdb")
6331 (version "2023.05.03")
6332 (source (origin
6333 (method url-fetch)
6334 (uri (string-append
6335 "mirror://kernel.org/software/network/wireless-regdb/"
6336 "wireless-regdb-" version ".tar.xz"))
6337 (sha256
6338 (base32 "04lc9jp8zxhyqxvkhrm637sswi2xm48jw8jnp3iflnknnf5d0m7j"))
6339
6340 ;; We're building 'regulatory.bin' by ourselves.
6341 (snippet '(begin
6342 (delete-file "regulatory.bin")))))
6343 (build-system gnu-build-system)
6344 (arguments
6345 (list
6346 #:phases
6347 #~(modify-phases %standard-phases
6348 (add-after 'unpack 'gzip-determinism
6349 (lambda _
6350 (substitute* "Makefile"
6351 (("gzip") "gzip --no-name"))))
6352 (add-after 'unpack 'omit-signature
6353 (lambda _
6354 (substitute* "Makefile"
6355 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
6356 ;; don't provide (see below). Disable it.
6357 ((" regulatory\\.db\\.p7s") "")
6358 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
6359 ;; but ‘make install’ depends only on the latter while
6360 ;; installing both (and failing). Depend on it explicitly.
6361 (("^install: " all) (string-append all "regulatory.db ")))))
6362 (delete 'configure)) ; no configure script
6363
6364 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
6365 ;; is computed and can be equal to 'maintainer-clean'; when that
6366 ;; happens, we can end up deleting the 'regulatory.bin' file that we
6367 ;; just built. Thus, build things sequentially.
6368 #:parallel-build? #f
6369
6370 #:tests? #f ; no tests
6371 #:make-flags
6372 #~(list (string-append "PREFIX=" #$output)
6373 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
6374
6375 ;; Leave this empty so that db2bin.py doesn't try to sign
6376 ;; ‘regulatory.bin’. This allows us to avoid managing a key
6377 ;; pair for the whole distribution.
6378 (string-append "REGDB_PRIVKEY=")
6379 ;; Don't generate a public key for the same reason. These are
6380 ;; used as Makefile targets and can't be the empty string.
6381 (string-append "REGDB_PUBCERT=/dev/null")
6382 (string-append "REGDB_PUBKEY=/dev/null"))))
6383 (native-inputs
6384 (list python-wrapper))
6385 (home-page
6386 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
6387 (synopsis "Wireless regulatory database")
6388 (description
6389 "This package contains the wireless regulatory database for the
6390@acronym{CRDA, Central Regulatory Database Agent}. The database contains
6391information on country-specific regulations for the wireless spectrum.")
6392 (license license:isc)))
6393
6394(define-public lm-sensors
6395 (package
6396 (name "lm-sensors")
6397 (version "3.6.2")
6398 (source
6399 (origin
6400 (method git-fetch)
6401 (uri (git-reference
6402 (url "https://github.com/hramrach/lm-sensors")
6403 (commit (string-append "V" (string-join
6404 (string-split version #\.) "-")))))
6405 (file-name (git-file-name name version))
6406 (sha256
6407 (base32 "0p2ck8p9zb1w53l37pvm6c10vi6r8bfz51nd3sdwwsfhfhgvsr0j"))
6408 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
6409 (build-system gnu-build-system)
6410 (outputs '("lib" ; avoid perl in closure
6411 "out"))
6412 (arguments
6413 (list
6414 #:tests? #f ; no 'check' target
6415 #:make-flags
6416 #~(list (string-append "PREFIX=" #$output)
6417 (string-append "ETCDIR=" #$output:lib "/etc")
6418 (string-append "INCLUDEDIR=" #$output:lib "/include")
6419 (string-append "MANDIR=" #$output "/share/man")
6420 (string-append "LIBDIR=" #$output:lib "/lib"))
6421 #:phases
6422 #~(modify-phases %standard-phases
6423 (delete 'configure)
6424 (add-before 'build 'patch-exec-paths
6425 (lambda* (#:key inputs #:allow-other-keys)
6426 (substitute* "prog/detect/sensors-detect"
6427 (("`uname")
6428 (string-append
6429 "`" (assoc-ref inputs "coreutils") "/bin/uname"))
6430 (("(`|\")modprobe" all open-quote)
6431 (string-append
6432 open-quote #$(this-package-input "kmod") "/bin/modprobe")))
6433 (substitute* '("prog/pwm/pwmconfig" "prog/pwm/fancontrol")
6434 (("gnuplot")
6435 (search-input-file inputs "/bin/gnuplot"))
6436 (("cat ")
6437 (string-append (search-input-file inputs "/bin/cat") " "))
6438 (("e?grep " match)
6439 (string-append
6440 (search-input-file
6441 inputs (string-append "/bin/" (string-trim-right match)))
6442 " "))
6443 (("sed -e")
6444 (string-append (search-input-file inputs "/bin/sed") " -e"))
6445 (("cut -d")
6446 (string-append (search-input-file inputs "/bin/cut") " -d"))
6447 (("sleep ")
6448 (string-append (search-input-file inputs "/bin/sleep") " "))
6449 (("readlink -f")
6450 (string-append
6451 (search-input-file inputs "/bin/readlink") " -f"))))))))
6452 (inputs
6453 (list gnuplot kmod perl rrdtool))
6454 (native-inputs
6455 (list bison flex pkg-config which))
6456 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
6457 (synopsis "Utilities to read temperature/voltage/fan sensors")
6458 (description
6459 "Lm-sensors is a hardware health monitoring package for Linux. It allows
6460you to access information from temperature, voltage, and fan speed sensors.
6461It works with most newer systems.")
6462 (license license:gpl2+)))
6463
6464(define-public iucode-tool
6465 (package
6466 (name "iucode-tool")
6467 (version "2.3.1")
6468 (source (origin
6469 (method url-fetch)
6470 (uri (string-append "https://gitlab.com/iucode-tool/releases"
6471 "/raw/latest/iucode-tool_" version ".tar.xz"))
6472 (sha256
6473 (base32
6474 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
6475 (build-system gnu-build-system)
6476 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
6477 (synopsis "Manipulate Intel microcode bundles")
6478 (description
6479 "@command{iucode_tool} is a utility to work with microcode packages for
6480Intel processors. It can convert between formats, extract specific versions,
6481create a firmware image suitable for the Linux kernel, and more.")
6482 ;; cpuid.h is available for i686, x86_64, and ia64.
6483 (supported-systems '("i686-linux" "x86_64-linux"))
6484 (license license:gpl2+)))
6485
6486(define-public i2c-tools
6487 (package
6488 (name "i2c-tools")
6489 (version "4.3")
6490 (source (origin
6491 (method url-fetch)
6492 (uri (string-append
6493 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6494 version ".tar.xz"))
6495 (sha256
6496 (base32
6497 "1y0fphjd5ah2j886x8i175r7viq0hmx666hyca0wi4dzrm290qxk"))))
6498 (build-system gnu-build-system)
6499 (arguments
6500 `(#:tests? #f ; no 'check' target
6501 #:make-flags
6502 ,#~(list (string-append "PREFIX=" #$output)
6503 (string-append "LDFLAGS+=-Wl,-rpath=" #$output "/lib")
6504 (string-append "CC=" #$(cc-for-target)))
6505 ;; No configure script.
6506 #:phases (modify-phases %standard-phases (delete 'configure))))
6507 (inputs
6508 (list perl))
6509 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
6510 (synopsis "I2C tools for Linux")
6511 (description
6512 "The i2c-tools package contains a heterogeneous set of I2C tools for
6513Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
6514EEPROM decoding scripts, EEPROM programming tools, and a python module for
6515SMBus access.")
6516 (license license:gpl2+)))
6517
6518(define-public i2c-tools-3
6519 (package
6520 (inherit i2c-tools)
6521 (name "i2c-tools")
6522 (version "3.1.2")
6523 (source (origin
6524 (method url-fetch)
6525 (uri (string-append
6526 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
6527 version ".tar.bz2"))
6528 (sha256
6529 (base32 "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv"))))
6530 (arguments
6531 (substitute-keyword-arguments (package-arguments i2c-tools)
6532 ((#:make-flags _)
6533 #~(list (string-append "prefix=" #$output)
6534 (string-append "CC=" #$(cc-for-target))))))))
6535
6536(define-public python-smbus
6537 (package
6538 (inherit i2c-tools)
6539 (name "python-smbus")
6540 (build-system pyproject-build-system)
6541 (arguments
6542 (list #:tests? #f ;; No test suite.
6543 #:phases
6544 #~(modify-phases %standard-phases
6545 (add-after 'unpack 'change-directory
6546 (lambda _ (chdir "py-smbus")))
6547 (add-after 'change-directory 'set-library-path
6548 (lambda _
6549 (substitute* "setup.py"
6550 (("-L\\.\\./lib")
6551 (string-append "-L" #$(this-package-input "i2c-tools")
6552 "/lib"))))))))
6553 (inputs (list i2c-tools))
6554 (native-inputs (list python-setuptools python-wheel))
6555 (synopsis "I2C/SMBus access for Python")
6556 (description "This package provides a Python library to access
6557@acronym{I2C, Inter-Integrated Circuit} and @acronym{SMBus, System
6558Management Bus} devices on Linux.")))
6559
6560(define-public xsensors
6561 (package
6562 (name "xsensors")
6563 (version "0.70")
6564 (source (origin
6565 (method url-fetch)
6566 (uri (string-append
6567 "http://www.linuxhardware.org/xsensors/xsensors-"
6568 version ".tar.gz"))
6569 (sha256
6570 (base32
6571 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
6572 (build-system gnu-build-system)
6573 (inputs `(("lm-sensors" ,lm-sensors "lib")
6574 ("gtk" ,gtk+-2)))
6575 (native-inputs (list pkg-config))
6576 (arguments
6577 `(#:phases
6578 (modify-phases %standard-phases
6579 (add-before 'configure 'enable-deprecated
6580 (lambda _
6581 (substitute* "src/Makefile.in"
6582 (("-DGDK_DISABLE_DEPRECATED") "")
6583 (("-DGTK_DISABLE_DEPRECATED") ""))
6584 #t))
6585 (add-before 'configure 'remove-Werror
6586 (lambda _
6587 (substitute* '("configure" "src/Makefile.in")
6588 (("-Werror") ""))
6589 #t)))))
6590 (home-page "http://www.linuxhardware.org/xsensors/")
6591 (synopsis "Hardware health information viewer")
6592 (description
6593 "Xsensors reads data from the libsensors library regarding hardware
6594health such as temperature, voltage and fan speed and displays the information
6595in a digital read-out.")
6596 (license license:gpl2+)))
6597
6598(define-public perf
6599 (package
6600 (name "perf")
6601 (version (package-version linux-libre))
6602 (source (package-source linux-libre))
6603 (build-system gnu-build-system)
6604 (arguments
6605 '(#:phases
6606 (modify-phases %standard-phases
6607 (replace 'configure
6608 (lambda* (#:key inputs #:allow-other-keys)
6609 (setenv "SHELL_PATH" (which "bash"))
6610 (chdir "tools/perf")
6611
6612 ;; In Linux 6.10.6, 'Makefile.config' overrides PKG_CONFIG_PATH
6613 ;; when looking for libtraceevent and thus fails to find it.
6614 ;; Remove that.
6615 (substitute* "Makefile.config"
6616 (("PKG_CONFIG_PATH=[[:graph:]]+")
6617 ""))
6618
6619 ;; This file hard-codes file system layouts for specific distros
6620 ;; but not for ours; address that. With this change, one can run
6621 ;; "perf report --symfs=$HOME/.guix-profile" (without
6622 ;; "/lib/debug") and 'perf' should be able to find separate debug
6623 ;; info files.
6624 (substitute* "util/dso.c"
6625 (("/usr/lib/debug")
6626 "/lib/debug")))))
6627 #:make-flags (list (string-append "prefix="
6628 (assoc-ref %outputs "out"))
6629 "CC=gcc"
6630 "WERROR=0"
6631
6632 ;; By default, 'config/Makefile' uses lib64 on
6633 ;; x86_64. Work around that.
6634 "lib=lib")
6635 #:tests? #f)) ;no tests
6636 (native-inputs
6637 (list pkg-config
6638 bison
6639 flex
6640 ;; There are build scripts written in these languages.
6641 perl
6642 python-2
6643 python-3
6644 ;; Documentation
6645 docbook-xsl
6646 xmlto
6647 asciidoc))
6648 (inputs
6649 (list slang ;for the interactive TUI
6650 zlib
6651 ;; newt
6652 python-2 ;'perf' links against libpython
6653 elfutils
6654 libiberty ;used alongside BDF for symbol demangling
6655 libunwind ;better stack walking
6656 libtraceevent
6657 numactl)) ;for 'perf bench numa mem'
6658 (home-page "https://perf.wiki.kernel.org/")
6659 (synopsis "Linux profiling with performance counters")
6660 (description
6661 "perf is a tool suite for profiling using hardware performance counters,
6662with support in the Linux kernel. perf can instrument CPU performance
6663counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
6664of lightweight profiling. This package contains the user-land tools and in
6665particular the @code{perf} command.")
6666 (license (package-license linux-libre))))
6667
6668(define-public pflask
6669 (package
6670 (name "pflask")
6671 (version "0.2")
6672 (source (origin
6673 (method git-fetch)
6674 (uri (git-reference
6675 (url "https://github.com/ghedo/pflask")
6676 (commit (string-append "v" version))))
6677 (file-name (git-file-name name version))
6678 (sha256
6679 (base32
6680 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
6681 (build-system cmake-build-system)
6682 (arguments
6683 '(#:tests? #f)) ; no tests
6684 (home-page "https://ghedo.github.io/pflask/")
6685 (synopsis "Simple tool for creating Linux namespace containers")
6686 (description "pflask is a simple tool for creating Linux namespace
6687containers. It can be used for running a command or even booting an OS inside
6688an isolated container, created with the help of Linux namespaces. It is
6689similar in functionality to chroot, although pflask provides better isolation
6690thanks to the use of namespaces.")
6691 (license license:bsd-2)))
6692
6693(define-public singularity
6694 (package
6695 (name "singularity")
6696 (version "2.6.1")
6697 (source (origin
6698 (method url-fetch)
6699 (uri (string-append "https://github.com/singularityware/singularity/"
6700 "releases/download/" version
6701 "/singularity-" version ".tar.gz"))
6702 (sha256
6703 (base32
6704 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
6705 (modules '((guix build utils)))
6706 (snippet
6707 '(begin
6708 ;; Do not create directories in /var.
6709 (substitute* "Makefile.in"
6710 (("\\$\\(MAKE\\) .*install-data-hook") ""))
6711
6712 ;; The original source overrides PATH so that it points to
6713 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
6714 ;; on Guix System. Leave PATH unchanged so we refer to the
6715 ;; installed Coreutils, grep, etc.
6716 (substitute* "bin/singularity.in"
6717 (("^PATH=.*" all)
6718 (string-append "#" all "\n")))
6719
6720 (substitute* (find-files "libexec/cli" "\\.exec$")
6721 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
6722 _ program)
6723 (string-append "/run/privileged/bin/singularity-"
6724 program "-helper")))
6725
6726 ;; These squashfs mount options are apparently no longer
6727 ;; supported since Linux-libre 5.4.5.
6728 (substitute* "src/lib/image/squashfs/mount.c"
6729 (("\"errors=remount-ro\"")
6730 "NULL"))))))
6731 (build-system gnu-build-system)
6732 (arguments
6733 (list
6734 #:configure-flags #~(list "--localstatedir=/var")
6735 #:phases
6736 #~(modify-phases %standard-phases
6737 (add-after 'unpack 'patch-references
6738 (lambda _
6739 (substitute* "libexec/cli/build.exec.in"
6740 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
6741 (substitute* (append
6742 (find-files "libexec" "functions")
6743 (find-files "libexec/bootstrap-scripts" ".*sh$")
6744 (find-files "libexec/cli" ".*exec$"))
6745 (("\\| grep ")
6746 (string-append "| " (which "grep") " "))
6747 (("egrep ")
6748 (string-append (which "egrep") " "))
6749 ((" sed ")
6750 (string-append " " (which "sed") " ")))))
6751 (add-after 'install 'set-PATH
6752 (lambda _
6753 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
6754 ;; But don't override PATH, so that other tools like zcat and
6755 ;; tar can still be found if they are available.
6756 (let ((coreutils #$(this-package-input "coreutils")))
6757 (wrap-program (string-append #$output "/bin/singularity")
6758 `("PATH" prefix (,(string-append coreutils "/bin"))))
6759 (substitute* (string-append #$output "/bin/run-singularity")
6760 (("/usr/bin/env singularity")
6761 (string-append (which "env") " "
6762 #$output "/bin/singularity")))))))))
6763 (inputs
6764 (list bash-minimal
6765 coreutils
6766 libarchive
6767 python-wrapper
6768 squashfs-tools
6769 zlib))
6770 (home-page "https://singularity.lbl.gov/")
6771 (synopsis "Container platform")
6772 (description "Singularity is a container platform supporting a number of
6773container image formats. It can build SquashFS container images or import
6774existing Docker images. Singularity requires kernel support for container
6775isolation or root privileges.")
6776 (license license:bsd-3)))
6777
6778(define-public python-spython
6779 (package
6780 (name "python-spython")
6781 (version "0.3.13")
6782 (source
6783 (origin
6784 (method url-fetch)
6785 (uri (pypi-uri "spython" version))
6786 (sha256
6787 (base32 "0kly851k6mj7xzcybciav5d0pq5q04pzg7c5a1g712bqbxkha4ck"))))
6788 (build-system pyproject-build-system)
6789 (arguments
6790 (list
6791 #:phases
6792 #~(modify-phases %standard-phases
6793 ;; Configure absolute path to singularity.
6794 (add-after 'unpack 'configure
6795 (lambda* (#:key inputs #:allow-other-keys)
6796 (let ((singularity (search-input-file inputs "bin/singularity")))
6797 (substitute* "spython/utils/terminal.py"
6798 (("software=\"singularity\"")
6799 (string-append "software=\"" singularity "\"")))
6800 (substitute* (list "spython/utils/terminal.py"
6801 "spython/main/help.py"
6802 "spython/main/base/command.py")
6803 (("\\[\"singularity\"")
6804 (string-append "[\"" singularity "\"")))
6805 (substitute* "spython/main/execute.py"
6806 (("shutil.which\\(\"singularity\"\\)")
6807 (string-append "shutil.which(\"" singularity "\")"))))))
6808 ;; Skip tests that require network access.
6809 (add-before 'check 'skip-tests
6810 (lambda _
6811 (delete-file "spython/tests/test_client.py"))))))
6812 (inputs
6813 (list singularity))
6814 (native-inputs
6815 (list python-pytest
6816 python-pytest-runner
6817 python-setuptools
6818 python-wheel))
6819 (home-page "https://github.com/singularityhub/singularity-cli")
6820 (synopsis "Singularity Python client")
6821 (description "@code{python-spython} is a Python library to interact with
6822Singularity containers.")
6823 (license license:mpl2.0)))
6824
6825(define-public libnvme
6826 (package
6827 (name "libnvme")
6828 (version "1.5")
6829 (source (origin
6830 (method git-fetch)
6831 (uri (git-reference
6832 (url "https://github.com/linux-nvme/libnvme.git")
6833 (commit (string-append "v" version))))
6834 (sha256
6835 (base32 "1wq8bw60l090z2kb717wyzk5wz1jrcn31ykdaa7k9pz9w79v0v67"))
6836 (file-name (git-file-name name version))))
6837 (build-system meson-build-system)
6838 (outputs (list "out" "doc")) ; docs are 80% of all output
6839 (arguments
6840 (list
6841 #:configure-flags
6842 #~(let ((doc (string-append #$output:doc "/share/doc/" #$name)))
6843 (list (string-append "-Dhtmldir=" doc "/html")
6844 (string-append "-Drstdir=" doc "/rst")
6845 "-Ddocs-build=true" "-Ddocs=all"))))
6846 (native-inputs (list pkg-config perl python python-sphinx))
6847 ;; libnvme.pc, libnvme-mi.pc lists these in Requires.private.
6848 (propagated-inputs (list dbus json-c openssl))
6849 (home-page "https://github.com/linux-nvme/libnvme")
6850 (synopsis "C Library for NVM Express on Linux")
6851 (description "libnvme provides type definitions for NVMe specification
6852structures, enumerations, and bit fields, helper functions to construct,
6853dispatch, and decode commands and payloads, and utilities to connect, scan,
6854and manage nvme devices on a Linux system.")
6855 (license license:lgpl2.1+)))
6856
6857(define-public nvme-cli
6858 (package
6859 (name "nvme-cli")
6860 (version "2.5")
6861 (home-page "https://github.com/linux-nvme/nvme-cli")
6862 (source (origin
6863 (method git-fetch)
6864 (uri (git-reference
6865 (url home-page)
6866 (commit (string-append "v" version))))
6867 (sha256
6868 (base32 "1jv1xir6gm86yyk5846qqkcjhc1bq103zyxf794fznyinh4nhlbg"))
6869 (file-name (git-file-name name version))))
6870 (build-system meson-build-system)
6871 (outputs (list "out" "doc")) ; docs make up ~70% of total size
6872 (arguments
6873 (list
6874 #:configure-flags #~(list (format #f "-Dhtmldir=~a/share/doc/~a/html"
6875 #$output:doc #$name)
6876 "-Ddocs=all")))
6877 (native-inputs (list pkg-config))
6878 (inputs (list libnvme json-c zlib))
6879 (synopsis "NVM-Express user space tooling for Linux")
6880 (description "Nvme-cli is a utility to provide standards compliant tooling
6881for NVM-Express drives. It was made specifically for Linux as it relies on the
6882IOCTLs defined by the mainline kernel driver.")
6883 (license license:gpl2+)))
6884
6885(define-public rfkill
6886 (package
6887 (name "rfkill")
6888 (version "0.5")
6889 (source (origin
6890 (method url-fetch)
6891 (uri (string-append "mirror://kernel.org/software/network/"
6892 name "/" name "-" version ".tar.xz"))
6893 (sha256
6894 (base32
6895 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
6896 (build-system gnu-build-system)
6897 (arguments
6898 `(#:make-flags (list "CC=gcc"
6899 (string-append "PREFIX=" %output))
6900 #:phases (modify-phases %standard-phases
6901 (delete 'configure))
6902 #:tests? #f))
6903 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
6904 (synopsis "Tool for enabling and disabling wireless devices")
6905 (description
6906 "rfkill is a simple tool for accessing the rfkill device interface,
6907which is used to enable and disable wireless networking devices, typically
6908WLAN, Bluetooth and mobile broadband.")
6909 (license (license:non-copyleft "file://COPYING"
6910 "See COPYING in the distribution."))
6911 ;; rfkill is part of util-linux as of 2.31.
6912 (properties `((superseded . ,util-linux)))))
6913
6914(define-public acpi
6915 (package
6916 (name "acpi")
6917 (version "1.7")
6918 (source (origin
6919 (method url-fetch)
6920 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
6921 version "/" name "-" version ".tar.gz"))
6922 (sha256
6923 (base32
6924 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
6925 (build-system gnu-build-system)
6926 (home-page "http://acpiclient.sourceforge.net")
6927 (synopsis "Display information on ACPI devices")
6928 (description "@code{acpi} attempts to replicate the functionality of the
6929\"old\" @code{apm} command on ACPI systems, including battery and thermal
6930information. It does not support ACPI suspending, only displays information
6931about ACPI devices.")
6932 (license license:gpl2+)))
6933
6934(define-public acpid
6935 (package
6936 (name "acpid")
6937 (version "2.0.34")
6938 (source (origin
6939 (method url-fetch)
6940 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
6941 version ".tar.xz"))
6942 (sha256
6943 (base32
6944 "0cxkdbd087kj9ikprvvjpk0ixzqbipf2rmj6qyp7r15wzj65q29d"))))
6945 (build-system gnu-build-system)
6946 (home-page "https://sourceforge.net/projects/acpid2/")
6947 (synopsis "Daemon for delivering ACPI events to user-space programs")
6948 (description
6949 "acpid is designed to notify user-space programs of Advanced
6950Configuration and Power Interface (ACPI) events. acpid should be started
6951during the system boot, and will run as a background process. When an ACPI
6952event is received from the kernel, acpid will examine the list of rules
6953specified in /etc/acpi/events and execute the rules that match the event.")
6954 (license license:gpl2+)))
6955
6956(define-public sysfsutils
6957 (package
6958 (name "sysfsutils")
6959 (version "2.1.0")
6960 (source
6961 (origin
6962 (method url-fetch)
6963 (uri
6964 (string-append
6965 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
6966 version ".tar.gz"))
6967 (sha256
6968 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
6969 (build-system gnu-build-system)
6970 (home-page "https://linux-diag.sourceforge.net/Sysfsutils.html")
6971 (synopsis "System utilities based on Linux sysfs")
6972 (description
6973 "These are a set of utilities built upon sysfs, a virtual file system in
6974Linux kernel versions 2.5+ that exposes a system's device tree. The package
6975also contains the libsysfs library.")
6976 ;; The library is under lgpl2.1+ (all files say "or any later version").
6977 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
6978 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
6979
6980(define-public cpufrequtils
6981 (let ((commit "a2f0c39d5f21596bb9f5223e895c0ff210b265d0")
6982 (revision "1"))
6983 (package
6984 (name "cpufrequtils")
6985 (version (git-version "008" revision commit ))
6986 (source
6987 (origin
6988 (method git-fetch)
6989 (uri
6990 (git-reference
6991 (url "https://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpufrequtils.git")
6992 (commit commit)))
6993 (file-name (git-file-name name version))
6994 (sha256
6995 (base32 "01n2hp6v89cilqqvqvlcprphyhnljsjclh4h1zf3b1l7ypz29lbp"))))
6996 (build-system gnu-build-system)
6997 (arguments
6998 `(#:tests? #f ; no test suite
6999 #:make-flags
7000 (let ((out (assoc-ref %outputs "out")))
7001 (list "PROC=false" ; obsoleted by sysfs in Linux 2.6(!)
7002 (string-append "CC=" ,(cc-for-target))
7003 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
7004 "INSTALL=install"
7005 (string-append "bindir=" out "/bin")
7006 (string-append "sbindir=" out "/sbin")
7007 (string-append "mandir=" out "/share/man")
7008 (string-append "includedir=" out "/include")
7009 (string-append "libdir=" out "/lib")
7010 (string-append "localedir=" out "/share/locale")
7011 (string-append "docdir=" out "/share/doc/" ,name)))
7012 #:phases
7013 (modify-phases %standard-phases
7014 (delete 'configure)))) ; no configure script
7015 (native-inputs
7016 `(("gettext" ,gettext-minimal)))
7017 (home-page
7018 "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
7019 (synopsis "Utilities to get and set CPU frequency on Linux")
7020 (description
7021 "The cpufrequtils suite contains utilities to retrieve CPU frequency
7022information, and set the CPU frequency if supported, using the cpufreq
7023capabilities of the Linux kernel.")
7024 (license license:gpl2))))
7025
7026(define-public libite
7027 (package
7028 (name "libite")
7029 (version "2.5.2")
7030 (source
7031 (origin
7032 (method git-fetch)
7033 (uri (git-reference
7034 (url "https://github.com/troglobit/libite")
7035 (commit (string-append "v" version))))
7036 (file-name (git-file-name name version))
7037 (sha256
7038 (base32 "0i27ppb557kdc1hm7nf0f5r7sxvqma31pr57h79whl6qcp28gy4a"))))
7039 (build-system gnu-build-system)
7040 (arguments
7041 `(#:configure-flags
7042 (list "--disable-static")
7043 #:phases
7044 (modify-phases %standard-phases
7045 (add-after 'unpack 'fix-tests
7046 (lambda* (#:key inputs #:allow-other-keys)
7047 ;; replace paths to the executables
7048 (substitute* "test/which.c"
7049 (("/usr/bin/which")
7050 (search-input-file inputs "/bin/which"))
7051 (("ls\"")
7052 (string-append
7053 (search-input-file inputs "/bin/ls") "\"")))
7054 ;; create pidfile in /tmp instead of /var
7055 (substitute* "test/pidfile.c" (("/var/tmp") "/tmp")))))))
7056 (native-inputs (list autoconf automake libtool which))
7057 (synopsis "Library providing missing pieces in GNU libc")
7058 (description "This package provides many of the missing pieces in GNU
7059libc. Most notably the string functions: strlcpy(3), strlcat(3) and the *BSD
7060sys/queue.h and sys/tree.h API's.")
7061 (home-page "https://troglobit.com/projects/libite/")
7062 (license license:expat)))
7063
7064(define-public libuev
7065 (package
7066 (name "libuev")
7067 (version "2.4.0")
7068 (source
7069 (origin
7070 (method git-fetch)
7071 (uri (git-reference
7072 (url "https://github.com/troglobit/libuev")
7073 (commit (string-append "v" version))))
7074 (file-name (git-file-name name version))
7075 (sha256
7076 (base32
7077 "0ih82lxfdcq179kknzdl5c8vi1l0n5j7yh68y8f6kwsrm457paf7"))))
7078 (build-system gnu-build-system)
7079 (native-inputs (list autoconf automake libtool))
7080 (synopsis "Lightweight event loop library for epoll family APIs")
7081 (description "This package provides small event loop that wraps the
7082epoll family of APIs.")
7083 (home-page "https://troglobit.com/projects/libuev/")
7084 (license license:expat)))
7085
7086(define-public libraw1394
7087 (package
7088 (name "libraw1394")
7089 (version "2.1.2")
7090 (source (origin
7091 (method url-fetch)
7092 (uri (string-append
7093 "mirror://kernel.org/linux/libs/ieee1394/"
7094 name "-" version ".tar.xz"))
7095 (sha256
7096 (base32
7097 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
7098 (build-system gnu-build-system)
7099 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7100 (synopsis "Interface library for the Linux IEEE1394 drivers")
7101 (description
7102 "Libraw1394 is the only supported interface to the kernel side raw1394 of
7103the Linux IEEE-1394 subsystem, which provides direct access to the connected
71041394 buses to user space. Through libraw1394/raw1394, applications can directly
7105send to and receive from other nodes without requiring a kernel driver for the
7106protocol in question.")
7107 (license license:lgpl2.1+)))
7108
7109(define-public libavc1394
7110 (package
7111 (name "libavc1394")
7112 (version "0.5.4")
7113 (source (origin
7114 (method url-fetch)
7115 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
7116 name "-" version ".tar.gz"))
7117 (sha256
7118 (base32
7119 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
7120 (build-system gnu-build-system)
7121 (native-inputs
7122 (list pkg-config))
7123 (propagated-inputs
7124 (list libraw1394)) ; required by libavc1394.pc
7125 (home-page "https://sourceforge.net/projects/libavc1394/")
7126 (synopsis "AV/C protocol library for IEEE 1394")
7127 (description
7128 "Libavc1394 is a programming interface to the AV/C specification from
7129the 1394 Trade Association. AV/C stands for Audio/Video Control.")
7130 (license license:lgpl2.1+)))
7131
7132(define-public libiec61883
7133 (package
7134 (name "libiec61883")
7135 (version "1.2.0")
7136 (source (origin
7137 (method url-fetch)
7138 (uri (string-append
7139 "mirror://kernel.org/linux/libs/ieee1394/"
7140 name "-" version ".tar.xz"))
7141 (sha256
7142 (base32
7143 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
7144 (build-system gnu-build-system)
7145 (native-inputs
7146 (list pkg-config))
7147 (propagated-inputs
7148 (list libraw1394)) ; required by libiec61883.pc
7149 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
7150 (synopsis "Isochronous streaming media library for IEEE 1394")
7151 (description
7152 "The libiec61883 library provides a higher level API for streaming DV,
7153MPEG-2 and audio over Linux IEEE 1394.")
7154 (license license:lgpl2.1+)))
7155
7156(define-public mdadm
7157 (package
7158 (name "mdadm")
7159 (version "4.2")
7160 (source (origin
7161 (method url-fetch)
7162 (uri (string-append
7163 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
7164 version ".tar.xz"))
7165 (sha256
7166 (base32
7167 "07ghmibmbnkdy91ng87zdllzicm299l20dhs9m5bfjw6f1b22726"))))
7168 (build-system gnu-build-system)
7169 (arguments
7170 (list #:make-flags
7171 #~(list (string-append "CC=" #$(cc-for-target))
7172 "INSTALL=install"
7173 "CHECK_RUN_DIR=0"
7174 ;; TODO: tell it where to find 'sendmail'
7175 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
7176 (string-append "BINDIR=" #$output "/sbin")
7177 (string-append "MANDIR=" #$output "/share/man")
7178 (string-append "UDEVDIR=" #$output "/lib/udev"))
7179 #:phases
7180 #~(modify-phases %standard-phases
7181 (add-before 'build 'patch-program-paths
7182 (lambda* (#:key native-inputs inputs #:allow-other-keys)
7183 (let ((coreutils (assoc-ref (or native-inputs inputs)
7184 "coreutils")))
7185 (substitute* "udev-md-raid-arrays.rules"
7186 (("/usr/bin/(readlink|basename)" all program)
7187 (string-append coreutils "/bin/" program))))))
7188 (add-before 'build 'remove-W-error
7189 (lambda _
7190 ;; We cannot build with -Werror on i686 due to a
7191 ;; 'sign-compare' warning in util.c.
7192 (substitute* "Makefile"
7193 (("-Werror") ""))))
7194 (delete 'configure))
7195 ;; Tests must be run as root.
7196 #:tests? #f))
7197 (inputs
7198 (list eudev))
7199 (supported-systems (remove target-hurd? %supported-systems))
7200 (home-page "http://neil.brown.name/blog/mdadm")
7201 (synopsis "Tool for managing Linux Software RAID arrays")
7202 (description
7203 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
7204assemble, report on, and monitor arrays. It can also move spares between raid
7205arrays when needed.")
7206 (license license:gpl2+)))
7207
7208(define-public mdadm-static
7209 (package
7210 (inherit mdadm)
7211 (name "mdadm-static")
7212 (arguments
7213 (substitute-keyword-arguments (package-arguments mdadm)
7214 ((#:make-flags flags)
7215 #~(cons* "LDFLAGS = -static"
7216 "CXFLAGS = -DNO_LIBUDEV"
7217 #$flags))
7218 ((#:phases phases)
7219 #~(modify-phases #$phases
7220 (add-after 'install 'remove-cruft
7221 (lambda* (#:key outputs #:allow-other-keys)
7222 (let* ((out (assoc-ref outputs "out"))
7223 (precious? (lambda (file)
7224 (member file '("." ".." "sbin"))))
7225 (directories (scandir out (negate precious?))))
7226 (with-directory-excursion out
7227 (for-each delete-file-recursively directories)
7228 (remove-store-references "sbin/mdadm")
7229 (delete-file "sbin/mdmon")))))))
7230 ((#:modules modules %default-gnu-modules)
7231 `((ice-9 ftw) ,@modules))
7232 ((#:strip-flags _ '())
7233 ''("--strip-all")) ;strip a few extra KiB
7234 ((#:allowed-references _ '("out"))
7235 '("out")))) ;refer only self
7236 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
7237
7238(define-public multipath-tools
7239 (package
7240 (name "multipath-tools")
7241 (version "0.11.0")
7242 (home-page "https://github.com/opensvc/multipath-tools")
7243 (source (origin
7244 (method git-fetch)
7245 (uri (git-reference (url home-page) (commit version)))
7246 (file-name (git-file-name name version))
7247 (sha256
7248 (base32
7249 "1yl2cd4xgw2l5xzx5dbdf7awhrvfbjsrspli9i6bmxc5j4jkvazr"))
7250 (modules '((guix build utils)))
7251 (snippet
7252 '(begin
7253 ;; Drop bundled valgrind headers.
7254 (delete-file-recursively "third-party")
7255 (substitute* '("multipathd/main.c"
7256 "libmpathutil/debug.c")
7257 (("#include \"../third-party/")
7258 "#include \""))))))
7259 (build-system gnu-build-system)
7260 (arguments
7261 (list
7262 #:test-target "test"
7263 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
7264 (string-append "prefix=" #$output)
7265 ;; Install Udev rules below this directory, relative
7266 ;; to the prefix.
7267 (string-append "systemd_prefix=" #$output))
7268 #:phases
7269 #~(modify-phases %standard-phases
7270 (add-after 'unpack 'patch-source
7271 (lambda* (#:key inputs #:allow-other-keys)
7272 (let ((libdevmapper.h
7273 (search-input-file inputs "include/libdevmapper.h"))
7274 (libudev.h
7275 (search-input-file inputs "include/libudev.h")))
7276 (substitute* "Makefile.inc"
7277 (("/bin/echo") "echo")
7278 (("\\$\\(prefix\\)/usr") "$(prefix)")
7279 (("configdir.*:= \\$\\(prefix\\)/etc/multipath/conf.d")
7280 "configdir := /etc/multipath/conf.d")
7281 ;; Do not save timestamp to avoid gzip "timestamp
7282 ;; out-of-range" warnings.
7283 (("gzip -9") "gzip -9n"))
7284 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
7285 (("/usr/include/libdevmapper.h") libdevmapper.h)
7286 (("/usr/include/libudev.h") libudev.h)))))
7287 (add-after 'unpack 'skip-failing-tests
7288 (lambda _
7289 ;; This test and the module's setup() test an arbitrary block
7290 ;; device node name, but the build environment has none.
7291 (substitute* "tests/devt.c"
7292 (("return get_one_devt.*") "return 0;\n")
7293 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
7294 ;; The above triggers -Werror=unused-function. Ignore it.
7295 (substitute* "tests/Makefile"
7296 (("CFLAGS \\+= " match)
7297 (string-append match "-Wno-error=unused-function ")))))
7298 (delete 'configure) ;no configure script
7299 (add-before 'build 'no-fortify-3
7300 (lambda _
7301 ;; NOTE: The check made seems to wrongly assume the
7302 ;; FORTIFY_SOURCE=3 is valid. However, when compiling, warnings
7303 ;; are emitted from glibc, resulting in failed build. Fix this
7304 ;; by forcing the usage of FORTIFY_SOURCE=2.
7305 (substitute* "create-config.mk"
7306 (("FORTIFY_SOURCE=3")
7307 "FORTIFY_SOURCE=2"))))
7308 (add-before 'build 'set-LDFLAGS
7309 (lambda _
7310 ;; Note: this cannot be passed as a make flag because that will
7311 ;; override the build system LDFLAGS.
7312 (setenv "LDFLAGS"
7313 (string-append "-Wl,-rpath=" #$output "/lib")))))))
7314
7315 (native-inputs
7316 (list perl pkg-config valgrind/pinned
7317 ;; For tests.
7318 cmocka))
7319 (inputs
7320 (list json-c
7321 libaio
7322 liburcu
7323 lvm2
7324 readline
7325 eudev
7326 ;; For libmount.
7327 `(,util-linux "lib")))
7328 (synopsis "Access block devices through multiple paths")
7329 (description
7330 "This package provides the following binaries to drive the
7331Linux Device Mapper multipathing driver:
7332@enumerate
7333@item @command{multipath} - Device mapper target autoconfig.
7334@item @command{multipathd} - Multipath daemon.
7335@item @command{mpathpersist} - Manages SCSI persistent reservations on
7336@code{dm} multipath devices.
7337@item @command{kpartx} - Create device maps from partition tables.
7338@end enumerate")
7339 (license (list license:gpl2+ ;main distribution
7340 license:lgpl2.0+)))) ;libmpathcmd/mpath_cmd.h
7341
7342(define-public libaio
7343 (package
7344 (name "libaio")
7345 (version "0.3.113")
7346 (source (origin
7347 (method url-fetch)
7348 (uri (list
7349 (string-append "https://releases.pagure.org/libaio/"
7350 name "-" version ".tar.gz")))
7351 (sha256
7352 (base32
7353 "02r0g2vfv6kfljplm3ga93w4xw13q2wixbn9hwi7ahqdzp2x2i1c"))
7354 (patches (search-patches "libaio-32bit-test.patch"))))
7355 (build-system gnu-build-system)
7356 (arguments
7357 (list #:make-flags
7358 #~(list (string-append "prefix=" #$output)
7359 (string-append "CC=" #$(cc-for-target)))
7360 #:test-target "partcheck" ; need root for a full 'check'
7361 #:phases
7362 #~(modify-phases %standard-phases
7363 (add-after 'unpack 'disable-problematic-tests
7364 (lambda _
7365 (with-directory-excursion "harness/cases"
7366 ;; The 21.t test fails with "Expected 4096, got
7367 ;; 18446744073709551605" (see:
7368 ;; https://pagure.io/libaio/issue/26).
7369 (rename-file "21.t" "21.t.disabled"))))
7370 (delete 'configure) ; no configure script
7371 #$@(if (target-riscv64?)
7372 #~((add-after 'unpack 'patch-test
7373 (lambda* (#:key build-inputs #:allow-other-keys)
7374 (invoke "patch" "-p1" "-i"
7375 #$(local-file
7376 (search-patch
7377 "libaio-riscv-test5.patch"))))))
7378 #~()))))
7379 (native-inputs
7380 (if (target-riscv64?)
7381 (list (search-patch "libaio-riscv-test5.patch")
7382 patch)
7383 '()))
7384 (home-page "https://pagure.io/libaio")
7385 (synopsis "Linux-native asynchronous I/O access library")
7386 (description
7387 "This library enables userspace to use Linux kernel asynchronous I/O
7388system calls, important for the performance of databases and other advanced
7389applications.")
7390 (license license:lgpl2.1+)))
7391
7392(define-public blktrace
7393 ;; Take a newer commit to get the latest patches.
7394 (let ((commit "b9ea6e507e8849f01d06aa48c0c59c5cee4820be")
7395 (revision "1"))
7396 (package
7397 (name "blktrace")
7398 (version (git-version "1.3.0" revision commit))
7399 (home-page
7400 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
7401 (source (origin
7402 (method git-fetch)
7403 (uri (git-reference
7404 (url home-page)
7405 (commit commit)))
7406 (sha256
7407 (base32 "0a4830mlqckbhchar1xcn2w4f24bzb75bigdig5wpm2axl0zc8cq"))
7408 (file-name (git-file-name name version))))
7409 (build-system gnu-build-system)
7410 (arguments
7411 (list #:make-flags
7412 #~(list (string-append "CC=" #$(cc-for-target))
7413 (string-append "prefix=" #$output))
7414 #:tests? #f ; no tests
7415 #:phases
7416 #~(modify-phases %standard-phases
7417 (delete 'configure) ; no configure script
7418 (add-after 'unpack 'fix-gnuplot-path
7419 (lambda* (#:key inputs #:allow-other-keys)
7420 (let ((gnuplot (assoc-ref inputs "gnuplot")))
7421 (substitute* "btt/bno_plot.py"
7422 (("gnuplot %s")
7423 (string-append gnuplot "/bin/gnuplot %s")))))))))
7424 (inputs
7425 `(("libaio" ,libaio)
7426 ("gnuplot" ,gnuplot)
7427 ("python" ,python-wrapper))) ;for 'bno_plot.py'
7428 (synopsis "Block layer IO tracing mechanism")
7429 (description "Blktrace is a block layer IO tracing mechanism which provides
7430detailed information about request queue operations to user space. It extracts
7431event traces from the kernel (via the relaying through the debug file system).")
7432 (license license:gpl2))))
7433
7434(define-public sbc
7435 (package
7436 (name "sbc")
7437 (version "1.5")
7438 (source (origin
7439 (method url-fetch)
7440 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
7441 version ".tar.xz"))
7442 (patches (search-patches "sbc-fix-build-non-x86.patch"))
7443 (sha256
7444 (base32
7445 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
7446 (build-system gnu-build-system)
7447 (inputs
7448 (list libsndfile))
7449 (native-inputs
7450 (list pkg-config))
7451 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
7452 (synopsis "Bluetooth subband audio codec")
7453 (description
7454 "The SBC is a digital audio encoder and decoder used to transfer data to
7455Bluetooth audio output devices like headphones or loudspeakers.")
7456 (license license:gpl2+)))
7457
7458(define-public bluez
7459 (package
7460 (name "bluez")
7461 (version "5.79")
7462 (source (origin
7463 (method url-fetch)
7464 (uri (string-append
7465 "mirror://kernel.org/linux/bluetooth/bluez-"
7466 version ".tar.xz"))
7467 (sha256
7468 (base32
7469 "12pal1m4xlr8k7kxb6isv5lbaca2wc5zcgy0907wfwcz78qaar21"))))
7470 (build-system gnu-build-system)
7471 (arguments
7472 (list
7473 #:configure-flags
7474 #~(list "--sysconfdir=/etc"
7475 "--localstatedir=/var"
7476 "--enable-library"
7477 "--enable-wiimote"
7478 "--disable-systemd"
7479 ;; TODO: is this needed? Not installed by default since 5.55.
7480 "--enable-hid2hci"
7481 ;; Install dbus/udev files to the correct location.
7482 (string-append "--with-dbusconfdir=" #$output "/etc")
7483 (string-append "--with-udevdir=" #$output "/lib/udev"))
7484 #:phases
7485 #~(modify-phases %standard-phases
7486 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
7487 ;; issue (discussion on upstream mailing list:
7488 ;; https://marc.info/?t=149578476300002&r=1&w=2)
7489 (add-before 'check 'skip-wonky-test
7490 (lambda _
7491 (substitute* "unit/test-gatt.c"
7492 (("tester_init\\(&argc, &argv\\);") "return 77;"))))
7493 (replace 'install
7494 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
7495 ;; Override the sysconfdir and localstatedir locations only for
7496 ;; the installation phase. Otherwise, the installation fails when
7497 ;; it tries to write to /etc/bluetooth and /var.
7498 (define make-flags*
7499 (append make-flags (list (string-append "sysconfdir="
7500 #$output "/etc")
7501 (string-append "localstatedir="
7502 #$output "/var"))))
7503 (apply (assoc-ref %standard-phases 'install)
7504 (append args (list #:make-flags make-flags*)))))
7505 (add-after 'install 'post-install
7506 (lambda* (#:key inputs outputs #:allow-other-keys)
7507 (let* ((servicedir (string-append #$output
7508 "/share/dbus-1/services"))
7509 (service "obexd/src/org.bluez.obex.service")
7510 (rule (string-append
7511 #$output "/lib/udev/rules.d/97-hid2hci.rules")))
7512 ;; Install the obex dbus service file.
7513 (substitute* service
7514 (("/bin/false")
7515 (string-append #$output "/libexec/bluetooth/obexd")))
7516 (install-file service servicedir)
7517 ;; Fix paths in the udev rule.
7518 (substitute* rule
7519 (("hid2hci --method")
7520 (string-append #$output "/lib/udev/hid2hci --method"))
7521 (("/sbin/udevadm")
7522 (search-input-file inputs "/bin/udevadm")))))))))
7523 (native-inputs
7524 (list gettext-minimal
7525 pkg-config
7526 python
7527 python-docutils
7528 python-pygments))
7529 (inputs
7530 (list glib dbus eudev libical readline))
7531 (home-page "https://www.bluez.org/")
7532 (synopsis "Linux Bluetooth protocol stack")
7533 (description
7534 "BlueZ provides support for the core Bluetooth layers and protocols. It
7535is flexible, efficient and uses a modular implementation.")
7536 (license license:gpl2+)))
7537
7538(define-public fuse-exfat
7539 (package
7540 (name "fuse-exfat")
7541 (version "1.4.0")
7542 (source (origin
7543 (method url-fetch)
7544 (uri (string-append
7545 "https://github.com/relan/exfat/releases/download/v"
7546 version "/" name "-" version ".tar.gz"))
7547 (sha256
7548 (base32
7549 "07h0ngnydfy8n8h9ni3jn8zlmcj4pzqa0nk0hk0i4yhfbv2yvkx1"))))
7550 (build-system gnu-build-system)
7551 (native-inputs
7552 (list pkg-config))
7553 (inputs
7554 (list fuse-2))
7555 (home-page "https://github.com/relan/exfat")
7556 (synopsis "Mount exFAT file systems")
7557 (description
7558 "This package provides a FUSE-based file system that provides read and
7559write access to exFAT devices.")
7560 (license license:gpl2+)))
7561
7562(define-public fuseiso
7563 (package
7564 (name "fuseiso")
7565 (version "20070708")
7566 (source (origin
7567 (method url-fetch)
7568 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
7569 version "/fuseiso-" version ".tar.bz2"))
7570 (sha256
7571 (base32
7572 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
7573 (build-system gnu-build-system)
7574 (native-inputs
7575 (list pkg-config))
7576 (inputs
7577 (list fuse-2 glib zlib))
7578 (home-page "https://sourceforge.net/projects/fuseiso/")
7579 (synopsis "Mount ISO file system images")
7580 (description
7581 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
7582.bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
7583Ridge, Joliet, and zisofs.")
7584 (license license:gpl2)))
7585
7586(define-public gpm
7587 (package
7588 (name "gpm")
7589 (version "1.20.7")
7590 (source (origin
7591 (method url-fetch)
7592 (uri (string-append
7593 "https://www.nico.schottelius.org/software/gpm/archives/"
7594 "gpm-" version ".tar.bz2"))
7595 (patches (search-patches "gpm-glibc-2.26.patch"))
7596 (sha256
7597 (base32
7598 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
7599 (modules '((guix build utils)))
7600 (snippet
7601 '(begin
7602 ;; Take a patch from upstream to fix building with -fno-common,
7603 ;; which is default in GCC 10:
7604 ;; https://github.com/telmich/gpm/pull/37
7605 (substitute* "src/headers/daemon.h"
7606 (("^time_t[[:blank:]]+last_selection_time;")
7607 "extern time_t last_selection_time;"))))))
7608 (build-system gnu-build-system)
7609 (arguments
7610 '(#:phases (modify-phases %standard-phases
7611 (replace 'bootstrap
7612 (lambda _
7613 ;; The tarball was not generated with 'make dist' so we
7614 ;; need to bootstrap things ourselves.
7615 (substitute* "autogen.sh"
7616 (("/bin/sh") (which "sh")))
7617 (invoke "./autogen.sh")
7618 (patch-makefile-SHELL "Makefile.include.in")
7619 #t)))
7620
7621 ;; Make sure programs find libgpm.so.
7622 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
7623 (assoc-ref %outputs "out")
7624 "/lib"))))
7625 (native-inputs
7626 (list texinfo
7627 bison
7628 flex
7629 autoconf
7630 automake
7631 libtool))
7632 (home-page "https://www.nico.schottelius.org/software/gpm/")
7633 (synopsis "Mouse support for the Linux console")
7634 (description
7635 "The GPM (general-purpose mouse) daemon is a mouse server for
7636applications running on the Linux console. It allows users to select items
7637and copy/paste text in the console and in xterm.")
7638 (license license:gpl2+)))
7639
7640(define-public btrfs-progs
7641 (package
7642 (name "btrfs-progs")
7643 (version "6.16")
7644 (source (origin
7645 (method url-fetch)
7646 (uri (string-append "mirror://kernel.org/linux/kernel/"
7647 "people/kdave/btrfs-progs/" "btrfs-progs-v"
7648 version ".tar.xz"))
7649 (sha256
7650 (base32
7651 "1ibg8qrsxzw4qjnsl5da1qz10m1zv3yx2jxd4jl1h9kwfgw31a9i"))))
7652 (build-system gnu-build-system)
7653 (outputs '("out" "static")) ;static versions of the binaries in "out"
7654 (arguments
7655 (list
7656 #:configure-flags
7657 #~(list
7658 ;; Without --disable-documentation, it complains about missing
7659 ;; python-sphinx on systems where this package isn't available
7660 ;; (because it requires Rust).
7661 #$@(if (member (%current-system)
7662 (package-transitive-supported-systems
7663 python-sphinx))
7664 '()
7665 '("--disable-documentation"))
7666 ;; The ‘Python support’ was never actually installed by previous
7667 ;; versions of this package, but did prevent cross-compilation.
7668 "--disable-python")
7669 #:phases #~(modify-phases %standard-phases
7670 (add-after 'unpack 'patch-makefile
7671 (lambda* (#:key outputs #:allow-other-keys)
7672 (substitute* "Makefile"
7673 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
7674 (string-append (assoc-ref outputs "out")
7675 "/lib/udev/rules.d")))))
7676 (add-after 'build 'build-static
7677 (lambda _
7678 (invoke "make" "static")))
7679 (add-after 'install 'install-bash-completion
7680 (lambda* (#:key outputs #:allow-other-keys)
7681 (let* ((out (assoc-ref outputs "out"))
7682 (bashcomp (string-append out
7683 "/etc/bash_completion.d")))
7684 (mkdir-p bashcomp)
7685 (copy-file "btrfs-completion"
7686 (string-append bashcomp "/btrfs")))))
7687 (add-after 'install 'install-static
7688 (let ((staticbin (string-append (assoc-ref %outputs
7689 "static")
7690 "/bin")))
7691 (lambda _
7692 (invoke "make"
7693 (string-append "bindir=" staticbin)
7694 "install-static")))))
7695 #:tests? #f ;XXX: require the 'btrfs' kernel module.
7696 #:test-target "test"
7697 #:parallel-tests? #f)) ;tests fail when run in parallel
7698 (inputs (list e2fsprogs ;for btrfs-convert
7699 eudev
7700 lzo
7701 `(,util-linux "lib") ;for libblkid and libuuid
7702 `(,util-linux "static") ;ditto
7703 zlib
7704 `(,zlib "static")
7705 `(,zstd "lib")
7706 `(,zstd "static")))
7707 (native-inputs
7708 (append
7709 ;; For building documentation. Since python-sphinx requires Rust, add
7710 ;; it conditionally depending on such support.
7711 (if (supported-package? python-sphinx)
7712 (list python-wrapper python-sphinx python-sphinx-rtd-theme)
7713 '())
7714 (list pkg-config
7715 acl ;for tests
7716 lvm2 ;for dmsetup
7717 grep ;need Perl regexp support
7718 libaio
7719 liburing
7720 util-linux ;for fallocate
7721 which)))
7722 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
7723 (synopsis "Create and manage btrfs copy-on-write file systems")
7724 (description
7725 "Btrfs is a @acronym{CoW, copy-on-write} file system for Linux
7726aimed at implementing advanced features while focusing on fault tolerance,
7727repair and easy administration.")
7728 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
7729 ;; GPL2: Everything else.
7730 (license (list license:gpl2 license:gpl2+))))
7731
7732(define-public btrfs-progs/static
7733 (package
7734 (name "btrfs-progs-static")
7735 (version (package-version btrfs-progs))
7736 (source #f)
7737 (build-system trivial-build-system)
7738 (inputs
7739 `(("btrfs-progs:static" ,btrfs-progs "static")))
7740 (arguments
7741 `(#:modules ((guix build utils))
7742 #:builder
7743 (begin
7744 (use-modules (guix build utils)
7745 (ice-9 ftw)
7746 (srfi srfi-26))
7747
7748 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
7749 (out (assoc-ref %outputs "out"))
7750 (source (string-append btrfs "/bin/btrfs.static"))
7751 (target (string-append out "/bin/btrfs")))
7752 (mkdir-p (dirname target))
7753 (copy-file source target)
7754 (remove-store-references target)
7755 (chmod target #o555)
7756 #t))))
7757 (home-page (package-home-page btrfs-progs))
7758 (synopsis "Statically-linked btrfs command from btrfs-progs")
7759 (description "This package provides the statically-linked @command{btrfs}
7760from the btrfs-progs package. It is meant to be used in initrds.")
7761 (license (package-license btrfs-progs))))
7762
7763(define-public cramfs-tools
7764 (package
7765 (name "cramfs-tools")
7766 (home-page "https://github.com/npitre/cramfs-tools")
7767 (version "2.1")
7768 (source (origin
7769 (method git-fetch)
7770 (uri (git-reference
7771 (url home-page)
7772 (commit (string-append "v" version))))
7773 (sha256
7774 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
7775 (file-name (git-file-name name version))))
7776 (build-system gnu-build-system)
7777 (arguments
7778 '(#:tests? #f ; No tests.
7779 #:phases
7780 (modify-phases %standard-phases
7781 (delete 'configure)
7782 (replace 'install
7783 (lambda* (#:key outputs #:allow-other-keys)
7784 (let ((out (assoc-ref outputs "out")))
7785 (install-file "mkcramfs" (string-append out "/sbin"))
7786 (install-file "cramfsck" (string-append out "/sbin")))
7787 #t)))))
7788 (inputs
7789 (list zlib))
7790 (synopsis "Tools to manage Cramfs file systems")
7791 (description "Cramfs is a Linux file system designed to be simple, small,
7792and to compress things well. It is used on a number of embedded systems and
7793small devices. This version has additional features such as uncompressed
7794blocks and random block placement.")
7795 (license license:gpl2+)))
7796
7797(define-public compsize
7798 (let ((commit "d79eacf77abe3b799387bb8a4e07a18f1f1031e8")
7799 (revision "0"))
7800 (package
7801 (name "compsize")
7802 (version (git-version "1.5" revision commit))
7803 (home-page "https://github.com/kilobyte/compsize")
7804 (source (origin
7805 (method git-fetch)
7806 (uri (git-reference
7807 (url home-page)
7808 (commit commit)))
7809 (sha256
7810 (base32 "02fvgy12m50rg1snp555a1kc3cm01g2imb81cih7ikhkbjbca0d7"))
7811 (file-name (git-file-name name version))
7812 (patches
7813 (search-patches "compsize-fix-btrfs-progs-compatibility.patch"))))
7814 (build-system gnu-build-system)
7815 (inputs
7816 (list btrfs-progs))
7817 (arguments
7818 `(#:tests? #f ; No tests.
7819 #:make-flags
7820 (list (string-append "CC=" ,(cc-for-target)))
7821 #:phases
7822 (modify-phases %standard-phases
7823 (delete 'configure)
7824 (replace 'install
7825 (lambda* (#:key outputs #:allow-other-keys)
7826 (let ((out (assoc-ref outputs "out")))
7827 (install-file "compsize" (string-append out "/bin"))
7828 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
7829 (synopsis "Find compression type/ratio on Btrfs files")
7830 (description "@command{compsize} takes a list of files (given as
7831arguments) on a Btrfs file system and measures used compression types and
7832effective compression ratio, producing a report.
7833
7834A directory has no extents but has a (recursive) list of files. A non-regular
7835file is silently ignored.
7836
7837As it makes no sense to talk about compression ratio of a partial extent,
7838every referenced extent is counted whole, exactly once -- no matter if you use
7839only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
7840uncompressed size will not match the number given by @command{tar} or
7841@command{du}. On the other hand, the space used should be accurate (although
7842obviously it can be shared with files outside our set).")
7843 (license license:gpl2+))))
7844
7845(define-public f2fs-tools
7846 (package
7847 (name "f2fs-tools")
7848 (version "1.16.0")
7849 (source (origin
7850 (method git-fetch)
7851 (uri (git-reference
7852 (url "https://git.kernel.org/pub/scm/linux/kernel\
7853/git/jaegeuk/f2fs-tools.git")
7854 (commit (string-append "v" version))))
7855 (file-name (git-file-name name version))
7856 (sha256
7857 (base32
7858 "0832ix3jnmfagx53wr6clc3q4ay7cbashfj7jirk01gyzwbvblfc"))))
7859 (build-system gnu-build-system)
7860 (native-inputs
7861 (list autoconf automake libtool pkg-config))
7862 (inputs
7863 (list `(,util-linux "lib"))) ;for libuuid
7864 (home-page "https://f2fs.wiki.kernel.org/")
7865 (synopsis "Userland tools for f2fs")
7866 (description
7867 "F2FS, the Flash-Friendly File System, is a modern file system
7868designed to be fast and durable on flash devices such as solid-state
7869disks and SD cards. This package provides the userland utilities.")
7870 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
7871 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
7872 (license (list license:gpl2 license:lgpl2.1))))
7873
7874(define-public f2fs-tools-1.7
7875 (package
7876 (inherit f2fs-tools)
7877 (name "f2fs-tools")
7878 (version "1.7.0")
7879 (source (origin
7880 (method git-fetch)
7881 (uri (git-reference
7882 (url (git-reference-url
7883 (origin-uri (package-source f2fs-tools))))
7884 (commit (string-append "v" version))))
7885 (file-name (git-file-name name version))
7886 (sha256
7887 (base32
7888 "0wpzklw8smnngng0dm25jdmi7v5zfhpz02dksyxpz0a7kzzvnqqm"))))
7889 (inputs
7890 (list `(,util-linux "lib") libselinux))
7891 (arguments
7892 '(#:configure-flags '("CFLAGS=-fcommon")
7893 #:phases
7894 (modify-phases %standard-phases
7895 (add-after 'install 'install-headers
7896 (lambda* (#:key outputs #:allow-other-keys)
7897 (let* ((out (assoc-ref outputs "out"))
7898 (out-include (string-append out "/include")))
7899 (install-file "include/f2fs_fs.h" out-include)
7900 (install-file "mkfs/f2fs_format_utils.h" out-include)))))))))
7901
7902(define-public f2fs-tools/static
7903 (static-package
7904 (package
7905 (inherit f2fs-tools)
7906 (name "f2fs-tools-static")
7907 (arguments
7908 `(#:configure-flags
7909 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
7910 (libuuid (assoc-ref %build-inputs "libuuid")))
7911 (list
7912 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
7913 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
7914 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
7915 "-I" libuuid "/include/blkid")
7916 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
7917 #:disallowed-references (,util-linux)
7918 #:make-flags '("LDFLAGS=-all-static")
7919 #:phases
7920 (modify-phases %standard-phases ; TODO: f2fs phases.
7921 (add-after 'install 'remove-store-references
7922 (lambda* (#:key outputs #:allow-other-keys)
7923 ;; Work around bug in our util-linux.
7924 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
7925 (remove-store-references (string-append (assoc-ref outputs "out")
7926 "/sbin/mkfs.f2fs"))
7927 #t)))))
7928 (inputs
7929 `(("libuuid:static" ,util-linux "static")
7930 ("libuuid" ,util-linux "lib")))))) ; for include files
7931
7932(define-public f2fs-fsck/static
7933 (package
7934 (name "f2fs-fsck-static")
7935 (version (package-version f2fs-tools/static))
7936 (source #f)
7937 (build-system trivial-build-system)
7938 (arguments
7939 `(#:modules ((guix build utils))
7940 #:builder
7941 (begin
7942 (use-modules (guix build utils)
7943 (ice-9 ftw)
7944 (srfi srfi-26))
7945 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
7946 (fsck "fsck.f2fs")
7947 (out (assoc-ref %outputs "out"))
7948 (sbin (string-append out "/sbin")))
7949 (mkdir-p sbin)
7950 (with-directory-excursion sbin
7951 (install-file (string-append f2fs-tools "/sbin/" fsck)
7952 ".")
7953 (remove-store-references fsck)
7954 (chmod fsck #o555))
7955 #t))))
7956 (inputs
7957 (list f2fs-tools/static))
7958 (home-page (package-home-page f2fs-tools/static))
7959 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
7960 (description "This package provides statically-linked fsck.f2fs command taken
7961from the f2fs-tools package. It is meant to be used in initrds.")
7962 (license (package-license f2fs-tools/static))))
7963
7964(define-public freefall
7965 (package
7966 (name "freefall")
7967 (version (package-version linux-libre))
7968 (source (package-source linux-libre))
7969 (build-system gnu-build-system)
7970 (arguments
7971 '(#:phases (modify-phases %standard-phases
7972 (add-after 'unpack 'enter-subdirectory
7973 (lambda _
7974 (chdir "tools/laptop/freefall")
7975 #t))
7976 (delete 'configure)
7977 (add-before 'build 'increase-timeout
7978 (lambda _
7979 ;; The default of 2 seconds is too low: it assumes an
7980 ;; open lid and AC power without actually checking.
7981 (substitute* "freefall.c"
7982 (("alarm\\(2\\)") "alarm(5)"))
7983 #t)))
7984 #:make-flags (list (string-append "PREFIX="
7985 (assoc-ref %outputs "out"))
7986 "CC=gcc")
7987 #:tests? #f)) ;no tests
7988 (home-page (package-home-page linux-libre))
7989 (synopsis "Free-fall protection for spinning laptop hard drives")
7990 (description
7991 "Prevents shock damage to the internal spinning hard drive(s) of some
7992HP and Dell laptops. When sudden movement is detected, all input/output
7993operations on the drive are suspended and its heads are parked on the ramp,
7994where they are less likely to cause damage to the spinning disc. Requires a
7995drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
7996feature, and a laptop with an accelerometer. It has no effect on SSDs.")
7997 (license license:gpl2)))
7998
7999
8000(define-public nbfc-linux
8001 (let ((version "0.1.7")
8002 (commit "4c2b75e4a875459e86a9892319889ff945e9cadf")
8003 (revision "0"))
8004 (package
8005 (name "nbfc-linux")
8006 (version (git-version version revision commit))
8007 (source (origin
8008 (method git-fetch)
8009 (uri (git-reference
8010 (url "https://github.com/nbfc-linux/nbfc-linux")
8011 (commit commit)))
8012 (file-name (git-file-name name version))
8013 (sha256
8014 (base32
8015 "0mmyfaigrh3fd5v11a8p38km4m02qzsfx8yh72g0z405bzhqn5jk"))))
8016 (build-system gnu-build-system)
8017 (arguments
8018 `(#:make-flags (list (string-append "CC="
8019 ,(cc-for-target))
8020 (string-append "PREFIX="
8021 (assoc-ref %outputs "out")))
8022 #:tests? #f
8023 #:phases (modify-phases %standard-phases
8024 (delete 'configure))))
8025 (native-inputs (list pkg-config))
8026 (propagated-inputs (list python dmidecode))
8027 (synopsis "NoteBook FanControl ported to Linux")
8028 (description
8029 "This package provides a C port of NoteBook FanControl (NBFC), a fan
8030control service for notebooks. It provides the same utilities with the same
8031interfaces as the original NBFC, although the implementation differs.")
8032 (home-page "https://github.com/nbfc-linux/nbfc-linux")
8033 (license license:gpl3+))))
8034
8035(define-public thinkfan
8036 (package
8037 (name "thinkfan")
8038 (version "2.0.0")
8039 (source
8040 (origin
8041 (method git-fetch)
8042 (uri (git-reference
8043 (url "https://github.com/vmatare/thinkfan")
8044 (commit version)))
8045 (file-name (git-file-name name version))
8046 (sha256
8047 (base32 "1jdjqdbv0m7yf9g4rxs7nq1ldh2b81a7qx4vcf9lzw7jwlydd822"))))
8048 (build-system cmake-build-system)
8049 (arguments
8050 (list
8051 #:modules '((guix build cmake-build-system)
8052 (guix build utils)
8053 (srfi srfi-26))
8054 #:tests? #f ; no test target
8055 #:configure-flags
8056 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
8057 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
8058 ;; inefficient’.
8059 #~(list "-DUSE_ATASMART:BOOL=ON")
8060 #:phases
8061 #~(modify-phases %standard-phases
8062 (add-after 'unpack 'create-init-scripts
8063 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
8064 ;; systemd to patch and install their service files. Fake their
8065 ;; presence rather than duplicating the build system below. Leave
8066 ;; things like ‘/bin/kill’ because they're not worth a dependency.
8067 ;; The sysvinit needs manual patching, but since upstream doesn't
8068 ;; even provide the option to install it: don't.
8069 (lambda _
8070 (substitute* "CMakeLists.txt"
8071 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
8072 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
8073 ;; That was easy! Now we just need to fix the destinations.
8074 (("/etc" directory)
8075 (string-append #$output directory))))))))
8076 (native-inputs
8077 (list pkg-config))
8078 (inputs
8079 `(("libatasmart" ,libatasmart)
8080 ("lm-sensors" ,lm-sensors "lib")
8081 ("yaml-cpp" ,yaml-cpp)))
8082 (home-page "https://github.com/vmatare/thinkfan")
8083 (synopsis "Simple fan control program")
8084 (description
8085 "Thinkfan is a simple fan control program. It reads temperatures,
8086checks them against configured limits and switches to appropriate (also
8087pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
8088other @code{hwmon} driver that enables temperature reading and fan control
8089from userspace.")
8090 (license license:gpl3+)))
8091
8092(define-public tpacpi-bat
8093 (package
8094 (name "tpacpi-bat")
8095 (version "3.2")
8096 (source
8097 (origin
8098 (method git-fetch)
8099 (uri (git-reference
8100 (url "https://github.com/teleshoes/tpacpi-bat")
8101 (commit (string-append "v" version))))
8102 (file-name (git-file-name name version))
8103 (sha256
8104 (base32 "0nd8s2bqbhl0sjpflphb4l9ix71p7kvnbvkq4dg9a1v0sxafyygm"))))
8105 (build-system gnu-build-system)
8106 (arguments
8107 `(#:tests? #f ; no test target
8108 #:phases
8109 (modify-phases %standard-phases
8110 (add-after 'unpack 'refer-to-inputs
8111 (lambda* (#:key inputs #:allow-other-keys)
8112 (substitute* "tpacpi-bat"
8113 (("cat ")
8114 (string-append (search-input-file inputs "bin/cat") " "))
8115 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
8116 ;; loaded. That's the administrator's prerogative; disable it.
8117 (("system \"(modprobe .*)\"" _ match)
8118 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))))
8119 (delete 'configure) ; nothing to configure
8120 (delete 'build) ; nothing to build
8121 (replace 'install
8122 (lambda* (#:key outputs #:allow-other-keys)
8123 (let* ((out (assoc-ref outputs "out"))
8124 (bin (string-append out "/bin"))
8125 (doc (string-append out "/share/doc/" ,name "-" ,version)))
8126 (install-file "tpacpi-bat" bin)
8127
8128 ;; There's no man page. Install other forms of documentation.
8129 (for-each (lambda (file)
8130 (let ((target (string-append doc "/" file)))
8131 (mkdir-p (dirname target))
8132 (copy-recursively file target)))
8133 (list "battery_asl" "examples" "README.md"))))))))
8134 (inputs
8135 (list coreutils-minimal
8136 perl))
8137 (home-page "https://github.com/teleshoes/tpacpi-bat")
8138 (synopsis "ThinkPad battery charge controller")
8139 (description
8140 "Tpacpi-bat is a command-line interface to control battery charging on
8141@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
8142ThinkPad models released after 2011}, starting with the xx20 series. It can
8143query and set the thresholds at which one or both batteries will start and stop
8144charging, inhibit charging batteries for a set period of time, or force them to
8145discharge when they otherwise would not.
8146
8147This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
8148kernel module provided by the @code{acpi-call-linux-module} package, which must
8149be installed and loaded separately. Only the original vendor firmware is
8150supported.")
8151 (license license:gpl3+)))
8152
8153(define-public tmon
8154 (package
8155 (name "tmon")
8156 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
8157 (version (package-version linux-libre))
8158 (source (package-source linux-libre))
8159 (build-system gnu-build-system)
8160 (arguments
8161 (list
8162 #:tests? #f ; no test suite
8163 #:make-flags
8164 #~(list (string-append "CC=" #$(cc-for-target))
8165 (string-append "INSTALL_ROOT=" #$output)
8166 "BINDIR=bin")
8167 #:phases
8168 #~(modify-phases %standard-phases
8169 (add-after 'unpack 'enter-subdirectory
8170 (lambda _
8171 (chdir "tools/thermal/tmon")))
8172 (add-after 'install 'install-man-page
8173 (lambda _
8174 (let ((man8 (string-append #$output "/share/man/man8")))
8175 (install-file "tmon.8" man8))))
8176 (delete 'configure)))) ; no configure script
8177 (inputs
8178 (list ncurses))
8179 (home-page (package-home-page linux-libre))
8180 (synopsis "Monitor and test the Linux thermal subsystem in real time")
8181 (description
8182 "Tmon is a tool to interact with the complex thermal subsystem of the
8183kernel Linux. It helps visualize thermal relationships and real-time thermal
8184data, tune and test cooling devices and sensors, and collect thermal data for
8185further analysis.
8186
8187As computers become smaller and more thermally constrained, more sensors are
8188added and new cooling capabilities introduced. Thermal relationships can change
8189dynamically. Their complexity grows exponentially among cooling devices, zones,
8190sensors, and trip points.
8191
8192Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
8193of symbolic links, trip point bindings, and device instances. To traverse it
8194by hand is no trivial task: @command{tmon} aims to make it understandable.")
8195 (license (list license:gpl2 ; the man page
8196 license:gpl2+)))) ; the actual rest
8197
8198(define-public turbostat
8199 (package
8200 (name "turbostat")
8201 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
8202 ;; make it harder to benefit from ‘free’ linux-libre package updates.
8203 (version (package-version linux-libre))
8204 (source (package-source linux-libre))
8205 (build-system gnu-build-system)
8206 (arguments
8207 (list
8208 #:tests? #f ;no test suite
8209 #:make-flags
8210 #~(list (string-append "CC=" #$(cc-for-target))
8211 (string-append "PREFIX=" #$output))
8212 #:phases
8213 #~(modify-phases %standard-phases
8214 (add-after 'unpack 'enter-subdirectory
8215 (lambda _
8216 (chdir "tools/power/x86/turbostat")))
8217 (delete 'configure)))) ;no configure script
8218 (inputs
8219 (list libcap))
8220 (supported-systems '("i686-linux" "x86_64-linux"))
8221 (home-page (package-home-page linux-libre))
8222 (synopsis "Report x86 processor frequency and idle statistics")
8223 (description
8224 "Turbostat reports x86 processor topology, frequency, idle power state
8225statistics, temperature, and power consumption. Some information is unavailable
8226on older processors.
8227
8228It can be used to identify machines that are inefficient in terms of power usage
8229or idle time, report the rate of @acronym{SMI, system management interrupt}s
8230occurring on the system, or verify the effects of power management tuning.
8231
8232@command{turbostat} reads hardware counters but doesn't write to them, so it
8233won't interfere with the OS or other running processes---including multiple
8234invocations of itself.")
8235 (license license:gpl2)))
8236
8237(define-public ntfs-3g
8238 (package
8239 (name "ntfs-3g")
8240 (version "2022.10.3")
8241 (source (origin
8242 (method url-fetch)
8243 (uri (string-append "https://tuxera.com/opensource/"
8244 "ntfs-3g_ntfsprogs-" version ".tgz"))
8245 (sha256
8246 (base32
8247 "030pakw3h1z6p8phdbyb0hw0bb868znvrri96rg88jq7d3p3c3pj"))
8248 (modules '((guix build utils)))
8249 (snippet '(begin
8250 ;; Install under $prefix.
8251 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
8252 (("/sbin")
8253 "@sbindir@"))))))
8254 (build-system gnu-build-system)
8255 (inputs (list util-linux ; libuuid
8256 fuse-2))
8257 (native-inputs (list pkg-config))
8258 (arguments
8259 '(#:configure-flags (list "--disable-static"
8260 "--disable-ldconfig" ;not necessary
8261 "--exec-prefix=${prefix}"
8262 "--with-fuse=external" ;use our own FUSE
8263 "--enable-mount-helper"
8264 "--enable-posix-acls"
8265 "--enable-xattr-mappings")
8266 #:phases
8267 (modify-phases %standard-phases
8268 ;; If users install ntfs-3g, they probably want to make it the
8269 ;; default driver as well, so we opt for sensible defaults and link
8270 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
8271 ;; mount NTFS file systems.)
8272 (add-after 'install 'install-link
8273 (lambda* (#:key outputs #:allow-other-keys)
8274 (let* ((out (assoc-ref outputs "out"))
8275 (sbin (string-append out "/sbin")))
8276 (symlink "mount.ntfs-3g"
8277 (string-append sbin "/mount.ntfs"))))))))
8278 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
8279 (synopsis "Read-write access to NTFS file systems")
8280 (description
8281 "NTFS-3G provides read-write access to NTFS file systems, which are
8282commonly found on Microsoft Windows. It is implemented as a FUSE file system.
8283The package provides additional NTFS tools.")
8284 (properties
8285 '((release-monitoring-url . "https://github.com/tuxera/ntfs-3g/releases")
8286 (upstream-name . "ntfs-3g_ntfsprogs")))
8287 (license license:gpl2+)))
8288
8289(define-public ntfs-3g/static
8290 (static-package
8291 (package
8292 (inherit ntfs-3g)
8293 (name "ntfs-3g-static")
8294 (arguments
8295 (substitute-keyword-arguments (package-arguments ntfs-3g)
8296 ((#:configure-flags flags)
8297 `(append ,flags
8298 (list "--enable-really-static"
8299 ;; The FUSE driver isn't currently used by our initrd.
8300 "--disable-ntfs-3g")))
8301 ((#:phases phases)
8302 `(modify-phases ,phases
8303 (add-after 'unpack 'make-really-static-really-static
8304 (lambda _
8305 (substitute* "ntfsprogs/Makefile.in"
8306 ((" -static") " -all-static"))))
8307 (delete 'install-link))))))))
8308
8309(define-public ntfsfix/static
8310 (package
8311 (name "ntfsfix-static")
8312 (version (package-version ntfs-3g/static))
8313 (source #f)
8314 (build-system trivial-build-system)
8315 (arguments
8316 `(#:modules ((guix build utils))
8317 #:builder
8318 (begin
8319 (use-modules (guix build utils))
8320 (let* ((ntfs-3g (assoc-ref %build-inputs "ntfs-3g"))
8321 (out (assoc-ref %outputs "out"))
8322 (bin (string-append out "/bin")))
8323 (install-file (string-append ntfs-3g "/bin/ntfsfix") bin)
8324 (with-directory-excursion bin
8325 (remove-store-references "ntfsfix"))))))
8326 (inputs
8327 `(("ntfs-3g" ,ntfs-3g/static)))
8328 (home-page (package-home-page ntfs-3g/static))
8329 (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
8330 (description
8331 "This package provides a statically linked @command{ntfsfix} taken
8332from the ntfs-3g package. It is meant to be used in initrds.")
8333 (license (package-license ntfs-3g/static))))
8334
8335(define-public rdma-core
8336 (package
8337 (name "rdma-core")
8338 (version "59.0")
8339 (source (origin
8340 (method url-fetch)
8341 (uri (string-append "https://github.com/linux-rdma/rdma-core"
8342 "/releases/download/v" version "/rdma-core-"
8343 version ".tar.gz"))
8344 (sha256
8345 (base32
8346 "1rbw0nxn7h9984r44pcwvnbdz2ycdn5wsmzrbwxxr31i7fqnkhg2"))))
8347 (build-system cmake-build-system)
8348 (arguments
8349 `(#:tests? #f ;no tests
8350
8351 ;; Upstream uses the "ninja" build system and encourage distros
8352 ;; to do the same for consistency.
8353 #:generator "Ninja"
8354 #:configure-flags (list ,@(if (%current-target-system)
8355 `((string-append
8356 "-DPKG_CONFIG_EXECUTABLE="
8357 (search-input-file
8358 %build-inputs
8359 (string-append "/bin/"
8360 ,(pkg-config-for-target)))))
8361 '())
8362 (string-append "-DRST2MAN_EXECUTABLE="
8363 (search-input-file
8364 %build-inputs "/bin/rst2man.py")))))
8365 (native-inputs
8366 (list pkg-config python-wrapper python-docutils-0.19)) ;for 'rst2man'
8367 (inputs
8368 (list libnl eudev))
8369 (home-page "https://github.com/linux-rdma/rdma-core")
8370 (synopsis "Utilities and libraries for working with RDMA devices")
8371 (description
8372 "This package provides userspace components for the InfiniBand
8373subsystem of the Linux kernel. Specifically it contains userspace
8374libraries for the following device nodes:
8375
8376@enumerate
8377@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
8378@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
8379@item @file{/dev/infiniband/umadX} (@code{libibumad})
8380@end enumerate
8381
8382The following service daemons are also provided:
8383@enumerate
8384@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
8385@item @code{iwpmd} (for iWARP kernel providers)
8386@item @code{ibacm} (for InfiniBand communication management assistant)
8387@end enumerate")
8388 ;; All library code is dual licensed under GPL2 and a custom MIT
8389 ;; variant. The package also includes some components covered by
8390 ;; other licenses. Consult COPYING.md for full details.
8391 (license
8392 (list license:gpl2
8393 (license:x11-style "See COPYING.BSD_MIT in the distribution")
8394 license:bsd-2 ; Files referring to COPYING.BSD_FB
8395 license:cc0 ; most files in ccan/
8396 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
8397
8398(define-public perftest
8399 (package
8400 (name "perftest")
8401 (version "4.5-0.20")
8402 (home-page "https://github.com/linux-rdma/perftest")
8403 (source (origin
8404 (method git-fetch)
8405 (uri (git-reference (url home-page)
8406 (commit (string-append "v" version))))
8407 (file-name (git-file-name name version))
8408 (sha256
8409 (base32
8410 "1hrpzmkz1kq4jwpy6b5fl8073iy7dllcq2hfzdw6waaf5920vd64"))))
8411 (build-system gnu-build-system)
8412 (native-inputs
8413 (list autoconf automake libtool))
8414 (inputs (list pciutils rdma-core))
8415 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
8416 (description "This is a collection of tests written over uverbs intended
8417for use as a performance micro-benchmark. The tests may be used for hardware
8418or software tuning as well as for functional testing.
8419
8420The collection contains a set of bandwidth and latency benchmark such as:
8421@enumerate
8422@item Send - @code{ib_send_bw} and @code{ib_send_lat}
8423@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
8424@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
8425@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
8426@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
8427@end enumerate")
8428 (license license:gpl2)))
8429
8430(define-public rng-tools
8431 (package
8432 (name "rng-tools")
8433 (home-page "https://github.com/nhorman/rng-tools")
8434 (version "6.17")
8435 (source (origin
8436 (method git-fetch)
8437 (uri (git-reference (url home-page)
8438 (commit (string-append "v" version))))
8439 (file-name (git-file-name name version))
8440 (sha256
8441 (base32
8442 "0vvqi9ha4jbk4086x2q98p4ip3z56sfdpyckdyknsd36zhp6z8n2"))
8443 (patches
8444 (search-patches "rng-tools-revert-build-randstat.patch"))
8445 (patch-flags '("-p0"))))
8446 (build-system gnu-build-system)
8447 (arguments
8448 (list
8449 ;; Disable support for various hardware entropy sources as they need
8450 ;; dependencies that are not yet in Guix, and would significantly
8451 ;; increase closure size.
8452 #:configure-flags #~(list "--without-nistbeacon"
8453 "--without-pkcs11"
8454 "--without-rtlsdr"
8455 "--without-qrypt")
8456 #:phases
8457 #~(modify-phases %standard-phases
8458 (add-before 'check 'disable-failing-test
8459 (lambda _
8460 (substitute* "tests/Makefile"
8461 ;; This test requires a hwrng, rdrand, or tpm device.
8462 ;; Worse, it appears to fail if that isn't sufficiently random.
8463 (("\\brngtestjitter\\.sh\\b") " ")))))))
8464 (native-inputs
8465 (list autoconf automake pkg-config))
8466 (inputs
8467 (list libcap sysfsutils openssl))
8468 (synopsis "Random number generator daemon")
8469 (description
8470 "Monitor a hardware random number generator, and supply entropy
8471from that to the system kernel's @file{/dev/random} machinery.")
8472 ;; The source package is offered under the GPL2+, but the files
8473 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
8474 (license (list license:gpl2 license:gpl2+))))
8475
8476(define-public cpupower
8477 (package
8478 (name "cpupower")
8479 (version (package-version linux-libre))
8480 (source (package-source linux-libre))
8481 (build-system gnu-build-system)
8482 (arguments
8483 (list #:make-flags
8484 #~(list "CC=gcc"
8485 (string-append "DESTDIR=" #$output)
8486 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
8487 "docdir=/share/doc/cpupower" ;drop default ‘packages/’
8488 "confdir=$(docdir)/examples"
8489 ;; The Makefile recommends the following changes.
8490 "DEBUG=false"
8491 "[email protected]")
8492 #:tests? #f ; no tests
8493 #:phases
8494 #~(modify-phases %standard-phases
8495 (add-after 'unpack 'enter-subdirectory
8496 (lambda _
8497 (chdir "tools/power/cpupower")))
8498 (delete 'configure) ; no configure script
8499 (add-before 'build 'fix-makefiles
8500 (lambda _
8501 (substitute* "Makefile"
8502 (("/usr/") "/")
8503 (("/bin/(install)" _ command) command))
8504 (substitute* "bench/Makefile"
8505 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))))
8506 (native-inputs (list gettext-minimal
8507 which)) ;to find gettext
8508 (inputs (list pciutils))
8509 (home-page (package-home-page linux-libre))
8510 (synopsis "CPU frequency and voltage scaling tools for Linux")
8511 (description
8512 "cpupower is a set of user-space tools that use the cpufreq feature of the
8513Linux kernel to retrieve and control processor features related to power saving,
8514such as frequency and voltage scaling.")
8515 (license license:gpl2)))
8516
8517(define-public x86-energy-perf-policy
8518 (package
8519 (name "x86-energy-perf-policy")
8520 (version (package-version linux-libre))
8521 (source (package-source linux-libre))
8522 (build-system gnu-build-system)
8523 (arguments
8524 '(#:tests? #f
8525 #:phases
8526 (modify-phases %standard-phases
8527 (add-after 'unpack 'enter-subdirectory
8528 (lambda _
8529 (chdir "tools/power/x86/x86_energy_perf_policy")
8530 #t))
8531 (delete 'configure)
8532 (add-before 'build 'fix-makefile
8533 (lambda _
8534 (substitute* "Makefile" (("/usr") ""))
8535 #t)))
8536 #:make-flags
8537 (let ((out (assoc-ref %outputs "out")))
8538 (list (string-append "DESTDIR=" out)
8539 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
8540 (supported-systems '("i686-linux" "x86_64-linux"))
8541 (home-page (package-home-page linux-libre))
8542 (synopsis "Display and update Intel-CPU energy-performance policy")
8543 (description
8544 "@command{x86_energy_perf_policy} displays and updates energy-performance
8545policy settings specific to Intel Architecture Processors. Settings are
8546accessed via Model Specific Register (MSR) updates, no matter if the Linux
8547cpufreq sub-system is enabled or not.")
8548 (license license:gpl2)))
8549
8550(define-public haveged
8551 (package
8552 (name "haveged")
8553 (version "1.9.19")
8554 (source
8555 (origin
8556 (method git-fetch)
8557 (uri (git-reference
8558 (url "https://github.com/jirka-h/haveged")
8559 (commit (string-append "v" version))))
8560 (file-name (git-file-name name version))
8561 (sha256
8562 (base32 "1qka68dlfz9z3gjfvfwvh60l2121c1yx0z264jqsf2vjp5f0xbmn"))))
8563 (build-system gnu-build-system)
8564 (arguments
8565 `(#:configure-flags
8566 (list "--disable-static")))
8567 (home-page "https://www.issihosts.com/haveged")
8568 (synopsis "Entropy source for the Linux random number generator")
8569 (description
8570 "haveged generates an unpredictable stream of random numbers for use by
8571Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
8572standard mechanisms for filling the entropy pool may not be sufficient for
8573systems with high needs or limited user interaction, such as headless servers.
8574
8575@command{haveged} runs as a privileged daemon, harvesting randomness from the
8576indirect effects of hardware events on hidden processor state using the
8577@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
8578It tunes itself to its environment and provides the same built-in test suite
8579for the output stream as used on certified hardware security devices.
8580
8581The quality of the randomness produced by this algorithm has not been proven.
8582It is recommended to run it together with another entropy source like rngd, and
8583not as a replacement for it.")
8584 (license (list (license:non-copyleft "file://nist/mconf.h")
8585 (license:non-copyleft "file://nist/packtest.c")
8586 license:public-domain ; nist/dfft.c
8587 license:gpl3+)))) ; everything else
8588
8589(define-public hotspot
8590 ;; Use the latest git commit as it includes unreleased fixes for the test
8591 ;; suite.
8592 (let ((commit "5cec69301a3f34ada86ce9fe01a9538b04b3cf7c")
8593 (revision "0"))
8594 (package
8595 (name "hotspot")
8596 (version (git-version "1.5.1" revision commit))
8597 (source (origin
8598 (method git-fetch)
8599 (uri (git-reference
8600 (url "https://github.com/KDAB/hotspot")
8601 (commit commit)
8602 ;; Include the bundled perfparser and PrefixTickLabels
8603 ;; libraries, which are to be used in source form.
8604 (recursive? #t)))
8605 (file-name (git-file-name name version))
8606 (sha256
8607 (base32
8608 "115gskjdcb1q3mgrnv1qcdrhxabjzl1hhkpk1klk67ayicsk1ym6"))))
8609 (build-system qt-build-system)
8610 (arguments
8611 (list
8612 ;; As mentioned in the option help text, the KAuth helper cannot be
8613 ;; installed to a custom prefix and the build fails with "file cannot
8614 ;; create directory: /polkit-1/actions. Maybe need administrative"
8615 ;; (see: https://bugs.kde.org/show_bug.cgi?id=363678).
8616 #:configure-flags #~(list "-DINSTALL_KAUTH_HELPER=OFF"
8617 "-DQT6_BUILD=ON")
8618 #:qtbase qtbase
8619 ;; The 'tst_models' and 'tst_callgraphgenerator' fail, with
8620 ;; the later seemingly requiring sudo or access to the kernel
8621 ;; trace points.
8622 #:test-exclude
8623 (string-append
8624 "("
8625 (string-join
8626 ;; The 'tst_models' expected output doesn't exactly
8627 ;; match.
8628 '("tst_models"
8629 ;; The 'tst_callgraphgenerator' perf invocation
8630 ;; fails when run in the build container.
8631 "tst_callgraphgenerator"
8632 ;; The 'tst_perfparser' test requires sudo/access
8633 ;; to the kernel scheduler trace points.
8634 "tst_perfparser")
8635 "|")
8636 ")")
8637 #:phases
8638 #~(modify-phases %standard-phases
8639 (add-after 'unpack 'patch-perfparser
8640 ;; XXX: This phase is copied from qt-creator: keep them in sync!
8641 (lambda* (#:key inputs #:allow-other-keys)
8642 ;; perfparser attempts to dynamically load the demangle
8643 ;; libraries; use their absolute file name to avoid having to
8644 ;; set LD_LIBRARY_PATH.
8645 (let ((librustc_demangle.so
8646 (with-exception-handler (lambda (ex)
8647 (if (search-error? ex)
8648 #f
8649 (raise-exception ex)))
8650 (lambda ()
8651 (search-input-file inputs "lib/librustc_demangle.so"))
8652 #:unwind? #t)))
8653 (substitute* "3rdparty/perfparser/app/demangler.cpp"
8654 (("loadDemangleLib\\(QStringLiteral\\(\"rustc_demangle\")"
8655 all)
8656 (if librustc_demangle.so
8657 (format #f "loadDemangleLib(QStringLiteral(~s)"
8658 librustc_demangle.so)
8659 all)) ;no rustc_demangle; leave unchanged
8660 (("loadDemangleLib\\(QStringLiteral\\(\"d_demangle\")")
8661 (format #f "loadDemangleLib(QStringLiteral(~s)"
8662 (search-input-file inputs
8663 "lib/libd_demangle.so")))))))
8664 (add-after 'unpack 'path-paths
8665 (lambda* (#:key inputs #:allow-other-keys)
8666 (substitute* "src/perfoutputwidgetkonsole.cpp"
8667 (("\"tail\"")
8668 (format #f "~s" (search-input-file inputs "bin/tail"))))
8669 (substitute* "src/perfrecord.cpp"
8670 (("\"perf( )?\"" _ space)
8671 (string-append "\"" (search-input-file inputs "bin/perf")
8672 (or space "") "\""))))))))
8673 (native-inputs
8674 (list extra-cmake-modules
8675 vulkan-headers))
8676 (inputs
8677 (append
8678 (list coreutils-minimal
8679 d-demangler
8680 elfutils
8681 karchive
8682 kconfig
8683 kcoreaddons
8684 kddockwidgets
8685 kgraphviewer
8686 ki18n
8687 kio
8688 kiconthemes
8689 kitemmodels
8690 kitemviews
8691 knotifications
8692 kparts
8693 ksyntaxhighlighting
8694 kwindowsystem
8695 libxkbcommon
8696 perf
8697 qtdeclarative
8698 qtsvg
8699 solid
8700 threadweaver
8701 `(,zstd "lib"))
8702 (if (supported-package? rust-rustc-demangle-capi-0.1)
8703 (list rust-rustc-demangle-capi-0.1)
8704 '())))
8705 (home-page "https://github.com/KDAB/hotspot")
8706 (synopsis "Performance analysis GUI for Linux perf")
8707 (description "Hotspot is a standalone GUI for performance data analysis.
8708It aims to be similar to KCachegrind, but for data collected with
8709@command{perf}, a profiler for use with the kernel Linux. Its main feature is
8710graphically visualizing a @file{perf.data} file.")
8711 (license (list license:gpl2+ license:gpl3+))))) ;dual licensed
8712
8713(define-public ecryptfs-utils
8714 (package
8715 (name "ecryptfs-utils")
8716 (version "111")
8717 (source
8718 (origin
8719 (method url-fetch)
8720 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
8721 version "/+download/ecryptfs-utils_"
8722 version ".orig.tar.gz"))
8723 (sha256
8724 (base32
8725 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
8726 (build-system gnu-build-system)
8727 (arguments
8728 `(#:configure-flags (list "--disable-pywrap")
8729 #:modules (,@%default-gnu-modules
8730 (ice-9 binary-ports)
8731 (rnrs bytevectors)
8732 (srfi srfi-26))
8733 #:phases
8734 (modify-phases %standard-phases
8735 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
8736 (lambda* (#:key inputs outputs #:allow-other-keys)
8737 (let ((out (assoc-ref outputs "out"))
8738 (util-linux (assoc-ref inputs "util-linux"))
8739 (cryptsetup (assoc-ref inputs "cryptsetup-minimal"))
8740 (linux-pam (assoc-ref inputs "linux-pam"))
8741 (lvm2 (assoc-ref inputs "lvm2")))
8742 (substitute* '("src/utils/ecryptfs-mount-private"
8743 "src/utils/ecryptfs-umount-private"
8744 "src/utils/ecryptfs-setup-private"
8745 "src/utils/ecryptfs-setup-swap"
8746 "src/utils/mount.ecryptfs.c"
8747 "src/utils/umount.ecryptfs.c"
8748 "src/pam_ecryptfs/pam_ecryptfs.c"
8749 "src/desktop/ecryptfs-mount-private.desktop.in"
8750 "src/desktop/ecryptfs-setup-private.desktop.in")
8751 (("/bin/mount")
8752 (string-append util-linux "/bin/mount"))
8753 (("/bin/umount")
8754 (string-append util-linux "/bin/umount"))
8755 (("/sbin/mount.ecryptfs_private")
8756 (string-append out "/sbin/mount.ecryptfs_private"))
8757 (("/sbin/umount.ecryptfs_private")
8758 (string-append out "/sbin/umount.ecryptfs_private"))
8759 (("/usr/bin/ecryptfs-mount-private")
8760 (string-append out "/bin/ecryptfs-mount-private"))
8761 (("/usr/bin/ecryptfs-rewrite-file")
8762 (string-append out "/bin/ecryptfs-rewrite-file"))
8763 (("/usr/bin/ecryptfs-setup-private")
8764 (string-append out "/bin/ecryptfs-setup-private"))
8765 (("/sbin/cryptsetup")
8766 (string-append cryptsetup "/sbin/cryptsetup"))
8767 (("/sbin/unix_chkpwd")
8768 (string-append linux-pam "/sbin/unix_chkpwd"))
8769 (("/sbin/dmsetup")
8770 (string-append lvm2 "/sbin/dmsetup"))))))
8771 (add-after 'install 'wrap-scripts
8772 (lambda* (#:key inputs outputs #:allow-other-keys)
8773 (let* ((out (assoc-ref outputs "out"))
8774 (bin (string-append out "/bin"))
8775 (add (map (lambda (bin)
8776 (dirname (search-input-file
8777 inputs (string-append "bin/" bin))))
8778 ;; For simplicity, we wrap all scripts the same.
8779 (list "awk" "find" "gettext" "grep" "keyctl" "ls"
8780 "lsof" "mount" "rsync" "sed" "which")))
8781 (script? (lambda (file)
8782 (call-with-input-file file
8783 (lambda (port)
8784 (bytevector=? (string->utf8 "#!")
8785 (get-bytevector-n port 2)))))))
8786 (for-each (lambda (file)
8787 (when (script? file)
8788 (wrap-program file
8789 ;; '= would be better than 'suffix but break
8790 ;; setuid binaries.
8791 `("PATH" ":" suffix (,@add
8792 ,(string-append bin))))))
8793 (find-files bin "."))))))))
8794 (native-inputs
8795 (list intltool perl ; for pod2man
8796 pkg-config))
8797 (inputs
8798 (list coreutils
8799 cryptsetup-minimal
8800 findutils
8801 gawk
8802 grep
8803 keyutils
8804 linux-pam
8805 lsof
8806 lvm2
8807 nss
8808 rsync
8809 sed
8810 util-linux
8811 which))
8812 (home-page "https://ecryptfs.org/")
8813 (synopsis "Cryptographic file system utilities")
8814 (description
8815 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
8816Each file's cryptographic meta-data is stored inside the file itself, along
8817with the encrypted contents. This allows individual encrypted files to be
8818copied between hosts and still be decrypted with the proper key. eCryptfs is a
8819native Linux file system, and has been part of the Linux kernel since version
88202.6.19. This package contains the userland utilities to manage it.")
8821 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
8822 ;; grant additional permission to link with OpenSSL.
8823 (license license:gpl2+)))
8824
8825(define-public libnfsidmap
8826 (package
8827 (name "libnfsidmap")
8828 (version "0.27")
8829 (source
8830 (origin
8831 (method url-fetch)
8832 (uri (string-append "https://fedorapeople.org/~steved/"
8833 name "/" version "/" name "-" version ".tar.bz2"))
8834 (sha256
8835 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
8836 (build-system gnu-build-system)
8837 (arguments
8838 `(#:configure-flags (list
8839 (string-append "--with-pluginpath="
8840 (assoc-ref %outputs "out")
8841 "/lib/libnfsidmap"))))
8842 (native-inputs
8843 (list autoconf)) ; 0.27 still needs autoheader
8844 (home-page
8845 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
8846 (synopsis "NFSv4 support library for name/ID mapping")
8847 (description "Libnfsidmap is a library holding multiple methods of
8848mapping names to ids and visa versa, mainly for NFSv4. It provides an
8849extensible array of mapping functions, currently consisting of two choices:
8850the default @code{nsswitch} and the experimental @code{umich_ldap}.")
8851 (license (license:non-copyleft "file://COPYING"
8852 "See COPYING in the distribution."))))
8853
8854(define-public module-init-tools
8855 (package
8856 (name "module-init-tools")
8857 (version "3.16")
8858 (source (origin
8859 (method url-fetch)
8860 (uri (string-append
8861 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
8862 "module-init-tools-" version ".tar.bz2"))
8863 (sha256
8864 (base32
8865 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
8866 (patches (search-patches "module-init-tools-moduledir.patch"))))
8867 (build-system gnu-build-system)
8868 (arguments
8869 ;; FIXME: The upstream tarball lacks man pages, and building them would
8870 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
8871 ;; but they vanished. In the meantime, fake it.
8872 '(#:phases
8873 (modify-phases %standard-phases
8874 (add-before 'configure 'fake-docbook
8875 (lambda _
8876 (substitute* "Makefile.in"
8877 (("^DOCBOOKTOMAN.*$")
8878 "DOCBOOKTOMAN = true\n"))
8879 #t)))))
8880 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
8881 (synopsis "Tools for loading and managing Linux kernel modules")
8882 (description
8883 "Tools for loading and managing Linux kernel modules, such as
8884@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
8885 (license license:gpl2+)))
8886
8887(define-public mce-inject
8888 (let ((revision "0") ; no git tags :-/
8889 (commit "4cbe46321b4a81365ff3aafafe63967264dbfec5"))
8890 (package
8891 (name "mce-inject")
8892 (version (git-version "0.0.0" revision commit))
8893 (source
8894 (origin
8895 (method git-fetch)
8896 (uri (git-reference
8897 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git")
8898 (commit commit)))
8899 (file-name (git-file-name name version))
8900 (sha256
8901 (base32 "0gjapg2hrlxp8ssrnhvc19i3r1xpcnql7xv0zjgbv09zyha08g6z"))))
8902 (build-system gnu-build-system)
8903 (arguments
8904 ;; There is no test suite. There's a test/ directory, but it just holds
8905 ;; example text files you could feed to the programme to crash something.
8906 (list #:tests? #f
8907 #:make-flags
8908 #~(list (string-append "prefix=" #$output)
8909 (string-append "CC=" #$(cc-for-target)))
8910 #:phases
8911 #~(modify-phases %standard-phases
8912 (delete 'configure) ; no configure script
8913 (add-after 'install 'install-examples
8914 (lambda* (#:key outputs #:allow-other-keys)
8915 (let* ((out (assoc-ref outputs "out"))
8916 (doc (string-append out "/share/doc/" #$name))
8917 (dir (string-append doc "/examples")))
8918 (copy-recursively "test" dir )))))))
8919 (native-inputs
8920 (list bison flex))
8921 (supported-systems (list "i686-linux" "x86_64-linux"))
8922 (home-page
8923 "https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git/about/")
8924 (synopsis
8925 "Inject x86 @acronym{MCEs, machine-check exceptions} into Linux")
8926 (description
8927 "This simple tool injects fake @acronym{MCEs, machine-check exceptions}
8928into a running Linux kernel, to debug or test the kernel's @acronym{EDAC, error
8929detection and correction}-handling code specific to x86 and x86_64 platforms.
8930
8931Real MCEs are internal CPU errors. Handling them correctly can be important to
8932system stability and even prevent physical damage. In contrast, simulated MCEs
8933produced by @command{mce-inject} are purely synthetic: injection happens only at
8934the software level, inside the kernel, and is not visible to the platform
8935hardware or firmware.
8936
8937A convenient feature of @command{mce-inject} is that the input language used to
8938describe MCEs is similar to the format used in Linux panic messages, with a few
8939extensions. In general, you should be able to pipe in any logged MCE panic to
8940simulate that same MCE.
8941
8942The target kernel must have the @code{CONFIG_X86_MCE_INJECT} option enabled and
8943the @code{mce-inject} module loaded if it exists.")
8944 (license license:gpl2))))
8945
8946(define-public mcelog
8947 (package
8948 (name "mcelog")
8949 (version "195")
8950 (source
8951 (origin
8952 (method git-fetch)
8953 (uri (git-reference
8954 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
8955 (commit (string-append "v" version))))
8956 (file-name (git-file-name name version))
8957 (sha256
8958 (base32 "1bg2bj8flybd8kzmmaaslisc6lc1fs9nbv09im6r32dq48skx5aj"))
8959 (modules '((guix build utils)))
8960 (snippet
8961 `(begin
8962 ;; The checkout lacks a .git directory, breaking ‘git describe’.
8963 (substitute* "Makefile"
8964 (("\"unknown\"") (string-append "\"v" ,version "\"")))))))
8965 (build-system gnu-build-system)
8966 (arguments
8967 (list
8968 ;; The tests will only run as root on certain supported CPU models.
8969 #:tests? #f
8970 #:make-flags
8971 #~(list (string-append "CC=" #$(cc-for-target))
8972 (string-append "prefix=" #$output)
8973 (string-append "DOCDIR=" #$output "/share/doc/"
8974 #$name "-" #$version)
8975 "etcprefix=$(DOCDIR)/examples")
8976 #:phases
8977 #~(modify-phases %standard-phases
8978 (delete 'configure)))) ; no configure script
8979 (native-inputs
8980 (list python-wrapper)) ; to generate example mcelog.conf
8981 (supported-systems (list "i686-linux" "x86_64-linux"))
8982 (home-page "https://mcelog.org/")
8983 (synopsis "Machine check monitor for x86 Linux systems")
8984 (description
8985 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
8986systems running the kernel Linux. It can also perform user-defined tasks, such
8987as bringing bad pages off-line, when configurable error thresholds are
8988exceeded.")
8989 (license license:gpl2)))
8990
8991(define-public mtd-utils
8992 (package
8993 (name "mtd-utils")
8994 (version "2.1.5")
8995 (source (origin
8996 (method url-fetch)
8997 (uri (string-append
8998 "ftp://ftp.infradead.org/pub/mtd-utils/"
8999 "mtd-utils-" version ".tar.bz2"))
9000 (sha256
9001 (base32
9002 "0ilz8hkcyvfcnqpy25kbr8fb71x9vl28wbmw56vvd68n2byjfviq"))))
9003 (arguments
9004 (list #:configure-flags
9005 (if (%current-target-system) ; When cross-compiling.
9006 #~(list)
9007 #~(list "--enable-unit-tests"))
9008
9009 #:parallel-tests? #f)) ;tests may fail when running in parallel
9010 (native-inputs
9011 (list cmocka pkg-config))
9012 (inputs
9013 (list acl ; extended attributes (xattr)
9014 lzo
9015 openssl ; optional crypto support
9016 `(,util-linux "lib")
9017 zlib
9018 `(,zstd "lib")))
9019 (build-system gnu-build-system)
9020 (synopsis "MTD Flash Storage Utilities")
9021 (description "This package provides utilities for testing, partitioning, etc
9022of flash storage.")
9023 (home-page "http://www.linux-mtd.infradead.org/")
9024 (license
9025 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
9026 license:mpl1.1 ; All ftl* files
9027 license:expat)))) ; libiniparser
9028
9029(define-public libseccomp
9030 (package
9031 (name "libseccomp")
9032 (version "2.6.0")
9033 (source (origin
9034 (method git-fetch)
9035 (uri (git-reference
9036 (url "https://github.com/seccomp/libseccomp")
9037 (commit (string-append "v" version))))
9038 (file-name (git-file-name name version))
9039 (sha256
9040 (base32
9041 "189yh66aj3z3jvns739qbj504f3mcl3w44pxxizw877pbj3kal11"))))
9042 (build-system gnu-build-system)
9043 (arguments
9044 (list
9045 #:configure-flags #~(list "--disable-static")
9046 #:phases #~(modify-phases %standard-phases
9047 (add-before 'check 'skip-load-test
9048 (lambda _
9049 ;; This test does a native system call and fails when
9050 ;; run under QEMU user-mode emulation. Just skip it.
9051 (delete-file "tests/52-basic-load.tests"))))))
9052 (native-inputs
9053 (list autoconf automake gperf libtool which))
9054 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
9055 (description "The libseccomp library provides an easy to use, platform
9056independent, interface to the Linux Kernel's syscall filtering mechanism. The
9057libseccomp API is designed to abstract away the underlying BPF based syscall
9058filter language and present a more conventional function-call based filtering
9059interface that should be familiar to, and easily adopted by, application
9060developers.")
9061 (home-page "https://github.com/seccomp/libseccomp")
9062 (license license:lgpl2.1)))
9063
9064(define-public radeontop
9065 (package
9066 (name "radeontop")
9067 (version "1.4")
9068 (source
9069 (origin
9070 (method git-fetch)
9071 (uri (git-reference
9072 (url "https://github.com/clbr/radeontop")
9073 (commit (string-append "v" version))))
9074 (file-name (git-file-name name version))
9075 (sha256
9076 (base32 "0kwqddidr45s1blp0h8r8h1dd1p50l516yb6mb4s6zsc827xzgg3"))))
9077 (build-system gnu-build-system)
9078 (arguments
9079 `(#:phases (modify-phases %standard-phases
9080 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
9081 ;; dependency, and doesn't even work on release(!) tarballs.
9082 (add-after 'unpack 'report-correct-version
9083 (lambda _
9084 (substitute* "getver.sh"
9085 (("ver=unknown")
9086 (string-append "ver=" ,version)))))
9087 (delete 'configure)) ; no configure script
9088 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9089 (string-append "PREFIX=" %output))
9090 #:tests? #f)) ; no tests
9091 (native-inputs
9092 (list gettext-minimal pkg-config))
9093 (inputs
9094 (list libdrm libpciaccess libxcb ncurses))
9095 (home-page "https://github.com/clbr/radeontop/")
9096 (synopsis "Usage monitor for AMD Radeon graphics")
9097 (description "RadeonTop monitors resource consumption on supported AMD
9098Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
9099a terminal or saved to a file for further processing. It measures both the
9100activity of the GPU as a whole, which is also accurate during OpenCL
9101computations, as well as separate component statistics that are only meaningful
9102under OpenGL graphics workloads.")
9103 (license license:gpl3)))
9104
9105(define-public efivar
9106 (package
9107 (name "efivar")
9108 (version "39")
9109 (source (origin
9110 (method git-fetch)
9111 (uri (git-reference
9112 (url "https://github.com/rhboot/efivar")
9113 (commit version)))
9114 (file-name (git-file-name name version))
9115 (sha256
9116 (base32
9117 "1zd9dghg1z2rrsazv3d9rj7nik6kdqz42jiak65pipz7mpjn9zdk"))
9118 (patches (search-patches "efivar-fix-fprint-format.patch"))))
9119 (build-system gnu-build-system)
9120 (arguments
9121 (list
9122 ;; Tests require a UEFI system and is not detected in the chroot.
9123 #:tests? #f
9124 #:make-flags #~(list (string-append "prefix="
9125 #$output)
9126 (string-append "libdir="
9127 #$output "/lib")
9128 (string-append "CC="
9129 #$(cc-for-target))
9130 "HOSTCC=gcc"
9131 (string-append "LDFLAGS=-Wl,-rpath="
9132 #$output "/lib")
9133 ;; Strictly only needed for i686-linux/32bit
9134 "CFLAGS=-g -O2 -Wno-error=format")
9135 #:phases #~(modify-phases %standard-phases
9136 (add-after 'unpack 'build-deterministically
9137 (lambda _
9138 (substitute* "src/include/defaults.mk"
9139 ;; Don't use -march=native.
9140 (("-march=native")
9141 ""))))
9142 (delete 'configure))))
9143 (native-inputs (list mandoc pkg-config))
9144 (inputs (list popt))
9145 (home-page "https://github.com/rhboot/efivar")
9146 (synopsis "Tool and library to manipulate EFI variables")
9147 (description "This package provides a library and a command line
9148interface to the variable facility of UEFI boot firmware.")
9149 (license license:lgpl2.1+)))
9150
9151(define-public efibootmgr
9152 (package
9153 (name "efibootmgr")
9154 (version "18")
9155 (source
9156 (origin
9157 (method git-fetch)
9158 (uri (git-reference
9159 (url "https://github.com/rhboot/efibootmgr")
9160 (commit version)))
9161 (file-name (git-file-name name version))
9162 (sha256
9163 (base32 "1j19m3dngcb7jl88ib32phbh5r7c02dhhakq8jk6z7y408c111hd"))))
9164 (build-system gnu-build-system)
9165 (arguments
9166 (list
9167 #:tests? #f ;no tests
9168 #:make-flags
9169 #~(append (list (string-append "prefix=" #$output)
9170 (string-append "libdir=" #$output "/lib")
9171 ;; EFIDIR denotes a subdirectory relative to the
9172 ;; EFI System Partition where the loader will be
9173 ;; installed (known as OS_VENDOR in the code).
9174 ;; GRUB overrides this, as such it's only used if
9175 ;; nothing else is specified on the command line.
9176 "EFIDIR=gnu")
9177 #$(if (%current-target-system)
9178 #~(list
9179 (string-append "CC=" #$(cc-for-target))
9180 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
9181 (string-append "EXTRAINCDIRS="
9182 #$(this-package-input "efivar") "/include"))
9183 #~'()))
9184 #:phases #~(modify-phases %standard-phases (delete 'configure))))
9185 (native-inputs
9186 (list pkg-config))
9187 (inputs
9188 (list efivar popt))
9189 (home-page "https://github.com/rhboot/efibootmgr")
9190 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
9191 (description
9192 "@code{efibootmgr} is a user-space application to modify the Intel
9193Extensible Firmware Interface (EFI) Boot Manager. This application can
9194create and destroy boot entries, change the boot order, change the next
9195running boot option, and more.")
9196 (license license:gpl2+)))
9197
9198(define-public sysstat
9199 (package
9200 (name "sysstat")
9201 (version "12.7.5")
9202 (source
9203 (origin
9204 (method url-fetch)
9205 (uri (string-append "https://sysstat.github.io/sysstat-packages/"
9206 "sysstat-" version ".tar.xz"))
9207 (sha256
9208 (base32 "0ssdrm3k0fclq5b5i0aznfwdkbac9l9cf88idaq3pls9lm040rjp"))))
9209 (build-system gnu-build-system)
9210 (native-inputs (list gettext-minimal))
9211 (arguments
9212 `(#:tests? #f ; no test suite.
9213 ;; Without this flag, it tries to install the man pages with group 'root'
9214 ;; and fails because /etc/passwd lacks an entry for the root user.
9215 #:configure-flags
9216 (list "--disable-file-attr"
9217 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
9218 #:phases
9219 (modify-phases %standard-phases
9220 ;; The build process tries to create '/var/lib/sa', so we skip that
9221 ;; instruction.
9222 (add-after 'build 'skip-touching-var
9223 (lambda _
9224 (substitute* "Makefile"
9225 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
9226 "")))))))
9227 (home-page "https://sysstat.github.io")
9228 (synopsis "Performance monitoring tools for Linux")
9229 (description "The sysstat utilities are a collection of performance
9230monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
9231@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
9232@code{sadf} and @code{sa}.")
9233 (license license:gpl2+)))
9234
9235(define-public acpilight
9236 (package
9237 (name "acpilight")
9238 (version "1.2")
9239 (source (origin
9240 (method git-fetch)
9241 (uri (git-reference
9242 (url "https://gitlab.com/wavexx/acpilight.git")
9243 (commit (string-append "v" version))))
9244 (file-name (git-file-name name version))
9245 (sha256
9246 (base32
9247 "1r0r3nx6x6vkpal6vci0zaa1n9dfacypldf6k8fxg7919vzxdn1w"))))
9248 (build-system gnu-build-system)
9249 (arguments
9250 (list #:tests? #f ; no tests
9251 #:make-flags
9252 #~(list (string-append "prefix=" #$output)
9253 (string-append "sysconfdir=" #$output "/lib")) ;udev rule
9254 #:phases
9255 #~(modify-phases %standard-phases
9256 (delete 'configure)
9257 (add-after 'unpack 'patch
9258 (lambda* (#:key inputs #:allow-other-keys)
9259 ;; Prevent reloading udev at build time
9260 (substitute* "Makefile"
9261 (("udevadm") "true"))
9262 (substitute* "90-backlight.rules"
9263 (("/bin")
9264 (string-append #$(this-package-input "coreutils")
9265 "/bin"))))))))
9266 (inputs (list coreutils python))
9267 (home-page "https://gitlab.com/wavexx/acpilight")
9268 (synopsis "Backward-compatibile xbacklight replacement")
9269 (description "acpilight is a backward-compatibile replacement for
9270xbacklight that uses the ACPI interface to set the display brightness. On
9271modern laptops acpilight can control both display and keyboard backlight
9272uniformly on either X11, the console or Wayland.")
9273 (license license:gpl3+)))
9274
9275(define-public light
9276 (package
9277 (name "light")
9278 (version "1.2.2")
9279 (source
9280 (origin
9281 (method git-fetch)
9282 (uri (git-reference
9283 (url "https://github.com/haikarainen/light")
9284 (commit (string-append "v" version))))
9285 (sha256
9286 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
9287 (file-name (git-file-name name version))))
9288 (build-system gnu-build-system)
9289 (arguments
9290 `(#:configure-flags '("CFLAGS=-fcommon")
9291 #:phases
9292 (modify-phases %standard-phases
9293 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
9294 (lambda* (#:key inputs #:allow-other-keys)
9295 (substitute* "90-backlight.rules"
9296 (("/bin/chgrp") (which "chgrp"))
9297 (("/bin/chmod") (which "chmod")))
9298 #t))
9299 (add-after 'install 'install-udev-rules
9300 (lambda* (#:key outputs #:allow-other-keys)
9301 (let ((out (assoc-ref outputs "out")))
9302 (install-file
9303 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
9304 #t))))))
9305 (native-inputs
9306 (list autoconf automake))
9307 (home-page "https://haikarainen.github.io/light/")
9308 (synopsis "GNU/Linux application to control backlights")
9309 (description
9310 "Light is a program to send commands to screen backlight controllers
9311under GNU/Linux. Features include:
9312
9313@itemize
9314@item It does not rely on X.
9315@item Light can automatically figure out the best controller to use, making
9316full use of underlying hardware.
9317@item It is possible to set a minimum brightness value, as some controllers
9318set the screen to be pitch black at a value of 0 (or higher).
9319@end itemize\n")
9320 (license license:gpl3+)))
9321
9322(define-public brightnessctl
9323 (package
9324 (name "brightnessctl")
9325 (version "0.5.1")
9326 (home-page "https://github.com/Hummer12007/brightnessctl")
9327 (source (origin
9328 (method git-fetch)
9329 (uri (git-reference (url home-page) (commit version)))
9330 (file-name (git-file-name name version))
9331 (sha256
9332 (base32
9333 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
9334 (patches (search-patches "brightnessctl-elogind-support.patch"))))
9335 (build-system gnu-build-system)
9336 (arguments
9337 `(#:tests? #f ; no tests
9338 #:make-flags (list (string-append "CC=" ,(cc-for-target))
9339 (string-append "PREFIX=" %output)
9340 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
9341 "ENABLE_SYSTEMD=1")
9342 #:phases
9343 (modify-phases %standard-phases
9344 (delete 'configure)
9345 (add-after 'unpack 'adjust-udev-rules
9346 (lambda _
9347 (substitute* "Makefile"
9348 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
9349 (substitute* "90-brightnessctl.rules"
9350 (("/bin/") "/run/current-system/profile/bin/"))
9351 #t)))))
9352 (native-inputs
9353 (list pkg-config))
9354 (inputs
9355 (list elogind))
9356 (synopsis "Backlight and LED brightness control")
9357 (description
9358 "This program allows you read and control device brightness. Devices
9359include backlight and LEDs. It can also preserve current brightness before
9360applying the operation, such as on lid close.
9361
9362The appropriate permissions must be set on the backlight or LED control
9363interface in sysfs, which can be accomplished with the included udev rules.")
9364 (license license:expat)))
9365
9366(define-public tlp
9367 (package
9368 (name "tlp")
9369 (version "1.8.0")
9370 (source
9371 (origin
9372 (method git-fetch)
9373 (uri (git-reference
9374 (url "https://github.com/linrunner/TLP")
9375 (commit version)))
9376 (file-name (git-file-name name version))
9377 (sha256
9378 (base32 "0r8r95wjb1sl5v8mli7kba2py9hc0ps915fx4lap5pg108ik9a06"))))
9379 (native-inputs
9380 (list shellcheck))
9381 (inputs
9382 `(("dbus" ,dbus)
9383 ("ethtool" ,ethtool)
9384 ("eudev" ,eudev)
9385 ("grep" ,grep)
9386 ("guile" ,guile-3.0) ;for wrap-script
9387 ("hdparm" ,hdparm)
9388 ("inetutils" ,inetutils)
9389 ("iw" ,iw)
9390 ("kmod" ,kmod)
9391 ("pciutils" ,pciutils)
9392 ("perl" ,perl)
9393 ("rfkill" ,rfkill)
9394 ("sed" ,sed)
9395 ("usbutils" ,usbutils)
9396 ("util-linux" ,util-linux)
9397 ("wireless-tools" ,wireless-tools)
9398 ,@(if (let ((system (or (%current-target-system)
9399 (%current-system))))
9400 (or (string-prefix? "i686-" system)
9401 (string-prefix? "x86_64-" system)))
9402 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
9403 '())))
9404 (build-system gnu-build-system)
9405 (arguments
9406 ;; XXX: The full test suite is run with "checkall" but it requires
9407 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
9408 (list
9409 #:make-flags
9410 #~(list "TLP_CONFUSR=/etc/tlp.conf" "TLP_CONFDIR=/etc/tlp.d")
9411 #:test-target "shellcheck"
9412 #:modules '((guix build gnu-build-system)
9413 (guix build utils)
9414 (srfi srfi-1))
9415 #:phases
9416 #~(modify-phases %standard-phases
9417 (delete 'configure) ; no configure script
9418 (add-before 'build 'setenv
9419 (lambda _
9420 (setenv "TLP_WITH_SYSTEMD" "0")
9421 (setenv "TLP_NO_INIT" "1")))
9422 (add-before 'build 'fix-installation
9423 (lambda _
9424 ;; Stop the Makefile from trying to create system directories.
9425 (substitute* "Makefile"
9426 (("= /usr") (string-append "= " #$output))
9427 (("= /etc") (string-append "= " #$output "/etc"))
9428 (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
9429 (add-before 'build 'fix-perl-calls
9430 ;; Shell scripts in "bat.d" and "func.d" call "perl". Fix
9431 ;; invocation without wrapping every one of them.
9432 (lambda* (#:key inputs #:allow-other-keys)
9433 (substitute* (append (find-files "bat.d" ".")
9434 (find-files "func.d" "."))
9435 (("(^|[^/])perl" _ prefix)
9436 (string-append prefix
9437 (search-input-file inputs "bin/perl"))))))
9438 (replace 'install
9439 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
9440 (add-after 'install 'wrap
9441 (lambda* (#:key inputs outputs #:allow-other-keys)
9442 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
9443 (sbin (string-append (assoc-ref outputs "out") "/sbin"))
9444 ;; Used to ignore symlinks which don't need wrapping
9445 (regular-file-predicate
9446 (lambda (file stat) (eq? 'regular (stat:type stat))))
9447 (bin-files (find-files bin regular-file-predicate))
9448 (sbin-files (find-files sbin regular-file-predicate)))
9449 (define (bin-directory input-name)
9450 (let ((p (assoc-ref inputs input-name)))
9451 (and p (string-append p "/bin"))))
9452 (define (sbin-directory input-name)
9453 (string-append (assoc-ref inputs input-name) "/sbin"))
9454 (for-each (lambda (program)
9455 ;; Programs rely on $0 so we use wrap-script
9456 ;; instead of wrap-program
9457 (wrap-script program
9458 `("PATH" ":" prefix
9459 ,(append
9460 (filter-map bin-directory
9461 '("bash"
9462 "coreutils"
9463 "dbus"
9464 "eudev"
9465 "grep"
9466 "inetutils"
9467 "kmod"
9468 "perl"
9469 "sed"
9470 "usbutils"
9471 "util-linux"
9472 "x86-energy-perf-policy"))
9473 (filter-map sbin-directory
9474 '("ethtool"
9475 "hdparm"
9476 "iw"
9477 "pciutils"
9478 "rfkill"
9479 "wireless-tools"))))))
9480 (append bin-files sbin-files))))))))
9481 (home-page "https://linrunner.de/en/tlp/tlp.html")
9482 (synopsis "Power management tool for Linux")
9483 (description "TLP is a power management tool for Linux. It comes with
9484a default configuration already optimized for battery life. Nevertheless,
9485TLP is customizable to fulfil system requirements. TLP settings are applied
9486every time the power supply source is changed.")
9487 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
9488 ;; rest is GPLv2+.
9489 (license (list license:gpl2+ license:gpl3+))))
9490
9491(define-public tlpui
9492 (package
9493 (name "tlpui")
9494 (version "1.8.0")
9495 (source
9496 (origin
9497 (method git-fetch)
9498 (uri (git-reference
9499 (url "https://github.com/d4nj1/TLPUI")
9500 (commit (string-append "tlpui-" version))))
9501 (file-name (git-file-name name version))
9502 (sha256
9503 (base32 "1q33p4gf5ii53wlgs61gghqxp3js5c45pn5nlibg2ygw069225r5"))))
9504 (build-system pyproject-build-system)
9505 (arguments
9506 (list
9507 #:phases
9508 #~(modify-phases %standard-phases
9509 (add-after 'unpack 'set-absolute-locations
9510 (lambda* (#:key inputs #:allow-other-keys)
9511 (let ((defaults.conf
9512 (search-input-file inputs "/share/tlp/defaults.conf"))
9513 (lspci (search-input-file inputs "/bin/lspci"))
9514 (lsusb (search-input-file inputs "/bin/lsusb"))
9515 (tlp-stat (search-input-file inputs "/bin/tlp-stat")))
9516 (with-directory-excursion "tlpui"
9517 (substitute* '("file.py" "settingshelper.py" "statui.py")
9518 (("\"tlp-stat\"")
9519 (string-append "'" tlp-stat "'"))
9520 (("/usr/share/tlp/defaults.conf")
9521 defaults.conf))
9522 (substitute* "ui_config_objects/gtkusblist.py"
9523 (("\"lsusb\"")
9524 (string-append "'" lsusb "'")))
9525 (substitute* "ui_config_objects/gtkpcilist.py"
9526 (("\"lspci\"")
9527 (string-append "'" lspci "'")))
9528 ;; Settings check if various tlp executables, lspci and
9529 ;; usbutils are available. Skip this phase since we know
9530 ;; for sure they are (and it avoids patching each location).
9531 (substitute* "settingshelper.py"
9532 (("(command_exists = ).*" _ lead)
9533 (string-append lead "True\n")))))))
9534 (add-after 'install 'install-desktop-file
9535 (lambda _
9536 (let ((dir (string-append #$output "/share/applications")))
9537 (install-file "tlpui.desktop" dir))))
9538 (add-after 'wrap 'wrap-gi-python
9539 (lambda _
9540 (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
9541 (wrap-program (string-append #$output "/bin/tlpui")
9542 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
9543 (native-inputs
9544 (list `(,glib "bin")
9545 gobject-introspection
9546 python-poetry-core
9547 python-pytest
9548 python-pyyaml))
9549 (inputs
9550 (list gtk+
9551 pciutils
9552 python-pygobject
9553 tlp
9554 usbutils))
9555 (propagated-inputs (list (librsvg-for-system)))
9556 (home-page "https://github.com/d4nj1/TLPUI")
9557 (synopsis "User interface for TLP written in Python")
9558 (description
9559 "The Python scripts in this project generate a GTK-UI to change
9560TLP configuration files easily. It aims to protect users from setting
9561bad configuration and to deliver a basic overview of all the valid
9562configuration values.")
9563 (license license:gpl2+)))
9564
9565(define-public lshw
9566 (package
9567 (name "lshw")
9568 (version "B.02.19.2")
9569 (source (origin
9570 (method url-fetch)
9571 (uri (string-append "https://www.ezix.org/software/"
9572 "files/lshw-" version
9573 ".tar.gz"))
9574 (sha256
9575 (base32
9576 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
9577 (build-system gnu-build-system)
9578 (arguments
9579 `(#:phases (modify-phases %standard-phases (delete 'configure))
9580 #:tests? #f ; no tests
9581 #:make-flags
9582 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
9583 (synopsis "List hardware information")
9584 (description
9585 "@command{lshw} (Hardware Lister) is a small tool to provide
9586detailed information on the hardware configuration of the machine.
9587It can report exact memory configuration, firmware version, mainboard
9588configuration, CPU version and speed, cache configuration, bus speed,
9589and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
9590machines (PowerMac G4 is known to work).")
9591 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
9592 (license license:gpl2+)))
9593
9594(define-public libmnl
9595 (package
9596 (name "libmnl")
9597 (version "1.0.5")
9598 (source
9599 (origin
9600 (method url-fetch)
9601 (uri (string-append "mirror://netfilter.org/libmnl/"
9602 "libmnl-" version ".tar.bz2"))
9603 (sha256
9604 (base32
9605 "09851ns07399rbz0y8slrlmnw3fn1nakr8d37pxjn5gkks8rnjr7"))))
9606 (build-system gnu-build-system)
9607 (home-page "https://www.netfilter.org/projects/libmnl/")
9608 (synopsis "Netlink utility library")
9609 (description "Libmnl is a minimalistic user-space library oriented to
9610Netlink developers. There are a lot of common tasks in parsing, validating,
9611constructing of both the Netlink header and TLVs that are repetitive and easy to
9612get wrong. This library aims to provide simple helpers that allows you to
9613re-use code and to avoid re-inventing the wheel.")
9614 (properties
9615 '((release-monitoring-url . "https://www.netfilter.org/pub/libmnl/")))
9616 (license license:lgpl2.1+)))
9617
9618(define-public libnftnl
9619 (package
9620 (name "libnftnl")
9621 (version "1.2.8")
9622 (source
9623 (origin
9624 (method url-fetch)
9625 (uri (string-append "mirror://netfilter.org/libnftnl/"
9626 "libnftnl-" version ".tar.xz"))
9627 (sha256
9628 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9629 (build-system gnu-build-system)
9630 (native-inputs
9631 (list pkg-config))
9632 (inputs
9633 (list libmnl))
9634 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
9635 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
9636 (description "Libnftnl is a userspace library providing a low-level netlink
9637programming interface to the in-kernel nf_tables subsystem. The library
9638libnftnl has been previously known as libnftables. This library is currently
9639used by nftables.")
9640 (license license:gpl2+)))
9641
9642;;; The symbol libnftl/fixed should be used when libnftnl needs fixes
9643;;; (security or else) and this deprecation could be removed.
9644(define-deprecated/public-alias libnftnl/fixed libnftnl/pinned)
9645
9646;; This is used in iptables, which contributes to rust. We're pinning this
9647;; variant to avoid accidental rebuilds of rust.
9648(define-public libnftnl/pinned
9649 (package
9650 (inherit libnftnl)
9651 (version "1.2.8")
9652 (source
9653 (origin
9654 (method url-fetch)
9655 (uri (string-append "mirror://netfilter.org/libnftnl/"
9656 "libnftnl-" version ".tar.xz"))
9657 (sha256
9658 (base32 "15ddcyp91lxjh2wfi8xicjpffhn9rpiqsa8djbkqvc69npbabzip"))))
9659 (build-system gnu-build-system)
9660 (native-inputs
9661 (list pkg-config))
9662 (inputs
9663 (list libmnl))))
9664
9665(define-public nftables
9666 (package
9667 (name "nftables")
9668 (version "1.0.8")
9669 (source
9670 (origin
9671 (method url-fetch)
9672 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
9673 version ".tar.xz")
9674 (string-append "https://www.nftables.org/projects/nftables"
9675 "/files/nftables-" version ".tar.xz")))
9676 (sha256
9677 (base32 "0l1xpwr9qfbl3bxa97v8s2lbibiz0xma9q0qi34xp0hswh6p8wwk"))))
9678 (build-system gnu-build-system)
9679 (arguments `(#:configure-flags
9680 '("--disable-static"
9681 "--with-cli=readline"
9682 "--with-json")
9683 #:phases
9684 (modify-phases %standard-phases
9685 (add-before 'configure 'autoreconf
9686 (lambda _
9687 (invoke "autoreconf" "-fi"))))))
9688 (inputs (list gmp libmnl libnftnl readline jansson))
9689 (native-inputs (list pkg-config
9690 bison
9691 flex
9692 docbook2x
9693 autoconf
9694 automake
9695 libtool))
9696 (home-page "https://www.nftables.org")
9697 (synopsis "Userspace utility for Linux packet filtering")
9698 (description "nftables is the project that aims to replace the existing
9699{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
9700filtering framework, a new userspace utility and also a compatibility layer for
9701{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
9702infrastructure such as the existing hooks, the connection tracking system, the
9703userspace queueing component and the logging subsystem.")
9704 (license license:gpl2)))
9705
9706(define-public libnetfilter-conntrack
9707 (package
9708 (name "libnetfilter-conntrack")
9709 (version "1.0.9")
9710 (source
9711 (origin
9712 (method url-fetch)
9713 (uri (string-append "https://netfilter.org/projects/"
9714 "libnetfilter_conntrack/files/"
9715 "libnetfilter_conntrack-"
9716 version ".tar.bz2"))
9717 (sha256
9718 (base32 "1a3rnpsba64dzy97wwjrxal89wr0nf9znvag2j18nkp3kzs9vgb7"))))
9719 (build-system gnu-build-system)
9720 (native-inputs (list pkg-config))
9721 (inputs (list libnfnetlink libmnl))
9722 (synopsis "Library for kernel connection tracking state table")
9723 (description "libnetfilter_conntrack is a userspace library providing a
9724programming interface (API) to the in-kernel connection tracking state table.
9725The library libnetfilter_conntrack has been previously known as
9726libnfnetlink_conntrack and libctnetlink. This library is currently used by
9727conntrack-tools among many other applications.")
9728 (home-page "https://netfilter.org/projects/libnetfilter_conntrack/index.html")
9729 (supported-systems (filter target-linux? %supported-systems))
9730 (properties '((upstream-name . "libnetfilter_conntrack")))
9731 (license license:gpl2+)))
9732
9733(define-public libnetfilter-cttimeout
9734 (package
9735 (name "libnetfilter-cttimeout")
9736 (version "1.0.1")
9737 (source
9738 (origin
9739 (method url-fetch)
9740 (uri (string-append "https://netfilter.org/projects/"
9741 "libnetfilter_cttimeout/files/"
9742 "libnetfilter_cttimeout-" version ".tar.bz2"))
9743 (sha256
9744 (base32 "0983cpyvxyycbnzqlrzml80pph2z51r6s7sxp06ciq8468pxln8b"))))
9745 (build-system gnu-build-system)
9746 (native-inputs (list pkg-config))
9747 (inputs (list libmnl))
9748 (synopsis "Library for kernel connection tracking timeout infrastructure")
9749 (description "libnetfilter_cttimeout is the userspace library that
9750provides the programming interface to the fine-grain connection tracking
9751timeout infrastructure. With this library, you can create, update and delete
9752timeout policies that can be attached to traffic flows. This library is used
9753by conntrack-tools.")
9754 (home-page "https://netfilter.org/projects/libnetfilter_cttimeout/index.html")
9755 (supported-systems (filter target-linux? %supported-systems))
9756 (properties '((upstream-name . "libnetfilter_cttimeout")))
9757 (license license:gpl2)))
9758
9759(define-public libnetfilter-cthelper
9760 (package
9761 (name "libnetfilter-cthelper")
9762 (version "1.0.1")
9763 (source
9764 (origin
9765 (method url-fetch)
9766 (uri (string-append "https://netfilter.org/projects/"
9767 "libnetfilter_cthelper/files/"
9768 "libnetfilter_cthelper-" version ".tar.bz2"))
9769 (sha256
9770 (base32 "04n95ngil5l8m8v64dfjm1dwq0wd3kf4vw1zblsrff13hxa3s1ql"))))
9771 (build-system gnu-build-system)
9772 (native-inputs (list pkg-config))
9773 (inputs (list libmnl))
9774 (synopsis "Library for user-space connection tracking helpers")
9775 (description "libnetfilter_cthelper is a userspace library that provides a
9776programming interface to user-space connection tracking helpers.
9777@enumerate
9778@item
9779register new user-space connection tracking helpers
9780@item
9781unregister user-space connection tracking helpers
9782@item
9783list existing registered user-space connection tracking helpers
9784@end enumerate")
9785 (home-page "https://netfilter.org/projects/libnetfilter_cthelper/index.html")
9786 (supported-systems (filter target-linux? %supported-systems))
9787 (properties '((upstream-name . "libnetfilter_cthelper")))
9788 (license license:gpl2+)))
9789
9790(define-public libnetfilter-queue
9791 (package
9792 (name "libnetfilter-queue")
9793 (version "1.0.5")
9794 (source
9795 (origin
9796 (method url-fetch)
9797 (uri (string-append "https://netfilter.org/projects/"
9798 "libnetfilter_queue/files/"
9799 "libnetfilter_queue-" version ".tar.bz2"))
9800 (sha256
9801 (base32
9802 "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr"))))
9803 (build-system gnu-build-system)
9804 (native-inputs (list pkg-config))
9805 (inputs (list libmnl libnfnetlink))
9806 (synopsis "Library for kernel netfilter infrastructure and state")
9807 (description "libnetfilter_queue is a userspace library providing an API
9808to packets that have been queued by the kernel packet filter. It is is part
9809of a system that deprecates the old ip_queue/libipq mechanism.")
9810 (home-page "https://netfilter.org/projects/libnetfilter_queue/index.html")
9811 (supported-systems (filter target-linux? %supported-systems))
9812 (properties '((upstream-name . "libnetfilter_queue")))
9813 (license license:gpl2+)))
9814
9815(define-public conntrack-tools
9816 (package
9817 (name "conntrack-tools")
9818 (version "1.4.8")
9819 (source
9820 (origin
9821 (method url-fetch)
9822 (uri (string-append "https://netfilter.org/projects/"
9823 "conntrack-tools/files/"
9824 "conntrack-tools-" version ".tar.xz"))
9825 (sha256
9826 (base32 "1mnynl5a63j25arapwvkjbm3a2cqm3aaklwfwwclhmpnqps7fxh6"))))
9827 (build-system gnu-build-system)
9828 (native-inputs (list bison flex pkg-config))
9829 (inputs (list libtirpc
9830 libnetfilter-conntrack
9831 libnetfilter-cttimeout
9832 libnetfilter-cthelper
9833 libnetfilter-queue
9834 libnfnetlink
9835 libmnl))
9836 (synopsis "Set of tools targeting the conntrack kernel subsystem")
9837 (description "The tool conntrack provides a full featured interface that
9838is intended to replace the old @file{/proc/net/ip_conntrack} interface. Using
9839conntrack, you can view and manage the in-kernel connection tracking state
9840table from userspace. On the other hand, conntrackd covers the specific
9841aspects of stateful firewalls to enable highly available scenarios, and can be
9842used as statistics collector as well.
9843
9844Since 1.2.0, the conntrack-tools includes the @command{nfct} command line
9845utility. This utility only supports the nfnetlink_cttimeout by now. In the
9846long run, we expect that it will replace conntrack by providing a syntax
9847similar to nftables.")
9848 (home-page "https://netfilter.org/projects/conntrack-tools/index.html")
9849 (supported-systems (filter target-linux? %supported-systems))
9850 (license license:gpl2+)))
9851
9852(define-public libnetfilter-acct
9853 (package
9854 (name "libnetfilter-acct")
9855 (version "1.0.3")
9856 (source
9857 (origin
9858 (method url-fetch)
9859 (uri (string-append "https://netfilter.org/projects/"
9860 "libnetfilter_acct/files/"
9861 "libnetfilter_acct-" version ".tar.bz2"))
9862 (sha256
9863 (base32
9864 "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22"))))
9865 (build-system gnu-build-system)
9866 (native-inputs (list pkg-config))
9867 (inputs (list libmnl))
9868 (synopsis "Library providing interface to extended accounting infrastructure")
9869 (description "libnetfilter_acct is the userspace library providing interface
9870to extended accounting infrastructure.
9871
9872@enumerate
9873@item
9874creating accounting objects
9875@item
9876retrieving accounting objects (and atomically set to zero)
9877@item
9878deleting accounting objects
9879@end enumerate
9880For the nfnetlink_acct subsystem.")
9881 (home-page "https://netfilter.org/projects/libnetfilter_acct/index.html")
9882 (supported-systems (filter target-linux? %supported-systems))
9883 (properties '((upstream-name . "libnetfilter_acct")))
9884 (license license:lgpl2.1+)))
9885
9886(define-public nfacct
9887 (package
9888 (name "nfacct")
9889 (version "1.0.2")
9890 (source
9891 (origin
9892 (method url-fetch)
9893 (uri (string-append "https://netfilter.org/projects/" name
9894 "/files/nfacct-" version ".tar.bz2"))
9895 (sha256
9896 (base32
9897 "0sdxbxjyapbqcp2ami5jd10vz4xbbdvx39f3wfy1iqsbflc25zzc"))))
9898 (build-system gnu-build-system)
9899 (native-inputs (list pkg-config))
9900 (inputs (list libmnl libnetfilter-acct))
9901 (synopsis "Command line tool to create/retrieve/delete accounting objects")
9902 (description "nfacct is the command line tool to create/retrieve/delete
9903accounting objects
9904@enumerate
9905@item
9906listing the objects of the nfacct table in plain text/XML
9907@item
9908atomically get and reset objects of the nfacct table
9909@item
9910adding new objects to the nfacct table
9911@item
9912deleting objects from the nfacct table
9913@end enumerate")
9914 (home-page "https://netfilter.org/projects/nfacct/index.html")
9915 (supported-systems (filter target-linux? %supported-systems))
9916 (license license:gpl2+)))
9917
9918(define-public libnetfilter-log
9919 (package
9920 (name "libnetfilter-log")
9921 (version "1.0.2")
9922 (source
9923 (origin
9924 (method url-fetch)
9925 (uri (string-append "https://netfilter.org/projects/"
9926 "libnetfilter_log/files/"
9927 "libnetfilter_log-" version ".tar.bz2"))
9928 (sha256
9929 (base32
9930 "1spy9xs41v76kid5ana8n126f3mvgq6fjibbfbj4kn0larbhix73"))))
9931 (build-system gnu-build-system)
9932 (native-inputs (list pkg-config))
9933 (inputs (list libnfnetlink libmnl))
9934 (synopsis "Library providing interface to packets logged by netfilter")
9935 (description "libnetfilter_log is a userspace library providing interface to
9936packets that have been logged by the kernel packet filter. It is is part of a
9937system that deprecates the old syslog/dmesg based packet logging. This library
9938has been previously known as libnfnetlink_log.
9939
9940@enumerate
9941@item
9942receiving to-be-logged packets from the kernel nfnetlink_log subsystem
9943@end enumerate")
9944 (home-page "https://netfilter.org/projects/libnetfilter_log/index.html")
9945 (supported-systems (filter target-linux? %supported-systems))
9946 (properties '((upstream-name . "libnetfilter_log")))
9947 (license license:gpl2+)))
9948
9949(define-public ulogd
9950 (package
9951 (name "ulogd")
9952 (version "2.0.7")
9953 (source
9954 (origin
9955 (method url-fetch)
9956 (uri (string-append "https://netfilter.org/projects/" name
9957 "/files/ulogd-" version ".tar.bz2"))
9958 (sha256
9959 (base32
9960 "0ax9959c4bapq78n13bbaibcf1gwjir3ngx8l2dh45lw9m4ha2lr"))))
9961 (build-system gnu-build-system)
9962 (outputs '("out"
9963 ;; additional non-default output plugins
9964 "json" "pcap" "sqlite3" "pgsql" "mysql"))
9965 (native-inputs (list pkg-config))
9966 (inputs (list libnfnetlink
9967 libmnl
9968 libnetfilter-log
9969 libnetfilter-conntrack
9970 libnetfilter-acct
9971 sqlite
9972 libpcap
9973 jansson
9974 postgresql
9975 (list mariadb "dev")
9976 zlib
9977 openssl))
9978 (arguments
9979 (list #:configure-flags
9980 #~(list (string-append "--with-pgsql="
9981 (assoc-ref %build-inputs "postgresql"))
9982 (string-append "--with-mysql="
9983 (assoc-ref %build-inputs "mariadb")))
9984 #:phases
9985 #~(modify-phases %standard-phases
9986 (add-after 'install 'install-doc
9987 (lambda _
9988 (let ((out-etc (string-append #$output "/etc"))
9989 (ulogd.conf "ulogd.conf"))
9990 (mkdir-p out-etc)
9991 (copy-file ulogd.conf (string-append out-etc "/"
9992 ulogd.conf)))))
9993 (add-after 'install 'setup-plugin-outputs
9994 (lambda* (#:key outputs #:allow-other-keys)
9995 (with-directory-excursion
9996 (string-append #$output "/lib/ulogd/")
9997 (for-each
9998 (lambda (output-name)
9999 (let ((output-dir (string-append
10000 (assoc-ref outputs output-name)
10001 "/lib/ulogd/")))
10002 (mkdir-p output-dir)
10003 (for-each
10004 (lambda (plugin)
10005 (copy-file plugin (string-append output-dir plugin))
10006 (delete-file plugin))
10007 (find-files "."
10008 (string-append "ulogd_output_"
10009 (string-upcase output-name)
10010 ".*$")))))
10011 (list "json" "pcap" "sqlite3" "pgsql" "mysql"))))))))
10012 (synopsis "Logging daemon for netfilter and iptables")
10013 (description "ulogd is a userspace logging daemon for netfilter/iptables
10014related logging. This includes per-packet logging of security violations,
10015per-packet logging for accounting, per-flow logging and flexible user-defined
10016accounting.
10017
10018@enumerate
10019@item
10020Packet and flow-based traffic accounting
10021@item
10022Flexible user-defined traffic accounting via nfacct infrastructure
10023@item
10024SQL database back-end support: SQLite3, PostgreSQL, MySQL
10025@item
10026Text-based output formats: CSV, XML, Netfilter's LOG, Netfilter's conntrack
10027@end enumerate")
10028 (home-page "https://netfilter.org/projects/nfacct/index.html")
10029 (supported-systems (filter target-linux? %supported-systems))
10030 (license license:gpl2)))
10031
10032(define-public proot
10033 (package
10034 (name "proot")
10035 (version "5.4.0")
10036 (source
10037 (origin
10038 (method git-fetch)
10039 (uri (git-reference
10040 (url "https://github.com/proot-me/PRoot")
10041 (commit (string-append "v" version))))
10042 (file-name (git-file-name name version))
10043 (sha256
10044 (base32 "186qsg4yvisqjgf8w5jxhnlig7x341vpqwcgp8as3r59qmqkpmk7"))
10045 ;; Waiting for upstream inclusion at
10046 ;; https://github.com/proot-me/proot/pull/355
10047 (patches (search-patches "proot-add-clone3.patch"
10048 "proot-add-missing-include.patch"))))
10049 (build-system gnu-build-system)
10050 ;; Many architectures are not supported (see:
10051 ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
10052 (supported-systems '("x86_64-linux" "i686-linux"
10053 "armhf-linux" "aarch64-linux" "i586-gnu" "x86_64-gnu"))
10054 (arguments
10055 ;; Disable the test suite on armhf-linux, as there are too many
10056 ;; failures to keep track of (see for example:
10057 ;; https://github.com/proot-me/proot/issues/286).
10058 `(#:tests? ,(not (or (%current-target-system)
10059 (string-prefix? "armhf"
10060 (or (%current-system)))))
10061 #:make-flags '("-C" "src")
10062 #:phases (modify-phases %standard-phases
10063 (add-after 'unpack 'patch-sources
10064 (lambda* (#:key inputs #:allow-other-keys)
10065 (substitute* (find-files "src" "\\.[ch]$")
10066 (("\"/bin/sh\"")
10067 (string-append "\"" (assoc-ref inputs "bash")
10068 "/bin/sh\"")))
10069
10070 (substitute* "src/GNUmakefile"
10071 (("/bin/echo") (which "echo"))
10072 (("^VERSION = .*")
10073 (string-append "VERSION := " ,version "\n")))
10074
10075 (substitute* (find-files "test" "\\.sh$")
10076 ;; Some of the tests try to "bind-mount" /bin/true.
10077 (("-b /bin/true:")
10078 (string-append "-b " (which "true") ":"))
10079 ;; Likewise for /bin.
10080 (("-b /bin:") "-b /gnu:")
10081 ;; Others try to run /bin/sh.
10082 (("/bin/sh") (which "sh"))
10083 ;; Others assume /etc/fstab exists.
10084 (("/etc/fstab") "/etc/passwd"))
10085 (substitute* "test/GNUmakefile"
10086 (("-b /bin:") "-b /gnu:"))
10087 (substitute* "test/test-c6b77b77.mk"
10088 (("/bin/bash") (which "bash"))
10089 (("/usr/bin/test") (which "test")))
10090 (substitute* "test/test-16573e73.c"
10091 (("/bin/([a-z-]+)" _ program)
10092 (which program)))
10093 (substitute* "test/test-5467b986.sh"
10094 (("-w /usr") "-w /gnu")
10095 (("-w usr") "-w gnu")
10096 (("/usr/share") "/gnu/store")
10097 (("share") "store"))
10098 (substitute* "test/test-092c5e26.sh"
10099 (("-q echo ")
10100 "-q $(which echo) "))
10101
10102 ;; The socket tests requires networking.
10103 (for-each delete-file
10104 (find-files "test" "test-socket.*\\.sh$"))))
10105 (delete 'configure)
10106 (add-after 'build 'build-manpage
10107 (lambda _
10108 (with-directory-excursion "doc"
10109 (invoke "make" "proot/man.1" "SUFFIX=.py"))))
10110 (replace 'check
10111 (lambda* (#:key tests? #:allow-other-keys)
10112 (when tests?
10113 (let ((n (parallel-job-count)))
10114 ;; Most of the tests expect "/bin" to be in $PATH so
10115 ;; they can run things that live in $ROOTFS/bin.
10116 (setenv "PATH"
10117 (string-append (getenv "PATH") ":/bin"))
10118 (invoke "make" "check" "-C" "test"
10119 ;;"V=1"
10120 "-j" (number->string n))))))
10121 (replace 'install
10122 (lambda* (#:key outputs #:allow-other-keys)
10123 ;; The 'install' rule does nearly nothing.
10124 (let* ((out (assoc-ref outputs "out"))
10125 (man1 (string-append out "/share/man/man1")))
10126 ;; TODO: 'make install-care' (does not even
10127 ;; build currently.)
10128 (invoke "make" "-C" "src" "install"
10129 (string-append "PREFIX=" out))
10130 (mkdir-p man1)
10131 (copy-file "doc/proot/man.1"
10132 (string-append man1 "/proot.1"))))))))
10133 (native-inputs (list which
10134 ;; For 'mcookie', used by some of the tests.
10135 util-linux
10136 coreutils
10137 pkg-config
10138 ;; For rst2man, used to generate the manual page.
10139 python-docutils-0.19))
10140 (inputs (list libarchive talloc))
10141 (home-page "https://github.com/proot-me/PRoot")
10142 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
10143 (description
10144 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
10145and @code{binfmt_misc}. This means that users don't need any privileges or
10146setup to do things like using an arbitrary directory as the new root
10147file system, making files accessible somewhere else in the file system
10148hierarchy, or executing programs built for another CPU architecture
10149transparently through QEMU user-mode. Also, developers can use PRoot as a
10150generic process instrumentation engine thanks to its extension mechanism.
10151Technically PRoot relies on @code{ptrace}, an unprivileged system-call
10152available in the kernel Linux.")
10153 (license license:gpl2+)))
10154
10155(define-public proot-static
10156 (package
10157 (inherit proot)
10158 (name "proot-static")
10159 (synopsis
10160 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
10161 (inputs `(("talloc" ,talloc/static)))
10162 (arguments
10163 (substitute-keyword-arguments (package-arguments proot)
10164 ((#:make-flags flags)
10165 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
10166 ((#:phases phases)
10167 `(modify-phases ,phases
10168 (add-after 'strip 'remove-store-references
10169 (lambda* (#:key outputs #:allow-other-keys)
10170 (let* ((out (assoc-ref outputs "out")))
10171 (with-directory-excursion out
10172 (remove-store-references "bin/proot")
10173 #t))))))
10174 ((#:allowed-references _ '("out"))
10175 '("out"))))))
10176
10177(define-public cpuid
10178 (package
10179 (name "cpuid")
10180 (version "20230614")
10181 (source (origin
10182 (method url-fetch)
10183 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
10184 version ".src.tar.gz"))
10185 (sha256
10186 (base32
10187 "1s54qc1j10d765r05kw9pzwzaxq2b0nndq2ifwq7cq62xx2k1j5i"))))
10188 (build-system gnu-build-system)
10189 (arguments
10190 (list #:make-flags
10191 #~(list (string-append "CC=" #$(cc-for-target)))
10192 #:tests? #f ; no tests
10193 #:phases
10194 #~(modify-phases %standard-phases
10195 (delete 'configure) ; no configure script
10196 (add-before 'install 'fix-makefile
10197 (lambda* (#:key outputs #:allow-other-keys)
10198 (substitute* "Makefile"
10199 (("\\$\\(BUILDROOT\\)/usr")
10200 (assoc-ref outputs "out"))))))))
10201 (inputs (list perl))
10202 (supported-systems '("i686-linux" "x86_64-linux"))
10203 (home-page "https://www.etallen.com/cpuid.html")
10204 (synopsis "Dump x86 CPUID processor information")
10205 (description "cpuid dumps detailed information about the CPU(s) gathered
10206from the CPUID instruction, and also determines the exact model of CPU(s). It
10207supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
10208NexGen, Rise, and SiS CPUs.")
10209 (license license:gpl2+)))
10210
10211(define-public jmtpfs
10212 (package
10213 (name "jmtpfs")
10214 (version "0.5")
10215 (source
10216 (origin
10217 (method git-fetch)
10218 (uri (git-reference
10219 (url "https://github.com/JasonFerrara/jmtpfs")
10220 (commit (string-append "v" version))))
10221 (file-name (git-file-name name version))
10222 (sha256
10223 (base32
10224 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
10225 (build-system gnu-build-system)
10226 (inputs
10227 (list file fuse-2 libmtp))
10228 (native-inputs
10229 (list pkg-config))
10230 (home-page "https://github.com/JasonFerrara/jmtpfs")
10231 (synopsis "Use a FUSE file system to access data over MTP")
10232 (description "jmtpfs uses @acronym{FUSE, File system in USEr space} to
10233provide access to data over @acronym{MTP, the Media Transfer Protocol}.
10234Unprivileged users can mount the MTP device as a file system.")
10235 (license license:gpl3)))
10236
10237(define-public procenv
10238 (package
10239 (name "procenv")
10240 (version "0.60")
10241 (source
10242 (origin
10243 (method git-fetch)
10244 (uri (git-reference
10245 (url "https://github.com/jamesodhunt/procenv")
10246 (commit version)))
10247 (file-name (git-file-name name version))
10248 (sha256
10249 (base32 "00d7q0h4qjc8lg435lq77lp2fx6ikm5piq90m81mr1dqqna1g6pz"))))
10250 (build-system gnu-build-system)
10251 (native-inputs
10252 (list pkg-config
10253 ;; For tests.
10254 check groff))
10255 (inputs
10256 (list expat libcap libselinux))
10257 (synopsis "Utility to show process environment")
10258 (description
10259 "Procenv is a command-line tool that displays as much detail about
10260itself and its environment as possible. It can be used as a test
10261tool, to understand the type of environment a process runs in, and for
10262comparing system environments.")
10263 (home-page "https://github.com/jamesodhunt/procenv/")
10264 (license license:gpl3+)))
10265
10266(define-public cassini-headers
10267 (let ((commit "9a8a738a879f007849fbc69be8e3487a4abf0952")
10268 (revision "0"))
10269 (package
10270 (name "cassini-headers")
10271 (version (git-version "2.0.0" ;per .spec file
10272 revision commit))
10273 (home-page "https://github.com/HewlettPackard/shs-cassini-headers")
10274 (source (origin
10275 (method git-fetch)
10276 (uri (git-reference (url home-page) (commit commit)))
10277 (file-name (git-file-name name version))
10278 (sha256
10279 (base32
10280 "0a54vwfr29n0i392wdap7rzmq0lb8mxa17d8yljdbm0kzrq48csz"))))
10281 (build-system copy-build-system)
10282 (arguments
10283 (list #:install-plan
10284 #~'(("include" "include")
10285 ("share/cassini-headers" "share/cassini-headers"))))
10286 (synopsis "Cassini network hardware definitions and headers")
10287 (description
10288 "This package provides hardware definitions and C headers for use by
10289the Linux driver and by user-space applications for the Cassini/Slingshot
10290high-speed network interconnect made by HPE (formerly Cray). User-land
10291software uses @file{cxi_prov_hw.h} from this package.")
10292 ;; As per include/cxi_prov_hw.h it is __aarch64__ or __x86_64__ only.
10293 (supported-systems '("x86_64-linux" "aarch64-linux"))
10294 (license (list license:gpl2 license:bsd-2))))) ;dual-licensed
10295
10296(define-public cxi-driver
10297 (let ((commit "5f0ec0ead6ef3f98542a2ef5e76b89d14dd22150")
10298 (revision "0"))
10299 (package
10300 (name "cxi-driver")
10301 (version (git-version "1.0.0" ;per .spec file
10302 revision commit))
10303 (home-page "https://github.com/HewlettPackard/shs-cxi-driver")
10304 (source
10305 (origin
10306 (method git-fetch)
10307 (uri (git-reference (url home-page) (commit commit)))
10308 (file-name (git-file-name name version))
10309 (sha256
10310 (base32
10311 "19cly014ihgdidrc1aki2xsbfhpc0g73v0vxcky8r27xza7rz5bg"))))
10312 ;; TODO: Actually build the Linux driver.
10313 (build-system copy-build-system)
10314 (arguments
10315 (list #:install-plan #~'(("include" "include"))))
10316 (propagated-inputs (list cassini-headers))
10317 (synopsis "Linux driver for the Cassini/Slingshot interconnect")
10318 (description
10319 "This is the Linux driver for the Cray/HPE Cassini 1 and 2 high-speed
10320network interconnect (aka. Slingshot), and its Ethernet driver. It includes
10321the @file{uapi/misc/cxi.h} C header file for use by user-land software.
10322
10323Currently the Linux driver itself is missing from this package.")
10324 (license license:gpl2+))))
10325
10326(define-public libcxi
10327 (package
10328 (name "libcxi")
10329 (version "12.0.1")
10330 (home-page "https://github.com/HewlettPackard/shs-libcxi")
10331 (source
10332 (origin
10333 (method git-fetch)
10334 (uri (git-reference (url home-page)
10335 (commit (string-append "release/shs-" version))))
10336 (file-name (git-file-name name version))
10337 (sha256
10338 (base32 "1pk2mdkkgiic7nnmhx3iwvgrnxva3qqk2wyni0yhxjciln0hq7s7"))))
10339 (build-system gnu-build-system)
10340 (arguments
10341 (list #:configure-flags
10342 #~(list "--disable-static"
10343 (string-append "--with-udevrulesdir="
10344 #$output "/lib/udev/rules.d"))
10345
10346 #:phases
10347 #~(modify-phases %standard-phases
10348 (add-before 'configure 'set-cassini-file-names
10349 (lambda* (#:key inputs #:allow-other-keys)
10350 (substitute* "utils/cxi_dump_csrs.py"
10351 (("/usr/share/cassini-headers/csr_defs.json")
10352 (search-input-file
10353 inputs
10354 "/share/cassini-headers/csr_defs.json"))))))))
10355 (native-inputs (list autoconf
10356 automake
10357 libtool
10358 pkg-config
10359 python-wrapper))
10360 (inputs (list libconfig
10361 libuv
10362 fuse-2
10363 libyaml
10364 libnl
10365 numactl
10366 eudev
10367 (list lm-sensors "lib")))
10368 (propagated-inputs (list cassini-headers cxi-driver))
10369 (synopsis "Interface to the Cassini/Slingshot high-speed interconnect")
10370 (description
10371 "Libcxi provides applications with a low-level interface to the
10372Cray/HPE Cassini high-speed @acronym{NIC, network interface controller}, also
10373known as Slingshot.")
10374
10375 ;; License is spelled out in 'cray-libcxi.spec' and in source file
10376 ;; headers.
10377 (license (list license:lgpl2.1+ license:bsd-3)))) ;dual-licensed
10378
10379(define-public libfabric
10380 (package
10381 (name "libfabric")
10382 (version "2.3.0")
10383 (source
10384 (origin
10385 (method url-fetch)
10386 (uri
10387 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
10388 version "/libfabric-" version ".tar.bz2"))
10389 (sha256
10390 (base32 "02gb12ijj19aad4c3dwckrrnjlsmy9fizkgw8a5zdzpqd3lgq60x"))))
10391 (build-system gnu-build-system)
10392 (inputs
10393 (let ((if-supported ;XXX: modified from openmpi
10394 (lambda (package . extra)
10395 (if (and (not (%current-target-system))
10396 (member (%current-system)
10397 (package-transitive-supported-systems package)))
10398 (cons package extra)
10399 '()))))
10400 (append (list rdma-core libnl)
10401 (if-supported psm)
10402 (if-supported psm2)
10403 (if-supported libcxi curl json-c))))
10404 (arguments
10405 (list #:configure-flags
10406 #~(append (if #$(target-64bit?)
10407 (list "--enable-efa")
10408 '())
10409 (list #$@(if (this-package-input "libcxi")
10410 #~("--enable-cxi")
10411 #~())
10412 "--enable-verbs"))
10413 #:phases
10414 #~(modify-phases %standard-phases
10415 (add-after 'install 'remove-libtool-archive
10416 (lambda _
10417 ;; 'libfabric.la' has '-ljson-c' without a corresponding
10418 ;; '-L' in 'dependency_libs', which in turn causes users
10419 ;; such as Open MPI to fail at link time due to '-ljson-c'
10420 ;; not being found, even when building a shared library.
10421 ;; So, remove the .la file.
10422 (delete-file
10423 (string-append #$output
10424 "/lib/libfabric.la")))))))
10425 (home-page "https://ofiwg.github.io/libfabric/")
10426 (synopsis "Open Fabric Interfaces")
10427 (description
10428 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
10429communication services to applications. OFI is best described as a collection
10430of libraries and applications used to export fabric services. The key
10431components of OFI are: application interfaces, provider libraries, kernel
10432services, daemons, and test applications.
10433
10434Libfabric is a core component of OFI. It is the library that defines and
10435exports the user-space API of OFI, and is typically the only software that
10436applications deal with directly. It works in conjunction with provider
10437libraries, which are often integrated directly into libfabric.")
10438 (license (list license:bsd-2 license:gpl2)))) ;dual
10439
10440(define-public libfabric-1 ;needed by Open MPI 4.x
10441 (package
10442 (inherit libfabric)
10443 (version "1.22.0")
10444 (source
10445 (origin
10446 (method url-fetch)
10447 (uri
10448 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
10449 version "/libfabric-" version ".tar.bz2"))
10450 (sha256
10451 (base32 "1znmw83rmippv0fwz0x7lgylfk17dr9ckll8lrm4z7kclspnqpj8"))))))
10452
10453(define-public psm
10454 (package
10455 (name "psm")
10456 (version "3.3.20170428")
10457 (home-page "https://github.com/intel/psm")
10458 (source
10459 (origin
10460 (method git-fetch)
10461 (uri (git-reference (url home-page)
10462 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
10463 (file-name (string-append "psm-" version ".tar.gz"))
10464 (sha256
10465 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
10466 (patches (search-patches
10467 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
10468 "psm-ldflags.patch" ; build shared lib with LDFLAGS
10469 "psm-repro.patch" ; reproducibility
10470 "psm-disable-memory-stats.patch"))
10471 (modules '((guix build utils)))
10472 (snippet
10473 ;; That file declares its own 'strlcat' as static. To avoid a
10474 ;; conflict with the function now in glibc 2.39, give it a
10475 ;; different name.
10476 #~(substitute* "ptl_ips/ips_proto_dump.c"
10477 (("strlcat")
10478 "psm_custom_strlcat")))))
10479 (build-system gnu-build-system)
10480 (outputs '("out" "debug"))
10481 (inputs `(("libuuid" ,util-linux "lib")))
10482 (arguments
10483 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
10484 ,(string-append "INSTALL_PREFIX=" %output)
10485 ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
10486 " -funwind-tables -O3 -g3"
10487 " -DPSM_USE_SYS_UUID"
10488 " -Wno-strict-aliasing -DNVALGRIND"
10489 " -fcommon")
10490 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
10491 #:tests? #f
10492 #:phases (modify-phases %standard-phases
10493 (delete 'configure)
10494 (add-after 'unpack 'patch-/usr/include
10495 (lambda _
10496 (substitute* "Makefile"
10497 (("\\$\\{DESTDIR}/usr/include")
10498 (string-append %output "/include")))
10499 (substitute* "Makefile"
10500 (("/lib64") "/lib"))
10501 #t))
10502 (add-after 'unpack 'patch-sysmacros
10503 (lambda _
10504 (substitute* "ipath/ipath_proto.c"
10505 (("#include <sys/poll.h>" m)
10506 (string-append m "\n"
10507 "#include <sys/sysmacros.h>")))
10508 #t)))))
10509 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
10510 (description
10511 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
10512communications interface for the True Scale family of products. PSM users are
10513enabled with mechanisms necessary to implement higher level communications
10514interfaces in parallel environments.")
10515 ;; Only Intel-compatible processors are supported.
10516 (supported-systems '("i686-linux" "x86_64-linux"))
10517 (license (list license:bsd-2 license:gpl2)))) ;dual
10518
10519(define-public snapscreenshot
10520 (package
10521 (name "snapscreenshot")
10522 (version "1.0.14.3")
10523 (source
10524 (origin
10525 (method url-fetch)
10526 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
10527 name "-" version ".tar.bz2"))
10528 (sha256
10529 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
10530 (build-system gnu-build-system)
10531 (arguments
10532 `(#:make-flags
10533 (let ((out (assoc-ref %outputs "out")))
10534 (list (string-append "BINDIR=" out "/bin")
10535 (string-append "MANDIR=" out "/share/man")))
10536 #:tests? #f ; no test suite
10537 #:phases
10538 (modify-phases %standard-phases
10539 (delete 'configure) ; ./configure is a snarky no-op
10540 (add-before 'install 'fix-ownership
10541 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
10542 (lambda _
10543 (substitute* "depfun.mak"
10544 ((" -o bin -g bin ") " "))
10545 #t))
10546 (add-before 'install 'create-output-directories
10547 (lambda* (#:key outputs #:allow-other-keys)
10548 (let ((out (assoc-ref outputs "out")))
10549 (mkdir-p (string-append out "/share/man/man1"))
10550 #t))))))
10551 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
10552 (synopsis "Take screenshots of one or more Linux text consoles")
10553 (description
10554 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
10555Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
10556relevant @file{/dev/vcs*} file(s).")
10557 (license license:gpl2)))
10558
10559(define-public fbcat
10560 (package
10561 (name "fbcat")
10562 (version "0.5.2")
10563 (source
10564 (origin
10565 (method url-fetch)
10566 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
10567 version "/" name "-" version ".tar.gz"))
10568 (sha256
10569 (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
10570 (build-system gnu-build-system)
10571 (inputs
10572 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
10573 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
10574 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
10575 `(("pnmtopng" ,netpbm)))
10576 (outputs (list "out" "fbgrab"))
10577 (arguments
10578 `(#:make-flags
10579 (list "CC=gcc"
10580 (string-append "PREFIX=" (assoc-ref %outputs "out")))
10581 #:tests? #f ; no tests
10582 #:phases
10583 (modify-phases %standard-phases
10584 (delete 'configure) ; no configure script
10585 (add-after 'build 'qualify-references
10586 (lambda* (#:key inputs outputs #:allow-other-keys)
10587 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
10588 (out (assoc-ref outputs "out")))
10589 (substitute* "fbgrab"
10590 (("fbcat" all)
10591 (string-append out "/bin/" all))
10592 (("pnmtopng" all)
10593 (string-append pnmtopng "/bin/" all))))))
10594 (add-after 'install 'split-fbgrab-output
10595 (lambda* (#:key outputs #:allow-other-keys)
10596 (let* ((out (assoc-ref outputs "out"))
10597 (out:fbgrab (assoc-ref outputs "fbgrab")))
10598 (for-each (lambda (file)
10599 (let ((old (string-append out "/" file))
10600 (new (string-append out:fbgrab "/" file)))
10601 (mkdir-p (dirname new))
10602 (rename-file old new)))
10603 (list "bin/fbgrab"
10604 "share/man/man1/fbgrab.1"))))))))
10605 (home-page "https://jwilk.net/software/fbcat")
10606 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
10607 (description
10608 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
10609a dump thereof. It supports a wide range of drivers and pixel formats.
10610
10611@command{fbcat} can take screenshots of virtually any application that can be
10612made to write its output to the framebuffer, including (but not limited to)
10613text-mode or graphical applications that don't use a display server.
10614
10615Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
10616emulates the behaviour of Gunnar Monell's older fbgrab utility.")
10617 (license license:gpl2)))
10618
10619(define-public fbgrab
10620 (package
10621 (name "fbgrab")
10622 (version "1.5")
10623 (source (origin
10624 (method git-fetch)
10625 (uri (git-reference
10626 (url "https://github.com/GunnarMonell/fbgrab")
10627 (commit version)))
10628 (file-name (git-file-name name version))
10629 (sha256
10630 (base32
10631 "1npn7l8jg0nhjraybjl38v8635zawzmn06ql3hs3vhci1vi1r90r"))))
10632 (build-system gnu-build-system)
10633 (arguments
10634 (list #:tests? #f ;no test suite
10635 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
10636 (string-append "DESTDIR=" #$output))
10637 #:phases #~(modify-phases %standard-phases
10638 (add-after 'unpack 'strip-/usr-prefix
10639 (lambda _
10640 (substitute* "Makefile"
10641 (("/usr") ""))))
10642 (delete 'configure))))
10643 (inputs (list libpng zlib))
10644 (home-page "https://github.com/GunnarMonell/fbgrab")
10645 (synopsis "Linux framebuffer screenshot/conversion utility")
10646 (description "FBGrab is a framebuffer screenshot program that captures the
10647Linux framebuffer and converts it to a PNG image. It can also convert a
10648framebuffer dump file (copy) to a PNG image.")
10649 (license license:gpl2))) ;GPL 2.0 only (per SPDX identifier in fbgrab.c)
10650
10651(define-public libcgroup
10652 (package
10653 (name "libcgroup")
10654 (version "3.2.0")
10655 (home-page "https://github.com/libcgroup/libcgroup")
10656 (source
10657 (origin
10658 (method url-fetch)
10659 (uri (string-append
10660 "https://github.com/libcgroup/libcgroup/releases/download/v"
10661 version "/" name "-" version ".tar.gz"))
10662 (sha256
10663 (base32 "1zmxhqp8kj2n7yvj82nsy5sx07yrxj4r37w41lz5q8bpqgbc43ws"))))
10664 (build-system gnu-build-system)
10665 (arguments
10666 ;; Tests are virtualized with lxc, it is not very feasible
10667 ;; to make them executable under guix build. Also, note that
10668 ;; origin is using source tarball release which is prepared
10669 ;; after testing.
10670 (list #:tests? #f
10671 #:configure-flags
10672 #~'("--disable-systemd")))
10673 (native-inputs
10674 (list bison flex))
10675 (inputs
10676 (list linux-pam))
10677 (synopsis "Control groups management tools")
10678 (description "Control groups is Linux kernel method for process resource
10679restriction, permission handling and more. This package provides userspace
10680interface to this kernel feature.")
10681 (license license:lgpl2.1)))
10682
10683(define-public mbpfan
10684 (package
10685 (name "mbpfan")
10686 (version "2.4.0")
10687 (source
10688 (origin
10689 (method git-fetch)
10690 (uri (git-reference
10691 (url "https://github.com/dgraziotin/mbpfan")
10692 (commit (string-append "v" version))))
10693 (file-name (git-file-name name version))
10694 (sha256
10695 (base32 "146sshsjafi26n741jvi9mdbazwf74jlacxfwkky4fhbq98idlhp"))))
10696 (build-system gnu-build-system)
10697 (arguments
10698 (list #:tests? #f ; tests ask to be run as root
10699 #:make-flags
10700 #~(list (string-append "DESTDIR=" #$output)
10701 (string-append "CC=" #$(cc-for-target)))
10702 #:phases
10703 #~(modify-phases %standard-phases
10704 (add-after 'unpack 'patch-paths
10705 (lambda _
10706 (substitute* "Makefile"
10707 (("/usr") ""))))
10708 (delete 'configure)))) ; there's no configure phase
10709 (home-page "https://github.com/dgraziotin/mbpfan")
10710 (synopsis "Control fan speed on Macbooks")
10711 (description
10712 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
10713the @code{coretemp} module and sets the fan speed using the @code{applesmc}
10714module. It can be executed as a daemon or in the foreground with root
10715privileges.")
10716 (license license:gpl3+)))
10717
10718(define-public psm2
10719 (package
10720 (name "psm2")
10721 (version "12.0")
10722 (source (origin
10723 (method git-fetch)
10724 (uri (git-reference
10725 (url "https://github.com/intel/opa-psm2")
10726 ;; tag 'psm-v12.0' = commit ad5dd1b
10727 (commit (string-append "psm-v" version))))
10728 (file-name (git-file-name name version))
10729 (sha256
10730 (base32
10731 "04nar65ac11qqx41vkfs7iip8kfiah0zms7l4rmsxncpiz2iqfik"))
10732 (patches
10733 (search-patches
10734 "psm2-compile-ctor-without-avx.patch"))
10735 (modules '((guix build utils)))
10736 (snippet
10737 ;; That file declares its own 'strlcat' as static. To avoid a
10738 ;; conflict with the function now in glibc 2.39, give it a
10739 ;; different name.
10740 #~(substitute* "ptl_ips/ips_proto_dump.c"
10741 (("strlcat")
10742 "psm2_custom_strlcat")))))
10743 (build-system gnu-build-system)
10744 (arguments
10745 (list #:make-flags
10746 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
10747 #:tests? #f
10748 #:phases #~(modify-phases %standard-phases
10749 (delete 'configure)
10750 (add-after 'unpack 'patch-Makefiles
10751 (lambda _
10752 (substitute* "Makefile"
10753 (("/lib64") "/lib")
10754 (("/usr") ""))
10755 (substitute* "compat/Makefile"
10756 (("/lib64") "/lib")
10757 (("/usr") ""))))
10758 (replace 'install
10759 (lambda _
10760 (setenv "DESTDIR" #$output)
10761 (invoke "make" "install"))))))
10762 (inputs
10763 (list rdma-core numactl))
10764 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
10765 (description
10766 "This package is low-level user-level Intel's communications interface.
10767The PSM2 API is a high-performance vendor-specific protocol that provides a
10768low-level communications interface for the Intel Omni-Path family of
10769high-speed networking devices.")
10770 (home-page "https://github.com/intel/opa-psm2")
10771 ;; Only the x86_64 architecture is supported.
10772 (supported-systems '("x86_64-linux"))
10773 (license (list license:bsd-3 license:gpl2)))) ; dual
10774
10775(define-public libpfm4
10776 (package
10777 (name "libpfm4")
10778 (version "4.9.0")
10779 (source (origin
10780 (method url-fetch)
10781 (uri (string-append "mirror://sourceforge/perfmon2/"
10782 name "/libpfm-" version ".tar.gz"))
10783 (sha256
10784 (base32
10785 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
10786 (build-system gnu-build-system)
10787 (arguments
10788 '(#:modules ((guix build utils)
10789 (guix build gnu-build-system))
10790 #:phases (modify-phases %standard-phases
10791 (delete 'configure)
10792 (delete 'check)
10793 (replace 'build
10794 (lambda* (#:key inputs outputs #:allow-other-keys)
10795 (let* ((out (assoc-ref outputs "out")))
10796 (setenv "CC" "gcc")
10797 (setenv "CFLAGS" "-Wno-format-truncation")
10798 (invoke "make")
10799 #t)))
10800 (replace 'install
10801 (lambda* (#:key outputs #:allow-other-keys)
10802 (let* ((out (assoc-ref outputs "out")))
10803 (invoke "make"
10804 (string-append "PREFIX=" out)
10805 "install")
10806 #t))))))
10807 (synopsis "Performance event monitoring library")
10808 (description
10809 "This package provides a library called libpfm4, which is used to develop
10810monitoring tools exploiting the performance monitoring events such as those
10811provided by the Performance Monitoring Unit (PMU) of modern processors.
10812
10813Libpfm4 helps convert from an event name, expressed as a string, to the event
10814encoding that is either the raw event as documented by the hardware vendor or
10815the OS-specific encoding. In the latter case, the library is able to prepare
10816the OS-specific data structures needed by the kernel to setup the event.
10817
10818libpfm4 provides support for the @code{perf_events} interface, which was
10819introduced in Linux 2.6.31.")
10820 (home-page "https://perfmon2.sourceforge.net/")
10821 (license license:expat)))
10822
10823(define-public libnfnetlink
10824 (package
10825 (name "libnfnetlink")
10826 (version "1.0.2")
10827 (source (origin
10828 (method url-fetch)
10829 (uri (string-append
10830 "https://www.netfilter.org/projects/libnfnetlink/files/"
10831 "libnfnetlink-" version ".tar.bz2"))
10832 (sha256
10833 (base32
10834 "0xn3rcrzxr6g82kfxzs9bqn2zvl2kf2yda30drwb9vr6sk1wfr5h"))))
10835 (build-system gnu-build-system)
10836 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
10837 (synopsis "Low-level netfilter netlink communication library")
10838 (description
10839 "@code{libnfnetlink} is the low-level library for netfilter related
10840kernel/userspace communication. It provides a generic messaging
10841infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
10842nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
10843management tools in userspace.")
10844 (license license:gpl2)))
10845
10846(define-public libinih
10847 (package
10848 (name "libinih")
10849 (version "57")
10850 (source (origin
10851 (method git-fetch)
10852 (uri (git-reference
10853 (url "https://github.com/benhoyt/inih")
10854 (commit (string-append "r" version))))
10855 (file-name (git-file-name name version))
10856 (sha256
10857 (base32
10858 "03hpyahdkipm5wfalj2xkz6y9ncd9zrlhnf7vap6lr56jj2fz2bb"))))
10859 (build-system meson-build-system)
10860 ;; Install static libraries for use by the initrd's xfsprogs/static.
10861 (outputs (list "out" "static"))
10862 (arguments
10863 `(#:configure-flags
10864 (list "-Ddistro_install=true"
10865 "-Ddefault_library=both")
10866 #:phases
10867 (modify-phases %standard-phases
10868 (add-after 'install 'separate-static
10869 (lambda* (#:key outputs #:allow-other-keys)
10870 (let ((out (assoc-ref outputs "out"))
10871 (static (assoc-ref outputs "static")))
10872 (with-directory-excursion out
10873 (for-each (lambda (source)
10874 (let ((target (string-append static "/" source)))
10875 (mkdir-p (dirname target))
10876 (rename-file source target)))
10877 (find-files "lib" "\\.a$")))))))))
10878 (home-page "https://github.com/benhoyt/inih")
10879 (synopsis "Simple .INI parser library for C")
10880 (description "The inih (INI Not Invented Here) library is a simple .INI file
10881parser written in C. It's only a couple of pages of code, and it was designed to
10882be small and simple, so it's good for embedded systems. It's also more or less
10883compatible with Python's ConfigParser style of .INI files, including RFC
10884822-style multi-line syntax and name: value entries.")
10885 (license license:bsd-3)))
10886
10887(define-public simpleini
10888 (let ((commit "6048871ea9ee0ec24be5bd099d161a10567d7dc2")
10889 (revision "1"))
10890 (package
10891 (name "simpleini")
10892 (version (git-version "4.22" revision commit))
10893 (source (origin
10894 (method git-fetch)
10895 (uri (git-reference
10896 (url "https://github.com/brofield/simpleini")
10897 (commit commit)))
10898 (file-name (git-file-name name version))
10899 (sha256
10900 (base32
10901 "1szaflnrzw1zx9v5g6mbbiaf9wfglp4n4jjq2793k9ryz3qxil9j"))))
10902 (build-system cmake-build-system)
10903 (arguments
10904 (list #:configure-flags #~(list "-DSIMPLEINI_USE_SYSTEM_GTEST=ON")))
10905 (native-inputs (list googletest))
10906 (home-page "https://github.com/brofield/simpleini")
10907 (synopsis "Simple API to read and write INI-style files")
10908 (description
10909 "SimpleIni provides a simple API to read and write INI-style
10910configuration files. It supports data files in ASCII, MBCS and Unicode.")
10911 (license license:expat))))
10912
10913(define-public xfsprogs
10914 (package
10915 (name "xfsprogs")
10916 (version "6.12.0")
10917 (source (origin
10918 (method url-fetch)
10919 (uri (string-append
10920 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
10921 "xfsprogs-" version ".tar.gz"))
10922 (sha256
10923 (base32
10924 "1n46n27fxx1137kni3drrhzhp1l8ksxabcsmi8yzxbhpbnl4q293"))))
10925 (build-system gnu-build-system)
10926 (outputs (list "out" "python"))
10927 (arguments
10928 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
10929 #:configure-flags
10930 (list "--disable-static")
10931 #:make-flags
10932 (list "V=1")
10933 #:phases
10934 (modify-phases %standard-phases
10935 (add-after 'install 'separate-python-output
10936 (lambda* (#:key outputs #:allow-other-keys)
10937 (let ((out (assoc-ref outputs "out"))
10938 (python (assoc-ref outputs "python")))
10939 (for-each
10940 (lambda (script)
10941 (mkdir-p (string-append python (dirname script)))
10942 (rename-file (string-append out script)
10943 (string-append python script)))
10944 (list "/sbin/xfs_scrub_all")))))
10945 (add-after 'install 'install-headers
10946 (lambda* (#:key make-flags #:allow-other-keys)
10947 (apply invoke "make" "install-dev" make-flags))))))
10948 (native-inputs
10949 ;; riscv64 needs >= gcc-13.3.0 for liburcu.
10950 (append
10951 (if (target-riscv64?)
10952 (list gcc-14)
10953 '())
10954 (list gettext-minimal)))
10955 (inputs
10956 `(("libinih" ,libinih)
10957 ("liburcu" ,liburcu)
10958 ("libuuid" ,util-linux "lib")
10959 ("python" ,python-wrapper)))
10960 (home-page "https://xfs.wiki.kernel.org/")
10961 (synopsis "XFS file system tools")
10962 (description "This package provides commands to create and check XFS
10963file systems.")
10964 ;; The library "libhandle" and the headers in "xfslibs-dev" are
10965 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
10966 (license (list license:gpl2 license:lgpl2.1))))
10967
10968(define-public xfsprogs-5.9
10969 (package
10970 (inherit xfsprogs)
10971 (name "xfsprogs")
10972 (version "5.9.0")
10973 (source (origin
10974 (method url-fetch)
10975 (uri (string-append
10976 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
10977 "xfsprogs-" version ".tar.gz"))
10978 (sha256
10979 (base32
10980 "13xkn9jpmwp4fm9r68vhgznkmxhnv83n2b39mhy2qdaph90w2a1l"))))
10981 (arguments
10982 (substitute-keyword-arguments (package-arguments xfsprogs)
10983 ((#:configure-flags configure-flags '())
10984 `(cons "--enable-gettext=no"
10985 ,configure-flags))))
10986 (native-inputs
10987 (modify-inputs (package-native-inputs xfsprogs)
10988 (delete "gettext-minimal")))))
10989
10990(define-public xfsprogs/static
10991 (package
10992 (inherit xfsprogs)
10993 (name "xfsprogs-static")
10994 (outputs (list "out"))
10995 (arguments
10996 (substitute-keyword-arguments (package-arguments xfsprogs)
10997 ((#:configure-flags configure-flags '())
10998 `(append ,configure-flags
10999 (list "--enable-static")))
11000 ((#:make-flags make-flags ''())
11001 `(cons* "LLDFLAGS=-all-static" ,make-flags))
11002 ((#:phases _ ''())
11003 `(modify-phases %standard-phases
11004 (add-after 'install 'delete-useless-files
11005 (lambda* (#:key outputs #:allow-other-keys)
11006 (with-directory-excursion (assoc-ref outputs "out")
11007 (for-each delete-file-recursively
11008 (list "include" "lib")))))))))
11009 (inputs
11010 `(("libinih:static" ,libinih "static")
11011 ("util-linux:static" ,util-linux "static")
11012 ,@(remove (match-lambda
11013 ((label . _)
11014 (member label '("python"))))
11015 (package-inputs xfsprogs))))
11016 (synopsis "Statically linked XFS file system tools")))
11017
11018(define-public xfs_repair/static
11019 (package
11020 (name "xfs_repair-static")
11021 (version (package-version xfsprogs/static))
11022 (source #f)
11023 (build-system trivial-build-system)
11024 (arguments
11025 `(#:modules ((guix build utils))
11026 #:builder
11027 (begin
11028 (use-modules (guix build utils))
11029 (let* ((xfsprogs (assoc-ref %build-inputs "xfsprogs"))
11030 (out (assoc-ref %outputs "out"))
11031 (sbin (string-append out "/sbin")))
11032 (install-file (string-append xfsprogs "/sbin/xfs_repair") sbin)
11033 (with-directory-excursion sbin
11034 (remove-store-references "xfs_repair"))))))
11035 (inputs
11036 `(("xfsprogs" ,xfsprogs/static)))
11037 (home-page (package-home-page xfsprogs/static))
11038 (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
11039 (description
11040 "This package provides a statically linked @command{xfs_repair} taken
11041from the xfsprogs package. It is meant to be used in initrds.")
11042 (license (package-license xfsprogs/static))))
11043
11044(define-public genext2fs
11045 (package
11046 (name "genext2fs")
11047 (version "1.5.0")
11048 (source (origin
11049 (method git-fetch)
11050 (uri (git-reference
11051 (url "https://github.com/bestouff/genext2fs")
11052 (commit "474111097321f03de9e009aa9f7d4a8948e310b2")))
11053 (file-name (git-file-name name version))
11054 (sha256
11055 (base32 "14lgvml5zz99845ja47jpf4iirjzfqv36ffzachh3hw2ggji9c7l"))))
11056 (build-system gnu-build-system)
11057 (native-inputs
11058 (list autoconf automake))
11059 (home-page "https://github.com/bestouff/genext2fs")
11060 (synopsis "Generate ext2 file system as a normal user")
11061 (description "This package provides a program to generate an ext2
11062file system as a normal (non-root) user. It does not require you to mount
11063the image file to copy files on it, nor does it require that you become
11064the superuser to make device nodes.")
11065 (license license:gpl2)))
11066
11067(define-public fakeroot
11068 (package
11069 (name "fakeroot")
11070 (version "1.37.1.2")
11071 (source
11072 (origin
11073 ;; There are no tags in the repository, so take this snapshot.
11074 (method url-fetch)
11075 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
11076 "fakeroot/fakeroot_" version ".orig.tar.gz"))
11077 (file-name (string-append name "-" version ".tar.gz"))
11078 (sha256
11079 (base32 "091jym16c4m4qjf5yclksvx7nw4sl7v5yrkz6z46wrwaij99d54m"))
11080 (modules '((guix build utils)
11081 (ice-9 ftw)))
11082 (snippet
11083 `(begin
11084 ;; Delete pregenerated man page translations, but not the originals.
11085 (with-directory-excursion "doc"
11086 (for-each (lambda (language)
11087 (for-each delete-file
11088 (find-files language "\\.[0-9]$")))
11089 (scandir "."
11090 (lambda (file)
11091 (and (not (string-prefix? "." file))
11092 (eq? 'directory
11093 (stat:type (lstat file))))))))))))
11094 (build-system gnu-build-system)
11095 (arguments
11096 `(#:configure-flags
11097 (list "--disable-static")
11098 #:phases
11099 (modify-phases %standard-phases
11100 (add-after 'unpack 'patch-Makefile.am
11101 (lambda _
11102 (substitute* "Makefile.am"
11103 (("/bin/sh") (which "sh")))))
11104 (add-after 'unpack 'patch-script
11105 (lambda* (#:key inputs #:allow-other-keys)
11106 (substitute* "scripts/fakeroot.in"
11107 (("getopt")
11108 (string-append (assoc-ref inputs "util-linux")
11109 "/bin/getopt"))
11110 (("sed")
11111 (string-append (assoc-ref inputs "sed")
11112 "/bin/sed"))
11113 (("cat|cut" command)
11114 (string-append (assoc-ref inputs "coreutils")
11115 "/bin/" command)) )))
11116 (replace 'bootstrap
11117 (lambda _
11118 ;; The "preroll" script takes care of Autoconf and also
11119 ;; prepares the translated manuals.
11120 (invoke "sh" "./preroll")))
11121 (add-before 'configure 'setenv
11122 (lambda _
11123 (setenv "LIBS" "-lacl")))
11124 (add-before 'check 'prepare-check
11125 (lambda _
11126 (setenv "SHELL" (which "bash"))
11127 (setenv "VERBOSE" "1")
11128 (substitute* "test/t.touchinstall"
11129 ;; We don't have the name of the root user, so use ID=0.
11130 (("grep root") "grep \"\\<0\\>\""))
11131 (substitute* "test/tartest"
11132 ;; We don't have the name of the root group, so use ID=0.
11133 (("ROOTGROUP=root") "ROOTGROUP=0")
11134 ;; We don't have the name of the daemon user, so use IDs.
11135 (("daemon:sys") "1:3")
11136 (("daemon:") "1:"))
11137 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
11138 (substitute* "test/compare-tar"
11139 (("tar -tvf") "tar --numeric-owner -tvf")))))))
11140 (native-inputs
11141 (list autoconf-2.71 automake gettext-minimal libtool po4a
11142 perl sharutils xz)) ; for tests
11143 (inputs
11144 (list acl libcap util-linux sed coreutils))
11145 (synopsis "Run commands in an environment with fake root privileges")
11146 (description
11147 "@command{fakeroot} runs a command in an environment where it appears to
11148have root privileges for file manipulation. This is useful for allowing users
11149to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
11150them with root permissions and/or ownership.
11151
11152Without fakeroot, one would have to have root privileges to create the
11153constituent files of the archives with the correct permissions and ownership,
11154and then pack them up, or one would have to construct the archives directly,
11155without using the archiver.")
11156 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
11157 (license license:gpl3+)))
11158
11159(define-public fakechroot
11160 ;; XXX: Build from the change submitted at
11161 ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
11162 ;; against glibc 2.33. Switch back to the official repository on the next
11163 ;; release.
11164 (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
11165 (revision "0"))
11166 (package
11167 (name "fakechroot")
11168 (version (git-version "2.20.1" revision commit))
11169 (source (origin
11170 (method git-fetch)
11171 (uri (git-reference
11172 (url "https://github.com/lipnitsk/fakechroot")
11173 (commit commit)))
11174 (file-name (git-file-name name version))
11175 (sha256
11176 (base32
11177 "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
11178 (build-system gnu-build-system)
11179 (arguments
11180 ;; XXX: The tests heavily assume they run on an FHS system so for now
11181 ;; skip them.
11182 '(#:tests? #f
11183 #:configure-flags '("--disable-static")))
11184 (native-inputs (list autoconf automake libtool perl))
11185 (synopsis "Emulate @code{chroot} by overriding file system calls")
11186 (description
11187 "@command{fakechroot} runs a command in an environment were is additional
11188possibility to use @code{chroot} command without root privileges. This is
11189useful for allowing users to create own chrooted environment with possibility
11190to install another packages without need for root privileges.
11191
11192It works by providing @file{libfakechroot.so}, a shared library meant to be
11193set as @code{LD_PRELOAD} to override the C library file system functions.")
11194 (home-page "https://github.com/dex4er/fakechroot/")
11195 (license license:lgpl2.1+))))
11196
11197(define-public falcosecurity-libs
11198 (package
11199 (name "falcosecurity-libs")
11200 (version "0.20.0")
11201 (source (origin
11202 (method git-fetch)
11203 (uri (git-reference
11204 (url "https://github.com/falcosecurity/libs/")
11205 (commit version)))
11206 (file-name (git-file-name name version))
11207 (sha256
11208 (base32
11209 "041ir9wk44v7isidwl7fzxrjvs85j637wcr7xirasd8ysxa0r4qv"))
11210 (patches
11211 (search-patches
11212 "falcosecurity-libs-shared-build.patch"))))
11213 (build-system cmake-build-system)
11214 (arguments
11215 (list
11216 #:configure-flags
11217 #~(list "-DUSE_BUNDLED_DEPS=OFF"
11218 "-DBUILD_DRIVER=OFF"
11219 "-DENABLE_DKMS=OFF"
11220 "-DBUILD_LIBSCAP_MODERN_BPF=ON"
11221 "-DSCAP_FILES_SUITE_ENABLE=OFF" ;attempts to download scap files
11222 "-DBUILD_SHARED_LIBS=ON"
11223 #$(string-append "-DFALCOSECURITY_LIBS_VERSION=" version))
11224 ;; Only the libsinsp test suite is run, as the one for libscap requires
11225 ;; elevated privileges.
11226 #:modules '((guix build cmake-build-system)
11227 ((guix build gnu-build-system) #:prefix gnu:)
11228 (guix build utils))
11229 #:phases
11230 #~(modify-phases %standard-phases
11231 (add-after 'unpack 'disable-problematic-tests
11232 (lambda _
11233 (substitute* "userspace/libsinsp/test/user.ut.cpp"
11234 ;; The 'system_lookup' test assumes a root user
11235 ;; exists in the build environment.
11236 (("TEST_F\\(usergroup_manager_test, system_lookup)")
11237 "TEST_F(usergroup_manager_test, DISABLED_system_lookup)"))))
11238 (replace 'check
11239 (lambda* (#:rest args)
11240 (apply (assoc-ref gnu:%standard-phases 'check)
11241 #:test-target "run-unit-test-libsinsp" args)))
11242 (add-after 'install 'delete-src
11243 (lambda _
11244 (delete-file-recursively
11245 (string-append #$output "/src")))))))
11246 (native-inputs
11247 (list bpftool
11248 clang-18 ;avoid stack limit exceeded build error
11249 googletest
11250 pkg-config
11251 valijson)) ;header-only library
11252 (inputs
11253 (list elfutils))
11254 (propagated-inputs
11255 ;; The following inputs are in the 'Requires' field of libscap.pc,
11256 ;; libsinp.pc or libpman.pc.
11257 (list c-ares
11258 grpc
11259 jsoncpp
11260 libbpf
11261 libelf
11262 openssl
11263 protobuf
11264 uthash ;included in libscap headers
11265 zlib
11266 ;; These are in the 'Requires.private' field of libscap.pc and
11267 ;; libsinp.pc. They are required because the headers are installed
11268 ;; to a non-standard directory, and thus need to be found via the
11269 ;; 'Cflags' field, which in turn mandates that both the pkg-config
11270 ;; modules listed in the 'Requires' and 'Requires.private' be
11271 ;; available.
11272 curl
11273 re2
11274 tbb))
11275 (home-page "https://github.com/falcosecurity/libs/")
11276 (synopsis "Falco security libraries")
11277 (description "The Falco security libraries include @code{libsinsp} and
11278@code{libscap}. @code{libscap} manages the data capture process, while
11279@code{libsinsp} is a system inspection library that enriches events from
11280@code{libscap} with machine state. @code{libsinsp} also performs events
11281filtering with rule evaluation through its internal rule engine. These
11282libraries are used by the @command{sysdig} command-line utility.")
11283 (license license:asl2.0)))
11284
11285(define-public inputattach
11286 (package
11287 (name "inputattach")
11288 (version "0.42.0")
11289 (source (origin
11290 (method git-fetch)
11291 (uri (git-reference
11292 (url "https://github.com/linuxwacom/input-wacom")
11293 (commit (string-append "input-wacom-" version))))
11294 (file-name (git-file-name name version))
11295 (sha256
11296 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
11297 (build-system gnu-build-system)
11298 (arguments
11299 `(#:phases
11300 (modify-phases %standard-phases
11301 (delete 'bootstrap)
11302 (delete 'configure)
11303 (replace 'build
11304 (lambda* (#:key inputs #:allow-other-keys)
11305 (with-directory-excursion "inputattach"
11306 (invoke "gcc" "-O2" "-o" "inputattach"
11307 "inputattach.c"))))
11308 (delete 'check)
11309 (replace 'install
11310 (lambda* (#:key outputs #:allow-other-keys)
11311 (let ((target-dir (string-append
11312 (assoc-ref outputs "out")
11313 "/bin/")))
11314 (mkdir-p target-dir)
11315 (copy-file "inputattach/inputattach"
11316 (string-append target-dir
11317 "inputattach"))
11318 #t))))))
11319 (home-page "https://linuxwacom.github.io/")
11320 (synopsis "Dispatch input peripherals events to a device file")
11321 (description "inputattach dispatches input events from several device
11322types and interfaces and translates so that the X server can use them.")
11323 (license license:gpl2+)))
11324
11325(define-public keyd
11326 (package
11327 (name "keyd")
11328 (version "2.5.0")
11329 (source
11330 (origin
11331 (method git-fetch)
11332 (uri (git-reference
11333 (url "https://github.com/rvaiya/keyd")
11334 (commit (string-append "v" version))))
11335 (sha256
11336 (base32
11337 "0nkra6lwdjhjcwj6486cgy562n4bcp98fjgl52rj8pp76i15yad7"))))
11338 (arguments
11339 (list #:tests? #f ; tests require root
11340 #:make-flags
11341 #~(list (string-append "CC=" #$(cc-for-target))
11342 "PREFIX="
11343 (string-append "DESTDIR=" #$output))
11344 #:phases
11345 '(modify-phases
11346 %standard-phases
11347 (delete 'configure)))) ; no autoconf
11348 (build-system gnu-build-system)
11349 (inputs (list linux-libre-headers))
11350 (synopsis "Key remapping daemon for Linux")
11351 (description
11352 "Keyd is a keyboard remapping utility with intuitive ini configuration
11353file format. Keyd has several features, many of which are traditionally only
11354found in custom keyboard firmware like QMK.")
11355 (home-page "https://github.com/rvaiya/keyd")
11356 (license license:expat)))
11357
11358(define-public pipewire
11359 (package
11360 (name "pipewire")
11361 (version "1.4.5")
11362 (source (origin
11363 (method git-fetch)
11364 (uri (git-reference
11365 (url "https://gitlab.freedesktop.org/pipewire/pipewire")
11366 (commit version)))
11367 (file-name (git-file-name name version))
11368 (sha256
11369 (base32
11370 "1k3b412zspmx2v0finb5g8kns8xsynlnz48cmlcg7ch62av6kw75"))))
11371 (build-system meson-build-system)
11372 (arguments
11373 (list
11374 #:configure-flags
11375 #~(list (string-append "-Dudevrulesdir=" #$output "/lib/udev/rules.d")
11376 "-Dman=enabled"
11377 "-Drlimits-install=false"
11378 "-Dsession-managers=[]"
11379 "-Dsysconfdir=/etc"
11380 "-Dsystemd=disabled")))
11381 (native-inputs
11382 (list `(,glib "bin")
11383 pkg-config
11384 doxygen
11385 python
11386 python-docutils))
11387 (inputs (list alsa-lib
11388 avahi
11389 bluez
11390 dbus
11391 eudev
11392 ffmpeg
11393 gst-plugins-base
11394 gstreamer
11395 jack-2
11396 ldacbt
11397 libcamera
11398 libdrm
11399 libfdk
11400 libfreeaptx
11401 libsndfile
11402 libusb
11403 openssl ; raop sink
11404 libva
11405 pulseaudio
11406 readline ; for pw-cli
11407 sbc
11408 vulkan-headers
11409 vulkan-loader
11410 webrtc-audio-processing))
11411 (home-page "https://pipewire.org/")
11412 (synopsis "Server and user space API to deal with multimedia pipelines")
11413 (description
11414 "PipeWire is a project that aims to greatly improve handling of audio and
11415video under Linux. It aims to support the usecases currently handled by both
11416PulseAudio and Jack and at the same time provide same level of powerful handling
11417of Video input and output. It also introduces a security model that makes
11418interacting with audio and video devices from containerized applications easy,
11419with supporting Flatpak applications being the primary goal. Alongside Wayland
11420and Flatpak we expect PipeWire to provide a core building block for the future
11421of Linux application development.")
11422 (license license:lgpl2.0+)))
11423
11424(define-public pipewire-minimal
11425 ;; Used as libpipewire to reduce closure size and avoid dependency cycles.
11426 (hidden-package
11427 (package
11428 (inherit pipewire)
11429 (name "pipewire-minimal")
11430 (arguments
11431 (list
11432 #:configure-flags
11433 #~(list "-Dsession-managers=[]"
11434 "-Ddbus=disabled"
11435 "-Dflatpak=disabled"
11436 ;; XXX: Otherwise test_loop will fail with:
11437 ;; libgcc_s.so.1 must be installed for pthread_cancel to work
11438 (string-append "-Dc_link_args=-Wl,-rpath=" #$output "/lib"
11439 " -lgcc_s")
11440 "-Db_asneeded=false")))
11441 (native-inputs '())
11442 (inputs '()))))
11443
11444(define-public wireplumber
11445 (package
11446 (name "wireplumber")
11447 (version "0.5.10")
11448 (source
11449 (origin
11450 (method git-fetch)
11451 (uri (git-reference
11452 (url
11453 "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
11454 (commit version)))
11455 (file-name (git-file-name name version))
11456 (sha256
11457 (base32 "0z4k6vn1zcqa5878mrcsin79b74ckvrzlprfxi730aa55w5xb609"))))
11458 (build-system meson-build-system)
11459 (arguments
11460 `(#:configure-flags '("-Dsystemd=disabled"
11461 "-Dsystem-lua=true")))
11462 (native-inputs
11463 (list `(,glib "bin")
11464 pkg-config))
11465 (inputs (list dbus elogind glib lua pipewire))
11466 (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
11467 (synopsis "Session / policy manager implementation for PipeWire")
11468 (description "WirePlumber is a modular session / policy manager for
11469PipeWire and a GObject-based high-level library that wraps PipeWire's API,
11470providing convenience for writing the daemon's modules as well as external
11471tools for managing PipeWire.")
11472 (license license:expat)))
11473
11474(define-public wireplumber-minimal
11475 (let ((base wireplumber))
11476 (package
11477 (inherit base)
11478 (name "wireplumber-minimal")
11479 (arguments
11480 (substitute-keyword-arguments (package-arguments base)
11481 ((#:configure-flags flags ''())
11482 #~(cons "-Delogind=disabled" #$flags))))
11483 (inputs
11484 (modify-inputs (package-inputs base)
11485 (delete "elogind"))))))
11486
11487(define-public ell
11488 (package
11489 (name "ell")
11490 (version "0.79")
11491 (source (origin
11492 (method git-fetch)
11493 (uri (git-reference
11494 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
11495 (commit version)))
11496 (file-name (git-file-name name version))
11497 (sha256
11498 (base32
11499 "0l8pbgnza58ivknzl3nd6y46mfminhnb3iwq82msi6g282wv7np4"))
11500 (modules '((guix build utils)))
11501 (snippet
11502 #~(begin
11503 (substitute* "Makefile.am"
11504 ;; requires hwdb.bin
11505 (("unit/test-hwdb.*") ""))))))
11506 (build-system gnu-build-system)
11507 (arguments
11508 ;; Tests launch dbus-daemon instances that all try to bind to
11509 ;; "/tmp/ell-test-bus". Thus, we need to run them sequentially.
11510 '(#:parallel-tests? #f))
11511 (inputs
11512 (list dbus))
11513 (native-inputs
11514 (list autoconf automake libtool pkg-config procps))
11515 (home-page "https://01.org/ell")
11516 (synopsis "Embedded Linux Library")
11517 (description "The Embedded Linux* Library (ELL) provides core, low-level
11518functionality for system daemons. It typically has no dependencies other than
11519the Linux kernel, C standard library, and libdl (for dynamic linking). While
11520ELL is designed to be efficient and compact enough for use on embedded Linux
11521platforms, it is not limited to resource-constrained systems.")
11522 (license license:lgpl2.1+)))
11523
11524(define-public kexec-tools
11525 (package
11526 (name "kexec-tools")
11527 (version "2.0.31")
11528 (source (origin
11529 (method url-fetch)
11530 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
11531 "/kexec/kexec-tools-" version ".tar.xz"))
11532 (sha256
11533 (base32
11534 "0c9cj9xvcm81gcwnkvvh9vh82v59kdz5llmblc2wkqb6vh6kb3wa"))))
11535 (build-system gnu-build-system)
11536 (arguments
11537 ;; There are no automated tests.
11538 '(#:tests? #f))
11539 ;; This variant of binutils is used for the 64 bit support needed to
11540 ;; assemble the `purgatory/arch/i386/compat_x86_64.S' program on i686-linux.
11541 (native-inputs (list (make-ld-wrapper "ld-wrapper"
11542 #:binutils binutils)
11543 binutils))
11544 (home-page "https://projects.horms.net/projects/kexec/")
11545 (synopsis "Tools for booting directly into different kernels")
11546 (description "This package provides the @code{kexec} program and ancillary
11547utilities. Using @code{kexec}, it is possible to boot directly into a new
11548kernel from the context of an already-running kernel, bypassing the normal
11549system boot process.")
11550 (supported-systems (delete "riscv64-linux" %supported-systems))
11551 (license license:gpl2)))
11552
11553(define-public cachefilesd
11554 (package
11555 (name "cachefilesd")
11556 (version "0.10.10")
11557 (source (origin
11558 (method url-fetch)
11559 (uri (string-append
11560 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
11561 "/cachefilesd.git/snapshot/cachefilesd-"
11562 version ".tar.gz"))
11563 (sha256
11564 (base32
11565 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
11566 (build-system gnu-build-system)
11567 (outputs '("out"))
11568 (arguments
11569 `(#:tests? #f ; there are no tests
11570 #:make-flags
11571 (let ((prefix-dir (lambda (var dir)
11572 (string-append var "=" %output "/" dir))))
11573 (list (string-append "CC=" ,(cc-for-target))
11574 (prefix-dir "SBINDIR" "sbin/")
11575 (prefix-dir "ETCDIR" "etc/")
11576 (prefix-dir "MANDIR" "share/man/")))
11577 #:phases (modify-phases %standard-phases (delete 'configure))))
11578 (home-page "https://people.redhat.com/~dhowells/cachefs/")
11579 (synopsis "CacheFiles userspace management daemon")
11580 (description "@code{cachefilesd} is a userspace daemon that manages the
11581cache data store that is used by network file systems such as @code{AFS} and
11582@code{NFS} to cache data locally on disk. The content of the cache is
11583persistent over reboots.")
11584 (license license:gpl2+)))
11585
11586(define-public libbpf
11587 (package
11588 (name "libbpf")
11589 (version "1.5.0")
11590 (source
11591 (origin
11592 (method git-fetch)
11593 (uri (git-reference
11594 (url "https://github.com/libbpf/libbpf")
11595 (commit (string-append "v" version))))
11596 (file-name (git-file-name name version))
11597 (sha256
11598 (base32
11599 "0j7rm76g2ss09vksm4nm2g5yq7df2z5qpjr4h6kd3959sc1rvxnh"))))
11600 (build-system gnu-build-system)
11601 (arguments
11602 (list
11603 #:tests? #f ;self-tests run in QEMU
11604 #:make-flags
11605 #~(list (string-append "PREFIX=" #$output)
11606 (string-append "LIBDIR=$(PREFIX)/lib")
11607 (string-append "CC=" #$(cc-for-target)))
11608 #:phases
11609 #~(modify-phases %standard-phases
11610 (delete 'configure)
11611 (add-before 'build 'pre-build
11612 (lambda _
11613 (chdir "src")))
11614 (replace 'install
11615 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
11616 (apply (assoc-ref %standard-phases 'install)
11617 (append args
11618 (list #:make-flags
11619 (append (list "install"
11620 ;; Also install the kernel
11621 ;; user API (uAPI) headers.
11622 "install_uapi_headers")
11623 make-flags)))))))))
11624 (native-inputs (list pkg-config))
11625 (propagated-inputs (list elfutils zlib)) ;in Requires.private of libbpf.pc
11626 (home-page "https://github.com/libbpf/libbpf")
11627 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
11628 (description
11629 "Libbpf supports building BPF CO-RE-enabled applications, which, in
11630contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
11631headers.")
11632 (license (list license:lgpl2.1 license:bsd-2))))
11633
11634(define-public libbpf-0.8
11635 (package
11636 (inherit libbpf)
11637 (name "libbpf")
11638 (version "0.8.1")
11639 (source
11640 (origin
11641 (method git-fetch)
11642 (uri (git-reference
11643 (url "https://github.com/libbpf/libbpf")
11644 (commit (string-append "v" version))))
11645 (file-name (git-file-name name version))
11646 (sha256
11647 (base32
11648 "1zzpkk4x3f20483dzw43b3ml03d63vvkmqf4j8y3b61b67wm59bm"))))
11649 (arguments
11650 (list
11651 #:tests? #f ;self-tests run in QEMU
11652 #:make-flags
11653 #~(list (string-append "PREFIX=" #$output)
11654 (string-append "LIBDIR=$(PREFIX)/lib")
11655 (string-append "CC=" #$(cc-for-target)))
11656 #:phases #~(modify-phases %standard-phases
11657 (delete 'configure)
11658 (add-before 'build 'pre-build
11659 (lambda _
11660 (chdir "src"))))))
11661 (native-inputs (list pkg-config))
11662 (propagated-inputs (list elfutils zlib)))) ;in Requires.private of libbpf.pc
11663
11664(define-public bcc
11665 (package
11666 (name "bcc")
11667 (version "0.30.0")
11668 (source
11669 (origin
11670 (method git-fetch)
11671 (uri (git-reference
11672 (url "https://github.com/iovisor/bcc")
11673 (commit (string-append "v" version))))
11674 (file-name (git-file-name name version))
11675 (sha256
11676 (base32
11677 "0b5la0yn6x6ll73drnrm5v5yibbrzkvl86hqivkrmnpgy8cqn0cy"))))
11678 (build-system cmake-build-system)
11679 (native-inputs
11680 (list bison
11681 flex
11682 (@ (gnu packages compression) zip)))
11683 (inputs
11684 (list bash-minimal ;for wrap-program
11685 clang-15
11686 elfutils
11687 luajit
11688 libbpf
11689 python-wrapper))
11690 (arguments
11691 (list
11692 ;; Tests all require root permissions and a "standard" file hierarchy.
11693 #:tests? #f
11694 #:configure-flags #~(list (string-append "-DREVISION=" #$version)
11695 "-DCMAKE_USE_LIBBPF_PACKAGE=ON")
11696 #:phases
11697 #~(modify-phases %standard-phases
11698 (add-after 'unpack 'substitute-libbc
11699 (lambda _
11700 (substitute* "src/python/bcc/libbcc.py"
11701 (("(libbcc\\.so.*)\\b" _ libbcc)
11702 (string-append #$output "/lib/" libbcc)))))
11703 (add-after 'install 'wrap-tools
11704 (lambda _
11705 (use-modules (ice-9 textual-ports))
11706 (let* ((out #$output)
11707 (lib (string-append out "/lib"))
11708 (tools (string-append out "/share/bcc/tools"))
11709 (python-executable?
11710 (lambda (filename _)
11711 (call-with-input-file filename
11712 (lambda (port)
11713 (string-contains (get-line port)
11714 "/bin/python"))))))
11715 (for-each (lambda (python-executable)
11716 (format #t "Wrapping: ~A.~%" python-executable)
11717 (wrap-program python-executable
11718 `("GUIX_PYTHONPATH" ":" prefix
11719 (,(string-append lib
11720 "/python"
11721 #$(version-major+minor
11722 (package-version python))
11723 "/site-packages")))))
11724 (find-files tools python-executable?))))))))
11725 (home-page "https://github.com/iovisor/bcc")
11726 (synopsis "Tools for BPF on Linux")
11727 (description
11728 "BCC is a toolkit for creating efficient kernel tracing and manipulation
11729programs, and includes several useful tools and examples. It makes use of
11730extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
11731that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
11732and above.")
11733 (license license:asl2.0)))
11734
11735(define-public bpftool
11736 (package
11737 (name "bpftool")
11738 (version (package-version linux-libre))
11739 (source (package-source linux-libre))
11740 (build-system gnu-build-system)
11741 (arguments
11742 `(#:tests? #f ;This package has no tests.
11743 #:phases (modify-phases %standard-phases
11744 (delete 'configure)
11745 (replace 'build
11746 (lambda* (#:key inputs #:allow-other-keys)
11747 (invoke "make" "-C" "tools/bpf/bpftool"
11748 ,(string-append "CC=" (cc-for-target)))))
11749 (replace 'install
11750 (lambda* (#:key outputs #:allow-other-keys)
11751 (let* ((out (assoc-ref outputs "out")))
11752 (mkdir-p (string-append out "/sbin"))
11753 (mkdir-p (string-append out
11754 "/share/bash-completion/completions"))
11755 (invoke "make"
11756 (string-append "prefix=" out)
11757 (string-append
11758 "bash_compdir=" out
11759 "/share/bash-completion/completions")
11760 "-C" "tools/bpf/bpftool"
11761 "install")))))))
11762 (inputs (list elfutils ;provides libelf
11763 readline libcap zlib))
11764 (native-inputs (list bison python-3))
11765 ;; This tool does not have a proper web page.
11766 (home-page
11767 "https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/bpf/bpftool")
11768 (synopsis "Tool for inspection and manipulation of eBPF programs and maps")
11769 (description "@command{bpftool} allows for inspection and simple
11770modification of BPF objects on the system.")
11771 (license (package-license linux-libre))))
11772
11773(define-public bpftrace
11774 (package
11775 (name "bpftrace")
11776 (version "0.21.2")
11777 (source
11778 (origin
11779 (method git-fetch)
11780 (uri (git-reference
11781 (url "https://github.com/bpftrace/bpftrace")
11782 (commit (string-append "v" version))))
11783 (file-name (git-file-name name version))
11784 (sha256
11785 (base32 "0icbhf1wk523a7lcmwqa67zc6hl6h02p5mfg26cizva447kbwsgz"))))
11786 (build-system cmake-build-system)
11787 (arguments
11788 (list
11789 #:test-exclude "(runtime_tests|tools-parsing-test)"
11790 #:phases
11791 #~(modify-phases %standard-phases
11792 ;; This patch also fixes broken compilation due to improper detection
11793 ;; of bfd features. This is taken from following upstream PR:
11794 ;; https://github.com/bpftrace/bpftrace/pull/3332
11795 (add-after 'unpack 'patch-paths-and-bfd-defs
11796 (lambda _
11797 (substitute* '("cmake/FindLibBfd.cmake"
11798 "src/CMakeLists.txt")
11799 (("LIBSFRAME_FOUND")
11800 "LIBSFRAME_LIBRARIES")
11801 (("LIBZSTD_FOUND")
11802 "LIBZSTD_LIBRARIES"))
11803 (with-directory-excursion "tests"
11804 (substitute* (find-files ".")
11805 (("/bin/sh")
11806 (which "sh")))
11807 (substitute* '("child.cpp"
11808 "runtime/call"
11809 "procmon.cpp")
11810 (("/bin/ls")
11811 (which "ls"))))))
11812 (add-after 'unpack 'fix-paths
11813 (lambda* (#:key inputs outputs #:allow-other-keys)
11814 (substitute* '("tests/child.cpp")
11815 (("/bin/sleep")
11816 (search-input-file inputs "bin/sleep")))))
11817 (add-before 'check 'set-test-filter
11818 (lambda _
11819 (setenv "GTEST_FILTER"
11820 (string-join
11821 (list ; "-" disables all following tests
11822 "-ast.probe_name_uprobe"
11823 "bpftrace.add_probes_uprobe_wildcard_file"
11824 "bpftrace.add_probes_uprobe_wildcard_file_uprobe_multi"
11825 "bpftrace.add_probes_usdt_wildcard"
11826 "Parser.multiple_attach_points_kprobe"
11827 "Parser.uretprobe_offset"
11828 "semantic_analyser.builtin_functions"
11829 "semantic_analyser.call_func"
11830 "semantic_analyser.call_uaddr")
11831 ":")))))))
11832 (native-inputs (list bison coreutils dwarves flex googletest xxd))
11833 (inputs (list bcc clang-15 elfutils libbpf libiberty cereal))
11834 (home-page "https://github.com/bpftrace/bpftrace")
11835 (synopsis "High-level tracing language for Linux eBPF")
11836 (description
11837 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
11838Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
11839LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
11840interacting with the Linux BPF system, as well as existing Linux tracing
11841capabilities: kernel dynamic tracing (kprobes), user-level dynamic
11842tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
11843and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
11844created by Alastair Robertson.")
11845 (license license:asl2.0)))
11846
11847(define-public ttyebus-linux-module
11848 (let ((revision "0")
11849 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
11850 (package
11851 (name "ttyebus-linux-module")
11852 (version (git-version "1.5" revision commit))
11853 (source
11854 (origin
11855 (method git-fetch)
11856 (uri (git-reference
11857 (url "https://github.com/eBUS/ttyebus")
11858 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
11859 (file-name (git-file-name name version))
11860 (sha256
11861 (base32
11862 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
11863 (supported-systems '("armhf-linux" "aarch64-linux"))
11864 (build-system linux-module-build-system)
11865 (arguments
11866 `(#:tests? #f))
11867 (home-page "https://github.com/eBUS/ttyebus")
11868 (synopsis "Low-latency Raspberry Pi UART driver")
11869 (description "This package provides a Linux kernel module that will
11870provide a serial device @code{/dev/ttyebus} with almost no latency upon
11871receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
11872 (license license:gpl3+))))
11873
11874(define-public ipset
11875 (package
11876 (name "ipset")
11877 (version "7.17")
11878 (source
11879 (origin
11880 (method url-fetch)
11881 (uri (string-append "https://ipset.netfilter.org/"
11882 "ipset-" version ".tar.bz2"))
11883 (sha256
11884 (base32 "1n34mkrdha9rggd0fizjx6baqkiqqd1yfhb5ml663mlx93zwjjdy"))))
11885 (build-system gnu-build-system)
11886 (inputs
11887 (list libmnl))
11888 (native-inputs
11889 (list pkg-config))
11890 (arguments
11891 `(#:configure-flags '("--disable-static"
11892 "--with-kmod=no")))
11893 (home-page "https://ipset.netfilter.org/")
11894 (synopsis "Administration tool for IP sets")
11895 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
11896can be administered by the ipset utility. Depending on the type,
11897currently an IP set may store IP addresses, (TCP/UDP) port numbers or
11898IP addresses with MAC addresses in a way which ensures lightning speed
11899when matching an entry against a set.
11900
11901If you want to
11902@itemize @bullet
11903@item store multiple IP addresses or port numbers and match against the entire
11904collection using a single iptables rule.
11905@item dynamically update iptables rules against IP addresses or ports without
11906performance penalty.
11907@item express complex IP address and ports based rulesets with a single
11908iptables rule and benefit from the speed of IP sets.
11909@end itemize\n
11910then IP sets may be the proper tool for you.")
11911 (license license:gpl2+)))
11912
11913(define-public liburing
11914 (package
11915 (name "liburing")
11916 (version "2.8")
11917 (source (origin
11918 (method git-fetch)
11919 (uri (git-reference
11920 (url "https://git.kernel.dk/liburing")
11921 (commit (string-append "liburing-" version))))
11922 (file-name (git-file-name name version))
11923 (sha256
11924 (base32
11925 "1skzzdb769jm8p098k292maqycfchpz16mqm6ml8sfzkq2hfck6p"))))
11926 (build-system gnu-build-system)
11927 (arguments
11928 `(;; Tests are dependent on kernel version and features
11929 #:tests? #f
11930 #:phases
11931 (modify-phases %standard-phases
11932 (replace 'configure
11933 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
11934 ;; --enable-fast-install, and --build
11935 (lambda* (#:key outputs #:allow-other-keys)
11936 (let ((out (assoc-ref outputs "out")))
11937 (setenv "SHELL" (which "sh"))
11938 (setenv "CONFIG_SHELL" (which "sh"))
11939 (invoke "./configure" (string-append "--prefix=" out))))))))
11940 (home-page "https://github.com/axboe/liburing")
11941 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
11942 (description "This is the io_uring library, liburing. liburing provides
11943helpers to setup and teardown io_uring instances, and also a simplified
11944interface for applications that don't need (or want) to deal with the full
11945kernel side implementation.")
11946 (license license:expat)))
11947
11948(define-public erofs-utils
11949 (package
11950 (name "erofs-utils")
11951 (version "1.8.10")
11952 (source
11953 (origin
11954 (method git-fetch)
11955 (uri (git-reference
11956 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
11957 (commit (string-append "v" version))))
11958 (file-name (git-file-name name version))
11959 (sha256
11960 (base32 "1qlig9q1fdjl0zn7206dbv7w5ssjg4az4hg7y3vk69ly0zbmwkil"))))
11961 (build-system gnu-build-system)
11962 (inputs
11963 (list lz4
11964 `(,util-linux "lib")
11965 zlib))
11966 (native-inputs
11967 (list autoconf automake libtool pkg-config))
11968 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
11969 (synopsis "User-space tools for the EROFS file system")
11970 (description
11971 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
11972read-only file system optimized for resource-scarce devices. This package
11973provides user-space tools for creating EROFS file systems.")
11974 (license license:gpl2+)))
11975
11976(define-public rasdaemon
11977 (package
11978 (name "rasdaemon")
11979 (version "0.8.3")
11980 (source
11981 (origin
11982 (method git-fetch)
11983 (uri (git-reference
11984 (url "https://github.com/mchehab/rasdaemon")
11985 (commit (string-append "v" version))))
11986 (file-name (git-file-name name version))
11987 (sha256
11988 (base32 "0vfw4vf75fnpbxnfsmpdwdzhplnccz24j23bg6nsb3b4wa8hv4sa"))))
11989 (native-inputs (list autoconf automake libtool pkg-config))
11990 (inputs (list bash-minimal libtraceevent perl perl-dbd-sqlite sqlite dmidecode kmod))
11991 (arguments
11992 (list
11993 #:configure-flags
11994 #~(list "--enable-all"
11995 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
11996 "--with-sysconfdefdir=."
11997 "--localstatedir=/var")
11998 #:phases
11999 #~(modify-phases %standard-phases
12000 (add-after 'unpack 'rename-README
12001 (lambda _
12002 ;; Required by autoreconf
12003 (rename-file "README.md" "README")))
12004 (add-before 'configure 'munge-autotools
12005 (lambda _
12006 ;; For some reason upstream forces sysconfdir=/etc. This results
12007 ;; in EPERM during the install phase. Removing the offending
12008 ;; line lets sysconfdir correctly pick up DESTDIR.
12009 (substitute* "configure.ac"
12010 (("^test .* sysconfdir=/etc\n$") ""))))
12011 (add-after 'install 'wrap-rasdaemon
12012 (lambda* (#:key inputs #:allow-other-keys)
12013 (let ((path (map dirname
12014 (list (search-input-file inputs "/sbin/dmidecode")
12015 (search-input-file inputs "/bin/modprobe")))))
12016 (wrap-program (string-append #$output "/sbin/ras-mc-ctl")
12017 `("PATH" ":" prefix ,path)
12018 `("PERL5LIB" ":" prefix ,(string-split (getenv "PERL5LIB") #\:)))))))))
12019 (build-system gnu-build-system)
12020 (home-page "https://github.com/mchehab/rasdaemon")
12021 (synopsis "Platform Reliability, Availability, and Serviceability tools")
12022 (description
12023 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
12024Availability and Serviceability} reports from Linux kernel trace events.
12025These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
12026through standard log mechanisms like syslog.")
12027 (license license:gpl2)))
12028
12029(define-public renameat2
12030 ;; This is a Gist, with no release or tags.
12031 (let ((revision "0")
12032 (commit "5c5193f20142511a5fc7069a539f4e5aba0ea470"))
12033 (package
12034 (name "renameat2")
12035 (version (git-version "0.0.0" revision commit))
12036 (source (origin
12037 (method url-fetch)
12038 (uri (string-append "https://gist.githubusercontent.com/"
12039 "eatnumber1/f97ac7dad7b1f5a9721f/raw/"
12040 commit "/renameat2.c"))
12041 (sha256
12042 (base32
12043 "07b4hsxqjm610sdkm4nxhp0gnl2s7gzlh4zdnja5ay40v4x24bb9"))))
12044 (build-system gnu-build-system)
12045 (arguments
12046 (list
12047 #:tests? #f ;no test suite
12048 #:phases #~(modify-phases %standard-phases
12049 (delete 'configure)
12050 (replace 'build
12051 (lambda _
12052 (invoke #$(cc-for-target) "renameat2.c"
12053 "-o" "renameat2")))
12054 (replace 'install
12055 (lambda _
12056 (install-file "renameat2"
12057 (string-append #$output "/bin")))))))
12058 (home-page "https://gist.github.com/eatnumber1/f97ac7dad7b1f5a9721f")
12059 (synopsis "Command to call the renameat2 Linux system call")
12060 (description "This package provides a @command{renameat2} command that
12061calls the Linux-specific @code{renameat2} system call.")
12062 (license license:expat))))
12063
12064(define-public libgpiod
12065 (package
12066 (name "libgpiod")
12067 (version "2.2.2")
12068 (source
12069 (origin
12070 (method git-fetch)
12071 (uri
12072 (git-reference
12073 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12074 (commit (string-append "v" version))))
12075 (file-name (git-file-name name version))
12076 (sha256 (base32 "10yiwrw80x0057w825zxmdbd54w9lbyf49bgqk1cryqapglfzqri"))))
12077 (build-system gnu-build-system)
12078 (arguments
12079 (list #:configure-flags
12080 #~(list "--enable-tools=yes"
12081 "--enable-bindings-cxx")))
12082 (native-inputs
12083 (list automake
12084 autoconf-2.71
12085 libtool
12086 autoconf-archive
12087 pkg-config))
12088 (synopsis "Interact with the Linux GPIO character device")
12089 (description
12090 "This package provides a C library with C++ bindings and
12091command-line tools for interacting with GPIO devices that avoids the usage of
12092older system-wide @file{/sys} interface.")
12093 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12094 (license (list license:lgpl2.1+ ;; libgpiod
12095 license:gpl2+ ;; gpio-tools
12096 license:lgpl3+)))) ;; C++ bindings
12097
12098(define-public python-libgpiod
12099 (package
12100 (name "python-libgpiod")
12101 (version "2.3.0")
12102 (source
12103 (origin
12104 (method git-fetch)
12105 (uri
12106 (git-reference
12107 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
12108 (commit (string-append "python-v" version))))
12109 (file-name (git-file-name name version))
12110 (sha256 (base32 "1lkd7lgpb28pqf7p6lrwl0ss7r5ryiddmdcisnz6ixy796qhr8kr"))))
12111 (build-system pyproject-build-system)
12112 (arguments
12113 (list
12114 #:tests? #f ; tests require root, see README.md
12115 #:phases
12116 #~(modify-phases %standard-phases
12117 (add-after 'unpack 'cd-to-python-bindings
12118 (lambda _
12119 (chdir "bindings/python"))))))
12120 (native-inputs
12121 (list python-setuptools
12122 python-wheel
12123 libgpiod))
12124 (synopsis "Interact with the Linux GPIO character device")
12125 (description
12126 "This package provides Python bindings for interacting with GPIO devices
12127that avoids the usage of older system-wide @file{/sys} interface.")
12128 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
12129 (license (list license:lgpl2.1+ ;; libgpiod
12130 license:gpl2+ ;; gpio-tools
12131 license:lgpl3+)))) ;; C++ bindings
12132
12133(define-public libtraceevent
12134 (package
12135 (name "libtraceevent")
12136 (version "1.7.3")
12137 (source
12138 (origin
12139 (method git-fetch)
12140 (uri (git-reference
12141 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git")
12142 (commit (string-append name "-" version))))
12143 (file-name (git-file-name name version))
12144 (sha256
12145 (base32 "06mw2f0xnk6dy9w2z0n4dz7lnm02qfsmnmj2h24453qxlw57x0d6"))
12146 (modules '((guix build utils)))
12147 (snippet
12148 #~(begin
12149 (substitute* (list "Makefile" "scripts/utils.mk")
12150 (("/bin/(pwd)" _ command) command))))))
12151 (build-system gnu-build-system)
12152 (arguments
12153 (list
12154 #:tests? #f ; no test suite
12155 #:make-flags
12156 #~(list
12157 (string-append "pkgconfig_dir=" #$output "/lib/pkgconfig")
12158 (string-append "prefix=" #$output))
12159 #:phases
12160 #~(modify-phases %standard-phases
12161 (delete 'configure)))) ; no configure script
12162 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/")
12163 (synopsis "Linux kernel trace event library")
12164 (description
12165 "This library parses raw Linux kernel trace event formats.")
12166 (license (list license:gpl2
12167 license:lgpl2.1))))
12168
12169(define-public libtracefs
12170 (package
12171 (name "libtracefs")
12172 (version "1.7.0")
12173 (source
12174 (origin
12175 (method git-fetch)
12176 (uri (git-reference
12177 (url "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git")
12178 (commit (string-append name "-" version))))
12179 (file-name (git-file-name name version))
12180 (sha256
12181 (base32 "0v896n3q0df0nxx5drbwyaqhrqiyxl06rvrdw3gp2r37awa9g1zb"))
12182 (modules '((guix build utils)))
12183 (snippet
12184 #~(begin
12185 (substitute* (list "Makefile" "scripts/utils.mk")
12186 (("/bin/(pwd)" _ command) command))))))
12187 (build-system gnu-build-system)
12188 (arguments
12189 (list
12190 #:tests? #f ; no test suite
12191 #:make-flags
12192 #~(list
12193 (string-append "CC=" #$(cc-for-target))
12194 (string-append "pkgconfig_dir=" #$output "/lib/pkgconfig")
12195 (string-append "prefix=" #$output))
12196 #:phases
12197 #~(modify-phases %standard-phases
12198 (delete 'configure)))) ; no configure script
12199 (native-inputs (list pkg-config))
12200 (inputs (list libtraceevent))
12201 (home-page "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/")
12202 (synopsis "Linux kernel trace file system library")
12203 (description
12204 "This library provides APIs to access the Linux kernel's trace file
12205system.")
12206 (license (list license:gpl2
12207 license:lgpl2.1))))
12208
12209(define-public libtree
12210 (package
12211 (name "libtree")
12212 (version "3.1.1")
12213 (source
12214 (origin
12215 (method git-fetch)
12216 (uri (git-reference
12217 (url "https://github.com/haampie/libtree")
12218 (commit (string-append "v" version))))
12219 (file-name (git-file-name name version))
12220 (patches (search-patches "libtree-fix-check-non-x86.patch"))
12221 (sha256
12222 (base32 "1jbc60cslzcfxk9jwva51ncr1zl1nz0fkgfjdckgv81is11nswmb"))))
12223 (arguments
12224 (list #:make-flags
12225 ;; NOTE: Official documentation recommends to build libtree with
12226 ;; "-static" flag.
12227 #~(list (string-append "CC=" #$(cc-for-target))
12228 (string-append "PREFIX=" #$output))
12229 #:phases
12230 #~(modify-phases %standard-phases
12231 (add-after 'unpack 'fix-tests
12232 ;; XXX: '08_nodeflib' fails as 'libtree' returns a non-zero
12233 ;; code in one of the tests.
12234 ;;
12235 ;; See <https://github.com/haampie/libtree/issues/80>).
12236 (lambda _
12237 (substitute* "tests/08_nodeflib/Makefile"
12238 (("! ../../libtree -vvv exe_b")
12239 "../../libtree -vvv exe_b"))))
12240 (delete 'configure))))
12241 (build-system gnu-build-system)
12242 (home-page "https://github.com/haampie/libtree")
12243 (synopsis "Show output of @command{ldd} as a tree")
12244 (description
12245 "This tool turns @command{ldd} into a tree and explains how shared
12246libraries are found or why they cannot be located.")
12247 (license license:expat)))
12248
12249(define-public touchegg
12250 (package
12251 (name "touchegg")
12252 (version "2.0.18")
12253 (source
12254 (origin
12255 (method git-fetch)
12256 (uri (git-reference
12257 (url "https://github.com/JoseExposito/touchegg")
12258 (commit version)))
12259 (file-name (git-file-name name version))
12260 (sha256
12261 (base32 "0m8zgihij14b8dxrxxvpl8sdsx49mjlnxnm0fhgfxscy7n07kcpc"))))
12262 (build-system cmake-build-system)
12263 (arguments
12264 `(#:tests? #f ; No tests exist
12265 #:configure-flags
12266 (list "-DUSE_SYSTEMD=OFF"))) ; No systemd
12267 (native-inputs
12268 (list
12269 pkg-config))
12270 (inputs
12271 (list
12272 cairo
12273 gtk+
12274 libgudev
12275 libinput
12276 libxrandr
12277 libxtst
12278 pugixml))
12279 (home-page "https://github.com/JoseExposito/touchegg")
12280 (synopsis "Multitouch gesture recognizer")
12281 (description
12282 "Touchégg is an application that runs in the background and transform the
12283gestures you make on your touchpad or touchscreen into visible actions in your
12284desktop.")
12285 (license license:gpl3+)))
12286
12287(define-public evtest
12288 (package
12289 (name "evtest")
12290 (version "1.36")
12291 (source (origin
12292 (method git-fetch)
12293 (uri (git-reference
12294 (url "https://gitlab.freedesktop.org/libevdev/evtest")
12295 (commit (string-append "evtest-" version))))
12296 (file-name (git-file-name name version))
12297 (sha256
12298 (base32
12299 "0mwjvz0fwwcwm4fpw0m4x8bcxpnzjkiy7fpb438vf4i5g5q0dc1k"))))
12300 (build-system gnu-build-system)
12301 (arguments
12302 (list #:tests? #f ;No tests exist
12303 #:make-flags #~(list (string-append "CC="
12304 #$(cc-for-target))
12305 (string-append "PREFIX="
12306 #$output))
12307 #:phases #~(modify-phases %standard-phases
12308 (add-after 'unpack 'generate-doc
12309 (lambda _
12310 (invoke "asciidoc" "-d" "manpage"
12311 "-b" "docbook"
12312 "-o" "evtest.1.xml"
12313 "evtest.txt")
12314 (invoke "xsltproc" "--nonet"
12315 (string-append
12316 #$(this-package-native-input "docbook-xsl")
12317 "/xml/xsl/docbook-xsl-"
12318 #$(package-version
12319 (this-package-native-input "docbook-xsl"))
12320 "/manpages/docbook.xsl")
12321 "evtest.1.xml")))
12322 (replace 'bootstrap
12323 (lambda _
12324 (setenv "CONFIG_SHELL" (which "sh"))
12325 (invoke "autoreconf" "-fi"))))))
12326 (native-inputs (list autoconf
12327 automake
12328 bash-minimal
12329 xmlto
12330 docbook-xsl
12331 libxslt
12332 asciidoc))
12333 (home-page "https://gitlab.freedesktop.org/libevdev/evtest")
12334 (synopsis "Kernel evdev device information and monitor")
12335 (description
12336 "@code{evtest} is a tool to print @code{evdev} kernel events. It reads
12337directly from the kernel device and prints a device description and the events
12338with the value and the symbolic name.")
12339 (license license:gpl2+)))
12340
12341(define-public tp-smapi-module
12342 (package
12343 (name "tp-smapi-module")
12344 (version "0.44")
12345 (source (origin
12346 (method git-fetch)
12347 (uri (git-reference
12348 (url "https://github.com/linux-thinkpad/tp_smapi")
12349 (commit (string-append "tp-smapi/" version))))
12350 (file-name (git-file-name name version))
12351 (sha256
12352 (base32
12353 "0kzbks07bh5jbi1n311zp9cbp1xxyzi7nys8wq1k0k5ig81h9w6k"))))
12354 (build-system linux-module-build-system)
12355 (arguments
12356 `(#:tests? #f)) ;there are none.
12357 (home-page "https://github.com/linux-thinkpad/tp_smapi")
12358 (synopsis
12359 "Linux Kernel module exposing features of ThinkPad hardware")
12360 (description
12361 "This package provides a Linux Kernel module that controls
12362battery charging of specific ThinkPad laptops. It also includes an improved
12363version of the HDAPS driver. The underlying hardware interfaces are
12364@acronym{SMAPI, System Management Application Program Interface} and direct
12365access to the embedded controller.")
12366 (license license:gpl2+)))
12367
12368(define-public modprobed-db
12369 (package
12370 (name "modprobed-db")
12371 (version "2.48")
12372 (source (origin
12373 (method git-fetch)
12374 (uri (git-reference
12375 (url "https://github.com/graysky2/modprobed-db")
12376 (commit (string-append "v" version))))
12377 (file-name (git-file-name name version))
12378 (sha256
12379 (base32
12380 "0jscinga32jjvy3vwl4s1pyd5fjgqhmmk010k665nhil302hzjdc"))))
12381 (build-system gnu-build-system)
12382 (arguments
12383 (list #:tests? #f ;no tests
12384 #:make-flags
12385 #~(list (string-append "PREFIX=" #$output)
12386 "INITDIR_SYSTEMD=no-thanks")
12387 #:phases
12388 #~(modify-phases %standard-phases
12389 (delete 'configure)
12390 (add-after 'install 'fix-path
12391 (lambda* (#:key inputs #:allow-other-keys)
12392 (substitute* (string-append #$output "/bin/modprobed-db")
12393 (("/usr") #$output)
12394 (((string-append "(" (string-join (list "awk"
12395 "cp"
12396 "cut"
12397 "getent"
12398 "grep"
12399 "logname"
12400 "md5sum"
12401 "mkdir"
12402 "mv"
12403 "sed"
12404 "sort"
12405 "uniq"
12406 "wc")
12407 "|") ")") m)
12408 (search-input-file inputs (string-append "/bin/" m)))
12409 (("modprobe ")
12410 (string-append
12411 (search-input-file inputs "/bin/modprobe") " "))))))))
12412 (inputs (list coreutils kmod gawk glibc grep sed))
12413 (home-page "https://wiki.archlinux.org/title/Modprobed-db")
12414 (synopsis "Keep track of Linux modules that have been probed")
12415 (description
12416 "Modprobed-db is a useful utility for users wishing to build a minimal
12417kernel via a @code{make localmodconfig}. In a nutshell, this @command{make}
12418target creates a config based on the current config and a list of modules you
12419define (that @command{modprobed-db} keeps for you). It then disables any
12420module option that is not needed thus not building extraneous modules. This
12421results in a system-specific, streamlined kernel package and footprint as well
12422as reduced compilation times.
12423
12424Modprobed-db simply logs every module ever probed on the target system to a
12425text-based database (@file{$XDG_CONFIG_HOME/modprobed-db}), which can be read
12426directly by @code{make localmodconfig} as described above.")
12427 (license license:expat)))
12428
12429(define-public kernel-hardening-checker
12430 (package
12431 (name "kernel-hardening-checker")
12432 (version "0.6.10")
12433 (source (origin
12434 (method git-fetch)
12435 (uri (git-reference
12436 (url "https://github.com/a13xp0p0v/kernel-hardening-checker")
12437 (commit (string-append "v" version))))
12438 (file-name (git-file-name name version))
12439 (sha256
12440 (base32
12441 "01p5wcyj4w5c4264abymhvpai7bvfy8ivspgqnrmg33qplwxl443"))))
12442 (build-system python-build-system)
12443 (home-page "https://github.com/a13xp0p0v/kernel-hardening-checker")
12444 (synopsis
12445 "Tool for checking the security hardening options of the Linux kernel")
12446 (description
12447 "@code{kernel-hardening-checker} is a tool for checking the security
12448hardening options of the Linux kernel. Provided preferences are based on
12449suggestions from various sources, including:
12450
12451@itemize
12452@item KSPP recommended settings
12453@item CLIP OS kernel configuration
12454@item Last public grsecurity patch (options which they disable)
12455@item SECURITY_LOCKDOWN_LSM patchset
12456@item Direct feedback from the Linux kernel maintainers
12457@end itemize\n
12458This tool supports checking Kconfig options and kernel cmdline parameters.")
12459 (license license:gpl3)))
12460
12461(define-deprecated-package kconfig-hardened-check
12462 kernel-hardening-checker)
12463
12464(define-public firejail
12465 (package
12466 (name "firejail")
12467 (version "0.9.74")
12468 (source (origin
12469 (method url-fetch)
12470 (uri (string-append
12471 "https://github.com/netblue30/firejail/releases/download/" version
12472 "/firejail-" version ".tar.xz" ))
12473 (sha256
12474 (base32
12475 "04w11jjh62ghs66ippw5xlg3l7l9mi3b5cpch1cg3fw7gxnbbn3h"))))
12476 (arguments
12477 (list #:phases
12478 #~(modify-phases %standard-phases
12479 (replace 'check
12480 (lambda* (#:key tests? #:allow-other-keys)
12481 (when tests?
12482 (with-directory-excursion "test"
12483 (invoke "make"))))))))
12484 (build-system gnu-build-system)
12485 (inputs
12486 (list apparmor xdg-dbus-proxy))
12487 (synopsis "Linux namespaces sandbox program")
12488 (description
12489 "Firejail is a SUID sandbox program that reduces the risk of security
12490breaches by restricting the running environment of untrusted applications
12491using Linux namespaces, seccomp-bpf and Linux capabilities. The software
12492includes sandbox profiles for a number of common Linux programs. Firejail
12493should be added to the list of setuid programs in the system configuration to
12494work properly.")
12495 (home-page "https://github.com/netblue30/firejail")
12496 (supported-systems
12497 (filter (cut string-suffix? "-linux" <>) %supported-systems))
12498 (license license:gpl2+)))
12499
12500(define-public firejail-disable-sandbox-check
12501 (package/inherit
12502 firejail
12503 (name "firejail-disable-sandbox-check")
12504 (arguments
12505 (substitute-keyword-arguments (package-arguments firejail)
12506 ((#:configure-flags flags #~'())
12507 #~(append #$flags
12508 (list "--disable-sandbox-check")))))
12509 (description
12510 (string-append (package-description firejail)
12511 " Builded with @code{--disable-sandbox-check}, which is
12512 only intended for development."))))
12513
12514(define-public edac-utils
12515 (package
12516 (name "edac-utils")
12517 (version "0.18")
12518 (source (origin
12519 (method git-fetch)
12520 (uri (git-reference
12521 (url "https://github.com/grondo/edac-utils.git")
12522 (commit version)))
12523 (file-name (string-append name "-" version "-checkout"))
12524 (sha256
12525 (base32
12526 "04j686m58wsnyy5di7rz0sw9jahlm4ziwxjmgs31pjb87vzw3xgp"))))
12527 (build-system gnu-build-system)
12528 (native-inputs
12529 (list perl))
12530 (inputs
12531 (list sysfsutils))
12532 (synopsis "Memory error detection and correction userspace helpers")
12533 (description "This package provides userspace helpers for memory
12534error detection and correction (EDAC).")
12535 (home-page "https://github.com/grondo/edac-utils")
12536 (license license:gpl2+)))
12537
12538(define-public spectre-meltdown-checker
12539 (package
12540 (name "spectre-meltdown-checker")
12541 (version "0.46")
12542 (source (origin
12543 (method git-fetch)
12544 (uri (git-reference
12545 (url "https://github.com/speed47/spectre-meltdown-checker")
12546 (commit (string-append "v" version))))
12547 (file-name (git-file-name name version))
12548 (patches
12549 (search-patches
12550 "spectre-meltdown-checker-externalize-fwdb.patch"))
12551 ;; Remove builtin firmware database.
12552 (modules '((guix build utils)))
12553 (snippet '(substitute* "spectre-meltdown-checker.sh"
12554 (("^# [AI],.*") "")))
12555 (sha256
12556 (base32
12557 "0j42p6dayb7k87kf8sqimxlaswis3qh0569a15zccyknv9vf129k"))))
12558 (build-system copy-build-system)
12559 (arguments
12560 (list
12561 #:install-plan
12562 #~'(("spectre-meltdown-checker.sh" "bin/spectre-meltdown-checker"))
12563 #:phases
12564 #~(modify-phases %standard-phases
12565 (add-after 'unpack 'fixpath
12566 (lambda* (#:key inputs #:allow-other-keys)
12567 (define* (find-command inputs cmd #:optional (bin "bin"))
12568 (search-input-file inputs (string-append bin "/" cmd)))
12569 (substitute* "spectre-meltdown-checker.sh"
12570 ;; ${opt_arch_prefix}CMD
12571 (("\\$\\{opt_arch_prefix\\}\\<(nm|objdump|readelf|strings)\\>"
12572 all cmd)
12573 (find-command inputs cmd))
12574
12575 ;; Commands safe to substitute directly.
12576 (("\\<(awk|(base|dir)name|bunzip2|g(un)?zip|lz4)\\>" all cmd)
12577 (find-command inputs cmd))
12578 (("\\<(lzop|mktemp|modprobe|pgrep|rmmod|umount)\\>" all cmd)
12579 (find-command inputs cmd))
12580 (("\\<(unlzma|unxz|unzstd|uuencode)\\>" all cmd)
12581 (find-command inputs cmd))
12582
12583 ;; Commands which should only be substituted based on their
12584 ;; surroundings: First up, dd.
12585 (("\\<(dd)\\> if=" all cmd)
12586 (string-append
12587 (find-command inputs cmd)
12588 " if="))
12589
12590 ;; Another special case: sysctl is in sbin.
12591 (("(if |\\$\\( *)\\<(sysctl)\\>" all pre cmd)
12592 (string-append pre (find-command inputs cmd "sbin")))
12593
12594 ;; Meow
12595 (("cat (<<EOF|\"\\$)" all what)
12596 (string-append (find-command inputs "cat") " " what))
12597 (("'cat'")
12598 (string-append "'" (find-command inputs "cat") "'"))
12599 (("\"cat\"")
12600 (string-append "\"" (find-command inputs "cat") "\""))
12601
12602 ;; ${COMMAND} -
12603 ;; ${COMMAND} ^
12604 (("\\<(base64|cut|grep|head|id|mount)\\> ([-^])" all cmd suffix)
12605 (string-append (find-command inputs cmd) " " suffix))
12606 (("\\<(od|perl|rm|uname|xargs)\\> ([-^])" all cmd suffix)
12607 (string-append (find-command inputs cmd) " " suffix))
12608
12609 ;; ${COMMAND} |
12610 (("\\<(dmesg)\\> \\|" all cmd)
12611 (string-append (find-command inputs cmd) " |"))
12612 ;; | ${COMMAND}
12613 (("\\| \\<(grep|sed|sort|stat|tr)\\>" all cmd)
12614 (string-append "| " (find-command inputs cmd)))
12615
12616 ;; Command in sub-shell, i.e. $($COMMAND ...)
12617 (("\\$\\( *(\\<cat|find|grep|mount|nproc|stat|tr\\>)"
12618 all cmd)
12619 (string-append "$(" (find-command inputs cmd)))
12620
12621 ;; command -v
12622 (("command -v \"*\\<(base64|nproc|perl|printf)\\>\"*" all cmd)
12623 (string-append "command -v " (find-command inputs cmd)))))))))
12624 (inputs (list kmod lz4 lzop perl procps sharutils util-linux zstd))
12625 (home-page "https://github.com/speed47/spectre-meltdown-checker")
12626 (synopsis "CPU vulnerability / mitigation checker")
12627 (description
12628 "This package provides a shell script to assess your system's resilience
12629against the several transient execution CVEs that were published since early
126302018, and gives guidance as to how to mitigate them.")
12631 (license license:gpl3)))
12632
12633(define-public csmith
12634 (package
12635 (name "csmith")
12636 (version "2.3.0")
12637 (source (origin
12638 (method git-fetch)
12639 (uri (git-reference
12640 (url "https://github.com/csmith-project/csmith")
12641 (commit (string-append "csmith-" version))))
12642 (file-name (git-file-name name version))
12643 (sha256
12644 (base32
12645 "0nhrsnv6cny14xz68qb1h30fbwc05adkisk51p3x63mydm60ddl3"))))
12646 (build-system gnu-build-system)
12647 (native-inputs
12648 (list autoconf automake libtool m4 perl))
12649 (arguments
12650 (list
12651 #:tests? #f ;no test suite
12652 ;; Do not install headers under 'include/csmith-VERSION' but in
12653 ;; 'include/csmith'.
12654 #:phases
12655 `(modify-phases %standard-phases
12656 (add-after 'unpack 'patch-includedir
12657 (lambda _
12658 (substitute* "runtime/Makefile.am"
12659 (("\\$\\(includedir\\)/\\$\\(PACKAGE\\)-\\$\\(VERSION\\)")
12660 "$(includedir)/$(PACKAGE)"))))
12661 (add-before 'bootstrap 'force-bootstrap
12662 (lambda _
12663 (delete-file "configure"))))))
12664 (home-page "https://github.com/csmith-project/csmith")
12665 (synopsis "Random generator of C programs")
12666 (description "The primary purpose of Csmith is to find compiler bugs with
12667random programs using differential testing.")
12668 (license license:bsd-4)))
12669
12670(define-public ipvsadm
12671 (package
12672 (name "ipvsadm")
12673 (version "1.31")
12674 (source
12675 (origin
12676 (method url-fetch)
12677 (uri (string-append "https://kernel.org/pub/linux/utils/kernel"
12678 "/ipvsadm/ipvsadm-" version ".tar.xz"))
12679 (sha256
12680 (base32 "1nyzpv1hx75k9lh0vfxfhc0p2fpqaqb38xpvs8sn88m1nljmw2hs"))))
12681 (build-system gnu-build-system)
12682 (native-inputs (list linux-libre-headers pkg-config which))
12683 (inputs (list libnl popt))
12684 (arguments
12685 (list #:tests? #f
12686 #:parallel-build? #f ;build fails randomly with '-j'
12687 #:make-flags
12688 #~(list (string-join
12689 (list "CFLAGS="
12690 (string-append "-I"
12691 #$(this-package-input "libnl")
12692 "/include/libnl3")
12693 (string-append "-L" #$(this-package-input "libnl")
12694 "/lib")
12695 "-fPIC")
12696 " ")
12697 (string-append "CC=" #$(cc-for-target))
12698 (string-append "SBIN=" #$output "/sbin")
12699 (string-append "INIT=" #$output "/etc/init.d")
12700 (string-append "MANDIR=" #$output "/share/man"))
12701 #:phases #~(modify-phases %standard-phases
12702 (delete 'configure))))
12703 (home-page "http://www.linuxvirtualserver.org/software/ipvs.html")
12704 (synopsis "IP virtual server administration utility")
12705 (description "@code{ipvsadm(8)} is used to set up, maintain or inspect the
12706virtual server table in the Linux kernel. The Linux Virtual Server can be used
12707to build scalable network services based on a cluster of two or more nodes.")
12708 (license license:gpl2+)))
12709
12710(define-public ryzenadj
12711 (package
12712 (name "ryzenadj")
12713 (version "0.17.0")
12714 (source (origin
12715 (method url-fetch)
12716 (uri (string-append "https://github.com/flygoat/ryzenadj/archive/refs/tags/"
12717 "v" version ".tar.gz"))
12718 (sha256
12719 (base32 "0i2x6kbn2ix52vjz1mmh0c0g3w0k4sn0lq68wbsk0pgndzcck2l4"))
12720 (modules '((guix build utils)))
12721 (snippet
12722 '(begin (delete-file-recursively "win32")
12723 #t))))
12724 (build-system cmake-build-system)
12725 (inputs (list pciutils))
12726 (arguments
12727 (list #:tests? #f ; No test suite
12728 #:phases #~(modify-phases %standard-phases
12729 (add-before 'install 'build
12730 (lambda _
12731 (invoke "cmake" "-DCMAKE_BUILD_TYPE=Release" "."))))))
12732 (home-page "https://github.com/flygoat/ryzenadj")
12733 (synopsis "Power management tool for AMD Ryzen APUs")
12734 (description
12735 "@command{ryzenadj} is an utility to adjust power management settings for
12736AMD Ryzen mobile processors. You will need to ensure it can access /dev/mem,
12737for instance by using the \"iomem=relaxed\" kernel argument.")
12738 (license license:lgpl3)))
12739
12740(define-public ryzen-smu
12741 (package
12742 (name "ryzen-smu")
12743 (version "0.1.5")
12744 (source (origin
12745 (method git-fetch)
12746 (uri (git-reference
12747 (url "https://gitlab.com/leogx9r/ryzen_smu.git")
12748 (commit (string-append "v" version))))
12749 (file-name (git-file-name name version))
12750 (sha256
12751 (base32
12752 "010la2a8zp7rljlg5ssc9ragzva4ca05gvzlicjagl508659d2wz"))))
12753 (build-system linux-module-build-system)
12754 (arguments
12755 `(#:tests? #f)) ; no tests
12756 (synopsis "System Management Unit driver for AMD Ryzen processors")
12757 (description "This package provides a way to access the
12758System Management Unit for certain AMD Ryzen processors.
12759This includes access to the System Management Network.")
12760 (home-page "https://gitlab.com/leogx9r/ryzen_smu")
12761 (license license:gpl2)))
12762
12763(define-public hid-wiimote-plus
12764 (package
12765 (name "hid-wiimote-plus")
12766 (version "0.9.2")
12767 (source (origin
12768 (method git-fetch)
12769 (uri (git-reference
12770 (url "https://github.com/dkosmari/hid-wiimote-plus.git")
12771 (commit (string-append "v" version))))
12772 (file-name (git-file-name name version))
12773 (sha256
12774 (base32
12775 "1rkp311x60jm73xlqypxsp375rx3fa55jyrspz1aqjga0q6cvswi"))))
12776 (build-system linux-module-build-system)
12777 (arguments
12778 (list #:tests? #f)) ; No tests.
12779 (synopsis "WiiMote HID kernel module")
12780 (description "This package provides a WiiMote driver that follows the
12781Linux input convention. Specifically, that allows you to use the D-pad
12782as a gamepad.")
12783 (home-page "https://github.com/dkosmari/hid-wiimote-plus")
12784 (license license:gpl2+)))
12785
12786(define-public python-evemu
12787 (package
12788 (name "python-evemu")
12789 (version "2.7.0")
12790 (source (origin
12791 (method git-fetch)
12792 (uri (git-reference
12793 (url "https://gitlab.freedesktop.org/libevdev/evemu")
12794 (commit (string-append "v" version))))
12795 (file-name (git-file-name name version))
12796 (sha256
12797 (base32
12798 "1sxf6v2wnajj9srlkfjfymjmmp4dlq73gzjcjmaw015a3c0xl029"))))
12799 (build-system gnu-build-system)
12800 (arguments
12801 (list #:tests? #f ; would open device files
12802 #:phases
12803 #~(modify-phases %standard-phases
12804 (add-after 'unpack 'patch
12805 (lambda* (#:key inputs #:allow-other-keys)
12806 (substitute* "python/evemu/base.py"
12807 (("\"libevdev.so\"")
12808 (string-append "\"" (assoc-ref inputs "libevdev")
12809 "/lib/libevdev.so\""))))))))
12810 (native-inputs
12811 (list asciidoc autoconf automake libtool docbook-xsl pkg-config
12812 python-wrapper xmlto))
12813 (inputs
12814 (list libevdev))
12815 (synopsis "Record and replay input device events")
12816 (description "This package provides a way to record and replay device
12817descriptions and events, making it possible to emulate input devices
12818through the Linux kernel's input system. Emulated devices are for most
12819practical purposes indistinguishable from real devices.
12820
12821It provides a command line program and also a Python library.")
12822 (home-page "https://www.freedesktop.org/wiki/Evemu/")
12823 (license license:gpl3)))
12824
12825(define-public dualsensectl
12826 (package
12827 (name "dualsensectl")
12828 (version "0.7")
12829 (source (origin
12830 (method git-fetch)
12831 (uri (git-reference
12832 (url "https://github.com/nowrep/dualsensectl.git")
12833 (commit (string-append "v" version))))
12834 (file-name (git-file-name name version))
12835 (sha256
12836 (base32
12837 "05snsp5r3hc2yc1nf0w4aam1my4h0lkxnmy7k4glxvasd9jwahzw"))))
12838 (build-system meson-build-system)
12839 (native-inputs
12840 (list pkg-config))
12841 (inputs
12842 (list eudev dbus hidapi))
12843 (synopsis "Linux tool for controlling PS5 DualSense controller")
12844 (description "This package provides a Linux tool for controlling a PS5
12845DualSense controller. It has to be already connected via USB or connected
12846via Bluetooth.")
12847 (home-page "https://github.com/nowrep/dualsensectl")
12848 (license license:gpl2)))