1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2021 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christine Lemmer-Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
12 ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
13 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
14 ;;; Copyright © 2016, 2018, 2019, 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
19 ;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
22 ;;; Copyright © 2017, 2018, 2020, 2021 Leo Famulari <leo@famulari.name>
23 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
24 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
25 ;;; Copyright © 2017, 2019, 2021 Mathieu Othacehe <othacehe@gnu.org>
26 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
27 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
30 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
31 ;;; Copyright © 2018, 2020 Brendan Tildesley <mail@brendan.scot>
32 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
33 ;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
34 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
35 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
36 ;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
37 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
38 ;;; Copyright © 2019, 2020, 2021 Brice Waegeneire <brice@waegenei.re>
39 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
40 ;;; Copyright © 2020, 2021 Oleg Pykhalov <go.wigust@gmail.com>
41 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
42 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
43 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
44 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
45 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
46 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
47 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
48 ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
49 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
50 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
51 ;;; Copyright © 2020 David Dashyan <mail@davie.li>
52 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
53 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
54 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
55 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
56 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
57 ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
58 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
59 ;;; Copyright © 2021 Josselin Poiret <josselin.poiret@protonmail.ch>
61 ;;; This file is part of GNU Guix.
63 ;;; GNU Guix is free software; you can redistribute it and/or modify it
64 ;;; under the terms of the GNU General Public License as published by
65 ;;; the Free Software Foundation; either version 3 of the License, or (at
66 ;;; your option) any later version.
68 ;;; GNU Guix is distributed in the hope that it will be useful, but
69 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
70 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
71 ;;; GNU General Public License for more details.
73 ;;; You should have received a copy of the GNU General Public License
74 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
76 (define-module (gnu packages linux)
77 #:use-module (gnu packages)
78 #:use-module (gnu packages acl)
79 #:use-module (gnu packages admin)
80 #:use-module (gnu packages algebra)
81 #:use-module (gnu packages audio)
82 #:use-module (gnu packages autotools)
83 #:use-module (gnu packages backup)
84 #:use-module (gnu packages base)
85 #:use-module (gnu packages bash)
86 #:use-module (gnu packages bison)
87 #:use-module (gnu packages boost)
88 #:use-module (gnu packages calendar)
89 #:use-module (gnu packages check)
90 #:use-module (gnu packages cpio)
91 #:use-module (gnu packages crypto)
92 #:use-module (gnu packages cryptsetup)
93 #:use-module (gnu packages compression)
94 #:use-module (gnu packages dbm)
95 #:use-module (gnu packages datastructures)
96 #:use-module (gnu packages docbook)
97 #:use-module (gnu packages documentation)
98 #:use-module (gnu packages elf)
99 #:use-module (gnu packages flex)
100 #:use-module (gnu packages file)
101 #:use-module (gnu packages freedesktop)
102 #:use-module (gnu packages gawk)
103 #:use-module (gnu packages gcc)
104 #:use-module (gnu packages gettext)
105 #:use-module (gnu packages glib)
106 #:use-module (gnu packages gnupg)
107 #:use-module (gnu packages golang)
108 #:use-module (gnu packages gperf)
109 #:use-module (gnu packages gstreamer)
110 #:use-module (gnu packages gtk)
111 #:use-module (gnu packages haskell-apps)
112 #:use-module (gnu packages haskell-xyz)
113 #:use-module (gnu packages libunwind)
114 #:use-module (gnu packages libusb)
115 #:use-module (gnu packages llvm)
116 #:use-module (gnu packages lua)
117 #:use-module (gnu packages man)
118 #:use-module (gnu packages maths)
119 #:use-module (gnu packages multiprecision)
120 #:use-module (gnu packages ncurses)
121 #:use-module (gnu packages netpbm)
122 #:use-module (gnu packages networking)
123 #:use-module (gnu packages ninja)
124 #:use-module (gnu packages nss)
125 #:use-module (gnu packages perl)
126 #:use-module (gnu packages pciutils)
127 #:use-module (gnu packages pkg-config)
128 #:use-module (gnu packages popt)
129 #:use-module (gnu packages pulseaudio)
130 #:use-module (gnu packages python)
131 #:use-module (gnu packages python-xyz)
132 #:use-module (gnu packages readline)
133 #:use-module (gnu packages rrdtool)
134 #:use-module (gnu packages samba)
135 #:use-module (gnu packages sdl)
136 #:use-module (gnu packages serialization)
137 #:use-module (gnu packages slang)
138 #:use-module (gnu packages sqlite)
139 #:use-module (gnu packages texinfo)
140 #:use-module (gnu packages tls)
141 #:use-module (gnu packages valgrind)
142 #:use-module (gnu packages video)
143 #:use-module (gnu packages vulkan)
144 #:use-module (gnu packages web)
145 #:use-module (gnu packages xiph)
146 #:use-module (gnu packages xml)
147 #:use-module (gnu packages xdisorg)
148 #:use-module (gnu packages xorg)
149 #:use-module (gnu packages groff)
150 #:use-module (gnu packages selinux)
151 #:use-module (gnu packages swig)
152 #:use-module (guix build-system cmake)
153 #:use-module (guix build-system copy)
154 #:use-module (guix build-system gnu)
155 #:use-module (guix build-system go)
156 #:use-module (guix build-system meson)
157 #:use-module (guix build-system python)
158 #:use-module (guix build-system trivial)
159 #:use-module (guix build-system linux-module)
160 #:use-module (guix download)
161 #:use-module (guix git-download)
162 #:use-module ((guix licenses) #:prefix license:)
163 #:use-module (guix packages)
164 #:use-module (guix gexp)
165 #:use-module (guix store)
166 #:use-module (guix monads)
167 #:use-module (guix utils)
168 #:use-module (guix deprecation) ;for libcap/next
169 #:use-module (srfi srfi-1)
170 #:use-module (srfi srfi-2)
171 #:use-module (srfi srfi-26)
172 #:use-module (ice-9 match)
173 #:use-module (ice-9 regex))
175 (define-public (system->linux-architecture arch)
176 "Return the Linux architecture name for ARCH, a Guix system name such as
177 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
178 (let ((arch (car (string-split arch #\-))))
179 (cond ((string=? arch "i686") "i386")
180 ((string-prefix? "mips" arch) "mips")
181 ((string-prefix? "arm" arch) "arm")
182 ((string-prefix? "aarch64" arch) "arm64")
183 ((string-prefix? "alpha" arch) "alpha")
184 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
185 ((string-prefix? "s390" arch) "s390")
186 ((string-prefix? "riscv" arch) "riscv")
189 (define-public (system->defconfig system)
190 "Some systems (notably powerpc-linux) require a special target for kernel
191 defconfig. Return the appropriate make target if applicable, otherwise return
193 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
194 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
195 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
200 ;;; Kernel source code deblobbing.
203 (define (linux-libre-deblob-scripts version gnu-revision
206 (list (version-major+minor version)
209 (uri (string-append "https://linux-libre.fsfla.org"
210 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
211 "deblob-" (version-major+minor version)))
212 (file-name (string-append "linux-libre-deblob-"
213 version "-" gnu-revision))
214 (sha256 deblob-hash))
217 (uri (string-append "https://linux-libre.fsfla.org"
218 "/pub/linux-libre/releases/" version "-" gnu-revision "/"
220 (file-name (string-append "linux-libre-deblob-check-" version "-" gnu-revision))
221 (sha256 deblob-check-hash))))
223 ;; XXXX: Workaround 'snippet' limitations
224 (define computed-origin-method (@@ (guix packages) computed-origin-method))
226 (define (make-linux-libre-source version
229 "Return a 'computed' origin that generates a Linux-libre tarball from the
230 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
231 (match deblob-scripts
232 ((deblob-version (? origin? deblob) (? origin? deblob-check))
233 (unless (string=? deblob-version (version-major+minor version))
234 ;; The deblob script cannot be expected to work properly on a
235 ;; different version (major+minor) of Linux, even if no errors
236 ;; are signaled during execution.
237 (error "deblob major+minor version mismatch"))
239 (method computed-origin-method)
240 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
244 (with-imported-modules '((guix build utils))
246 (use-modules (guix build utils)
251 (setvbuf (current-output-port) 'line)
253 (let ((dir (string-append "linux-" #$version)))
256 (set-path-environment-variable
259 #+(canonical-package bash)
260 #+(canonical-package coreutils)
261 #+(canonical-package diffutils)
262 #+(canonical-package findutils)
263 #+(canonical-package patch)
264 #+(canonical-package xz)
265 #+(canonical-package sed)
266 #+(canonical-package grep)
267 #+(canonical-package bzip2)
268 #+(canonical-package gzip)
269 #+(canonical-package tar)
270 #+(canonical-package gawk)
273 (with-directory-excursion "/tmp/bin"
275 (copy-file #+deblob "deblob")
276 (chmod "deblob" #o755)
277 (substitute* "deblob"
278 (("/bin/sh") (which "sh")))
280 (copy-file #+deblob-check "deblob-check")
281 (chmod "deblob-check" #o755)
282 (substitute* "deblob-check"
283 (("/bin/sh") (which "sh"))
284 (("/bin/sed") (which "sed"))
285 (("/usr/bin/python") (which "python"))))
287 (if (file-is-directory? #+upstream-source)
289 (format #t "Copying upstream linux source...~%")
290 (invoke "cp" "--archive" #+upstream-source dir)
291 (invoke "chmod" "--recursive" "u+w" dir))
293 (format #t "Unpacking upstream linux tarball...~%")
294 (invoke "tar" "xf" #$upstream-source)
297 (and (not (member name '("." "..")))
298 (file-is-directory? name))))
300 (unless (string=? dir unpacked-dir)
301 (rename-file unpacked-dir dir)))
303 (error "multiple directories found" dirs)))))
305 (with-directory-excursion dir
306 (format #t "Running deblob script...~%")
307 (invoke "/tmp/bin/deblob"))
309 (format #t "~%Packing new Linux-libre tarball...~%")
310 (invoke "tar" "cvfa" #$output
311 ;; Avoid non-determinism in the archive.
319 (format #t "~%Scanning the generated tarball for blobs...~%")
320 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
328 (define (linux-libre-urls version gnu-revision)
329 "Return a list of URLs for Linux-Libre VERSION."
331 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
332 version "-" gnu-revision "/linux-libre-" version "-" gnu-revision ".tar.xz")
334 ;; XXX: Work around <http://bugs.gnu.org/14851>.
336 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
337 version "-" gnu-revision ".tar.xz")
339 ;; Maybe this URL will become valid eventually.
341 "mirror://gnu/linux-libre/" version "-" gnu-revision "/linux-libre-"
342 version "-" gnu-revision ".tar.xz")))
344 (define (%upstream-linux-source version hash)
347 (uri (string-append "mirror://kernel.org"
348 "/linux/kernel/v" (version-major version) ".x/"
349 "linux-" version ".tar.xz"))
352 ;; The current "stable" kernels. That is, the most recently released major
353 ;; versions that are still supported upstream.
354 (define-public linux-libre-5.14-version "5.14.12")
355 (define-public linux-libre-5.14-gnu-revision "gnu")
356 (define deblob-scripts-5.14
357 (linux-libre-deblob-scripts
358 linux-libre-5.14-version
359 linux-libre-5.14-gnu-revision
360 (base32 "00vv2a51cvw2nx8iazmiy9i4h3jj9gvvpwz9gxp2v1hcmrsxq935")
361 (base32 "024rz0bp3n3r5nkwbib7byx10d72c2fh5cw9iv00diyzgnp819g7")))
362 (define-public linux-libre-5.14-pristine-source
363 (let ((version linux-libre-5.14-version)
364 (hash (base32 "0dswxf1qk70lms5lph15i7nz3ybwiia58v8zzrmi71ajviwjc9wd")))
365 (make-linux-libre-source version
366 (%upstream-linux-source version hash)
367 deblob-scripts-5.14)))
369 ;; The "longterm" kernels — the older releases with long-term upstream support.
370 ;; Here are the support timelines:
371 ;; <https://www.kernel.org/category/releases.html>
372 (define-public linux-libre-5.10-version "5.10.73")
373 (define-public linux-libre-5.10-gnu-revision "gnu1")
374 (define deblob-scripts-5.10
375 (linux-libre-deblob-scripts
376 linux-libre-5.10-version
377 linux-libre-5.10-gnu-revision
378 (base32 "19d1pdsilq1ycnx1zw3vhf9mwdxbi5nmgzm0g1kj1lkkf1y4i1mv")
379 (base32 "024rz0bp3n3r5nkwbib7byx10d72c2fh5cw9iv00diyzgnp819g7")))
380 (define-public linux-libre-5.10-pristine-source
381 (let ((version linux-libre-5.10-version)
382 (hash (base32 "0xhf0g5pra27hnavpy0y3mn05m5hqn5rd3d6fx0a3vr35c1jicpd")))
383 (make-linux-libre-source version
384 (%upstream-linux-source version hash)
385 deblob-scripts-5.10)))
387 (define-public linux-libre-5.4-version "5.4.153")
388 (define-public linux-libre-5.4-gnu-revision "gnu1")
389 (define deblob-scripts-5.4
390 (linux-libre-deblob-scripts
391 linux-libre-5.4-version
392 linux-libre-5.4-gnu-revision
393 (base32 "1cdxljvmivdwcy9v9fr5iv0x0d1884pf3876p9nzrly599lz2wnl")
394 (base32 "1a0k9i8gnzkyvfr80f8xw2fnxfwddhz1pzicz9fh0y3jzzkzk45p")))
395 (define-public linux-libre-5.4-pristine-source
396 (let ((version linux-libre-5.4-version)
397 (hash (base32 "0jaz57sd51xqc7w8k3f43bfc5mdsh1413mdngqqsgr8isv4hg7vd")))
398 (make-linux-libre-source version
399 (%upstream-linux-source version hash)
400 deblob-scripts-5.4)))
402 (define-public linux-libre-4.19-version "4.19.211")
403 (define-public linux-libre-4.19-gnu-revision "gnu1")
404 (define deblob-scripts-4.19
405 (linux-libre-deblob-scripts
406 linux-libre-4.19-version
407 linux-libre-4.19-gnu-revision
408 (base32 "1hiaagdyfy6b0f9ivdy7zq0cd6akaj6v3c4nzikrgsk12vgc1a1q")
409 (base32 "1a0k9i8gnzkyvfr80f8xw2fnxfwddhz1pzicz9fh0y3jzzkzk45p")))
410 (define-public linux-libre-4.19-pristine-source
411 (let ((version linux-libre-4.19-version)
412 (hash (base32 "1m3y5gsf5s8bb4jxkri20dlxi8aiqabzaijj2h1svz4r19ca8j7v")))
413 (make-linux-libre-source version
414 (%upstream-linux-source version hash)
415 deblob-scripts-4.19)))
417 (define-public linux-libre-4.14-version "4.14.250")
418 (define-public linux-libre-4.14-gnu-revision "gnu1")
419 (define deblob-scripts-4.14
420 (linux-libre-deblob-scripts
421 linux-libre-4.14-version
422 linux-libre-4.14-gnu-revision
423 (base32 "0cnax38650m9sxiwvc1xm5saymlsmx427j3jqpx34df2ah2rnrwf")
424 (base32 "1a0k9i8gnzkyvfr80f8xw2fnxfwddhz1pzicz9fh0y3jzzkzk45p")))
425 (define-public linux-libre-4.14-pristine-source
426 (let ((version linux-libre-4.14-version)
427 (hash (base32 "0zbf6gxm8iwf7cra310gfd0zyj8l9ckdahky9w6wb9wlznwkvd54")))
428 (make-linux-libre-source version
429 (%upstream-linux-source version hash)
430 deblob-scripts-4.14)))
432 (define-public linux-libre-4.9-version "4.9.286")
433 (define-public linux-libre-4.9-gnu-revision "gnu1")
434 (define deblob-scripts-4.9
435 (linux-libre-deblob-scripts
436 linux-libre-4.9-version
437 linux-libre-4.9-gnu-revision
438 (base32 "1n74ddrifnw06hx7ih2sk8jaiqlm1jyyhswyjpxiyhrrcvjcilch")
439 (base32 "1a0k9i8gnzkyvfr80f8xw2fnxfwddhz1pzicz9fh0y3jzzkzk45p")))
440 (define-public linux-libre-4.9-pristine-source
441 (let ((version linux-libre-4.9-version)
442 (hash (base32 "0id62p43dmkl9ir278p0dsfg3q7m1d8rlxv0c9qi1pzalkygv8p2")))
443 (make-linux-libre-source version
444 (%upstream-linux-source version hash)
445 deblob-scripts-4.9)))
447 (define-public linux-libre-4.4-version "4.4.288")
448 (define-public linux-libre-4.4-gnu-revision "gnu1")
449 (define deblob-scripts-4.4
450 (linux-libre-deblob-scripts
451 linux-libre-4.4-version
452 linux-libre-4.4-gnu-revision
453 (base32 "11397dgj6cdfv6anxrj7jwgvnqvwh5i0ci6c8mb85ry6h4fnfmq4")
454 (base32 "1a0k9i8gnzkyvfr80f8xw2fnxfwddhz1pzicz9fh0y3jzzkzk45p")))
455 (define-public linux-libre-4.4-pristine-source
456 (let ((version linux-libre-4.4-version)
457 (hash (base32 "028w3yzmzymy7l1nf3n1pfbg95hfi4ilphkyl00ddgj8sfm542c7")))
458 (make-linux-libre-source version
459 (%upstream-linux-source version hash)
460 deblob-scripts-4.4)))
462 (define %boot-logo-patch
463 ;; Linux-Libre boot logo featuring Freedo and a gnu.
466 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
467 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
470 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
472 (define %linux-libre-arm-export-__sync_icache_dcache-patch
476 "https://salsa.debian.org/kernel-team/linux"
477 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
478 "/debian/patches/bugfix/arm/"
479 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
480 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
482 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
484 (define (source-with-patches source patches)
487 (patches (append (origin-patches source)
490 (define-public linux-libre-5.14-source
491 (source-with-patches linux-libre-5.14-pristine-source
492 (list %boot-logo-patch
493 %linux-libre-arm-export-__sync_icache_dcache-patch
494 ;; Pinebook Pro patch to fix LCD display
496 "linux-libre-arm64-generic-pinebook-lcd.patch"))))
498 (define-public linux-libre-5.10-source
499 (source-with-patches linux-libre-5.10-pristine-source
500 (list %boot-logo-patch
501 %linux-libre-arm-export-__sync_icache_dcache-patch
502 ;; Pinebook Pro patch to fix LCD display
504 "linux-libre-arm64-generic-pinebook-lcd.patch"))))
506 (define-public linux-libre-5.4-source
507 (source-with-patches linux-libre-5.4-pristine-source
508 (list %boot-logo-patch
509 %linux-libre-arm-export-__sync_icache_dcache-patch
510 ;; Pinebook Pro patch from linux-next,
511 ;; can be dropped for linux-libre 5.7
513 "linux-libre-support-for-Pinebook-Pro.patch"))))
515 (define-public linux-libre-4.19-source
516 (source-with-patches linux-libre-4.19-pristine-source
517 (list %boot-logo-patch
518 %linux-libre-arm-export-__sync_icache_dcache-patch)))
520 (define-public linux-libre-4.14-source
521 (source-with-patches linux-libre-4.14-pristine-source
522 (list %boot-logo-patch)))
524 (define-public linux-libre-4.9-source
525 (source-with-patches linux-libre-4.9-pristine-source
526 (list %boot-logo-patch)))
528 (define-public linux-libre-4.4-source
529 (source-with-patches linux-libre-4.4-pristine-source
530 (list %boot-logo-patch)))
537 (define (make-linux-libre-headers version gnu-revision hash-string)
538 (make-linux-libre-headers* version gnu-revision
541 (uri (linux-libre-urls version gnu-revision))
542 (sha256 (base32 hash-string)))))
544 (define (make-linux-libre-headers* version gnu-revision source)
546 (name "linux-libre-headers")
549 (build-system gnu-build-system)
550 (native-inputs `(("perl" ,perl)
551 ,@(if (version>=? version "4.16")
556 `(#:modules ((guix build gnu-build-system)
561 (modify-phases %standard-phases
565 (let ((arch ,(system->linux-architecture
566 (or (%current-target-system)
568 (defconfig ,(system->defconfig
569 (or (%current-target-system)
571 (make-target ,(if (version>=? version "5.3")
575 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
576 (invoke "make" defconfig)
577 (invoke "make" "mrproper" make-target))))
579 (lambda* (#:key outputs #:allow-other-keys)
580 (let ((out (assoc-ref outputs "out")))
582 ;; Mimic the quiet_cmd_headers_install target to avoid a
583 ;; dependency on rsync.
584 (for-each (lambda (file)
585 (let ((destination (string-append
587 ;; Drop the 'usr/include' prefix.
588 (match (string-split file #\/)
590 (string-join path "/"))))))
591 (format #t "`~a' -> `~a'~%" file destination)
592 (install-file file (dirname destination))))
593 (find-files "usr/include" "\\.h$"))
595 (mkdir (string-append out "/include/config"))
596 (call-with-output-file
598 "/include/config/kernel.release")
600 (format p "~a-default~%" ,version)))))))
601 #:allowed-references ()
603 (home-page "https://www.gnu.org/software/linux-libre/")
604 (synopsis "GNU Linux-Libre kernel headers")
605 (description "Headers of the Linux-Libre kernel.")
606 (license license:gpl2)))
608 (define-public linux-libre-headers-5.14
609 (make-linux-libre-headers* linux-libre-5.14-version
610 linux-libre-5.14-gnu-revision
611 linux-libre-5.14-source))
613 (define-public linux-libre-headers-5.10
614 (make-linux-libre-headers* linux-libre-5.10-version
615 linux-libre-5.10-gnu-revision
616 linux-libre-5.10-source))
618 (define-public linux-libre-headers-5.4
619 (make-linux-libre-headers* linux-libre-5.4-version
620 linux-libre-5.4-gnu-revision
621 linux-libre-5.4-source))
623 (define-public linux-libre-headers-4.19
624 (make-linux-libre-headers* linux-libre-4.19-version
625 linux-libre-4.19-gnu-revision
626 linux-libre-4.19-source))
628 (define-public linux-libre-headers-4.14
629 (make-linux-libre-headers* linux-libre-4.14-version
630 linux-libre-4.14-gnu-revision
631 linux-libre-4.14-source))
633 (define-public linux-libre-headers-4.9
634 (make-linux-libre-headers* linux-libre-4.9-version
635 linux-libre-4.9-gnu-revision
636 linux-libre-4.9-source))
638 (define-public linux-libre-headers-4.4
639 (make-linux-libre-headers* linux-libre-4.4-version
640 linux-libre-4.4-gnu-revision
641 linux-libre-4.4-source))
643 ;; The following package is used in the early bootstrap, and thus must be kept
644 ;; stable and with minimal build requirements.
645 (define-public linux-libre-headers-5.10.35
646 (make-linux-libre-headers "5.10.35" "gnu"
647 "0q2rnchad55d49f3rajrkazz0fcjv1irwrdb1hwjnl01fzm2gjk3"))
649 (define-public linux-libre-headers linux-libre-headers-5.10.35)
653 ;;; Kernel configurations.
656 (define* (kernel-config arch #:key variant)
657 "Return the absolute file name of the Linux-Libre build configuration file
658 for ARCH and optionally VARIANT, or #f if there is no such configuration."
659 (let* ((name (string-append (if variant (string-append variant "-") "")
660 (if (string=? "i386" arch) "i686" arch) ".conf"))
661 (file (string-append "linux-libre/" name)))
662 (search-auxiliary-file file)))
664 (define %default-extra-linux-options
665 `(;; Some very mild hardening.
666 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
667 ;; All kernels should have NAMESPACES options enabled
668 ("CONFIG_NAMESPACES" . #t)
669 ("CONFIG_UTS_NS" . #t)
670 ("CONFIG_IPC_NS" . #t)
671 ("CONFIG_USER_NS" . #t)
672 ("CONFIG_PID_NS" . #t)
673 ("CONFIG_NET_NS" . #t)
674 ;; Various options needed for elogind service:
675 ;; https://issues.guix.gnu.org/43078
676 ("CONFIG_CGROUP_FREEZER" . #t)
677 ("CONFIG_BLK_CGROUP" . #t)
678 ("CONFIG_CGROUP_WRITEBACK" . #t)
679 ("CONFIG_CGROUP_SCHED" . #t)
680 ("CONFIG_CGROUP_PIDS" . #t)
681 ("CONFIG_CGROUP_FREEZER" . #t)
682 ("CONFIG_CGROUP_DEVICE" . #t)
683 ("CONFIG_CGROUP_CPUACCT" . #t)
684 ("CONFIG_CGROUP_PERF" . #t)
685 ("CONFIG_SOCK_CGROUP_DATA" . #t)
686 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
687 ("CONFIG_CGROUP_NET_PRIO" . #t)
688 ("CONFIG_CGROUP_NET_CLASSID" . #t)
689 ("CONFIG_MEMCG" . #t)
690 ("CONFIG_MEMCG_SWAP" . #t)
691 ("CONFIG_MEMCG_KMEM" . #t)
692 ("CONFIG_CPUSETS" . #t)
693 ("CONFIG_PROC_PID_CPUSET" . #t)
694 ;; Allow disk encryption by default
695 ("CONFIG_DM_CRYPT" . m)
696 ;; Modules required for initrd:
697 ("CONFIG_NET_9P" . m)
698 ("CONFIG_NET_9P_VIRTIO" . m)
699 ("CONFIG_VIRTIO_BLK" . m)
700 ("CONFIG_VIRTIO_NET" . m)
701 ("CONFIG_VIRTIO_PCI" . m)
702 ("CONFIG_VIRTIO_BALLOON" . m)
703 ("CONFIG_VIRTIO_MMIO" . m)
704 ("CONFIG_FUSE_FS" . m)
706 ("CONFIG_9P_FS" . m)))
708 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
709 (define %bpf-extra-linux-options
710 `(;; Needed for probes
711 ("CONFIG_UPROBE_EVENTS" . #t)
712 ("CONFIG_KPROBE_EVENTS" . #t)
713 ;; kheaders module also helpful for tracing
714 ("CONFIG_IKHEADERS" . #t)
716 ("CONFIG_BPF_SYSCALL" . #t)
717 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
718 ;; optional, for tc filters
719 ("CONFIG_NET_CLS_BPF" . m)
720 ;; optional, for tc actions
721 ("CONFIG_NET_ACT_BPF" . m)
722 ("CONFIG_BPF_JIT" . #t)
723 ;; for Linux kernel versions 4.1 through 4.6
724 ;; ("CONFIG_HAVE_BPF_JIT" . y)
725 ;; for Linux kernel versions 4.7 and later
726 ("CONFIG_HAVE_EBPF_JIT" . #t)
727 ;; optional, for kprobes
728 ("CONFIG_BPF_EVENTS" . #t)
730 ("CONFIG_IKHEADERS" . #t)))
732 (define (config->string options)
733 (string-join (map (match-lambda
735 (string-append option "=m"))
737 (string-append option "=y"))
739 (string-append option "=n")))
745 ;;; Kernel package utilities.
748 (define* (make-linux-libre version gnu-revision hash-string supported-systems
751 ;; A function that takes an arch and a variant.
752 ;; See kernel-config for an example.
753 (configuration-file #f)
754 (defconfig "defconfig")
755 (extra-options %default-extra-linux-options)
756 (patches (list %boot-logo-patch)))
757 (make-linux-libre* version gnu-revision
760 (uri (linux-libre-urls version gnu-revision))
761 (sha256 (base32 hash-string))
764 #:extra-version extra-version
765 #:configuration-file configuration-file
766 #:defconfig defconfig
767 #:extra-options extra-options))
769 (define* (make-linux-libre* version gnu-revision source supported-systems
772 ;; A function that takes an arch and a variant.
773 ;; See kernel-config for an example.
774 (configuration-file #f)
775 (defconfig "defconfig")
776 (extra-options %default-extra-linux-options))
778 (name (if extra-version
779 (string-append "linux-libre-" extra-version)
783 (supported-systems supported-systems)
784 (build-system gnu-build-system)
789 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
793 ;; These are needed to compile the GCC plugins.
798 ,@(match (and configuration-file
800 (system->linux-architecture
801 (or (%current-target-system) (%current-system)))
802 #:variant (version-major+minor version)))
803 (#f ;no config for this platform
806 `(("kconfig" ,config))))))
808 `(#:modules ((guix build gnu-build-system)
815 (modify-phases %standard-phases
816 (add-after 'unpack 'patch-/bin/pwd
818 (substitute* (find-files "." "^Makefile(\\.include)?$")
819 (("/bin/pwd") "pwd"))
822 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
823 ;; Avoid introducing timestamps
824 (setenv "KCONFIG_NOTIMESTAMP" "1")
825 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
827 ;; Set ARCH and CROSS_COMPILE
828 (let ((arch ,(system->linux-architecture
829 (or (%current-target-system)
830 (%current-system)))))
832 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
835 (setenv "CROSS_COMPILE" (string-append target "-"))
836 (format #t "`CROSS_COMPILE' set to `~a'~%"
837 (getenv "CROSS_COMPILE"))))
839 (setenv "EXTRAVERSION" ,(and extra-version
840 (string-append "-" extra-version)))
842 (let ((build (assoc-ref %standard-phases 'build))
843 (config (assoc-ref (or native-inputs inputs) "kconfig")))
845 ;; Use a custom kernel configuration file or a default
846 ;; configuration file.
849 (copy-file config ".config")
850 (chmod ".config" #o666))
851 (invoke "make" ,defconfig))
853 ;; Appending works even when the option wasn't in the
854 ;; file. The last one prevails if duplicated.
855 (let ((port (open-file ".config" "a"))
856 (extra-configuration ,(config->string extra-options)))
857 (display extra-configuration port)
860 (invoke "make" "oldconfig"))))
862 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
863 (let* ((out (assoc-ref outputs "out"))
864 (moddir (string-append out "/lib/modules"))
865 (dtbdir (string-append out "/lib/dtbs")))
866 ;; Install kernel image, kernel configuration and link map.
867 (for-each (lambda (file) (install-file file out))
868 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
869 ;; Install device tree files
870 (unless (null? (find-files "." "\\.dtb$"))
872 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
874 ;; Install kernel modules
877 ;; Disable depmod because the Guix system's module directory
878 ;; is an union of potentially multiple packages. It is not
879 ;; possible to use depmod to usefully calculate a dependency
880 ;; graph while building only one of those packages.
882 (string-append "MODULE_DIR=" moddir)
883 (string-append "INSTALL_PATH=" out)
884 (string-append "INSTALL_MOD_PATH=" out)
885 "INSTALL_MOD_STRIP=1"
887 (let* ((versions (filter (lambda (name)
888 (not (string-prefix? "." name)))
890 (version (match versions
892 ;; There are symlinks to the build and source directory,
893 ;; both of which will point to target /tmp/guix-build*
894 ;; and thus not be useful in a profile. Delete the symlinks.
895 (false-if-file-not-found
896 (delete-file (string-append moddir "/" version "/build")))
897 (false-if-file-not-found
898 (delete-file (string-append moddir "/" version "/source"))))
901 (home-page "https://www.gnu.org/software/linux-libre/")
902 (synopsis "100% free redistribution of a cleaned Linux kernel")
904 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
905 It has been modified to remove all non-free binary blobs.")
906 (license license:gpl2)
907 (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.
911 ;;; Generic kernel packages.
914 (define-public linux-libre-5.14
915 (make-linux-libre* linux-libre-5.14-version
916 linux-libre-5.14-gnu-revision
917 linux-libre-5.14-source
918 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
919 #:configuration-file kernel-config))
921 (define-public linux-libre-version linux-libre-5.14-version)
922 (define-public linux-libre-gnu-revision linux-libre-5.14-gnu-revision)
923 (define-public linux-libre-pristine-source linux-libre-5.14-pristine-source)
924 (define-public linux-libre-source linux-libre-5.14-source)
925 (define-public linux-libre linux-libre-5.14)
927 (define-public linux-libre-5.10
928 (make-linux-libre* linux-libre-5.10-version
929 linux-libre-5.10-gnu-revision
930 linux-libre-5.10-source
931 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
932 #:configuration-file kernel-config))
934 (define-public linux-libre-5.4
935 (make-linux-libre* linux-libre-5.4-version
936 linux-libre-5.4-gnu-revision
937 linux-libre-5.4-source
938 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
939 #:configuration-file kernel-config))
941 (define-public linux-libre-4.19
942 (make-linux-libre* linux-libre-4.19-version
943 linux-libre-4.19-gnu-revision
944 linux-libre-4.19-source
945 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
946 #:configuration-file kernel-config))
948 (define-public linux-libre-4.14
949 (make-linux-libre* linux-libre-4.14-version
950 linux-libre-4.14-gnu-revision
951 linux-libre-4.14-source
952 '("x86_64-linux" "i686-linux" "armhf-linux")
953 #:configuration-file kernel-config))
955 (define-public linux-libre-4.9
956 (make-linux-libre* linux-libre-4.9-version
957 linux-libre-4.9-gnu-revision
958 linux-libre-4.9-source
959 '("x86_64-linux" "i686-linux")
960 #:configuration-file kernel-config))
962 (define-public linux-libre-4.4
963 (make-linux-libre* linux-libre-4.4-version
964 linux-libre-4.4-gnu-revision
965 linux-libre-4.4-source
966 '("x86_64-linux" "i686-linux")
967 #:configuration-file kernel-config
970 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
971 ;; This option was removed upstream in version 4.7.
972 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
973 %default-extra-linux-options)))
975 ;; Linux-Libre-LTS points to the *newest* released long-term support version of
977 ;; Reference: https://jxself.org/linux-libre/
979 (define-public linux-libre-lts-version linux-libre-5.10-version)
980 (define-public linux-libre-lts-gnu-revision linux-libre-5.10-gnu-revision)
981 (define-public linux-libre-lts-pristine-source linux-libre-5.10-pristine-source)
982 (define-public linux-libre-lts-source linux-libre-5.10-source)
983 (define-public linux-libre-lts linux-libre-5.10)
987 ;;; Specialized kernel variants.
990 (define-public linux-libre-arm-generic
991 (make-linux-libre* linux-libre-version
992 linux-libre-gnu-revision
995 #:defconfig "multi_v7_defconfig"
996 #:extra-version "arm-generic"
999 `(;; needed to fix the RTC on rockchip platforms
1000 ("CONFIG_RTC_DRV_RK808" . #t))
1001 %default-extra-linux-options)))
1003 (define-public linux-libre-arm-veyron
1004 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
1006 (define-public linux-libre-arm-generic-5.10
1007 (make-linux-libre* linux-libre-5.10-version
1008 linux-libre-5.10-gnu-revision
1009 linux-libre-5.10-source
1011 #:defconfig "multi_v7_defconfig"
1012 #:extra-version "arm-generic"
1015 `(;; needed to fix the RTC on rockchip platforms
1016 ("CONFIG_RTC_DRV_RK808" . #t))
1017 %default-extra-linux-options)))
1019 (define-public linux-libre-arm-generic-5.4
1020 (make-linux-libre* linux-libre-5.4-version
1021 linux-libre-5.4-gnu-revision
1022 linux-libre-5.4-source
1024 #:defconfig "multi_v7_defconfig"
1025 #:extra-version "arm-generic"
1028 `(;; needed to fix the RTC on rockchip platforms
1029 ("CONFIG_RTC_DRV_RK808" . #t))
1030 %default-extra-linux-options)))
1032 (define-public linux-libre-arm-generic-4.19
1033 (make-linux-libre* linux-libre-4.19-version
1034 linux-libre-4.19-gnu-revision
1035 linux-libre-4.19-source
1037 #:defconfig "multi_v7_defconfig"
1038 #:extra-version "arm-generic"))
1040 (define-public linux-libre-arm-generic-4.14
1041 (make-linux-libre* linux-libre-4.14-version
1042 linux-libre-4.14-gnu-revision
1043 linux-libre-4.14-source
1045 #:defconfig "multi_v7_defconfig"
1046 #:extra-version "arm-generic"))
1048 (define-public linux-libre-arm-omap2plus
1049 (make-linux-libre* linux-libre-version
1050 linux-libre-gnu-revision
1053 #:defconfig "omap2plus_defconfig"
1054 #:extra-version "arm-omap2plus"))
1056 (define-public linux-libre-arm-omap2plus-4.19
1057 (make-linux-libre* linux-libre-4.19-version
1058 linux-libre-4.19-gnu-revision
1059 linux-libre-4.19-source
1061 #:defconfig "omap2plus_defconfig"
1062 #:extra-version "arm-omap2plus"))
1064 (define-public linux-libre-arm-omap2plus-4.14
1065 (make-linux-libre* linux-libre-4.14-version
1066 linux-libre-4.14-gnu-revision
1067 linux-libre-4.14-source
1069 #:defconfig "omap2plus_defconfig"
1070 #:extra-version "arm-omap2plus"))
1072 (define-public linux-libre-arm64-generic
1073 (make-linux-libre* linux-libre-version
1074 linux-libre-gnu-revision
1077 #:defconfig "defconfig"
1078 #:extra-version "arm64-generic"
1081 `(;; needed to fix the RTC on rockchip platforms
1082 ("CONFIG_RTC_DRV_RK808" . #t)
1083 ;; Pinebook display, battery, charger and usb
1084 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1085 ("CONFIG_CHARGER_AXP20X" . m)
1086 ("CONFIG_INPUT_AXP20X_PEK" . m)
1087 ("CONFIG_CHARGER_AXP20X" . m)
1088 ("CONFIG_BATTERY_AXP20X" . m)
1089 ("CONFIG_PINCTRL_AXP209" . m)
1090 ("CONFIG_AXP20X_POWER" . m)
1091 ("CONFIG_AXP20X_ADC" . m)
1092 ;; Pinebook PRO battery and sound support
1093 ("CONFIG_BATTERY_CW2015" . m)
1094 ("CONFIG_CHARGER_GPIO" . m)
1095 ("CONFIG_SND_SOC_ES8316" . m))
1096 %default-extra-linux-options)))
1098 (define-public linux-libre-arm64-generic-5.10
1099 (make-linux-libre* linux-libre-5.10-version
1100 linux-libre-5.10-gnu-revision
1101 linux-libre-5.10-source
1103 #:defconfig "defconfig"
1104 #:extra-version "arm64-generic"
1107 `(;; needed to fix the RTC on rockchip platforms
1108 ("CONFIG_RTC_DRV_RK808" . #t)
1109 ;; Pinebook display, battery, charger and usb
1110 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1111 ("CONFIG_CHARGER_AXP20X" . m)
1112 ("CONFIG_INPUT_AXP20X_PEK" . m)
1113 ("CONFIG_CHARGER_AXP20X" . m)
1114 ("CONFIG_BATTERY_AXP20X" . m)
1115 ("CONFIG_PINCTRL_AXP209" . m)
1116 ("CONFIG_AXP20X_POWER" . m)
1117 ("CONFIG_AXP20X_ADC" . m)
1118 ;; Pinebook PRO battery and sound support
1119 ("CONFIG_BATTERY_CW2015" . m)
1120 ("CONFIG_CHARGER_GPIO" . m)
1121 ("CONFIG_SND_SOC_ES8316" . m))
1122 %default-extra-linux-options)))
1124 (define-public linux-libre-arm64-generic-5.4
1125 (make-linux-libre* linux-libre-5.4-version
1126 linux-libre-5.4-gnu-revision
1127 linux-libre-5.4-source
1129 #:defconfig "defconfig"
1130 #:extra-version "arm64-generic"
1133 `(;; needed to fix the RTC on rockchip platforms
1134 ("CONFIG_RTC_DRV_RK808" . #t))
1135 %default-extra-linux-options)))
1137 (define-public linux-libre-riscv64-generic
1138 (make-linux-libre* linux-libre-version
1139 linux-libre-gnu-revision
1142 #:extra-version "riscv64-generic"))
1144 (define-public linux-libre-mips64el-fuloong2e
1145 (make-linux-libre* linux-libre-version
1146 linux-libre-gnu-revision
1149 #:defconfig "fuloong2e_defconfig"
1150 #:extra-version "mips64el-fuloong2e"
1153 `(("CONFIG_OVERLAY_FS" . m))
1154 %default-extra-linux-options)))
1156 (define-public linux-libre-with-bpf
1157 (let ((base-linux-libre
1159 linux-libre-5.14-version
1160 linux-libre-5.14-gnu-revision
1161 linux-libre-5.14-source
1162 '("x86_64-linux" "i686-linux" "armhf-linux"
1163 "aarch64-linux" "riscv64-linux")
1164 #:extra-version "bpf"
1165 #:configuration-file kernel-config
1167 (append %bpf-extra-linux-options
1168 %default-extra-linux-options))))
1170 (inherit base-linux-libre)
1171 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
1176 ;;; Linux kernel modules.
1179 (define-public acpi-call-linux-module
1181 (name "acpi-call-linux-module")
1187 (url "https://github.com/nix-community/acpi_call")
1188 (commit (string-append "v" version))))
1189 (file-name (git-file-name name version))
1191 (base32 "1s7h9y3adyfhw7cjldlfmid79lrwz3vqlvziw9nwd6x5qdj4w9vp"))))
1192 (build-system linux-module-build-system)
1194 `(#:tests? #f ; no tests
1196 (modify-phases %standard-phases
1197 (add-before 'install 'patch-shebangs-harder
1198 ;; The (only) shebangs in examples/ don't justify a reference.
1199 ;; However, do substitute a more portable one than the original.
1201 (substitute* (find-files "examples" ".")
1202 (("^(#! *)/[^ ]*/" _ shebang)
1203 (string-append shebang "/usr/bin/env ")))))
1204 (add-after 'install 'install-documentation
1205 (lambda* (#:key outputs #:allow-other-keys)
1206 (let* ((out (assoc-ref outputs "out"))
1207 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1208 (for-each (lambda (file)
1209 (let ((target (string-append doc "/" file)))
1210 (mkdir-p (dirname target))
1211 (copy-recursively file target)))
1212 (list "README.md" "examples"))))))))
1213 (home-page "https://github.com/nix-community/acpi_call")
1214 (synopsis "Linux kernel module to perform ACPI method calls")
1216 "This simple Linux kernel module allows calls from user space to any
1217 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1218 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1219 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1220 and @code{ACPI_BUFFER}.
1222 It grants direct and undocumented access to your hardware that may cause damage
1223 and should be used with caution, especially on untested models.")
1224 (license license:gpl3+))) ; see README.md (no licence headers)
1226 (define-public corefreq
1234 (url "https://github.com/cyring/CoreFreq")
1236 (file-name (git-file-name name version))
1238 (base32 "1k8pyxcahc78kcc8q1h76dr91i1r33jciqhgkajkz3xa28qx8mhn"))))
1239 (build-system linux-module-build-system)
1240 (outputs (list "out" "linux-module"))
1242 `(#:imported-modules ((guix build gnu-build-system)
1243 ,@%linux-module-build-system-modules)
1244 #:modules ((guix build linux-module-build-system)
1245 ((guix build gnu-build-system) #:prefix gnu:)
1248 (list (string-append "CC=" ,(cc-for-target))
1250 (string-append "PREFIX=" (assoc-ref %outputs "out")))
1251 #:tests? #f ; no test suite
1253 (modify-phases %standard-phases
1254 (add-after 'unpack 'untangle-module-targets
1255 ;; Having to build everything in one pass would complicate the
1256 ;; definition. Let each build system handle what it's good at.
1258 (substitute* "Makefile"
1259 ((".*MAKE.*KERNELDIR.*") ""))))
1260 (add-after 'build 'gnu:build
1261 (assoc-ref gnu:%standard-phases 'build))
1262 (add-after 'install 'gnu:install
1263 (assoc-ref gnu:%standard-phases 'install))
1264 (add-after 'install 'separate-module
1265 (lambda* (#:key outputs #:allow-other-keys)
1266 ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an
1267 ;; empty <out>/lib/modules directory, so just do it all by hand.
1268 (let* ((out (assoc-ref outputs "out"))
1269 (module (assoc-ref outputs "linux-module")))
1270 (mkdir-p (string-append module "/lib"))
1271 (rename-file (string-append out "/lib/modules")
1272 (string-append module "/lib/modules")))))
1273 (add-after 'install 'install-README
1274 ;; There is no proper documentation. Provide something.
1275 (lambda* (#:key outputs #:allow-other-keys)
1276 (let* ((out (assoc-ref outputs "out"))
1277 (doc (string-append out "/share/doc/"
1278 ,name "-" ,version)))
1279 (install-file "README.md" doc)))))))
1280 (home-page "https://github.com/cyring/CoreFreq")
1282 "Measure performance data & tweak low-level settings on x86-64 CPUs")
1284 "CoreFreq is a CPU monitor that reports low-level processor settings and
1285 performance data with notably high precision by using a loadable Linux kernel
1286 module. Unlike most similar tools, it can be used to modify some settings if
1287 supported by the hardware and at your own risk. It's designed for 64-bit x86
1288 Intel processors (Atom, Core2, Nehalem, SandyBridge, and newer) and compatible
1289 architectures like AMD@tie{}Zen and Hygon@tie{}Dhyana.
1291 Supported processor features include:
1293 @item time spent in C-states, including C1/C3 Auto- and UnDemotion;
1294 @item core temperatures, voltage, and tweaking thermal limits;
1295 @item core frequencies, ratios, and base clock rate;
1296 @item enabling, disabling, and testing SpeedStep (EIST), Turbo Boost, and
1297 Hyper-Threading or SMT;
1298 @item enabling or disabling data cache prefetching;
1299 @item kernel assembly code to keep as near as possible readings of performance
1300 counters such as the @acronym{TSC, Time Stamp Counter}, @acronym{UCC, Unhalted
1301 Core Cycles}, and @acronym{URC, Unhalted Reference Cycles};
1302 @item the number of instructions per cycle or second (IPS, IPC, and CPI);
1303 @item memory controller geometry and RAM timings;
1304 @item running processes' CPU affinity.
1307 This package provides the @command{corefreqd} data collection daemon, the
1308 @command{corefreq-cli} client to visualise and control it in real time, and the
1309 @code{corefreqk} kernel module in its own separate output. Read the included
1310 @file{README.md} before loading it.")
1311 (supported-systems (list "x86_64-linux"))
1312 (license license:gpl2)))
1314 (define-public librem-ec-acpi-linux-module
1316 (name "librem-ec-acpi-linux-module")
1322 (url "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
1323 (commit (string-append "v" version))))
1324 (file-name (git-file-name name version))
1326 (base32 "1qnbfj60i8nn2ahgj2zp5ixd79bb0wl1ld36x3igws2f3c0f5pfi"))))
1327 (build-system linux-module-build-system)
1329 `(#:tests? #f)) ; no test suite
1330 (home-page "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
1331 (synopsis "Linux kernel module to control the Librem Embedded Controller")
1333 "This is the Linux kernel @acronym{ACPI, Advanced Configuration and Power
1334 Interface} platform driver for the @acronym{EC, Embedded Controller} firmware
1335 on Purism Librem laptop computers. It allows user-space control over the
1336 battery charging thresholds, keyboard backlight, fans and thermal monitors,
1337 and the notification, WiFi, and Bluetooth LED.")
1338 (license license:gpl2)))
1340 (define-public rtl8821ce-linux-module
1341 (let ((commit "897e7c4c15dd5a0a569745dc223d969a26ff5bfc")
1344 (name "rtl8821ce-linux-module")
1345 (version (git-version "0.0.0" revision commit))
1350 (url "https://github.com/tomaspinho/rtl8821ce")
1352 (file-name (git-file-name name version))
1355 "0935dzz0njxh78wfd17yqah1dxn6b3kaszvzclwwrwwhwcrdp80j"))))
1356 (build-system linux-module-build-system)
1359 (list (string-append "CC=" ,(cc-for-target))
1360 (string-append "KSRC="
1361 (assoc-ref %build-inputs "linux-module-builder")
1362 "/lib/modules/build"))
1364 (modify-phases %standard-phases
1366 (lambda* (#:key (make-flags '()) (parallel-build? #t)
1368 (apply invoke "make"
1369 `(,@(if parallel-build?
1370 `("-j" ,(number->string (parallel-job-count)))
1373 #:tests? #f)) ; no test suite
1374 (home-page "https://github.com/tomaspinho/rtl8821ce")
1375 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1376 (description "This is Realtek's RTL8821CE Linux driver for wireless
1378 (license license:gpl2))))
1380 (define-public rtl8812au-aircrack-ng-linux-module
1381 (let ((commit "b8167e66b4ac046b3b76c2c40008d84528e91594")
1384 (inherit rtl8821ce-linux-module)
1385 (name "rtl8812au-aircrack-ng-linux-module")
1386 (version (git-version "5.6.4.2" revision commit))
1391 (url "https://github.com/aircrack-ng/rtl8812au")
1393 (file-name (git-file-name name version))
1395 (base32 "1940f2yz5c4q2fhcd91zfzl32fhdsgr297vzamm7nd8kdk0gymi2"))
1396 (modules '((guix build utils)))
1399 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1400 ;; and other unnecessary unlicenced things.
1401 (for-each delete-file-recursively (list "android"
1404 (supported-systems '("x86_64-linux" "i686-linux"))
1405 (home-page "https://github.com/aircrack-ng/rtl8812au")
1406 (synopsis "Linux driver for Realtek USB wireless network adapters")
1408 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1409 network adapters, modified by the aircrack-ng project to support monitor mode
1410 and frame injection. It provides a @code{88XXau} kernel module that supports
1411 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1412 (license license:gpl2+))))
1414 (define-public vhba-module
1416 (name "vhba-module")
1417 (version "20210418")
1422 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1425 (base32 "119zgav6caialmf3hr096wkf72l9h76sqc9w5dhx26kj4yp85g8q"))))
1426 (build-system linux-module-build-system)
1428 `(#:tests? #f)) ; no test suite
1429 (home-page "https://cdemu.sourceforge.io/")
1430 (synopsis "Linux kernel module that emulates SCSI devices")
1432 "The @acronym{VHBA, Virtual SCSI Host Bus Adapter} module is the link
1433 between the CDemu user-space daemon and the kernel Linux. It acts as a
1434 low-level SCSI driver that emulates a virtual SCSI adapter which can have
1435 multiple virtual devices attached to it. Its typical use with CDEmu is to
1436 emulate optical devices such as DVD and CD-ROM drives.")
1437 (license license:gpl2+)))
1439 (define-public bbswitch-module
1440 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
1441 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
1442 (let ((commit "ddbd243638c7bc2baecf43a78aff46cdc12e9b2e"))
1444 (name "bbswitch-module")
1445 (version (git-version "0.8" "1" commit))
1449 (url "https://github.com/Bumblebee-Project/bbswitch")
1451 (file-name (git-file-name name version))
1454 "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb"))))
1455 (build-system linux-module-build-system)
1459 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1460 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1461 (description "The bbswitch module provides a way to toggle the Nvidia
1462 graphics card on Optimus laptops.")
1463 (license license:gpl2))))
1465 (define-public ddcci-driver-linux
1467 (name "ddcci-driver-linux")
1474 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1475 (commit (string-append "v" version))))
1476 (file-name (git-file-name name version))
1479 "0b50hhkna6ika2vwahzb9za9b41g39ialgv5y1y0kakqi50qi0ld"))))
1480 (build-system linux-module-build-system)
1482 `(#:tests? #f ; no tests
1484 (modify-phases %standard-phases
1489 (with-directory-excursion module
1490 (apply (assoc-ref %standard-phases 'build) args)))
1491 '("ddcci" "ddcci-backlight"))
1497 (with-directory-excursion module
1498 (apply (assoc-ref %standard-phases 'install) args)))
1499 '("ddcci" "ddcci-backlight"))
1501 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1502 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1503 (description "This package provides two Linux kernel drivers, ddcci and
1504 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1505 interface. The ddcci module creates a character device for each DDC/CI
1506 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1507 module allows the control of the backlight level or luminance property when
1508 supported under @file{/sys/class/backlight/}.")
1509 (license license:gpl2+)))
1511 (define-public v4l2loopback-linux-module
1513 (name "v4l2loopback-linux-module")
1518 (url "https://github.com/umlaeute/v4l2loopback")
1519 (commit (string-append "v" version))))
1520 (file-name (git-file-name name version))
1523 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1524 (build-system linux-module-build-system)
1526 `(#:tests? #f)) ; no test suite
1527 (home-page "https://github.com/umlaeute/v4l2loopback")
1528 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1530 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1531 for Linux 2} applications will treat these as ordinary video devices but read
1532 video data generated by another application, instead of a hardware device such
1535 This lets you apply nifty effects to your Jitsi video, for example, but also
1536 allows some more serious things like adding streaming capabilities to an
1537 application by hooking GStreamer into the loopback device.")
1538 (license license:gpl2+)))
1540 (define-public xpadneo
1547 (url "https://github.com/atar-axis/xpadneo")
1548 (commit (string-append "v" version))))
1549 (file-name (git-file-name name version))
1552 "0xr0zx134s56h4ij6c3fh8ki0h58h61minbfxcl3sgpgxkh14ism"))))
1553 (build-system linux-module-build-system)
1555 `(#:tests? #f ; no `check' target
1556 #:source-directory "hid-xpadneo/src"
1558 (modify-phases %standard-phases
1559 (add-after 'install 'post-install
1560 (lambda* (#:key outputs #:allow-other-keys #:rest args)
1561 (let ((out (assoc-ref outputs "out")))
1562 (copy-recursively "hid-xpadneo/etc-modprobe.d"
1563 (string-append out "/etc/modprobe.d"))
1564 ;; udev-service-type takes its rules from /lib rather than
1565 ;; /etc, so copy it there instead
1566 (copy-recursively "hid-xpadneo/etc-udev-rules.d"
1567 (string-append out "/lib/udev/rules.d"))))))))
1568 (home-page "https://atar-axis.github.io/xpadneo/")
1569 (synopsis "Xbox One Wireless Controller driver")
1571 "This package provides a driver for the XBox One S Wireless controller
1572 and some newer models when connected via bluetooth. In addition to the kernel
1573 module provided itself, it also contains a modprobe configuration and udev
1574 rules, which need to be installed separately.")
1575 (license license:gpl3+)))
1579 ;;; Pluggable authentication modules (PAM).
1582 (define-public linux-pam
1590 "https://github.com/linux-pam/linux-pam/releases/download/v"
1591 version "/Linux-PAM-" version ".tar.xz"))
1594 "1z4jayf69qyyxln1gl6ch4qxfd66ib1g42garnrv2d8i1drl0790"))
1595 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1597 (build-system gnu-build-system)
1601 ;; TODO: optional dependencies
1602 ;; ("libxcrypt" ,libxcrypt)
1603 ;; ("cracklib" ,cracklib)
1606 `(;; Most users, such as `shadow', expect the headers to be under
1608 #:configure-flags (list (string-append "--includedir="
1609 (assoc-ref %outputs "out")
1610 "/include/security")
1612 ;; XXX: <rpc/rpc.h> is missing from glibc when
1613 ;; cross-compiling, so we have to disable NIS
1614 ;; support altogether.
1615 ,@(if (%current-target-system)
1619 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1622 (home-page "http://www.linux-pam.org/")
1623 (synopsis "Pluggable authentication modules for Linux")
1625 "A *Free* project to implement OSF's RFC 86.0.
1626 Pluggable authentication modules are small shared object files that can
1627 be used through the PAM API to perform tasks, like authenticating a user
1628 at login. Local and dynamic reconfiguration are its key features.")
1629 (license license:bsd-3)))
1631 (define-public linux-pam-1.2
1639 "http://www.linux-pam.org/library/"
1640 "Linux-PAM-" version ".tar.bz2"))
1643 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1644 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1646 (define-public python-pamela
1648 (name "python-pamela")
1652 ;; Tests not distributed in pypi release.
1655 (url "https://github.com/minrk/pamela")
1657 (file-name (git-file-name name version))
1660 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
1661 (build-system python-build-system)
1663 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
1665 (modify-phases %standard-phases
1666 (add-after 'unpack 'hardcode-pam.so
1667 (lambda* (#:key inputs #:allow-other-keys)
1668 (let ((pam (assoc-ref inputs "linux-pam")))
1669 (substitute* "pamela.py"
1670 (("find_library\\(\"pam\")")
1671 (string-append "'" pam "/lib/libpam.so'")))
1674 (lambda* (#:key tests? #:allow-other-keys)
1676 (if (file-exists? "test_pamela.py")
1677 (invoke "py.test" "--assert=plain" "test_pamela.py")
1678 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
1681 `(("linux-pam" ,linux-pam)))
1683 `(("python-pytest" ,python-pytest)))
1684 (home-page "https://github.com/minrk/pamela")
1685 (synopsis "PAM interface using ctypes")
1686 (description "This package provides a PAM interface using @code{ctypes}.")
1687 (license license:expat)))
1689 (define-public pam-gnupg
1696 (url "https://github.com/cruegge/pam-gnupg")
1697 (commit (string-append "v" version))))
1698 (file-name (git-file-name name version))
1701 "1bf91gi6zmfzzmczxm7pajxdlgnikasvg5xsd3j0a368rcr7lf9l"))))
1702 (build-system gnu-build-system)
1705 ("linux-pam" ,linux-pam)))
1707 `(("autoconf" ,autoconf)
1708 ("automake" ,automake)
1709 ("libtool" ,libtool)))
1711 `(#:tests? #f ;no tests suite
1713 (list (string-append "--with-moduledir="
1714 (assoc-ref %outputs "out") "/lib/security"))))
1716 (home-page "https://github.com/cruegge/pam-gnupg")
1717 (synopsis "Unlock GnuPG keys on login")
1718 (description "This package provides a PAM module that hands over your
1719 login password to @code{gpg-agent}. This can be useful if you are using a
1720 GnuPG-based password manager like @code{pass}.")
1721 (license license:gpl3+)))
1728 (define-public powercap
1736 (url "https://github.com/powercap/powercap")
1737 (commit (string-append "v" version))))
1738 (file-name (git-file-name name version))
1740 (base32 "1hp2i1d195v0n4jgvgaymkxlpgyhn07ic273gkda95lz65cdfcgm"))))
1741 (build-system cmake-build-system)
1744 '("-DBUILD_SHARED_LIBS=ON")))
1745 (home-page "https://github.com/powercap/powercap")
1746 (synopsis "Utilities for accessing the powercap Linux kernel feature")
1747 (description "This package contains utilities for accessing the powercap
1748 Linux kernel feature through sysfs. It includes an implementation for working
1749 with Intel @acronym{RAPL, Running Average Power Limit}.
1750 It provides the commands @code{powercap-info} and @code{powercap-set}.")
1751 (license license:bsd-3)))
1753 (define-public powerstat
1760 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1761 "powerstat/powerstat-" version ".tar.gz"))
1763 (base32 "18m85k83hryj05vix63fay1hh0sb9h87hy5r7g1dqg2y9i8lzgxk"))))
1764 (build-system gnu-build-system)
1767 (list (string-append "CC=" ,(cc-for-target))
1768 (string-append "prefix=" (assoc-ref %outputs "out")))
1769 #:tests? #f ; no test suite
1771 (modify-phases %standard-phases
1772 (delete 'configure)))) ; no configure script
1773 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1774 (synopsis "Measure system power consumption")
1776 "Powerstat measures and reports your computer's power consumption in real
1777 time. On mobile PCs, it uses ACPI battery information to measure the power
1778 drain of the entire system.
1780 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1781 domain measurements. These are available only on some hardware such as Intel
1782 Sandybridge and newer, and cover only part of the machine's components such as
1783 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1784 and don't require a battery at all.
1786 The output is like @command{vmstat} but also shows power consumption statistics:
1787 at the end of a run, @command{powerstat} will calculate the average, standard
1788 deviation, and minimum and maximum values. It can show a nice histogram too.")
1789 (license license:gpl2)))
1791 (define-public psmisc
1798 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1801 (base32 "0y8n1jd2dn4cvc5mh806d66qnq8xl0xmzczbycjwal10rvmcw33z"))))
1802 (build-system gnu-build-system)
1804 `(,@(if (%current-target-system)
1807 "ac_cv_func_malloc_0_nonnull=yes"
1808 "ac_cv_func_realloc_0_nonnull=yes"))
1810 (inputs `(("ncurses" ,ncurses)))
1811 (home-page "https://gitlab.com/psmisc/psmisc")
1812 (synopsis "Small utilities that use the proc file system")
1814 "This PSmisc package is a set of some small useful utilities that
1815 use the proc file system. We're not about changing the world, but
1816 providing the system administrator with some help in common tasks.")
1817 (license license:gpl2+)))
1819 (define-public util-linux
1825 (uri (string-append "mirror://kernel.org/linux/utils/"
1826 "util-linux/v" (version-major+minor version) "/"
1827 "util-linux-" version ".tar.xz"))
1830 "0xkb7vw2040zi4m0sbhs5qn5l8nrq4xsf4sdxf3cy9mpachd8jwf"))
1831 (patches (search-patches "util-linux-tests.patch"))
1832 (modules '((guix build utils)))
1834 ;; We take 'nologin' from Shadow, the 'logger' program from
1835 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1837 (substitute* "configure"
1838 (("build_nologin=yes") "build_nologin=no")
1839 (("build_logger=yes") "build_logger=no")
1840 (("build_kill=yes") "build_kill=no"))
1842 (build-system gnu-build-system)
1843 (outputs '("out" ;6.4 MiB executables and documentation
1844 "lib" ;8.8 MiB shared libraries, headers and locales
1845 "static")) ;2.9 MiB static .a libraries
1847 `(#:configure-flags (list "--disable-use-tty-group"
1849 "--enable-fs-paths-default="
1850 "/run/setuid-programs"
1851 ":/run/current-system/profile/sbin")
1852 ;; Don't try to chown root:root mount and umount
1853 "--disable-makeinstall-chown"
1854 "--localstatedir=/var"
1855 (string-append "--localedir="
1856 (assoc-ref %outputs "lib")
1858 ;; Install completions where our
1859 ;; bash-completion package expects them.
1860 (string-append "--with-bashcompletiondir="
1861 (assoc-ref %outputs "out")
1862 "/etc/bash_completion.d"))
1864 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
1865 ;; <https://bugs.gnu.org/47791>.
1866 #:tests? ,(and (not (%current-target-system))
1867 (not (string-suffix? "-gnu" (%current-system))))
1869 #:phases (modify-phases %standard-phases
1870 (add-before 'configure 'patch-build-scripts
1871 (lambda* (#:key outputs #:allow-other-keys)
1872 (substitute* "configure"
1873 ;; The build system assumes that we want to install
1874 ;; libraries below $exec_prefix when $libdir does not
1875 ;; match any of the "usual" locations. Fix that.
1876 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1877 "usrlib_execdir=$libdir"))))
1878 (add-before 'build 'set-umount-file-name
1879 (lambda* (#:key outputs #:allow-other-keys)
1880 ;; Tell 'eject' the right file name of 'umount'.
1881 (let ((out (assoc-ref outputs "out")))
1882 (substitute* "sys-utils/eject.c"
1883 (("\"/bin/umount\"")
1884 (string-append "\"" out "/bin/umount\""))))))
1885 (add-before 'check 'pre-check
1886 (lambda* (#:key native-inputs inputs #:allow-other-keys)
1887 (let ((services (search-input-file (or native-inputs inputs)
1889 ;; Change the test to refer to the right file.
1890 (substitute* "tests/ts/misc/mcookie"
1894 ;; The C.UTF-8 locale does not exist in our libc.
1895 (substitute* "tests/ts/column/invalid-multibyte"
1896 (("C\\.UTF-8") "en_US.utf8")))))
1897 (add-before 'check 'disable-setarch-test
1899 ;; The setarch tests are unreliable in QEMU's user-mode
1900 ;; emulation, which is our primary method of building
1901 ;; ARMv7 packages. See
1902 ;; <https://github.com/karelzak/util-linux/issues/601>.
1903 (substitute* "tests/ts/misc/setarch"
1904 (("ts_init_subtest.*" all)
1907 "ts_skip \"setarch tests are unreliable under QEMU\"")))))
1908 ,@(if (target-x86-32?)
1909 `((add-before 'check 'disable-lsns-test
1911 ;; The lsns tests can fail due to ioctl(_, NS_GET_USERNS)
1912 ;; returning ENOTTY, indicating this kernel does not
1913 ;; support user namespaces. Curiously, this test can fail
1914 ;; on i686 even if the same test passes on x86_64 on the
1915 ;; same machine. See <https://issues.guix.gnu.org/49933>.
1916 (delete-file "tests/ts/lsns/ioctl_ns"))))
1918 (add-after 'install 'move-static-libraries
1919 (lambda* (#:key outputs #:allow-other-keys)
1920 (let ((lib (assoc-ref outputs "lib"))
1921 (static (assoc-ref outputs "static")))
1923 ;; Move static libraries to the "static" output.
1924 (mkdir-p (string-append static "/lib"))
1925 (with-directory-excursion lib
1926 (for-each (lambda (file)
1928 (string-append static "/"
1930 (find-files "lib" "\\.a$"))
1932 ;; Remove references to the static library from the '.la'
1933 ;; files so that Libtool does the right thing when both
1934 ;; the shared and static library is available.
1935 (substitute* (find-files "lib" "\\.la$")
1936 (("old_library=.*") "old_library=''\n"))))))
1937 (add-after 'install 'adjust-pkg-config-files
1938 (lambda* (#:key outputs #:allow-other-keys)
1939 (let ((lib (assoc-ref outputs "lib")))
1940 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1941 ;; the pkg-config files to avoid a cyclic reference on "out".
1942 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1944 (("^(exec_)?prefix=.*") ""))))))))
1946 (list file ;for libmagic
1950 (list net-base ;for tests
1952 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1953 (synopsis "Collection of utilities for the Linux kernel")
1954 (description "Util-linux is a diverse collection of Linux kernel
1955 utilities. It provides dmesg and includes tools for working with file systems,
1956 block devices, UUIDs, TTYs, and many other tools.")
1958 ;; Note that util-linux doesn't use the same license for all the
1959 ;; code. GPLv2+ is the default license for a code without an
1960 ;; explicitly defined license.
1961 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1962 license:bsd-4 license:public-domain))))
1964 ;; util-linux optionally supports udev, which allows lsblk to read file system
1965 ;; metadata without special privileges. Add it as a separate package to avoid
1966 ;; a circular dependency, and to keep the size small.
1967 (define-public util-linux+udev
1970 (name "util-linux-with-udev")
1973 ,@(package-inputs util-linux)))))
1975 (define-public ddate
1982 (url "https://github.com/bo0ts/ddate")
1983 (commit (string-append "v" version))))
1984 (file-name (git-file-name name version))
1986 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1987 (build-system cmake-build-system)
1988 (arguments '(#:tests? #f))
1989 (home-page "https://github.com/bo0ts/ddate")
1990 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1992 "ddate displays the Discordian date and holidays of a given date.
1993 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1994 by Robert Shea and Robert Anton Wilson.")
1995 (license license:public-domain)))
1997 (define-public fbset
2004 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
2007 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
2008 (build-system gnu-build-system)
2010 '(#:modules ((guix build gnu-build-system)
2014 (modify-phases %standard-phases
2015 (delete 'configure) ; no configure script
2016 (add-before 'install 'pre-install
2017 (lambda* (#:key outputs #:allow-other-keys)
2018 (let ((out (assoc-ref outputs "out")))
2019 (substitute* "Makefile"
2020 (("mknod ") "true ")
2021 ;; The Makefile doesn't honour PREFIX or similar.
2024 (with-directory-excursion out
2025 (for-each mkdir-p (list "sbin"
2029 (add-after 'install 'install-fb.modes
2030 (lambda* (#:key outputs #:allow-other-keys)
2031 (let* ((out (assoc-ref outputs "out"))
2032 (etc (string-append out "/etc")))
2033 (for-each (cut install-file <> etc)
2034 (find-files "etc" "^fb\\.modes"))
2035 (symlink "fb.modes.ATI"
2036 (string-append etc "/fb.modes"))
2038 ;; Parallel building races to create modes.tab.c.
2039 #:parallel-build? #f
2040 #:tests? #f)) ; no test suite
2044 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
2045 (synopsis "Show and modify Linux frame buffer settings")
2047 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
2048 different kinds of graphic displays. The @command{fbset} utility can query and
2049 change various device settings such as depth, virtual resolution, and timing
2051 (license license:gpl2)))
2053 (define-public procps
2059 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
2060 "procps-ng-" version ".tar.xz"))
2063 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
2064 (build-system gnu-build-system)
2066 `(#:modules ((guix build utils)
2067 (guix build gnu-build-system)
2070 ,@(if (%current-target-system)
2073 "ac_cv_func_malloc_0_nonnull=yes"
2074 "ac_cv_func_realloc_0_nonnull=yes"))
2077 (modify-phases %standard-phases
2079 'install 'post-install
2080 ;; Remove commands and man pages redudant with
2082 (lambda* (#:key outputs #:allow-other-keys)
2083 (let* ((out (assoc-ref outputs "out"))
2084 (dup (append-map (cut find-files out <>)
2085 '("^kill" "^uptime"))))
2086 (for-each delete-file dup)
2088 (inputs `(("ncurses" ,ncurses)))
2089 (home-page "https://gitlab.com/procps-ng/procps/")
2090 (synopsis "Utilities that give information about processes")
2092 "Procps is the package that has a bunch of small useful utilities
2093 that give information about processes using the Linux /proc file system.
2094 The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
2095 slabtop, tload, top, vmstat, w, watch and sysctl.")
2096 (license license:gpl2)))
2098 (define-public usbutils
2105 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
2106 "usbutils-" version ".tar.xz"))
2108 (base32 "0f0klk6d3hmbpf6p4dcwa1qjzblmkhbxs1wsw87aidvqri7lj8wy"))))
2109 (build-system gnu-build-system)
2110 (outputs (list "out" "python"))
2113 (modify-phases %standard-phases
2114 (add-before 'bootstrap 'patch-bootstrap-scripts
2116 (substitute* "usbhid-dump/bootstrap"
2117 (("/bin/sh") (which "sh")))
2119 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
2120 (substitute* "autogen.sh"
2121 (("^\\./configure.*") ""))
2123 (add-after 'install 'separate-python-output
2124 ;; Separating one Python script shaves more than 106 MiB from :out.
2125 (lambda* (#:key outputs #:allow-other-keys)
2126 (let ((out (assoc-ref outputs "out"))
2127 (out:python (assoc-ref outputs "python")))
2128 (for-each (lambda (file)
2129 (let ((old (string-append out "/" file))
2130 (new (string-append out:python "/" file)))
2131 (mkdir-p (dirname new))
2132 (rename-file old new)))
2133 (list "bin/lsusb.py"))
2138 ("python" ,python)))
2140 `(("autoconf" ,autoconf)
2141 ("automake" ,automake)
2142 ("libtool" ,libtool)
2143 ("pkg-config" ,pkg-config)))
2144 (home-page "http://www.linux-usb.org/")
2146 "Tools for working with USB devices, such as lsusb")
2148 "Tools for working with USB devices, such as lsusb.")
2149 (license license:gpl2+)))
2151 (define-public usbip-utils
2153 (name "usbip-utils")
2154 (version (package-version linux-libre))
2155 (source (package-source linux-libre))
2156 (build-system gnu-build-system)
2158 '(#:configure-flags '("--disable-static")
2159 #:phases (modify-phases %standard-phases
2160 (add-after 'unpack 'enter-subdirectory
2162 (chdir "tools/usb/usbip")
2165 `(("automake" ,automake)
2166 ("autoreconf" ,autoconf)
2167 ("libtool" ,libtool)))
2168 (inputs `(("eudev" ,eudev)))
2169 (home-page (package-home-page linux-libre))
2170 (synopsis "Utilities for sharing USB devices over IP networks")
2172 "The USB/IP protocol enables to pass USB device from a server to
2173 a client over the network. The server is a machine which shares an
2174 USB device and the client is a machine which uses USB device provided by
2175 a server over the network. The USB device may be either physical device
2176 connected to a server or software entity created on a server using USB
2177 gadget subsystem. The usbip-utils are userspace tools to used to handle
2178 connection and management on both side. The client needs the @file{vhci-hcd}
2179 Linux kernel module and the server needs the @file{usbip_host} Linux kernel
2181 (license license:gpl2)))
2183 (define-public e2fsprogs
2190 "mirror://kernel.org/linux/kernel/people/tytso/"
2191 "e2fsprogs/v" version "/"
2192 "e2fsprogs-" version ".tar.xz"))
2195 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
2196 (build-system gnu-build-system)
2197 (inputs `(("util-linux" ,util-linux "lib")))
2198 (native-inputs `(("pkg-config" ,pkg-config)
2199 ("texinfo" ,texinfo) ;for the libext2fs Info manual
2203 ("procps" ,procps)))
2205 '(;; util-linux is the preferred source for some of the libraries and
2206 ;; commands, so disable them (see, e.g.,
2207 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
2208 #:configure-flags (list "--disable-libblkid"
2209 "--disable-libuuid" "--disable-uuidd"
2212 ;; Use symlinks instead of hard links for
2213 ;; 'fsck.extN' etc. This makes the resulting nar
2214 ;; smaller and is preserved across copies.
2215 "--enable-symlink-install"
2217 (string-append "LDFLAGS=-Wl,-rpath="
2218 (assoc-ref %outputs "out")
2221 ;; Install libext2fs et al.
2222 "--enable-elf-shlibs")
2225 (modify-phases %standard-phases
2226 (add-before 'configure 'patch-shells
2228 (substitute* "configure"
2229 (("/bin/sh (.*)parse-types.sh" _ dir)
2230 (string-append (which "sh") " " dir
2232 (substitute* "MCONFIG.in"
2233 (("INSTALL_SYMLINK = /bin/sh")
2234 "INSTALL_SYMLINK = sh"))
2235 (substitute* (find-files "." "^Makefile.in$")
2237 (string-append "#!" (which "sh"))))
2239 (add-after 'install 'install-libs
2240 (lambda* (#:key outputs #:allow-other-keys)
2241 (let* ((out (assoc-ref outputs "out"))
2242 (lib (string-append out "/lib")))
2243 (invoke "make" "install-libs")
2245 ;; Make the .a writable so that 'strip' works.
2246 ;; Failing to do that, due to debug symbols, we
2247 ;; retain a reference to the final
2248 ;; linux-libre-headers, which refer to the
2249 ;; bootstrap binaries.
2250 (let ((archives (find-files lib "\\.a$")))
2251 (for-each (lambda (file)
2255 (home-page "http://e2fsprogs.sourceforge.net/")
2256 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
2258 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
2259 (license (list license:gpl2 ;programs
2260 license:lgpl2.0 ;libext2fs
2261 license:x11)))) ;libuuid
2263 (define e2fsprogs/static
2265 (package (inherit e2fsprogs)
2267 ;; Do not build shared libraries.
2268 (substitute-keyword-arguments (package-arguments e2fsprogs)
2269 ((#:configure-flags _)
2270 '(list "--disable-blkid"))
2274 (define-public e2fsck/static
2276 (name "e2fsck-static")
2277 (version (package-version e2fsprogs))
2278 (build-system trivial-build-system)
2281 `(("e2fsprogs" ,e2fsprogs/static)))
2283 `(#:modules ((guix build utils))
2286 (use-modules (guix build utils)
2290 (let ((e2fsck (search-input-file %build-inputs "/sbin/e2fsck"))
2291 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
2293 (with-directory-excursion bin
2294 (copy-file e2fsck "e2fsck")
2295 (remove-store-references "e2fsck")
2296 (chmod "e2fsck" #o555))
2298 (home-page (package-home-page e2fsprogs))
2299 (synopsis "Statically-linked e2fsck command from e2fsprogs")
2300 (description "This package provides statically-linked e2fsck command taken
2301 from the e2fsprogs package. It is meant to be used in initrds.")
2302 (license (package-license e2fsprogs))))
2304 (define-public extundelete
2306 (name "extundelete")
2311 (uri (string-append "mirror://sourceforge/extundelete/"
2312 "extundelete/" version "/extundelete-"
2313 version ".tar.bz2"))
2316 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
2317 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
2318 (build-system gnu-build-system)
2319 (inputs `(("e2fsprogs" ,e2fsprogs)))
2320 (home-page "http://extundelete.sourceforge.net/")
2321 (synopsis "Recover deleted files from ext2/3/4 partitions")
2323 "Extundelete is a set of tools that can recover deleted files from an
2324 ext3 or ext4 partition.")
2325 (license license:gpl2)))
2327 (define-public zerofree
2331 (home-page "https://frippery.org/uml/")
2334 (uri (string-append home-page name "-" version
2338 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
2339 (build-system gnu-build-system)
2342 (modify-phases %standard-phases
2343 (delete 'configure) ; no configure script
2345 ;; The Makefile lacks an ‘install’ target.
2346 (lambda* (#:key outputs #:allow-other-keys)
2347 (let* ((out (assoc-ref outputs "out"))
2348 (bin (string-append out "/bin")))
2349 (chmod "zerofree" #o555)
2350 (install-file "zerofree" bin)
2352 #:tests? #f)) ; no tests
2353 (inputs `(("libext2fs" ,e2fsprogs)))
2354 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
2356 "Zerofree finds the unallocated blocks with non-zero value content in an
2357 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
2358 This is a simple way to make disk images more compressible.
2359 Zerofree requires the file system to be unmounted or mounted read-only.")
2360 (license license:gpl2)))
2362 (define-public strace
2366 (home-page "https://strace.io")
2369 (uri (string-append home-page "/files/" version
2370 "/strace-" version ".tar.xz"))
2373 "0mmns22bjjvakxj29si0x4dcylcgy26llpcimkb0llcxif439k2s"))))
2374 (build-system gnu-build-system)
2377 (modify-phases %standard-phases
2378 (add-after 'unpack 'patch-/bin/sh
2380 (substitute* "src/strace.c"
2381 (("/bin/sh") (which "sh")))
2383 (add-after 'unpack 'disable-failing-tests
2385 (substitute* "tests/Makefile.in"
2386 ;; XXX: This test fails because an extra readlink call is made
2387 ;; by the glibc when using the ld.so cache.
2388 (("readlink.gen.test[^:]") " ")
2390 ;; XXX: These hang forever even if the test time-out is
2392 (("^\tstrace-DD?D?\\.test \\\\.*") "")
2393 (("^\tpidns-cache.test \\\\.*") "")
2394 (("^\t.*--pidns-translation.test \\\\.*") ""))
2396 ;; Don't fail if the architecture doesn't support different
2398 #:configure-flags '("--enable-mpers=check")
2399 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
2400 #:parallel-tests? #f)) ; undeterministic failures
2401 (native-inputs `(("perl" ,perl)))
2402 (synopsis "System call tracer for Linux")
2404 "strace is a system call tracer, i.e. a debugging tool which prints out a
2405 trace of all the system calls made by a another process/program.")
2406 (license license:lgpl2.1+)))
2408 (define-public ltrace
2414 (uri (string-append "http://www.ltrace.org/ltrace_" version
2418 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
2419 (build-system gnu-build-system)
2420 (inputs `(("libelf" ,elfutils)))
2422 ;; Compilation uses -Werror by default, but it fails.
2423 '(#:configure-flags '("--disable-werror")))
2424 (home-page "https://www.ltrace.org/")
2425 (synopsis "Library call tracer for Linux")
2427 "ltrace intercepts and records dynamic library calls which are called by
2428 an executed process and the signals received by that process. It can also
2429 intercept and print the system calls executed by the program.")
2430 (license license:gpl2+)))
2432 (define-public alsa-ucm-conf
2434 (name "alsa-ucm-conf")
2439 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
2440 version ".tar.bz2"))
2443 "0h6kzi1cfdqyxp4pwpqh5wb89c8s9wrgix315bvamffwfxf56frc"))))
2444 (build-system copy-build-system)
2447 '(("ucm" "share/alsa/ucm")
2448 ("ucm2" "share/alsa/ucm2"))))
2449 (home-page "https://www.alsa-project.org/wiki/Main_Page")
2450 (synopsis "The Advanced Linux Sound Architecture Use Case Manager")
2452 "This package contains Advanced Linux Sound Architecture Use Case Manager
2453 configuration of audio input/output names and routing for specific audio
2455 (license license:bsd-3)))
2457 (define-public alsa-topology-conf
2459 (name "alsa-topology-conf")
2464 "ftp://ftp.alsa-project.org/pub/lib/" name "-"
2465 version ".tar.bz2"))
2468 "01zdg6q4s6d01k39z96wi4vbhrfw1i2g4yi5dijwfk6a5vjfdq2m"))))
2469 (build-system copy-build-system)
2472 '(("topology" "share/alsa/topology"))))
2473 (home-page "https://www.alsa-project.org/wiki/Main_Page")
2474 (synopsis "The Advanced Linux Sound Architecture libraries")
2476 "This package contains Advanced Linux Sound Architecture topology
2477 configuration files that can be used for specific audio hardware.")
2478 (license license:bsd-3)))
2480 (define-public alsa-lib
2487 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
2488 version ".tar.bz2"))
2491 "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp"))))
2492 (build-system gnu-build-system)
2494 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2495 (assoc-ref %outputs "out")
2498 (modify-phases %standard-phases
2499 (add-before 'install 'pre-install
2500 (lambda* (#:key inputs outputs #:allow-other-keys)
2502 (string-append (assoc-ref inputs "alsa-ucm-conf")))
2504 (string-append (assoc-ref inputs "alsa-topology-conf")))
2506 (string-append (assoc-ref outputs "out") "/share/alsa"))
2508 (string-append ucm "/share/alsa/ucm"))
2510 (string-append ucm "/share/alsa/ucm2"))
2512 (string-append topology "/share/alsa/topology")))
2514 (symlink ucm-share (string-append alsa "/ucm"))
2515 (symlink ucm2-share (string-append alsa "/ucm2"))
2516 (symlink topology-share (string-append alsa "/topology")))
2519 `(("alsa-ucm-conf" ,alsa-ucm-conf)
2520 ("alsa-topology-conf" ,alsa-topology-conf)))
2521 (home-page "https://www.alsa-project.org/wiki/Main_Page")
2522 (synopsis "The Advanced Linux Sound Architecture libraries")
2524 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2525 MIDI functionality to the Linux-based operating system.")
2526 (license license:lgpl2.1+)))
2528 (define-public alsa-utils
2534 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
2535 name "-" version ".tar.bz2"))
2538 "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq"))))
2539 (build-system gnu-build-system)
2541 ;; XXX: Disable man page creation until we have DocBook.
2542 '(#:configure-flags (list "--disable-xmlto"
2544 ;; The udev rule is responsible for restoring
2546 (string-append "--with-udev-rules-dir="
2547 (assoc-ref %outputs "out")
2548 "/lib/udev/rules.d"))
2550 (modify-phases %standard-phases
2551 (add-before 'check 'disable-broken-test
2553 ;; XXX: The 1.1.8 release tarball is missing a header that's
2554 ;; required for this test to work. Fixed in 1.1.9.
2555 (substitute* "axfer/test/Makefile"
2556 ((".*container-test.*") ""))
2559 'install 'pre-install
2561 ;; Don't try to mkdir /var/lib/alsa.
2562 (substitute* "Makefile"
2563 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2567 `(("gettext" ,gettext-minimal)))
2569 `(("libsamplerate" ,libsamplerate)
2570 ("ncurses" ,ncurses)
2571 ("alsa-lib" ,alsa-lib)
2573 (home-page "http://www.alsa-project.org/")
2574 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2576 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2577 MIDI functionality to the Linux-based operating system.")
2579 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2581 (license license:gpl2)))
2583 (define-public alsa-plugins
2585 (name "alsa-plugins")
2589 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2590 name "-" version ".tar.bz2"))
2593 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2594 (build-system gnu-build-system)
2595 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2596 ;; be split, there are references to both in files.
2597 ;; TODO: Remove OSS related plugins, they add support to run native
2598 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2600 (outputs '("out" "pulseaudio" "jack"))
2601 (native-search-paths
2602 (list (search-path-specification
2603 (variable "ALSA_PLUGIN_DIR")
2604 (files '("lib/alsa-lib"))
2607 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2608 ;; for /etc/alsa. On Guix System plugins are loaded from
2609 ;; the ALSA service, and other distributions likely
2610 ;; won't use these files.
2611 "--with-alsalconfdir=/tmp/noop")
2613 (modify-phases %standard-phases
2614 (add-after 'install 'split
2615 (lambda* (#:key inputs outputs #:allow-other-keys)
2616 ;; Distribute the binaries to the various outputs.
2617 (let* ((out (assoc-ref outputs "out"))
2618 (jack (assoc-ref outputs "jack"))
2619 (jacklib (string-append jack "/lib/alsa-lib"))
2620 (pua (assoc-ref outputs "pulseaudio"))
2621 (pualib (string-append pua "/lib/alsa-lib")))
2624 (for-each (lambda (file)
2625 (rename-file file (string-append jacklib "/" (basename file))))
2626 (find-files out ".*jack\\.(la|so)"))
2629 (for-each (lambda (file)
2630 (rename-file file (string-append pualib "/" (basename file))))
2631 (find-files out ".*pulse\\.(la|so)"))
2634 `(("alsa-lib" ,alsa-lib)
2636 ("speex" ,speex) ; libspeexdsp resampling plugin
2637 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2638 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2639 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2641 `(("pkg-config" ,pkg-config)))
2642 (home-page "http://www.alsa-project.org/")
2643 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2645 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2646 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2647 by providing additional plugins which include: upmixing, downmixing, jackd and
2648 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2649 external rate conversion.")
2650 (license (list license:gpl2+
2651 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2652 license:lgpl2.1+))))
2654 (define-public iptables
2661 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2663 (string-append "https://www.netfilter.org/projects/iptables/"
2664 "files/iptables-" version ".tar.bz2")))
2666 (base32 "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1"))))
2667 (build-system gnu-build-system)
2669 `(("pkg-config" ,pkg-config)
2673 `(("libmnl" ,libmnl)
2674 ("libnftnl" ,libnftnl)))
2676 '(#:tests? #f ; no test suite
2677 #:configure-flags ; add $libdir to the RUNPATH of executables
2678 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
2679 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2680 (synopsis "Programs to configure Linux IP packet filtering rules")
2682 "@command{iptables} is the user-space command line program used to
2683 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2684 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2686 This package also includes @command{ip6tables}, which is used to configure the
2689 Both commands are targeted at system administrators.")
2690 (license license:gpl2+)))
2692 (define-public jitterentropy-rngd
2694 (name "jitterentropy-rngd")
2700 (url "https://github.com/smuellerDD/jitterentropy-rngd")
2701 (commit (string-append "v" version))))
2702 (file-name (git-file-name name version))
2704 (base32 "05h9a60s9x3jav33lh50ac1jw8wvbljw2ndrk3k7gs2nlz0kkl14"))))
2705 (build-system gnu-build-system)
2707 `(#:tests? #f ; no test suite
2709 (list (string-append "CC=" ,(cc-for-target))
2710 (string-append "PREFIX=" (assoc-ref %outputs "out"))
2711 "UNITDIR=$(PREFIX)/lib/systemd/system")
2713 (modify-phases %standard-phases
2714 (delete 'configure)))) ; no ./configure script
2715 (home-page "https://www.chronox.de/jent.html")
2716 (synopsis "CPU jitter random number generator daemon")
2718 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
2719 number generator} core to the kernel Linux's entropy estimator. This prevents
2720 the @file{/dev/random} device from blocking and should benefit users of the
2721 preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
2723 The CPU Jitter RNG itself is part of the kernel and claims to provide good
2724 entropy by collecting and magnifying differences in CPU execution time as
2725 measured by the high-resolution timer built into modern CPUs. It requires no
2726 additional hardware or external entropy source.
2728 The random bit stream generated by @command{jitterentropy-rngd} is not processed
2729 by a cryptographically secure whitening function. Nonetheless, its authors
2730 believe it to be a suitable source of cryptographically secure key material or
2731 other cryptographically sensitive data.
2733 If you agree with them, start this daemon as early as possible to provide
2734 properly seeded random numbers to services like SSH or those using TLS during
2735 early boot when entropy may be low, especially in virtualised environments.")
2736 (license (list license:bsd-3 ; or
2739 (define-public lsscsi
2746 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2749 "0jp458m2b3wckr18qkln69i01152qlwz33zm49103lq8fgx0n6d4"))))
2750 (build-system gnu-build-system)
2751 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2752 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2754 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2755 also list NVMe namespaces or controllers and show the relationship between a
2756 device's primary node name, its SCSI generic (sg) node name and its kernel
2758 (license license:gpl2)))
2760 (define-public ebtables
2767 "mirror://netfilter.org/ebtables/ebtables-"
2771 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2772 (build-system gnu-build-system)
2775 ("iptables" ,iptables)))
2776 (synopsis "Ethernet bridge frame table administration")
2777 (home-page "https://ebtables.netfilter.org/")
2779 "ebtables is an application program used to set up and maintain the
2780 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2781 analogous to the iptables application, but less complicated, due to the fact
2782 that the Ethernet protocol is much simpler than the IP protocol.")
2783 (license license:gpl2+)))
2785 (define-public iproute
2792 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2796 "0dhvdybfm33q9lz73sfnc24pxy2r42xywzb1gdgydjfafhvyb8kj"))))
2797 (build-system gnu-build-system)
2799 `( ;; There is a test suite, but it wants network namespaces and sudo.
2801 #:make-flags (let ((out (assoc-ref %outputs "out")))
2803 (string-append "CC=" ,(cc-for-target))
2805 (string-append "BASH_COMPDIR=" out
2806 "/etc/bash_completion.d")
2807 (string-append "LIBDIR=" out "/lib")
2808 (string-append "HDRDIR=" out "/include")
2809 (string-append "SBINDIR=" out "/sbin")
2810 (string-append "CONFDIR=" out "/etc")
2811 (string-append "DOCDIR=" out "/share/doc/"
2813 (string-append "MANDIR=" out "/share/man")))
2814 #:phases (modify-phases %standard-phases
2815 (add-before 'install 'pre-install
2817 ;; Don't attempt to create /var/lib/arpd.
2818 (substitute* "Makefile"
2819 (("^.*ARPDDIR.*$") ""))
2821 (add-after 'unpack 'patch-configure
2823 (let ((target ,(%current-target-system)))
2824 (substitute* "configure"
2827 (string-append target "-pkg-config")
2832 ("iptables" ,iptables)
2833 ("libmnl" ,libmnl)))
2837 ("pkg-config" ,pkg-config)))
2839 ;; ("libmnl" ,libmnl)
2840 ;; ("util-linux" ,util-linux)
2842 "https://wiki.linuxfoundation.org/networking/iproute2")
2844 "Utilities for controlling TCP/IP networking and traffic in Linux")
2846 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2847 and traffic with the Linux kernel. The most important of these are
2848 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2851 Most network configuration manuals still refer to ifconfig and route as the
2852 primary network configuration tools, but ifconfig is known to behave
2853 inadequately in modern network environments, and both should be deprecated.")
2854 (license license:gpl2+)))
2856 (define-public net-tools
2857 ;; XXX: This package is basically unmaintained, but it provides a few
2858 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2860 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2864 (version (string-append "1.60-" revision "." (string-take commit 7)))
2867 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2868 "n/ne/net-tools/code.git/net-tools-code-"
2870 (file-name (string-append name "-" version ".zip"))
2873 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2874 (home-page "http://net-tools.sourceforge.net/")
2875 (build-system gnu-build-system)
2877 `(#:modules ((guix build gnu-build-system)
2882 (modify-phases %standard-phases
2884 (lambda* (#:key outputs #:allow-other-keys)
2885 (let ((out (assoc-ref outputs "out")))
2886 (mkdir-p (string-append out "/bin"))
2887 (mkdir-p (string-append out "/sbin"))
2889 ;; Pretend we have everything...
2890 (system "yes | make config")
2892 ;; ... except for the things we don't have.
2893 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2894 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2895 ;; that have been removed.
2896 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2897 ;; think about adding them later.
2898 (substitute* '("config.make" "config.h")
2899 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2902 (add-after 'install 'remove-redundant-commands
2903 (lambda* (#:key outputs #:allow-other-keys)
2904 ;; Remove commands and man pages redundant with Inetutils.
2905 (let* ((out (assoc-ref outputs "out"))
2906 (dup (append-map (cut find-files out <>)
2908 "^(yp|nis|dns)?domainname"))))
2909 (for-each delete-file dup)
2911 ;; Binaries that depend on libnet-tools.a don't declare that
2912 ;; dependency, making it parallel-unsafe.
2913 #:parallel-build? #f
2915 #:tests? #f ; no test suite
2916 #:make-flags (let ((out (assoc-ref %outputs "out")))
2917 (list ,(string-append "CC=" (cc-for-target))
2918 (string-append "BASEDIR=" out)
2919 (string-append "INSTALLNLSDIR=" out "/share/locale")
2920 (string-append "mandir=/share/man")))))
2921 (native-inputs `(("gettext" ,gettext-minimal)
2923 (supported-systems (delete "i586-gnu" %supported-systems))
2924 (synopsis "Tools for controlling the network subsystem in Linux")
2926 "This package includes the important tools for controlling the network
2927 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2928 route. Additionally, this package contains utilities relating to particular
2929 network hardware types (plipconfig, slattach) and advanced aspects of IP
2930 configuration (iptunnel, ipmaddr).")
2931 (license license:gpl2+))))
2933 (define-public libcap
2940 "mirror://kernel.org/linux/libs/security/linux-privs/"
2941 "libcap2/libcap-" version ".tar.xz"))
2944 "1ych13qc1mvzv8iscbims5b317vxcmy5ffpmfy98zk7bgamz62b6"))))
2945 (build-system gnu-build-system)
2946 (arguments `(#:phases
2947 ,#~(modify-phases %standard-phases
2949 ;; Add $libdir to the RUNPATH of executables.
2951 (substitute* "Make.Rules"
2952 (("LDFLAGS \\?= #-g")
2953 (string-append "LDFLAGS ?= -Wl,-rpath="
2954 ;; TODO(core-updates): Use #$output
2956 #$(if (%current-target-system)
2960 #:test-target "test"
2963 (string-append "prefix=" (assoc-ref %outputs "out"))
2965 ;; Tell the makefile to use TARGET-gcc and friends
2966 ;; when cross-compiling.
2967 ,@(if (%current-target-system)
2968 `(,(string-append "CROSS_COMPILE="
2969 (%current-target-system) "-")
2972 (native-inputs `(("perl" ,perl)))
2973 (supported-systems (delete "i586-gnu" %supported-systems))
2974 (home-page "https://sites.google.com/site/fullycapable/")
2975 (synopsis "Library for working with POSIX capabilities")
2977 "Libcap2 provides a programming interface to POSIX capabilities on
2978 Linux-based operating systems.")
2980 ;; License is BSD-3 or GPLv2, at the user's choice.
2981 (license license:gpl2)))
2983 (define-public bridge-utils
2985 (name "bridge-utils")
2990 (uri (string-append "mirror://kernel.org/linux/utils/net/"
2991 "bridge-utils/bridge-utils-" version ".tar.xz"))
2993 (base32 "03p6cmhm6cqhnfsfa1wv7frhb361y12daf7gr1h5qh51y7j8n7d6"))))
2994 (build-system gnu-build-system)
2996 ;; The tarball lacks all the generated files.
2997 (native-inputs `(("autoconf" ,autoconf)
2998 ("automake" ,automake)))
3000 '(#:tests? #f)) ; no 'check' target
3002 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
3003 (synopsis "Manipulate Ethernet bridges")
3005 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
3006 to connect two Ethernet segments together in a protocol independent way.
3007 Packets are forwarded based on Ethernet address, rather than IP address (like
3008 a router). Since forwarding is done at Layer 2, all protocols can go
3009 transparently through a bridge.")
3010 (license license:gpl2+)))
3012 (define-public libnl
3019 "https://github.com/thom311/libnl/releases/download/"
3020 "libnl" (string-join (string-split version #\.) "_")
3021 "/libnl-" version ".tar.gz"))
3024 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
3025 (build-system gnu-build-system)
3029 ("pkg-config" ,pkg-config)
3035 "https://github.com/thom311/libnl/releases/download/libnl"
3036 (string-join (string-split version #\.) "_")
3037 "/libnl-doc-" version ".tar.gz"))
3039 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
3040 (outputs `("out" "doc"))
3043 (modify-phases %standard-phases
3044 (add-after 'install 'install-doc
3045 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
3046 (let ((dest (string-append (assoc-ref outputs "doc")
3047 "/share/doc/libnl")))
3049 (invoke "tar" "xf" (assoc-ref
3050 (or native-inputs inputs)
3052 "--strip-components=1" "-C" dest)))))))
3053 (home-page "https://www.infradead.org/~tgr/libnl/")
3054 (synopsis "NetLink protocol library suite")
3056 "The libnl suite is a collection of libraries providing APIs to netlink
3057 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
3058 between the kernel and user space processes. It was designed to be a more
3059 flexible successor to ioctl to provide mainly networking related kernel
3060 configuration and monitoring interfaces.")
3062 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
3063 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
3064 (license license:gpl2)))
3066 ;; libnl python extensions used to be outputs of libnl. However, as
3067 ;; cross-compiling python extensions is currently broken, create separate
3068 ;; packages for libnl python extensions.
3069 (define (libnl-python-package python)
3070 (let ((name (string-append "libnl-" python)))
3075 ((string=? python "python2")
3076 `(("python-2" ,python-2)))
3077 ((string=? python "python3")
3078 `(("python-3" ,python-3))))))
3079 (propagated-inputs `(("libnl" ,libnl)))
3082 `(#:modules ((guix build gnu-build-system)
3086 (modify-phases %standard-phases
3088 (lambda* (#:key inputs outputs #:allow-other-keys)
3089 (define (python-inst python)
3090 (invoke python "setup.py" "build")
3091 (invoke python "setup.py" "install"
3092 (string-append "--prefix="
3093 (assoc-ref %outputs "out")))
3094 (invoke python "setup.py" "clean"))
3095 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
3096 (assoc-ref inputs "libnl")))
3097 (with-directory-excursion "./python" (python-inst ,python))
3100 (define-public libnl-python2 (libnl-python-package "python2"))
3101 (define-public libnl-python3 (libnl-python-package "python3"))
3110 "mirror://kernel.org/software/network/iw/iw-"
3114 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
3115 (build-system gnu-build-system)
3116 (native-inputs `(("pkg-config" ,pkg-config)))
3117 (inputs `(("libnl" ,libnl)))
3120 (let* ((target ,(%current-target-system))
3121 (pkg-config (if target
3122 (string-append target "-pkg-config")
3125 ,(string-append "CC=" (cc-for-target))
3126 (string-append "PKG_CONFIG="
3127 (assoc-ref %build-inputs "pkg-config")
3129 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
3130 #:phases (modify-phases %standard-phases (delete 'configure))))
3131 (home-page "https://wireless.wiki.kernel.org/")
3132 (synopsis "Tool for configuring wireless devices")
3134 "iw is a new nl80211 based CLI configuration utility for wireless
3135 devices. It replaces @code{iwconfig}, which is deprecated.")
3136 (license license:isc)))
3138 (define-public powertop
3146 (url "https://github.com/fenrus75/powertop")
3147 (commit (string-append "v" version))))
3148 (file-name (git-file-name name version))
3150 (base32 "1zkr2y5nb1nr22nq8a3zli87iyfasfq6489p7h1k428pv8k45w4f"))))
3151 (build-system gnu-build-system)
3154 (list "LDFLAGS=-pthread")
3156 (modify-phases %standard-phases
3157 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
3158 ;; allow calibrating the network interface in Guix System.
3159 (add-after 'unpack 'patch-absolute-file-names
3160 (lambda* (#:key inputs #:allow-other-keys)
3161 (let ((kmod (assoc-ref inputs "kmod")))
3162 (substitute* (find-files "src" "\\.cpp$")
3163 ;; Give the right 'modprobe' file name so that essential
3164 ;; modules such as msr.ko can be loaded.
3165 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
3166 ;; These programs are only needed to calibrate, so using
3167 ;; relative file names avoids adding extra inputs. When they
3168 ;; are missing powertop gracefully handles it.
3169 (("/usr/bin/hcitool") "hcitool")
3170 (("/usr/bin/xset") "xset")
3171 (("/usr/sbin/hciconfig") "hciconfig"))
3176 ("ncurses" ,ncurses)
3177 ("pciutils" ,pciutils)
3180 `(("autoconf" ,autoconf)
3181 ("automake" ,automake)
3182 ("gettext" ,gettext-minimal)
3183 ("libtool" ,libtool)
3184 ("pkg-config" ,pkg-config)))
3185 (home-page "https://01.org/powertop/")
3186 (synopsis "Analyze power consumption on Intel-based laptops")
3188 "PowerTOP is a Linux tool to diagnose issues with power consumption and
3189 power management. In addition to being a diagnostic tool, PowerTOP also has
3190 an interactive mode where the user can experiment various power management
3191 settings for cases where the operating system has not enabled these
3193 (license license:gpl2)))
3195 (define-public aumix
3202 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
3203 version ".tar.bz2"))
3206 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
3207 (build-system gnu-build-system)
3209 ;; Allow compilation with GCC 10.
3210 '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
3211 (inputs `(("ncurses" ,ncurses)))
3212 (home-page "http://www.jpj.net/~trevor/aumix.html")
3213 (synopsis "Audio mixer for X and the console")
3215 "Aumix adjusts an audio mixer from X, the console, a terminal,
3216 the command line or a script.")
3217 (license license:gpl2+)))
3219 (define-public iotop
3226 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
3229 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
3230 (build-system python-build-system)
3233 (modify-phases %standard-phases
3234 (add-after 'unpack 'fix-build-with-python3
3236 (substitute* "setup.py"
3237 (("itervalues") "values"))
3239 ;; There are currently no checks in the package.
3241 (native-inputs `(("python" ,python)))
3242 (home-page "http://guichaz.free.fr/iotop/")
3244 "Displays the IO activity of running processes")
3246 "Iotop is a Python program with a top like user interface to show the
3247 processes currently causing I/O.")
3248 (license license:gpl2+)))
3256 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
3257 "download/fuse-" version
3258 "/fuse-" version ".tar.gz"))
3261 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
3262 (patches (search-patches "fuse-overlapping-headers.patch"))))
3263 (build-system gnu-build-system)
3265 `(("bash-minimal" ,bash-minimal)
3266 ("util-linux" ,util-linux)))
3268 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
3269 (assoc-ref %outputs "out")
3271 (string-append "INIT_D_PATH="
3272 (assoc-ref %outputs "out")
3275 ;; The rule makes /dev/fuse 666.
3276 (string-append "UDEV_RULES_PATH="
3277 (assoc-ref %outputs "out")
3278 "/lib/udev/rules.d"))
3280 (modify-phases %standard-phases
3281 (add-before 'build 'set-file-names
3282 (lambda* (#:key inputs #:allow-other-keys)
3283 ;; libfuse calls out to mount(8) and umount(8). Make sure
3284 ;; it refers to the right ones.
3285 (substitute* '("lib/mount_util.c" "util/mount_util.c")
3286 (("/bin/(u?)mount" _ maybe-u)
3287 (search-input-file inputs
3288 (string-append "bin/"
3290 (substitute* '("util/mount.fuse.c")
3292 (search-input-file inputs "/bin/sh")))
3294 ;; This hack leads libfuse to search for 'fusermount' in
3295 ;; $PATH, where it may find a setuid-root binary, instead of
3296 ;; trying solely $out/sbin/fusermount and failing because
3298 (substitute* "lib/Makefile"
3299 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
3300 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))
3301 (supported-systems (delete "i586-gnu" %supported-systems))
3302 (home-page "https://github.com/libfuse/libfuse")
3303 (synopsis "Support file systems implemented in user space")
3305 "As a consequence of its monolithic design, file system code for Linux
3306 normally goes into the kernel itself---which is not only a robustness issue,
3307 but also an impediment to system extensibility. FUSE, for \"file systems in
3308 user space\", is a kernel module and user-space library that tries to address
3309 part of this problem by allowing users to run file system implementations as
3310 user-space processes.")
3311 (license (list license:lgpl2.1 ;library
3312 license:gpl2+)))) ;command-line utilities
3314 (define-public fuse-3
3322 (string-append "https://github.com/libfuse/libfuse/releases/"
3323 "download/fuse-" version
3324 "/fuse-" version ".tar.xz"))
3327 "0rlnnsiw614qcmgy8xz67044gqc1pbvvf2yxjv44lh27bm487qmj"))))
3328 (build-system meson-build-system)
3332 (string-append "-Dudevrulesdir=" #$output "/udev/rules.d")
3336 ,#~(modify-phases %standard-phases
3337 (add-after 'unpack 'set-file-names
3338 (lambda* (#:key inputs #:allow-other-keys)
3339 ;; libfuse calls out to mount(8) and umount(8). Make sure
3340 ;; it refers to the right ones.
3341 (substitute* '("lib/mount_util.c")
3342 (("/bin/(u?)mount" _ maybe-u)
3343 (search-input-file inputs
3344 (string-append "bin/"
3346 (substitute* '("util/mount.fuse.c")
3348 (search-input-file inputs "/bin/sh")))
3350 ;; This hack leads libfuse to search for 'fusermount' in
3351 ;; $PATH, where it may find a setuid-root binary, instead of
3352 ;; trying solely $out/sbin/fusermount and failing because
3354 (substitute* "lib/meson.build"
3355 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
3356 "-DFUSERMOUNT_DIR=\"/var/empty\"'"))))
3357 (add-after 'unpack 'fix-install
3358 (lambda* (#:key inputs #:allow-other-keys)
3359 (substitute* '("util/meson.build")
3360 (("install_helper.sh") "true"))
3361 (substitute* '("util/meson.build")
3362 (("fuseconf_path = .*")
3363 "fuseconf_path = '/etc/fuse.conf'"))))
3364 (add-before 'configure 'set-paths
3365 (lambda* (#:key inputs outputs #:allow-other-keys)
3367 (string-append (getcwd) "/etc/init.d")))
3368 (setenv "MOUNT_FUSE_PATH"
3369 (string-append #$output "/sbin"))
3370 (setenv "UDEV_RULES_PATH"
3371 (string-append #$output
3372 "/lib/udev/rules.d"))))))))))
3374 (define-public unionfs-fuse
3376 (name "unionfs-fuse")
3381 (url "https://github.com/rpodgorny/unionfs-fuse")
3382 (commit (string-append "v" version))))
3383 (file-name (git-file-name name version))
3386 "1yigh8z1q6iq6yjyq7kl7vpbpjnxjld32apvjaw2bl44pqqg56hh"))))
3387 (build-system cmake-build-system)
3389 `(("python" ,python)))
3390 (inputs `(("fuse" ,fuse)))
3392 ;; The tests were never actually run ("collected 0 items"), but in recent
3393 ;; versions of pytest that causes an error.
3395 (home-page "https://github.com/rpodgorny/unionfs-fuse")
3396 (synopsis "User-space union file system")
3398 "UnionFS-FUSE is a flexible union file system implementation in user
3399 space, using the FUSE library. Mounting a union file system allows you to
3400 \"aggregate\" the contents of several directories into a single mount point.
3401 UnionFS-FUSE additionally supports copy-on-write.")
3402 (license license:bsd-3)))
3405 (package (inherit fuse)
3406 (name "fuse-static")
3407 (source (origin (inherit (package-source fuse))
3408 (modules '((guix build utils)))
3411 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
3412 ;; updated. Change calls to 'mtab_needs_update' to 0 so
3413 ;; that it doesn't do that, allowing us to remove the
3414 ;; dependency on util-linux (something that is useful in
3416 (substitute* '("lib/mount_util.c"
3417 "util/mount_util.c")
3418 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
3424 (define-public unionfs-fuse/static
3425 (package (inherit unionfs-fuse)
3426 (synopsis "User-space union file system (statically linked)")
3427 (name (string-append (package-name unionfs-fuse) "-static"))
3428 (source (origin (inherit (package-source unionfs-fuse))
3429 (modules '((guix build utils)))
3432 ;; Add -ldl to the libraries, because libfuse.a needs that.
3433 (substitute* "src/CMakeLists.txt"
3434 (("target_link_libraries(.*)\\)" _ libs)
3435 (string-append "target_link_libraries"
3440 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
3442 (modify-phases %standard-phases
3443 (add-after 'install 'post-install
3444 (lambda* (#:key outputs #:allow-other-keys)
3445 (let* ((out (assoc-ref outputs "out"))
3446 (exe (string-append out "/bin/unionfs")))
3447 ;; By default, 'unionfs' keeps references to
3448 ;; $glibc/share/locale and similar stuff. Remove them.
3449 (remove-store-references exe)
3451 ;; 'unionfsctl' has references to glibc as well. Since
3452 ;; we don't need it, remove it.
3453 (delete-file (string-append out "/bin/unionfsctl"))
3455 (inputs `(("fuse" ,fuse-static)))))
3457 (define-public sshfs
3463 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
3464 "download/sshfs-" version "/sshfs-" version
3468 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
3469 (build-system gnu-build-system)
3474 `(("pkg-config" ,pkg-config)))
3475 (home-page "https://github.com/libfuse/sshfs")
3476 (synopsis "Mount remote file systems over SSH")
3478 "This is a file system client based on the SSH File Transfer Protocol.
3479 Since most SSH servers already support this protocol it is very easy to set
3480 up: on the server side there's nothing to do; on the client side mounting the
3481 file system is as easy as logging into the server with an SSH client.")
3482 (license license:gpl2+)))
3484 (define-public sshfs-fuse
3485 (package (inherit sshfs)
3487 (properties `((superseded . ,sshfs)))))
3489 (define-public archivemount
3491 (name "archivemount")
3496 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
3497 "archivemount-" version ".tar.gz"))
3499 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
3500 (build-system gnu-build-system)
3501 (inputs `(("fuse" ,fuse)
3502 ("libarchive" ,libarchive)))
3503 (native-inputs `(("pkg-config" ,pkg-config)))
3504 (home-page "https://www.cybernoia.de/software/archivemount.html")
3505 (synopsis "Tool for mounting archive files with FUSE")
3506 (description "archivemount is a FUSE-based file system for Unix variants,
3507 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
3508 mount point where it can be read from or written to as with any other file
3509 system. This makes accessing the contents of the archive, which may be
3510 compressed, transparent to other programs, without decompressing them.")
3511 (license license:lgpl2.0+)))
3513 (define-public numactl
3520 "https://github.com/numactl/numactl/releases/download/v"
3521 version "/numactl-" version ".tar.gz"))
3524 "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2"))))
3525 (build-system gnu-build-system)
3527 '(;; There's a 'test' target, but it requires NUMA support in the kernel
3528 ;; to run, which we can't assume to have.
3531 ;; NUMA is apparently not supported on armhf, see
3532 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
3533 (supported-systems (delete "armhf-linux" %supported-systems))
3534 (home-page "https://github.com/numactl/numactl")
3535 (synopsis "Tools for non-uniform memory access (NUMA) machines")
3537 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
3538 memory is not all in one place. The @command{numactl} program allows you to
3539 run your application program on specific CPUs and memory nodes. It does this
3540 by supplying a NUMA memory policy to the operating system before running your
3543 The package contains other commands, such as @command{numastat},
3544 @command{memhog}, and @command{numademo} which provides a quick overview of
3545 NUMA performance on your system.")
3546 (license (list license:gpl2 ;programs
3547 license:lgpl2.1)))) ;library
3549 (define-public kbd-neo
3556 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
3557 version "/linux/console/neo.map"))
3558 (file-name (string-append name "-" version ".map"))
3561 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
3562 (build-system trivial-build-system)
3564 `(#:modules ((guix build utils))
3566 (use-modules (guix build utils))
3567 (let ((out (string-append %output "/share/keymaps"))
3568 (source (assoc-ref %build-inputs "source")))
3570 (copy-file source (string-append out "/neo.map"))
3572 (home-page "https://neo-layout.org")
3573 (synopsis "Neo2 console layout")
3575 "Kbd-neo provides the Neo2 keyboard layout for use with
3576 @command{loadkeys(1)} from @code{kbd(4)}.")
3577 ;; The file is located in an svn directory, the entire content of
3578 ;; the directory is licensed as GPL3.
3579 (license license:gpl3+)))
3587 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
3591 "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m"))
3592 (modules '((guix build utils)))
3595 (substitute* '("src/unicode_start" "src/unicode_stop")
3596 ;; Assume the Coreutils are in $PATH.
3599 (build-system gnu-build-system)
3602 (modify-phases %standard-phases
3603 (add-before 'build 'pre-build
3604 (lambda* (#:key inputs #:allow-other-keys)
3605 (let ((bzip2 (assoc-ref inputs "bzip2"))
3606 (gzip (assoc-ref inputs "gzip"))
3607 (xz (assoc-ref inputs "xz"))
3608 (zstd (assoc-ref inputs "zstd")))
3609 (substitute* "src/libkbdfile/kbdfile.c"
3610 (("bzip2") (string-append bzip2 "/bin/bzip2"))
3611 (("gzip") (string-append gzip "/bin/gzip"))
3612 (("xz -d") (string-append xz "/bin/xz -d"))
3613 (("zstd") (string-append zstd "/bin/zstd"))))))
3614 (add-after 'install 'post-install
3615 (lambda* (#:key outputs #:allow-other-keys)
3616 ;; Make sure these programs find their comrades.
3617 (let* ((out (assoc-ref outputs "out"))
3618 (bin (string-append out "/bin")))
3619 (for-each (lambda (prog)
3620 (wrap-program (string-append bin "/" prog)
3621 `("PATH" ":" prefix (,bin))))
3622 '("unicode_start" "unicode_stop"))))))))
3624 `(("autoconf" ,autoconf)
3625 ("pkg-config" ,pkg-config)))
3632 (native-search-paths
3633 (list (search-path-specification
3634 (variable "LOADKEYS_KEYMAP_PATH")
3635 ;; Append ‘/**’ to recursively search all directories. One can then
3636 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
3637 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
3638 (files (list "share/keymaps/**")))))
3639 (home-page "http://kbd-project.org/")
3640 (synopsis "Linux keyboard utilities and keyboard maps")
3642 "This package contains keytable files and keyboard utilities compatible
3643 for systems using the Linux kernel. This includes commands such as
3644 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3645 (license license:gpl2+)))
3647 (define-public loadkeys-static
3650 (name "loadkeys-static")
3652 (substitute-keyword-arguments (package-arguments kbd)
3653 ((#:configure-flags flags ''())
3654 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
3655 "--disable-vlock" ;so we don't need libpam
3656 "--disable-libkeymap")
3658 ((#:make-flags flags ''())
3659 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
3660 ((#:phases phases '%standard-phases)
3661 `(modify-phases ,phases
3663 (lambda* (#:key outputs #:allow-other-keys)
3664 (let ((out (assoc-ref outputs "out")))
3665 ;; The binary keeps references to gzip, among other things,
3666 ;; which we don't need in the initrd, so strip references.
3667 (remove-store-references "src/loadkeys")
3669 (install-file "src/loadkeys"
3670 (string-append out "/bin")))))
3671 (delete 'post-install)))
3672 ((#:strip-flags _ '())
3674 ((#:allowed-references _ '())
3677 (synopsis "Statically-linked @command{loadkeys} program")
3679 ;; This package is meant to be used internally in the initrd so don't
3681 (properties '((hidden? . #t)))))
3683 (define-public inotify-tools
3685 (name "inotify-tools")
3686 (version "3.20.11.0")
3690 (url "https://github.com/rvoicilas/inotify-tools")
3692 (file-name (git-file-name name version))
3695 "1m8avqccrhm38krlhp88a7v949f3hrzx060bbrr5dp5qw2nmw9j2"))))
3696 (build-system gnu-build-system)
3698 `(("autoconf" ,autoconf)
3699 ("automake" ,automake)
3700 ("libtool" ,libtool)))
3703 (list "--disable-static")))
3704 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3705 (synopsis "Monitor file accesses")
3707 "The inotify-tools packages provides a C library and command-line tools
3708 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3709 (license license:gpl2+)))
3718 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3719 "kmod-" version ".tar.xz"))
3722 "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
3723 (patches (search-patches "kmod-module-directory.patch"))))
3724 (build-system gnu-build-system)
3726 `(("pkg-config" ,pkg-config)
3732 ("zstd-lib" ,zstd "lib")))
3734 `(#:configure-flags '("--with-xz" "--with-zlib" "--with-zstd"
3735 "--disable-test-modules")
3737 (modify-phases %standard-phases
3738 (add-after 'unpack 'disable-tests
3740 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3741 (substitute* "Makefile.in"
3742 (("testsuite/test-modprobe") "")
3743 (("testsuite/test-depmod") "")
3744 (("testsuite/test-blacklist") ""))
3746 (add-after 'install 'install-modprobe&co
3747 (lambda* (#:key outputs #:allow-other-keys)
3748 (let* ((out (assoc-ref outputs "out"))
3749 (bin (string-append out "/bin")))
3750 (for-each (lambda (tool)
3752 (string-append bin "/" tool)))
3753 '("insmod" "rmmod" "lsmod" "modprobe"
3754 "modinfo" "depmod"))
3756 (supported-systems (delete "i586-gnu" %supported-systems))
3757 (home-page "https://www.kernel.org/")
3758 (synopsis "Kernel module tools")
3759 (description "Kmod is a set of tools to handle common tasks with Linux
3760 kernel modules like insert, remove, list, check properties, resolve
3761 dependencies and aliases.
3763 These tools are designed on top of libkmod, a library that is shipped with
3764 kmod. The aim is to be compatible with tools, configurations and indices
3765 from the module-init-tools project.")
3766 (license license:gpl2+))) ; library under lgpl2.1+
3768 (define-public earlyoom
3775 (url "https://github.com/rfjakob/earlyoom")
3776 (commit (string-append "v" version))))
3777 (file-name (git-file-name name version))
3780 "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))
3781 (modules '((guix build utils)))
3784 (substitute* "Makefile"
3786 "GO111MODULE=off go test -v"))
3788 (build-system gnu-build-system)
3791 (modify-phases %standard-phases
3792 (delete 'configure) ; no configure script
3793 (add-before 'check 'set-go-HOME
3795 (setenv "HOME" (getcwd))
3797 (add-before 'check 'disable-failing-test
3799 ;; This test relies on writing to /proc/%d/oom_score_adj.
3800 (substitute* "testsuite_cli_test.go"
3802 (string-append "skipped" match)))
3804 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3805 (list ,(string-append "CC=" (cc-for-target))
3806 (string-append "VERSION=v" ,version)
3807 (string-append "PREFIX=" prefix)
3808 (string-append "SYSCONFDIR=" prefix "/etc")))
3809 #:test-target "test"))
3810 (native-inputs `(("go" ,go) ;for the test suite
3811 ("pandoc" ,pandoc))) ;to generate the manpage
3812 (home-page "https://github.com/rfjakob/earlyoom")
3813 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3814 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3815 runs in user space and provides a more responsive and configurable alternative
3816 to the in-kernel OOM killer.")
3817 (license license:expat)))
3819 (define-public eudev
3820 ;; The post-systemd fork, maintained by Gentoo.
3826 (uri (git-reference (url "https://github.com/gentoo/eudev")
3827 (commit (string-append "v" version))))
3828 (file-name (git-file-name name version))
3831 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3832 (patches (search-patches "eudev-rules-directory.patch"))))
3833 (build-system gnu-build-system)
3836 (modify-phases %standard-phases
3837 (add-after 'unpack 'make-source-writable
3839 ;; XXX: Git checkouts are read-only, but this package needs to
3840 ;; modify some of its files.
3841 (for-each make-file-writable (find-files "."))
3843 (add-before 'bootstrap 'patch-file-names
3844 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3845 (substitute* "man/make.sh"
3846 (("/usr/bin/xsltproc")
3847 (string-append (assoc-ref
3848 (or native-inputs inputs) "xsltproc")
3851 (add-before 'configure 'patch-bindir-in-btrfs-rules
3852 (lambda* (#:key outputs #:allow-other-keys)
3853 ;; The "@bindir@" substitution incorrectly expands to a literal
3854 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3856 (let ((out (assoc-ref outputs "out")))
3857 (substitute* "rules/64-btrfs.rules.in"
3859 (string-append out "/bin")))
3861 (add-after 'install 'move-static-library
3862 (lambda* (#:key outputs #:allow-other-keys)
3863 (let* ((out (assoc-ref outputs "out"))
3864 (static (assoc-ref outputs "static"))
3865 (source (string-append out "/lib/libudev.a"))
3866 (target (string-append static "/lib/libudev.a")))
3867 (mkdir-p (dirname target))
3868 (link source target)
3869 (delete-file source)
3870 ;; Remove reference to the static library from the .la file
3871 ;; such that Libtool looks for it in the usual places.
3872 (substitute* (string-append out "/lib/libudev.la")
3874 "old_library=''\n"))
3876 (add-after 'install 'build-hwdb
3877 (lambda* (#:key outputs #:allow-other-keys)
3878 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3879 ;; similar tools to display product names.
3881 ;; XXX: This can't be done when cross-compiling. Find another way
3882 ;; to generate hwdb.bin for cross-built systems.
3883 (let ((out (assoc-ref outputs "out")))
3884 ,@(if (%current-target-system)
3886 '((invoke (string-append out "/bin/udevadm")
3887 "hwdb" "--update")))))))
3888 #:configure-flags (list "--enable-manpages")))
3890 `(("autoconf" ,autoconf)
3891 ("automake" ,automake)
3893 ("libtool" ,libtool)
3894 ("pkg-config" ,pkg-config)
3897 ("python" ,python-wrapper)
3898 ;; For documentation.
3899 ("docbook-xml" ,docbook-xml-4.2)
3900 ("docbook-xsl" ,docbook-xsl)
3901 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3902 ("xsltproc" ,libxslt)))
3904 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3905 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3906 ;; which contains the rules to do that.
3907 `(("util-linux" ,util-linux "lib") ;for blkid
3909 (outputs '("out" "static"))
3910 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3911 (synopsis "Userspace device management")
3912 (description "Udev is a daemon which dynamically creates and removes
3913 device nodes from /dev/, handles hotplug events and loads drivers at boot
3915 (license license:gpl2+)))
3917 (define-public python-evdev
3919 (name "python-evdev")
3924 (uri (pypi-uri "evdev" version))
3926 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3927 (build-system python-build-system)
3929 `(("kernel-headers" ,linux-libre-headers)))
3931 `(#:tests? #f ;no rule for tests
3933 (modify-phases %standard-phases
3934 (add-before 'build 'fix-hard-coded-directory
3935 (lambda* (#:key inputs #:allow-other-keys)
3936 (substitute* "setup.py"
3937 (("/usr/include/linux")
3939 (assoc-ref inputs "kernel-headers") "/include/linux")))
3941 (home-page "https://github.com/gvalkov/python-evdev")
3942 (synopsis "Bindings to the Linux input handling subsystem")
3944 "Python-evdev provides bindings to the generic input event interface in
3945 Linux. The @code{evdev} interface serves the purpose of passing events
3946 generated in the kernel directly to userspace through character devices that
3947 are typically located in @file{/dev/input/}.
3949 This package also comes with bindings to @code{uinput}, the userspace input
3950 subsystem. @code{uinput} allows userspace programs to create and handle input
3951 devices that can inject events directly into the input subsystem.")
3952 (license license:bsd-3)))
3954 (define-public interception-tools
3956 (name "interception-tools")
3958 (home-page "https://gitlab.com/interception/linux/tools")
3963 (commit (string-append "v" version))))
3964 (file-name (git-file-name name version))
3967 "0wcmppa7092b33wb8vc782day5phf90pc25cn1x7rk0rlw565z36"))))
3968 (build-system cmake-build-system)
3970 `(("pkg-config" ,pkg-config)))
3973 ("libevdev" ,libevdev)
3975 ("yaml-cpp" ,yaml-cpp)))
3977 `(#:tests? #f)) ; no test suite
3978 (synopsis "Utilities for operating on input events of evdev devices")
3980 "Interception Tools provides a composable infrastructure on top of
3981 @code{libudev} and @code{libevdev}. The following utilities are provided:
3984 @item @command{udevmon} --- monitor input devices for launching tasks
3985 @item @command{intercept} --- redirect device input events to stdout
3986 @item @command{uinput} --- redirect device input events from stding to virtual device
3987 @item @command{mux} --- mux streams of input events
3989 ;; Dual-licensed under GPLv3+ or "something else" on request, per
3991 (license license:gpl3+)))
3993 (define-public interception-dual-function-keys
3995 (name "interception-dual-function-keys")
3997 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
4003 (file-name (git-file-name name version))
4006 "0s49vbg3j4rwh78i8rx8qr7myql09p7b3lhrjl0p7dd98xp6ann6"))))
4007 (build-system gnu-build-system)
4009 `(("libevdev" ,libevdev)
4010 ("yaml-cpp" ,yaml-cpp)))
4012 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
4013 ,(string-append "CXX=" (cxx-for-target))
4014 (string-append "PREFIX=" %output))
4016 (modify-phases %standard-phases
4017 (add-after 'unpack 'fix-libevdev-path
4018 (lambda* (#:key inputs #:allow-other-keys)
4019 (let ((libevdev (assoc-ref inputs "libevdev")))
4020 (substitute* "config.mk"
4021 (("/usr/include/libevdev-1.0")
4022 (string-append libevdev "/include/libevdev-1.0")))
4024 ;; No configure script
4025 (delete 'configure))
4026 ;; No tests are included.
4028 (synopsis "Tap for one key, hold for another")
4030 "Dual Function Keys is a plugin for @code{interception-tools} that allows
4031 one to send arbitrary keycodes when a given key is tapped or held.")
4032 (license license:expat)))
4040 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
4042 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
4046 "1m4xpda8vbyd89ca0w8nacvnl4j34yzsa625gn990fb5sh84ab44"))
4047 (modules '((guix build utils)))
4050 (use-modules (guix build utils))
4052 ;; Honor sysconfdir.
4053 (substitute* "make.tmpl.in"
4055 "confdir = @sysconfdir@\n")
4056 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
4057 "DEFAULT_SYS_DIR = @sysconfdir@"))
4059 (patches (search-patches "lvm2-static-link.patch"))))
4060 (build-system gnu-build-system)
4062 `(("pkg-config" ,pkg-config)
4063 ("procps" ,procps))) ;tests use 'pgrep'
4065 `(("libaio" ,libaio)
4069 (modify-phases %standard-phases
4070 (add-after 'configure 'set-makefile-shell
4072 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
4074 (setenv "SHELL" (which "sh"))
4076 ;; Replace /bin/sh with the right file name.
4077 (patch-makefile-SHELL "make.tmpl")
4080 #:configure-flags (list (string-append "--sysconfdir="
4081 (assoc-ref %outputs "out")
4083 "--enable-udev_sync"
4084 "--enable-udev_rules"
4085 "--enable-pkgconfig"
4087 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
4089 ;; Make sure programs such as 'dmsetup' can
4090 ;; find libdevmapper.so.
4091 (string-append "LDFLAGS=-Wl,-rpath="
4092 (assoc-ref %outputs "out")
4094 (assoc-ref %outputs "out")
4095 "/lib/device-mapper")
4096 ;; This is needed when cross-compiling.
4097 ,@(if (%current-target-system)
4098 '("ac_cv_func_malloc_0_nonnull=yes"
4099 "ac_cv_func_realloc_0_nonnull=yes")
4102 ;; The tests use 'mknod', which requires root access.
4104 (supported-systems (delete "i586-gnu" %supported-systems))
4105 (home-page "https://sourceware.org/lvm2/")
4106 (synopsis "Logical volume management for Linux")
4108 "LVM2 is the logical volume management tool set for Linux-based systems.
4109 This package includes the user-space libraries and tools, including the device
4110 mapper. Kernel components are part of Linux-libre.")
4112 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
4113 ;; Command-line tools are GPLv2.
4114 (license (list license:gpl2 license:lgpl2.1))))
4116 (define-public lvm2-static
4119 (name "lvm2-static")
4121 ;; Propagate udev because libdevmapper.a depends on libudev.
4122 (propagated-inputs `(("udev:static" ,eudev "static")))
4125 (substitute-keyword-arguments (package-arguments lvm2)
4126 ((#:configure-flags flags '())
4127 ;; LVM2 doesn't use Libtool, hence the custom option.
4128 `(append '("--enable-static_link")
4129 ;; Building dmeventd statically is complicated due to a
4130 ;; requirement on libdevmapper.a, which is being phased out
4131 ;; in favor of libdevice-mapper.a, which in turn is is not
4132 ;; easily made available at dmeventd build time. Just ignore
4133 ;; it until the situation improves.
4134 (delete "--enable-dmeventd" ,flags)))
4136 `(modify-phases ,phases
4137 (add-before 'configure 'adjust-Makefile
4139 ;; These fixes are related to the upstream libdm->device_mapper
4140 ;; migration and will hopefully be fixed upstream in due time.
4141 (substitute* "tools/Makefile.in"
4142 ;; This variable is empty in a static configuration and causes
4143 ;; an erroneous GCC command line.
4144 (("-L\\$\\(interfacebuilddir\\)") "")
4145 ;; Remove obsolete reference to libdevmapper.a.
4146 (("-ldevmapper") ""))
4148 (synopsis "Logical volume management for Linux (statically linked)")))
4150 (define-public thin-provisioning-tools
4152 (name "thin-provisioning-tools")
4158 (url "https://github.com/jthornber/thin-provisioning-tools")
4159 (commit (string-append "v" version))))
4160 (file-name (git-file-name name version))
4162 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
4163 (build-system gnu-build-system)
4165 ;; Doesn't build with --enable-testing due to a function name collision
4166 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
4169 `(("automake" ,automake)
4170 ("autoreconf" ,autoconf)))
4174 ("libaio" ,libaio)))
4175 (synopsis "Tools for manipulating the metadata of device-mapper targets")
4176 (description "A suite of tools for manipulating the metadata of the
4177 dm-thin, dm-cache and dm-era device-mapper targets.")
4178 (home-page "https://github.com/jthornber/thin-provisioning-tools")
4179 (license license:gpl3+)))
4181 (define-public wireless-tools
4183 (name "wireless-tools")
4187 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
4191 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
4194 ;; Remove the older header files that are not free software.
4195 (for-each (lambda (n)
4196 (delete-file (format #f "wireless.~a.h" n)))
4197 '(10 11 12 13 14 15 16 17 18 19 20))
4199 (build-system gnu-build-system)
4202 (list (string-append "PREFIX=" %output)
4203 (string-append "INSTALL_MAN=" %output "/share/man")
4204 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
4207 (modify-phases %standard-phases
4209 (lambda* (#:key target #:allow-other-keys)
4210 (when ,(%current-target-system)
4211 ;; Cross-compilation: use the cross tools.
4212 (substitute* (find-files "." "Makefile")
4214 (string-append "CC = " target "-gcc\n"))
4216 (string-append "AR = " target "-ar\n"))
4218 (string-append "RANLIB = " target "-ranlib\n"))))
4221 (synopsis "Tools for manipulating Linux Wireless Extensions")
4222 (description "Wireless Tools are used to manipulate the now-deprecated
4223 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
4224 Extension was an interface allowing you to set Wireless LAN specific
4225 parameters and get the specific stats. It is deprecated in favor the nl80211
4227 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
4228 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
4229 ;; other files are distributed under gpl2.
4230 (license (list license:gpl2 license:lgpl2.1+))))
4238 (uri (string-append "mirror://kernel.org/software/network/crda/"
4239 "crda-" version ".tar.xz"))
4242 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
4243 (patches (search-patches "crda-optional-gcrypt.patch"))))
4244 (build-system gnu-build-system)
4246 `(#:phases (modify-phases %standard-phases
4248 (add-after 'unpack 'gzip-determinism
4250 (substitute* "Makefile"
4251 (("gzip") "gzip --no-name"))
4253 ,@(if (%current-target-system)
4255 'unpack 'fix-pkg-config
4256 (lambda* (#:key target #:allow-other-keys)
4260 (string-append target "-pkg-config")))
4264 'build 'no-werror-no-ldconfig
4266 (substitute* "Makefile"
4268 (("ldconfig") "true"))
4271 'build 'set-regulator-db-file-name
4272 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4273 ;; Tell CRDA where to find our database.
4274 (let ((regdb (assoc-ref (or native-inputs inputs)
4276 (substitute* "crda.c"
4277 (("\"/lib/crda/regulatory.bin\"")
4278 (string-append "\"" regdb
4279 "/lib/crda/regulatory.bin\"")))
4281 #:test-target "verify"
4282 #:make-flags (let ((out (assoc-ref %outputs "out"))
4283 (regdb (assoc-ref %build-inputs "wireless-regdb")))
4285 (string-append "CC=" ,(cc-for-target))
4288 ;; Disable signature-checking on 'regulatory.bin'.
4289 ;; The reason is that this simplifies maintenance
4290 ;; on our side (no need to manage a distro key
4291 ;; pair), and we can guarantee integrity of
4292 ;; 'regulatory.bin' by other means anyway, such as
4293 ;; 'guix gc --verify'. See
4294 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
4298 (string-append "PREFIX=" out)
4299 (string-append "SBINDIR=" out "/sbin/")
4300 (string-append "UDEV_RULE_DIR="
4301 out "/lib/udev/rules.d")
4302 (string-append "LDFLAGS=-Wl,-rpath="
4304 (string-append "REG_BIN=" regdb
4305 "/lib/crda/regulatory.bin")
4307 (native-inputs `(("pkg-config" ,pkg-config)
4308 ("wireless-regdb" ,wireless-regdb)))
4309 (inputs `(("libnl" ,libnl)))
4311 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
4312 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
4314 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
4315 communication between the kernel Linux and user space for regulatory
4317 (license license:copyleft-next)))
4319 (define-public wireless-regdb
4321 (name "wireless-regdb")
4322 (version "2020.11.20")
4326 "mirror://kernel.org/software/network/wireless-regdb/"
4327 "wireless-regdb-" version ".tar.xz"))
4330 "0liagyi6ppf5w474qk9j4jz5gbvvn8mc8al1dq4b1xrgv28485ml"))
4332 ;; We're building 'regulatory.bin' by ourselves.
4334 (delete-file "regulatory.bin")
4336 (build-system gnu-build-system)
4339 (modify-phases %standard-phases
4340 (add-after 'unpack 'gzip-determinism
4342 (substitute* "Makefile"
4343 (("gzip") "gzip --no-name"))
4345 (add-after 'unpack 'omit-signature
4347 (substitute* "Makefile"
4348 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
4349 ;; don't provide (see below). Disable it.
4350 ((" regulatory\\.db\\.p7s") "")
4351 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
4352 ;; but ‘make install’ depends only on the latter while installing
4353 ;; both (and failing). Depend on it explicitly.
4354 (("^install: " all) (string-append all "regulatory.db ")))
4356 (delete 'configure)) ; no configure script
4358 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
4359 ;; is computed and can be equal to 'maintainer-clean'; when that
4360 ;; happens, we can end up deleting the 'regulatory.bin' file that we
4361 ;; just built. Thus, build things sequentially.
4362 #:parallel-build? #f
4364 #:tests? #f ; no tests
4366 (let ((out (assoc-ref %outputs "out")))
4367 (list (string-append "PREFIX=" out)
4368 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
4370 ;; Leave this empty so that db2bin.py doesn't try to sign
4371 ;; ‘regulatory.bin’. This allows us to avoid managing a key
4372 ;; pair for the whole distribution.
4373 (string-append "REGDB_PRIVKEY=")
4374 ;; Don't generate a public key for the same reason. These are
4375 ;; used as Makefile targets and can't be the empty string.
4376 (string-append "REGDB_PUBCERT=/dev/null")
4377 (string-append "REGDB_PUBKEY=/dev/null")))))
4379 `(("python" ,python-wrapper)))
4381 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
4382 (synopsis "Wireless regulatory database")
4384 "This package contains the wireless regulatory database for the Central
4385 Regulatory Database Agent (CRDA). The database contains information on
4386 country-specific regulations for the wireless spectrum.")
4387 (license license:isc)))
4389 (define-public lm-sensors
4397 (url "https://github.com/groeck/lm-sensors")
4398 (commit (string-append "V" (string-join
4399 (string-split version #\.) "-")))))
4400 (file-name (git-file-name name version))
4402 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
4403 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
4404 (build-system gnu-build-system)
4405 (inputs `(("rrdtool" ,rrdtool)
4408 ("gnuplot" ,gnuplot)))
4409 (native-inputs `(("pkg-config" ,pkg-config)
4413 (outputs '("lib" ; avoid perl in closure
4416 `(#:tests? #f ; no 'check' target
4417 #:make-flags (list (string-append "PREFIX=" %output)
4418 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
4419 (string-append "INCLUDEDIR="
4420 (assoc-ref %outputs "lib") "/include")
4421 (string-append "MANDIR=" %output "/share/man")
4422 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
4424 (modify-phases %standard-phases
4426 (add-before 'build 'patch-exec-paths
4427 (lambda* (#:key inputs outputs #:allow-other-keys)
4428 (substitute* "prog/detect/sensors-detect"
4430 (string-append "`" (assoc-ref inputs "coreutils")
4432 (("(`|\")modprobe" all open-quote)
4433 (string-append open-quote
4434 (assoc-ref inputs "kmod")
4436 (substitute* '("prog/pwm/pwmconfig"
4437 "prog/pwm/fancontrol")
4439 (search-input-file inputs "/bin/gnuplot"))
4441 (string-append (search-input-file inputs "/bin/cat")
4444 (string-append (search-input-file inputs
4447 (string-trim-right match)))
4450 (string-append (search-input-file inputs "/bin/sed")
4453 (string-append (search-input-file inputs "/bin/cut")
4456 (string-append (search-input-file inputs "/bin/sleep")
4459 (string-append (search-input-file inputs "/bin/readlink")
4461 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
4462 (synopsis "Utilities to read temperature/voltage/fan sensors")
4464 "Lm-sensors is a hardware health monitoring package for Linux. It allows
4465 you to access information from temperature, voltage, and fan speed sensors.
4466 It works with most newer systems.")
4467 (license license:gpl2+)))
4469 (define-public iucode-tool
4471 (name "iucode-tool")
4475 (uri (string-append "https://gitlab.com/iucode-tool/releases"
4476 "/raw/latest/iucode-tool_" version ".tar.xz"))
4479 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
4480 (build-system gnu-build-system)
4481 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
4482 (synopsis "Manipulate Intel microcode bundles")
4484 "@command{iucode_tool} is a utility to work with microcode packages for
4485 Intel processors. It can convert between formats, extract specific versions,
4486 create a firmware image suitable for the Linux kernel, and more.")
4487 ;; cpuid.h is available for i686, x86_64, and ia64.
4488 (supported-systems '("i686-linux" "x86_64-linux"))
4489 (license license:gpl2+)))
4491 (define-public i2c-tools
4498 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
4499 version ".tar.bz2"))
4502 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
4503 (build-system gnu-build-system)
4505 `(#:tests? #f ; no 'check' target
4506 #:make-flags (list (string-append "prefix=" %output)
4507 ,(string-append "CC=" (cc-for-target)))
4508 ;; No configure script.
4509 #:phases (modify-phases %standard-phases (delete 'configure))))
4512 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
4513 (synopsis "I2C tools for Linux")
4515 "The i2c-tools package contains a heterogeneous set of I2C tools for
4516 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
4517 EEPROM decoding scripts, EEPROM programming tools, and a python module for
4519 (license license:gpl2+)))
4521 (define-public xsensors
4528 "http://www.linuxhardware.org/xsensors/xsensors-"
4532 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
4533 (build-system gnu-build-system)
4534 (inputs `(("lm-sensors" ,lm-sensors "lib")
4536 (native-inputs `(("pkg-config" ,pkg-config)))
4539 (modify-phases %standard-phases
4540 (add-before 'configure 'enable-deprecated
4542 (substitute* "src/Makefile.in"
4543 (("-DGDK_DISABLE_DEPRECATED") "")
4544 (("-DGTK_DISABLE_DEPRECATED") ""))
4546 (add-before 'configure 'remove-Werror
4548 (substitute* '("configure" "src/Makefile.in")
4551 (home-page "http://www.linuxhardware.org/xsensors/")
4552 (synopsis "Hardware health information viewer")
4554 "Xsensors reads data from the libsensors library regarding hardware
4555 health such as temperature, voltage and fan speed and displays the information
4556 in a digital read-out.")
4557 (license license:gpl2+)))
4562 (version (package-version linux-libre))
4563 (source (package-source linux-libre))
4564 (build-system gnu-build-system)
4567 (modify-phases %standard-phases
4569 (lambda* (#:key inputs #:allow-other-keys)
4570 (setenv "SHELL_PATH" (which "bash"))
4571 (chdir "tools/perf")
4573 #:make-flags (list (string-append "prefix="
4574 (assoc-ref %outputs "out"))
4578 ;; By default, 'config/Makefile' uses lib64 on
4579 ;; x86_64. Work around that.
4581 #:tests? #f)) ;no tests
4583 `(("pkg-config" ,pkg-config)
4587 ;; There are build scripts written in these languages.
4589 ("python2" ,python-2)
4590 ("python3" ,python-3)))
4592 `(("slang" ,slang) ;for the interactive TUI
4594 ("python" ,python-2) ;'perf' links against libpython
4595 ("elfutils" ,elfutils)
4596 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
4597 ("libunwind" ,libunwind) ;better stack walking
4598 ("numactl" ,numactl) ;for 'perf bench numa mem'
4601 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
4602 ("docbook-xsl" ,docbook-xsl)
4604 ("asciidoc" ,asciidoc)))
4605 (home-page "https://perf.wiki.kernel.org/")
4606 (synopsis "Linux profiling with performance counters")
4608 "perf is a tool suite for profiling using hardware performance counters,
4609 with support in the Linux kernel. perf can instrument CPU performance
4610 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
4611 of lightweight profiling. This package contains the user-land tools and in
4612 particular the @code{perf} command.")
4613 (license (package-license linux-libre))))
4615 (define-public pflask
4622 (url "https://github.com/ghedo/pflask")
4623 (commit (string-append "v" version))))
4624 (file-name (git-file-name name version))
4627 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
4628 (build-system cmake-build-system)
4630 '(#:tests? #f)) ; no tests
4631 (home-page "https://ghedo.github.io/pflask/")
4632 (synopsis "Simple tool for creating Linux namespace containers")
4633 (description "pflask is a simple tool for creating Linux namespace
4634 containers. It can be used for running a command or even booting an OS inside
4635 an isolated container, created with the help of Linux namespaces. It is
4636 similar in functionality to chroot, although pflask provides better isolation
4637 thanks to the use of namespaces.")
4638 (license license:bsd-2)))
4640 (define-public singularity
4642 (name "singularity")
4646 (uri (string-append "https://github.com/singularityware/singularity/"
4647 "releases/download/" version
4648 "/singularity-" version ".tar.gz"))
4651 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
4652 (modules '((guix build utils)))
4655 ;; Do not create directories in /var.
4656 (substitute* "Makefile.in"
4657 (("\\$\\(MAKE\\) .*install-data-hook") ""))
4659 ;; The original source overrides PATH so that it points to
4660 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
4661 ;; on Guix System. Leave PATH unchanged so we refer to the
4662 ;; installed Coreutils, grep, etc.
4663 (substitute* "bin/singularity.in"
4665 (string-append "#" all "\n")))
4667 (substitute* (find-files "libexec/cli" "\\.exec$")
4668 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
4670 (string-append "/run/setuid-programs/singularity-"
4671 program "-helper")))
4673 ;; These squashfs mount options are apparently no longer
4674 ;; supported since Linux-libre 5.4.5.
4675 (substitute* "src/lib/image/squashfs/mount.c"
4676 (("\"errors=remount-ro\"")
4679 (build-system gnu-build-system)
4681 `(#:configure-flags '("--localstatedir=/var")
4683 (modify-phases %standard-phases
4684 (add-after 'unpack 'patch-references
4686 (substitute* "libexec/cli/build.exec.in"
4687 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
4688 (substitute* (append
4689 (find-files "libexec" "functions")
4690 (find-files "libexec/bootstrap-scripts" ".*sh$")
4691 (find-files "libexec/cli" ".*exec$"))
4693 (string-append "| " (which "grep") " "))
4695 (string-append (which "egrep") " "))
4697 (string-append " " (which "sed") " ")))
4699 (add-after 'install 'set-PATH
4700 (lambda* (#:key inputs outputs #:allow-other-keys)
4701 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
4702 (let ((out (assoc-ref outputs "out"))
4703 (coreutils (assoc-ref inputs "coreutils")))
4704 (wrap-program (string-append out "/bin/singularity")
4705 `("PATH" ":" = (,(string-append coreutils "/bin"))))
4706 (substitute* (string-append out "/bin/run-singularity")
4707 (("/usr/bin/env singularity")
4708 (string-append (which "env") " "
4709 out "/bin/singularity")))
4712 `(("libarchive" ,libarchive)
4713 ("python" ,python-wrapper)
4715 ("squashfs-tools" ,squashfs-tools)))
4716 (home-page "https://singularity.lbl.gov/")
4717 (synopsis "Container platform")
4718 (description "Singularity is a container platform supporting a number of
4719 container image formats. It can build SquashFS container images or import
4720 existing Docker images. Singularity requires kernel support for container
4721 isolation or root privileges.")
4722 (license license:bsd-3)))
4724 (define-public hdparm
4730 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
4731 "hdparm-" version ".tar.gz"))
4734 "0zvppv8qw0y1shlhn34iq1g4883i1cywsa514n595nmyrmsrs3rc"))))
4735 (build-system gnu-build-system)
4738 (let ((out (assoc-ref %outputs "out")))
4739 (list (string-append "binprefix=" out)
4740 (string-append "manprefix=" out)
4741 ,(string-append "CC=" (cc-for-target))
4742 ;; Let Guix strip the binaries and not break cross-compilation.
4745 (modify-phases %standard-phases
4746 (delete 'configure)) ; no configure script
4747 #:tests? #f)) ; no test suite
4748 (home-page "https://sourceforge.net/projects/hdparm/")
4749 (synopsis "View and tune ATA disk drive parameters")
4751 "@command{hdparm} is a command-line utility to control ATA controllers and
4752 disk drives. It can increase performance and/or reliability by careful tuning
4753 of hardware settings like power and acoustic management, DMA modes, and caching.
4754 It can also display detailed device information, or be used as a simple
4755 performance benchmarking tool.
4757 @command{hdparm} provides a command line interface to various Linux kernel
4758 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
4759 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4760 Translation (@dfn{SAT}) are also supported.")
4761 (license (license:non-copyleft "file://LICENSE.TXT"))))
4763 (define-public nvme-cli
4767 (home-page "https://github.com/linux-nvme/nvme-cli")
4772 (commit (string-append "v" version))))
4774 (base32 "0qr1wa163cb7z6g083nl3zcc28mmlbxh1m97pd54bp3gyrhmdhhr"))
4775 (file-name (git-file-name name version))))
4776 (build-system gnu-build-system)
4779 (list ,(string-append "CC=" (cc-for-target)))
4780 #:phases (modify-phases %standard-phases
4781 (delete 'configure) ; no ./configure script
4784 (invoke "make" "install-spec" "PREFIX="
4785 (string-append "DESTDIR=" %output)))))
4786 ;; The tests require sysfs, which is not accessible from from the build
4789 (synopsis "NVM-Express user space tooling for Linux")
4790 (description "Nvme-cli is a utility to provide standards compliant tooling
4791 for NVM-Express drives. It was made specifically for Linux as it relies on the
4792 IOCTLs defined by the mainline kernel driver.")
4793 (license license:gpl2+)))
4795 (define-public rfkill
4801 (uri (string-append "mirror://kernel.org/software/network/"
4802 name "/" name "-" version ".tar.xz"))
4805 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4806 (build-system gnu-build-system)
4808 `(#:make-flags (list "CC=gcc"
4809 (string-append "PREFIX=" %output))
4810 #:phases (modify-phases %standard-phases
4811 (delete 'configure))
4813 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4814 (synopsis "Tool for enabling and disabling wireless devices")
4816 "rfkill is a simple tool for accessing the rfkill device interface,
4817 which is used to enable and disable wireless networking devices, typically
4818 WLAN, Bluetooth and mobile broadband.")
4819 (license (license:non-copyleft "file://COPYING"
4820 "See COPYING in the distribution."))
4821 ;; rfkill is part of util-linux as of 2.31.
4822 (properties `((superseded . ,util-linux)))))
4830 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4831 version "/" name "-" version ".tar.gz"))
4834 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4835 (build-system gnu-build-system)
4836 (home-page "http://acpiclient.sourceforge.net")
4837 (synopsis "Display information on ACPI devices")
4838 (description "@code{acpi} attempts to replicate the functionality of the
4839 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4840 information. It does not support ACPI suspending, only displays information
4841 about ACPI devices.")
4842 (license license:gpl2+)))
4844 (define-public acpid
4850 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4854 "1s6vf8lqwrcqi14k0ww47pk1kifbvxin73ha7mk1njmk7qdzfmh8"))))
4855 (build-system gnu-build-system)
4856 (home-page "https://sourceforge.net/projects/acpid2/")
4857 (synopsis "Daemon for delivering ACPI events to user-space programs")
4859 "acpid is designed to notify user-space programs of Advanced
4860 Configuration and Power Interface (ACPI) events. acpid should be started
4861 during the system boot, and will run as a background process. When an ACPI
4862 event is received from the kernel, acpid will examine the list of rules
4863 specified in /etc/acpi/events and execute the rules that match the event.")
4864 (license license:gpl2+)))
4866 (define-public sysfsutils
4875 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4878 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4879 (build-system gnu-build-system)
4880 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4881 (synopsis "System utilities based on Linux sysfs")
4883 "These are a set of utilities built upon sysfs, a virtual file system in
4884 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4885 also contains the libsysfs library.")
4886 ;; The library is under lgpl2.1+ (all files say "or any later version").
4887 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4888 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4890 (define-public cpufrequtils
4892 (name "cpufrequtils")
4897 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4898 "cpufrequtils-" version ".tar.gz"))
4900 (base32 "0xjs8j44hh0cz6qpig1n0iw8xjpr6s5qmcmwh965ngapxgarr7af"))))
4901 (build-system gnu-build-system)
4903 `(#:tests? #f ; no test suite
4905 (let ((out (assoc-ref %outputs "out")))
4906 (list "PROC=false" ; obsoleted by sysfs in Linux 2.6(!)
4907 (string-append "CC=" ,(cc-for-target))
4908 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4910 (string-append "bindir=" out "/bin")
4911 (string-append "sbindir=" out "/sbin")
4912 (string-append "mandir=" out "/share/man")
4913 (string-append "includedir=" out "/include")
4914 (string-append "libdir=" out "/lib")
4915 (string-append "localedir=" out "/share/locale")
4916 (string-append "docdir=" out "/share/doc/" ,name)))
4918 (modify-phases %standard-phases
4919 (delete 'configure)))) ; no configure script
4921 `(("gettext" ,gettext-minimal)))
4923 "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
4924 (synopsis "Utilities to get and set CPU frequency on Linux")
4926 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4927 information, and set the CPU frequency if supported, using the cpufreq
4928 capabilities of the Linux kernel.")
4929 (license license:gpl2)))
4931 (define-public libraw1394
4938 "mirror://kernel.org/linux/libs/ieee1394/"
4939 name "-" version ".tar.xz"))
4942 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4943 (build-system gnu-build-system)
4944 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4945 (synopsis "Interface library for the Linux IEEE1394 drivers")
4947 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4948 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4949 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4950 send to and receive from other nodes without requiring a kernel driver for the
4951 protocol in question.")
4952 (license license:lgpl2.1+)))
4954 (define-public libavc1394
4960 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4961 name "-" version ".tar.gz"))
4964 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4965 (build-system gnu-build-system)
4967 `(("pkg-config" ,pkg-config)))
4969 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4970 (home-page "https://sourceforge.net/projects/libavc1394/")
4971 (synopsis "AV/C protocol library for IEEE 1394")
4973 "Libavc1394 is a programming interface to the AV/C specification from
4974 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4975 (license license:lgpl2.1+)))
4977 (define-public libiec61883
4979 (name "libiec61883")
4984 "mirror://kernel.org/linux/libs/ieee1394/"
4985 name "-" version ".tar.xz"))
4988 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4989 (build-system gnu-build-system)
4991 `(("pkg-config" ,pkg-config)))
4993 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4994 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4995 (synopsis "Isochronous streaming media library for IEEE 1394")
4997 "The libiec61883 library provides a higher level API for streaming DV,
4998 MPEG-2 and audio over Linux IEEE 1394.")
4999 (license license:lgpl2.1+)))
5001 (define-public mdadm
5008 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
5012 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
5013 (build-system gnu-build-system)
5017 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
5018 (list ,(string-append "CC=" (cc-for-target))
5021 ;; TODO: tell it where to find 'sendmail'
5022 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
5023 (string-append "BINDIR=" out "/sbin")
5024 (string-append "MANDIR=" out "/share/man")
5025 (string-append "UDEVDIR=" out "/lib/udev")))
5027 (modify-phases %standard-phases
5028 (add-before 'build 'patch-program-paths
5029 (lambda* (#:key native-inputs inputs #:allow-other-keys)
5030 (let ((coreutils (assoc-ref (or native-inputs inputs)
5032 (substitute* "udev-md-raid-arrays.rules"
5033 (("/usr/bin/(readlink|basename)" all program)
5034 (string-append coreutils "/bin/" program))))
5036 (add-before 'build 'remove-W-error
5038 ;; We cannot build with -Werror on i686 due to a
5039 ;; 'sign-compare' warning in util.c.
5040 (substitute* "Makefile"
5043 (delete 'configure))
5044 ;;tests must be done as root
5046 (supported-systems (delete "i586-gnu" %supported-systems))
5047 (home-page "http://neil.brown.name/blog/mdadm")
5048 (synopsis "Tool for managing Linux Software RAID arrays")
5050 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
5051 assemble, report on, and monitor arrays. It can also move spares between raid
5052 arrays when needed.")
5053 (license license:gpl2+)))
5055 (define-public mdadm-static
5058 (name "mdadm-static")
5060 (substitute-keyword-arguments (package-arguments mdadm)
5061 ((#:make-flags flags)
5062 `(cons "LDFLAGS = -static" ,flags))
5064 `(modify-phases ,phases
5065 (add-after 'install 'remove-cruft
5066 (lambda* (#:key outputs #:allow-other-keys)
5067 (let* ((out (assoc-ref outputs "out"))
5068 (precious? (lambda (file)
5069 (member file '("." ".." "sbin"))))
5070 (directories (scandir out (negate precious?))))
5071 (with-directory-excursion out
5072 (for-each delete-file-recursively directories)
5073 (remove-store-references "sbin/mdadm")
5074 (delete-file "sbin/mdmon")
5076 ((#:modules modules %gnu-build-system-modules)
5077 `((ice-9 ftw) ,@modules))
5078 ((#:strip-flags _ '())
5079 ''("--strip-all")) ;strip a few extra KiB
5080 ((#:allowed-references _ '("out"))
5081 '("out")))) ;refer only self
5082 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
5084 (define-public multipath-tools
5086 (name "multipath-tools")
5091 (url "https://git.opensvc.com/multipath-tools/.git")
5093 (file-name (git-file-name name version))
5096 "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg"))
5097 (modules '((guix build utils)))
5100 ;; Drop bundled valgrind headers.
5101 (delete-file-recursively "third-party")
5102 (substitute* '("multipathd/main.c"
5103 "libmultipath/debug.c")
5104 (("#include \"../third-party/")
5107 (build-system gnu-build-system)
5109 '(#:test-target "test"
5110 #:parallel-build? #f ;XXX: broken in 0.8.4
5111 #:make-flags (list "CC=gcc"
5112 (string-append "DESTDIR="
5113 (assoc-ref %outputs "out"))
5114 ;; Install Udev rules below this directory, relative
5117 (string-append "LDFLAGS=-Wl,-rpath="
5118 (assoc-ref %outputs "out")
5121 (modify-phases %standard-phases
5122 (add-after 'unpack 'patch-source
5123 (lambda* (#:key inputs #:allow-other-keys)
5124 (let ((lvm2 (assoc-ref inputs "lvm2"))
5125 (udev (assoc-ref inputs "udev")))
5126 (substitute* "Makefile.inc"
5127 (("\\$\\(prefix\\)/usr") "$(prefix)")
5128 ;; Do not save timestamp to avoid gzip "timestamp
5129 ;; out-of-range" warnings.
5130 (("gzip -9") "gzip -9n"))
5131 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
5132 (("/usr/include/libdevmapper.h")
5133 (string-append lvm2 "/include/libdevmapper.h"))
5134 (("/usr/include/libudev.h")
5135 (string-append udev "/include/libudev.h")))
5137 (add-after 'unpack 'fix-maybe-uninitialized-variable
5139 ;; This variable gets initialized later if needed, but GCC 7
5140 ;; fails to notice. Should be fixed for > 0.8.4.
5141 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
5142 (substitute* "libmultipath/structs_vec.c"
5143 (("bool is_queueing;")
5144 "bool is_queueing = false;"))
5146 (add-after 'unpack 'fix-linking-tests
5148 ;; Add missing linker flag for -lmpathcmd. This should be fixed
5149 ;; for versions > 0.8.4.
5150 (substitute* "tests/Makefile"
5151 (("-lmultipath -lcmocka")
5152 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
5154 (add-after 'unpack 'skip-failing-tests
5156 ;; This test and the module's setup() test an arbitrary block
5157 ;; device node name, but the build environment has none.
5158 (substitute* "tests/devt.c"
5159 (("return get_one_devt.*") "return 0;\n")
5160 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
5161 ;; The above triggers -Werror=unused-function. Ignore it.
5162 (substitute* "tests/Makefile"
5163 (("CFLAGS \\+= " match)
5164 (string-append match "-Wno-error=unused-function ")))
5166 (delete 'configure)))) ; no configure script
5169 ("pkg-config" ,pkg-config)
5170 ("valgrind" ,valgrind)
5173 ("cmocka" ,cmocka)))
5175 `(("json-c" ,json-c)
5177 ("liburcu" ,liburcu)
5179 ("readline" ,readline)
5181 (home-page "http://christophe.varoqui.free.fr/")
5182 (synopsis "Access block devices through multiple paths")
5184 "This package provides the following binaries to drive the
5185 Linux Device Mapper multipathing driver:
5187 @item @command{multipath} - Device mapper target autoconfig.
5188 @item @command{multipathd} - Multipath daemon.
5189 @item @command{mpathpersist} - Manages SCSI persistent reservations on
5190 @code{dm} multipath devices.
5191 @item @command{kpartx} - Create device maps from partition tables.
5193 (license (list license:gpl2+ ; main distribution
5194 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
5196 (define-public libaio
5203 (string-append "https://releases.pagure.org/libaio/"
5204 name "-" version ".tar.gz")))
5207 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
5208 (build-system gnu-build-system)
5211 (let ((target ,(%current-target-system)))
5212 (list (string-append "prefix=" %output)
5215 (string-append (assoc-ref %build-inputs "cross-gcc")
5216 "/bin/" target "-gcc")
5218 #:test-target "partcheck" ; need root for a full 'check'
5220 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
5221 (home-page "https://pagure.io/libaio")
5222 (synopsis "Linux-native asynchronous I/O access library")
5224 "This library enables userspace to use Linux kernel asynchronous I/O
5225 system calls, important for the performance of databases and other advanced
5227 (license license:lgpl2.1+)))
5229 (define-public blktrace
5230 ;; Take a newer commit to get the fix for CVE-2018-10689.
5231 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
5235 (version (git-version "1.2.0" revision commit))
5237 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
5244 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
5245 (file-name (git-file-name name version))))
5246 (build-system gnu-build-system)
5249 (list ,(string-append "CC=" (cc-for-target))
5250 (string-append "prefix=" %output))
5251 #:tests? #f ; no tests
5253 (modify-phases %standard-phases
5254 (delete 'configure) ; no configure script
5255 (add-after 'unpack 'fix-gnuplot-path
5256 (lambda* (#:key inputs #:allow-other-keys)
5257 (let ((gnuplot (assoc-ref inputs "gnuplot")))
5258 (substitute* "btt/bno_plot.py"
5260 (string-append gnuplot "/bin/gnuplot %s")))
5263 `(("libaio" ,libaio)
5264 ("gnuplot" ,gnuplot)
5265 ("python" ,python-wrapper))) ;for 'bno_plot.py'
5266 (synopsis "Block layer IO tracing mechanism")
5267 (description "Blktrace is a block layer IO tracing mechanism which provides
5268 detailed information about request queue operations to user space. It extracts
5269 event traces from the kernel (via the relaying through the debug file system).")
5270 (license license:gpl2))))
5278 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
5280 (patches (search-patches "sbc-fix-build-non-x86.patch"))
5283 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
5284 (build-system gnu-build-system)
5286 `(("libsndfile" ,libsndfile)))
5288 `(("pkg-config" ,pkg-config)))
5289 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
5290 (synopsis "Bluetooth subband audio codec")
5292 "The SBC is a digital audio encoder and decoder used to transfer data to
5293 Bluetooth audio output devices like headphones or loudspeakers.")
5294 (license license:gpl2+)))
5296 (define-public bluez
5303 "mirror://kernel.org/linux/bluetooth/bluez-"
5307 "124v9s4y1s7s6klx5vlmzpk1jlr4x84ch7r7scm7x2f42dqp2qw8"))))
5308 (build-system gnu-build-system)
5311 (let ((out (assoc-ref %outputs "out")))
5312 (list "--sysconfdir=/etc"
5313 "--localstatedir=/var"
5316 ;; TODO: is this needed? Not installed by default since 5.55.
5318 ;; Install dbus/udev files to the correct location.
5319 (string-append "--with-dbusconfdir=" out "/etc")
5320 (string-append "--with-udevdir=" out "/lib/udev")))
5322 (modify-phases %standard-phases
5323 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
5324 ;; issue (discussion on upstream mailing list:
5325 ;; https://marc.info/?t=149578476300002&r=1&w=2)
5326 (add-before 'check 'skip-wonky-test
5328 (substitute* "unit/test-gatt.c"
5329 (("tester_init\\(&argc, &argv\\);") "return 77;"))
5331 (add-after 'install 'post-install
5332 (lambda* (#:key inputs outputs #:allow-other-keys)
5333 (let* ((out (assoc-ref outputs "out"))
5334 (servicedir (string-append out "/share/dbus-1/services"))
5335 (service "obexd/src/org.bluez.obex.service")
5336 (rule (string-append
5337 out "/lib/udev/rules.d/97-hid2hci.rules")))
5338 ;; Install the obex dbus service file.
5339 (substitute* service
5341 (string-append out "/libexec/bluetooth/obexd")))
5342 (install-file service servicedir)
5343 ;; Fix paths in the udev rule.
5345 (("hid2hci --method")
5346 (string-append out "/lib/udev/hid2hci --method"))
5348 (search-input-file inputs "/bin/udevadm")))
5351 `(("pkg-config" ,pkg-config)
5352 ("gettext" ,gettext-minimal)))
5357 ("libical" ,libical)
5358 ("readline" ,readline)))
5359 (home-page "http://www.bluez.org/")
5360 (synopsis "Linux Bluetooth protocol stack")
5362 "BlueZ provides support for the core Bluetooth layers and protocols. It
5363 is flexible, efficient and uses a modular implementation.")
5364 (license license:gpl2+)))
5366 (define-public fuse-exfat
5373 "https://github.com/relan/exfat/releases/download/v"
5374 version "/" name "-" version ".tar.gz"))
5377 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
5378 (build-system gnu-build-system)
5380 `(("pkg-config" ,pkg-config)))
5383 (home-page "https://github.com/relan/exfat")
5384 (synopsis "Mount exFAT file systems")
5386 "This package provides a FUSE-based file system that provides read and
5387 write access to exFAT devices.")
5388 (license license:gpl2+)))
5390 (define-public fuseiso
5393 (version "20070708")
5396 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
5397 version "/fuseiso-" version ".tar.bz2"))
5400 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
5401 (build-system gnu-build-system)
5403 `(("pkg-config" ,pkg-config)))
5408 (home-page "https://sourceforge.net/projects/fuseiso/")
5409 (synopsis "Mount ISO file system images")
5411 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
5412 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
5413 Ridge, Joliet, and zisofs.")
5414 (license license:gpl2)))
5423 "https://www.nico.schottelius.org/software/gpm/archives/"
5424 "gpm-" version ".tar.bz2"))
5425 (patches (search-patches "gpm-glibc-2.26.patch"))
5428 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
5429 (modules '((guix build utils)))
5432 ;; Take a patch from upstream to fix building with -fno-common,
5433 ;; which is default in GCC 10:
5434 ;; https://github.com/telmich/gpm/pull/37
5435 (substitute* "src/headers/daemon.h"
5436 (("^time_t[[:blank:]]+last_selection_time;")
5437 "extern time_t last_selection_time;"))))))
5438 (build-system gnu-build-system)
5440 '(#:phases (modify-phases %standard-phases
5443 ;; The tarball was not generated with 'make dist' so we
5444 ;; need to bootstrap things ourselves.
5445 (substitute* "autogen.sh"
5446 (("/bin/sh") (which "sh")))
5447 (invoke "./autogen.sh")
5448 (patch-makefile-SHELL "Makefile.include.in")
5451 ;; Make sure programs find libgpm.so.
5452 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
5453 (assoc-ref %outputs "out")
5456 `(("texinfo" ,texinfo)
5459 ("autoconf" ,autoconf)
5460 ("automake" ,automake)
5461 ("libtool" ,libtool)))
5462 (home-page "https://www.nico.schottelius.org/software/gpm/")
5463 (synopsis "Mouse support for the Linux console")
5465 "The GPM (general-purpose mouse) daemon is a mouse server for
5466 applications running on the Linux console. It allows users to select items
5467 and copy/paste text in the console and in xterm.")
5468 (license license:gpl2+)))
5470 (define-public btrfs-progs
5472 (name "btrfs-progs")
5476 (uri (string-append "mirror://kernel.org/linux/kernel/"
5477 "people/kdave/btrfs-progs/"
5478 "btrfs-progs-v" version ".tar.xz"))
5481 "1afpa8izagkr9sn5fqrm6687idiqdkcz08ks2j07972kd0rm5il5"))))
5482 (build-system gnu-build-system)
5484 "static")) ; static versions of the binaries in "out"
5486 '(#:phases (modify-phases %standard-phases
5487 (add-after 'unpack 'patch-makefile
5488 (lambda* (#:key outputs #:allow-other-keys)
5489 (substitute* "Makefile"
5490 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
5491 (string-append (assoc-ref outputs "out")
5492 "/lib/udev/rules.d")))))
5493 (add-after 'build 'build-static
5494 (lambda _ (invoke "make" "static")))
5495 (add-after 'install 'install-bash-completion
5496 (lambda* (#:key outputs #:allow-other-keys)
5497 (let* ((out (assoc-ref outputs "out"))
5498 (bashcomp (string-append out "/etc/bash_completion.d")))
5500 (copy-file "btrfs-completion"
5501 (string-append bashcomp "/btrfs")))))
5502 (add-after 'install 'install-static
5503 (let ((staticbin (string-append (assoc-ref %outputs "static")
5507 (string-append "bindir=" staticbin)
5508 "install-static")))))
5509 #:tests? #f ; XXX: require the 'btrfs' kernel module.
5510 #:test-target "test"
5511 #:parallel-tests? #f)) ; tests fail when run in parallel
5512 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
5514 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
5515 ("util-linux:static" ,util-linux "static") ;ditto
5517 ("zlib:static" ,zlib "static")
5518 ("zstd" ,zstd "lib")
5519 ("zstd:static" ,zstd "static")))
5520 (native-inputs `(("pkg-config" ,pkg-config)
5521 ("asciidoc" ,asciidoc)
5524 ;; Remove this input entirely when the default headers
5525 ;; version provides blk_zone.capacity (>= 5.9).
5526 ("linux-libre-headers" ,linux-libre-headers-5.10)
5527 ;; For building documentation.
5528 ("libxml2" ,libxml2)
5529 ("docbook-xsl" ,docbook-xsl)
5535 ;; The tests need 'grep' with perl regexp support.
5537 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
5538 (synopsis "Create and manage btrfs copy-on-write file systems")
5539 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
5540 aimed at implementing advanced features while focusing on fault tolerance,
5541 repair and easy administration.")
5542 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
5543 ;; GPL2: Everything else.
5544 (license (list license:gpl2 license:gpl2+))))
5546 (define-public btrfs-progs/static
5548 (name "btrfs-progs-static")
5549 (version (package-version btrfs-progs))
5551 (build-system trivial-build-system)
5553 `(("btrfs-progs:static" ,btrfs-progs "static")))
5555 `(#:modules ((guix build utils))
5558 (use-modules (guix build utils)
5562 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
5563 (out (assoc-ref %outputs "out"))
5564 (source (string-append btrfs "/bin/btrfs.static"))
5565 (target (string-append out "/bin/btrfs")))
5566 (mkdir-p (dirname target))
5567 (copy-file source target)
5568 (remove-store-references target)
5569 (chmod target #o555)
5571 (home-page (package-home-page btrfs-progs))
5572 (synopsis "Statically-linked btrfs command from btrfs-progs")
5573 (description "This package provides the statically-linked @command{btrfs}
5574 from the btrfs-progs package. It is meant to be used in initrds.")
5575 (license (package-license btrfs-progs))))
5577 (define-public cramfs-tools
5579 (name "cramfs-tools")
5580 (home-page "https://github.com/npitre/cramfs-tools")
5586 (commit (string-append "v" version))))
5588 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
5589 (file-name (git-file-name name version))))
5590 (build-system gnu-build-system)
5592 '(#:tests? #f ; No tests.
5594 (modify-phases %standard-phases
5597 (lambda* (#:key outputs #:allow-other-keys)
5598 (let ((out (assoc-ref outputs "out")))
5599 (install-file "mkcramfs" (string-append out "/sbin"))
5600 (install-file "cramfsck" (string-append out "/sbin")))
5604 (synopsis "Tools to manage Cramfs file systems")
5605 (description "Cramfs is a Linux file system designed to be simple, small,
5606 and to compress things well. It is used on a number of embedded systems and
5607 small devices. This version has additional features such as uncompressed
5608 blocks and random block placement.")
5609 (license license:gpl2+)))
5611 (define-public compsize
5615 (home-page "https://github.com/kilobyte/compsize")
5620 (commit (string-append "v" version))))
5622 (base32 "0vqnrwgpv6pc1yjl0g4gl71xyl6v0xl3pyqjanjpwps73c53azir"))
5623 (file-name (git-file-name name version))))
5624 (build-system gnu-build-system)
5626 `(("btrfs-progs" ,btrfs-progs)))
5628 `(#:tests? #f ; No tests.
5630 (list (string-append "CC=" ,(cc-for-target)))
5632 (modify-phases %standard-phases
5635 (lambda* (#:key outputs #:allow-other-keys)
5636 (let ((out (assoc-ref outputs "out")))
5637 (install-file "compsize" (string-append out "/bin"))
5638 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
5639 (synopsis "Find compression type/ratio on Btrfs files")
5640 (description "@command{compsize} takes a list of files (given as
5641 arguments) on a Btrfs file system and measures used compression types and
5642 effective compression ratio, producing a report.
5644 A directory has no extents but has a (recursive) list of files. A non-regular
5645 file is silently ignored.
5647 As it makes no sense to talk about compression ratio of a partial extent,
5648 every referenced extent is counted whole, exactly once -- no matter if you use
5649 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
5650 uncompressed size will not match the number given by @command{tar} or
5651 @command{du}. On the other hand, the space used should be accurate (although
5652 obviously it can be shared with files outside our set).")
5653 (license license:gpl2+)))
5655 (define-public f2fs-tools-1.7
5662 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5663 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5666 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
5668 (build-system gnu-build-system)
5670 `(#:configure-flags '("CFLAGS=-fcommon")
5672 (modify-phases %standard-phases
5673 (add-after 'install 'install-headers
5674 (lambda* (#:key outputs #:allow-other-keys)
5675 (let* ((out (assoc-ref outputs "out"))
5676 (out-include (string-append out "/include")))
5677 (install-file "include/f2fs_fs.h" out-include)
5678 (install-file "mkfs/f2fs_format_utils.h" out-include)
5681 `(("autoconf" ,autoconf)
5682 ("automake" ,automake)
5683 ("libtool" ,libtool)
5684 ("pkg-config" ,pkg-config)))
5686 `(("libuuid" ,util-linux "lib")
5687 ("libselinux" ,libselinux)))
5688 (home-page "https://f2fs.wiki.kernel.org/")
5689 (synopsis "Userland tools for f2fs")
5691 "F2FS, the Flash-Friendly File System, is a modern file system
5692 designed to be fast and durable on flash devices such as solid-state
5693 disks and SD cards. This package provides the userland utilities.")
5694 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
5695 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
5696 (license (list license:gpl2 license:lgpl2.1))))
5698 (define-public f2fs-tools
5700 (inherit f2fs-tools-1.7)
5706 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5707 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5710 "1lab1446c78xsjwhpki7s85z4171m8p9279c8yhm4882wba674k1"))))
5712 `(("libuuid" ,util-linux "lib")))))
5714 (define-public f2fs-tools/static
5717 (inherit f2fs-tools)
5718 (name "f2fs-tools-static")
5721 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
5722 (libuuid (assoc-ref %build-inputs "libuuid")))
5724 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
5725 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
5726 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
5727 "-I" libuuid "/include/blkid")
5728 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
5729 #:disallowed-references (,util-linux)
5731 (modify-phases %standard-phases ; TODO: f2fs phases.
5732 (add-after 'unpack 'make-static
5734 (define (append-to-file name body)
5735 (let ((file (open-file name "a")))
5738 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
5739 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
5740 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
5742 (add-after 'install 'remove-store-references
5743 (lambda* (#:key outputs #:allow-other-keys)
5744 ;; Work around bug in our util-linux.
5745 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
5746 (remove-store-references (string-append (assoc-ref outputs "out")
5750 `(("libuuid:static" ,util-linux "static")
5751 ("libuuid" ,util-linux "lib")))))) ; for include files
5753 (define-public f2fs-fsck/static
5755 (name "f2fs-fsck-static")
5756 (version (package-version f2fs-tools/static))
5758 (build-system trivial-build-system)
5760 `(#:modules ((guix build utils))
5763 (use-modules (guix build utils)
5766 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
5768 (out (assoc-ref %outputs "out"))
5769 (sbin (string-append out "/sbin")))
5771 (with-directory-excursion sbin
5772 (install-file (string-append f2fs-tools "/sbin/" fsck)
5774 (remove-store-references fsck)
5778 `(("f2fs-tools-static" ,f2fs-tools/static)))
5779 (home-page (package-home-page f2fs-tools/static))
5780 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5781 (description "This package provides statically-linked fsck.f2fs command taken
5782 from the f2fs-tools package. It is meant to be used in initrds.")
5783 (license (package-license f2fs-tools/static))))
5785 (define-public freefall
5788 (version (package-version linux-libre))
5789 (source (package-source linux-libre))
5790 (build-system gnu-build-system)
5792 '(#:phases (modify-phases %standard-phases
5793 (add-after 'unpack 'enter-subdirectory
5795 (chdir "tools/laptop/freefall")
5798 (add-before 'build 'increase-timeout
5800 ;; The default of 2 seconds is too low: it assumes an
5801 ;; open lid and AC power without actually checking.
5802 (substitute* "freefall.c"
5803 (("alarm\\(2\\)") "alarm(5)"))
5805 #:make-flags (list (string-append "PREFIX="
5806 (assoc-ref %outputs "out"))
5808 #:tests? #f)) ;no tests
5809 (home-page (package-home-page linux-libre))
5810 (synopsis "Free-fall protection for spinning laptop hard drives")
5812 "Prevents shock damage to the internal spinning hard drive(s) of some
5813 HP and Dell laptops. When sudden movement is detected, all input/output
5814 operations on the drive are suspended and its heads are parked on the ramp,
5815 where they are less likely to cause damage to the spinning disc. Requires a
5816 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5817 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5818 (license license:gpl2)))
5820 (define-public thinkfan
5828 (url "https://github.com/vmatare/thinkfan")
5830 (file-name (git-file-name name version))
5832 (base32 "01l1pnj1cgy3dwgyys2s5iqzyv6kk47vlpy09qjafk8py21ijik3"))))
5833 (build-system cmake-build-system)
5835 `(#:modules ((guix build cmake-build-system)
5838 #:tests? #f ; no test target
5840 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5841 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5843 `("-DUSE_ATASMART:BOOL=ON")
5845 (modify-phases %standard-phases
5846 (add-after 'unpack 'create-init-scripts
5847 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5848 ;; systemd to patch and install their service files. Fake their
5849 ;; presence rather than duplicating the build system below. Leave
5850 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5851 ;; The sysvinit needs manual patching, but since upstream doesn't
5852 ;; even provide the option to install it: don't.
5853 (lambda* (#:key outputs #:allow-other-keys)
5854 (let* ((out (assoc-ref outputs "out"))
5855 (share (string-append out "/share/" ,name)))
5856 (substitute* "CMakeLists.txt"
5857 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5858 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5859 ;; That was easy! Now we just need to fix the destinations.
5861 (string-append out directory)))
5864 `(("pkg-config" ,pkg-config)))
5866 `(("libatasmart" ,libatasmart)
5867 ("yaml-cpp" ,yaml-cpp)))
5868 (home-page "https://github.com/vmatare/thinkfan")
5869 (synopsis "Simple fan control program")
5871 "Thinkfan is a simple fan control program. It reads temperatures,
5872 checks them against configured limits and switches to appropriate (also
5873 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5874 other @code{hwmon} driver that enables temperature reading and fan control
5876 (license license:gpl3+)))
5878 (define-public tpacpi-bat
5886 (url "https://github.com/teleshoes/tpacpi-bat")
5887 (commit (string-append "v" version))))
5888 (file-name (git-file-name name version))
5890 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5891 (build-system gnu-build-system)
5893 `(#:tests? #f ; no test target
5895 (modify-phases %standard-phases
5896 (add-after 'unpack 'refer-to-inputs
5898 (substitute* "tpacpi-bat"
5900 (format #f "~a " (which "cat")))
5901 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5902 ;; loaded. That's the administrator's prerogative; disable it.
5903 (("system \"(modprobe .*)\"" _ match)
5904 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5906 (delete 'configure) ; nothing to configure
5907 (delete 'build) ; nothing to build
5909 (lambda* (#:key outputs #:allow-other-keys)
5910 (let* ((out (assoc-ref outputs "out"))
5911 (bin (string-append out "/bin"))
5912 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5913 (install-file "tpacpi-bat" bin)
5915 ;; There's no man page. Install other forms of documentation.
5916 (for-each (lambda (file)
5917 (let ((target (string-append doc "/" file)))
5918 (mkdir-p (dirname target))
5919 (copy-recursively file target)))
5920 (list "battery_asl" "examples" "README.md"))
5924 (home-page "https://github.com/teleshoes/tpacpi-bat")
5925 (synopsis "ThinkPad battery charge controller")
5927 "Tpacpi-bat is a command-line interface to control battery charging on
5928 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5929 ThinkPad models released after 2011}, starting with the xx20 series. It can
5930 query and set the thresholds at which one or both batteries will start and stop
5931 charging, inhibit charging batteries for a set period of time, or force them to
5932 discharge when they otherwise would not.
5934 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5935 kernel module provided by the @code{acpi-call-linux-module} package, which must
5936 be installed and loaded separately. Only the original vendor firmware is
5938 (license license:gpl3+)))
5943 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
5944 (version (package-version linux-libre))
5945 (source (package-source linux-libre))
5946 (build-system gnu-build-system)
5948 `(#:tests? #f ; no test suite
5950 (list (string-append "CC=" ,(cc-for-target))
5951 (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out"))
5954 (modify-phases %standard-phases
5955 (add-after 'unpack 'enter-subdirectory
5957 (chdir "tools/thermal/tmon")
5959 (add-after 'install 'install-man-page
5960 (lambda* (#:key outputs #:allow-other-keys)
5961 (let* ((out (assoc-ref outputs "out"))
5962 (man8 (string-append out "/share/man/man8")))
5963 (install-file "tmon.8" man8)
5965 (delete 'configure)))) ; no configure script
5967 `(("ncurses" ,ncurses)))
5968 (home-page (package-home-page linux-libre))
5969 (synopsis "Monitor and test the Linux thermal subsystem in real time")
5971 "Tmon is a tool to interact with the complex thermal subsystem of the
5972 kernel Linux. It helps visualize thermal relationships and real-time thermal
5973 data, tune and test cooling devices and sensors, and collect thermal data for
5976 As computers become smaller and more thermally constrained, more sensors are
5977 added and new cooling capabilities introduced. Thermal relationships can change
5978 dynamically. Their complexity grows exponentially among cooling devices, zones,
5979 sensors, and trip points.
5981 Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
5982 of symbolic links, trip point bindings, and device instances. To traverse it
5983 by hand is no trivial task: @command{tmon} aims to make it understandable.")
5984 (license (list license:gpl2 ; the man page
5985 license:gpl2+)))) ; the actual rest
5987 (define-public turbostat
5990 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
5991 ;; make it harder to benefit from ‘free’ linux-libre package updates.
5992 (version (package-version linux-libre))
5993 (source (package-source linux-libre))
5994 (build-system gnu-build-system)
5996 `(#:tests? #f ; no test suite
5998 (list (string-append "CC=" ,(cc-for-target))
5999 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6001 (modify-phases %standard-phases
6002 (add-after 'unpack 'enter-subdirectory
6004 (chdir "tools/power/x86/turbostat")
6006 (delete 'configure)))) ; no configure script
6008 `(("libcap" ,libcap)))
6009 (supported-systems '("i686-linux" "x86_64-linux"))
6010 (home-page (package-home-page linux-libre))
6011 (synopsis "Report x86 processor frequency and idle statistics")
6013 "Turbostat reports x86 processor topology, frequency, idle power state
6014 statistics, temperature, and power consumption. Some information is unavailable
6015 on older processors.
6017 It can be used to identify machines that are inefficient in terms of power usage
6018 or idle time, report the rate of @acronym{SMI, system management interrupt}s
6019 occurring on the system, or verify the effects of power management tuning.
6021 @command{turbostat} reads hardware counters but doesn't write to them, so it
6022 won't interfere with the OS or other running processes---including multiple
6023 invocations of itself.")
6024 (license license:gpl2)))
6026 (define-public ntfs-3g
6029 (version "2021.8.22")
6032 (uri (string-append "https://tuxera.com/opensource/"
6033 "ntfs-3g_ntfsprogs-" version ".tgz"))
6036 "1yrf42xr92qv3pads8lzp5nyssz6875ncfgg8v3jwjyr0nm87f2m"))
6037 (modules '((guix build utils)))
6039 ;; Install under $prefix.
6040 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
6044 (build-system gnu-build-system)
6045 (inputs `(("util-linux" ,util-linux) ; libuuid
6047 (native-inputs `(("pkg-config" ,pkg-config)))
6049 '(#:configure-flags (list "--disable-static"
6050 "--disable-ldconfig" ;not necessary
6051 "--exec-prefix=${prefix}"
6052 "--with-fuse=external" ;use our own FUSE
6053 "--enable-mount-helper"
6054 "--enable-posix-acls"
6055 "--enable-xattr-mappings")
6057 (modify-phases %standard-phases
6058 ;; If users install ntfs-3g, they probably want to make it the
6059 ;; default driver as well, so we opt for sensible defaults and link
6060 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
6061 ;; mount NTFS file systems.)
6062 (add-after 'install 'install-link
6063 (lambda* (#:key outputs #:allow-other-keys)
6064 (let* ((out (assoc-ref outputs "out"))
6065 (sbin (string-append out "/sbin")))
6066 (symlink "mount.ntfs-3g"
6067 (string-append sbin "/mount.ntfs")))
6069 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
6070 (synopsis "Read-write access to NTFS file systems")
6072 "NTFS-3G provides read-write access to NTFS file systems, which are
6073 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
6074 The package provides additional NTFS tools.")
6075 (license license:gpl2+)))
6077 (define-public ntfs-3g/static
6081 (name "ntfs-3g-static")
6083 (substitute-keyword-arguments (package-arguments ntfs-3g)
6084 ((#:configure-flags flags)
6086 (list "--enable-really-static"
6087 ;; The FUSE driver isn't currently used by our initrd.
6088 "--disable-ntfs-3g")))
6090 `(modify-phases ,phases
6091 (add-after 'unpack 'make-really-static-really-static
6093 (substitute* "ntfsprogs/Makefile.in"
6094 ((" -static") " -all-static"))))
6095 (delete 'install-link))))))))
6097 (define-public ntfsfix/static
6099 (name "ntfsfix-static")
6100 (version (package-version ntfs-3g/static))
6102 (build-system trivial-build-system)
6104 `(#:modules ((guix build utils))
6107 (use-modules (guix build utils))
6108 (let* ((ntfs-3g (assoc-ref %build-inputs "ntfs-3g"))
6109 (out (assoc-ref %outputs "out"))
6110 (bin (string-append out "/bin")))
6111 (install-file (string-append ntfs-3g "/bin/ntfsfix") bin)
6112 (with-directory-excursion bin
6113 (remove-store-references "ntfsfix"))))))
6115 `(("ntfs-3g" ,ntfs-3g/static)))
6116 (home-page (package-home-page ntfs-3g/static))
6117 (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
6119 "This package provides a statically linked @command{ntfsfix} taken
6120 from the ntfs-3g package. It is meant to be used in initrds.")
6121 (license (package-license ntfs-3g/static))))
6123 (define-public rdma-core
6129 (uri (string-append "https://github.com/linux-rdma/rdma-core"
6130 "/releases/download/v" version "/rdma-core-"
6134 "1rah0v9gq9rksqd2c17nmydsxcjz178n7m2y4ricwlf5pq1b2yfi"))))
6135 (build-system cmake-build-system)
6137 `(#:tests? #f ; no tests
6138 ;; Upstream uses the "ninja" build system and encourage distros
6139 ;; to do the same for consistency.
6140 #:configure-flags (list "-GNinja"
6142 (string-append "-DRST2MAN_EXECUTABLE="
6143 (assoc-ref %build-inputs
6147 (modify-phases %standard-phases
6151 "-j" (number->string (parallel-job-count)))))
6154 (invoke "ninja" "install"))))))
6157 ("pkg-config" ,pkg-config)
6158 ("python" ,python-wrapper)
6159 ("python-docutils" ,python-docutils))) ;for 'rst2man'
6163 (home-page "https://github.com/linux-rdma/rdma-core")
6164 (synopsis "Utilities and libraries for working with RDMA devices")
6166 "This package provides userspace components for the InfiniBand
6167 subsystem of the Linux kernel. Specifically it contains userspace
6168 libraries for the following device nodes:
6171 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
6172 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
6173 @item @file{/dev/infiniband/umadX} (@code{libibumad})
6176 The following service daemons are also provided:
6178 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
6179 @item @code{iwpmd} (for iWARP kernel providers)
6180 @item @code{ibacm} (for InfiniBand communication management assistant)
6182 ;; All library code is dual licensed under GPL2 and a custom MIT
6183 ;; variant. The package also includes some components covered by
6184 ;; other licenses. Consult COPYING.md for full details.
6187 (license:x11-style "See COPYING.BSD_MIT in the distribution")
6188 license:bsd-2 ; Files referring to COPYING.BSD_FB
6189 license:cc0 ; most files in ccan/
6190 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
6192 (define-public perftest
6199 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
6200 version "/perftest-" version ".g0927198.tar.gz"))
6202 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
6203 (build-system gnu-build-system)
6206 (modify-phases %standard-phases
6207 (add-after 'unpack 'patch-header-paths
6209 (substitute* '("src/raw_ethernet_fs_rate.c"
6210 "src/raw_ethernet_resources.c"
6211 "src/raw_ethernet_resources.h"
6212 "src/raw_ethernet_send_burst_lat.c"
6213 "src/raw_ethernet_send_bw.c"
6214 "src/raw_ethernet_send_lat.c")
6215 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
6217 (inputs `(("rdma-core" ,rdma-core)))
6218 (home-page "https://github.com/linux-rdma/perftest/")
6219 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
6220 (description "This is a collection of tests written over uverbs intended for
6221 use as a performance micro-benchmark. The tests may be used for hardware or
6222 software tuning as well as for functional testing.
6224 The collection contains a set of bandwidth and latency benchmark such as:
6226 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
6227 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
6228 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
6229 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
6230 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
6232 (license license:gpl2)))
6234 (define-public rng-tools
6237 (home-page "https://github.com/nhorman/rng-tools")
6241 (uri (git-reference (url home-page)
6242 (commit (string-append "v" version))))
6243 (file-name (git-file-name name version))
6246 "1hrbm4y7fbzkg5j2f7vpj19ri2ff2lp77al17fhi4mv0bvdfjd9m"))))
6247 (build-system gnu-build-system)
6249 `(;; Disable support for various hardware entropy sources as they need
6250 ;; dependencies that are not yet in Guix, and would significantly
6251 ;; increase closure size.
6252 #:configure-flags '("--without-nistbeacon"
6254 "--without-rtlsdr")))
6256 `(("autoconf" ,autoconf)
6257 ("automake" ,automake)
6258 ("pkg-config" ,pkg-config)))
6260 `(("libsysfs" ,sysfsutils)
6261 ("openssl" ,openssl)))
6262 (synopsis "Random number generator daemon")
6264 "Monitor a hardware random number generator, and supply entropy
6265 from that to the system kernel's @file{/dev/random} machinery.")
6266 ;; The source package is offered under the GPL2+, but the files
6267 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
6268 (license (list license:gpl2 license:gpl2+))))
6270 (define-public cpupower
6273 (version (package-version linux-libre))
6274 (source (package-source linux-libre))
6275 (build-system gnu-build-system)
6277 '(#:phases (modify-phases %standard-phases
6278 (add-after 'unpack 'enter-subdirectory
6280 (chdir "tools/power/cpupower")
6283 (add-before 'build 'fix-makefiles
6285 (substitute* "Makefile"
6287 (("/bin/(install|pwd)" _ command) command))
6288 (substitute* "bench/Makefile"
6289 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
6291 #:make-flags (let ((out (assoc-ref %outputs "out")))
6292 (list (string-append "DESTDIR=" out)
6293 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
6295 "docdir=/share/doc/cpupower"
6296 "confdir=$(docdir)/examples"
6297 ;; The Makefile recommends the following changes
6299 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
6300 #:tests? #f)) ;no tests
6301 (native-inputs `(("gettext" ,gettext-minimal)))
6302 (inputs `(("pciutils" ,pciutils)))
6303 (home-page (package-home-page linux-libre))
6304 (synopsis "CPU frequency and voltage scaling tools for Linux")
6306 "cpupower is a set of user-space tools that use the cpufreq feature of the
6307 Linux kernel to retrieve and control processor features related to power saving,
6308 such as frequency and voltage scaling.")
6309 (license license:gpl2)))
6311 (define-public x86-energy-perf-policy
6313 (name "x86-energy-perf-policy")
6314 (version (package-version linux-libre))
6315 (source (package-source linux-libre))
6316 (build-system gnu-build-system)
6320 (modify-phases %standard-phases
6321 (add-after 'unpack 'enter-subdirectory
6323 (chdir "tools/power/x86/x86_energy_perf_policy")
6326 (add-before 'build 'fix-makefile
6328 (substitute* "Makefile" (("/usr") ""))
6331 (let ((out (assoc-ref %outputs "out")))
6332 (list (string-append "DESTDIR=" out)
6333 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
6334 (supported-systems '("i686-linux" "x86_64-linux"))
6335 (home-page (package-home-page linux-libre))
6336 (synopsis "Display and update Intel-CPU energy-performance policy")
6338 "@command{x86_energy_perf_policy} displays and updates energy-performance
6339 policy settings specific to Intel Architecture Processors. Settings are
6340 accessed via Model Specific Register (MSR) updates, no matter if the Linux
6341 cpufreq sub-system is enabled or not.")
6342 (license license:gpl2)))
6344 (define-public haveged
6352 (url "https://github.com/jirka-h/haveged")
6353 (commit (string-append "v" version))))
6354 (file-name (git-file-name name version))
6356 (base32 "1zb790adsmqq3r26zlaxfrk2hpgxjcjz8l73hn3hli3l3javykvd"))))
6357 (build-system gnu-build-system)
6360 (list "--disable-static")))
6361 (home-page "https://www.issihosts.com/haveged")
6362 (synopsis "Entropy source for the Linux random number generator")
6364 "haveged generates an unpredictable stream of random numbers for use by
6365 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
6366 standard mechanisms for filling the entropy pool may not be sufficient for
6367 systems with high needs or limited user interaction, such as headless servers.
6369 @command{haveged} runs as a privileged daemon, harvesting randomness from the
6370 indirect effects of hardware events on hidden processor state using the
6371 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
6372 It tunes itself to its environment and provides the same built-in test suite
6373 for the output stream as used on certified hardware security devices.
6375 The quality of the randomness produced by this algorithm has not been proven.
6376 It is recommended to run it together with another entropy source like rngd, and
6377 not as a replacement for it.")
6378 (license (list (license:non-copyleft "file://nist/mconf.h")
6379 (license:non-copyleft "file://nist/packtest.c")
6380 license:public-domain ; nist/dfft.c
6381 license:gpl3+)))) ; everything else
6383 (define-public ecryptfs-utils
6385 (name "ecryptfs-utils")
6390 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
6391 version "/+download/ecryptfs-utils_"
6392 version ".orig.tar.gz"))
6395 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
6396 (build-system gnu-build-system)
6398 `(#:configure-flags (list "--disable-pywrap")
6400 (modify-phases %standard-phases
6401 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
6402 (lambda* (#:key inputs outputs #:allow-other-keys)
6403 (let ((out (assoc-ref outputs "out"))
6404 (utils-linux (assoc-ref inputs "utils-linux"))
6405 (cryptsetup (assoc-ref inputs "cryptsetup"))
6406 (linux-pam (assoc-ref inputs "linux-pam"))
6407 (lvm2 (assoc-ref inputs "lvm2")))
6408 (substitute* '("src/utils/ecryptfs-mount-private"
6409 "src/utils/ecryptfs-umount-private"
6410 "src/utils/ecryptfs-setup-private"
6411 "src/utils/ecryptfs-setup-swap"
6412 "src/utils/mount.ecryptfs.c"
6413 "src/utils/umount.ecryptfs.c"
6414 "src/pam_ecryptfs/pam_ecryptfs.c"
6415 "src/desktop/ecryptfs-mount-private.desktop.in"
6416 "src/desktop/ecryptfs-setup-private.desktop.in")
6418 (string-append utils-linux "/bin/mount"))
6420 (string-append utils-linux "/bin/umount"))
6421 (("/sbin/mount.ecryptfs_private")
6422 (string-append out "/sbin/mount.ecryptfs_private"))
6423 (("/sbin/umount.ecryptfs_private")
6424 (string-append out "/sbin/umount.ecryptfs_private"))
6425 (("/usr/bin/ecryptfs-mount-private")
6426 (string-append out "/bin/ecryptfs-mount-private"))
6427 (("/usr/bin/ecryptfs-rewrite-file")
6428 (string-append out "/bin/ecryptfs-rewrite-file"))
6429 (("/usr/bin/ecryptfs-setup-private")
6430 (string-append out "/bin/ecryptfs-setup-private"))
6431 (("/sbin/cryptsetup")
6432 (string-append cryptsetup "/sbin/cryptsetup"))
6433 (("/sbin/unix_chkpwd")
6434 (string-append linux-pam "/sbin/unix_chkpwd"))
6436 (string-append lvm2 "/sbin/dmsetup")))))))))
6438 `(("intltool" ,intltool)
6439 ("perl" ,perl) ; for pod2man
6440 ("pkg-config" ,pkg-config)))
6442 `(("keyutils" ,keyutils)
6443 ("linux-pam" ,linux-pam)
6444 ("utils-linux" ,util-linux)
6445 ("cryptsetup" ,cryptsetup)
6448 (home-page "https://ecryptfs.org/")
6449 (synopsis "eCryptfs cryptographic file system utilities")
6451 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
6452 Each file's cryptographic meta-data is stored inside the file itself, along
6453 with the encrypted contents. This allows individual encrypted files to be
6454 copied between hosts and still be decrypted with the proper key. eCryptfs is a
6455 native Linux file system, and has been part of the Linux kernel since version
6456 2.6.19. This package contains the userland utilities to manage it.")
6457 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
6458 ;; grant additional permission to link with OpenSSL.
6459 (license license:gpl2+)))
6461 (define-public libnfsidmap
6463 (name "libnfsidmap")
6468 (uri (string-append "https://fedorapeople.org/~steved/"
6469 name "/" version "/" name "-" version ".tar.bz2"))
6471 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
6472 (build-system gnu-build-system)
6474 `(#:configure-flags (list
6475 (string-append "--with-pluginpath="
6476 (assoc-ref %outputs "out")
6477 "/lib/libnfsidmap"))))
6479 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
6481 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
6482 (synopsis "NFSv4 support library for name/ID mapping")
6483 (description "Libnfsidmap is a library holding mulitiple methods of
6484 mapping names to ids and visa versa, mainly for NFSv4. It provides an
6485 extensible array of mapping functions, currently consisting of two choices:
6486 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
6487 (license (license:non-copyleft "file://COPYING"
6488 "See COPYING in the distribution."))))
6490 (define-public module-init-tools
6492 (name "module-init-tools")
6497 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
6498 "module-init-tools-" version ".tar.bz2"))
6501 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
6502 (patches (search-patches "module-init-tools-moduledir.patch"))))
6503 (build-system gnu-build-system)
6505 ;; FIXME: The upstream tarball lacks man pages, and building them would
6506 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
6507 ;; but they vanished. In the meantime, fake it.
6509 (modify-phases %standard-phases
6510 (add-before 'configure 'fake-docbook
6512 (substitute* "Makefile.in"
6513 (("^DOCBOOKTOMAN.*$")
6514 "DOCBOOKTOMAN = true\n"))
6516 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
6517 (synopsis "Tools for loading and managing Linux kernel modules")
6519 "Tools for loading and managing Linux kernel modules, such as
6520 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
6521 (license license:gpl2+)))
6523 (define-public mcelog
6531 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
6532 (commit (string-append "v" version))))
6533 (file-name (git-file-name name version))
6535 (base32 "1mlwn6ck9qiwqa2vg5wg1gvfva3jv7ygjr7p7bam0qszajs5pirk"))
6536 (modules '((guix build utils)))
6539 ;; The checkout lacks a .git directory, breaking ‘git describe’.
6540 (substitute* "Makefile"
6541 (("\"unknown\"") (string-append "\"v" ,version "\"")))
6543 (build-system gnu-build-system)
6545 `(#:phases (modify-phases %standard-phases
6546 (delete 'configure)) ; no configure script
6547 #:make-flags (let ((out (assoc-ref %outputs "out")))
6548 (list (string-append "CC=" ,(cc-for-target))
6549 (string-append "prefix=" out)
6550 (string-append "DOCDIR=" out "/share/doc/"
6552 "etcprefix=$(DOCDIR)/examples"))
6553 ;; The tests will only run as root on certain supported CPU models.
6555 (supported-systems (list "i686-linux" "x86_64-linux"))
6556 (home-page "https://mcelog.org/")
6557 (synopsis "Machine check monitor for x86 Linux systems")
6559 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
6560 systems running the kernel Linux. It can also perform user-defined tasks, such
6561 as bringing bad pages off-line, when configurable error thresholds are
6563 (license license:gpl2)))
6565 (define-public mtd-utils
6572 "ftp://ftp.infradead.org/pub/mtd-utils/"
6573 "mtd-utils-" version ".tar.bz2"))
6576 "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
6578 '(#:configure-flags '("--enable-unit-tests")))
6580 `(("cmocka" ,cmocka)
6581 ("pkg-config" ,pkg-config)))
6583 `(("acl" ,acl) ; extended attributes (xattr)
6584 ("libuuid" ,util-linux "lib")
6586 ("openssl" ,openssl) ; optional crypto support
6588 ("zstd" ,zstd "lib")))
6589 (build-system gnu-build-system)
6590 (synopsis "MTD Flash Storage Utilities")
6591 (description "This package provides utilities for testing, partitioning, etc
6593 (home-page "http://www.linux-mtd.infradead.org/")
6595 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
6596 license:mpl1.1 ; All ftl* files
6597 license:expat)))) ; libiniparser
6599 (define-public libseccomp
6605 (uri (string-append "https://github.com/seccomp/libseccomp/"
6606 "releases/download/v" version
6607 "/libseccomp-" version ".tar.gz"))
6610 "1pw7rd4gwqpmraipgdqkdkhnx4ql35wrn3lnjgl6pncinkgm59hp"))))
6611 (build-system gnu-build-system)
6613 '(#:configure-flags '("--disable-static")
6614 #:phases (modify-phases %standard-phases
6615 (add-before 'check 'skip-load-test
6617 ;; This test does a native system call and fails when
6618 ;; run under QEMU user-mode emulation. Just skip it.
6619 (delete-file "tests/52-basic-load.tests"))))))
6623 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
6624 (description "The libseccomp library provides an easy to use, platform
6625 independent, interface to the Linux Kernel's syscall filtering mechanism. The
6626 libseccomp API is designed to abstract away the underlying BPF based syscall
6627 filter language and present a more conventional function-call based filtering
6628 interface that should be familiar to, and easily adopted by, application
6630 (home-page "https://github.com/seccomp/libseccomp")
6631 (license license:lgpl2.1)))
6633 (define-public radeontop
6641 (url "https://github.com/clbr/radeontop")
6642 (commit (string-append "v" version))))
6643 (file-name (git-file-name name version))
6645 (base32 "0ay6vl9zsz9b2scy0fnsy482pzizj52i27syxwny4z4i9wrk2wmn"))))
6646 (build-system gnu-build-system)
6648 `(#:phases (modify-phases %standard-phases
6649 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
6650 ;; dependency, and doesn't even work on release(!) tarballs.
6651 (add-after 'unpack 'report-correct-version
6653 (substitute* "getver.sh"
6655 (string-append "ver=" ,version)))
6657 (delete 'configure)) ; no configure script
6658 #:make-flags (list "CC=gcc"
6659 (string-append "PREFIX=" %output))
6660 #:tests? #f)) ; no tests
6662 `(("gettext" ,gettext-minimal)
6663 ("pkg-config" ,pkg-config)))
6665 `(("libdrm" ,libdrm)
6666 ("libpciaccess" ,libpciaccess)
6668 ("ncurses" ,ncurses)))
6669 (home-page "https://github.com/clbr/radeontop/")
6670 (synopsis "Usage monitor for AMD Radeon graphics")
6671 (description "RadeonTop monitors resource consumption on supported AMD
6672 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
6673 a terminal or saved to a file for further processing. It measures both the
6674 activity of the GPU as a whole, which is also accurate during OpenCL
6675 computations, as well as separate component statistics that are only meaningful
6676 under OpenGL graphics workloads.")
6677 (license license:gpl3)))
6679 (define-public efivar
6685 (uri (string-append "https://github.com/rhboot/" name
6686 "/releases/download/" version "/" name
6687 "-" version ".tar.bz2"))
6688 (patches (search-patches "efivar-gcc-compat.patch"))
6691 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))
6692 (modules '((guix build utils)))
6695 ;; Compile everything within a single LTO partition
6696 ;; to work around ordering issues in the code. Try
6697 ;; removing this for versions > 37.
6698 (substitute* "Make.defaults"
6700 "-flto -flto-partition=one"))))))
6701 (build-system gnu-build-system)
6703 `(;; Tests require a UEFI system and is not detected in the chroot.
6705 #:make-flags (list (string-append "prefix=" %output)
6706 (string-append "libdir=" %output "/lib")
6707 (string-append "CC_FOR_BUILD=" ,(cc-for-target))
6708 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6710 (modify-phases %standard-phases
6711 (delete 'configure))))
6713 `(("pkg-config" ,pkg-config)))
6716 (home-page "https://github.com/rhboot/efivar")
6717 (synopsis "Tool and library to manipulate EFI variables")
6718 (description "This package provides a library and a command line
6719 interface to the variable facility of UEFI boot firmware.")
6720 (license license:lgpl2.1+)))
6722 (define-public efibootmgr
6730 (url "https://github.com/rhinstaller/efibootmgr")
6732 (file-name (git-file-name name version))
6734 (base32 "1niicijxg59rsmiw3rsjwy4bvi1n42dynvm01lnp9haixdzdpq03"))
6735 (patches (search-patches "efibootmgr-remove-extra-decl.patch"))))
6736 (build-system gnu-build-system)
6738 `(#:tests? #f ;no tests
6739 #:make-flags (list (string-append "prefix=" %output)
6740 (string-append "libdir=" %output "/lib")
6741 ;; EFIDIR denotes a subdirectory relative to the
6742 ;; EFI System Partition where the loader will be
6743 ;; installed (known as OS_VENDOR in the code).
6744 ;; GRUB overrides this, as such it's only used if
6745 ;; nothing else is specified on the command line.
6747 #:phases (modify-phases %standard-phases (delete 'configure))))
6749 `(("pkg-config" ,pkg-config)))
6751 `(("efivar" ,efivar)
6753 (home-page "https://github.com/rhinstaller/efibootmgr")
6754 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
6756 "@code{efibootmgr} is a user-space application to modify the Intel
6757 Extensible Firmware Interface (EFI) Boot Manager. This application can
6758 create and destroy boot entries, change the boot order, change the next
6759 running boot option, and more.")
6760 (license license:gpl2+)))
6762 (define-public sysstat
6769 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6770 "sysstat-" version ".tar.xz"))
6772 (base32 "1z8bdyj92q0capbrdscwzb51bqh54ng15gpvmjmvrb2syhqj8hxf"))))
6773 (build-system gnu-build-system)
6775 `(#:tests? #f ; no test suite.
6776 ;; Without this flag, it tries to install the man pages with group 'root'
6777 ;; and fails because /etc/passwd lacks an entry for the root user.
6779 (list "--disable-file-attr"
6780 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
6782 (modify-phases %standard-phases
6783 ;; The build process tries to create '/var/lib/sa', so we skip that
6785 (add-after 'build 'skip-touching-var
6787 (substitute* "Makefile"
6788 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
6791 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
6792 (synopsis "Performance monitoring tools for Linux")
6793 (description "The sysstat utilities are a collection of performance
6794 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
6795 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
6796 @code{sadf} and @code{sa}.")
6797 (license license:gpl2+)))
6799 (define-public light
6807 (url "https://github.com/haikarainen/light")
6808 (commit (string-append "v" version))))
6810 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
6811 (file-name (git-file-name name version))))
6812 (build-system gnu-build-system)
6814 `(#:configure-flags '("CFLAGS=-fcommon")
6816 (modify-phases %standard-phases
6817 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
6818 (lambda* (#:key inputs #:allow-other-keys)
6819 (substitute* "90-backlight.rules"
6820 (("/bin/chgrp") (which "chgrp"))
6821 (("/bin/chmod") (which "chmod")))
6823 (add-after 'install 'install-udev-rules
6824 (lambda* (#:key outputs #:allow-other-keys)
6825 (let ((out (assoc-ref outputs "out")))
6827 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
6830 `(("autoconf" ,autoconf)
6831 ("automake" ,automake)))
6832 (home-page "https://haikarainen.github.io/light/")
6833 (synopsis "GNU/Linux application to control backlights")
6835 "Light is a program to send commands to screen backlight controllers
6836 under GNU/Linux. Features include:
6839 @item It does not rely on X.
6840 @item Light can automatically figure out the best controller to use, making
6841 full use of underlying hardware.
6842 @item It is possible to set a minimum brightness value, as some controllers
6843 set the screen to be pitch black at a value of 0 (or higher).
6845 (license license:gpl3+)))
6847 (define-public brightnessctl
6849 (name "brightnessctl")
6851 (home-page "https://github.com/Hummer12007/brightnessctl")
6854 (uri (git-reference (url home-page) (commit version)))
6855 (file-name (git-file-name name version))
6858 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
6859 (patches (search-patches "brightnessctl-elogind-support.patch"))))
6860 (build-system gnu-build-system)
6862 `(#:tests? #f ; no tests
6863 #:make-flags (list (string-append "CC=" ,(cc-for-target))
6864 (string-append "PREFIX=" %output)
6865 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
6868 (modify-phases %standard-phases
6870 (add-after 'unpack 'adjust-udev-rules
6872 (substitute* "Makefile"
6873 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
6874 (substitute* "90-brightnessctl.rules"
6875 (("/bin/") "/run/current-system/profile/bin/"))
6878 `(("pkg-config" ,pkg-config)))
6880 `(("elogind" ,elogind)))
6881 (synopsis "Backlight and LED brightness control")
6883 "This program allows you read and control device brightness. Devices
6884 include backlight and LEDs. It can also preserve current brightness before
6885 applying the operation, such as on lid close.
6887 The appropriate permissions must be set on the backlight or LED control
6888 interface in sysfs, which can be accomplished with the included udev rules.")
6889 (license license:expat)))
6899 (url "https://github.com/linrunner/TLP")
6901 (file-name (git-file-name name version))
6903 (base32 "0bnsz9bw9rj1apl80jwz39zj5mnlps3jbckihvl8bbdbrbhj6p06"))))
6905 `(("shellcheck" ,shellcheck)))
6909 ("ethtool" ,ethtool)
6913 ("inetutils" ,inetutils)
6916 ("pciutils" ,pciutils)
6920 ("usbutils" ,usbutils)
6921 ("util-linux" ,util-linux)
6922 ("wireless-tools" ,wireless-tools)
6923 ,@(if (let ((system (or (%current-target-system)
6924 (%current-system))))
6925 (or (string-prefix? "i686-" system)
6926 (string-prefix? "x86_64-" system)))
6927 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
6929 (build-system gnu-build-system)
6931 ;; XXX: The full test suite is run with "checkall" but it requires
6932 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
6933 `(#:test-target "shellcheck"
6934 #:modules ((guix build gnu-build-system)
6938 (modify-phases %standard-phases
6939 (delete 'configure) ; no configure script
6940 (add-before 'build 'setenv
6941 (lambda* (#:key outputs #:allow-other-keys)
6942 (let ((out (assoc-ref outputs "out")))
6943 (setenv "TLP_WITH_SYSTEMD" "0")
6944 (setenv "TLP_NO_INIT" "1")
6945 (setenv "TLP_NO_PMUTILS" "1")
6946 (setenv "TLP_SBIN" (string-append out "/bin"))
6947 (setenv "TLP_BATD" (string-append out "/share/tlp/bat.d"))
6948 (setenv "TLP_BIN" (string-append out "/bin"))
6949 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
6950 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
6951 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
6952 (setenv "TLP_CONFDEF"
6953 (string-append out "/share/tlp/defaults.conf"))
6954 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
6955 (setenv "TLP_CONFREN"
6956 (string-append out "/share/tlp/rename.conf"))
6958 (string-append out "/lib/elogind/system-sleep"))
6960 (string-append out "/share/bash-completion/completions"))
6961 (setenv "TLP_MAN" (string-append out "/share/man"))
6962 (setenv "TLP_META" (string-append out "/share/metainfo"))
6964 (add-before 'install 'fix-installation
6966 ;; Stop the Makefile from trying to create system directories.
6967 (substitute* "Makefile"
6968 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6969 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6972 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6973 (add-after 'install 'wrap
6974 (lambda* (#:key inputs outputs #:allow-other-keys)
6975 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6976 (bin-files (find-files bin ".*")))
6977 (define (bin-directory input-name)
6978 (let ((p (assoc-ref inputs input-name)))
6979 (and p (string-append p "/bin"))))
6980 (define (sbin-directory input-name)
6981 (string-append (assoc-ref inputs input-name) "/sbin"))
6982 (for-each (lambda (program)
6983 (wrap-program program
6986 (filter-map bin-directory
6998 "x86-energy-perf-policy"))
6999 (filter-map sbin-directory
7005 "wireless-tools"))))))
7008 (home-page "https://linrunner.de/en/tlp/tlp.html")
7009 (synopsis "Power management tool for Linux")
7010 (description "TLP is a power management tool for Linux. It comes with
7011 a default configuration already optimized for battery life. Nevertheless,
7012 TLP is customizable to fulfil system requirements. TLP settings are applied
7013 every time the power supply source is changed.")
7014 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
7016 (license (list license:gpl2+ license:gpl3+))))
7021 (version "B.02.19.2")
7024 (uri (string-append "https://www.ezix.org/software/"
7025 "files/lshw-" version
7029 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
7030 (build-system gnu-build-system)
7032 `(#:phases (modify-phases %standard-phases (delete 'configure))
7033 #:tests? #f ; no tests
7035 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
7036 (synopsis "List hardware information")
7038 "@command{lshw} (Hardware Lister) is a small tool to provide
7039 detailed information on the hardware configuration of the machine.
7040 It can report exact memory configuration, firmware version, mainboard
7041 configuration, CPU version and speed, cache configuration, bus speed,
7042 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
7043 machines (PowerMac G4 is known to work).")
7044 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
7045 (license license:gpl2+)))
7047 (define-public libmnl
7054 (uri (string-append "mirror://netfilter.org/libmnl/"
7055 "libmnl-" version ".tar.bz2"))
7058 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
7059 (build-system gnu-build-system)
7060 (home-page "https://www.netfilter.org/projects/libmnl/")
7061 (synopsis "Netlink utility library")
7062 (description "Libmnl is a minimalistic user-space library oriented to
7063 Netlink developers. There are a lot of common tasks in parsing, validating,
7064 constructing of both the Netlink header and TLVs that are repetitive and easy to
7065 get wrong. This library aims to provide simple helpers that allows you to
7066 re-use code and to avoid re-inventing the wheel.")
7067 (license license:lgpl2.1+)))
7069 (define-public libnftnl
7076 (uri (string-append "mirror://netfilter.org/libnftnl/"
7077 "libnftnl-" version ".tar.bz2"))
7079 (base32 "1xblq1cbcxhr6qmjpy98i1qdza148idgz99vbhjc7s4vzvfizc4h"))))
7080 (build-system gnu-build-system)
7082 `(("pkg-config" ,pkg-config)))
7084 `(("libmnl" ,libmnl)))
7085 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
7086 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
7087 (description "Libnftnl is a userspace library providing a low-level netlink
7088 programming interface to the in-kernel nf_tables subsystem. The library
7089 libnftnl has been previously known as libnftables. This library is currently
7091 (license license:gpl2+)))
7093 (define-public nftables
7100 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
7102 (string-append "https://www.nftables.org/projects/nftables"
7103 "/files/nftables-" version ".tar.bz2")))
7105 (base32 "1x25zs2czmn14mmq1nqi4zibsvh04vqjbx5lxj42nylnmxym9gsq"))))
7106 (build-system gnu-build-system)
7107 (arguments `(#:configure-flags
7108 '("--disable-man-doc" ; FIXME: needs docbook2x
7109 "--disable-static")))
7110 (inputs `(("gmp" ,gmp)
7112 ("libnftnl" ,libnftnl)
7113 ("readline" ,readline)))
7114 (native-inputs `(("pkg-config" ,pkg-config)
7117 (home-page "https://www.nftables.org")
7118 (synopsis "Userspace utility for Linux packet filtering")
7119 (description "nftables is the project that aims to replace the existing
7120 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
7121 filtering framework, a new userspace utility and also a compatibility layer for
7122 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
7123 infrastructure such as the existing hooks, the connection tracking system, the
7124 userspace queueing component and the logging subsystem.")
7125 (license license:gpl2)))
7127 (define-public proot
7128 (let ((revision "0")
7129 (commit "a70023ab3db47d011265451b99a1abef7b9d7afc"))
7132 ;; The last stable release was made in 2015, and fails to build for the
7133 ;; aarch64 platform. Use the latest commit, which includes fixes for
7134 ;; the supported ARM architectures and the test suite, among others.
7135 (version (git-version "5.2.0-alpha" revision commit))
7140 (url "https://github.com/proot-me/PRoot")
7141 (commit (string-append commit))))
7142 (file-name (git-file-name name version))
7144 (base32 "1kmry3rb967phxnxjfnx310gy1d4gpmjd6fp3hbm9v9jciysxy4z"))))
7145 (build-system gnu-build-system)
7146 ;; The powerpc64le-linux and mips64el-linux architectures are not
7148 ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
7149 (supported-systems '("x86_64-linux" "i686-linux"
7150 "armhf-linux" "aarch64-linux" "i586-gnu"))
7152 ;; Disable the test suite on armhf-linux, as there are too many
7153 ;; failures to keep track of (see for example:
7154 ;; https://github.com/proot-me/proot/issues/286).
7155 `(#:tests? ,(not (string-prefix? "armhf"
7156 (or (%current-target-system)
7157 (%current-system))))
7158 #:make-flags '("-C" "src")
7159 #:phases (modify-phases %standard-phases
7160 (add-after 'unpack 'patch-sources
7161 (lambda* (#:key inputs #:allow-other-keys)
7162 (substitute* (find-files "src" "\\.[ch]$")
7164 (string-append "\"" (assoc-ref inputs "bash")
7167 (substitute* "src/GNUmakefile"
7168 (("/bin/echo") (which "echo"))
7170 (string-append "VERSION := " ,version "\n")))
7172 (substitute* (find-files "test" "\\.sh$")
7173 ;; Some of the tests try to "bind-mount" /bin/true.
7175 (string-append "-b " (which "true") ":"))
7176 ;; Likewise for /bin.
7177 (("-b /bin:") "-b /gnu:")
7178 ;; Others try to run /bin/sh.
7179 (("/bin/sh") (which "sh"))
7180 ;; Others assume /etc/fstab exists.
7181 (("/etc/fstab") "/etc/passwd"))
7182 (substitute* "test/GNUmakefile"
7183 (("-b /bin:") "-b /gnu:"))
7184 (substitute* "test/test-c6b77b77.mk"
7185 (("/bin/bash") (which "bash"))
7186 (("/usr/bin/test") (which "test")))
7187 (substitute* "test/test-16573e73.c"
7188 (("/bin/([a-z-]+)" _ program)
7190 (substitute* "test/test-d2175fc3.sh"
7191 (("\\^/bin/true\\$") "$(which true)"))
7192 (substitute* "test/test-5467b986.sh"
7193 (("-w /usr") "-w /gnu")
7194 (("-w usr") "-w gnu")
7195 (("/usr/share") "/gnu/store")
7196 (("share") "store"))
7197 (substitute* "test/test-092c5e26.sh"
7199 "-q $(which echo) "))
7201 ;; The following tests are known to fail (see:
7202 ;; https://github.com/proot-me/proot/issues/184).
7203 (delete-file "test/test-0228fbe7.sh")
7204 (delete-file "test/test-2db65cd2.sh")
7205 (delete-file "test/test-cdd39012.sh")
7206 (delete-file "test/test-d92b57ca.sh")
7208 ;; This one fails on a waitpid call that returns 1 (see:
7209 ;; https://github.com/proot-me/proot/issues/261).
7210 (delete-file "test/test-ptrace01.c")
7212 ;; XXX: This test fails in an obscure corner case, just
7214 (delete-file "test/test-kkkkkkkk.c")
7216 ;; This one requires Docker.
7217 (delete-file "test/test-docker.sh")
7219 ;; The socket tests requires networking.
7220 (for-each delete-file
7221 (find-files "test" "test-socket.*\\.sh$"))))
7223 (add-after 'build 'build-manpage
7225 (with-directory-excursion "doc"
7226 (invoke "make" "proot/man.1" "SUFFIX=.py"))))
7228 (lambda* (#:key tests? #:allow-other-keys)
7230 (let ((n (parallel-job-count)))
7231 ;; Most of the tests expect "/bin" to be in $PATH so
7232 ;; they can run things that live in $ROOTFS/bin.
7234 (string-append (getenv "PATH") ":/bin"))
7235 (invoke "make" "check" "-C" "test"
7237 "-j" (number->string n))))))
7239 (lambda* (#:key outputs #:allow-other-keys)
7240 ;; The 'install' rule does nearly nothing.
7241 (let* ((out (assoc-ref outputs "out"))
7242 (man1 (string-append out "/share/man/man1")))
7243 ;; TODO: 'make install-care' (does not even
7244 ;; build currently.)
7245 (invoke "make" "-C" "src" "install"
7246 (string-append "PREFIX=" out))
7248 (copy-file "doc/proot/man.1"
7249 (string-append man1 "/proot.1"))))))))
7250 (native-inputs `(("which" ,which)
7251 ;; For 'mcookie', used by some of the tests.
7252 ("util-linux" ,util-linux)
7253 ("coreutils" ,coreutils)
7254 ("pkg-config" ,pkg-config)
7255 ;; For rst2man, used to generate the manual page.
7256 ("python-docutils" ,python-docutils)))
7257 (inputs `(("libarchive" ,libarchive)
7258 ("talloc" ,talloc)))
7259 (home-page "https://github.com/proot-me/PRoot")
7260 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
7262 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
7263 and @code{binfmt_misc}. This means that users don't need any privileges or
7264 setup to do things like using an arbitrary directory as the new root
7265 file system, making files accessible somewhere else in the file system
7266 hierarchy, or executing programs built for another CPU architecture
7267 transparently through QEMU user-mode. Also, developers can use PRoot as a
7268 generic process instrumentation engine thanks to its extension mechanism.
7269 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
7270 available in the kernel Linux.")
7271 (license license:gpl2+))))
7273 (define-public proot-static
7276 (name "proot-static")
7278 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
7279 (inputs `(("talloc" ,talloc/static)))
7281 (substitute-keyword-arguments (package-arguments proot)
7282 ((#:make-flags flags)
7283 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
7285 `(modify-phases ,phases
7286 (add-after 'strip 'remove-store-references
7287 (lambda* (#:key outputs #:allow-other-keys)
7288 (let* ((out (assoc-ref outputs "out")))
7289 (with-directory-excursion out
7290 (remove-store-references "bin/proot")
7292 ((#:allowed-references _ '("out"))
7295 (define-public cpuid
7298 (version "20201006")
7301 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
7302 version ".src.tar.gz"))
7305 "19jnkh57f979b78ak5mpxmdvnkgc33r55cw9shgd2hc380b3zi8k"))))
7306 (build-system gnu-build-system)
7309 (list (string-append "CC=" ,(cc-for-target)))
7310 #:tests? #f ; no tests
7311 #:phases (modify-phases %standard-phases
7312 (delete 'configure) ; no configure script
7313 (add-before 'install 'fix-makefile
7314 (lambda* (#:key outputs #:allow-other-keys)
7315 (substitute* "Makefile"
7316 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
7317 ;; Make the compressed manpages writable so that the
7318 ;; reset-gzip-timestamps phase does not error out.
7319 (substitute* "Makefile"
7320 (("-m 444") "-m 644"))
7322 (inputs `(("perl" ,perl)))
7323 (supported-systems '("i686-linux" "x86_64-linux"))
7324 (home-page "http://www.etallen.com/cpuid.html")
7325 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
7326 (description "cpuid dumps detailed information about the CPU(s) gathered
7327 from the CPUID instruction, and also determines the exact model of CPU(s). It
7328 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
7329 NexGen, Rise, and SiS CPUs.")
7330 (license license:gpl2+)))
7332 (define-public jmtpfs
7340 (url "https://github.com/JasonFerrara/jmtpfs")
7341 (commit (string-append "v" version))))
7342 (file-name (git-file-name name version))
7345 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
7346 (build-system gnu-build-system)
7350 ("libmtp" ,libmtp)))
7352 `(("pkg-config" ,pkg-config)))
7353 (home-page "https://github.com/JasonFerrara/jmtpfs")
7354 (synopsis "Use a FUSE file system to access data over MTP")
7355 (description "jmtpfs uses FUSE (file system in userspace) to provide access
7356 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
7357 the MTP device as a file system.")
7358 (license license:gpl3)))
7360 (define-public procenv
7368 (url "https://github.com/jamesodhunt/procenv")
7370 (file-name (git-file-name name version))
7372 (base32 "137n630qzml4yraqzp2fij8nzn8341nf8d58yzfhk8ddlzi60sfm"))))
7373 (build-system gnu-build-system)
7375 `(("pkg-config" ,pkg-config)
7383 ("libselinux" ,libselinux)))
7384 (synopsis "Utility to show process environment")
7386 "Procenv is a command-line tool that displays as much detail about
7387 itself and its environment as possible. It can be used as a test
7388 tool, to understand the type of environment a process runs in, and for
7389 comparing system environments.")
7390 (home-page "https://github.com/jamesodhunt/procenv/")
7391 (license license:gpl3+)))
7393 (define-public libfabric
7401 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
7402 version "/libfabric-" version ".tar.bz2"))
7404 (base32 "1nnpfkwxhim2nqjkb1vwrb4wj4j3l6w6yvvy69fqam2snlhshazz"))))
7405 (build-system gnu-build-system)
7406 (inputs `(("rdma-core" ,rdma-core)
7407 ,@(match (%current-system)
7408 ((member (package-supported-systems psm))
7412 (home-page "https://ofiwg.github.io/libfabric/")
7413 (synopsis "Open Fabric Interfaces")
7415 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
7416 communication services to applications. OFI is best described as a collection
7417 of libraries and applications used to export fabric services. The key
7418 components of OFI are: application interfaces, provider libraries, kernel
7419 services, daemons, and test applications.
7421 Libfabric is a core component of OFI. It is the library that defines and
7422 exports the user-space API of OFI, and is typically the only software that
7423 applications deal with directly. It works in conjunction with provider
7424 libraries, which are often integrated directly into libfabric.")
7425 (license (list license:bsd-2 license:gpl2)))) ;dual
7430 (version "3.3.20170428")
7431 (home-page "https://github.com/intel/psm")
7435 (uri (git-reference (url home-page)
7436 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
7437 (file-name (string-append "psm-" version ".tar.gz"))
7439 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
7440 (patches (search-patches
7441 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
7442 "psm-ldflags.patch" ; build shared lib with LDFLAGS
7443 "psm-repro.patch" ; reproducibility
7444 "psm-disable-memory-stats.patch"))))
7445 (build-system gnu-build-system)
7446 (outputs '("out" "debug"))
7447 (inputs `(("libuuid" ,util-linux "lib")))
7449 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
7450 ,(string-append "INSTALL_PREFIX=" %output)
7451 ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
7452 " -funwind-tables -O3 -g3"
7453 " -DPSM_USE_SYS_UUID"
7454 " -Wno-strict-aliasing -DNVALGRIND"
7456 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
7458 #:phases (modify-phases %standard-phases
7460 (add-after 'unpack 'patch-/usr/include
7462 (substitute* "Makefile"
7463 (("\\$\\{DESTDIR}/usr/include")
7464 (string-append %output "/include")))
7465 (substitute* "Makefile"
7466 (("/lib64") "/lib"))
7468 (add-after 'unpack 'patch-sysmacros
7470 (substitute* "ipath/ipath_proto.c"
7471 (("#include <sys/poll.h>" m)
7472 (string-append m "\n"
7473 "#include <sys/sysmacros.h>")))
7475 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
7477 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
7478 communications interface for the True Scale family of products. PSM users are
7479 enabled with mechanisms necessary to implement higher level communications
7480 interfaces in parallel environments.")
7481 ;; Only Intel-compatable processors are supported.
7482 (supported-systems '("i686-linux" "x86_64-linux"))
7483 (license (list license:bsd-2 license:gpl2)))) ;dual
7485 (define-public snapscreenshot
7487 (name "snapscreenshot")
7488 (version "1.0.14.3")
7492 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
7493 name "-" version ".tar.bz2"))
7495 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
7496 (build-system gnu-build-system)
7499 (let ((out (assoc-ref %outputs "out")))
7500 (list (string-append "BINDIR=" out "/bin")
7501 (string-append "MANDIR=" out "/share/man")))
7502 #:tests? #f ; no test suite
7504 (modify-phases %standard-phases
7505 (delete 'configure) ; ./configure is a snarky no-op
7506 (add-before 'install 'fix-ownership
7507 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
7509 (substitute* "depfun.mak"
7510 ((" -o bin -g bin ") " "))
7512 (add-before 'install 'create-output-directories
7513 (lambda* (#:key outputs #:allow-other-keys)
7514 (let ((out (assoc-ref outputs "out")))
7515 (mkdir-p (string-append out "/share/man/man1"))
7517 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
7518 (synopsis "Take screenshots of one or more Linux text consoles")
7520 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
7521 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
7522 relevant @file{/dev/vcs*} file(s).")
7523 (license license:gpl2)))
7525 (define-public fbcat
7532 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
7533 version "/" name "-" version ".tar.gz"))
7535 (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
7536 (build-system gnu-build-system)
7538 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
7539 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
7540 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
7541 `(("pnmtopng" ,netpbm)))
7542 (outputs (list "out" "fbgrab"))
7546 (string-append "PREFIX=" (assoc-ref %outputs "out")))
7547 #:tests? #f ; no tests
7549 (modify-phases %standard-phases
7550 (delete 'configure) ; no configure script
7551 (add-after 'build 'qualify-references
7552 (lambda* (#:key inputs outputs #:allow-other-keys)
7553 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
7554 (out (assoc-ref outputs "out")))
7555 (substitute* "fbgrab"
7557 (string-append out "/bin/" all))
7559 (string-append pnmtopng "/bin/" all))))))
7560 (add-after 'install 'split-fbgrab-output
7561 (lambda* (#:key outputs #:allow-other-keys)
7562 (let* ((out (assoc-ref outputs "out"))
7563 (out:fbgrab (assoc-ref outputs "fbgrab")))
7564 (for-each (lambda (file)
7565 (let ((old (string-append out "/" file))
7566 (new (string-append out:fbgrab "/" file)))
7567 (mkdir-p (dirname new))
7568 (rename-file old new)))
7570 "share/man/man1/fbgrab.1"))))))))
7571 (home-page "https://jwilk.net/software/fbcat")
7572 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
7574 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
7575 a dump therof. It supports a wide range of drivers and pixel formats.
7576 @command{fbcat} can take screenshots of virtually any application that can be
7577 made to write its output to the framebuffer, including (but not limited to)
7578 text-mode or graphical applications that don't use a display server.
7580 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
7581 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
7582 (license license:gpl2)))
7584 (define-public libcgroup
7592 "mirror://sourceforge/libcg/" name "/"
7593 version "/" name "-" version ".tar.bz2"))
7595 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
7596 (build-system gnu-build-system)
7603 `(("linux-pam" ,linux-pam)))
7604 (home-page "https://sourceforge.net/projects/libcg/")
7605 (synopsis "Control groups management tools")
7606 (description "Control groups is Linux kernel method for process resource
7607 restriction, permission handling and more. This package provides userspace
7608 interface to this kernel feature.")
7609 (license license:lgpl2.1)))
7611 (define-public mbpfan
7619 (url "https://github.com/dgraziotin/mbpfan")
7620 (commit (string-append "v" version))))
7621 (file-name (git-file-name name version))
7623 (base32 "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr"))))
7624 (build-system gnu-build-system)
7626 `(#:tests? #f ; tests ask to be run as root
7627 #:make-flags (let ((out (assoc-ref %outputs "out")))
7628 (list (string-append "DESTDIR=" out)
7629 ,(string-append "CC=" (cc-for-target))))
7631 (modify-phases %standard-phases
7632 (add-after 'unpack 'patch-paths
7634 (substitute* "Makefile"
7637 (delete 'configure)))) ; there's no configure phase
7638 (home-page "https://github.com/dgraziotin/mbpfan")
7639 (synopsis "Control fan speed on Macbooks")
7641 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
7642 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
7643 module. It can be executed as a daemon or in the foreground with root
7645 (license license:gpl3+)))
7650 (version "11.2.185")
7654 (url "https://github.com/intel/opa-psm2")
7655 (commit (string-append "PSM2_" version))))
7656 (file-name (git-file-name name version))
7659 "062hg4r6gz7pla9df70nqs5i2a3mp1wszmp4l0g771fykhhrxsjg"))))
7660 (build-system gnu-build-system)
7663 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
7665 #:phases (modify-phases %standard-phases
7667 (add-after 'unpack 'patch-Makefiles
7669 (substitute* "Makefile"
7672 (substitute* "compat/Makefile"
7678 (setenv "DESTDIR" %output)
7679 (invoke "make" "install")
7682 `(("rdma-core" ,rdma-core)
7683 ("numactl" ,numactl)))
7684 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
7686 "This package is low-level user-level Intel's communications interface.
7687 The PSM2 API is a high-performance vendor-specific protocol that provides a
7688 low-level communications interface for the Intel Omni-Path family of
7689 high-speed networking devices.")
7690 (home-page "https://github.com/intel/opa-psm2")
7691 ;; Only the x86_64 architecure is supported.
7692 (supported-systems '("x86_64-linux"))
7693 (license (list license:bsd-3 license:gpl2)))) ; dual
7695 (define-public libpfm4
7701 (uri (string-append "mirror://sourceforge/perfmon2/"
7702 name "/libpfm-" version ".tar.gz"))
7705 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
7706 (build-system gnu-build-system)
7708 '(#:modules ((guix build utils)
7709 (guix build gnu-build-system))
7710 #:phases (modify-phases %standard-phases
7714 (lambda* (#:key inputs outputs #:allow-other-keys)
7715 (let* ((out (assoc-ref outputs "out")))
7720 (lambda* (#:key outputs #:allow-other-keys)
7721 (let* ((out (assoc-ref outputs "out")))
7723 (string-append "PREFIX=" out)
7726 (synopsis "Performance event monitoring library")
7728 "This package provides a library called libpfm4, which is used to develop
7729 monitoring tools exploiting the performance monitoring events such as those
7730 provided by the Performance Monitoring Unit (PMU) of modern processors.
7732 Libpfm4 helps convert from an event name, expressed as a string, to the event
7733 encoding that is either the raw event as documented by the hardware vendor or
7734 the OS-specific encoding. In the latter case, the library is able to prepare
7735 the OS-specific data structures needed by the kernel to setup the event.
7737 libpfm4 provides support for the @code{perf_events} interface, which was
7738 introduced in Linux 2.6.31.")
7739 (home-page "http://perfmon2.sourceforge.net/")
7740 (license license:expat)))
7742 (define-public libnfnetlink
7744 (name "libnfnetlink")
7749 "https://www.netfilter.org/projects/libnfnetlink/files/"
7750 "libnfnetlink-" version ".tar.bz2"))
7753 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
7754 (build-system gnu-build-system)
7755 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
7756 (synopsis "Low-level netfilter netlink communication library")
7758 "@code{libnfnetlink} is the low-level library for netfilter related
7759 kernel/userspace communication. It provides a generic messaging
7760 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
7761 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
7762 management tools in userspace.")
7763 (license license:gpl2)))
7765 (define-public go-netlink
7772 (url "https://github.com/vishvananda/netlink")
7773 (commit (string-append "v" version))))
7774 (file-name (git-file-name name version))
7777 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
7778 (build-system go-build-system)
7780 `(#:import-path "github.com/vishvananda/netlink"))
7782 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
7783 ("go-netns" ,go-netns)))
7784 (home-page "https://github.com/vishvananda/netlink")
7785 (synopsis "Simple netlink library for Go")
7786 (description "The netlink package provides a simple netlink library for
7787 Go. Netlink is the interface a user-space program in Linux uses to
7788 communicate with the kernel. It can be used to add and remove interfaces, set
7789 IP addresses and routes, and configure IPsec.")
7790 (license license:asl2.0)))
7792 (define-public libinih
7799 (url "https://github.com/benhoyt/inih")
7800 (commit (string-append "r" version))))
7801 (file-name (git-file-name name version))
7804 "0dqf5j2sw4hq68rqvxbrsf44ygfzx9ypiyzipk4cvp9aimbvsbc6"))))
7805 (build-system meson-build-system)
7806 ;; Install static libraries for use by the initrd's xfsprogs/static.
7807 (outputs (list "out" "static"))
7810 (list "-Ddistro_install=true"
7811 "-Ddefault_library=both")
7813 (modify-phases %standard-phases
7814 (add-after 'install 'separate-static
7815 (lambda* (#:key outputs #:allow-other-keys)
7816 (let ((out (assoc-ref outputs "out"))
7817 (static (assoc-ref outputs "static")))
7818 (with-directory-excursion out
7819 (for-each (lambda (source)
7820 (let ((target (string-append static "/" source)))
7821 (mkdir-p (dirname target))
7822 (rename-file source target)))
7823 (find-files "lib" "\\.a$")))))))))
7824 (home-page "https://github.com/benhoyt/inih")
7825 (synopsis "Simple .INI parser library for C")
7826 (description "The inih (INI Not Invented Here) library is a simple .INI file
7827 parser written in C. It's only a couple of pages of code, and it was designed to
7828 be small and simple, so it's good for embedded systems. It's also more or less
7829 compatible with Python's ConfigParser style of .INI files, including RFC
7830 822-style multi-line syntax and name: value entries.")
7831 (license license:bsd-3)))
7833 (define-public xfsprogs
7840 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
7841 "xfsprogs-" version ".tar.gz"))
7844 "09s3alwrhs1gaaywkpx2knc5bxb44b77009jw8zgsy9c2wxximns"))))
7845 (build-system gnu-build-system)
7846 (outputs (list "out" "python"))
7848 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
7852 (modify-phases %standard-phases
7853 (add-after 'install 'separate-python-output
7854 (lambda* (#:key outputs #:allow-other-keys)
7855 (let ((out (assoc-ref outputs "out"))
7856 (python (assoc-ref outputs "python")))
7859 (mkdir-p (string-append python (dirname script)))
7860 (rename-file (string-append out script)
7861 (string-append python script)))
7862 (list "/sbin/xfs_scrub_all")))))
7863 (add-after 'install 'install-headers
7864 (lambda* (#:key make-flags #:allow-other-keys)
7865 (apply invoke "make" "install-dev" make-flags))))))
7867 `(("gettext" ,gettext-minimal)))
7869 `(("libinih" ,libinih)
7870 ("libuuid" ,util-linux "lib")
7871 ("python" ,python-wrapper)))
7872 (home-page "https://xfs.wiki.kernel.org/")
7873 (synopsis "XFS file system tools")
7874 (description "This package provides commands to create and check XFS
7876 ;; The library "libhandle" and the headers in "xfslibs-dev" are
7877 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
7878 (license (list license:gpl2 license:lgpl2.1))))
7880 (define-public xfsprogs/static
7883 (name "xfsprogs-static")
7884 (outputs (list "out"))
7886 (substitute-keyword-arguments (package-arguments xfsprogs)
7887 ((#:make-flags make-flags ''())
7888 `(cons* "LLDFLAGS=-all-static" ,make-flags))
7890 `(modify-phases %standard-phases
7891 (add-after 'install 'delete-useless-files
7892 (lambda* (#:key outputs #:allow-other-keys)
7893 (with-directory-excursion (assoc-ref outputs "out")
7894 (for-each delete-file-recursively
7895 (list "include" "lib")))))))))
7897 `(("libinih:static" ,libinih "static")
7898 ("util-linux:static" ,util-linux "static")
7899 ,@(remove (match-lambda
7901 (member label '("python"))))
7902 (package-inputs xfsprogs))))
7903 (synopsis "Statically linked XFS file system tools")))
7905 (define-public xfs_repair/static
7907 (name "xfs_repair-static")
7908 (version (package-version xfsprogs/static))
7910 (build-system trivial-build-system)
7912 `(#:modules ((guix build utils))
7915 (use-modules (guix build utils))
7916 (let* ((xfsprogs (assoc-ref %build-inputs "xfsprogs"))
7917 (out (assoc-ref %outputs "out"))
7918 (sbin (string-append out "/sbin")))
7919 (install-file (string-append xfsprogs "/sbin/xfs_repair") sbin)
7920 (with-directory-excursion sbin
7921 (remove-store-references "xfs_repair"))))))
7923 `(("xfsprogs" ,xfsprogs/static)))
7924 (home-page (package-home-page xfsprogs/static))
7925 (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
7927 "This package provides a statically linked @command{xfs_repair} taken
7928 from the xfsprogs package. It is meant to be used in initrds.")
7929 (license (package-license xfsprogs/static))))
7931 (define-public genext2fs
7938 (url "https://github.com/jeremie-koenig/genext2fs")
7939 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
7940 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
7941 (file-name (git-file-name name version))
7943 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
7944 (build-system gnu-build-system)
7947 (modify-phases %standard-phases
7948 (add-after 'unpack 'apply-debian-patches
7949 ;; Debian changes (the revision after ‘-’ in VERSION) are
7950 ;; maintained as separate patches. Apply those relevant to us.
7954 (invoke "patch" "-p1" "-i"
7955 (string-append "debian/patches/" file-name)))
7956 (list "blocksize+creator.diff" ; add -B/-o options
7957 "byteswap_fix.diff"))
7960 `(("autoconf" ,autoconf)
7961 ("automake" ,automake)))
7962 (home-page "https://github.com/jeremie-koenig/genext2fs")
7963 (synopsis "Generate ext2 file system as a normal user")
7964 (description "This package provides a program to generate an ext2
7965 file system as a normal (non-root) user. It does not require you to mount
7966 the image file to copy files on it, nor does it require that you become
7967 the superuser to make device nodes.")
7968 (license license:gpl2)))
7970 (define-public fakeroot
7976 ;; There are no tags in the repository, so take this snapshot.
7978 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
7979 "fakeroot/fakeroot_" version ".orig.tar.gz"))
7980 (file-name (string-append name "-" version ".tar.gz"))
7983 "1sg8inv1zzp4h9ncbbmxip3svd11sd86j22cvxrjwnf5zn7mf2j8"))
7984 (modules '((guix build utils)
7988 ;; Delete pregenerated man page translations, but not the originals.
7989 (with-directory-excursion "doc"
7990 (for-each (lambda (language)
7991 (for-each delete-file
7992 (find-files language "\\.[0-9]$")))
7995 (and (not (string-prefix? "." file))
7997 (stat:type (lstat file))))))))))))
7998 (build-system gnu-build-system)
8001 (list "--disable-static")
8003 (modify-phases %standard-phases
8004 (add-after 'unpack 'patch-Makefile.am
8006 (substitute* "Makefile.am"
8007 (("/bin/sh") (which "sh")))))
8008 (add-after 'unpack 'patch-script
8009 (lambda* (#:key inputs #:allow-other-keys)
8010 (substitute* "scripts/fakeroot.in"
8012 (string-append (assoc-ref inputs "util-linux")
8015 (string-append (assoc-ref inputs "sed")
8017 (("cat|cut" command)
8018 (string-append (assoc-ref inputs "coreutils")
8019 "/bin/" command)) )))
8022 ;; The "preroll" script takes care of Autoconf and also
8023 ;; prepares the translated manuals.
8024 (invoke "sh" "./preroll")))
8025 (add-before 'configure 'setenv
8027 (setenv "LIBS" "-lacl")))
8028 (add-before 'check 'prepare-check
8030 (setenv "SHELL" (which "bash"))
8031 (setenv "VERBOSE" "1")
8032 (substitute* "test/t.touchinstall"
8033 ;; We don't have the name of the root user, so use ID=0.
8034 (("grep root") "grep \"\\<0\\>\""))
8035 (substitute* "test/tartest"
8036 ;; We don't have the name of the root group, so use ID=0.
8037 (("ROOTGROUP=root") "ROOTGROUP=0")
8038 ;; We don't have the name of the daemon user, so use IDs.
8039 (("daemon:sys") "1:3")
8041 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
8042 (substitute* "test/compare-tar"
8043 (("tar -tvf") "tar --numeric-owner -tvf")))))))
8045 `(;; For bootstrapping the package.
8046 ("autoconf" ,autoconf-2.71)
8047 ("automake" ,automake)
8048 ("libtool" ,libtool)
8049 ("gettext" ,gettext-minimal)
8053 ("sharutils" ,sharutils)
8058 ("util-linux" ,util-linux)
8060 ("coreutils" ,coreutils)))
8061 (synopsis "Run commands in an environment with fake root privileges")
8063 "@command{fakeroot} runs a command in an environment where it appears to
8064 have root privileges for file manipulation. This is useful for allowing users
8065 to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
8066 them with root permissions and/or ownership.
8068 Without fakeroot, one would have to have root privileges to create the
8069 constituent files of the archives with the correct permissions and ownership,
8070 and then pack them up, or one would have to construct the archives directly,
8071 without using the archiver.")
8072 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
8073 (license license:gpl3+)))
8075 (define-public fakechroot
8076 ;; XXX: Build from the change submitted at
8077 ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
8078 ;; against glibc 2.33. Switch back to the official repository on the next
8080 (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
8084 (version (git-version "2.20.1" revision commit))
8088 (url "https://github.com/lipnitsk/fakechroot")
8090 (file-name (git-file-name name version))
8093 "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
8094 (build-system gnu-build-system)
8096 ;; XXX: The tests heavily assume they run on an FHS system so for now
8099 #:configure-flags '("--disable-static")))
8100 (native-inputs (list autoconf automake libtool perl))
8101 (synopsis "Emulate @code{chroot} by overriding file system calls")
8103 "@command{fakechroot} runs a command in an environment were is additional
8104 possibility to use @code{chroot} command without root privileges. This is
8105 useful for allowing users to create own chrooted environment with possibility
8106 to install another packages without need for root privileges.
8108 It works by providing @file{libfakechroot.so}, a shared library meant to be
8109 set as @code{LD_PRELOAD} to override the C library file system functions.")
8110 (home-page "https://github.com/dex4er/fakechroot/")
8111 (license license:lgpl2.1+))))
8113 (define-public inputattach
8115 (name "inputattach")
8120 (url "https://github.com/linuxwacom/input-wacom")
8121 (commit (string-append "input-wacom-" version))))
8122 (file-name (git-file-name name version))
8124 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
8125 (build-system gnu-build-system)
8128 (modify-phases %standard-phases
8132 (lambda* (#:key inputs #:allow-other-keys)
8133 (with-directory-excursion "inputattach"
8134 (invoke "gcc" "-O2" "-o" "inputattach"
8138 (lambda* (#:key outputs #:allow-other-keys)
8139 (let ((target-dir (string-append
8140 (assoc-ref outputs "out")
8142 (mkdir-p target-dir)
8143 (copy-file "inputattach/inputattach"
8144 (string-append target-dir
8147 (home-page "https://linuxwacom.github.io/")
8148 (synopsis "Dispatch input peripherals events to a device file")
8149 (description "inputattach dispatches input events from several device
8150 types and interfaces and translates so that the X server can use them.")
8151 (license license:gpl2+)))
8153 (define-public pipewire
8160 (url "https://github.com/PipeWire/pipewire")
8162 (file-name (git-file-name name version))
8165 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))
8166 (patches (search-patches "pipewire-0.2.7-fno-common.patch"))))
8167 (build-system meson-build-system)
8169 '(#:configure-flags '("-Dsystemd=false")))
8171 `(("pkg-config" ,pkg-config)))
8173 `(("alsa-lib" ,alsa-lib)
8177 ("gstreamer" ,gstreamer)
8178 ("gst-plugins-base" ,gst-plugins-base)
8182 (home-page "https://pipewire.org/")
8183 (synopsis "Server and user space API to deal with multimedia pipelines")
8185 "PipeWire is a project that aims to greatly improve handling of audio and
8186 video under Linux. It aims to support the usecases currently handled by both
8187 PulseAudio and Jack and at the same time provide same level of powerful handling
8188 of Video input and output. It also introduces a security model that makes
8189 interacting with audio and video devices from containerized applications easy,
8190 with supporting Flatpak applications being the primary goal. Alongside Wayland
8191 and Flatpak we expect PipeWire to provide a core building block for the future
8192 of Linux application development.")
8193 (license license:lgpl2.0+)))
8195 (define-public pipewire-0.3
8203 (url "https://github.com/PipeWire/pipewire")
8205 (file-name (git-file-name name version))
8208 "16jjxcnahxqfcawz77ywx837ybhwzcivn7hgqb9cmlp1y2syy8gk"))))
8211 (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
8212 "/lib/udev/rules.d")
8213 "-Dsystemd=disabled")
8215 (modify-phases %standard-phases
8216 ;; Skip shrink-runpath, otherwise validate-runpath fails.
8217 (delete 'shrink-runpath))))
8219 (append (package-inputs pipewire)
8222 ("pulseaudio" ,pulseaudio)
8223 ("vulkan-loader" ,vulkan-loader)
8224 ("vulkan-headers" ,vulkan-headers))))))
8233 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
8235 (file-name (git-file-name name version))
8238 "14scs8vqpcf2810gvabsplg9yzh9y4sz47407bjy6vd604z3w8ah"))))
8239 (build-system gnu-build-system)
8242 (modify-phases %standard-phases
8243 (add-after 'unpack 'fix-dbus-tests
8245 (substitute* '("unit/test-dbus-message-fds.c"
8246 "unit/test-dbus-properties.c"
8248 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
8253 `(("autoconf" ,autoconf)
8254 ("libtool" ,libtool)
8255 ("pkgconfig" ,pkg-config)
8256 ("automake" ,automake)))
8257 (home-page "https://01.org/ell")
8258 (synopsis "Embedded Linux Library")
8259 (description "The Embedded Linux* Library (ELL) provides core, low-level
8260 functionality for system daemons. It typically has no dependencies other than
8261 the Linux kernel, C standard library, and libdl (for dynamic linking). While
8262 ELL is designed to be efficient and compact enough for use on embedded Linux
8263 platforms, it is not limited to resource-constrained systems.")
8264 (license license:lgpl2.1+)))
8266 (define-public lttng-ust
8272 (uri (string-append "https://lttng.org/files/lttng-ust/"
8273 "lttng-ust-" version ".tar.bz2"))
8276 "1iwz6p79zvibj8sl8qqw84lcir9a8z1ylq77hhnwg26anrjg1l5w"))))
8277 (build-system gnu-build-system)
8279 `(("liburcu" ,liburcu)
8280 ("numactl" ,numactl)))
8282 `(("python" ,python-3)))
8283 (home-page "https://lttng.org/")
8284 (synopsis "LTTng userspace tracer libraries")
8285 (description "The user space tracing library, liblttng-ust, is the LTTng
8286 user space tracer. It receives commands from a session daemon, for example to
8287 enable and disable specific instrumentation points, and writes event records
8288 to ring buffers shared with a consumer daemon.")
8289 (license license:lgpl2.1+)))
8291 (define-public kexec-tools
8293 (name "kexec-tools")
8297 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
8298 "/kexec/kexec-tools-" version ".tar.xz"))
8301 "1hj9mj6x3qs9c8x8mrri9xd3wsg3gwzbab3jfa5ry146xm4pzjcn"))))
8302 (build-system gnu-build-system)
8304 ;; There are no automated tests.
8306 (home-page "https://projects.horms.net/projects/kexec/")
8307 (synopsis "Tools for booting directly into different kernels")
8308 (description "This package provides the @code{kexec} program and ancillary
8309 utilities. Using @code{kexec}, it is possible to boot directly into a new
8310 kernel from the context of an already-running kernel, bypassing the normal
8311 system boot process.")
8312 (license license:gpl2)))
8314 (define-public cachefilesd
8316 (name "cachefilesd")
8321 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
8322 "/cachefilesd.git/snapshot/cachefilesd-"
8326 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
8327 (build-system gnu-build-system)
8330 `(#:tests? #f ; there are no tests
8332 (let ((prefix-dir (lambda (var dir)
8333 (string-append var "=" %output "/" dir))))
8334 (list (string-append "CC=" ,(cc-for-target))
8335 (prefix-dir "SBINDIR" "sbin/")
8336 (prefix-dir "ETCDIR" "etc/")
8337 (prefix-dir "MANDIR" "share/man/")))
8338 #:phases (modify-phases %standard-phases (delete 'configure))))
8339 (home-page "https://people.redhat.com/~dhowells/cachefs/")
8340 (synopsis "CacheFiles userspace management daemon")
8341 (description "@code{cachefilesd} is a userspace daemon that manages the
8342 cache data store that is used by network file systems such as @code{AFS} and
8343 @code{NFS} to cache data locally on disk. The content of the cache is
8344 persistent over reboots.")
8345 (license license:gpl2+)))
8347 (define-public libbpf
8355 (url "https://github.com/libbpf/libbpf")
8356 (commit (string-append "v" version))))
8357 (file-name (git-file-name name version))
8360 "0ilnnm4q22f8fagwp8kb37licy4ks861i2iqh2djsypqhnxvx3fv"))))
8361 (build-system gnu-build-system)
8363 `(("pkg-config" ,pkg-config)))
8365 ;; In Requires.private of libbpf.pc.
8366 `(("libelf" ,libelf)
8369 `(#:tests? #f ; no tests
8372 (string-append "PREFIX=" (assoc-ref %outputs "out"))
8373 (string-append "LIBDIR=$(PREFIX)/lib")
8375 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
8377 (modify-phases %standard-phases
8379 (add-before 'build 'pre-build
8383 (home-page "https://github.com/libbpf/libbpf")
8384 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
8386 "Libbpf supports building BPF CO-RE-enabled applications, which, in
8387 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
8389 (license `(,license:lgpl2.1 ,license:bsd-2))))
8399 (url "https://github.com/iovisor/bcc")
8400 (commit (string-append "v" version))))
8401 (file-name (git-file-name name version))
8404 "1367c0bzrpclvjvmk0sxgi49rh7j2f9izqk5a7g3yvawh1fmvvjh"))))
8405 (build-system cmake-build-system)
8410 `(("clang-toolchain" ,clang-toolchain)
8411 ("libbpf" ,(package-source libbpf))
8412 ;; LibElf required but libelf does not contain
8413 ;; archives, only object files.
8414 ;; https://github.com/iovisor/bcc/issues/504
8415 ("elfutils" ,elfutils)
8416 ("linux-libre-headers" ,linux-libre-headers)
8418 ("python-wrapper" ,python-wrapper)))
8420 `(;; Tests all require root permissions and a "standard" file hierarchy.
8423 (let ((revision ,version))
8424 `(,(string-append "-DREVISION=" revision)))
8426 (modify-phases %standard-phases
8427 ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
8428 (add-after 'unpack 'copy-libbpf
8429 (lambda* (#:key inputs #:allow-other-keys)
8430 (delete-file-recursively "src/cc/libbpf")
8432 (assoc-ref inputs "libbpf") "src/cc/libbpf")))
8433 (add-after 'copy-libbpf 'substitute-libbc
8434 (lambda* (#:key outputs #:allow-other-keys)
8435 (substitute* "src/python/bcc/libbcc.py"
8436 (("(libbcc\\.so.*)\\b" _ libbcc)
8438 (assoc-ref outputs "out") "/lib/" libbcc)))))
8439 (add-after 'install 'wrap-tools
8440 (lambda* (#:key outputs #:allow-other-keys)
8441 (use-modules (ice-9 textual-ports))
8442 (let* ((out (assoc-ref outputs "out"))
8443 (lib (string-append out "/lib"))
8444 (tools (string-append out "/share/bcc/tools"))
8446 (lambda (filename _)
8447 (call-with-input-file filename
8449 (string-contains (get-line port)
8452 (lambda (python-executable)
8453 (format #t "Wrapping: ~A.~%" python-executable)
8454 (wrap-program python-executable
8455 `("GUIX_PYTHONPATH" ":" prefix
8456 (,(string-append lib
8458 ,(version-major+minor
8459 (package-version python))
8460 "/site-packages")))))
8461 (find-files tools python-executable?))
8463 (home-page "https://github.com/iovisor/bcc")
8464 (synopsis "Tools for BPF on Linux")
8466 "BCC is a toolkit for creating efficient kernel tracing and manipulation
8467 programs, and includes several useful tools and examples. It makes use of
8468 extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
8469 that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
8471 (license license:asl2.0)))
8473 (define-public bpftrace
8481 (url "https://github.com/iovisor/bpftrace")
8482 (commit (string-append "v" version))))
8483 (file-name (git-file-name name version))
8485 (base32 "0y4qgm2cpccrsm20rnh92hqplddqsc5q5zhw9nqn2igm3h9i0z7h"))
8486 (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
8487 (build-system cmake-build-system)
8493 ("clang-toolchain" ,clang-toolchain)
8494 ("elfutils" ,elfutils)
8496 ("linux-libre-headers" ,linux-libre-headers)))
8498 `(#:tests? #f ;Tests require googletest sources.
8500 '("-DBUILD_TESTING=OFF"
8501 ;; FIXME: libbfd misses some link dependencies, when fixed, remove
8502 ;; the associated patch.
8503 "-DHAVE_BFD_DISASM=OFF")))
8504 (home-page "https://github.com/iovisor/bpftrace")
8505 (synopsis "High-level tracing language for Linux eBPF")
8507 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
8508 Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
8509 LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
8510 interacting with the Linux BPF system, as well as existing Linux tracing
8511 capabilities: kernel dynamic tracing (kprobes), user-level dynamic
8512 tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
8513 and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
8514 created by Alastair Robertson.")
8515 (license license:asl2.0)))
8517 (define-public ttyebus-linux-module
8518 (let ((revision "0")
8519 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
8521 (name "ttyebus-linux-module")
8522 (version (git-version "1.5" revision commit))
8527 (url "https://github.com/eBUS/ttyebus")
8528 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
8529 (file-name (git-file-name name version))
8532 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
8533 (supported-systems '("armhf-linux" "aarch64-linux"))
8534 (build-system linux-module-build-system)
8537 (home-page "https://github.com/eBUS/ttyebus")
8538 (synopsis "Low-latency Raspberry Pi UART driver")
8539 (description "This package provides a Linux kernel module that will
8540 provide a serial device @code{/dev/ttyebus} with almost no latency upon
8541 receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
8542 (license license:gpl3+))))
8544 (define-public ipset
8551 (uri (string-append "https://ipset.netfilter.org/"
8552 "ipset-" version ".tar.bz2"))
8554 (base32 "0l8pcaym6057hq3a4zwnk53p5y6xg1m3d3c83wn18h5nmnm4am8a"))))
8555 (build-system gnu-build-system)
8557 `(("libmnl" ,libmnl)))
8559 `(("pkg-config" ,pkg-config)))
8561 `(#:configure-flags '("--disable-static"
8563 (home-page "https://ipset.netfilter.org/")
8564 (synopsis "Administration tool for IP sets")
8565 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
8566 can be administered by the ipset utility. Depending on the type,
8567 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
8568 IP addresses with MAC addresses in a way which ensures lightning speed
8569 when matching an entry against a set.
8573 @item store multiple IP addresses or port numbers and match against the entire
8574 collection using a single iptables rule.
8575 @item dynamically update iptables rules against IP addresses or ports without
8576 performance penalty.
8577 @item express complex IP address and ports based rulesets with a single
8578 iptables rule and benefit from the speed of IP sets.
8580 then IP sets may be the proper tool for you.")
8581 (license license:gpl2+)))
8583 (define-public liburing
8590 (url "https://git.kernel.dk/liburing")
8591 (commit (string-append "liburing-" version))))
8592 (file-name (git-file-name name version))
8595 "15z44l7y4c6s6dlf7v8lq4znlsjbja2r4ifbni0l8cdcnq0w3zh3"))))
8596 (build-system gnu-build-system)
8598 `(;; Tests are dependent on kernel version and features
8601 (modify-phases %standard-phases
8603 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
8604 ;; --enable-fast-install, and --build
8605 (lambda* (#:key outputs #:allow-other-keys)
8606 (let ((out (assoc-ref outputs "out")))
8607 (setenv "SHELL" (which "sh"))
8608 (setenv "CONFIG_SHELL" (which "sh"))
8609 (invoke "./configure" (string-append "--prefix=" out))))))))
8610 (home-page "https://github.com/axboe/liburing")
8611 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
8612 (description "This is the io_uring library, liburing. liburing provides
8613 helpers to setup and teardown io_uring instances, and also a simplified
8614 interface for applications that don't need (or want) to deal with the full
8615 kernel side implementation.")
8616 (license license:expat)))
8618 (define-public erofs-utils
8620 (name "erofs-utils")
8626 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
8627 (commit (string-append "v" version))))
8628 (file-name (git-file-name name version))
8630 (base32 "0sqiw05zbxr6l0g9gn3whkc4qc5km2qvfg4lnm08nppwskm8yaw8"))))
8631 (build-system gnu-build-system)
8634 ("libuuid" ,util-linux "lib")))
8636 `(("autoconf" ,autoconf)
8637 ("automake" ,automake)
8638 ("libtool" ,libtool)
8639 ("pkg-config" ,pkg-config)))
8640 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
8641 (synopsis "User-space tools for the EROFS file system")
8643 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
8644 read-only file system optimized for resource-scarce devices. This package
8645 provides user-space tools for creating EROFS file systems.")
8646 (license license:gpl2+)))
8648 (define-public rasdaemon
8656 (url "https://github.com/mchehab/rasdaemon")
8657 (commit (string-append "v" version))))
8658 (file-name (git-file-name name version))
8660 (base32 "12ih96jwmr7imp9zyckf9zjqqm5ra1kv5fj6kbw71y6yl31069dz"))))
8661 (native-inputs `(("autoconf" ,autoconf)
8662 ("automake" ,automake)
8663 ("libtool" ,libtool)))
8664 (inputs `(("sqlite" ,sqlite)))
8667 (list "--enable-all"
8668 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
8669 "--with-sysconfdefdir=."
8670 "--localstatedir=/var")
8672 (modify-phases %standard-phases
8673 (add-before 'configure 'munge-autotools
8675 ;; For some reason upstream forces sysconfdir=/etc. This results
8676 ;; in EPERM during the install phase. Removing the offending
8677 ;; line lets sysconfdir correctly pick up DESTDIR.
8678 (substitute* "configure.ac"
8679 (("^test .* sysconfdir=/etc\n$") ""))
8680 ;; Upstream tries to create /var/lib/rasdaemon at install time.
8681 ;; This results in EPERM on guix. Instead, the service should
8682 ;; create this at activation time.
8683 (substitute* "Makefile.am"
8684 (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") "")))))))
8685 (build-system gnu-build-system)
8686 (home-page "https://github.com/mchehab/rasdaemon")
8687 (synopsis "Platform Reliability, Availability, and Serviceability tools")
8689 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
8690 Availability and Serviceability} reports from Linux kernel trace events.
8691 These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
8692 through standard log mechanisms like syslog.")
8693 (license license:gpl2)))
8695 (define-public libgpiod
8704 (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
8705 (commit (string-append "v" version))))
8706 (file-name (git-file-name name version))
8707 (sha256 (base32 "0rv8a11hx3pc6sdw6nfc6k35hkp2clb3v53n1381cvip8fzhbsad"))))
8708 (build-system gnu-build-system)
8711 '("--enable-tools=yes"
8712 "--enable-bindings-cxx"
8713 "--enable-bindings-python")))
8715 `(("automake" ,automake)
8716 ("autoconf" ,autoconf)
8717 ("libtool" ,libtool)
8718 ("autoconf-archive" ,autoconf-archive)
8719 ("pkg-config" ,pkg-config)
8720 ("python" ,python-3)))
8721 (synopsis "Interact with the Linux GPIO character device")
8723 "This package provides a C library with C++/Python bindings and
8724 command-line tools for interacting with GPIO devices that avoids the usage of
8725 older system-wide @file{/sys} interface.")
8726 (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
8727 (license (list license:lgpl2.1+ ;; libgpiod
8728 license:gpl2+ ;; gpio-tools
8729 license:lgpl3+)))) ;; C++ bindings