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 Christopher Allan 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 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 Mathieu Othacehe <m.othacehe@gmail.com>
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 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 Maxim Cournoyer <maxim.cournoyer@gmail.com>
37 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
38 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
39 ;;; Copyright © 2019, 2020, 2021 Brice Waegeneire <brice@waegenei.re>
40 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
41 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
42 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
43 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
44 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
45 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
46 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
47 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
48 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
49 ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
50 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
51 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
52 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
53 ;;; Copyright © 2020 David Dashyan <mail@davie.li>
54 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
55 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
57 ;;; This file is part of GNU Guix.
59 ;;; GNU Guix is free software; you can redistribute it and/or modify it
60 ;;; under the terms of the GNU General Public License as published by
61 ;;; the Free Software Foundation; either version 3 of the License, or (at
62 ;;; your option) any later version.
64 ;;; GNU Guix is distributed in the hope that it will be useful, but
65 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
66 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67 ;;; GNU General Public License for more details.
69 ;;; You should have received a copy of the GNU General Public License
70 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
72 (define-module (gnu packages linux)
73 #:use-module (gnu packages)
74 #:use-module (gnu packages acl)
75 #:use-module (gnu packages admin)
76 #:use-module (gnu packages algebra)
77 #:use-module (gnu packages audio)
78 #:use-module (gnu packages autotools)
79 #:use-module (gnu packages backup)
80 #:use-module (gnu packages base)
81 #:use-module (gnu packages bash)
82 #:use-module (gnu packages bison)
83 #:use-module (gnu packages boost)
84 #:use-module (gnu packages calendar)
85 #:use-module (gnu packages check)
86 #:use-module (gnu packages cpio)
87 #:use-module (gnu packages crypto)
88 #:use-module (gnu packages cryptsetup)
89 #:use-module (gnu packages compression)
90 #:use-module (gnu packages dbm)
91 #:use-module (gnu packages datastructures)
92 #:use-module (gnu packages docbook)
93 #:use-module (gnu packages documentation)
94 #:use-module (gnu packages elf)
95 #:use-module (gnu packages flex)
96 #:use-module (gnu packages file)
97 #:use-module (gnu packages freedesktop)
98 #:use-module (gnu packages gawk)
99 #:use-module (gnu packages gcc)
100 #:use-module (gnu packages gettext)
101 #:use-module (gnu packages glib)
102 #:use-module (gnu packages golang)
103 #:use-module (gnu packages gperf)
104 #:use-module (gnu packages gstreamer)
105 #:use-module (gnu packages gtk)
106 #:use-module (gnu packages haskell-apps)
107 #:use-module (gnu packages haskell-xyz)
108 #:use-module (gnu packages libunwind)
109 #:use-module (gnu packages libusb)
110 #:use-module (gnu packages llvm)
111 #:use-module (gnu packages lua)
112 #:use-module (gnu packages man)
113 #:use-module (gnu packages maths)
114 #:use-module (gnu packages multiprecision)
115 #:use-module (gnu packages ncurses)
116 #:use-module (gnu packages netpbm)
117 #:use-module (gnu packages networking)
118 #:use-module (gnu packages ninja)
119 #:use-module (gnu packages nss)
120 #:use-module (gnu packages perl)
121 #:use-module (gnu packages pciutils)
122 #:use-module (gnu packages pkg-config)
123 #:use-module (gnu packages popt)
124 #:use-module (gnu packages pulseaudio)
125 #:use-module (gnu packages python)
126 #:use-module (gnu packages python-xyz)
127 #:use-module (gnu packages readline)
128 #:use-module (gnu packages rrdtool)
129 #:use-module (gnu packages samba)
130 #:use-module (gnu packages sdl)
131 #:use-module (gnu packages serialization)
132 #:use-module (gnu packages slang)
133 #:use-module (gnu packages sqlite)
134 #:use-module (gnu packages texinfo)
135 #:use-module (gnu packages tls)
136 #:use-module (gnu packages valgrind)
137 #:use-module (gnu packages video)
138 #:use-module (gnu packages vulkan)
139 #:use-module (gnu packages web)
140 #:use-module (gnu packages xiph)
141 #:use-module (gnu packages xml)
142 #:use-module (gnu packages xdisorg)
143 #:use-module (gnu packages xorg)
144 #:use-module (gnu packages groff)
145 #:use-module (gnu packages rsync)
146 #:use-module (gnu packages selinux)
147 #:use-module (gnu packages swig)
148 #:use-module (guix build-system cmake)
149 #:use-module (guix build-system gnu)
150 #:use-module (guix build-system go)
151 #:use-module (guix build-system meson)
152 #:use-module (guix build-system python)
153 #:use-module (guix build-system trivial)
154 #:use-module (guix build-system linux-module)
155 #:use-module (guix download)
156 #:use-module (guix git-download)
157 #:use-module ((guix licenses) #:prefix license:)
158 #:use-module (guix packages)
159 #:use-module (guix gexp)
160 #:use-module (guix store)
161 #:use-module (guix monads)
162 #:use-module (guix utils)
163 #:use-module (guix deprecation) ;for libcap/next
164 #:use-module (srfi srfi-1)
165 #:use-module (srfi srfi-2)
166 #:use-module (srfi srfi-26)
167 #:use-module (ice-9 match))
169 (define-public (system->linux-architecture arch)
170 "Return the Linux architecture name for ARCH, a Guix system name such as
171 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
172 (let ((arch (car (string-split arch #\-))))
173 (cond ((string=? arch "i686") "i386")
174 ((string-prefix? "mips" arch) "mips")
175 ((string-prefix? "arm" arch) "arm")
176 ((string-prefix? "aarch64" arch) "arm64")
177 ((string-prefix? "alpha" arch) "alpha")
178 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
179 ((string-prefix? "s390" arch) "s390")
180 ((string-prefix? "riscv" arch) "riscv")
183 (define-public (system->defconfig system)
184 "Some systems (notably powerpc-linux) require a special target for kernel
185 defconfig. Return the appropriate make target if applicable, otherwise return
187 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
188 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
189 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
194 ;;; Kernel source code deblobbing.
197 (define (linux-libre-deblob-scripts version
200 (list (version-major+minor version)
203 (uri (string-append "https://linux-libre.fsfla.org"
204 "/pub/linux-libre/releases/" version "-gnu/"
205 "deblob-" (version-major+minor version)))
206 (file-name (string-append "linux-libre-deblob-"
208 (sha256 deblob-hash))
211 (uri (string-append "https://linux-libre.fsfla.org"
212 "/pub/linux-libre/releases/" version "-gnu/"
214 (file-name (string-append "linux-libre-deblob-check-" version))
215 (sha256 deblob-check-hash))))
217 (define* (computed-origin-method gexp-promise hash-algo hash
218 #:optional (name "source")
219 #:key (system (%current-system))
220 (guile (default-guile)))
221 "Return a derivation that executes the G-expression that results
222 from forcing GEXP-PROMISE."
223 (mlet %store-monad ((guile (package->derivation guile system)))
224 (gexp->derivation (or name "computed-origin")
226 #:graft? #f ;nothing to graft
228 #:guile-for-build guile)))
230 (define (make-linux-libre-source version
233 "Return a 'computed' origin that generates a Linux-libre tarball from the
234 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
235 (match deblob-scripts
236 ((deblob-version (? origin? deblob) (? origin? deblob-check))
237 (unless (string=? deblob-version (version-major+minor version))
238 ;; The deblob script cannot be expected to work properly on a
239 ;; different version (major+minor) of Linux, even if no errors
240 ;; are signaled during execution.
241 (error "deblob major+minor version mismatch"))
243 (method computed-origin-method)
244 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
248 (with-imported-modules '((guix build utils))
250 (use-modules (guix build utils)
255 (setvbuf (current-output-port) 'line)
257 (let ((dir (string-append "linux-" #$version)))
260 (set-path-environment-variable
263 #+(canonical-package bash)
264 #+(canonical-package coreutils)
265 #+(canonical-package diffutils)
266 #+(canonical-package findutils)
267 #+(canonical-package patch)
268 #+(canonical-package xz)
269 #+(canonical-package sed)
270 #+(canonical-package grep)
271 #+(canonical-package bzip2)
272 #+(canonical-package gzip)
273 #+(canonical-package tar)
274 #+(canonical-package gawk)
277 (with-directory-excursion "/tmp/bin"
279 (copy-file #+deblob "deblob")
280 (chmod "deblob" #o755)
281 (substitute* "deblob"
282 (("/bin/sh") (which "sh")))
284 (copy-file #+deblob-check "deblob-check")
285 (chmod "deblob-check" #o755)
286 (substitute* "deblob-check"
287 (("/bin/sh") (which "sh"))
288 (("/bin/sed") (which "sed"))
289 (("/usr/bin/python") (which "python"))))
291 (if (file-is-directory? #+upstream-source)
293 (format #t "Copying upstream linux source...~%")
294 (invoke "cp" "--archive" #+upstream-source dir)
295 (invoke "chmod" "--recursive" "u+w" dir))
297 (format #t "Unpacking upstream linux tarball...~%")
298 (invoke "tar" "xf" #$upstream-source)
301 (and (not (member name '("." "..")))
302 (file-is-directory? name))))
304 (unless (string=? dir unpacked-dir)
305 (rename-file unpacked-dir dir)))
307 (error "multiple directories found" dirs)))))
309 (with-directory-excursion dir
310 (format #t "Running deblob script...~%")
311 (invoke "/tmp/bin/deblob"))
313 (format #t "~%Packing new Linux-libre tarball...~%")
314 (invoke "tar" "cvfa" #$output
315 ;; Avoid non-determinism in the archive.
323 (format #t "~%Scanning the generated tarball for blobs...~%")
324 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
332 (define (linux-libre-urls version)
333 "Return a list of URLs for Linux-Libre VERSION."
335 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
336 version "-gnu/linux-libre-" version "-gnu.tar.xz")
338 ;; XXX: Work around <http://bugs.gnu.org/14851>.
340 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
341 version "-gnu.tar.xz")
343 ;; Maybe this URL will become valid eventually.
345 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
346 version "-gnu.tar.xz")))
348 (define (%upstream-linux-source version hash)
351 (uri (string-append "mirror://kernel.org"
352 "/linux/kernel/v" (version-major version) ".x/"
353 "linux-" version ".tar.xz"))
356 ;; The current "stable" kernels. That is, the most recently released major
357 ;; versions that are still supported upstream.
358 (define-public linux-libre-5.12-version "5.12.14")
359 (define deblob-scripts-5.12
360 (linux-libre-deblob-scripts
361 linux-libre-5.12-version
362 (base32 "1vdsr9y4gckknrbqcjyfakwva3k0vb5zcivzk3k1s9mh7qp9dils")
363 (base32 "1p1jzrci97sipjdx3h0vmdnw35z2vyvczinxmp65xi1ja7ww0g14")))
364 (define-public linux-libre-5.12-pristine-source
365 (let ((version linux-libre-5.12-version)
366 (hash (base32 "1b3xnb62n53vm6larkvv2vzd9w7cjnqh8zh6jzq9lpcg12c3pjlh")))
367 (make-linux-libre-source version
368 (%upstream-linux-source version hash)
369 deblob-scripts-5.12)))
371 ;; The "longterm" kernels — the older releases with long-term upstream support.
372 ;; Here are the support timelines:
373 ;; <https://www.kernel.org/category/releases.html>
374 (define-public linux-libre-5.10-version "5.10.47")
375 (define deblob-scripts-5.10
376 (linux-libre-deblob-scripts
377 linux-libre-5.10-version
378 (base32 "1rmnx1px4sizs2lq831yd2g9dyflg0vmykz3cv9443x2a2vwy81f")
379 (base32 "1zsr02zmpx3968277sy8pfs2mdlgh86ifymwyj0r56wnhzf5q6hk")))
380 (define-public linux-libre-5.10-pristine-source
381 (let ((version linux-libre-5.10-version)
382 (hash (base32 "1ig1kb10729xyawm2zqzx8slpdbylgwms7b5vkhw3q6iwqpjmd9h")))
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.128")
388 (define deblob-scripts-5.4
389 (linux-libre-deblob-scripts
390 linux-libre-5.4-version
391 (base32 "12g1wm7xvjvmjanbgg0ahxm4vs2n5bvicfnnnag4h35vl4q3lggg")
392 (base32 "1xghbbnaisjd0k1klbyn1p7r6r4x5a1bpmkm56a3gh2zvw4s7mj8")))
393 (define-public linux-libre-5.4-pristine-source
394 (let ((version linux-libre-5.4-version)
395 (hash (base32 "1arrpskxkkl6vb06d4y4xvfy1355mjk5ac5sp66657kbh6xswm1v")))
396 (make-linux-libre-source version
397 (%upstream-linux-source version hash)
398 deblob-scripts-5.4)))
400 (define-public linux-libre-4.19-version "4.19.195")
401 (define deblob-scripts-4.19
402 (linux-libre-deblob-scripts
403 linux-libre-4.19-version
404 (base32 "1jfcz4lnm44b3xzrkiipvw35kl0vvdvhr2pg7jfwf02f6qbvay18")
405 (base32 "1jiaw0as1ippkrjdpd52657w5mz9qczg3y2hlra7m9k0xawwiqlf")))
406 (define-public linux-libre-4.19-pristine-source
407 (let ((version linux-libre-4.19-version)
408 (hash (base32 "02rdy5mdmwxli0cin5n7ab492y9fs01hhqxrjq6b4idwv5baa42m")))
409 (make-linux-libre-source version
410 (%upstream-linux-source version hash)
411 deblob-scripts-4.19)))
413 (define-public linux-libre-4.14-version "4.14.237")
414 (define deblob-scripts-4.14
415 (linux-libre-deblob-scripts
416 linux-libre-4.14-version
417 (base32 "07afckszdm4pq008i6ij0pxpw2rpgi5q931nxh6dxcczpicvwbc9")
418 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
419 (define-public linux-libre-4.14-pristine-source
420 (let ((version linux-libre-4.14-version)
421 (hash (base32 "0kib9p61hhwjbr8zhir9aw86qik7k6bm95503n3k09ayyachajpq")))
422 (make-linux-libre-source version
423 (%upstream-linux-source version hash)
424 deblob-scripts-4.14)))
426 (define-public linux-libre-4.9-version "4.9.273")
427 (define deblob-scripts-4.9
428 (linux-libre-deblob-scripts
429 linux-libre-4.9-version
430 (base32 "1w8cb8w1cpcwswc3rxq6vwjafw6yy0igib34rrm93ag5h6inncfv")
431 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
432 (define-public linux-libre-4.9-pristine-source
433 (let ((version linux-libre-4.9-version)
434 (hash (base32 "0jjarv3xfkc21j1xhgch53w8wm6rq3xw1i03rjw9fv5i9k4x6qsw")))
435 (make-linux-libre-source version
436 (%upstream-linux-source version hash)
437 deblob-scripts-4.9)))
439 (define-public linux-libre-4.4-version "4.4.273")
440 (define deblob-scripts-4.4
441 (linux-libre-deblob-scripts
442 linux-libre-4.4-version
443 (base32 "1lid4k7g947yi3hcjj0lz0fnssawbph3jsy67vrv57l5imrhv3zs")
444 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
445 (define-public linux-libre-4.4-pristine-source
446 (let ((version linux-libre-4.4-version)
447 (hash (base32 "1pd39cak0zhda3m9nvn9yxgd070wxvckaha5wl8pi7c8i6jfpclb")))
448 (make-linux-libre-source version
449 (%upstream-linux-source version hash)
450 deblob-scripts-4.4)))
452 (define %boot-logo-patch
453 ;; Linux-Libre boot logo featuring Freedo and a gnu.
456 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
457 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
460 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
462 (define %linux-libre-arm-export-__sync_icache_dcache-patch
466 "https://salsa.debian.org/kernel-team/linux"
467 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
468 "/debian/patches/bugfix/arm/"
469 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
470 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
472 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
474 (define (source-with-patches source patches)
477 (patches (append (origin-patches source)
480 (define-public linux-libre-5.12-source
481 (source-with-patches linux-libre-5.12-pristine-source
482 (list %boot-logo-patch
483 %linux-libre-arm-export-__sync_icache_dcache-patch
484 ;; Pinebook Pro patch to fix LCD display
486 "linux-libre-arm64-generic-pinebook-lcd.patch"))))
488 (define-public linux-libre-5.10-source
489 (source-with-patches linux-libre-5.10-pristine-source
490 (list %boot-logo-patch
491 %linux-libre-arm-export-__sync_icache_dcache-patch
492 ;; Pinebook Pro patch to fix LCD display
494 "linux-libre-arm64-generic-pinebook-lcd.patch"))))
496 (define-public linux-libre-5.4-source
497 (source-with-patches linux-libre-5.4-pristine-source
498 (list %boot-logo-patch
499 %linux-libre-arm-export-__sync_icache_dcache-patch
500 ;; Pinebook Pro patch from linux-next,
501 ;; can be dropped for linux-libre 5.7
503 "linux-libre-support-for-Pinebook-Pro.patch"))))
505 (define-public linux-libre-4.19-source
506 (source-with-patches linux-libre-4.19-pristine-source
507 (list %boot-logo-patch
508 %linux-libre-arm-export-__sync_icache_dcache-patch)))
510 (define-public linux-libre-4.14-source
511 (source-with-patches linux-libre-4.14-pristine-source
512 (list %boot-logo-patch)))
514 (define-public linux-libre-4.9-source
515 (source-with-patches linux-libre-4.9-pristine-source
516 (list %boot-logo-patch)))
518 (define-public linux-libre-4.4-source
519 (source-with-patches linux-libre-4.4-pristine-source
520 (list %boot-logo-patch)))
527 (define (make-linux-libre-headers version hash-string)
528 (make-linux-libre-headers* version
531 (uri (linux-libre-urls version))
532 (sha256 (base32 hash-string)))))
534 (define (make-linux-libre-headers* version source)
536 (name "linux-libre-headers")
539 (build-system gnu-build-system)
540 (native-inputs `(("perl" ,perl)
541 ,@(if (version>=? version "4.16")
545 ,@(if (version>=? version "5.3")
549 `(#:modules ((guix build gnu-build-system)
553 (modify-phases %standard-phases
557 (let ((arch ,(system->linux-architecture
558 (or (%current-target-system)
560 (defconfig ,(system->defconfig
561 (or (%current-target-system)
562 (%current-system)))))
564 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
565 (invoke "make" defconfig)
566 (invoke "make" "mrproper" "headers_check"))))
568 (lambda* (#:key outputs #:allow-other-keys)
569 (let ((out (assoc-ref outputs "out")))
571 (string-append "INSTALL_HDR_PATH=" out)
574 (mkdir (string-append out "/include/config"))
575 (call-with-output-file
577 "/include/config/kernel.release")
579 (format p "~a-default~%" ,version)))
581 ;; Remove the '.install' and '..install.cmd' files; the
582 ;; latter contains store paths, which pulls in bootstrap
583 ;; binaries in the build environment, and prevents bit
584 ;; reproducibility for the bootstrap binaries.
585 (for-each delete-file (find-files out "\\.install"))
588 #:allowed-references ()
590 (home-page "https://www.gnu.org/software/linux-libre/")
591 (synopsis "GNU Linux-Libre kernel headers")
592 (description "Headers of the Linux-Libre kernel.")
593 (license license:gpl2)))
595 (define-public linux-libre-headers-5.12
596 (make-linux-libre-headers* linux-libre-5.12-version
597 linux-libre-5.12-source))
599 (define-public linux-libre-headers-5.10
600 (make-linux-libre-headers* linux-libre-5.10-version
601 linux-libre-5.10-source))
603 (define-public linux-libre-headers-5.4
604 (make-linux-libre-headers* linux-libre-5.4-version
605 linux-libre-5.4-source))
607 (define-public linux-libre-headers-4.19
608 (make-linux-libre-headers* linux-libre-4.19-version
609 linux-libre-4.19-source))
611 (define-public linux-libre-headers-4.14
612 (make-linux-libre-headers* linux-libre-4.14-version
613 linux-libre-4.14-source))
615 (define-public linux-libre-headers-4.9
616 (make-linux-libre-headers* linux-libre-4.9-version
617 linux-libre-4.9-source))
619 (define-public linux-libre-headers-4.4
620 (make-linux-libre-headers* linux-libre-4.4-version
621 linux-libre-4.4-source))
623 ;; The following package is used in the early bootstrap, and thus must be kept
624 ;; stable and with minimal build requirements.
625 (define-public linux-libre-headers-5.4.20
626 (make-linux-libre-headers "5.4.20"
627 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
629 (define-public linux-libre-headers linux-libre-headers-5.4.20)
633 ;;; Kernel configurations.
636 (define* (kernel-config arch #:key variant)
637 "Return the absolute file name of the Linux-Libre build configuration file
638 for ARCH and optionally VARIANT, or #f if there is no such configuration."
639 (let* ((name (string-append (if variant (string-append variant "-") "")
640 (if (string=? "i386" arch) "i686" arch) ".conf"))
641 (file (string-append "linux-libre/" name)))
642 (search-auxiliary-file file)))
644 (define %default-extra-linux-options
645 `(;; Some very mild hardening.
646 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
647 ;; All kernels should have NAMESPACES options enabled
648 ("CONFIG_NAMESPACES" . #t)
649 ("CONFIG_UTS_NS" . #t)
650 ("CONFIG_IPC_NS" . #t)
651 ("CONFIG_USER_NS" . #t)
652 ("CONFIG_PID_NS" . #t)
653 ("CONFIG_NET_NS" . #t)
654 ;; Various options needed for elogind service:
655 ;; https://issues.guix.gnu.org/43078
656 ("CONFIG_CGROUP_FREEZER" . #t)
657 ("CONFIG_BLK_CGROUP" . #t)
658 ("CONFIG_CGROUP_WRITEBACK" . #t)
659 ("CONFIG_CGROUP_SCHED" . #t)
660 ("CONFIG_CGROUP_PIDS" . #t)
661 ("CONFIG_CGROUP_FREEZER" . #t)
662 ("CONFIG_CGROUP_DEVICE" . #t)
663 ("CONFIG_CGROUP_CPUACCT" . #t)
664 ("CONFIG_CGROUP_PERF" . #t)
665 ("CONFIG_SOCK_CGROUP_DATA" . #t)
666 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
667 ("CONFIG_CGROUP_NET_PRIO" . #t)
668 ("CONFIG_CGROUP_NET_CLASSID" . #t)
669 ("CONFIG_MEMCG" . #t)
670 ("CONFIG_MEMCG_SWAP" . #t)
671 ("CONFIG_MEMCG_KMEM" . #t)
672 ("CONFIG_CPUSETS" . #t)
673 ("CONFIG_PROC_PID_CPUSET" . #t)
674 ;; Allow disk encryption by default
675 ("CONFIG_DM_CRYPT" . m)
676 ;; Modules required for initrd:
677 ("CONFIG_NET_9P" . m)
678 ("CONFIG_NET_9P_VIRTIO" . m)
679 ("CONFIG_VIRTIO_BLK" . m)
680 ("CONFIG_VIRTIO_NET" . m)
681 ("CONFIG_VIRTIO_PCI" . m)
682 ("CONFIG_VIRTIO_BALLOON" . m)
683 ("CONFIG_VIRTIO_MMIO" . m)
684 ("CONFIG_FUSE_FS" . m)
686 ("CONFIG_9P_FS" . m)))
688 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
689 (define %bpf-extra-linux-options
690 `(;; Needed for probes
691 ("CONFIG_UPROBE_EVENTS" . #t)
692 ("CONFIG_KPROBE_EVENTS" . #t)
693 ;; kheaders module also helpful for tracing
694 ("CONFIG_IKHEADERS" . #t)
696 ("CONFIG_BPF_SYSCALL" . #t)
697 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
698 ;; optional, for tc filters
699 ("CONFIG_NET_CLS_BPF" . m)
700 ;; optional, for tc actions
701 ("CONFIG_NET_ACT_BPF" . m)
702 ("CONFIG_BPF_JIT" . #t)
703 ;; for Linux kernel versions 4.1 through 4.6
704 ;; ("CONFIG_HAVE_BPF_JIT" . y)
705 ;; for Linux kernel versions 4.7 and later
706 ("CONFIG_HAVE_EBPF_JIT" . #t)
707 ;; optional, for kprobes
708 ("CONFIG_BPF_EVENTS" . #t)
710 ("CONFIG_IKHEADERS" . #t)))
712 (define (config->string options)
713 (string-join (map (match-lambda
715 (string-append option "=m"))
717 (string-append option "=y"))
719 (string-append option "=n")))
725 ;;; Kernel package utilities.
728 (define* (make-linux-libre version hash-string supported-systems
731 ;; A function that takes an arch and a variant.
732 ;; See kernel-config for an example.
733 (configuration-file #f)
734 (defconfig "defconfig")
735 (extra-options %default-extra-linux-options)
736 (patches (list %boot-logo-patch)))
737 (make-linux-libre* version
740 (uri (linux-libre-urls version))
741 (sha256 (base32 hash-string))
744 #:extra-version extra-version
745 #:configuration-file configuration-file
746 #:defconfig defconfig
747 #:extra-options extra-options))
749 (define* (make-linux-libre* version source supported-systems
752 ;; A function that takes an arch and a variant.
753 ;; See kernel-config for an example.
754 (configuration-file #f)
755 (defconfig "defconfig")
756 (extra-options %default-extra-linux-options))
758 (name (if extra-version
759 (string-append "linux-libre-" extra-version)
763 (supported-systems supported-systems)
764 (build-system gnu-build-system)
769 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
773 ;; These are needed to compile the GCC plugins.
778 ,@(match (and configuration-file
780 (system->linux-architecture
781 (or (%current-target-system) (%current-system)))
782 #:variant (version-major+minor version)))
783 (#f ;no config for this platform
786 `(("kconfig" ,config))))))
788 `(#:modules ((guix build gnu-build-system)
795 (modify-phases %standard-phases
796 (add-after 'unpack 'patch-/bin/pwd
798 (substitute* (find-files "." "^Makefile(\\.include)?$")
799 (("/bin/pwd") "pwd"))
802 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
803 ;; Avoid introducing timestamps
804 (setenv "KCONFIG_NOTIMESTAMP" "1")
805 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
807 ;; Set ARCH and CROSS_COMPILE
808 (let ((arch ,(system->linux-architecture
809 (or (%current-target-system)
810 (%current-system)))))
812 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
815 (setenv "CROSS_COMPILE" (string-append target "-"))
816 (format #t "`CROSS_COMPILE' set to `~a'~%"
817 (getenv "CROSS_COMPILE"))))
819 (setenv "EXTRAVERSION" ,(and extra-version
820 (string-append "-" extra-version)))
822 (let ((build (assoc-ref %standard-phases 'build))
823 (config (assoc-ref (or native-inputs inputs) "kconfig")))
825 ;; Use a custom kernel configuration file or a default
826 ;; configuration file.
829 (copy-file config ".config")
830 (chmod ".config" #o666))
831 (invoke "make" ,defconfig))
833 ;; Appending works even when the option wasn't in the
834 ;; file. The last one prevails if duplicated.
835 (let ((port (open-file ".config" "a"))
836 (extra-configuration ,(config->string extra-options)))
837 (display extra-configuration port)
840 (invoke "make" "oldconfig"))))
842 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
843 (let* ((out (assoc-ref outputs "out"))
844 (moddir (string-append out "/lib/modules"))
845 (dtbdir (string-append out "/lib/dtbs")))
846 ;; Install kernel image, kernel configuration and link map.
847 (for-each (lambda (file) (install-file file out))
848 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
849 ;; Install device tree files
850 (unless (null? (find-files "." "\\.dtb$"))
852 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
854 ;; Install kernel modules
857 ;; Disable depmod because the Guix system's module directory
858 ;; is an union of potentially multiple packages. It is not
859 ;; possible to use depmod to usefully calculate a dependency
860 ;; graph while building only one of those packages.
862 (string-append "MODULE_DIR=" moddir)
863 (string-append "INSTALL_PATH=" out)
864 (string-append "INSTALL_MOD_PATH=" out)
865 "INSTALL_MOD_STRIP=1"
867 (let* ((versions (filter (lambda (name)
868 (not (string-prefix? "." name)))
870 (version (match versions
872 ;; There are symlinks to the build and source directory,
873 ;; both of which will point to target /tmp/guix-build*
874 ;; and thus not be useful in a profile. Delete the symlinks.
875 (false-if-file-not-found
876 (delete-file (string-append moddir "/" version "/build")))
877 (false-if-file-not-found
878 (delete-file (string-append moddir "/" version "/source"))))
881 (home-page "https://www.gnu.org/software/linux-libre/")
882 (synopsis "100% free redistribution of a cleaned Linux kernel")
884 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
885 It has been modified to remove all non-free binary blobs.")
886 (license license:gpl2)
887 (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.
891 ;;; Generic kernel packages.
894 (define-public linux-libre-5.12
895 (make-linux-libre* linux-libre-5.12-version
896 linux-libre-5.12-source
897 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
898 #:configuration-file kernel-config))
900 (define-public linux-libre-version linux-libre-5.12-version)
901 (define-public linux-libre-pristine-source linux-libre-5.12-pristine-source)
902 (define-public linux-libre-source linux-libre-5.12-source)
903 (define-public linux-libre linux-libre-5.12)
905 (define-public linux-libre-5.10
906 (make-linux-libre* linux-libre-5.10-version
907 linux-libre-5.10-source
908 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
909 #:configuration-file kernel-config))
911 (define-public linux-libre-5.4
912 (make-linux-libre* linux-libre-5.4-version
913 linux-libre-5.4-source
914 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
915 #:configuration-file kernel-config))
917 (define-public linux-libre-4.19
918 (make-linux-libre* linux-libre-4.19-version
919 linux-libre-4.19-source
920 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
921 #:configuration-file kernel-config))
923 (define-public linux-libre-4.14
924 (make-linux-libre* linux-libre-4.14-version
925 linux-libre-4.14-source
926 '("x86_64-linux" "i686-linux" "armhf-linux")
927 #:configuration-file kernel-config))
929 (define-public linux-libre-4.9
930 (make-linux-libre* linux-libre-4.9-version
931 linux-libre-4.9-source
932 '("x86_64-linux" "i686-linux")
933 #:configuration-file kernel-config))
935 (define-public linux-libre-4.4
936 (make-linux-libre* linux-libre-4.4-version
937 linux-libre-4.4-source
938 '("x86_64-linux" "i686-linux")
939 #:configuration-file kernel-config
942 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
943 ;; This option was removed upstream in version 4.7.
944 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
945 %default-extra-linux-options)))
947 ;; Linux-Libre-LTS points to the *newest* released long-term support version of
949 ;; Reference: https://jxself.org/linux-libre/
951 (define-public linux-libre-lts-version linux-libre-5.10-version)
952 (define-public linux-libre-lts-pristine-source linux-libre-5.10-pristine-source)
953 (define-public linux-libre-lts-source linux-libre-5.10-source)
954 (define-public linux-libre-lts linux-libre-5.10)
958 ;;; Specialized kernel variants.
961 (define-public linux-libre-arm-generic
962 (make-linux-libre* linux-libre-version
965 #:defconfig "multi_v7_defconfig"
966 #:extra-version "arm-generic"
969 `(;; needed to fix the RTC on rockchip platforms
970 ("CONFIG_RTC_DRV_RK808" . #t))
971 %default-extra-linux-options)))
973 (define-public linux-libre-arm-veyron
974 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
976 (define-public linux-libre-arm-generic-5.10
977 (make-linux-libre* linux-libre-5.10-version
978 linux-libre-5.10-source
980 #:defconfig "multi_v7_defconfig"
981 #:extra-version "arm-generic"
984 `(;; needed to fix the RTC on rockchip platforms
985 ("CONFIG_RTC_DRV_RK808" . #t))
986 %default-extra-linux-options)))
988 (define-public linux-libre-arm-generic-5.4
989 (make-linux-libre* linux-libre-5.4-version
990 linux-libre-5.4-source
992 #:defconfig "multi_v7_defconfig"
993 #:extra-version "arm-generic"
996 `(;; needed to fix the RTC on rockchip platforms
997 ("CONFIG_RTC_DRV_RK808" . #t))
998 %default-extra-linux-options)))
1000 (define-public linux-libre-arm-generic-4.19
1001 (make-linux-libre* linux-libre-4.19-version
1002 linux-libre-4.19-source
1004 #:defconfig "multi_v7_defconfig"
1005 #:extra-version "arm-generic"))
1007 (define-public linux-libre-arm-generic-4.14
1008 (make-linux-libre* linux-libre-4.14-version
1009 linux-libre-4.14-source
1011 #:defconfig "multi_v7_defconfig"
1012 #:extra-version "arm-generic"))
1014 (define-public linux-libre-arm-omap2plus
1015 (make-linux-libre* linux-libre-version
1018 #:defconfig "omap2plus_defconfig"
1019 #:extra-version "arm-omap2plus"))
1021 (define-public linux-libre-arm-omap2plus-4.19
1022 (make-linux-libre* linux-libre-4.19-version
1023 linux-libre-4.19-source
1025 #:defconfig "omap2plus_defconfig"
1026 #:extra-version "arm-omap2plus"))
1028 (define-public linux-libre-arm-omap2plus-4.14
1029 (make-linux-libre* linux-libre-4.14-version
1030 linux-libre-4.14-source
1032 #:defconfig "omap2plus_defconfig"
1033 #:extra-version "arm-omap2plus"))
1035 (define-public linux-libre-arm64-generic
1036 (make-linux-libre* linux-libre-version
1039 #:defconfig "defconfig"
1040 #:extra-version "arm64-generic"
1043 `(;; needed to fix the RTC on rockchip platforms
1044 ("CONFIG_RTC_DRV_RK808" . #t)
1045 ;; Pinebook display, battery, charger and usb
1046 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1047 ("CONFIG_CHARGER_AXP20X" . m)
1048 ("CONFIG_INPUT_AXP20X_PEK" . m)
1049 ("CONFIG_CHARGER_AXP20X" . m)
1050 ("CONFIG_BATTERY_AXP20X" . m)
1051 ("CONFIG_PINCTRL_AXP209" . m)
1052 ("CONFIG_AXP20X_POWER" . m)
1053 ("CONFIG_AXP20X_ADC" . m)
1054 ;; Pinebook PRO battery and sound support
1055 ("CONFIG_BATTERY_CW2015" . m)
1056 ("CONFIG_CHARGER_GPIO" . m)
1057 ("CONFIG_SND_SOC_ES8316" . m))
1058 %default-extra-linux-options)))
1060 (define-public linux-libre-arm64-generic-5.10
1061 (make-linux-libre* linux-libre-5.10-version
1062 linux-libre-5.10-source
1064 #:defconfig "defconfig"
1065 #:extra-version "arm64-generic"
1068 `(;; needed to fix the RTC on rockchip platforms
1069 ("CONFIG_RTC_DRV_RK808" . #t)
1070 ;; Pinebook display, battery, charger and usb
1071 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1072 ("CONFIG_CHARGER_AXP20X" . m)
1073 ("CONFIG_INPUT_AXP20X_PEK" . m)
1074 ("CONFIG_CHARGER_AXP20X" . m)
1075 ("CONFIG_BATTERY_AXP20X" . m)
1076 ("CONFIG_PINCTRL_AXP209" . m)
1077 ("CONFIG_AXP20X_POWER" . m)
1078 ("CONFIG_AXP20X_ADC" . m)
1079 ;; Pinebook PRO battery and sound support
1080 ("CONFIG_BATTERY_CW2015" . m)
1081 ("CONFIG_CHARGER_GPIO" . m)
1082 ("CONFIG_SND_SOC_ES8316" . m))
1083 %default-extra-linux-options)))
1085 (define-public linux-libre-arm64-generic-5.4
1086 (make-linux-libre* linux-libre-5.4-version
1087 linux-libre-5.4-source
1089 #:defconfig "defconfig"
1090 #:extra-version "arm64-generic"
1093 `(;; needed to fix the RTC on rockchip platforms
1094 ("CONFIG_RTC_DRV_RK808" . #t))
1095 %default-extra-linux-options)))
1097 (define-public linux-libre-riscv64-generic
1098 (make-linux-libre* linux-libre-version
1101 #:extra-version "riscv64-generic"))
1103 (define-public linux-libre-mips64el-fuloong2e
1104 (make-linux-libre* linux-libre-version
1107 #:defconfig "fuloong2e_defconfig"
1108 #:extra-version "mips64el-fuloong2e"
1111 `(("CONFIG_OVERLAY_FS" . m))
1112 %default-extra-linux-options)))
1114 (define-public linux-libre-with-bpf
1115 (let ((base-linux-libre
1117 linux-libre-5.12-version
1118 linux-libre-5.12-source
1119 '("x86_64-linux" "i686-linux" "armhf-linux"
1120 "aarch64-linux" "riscv64-linux")
1121 #:extra-version "bpf"
1122 #:configuration-file kernel-config
1124 (append %bpf-extra-linux-options
1125 %default-extra-linux-options))))
1127 (inherit base-linux-libre)
1128 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
1133 ;;; Linux kernel modules.
1136 (define-public acpi-call-linux-module
1138 (name "acpi-call-linux-module")
1144 (url "https://github.com/nix-community/acpi_call")
1145 (commit (string-append "v" version))))
1146 (file-name (git-file-name name version))
1148 (base32 "0mr4rjbv6fj4phf038addrgv32940bphghw2v9n1z4awvw7wzkbg"))))
1149 (build-system linux-module-build-system)
1151 `(#:tests? #f ; no tests
1153 (modify-phases %standard-phases
1154 (add-before 'install 'patch-shebangs-harder
1155 ;; The (only) shebangs in examples/ don't justify a reference.
1156 ;; However, do substitute a more portable one than the original.
1158 (substitute* (find-files "examples" ".")
1159 (("^(#! *)/[^ ]*/" _ shebang)
1160 (string-append shebang "/usr/bin/env ")))
1162 (add-after 'install 'install-documentation
1163 (lambda* (#:key outputs #:allow-other-keys)
1164 (let* ((out (assoc-ref outputs "out"))
1165 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1166 (for-each (lambda (file)
1167 (let ((target (string-append doc "/" file)))
1168 (mkdir-p (dirname target))
1169 (copy-recursively file target)))
1170 (list "README.md" "examples"))
1172 (home-page "https://github.com/teleshoes/acpi_call")
1173 (synopsis "Linux kernel module to perform ACPI method calls")
1175 "This simple Linux kernel module allows calls from user space to any
1176 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1177 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1178 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1179 and @code{ACPI_BUFFER}.
1181 It grants direct and undocumented access to your hardware that may cause damage
1182 and should be used with caution, especially on untested models.")
1183 (license license:gpl3+))) ; see README.md (no licence headers)
1185 (define-public corefreq
1193 (url "https://github.com/cyring/CoreFreq")
1195 (file-name (git-file-name name version))
1197 (base32 "1k8pyxcahc78kcc8q1h76dr91i1r33jciqhgkajkz3xa28qx8mhn"))))
1198 (build-system linux-module-build-system)
1199 (outputs (list "out" "linux-module"))
1201 `(#:imported-modules ((guix build gnu-build-system)
1202 ,@%linux-module-build-system-modules)
1203 #:modules ((guix build linux-module-build-system)
1204 ((guix build gnu-build-system) #:prefix gnu:)
1207 (list (string-append "CC=" ,(cc-for-target))
1209 (string-append "PREFIX=" (assoc-ref %outputs "out")))
1210 #:tests? #f ; no test suite
1212 (modify-phases %standard-phases
1213 (add-after 'unpack 'untangle-module-targets
1214 ;; Having to build everything in one pass would complicate the
1215 ;; definition. Let each build system handle what it's good at.
1217 (substitute* "Makefile"
1218 ((".*MAKE.*KERNELDIR.*") ""))))
1219 (add-after 'build 'gnu:build
1220 (assoc-ref gnu:%standard-phases 'build))
1221 (add-after 'install 'gnu:install
1222 (assoc-ref gnu:%standard-phases 'install))
1223 (add-after 'install 'separate-module
1224 (lambda* (#:key outputs #:allow-other-keys)
1225 ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an
1226 ;; empty <out>/lib/modules directory, so just do it all by hand.
1227 (let* ((out (assoc-ref outputs "out"))
1228 (module (assoc-ref outputs "linux-module")))
1229 (mkdir-p (string-append module "/lib"))
1230 (rename-file (string-append out "/lib/modules")
1231 (string-append module "/lib/modules")))))
1232 (add-after 'install 'install-README
1233 ;; There is no proper documentation. Provide something.
1234 (lambda* (#:key outputs #:allow-other-keys)
1235 (let* ((out (assoc-ref outputs "out"))
1236 (doc (string-append out "/share/doc/"
1237 ,name "-" ,version)))
1238 (install-file "README.md" doc)))))))
1239 (home-page "https://github.com/cyring/CoreFreq")
1241 "Measure performance data & tweak low-level settings on x86-64 CPUs")
1243 "CoreFreq is a CPU monitor that reports low-level processor settings and
1244 performance data with notably high precision by using a loadable Linux kernel
1245 module. Unlike most similar tools, it can be used to modify some settings if
1246 supported by the hardware and at your own risk. It's designed for 64-bit x86
1247 Intel processors (Atom, Core2, Nehalem, SandyBridge, and newer) and compatible
1248 architectures like AMD@tie{}Zen and Hygon@tie{}Dhyana.
1250 Supported processor features include:
1252 @item time spent in C-states, including C1/C3 Auto- and UnDemotion;
1253 @item core temperatures, voltage, and tweaking thermal limits;
1254 @item core frequencies, ratios, and base clock rate;
1255 @item enabling, disabling, and testing SpeedStep (EIST), Turbo Boost, and
1256 Hyper-Threading or SMT;
1257 @item enabling or disabling data cache prefetching;
1258 @item kernel assembly code to keep as near as possible readings of performance
1259 counters such as the @acronym{TSC, Time Stamp Counter}, @acronym{UCC, Unhalted
1260 Core Cycles}, and @acronym{URC, Unhalted Reference Cycles};
1261 @item the number of instructions per cycle or second (IPS, IPC, and CPI);
1262 @item memory controller geometry and RAM timings;
1263 @item running processes' CPU affinity.
1266 This package provides the @command{corefreqd} data collection daemon, the
1267 @command{corefreq-cli} client to visualise and control it in real time, and the
1268 @code{corefreqk} kernel module in its own separate output. Read the included
1269 @file{README.md} before loading it.")
1270 (supported-systems (list "x86_64-linux"))
1271 (license license:gpl2)))
1273 (define-public librem-ec-acpi-linux-module
1275 (name "librem-ec-acpi-linux-module")
1281 (url "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
1282 (commit (string-append "v" version))))
1283 (file-name (git-file-name name version))
1285 (base32 "1qnbfj60i8nn2ahgj2zp5ixd79bb0wl1ld36x3igws2f3c0f5pfi"))))
1286 (build-system linux-module-build-system)
1288 `(#:tests? #f)) ; no test suite
1289 (home-page "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
1290 (synopsis "Linux kernel module to control the Librem Embedded Controller")
1292 "This is the Linux kernel @acronym{ACPI, Advanced Configuration and Power
1293 Interface} platform driver for the @acronym{EC, Embedded Controller} firmware
1294 on Purism Librem laptop computers. It allows user-space control over the
1295 battery charging thresholds, keyboard backlight, fans and thermal monitors,
1296 and the notification, WiFi, and Bluetooth LED.")
1297 (license license:gpl2)))
1299 (define-public rtl8812au-aircrack-ng-linux-module
1300 (let ((commit "059e06a51be025fde5b2bec6565540b3d9981b0b")
1303 (name "rtl8812au-aircrack-ng-linux-module")
1304 (version (git-version "5.6.4.2" revision commit))
1309 (url "https://github.com/aircrack-ng/rtl8812au")
1311 (file-name (git-file-name name version))
1313 (base32 "0h6l2r3yj7j9zf11dw0zcdyn50ajnjw8yvv86dzlfj80dn75n98f"))
1314 (modules '((guix build utils)))
1317 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1318 ;; and other unnecessary unlicenced things.
1319 (for-each delete-file-recursively (list "android"
1323 (build-system linux-module-build-system)
1326 (list (string-append "KSRC="
1327 (assoc-ref %build-inputs "linux-module-builder")
1328 "/lib/modules/build"))
1330 (modify-phases %standard-phases
1332 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1333 (apply invoke "make" make-flags))))
1334 #:tests? #f)) ; no test suite
1335 (supported-systems '("x86_64-linux" "i686-linux"))
1336 (home-page "https://github.com/aircrack-ng/rtl8812au")
1337 (synopsis "Linux driver for Realtek USB wireless network adapters")
1339 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1340 network adapters, modified by the aircrack-ng project to support monitor mode
1341 and frame injection. It provides a @code{88XXau} kernel module that supports
1342 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1343 (license license:gpl2+))))
1345 (define-public rtl8821ce-linux-module
1346 (let ((commit "897e7c4c15dd5a0a569745dc223d969a26ff5bfc")
1349 (name "rtl8821ce-linux-module")
1350 (version (git-version "0.0.0" revision commit))
1355 (url "https://github.com/tomaspinho/rtl8821ce")
1357 (file-name (git-file-name name version))
1360 "0935dzz0njxh78wfd17yqah1dxn6b3kaszvzclwwrwwhwcrdp80j"))))
1361 (build-system linux-module-build-system)
1365 (string-append "KSRC="
1366 (assoc-ref %build-inputs "linux-module-builder")
1367 "/lib/modules/build"))
1369 (modify-phases %standard-phases
1371 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1372 (apply invoke "make" make-flags))))
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 vhba-module
1382 (name "vhba-module")
1383 (version "20200106")
1387 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1388 version ".tar.bz2"))
1391 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1392 (build-system linux-module-build-system)
1396 (home-page "https://cdemu.sourceforge.io/")
1397 (synopsis "Kernel module that emulates SCSI devices")
1398 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1399 between the CDemu userspace daemon and linux kernel.")
1400 (license license:gpl2+)))
1402 (define-public bbswitch-module
1403 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
1404 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
1405 (let ((commit "ddbd243638c7bc2baecf43a78aff46cdc12e9b2e"))
1407 (name "bbswitch-module")
1408 (version (git-version "0.8" "1" commit))
1412 (url "https://github.com/Bumblebee-Project/bbswitch")
1414 (file-name (git-file-name name version))
1417 "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb"))))
1418 (build-system linux-module-build-system)
1422 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1423 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1424 (description "The bbswitch module provides a way to toggle the Nvidia
1425 graphics card on Optimus laptops.")
1426 (license license:gpl2))))
1428 (define-public ddcci-driver-linux
1430 (name "ddcci-driver-linux")
1437 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1438 (commit (string-append "v" version))))
1439 (file-name (git-file-name name version))
1442 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1443 (build-system linux-module-build-system)
1445 `(#:tests? #f ; no tests
1447 (modify-phases %standard-phases
1452 (with-directory-excursion module
1453 (apply (assoc-ref %standard-phases 'build) args)))
1454 '("ddcci" "ddcci-backlight"))
1460 (with-directory-excursion module
1461 (apply (assoc-ref %standard-phases 'install) args)))
1462 '("ddcci" "ddcci-backlight"))
1464 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1465 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1466 (description "This package provides two Linux kernel drivers, ddcci and
1467 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1468 interface. The ddcci module creates a character device for each DDC/CI
1469 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1470 module allows the control of the backlight level or luminance property when
1471 supported under @file{/sys/class/backlight/}.")
1472 (license license:gpl2+)))
1474 (define-public v4l2loopback-linux-module
1476 (name "v4l2loopback-linux-module")
1481 (url "https://github.com/umlaeute/v4l2loopback")
1482 (commit (string-append "v" version))))
1483 (file-name (git-file-name name version))
1486 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1487 (build-system linux-module-build-system)
1489 `(#:tests? #f)) ; no test suite
1490 (home-page "https://github.com/umlaeute/v4l2loopback")
1491 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1493 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1494 for Linux 2} applications will treat these as ordinary video devices but read
1495 video data generated by another application, instead of a hardware device such
1498 This lets you apply nifty effects to your Jitsi video, for example, but also
1499 allows some more serious things like adding streaming capabilities to an
1500 application by hooking GStreamer into the loopback device.")
1501 (license license:gpl2+)))
1505 ;;; Pluggable authentication modules (PAM).
1508 (define-public linux-pam
1516 "https://github.com/linux-pam/linux-pam/releases/download/v"
1517 version "/Linux-PAM-" version ".tar.xz"))
1520 "1z4jayf69qyyxln1gl6ch4qxfd66ib1g42garnrv2d8i1drl0790"))
1521 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1523 (build-system gnu-build-system)
1527 ;; TODO: optional dependencies
1528 ;; ("libxcrypt" ,libxcrypt)
1529 ;; ("cracklib" ,cracklib)
1532 `(;; Most users, such as `shadow', expect the headers to be under
1534 #:configure-flags (list (string-append "--includedir="
1535 (assoc-ref %outputs "out")
1536 "/include/security")
1538 ;; XXX: <rpc/rpc.h> is missing from glibc when
1539 ;; cross-compiling, so we have to disable NIS
1540 ;; support altogether.
1541 ,@(if (%current-target-system)
1545 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1548 (home-page "http://www.linux-pam.org/")
1549 (synopsis "Pluggable authentication modules for Linux")
1551 "A *Free* project to implement OSF's RFC 86.0.
1552 Pluggable authentication modules are small shared object files that can
1553 be used through the PAM API to perform tasks, like authenticating a user
1554 at login. Local and dynamic reconfiguration are its key features.")
1555 (license license:bsd-3)))
1557 (define-public linux-pam-1.2
1565 "http://www.linux-pam.org/library/"
1566 "Linux-PAM-" version ".tar.bz2"))
1569 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1570 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1572 (define-public python-pamela
1574 (name "python-pamela")
1578 ;; Tests not distributed in pypi release.
1581 (url "https://github.com/minrk/pamela")
1583 (file-name (git-file-name name version))
1586 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
1587 (build-system python-build-system)
1589 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
1591 (modify-phases %standard-phases
1592 (add-after 'unpack 'hardcode-pam.so
1593 (lambda* (#:key inputs #:allow-other-keys)
1594 (let ((pam (assoc-ref inputs "linux-pam")))
1595 (substitute* "pamela.py"
1596 (("find_library\\(\"pam\")")
1597 (string-append "'" pam "/lib/libpam.so'")))
1600 (lambda* (#:key tests? #:allow-other-keys)
1602 (if (file-exists? "test_pamela.py")
1603 (invoke "py.test" "--assert=plain" "test_pamela.py")
1604 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
1607 `(("linux-pam" ,linux-pam)))
1609 `(("python-pytest" ,python-pytest)))
1610 (home-page "https://github.com/minrk/pamela")
1611 (synopsis "PAM interface using ctypes")
1612 (description "This package provides a PAM interface using @code{ctypes}.")
1613 (license license:expat)))
1620 (define-public powerstat
1627 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1628 "powerstat/powerstat-" version ".tar.gz"))
1630 (base32 "18m85k83hryj05vix63fay1hh0sb9h87hy5r7g1dqg2y9i8lzgxk"))))
1631 (build-system gnu-build-system)
1634 (list (string-append "CC=" ,(cc-for-target))
1635 (string-append "prefix=" (assoc-ref %outputs "out")))
1636 #:tests? #f ; no test suite
1638 (modify-phases %standard-phases
1639 (delete 'configure)))) ; no configure script
1640 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1641 (synopsis "Measure system power consumption")
1643 "Powerstat measures and reports your computer's power consumption in real
1644 time. On mobile PCs, it uses ACPI battery information to measure the power
1645 drain of the entire system.
1647 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1648 domain measurements. These are available only on some hardware such as Intel
1649 Sandybridge and newer, and cover only part of the machine's components such as
1650 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1651 and don't require a battery at all.
1653 The output is like @command{vmstat} but also shows power consumption statistics:
1654 at the end of a run, @command{powerstat} will calculate the average, standard
1655 deviation, and minimum and maximum values. It can show a nice histogram too.")
1656 (license license:gpl2)))
1658 (define-public psmisc
1665 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1668 (base32 "0y8n1jd2dn4cvc5mh806d66qnq8xl0xmzczbycjwal10rvmcw33z"))))
1669 (build-system gnu-build-system)
1671 `(,@(if (%current-target-system)
1674 "ac_cv_func_malloc_0_nonnull=yes"
1675 "ac_cv_func_realloc_0_nonnull=yes"))
1677 (inputs `(("ncurses" ,ncurses)))
1678 (home-page "https://gitlab.com/psmisc/psmisc")
1679 (synopsis "Small utilities that use the proc file system")
1681 "This PSmisc package is a set of some small useful utilities that
1682 use the proc file system. We're not about changing the world, but
1683 providing the system administrator with some help in common tasks.")
1684 (license license:gpl2+)))
1686 (define-public util-linux
1692 (uri (string-append "mirror://kernel.org/linux/utils/"
1693 "util-linux/v" (version-major+minor version) "/"
1694 "util-linux-" version ".tar.xz"))
1697 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1698 (patches (search-patches "util-linux-tests.patch"))
1699 (modules '((guix build utils)))
1701 ;; We take 'nologin' from Shadow, the 'logger' program from
1702 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1704 (substitute* "configure"
1705 (("build_nologin=yes") "build_nologin=no")
1706 (("build_logger=yes") "build_logger=no")
1707 (("build_kill=yes") "build_kill=no"))
1709 (build-system gnu-build-system)
1710 (outputs '("out" ;6.4 MiB executables and documentation
1711 "lib" ;8.8 MiB shared libraries, headers and locales
1712 "static")) ;2.9 MiB static .a libraries
1714 `(#:configure-flags (list "--disable-use-tty-group"
1715 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1716 ;; Don't try to chown root:root mount and umount
1717 "--disable-makeinstall-chown"
1718 "--localstatedir=/var"
1719 (string-append "--localedir="
1720 (assoc-ref %outputs "lib")
1722 ;; Install completions where our
1723 ;; bash-completion package expects them.
1724 (string-append "--with-bashcompletiondir="
1725 (assoc-ref %outputs "out")
1726 "/etc/bash_completion.d"))
1728 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
1729 ;; <https://bugs.gnu.org/47791>.
1730 #:tests? ,(and (not (%current-target-system))
1731 (not (string-suffix? "-gnu" (%current-system))))
1733 #:phases (modify-phases %standard-phases
1734 (add-before 'configure 'patch-build-scripts
1735 (lambda* (#:key outputs #:allow-other-keys)
1736 (substitute* "configure"
1737 ;; The build system assumes that we want to install
1738 ;; libraries below $exec_prefix when $libdir does not
1739 ;; match any of the "usual" locations. Fix that.
1740 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1741 "usrlib_execdir=$libdir"))
1743 (add-before 'build 'set-umount-file-name
1744 (lambda* (#:key outputs #:allow-other-keys)
1745 ;; Tell 'eject' the right file name of 'umount'.
1746 (let ((out (assoc-ref outputs "out")))
1747 (substitute* "sys-utils/eject.c"
1748 (("\"/bin/umount\"")
1749 (string-append "\"" out "/bin/umount\"")))
1751 (add-before 'check 'pre-check
1752 (lambda* (#:key inputs outputs #:allow-other-keys)
1753 (let ((out (assoc-ref outputs "out"))
1754 (net (assoc-ref inputs "net-base")))
1755 ;; Change the test to refer to the right file.
1756 (substitute* "tests/ts/misc/mcookie"
1758 (string-append net "/etc/services")))
1760 ;; The C.UTF-8 locale does not exist in our libc.
1761 (substitute* "tests/ts/column/invalid-multibyte"
1762 (("C\\.UTF-8") "en_US.utf8"))
1764 ;; TODO: Remove the conditional on the next rebuild cycle.
1765 ,@(if (string-prefix? "arm" (%current-system))
1766 '((add-before 'check 'disable-setarch-test
1768 ;; The setarch tests are unreliable in QEMU's
1769 ;; user-mode emulation, which is our primary
1770 ;; method of building ARMv7 packages.
1771 ;; <https://github.com/karelzak/util-linux/issues/601>
1772 (substitute* "tests/ts/misc/setarch"
1773 (("ts_init_subtest.*" all)
1776 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1779 (add-after 'install 'move-static-libraries
1780 (lambda* (#:key outputs #:allow-other-keys)
1781 (let ((lib (assoc-ref outputs "lib"))
1782 (static (assoc-ref outputs "static")))
1784 ;; Move static libraries to the "static" output.
1785 (mkdir-p (string-append static "/lib"))
1786 (with-directory-excursion lib
1787 (for-each (lambda (file)
1789 (string-append static "/"
1791 (find-files "lib" "\\.a$"))
1793 ;; Remove references to the static library from the '.la'
1794 ;; files so that Libtool does the right thing when both
1795 ;; the shared and static library is available.
1796 (substitute* (find-files "lib" "\\.la$")
1797 (("old_library=.*") "old_library=''\n")))
1800 (add-after 'install 'adjust-pkg-config-files
1801 (lambda* (#:key outputs #:allow-other-keys)
1802 (let ((lib (assoc-ref outputs "lib")))
1803 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1804 ;; the pkg-config files to avoid a cyclic reference on "out".
1805 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1807 (("^(exec_)?prefix=.*") "")))
1809 (inputs `(("zlib" ,zlib)
1810 ("ncurses" ,ncurses)
1812 ;; XXX: This is so that the 'pre-check' phase can find it.
1813 ,@(if (%current-target-system)
1814 `(("net-base" ,net-base))
1818 ("net-base" ,net-base))) ;for tests
1819 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1820 (synopsis "Collection of utilities for the Linux kernel")
1821 (description "Util-linux is a diverse collection of Linux kernel
1822 utilities. It provides dmesg and includes tools for working with file systems,
1823 block devices, UUIDs, TTYs, and many other tools.")
1825 ;; Note that util-linux doesn't use the same license for all the
1826 ;; code. GPLv2+ is the default license for a code without an
1827 ;; explicitly defined license.
1828 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1829 license:bsd-4 license:public-domain))))
1831 ;; util-linux optionally supports udev, which allows lsblk to read file system
1832 ;; metadata without special privileges. Add it as a separate package to avoid
1833 ;; a circular dependency, and to keep the size small.
1834 (define-public util-linux+udev
1837 (name "util-linux-with-udev")
1840 ,@(package-inputs util-linux)))))
1842 (define-public ddate
1849 (url "https://github.com/bo0ts/ddate")
1850 (commit (string-append "v" version))))
1851 (file-name (git-file-name name version))
1853 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1854 (build-system cmake-build-system)
1855 (arguments '(#:tests? #f))
1856 (home-page "https://github.com/bo0ts/ddate")
1857 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1859 "ddate displays the Discordian date and holidays of a given date.
1860 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1861 by Robert Shea and Robert Anton Wilson.")
1862 (license license:public-domain)))
1864 (define-public fbset
1871 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1874 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1875 (build-system gnu-build-system)
1877 '(#:modules ((guix build gnu-build-system)
1881 (modify-phases %standard-phases
1882 (delete 'configure) ; no configure script
1883 (add-before 'install 'pre-install
1884 (lambda* (#:key outputs #:allow-other-keys)
1885 (let ((out (assoc-ref outputs "out")))
1886 (substitute* "Makefile"
1887 (("mknod ") "true ")
1888 ;; The Makefile doesn't honour PREFIX or similar.
1891 (with-directory-excursion out
1892 (for-each mkdir-p (list "sbin"
1896 (add-after 'install 'install-fb.modes
1897 (lambda* (#:key outputs #:allow-other-keys)
1898 (let* ((out (assoc-ref outputs "out"))
1899 (etc (string-append out "/etc")))
1900 (for-each (cut install-file <> etc)
1901 (find-files "etc" "^fb\\.modes"))
1902 (symlink "fb.modes.ATI"
1903 (string-append etc "/fb.modes"))
1905 ;; Parallel building races to create modes.tab.c.
1906 #:parallel-build? #f
1907 #:tests? #f)) ; no test suite
1911 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1912 (synopsis "Show and modify Linux frame buffer settings")
1914 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1915 different kinds of graphic displays. The @command{fbset} utility can query and
1916 change various device settings such as depth, virtual resolution, and timing
1918 (license license:gpl2)))
1920 (define-public procps
1926 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1927 "procps-ng-" version ".tar.xz"))
1930 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1931 (build-system gnu-build-system)
1933 `(#:modules ((guix build utils)
1934 (guix build gnu-build-system)
1937 ,@(if (%current-target-system)
1940 "ac_cv_func_malloc_0_nonnull=yes"
1941 "ac_cv_func_realloc_0_nonnull=yes"))
1944 (modify-phases %standard-phases
1946 'install 'post-install
1947 ;; Remove commands and man pages redudant with
1949 (lambda* (#:key outputs #:allow-other-keys)
1950 (let* ((out (assoc-ref outputs "out"))
1951 (dup (append-map (cut find-files out <>)
1952 '("^kill" "^uptime"))))
1953 (for-each delete-file dup)
1955 (inputs `(("ncurses" ,ncurses)))
1956 (home-page "https://gitlab.com/procps-ng/procps/")
1957 (synopsis "Utilities that give information about processes")
1959 "Procps is the package that has a bunch of small useful utilities
1960 that give information about processes using the Linux /proc file system.
1961 The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
1962 slabtop, tload, top, vmstat, w, watch and sysctl.")
1963 (license license:gpl2)))
1965 (define-public usbutils
1972 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1973 "usbutils-" version ".tar.xz"))
1975 (base32 "0f0klk6d3hmbpf6p4dcwa1qjzblmkhbxs1wsw87aidvqri7lj8wy"))))
1976 (build-system gnu-build-system)
1977 (outputs (list "out" "python"))
1980 (modify-phases %standard-phases
1981 (add-before 'bootstrap 'patch-bootstrap-scripts
1983 (substitute* "usbhid-dump/bootstrap"
1984 (("/bin/sh") (which "sh")))
1986 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1987 (substitute* "autogen.sh"
1988 (("^\\./configure.*") ""))
1990 (add-after 'install 'separate-python-output
1991 ;; Separating one Python script shaves more than 106 MiB from :out.
1992 (lambda* (#:key outputs #:allow-other-keys)
1993 (let ((out (assoc-ref outputs "out"))
1994 (out:python (assoc-ref outputs "python")))
1995 (for-each (lambda (file)
1996 (let ((old (string-append out "/" file))
1997 (new (string-append out:python "/" file)))
1998 (mkdir-p (dirname new))
1999 (rename-file old new)))
2000 (list "bin/lsusb.py"))
2005 ("python" ,python)))
2007 `(("autoconf" ,autoconf)
2008 ("automake" ,automake)
2009 ("libtool" ,libtool)
2010 ("pkg-config" ,pkg-config)))
2011 (home-page "http://www.linux-usb.org/")
2013 "Tools for working with USB devices, such as lsusb")
2015 "Tools for working with USB devices, such as lsusb.")
2016 (license license:gpl2+)))
2018 (define-public e2fsprogs
2025 "mirror://kernel.org/linux/kernel/people/tytso/"
2026 "e2fsprogs/v" version "/"
2027 "e2fsprogs-" version ".tar.xz"))
2030 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
2031 (build-system gnu-build-system)
2032 (inputs `(("util-linux" ,util-linux "lib")))
2033 (native-inputs `(("pkg-config" ,pkg-config)
2034 ("texinfo" ,texinfo) ;for the libext2fs Info manual
2038 ("procps" ,procps)))
2040 '(;; util-linux is the preferred source for some of the libraries and
2041 ;; commands, so disable them (see, e.g.,
2042 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
2043 #:configure-flags (list "--disable-libblkid"
2044 "--disable-libuuid" "--disable-uuidd"
2047 ;; Use symlinks instead of hard links for
2048 ;; 'fsck.extN' etc. This makes the resulting nar
2049 ;; smaller and is preserved across copies.
2050 "--enable-symlink-install"
2052 (string-append "LDFLAGS=-Wl,-rpath="
2053 (assoc-ref %outputs "out")
2056 ;; Install libext2fs et al.
2057 "--enable-elf-shlibs")
2060 (modify-phases %standard-phases
2061 (add-before 'configure 'patch-shells
2063 (substitute* "configure"
2064 (("/bin/sh (.*)parse-types.sh" _ dir)
2065 (string-append (which "sh") " " dir
2067 (substitute* "MCONFIG.in"
2068 (("INSTALL_SYMLINK = /bin/sh")
2069 "INSTALL_SYMLINK = sh"))
2070 (substitute* (find-files "." "^Makefile.in$")
2072 (string-append "#!" (which "sh"))))
2074 (add-after 'install 'install-libs
2075 (lambda* (#:key outputs #:allow-other-keys)
2076 (let* ((out (assoc-ref outputs "out"))
2077 (lib (string-append out "/lib")))
2078 (invoke "make" "install-libs")
2080 ;; Make the .a writable so that 'strip' works.
2081 ;; Failing to do that, due to debug symbols, we
2082 ;; retain a reference to the final
2083 ;; linux-libre-headers, which refer to the
2084 ;; bootstrap binaries.
2085 (let ((archives (find-files lib "\\.a$")))
2086 (for-each (lambda (file)
2090 (home-page "http://e2fsprogs.sourceforge.net/")
2091 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
2093 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
2094 (license (list license:gpl2 ;programs
2095 license:lgpl2.0 ;libext2fs
2096 license:x11)))) ;libuuid
2098 (define e2fsprogs/static
2100 (package (inherit e2fsprogs)
2102 ;; Do not build shared libraries.
2103 (substitute-keyword-arguments (package-arguments e2fsprogs)
2104 ((#:configure-flags _)
2105 '(list "--disable-blkid"))
2109 (define-public e2fsck/static
2111 (name "e2fsck-static")
2112 (version (package-version e2fsprogs))
2113 (build-system trivial-build-system)
2116 `(("e2fsprogs" ,e2fsprogs/static)))
2118 `(#:modules ((guix build utils))
2121 (use-modules (guix build utils)
2125 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
2127 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
2129 (with-directory-excursion bin
2130 (copy-file e2fsck "e2fsck")
2131 (remove-store-references "e2fsck")
2132 (chmod "e2fsck" #o555))
2134 (home-page (package-home-page e2fsprogs))
2135 (synopsis "Statically-linked e2fsck command from e2fsprogs")
2136 (description "This package provides statically-linked e2fsck command taken
2137 from the e2fsprogs package. It is meant to be used in initrds.")
2138 (license (package-license e2fsprogs))))
2140 (define-public extundelete
2142 (name "extundelete")
2147 (uri (string-append "mirror://sourceforge/extundelete/"
2148 "extundelete/" version "/extundelete-"
2149 version ".tar.bz2"))
2152 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
2153 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
2154 (build-system gnu-build-system)
2155 (inputs `(("e2fsprogs" ,e2fsprogs)))
2156 (home-page "http://extundelete.sourceforge.net/")
2157 (synopsis "Recover deleted files from ext2/3/4 partitions")
2159 "Extundelete is a set of tools that can recover deleted files from an
2160 ext3 or ext4 partition.")
2161 (license license:gpl2)))
2163 (define-public zerofree
2167 (home-page "https://frippery.org/uml/")
2170 (uri (string-append home-page name "-" version
2174 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
2175 (build-system gnu-build-system)
2178 (modify-phases %standard-phases
2179 (delete 'configure) ; no configure script
2181 ;; The Makefile lacks an ‘install’ target.
2182 (lambda* (#:key outputs #:allow-other-keys)
2183 (let* ((out (assoc-ref outputs "out"))
2184 (bin (string-append out "/bin")))
2185 (chmod "zerofree" #o555)
2186 (install-file "zerofree" bin)
2188 #:tests? #f)) ; no tests
2189 (inputs `(("libext2fs" ,e2fsprogs)))
2190 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
2192 "Zerofree finds the unallocated blocks with non-zero value content in an
2193 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
2194 This is a simple way to make disk images more compressible.
2195 Zerofree requires the file system to be unmounted or mounted read-only.")
2196 (license license:gpl2)))
2198 (define-public strace
2202 (home-page "https://strace.io")
2205 (uri (string-append home-page "/files/" version
2206 "/strace-" version ".tar.xz"))
2209 "1abs3svkg9985f4jrxx34sj1dcpsf95vv1a0g01c777zgygncjnz"))))
2210 (build-system gnu-build-system)
2213 (modify-phases %standard-phases
2214 (add-after 'unpack 'patch-/bin/sh
2216 (substitute* "strace.c"
2217 (("/bin/sh") (which "sh")))
2219 (add-after 'unpack 'disable-failing-tests
2221 ;; XXX These hang forever even if the test time-out is extended.
2222 (substitute* "tests/Makefile.in"
2223 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
2225 ;; Don't fail if the architecture doesn't support different personalities.
2226 #:configure-flags '("--enable-mpers=check")
2227 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
2228 #:parallel-tests? #f)) ; undeterministic failures
2229 (native-inputs `(("perl" ,perl)))
2230 (synopsis "System call tracer for Linux")
2232 "strace is a system call tracer, i.e. a debugging tool which prints out a
2233 trace of all the system calls made by a another process/program.")
2234 (license license:lgpl2.1+)))
2236 (define-public ltrace
2242 (uri (string-append "http://www.ltrace.org/ltrace_" version
2246 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
2247 (build-system gnu-build-system)
2248 (inputs `(("libelf" ,elfutils)))
2250 ;; Compilation uses -Werror by default, but it fails.
2251 '(#:configure-flags '("--disable-werror")))
2252 (home-page "https://www.ltrace.org/")
2253 (synopsis "Library call tracer for Linux")
2255 "ltrace intercepts and records dynamic library calls which are called by
2256 an executed process and the signals received by that process. It can also
2257 intercept and print the system calls executed by the program.")
2258 (license license:gpl2+)))
2260 (define-public alsa-lib
2267 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
2268 version ".tar.bz2"))
2271 "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp"))))
2272 (build-system gnu-build-system)
2274 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2275 (assoc-ref %outputs "out")
2277 (home-page "https://www.alsa-project.org/")
2278 (synopsis "The Advanced Linux Sound Architecture libraries")
2280 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2281 MIDI functionality to the Linux-based operating system.")
2282 (license license:lgpl2.1+)))
2284 (define-public alsa-utils
2290 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
2291 name "-" version ".tar.bz2"))
2294 "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq"))))
2295 (build-system gnu-build-system)
2297 ;; XXX: Disable man page creation until we have DocBook.
2298 '(#:configure-flags (list "--disable-xmlto"
2300 ;; The udev rule is responsible for restoring
2302 (string-append "--with-udev-rules-dir="
2303 (assoc-ref %outputs "out")
2304 "/lib/udev/rules.d"))
2306 (modify-phases %standard-phases
2307 (add-before 'check 'disable-broken-test
2309 ;; XXX: The 1.1.8 release tarball is missing a header that's
2310 ;; required for this test to work. Fixed in 1.1.9.
2311 (substitute* "axfer/test/Makefile"
2312 ((".*container-test.*") ""))
2315 'install 'pre-install
2317 ;; Don't try to mkdir /var/lib/alsa.
2318 (substitute* "Makefile"
2319 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2323 `(("gettext" ,gettext-minimal)))
2325 `(("libsamplerate" ,libsamplerate)
2326 ("ncurses" ,ncurses)
2327 ("alsa-lib" ,alsa-lib)
2329 (home-page "http://www.alsa-project.org/")
2330 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2332 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2333 MIDI functionality to the Linux-based operating system.")
2335 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2337 (license license:gpl2)))
2339 (define-public alsa-plugins
2341 (name "alsa-plugins")
2345 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2346 name "-" version ".tar.bz2"))
2349 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2350 (build-system gnu-build-system)
2351 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2352 ;; be split, there are references to both in files.
2353 ;; TODO: Remove OSS related plugins, they add support to run native
2354 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2356 (outputs '("out" "pulseaudio" "jack"))
2357 (native-search-paths
2358 (list (search-path-specification
2359 (variable "ALSA_PLUGIN_DIR")
2360 (files '("lib/alsa-lib"))
2363 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2364 ;; for /etc/alsa. On Guix System plugins are loaded from
2365 ;; the ALSA service, and other distributions likely
2366 ;; won't use these files.
2367 "--with-alsalconfdir=/tmp/noop")
2369 (modify-phases %standard-phases
2370 (add-after 'install 'split
2371 (lambda* (#:key inputs outputs #:allow-other-keys)
2372 ;; Distribute the binaries to the various outputs.
2373 (let* ((out (assoc-ref outputs "out"))
2374 (jack (assoc-ref outputs "jack"))
2375 (jacklib (string-append jack "/lib/alsa-lib"))
2376 (pua (assoc-ref outputs "pulseaudio"))
2377 (pualib (string-append pua "/lib/alsa-lib")))
2380 (for-each (lambda (file)
2381 (rename-file file (string-append jacklib "/" (basename file))))
2382 (find-files out ".*jack\\.(la|so)"))
2385 (for-each (lambda (file)
2386 (rename-file file (string-append pualib "/" (basename file))))
2387 (find-files out ".*pulse\\.(la|so)"))
2390 `(("alsa-lib" ,alsa-lib)
2392 ("speex" ,speex) ; libspeexdsp resampling plugin
2393 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2394 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2395 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2397 `(("pkg-config" ,pkg-config)))
2398 (home-page "http://www.alsa-project.org/")
2399 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2401 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2402 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2403 by providing additional plugins which include: upmixing, downmixing, jackd and
2404 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2405 external rate conversion.")
2406 (license (list license:gpl2+
2407 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2408 license:lgpl2.1+))))
2410 (define-public iptables
2417 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2419 (string-append "https://www.netfilter.org/projects/iptables/"
2420 "files/iptables-" version ".tar.bz2")))
2422 (base32 "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1"))))
2423 (build-system gnu-build-system)
2425 `(("pkg-config" ,pkg-config)
2429 `(("libmnl" ,libmnl)
2430 ("libnftnl" ,libnftnl)))
2432 '(#:tests? #f ; no test suite
2433 #:configure-flags ; add $libdir to the RUNPATH of executables
2434 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
2435 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2436 (synopsis "Programs to configure Linux IP packet filtering rules")
2438 "@command{iptables} is the user-space command line program used to
2439 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2440 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2442 This package also includes @command{ip6tables}, which is used to configure the
2445 Both commands are targeted at system administrators.")
2446 (license license:gpl2+)))
2448 (define-public jitterentropy-rngd
2450 (name "jitterentropy-rngd")
2456 (url "https://github.com/smuellerDD/jitterentropy-rngd")
2457 (commit (string-append "v" version))))
2458 (file-name (git-file-name name version))
2460 (base32 "1fb8zfwhwkl1d8n4cdn7rdv5rwd75qgc00d36pmkl7wgnj3c9xda"))))
2461 (build-system gnu-build-system)
2463 `(#:tests? #f ; no test suite
2465 (list (string-append "CC=" ,(cc-for-target))
2466 (string-append "PREFIX=" (assoc-ref %outputs "out"))
2467 "UNITDIR=$(PREFIX)/lib/systemd/system")
2469 (modify-phases %standard-phases
2470 (delete 'configure)))) ; no ./configure script
2471 (home-page "https://www.chronox.de/jent.html")
2472 (synopsis "CPU jitter random number generator daemon")
2474 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
2475 number generator} core to the kernel Linux's entropy estimator. This prevents
2476 the @file{/dev/random} device from blocking and should benefit users of the
2477 preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
2479 The CPU Jitter RNG itself is part of the kernel and claims to provide good
2480 entropy by collecting and magnifying differences in CPU execution time as
2481 measured by the high-resolution timer built into modern CPUs. It requires no
2482 additional hardware or external entropy source.
2484 The random bit stream generated by @command{jitterentropy-rngd} is not processed
2485 by a cryptographically secure whitening function. Nonetheless, its authors
2486 believe it to be a suitable source of cryptographically secure key material or
2487 other cryptographically sensitive data.
2489 If you agree with them, start this daemon as early as possible to provide
2490 properly seeded random numbers to services like SSH or those using TLS during
2491 early boot when entropy may be low, especially in virtualised environments.")
2492 (license (list license:bsd-3 ; or
2495 (define-public lsscsi
2502 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2505 "0jp458m2b3wckr18qkln69i01152qlwz33zm49103lq8fgx0n6d4"))))
2506 (build-system gnu-build-system)
2507 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2508 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2510 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2511 also list NVMe namespaces or controllers and show the relationship between a
2512 device's primary node name, its SCSI generic (sg) node name and its kernel
2514 (license license:gpl2)))
2516 (define-public ebtables
2523 "mirror://netfilter.org/ebtables/ebtables-"
2527 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2528 (build-system gnu-build-system)
2531 ("iptables" ,iptables)))
2532 (synopsis "Ethernet bridge frame table administration")
2533 (home-page "https://ebtables.netfilter.org/")
2535 "ebtables is an application program used to set up and maintain the
2536 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2537 analogous to the iptables application, but less complicated, due to the fact
2538 that the Ethernet protocol is much simpler than the IP protocol.")
2539 (license license:gpl2+)))
2541 (define-public iproute
2548 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2552 "0dhvdybfm33q9lz73sfnc24pxy2r42xywzb1gdgydjfafhvyb8kj"))))
2553 (build-system gnu-build-system)
2555 `( ;; There is a test suite, but it wants network namespaces and sudo.
2557 #:make-flags (let ((out (assoc-ref %outputs "out")))
2559 (string-append "CC=" ,(cc-for-target))
2561 (string-append "BASH_COMPDIR=" out
2562 "/etc/bash_completion.d")
2563 (string-append "LIBDIR=" out "/lib")
2564 (string-append "HDRDIR=" out "/include")
2565 (string-append "SBINDIR=" out "/sbin")
2566 (string-append "CONFDIR=" out "/etc")
2567 (string-append "DOCDIR=" out "/share/doc/"
2569 (string-append "MANDIR=" out "/share/man")))
2570 #:phases (modify-phases %standard-phases
2571 (add-before 'install 'pre-install
2573 ;; Don't attempt to create /var/lib/arpd.
2574 (substitute* "Makefile"
2575 (("^.*ARPDDIR.*$") ""))
2577 (add-after 'unpack 'patch-configure
2579 (let ((target ,(%current-target-system)))
2580 (substitute* "configure"
2583 (string-append target "-pkg-config")
2588 ("iptables" ,iptables)
2589 ("libmnl" ,libmnl)))
2593 ("pkg-config" ,pkg-config)))
2595 ;; ("libmnl" ,libmnl)
2596 ;; ("util-linux" ,util-linux)
2598 "https://wiki.linuxfoundation.org/networking/iproute2")
2600 "Utilities for controlling TCP/IP networking and traffic in Linux")
2602 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2603 and traffic with the Linux kernel. The most important of these are
2604 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2607 Most network configuration manuals still refer to ifconfig and route as the
2608 primary network configuration tools, but ifconfig is known to behave
2609 inadequately in modern network environments, and both should be deprecated.")
2610 (license license:gpl2+)))
2612 (define-public net-tools
2613 ;; XXX: This package is basically unmaintained, but it provides a few
2614 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2616 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2620 (version (string-append "1.60-" revision "." (string-take commit 7)))
2623 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2624 "n/ne/net-tools/code.git/net-tools-code-"
2626 (file-name (string-append name "-" version ".zip"))
2629 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2630 (home-page "http://net-tools.sourceforge.net/")
2631 (build-system gnu-build-system)
2633 `(#:modules ((guix build gnu-build-system)
2638 (modify-phases %standard-phases
2640 (lambda* (#:key outputs #:allow-other-keys)
2641 (let ((out (assoc-ref outputs "out")))
2642 (mkdir-p (string-append out "/bin"))
2643 (mkdir-p (string-append out "/sbin"))
2645 ;; Pretend we have everything...
2646 (system "yes | make config")
2648 ;; ... except for the things we don't have.
2649 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2650 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2651 ;; that have been removed.
2652 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2653 ;; think about adding them later.
2654 (substitute* '("config.make" "config.h")
2655 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2658 (add-after 'install 'remove-redundant-commands
2659 (lambda* (#:key outputs #:allow-other-keys)
2660 ;; Remove commands and man pages redundant with Inetutils.
2661 (let* ((out (assoc-ref outputs "out"))
2662 (dup (append-map (cut find-files out <>)
2664 "^(yp|nis|dns)?domainname"))))
2665 (for-each delete-file dup)
2667 ;; Binaries that depend on libnet-tools.a don't declare that
2668 ;; dependency, making it parallel-unsafe.
2669 #:parallel-build? #f
2671 #:tests? #f ; no test suite
2672 #:make-flags (let ((out (assoc-ref %outputs "out")))
2673 (list ,(string-append "CC=" (cc-for-target))
2674 (string-append "BASEDIR=" out)
2675 (string-append "INSTALLNLSDIR=" out "/share/locale")
2676 (string-append "mandir=/share/man")))))
2677 (native-inputs `(("gettext" ,gettext-minimal)
2679 (supported-systems (delete "i586-gnu" %supported-systems))
2680 (synopsis "Tools for controlling the network subsystem in Linux")
2682 "This package includes the important tools for controlling the network
2683 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2684 route. Additionally, this package contains utilities relating to particular
2685 network hardware types (plipconfig, slattach) and advanced aspects of IP
2686 configuration (iptunnel, ipmaddr).")
2687 (license license:gpl2+))))
2689 (define-public libcap-2.31
2696 "mirror://kernel.org/linux/libs/security/linux-privs/"
2697 "libcap2/libcap-" version ".tar.xz"))
2700 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2701 (build-system gnu-build-system)
2702 (arguments '(#:phases
2703 (modify-phases %standard-phases
2705 ;; Add $libdir to the RUNPATH of executables.
2707 (substitute* "Make.Rules"
2709 (string-append "LDFLAGS := -Wl,-rpath="
2712 #:test-target "test"
2713 #:make-flags (list "lib=lib"
2714 (string-append "prefix="
2715 (assoc-ref %outputs "out"))
2716 "RAISE_SETFCAP=no")))
2717 (native-inputs `(("perl" ,perl)))
2718 (supported-systems (delete "i586-gnu" %supported-systems))
2719 (home-page "https://sites.google.com/site/fullycapable/")
2720 (synopsis "Library for working with POSIX capabilities")
2722 "Libcap2 provides a programming interface to POSIX capabilities on
2723 Linux-based operating systems.")
2725 ;; License is BSD-3 or GPLv2, at the user's choice.
2726 (license license:gpl2)))
2728 ;; libcap 2.31 has problems with newer kernels, so provide this newer variant.
2729 ;; Keep the old libcap around to avoid rebuilding 'coreutils' and 'avahi'.
2730 ;; To be merged with libcap on the next rebuild cycle.
2731 (define-public libcap
2733 (inherit libcap-2.31)
2738 "mirror://kernel.org/linux/libs/security/linux-privs/"
2739 "libcap2/libcap-" version ".tar.xz"))
2742 "11ijmi7jik9iw6pdszc6bylhggghr8cza03bcrbhbqf0cpvkjrnn"))))
2744 (substitute-keyword-arguments (package-arguments libcap-2.31)
2746 `(modify-phases ,phases
2749 ;; Add $libdir to the RUNPATH of executables.
2750 (substitute* "Make.Rules"
2751 (("LDFLAGS \\?= #-g")
2752 (string-append "LDFLAGS ?= -Wl,-rpath="
2756 (define-deprecated libcap/next libcap)
2757 (export libcap/next)
2759 (define-public bridge-utils
2761 (name "bridge-utils")
2766 (uri (string-append "mirror://kernel.org/linux/kernel/people/shemminger/"
2767 "bridge-utils/bridge-utils-" version ".tar.xz"))
2769 (base32 "0zlrigizac2nfwgvksm92v4wafrpgxlbci3gwimc795ib7k8g6ck"))))
2770 (build-system gnu-build-system)
2772 ;; The tarball lacks all the generated files.
2773 (native-inputs `(("autoconf" ,autoconf)
2774 ("automake" ,automake)))
2777 (modify-phases %standard-phases
2778 (add-before 'bootstrap 'patch-stuff
2780 ;; Fix "field ‘ip6’ has incomplete type" errors.
2781 (substitute* "libbridge/libbridge.h"
2782 (("#include <linux/if_bridge.h>")
2783 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2785 ;; Ensure that the entire build fails if one of the
2786 ;; sub-Makefiles fails.
2787 (substitute* "Makefile.in"
2788 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2789 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2792 #:tests? #f)) ; no 'check' target
2794 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2795 (synopsis "Manipulate Ethernet bridges")
2797 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2798 to connect two Ethernet segments together in a protocol independent way.
2799 Packets are forwarded based on Ethernet address, rather than IP address (like
2800 a router). Since forwarding is done at Layer 2, all protocols can go
2801 transparently through a bridge.")
2802 (license license:gpl2+)))
2804 (define-public libnl
2811 "https://github.com/thom311/libnl/releases/download/"
2812 "libnl" (string-join (string-split version #\.) "_")
2813 "/libnl-" version ".tar.gz"))
2816 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2817 (build-system gnu-build-system)
2821 ("pkg-config" ,pkg-config)
2827 "https://github.com/thom311/libnl/releases/download/libnl"
2828 (string-join (string-split version #\.) "_")
2829 "/libnl-doc-" version ".tar.gz"))
2831 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2832 (outputs `("out" "doc"))
2835 (modify-phases %standard-phases
2836 (add-after 'install 'install-doc
2837 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2838 (let ((dest (string-append (assoc-ref outputs "doc")
2839 "/share/doc/libnl")))
2841 (invoke "tar" "xf" (assoc-ref
2842 (or native-inputs inputs)
2844 "--strip-components=1" "-C" dest)))))))
2845 (home-page "https://www.infradead.org/~tgr/libnl/")
2846 (synopsis "NetLink protocol library suite")
2848 "The libnl suite is a collection of libraries providing APIs to netlink
2849 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2850 between the kernel and user space processes. It was designed to be a more
2851 flexible successor to ioctl to provide mainly networking related kernel
2852 configuration and monitoring interfaces.")
2854 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2855 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2856 (license license:gpl2)))
2858 ;; libnl python extensions used to be outputs of libnl. However, as
2859 ;; cross-compiling python extensions is currently broken, create separate
2860 ;; packages for libnl python extensions.
2861 (define (libnl-python-package python)
2862 (let ((name (string-append "libnl-" python)))
2867 ((string=? python "python2")
2868 `(("python-2" ,python-2)))
2869 ((string=? python "python3")
2870 `(("python-3" ,python-3))))))
2871 (propagated-inputs `(("libnl" ,libnl)))
2874 `(#:modules ((guix build gnu-build-system)
2878 (modify-phases %standard-phases
2880 (lambda* (#:key inputs outputs #:allow-other-keys)
2881 (define (python-inst python)
2882 (invoke python "setup.py" "build")
2883 (invoke python "setup.py" "install"
2884 (string-append "--prefix="
2885 (assoc-ref %outputs "out")))
2886 (invoke python "setup.py" "clean"))
2887 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2888 (assoc-ref inputs "libnl")))
2889 (with-directory-excursion "./python" (python-inst ,python))
2892 (define-public libnl-python2 (libnl-python-package "python2"))
2893 (define-public libnl-python3 (libnl-python-package "python3"))
2902 "mirror://kernel.org/software/network/iw/iw-"
2906 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2907 (build-system gnu-build-system)
2908 (native-inputs `(("pkg-config" ,pkg-config)))
2909 (inputs `(("libnl" ,libnl)))
2912 (let* ((target ,(%current-target-system))
2913 (pkg-config (if target
2914 (string-append target "-pkg-config")
2917 ,(string-append "CC=" (cc-for-target))
2918 (string-append "PKG_CONFIG="
2919 (assoc-ref %build-inputs "pkg-config")
2921 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2922 #:phases (modify-phases %standard-phases (delete 'configure))))
2923 (home-page "https://wireless.wiki.kernel.org/")
2924 (synopsis "Tool for configuring wireless devices")
2926 "iw is a new nl80211 based CLI configuration utility for wireless
2927 devices. It replaces @code{iwconfig}, which is deprecated.")
2928 (license license:isc)))
2930 (define-public powertop
2938 (url "https://github.com/fenrus75/powertop")
2939 (commit (string-append "v" version))))
2940 (file-name (git-file-name name version))
2942 (base32 "1zkr2y5nb1nr22nq8a3zli87iyfasfq6489p7h1k428pv8k45w4f"))))
2943 (build-system gnu-build-system)
2946 (list "LDFLAGS=-pthread")
2948 (modify-phases %standard-phases
2949 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2950 ;; allow calibrating the network interface in Guix System.
2951 (add-after 'unpack 'patch-absolute-file-names
2952 (lambda* (#:key inputs #:allow-other-keys)
2953 (let ((kmod (assoc-ref inputs "kmod")))
2954 (substitute* (find-files "src" "\\.cpp$")
2955 ;; Give the right 'modprobe' file name so that essential
2956 ;; modules such as msr.ko can be loaded.
2957 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2958 ;; These programs are only needed to calibrate, so using
2959 ;; relative file names avoids adding extra inputs. When they
2960 ;; are missing powertop gracefully handles it.
2961 (("/usr/bin/hcitool") "hcitool")
2962 (("/usr/bin/xset") "xset")
2963 (("/usr/sbin/hciconfig") "hciconfig"))
2968 ("ncurses" ,ncurses)
2969 ("pciutils" ,pciutils)
2972 `(("autoconf" ,autoconf)
2973 ("automake" ,automake)
2974 ("gettext" ,gettext-minimal)
2975 ("libtool" ,libtool)
2976 ("pkg-config" ,pkg-config)))
2977 (home-page "https://01.org/powertop/")
2978 (synopsis "Analyze power consumption on Intel-based laptops")
2980 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2981 power management. In addition to being a diagnostic tool, PowerTOP also has
2982 an interactive mode where the user can experiment various power management
2983 settings for cases where the operating system has not enabled these
2985 (license license:gpl2)))
2987 (define-public aumix
2994 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2995 version ".tar.bz2"))
2998 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2999 (build-system gnu-build-system)
3000 (inputs `(("ncurses" ,ncurses)))
3001 (home-page "http://www.jpj.net/~trevor/aumix.html")
3002 (synopsis "Audio mixer for X and the console")
3004 "Aumix adjusts an audio mixer from X, the console, a terminal,
3005 the command line or a script.")
3006 (license license:gpl2+)))
3008 (define-public iotop
3015 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
3018 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
3019 (build-system python-build-system)
3022 (modify-phases %standard-phases
3023 (add-after 'unpack 'fix-build-with-python3
3025 (substitute* "setup.py"
3026 (("itervalues") "values"))
3028 ;; There are currently no checks in the package.
3030 (native-inputs `(("python" ,python)))
3031 (home-page "http://guichaz.free.fr/iotop/")
3033 "Displays the IO activity of running processes")
3035 "Iotop is a Python program with a top like user interface to show the
3036 processes currently causing I/O.")
3037 (license license:gpl2+)))
3045 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
3046 "download/fuse-" version
3047 "/fuse-" version ".tar.gz"))
3050 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
3051 (patches (search-patches "fuse-overlapping-headers.patch"))))
3052 (build-system gnu-build-system)
3053 (inputs `(("util-linux" ,util-linux)))
3055 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
3056 (assoc-ref %outputs "out")
3058 (string-append "INIT_D_PATH="
3059 (assoc-ref %outputs "out")
3062 ;; The rule makes /dev/fuse 666.
3063 (string-append "UDEV_RULES_PATH="
3064 (assoc-ref %outputs "out")
3065 "/lib/udev/rules.d"))
3067 (modify-phases %standard-phases
3068 (add-before 'build 'set-file-names
3069 (lambda* (#:key inputs #:allow-other-keys)
3070 ;; libfuse calls out to mount(8) and umount(8). Make sure
3071 ;; it refers to the right ones.
3072 (substitute* '("lib/mount_util.c" "util/mount_util.c")
3073 (("/bin/(u?)mount" _ maybe-u)
3074 (string-append (assoc-ref inputs "util-linux")
3075 "/bin/" maybe-u "mount")))
3076 (substitute* '("util/mount.fuse.c")
3080 ;; This hack leads libfuse to search for 'fusermount' in
3081 ;; $PATH, where it may find a setuid-root binary, instead of
3082 ;; trying solely $out/sbin/fusermount and failing because
3084 (substitute* "lib/Makefile"
3085 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
3086 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
3088 (supported-systems (delete "i586-gnu" %supported-systems))
3089 (home-page "https://github.com/libfuse/libfuse")
3090 (synopsis "Support file systems implemented in user space")
3092 "As a consequence of its monolithic design, file system code for Linux
3093 normally goes into the kernel itself---which is not only a robustness issue,
3094 but also an impediment to system extensibility. FUSE, for \"file systems in
3095 user space\", is a kernel module and user-space library that tries to address
3096 part of this problem by allowing users to run file system implementations as
3097 user-space processes.")
3098 (license (list license:lgpl2.1 ;library
3099 license:gpl2+)))) ;command-line utilities
3101 (define-public unionfs-fuse
3103 (name "unionfs-fuse")
3108 (url "https://github.com/rpodgorny/unionfs-fuse")
3109 (commit (string-append "v" version))))
3110 (file-name (git-file-name name version))
3113 "0bwx70x834qgqh53vqp18bhbxbsny80hz922rbgj8k9wj7cbfilm"))))
3114 (build-system cmake-build-system)
3116 `(("python" ,python)))
3117 (inputs `(("fuse" ,fuse)))
3119 ;; The tests were never actually run ("collected 0 items"), but in recent
3120 ;; versions of pytest that causes an error.
3122 (home-page "https://github.com/rpodgorny/unionfs-fuse")
3123 (synopsis "User-space union file system")
3125 "UnionFS-FUSE is a flexible union file system implementation in user
3126 space, using the FUSE library. Mounting a union file system allows you to
3127 \"aggregate\" the contents of several directories into a single mount point.
3128 UnionFS-FUSE additionally supports copy-on-write.")
3129 (license license:bsd-3)))
3132 (package (inherit fuse)
3133 (name "fuse-static")
3134 (source (origin (inherit (package-source fuse))
3135 (modules '((guix build utils)))
3138 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
3139 ;; updated. Change calls to 'mtab_needs_update' to 0 so
3140 ;; that it doesn't do that, allowing us to remove the
3141 ;; dependency on util-linux (something that is useful in
3143 (substitute* '("lib/mount_util.c"
3144 "util/mount_util.c")
3145 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
3151 (define-public unionfs-fuse/static
3152 (package (inherit unionfs-fuse)
3153 (synopsis "User-space union file system (statically linked)")
3154 (name (string-append (package-name unionfs-fuse) "-static"))
3155 (source (origin (inherit (package-source unionfs-fuse))
3156 (modules '((guix build utils)))
3159 ;; Add -ldl to the libraries, because libfuse.a needs that.
3160 (substitute* "src/CMakeLists.txt"
3161 (("target_link_libraries(.*)\\)" _ libs)
3162 (string-append "target_link_libraries"
3167 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
3169 (modify-phases %standard-phases
3170 (add-after 'install 'post-install
3171 (lambda* (#:key outputs #:allow-other-keys)
3172 (let* ((out (assoc-ref outputs "out"))
3173 (exe (string-append out "/bin/unionfs")))
3174 ;; By default, 'unionfs' keeps references to
3175 ;; $glibc/share/locale and similar stuff. Remove them.
3176 (remove-store-references exe)
3178 ;; 'unionfsctl' has references to glibc as well. Since
3179 ;; we don't need it, remove it.
3180 (delete-file (string-append out "/bin/unionfsctl"))
3182 (inputs `(("fuse" ,fuse-static)))))
3184 (define-public sshfs
3190 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
3191 "download/sshfs-" version "/sshfs-" version
3195 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
3196 (build-system gnu-build-system)
3201 `(("pkg-config" ,pkg-config)))
3202 (home-page "https://github.com/libfuse/sshfs")
3203 (synopsis "Mount remote file systems over SSH")
3205 "This is a file system client based on the SSH File Transfer Protocol.
3206 Since most SSH servers already support this protocol it is very easy to set
3207 up: on the server side there's nothing to do; on the client side mounting the
3208 file system is as easy as logging into the server with an SSH client.")
3209 (license license:gpl2+)))
3211 (define-public sshfs-fuse
3212 (package (inherit sshfs)
3214 (properties `((superseded . ,sshfs)))))
3216 (define-public archivemount
3218 (name "archivemount")
3223 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
3224 "archivemount-" version ".tar.gz"))
3226 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
3227 (build-system gnu-build-system)
3228 (inputs `(("fuse" ,fuse)
3229 ("libarchive" ,libarchive)))
3230 (native-inputs `(("pkg-config" ,pkg-config)))
3231 (home-page "https://www.cybernoia.de/software/archivemount.html")
3232 (synopsis "Tool for mounting archive files with FUSE")
3233 (description "archivemount is a FUSE-based file system for Unix variants,
3234 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
3235 mount point where it can be read from or written to as with any other file
3236 system. This makes accessing the contents of the archive, which may be
3237 compressed, transparent to other programs, without decompressing them.")
3238 (license license:lgpl2.0+)))
3240 (define-public numactl
3247 "https://github.com/numactl/numactl/releases/download/v"
3248 version "/numactl-" version ".tar.gz"))
3251 "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2"))))
3252 (build-system gnu-build-system)
3254 '(;; There's a 'test' target, but it requires NUMA support in the kernel
3255 ;; to run, which we can't assume to have.
3258 ;; NUMA is apparently not supported on armhf, see
3259 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
3260 (supported-systems (delete "armhf-linux" %supported-systems))
3261 (home-page "https://github.com/numactl/numactl")
3262 (synopsis "Tools for non-uniform memory access (NUMA) machines")
3264 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
3265 memory is not all in one place. The @command{numactl} program allows you to
3266 run your application program on specific CPUs and memory nodes. It does this
3267 by supplying a NUMA memory policy to the operating system before running your
3270 The package contains other commands, such as @command{numastat},
3271 @command{memhog}, and @command{numademo} which provides a quick overview of
3272 NUMA performance on your system.")
3273 (license (list license:gpl2 ;programs
3274 license:lgpl2.1)))) ;library
3276 (define-public kbd-neo
3283 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
3284 version "/linux/console/neo.map"))
3285 (file-name (string-append name "-" version ".map"))
3288 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
3289 (build-system trivial-build-system)
3291 `(#:modules ((guix build utils))
3293 (use-modules (guix build utils))
3294 (let ((out (string-append %output "/share/keymaps"))
3295 (source (assoc-ref %build-inputs "source")))
3297 (copy-file source (string-append out "/neo.map"))
3299 (home-page "https://neo-layout.org")
3300 (synopsis "Neo2 console layout")
3302 "Kbd-neo provides the Neo2 keyboard layout for use with
3303 @command{loadkeys(1)} from @code{kbd(4)}.")
3304 ;; The file is located in an svn directory, the entire content of
3305 ;; the directory is licensed as GPL3.
3306 (license license:gpl3+)))
3314 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
3318 "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m"))
3319 (modules '((guix build utils)))
3322 (substitute* '("src/unicode_start" "src/unicode_stop")
3323 ;; Assume the Coreutils are in $PATH.
3326 (build-system gnu-build-system)
3329 (modify-phases %standard-phases
3330 (add-before 'build 'pre-build
3331 (lambda* (#:key inputs #:allow-other-keys)
3332 (let ((bzip2 (assoc-ref inputs "bzip2"))
3333 (gzip (assoc-ref inputs "gzip"))
3334 (xz (assoc-ref inputs "xz"))
3335 (zstd (assoc-ref inputs "zstd")))
3336 (substitute* "src/libkbdfile/kbdfile.c"
3337 (("bzip2") (string-append bzip2 "/bin/bzip2"))
3338 (("gzip") (string-append gzip "/bin/gzip"))
3339 (("xz -d") (string-append xz "/bin/xz -d"))
3340 (("zstd") (string-append zstd "/bin/zstd"))))))
3341 (add-after 'install 'post-install
3342 (lambda* (#:key outputs #:allow-other-keys)
3343 ;; Make sure these programs find their comrades.
3344 (let* ((out (assoc-ref outputs "out"))
3345 (bin (string-append out "/bin")))
3346 (for-each (lambda (prog)
3347 (wrap-program (string-append bin "/" prog)
3348 `("PATH" ":" prefix (,bin))))
3349 '("unicode_start" "unicode_stop"))))))))
3351 `(("autoconf" ,autoconf)
3352 ("pkg-config" ,pkg-config)))
3359 (native-search-paths
3360 (list (search-path-specification
3361 (variable "LOADKEYS_KEYMAP_PATH")
3362 ;; Append ‘/**’ to recursively search all directories. One can then
3363 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
3364 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
3365 (files (list "share/keymaps/**")))))
3366 (home-page "http://kbd-project.org/")
3367 (synopsis "Linux keyboard utilities and keyboard maps")
3369 "This package contains keytable files and keyboard utilities compatible
3370 for systems using the Linux kernel. This includes commands such as
3371 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3372 (license license:gpl2+)))
3374 (define-public loadkeys-static
3377 (name "loadkeys-static")
3379 (substitute-keyword-arguments (package-arguments kbd)
3380 ((#:configure-flags flags ''())
3381 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
3382 "--disable-vlock" ;so we don't need libpam
3383 "--disable-libkeymap")
3385 ((#:make-flags flags ''())
3386 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
3387 ((#:phases phases '%standard-phases)
3388 `(modify-phases ,phases
3390 (lambda* (#:key outputs #:allow-other-keys)
3391 (let ((out (assoc-ref outputs "out")))
3392 ;; The binary keeps references to gzip, among other things,
3393 ;; which we don't need in the initrd, so strip references.
3394 (remove-store-references "src/loadkeys")
3396 (install-file "src/loadkeys"
3397 (string-append out "/bin")))))
3398 (delete 'post-install)))
3399 ((#:strip-flags _ '())
3401 ((#:allowed-references _ '())
3404 (synopsis "Statically-linked @command{loadkeys} program")
3406 ;; This package is meant to be used internally in the initrd so don't
3408 (properties '((hidden? . #t)))))
3410 (define-public inotify-tools
3412 (name "inotify-tools")
3413 (version "3.20.11.0")
3417 (url "https://github.com/rvoicilas/inotify-tools")
3419 (file-name (git-file-name name version))
3422 "1m8avqccrhm38krlhp88a7v949f3hrzx060bbrr5dp5qw2nmw9j2"))))
3423 (build-system gnu-build-system)
3425 `(("autoconf" ,autoconf)
3426 ("automake" ,automake)
3427 ("libtool" ,libtool)))
3430 (list "--disable-static")))
3431 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3432 (synopsis "Monitor file accesses")
3434 "The inotify-tools packages provides a C library and command-line tools
3435 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3436 (license license:gpl2+)))
3445 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3446 "kmod-" version ".tar.xz"))
3449 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3450 (patches (search-patches "kmod-module-directory.patch"))))
3451 (build-system gnu-build-system)
3453 `(("pkg-config" ,pkg-config)))
3458 `(#:configure-flags '("--with-xz" "--with-zlib"
3459 "--disable-test-modules")
3461 (modify-phases %standard-phases
3462 (add-after 'unpack 'disable-tests
3464 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3465 (substitute* "Makefile.in"
3466 (("testsuite/test-modprobe") "")
3467 (("testsuite/test-depmod") "")
3468 (("testsuite/test-blacklist") ""))
3470 (add-after 'install 'install-modprobe&co
3471 (lambda* (#:key outputs #:allow-other-keys)
3472 (let* ((out (assoc-ref outputs "out"))
3473 (bin (string-append out "/bin")))
3474 (for-each (lambda (tool)
3476 (string-append bin "/" tool)))
3477 '("insmod" "rmmod" "lsmod" "modprobe"
3478 "modinfo" "depmod"))
3480 (supported-systems (delete "i586-gnu" %supported-systems))
3481 (home-page "https://www.kernel.org/")
3482 (synopsis "Kernel module tools")
3483 (description "Kmod is a set of tools to handle common tasks with Linux
3484 kernel modules like insert, remove, list, check properties, resolve
3485 dependencies and aliases.
3487 These tools are designed on top of libkmod, a library that is shipped with
3488 kmod. The aim is to be compatible with tools, configurations and indices
3489 from the module-init-tools project.")
3490 (license license:gpl2+))) ; library under lgpl2.1+
3492 (define-public earlyoom
3499 (url "https://github.com/rfjakob/earlyoom")
3500 (commit (string-append "v" version))))
3501 (file-name (git-file-name name version))
3504 "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))))
3505 (build-system gnu-build-system)
3508 (modify-phases %standard-phases
3509 (delete 'configure) ; no configure script
3510 (add-before 'check 'set-go-HOME
3512 (setenv "HOME" (getcwd))
3514 (add-before 'check 'disable-failing-test
3516 ;; This test relies on writing to /proc/%d/oom_score_adj.
3517 (substitute* "testsuite_cli_test.go"
3519 (string-append "skipped" match)))
3521 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3522 (list ,(string-append "CC=" (cc-for-target))
3523 (string-append "VERSION=v" ,version)
3524 (string-append "PREFIX=" prefix)
3525 (string-append "SYSCONFDIR=" prefix "/etc")))
3526 #:test-target "test"))
3527 (native-inputs `(("go" ,go) ;for the test suite
3528 ("pandoc" ,pandoc))) ;to generate the manpage
3529 (home-page "https://github.com/rfjakob/earlyoom")
3530 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3531 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3532 runs in user space and provides a more responsive and configurable alternative
3533 to the in-kernel OOM killer.")
3534 (license license:expat)))
3536 (define-public eudev
3537 ;; The post-systemd fork, maintained by Gentoo.
3543 (uri (git-reference (url "https://github.com/gentoo/eudev")
3544 (commit (string-append "v" version))))
3545 (file-name (git-file-name name version))
3548 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3549 (patches (search-patches "eudev-rules-directory.patch"))))
3550 (build-system gnu-build-system)
3553 (modify-phases %standard-phases
3554 (add-after 'unpack 'make-source-writable
3556 ;; XXX: Git checkouts are read-only, but this package needs to
3557 ;; modify some of its files.
3558 (for-each make-file-writable (find-files "."))
3560 (add-before 'bootstrap 'patch-file-names
3561 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3562 (substitute* "man/make.sh"
3563 (("/usr/bin/xsltproc")
3564 (string-append (assoc-ref
3565 (or native-inputs inputs) "xsltproc")
3568 (add-before 'configure 'patch-bindir-in-btrfs-rules
3569 (lambda* (#:key outputs #:allow-other-keys)
3570 ;; The "@bindir@" substitution incorrectly expands to a literal
3571 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3573 (let ((out (assoc-ref outputs "out")))
3574 (substitute* "rules/64-btrfs.rules.in"
3576 (string-append out "/bin")))
3578 (add-after 'install 'move-static-library
3579 (lambda* (#:key outputs #:allow-other-keys)
3580 (let* ((out (assoc-ref outputs "out"))
3581 (static (assoc-ref outputs "static"))
3582 (source (string-append out "/lib/libudev.a"))
3583 (target (string-append static "/lib/libudev.a")))
3584 (mkdir-p (dirname target))
3585 (link source target)
3586 (delete-file source)
3587 ;; Remove reference to the static library from the .la file
3588 ;; such that Libtool looks for it in the usual places.
3589 (substitute* (string-append out "/lib/libudev.la")
3591 "old_library=''\n"))
3593 (add-after 'install 'build-hwdb
3594 (lambda* (#:key outputs #:allow-other-keys)
3595 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3596 ;; similar tools to display product names.
3598 ;; XXX: This can't be done when cross-compiling. Find another way
3599 ;; to generate hwdb.bin for cross-built systems.
3600 (let ((out (assoc-ref outputs "out")))
3601 ,@(if (%current-target-system)
3603 '((invoke (string-append out "/bin/udevadm")
3604 "hwdb" "--update")))))))
3605 #:configure-flags (list "--enable-manpages")))
3607 `(("autoconf" ,autoconf)
3608 ("automake" ,automake)
3610 ("libtool" ,libtool)
3611 ("pkg-config" ,pkg-config)
3614 ("python" ,python-wrapper)
3615 ;; For documentation.
3616 ("docbook-xml" ,docbook-xml-4.2)
3617 ("docbook-xsl" ,docbook-xsl)
3618 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3619 ("xsltproc" ,libxslt)))
3621 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3622 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3623 ;; which contains the rules to do that.
3624 `(("util-linux" ,util-linux "lib") ;for blkid
3626 (outputs '("out" "static"))
3627 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3628 (synopsis "Userspace device management")
3629 (description "Udev is a daemon which dynamically creates and removes
3630 device nodes from /dev/, handles hotplug events and loads drivers at boot
3632 (license license:gpl2+)))
3634 (define-public python-evdev
3636 (name "python-evdev")
3641 (uri (pypi-uri "evdev" version))
3643 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3644 (build-system python-build-system)
3646 `(("kernel-headers" ,linux-libre-headers)))
3648 `(#:tests? #f ;no rule for tests
3650 (modify-phases %standard-phases
3651 (add-before 'build 'fix-hard-coded-directory
3652 (lambda* (#:key inputs #:allow-other-keys)
3653 (substitute* "setup.py"
3654 (("/usr/include/linux")
3656 (assoc-ref inputs "kernel-headers") "/include/linux")))
3658 (home-page "https://github.com/gvalkov/python-evdev")
3659 (synopsis "Bindings to the Linux input handling subsystem")
3661 "Python-evdev provides bindings to the generic input event interface in
3662 Linux. The @code{evdev} interface serves the purpose of passing events
3663 generated in the kernel directly to userspace through character devices that
3664 are typically located in @file{/dev/input/}.
3666 This package also comes with bindings to @code{uinput}, the userspace input
3667 subsystem. @code{uinput} allows userspace programs to create and handle input
3668 devices that can inject events directly into the input subsystem.")
3669 (license license:bsd-3)))
3671 (define-public interception-tools
3673 (name "interception-tools")
3675 (home-page "https://gitlab.com/interception/linux/tools")
3680 (commit (string-append "v" version))))
3681 (file-name (git-file-name name version))
3684 "0k9h14a9d65nwvv7pj0kigjgzfv453mm3r4svnxfg1h5lccmy8jj"))))
3685 (build-system cmake-build-system)
3688 ("libevdev" ,libevdev)
3690 ("yaml-cpp" ,yaml-cpp)))
3693 (modify-phases %standard-phases
3694 (add-after 'unpack 'fix-libevdev-path
3695 (lambda* (#:key inputs #:allow-other-keys)
3696 (let ((libevdev (assoc-ref inputs "libevdev")))
3697 (substitute* "CMakeLists.txt"
3698 (("/usr/include/libevdev-1.0")
3699 (string-append libevdev "/include/libevdev-1.0")))
3701 ;; No tests are included.
3703 (synopsis "Utilities for operating on input events of evdev devices")
3705 "Interception Tools provides a composable infrastructure on top of
3706 @code{libudev} and @code{libevdev}. The following utilities are provided:
3709 @item @command{udevmon} --- monitor input devices for launching tasks
3710 @item @command{intercept} --- redirect device input events to stdout
3711 @item @command{uinput} --- redirect device input events from stding to virtual device
3712 @item @command{mux} --- mux streams of input events
3714 ;; Dual-licensed under GPLv3+ or "something else" on request, per
3716 (license license:gpl3+)))
3718 (define-public interception-dual-function-keys
3720 (name "interception-dual-function-keys")
3722 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
3728 (file-name (git-file-name name version))
3731 "1gvhkmwzl5fyyc7k8rc4rf2b9mzh05wa8wcybf9hz2x1mqkc7lmz"))))
3732 (build-system gnu-build-system)
3734 `(("libevdev" ,libevdev)
3735 ("yaml-cpp" ,yaml-cpp)))
3737 `(#:make-flags (list "CC=gcc" "CXX=g++"
3738 (string-append "PREFIX=" (assoc-ref %outputs "out")))
3740 (modify-phases %standard-phases
3741 (add-after 'unpack 'fix-libevdev-path
3742 (lambda* (#:key inputs #:allow-other-keys)
3743 (let ((libevdev (assoc-ref inputs "libevdev")))
3744 (substitute* "config.mk"
3745 (("/usr/include/libevdev-1.0")
3746 (string-append libevdev "/include/libevdev-1.0")))
3748 ;; No configure script
3750 ;; No target 'check'
3752 (synopsis "Tap for one key, hold for another")
3754 "Dual Function Keys is a plugin for @code{interception-tools} that allows
3755 one to send arbitrary keycodes when a given key is tapped or held.")
3756 (license license:expat)))
3764 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
3766 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3770 "1m4xpda8vbyd89ca0w8nacvnl4j34yzsa625gn990fb5sh84ab44"))
3771 (modules '((guix build utils)))
3774 (use-modules (guix build utils))
3776 ;; Honor sysconfdir.
3777 (substitute* "make.tmpl.in"
3779 "confdir = @sysconfdir@\n")
3780 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3781 "DEFAULT_SYS_DIR = @sysconfdir@"))
3783 (patches (search-patches "lvm2-static-link.patch"))))
3784 (build-system gnu-build-system)
3786 `(("pkg-config" ,pkg-config)
3787 ("procps" ,procps))) ;tests use 'pgrep'
3789 `(("libaio" ,libaio)
3793 (modify-phases %standard-phases
3794 (add-after 'configure 'set-makefile-shell
3796 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3798 (setenv "SHELL" (which "sh"))
3800 ;; Replace /bin/sh with the right file name.
3801 (patch-makefile-SHELL "make.tmpl")
3804 #:configure-flags (list (string-append "--sysconfdir="
3805 (assoc-ref %outputs "out")
3807 "--enable-udev_sync"
3808 "--enable-udev_rules"
3809 "--enable-pkgconfig"
3811 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3813 ;; Make sure programs such as 'dmsetup' can
3814 ;; find libdevmapper.so.
3815 (string-append "LDFLAGS=-Wl,-rpath="
3816 (assoc-ref %outputs "out")
3818 (assoc-ref %outputs "out")
3819 "/lib/device-mapper")
3820 ;; This is needed when cross-compiling.
3821 ,@(if (%current-target-system)
3822 '("ac_cv_func_malloc_0_nonnull=yes"
3823 "ac_cv_func_realloc_0_nonnull=yes")
3826 ;; The tests use 'mknod', which requires root access.
3828 (supported-systems (delete "i586-gnu" %supported-systems))
3829 (home-page "https://sourceware.org/lvm2/")
3830 (synopsis "Logical volume management for Linux")
3832 "LVM2 is the logical volume management tool set for Linux-based systems.
3833 This package includes the user-space libraries and tools, including the device
3834 mapper. Kernel components are part of Linux-libre.")
3836 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3837 ;; Command-line tools are GPLv2.
3838 (license (list license:gpl2 license:lgpl2.1))))
3840 (define-public lvm2-static
3843 (name "lvm2-static")
3845 ;; Propagate udev because libdevmapper.a depends on libudev.
3846 (propagated-inputs `(("udev:static" ,eudev "static")))
3849 (substitute-keyword-arguments (package-arguments lvm2)
3850 ((#:configure-flags flags '())
3851 ;; LVM2 doesn't use Libtool, hence the custom option.
3852 `(append '("--enable-static_link")
3853 ;; Building dmeventd statically is complicated due to a
3854 ;; requirement on libdevmapper.a, which is being phased out
3855 ;; in favor of libdevice-mapper.a, which in turn is is not
3856 ;; easily made available at dmeventd build time. Just ignore
3857 ;; it until the situation improves.
3858 (delete "--enable-dmeventd" ,flags)))
3860 `(modify-phases ,phases
3861 (add-before 'configure 'adjust-Makefile
3863 ;; These fixes are related to the upstream libdm->device_mapper
3864 ;; migration and will hopefully be fixed upstream in due time.
3865 (substitute* "tools/Makefile.in"
3866 ;; This variable is empty in a static configuration and causes
3867 ;; an erroneous GCC command line.
3868 (("-L\\$\\(interfacebuilddir\\)") "")
3869 ;; Remove obsolete reference to libdevmapper.a.
3870 (("-ldevmapper") ""))
3872 (synopsis "Logical volume management for Linux (statically linked)")))
3874 (define-public thin-provisioning-tools
3876 (name "thin-provisioning-tools")
3882 (url "https://github.com/jthornber/thin-provisioning-tools")
3883 (commit (string-append "v" version))))
3884 (file-name (git-file-name name version))
3886 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
3887 (build-system gnu-build-system)
3889 ;; Doesn't build with --enable-testing due to a function name collision
3890 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
3893 `(("automake" ,automake)
3894 ("autoreconf" ,autoconf)))
3898 ("libaio" ,libaio)))
3899 (synopsis "Tools for manipulating the metadata of device-mapper targets")
3900 (description "A suite of tools for manipulating the metadata of the
3901 dm-thin, dm-cache and dm-era device-mapper targets.")
3902 (home-page "https://github.com/jthornber/thin-provisioning-tools")
3903 (license license:gpl3+)))
3905 (define-public wireless-tools
3907 (name "wireless-tools")
3911 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3915 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3918 ;; Remove the older header files that are not free software.
3919 (for-each (lambda (n)
3920 (delete-file (format #f "wireless.~a.h" n)))
3921 '(10 11 12 13 14 15 16 17 18 19 20))
3923 (build-system gnu-build-system)
3926 (list (string-append "PREFIX=" %output)
3927 (string-append "INSTALL_MAN=" %output "/share/man")
3928 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3931 (modify-phases %standard-phases
3933 (lambda* (#:key target #:allow-other-keys)
3934 (when ,(%current-target-system)
3935 ;; Cross-compilation: use the cross tools.
3936 (substitute* (find-files "." "Makefile")
3938 (string-append "CC = " target "-gcc\n"))
3940 (string-append "AR = " target "-ar\n"))
3942 (string-append "RANLIB = " target "-ranlib\n"))))
3945 (synopsis "Tools for manipulating Linux Wireless Extensions")
3946 (description "Wireless Tools are used to manipulate the now-deprecated
3947 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3948 Extension was an interface allowing you to set Wireless LAN specific
3949 parameters and get the specific stats. It is deprecated in favor the nl80211
3951 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3952 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3953 ;; other files are distributed under gpl2.
3954 (license (list license:gpl2 license:lgpl2.1+))))
3962 (uri (string-append "mirror://kernel.org/software/network/crda/"
3963 "crda-" version ".tar.xz"))
3966 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3967 (patches (search-patches "crda-optional-gcrypt.patch"))))
3968 (build-system gnu-build-system)
3970 `(#:phases (modify-phases %standard-phases
3972 (add-after 'unpack 'gzip-determinism
3974 (substitute* "Makefile"
3975 (("gzip") "gzip --no-name"))
3977 ,@(if (%current-target-system)
3979 'unpack 'fix-pkg-config
3980 (lambda* (#:key target #:allow-other-keys)
3984 (string-append target "-pkg-config")))
3988 'build 'no-werror-no-ldconfig
3990 (substitute* "Makefile"
3992 (("ldconfig") "true"))
3995 'build 'set-regulator-db-file-name
3996 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3997 ;; Tell CRDA where to find our database.
3998 (let ((regdb (assoc-ref (or native-inputs inputs)
4000 (substitute* "crda.c"
4001 (("\"/lib/crda/regulatory.bin\"")
4002 (string-append "\"" regdb
4003 "/lib/crda/regulatory.bin\"")))
4005 #:test-target "verify"
4006 #:make-flags (let ((out (assoc-ref %outputs "out"))
4007 (regdb (assoc-ref %build-inputs "wireless-regdb")))
4009 (string-append "CC=" ,(cc-for-target))
4012 ;; Disable signature-checking on 'regulatory.bin'.
4013 ;; The reason is that this simplifies maintenance
4014 ;; on our side (no need to manage a distro key
4015 ;; pair), and we can guarantee integrity of
4016 ;; 'regulatory.bin' by other means anyway, such as
4017 ;; 'guix gc --verify'. See
4018 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
4022 (string-append "PREFIX=" out)
4023 (string-append "SBINDIR=" out "/sbin/")
4024 (string-append "UDEV_RULE_DIR="
4025 out "/lib/udev/rules.d")
4026 (string-append "LDFLAGS=-Wl,-rpath="
4028 (string-append "REG_BIN=" regdb
4029 "/lib/crda/regulatory.bin")
4031 (native-inputs `(("pkg-config" ,pkg-config)
4032 ("wireless-regdb" ,wireless-regdb)))
4033 (inputs `(("libnl" ,libnl)))
4035 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
4036 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
4038 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
4039 communication between the kernel Linux and user space for regulatory
4041 (license license:copyleft-next)))
4043 (define-public wireless-regdb
4045 (name "wireless-regdb")
4046 (version "2020.11.20")
4050 "mirror://kernel.org/software/network/wireless-regdb/"
4051 "wireless-regdb-" version ".tar.xz"))
4054 "0liagyi6ppf5w474qk9j4jz5gbvvn8mc8al1dq4b1xrgv28485ml"))
4056 ;; We're building 'regulatory.bin' by ourselves.
4058 (delete-file "regulatory.bin")
4060 (build-system gnu-build-system)
4063 (modify-phases %standard-phases
4064 (add-after 'unpack 'gzip-determinism
4066 (substitute* "Makefile"
4067 (("gzip") "gzip --no-name"))
4069 (add-after 'unpack 'omit-signature
4071 (substitute* "Makefile"
4072 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
4073 ;; don't provide (see below). Disable it.
4074 ((" regulatory\\.db\\.p7s") "")
4075 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
4076 ;; but ‘make install’ depends only on the latter while installing
4077 ;; both (and failing). Depend on it explicitly.
4078 (("^install: " all) (string-append all "regulatory.db ")))
4080 (delete 'configure)) ; no configure script
4082 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
4083 ;; is computed and can be equal to 'maintainer-clean'; when that
4084 ;; happens, we can end up deleting the 'regulatory.bin' file that we
4085 ;; just built. Thus, build things sequentially.
4086 #:parallel-build? #f
4088 #:tests? #f ; no tests
4090 (let ((out (assoc-ref %outputs "out")))
4091 (list (string-append "PREFIX=" out)
4092 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
4094 ;; Leave this empty so that db2bin.py doesn't try to sign
4095 ;; ‘regulatory.bin’. This allows us to avoid managing a key
4096 ;; pair for the whole distribution.
4097 (string-append "REGDB_PRIVKEY=")
4098 ;; Don't generate a public key for the same reason. These are
4099 ;; used as Makefile targets and can't be the empty string.
4100 (string-append "REGDB_PUBCERT=/dev/null")
4101 (string-append "REGDB_PUBKEY=/dev/null")))))
4103 `(("python" ,python-wrapper)))
4105 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
4106 (synopsis "Wireless regulatory database")
4108 "This package contains the wireless regulatory database for the Central
4109 Regulatory Database Agent (CRDA). The database contains information on
4110 country-specific regulations for the wireless spectrum.")
4111 (license license:isc)))
4113 (define-public lm-sensors
4121 (url "https://github.com/groeck/lm-sensors")
4122 (commit (string-append "V" (string-join
4123 (string-split version #\.) "-")))))
4124 (file-name (git-file-name name version))
4126 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
4127 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
4128 (build-system gnu-build-system)
4129 (inputs `(("rrdtool" ,rrdtool)
4132 ("gnuplot" ,gnuplot)))
4133 (native-inputs `(("pkg-config" ,pkg-config)
4137 (outputs '("lib" ; avoid perl in closure
4140 `(#:tests? #f ; no 'check' target
4141 #:make-flags (list (string-append "PREFIX=" %output)
4142 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
4143 (string-append "INCLUDEDIR="
4144 (assoc-ref %outputs "lib") "/include")
4145 (string-append "MANDIR=" %output "/share/man")
4146 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
4148 (modify-phases %standard-phases
4150 (add-before 'build 'patch-exec-paths
4151 (lambda* (#:key inputs outputs #:allow-other-keys)
4152 (substitute* "prog/detect/sensors-detect"
4154 (string-append "`" (assoc-ref inputs "coreutils")
4156 (("(`|\")modprobe" all open-quote)
4157 (string-append open-quote
4158 (assoc-ref inputs "kmod")
4160 (substitute* '("prog/pwm/pwmconfig"
4161 "prog/pwm/fancontrol")
4163 (string-append (assoc-ref inputs "gnuplot")
4166 (string-append (assoc-ref inputs "coreutils")
4169 (string-append (assoc-ref inputs "grep")
4172 (string-append (assoc-ref inputs "sed")
4175 (string-append (assoc-ref inputs "coreutils")
4178 (string-append (assoc-ref inputs "coreutils")
4181 (string-append (assoc-ref inputs "coreutils")
4182 "/bin/readlink -f")))
4184 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
4185 (synopsis "Utilities to read temperature/voltage/fan sensors")
4187 "Lm-sensors is a hardware health monitoring package for Linux. It allows
4188 you to access information from temperature, voltage, and fan speed sensors.
4189 It works with most newer systems.")
4190 (license license:gpl2+)))
4192 (define-public iucode-tool
4194 (name "iucode-tool")
4198 (uri (string-append "https://gitlab.com/iucode-tool/releases"
4199 "/raw/latest/iucode-tool_" version ".tar.xz"))
4202 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
4203 (build-system gnu-build-system)
4204 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
4205 (synopsis "Manipulate Intel microcode bundles")
4207 "@command{iucode_tool} is a utility to work with microcode packages for
4208 Intel processors. It can convert between formats, extract specific versions,
4209 create a firmware image suitable for the Linux kernel, and more.")
4210 ;; cpuid.h is available for i686, x86_64, and ia64.
4211 (supported-systems '("i686-linux" "x86_64-linux"))
4212 (license license:gpl2+)))
4214 (define-public i2c-tools
4221 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
4222 version ".tar.bz2"))
4225 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
4226 (build-system gnu-build-system)
4228 `(#:tests? #f ; no 'check' target
4229 #:make-flags (list (string-append "prefix=" %output)
4230 ,(string-append "CC=" (cc-for-target)))
4231 ;; No configure script.
4232 #:phases (modify-phases %standard-phases (delete 'configure))))
4235 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
4236 (synopsis "I2C tools for Linux")
4238 "The i2c-tools package contains a heterogeneous set of I2C tools for
4239 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
4240 EEPROM decoding scripts, EEPROM programming tools, and a python module for
4242 (license license:gpl2+)))
4244 (define-public xsensors
4251 "http://www.linuxhardware.org/xsensors/xsensors-"
4255 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
4256 (build-system gnu-build-system)
4257 (inputs `(("lm-sensors" ,lm-sensors "lib")
4259 (native-inputs `(("pkg-config" ,pkg-config)))
4262 (modify-phases %standard-phases
4263 (add-before 'configure 'enable-deprecated
4265 (substitute* "src/Makefile.in"
4266 (("-DGDK_DISABLE_DEPRECATED") "")
4267 (("-DGTK_DISABLE_DEPRECATED") ""))
4269 (add-before 'configure 'remove-Werror
4271 (substitute* '("configure" "src/Makefile.in")
4274 (home-page "http://www.linuxhardware.org/xsensors/")
4275 (synopsis "Hardware health information viewer")
4277 "Xsensors reads data from the libsensors library regarding hardware
4278 health such as temperature, voltage and fan speed and displays the information
4279 in a digital read-out.")
4280 (license license:gpl2+)))
4285 (version (package-version linux-libre))
4286 (source (package-source linux-libre))
4287 (build-system gnu-build-system)
4290 (modify-phases %standard-phases
4292 (lambda* (#:key inputs #:allow-other-keys)
4293 (setenv "SHELL_PATH" (which "bash"))
4294 (chdir "tools/perf")
4296 #:make-flags (list (string-append "prefix="
4297 (assoc-ref %outputs "out"))
4301 ;; By default, 'config/Makefile' uses lib64 on
4302 ;; x86_64. Work around that.
4304 #:tests? #f)) ;no tests
4306 `(("pkg-config" ,pkg-config)
4310 ;; There are build scripts written in these languages.
4312 ("python2" ,python-2)
4313 ("python3" ,python-3)))
4315 `(("slang" ,slang) ;for the interactive TUI
4317 ("python" ,python-2) ;'perf' links against libpython
4318 ("elfutils" ,elfutils)
4319 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
4320 ("libunwind" ,libunwind) ;better stack walking
4321 ("numactl" ,numactl) ;for 'perf bench numa mem'
4324 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
4325 ("docbook-xsl" ,docbook-xsl)
4327 ("asciidoc" ,asciidoc)))
4328 (home-page "https://perf.wiki.kernel.org/")
4329 (synopsis "Linux profiling with performance counters")
4331 "perf is a tool suite for profiling using hardware performance counters,
4332 with support in the Linux kernel. perf can instrument CPU performance
4333 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
4334 of lightweight profiling. This package contains the user-land tools and in
4335 particular the @code{perf} command.")
4336 (license (package-license linux-libre))))
4338 (define-public pflask
4345 (url "https://github.com/ghedo/pflask")
4346 (commit (string-append "v" version))))
4347 (file-name (git-file-name name version))
4350 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
4351 (build-system cmake-build-system)
4353 '(#:tests? #f)) ; no tests
4354 (home-page "https://ghedo.github.io/pflask/")
4355 (synopsis "Simple tool for creating Linux namespace containers")
4356 (description "pflask is a simple tool for creating Linux namespace
4357 containers. It can be used for running a command or even booting an OS inside
4358 an isolated container, created with the help of Linux namespaces. It is
4359 similar in functionality to chroot, although pflask provides better isolation
4360 thanks to the use of namespaces.")
4361 (license license:bsd-2)))
4363 (define-public singularity
4365 (name "singularity")
4369 (uri (string-append "https://github.com/singularityware/singularity/"
4370 "releases/download/" version
4371 "/singularity-" version ".tar.gz"))
4374 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
4375 (modules '((guix build utils)))
4378 ;; Do not create directories in /var.
4379 (substitute* "Makefile.in"
4380 (("\\$\\(MAKE\\) .*install-data-hook") ""))
4382 ;; The original source overrides PATH so that it points to
4383 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
4384 ;; on Guix System. Leave PATH unchanged so we refer to the
4385 ;; installed Coreutils, grep, etc.
4386 (substitute* "bin/singularity.in"
4388 (string-append "#" all "\n")))
4390 (substitute* (find-files "libexec/cli" "\\.exec$")
4391 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
4393 (string-append "/run/setuid-programs/singularity-"
4394 program "-helper")))
4396 ;; These squashfs mount options are apparently no longer
4397 ;; supported since Linux-libre 5.4.5.
4398 (substitute* "src/lib/image/squashfs/mount.c"
4399 (("\"errors=remount-ro\"")
4402 (build-system gnu-build-system)
4404 `(#:configure-flags '("--localstatedir=/var")
4406 (modify-phases %standard-phases
4407 (add-after 'unpack 'patch-references
4409 (substitute* "libexec/cli/build.exec.in"
4410 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
4411 (substitute* (append
4412 (find-files "libexec" "functions")
4413 (find-files "libexec/bootstrap-scripts" ".*sh$")
4414 (find-files "libexec/cli" ".*exec$"))
4416 (string-append "| " (which "grep") " "))
4418 (string-append (which "egrep") " "))
4420 (string-append " " (which "sed") " ")))
4422 (add-after 'install 'set-PATH
4423 (lambda* (#:key inputs outputs #:allow-other-keys)
4424 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
4425 (let ((out (assoc-ref outputs "out"))
4426 (coreutils (assoc-ref inputs "coreutils")))
4427 (wrap-program (string-append out "/bin/singularity")
4428 `("PATH" ":" = (,(string-append coreutils "/bin"))))
4429 (substitute* (string-append out "/bin/run-singularity")
4430 (("/usr/bin/env singularity")
4431 (string-append (which "env") " "
4432 out "/bin/singularity")))
4435 `(("libarchive" ,libarchive)
4436 ("python" ,python-wrapper)
4438 ("squashfs-tools" ,squashfs-tools)))
4439 (home-page "https://singularity.lbl.gov/")
4440 (synopsis "Container platform")
4441 (description "Singularity is a container platform supporting a number of
4442 container image formats. It can build SquashFS container images or import
4443 existing Docker images. Singularity requires kernel support for container
4444 isolation or root privileges.")
4445 (license license:bsd-3)))
4447 (define-public hdparm
4453 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
4454 "hdparm-" version ".tar.gz"))
4457 "0zvppv8qw0y1shlhn34iq1g4883i1cywsa514n595nmyrmsrs3rc"))))
4458 (build-system gnu-build-system)
4461 (let ((out (assoc-ref %outputs "out")))
4462 (list (string-append "binprefix=" out)
4463 (string-append "manprefix=" out)
4464 ,(string-append "CC=" (cc-for-target))
4465 ;; Let Guix strip the binaries and not break cross-compilation.
4468 (modify-phases %standard-phases
4469 (delete 'configure)) ; no configure script
4470 #:tests? #f)) ; no test suite
4471 (home-page "https://sourceforge.net/projects/hdparm/")
4472 (synopsis "View and tune ATA disk drive parameters")
4474 "@command{hdparm} is a command-line utility to control ATA controllers and
4475 disk drives. It can increase performance and/or reliability by careful tuning
4476 of hardware settings like power and acoustic management, DMA modes, and caching.
4477 It can also display detailed device information, or be used as a simple
4478 performance benchmarking tool.
4480 @command{hdparm} provides a command line interface to various Linux kernel
4481 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
4482 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4483 Translation (@dfn{SAT}) are also supported.")
4484 (license (license:non-copyleft "file://LICENSE.TXT"))))
4486 (define-public nvme-cli
4490 (home-page "https://github.com/linux-nvme/nvme-cli")
4495 (commit (string-append "v" version))))
4497 (base32 "0dpadz945482srqpsbfx1bh7rc499fgpyzz1flhk9g9xjbpapkzc"))
4498 (file-name (git-file-name name version))))
4499 (build-system gnu-build-system)
4502 (list ,(string-append "CC=" (cc-for-target)))
4503 #:phases (modify-phases %standard-phases
4504 (delete 'configure) ; no ./configure script
4507 (invoke "make" "install-spec" "PREFIX="
4508 (string-append "DESTDIR=" %output)))))
4509 ;; The tests require sysfs, which is not accessible from from the build
4512 (synopsis "NVM-Express user space tooling for Linux")
4513 (description "Nvme-cli is a utility to provide standards compliant tooling
4514 for NVM-Express drives. It was made specifically for Linux as it relies on the
4515 IOCTLs defined by the mainline kernel driver.")
4516 (license license:gpl2+)))
4518 (define-public rfkill
4524 (uri (string-append "mirror://kernel.org/software/network/"
4525 name "/" name "-" version ".tar.xz"))
4528 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4529 (build-system gnu-build-system)
4531 `(#:make-flags (list "CC=gcc"
4532 (string-append "PREFIX=" %output))
4533 #:phases (modify-phases %standard-phases
4534 (delete 'configure))
4536 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4537 (synopsis "Tool for enabling and disabling wireless devices")
4539 "rfkill is a simple tool for accessing the rfkill device interface,
4540 which is used to enable and disable wireless networking devices, typically
4541 WLAN, Bluetooth and mobile broadband.")
4542 (license (license:non-copyleft "file://COPYING"
4543 "See COPYING in the distribution."))
4544 ;; rfkill is part of util-linux as of 2.31.
4545 (properties `((superseded . ,util-linux)))))
4553 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4554 version "/" name "-" version ".tar.gz"))
4557 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4558 (build-system gnu-build-system)
4559 (home-page "http://acpiclient.sourceforge.net")
4560 (synopsis "Display information on ACPI devices")
4561 (description "@code{acpi} attempts to replicate the functionality of the
4562 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4563 information. It does not support ACPI suspending, only displays information
4564 about ACPI devices.")
4565 (license license:gpl2+)))
4567 (define-public acpid
4573 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4577 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4578 (build-system gnu-build-system)
4579 (home-page "https://sourceforge.net/projects/acpid2/")
4580 (synopsis "Daemon for delivering ACPI events to user-space programs")
4582 "acpid is designed to notify user-space programs of Advanced
4583 Configuration and Power Interface (ACPI) events. acpid should be started
4584 during the system boot, and will run as a background process. When an ACPI
4585 event is received from the kernel, acpid will examine the list of rules
4586 specified in /etc/acpi/events and execute the rules that match the event.")
4587 (license license:gpl2+)))
4589 (define-public sysfsutils
4598 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4601 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4602 (build-system gnu-build-system)
4603 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4604 (synopsis "System utilities based on Linux sysfs")
4606 "These are a set of utilities built upon sysfs, a virtual file system in
4607 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4608 also contains the libsysfs library.")
4609 ;; The library is under lgpl2.1+ (all files say "or any later version").
4610 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4611 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4613 (define-public sysfsutils-1
4615 (inherit sysfsutils)
4622 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4623 "/sysfsutils-" version ".tar.gz"))
4625 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4626 (modules '((guix build utils)))
4629 (substitute* "Makefile.in"
4630 (("includedir = /usr/include/sysfs")
4631 "includedir = @includedir@"))
4632 (substitute* "configure"
4633 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4634 (string-append "includedir='" orig "/sysfs'")))
4636 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4638 (define-public cpufrequtils
4640 (name "cpufrequtils")
4645 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4646 "cpufrequtils-" version ".tar.gz"))
4648 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4649 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4650 (build-system gnu-build-system)
4652 `(("sysfsutils" ,sysfsutils-1)))
4654 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4655 (assoc-ref %outputs "out") "/lib"))))
4656 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4657 (synopsis "Utilities to get and set CPU frequency on Linux")
4659 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4660 information, and set the CPU frequency if supported, using the cpufreq
4661 capabilities of the Linux kernel.")
4662 (license license:gpl2)))
4664 (define-public libraw1394
4671 "mirror://kernel.org/linux/libs/ieee1394/"
4672 name "-" version ".tar.xz"))
4675 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4676 (build-system gnu-build-system)
4677 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4678 (synopsis "Interface library for the Linux IEEE1394 drivers")
4680 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4681 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4682 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4683 send to and receive from other nodes without requiring a kernel driver for the
4684 protocol in question.")
4685 (license license:lgpl2.1+)))
4687 (define-public libavc1394
4693 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4694 name "-" version ".tar.gz"))
4697 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4698 (build-system gnu-build-system)
4700 `(("pkg-config" ,pkg-config)))
4702 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4703 (home-page "https://sourceforge.net/projects/libavc1394/")
4704 (synopsis "AV/C protocol library for IEEE 1394")
4706 "Libavc1394 is a programming interface to the AV/C specification from
4707 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4708 (license license:lgpl2.1+)))
4710 (define-public libiec61883
4712 (name "libiec61883")
4717 "mirror://kernel.org/linux/libs/ieee1394/"
4718 name "-" version ".tar.xz"))
4721 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4722 (build-system gnu-build-system)
4724 `(("pkg-config" ,pkg-config)))
4726 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4727 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4728 (synopsis "Isochronous streaming media library for IEEE 1394")
4730 "The libiec61883 library provides a higher level API for streaming DV,
4731 MPEG-2 and audio over Linux IEEE 1394.")
4732 (license license:lgpl2.1+)))
4734 (define-public mdadm
4741 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4745 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4746 (build-system gnu-build-system)
4750 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4751 (list ,(string-append "CC=" (cc-for-target))
4754 ;; TODO: tell it where to find 'sendmail'
4755 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4756 (string-append "BINDIR=" out "/sbin")
4757 (string-append "MANDIR=" out "/share/man")
4758 (string-append "UDEVDIR=" out "/lib/udev")))
4760 (modify-phases %standard-phases
4761 (add-before 'build 'patch-program-paths
4762 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4763 (let ((coreutils (assoc-ref (or native-inputs inputs)
4765 (substitute* "udev-md-raid-arrays.rules"
4766 (("/usr/bin/(readlink|basename)" all program)
4767 (string-append coreutils "/bin/" program))))
4769 (add-before 'build 'remove-W-error
4771 ;; We cannot build with -Werror on i686 due to a
4772 ;; 'sign-compare' warning in util.c.
4773 (substitute* "Makefile"
4776 (delete 'configure))
4777 ;;tests must be done as root
4779 (supported-systems (delete "i586-gnu" %supported-systems))
4780 (home-page "http://neil.brown.name/blog/mdadm")
4781 (synopsis "Tool for managing Linux Software RAID arrays")
4783 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4784 assemble, report on, and monitor arrays. It can also move spares between raid
4785 arrays when needed.")
4786 (license license:gpl2+)))
4788 (define-public mdadm-static
4791 (name "mdadm-static")
4793 (substitute-keyword-arguments (package-arguments mdadm)
4794 ((#:make-flags flags)
4795 `(cons "LDFLAGS = -static" ,flags))
4797 `(modify-phases ,phases
4798 (add-after 'install 'remove-cruft
4799 (lambda* (#:key outputs #:allow-other-keys)
4800 (let* ((out (assoc-ref outputs "out"))
4801 (precious? (lambda (file)
4802 (member file '("." ".." "sbin"))))
4803 (directories (scandir out (negate precious?))))
4804 (with-directory-excursion out
4805 (for-each delete-file-recursively directories)
4806 (remove-store-references "sbin/mdadm")
4807 (delete-file "sbin/mdmon")
4809 ((#:modules modules %gnu-build-system-modules)
4810 `((ice-9 ftw) ,@modules))
4811 ((#:strip-flags _ '())
4812 ''("--strip-all")) ;strip a few extra KiB
4813 ((#:allowed-references _ '("out"))
4814 '("out")))) ;refer only self
4815 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4817 (define-public multipath-tools
4819 (name "multipath-tools")
4824 (url "https://git.opensvc.com/multipath-tools/.git")
4826 (file-name (git-file-name name version))
4829 "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg"))
4830 (modules '((guix build utils)))
4833 ;; Drop bundled valgrind headers.
4834 (delete-file-recursively "third-party")
4835 (substitute* '("multipathd/main.c"
4836 "libmultipath/debug.c")
4837 (("#include \"../third-party/")
4840 (build-system gnu-build-system)
4842 '(#:test-target "test"
4843 #:parallel-build? #f ;XXX: broken in 0.8.4
4844 #:make-flags (list "CC=gcc"
4845 (string-append "DESTDIR="
4846 (assoc-ref %outputs "out"))
4847 ;; Install Udev rules below this directory, relative
4850 (string-append "LDFLAGS=-Wl,-rpath="
4851 (assoc-ref %outputs "out")
4854 (modify-phases %standard-phases
4855 (add-after 'unpack 'patch-source
4856 (lambda* (#:key inputs #:allow-other-keys)
4857 (let ((lvm2 (assoc-ref inputs "lvm2"))
4858 (udev (assoc-ref inputs "udev")))
4859 (substitute* "Makefile.inc"
4860 (("\\$\\(prefix\\)/usr") "$(prefix)")
4861 ;; Do not save timestamp to avoid gzip "timestamp
4862 ;; out-of-range" warnings.
4863 (("gzip -9") "gzip -9n"))
4864 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4865 (("/usr/include/libdevmapper.h")
4866 (string-append lvm2 "/include/libdevmapper.h"))
4867 (("/usr/include/libudev.h")
4868 (string-append udev "/include/libudev.h")))
4870 (add-after 'unpack 'fix-maybe-uninitialized-variable
4872 ;; This variable gets initialized later if needed, but GCC 7
4873 ;; fails to notice. Should be fixed for > 0.8.4.
4874 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4875 (substitute* "libmultipath/structs_vec.c"
4876 (("bool is_queueing;")
4877 "bool is_queueing = false;"))
4879 (add-after 'unpack 'fix-linking-tests
4881 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4882 ;; for versions > 0.8.4.
4883 (substitute* "tests/Makefile"
4884 (("-lmultipath -lcmocka")
4885 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4887 (add-after 'unpack 'skip-failing-tests
4889 ;; This test and the module's setup() test an arbitrary block
4890 ;; device node name, but the build environment has none.
4891 (substitute* "tests/devt.c"
4892 (("return get_one_devt.*") "return 0;\n")
4893 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
4894 ;; The above triggers -Werror=unused-function. Ignore it.
4895 (substitute* "tests/Makefile"
4896 (("CFLAGS \\+= " match)
4897 (string-append match "-Wno-error=unused-function ")))
4899 (delete 'configure)))) ; no configure script
4902 ("pkg-config" ,pkg-config)
4903 ("valgrind" ,valgrind)
4906 ("cmocka" ,cmocka)))
4908 `(("json-c" ,json-c)
4910 ("liburcu" ,liburcu)
4912 ("readline" ,readline)
4914 (home-page "http://christophe.varoqui.free.fr/")
4915 (synopsis "Access block devices through multiple paths")
4917 "This package provides the following binaries to drive the
4918 Linux Device Mapper multipathing driver:
4920 @item @command{multipath} - Device mapper target autoconfig.
4921 @item @command{multipathd} - Multipath daemon.
4922 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4923 @code{dm} multipath devices.
4924 @item @command{kpartx} - Create device maps from partition tables.
4926 (license (list license:gpl2+ ; main distribution
4927 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4929 (define-public libaio
4936 (string-append "https://releases.pagure.org/libaio/"
4937 name "-" version ".tar.gz")))
4940 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4941 (build-system gnu-build-system)
4944 (let ((target ,(%current-target-system)))
4945 (list (string-append "prefix=" %output)
4948 (string-append (assoc-ref %build-inputs "cross-gcc")
4949 "/bin/" target "-gcc")
4951 #:test-target "partcheck" ; need root for a full 'check'
4953 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4954 (home-page "https://pagure.io/libaio")
4955 (synopsis "Linux-native asynchronous I/O access library")
4957 "This library enables userspace to use Linux kernel asynchronous I/O
4958 system calls, important for the performance of databases and other advanced
4960 (license license:lgpl2.1+)))
4962 (define-public blktrace
4963 ;; Take a newer commit to get the fix for CVE-2018-10689.
4964 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4968 (version (git-version "1.2.0" revision commit))
4970 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4977 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4978 (file-name (git-file-name name version))))
4979 (build-system gnu-build-system)
4982 (list ,(string-append "CC=" (cc-for-target))
4983 (string-append "prefix=" %output))
4984 #:tests? #f ; no tests
4986 (modify-phases %standard-phases
4987 (delete 'configure) ; no configure script
4988 (add-after 'unpack 'fix-gnuplot-path
4989 (lambda* (#:key inputs #:allow-other-keys)
4990 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4991 (substitute* "btt/bno_plot.py"
4993 (string-append gnuplot "/bin/gnuplot %s")))
4996 `(("libaio" ,libaio)
4997 ("gnuplot" ,gnuplot)
4998 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4999 (synopsis "Block layer IO tracing mechanism")
5000 (description "Blktrace is a block layer IO tracing mechanism which provides
5001 detailed information about request queue operations to user space. It extracts
5002 event traces from the kernel (via the relaying through the debug file system).")
5003 (license license:gpl2))))
5011 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
5013 (patches (search-patches "sbc-fix-build-non-x86.patch"))
5016 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
5017 (build-system gnu-build-system)
5019 `(("libsndfile" ,libsndfile)))
5021 `(("pkg-config" ,pkg-config)))
5022 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
5023 (synopsis "Bluetooth subband audio codec")
5025 "The SBC is a digital audio encoder and decoder used to transfer data to
5026 Bluetooth audio output devices like headphones or loudspeakers.")
5027 (license license:gpl2+)))
5029 (define-public bluez
5036 "mirror://kernel.org/linux/bluetooth/bluez-"
5040 "124v9s4y1s7s6klx5vlmzpk1jlr4x84ch7r7scm7x2f42dqp2qw8"))))
5041 (build-system gnu-build-system)
5044 (let ((out (assoc-ref %outputs "out")))
5045 (list "--sysconfdir=/etc"
5046 "--localstatedir=/var"
5049 ;; TODO: is this needed? Not installed by default since 5.55.
5051 ;; Install dbus/udev files to the correct location.
5052 (string-append "--with-dbusconfdir=" out "/etc")
5053 (string-append "--with-udevdir=" out "/lib/udev")))
5055 (modify-phases %standard-phases
5056 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
5057 ;; issue (discussion on upstream mailing list:
5058 ;; https://marc.info/?t=149578476300002&r=1&w=2)
5059 (add-before 'check 'skip-wonky-test
5061 (substitute* "unit/test-gatt.c"
5062 (("tester_init\\(&argc, &argv\\);") "return 77;"))
5064 (add-after 'install 'post-install
5065 (lambda* (#:key inputs outputs #:allow-other-keys)
5066 (let* ((out (assoc-ref outputs "out"))
5067 (servicedir (string-append out "/share/dbus-1/services"))
5068 (service "obexd/src/org.bluez.obex.service")
5069 (rule (string-append
5070 out "/lib/udev/rules.d/97-hid2hci.rules")))
5071 ;; Install the obex dbus service file.
5072 (substitute* service
5074 (string-append out "/libexec/bluetooth/obexd")))
5075 (install-file service servicedir)
5076 ;; Fix paths in the udev rule.
5078 (("hid2hci --method")
5079 (string-append out "/lib/udev/hid2hci --method"))
5081 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
5084 `(("pkg-config" ,pkg-config)
5085 ("gettext" ,gettext-minimal)))
5090 ("libical" ,libical)
5091 ("readline" ,readline)))
5092 (home-page "http://www.bluez.org/")
5093 (synopsis "Linux Bluetooth protocol stack")
5095 "BlueZ provides support for the core Bluetooth layers and protocols. It
5096 is flexible, efficient and uses a modular implementation.")
5097 (license license:gpl2+)))
5099 (define-public fuse-exfat
5106 "https://github.com/relan/exfat/releases/download/v"
5107 version "/" name "-" version ".tar.gz"))
5110 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
5111 (build-system gnu-build-system)
5113 `(("pkg-config" ,pkg-config)))
5116 (home-page "https://github.com/relan/exfat")
5117 (synopsis "Mount exFAT file systems")
5119 "This package provides a FUSE-based file system that provides read and
5120 write access to exFAT devices.")
5121 (license license:gpl2+)))
5123 (define-public fuseiso
5126 (version "20070708")
5129 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
5130 version "/fuseiso-" version ".tar.bz2"))
5133 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
5134 (build-system gnu-build-system)
5136 `(("pkg-config" ,pkg-config)))
5141 (home-page "https://sourceforge.net/projects/fuseiso/")
5142 (synopsis "Mount ISO file system images")
5144 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
5145 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
5146 Ridge, Joliet, and zisofs.")
5147 (license license:gpl2)))
5156 "https://www.nico.schottelius.org/software/gpm/archives/"
5157 "gpm-" version ".tar.bz2"))
5158 (patches (search-patches "gpm-glibc-2.26.patch"))
5161 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
5162 (modules '((guix build utils)))
5165 ;; Take a patch from upstream to fix building with -fno-common,
5166 ;; which is default in GCC 10:
5167 ;; https://github.com/telmich/gpm/pull/37
5168 (substitute* "src/headers/daemon.h"
5169 (("^time_t[[:blank:]]+last_selection_time;")
5170 "extern time_t last_selection_time;"))))))
5171 (build-system gnu-build-system)
5173 '(#:phases (modify-phases %standard-phases
5176 ;; The tarball was not generated with 'make dist' so we
5177 ;; need to bootstrap things ourselves.
5178 (substitute* "autogen.sh"
5179 (("/bin/sh") (which "sh")))
5180 (invoke "./autogen.sh")
5181 (patch-makefile-SHELL "Makefile.include.in")
5184 ;; Make sure programs find libgpm.so.
5185 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
5186 (assoc-ref %outputs "out")
5189 `(("texinfo" ,texinfo)
5192 ("autoconf" ,autoconf)
5193 ("automake" ,automake)
5194 ("libtool" ,libtool)))
5195 (home-page "https://www.nico.schottelius.org/software/gpm/")
5196 (synopsis "Mouse support for the Linux console")
5198 "The GPM (general-purpose mouse) daemon is a mouse server for
5199 applications running on the Linux console. It allows users to select items
5200 and copy/paste text in the console and in xterm.")
5201 (license license:gpl2+)))
5203 (define-public btrfs-progs
5205 (name "btrfs-progs")
5209 (uri (string-append "mirror://kernel.org/linux/kernel/"
5210 "people/kdave/btrfs-progs/"
5211 "btrfs-progs-v" version ".tar.xz"))
5214 "0n9p8zaz4nrkgc20cp6zj7gp4ib4hd4lbyph74f4pysllkz4c24m"))))
5215 (build-system gnu-build-system)
5217 "static")) ; static versions of the binaries in "out"
5219 '(#:phases (modify-phases %standard-phases
5220 (add-after 'unpack 'patch-makefile
5221 (lambda* (#:key outputs #:allow-other-keys)
5222 (substitute* "Makefile"
5223 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
5224 (string-append (assoc-ref outputs "out")
5225 "/lib/udev/rules.d")))
5227 (add-after 'build 'build-static
5228 (lambda _ (invoke "make" "static")))
5229 (add-after 'install 'install-bash-completion
5230 (lambda* (#:key outputs #:allow-other-keys)
5231 (let* ((out (assoc-ref outputs "out"))
5232 (bashcomp (string-append out "/etc/bash_completion.d")))
5234 (copy-file "btrfs-completion"
5235 (string-append bashcomp "/btrfs"))
5237 (add-after 'install 'install-static
5238 (let ((staticbin (string-append (assoc-ref %outputs "static")
5242 (string-append "bindir=" staticbin)
5243 "install-static")))))
5244 #:tests? #f ; XXX: require the 'btrfs' kernel module.
5245 #:test-target "test"
5246 #:parallel-tests? #f)) ; tests fail when run in parallel
5247 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
5249 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
5250 ("util-linux:static" ,util-linux "static") ;ditto
5252 ("zlib:static" ,zlib "static")
5253 ("zstd" ,zstd "lib")
5254 ("zstd:static" ,zstd "static")))
5255 (native-inputs `(("pkg-config" ,pkg-config)
5256 ("asciidoc" ,asciidoc)
5259 ;; Remove this input entirely when the default headers
5260 ;; version provides blk_zone.capacity (>= 5.9).
5261 ("linux-libre-headers" ,linux-libre-headers-5.10)
5262 ;; For building documentation.
5263 ("libxml2" ,libxml2)
5264 ("docbook-xsl" ,docbook-xsl)
5270 ;; The tests need 'grep' with perl regexp support.
5272 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
5273 (synopsis "Create and manage btrfs copy-on-write file systems")
5274 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
5275 aimed at implementing advanced features while focusing on fault tolerance,
5276 repair and easy administration.")
5277 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
5278 ;; GPL2: Everything else.
5279 (license (list license:gpl2 license:gpl2+))))
5281 (define-public btrfs-progs/static
5283 (name "btrfs-progs-static")
5284 (version (package-version btrfs-progs))
5286 (build-system trivial-build-system)
5288 `(("btrfs-progs:static" ,btrfs-progs "static")))
5290 `(#:modules ((guix build utils))
5293 (use-modules (guix build utils)
5297 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
5298 (out (assoc-ref %outputs "out"))
5299 (source (string-append btrfs "/bin/btrfs.static"))
5300 (target (string-append out "/bin/btrfs")))
5301 (mkdir-p (dirname target))
5302 (copy-file source target)
5303 (remove-store-references target)
5304 (chmod target #o555)
5306 (home-page (package-home-page btrfs-progs))
5307 (synopsis "Statically-linked btrfs command from btrfs-progs")
5308 (description "This package provides the statically-linked @command{btrfs}
5309 from the btrfs-progs package. It is meant to be used in initrds.")
5310 (license (package-license btrfs-progs))))
5312 (define-public cramfs-tools
5314 (name "cramfs-tools")
5315 (home-page "https://github.com/npitre/cramfs-tools")
5321 (commit (string-append "v" version))))
5323 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
5324 (file-name (git-file-name name version))))
5325 (build-system gnu-build-system)
5327 '(#:tests? #f ; No tests.
5329 (modify-phases %standard-phases
5332 (lambda* (#:key outputs #:allow-other-keys)
5333 (let ((out (assoc-ref outputs "out")))
5334 (install-file "mkcramfs" (string-append out "/sbin"))
5335 (install-file "cramfsck" (string-append out "/sbin")))
5339 (synopsis "Tools to manage Cramfs file systems")
5340 (description "Cramfs is a Linux file system designed to be simple, small,
5341 and to compress things well. It is used on a number of embedded systems and
5342 small devices. This version has additional features such as uncompressed
5343 blocks and random block placement.")
5344 (license license:gpl2+)))
5346 (define-public compsize
5350 (home-page "https://github.com/kilobyte/compsize")
5355 (commit (string-append "v" version))))
5357 (base32 "0vqnrwgpv6pc1yjl0g4gl71xyl6v0xl3pyqjanjpwps73c53azir"))
5358 (file-name (git-file-name name version))))
5359 (build-system gnu-build-system)
5361 `(("btrfs-progs" ,btrfs-progs)))
5363 `(#:tests? #f ; No tests.
5365 (list (string-append "CC=" ,(cc-for-target)))
5367 (modify-phases %standard-phases
5370 (lambda* (#:key outputs #:allow-other-keys)
5371 (let ((out (assoc-ref outputs "out")))
5372 (install-file "compsize" (string-append out "/bin"))
5373 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
5374 (synopsis "Find compression type/ratio on Btrfs files")
5375 (description "@command{compsize} takes a list of files (given as
5376 arguments) on a Btrfs file system and measures used compression types and
5377 effective compression ratio, producing a report.
5379 A directory has no extents but has a (recursive) list of files. A non-regular
5380 file is silently ignored.
5382 As it makes no sense to talk about compression ratio of a partial extent,
5383 every referenced extent is counted whole, exactly once -- no matter if you use
5384 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
5385 uncompressed size will not match the number given by @command{tar} or
5386 @command{du}. On the other hand, the space used should be accurate (although
5387 obviously it can be shared with files outside our set).")
5388 (license license:gpl2+)))
5390 (define-public f2fs-tools-1.7
5397 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5398 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5401 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
5403 (build-system gnu-build-system)
5406 (modify-phases %standard-phases
5407 (add-after 'install 'install-headers
5408 (lambda* (#:key outputs #:allow-other-keys)
5409 (let* ((out (assoc-ref outputs "out"))
5410 (out-include (string-append out "/include")))
5411 (install-file "include/f2fs_fs.h" out-include)
5412 (install-file "mkfs/f2fs_format_utils.h" out-include)
5415 `(("autoconf" ,autoconf)
5416 ("automake" ,automake)
5417 ("libtool" ,libtool)
5418 ("pkg-config" ,pkg-config)))
5420 `(("libuuid" ,util-linux "lib")
5421 ("libselinux" ,libselinux)))
5422 (home-page "https://f2fs.wiki.kernel.org/")
5423 (synopsis "Userland tools for f2fs")
5425 "F2FS, the Flash-Friendly File System, is a modern file system
5426 designed to be fast and durable on flash devices such as solid-state
5427 disks and SD cards. This package provides the userland utilities.")
5428 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
5429 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
5430 (license (list license:gpl2 license:lgpl2.1))))
5432 (define-public f2fs-tools
5434 (inherit f2fs-tools-1.7)
5440 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5441 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5444 "1lab1446c78xsjwhpki7s85z4171m8p9279c8yhm4882wba674k1"))))
5446 `(("libuuid" ,util-linux "lib")))))
5448 (define-public f2fs-tools/static
5451 (inherit f2fs-tools)
5452 (name "f2fs-tools-static")
5455 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
5456 (libuuid (assoc-ref %build-inputs "libuuid")))
5458 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
5459 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
5460 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
5461 "-I" libuuid "/include/blkid")
5462 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
5463 #:disallowed-references (,util-linux)
5465 (modify-phases %standard-phases ; TODO: f2fs phases.
5466 (add-after 'unpack 'make-static
5468 (define (append-to-file name body)
5469 (let ((file (open-file name "a")))
5472 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
5473 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
5474 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
5476 (add-after 'install 'remove-store-references
5477 (lambda* (#:key outputs #:allow-other-keys)
5478 ;; Work around bug in our util-linux.
5479 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
5480 (remove-store-references (string-append (assoc-ref outputs "out")
5484 `(("libuuid:static" ,util-linux "static")
5485 ("libuuid" ,util-linux "lib")))))) ; for include files
5487 (define-public f2fs-fsck/static
5489 (name "f2fs-fsck-static")
5490 (version (package-version f2fs-tools/static))
5492 (build-system trivial-build-system)
5494 `(#:modules ((guix build utils))
5497 (use-modules (guix build utils)
5500 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
5502 (out (assoc-ref %outputs "out"))
5503 (sbin (string-append out "/sbin")))
5505 (with-directory-excursion sbin
5506 (install-file (string-append f2fs-tools "/sbin/" fsck)
5508 (remove-store-references fsck)
5512 `(("f2fs-tools-static" ,f2fs-tools/static)))
5513 (home-page (package-home-page f2fs-tools/static))
5514 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5515 (description "This package provides statically-linked fsck.f2fs command taken
5516 from the f2fs-tools package. It is meant to be used in initrds.")
5517 (license (package-license f2fs-tools/static))))
5519 (define-public freefall
5522 (version (package-version linux-libre))
5523 (source (package-source linux-libre))
5524 (build-system gnu-build-system)
5526 '(#:phases (modify-phases %standard-phases
5527 (add-after 'unpack 'enter-subdirectory
5529 (chdir "tools/laptop/freefall")
5532 (add-before 'build 'increase-timeout
5534 ;; The default of 2 seconds is too low: it assumes an
5535 ;; open lid and AC power without actually checking.
5536 (substitute* "freefall.c"
5537 (("alarm\\(2\\)") "alarm(5)"))
5539 #:make-flags (list (string-append "PREFIX="
5540 (assoc-ref %outputs "out"))
5542 #:tests? #f)) ;no tests
5543 (home-page (package-home-page linux-libre))
5544 (synopsis "Free-fall protection for spinning laptop hard drives")
5546 "Prevents shock damage to the internal spinning hard drive(s) of some
5547 HP and Dell laptops. When sudden movement is detected, all input/output
5548 operations on the drive are suspended and its heads are parked on the ramp,
5549 where they are less likely to cause damage to the spinning disc. Requires a
5550 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5551 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5552 (license license:gpl2)))
5554 (define-public thinkfan
5562 (url "https://github.com/vmatare/thinkfan")
5564 (file-name (git-file-name name version))
5566 (base32 "01l1pnj1cgy3dwgyys2s5iqzyv6kk47vlpy09qjafk8py21ijik3"))))
5567 (build-system cmake-build-system)
5569 `(#:modules ((guix build cmake-build-system)
5572 #:tests? #f ; no test target
5574 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5575 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5577 `("-DUSE_ATASMART:BOOL=ON")
5579 (modify-phases %standard-phases
5580 (add-after 'unpack 'create-init-scripts
5581 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5582 ;; systemd to patch and install their service files. Fake their
5583 ;; presence rather than duplicating the build system below. Leave
5584 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5585 ;; The sysvinit needs manual patching, but since upstream doesn't
5586 ;; even provide the option to install it: don't.
5587 (lambda* (#:key outputs #:allow-other-keys)
5588 (let* ((out (assoc-ref outputs "out"))
5589 (share (string-append out "/share/" ,name)))
5590 (substitute* "CMakeLists.txt"
5591 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5592 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5593 ;; That was easy! Now we just need to fix the destinations.
5595 (string-append out directory)))
5598 `(("pkg-config" ,pkg-config)))
5600 `(("libatasmart" ,libatasmart)
5601 ("yaml-cpp" ,yaml-cpp)))
5602 (home-page "https://github.com/vmatare/thinkfan")
5603 (synopsis "Simple fan control program")
5605 "Thinkfan is a simple fan control program. It reads temperatures,
5606 checks them against configured limits and switches to appropriate (also
5607 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5608 other @code{hwmon} driver that enables temperature reading and fan control
5610 (license license:gpl3+)))
5612 (define-public tpacpi-bat
5620 (url "https://github.com/teleshoes/tpacpi-bat")
5621 (commit (string-append "v" version))))
5622 (file-name (git-file-name name version))
5624 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5625 (build-system gnu-build-system)
5627 `(#:tests? #f ; no test target
5629 (modify-phases %standard-phases
5630 (add-after 'unpack 'refer-to-inputs
5632 (substitute* "tpacpi-bat"
5634 (format #f "~a " (which "cat")))
5635 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5636 ;; loaded. That's the administrator's prerogative; disable it.
5637 (("system \"(modprobe .*)\"" _ match)
5638 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5640 (delete 'configure) ; nothing to configure
5641 (delete 'build) ; nothing to build
5643 (lambda* (#:key outputs #:allow-other-keys)
5644 (let* ((out (assoc-ref outputs "out"))
5645 (bin (string-append out "/bin"))
5646 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5647 (install-file "tpacpi-bat" bin)
5649 ;; There's no man page. Install other forms of documentation.
5650 (for-each (lambda (file)
5651 (let ((target (string-append doc "/" file)))
5652 (mkdir-p (dirname target))
5653 (copy-recursively file target)))
5654 (list "battery_asl" "examples" "README.md"))
5658 (home-page "https://github.com/teleshoes/tpacpi-bat")
5659 (synopsis "ThinkPad battery charge controller")
5661 "Tpacpi-bat is a command-line interface to control battery charging on
5662 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5663 ThinkPad models released after 2011}, starting with the xx20 series. It can
5664 query and set the thresholds at which one or both batteries will start and stop
5665 charging, inhibit charging batteries for a set period of time, or force them to
5666 discharge when they otherwise would not.
5668 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5669 kernel module provided by the @code{acpi-call-linux-module} package, which must
5670 be installed and loaded separately. Only the original vendor firmware is
5672 (license license:gpl3+)))
5677 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
5678 (version (package-version linux-libre))
5679 (source (package-source linux-libre))
5680 (build-system gnu-build-system)
5682 `(#:tests? #f ; no test suite
5684 (list (string-append "CC=" ,(cc-for-target))
5685 (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out"))
5688 (modify-phases %standard-phases
5689 (add-after 'unpack 'enter-subdirectory
5691 (chdir "tools/thermal/tmon")
5693 (add-after 'install 'install-man-page
5694 (lambda* (#:key outputs #:allow-other-keys)
5695 (let* ((out (assoc-ref outputs "out"))
5696 (man8 (string-append out "/share/man/man8")))
5697 (install-file "tmon.8" man8)
5699 (delete 'configure)))) ; no configure script
5701 `(("ncurses" ,ncurses)))
5702 (home-page (package-home-page linux-libre))
5703 (synopsis "Monitor and test the Linux thermal subsystem in real time")
5705 "Tmon is a tool to interact with the complex thermal subsystem of the
5706 kernel Linux. It helps visualize thermal relationships and real-time thermal
5707 data, tune and test cooling devices and sensors, and collect thermal data for
5710 As computers become smaller and more thermally constrained, more sensors are
5711 added and new cooling capabilities introduced. Thermal relationships can change
5712 dynamically. Their complexity grows exponentially among cooling devices, zones,
5713 sensors, and trip points.
5715 Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
5716 of symbolic links, trip point bindings, and device instances. To traverse it
5717 by hand is no trivial task: @command{tmon} aims to make it understandable.")
5718 (license (list license:gpl2 ; the man page
5719 license:gpl2+)))) ; the actual rest
5721 (define-public turbostat
5724 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
5725 ;; make it harder to benefit from ‘free’ linux-libre package updates.
5726 (version (package-version linux-libre))
5727 (source (package-source linux-libre))
5728 (build-system gnu-build-system)
5730 `(#:tests? #f ; no test suite
5732 (list (string-append "CC=" ,(cc-for-target))
5733 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5735 (modify-phases %standard-phases
5736 (add-after 'unpack 'enter-subdirectory
5738 (chdir "tools/power/x86/turbostat")
5740 (delete 'configure)))) ; no configure script
5742 `(("libcap" ,libcap)))
5743 (supported-systems '("i686-linux" "x86_64-linux"))
5744 (home-page (package-home-page linux-libre))
5745 (synopsis "Report x86 processor frequency and idle statistics")
5747 "Turbostat reports x86 processor topology, frequency, idle power state
5748 statistics, temperature, and power consumption. Some information is unavailable
5749 on older processors.
5751 It can be used to identify machines that are inefficient in terms of power usage
5752 or idle time, report the rate of @acronym{SMI, system management interrupt}s
5753 occurring on the system, or verify the effects of power management tuning.
5755 @command{turbostat} reads hardware counters but doesn't write to them, so it
5756 won't interfere with the OS or other running processes---including multiple
5757 invocations of itself.")
5758 (license license:gpl2)))
5760 (define-public ntfs-3g
5763 (version "2017.3.23")
5766 (uri (string-append "https://tuxera.com/opensource/"
5767 "ntfs-3g_ntfsprogs-" version ".tgz"))
5768 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5771 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5772 (modules '((guix build utils)))
5774 ;; Install under $prefix.
5775 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5779 (build-system gnu-build-system)
5780 (inputs `(("util-linux" ,util-linux)
5781 ("fuse" ,fuse))) ;libuuid
5782 (native-inputs `(("pkg-config" ,pkg-config)))
5784 '(#:configure-flags (list "--disable-static"
5785 "--exec-prefix=${prefix}"
5786 "--with-fuse=external" ;use our own FUSE
5787 "--enable-mount-helper"
5788 "--enable-posix-acls"
5789 "--enable-xattr-mappings")
5791 (modify-phases %standard-phases
5792 ;; If users install ntfs-3g, they probably want to make it the
5793 ;; default driver as well, so we opt for sensible defaults and link
5794 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5795 ;; mount NTFS file systems.)
5796 (add-after 'install 'install-link
5797 (lambda* (#:key outputs #:allow-other-keys)
5798 (let* ((out (assoc-ref outputs "out"))
5799 (sbin (string-append out "/sbin")))
5800 (symlink "mount.ntfs-3g"
5801 (string-append sbin "/mount.ntfs")))
5803 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5804 (synopsis "Read-write access to NTFS file systems")
5806 "NTFS-3G provides read-write access to NTFS file systems, which are
5807 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5808 The package provides additional NTFS tools.")
5809 (license license:gpl2+)))
5811 (define-public rdma-core
5817 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5818 "/releases/download/v" version "/rdma-core-"
5822 "1rah0v9gq9rksqd2c17nmydsxcjz178n7m2y4ricwlf5pq1b2yfi"))))
5823 (build-system cmake-build-system)
5825 `(#:tests? #f ; no tests
5826 ;; Upstream uses the "ninja" build system and encourage distros
5827 ;; to do the same for consistency.
5828 #:configure-flags (list "-GNinja"
5830 (string-append "-DRST2MAN_EXECUTABLE="
5831 (assoc-ref %build-inputs
5835 (modify-phases %standard-phases
5839 "-j" (number->string (parallel-job-count)))))
5842 (invoke "ninja" "install"))))))
5845 ("pkg-config" ,pkg-config)
5846 ("python" ,python-wrapper)
5847 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5851 (home-page "https://github.com/linux-rdma/rdma-core")
5852 (synopsis "Utilities and libraries for working with RDMA devices")
5854 "This package provides userspace components for the InfiniBand
5855 subsystem of the Linux kernel. Specifically it contains userspace
5856 libraries for the following device nodes:
5859 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5860 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5861 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5864 The following service daemons are also provided:
5866 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5867 @item @code{iwpmd} (for iWARP kernel providers)
5868 @item @code{ibacm} (for InfiniBand communication management assistant)
5870 ;; All library code is dual licensed under GPL2 and a custom MIT
5871 ;; variant. The package also includes some components covered by
5872 ;; other licenses. Consult COPYING.md for full details.
5875 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5876 license:bsd-2 ; Files referring to COPYING.BSD_FB
5877 license:cc0 ; most files in ccan/
5878 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5880 (define-public perftest
5887 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5888 version "/perftest-" version ".g0927198.tar.gz"))
5890 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5891 (build-system gnu-build-system)
5894 (modify-phases %standard-phases
5895 (add-after 'unpack 'patch-header-paths
5897 (substitute* '("src/raw_ethernet_fs_rate.c"
5898 "src/raw_ethernet_resources.c"
5899 "src/raw_ethernet_resources.h"
5900 "src/raw_ethernet_send_burst_lat.c"
5901 "src/raw_ethernet_send_bw.c"
5902 "src/raw_ethernet_send_lat.c")
5903 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5905 (inputs `(("rdma-core" ,rdma-core)))
5906 (home-page "https://github.com/linux-rdma/perftest/")
5907 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5908 (description "This is a collection of tests written over uverbs intended for
5909 use as a performance micro-benchmark. The tests may be used for hardware or
5910 software tuning as well as for functional testing.
5912 The collection contains a set of bandwidth and latency benchmark such as:
5914 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5915 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5916 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5917 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5918 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5920 (license license:gpl2)))
5922 (define-public rng-tools
5925 (home-page "https://github.com/nhorman/rng-tools")
5929 (uri (git-reference (url home-page)
5930 (commit (string-append "v" version))))
5931 (file-name (git-file-name name version))
5934 "0m4895f44a668r0z7md5ifq7syndsb2by2dfhk794vmhprsk1406"))))
5935 (build-system gnu-build-system)
5937 `(;; Disable support for various hardware entropy sources as they need
5938 ;; dependencies that are not yet in Guix, and would significantly
5939 ;; increase closure size.
5940 #:configure-flags '("--without-nistbeacon"
5942 "--without-rtlsdr")))
5944 `(("autoconf" ,autoconf)
5945 ("automake" ,automake)
5946 ("pkg-config" ,pkg-config)))
5948 `(("libsysfs" ,sysfsutils)
5949 ("openssl" ,openssl)))
5950 (synopsis "Random number generator daemon")
5952 "Monitor a hardware random number generator, and supply entropy
5953 from that to the system kernel's @file{/dev/random} machinery.")
5954 ;; The source package is offered under the GPL2+, but the files
5955 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5956 (license (list license:gpl2 license:gpl2+))))
5958 (define-public cpupower
5961 (version (package-version linux-libre))
5962 (source (package-source linux-libre))
5963 (build-system gnu-build-system)
5965 '(#:phases (modify-phases %standard-phases
5966 (add-after 'unpack 'enter-subdirectory
5968 (chdir "tools/power/cpupower")
5971 (add-before 'build 'fix-makefiles
5973 (substitute* "Makefile"
5975 (("/bin/(install|pwd)" _ command) command))
5976 (substitute* "bench/Makefile"
5977 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5979 #:make-flags (let ((out (assoc-ref %outputs "out")))
5980 (list (string-append "DESTDIR=" out)
5981 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5983 "docdir=/share/doc/cpupower"
5984 "confdir=$(docdir)/examples"
5985 ;; The Makefile recommends the following changes
5987 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5988 #:tests? #f)) ;no tests
5989 (native-inputs `(("gettext" ,gettext-minimal)))
5990 (inputs `(("pciutils" ,pciutils)))
5991 (home-page (package-home-page linux-libre))
5992 (synopsis "CPU frequency and voltage scaling tools for Linux")
5994 "cpupower is a set of user-space tools that use the cpufreq feature of the
5995 Linux kernel to retrieve and control processor features related to power saving,
5996 such as frequency and voltage scaling.")
5997 (license license:gpl2)))
5999 (define-public x86-energy-perf-policy
6001 (name "x86-energy-perf-policy")
6002 (version (package-version linux-libre))
6003 (source (package-source linux-libre))
6004 (build-system gnu-build-system)
6008 (modify-phases %standard-phases
6009 (add-after 'unpack 'enter-subdirectory
6011 (chdir "tools/power/x86/x86_energy_perf_policy")
6014 (add-before 'build 'fix-makefile
6016 (substitute* "Makefile" (("/usr") ""))
6019 (let ((out (assoc-ref %outputs "out")))
6020 (list (string-append "DESTDIR=" out)
6021 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
6022 (supported-systems '("i686-linux" "x86_64-linux"))
6023 (home-page (package-home-page linux-libre))
6024 (synopsis "Display and update Intel-CPU energy-performance policy")
6026 "@command{x86_energy_perf_policy} displays and updates energy-performance
6027 policy settings specific to Intel Architecture Processors. Settings are
6028 accessed via Model Specific Register (MSR) updates, no matter if the Linux
6029 cpufreq sub-system is enabled or not.")
6030 (license license:gpl2)))
6032 (define-public haveged
6040 (url "https://github.com/jirka-h/haveged")
6041 (commit (string-append "v" version))))
6042 (file-name (git-file-name name version))
6044 (base32 "050hmnh5s2s4mb83f4d1fk23mk27pprg840c1aagc6v1sz6x5dhq"))))
6045 (build-system gnu-build-system)
6046 (home-page "https://www.issihosts.com/haveged")
6047 (synopsis "Entropy source for the Linux random number generator")
6049 "haveged generates an unpredictable stream of random numbers for use by
6050 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
6051 standard mechanisms for filling the entropy pool may not be sufficient for
6052 systems with high needs or limited user interaction, such as headless servers.
6054 @command{haveged} runs as a privileged daemon, harvesting randomness from the
6055 indirect effects of hardware events on hidden processor state using the
6056 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
6057 It tunes itself to its environment and provides the same built-in test suite
6058 for the output stream as used on certified hardware security devices.
6060 The quality of the randomness produced by this algorithm has not been proven.
6061 It is recommended to run it together with another entropy source like rngd, and
6062 not as a replacement for it.")
6063 (license (list (license:non-copyleft "file://nist/mconf.h")
6064 (license:non-copyleft "file://nist/packtest.c")
6065 license:public-domain ; nist/dfft.c
6066 license:gpl3+)))) ; everything else
6068 (define-public ecryptfs-utils
6070 (name "ecryptfs-utils")
6075 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
6076 version "/+download/ecryptfs-utils_"
6077 version ".orig.tar.gz"))
6080 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
6081 (build-system gnu-build-system)
6083 `(#:configure-flags (list "--disable-pywrap")
6085 (modify-phases %standard-phases
6086 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
6087 (lambda* (#:key inputs outputs #:allow-other-keys)
6088 (let ((out (assoc-ref outputs "out"))
6089 (utils-linux (assoc-ref inputs "utils-linux"))
6090 (cryptsetup (assoc-ref inputs "cryptsetup"))
6091 (linux-pam (assoc-ref inputs "linux-pam"))
6092 (lvm2 (assoc-ref inputs "lvm2")))
6093 (substitute* '("src/utils/ecryptfs-mount-private"
6094 "src/utils/ecryptfs-umount-private"
6095 "src/utils/ecryptfs-setup-private"
6096 "src/utils/ecryptfs-setup-swap"
6097 "src/utils/mount.ecryptfs.c"
6098 "src/utils/umount.ecryptfs.c"
6099 "src/pam_ecryptfs/pam_ecryptfs.c"
6100 "src/desktop/ecryptfs-mount-private.desktop.in"
6101 "src/desktop/ecryptfs-setup-private.desktop.in")
6103 (string-append utils-linux "/bin/mount"))
6105 (string-append utils-linux "/bin/umount"))
6106 (("/sbin/mount.ecryptfs_private")
6107 (string-append out "/sbin/mount.ecryptfs_private"))
6108 (("/sbin/umount.ecryptfs_private")
6109 (string-append out "/sbin/umount.ecryptfs_private"))
6110 (("/usr/bin/ecryptfs-mount-private")
6111 (string-append out "/bin/ecryptfs-mount-private"))
6112 (("/usr/bin/ecryptfs-rewrite-file")
6113 (string-append out "/bin/ecryptfs-rewrite-file"))
6114 (("/usr/bin/ecryptfs-setup-private")
6115 (string-append out "/bin/ecryptfs-setup-private"))
6116 (("/sbin/cryptsetup")
6117 (string-append cryptsetup "/sbin/cryptsetup"))
6118 (("/sbin/unix_chkpwd")
6119 (string-append linux-pam "/sbin/unix_chkpwd"))
6121 (string-append lvm2 "/sbin/dmsetup")))))))))
6123 `(("intltool" ,intltool)
6124 ("perl" ,perl) ; for pod2man
6125 ("pkg-config" ,pkg-config)))
6127 `(("keyutils" ,keyutils)
6128 ("linux-pam" ,linux-pam)
6129 ("utils-linux" ,util-linux)
6130 ("cryptsetup" ,cryptsetup)
6133 (home-page "https://ecryptfs.org/")
6134 (synopsis "eCryptfs cryptographic file system utilities")
6136 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
6137 Each file's cryptographic meta-data is stored inside the file itself, along
6138 with the encrypted contents. This allows individual encrypted files to be
6139 copied between hosts and still be decrypted with the proper key. eCryptfs is a
6140 native Linux file system, and has been part of the Linux kernel since version
6141 2.6.19. This package contains the userland utilities to manage it.")
6142 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
6143 ;; grant additional permission to link with OpenSSL.
6144 (license license:gpl2+)))
6146 (define-public libnfsidmap
6148 (name "libnfsidmap")
6153 (uri (string-append "https://fedorapeople.org/~steved/"
6154 name "/" version "/" name "-" version ".tar.bz2"))
6156 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
6157 (build-system gnu-build-system)
6159 `(#:configure-flags (list
6160 (string-append "--with-pluginpath="
6161 (assoc-ref %outputs "out")
6162 "/lib/libnfsidmap"))))
6164 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
6166 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
6167 (synopsis "NFSv4 support library for name/ID mapping")
6168 (description "Libnfsidmap is a library holding mulitiple methods of
6169 mapping names to ids and visa versa, mainly for NFSv4. It provides an
6170 extensible array of mapping functions, currently consisting of two choices:
6171 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
6172 (license (license:non-copyleft "file://COPYING"
6173 "See COPYING in the distribution."))))
6175 (define-public module-init-tools
6177 (name "module-init-tools")
6182 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
6183 "module-init-tools-" version ".tar.bz2"))
6186 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
6187 (patches (search-patches "module-init-tools-moduledir.patch"))))
6188 (build-system gnu-build-system)
6190 ;; FIXME: The upstream tarball lacks man pages, and building them would
6191 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
6192 ;; but they vanished. In the meantime, fake it.
6194 (modify-phases %standard-phases
6195 (add-before 'configure 'fake-docbook
6197 (substitute* "Makefile.in"
6198 (("^DOCBOOKTOMAN.*$")
6199 "DOCBOOKTOMAN = true\n"))
6201 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
6202 (synopsis "Tools for loading and managing Linux kernel modules")
6204 "Tools for loading and managing Linux kernel modules, such as
6205 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
6206 (license license:gpl2+)))
6208 (define-public mcelog
6216 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
6217 (commit (string-append "v" version))))
6218 (file-name (git-file-name name version))
6220 (base32 "1mlwn6ck9qiwqa2vg5wg1gvfva3jv7ygjr7p7bam0qszajs5pirk"))
6221 (modules '((guix build utils)))
6224 ;; The checkout lacks a .git directory, breaking ‘git describe’.
6225 (substitute* "Makefile"
6226 (("\"unknown\"") (string-append "\"v" ,version "\"")))
6228 (build-system gnu-build-system)
6230 `(#:phases (modify-phases %standard-phases
6231 (delete 'configure)) ; no configure script
6232 #:make-flags (let ((out (assoc-ref %outputs "out")))
6233 (list (string-append "CC=" ,(cc-for-target))
6234 (string-append "prefix=" out)
6235 (string-append "DOCDIR=" out "/share/doc/"
6237 "etcprefix=$(DOCDIR)/examples"))
6238 ;; The tests will only run as root on certain supported CPU models.
6240 (supported-systems (list "i686-linux" "x86_64-linux"))
6241 (home-page "https://mcelog.org/")
6242 (synopsis "Machine check monitor for x86 Linux systems")
6244 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
6245 systems running the kernel Linux. It can also perform user-defined tasks, such
6246 as bringing bad pages off-line, when configurable error thresholds are
6248 (license license:gpl2)))
6250 (define-public mtd-utils
6257 "ftp://ftp.infradead.org/pub/mtd-utils/"
6258 "mtd-utils-" version ".tar.bz2"))
6261 "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
6263 '(#:configure-flags '("--enable-unit-tests")))
6265 `(("cmocka" ,cmocka)
6266 ("pkg-config" ,pkg-config)))
6268 `(("acl" ,acl) ; extended attributes (xattr)
6269 ("libuuid" ,util-linux "lib")
6271 ("openssl" ,openssl) ; optional crypto support
6273 ("zstd" ,zstd "lib")))
6274 (build-system gnu-build-system)
6275 (synopsis "MTD Flash Storage Utilities")
6276 (description "This package provides utilities for testing, partitioning, etc
6278 (home-page "http://www.linux-mtd.infradead.org/")
6280 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
6281 license:mpl1.1 ; All ftl* files
6282 license:expat)))) ; libiniparser
6284 (define-public libseccomp
6290 (uri (string-append "https://github.com/seccomp/libseccomp/"
6291 "releases/download/v" version
6292 "/libseccomp-" version ".tar.gz"))
6295 "0m8dlg1v7kflcxvajs4p76p275qwsm2abbf5mfapkakp7hw7wc7f"))))
6296 (build-system gnu-build-system)
6298 '(#:configure-flags '("--disable-static")
6299 #:phases (modify-phases %standard-phases
6300 (add-before 'check 'skip-load-test
6302 ;; This test does a native system call and fails when
6303 ;; run under QEMU user-mode emulation. Just skip it.
6304 (delete-file "tests/52-basic-load.tests")
6309 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
6310 (description "The libseccomp library provides an easy to use, platform
6311 independent, interface to the Linux Kernel's syscall filtering mechanism. The
6312 libseccomp API is designed to abstract away the underlying BPF based syscall
6313 filter language and present a more conventional function-call based filtering
6314 interface that should be familiar to, and easily adopted by, application
6316 (home-page "https://github.com/seccomp/libseccomp")
6317 (license license:lgpl2.1)))
6319 (define-public radeontop
6327 (url "https://github.com/clbr/radeontop")
6328 (commit (string-append "v" version))))
6329 (file-name (git-file-name name version))
6331 (base32 "0ay6vl9zsz9b2scy0fnsy482pzizj52i27syxwny4z4i9wrk2wmn"))))
6332 (build-system gnu-build-system)
6334 `(#:phases (modify-phases %standard-phases
6335 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
6336 ;; dependency, and doesn't even work on release(!) tarballs.
6337 (add-after 'unpack 'report-correct-version
6339 (substitute* "getver.sh"
6341 (string-append "ver=" ,version)))
6343 (delete 'configure)) ; no configure script
6344 #:make-flags (list "CC=gcc"
6345 (string-append "PREFIX=" %output))
6346 #:tests? #f)) ; no tests
6348 `(("gettext" ,gettext-minimal)
6349 ("pkg-config" ,pkg-config)))
6351 `(("libdrm" ,libdrm)
6352 ("libpciaccess" ,libpciaccess)
6354 ("ncurses" ,ncurses)))
6355 (home-page "https://github.com/clbr/radeontop/")
6356 (synopsis "Usage monitor for AMD Radeon graphics")
6357 (description "RadeonTop monitors resource consumption on supported AMD
6358 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
6359 a terminal or saved to a file for further processing. It measures both the
6360 activity of the GPU as a whole, which is also accurate during OpenCL
6361 computations, as well as separate component statistics that are only meaningful
6362 under OpenGL graphics workloads.")
6363 (license license:gpl3)))
6365 (define-public efivar
6371 (uri (string-append "https://github.com/rhboot/" name
6372 "/releases/download/" version "/" name
6373 "-" version ".tar.bz2"))
6374 (patches (search-patches "efivar-gcc-compat.patch"))
6377 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))
6378 (modules '((guix build utils)))
6381 ;; Compile everything within a single LTO partition
6382 ;; to work around ordering issues in the code. Try
6383 ;; removing this for versions > 37.
6384 (substitute* "Make.defaults"
6386 "-flto -flto-partition=one"))))))
6387 (build-system gnu-build-system)
6389 `(;; Tests require a UEFI system and is not detected in the chroot.
6391 #:make-flags (list (string-append "prefix=" %output)
6392 (string-append "libdir=" %output "/lib")
6393 (string-append "CC_FOR_BUILD=" ,(cc-for-target))
6394 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6396 (modify-phases %standard-phases
6397 (delete 'configure))))
6399 `(("pkg-config" ,pkg-config)))
6402 (home-page "https://github.com/rhboot/efivar")
6403 (synopsis "Tool and library to manipulate EFI variables")
6404 (description "This package provides a library and a command line
6405 interface to the variable facility of UEFI boot firmware.")
6406 (license license:lgpl2.1+)))
6408 (define-public efibootmgr
6416 (url "https://github.com/rhinstaller/efibootmgr")
6418 (file-name (git-file-name name version))
6420 (base32 "1niicijxg59rsmiw3rsjwy4bvi1n42dynvm01lnp9haixdzdpq03"))
6421 (patches (search-patches "efibootmgr-remove-extra-decl.patch"))))
6422 (build-system gnu-build-system)
6424 `(#:tests? #f ;no tests
6425 #:make-flags (list (string-append "prefix=" %output)
6426 (string-append "libdir=" %output "/lib")
6427 ;; EFIDIR denotes a subdirectory relative to the
6428 ;; EFI System Partition where the loader will be
6429 ;; installed (known as OS_VENDOR in the code).
6430 ;; GRUB overrides this, as such it's only used if
6431 ;; nothing else is specified on the command line.
6433 #:phases (modify-phases %standard-phases (delete 'configure))))
6435 `(("pkg-config" ,pkg-config)))
6437 `(("efivar" ,efivar)
6439 (home-page "https://github.com/rhinstaller/efibootmgr")
6440 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
6442 "@code{efibootmgr} is a user-space application to modify the Intel
6443 Extensible Firmware Interface (EFI) Boot Manager. This application can
6444 create and destroy boot entries, change the boot order, change the next
6445 running boot option, and more.")
6446 (license license:gpl2+)))
6448 (define-public sysstat
6455 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6456 "sysstat-" version ".tar.xz"))
6458 (base32 "1z8bdyj92q0capbrdscwzb51bqh54ng15gpvmjmvrb2syhqj8hxf"))))
6459 (build-system gnu-build-system)
6461 `(#:tests? #f ; no test suite.
6462 ;; Without this flag, it tries to install the man pages with group 'root'
6463 ;; and fails because /etc/passwd lacks an entry for the root user.
6465 (list "--disable-file-attr"
6466 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
6468 (modify-phases %standard-phases
6469 ;; The build process tries to create '/var/lib/sa', so we skip that
6471 (add-after 'build 'skip-touching-var
6473 (substitute* "Makefile"
6474 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
6477 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
6478 (synopsis "Performance monitoring tools for Linux")
6479 (description "The sysstat utilities are a collection of performance
6480 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
6481 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
6482 @code{sadf} and @code{sa}.")
6483 (license license:gpl2+)))
6485 (define-public light
6493 (url "https://github.com/haikarainen/light")
6494 (commit (string-append "v" version))))
6496 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
6497 (file-name (git-file-name name version))))
6498 (build-system gnu-build-system)
6501 (modify-phases %standard-phases
6502 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
6503 (lambda* (#:key inputs #:allow-other-keys)
6504 (substitute* "90-backlight.rules"
6505 (("/bin/chgrp") (which "chgrp"))
6506 (("/bin/chmod") (which "chmod")))
6508 (add-after 'install 'install-udev-rules
6509 (lambda* (#:key outputs #:allow-other-keys)
6510 (let ((out (assoc-ref outputs "out")))
6512 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
6515 `(("autoconf" ,autoconf)
6516 ("automake" ,automake)))
6517 (home-page "https://haikarainen.github.io/light/")
6518 (synopsis "GNU/Linux application to control backlights")
6520 "Light is a program to send commands to screen backlight controllers
6521 under GNU/Linux. Features include:
6524 @item It does not rely on X.
6525 @item Light can automatically figure out the best controller to use, making
6526 full use of underlying hardware.
6527 @item It is possible to set a minimum brightness value, as some controllers
6528 set the screen to be pitch black at a value of 0 (or higher).
6530 (license license:gpl3+)))
6532 (define-public brightnessctl
6534 (name "brightnessctl")
6536 (home-page "https://github.com/Hummer12007/brightnessctl")
6539 (uri (git-reference (url home-page) (commit version)))
6540 (file-name (git-file-name name version))
6543 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
6544 (patches (search-patches "brightnessctl-elogind-support.patch"))))
6545 (build-system gnu-build-system)
6547 `(#:tests? #f ; no tests
6548 #:make-flags (list (string-append "CC=" ,(cc-for-target))
6549 (string-append "PREFIX=" %output)
6550 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
6553 (modify-phases %standard-phases
6555 (add-after 'unpack 'adjust-udev-rules
6557 (substitute* "Makefile"
6558 (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
6559 (substitute* "90-brightnessctl.rules"
6560 (("/bin/") "/run/current-system/profile/bin/"))
6563 `(("pkg-config" ,pkg-config)))
6565 `(("elogind" ,elogind)))
6566 (synopsis "Backlight and LED brightness control")
6568 "This program allows you read and control device brightness. Devices
6569 include backlight and LEDs. It can also preserve current brightness before
6570 applying the operation, such as on lid close.
6572 The appropriate permissions must be set on the backlight or LED control
6573 interface in sysfs, which can be accomplished with the included udev rules.")
6574 (license license:expat)))
6584 (url "https://github.com/linrunner/TLP")
6586 (file-name (git-file-name name version))
6588 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
6590 `(("shellcheck" ,shellcheck)))
6594 ("ethtool" ,ethtool)
6598 ("inetutils" ,inetutils)
6601 ("pciutils" ,pciutils)
6605 ("usbutils" ,usbutils)
6606 ("util-linux" ,util-linux)
6607 ("wireless-tools" ,wireless-tools)
6608 ,@(if (let ((system (or (%current-target-system)
6609 (%current-system))))
6610 (or (string-prefix? "i686-" system)
6611 (string-prefix? "x86_64-" system)))
6612 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
6614 (build-system gnu-build-system)
6616 ;; XXX: The full test suite is run with "checkall" but it requires
6617 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
6618 `(#:test-target "shellcheck"
6619 #:modules ((guix build gnu-build-system)
6623 (modify-phases %standard-phases
6624 (delete 'configure) ; no configure script
6625 (add-before 'build 'setenv
6626 (lambda* (#:key outputs #:allow-other-keys)
6627 (let ((out (assoc-ref outputs "out")))
6628 (setenv "TLP_WITH_SYSTEMD" "0")
6629 (setenv "TLP_NO_INIT" "1")
6630 (setenv "TLP_NO_PMUTILS" "1")
6631 (setenv "TLP_SBIN" (string-append out "/bin"))
6632 (setenv "TLP_BIN" (string-append out "/bin"))
6633 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
6634 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
6635 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
6636 (setenv "TLP_CONFDEF"
6637 (string-append out "/share/tlp/defaults.conf"))
6638 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
6640 (string-append out "/lib/elogind/system-sleep"))
6642 (string-append out "/share/bash-completion/completions"))
6643 (setenv "TLP_MAN" (string-append out "/share/man"))
6644 (setenv "TLP_META" (string-append out "/share/metainfo"))
6646 (add-before 'install 'fix-installation
6648 ;; Stop the Makefile from trying to create system directories.
6649 (substitute* "Makefile"
6650 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6651 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6654 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6655 (add-after 'install 'wrap
6656 (lambda* (#:key inputs outputs #:allow-other-keys)
6657 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6658 (bin-files (find-files bin ".*")))
6659 (define (bin-directory input-name)
6660 (let ((p (assoc-ref inputs input-name)))
6661 (and p (string-append p "/bin"))))
6662 (define (sbin-directory input-name)
6663 (string-append (assoc-ref inputs input-name) "/sbin"))
6664 (for-each (lambda (program)
6665 (wrap-program program
6668 (filter-map bin-directory
6680 "x86-energy-perf-policy"))
6681 (filter-map sbin-directory
6687 "wireless-tools"))))))
6690 (home-page "https://linrunner.de/en/tlp/tlp.html")
6691 (synopsis "Power management tool for Linux")
6692 (description "TLP is a power management tool for Linux. It comes with
6693 a default configuration already optimized for battery life. Nevertheless,
6694 TLP is customizable to fulfil system requirements. TLP settings are applied
6695 every time the power supply source is changed.")
6696 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6698 (license (list license:gpl2+ license:gpl3+))))
6703 (version "B.02.19.2")
6706 (uri (string-append "https://www.ezix.org/software/"
6707 "files/lshw-" version
6711 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
6712 (build-system gnu-build-system)
6714 `(#:phases (modify-phases %standard-phases (delete 'configure))
6715 #:tests? #f ; no tests
6717 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6718 (synopsis "List hardware information")
6720 "@command{lshw} (Hardware Lister) is a small tool to provide
6721 detailed information on the hardware configuration of the machine.
6722 It can report exact memory configuration, firmware version, mainboard
6723 configuration, CPU version and speed, cache configuration, bus speed,
6724 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6725 machines (PowerMac G4 is known to work).")
6726 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6727 (license license:gpl2+)))
6729 (define-public libmnl
6736 (uri (string-append "mirror://netfilter.org/libmnl/"
6737 "libmnl-" version ".tar.bz2"))
6740 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6741 (build-system gnu-build-system)
6742 (home-page "https://www.netfilter.org/projects/libmnl/")
6743 (synopsis "Netlink utility library")
6744 (description "Libmnl is a minimalistic user-space library oriented to
6745 Netlink developers. There are a lot of common tasks in parsing, validating,
6746 constructing of both the Netlink header and TLVs that are repetitive and easy to
6747 get wrong. This library aims to provide simple helpers that allows you to
6748 re-use code and to avoid re-inventing the wheel.")
6749 (license license:lgpl2.1+)))
6751 (define-public libnftnl
6758 (uri (string-append "mirror://netfilter.org/libnftnl/"
6759 "libnftnl-" version ".tar.bz2"))
6761 (base32 "1xblq1cbcxhr6qmjpy98i1qdza148idgz99vbhjc7s4vzvfizc4h"))))
6762 (build-system gnu-build-system)
6764 `(("pkg-config" ,pkg-config)))
6766 `(("libmnl" ,libmnl)))
6767 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6768 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6769 (description "Libnftnl is a userspace library providing a low-level netlink
6770 programming interface to the in-kernel nf_tables subsystem. The library
6771 libnftnl has been previously known as libnftables. This library is currently
6773 (license license:gpl2+)))
6775 (define-public nftables
6782 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6784 (string-append "https://www.nftables.org/projects/nftables"
6785 "/files/nftables-" version ".tar.bz2")))
6787 (base32 "1d7iwc8xlyfsbgn6qx1sdfcq7jhpl8wpfj39hcd06y8dzp3jvvvn"))))
6788 (build-system gnu-build-system)
6789 (arguments `(#:configure-flags
6790 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6791 (inputs `(("gmp" ,gmp)
6793 ("libnftnl" ,libnftnl)
6794 ("readline" ,readline)))
6795 (native-inputs `(("pkg-config" ,pkg-config)
6798 (home-page "https://www.nftables.org")
6799 (synopsis "Userspace utility for Linux packet filtering")
6800 (description "nftables is the project that aims to replace the existing
6801 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6802 filtering framework, a new userspace utility and also a compatibility layer for
6803 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6804 infrastructure such as the existing hooks, the connection tracking system, the
6805 userspace queueing component and the logging subsystem.")
6806 (license license:gpl2)))
6808 (define-public proot
6816 (url "https://github.com/proot-me/PRoot")
6817 (commit (string-append "v" version))))
6818 (file-name (git-file-name name version))
6820 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6821 (patches (search-patches "proot-test-fhs.patch"))))
6822 (build-system gnu-build-system)
6824 '(#:make-flags '("-C" "src")
6826 #:phases (modify-phases %standard-phases
6828 (add-before 'build 'set-shell-file-name
6829 (lambda* (#:key inputs #:allow-other-keys)
6830 (substitute* (find-files "src" "\\.[ch]$")
6833 (assoc-ref inputs "bash")
6836 (add-before 'check 'fix-fhs-assumptions-in-tests
6838 (substitute* "tests/test-c6b77b77.mk"
6839 (("/bin/bash") (which "bash"))
6840 (("/usr/bin/test") (which "test")))
6841 (substitute* '("tests/test-16573e73.c")
6842 (("/bin/([a-z-]+)" _ program)
6845 (substitute* (find-files "tests" "\\.sh$")
6846 ;; Some of the tests try to "bind-mount" /bin/true.
6848 (string-append "-b " (which "true") ":"))
6849 ;; Likewise for /bin.
6850 (("-b /bin:") "-b /gnu:")
6851 ;; Others try to run /bin/sh.
6852 (("/bin/sh") (which "sh"))
6853 ;; Others assume /etc/fstab exists.
6854 (("/etc/fstab") "/etc/passwd"))
6856 (substitute* "tests/GNUmakefile"
6857 (("-b /bin:") "-b /gnu:"))
6859 ;; XXX: This test fails in an obscure corner case, just
6861 (delete-file "tests/test-kkkkkkkk.c")
6866 (let ((n (parallel-job-count)))
6867 ;; For some reason we get lots of segfaults with
6868 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6869 (setenv "PROOT_NO_SECCOMP" "1")
6871 ;; Most of the tests expect "/bin" to be in $PATH so
6872 ;; they can run things that live in $ROOTFS/bin.
6874 (string-append (getenv "PATH") ":/bin"))
6876 (invoke "make" "check" "-C" "tests"
6878 "-j" (number->string n)))))
6880 (lambda* (#:key outputs #:allow-other-keys)
6881 ;; The 'install' rule does nearly nothing.
6882 (let* ((out (assoc-ref outputs "out"))
6883 (man1 (string-append out "/share/man/man1")))
6884 ;; TODO: 'make install-care' (does not even
6885 ;; build currently.)
6886 (invoke "make" "-C" "src" "install"
6887 (string-append "PREFIX=" out))
6890 (copy-file "doc/proot/man.1"
6891 (string-append man1 "/proot.1"))
6893 (native-inputs `(("which" ,which)
6895 ;; For 'mcookie', used by some of the tests.
6896 ("util-linux" ,util-linux)
6898 ;; XXX: Choose the old coreutils because its 'stat'
6899 ;; program does not use statx(2) when running 'stat -c
6900 ;; %a' or similar, which PRoot doesn't properly support.
6901 ("coreutils-old" ,coreutils-8.30)
6903 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6904 ;; make 4.3 to segfault.
6905 ("make-old" ,gnu-make-4.2)))
6906 (inputs `(("talloc" ,talloc)))
6907 (home-page "https://github.com/proot-me/PRoot")
6908 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6910 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6911 and @code{binfmt_misc}. This means that users don't need any privileges or
6912 setup to do things like using an arbitrary directory as the new root
6913 file system, making files accessible somewhere else in the file system
6914 hierarchy, or executing programs built for another CPU architecture
6915 transparently through QEMU user-mode. Also, developers can use PRoot as a
6916 generic process instrumentation engine thanks to its extension mechanism.
6917 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6918 available in the kernel Linux.")
6919 (license license:gpl2+)))
6921 (define-public proot-static
6924 (name "proot-static")
6926 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6927 (inputs `(("talloc" ,talloc/static)))
6929 (substitute-keyword-arguments (package-arguments proot)
6930 ((#:make-flags flags)
6931 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6933 `(modify-phases ,phases
6934 (add-after 'strip 'remove-store-references
6935 (lambda* (#:key outputs #:allow-other-keys)
6936 (let* ((out (assoc-ref outputs "out")))
6937 (with-directory-excursion out
6938 (remove-store-references "bin/proot")
6940 ((#:allowed-references _ '("out"))
6943 (define-public cpuid
6946 (version "20201006")
6949 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6950 version ".src.tar.gz"))
6953 "19jnkh57f979b78ak5mpxmdvnkgc33r55cw9shgd2hc380b3zi8k"))))
6954 (build-system gnu-build-system)
6957 (list (string-append "CC=" ,(cc-for-target)))
6958 #:tests? #f ; no tests
6959 #:phases (modify-phases %standard-phases
6960 (delete 'configure) ; no configure script
6961 (add-before 'install 'fix-makefile
6962 (lambda* (#:key outputs #:allow-other-keys)
6963 (substitute* "Makefile"
6964 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6965 ;; Make the compressed manpages writable so that the
6966 ;; reset-gzip-timestamps phase does not error out.
6967 (substitute* "Makefile"
6968 (("-m 444") "-m 644"))
6970 (inputs `(("perl" ,perl)))
6971 (supported-systems '("i686-linux" "x86_64-linux"))
6972 (home-page "http://www.etallen.com/cpuid.html")
6973 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6974 (description "cpuid dumps detailed information about the CPU(s) gathered
6975 from the CPUID instruction, and also determines the exact model of CPU(s). It
6976 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6977 NexGen, Rise, and SiS CPUs.")
6978 (license license:gpl2+)))
6980 (define-public jmtpfs
6988 (url "https://github.com/JasonFerrara/jmtpfs")
6989 (commit (string-append "v" version))))
6990 (file-name (git-file-name name version))
6993 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6994 (build-system gnu-build-system)
6998 ("libmtp" ,libmtp)))
7000 `(("pkg-config" ,pkg-config)))
7001 (home-page "https://github.com/JasonFerrara/jmtpfs")
7002 (synopsis "Use a FUSE file system to access data over MTP")
7003 (description "jmtpfs uses FUSE (file system in userspace) to provide access
7004 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
7005 the MTP device as a file system.")
7006 (license license:gpl3)))
7008 (define-public procenv
7016 (url "https://github.com/jamesodhunt/procenv")
7018 (file-name (git-file-name name version))
7020 (base32 "13fnr4gfj2xlxghw93m5gsxzlwzv3s6jv9hja0w0pb23hlncbmhy"))))
7021 (build-system gnu-build-system)
7023 `(("pkg-config" ,pkg-config)
7031 ("libselinux" ,libselinux)))
7032 (synopsis "Utility to show process environment")
7033 (description "Procenv is a command-line tool that displays as much detail about
7034 itself and its environment as possible. It can be used as a test
7035 tool, to understand the type of environment a process runs in, and for
7036 comparing system environments.")
7037 (home-page "https://github.com/jamesodhunt/procenv/")
7038 (license license:gpl3+)))
7040 (define-public libfabric
7048 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
7049 version "/libfabric-" version ".tar.bz2"))
7051 (base32 "1nnpfkwxhim2nqjkb1vwrb4wj4j3l6w6yvvy69fqam2snlhshazz"))))
7052 (build-system gnu-build-system)
7053 (inputs `(("rdma-core" ,rdma-core)
7054 ,@(match (%current-system)
7055 ((member (package-supported-systems psm))
7059 (home-page "https://ofiwg.github.io/libfabric/")
7060 (synopsis "Open Fabric Interfaces")
7062 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
7063 communication services to applications. OFI is best described as a collection
7064 of libraries and applications used to export fabric services. The key
7065 components of OFI are: application interfaces, provider libraries, kernel
7066 services, daemons, and test applications.
7068 Libfabric is a core component of OFI. It is the library that defines and
7069 exports the user-space API of OFI, and is typically the only software that
7070 applications deal with directly. It works in conjunction with provider
7071 libraries, which are often integrated directly into libfabric.")
7072 (license (list license:bsd-2 license:gpl2)))) ;dual
7077 (version "3.3.20170428")
7078 (home-page "https://github.com/intel/psm")
7082 (uri (git-reference (url home-page)
7083 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
7084 (file-name (string-append "psm-" version ".tar.gz"))
7086 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
7087 (patches (search-patches
7088 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
7089 "psm-ldflags.patch" ; build shared lib with LDFLAGS
7090 "psm-repro.patch" ; reproducibility
7091 "psm-disable-memory-stats.patch"))))
7092 (build-system gnu-build-system)
7093 (outputs '("out" "debug"))
7094 (inputs `(("libuuid" ,util-linux "lib")))
7096 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
7097 ,(string-append "INSTALL_PREFIX=" %output)
7098 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
7100 #:phases (modify-phases %standard-phases
7102 (add-after 'unpack 'patch-/usr/include
7104 (substitute* "Makefile"
7105 (("\\$\\{DESTDIR}/usr/include")
7106 (string-append %output "/include")))
7107 (substitute* "Makefile"
7108 (("/lib64") "/lib"))
7110 (add-after 'unpack 'patch-sysmacros
7112 (substitute* "ipath/ipath_proto.c"
7113 (("#include <sys/poll.h>" m)
7114 (string-append m "\n"
7115 "#include <sys/sysmacros.h>")))
7117 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
7119 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
7120 communications interface for the True Scale family of products. PSM users are
7121 enabled with mechanisms necessary to implement higher level communications
7122 interfaces in parallel environments.")
7123 ;; Only Intel-compatable processors are supported.
7124 (supported-systems '("i686-linux" "x86_64-linux"))
7125 (license (list license:bsd-2 license:gpl2)))) ;dual
7127 (define-public snapscreenshot
7129 (name "snapscreenshot")
7130 (version "1.0.14.3")
7134 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
7135 name "-" version ".tar.bz2"))
7137 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
7138 (build-system gnu-build-system)
7141 (let ((out (assoc-ref %outputs "out")))
7142 (list (string-append "BINDIR=" out "/bin")
7143 (string-append "MANDIR=" out "/share/man")))
7144 #:tests? #f ; no test suite
7146 (modify-phases %standard-phases
7147 (delete 'configure) ; ./configure is a snarky no-op
7148 (add-before 'install 'fix-ownership
7149 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
7151 (substitute* "depfun.mak"
7152 ((" -o bin -g bin ") " "))
7154 (add-before 'install 'create-output-directories
7155 (lambda* (#:key outputs #:allow-other-keys)
7156 (let ((out (assoc-ref outputs "out")))
7157 (mkdir-p (string-append out "/share/man/man1"))
7159 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
7160 (synopsis "Take screenshots of one or more Linux text consoles")
7162 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
7163 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
7164 relevant @file{/dev/vcs*} file(s).")
7165 (license license:gpl2)))
7167 (define-public fbcat
7174 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
7175 version "/" name "-" version ".tar.gz"))
7177 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
7178 (build-system gnu-build-system)
7180 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
7181 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
7182 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
7183 `(("pnmtopng" ,netpbm)))
7184 (outputs (list "out" "fbgrab"))
7188 (string-append "PREFIX=" (assoc-ref %outputs "out")))
7189 #:tests? #f ; no tests
7191 (modify-phases %standard-phases
7192 (delete 'configure) ; no configure script
7193 (add-after 'build 'qualify-references
7194 (lambda* (#:key inputs outputs #:allow-other-keys)
7195 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
7196 (out (assoc-ref outputs "out")))
7197 (substitute* "fbgrab"
7199 (string-append out "/bin/" all))
7201 (string-append pnmtopng "/bin/" all)))
7203 (add-after 'install 'split-fbgrab-output
7204 (lambda* (#:key outputs #:allow-other-keys)
7205 (let* ((out (assoc-ref outputs "out"))
7206 (out:fbgrab (assoc-ref outputs "fbgrab")))
7207 (for-each (lambda (file)
7208 (let ((old (string-append out "/" file))
7209 (new (string-append out:fbgrab "/" file)))
7210 (mkdir-p (dirname new))
7211 (rename-file old new)))
7213 "share/man/man1/fbgrab.1"))
7215 (home-page "https://jwilk.net/software/fbcat")
7216 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
7218 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
7219 a dump therof. It supports a wide range of drivers and pixel formats.
7220 @command{fbcat} can take screenshots of virtually any application that can be
7221 made to write its output to the framebuffer, including (but not limited to)
7222 text-mode or graphical applications that don't use a display server.
7224 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
7225 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
7226 (license license:gpl2)))
7228 (define-public libcgroup
7236 "mirror://sourceforge/libcg/" name "/"
7237 version "/" name "-" version ".tar.bz2"))
7239 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
7240 (build-system gnu-build-system)
7247 `(("linux-pam" ,linux-pam)))
7248 (home-page "https://sourceforge.net/projects/libcg/")
7249 (synopsis "Control groups management tools")
7250 (description "Control groups is Linux kernel method for process resource
7251 restriction, permission handling and more. This package provides userspace
7252 interface to this kernel feature.")
7253 (license license:lgpl2.1)))
7255 (define-public mbpfan
7263 (url "https://github.com/dgraziotin/mbpfan")
7264 (commit (string-append "v" version))))
7265 (file-name (git-file-name name version))
7267 (base32 "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr"))))
7268 (build-system gnu-build-system)
7270 `(#:tests? #f ; tests ask to be run as root
7271 #:make-flags (let ((out (assoc-ref %outputs "out")))
7272 (list (string-append "DESTDIR=" out)
7273 ,(string-append "CC=" (cc-for-target))))
7275 (modify-phases %standard-phases
7276 (add-after 'unpack 'patch-paths
7278 (substitute* "Makefile"
7281 (delete 'configure)))) ; there's no configure phase
7282 (home-page "https://github.com/dgraziotin/mbpfan")
7283 (synopsis "Control fan speed on Macbooks")
7285 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
7286 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
7287 module. It can be executed as a daemon or in the foreground with root
7289 (license license:gpl3+)))
7294 (version "11.2.185")
7298 (url "https://github.com/intel/opa-psm2")
7299 (commit (string-append "PSM2_" version))))
7300 (file-name (git-file-name name version))
7303 "062hg4r6gz7pla9df70nqs5i2a3mp1wszmp4l0g771fykhhrxsjg"))))
7304 (build-system gnu-build-system)
7307 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
7309 #:phases (modify-phases %standard-phases
7311 (add-after 'unpack 'patch-Makefiles
7313 (substitute* "Makefile"
7316 (substitute* "compat/Makefile"
7322 (setenv "DESTDIR" %output)
7323 (invoke "make" "install")
7326 `(("rdma-core" ,rdma-core)
7327 ("numactl" ,numactl)))
7328 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
7330 "This package is low-level user-level Intel's communications interface.
7331 The PSM2 API is a high-performance vendor-specific protocol that provides a
7332 low-level communications interface for the Intel Omni-Path family of
7333 high-speed networking devices.")
7334 (home-page "https://github.com/intel/opa-psm2")
7335 ;; Only the x86_64 architecure is supported.
7336 (supported-systems '("x86_64-linux"))
7337 (license (list license:bsd-3 license:gpl2)))) ; dual
7339 (define-public libpfm4
7345 (uri (string-append "mirror://sourceforge/perfmon2/"
7346 name "/libpfm-" version ".tar.gz"))
7349 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
7350 (build-system gnu-build-system)
7352 '(#:modules ((guix build utils)
7353 (guix build gnu-build-system))
7354 #:phases (modify-phases %standard-phases
7358 (lambda* (#:key inputs outputs #:allow-other-keys)
7359 (let* ((out (assoc-ref outputs "out")))
7364 (lambda* (#:key outputs #:allow-other-keys)
7365 (let* ((out (assoc-ref outputs "out")))
7367 (string-append "PREFIX=" out)
7370 (synopsis "Performance event monitoring library")
7372 "This package provides a library called libpfm4, which is used to develop
7373 monitoring tools exploiting the performance monitoring events such as those
7374 provided by the Performance Monitoring Unit (PMU) of modern processors.
7376 Libpfm4 helps convert from an event name, expressed as a string, to the event
7377 encoding that is either the raw event as documented by the hardware vendor or
7378 the OS-specific encoding. In the latter case, the library is able to prepare
7379 the OS-specific data structures needed by the kernel to setup the event.
7381 libpfm4 provides support for the @code{perf_events} interface, which was
7382 introduced in Linux 2.6.31.")
7383 (home-page "http://perfmon2.sourceforge.net/")
7384 (license license:expat)))
7386 (define-public libnfnetlink
7388 (name "libnfnetlink")
7393 "https://www.netfilter.org/projects/libnfnetlink/files/"
7394 "libnfnetlink-" version ".tar.bz2"))
7397 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
7398 (build-system gnu-build-system)
7399 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
7400 (synopsis "Low-level netfilter netlink communication library")
7402 "@code{libnfnetlink} is the low-level library for netfilter related
7403 kernel/userspace communication. It provides a generic messaging
7404 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
7405 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
7406 management tools in userspace.")
7407 (license license:gpl2)))
7409 (define-public go-netlink
7416 (url "https://github.com/vishvananda/netlink")
7417 (commit (string-append "v" version))))
7418 (file-name (git-file-name name version))
7421 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
7422 (build-system go-build-system)
7424 `(#:import-path "github.com/vishvananda/netlink"))
7426 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
7427 ("go-netns" ,go-netns)))
7428 (home-page "https://github.com/vishvananda/netlink")
7429 (synopsis "Simple netlink library for Go")
7430 (description "The netlink package provides a simple netlink library for
7431 Go. Netlink is the interface a user-space program in Linux uses to
7432 communicate with the kernel. It can be used to add and remove interfaces, set
7433 IP addresses and routes, and configure IPsec.")
7434 (license license:asl2.0)))
7436 (define-public libinih
7443 (url "https://github.com/benhoyt/inih")
7444 (commit (string-append "r" version))))
7445 (file-name (git-file-name name version))
7448 "0dqf5j2sw4hq68rqvxbrsf44ygfzx9ypiyzipk4cvp9aimbvsbc6"))))
7449 (build-system meson-build-system)
7451 '(#:configure-flags '("-Ddistro_install=true" "-Ddefault_library=shared")))
7452 (home-page "https://github.com/benhoyt/inih")
7453 (synopsis "Simple .INI parser library for C")
7454 (description "The inih (INI Not Invented Here) library is a simple .INI file
7455 parser written in C. It's only a couple of pages of code, and it was designed to
7456 be small and simple, so it's good for embedded systems. It's also more or less
7457 compatible with Python's ConfigParser style of .INI files, including RFC
7458 822-style multi-line syntax and name: value entries.")
7459 (license license:bsd-3)))
7461 (define-public xfsprogs
7468 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
7469 "xfsprogs-" version ".tar.gz"))
7472 "0b5vvwq4rqw7kph23ycd518d31dx3wq7w61znixxpdljx0ig71qn"))))
7473 (build-system gnu-build-system)
7474 (outputs (list "out" "python"))
7476 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
7478 (modify-phases %standard-phases
7479 (add-after 'install 'separate-python-output
7480 (lambda* (#:key outputs #:allow-other-keys)
7481 (let ((out (assoc-ref outputs "out"))
7482 (python (assoc-ref outputs "python")))
7485 (mkdir-p (string-append python (dirname script)))
7486 (rename-file (string-append out script)
7487 (string-append python script)))
7488 (list "/sbin/xfs_scrub_all"))
7490 (add-after 'install 'install-headers
7492 (invoke "make" "install-dev"))))))
7494 `(("gettext" ,gettext-minimal)))
7496 `(("libinih" ,libinih)
7497 ("libuuid" ,util-linux "lib")
7498 ("python" ,python-wrapper)))
7499 (home-page "https://xfs.wiki.kernel.org/")
7500 (synopsis "XFS file system tools")
7501 (description "This package provides commands to create and check XFS
7503 ;; The library "libhandle" and the headers in "xfslibs-dev" are
7504 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
7505 (license (list license:gpl2 license:lgpl2.1))))
7507 (define-public genext2fs
7514 (url "https://github.com/jeremie-koenig/genext2fs")
7515 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
7516 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
7517 (file-name (git-file-name name version))
7519 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
7520 (build-system gnu-build-system)
7523 (modify-phases %standard-phases
7524 (add-after 'unpack 'apply-debian-patches
7525 ;; Debian changes (the revision after ‘-’ in VERSION) are
7526 ;; maintained as separate patches. Apply those relevant to us.
7530 (invoke "patch" "-p1" "-i"
7531 (string-append "debian/patches/" file-name)))
7532 (list "blocksize+creator.diff" ; add -B/-o options
7533 "byteswap_fix.diff"))
7536 `(("autoconf" ,autoconf)
7537 ("automake" ,automake)))
7538 (home-page "https://github.com/jeremie-koenig/genext2fs")
7539 (synopsis "Generate ext2 file system as a normal user")
7540 (description "This package provides a program to generate an ext2
7541 file system as a normal (non-root) user. It does not require you to mount
7542 the image file to copy files on it, nor does it require that you become
7543 the superuser to make device nodes.")
7544 (license license:gpl2)))
7546 (define-public fakeroot
7551 ;; There are no tags in the repository, so take this snapshot.
7553 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
7554 "fakeroot/fakeroot_" version ".orig.tar.gz"))
7555 (file-name (string-append name "-" version ".tar.gz"))
7558 "0v4m3v1bdqvblwj3vqsb3mllgbci6dsgsydq6765nzvz6n1kd44f"))))
7559 (build-system gnu-build-system)
7562 (modify-phases %standard-phases
7565 ;; The "preroll" script takes care of Autoconf and also
7566 ;; prepares the translated manuals.
7567 (invoke "sh" "./preroll")))
7568 (add-after 'configure 'patch-Makefile
7570 ;; Note: The root of the problem is already in "Makefile.am".
7571 (substitute* "Makefile"
7572 (("/bin/sh") (which "sh")))
7574 (add-after 'unpack 'patch-script
7575 (lambda* (#:key inputs #:allow-other-keys)
7576 (substitute* "scripts/fakeroot.in"
7578 (string-append (assoc-ref inputs "util-linux")
7581 (string-append (assoc-ref inputs "sed")
7584 (string-append (assoc-ref inputs "coreutils")
7587 (add-before 'configure 'setenv
7589 (setenv "LIBS" "-lacl")
7591 (add-before 'check 'prepare-check
7593 (setenv "SHELL" (which "bash"))
7594 (setenv "VERBOSE" "1")
7595 (substitute* "test/t.touchinstall"
7596 ;; We don't have the name of the root user, so use ID=0.
7597 (("grep root") "grep \"\\<0\\>\""))
7598 (substitute* "test/tartest"
7599 ;; We don't have the name of the root group, so use ID=0.
7600 (("ROOTGROUP=root") "ROOTGROUP=0")
7601 ;; We don't have the name of the daemon user, so use IDs.
7602 (("daemon:sys") "1:3")
7604 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
7605 (substitute* "test/compare-tar"
7606 (("tar -tvf") "tar --numeric-owner -tvf"))
7609 `(;; For bootstrapping the package.
7610 ("autoconf" ,autoconf)
7611 ("automake" ,automake)
7612 ("libtool" ,libtool)
7613 ("gettext" ,gettext-minimal)
7617 ("sharutils" ,sharutils)
7622 ("util-linux" ,util-linux)
7624 ("coreutils" ,coreutils)))
7625 (synopsis "Provides a fake root environment")
7626 (description "@command{fakeroot} runs a command in an environment where
7627 it appears to have root privileges for file manipulation. This is useful
7628 for allowing users to create archives (tar, ar, .deb etc.) with files in
7629 them with root permissions/ownership. Without fakeroot one would have to
7630 have root privileges to create the constituent files of the archives with
7631 the correct permissions and ownership, and then pack them up, or one would
7632 have to construct the archives directly, without using the archiver.")
7633 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
7634 (license license:gpl3+)))
7636 (define-public fakechroot
7643 "https://github.com/dex4er/fakechroot/releases/download/"
7644 version "/fakechroot-" version ".tar.gz"))
7647 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
7648 (build-system gnu-build-system)
7650 ;; XXX: The tests heavily assume they run on an FHS system so for now
7653 #:configure-flags '("--disable-static")))
7654 (synopsis "Emulate @code{chroot} by overriding file system calls")
7656 "@command{fakechroot} runs a command in an environment were is additional
7657 possibility to use @code{chroot} command without root privileges. This is
7658 useful for allowing users to create own chrooted environment with possibility
7659 to install another packages without need for root privileges.
7661 It works by providing @file{libfakechroot.so}, a shared library meant to be
7662 set as @code{LD_PRELOAD} to override the C library file system functions.")
7663 (home-page "https://github.com/dex4er/fakechroot/")
7664 (license license:lgpl2.1+)))
7666 (define-public inputattach
7668 (name "inputattach")
7673 (url "https://github.com/linuxwacom/input-wacom")
7674 (commit (string-append "input-wacom-" version))))
7675 (file-name (git-file-name name version))
7677 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
7678 (build-system gnu-build-system)
7681 (modify-phases %standard-phases
7685 (lambda* (#:key inputs #:allow-other-keys)
7686 (with-directory-excursion "inputattach"
7687 (invoke (string-append (assoc-ref inputs "gcc")
7689 "-O2" "-o" "inputattach" "inputattach.c"))
7693 (lambda* (#:key outputs #:allow-other-keys)
7694 (let ((target-dir (string-append
7695 (assoc-ref outputs "out")
7697 (mkdir-p target-dir)
7698 (copy-file "inputattach/inputattach"
7699 (string-append target-dir
7702 (home-page "https://linuxwacom.github.io/")
7703 (synopsis "Dispatch input peripherals events to a device file")
7704 (description "inputattach dispatches input events from several device
7705 types and interfaces and translates so that the X server can use them.")
7706 (license license:gpl2+)))
7708 (define-public pipewire
7715 (url "https://github.com/PipeWire/pipewire")
7717 (file-name (git-file-name name version))
7720 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
7721 (build-system meson-build-system)
7723 '(#:configure-flags '("-Dsystemd=false")))
7725 `(("pkg-config" ,pkg-config)))
7727 `(("alsa-lib" ,alsa-lib)
7731 ("gstreamer" ,gstreamer)
7732 ("gst-plugins-base" ,gst-plugins-base)
7736 (home-page "https://pipewire.org/")
7737 (synopsis "Server and user space API to deal with multimedia pipelines")
7739 "PipeWire is a project that aims to greatly improve handling of audio and
7740 video under Linux. It aims to support the usecases currently handled by both
7741 PulseAudio and Jack and at the same time provide same level of powerful handling
7742 of Video input and output. It also introduces a security model that makes
7743 interacting with audio and video devices from containerized applications easy,
7744 with supporting Flatpak applications being the primary goal. Alongside Wayland
7745 and Flatpak we expect PipeWire to provide a core building block for the future
7746 of Linux application development.")
7747 (license license:lgpl2.0+)))
7749 (define-public pipewire-0.3
7757 (url "https://github.com/PipeWire/pipewire")
7759 (file-name (git-file-name name version))
7762 "16jjxcnahxqfcawz77ywx837ybhwzcivn7hgqb9cmlp1y2syy8gk"))))
7765 (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
7766 "/lib/udev/rules.d")
7767 "-Dsystemd=disabled")
7769 (modify-phases %standard-phases
7770 ;; Skip shrink-runpath, otherwise validate-runpath fails.
7771 (delete 'shrink-runpath))))
7773 (append (package-inputs pipewire)
7776 ("pulseaudio" ,pulseaudio)
7777 ("vulkan-loader" ,vulkan-loader)
7778 ("vulkan-headers" ,vulkan-headers))))))
7787 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7789 (file-name (git-file-name name version))
7792 "14scs8vqpcf2810gvabsplg9yzh9y4sz47407bjy6vd604z3w8ah"))))
7793 (build-system gnu-build-system)
7796 (modify-phases %standard-phases
7797 (add-after 'unpack 'fix-dbus-tests
7799 (substitute* '("unit/test-dbus-message-fds.c"
7800 "unit/test-dbus-properties.c"
7802 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7807 `(("autoconf" ,autoconf)
7808 ("libtool" ,libtool)
7809 ("pkgconfig" ,pkg-config)
7810 ("automake" ,automake)))
7811 (home-page "https://01.org/ell")
7812 (synopsis "Embedded Linux Library")
7813 (description "The Embedded Linux* Library (ELL) provides core, low-level
7814 functionality for system daemons. It typically has no dependencies other than
7815 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7816 ELL is designed to be efficient and compact enough for use on embedded Linux
7817 platforms, it is not limited to resource-constrained systems.")
7818 (license license:lgpl2.1+)))
7820 (define-public lttng-ust
7826 (uri (string-append "https://lttng.org/files/lttng-ust/"
7827 "lttng-ust-" version ".tar.bz2"))
7830 "1iwz6p79zvibj8sl8qqw84lcir9a8z1ylq77hhnwg26anrjg1l5w"))))
7831 (build-system gnu-build-system)
7833 `(("liburcu" ,liburcu)
7834 ("numactl" ,numactl)))
7836 `(("python" ,python-3)))
7837 (home-page "https://lttng.org/")
7838 (synopsis "LTTng userspace tracer libraries")
7839 (description "The user space tracing library, liblttng-ust, is the LTTng
7840 user space tracer. It receives commands from a session daemon, for example to
7841 enable and disable specific instrumentation points, and writes event records
7842 to ring buffers shared with a consumer daemon.")
7843 (license license:lgpl2.1+)))
7845 (define-public kexec-tools
7847 (name "kexec-tools")
7851 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7852 "/kexec/kexec-tools-" version ".tar.xz"))
7855 "1hj9mj6x3qs9c8x8mrri9xd3wsg3gwzbab3jfa5ry146xm4pzjcn"))))
7856 (build-system gnu-build-system)
7858 ;; There are no automated tests.
7860 (home-page "https://projects.horms.net/projects/kexec/")
7861 (synopsis "Tools for booting directly into different kernels")
7862 (description "This package provides the @code{kexec} program and ancillary
7863 utilities. Using @code{kexec}, it is possible to boot directly into a new
7864 kernel from the context of an already-running kernel, bypassing the normal
7865 system boot process.")
7866 (license license:gpl2)))
7868 (define-public cachefilesd
7870 (name "cachefilesd")
7875 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7876 "/cachefilesd.git/snapshot/cachefilesd-"
7880 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7881 (build-system gnu-build-system)
7884 `(#:tests? #f ; there are no tests
7886 (let ((prefix-dir (lambda (var dir)
7887 (string-append var "=" %output "/" dir))))
7888 (list (string-append "CC=" ,(cc-for-target))
7889 (prefix-dir "SBINDIR" "sbin/")
7890 (prefix-dir "ETCDIR" "etc/")
7891 (prefix-dir "MANDIR" "share/man/")))
7892 #:phases (modify-phases %standard-phases (delete 'configure))))
7893 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7894 (synopsis "CacheFiles userspace management daemon")
7895 (description "@code{cachefilesd} is a userspace daemon that manages the
7896 cache data store that is used by network file systems such as @code{AFS} and
7897 @code{NFS} to cache data locally on disk. The content of the cache is
7898 persistent over reboots.")
7899 (license license:gpl2+)))
7901 (define-public libbpf
7909 (url "https://github.com/libbpf/libbpf")
7910 (commit (string-append "v" version))))
7911 (file-name (git-file-name name version))
7914 "0ilnnm4q22f8fagwp8kb37licy4ks861i2iqh2djsypqhnxvx3fv"))))
7915 (build-system gnu-build-system)
7917 `(("pkg-config" ,pkg-config)))
7919 ;; In Requires.private of libbpf.pc.
7920 `(("libelf" ,libelf)
7923 `(#:tests? #f ; no tests
7926 (string-append "PREFIX=" (assoc-ref %outputs "out"))
7927 (string-append "LIBDIR=$(PREFIX)/lib")
7929 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
7931 (modify-phases %standard-phases
7933 (add-before 'build 'pre-build
7937 (home-page "https://github.com/libbpf/libbpf")
7938 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
7940 "Libbpf supports building BPF CO-RE-enabled applications, which, in
7941 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
7943 (license `(,license:lgpl2.1 ,license:bsd-2))))
7953 (url "https://github.com/iovisor/bcc")
7954 (commit (string-append "v" version))))
7955 (file-name (git-file-name name version))
7958 "1367c0bzrpclvjvmk0sxgi49rh7j2f9izqk5a7g3yvawh1fmvvjh"))))
7959 (build-system cmake-build-system)
7964 `(("clang-toolchain" ,clang-toolchain)
7965 ("libbpf" ,(package-source libbpf))
7966 ;; LibElf required but libelf does not contain
7967 ;; archives, only object files.
7968 ;; https://github.com/iovisor/bcc/issues/504
7969 ("elfutils" ,elfutils)
7970 ("linux-libre-headers" ,linux-libre-headers)
7972 ("python-wrapper" ,python-wrapper)))
7974 `(;; Tests all require root permissions and a "standard" file hierarchy.
7977 (let ((revision ,version))
7978 `(,(string-append "-DREVISION=" revision)))
7980 (modify-phases %standard-phases
7981 ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
7982 (add-after 'unpack 'copy-libbpf
7983 (lambda* (#:key inputs #:allow-other-keys)
7984 (delete-file-recursively "src/cc/libbpf")
7986 (assoc-ref inputs "libbpf") "src/cc/libbpf")))
7987 (add-after 'copy-libbpf 'substitute-libbc
7988 (lambda* (#:key outputs #:allow-other-keys)
7989 (substitute* "src/python/bcc/libbcc.py"
7990 (("(libbcc\\.so.*)\\b" _ libbcc)
7992 (assoc-ref outputs "out") "/lib/" libbcc)))))
7993 (add-after 'install 'wrap-tools
7994 (lambda* (#:key outputs #:allow-other-keys)
7995 (use-modules (ice-9 textual-ports))
7996 (let* ((out (assoc-ref outputs "out"))
7997 (lib (string-append out "/lib"))
7998 (tools (string-append out "/share/bcc/tools"))
8000 (lambda (filename _)
8001 (call-with-input-file filename
8003 (string-contains (get-line port)
8006 (lambda (python-executable)
8007 (format #t "Wrapping: ~A.~%" python-executable)
8008 (wrap-program python-executable
8009 `("PYTHONPATH" ":" prefix
8010 (,(string-append lib
8012 ,(version-major+minor
8013 (package-version python))
8014 "/site-packages")))))
8015 (find-files tools python-executable?))
8017 (home-page "https://github.com/iovisor/bcc")
8018 (synopsis "Tools for BPF on Linux")
8020 "BCC is a toolkit for creating efficient kernel tracing and manipulation
8021 programs, and includes several useful tools and examples. It makes use of
8022 extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
8023 that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
8025 (license license:asl2.0)))
8027 (define-public bpftrace
8035 (url "https://github.com/iovisor/bpftrace")
8036 (commit (string-append "v" version))))
8037 (file-name (git-file-name name version))
8039 (base32 "0y4qgm2cpccrsm20rnh92hqplddqsc5q5zhw9nqn2igm3h9i0z7h"))
8040 (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
8041 (build-system cmake-build-system)
8047 ("clang-toolchain" ,clang-toolchain)
8048 ("elfutils" ,elfutils)
8050 ("linux-libre-headers" ,linux-libre-headers)))
8052 `(#:tests? #f ;Tests require googletest sources.
8054 '("-DBUILD_TESTING=OFF"
8055 ;; FIXME: libbfd misses some link dependencies, when fixed, remove
8056 ;; the associated patch.
8057 "-DHAVE_BFD_DISASM=OFF")))
8058 (home-page "https://github.com/iovisor/bpftrace")
8059 (synopsis "High-level tracing language for Linux eBPF")
8061 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
8062 Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
8063 LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
8064 interacting with the Linux BPF system, as well as existing Linux tracing
8065 capabilities: kernel dynamic tracing (kprobes), user-level dynamic
8066 tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
8067 and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
8068 created by Alastair Robertson.")
8069 (license license:asl2.0)))
8071 (define-public ttyebus-linux-module
8072 (let ((revision "0")
8073 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
8075 (name "ttyebus-linux-module")
8076 (version (git-version "1.5" revision commit))
8081 (url "https://github.com/eBUS/ttyebus")
8082 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
8083 (file-name (git-file-name name version))
8086 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
8087 (supported-systems '("armhf-linux" "aarch64-linux"))
8088 (build-system linux-module-build-system)
8091 (home-page "https://github.com/eBUS/ttyebus")
8092 (synopsis "Low-latency Raspberry Pi UART driver")
8093 (description "This package provides a Linux kernel module that will
8094 provide a serial device @code{/dev/ttyebus} with almost no latency upon
8095 receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
8096 (license license:gpl3+))))
8098 (define-public ipset
8105 (uri (string-append "https://ipset.netfilter.org/"
8106 "ipset-" version ".tar.bz2"))
8108 (base32 "0zdzp9fhpp6hmirzxy7w27fb9xx9lxd2ykxbn8by7ngi62nvll9i"))))
8109 (build-system gnu-build-system)
8111 `(("libmnl" ,libmnl)))
8113 `(("pkg-config" ,pkg-config)))
8115 `(#:configure-flags '("--with-kmod=no")))
8116 (home-page "https://ipset.netfilter.org/")
8117 (synopsis "Administration tool for IP sets")
8118 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
8119 can be administered by the ipset utility. Depending on the type,
8120 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
8121 IP addresses with MAC addresses in a way which ensures lightning speed
8122 when matching an entry against a set.
8126 @item store multiple IP addresses or port numbers and match against the entire
8127 collection using a single iptables rule.
8128 @item dynamically update iptables rules against IP addresses or ports without
8129 performance penalty.
8130 @item express complex IP address and ports based rulesets with a single
8131 iptables rule and benefit from the speed of IP sets.
8133 then IP sets may be the proper tool for you.")
8134 (license license:gpl2+)))
8136 (define-public liburing
8143 (url "https://git.kernel.dk/liburing")
8144 (commit (string-append "liburing-" version))))
8145 (file-name (git-file-name name version))
8148 "15z44l7y4c6s6dlf7v8lq4znlsjbja2r4ifbni0l8cdcnq0w3zh3"))))
8149 (build-system gnu-build-system)
8151 `(;; Tests are dependent on kernel version and features
8154 (modify-phases %standard-phases
8156 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
8157 ;; --enable-fast-install, and --build
8158 (lambda* (#:key outputs #:allow-other-keys)
8159 (let ((out (assoc-ref outputs "out")))
8160 (setenv "SHELL" (which "sh"))
8161 (setenv "CONFIG_SHELL" (which "sh"))
8162 (invoke "./configure" (string-append "--prefix=" out))))))))
8163 (home-page "https://github.com/axboe/liburing")
8164 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
8165 (description "This is the io_uring library, liburing. liburing provides
8166 helpers to setup and teardown io_uring instances, and also a simplified
8167 interface for applications that don't need (or want) to deal with the full
8168 kernel side implementation.")
8169 (license license:expat)))
8171 (define-public erofs-utils
8173 (name "erofs-utils")
8179 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
8180 (commit (string-append "v" version))))
8181 (file-name (git-file-name name version))
8183 (base32 "0sqiw05zbxr6l0g9gn3whkc4qc5km2qvfg4lnm08nppwskm8yaw8"))))
8184 (build-system gnu-build-system)
8187 ("libuuid" ,util-linux "lib")))
8189 `(("autoconf" ,autoconf)
8190 ("automake" ,automake)
8191 ("libtool" ,libtool)
8192 ("pkg-config" ,pkg-config)))
8193 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
8194 (synopsis "User-space tools for the EROFS file system")
8196 "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
8197 read-only file system optimized for resource-scarce devices. This package
8198 provides user-space tools for creating EROFS file systems.")
8199 (license license:gpl2+)))
8201 (define-public rasdaemon
8209 (url "https://github.com/mchehab/rasdaemon")
8210 (commit (string-append "v" version))))
8211 (file-name (git-file-name name version))
8213 (base32 "12ih96jwmr7imp9zyckf9zjqqm5ra1kv5fj6kbw71y6yl31069dz"))))
8214 (native-inputs `(("autoconf" ,autoconf)
8215 ("automake" ,automake)
8216 ("libtool" ,libtool)))
8217 (inputs `(("sqlite" ,sqlite)))
8220 (list "--enable-all"
8221 ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
8222 "--with-sysconfdefdir=."
8223 "--localstatedir=/var")
8225 (modify-phases %standard-phases
8226 (add-before 'configure 'munge-autotools
8228 ;; For some reason upstream forces sysconfdir=/etc. This results
8229 ;; in EPERM during the install phase. Removing the offending
8230 ;; line lets sysconfdir correctly pick up DESTDIR.
8231 (substitute* "configure.ac"
8232 (("^test .* sysconfdir=/etc\n$") ""))
8233 ;; Upstream tries to create /var/lib/rasdaemon at install time.
8234 ;; This results in EPERM on guix. Instead, the service should
8235 ;; create this at activation time.
8236 (substitute* "Makefile.am"
8237 (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") "")))))))
8238 (build-system gnu-build-system)
8239 (home-page "https://github.com/mchehab/rasdaemon")
8240 (synopsis "Platform Reliability, Availability, and Serviceability tools")
8242 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
8243 Availability and Serviceability} reports from Linux kernel trace events.
8244 These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
8245 through standard log mechanisms like syslog.")
8246 (license license:gpl2)))