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 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 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 Brice Waegeneire <brice@waegenei.re>
47 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
48 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
49 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
50 ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
51 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
52 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
53 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
54 ;;; Copyright © 2020 David Dashyan <mail@davie.li>
55 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
56 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
58 ;;; This file is part of GNU Guix.
60 ;;; GNU Guix is free software; you can redistribute it and/or modify it
61 ;;; under the terms of the GNU General Public License as published by
62 ;;; the Free Software Foundation; either version 3 of the License, or (at
63 ;;; your option) any later version.
65 ;;; GNU Guix is distributed in the hope that it will be useful, but
66 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
67 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
68 ;;; GNU General Public License for more details.
70 ;;; You should have received a copy of the GNU General Public License
71 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
73 (define-module (gnu packages linux)
74 #:use-module (gnu packages)
75 #:use-module (gnu packages acl)
76 #:use-module (gnu packages admin)
77 #:use-module (gnu packages algebra)
78 #:use-module (gnu packages audio)
79 #:use-module (gnu packages autotools)
80 #:use-module (gnu packages backup)
81 #:use-module (gnu packages base)
82 #:use-module (gnu packages bash)
83 #:use-module (gnu packages bison)
84 #:use-module (gnu packages boost)
85 #:use-module (gnu packages calendar)
86 #:use-module (gnu packages check)
87 #:use-module (gnu packages cpio)
88 #:use-module (gnu packages crypto)
89 #:use-module (gnu packages cryptsetup)
90 #:use-module (gnu packages compression)
91 #:use-module (gnu packages dbm)
92 #:use-module (gnu packages datastructures)
93 #:use-module (gnu packages docbook)
94 #:use-module (gnu packages documentation)
95 #:use-module (gnu packages elf)
96 #:use-module (gnu packages flex)
97 #:use-module (gnu packages file)
98 #:use-module (gnu packages freedesktop)
99 #:use-module (gnu packages gawk)
100 #:use-module (gnu packages gcc)
101 #:use-module (gnu packages gettext)
102 #:use-module (gnu packages glib)
103 #:use-module (gnu packages golang)
104 #:use-module (gnu packages gperf)
105 #:use-module (gnu packages gstreamer)
106 #:use-module (gnu packages gtk)
107 #:use-module (gnu packages haskell-apps)
108 #:use-module (gnu packages haskell-xyz)
109 #:use-module (gnu packages libunwind)
110 #:use-module (gnu packages libusb)
111 #:use-module (gnu packages llvm)
112 #:use-module (gnu packages lua)
113 #:use-module (gnu packages man)
114 #:use-module (gnu packages maths)
115 #:use-module (gnu packages multiprecision)
116 #:use-module (gnu packages ncurses)
117 #:use-module (gnu packages netpbm)
118 #:use-module (gnu packages networking)
119 #:use-module (gnu packages ninja)
120 #:use-module (gnu packages nss)
121 #:use-module (gnu packages perl)
122 #:use-module (gnu packages pciutils)
123 #:use-module (gnu packages pkg-config)
124 #:use-module (gnu packages popt)
125 #:use-module (gnu packages pulseaudio)
126 #:use-module (gnu packages python)
127 #:use-module (gnu packages python-xyz)
128 #:use-module (gnu packages readline)
129 #:use-module (gnu packages rrdtool)
130 #:use-module (gnu packages samba)
131 #:use-module (gnu packages sdl)
132 #:use-module (gnu packages serialization)
133 #:use-module (gnu packages slang)
134 #:use-module (gnu packages sqlite)
135 #:use-module (gnu packages texinfo)
136 #:use-module (gnu packages tls)
137 #:use-module (gnu packages valgrind)
138 #:use-module (gnu packages video)
139 #:use-module (gnu packages vulkan)
140 #:use-module (gnu packages web)
141 #:use-module (gnu packages xiph)
142 #:use-module (gnu packages xml)
143 #:use-module (gnu packages xdisorg)
144 #:use-module (gnu packages xorg)
145 #:use-module (gnu packages groff)
146 #:use-module (gnu packages rsync)
147 #:use-module (gnu packages selinux)
148 #:use-module (gnu packages swig)
149 #:use-module (guix build-system cmake)
150 #:use-module (guix build-system gnu)
151 #:use-module (guix build-system go)
152 #:use-module (guix build-system meson)
153 #:use-module (guix build-system python)
154 #:use-module (guix build-system trivial)
155 #:use-module (guix build-system linux-module)
156 #:use-module (guix download)
157 #:use-module (guix git-download)
158 #:use-module ((guix licenses) #:prefix license:)
159 #:use-module (guix packages)
160 #:use-module (guix gexp)
161 #:use-module (guix store)
162 #:use-module (guix monads)
163 #:use-module (guix utils)
164 #:use-module (guix deprecation) ;for libcap/next
165 #:use-module (srfi srfi-1)
166 #:use-module (srfi srfi-2)
167 #:use-module (srfi srfi-26)
168 #:use-module (ice-9 match))
170 (define-public (system->linux-architecture arch)
171 "Return the Linux architecture name for ARCH, a Guix system name such as
172 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
173 (let ((arch (car (string-split arch #\-))))
174 (cond ((string=? arch "i686") "i386")
175 ((string-prefix? "mips" arch) "mips")
176 ((string-prefix? "arm" arch) "arm")
177 ((string-prefix? "aarch64" arch) "arm64")
178 ((string-prefix? "alpha" arch) "alpha")
179 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
180 ((string-prefix? "s390" arch) "s390")
181 ((string-prefix? "riscv" arch) "riscv")
184 (define-public (system->defconfig system)
185 "Some systems (notably powerpc-linux) require a special target for kernel
186 defconfig. Return the appropriate make target if applicable, otherwise return
188 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
189 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
190 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
195 ;;; Kernel source code deblobbing.
198 (define (linux-libre-deblob-scripts version
201 (list (version-major+minor version)
204 (uri (string-append "https://linux-libre.fsfla.org"
205 "/pub/linux-libre/releases/" version "-gnu/"
206 "deblob-" (version-major+minor version)))
207 (file-name (string-append "linux-libre-deblob-"
209 (sha256 deblob-hash))
212 (uri (string-append "https://linux-libre.fsfla.org"
213 "/pub/linux-libre/releases/" version "-gnu/"
215 (file-name (string-append "linux-libre-deblob-check-" version))
216 (sha256 deblob-check-hash))))
218 (define* (computed-origin-method gexp-promise hash-algo hash
219 #:optional (name "source")
220 #:key (system (%current-system))
221 (guile (default-guile)))
222 "Return a derivation that executes the G-expression that results
223 from forcing GEXP-PROMISE."
224 (mlet %store-monad ((guile (package->derivation guile system)))
225 (gexp->derivation (or name "computed-origin")
227 #:graft? #f ;nothing to graft
229 #:guile-for-build guile)))
231 (define (make-linux-libre-source version
234 "Return a 'computed' origin that generates a Linux-libre tarball from the
235 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
236 (match deblob-scripts
237 ((deblob-version (? origin? deblob) (? origin? deblob-check))
238 (unless (string=? deblob-version (version-major+minor version))
239 ;; The deblob script cannot be expected to work properly on a
240 ;; different version (major+minor) of Linux, even if no errors
241 ;; are signaled during execution.
242 (error "deblob major+minor version mismatch"))
244 (method computed-origin-method)
245 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
249 (with-imported-modules '((guix build utils))
251 (use-modules (guix build utils)
256 (setvbuf (current-output-port) 'line)
258 (let ((dir (string-append "linux-" #$version)))
261 (set-path-environment-variable
264 #+(canonical-package bash)
265 #+(canonical-package coreutils)
266 #+(canonical-package diffutils)
267 #+(canonical-package findutils)
268 #+(canonical-package patch)
269 #+(canonical-package xz)
270 #+(canonical-package sed)
271 #+(canonical-package grep)
272 #+(canonical-package bzip2)
273 #+(canonical-package gzip)
274 #+(canonical-package tar)
275 #+(canonical-package gawk)
278 (with-directory-excursion "/tmp/bin"
280 (copy-file #+deblob "deblob")
281 (chmod "deblob" #o755)
282 (substitute* "deblob"
283 (("/bin/sh") (which "sh")))
285 (copy-file #+deblob-check "deblob-check")
286 (chmod "deblob-check" #o755)
287 (substitute* "deblob-check"
288 (("/bin/sh") (which "sh"))
289 (("/bin/sed") (which "sed"))
290 (("/usr/bin/python") (which "python"))))
292 (if (file-is-directory? #+upstream-source)
294 (format #t "Copying upstream linux source...~%")
295 (invoke "cp" "--archive" #+upstream-source dir)
296 (invoke "chmod" "--recursive" "u+w" dir))
298 (format #t "Unpacking upstream linux tarball...~%")
299 (invoke "tar" "xf" #$upstream-source)
302 (and (not (member name '("." "..")))
303 (file-is-directory? name))))
305 (unless (string=? dir unpacked-dir)
306 (rename-file unpacked-dir dir)))
308 (error "multiple directories found" dirs)))))
310 (with-directory-excursion dir
311 (format #t "Running deblob script...~%")
312 (invoke "/tmp/bin/deblob"))
314 (format #t "~%Packing new Linux-libre tarball...~%")
315 (invoke "tar" "cvfa" #$output
316 ;; Avoid non-determinism in the archive.
324 (format #t "~%Scanning the generated tarball for blobs...~%")
325 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
333 (define (linux-libre-urls version)
334 "Return a list of URLs for Linux-Libre VERSION."
336 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
337 version "-gnu/linux-libre-" version "-gnu.tar.xz")
339 ;; XXX: Work around <http://bugs.gnu.org/14851>.
341 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
342 version "-gnu.tar.xz")
344 ;; Maybe this URL will become valid eventually.
346 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
347 version "-gnu.tar.xz")))
349 (define (%upstream-linux-source version hash)
352 (uri (string-append "mirror://kernel.org"
353 "/linux/kernel/v" (version-major version) ".x/"
354 "linux-" version ".tar.xz"))
357 ;; The current "stable" kernels. That is, the most recently released major
358 ;; versions that are still supported upstream.
359 (define-public linux-libre-5.12-version "5.12.5")
360 (define deblob-scripts-5.12
361 (linux-libre-deblob-scripts
362 linux-libre-5.12-version
363 (base32 "1vdsr9y4gckknrbqcjyfakwva3k0vb5zcivzk3k1s9mh7qp9dils")
364 (base32 "1qp25fd4wgjyk7dzdq9yirm1z5w68sd1p3wv8lch8259i51gwjnf")))
365 (define-public linux-libre-5.12-pristine-source
366 (let ((version linux-libre-5.12-version)
367 (hash (base32 "1x39sdswww4j8zr54wpjzy9dia52kihs11xwljxcnz8pck0vwja0")))
368 (make-linux-libre-source version
369 (%upstream-linux-source version hash)
370 deblob-scripts-5.12)))
372 (define-public linux-libre-5.11-version "5.11.22")
373 (define deblob-scripts-5.11
374 (linux-libre-deblob-scripts
375 linux-libre-5.11-version
376 (base32 "02mn6bd69sr3i3xapg146w7nxln15mffm2zh3qc7k5am92y049h4")
377 (base32 "0yvr80g200hdryz54gdnzj4fl38pf7g4qbgj475rhcfwixhp1j7n")))
378 (define-public linux-libre-5.11-pristine-source
379 (let ((version linux-libre-5.11-version)
380 (hash (base32 "003nlphkqish6l4xblhi369v4qv2zck7529prkdnx4gb2ihpq0hi")))
381 (make-linux-libre-source version
382 (%upstream-linux-source version hash)
383 deblob-scripts-5.11)))
385 ;; The "longterm" kernels — the older releases with long-term upstream support.
386 ;; Here are the support timelines:
387 ;; <https://www.kernel.org/category/releases.html>
388 (define-public linux-libre-5.10-version "5.10.37")
389 (define deblob-scripts-5.10
390 (linux-libre-deblob-scripts
391 linux-libre-5.10-version
392 (base32 "1rmnx1px4sizs2lq831yd2g9dyflg0vmykz3cv9443x2a2vwy81f")
393 (base32 "0hh27ccqimagr3aij7ygwikxw66y63sqwd0xlf49bhpjd090r9a7")))
394 (define-public linux-libre-5.10-pristine-source
395 (let ((version linux-libre-5.10-version)
396 (hash (base32 "0xz01g017s9kcc9awlg6p9wrm8pzxyk4fizrf3mq9i5gklqf7md8")))
397 (make-linux-libre-source version
398 (%upstream-linux-source version hash)
399 deblob-scripts-5.10)))
401 (define-public linux-libre-5.4-version "5.4.119")
402 (define deblob-scripts-5.4
403 (linux-libre-deblob-scripts
404 linux-libre-5.4-version
405 (base32 "12g1wm7xvjvmjanbgg0ahxm4vs2n5bvicfnnnag4h35vl4q3lggg")
406 (base32 "1xghbbnaisjd0k1klbyn1p7r6r4x5a1bpmkm56a3gh2zvw4s7mj8")))
407 (define-public linux-libre-5.4-pristine-source
408 (let ((version linux-libre-5.4-version)
409 (hash (base32 "185jxk0cfnk8c6rfc78id2qwd9k2597xyc4dv2pahjc13v7xxrvi")))
410 (make-linux-libre-source version
411 (%upstream-linux-source version hash)
412 deblob-scripts-5.4)))
414 (define-public linux-libre-4.19-version "4.19.190")
415 (define deblob-scripts-4.19
416 (linux-libre-deblob-scripts
417 linux-libre-4.19-version
418 (base32 "1jfcz4lnm44b3xzrkiipvw35kl0vvdvhr2pg7jfwf02f6qbvay18")
419 (base32 "1jiaw0as1ippkrjdpd52657w5mz9qczg3y2hlra7m9k0xawwiqlf")))
420 (define-public linux-libre-4.19-pristine-source
421 (let ((version linux-libre-4.19-version)
422 (hash (base32 "0pf8py0id0r8wzr5050bik1sbhl8gsznnr5bvcmrs4jkhpp2m73g")))
423 (make-linux-libre-source version
424 (%upstream-linux-source version hash)
425 deblob-scripts-4.19)))
427 (define-public linux-libre-4.14-version "4.14.232")
428 (define deblob-scripts-4.14
429 (linux-libre-deblob-scripts
430 linux-libre-4.14-version
431 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
432 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
433 (define-public linux-libre-4.14-pristine-source
434 (let ((version linux-libre-4.14-version)
435 (hash (base32 "0sa3sz7bznlhijd0iwv37nyrrnw34iq6dq1bqr6cj2wpyrhr7h8x")))
436 (make-linux-libre-source version
437 (%upstream-linux-source version hash)
438 deblob-scripts-4.14)))
440 (define-public linux-libre-4.9-version "4.9.268")
441 (define deblob-scripts-4.9
442 (linux-libre-deblob-scripts
443 linux-libre-4.9-version
444 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
445 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
446 (define-public linux-libre-4.9-pristine-source
447 (let ((version linux-libre-4.9-version)
448 (hash (base32 "0aknrlf5q0dsqib8c9klmf5c60dy7hg2zksb020qvyrp077gcrjv")))
449 (make-linux-libre-source version
450 (%upstream-linux-source version hash)
451 deblob-scripts-4.9)))
453 (define-public linux-libre-4.4-version "4.4.268")
454 (define deblob-scripts-4.4
455 (linux-libre-deblob-scripts
456 linux-libre-4.4-version
457 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
458 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
459 (define-public linux-libre-4.4-pristine-source
460 (let ((version linux-libre-4.4-version)
461 (hash (base32 "1srk08kaxq5jjlqx804cgjffhcsrdkv3idh8ipagl6v2w4kas5v8")))
462 (make-linux-libre-source version
463 (%upstream-linux-source version hash)
464 deblob-scripts-4.4)))
466 (define %boot-logo-patch
467 ;; Linux-Libre boot logo featuring Freedo and a gnu.
470 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
471 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
474 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
476 (define %linux-libre-arm-export-__sync_icache_dcache-patch
480 "https://salsa.debian.org/kernel-team/linux"
481 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
482 "/debian/patches/bugfix/arm/"
483 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
484 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
486 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
488 (define (source-with-patches source patches)
491 (patches (append (origin-patches source)
494 (define-public linux-libre-5.12-source
495 (source-with-patches linux-libre-5.12-pristine-source
496 (list %boot-logo-patch
497 %linux-libre-arm-export-__sync_icache_dcache-patch)))
499 (define-public linux-libre-5.11-source
500 (source-with-patches linux-libre-5.11-pristine-source
501 (list %boot-logo-patch
502 %linux-libre-arm-export-__sync_icache_dcache-patch
503 ;; Pinebook Pro patch to fix LCD display
505 "linux-libre-arm64-generic-pinebook-lcd.patch"))))
507 (define-public linux-libre-5.10-source
508 (source-with-patches linux-libre-5.10-pristine-source
509 (list %boot-logo-patch
510 %linux-libre-arm-export-__sync_icache_dcache-patch
512 "linux-libre-arm64-generic-pinebook-lcd.patch"))))
514 (define-public linux-libre-5.4-source
515 (source-with-patches linux-libre-5.4-pristine-source
516 (list %boot-logo-patch
517 %linux-libre-arm-export-__sync_icache_dcache-patch
518 ;; Pinebook Pro patch from linux-next,
519 ;; can be dropped for linux-libre 5.7
521 "linux-libre-support-for-Pinebook-Pro.patch"))))
523 (define-public linux-libre-4.19-source
524 (source-with-patches linux-libre-4.19-pristine-source
525 (list %boot-logo-patch
526 %linux-libre-arm-export-__sync_icache_dcache-patch)))
528 (define-public linux-libre-4.14-source
529 (source-with-patches linux-libre-4.14-pristine-source
530 (list %boot-logo-patch)))
532 (define-public linux-libre-4.9-source
533 (source-with-patches linux-libre-4.9-pristine-source
534 (list %boot-logo-patch)))
536 (define-public linux-libre-4.4-source
537 (source-with-patches linux-libre-4.4-pristine-source
538 (list %boot-logo-patch)))
545 (define (make-linux-libre-headers version hash-string)
546 (make-linux-libre-headers* version
549 (uri (linux-libre-urls version))
550 (sha256 (base32 hash-string)))))
552 (define (make-linux-libre-headers* version source)
554 (name "linux-libre-headers")
557 (build-system gnu-build-system)
558 (native-inputs `(("perl" ,perl)
559 ,@(if (version>=? version "4.16")
563 ,@(if (version>=? version "5.3")
567 `(#:modules ((guix build gnu-build-system)
571 (modify-phases %standard-phases
575 (let ((arch ,(system->linux-architecture
576 (or (%current-target-system)
578 (defconfig ,(system->defconfig
579 (or (%current-target-system)
580 (%current-system)))))
582 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
583 (invoke "make" defconfig)
584 (invoke "make" "mrproper" "headers_check"))))
586 (lambda* (#:key outputs #:allow-other-keys)
587 (let ((out (assoc-ref outputs "out")))
589 (string-append "INSTALL_HDR_PATH=" out)
592 (mkdir (string-append out "/include/config"))
593 (call-with-output-file
595 "/include/config/kernel.release")
597 (format p "~a-default~%" ,version)))
599 ;; Remove the '.install' and '..install.cmd' files; the
600 ;; latter contains store paths, which pulls in bootstrap
601 ;; binaries in the build environment, and prevents bit
602 ;; reproducibility for the bootstrap binaries.
603 (for-each delete-file (find-files out "\\.install"))
606 #:allowed-references ()
608 (home-page "https://www.gnu.org/software/linux-libre/")
609 (synopsis "GNU Linux-Libre kernel headers")
610 (description "Headers of the Linux-Libre kernel.")
611 (license license:gpl2)))
613 (define-public linux-libre-headers-5.12
614 (make-linux-libre-headers* linux-libre-5.12-version
615 linux-libre-5.12-source))
617 (define-public linux-libre-headers-5.11
618 (make-linux-libre-headers* linux-libre-5.11-version
619 linux-libre-5.11-source))
621 (define-public linux-libre-headers-5.10
622 (make-linux-libre-headers* linux-libre-5.10-version
623 linux-libre-5.10-source))
625 (define-public linux-libre-headers-5.4
626 (make-linux-libre-headers* linux-libre-5.4-version
627 linux-libre-5.4-source))
629 (define-public linux-libre-headers-4.19
630 (make-linux-libre-headers* linux-libre-4.19-version
631 linux-libre-4.19-source))
633 (define-public linux-libre-headers-4.14
634 (make-linux-libre-headers* linux-libre-4.14-version
635 linux-libre-4.14-source))
637 (define-public linux-libre-headers-4.9
638 (make-linux-libre-headers* linux-libre-4.9-version
639 linux-libre-4.9-source))
641 (define-public linux-libre-headers-4.4
642 (make-linux-libre-headers* linux-libre-4.4-version
643 linux-libre-4.4-source))
645 ;; The following package is used in the early bootstrap, and thus must be kept
646 ;; stable and with minimal build requirements.
647 (define-public linux-libre-headers-5.4.20
648 (make-linux-libre-headers "5.4.20"
649 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
651 (define-public linux-libre-headers linux-libre-headers-5.4.20)
655 ;;; Kernel configurations.
658 (define* (kernel-config arch #:key variant)
659 "Return the absolute file name of the Linux-Libre build configuration file
660 for ARCH and optionally VARIANT, or #f if there is no such configuration."
661 (let* ((name (string-append (if variant (string-append variant "-") "")
662 (if (string=? "i386" arch) "i686" arch) ".conf"))
663 (file (string-append "linux-libre/" name)))
664 (search-auxiliary-file file)))
666 (define %default-extra-linux-options
667 `(;; Some very mild hardening.
668 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
669 ;; All kernels should have NAMESPACES options enabled
670 ("CONFIG_NAMESPACES" . #t)
671 ("CONFIG_UTS_NS" . #t)
672 ("CONFIG_IPC_NS" . #t)
673 ("CONFIG_USER_NS" . #t)
674 ("CONFIG_PID_NS" . #t)
675 ("CONFIG_NET_NS" . #t)
676 ;; Various options needed for elogind service:
677 ;; https://issues.guix.gnu.org/43078
678 ("CONFIG_CGROUP_FREEZER" . #t)
679 ("CONFIG_BLK_CGROUP" . #t)
680 ("CONFIG_CGROUP_WRITEBACK" . #t)
681 ("CONFIG_CGROUP_SCHED" . #t)
682 ("CONFIG_CGROUP_PIDS" . #t)
683 ("CONFIG_CGROUP_FREEZER" . #t)
684 ("CONFIG_CGROUP_DEVICE" . #t)
685 ("CONFIG_CGROUP_CPUACCT" . #t)
686 ("CONFIG_CGROUP_PERF" . #t)
687 ("CONFIG_SOCK_CGROUP_DATA" . #t)
688 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
689 ("CONFIG_CGROUP_NET_PRIO" . #t)
690 ("CONFIG_CGROUP_NET_CLASSID" . #t)
691 ("CONFIG_MEMCG" . #t)
692 ("CONFIG_MEMCG_SWAP" . #t)
693 ("CONFIG_MEMCG_KMEM" . #t)
694 ("CONFIG_CPUSETS" . #t)
695 ("CONFIG_PROC_PID_CPUSET" . #t)
696 ;; Allow disk encryption by default
697 ("CONFIG_DM_CRYPT" . m)
698 ;; Modules required for initrd:
699 ("CONFIG_NET_9P" . m)
700 ("CONFIG_NET_9P_VIRTIO" . m)
701 ("CONFIG_VIRTIO_BLK" . m)
702 ("CONFIG_VIRTIO_NET" . m)
703 ("CONFIG_VIRTIO_PCI" . m)
704 ("CONFIG_VIRTIO_BALLOON" . m)
705 ("CONFIG_VIRTIO_MMIO" . m)
706 ("CONFIG_FUSE_FS" . m)
708 ("CONFIG_9P_FS" . m)))
710 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
711 (define %bpf-extra-linux-options
712 `(;; Needed for probes
713 ("CONFIG_UPROBE_EVENTS" . #t)
714 ("CONFIG_KPROBE_EVENTS" . #t)
715 ;; kheaders module also helpful for tracing
716 ("CONFIG_IKHEADERS" . #t)
718 ("CONFIG_BPF_SYSCALL" . #t)
719 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
720 ;; optional, for tc filters
721 ("CONFIG_NET_CLS_BPF" . m)
722 ;; optional, for tc actions
723 ("CONFIG_NET_ACT_BPF" . m)
724 ("CONFIG_BPF_JIT" . #t)
725 ;; for Linux kernel versions 4.1 through 4.6
726 ;; ("CONFIG_HAVE_BPF_JIT" . y)
727 ;; for Linux kernel versions 4.7 and later
728 ("CONFIG_HAVE_EBPF_JIT" . #t)
729 ;; optional, for kprobes
730 ("CONFIG_BPF_EVENTS" . #t)
732 ("CONFIG_IKHEADERS" . #t)))
734 (define (config->string options)
735 (string-join (map (match-lambda
737 (string-append option "=m"))
739 (string-append option "=y"))
741 (string-append option "=n")))
747 ;;; Kernel package utilities.
750 (define* (make-linux-libre version hash-string supported-systems
752 ;; A function that takes an arch and a variant.
753 ;; See kernel-config for an example.
755 (configuration-file #f)
756 (defconfig "defconfig")
757 (extra-options %default-extra-linux-options)
758 (patches (list %boot-logo-patch)))
759 (make-linux-libre* version
762 (uri (linux-libre-urls version))
763 (sha256 (base32 hash-string))
766 #:extra-version extra-version
767 #:configuration-file configuration-file
768 #:defconfig defconfig
769 #:extra-options extra-options))
771 (define* (make-linux-libre* version source supported-systems
773 ;; A function that takes an arch and a variant.
774 ;; See kernel-config for an example.
776 (configuration-file #f)
777 (defconfig "defconfig")
778 (extra-options %default-extra-linux-options))
780 (name (if extra-version
781 (string-append "linux-libre-" extra-version)
785 (supported-systems supported-systems)
786 (build-system gnu-build-system)
791 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
795 ;; These are needed to compile the GCC plugins.
800 ,@(match (and configuration-file
802 (system->linux-architecture
803 (or (%current-target-system) (%current-system)))
804 #:variant (version-major+minor version)))
805 (#f ;no config for this platform
808 `(("kconfig" ,config))))))
810 `(#:modules ((guix build gnu-build-system)
817 (modify-phases %standard-phases
818 (add-after 'unpack 'patch-/bin/pwd
820 (substitute* (find-files "." "^Makefile(\\.include)?$")
821 (("/bin/pwd") "pwd"))
824 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
825 ;; Avoid introducing timestamps
826 (setenv "KCONFIG_NOTIMESTAMP" "1")
827 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
829 ;; Set ARCH and CROSS_COMPILE
830 (let ((arch ,(system->linux-architecture
831 (or (%current-target-system)
832 (%current-system)))))
834 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
837 (setenv "CROSS_COMPILE" (string-append target "-"))
838 (format #t "`CROSS_COMPILE' set to `~a'~%"
839 (getenv "CROSS_COMPILE"))))
841 (setenv "EXTRA_VERSION" ,extra-version)
843 (let ((build (assoc-ref %standard-phases 'build))
844 (config (assoc-ref (or native-inputs inputs) "kconfig")))
846 ;; Use a custom kernel configuration file or a default
847 ;; configuration file.
850 (copy-file config ".config")
851 (chmod ".config" #o666))
852 (invoke "make" ,defconfig))
854 ;; Appending works even when the option wasn't in the
855 ;; file. The last one prevails if duplicated.
856 (let ((port (open-file ".config" "a"))
857 (extra-configuration ,(config->string extra-options)))
858 (display extra-configuration port)
861 (invoke "make" "oldconfig"))))
863 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
864 (let* ((out (assoc-ref outputs "out"))
865 (moddir (string-append out "/lib/modules"))
866 (dtbdir (string-append out "/lib/dtbs")))
867 ;; Install kernel image, kernel configuration and link map.
868 (for-each (lambda (file) (install-file file out))
869 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
870 ;; Install device tree files
871 (unless (null? (find-files "." "\\.dtb$"))
873 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
875 ;; Install kernel modules
878 ;; Disable depmod because the Guix system's module directory
879 ;; is an union of potentially multiple packages. It is not
880 ;; possible to use depmod to usefully calculate a dependency
881 ;; graph while building only one of those packages.
883 (string-append "MODULE_DIR=" moddir)
884 (string-append "INSTALL_PATH=" out)
885 (string-append "INSTALL_MOD_PATH=" out)
886 "INSTALL_MOD_STRIP=1"
888 (let* ((versions (filter (lambda (name)
889 (not (string-prefix? "." name)))
891 (version (match versions
893 ;; There are symlinks to the build and source directory,
894 ;; both of which will point to target /tmp/guix-build*
895 ;; and thus not be useful in a profile. Delete the symlinks.
896 (false-if-file-not-found
897 (delete-file (string-append moddir "/" version "/build")))
898 (false-if-file-not-found
899 (delete-file (string-append moddir "/" version "/source"))))
902 (home-page "https://www.gnu.org/software/linux-libre/")
903 (synopsis "100% free redistribution of a cleaned Linux kernel")
905 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
906 It has been modified to remove all non-free binary blobs.")
907 (license license:gpl2)
908 (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.
912 ;;; Generic kernel packages.
915 (define-public linux-libre-5.12
916 (make-linux-libre* linux-libre-5.12-version
917 linux-libre-5.12-source
918 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
919 #:configuration-file kernel-config))
921 (define-public linux-libre-5.11
922 (make-linux-libre* linux-libre-5.11-version
923 linux-libre-5.11-source
924 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
925 #:configuration-file kernel-config))
927 (define-public linux-libre-version linux-libre-5.11-version)
928 (define-public linux-libre-pristine-source linux-libre-5.11-pristine-source)
929 (define-public linux-libre-source linux-libre-5.11-source)
930 (define-public linux-libre linux-libre-5.11)
932 (define-public linux-libre-5.10
933 (make-linux-libre* linux-libre-5.10-version
934 linux-libre-5.10-source
935 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
936 #:configuration-file kernel-config))
938 (define-public linux-libre-5.4
939 (make-linux-libre* linux-libre-5.4-version
940 linux-libre-5.4-source
941 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
942 #:configuration-file kernel-config))
944 (define-public linux-libre-4.19
945 (make-linux-libre* linux-libre-4.19-version
946 linux-libre-4.19-source
947 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
948 #:configuration-file kernel-config))
950 (define-public linux-libre-4.14
951 (make-linux-libre* linux-libre-4.14-version
952 linux-libre-4.14-source
953 '("x86_64-linux" "i686-linux" "armhf-linux")
954 #:configuration-file kernel-config))
956 (define-public linux-libre-4.9
957 (make-linux-libre* linux-libre-4.9-version
958 linux-libre-4.9-source
959 '("x86_64-linux" "i686-linux")
960 #:configuration-file kernel-config))
962 (define-public linux-libre-4.4
963 (make-linux-libre* linux-libre-4.4-version
964 linux-libre-4.4-source
965 '("x86_64-linux" "i686-linux")
966 #:configuration-file kernel-config
969 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
970 ;; This option was removed upstream in version 4.7.
971 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
972 %default-extra-linux-options)))
974 ;; Linux-Libre-LTS points to the *newest* released long-term support version of
976 ;; Reference: https://jxself.org/linux-libre/
978 (define-public linux-libre-lts-version linux-libre-5.10-version)
979 (define-public linux-libre-lts-pristine-source linux-libre-5.10-pristine-source)
980 (define-public linux-libre-lts-source linux-libre-5.10-source)
981 (define-public linux-libre-lts linux-libre-5.10)
985 ;;; Specialized kernel variants.
988 (define-public linux-libre-arm-generic
989 (make-linux-libre* linux-libre-version
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-veyron
1001 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
1003 (define-public linux-libre-arm-generic-5.10
1004 (make-linux-libre* linux-libre-5.10-version
1005 linux-libre-5.10-source
1007 #:defconfig "multi_v7_defconfig"
1008 #:extra-version "arm-generic"
1011 `(;; needed to fix the RTC on rockchip platforms
1012 ("CONFIG_RTC_DRV_RK808" . #t))
1013 %default-extra-linux-options)))
1015 (define-public linux-libre-arm-generic-5.4
1016 (make-linux-libre* linux-libre-5.4-version
1017 linux-libre-5.4-source
1019 #:defconfig "multi_v7_defconfig"
1020 #:extra-version "arm-generic"
1023 `(;; needed to fix the RTC on rockchip platforms
1024 ("CONFIG_RTC_DRV_RK808" . #t))
1025 %default-extra-linux-options)))
1027 (define-public linux-libre-arm-generic-4.19
1028 (make-linux-libre* linux-libre-4.19-version
1029 linux-libre-4.19-source
1031 #:defconfig "multi_v7_defconfig"
1032 #:extra-version "arm-generic"))
1034 (define-public linux-libre-arm-generic-4.14
1035 (make-linux-libre* linux-libre-4.14-version
1036 linux-libre-4.14-source
1038 #:defconfig "multi_v7_defconfig"
1039 #:extra-version "arm-generic"))
1041 (define-public linux-libre-arm-omap2plus
1042 (make-linux-libre* linux-libre-version
1045 #:defconfig "omap2plus_defconfig"
1046 #:extra-version "arm-omap2plus"))
1048 (define-public linux-libre-arm-omap2plus-4.19
1049 (make-linux-libre* linux-libre-4.19-version
1050 linux-libre-4.19-source
1052 #:defconfig "omap2plus_defconfig"
1053 #:extra-version "arm-omap2plus"))
1055 (define-public linux-libre-arm-omap2plus-4.14
1056 (make-linux-libre* linux-libre-4.14-version
1057 linux-libre-4.14-source
1059 #:defconfig "omap2plus_defconfig"
1060 #:extra-version "arm-omap2plus"))
1062 (define-public linux-libre-arm64-generic
1063 (make-linux-libre* linux-libre-version
1066 #:defconfig "defconfig"
1067 #:extra-version "arm64-generic"
1070 `(;; needed to fix the RTC on rockchip platforms
1071 ("CONFIG_RTC_DRV_RK808" . #t)
1072 ;; Pinebook display, battery, charger and usb
1073 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1074 ("CONFIG_CHARGER_AXP20X" . m)
1075 ("CONFIG_INPUT_AXP20X_PEK" . m)
1076 ("CONFIG_CHARGER_AXP20X" . m)
1077 ("CONFIG_BATTERY_AXP20X" . m)
1078 ("CONFIG_PINCTRL_AXP209" . m)
1079 ("CONFIG_AXP20X_POWER" . m)
1080 ("CONFIG_AXP20X_ADC" . m)
1081 ;; Pinebook PRO battery and sound support
1082 ("CONFIG_BATTERY_CW2015" . m)
1083 ("CONFIG_CHARGER_GPIO" . m)
1084 ("CONFIG_SND_SOC_ES8316" . m))
1085 %default-extra-linux-options)))
1087 (define-public linux-libre-arm64-generic-5.10
1088 (make-linux-libre* linux-libre-5.10-version
1089 linux-libre-5.10-source
1091 #:defconfig "defconfig"
1092 #:extra-version "arm64-generic"
1095 `(;; needed to fix the RTC on rockchip platforms
1096 ("CONFIG_RTC_DRV_RK808" . #t)
1097 ;; Pinebook display, battery, charger and usb
1098 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1099 ("CONFIG_CHARGER_AXP20X" . m)
1100 ("CONFIG_INPUT_AXP20X_PEK" . m)
1101 ("CONFIG_CHARGER_AXP20X" . m)
1102 ("CONFIG_BATTERY_AXP20X" . m)
1103 ("CONFIG_PINCTRL_AXP209" . m)
1104 ("CONFIG_AXP20X_POWER" . m)
1105 ("CONFIG_AXP20X_ADC" . m)
1106 ;; Pinebook PRO battery and sound support
1107 ("CONFIG_BATTERY_CW2015" . m)
1108 ("CONFIG_CHARGER_GPIO" . m)
1109 ("CONFIG_SND_SOC_ES8316" . m))
1110 %default-extra-linux-options)))
1112 (define-public linux-libre-arm64-generic-5.4
1113 (make-linux-libre* linux-libre-5.4-version
1114 linux-libre-5.4-source
1116 #:defconfig "defconfig"
1117 #:extra-version "arm64-generic"
1120 `(;; needed to fix the RTC on rockchip platforms
1121 ("CONFIG_RTC_DRV_RK808" . #t))
1122 %default-extra-linux-options)))
1124 (define-public linux-libre-riscv64-generic
1125 (make-linux-libre* linux-libre-version
1128 #:extra-version "riscv64-generic"))
1130 (define-public linux-libre-mips64el-fuloong2e
1131 (make-linux-libre* linux-libre-version
1134 #:defconfig "fuloong2e_defconfig"
1135 #:extra-version "mips64el-fuloong2e"
1138 `(("CONFIG_OVERLAY_FS" . m))
1139 %default-extra-linux-options)))
1141 (define-public linux-libre-with-bpf
1142 (let ((base-linux-libre
1144 linux-libre-5.11-version
1145 linux-libre-5.11-source
1146 '("x86_64-linux" "i686-linux" "armhf-linux"
1147 "aarch64-linux" "riscv64-linux")
1148 #:extra-version "bpf"
1149 #:configuration-file kernel-config
1151 (append %bpf-extra-linux-options
1152 %default-extra-linux-options))))
1154 (inherit base-linux-libre)
1155 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
1160 ;;; Linux kernel modules.
1163 (define-public acpi-call-linux-module
1165 (name "acpi-call-linux-module")
1171 (url "https://github.com/nix-community/acpi_call")
1172 (commit (string-append "v" version))))
1173 (file-name (git-file-name name version))
1175 (base32 "0mr4rjbv6fj4phf038addrgv32940bphghw2v9n1z4awvw7wzkbg"))))
1176 (build-system linux-module-build-system)
1178 `(#:tests? #f ; no tests
1180 (modify-phases %standard-phases
1181 (add-before 'install 'patch-shebangs-harder
1182 ;; The (only) shebangs in examples/ don't justify a reference.
1183 ;; However, do substitute a more portable one than the original.
1185 (substitute* (find-files "examples" ".")
1186 (("^(#! *)/[^ ]*/" _ shebang)
1187 (string-append shebang "/usr/bin/env ")))
1189 (add-after 'install 'install-documentation
1190 (lambda* (#:key outputs #:allow-other-keys)
1191 (let* ((out (assoc-ref outputs "out"))
1192 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1193 (for-each (lambda (file)
1194 (let ((target (string-append doc "/" file)))
1195 (mkdir-p (dirname target))
1196 (copy-recursively file target)))
1197 (list "README.md" "examples"))
1199 (home-page "https://github.com/teleshoes/acpi_call")
1200 (synopsis "Linux kernel module to perform ACPI method calls")
1202 "This simple Linux kernel module allows calls from user space to any
1203 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1204 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1205 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1206 and @code{ACPI_BUFFER}.
1208 It grants direct and undocumented access to your hardware that may cause damage
1209 and should be used with caution, especially on untested models.")
1210 (license license:gpl3+))) ; see README.md (no licence headers)
1212 (define-public rtl8812au-aircrack-ng-linux-module
1213 (let ((commit "059e06a51be025fde5b2bec6565540b3d9981b0b")
1216 (name "rtl8812au-aircrack-ng-linux-module")
1217 (version (git-version "5.6.4.2" revision commit))
1222 (url "https://github.com/aircrack-ng/rtl8812au")
1224 (file-name (git-file-name name version))
1226 (base32 "0h6l2r3yj7j9zf11dw0zcdyn50ajnjw8yvv86dzlfj80dn75n98f"))
1227 (modules '((guix build utils)))
1230 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1231 ;; and other unnecessary unlicenced things.
1232 (for-each delete-file-recursively (list "android"
1236 (build-system linux-module-build-system)
1239 (list (string-append "KSRC="
1240 (assoc-ref %build-inputs "linux-module-builder")
1241 "/lib/modules/build"))
1243 (modify-phases %standard-phases
1245 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1246 (apply invoke "make" make-flags))))
1247 #:tests? #f)) ; no test suite
1248 (supported-systems '("x86_64-linux" "i686-linux"))
1249 (home-page "https://github.com/aircrack-ng/rtl8812au")
1250 (synopsis "Linux driver for Realtek USB wireless network adapters")
1252 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1253 network adapters, modified by the aircrack-ng project to support monitor mode
1254 and frame injection. It provides a @code{88XXau} kernel module that supports
1255 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1256 (license license:gpl2+))))
1258 (define-public rtl8821ce-linux-module
1259 (let ((commit "14b536f0c9ad2d0abbdab8afc7ade684900ca9cf")
1262 (name "rtl8821ce-linux-module")
1263 (version (git-version "0.0.0" revision commit))
1268 (url "https://github.com/tomaspinho/rtl8821ce")
1270 (file-name (git-file-name name version))
1273 "0z7r7spsgn22gwv9pcmkdjn9ingi8jj7xkxasph8118h46fw8ip2"))))
1274 (build-system linux-module-build-system)
1278 (string-append "KSRC="
1279 (assoc-ref %build-inputs "linux-module-builder")
1280 "/lib/modules/build"))
1282 (modify-phases %standard-phases
1284 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1285 (apply invoke "make" make-flags))))
1286 #:tests? #f)) ; no test suite
1287 (home-page "https://github.com/tomaspinho/rtl8821ce")
1288 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1289 (description "This is Realtek's RTL8821CE Linux driver for wireless
1291 (license license:gpl2))))
1293 (define-public vhba-module
1295 (name "vhba-module")
1296 (version "20200106")
1300 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1301 version ".tar.bz2"))
1304 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1305 (build-system linux-module-build-system)
1309 (home-page "https://cdemu.sourceforge.io/")
1310 (synopsis "Kernel module that emulates SCSI devices")
1311 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1312 between the CDemu userspace daemon and linux kernel.")
1313 (license license:gpl2+)))
1315 (define-public bbswitch-module
1316 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
1317 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
1318 (let ((commit "ddbd243638c7bc2baecf43a78aff46cdc12e9b2e"))
1320 (name "bbswitch-module")
1321 (version (git-version "0.8" "1" commit))
1325 (url "https://github.com/Bumblebee-Project/bbswitch")
1327 (file-name (git-file-name name version))
1330 "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb"))))
1331 (build-system linux-module-build-system)
1335 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1336 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1337 (description "The bbswitch module provides a way to toggle the Nvidia
1338 graphics card on Optimus laptops.")
1339 (license license:gpl2))))
1341 (define-public ddcci-driver-linux
1343 (name "ddcci-driver-linux")
1350 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1351 (commit (string-append "v" version))))
1352 (file-name (git-file-name name version))
1355 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1356 (build-system linux-module-build-system)
1358 `(#:tests? #f ; no tests
1360 (modify-phases %standard-phases
1365 (with-directory-excursion module
1366 (apply (assoc-ref %standard-phases 'build) args)))
1367 '("ddcci" "ddcci-backlight"))
1373 (with-directory-excursion module
1374 (apply (assoc-ref %standard-phases 'install) args)))
1375 '("ddcci" "ddcci-backlight"))
1377 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1378 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1379 (description "This package provides two Linux kernel drivers, ddcci and
1380 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1381 interface. The ddcci module creates a character device for each DDC/CI
1382 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1383 module allows the control of the backlight level or luminance property when
1384 supported under @file{/sys/class/backlight/}.")
1385 (license license:gpl2+)))
1387 (define-public v4l2loopback-linux-module
1389 (name "v4l2loopback-linux-module")
1394 (url "https://github.com/umlaeute/v4l2loopback")
1395 (commit (string-append "v" version))))
1396 (file-name (git-file-name name version))
1399 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1400 (build-system linux-module-build-system)
1402 `(#:tests? #f)) ; no test suite
1403 (home-page "https://github.com/umlaeute/v4l2loopback")
1404 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1406 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1407 for Linux 2} applications will treat these as ordinary video devices but read
1408 video data generated by another application, instead of a hardware device such
1411 This lets you apply nifty effects to your Jitsi video, for example, but also
1412 allows some more serious things like adding streaming capabilities to an
1413 application by hooking GStreamer into the loopback device.")
1414 (license license:gpl2+)))
1418 ;;; Pluggable authentication modules (PAM).
1421 (define-public linux-pam
1429 "https://github.com/linux-pam/linux-pam/releases/download/v"
1430 version "/Linux-PAM-" version ".tar.xz"))
1433 "1z4jayf69qyyxln1gl6ch4qxfd66ib1g42garnrv2d8i1drl0790"))
1434 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1436 (build-system gnu-build-system)
1440 ;; TODO: optional dependencies
1441 ;; ("libxcrypt" ,libxcrypt)
1442 ;; ("cracklib" ,cracklib)
1445 `(;; Most users, such as `shadow', expect the headers to be under
1447 #:configure-flags (list (string-append "--includedir="
1448 (assoc-ref %outputs "out")
1449 "/include/security")
1451 ;; XXX: <rpc/rpc.h> is missing from glibc when
1452 ;; cross-compiling, so we have to disable NIS
1453 ;; support altogether.
1454 ,@(if (%current-target-system)
1458 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1461 (home-page "http://www.linux-pam.org/")
1462 (synopsis "Pluggable authentication modules for Linux")
1464 "A *Free* project to implement OSF's RFC 86.0.
1465 Pluggable authentication modules are small shared object files that can
1466 be used through the PAM API to perform tasks, like authenticating a user
1467 at login. Local and dynamic reconfiguration are its key features.")
1468 (license license:bsd-3)))
1470 (define-public linux-pam-1.2
1478 "http://www.linux-pam.org/library/"
1479 "Linux-PAM-" version ".tar.bz2"))
1482 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1483 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1485 (define-public python-pamela
1487 (name "python-pamela")
1491 ;; Tests not distributed in pypi release.
1494 (url "https://github.com/minrk/pamela")
1496 (file-name (git-file-name name version))
1499 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
1500 (build-system python-build-system)
1502 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
1504 (modify-phases %standard-phases
1505 (add-after 'unpack 'hardcode-pam.so
1506 (lambda* (#:key inputs #:allow-other-keys)
1507 (let ((pam (assoc-ref inputs "linux-pam")))
1508 (substitute* "pamela.py"
1509 (("find_library\\(\"pam\")")
1510 (string-append "'" pam "/lib/libpam.so'")))
1513 (lambda* (#:key tests? #:allow-other-keys)
1515 (if (file-exists? "test_pamela.py")
1516 (invoke "py.test" "--assert=plain" "test_pamela.py")
1517 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
1520 `(("linux-pam" ,linux-pam)))
1522 `(("python-pytest" ,python-pytest)))
1523 (home-page "https://github.com/minrk/pamela")
1524 (synopsis "PAM interface using ctypes")
1525 (description "This package provides a PAM interface using @code{ctypes}.")
1526 (license license:expat)))
1533 (define-public powerstat
1540 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1541 "powerstat/powerstat-" version ".tar.gz"))
1543 (base32 "0dmixbxm4qd08ds26i0wvxwyy8nrjzfjj2q9ylx35564g4wh58qb"))))
1544 (build-system gnu-build-system)
1547 (list (string-append "CC=" ,(cc-for-target))
1548 (string-append "prefix=" (assoc-ref %outputs "out")))
1549 #:tests? #f ; no test suite
1551 (modify-phases %standard-phases
1552 (add-after 'unpack 'respect-$prefix
1553 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1555 (substitute* "Makefile"
1556 (("DIR=/usr/") "DIR=$(prefix)/"))
1558 (delete 'configure)))) ; no configure script
1559 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1560 (synopsis "Measure system power consumption")
1562 "Powerstat measures and reports your computer's power consumption in real
1563 time. On mobile PCs, it uses ACPI battery information to measure the power
1564 drain of the entire system.
1566 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1567 domain measurements. These are available only on some hardware such as Intel
1568 Sandybridge and newer, and cover only part of the machine's components such as
1569 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1570 and don't require a battery at all.
1572 The output is like @command{vmstat} but also shows power consumption statistics:
1573 at the end of a run, @command{powerstat} will calculate the average, standard
1574 deviation, and minimum and maximum values. It can show a nice histogram too.")
1575 (license license:gpl2)))
1577 (define-public psmisc
1584 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1587 (base32 "0y8n1jd2dn4cvc5mh806d66qnq8xl0xmzczbycjwal10rvmcw33z"))))
1588 (build-system gnu-build-system)
1590 `(,@(if (%current-target-system)
1593 "ac_cv_func_malloc_0_nonnull=yes"
1594 "ac_cv_func_realloc_0_nonnull=yes"))
1596 (inputs `(("ncurses" ,ncurses)))
1597 (home-page "https://gitlab.com/psmisc/psmisc")
1598 (synopsis "Small utilities that use the proc file system")
1600 "This PSmisc package is a set of some small useful utilities that
1601 use the proc file system. We're not about changing the world, but
1602 providing the system administrator with some help in common tasks.")
1603 (license license:gpl2+)))
1605 (define-public util-linux
1611 (uri (string-append "mirror://kernel.org/linux/utils/"
1612 "util-linux/v" (version-major+minor version) "/"
1613 "util-linux-" version ".tar.xz"))
1616 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1617 (patches (search-patches "util-linux-tests.patch"))
1618 (modules '((guix build utils)))
1620 ;; We take 'nologin' from Shadow, the 'logger' program from
1621 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1623 (substitute* "configure"
1624 (("build_nologin=yes") "build_nologin=no")
1625 (("build_logger=yes") "build_logger=no")
1626 (("build_kill=yes") "build_kill=no"))
1628 (build-system gnu-build-system)
1629 (outputs '("out" ;6.4 MiB executables and documentation
1630 "lib" ;8.8 MiB shared libraries, headers and locales
1631 "static")) ;2.9 MiB static .a libraries
1633 `(#:configure-flags (list "--disable-use-tty-group"
1634 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1635 ;; Don't try to chown root:root mount and umount
1636 "--disable-makeinstall-chown"
1637 "--localstatedir=/var"
1638 (string-append "--localedir="
1639 (assoc-ref %outputs "lib")
1641 ;; Install completions where our
1642 ;; bash-completion package expects them.
1643 (string-append "--with-bashcompletiondir="
1644 (assoc-ref %outputs "out")
1645 "/etc/bash_completion.d"))
1647 ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
1648 ;; <https://bugs.gnu.org/47791>.
1649 #:tests? ,(and (not (%current-target-system))
1650 (not (string-suffix? "-gnu" (%current-system))))
1652 #:phases (modify-phases %standard-phases
1653 (add-before 'configure 'patch-build-scripts
1654 (lambda* (#:key outputs #:allow-other-keys)
1655 (substitute* "configure"
1656 ;; The build system assumes that we want to install
1657 ;; libraries below $exec_prefix when $libdir does not
1658 ;; match any of the "usual" locations. Fix that.
1659 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1660 "usrlib_execdir=$libdir"))
1662 (add-before 'build 'set-umount-file-name
1663 (lambda* (#:key outputs #:allow-other-keys)
1664 ;; Tell 'eject' the right file name of 'umount'.
1665 (let ((out (assoc-ref outputs "out")))
1666 (substitute* "sys-utils/eject.c"
1667 (("\"/bin/umount\"")
1668 (string-append "\"" out "/bin/umount\"")))
1670 (add-before 'check 'pre-check
1671 (lambda* (#:key inputs outputs #:allow-other-keys)
1672 (let ((out (assoc-ref outputs "out"))
1673 (net (assoc-ref inputs "net-base")))
1674 ;; Change the test to refer to the right file.
1675 (substitute* "tests/ts/misc/mcookie"
1677 (string-append net "/etc/services")))
1679 ;; The C.UTF-8 locale does not exist in our libc.
1680 (substitute* "tests/ts/column/invalid-multibyte"
1681 (("C\\.UTF-8") "en_US.utf8"))
1683 ;; TODO: Remove the conditional on the next rebuild cycle.
1684 ,@(if (string-prefix? "arm" (%current-system))
1685 '((add-before 'check 'disable-setarch-test
1687 ;; The setarch tests are unreliable in QEMU's
1688 ;; user-mode emulation, which is our primary
1689 ;; method of building ARMv7 packages.
1690 ;; <https://github.com/karelzak/util-linux/issues/601>
1691 (substitute* "tests/ts/misc/setarch"
1692 (("ts_init_subtest.*" all)
1695 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1698 (add-after 'install 'move-static-libraries
1699 (lambda* (#:key outputs #:allow-other-keys)
1700 (let ((lib (assoc-ref outputs "lib"))
1701 (static (assoc-ref outputs "static")))
1703 ;; Move static libraries to the "static" output.
1704 (mkdir-p (string-append static "/lib"))
1705 (with-directory-excursion lib
1706 (for-each (lambda (file)
1708 (string-append static "/"
1710 (find-files "lib" "\\.a$"))
1712 ;; Remove references to the static library from the '.la'
1713 ;; files so that Libtool does the right thing when both
1714 ;; the shared and static library is available.
1715 (substitute* (find-files "lib" "\\.la$")
1716 (("old_library=.*") "old_library=''\n")))
1719 (add-after 'install 'adjust-pkg-config-files
1720 (lambda* (#:key outputs #:allow-other-keys)
1721 (let ((lib (assoc-ref outputs "lib")))
1722 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1723 ;; the pkg-config files to avoid a cyclic reference on "out".
1724 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1726 (("^(exec_)?prefix=.*") "")))
1728 (inputs `(("zlib" ,zlib)
1729 ("ncurses" ,ncurses)
1731 ;; XXX: This is so that the 'pre-check' phase can find it.
1732 ,@(if (%current-target-system)
1733 `(("net-base" ,net-base))
1737 ("net-base" ,net-base))) ;for tests
1738 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1739 (synopsis "Collection of utilities for the Linux kernel")
1740 (description "Util-linux is a diverse collection of Linux kernel
1741 utilities. It provides dmesg and includes tools for working with file systems,
1742 block devices, UUIDs, TTYs, and many other tools.")
1744 ;; Note that util-linux doesn't use the same license for all the
1745 ;; code. GPLv2+ is the default license for a code without an
1746 ;; explicitly defined license.
1747 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1748 license:bsd-4 license:public-domain))))
1750 ;; util-linux optionally supports udev, which allows lsblk to read file system
1751 ;; metadata without special privileges. Add it as a separate package to avoid
1752 ;; a circular dependency, and to keep the size small.
1753 (define-public util-linux+udev
1756 (name "util-linux-with-udev")
1759 ,@(package-inputs util-linux)))))
1761 (define-public ddate
1768 (url "https://github.com/bo0ts/ddate")
1769 (commit (string-append "v" version))))
1770 (file-name (git-file-name name version))
1772 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1773 (build-system cmake-build-system)
1774 (arguments '(#:tests? #f))
1775 (home-page "https://github.com/bo0ts/ddate")
1776 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1778 "ddate displays the Discordian date and holidays of a given date.
1779 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1780 by Robert Shea and Robert Anton Wilson.")
1781 (license license:public-domain)))
1783 (define-public fbset
1790 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1793 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1794 (build-system gnu-build-system)
1796 '(#:modules ((guix build gnu-build-system)
1800 (modify-phases %standard-phases
1801 (delete 'configure) ; no configure script
1802 (add-before 'install 'pre-install
1803 (lambda* (#:key outputs #:allow-other-keys)
1804 (let ((out (assoc-ref outputs "out")))
1805 (substitute* "Makefile"
1806 (("mknod ") "true ")
1807 ;; The Makefile doesn't honour PREFIX or similar.
1810 (with-directory-excursion out
1811 (for-each mkdir-p (list "sbin"
1815 (add-after 'install 'install-fb.modes
1816 (lambda* (#:key outputs #:allow-other-keys)
1817 (let* ((out (assoc-ref outputs "out"))
1818 (etc (string-append out "/etc")))
1819 (for-each (cut install-file <> etc)
1820 (find-files "etc" "^fb\\.modes"))
1821 (symlink "fb.modes.ATI"
1822 (string-append etc "/fb.modes"))
1824 ;; Parallel building races to create modes.tab.c.
1825 #:parallel-build? #f
1826 #:tests? #f)) ; no test suite
1830 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1831 (synopsis "Show and modify Linux frame buffer settings")
1833 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1834 different kinds of graphic displays. The @command{fbset} utility can query and
1835 change various device settings such as depth, virtual resolution, and timing
1837 (license license:gpl2)))
1839 (define-public procps
1845 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1846 "procps-ng-" version ".tar.xz"))
1849 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1850 (build-system gnu-build-system)
1852 `(#:modules ((guix build utils)
1853 (guix build gnu-build-system)
1856 ,@(if (%current-target-system)
1859 "ac_cv_func_malloc_0_nonnull=yes"
1860 "ac_cv_func_realloc_0_nonnull=yes"))
1863 (modify-phases %standard-phases
1865 'install 'post-install
1866 ;; Remove commands and man pages redudant with
1868 (lambda* (#:key outputs #:allow-other-keys)
1869 (let* ((out (assoc-ref outputs "out"))
1870 (dup (append-map (cut find-files out <>)
1871 '("^kill" "^uptime"))))
1872 (for-each delete-file dup)
1874 (inputs `(("ncurses" ,ncurses)))
1875 (home-page "https://gitlab.com/procps-ng/procps/")
1876 (synopsis "Utilities that give information about processes")
1878 "Procps is the package that has a bunch of small useful utilities
1879 that give information about processes using the Linux /proc file system.
1880 The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
1881 slabtop, tload, top, vmstat, w, watch and sysctl.")
1882 (license license:gpl2)))
1884 (define-public usbutils
1891 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1892 "usbutils-" version ".tar.xz"))
1894 (base32 "0f0klk6d3hmbpf6p4dcwa1qjzblmkhbxs1wsw87aidvqri7lj8wy"))))
1895 (build-system gnu-build-system)
1896 (outputs (list "out" "python"))
1899 (modify-phases %standard-phases
1900 (add-before 'bootstrap 'patch-bootstrap-scripts
1902 (substitute* "usbhid-dump/bootstrap"
1903 (("/bin/sh") (which "sh")))
1905 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1906 (substitute* "autogen.sh"
1907 (("^\\./configure.*") ""))
1909 (add-after 'install 'separate-python-output
1910 ;; Separating one Python script shaves more than 106 MiB from :out.
1911 (lambda* (#:key outputs #:allow-other-keys)
1912 (let ((out (assoc-ref outputs "out"))
1913 (out:python (assoc-ref outputs "python")))
1914 (for-each (lambda (file)
1915 (let ((old (string-append out "/" file))
1916 (new (string-append out:python "/" file)))
1917 (mkdir-p (dirname new))
1918 (rename-file old new)))
1919 (list "bin/lsusb.py"))
1924 ("python" ,python)))
1926 `(("autoconf" ,autoconf)
1927 ("automake" ,automake)
1928 ("libtool" ,libtool)
1929 ("pkg-config" ,pkg-config)))
1930 (home-page "http://www.linux-usb.org/")
1932 "Tools for working with USB devices, such as lsusb")
1934 "Tools for working with USB devices, such as lsusb.")
1935 (license license:gpl2+)))
1937 (define-public e2fsprogs
1944 "mirror://kernel.org/linux/kernel/people/tytso/"
1945 "e2fsprogs/v" version "/"
1946 "e2fsprogs-" version ".tar.xz"))
1949 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1950 (build-system gnu-build-system)
1951 (inputs `(("util-linux" ,util-linux "lib")))
1952 (native-inputs `(("pkg-config" ,pkg-config)
1953 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1957 ("procps" ,procps)))
1959 '(;; util-linux is the preferred source for some of the libraries and
1960 ;; commands, so disable them (see, e.g.,
1961 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1962 #:configure-flags (list "--disable-libblkid"
1963 "--disable-libuuid" "--disable-uuidd"
1966 ;; Use symlinks instead of hard links for
1967 ;; 'fsck.extN' etc. This makes the resulting nar
1968 ;; smaller and is preserved across copies.
1969 "--enable-symlink-install"
1971 (string-append "LDFLAGS=-Wl,-rpath="
1972 (assoc-ref %outputs "out")
1975 ;; Install libext2fs et al.
1976 "--enable-elf-shlibs")
1979 (modify-phases %standard-phases
1980 (add-before 'configure 'patch-shells
1982 (substitute* "configure"
1983 (("/bin/sh (.*)parse-types.sh" _ dir)
1984 (string-append (which "sh") " " dir
1986 (substitute* "MCONFIG.in"
1987 (("INSTALL_SYMLINK = /bin/sh")
1988 "INSTALL_SYMLINK = sh"))
1989 (substitute* (find-files "." "^Makefile.in$")
1991 (string-append "#!" (which "sh"))))
1993 (add-after 'install 'install-libs
1994 (lambda* (#:key outputs #:allow-other-keys)
1995 (let* ((out (assoc-ref outputs "out"))
1996 (lib (string-append out "/lib")))
1997 (invoke "make" "install-libs")
1999 ;; Make the .a writable so that 'strip' works.
2000 ;; Failing to do that, due to debug symbols, we
2001 ;; retain a reference to the final
2002 ;; linux-libre-headers, which refer to the
2003 ;; bootstrap binaries.
2004 (let ((archives (find-files lib "\\.a$")))
2005 (for-each (lambda (file)
2009 (home-page "http://e2fsprogs.sourceforge.net/")
2010 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
2012 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
2013 (license (list license:gpl2 ;programs
2014 license:lgpl2.0 ;libext2fs
2015 license:x11)))) ;libuuid
2017 (define e2fsprogs/static
2019 (package (inherit e2fsprogs)
2021 ;; Do not build shared libraries.
2022 (substitute-keyword-arguments (package-arguments e2fsprogs)
2023 ((#:configure-flags _)
2024 '(list "--disable-blkid"))
2028 (define-public e2fsck/static
2030 (name "e2fsck-static")
2031 (version (package-version e2fsprogs))
2032 (build-system trivial-build-system)
2035 `(("e2fsprogs" ,e2fsprogs/static)))
2037 `(#:modules ((guix build utils))
2040 (use-modules (guix build utils)
2044 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
2046 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
2048 (with-directory-excursion bin
2049 (copy-file e2fsck "e2fsck")
2050 (remove-store-references "e2fsck")
2051 (chmod "e2fsck" #o555))
2053 (home-page (package-home-page e2fsprogs))
2054 (synopsis "Statically-linked e2fsck command from e2fsprogs")
2055 (description "This package provides statically-linked e2fsck command taken
2056 from the e2fsprogs package. It is meant to be used in initrds.")
2057 (license (package-license e2fsprogs))))
2059 (define-public extundelete
2061 (name "extundelete")
2066 (uri (string-append "mirror://sourceforge/extundelete/"
2067 "extundelete/" version "/extundelete-"
2068 version ".tar.bz2"))
2071 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
2072 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
2073 (build-system gnu-build-system)
2074 (inputs `(("e2fsprogs" ,e2fsprogs)))
2075 (home-page "http://extundelete.sourceforge.net/")
2076 (synopsis "Recover deleted files from ext2/3/4 partitions")
2078 "Extundelete is a set of tools that can recover deleted files from an
2079 ext3 or ext4 partition.")
2080 (license license:gpl2)))
2082 (define-public zerofree
2086 (home-page "https://frippery.org/uml/")
2089 (uri (string-append home-page name "-" version
2093 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
2094 (build-system gnu-build-system)
2097 (modify-phases %standard-phases
2098 (delete 'configure) ; no configure script
2100 ;; The Makefile lacks an ‘install’ target.
2101 (lambda* (#:key outputs #:allow-other-keys)
2102 (let* ((out (assoc-ref outputs "out"))
2103 (bin (string-append out "/bin")))
2104 (chmod "zerofree" #o555)
2105 (install-file "zerofree" bin)
2107 #:tests? #f)) ; no tests
2108 (inputs `(("libext2fs" ,e2fsprogs)))
2109 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
2111 "Zerofree finds the unallocated blocks with non-zero value content in an
2112 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
2113 This is a simple way to make disk images more compressible.
2114 Zerofree requires the file system to be unmounted or mounted read-only.")
2115 (license license:gpl2)))
2117 (define-public strace
2121 (home-page "https://strace.io")
2124 (uri (string-append home-page "/files/" version
2125 "/strace-" version ".tar.xz"))
2128 "1abs3svkg9985f4jrxx34sj1dcpsf95vv1a0g01c777zgygncjnz"))))
2129 (build-system gnu-build-system)
2132 (modify-phases %standard-phases
2133 (add-after 'unpack 'patch-/bin/sh
2135 (substitute* "strace.c"
2136 (("/bin/sh") (which "sh")))
2138 (add-after 'unpack 'disable-failing-tests
2140 ;; XXX These hang forever even if the test time-out is extended.
2141 (substitute* "tests/Makefile.in"
2142 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
2144 ;; Don't fail if the architecture doesn't support different personalities.
2145 #:configure-flags '("--enable-mpers=check")
2146 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
2147 #:parallel-tests? #f)) ; undeterministic failures
2148 (native-inputs `(("perl" ,perl)))
2149 (synopsis "System call tracer for Linux")
2151 "strace is a system call tracer, i.e. a debugging tool which prints out a
2152 trace of all the system calls made by a another process/program.")
2153 (license license:lgpl2.1+)))
2155 (define-public ltrace
2161 (uri (string-append "http://www.ltrace.org/ltrace_" version
2165 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
2166 (build-system gnu-build-system)
2167 (inputs `(("libelf" ,elfutils)))
2169 ;; Compilation uses -Werror by default, but it fails.
2170 '(#:configure-flags '("--disable-werror")))
2171 (home-page "https://www.ltrace.org/")
2172 (synopsis "Library call tracer for Linux")
2174 "ltrace intercepts and records dynamic library calls which are called by
2175 an executed process and the signals received by that process. It can also
2176 intercept and print the system calls executed by the program.")
2177 (license license:gpl2+)))
2179 (define-public alsa-lib
2186 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
2187 version ".tar.bz2"))
2190 "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp"))))
2191 (build-system gnu-build-system)
2193 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2194 (assoc-ref %outputs "out")
2196 (home-page "https://www.alsa-project.org/")
2197 (synopsis "The Advanced Linux Sound Architecture libraries")
2199 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2200 MIDI functionality to the Linux-based operating system.")
2201 (license license:lgpl2.1+)))
2203 (define-public alsa-utils
2209 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
2210 name "-" version ".tar.bz2"))
2213 "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq"))))
2214 (build-system gnu-build-system)
2216 ;; XXX: Disable man page creation until we have DocBook.
2217 '(#:configure-flags (list "--disable-xmlto"
2219 ;; The udev rule is responsible for restoring
2221 (string-append "--with-udev-rules-dir="
2222 (assoc-ref %outputs "out")
2223 "/lib/udev/rules.d"))
2225 (modify-phases %standard-phases
2226 (add-before 'check 'disable-broken-test
2228 ;; XXX: The 1.1.8 release tarball is missing a header that's
2229 ;; required for this test to work. Fixed in 1.1.9.
2230 (substitute* "axfer/test/Makefile"
2231 ((".*container-test.*") ""))
2234 'install 'pre-install
2236 ;; Don't try to mkdir /var/lib/alsa.
2237 (substitute* "Makefile"
2238 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2242 `(("gettext" ,gettext-minimal)))
2244 `(("libsamplerate" ,libsamplerate)
2245 ("ncurses" ,ncurses)
2246 ("alsa-lib" ,alsa-lib)
2248 (home-page "http://www.alsa-project.org/")
2249 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2251 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2252 MIDI functionality to the Linux-based operating system.")
2254 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2256 (license license:gpl2)))
2258 (define-public alsa-plugins
2260 (name "alsa-plugins")
2264 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2265 name "-" version ".tar.bz2"))
2268 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2269 (build-system gnu-build-system)
2270 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2271 ;; be split, there are references to both in files.
2272 ;; TODO: Remove OSS related plugins, they add support to run native
2273 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2275 (outputs '("out" "pulseaudio" "jack"))
2276 (native-search-paths
2277 (list (search-path-specification
2278 (variable "ALSA_PLUGIN_DIR")
2279 (files '("lib/alsa-lib"))
2282 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2283 ;; for /etc/alsa. On Guix System plugins are loaded from
2284 ;; the ALSA service, and other distributions likely
2285 ;; won't use these files.
2286 "--with-alsalconfdir=/tmp/noop")
2288 (modify-phases %standard-phases
2289 (add-after 'install 'split
2290 (lambda* (#:key inputs outputs #:allow-other-keys)
2291 ;; Distribute the binaries to the various outputs.
2292 (let* ((out (assoc-ref outputs "out"))
2293 (jack (assoc-ref outputs "jack"))
2294 (jacklib (string-append jack "/lib/alsa-lib"))
2295 (pua (assoc-ref outputs "pulseaudio"))
2296 (pualib (string-append pua "/lib/alsa-lib")))
2299 (for-each (lambda (file)
2300 (rename-file file (string-append jacklib "/" (basename file))))
2301 (find-files out ".*jack\\.(la|so)"))
2304 (for-each (lambda (file)
2305 (rename-file file (string-append pualib "/" (basename file))))
2306 (find-files out ".*pulse\\.(la|so)"))
2309 `(("alsa-lib" ,alsa-lib)
2311 ("speex" ,speex) ; libspeexdsp resampling plugin
2312 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2313 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2314 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2316 `(("pkg-config" ,pkg-config)))
2317 (home-page "http://www.alsa-project.org/")
2318 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2320 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2321 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2322 by providing additional plugins which include: upmixing, downmixing, jackd and
2323 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2324 external rate conversion.")
2325 (license (list license:gpl2+
2326 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2327 license:lgpl2.1+))))
2329 (define-public iptables
2336 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2338 (string-append "https://www.netfilter.org/projects/iptables/"
2339 "files/iptables-" version ".tar.bz2")))
2341 (base32 "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1"))))
2342 (build-system gnu-build-system)
2344 `(("pkg-config" ,pkg-config)
2348 `(("libmnl" ,libmnl)
2349 ("libnftnl" ,libnftnl)))
2351 '(#:tests? #f ; no test suite
2352 #:configure-flags ; add $libdir to the RUNPATH of executables
2353 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
2354 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2355 (synopsis "Programs to configure Linux IP packet filtering rules")
2357 "@command{iptables} is the user-space command line program used to
2358 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2359 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2361 This package also includes @command{ip6tables}, which is used to configure the
2364 Both commands are targeted at system administrators.")
2365 (license license:gpl2+)))
2367 (define-public jitterentropy-rngd
2369 (name "jitterentropy-rngd")
2375 (url "https://github.com/smuellerDD/jitterentropy-rngd")
2376 (commit (string-append "v" version))))
2377 (file-name (git-file-name name version))
2379 (base32 "1fb8zfwhwkl1d8n4cdn7rdv5rwd75qgc00d36pmkl7wgnj3c9xda"))))
2380 (build-system gnu-build-system)
2382 `(#:tests? #f ; no test suite
2384 (list (string-append "CC=" ,(cc-for-target))
2385 (string-append "PREFIX=" (assoc-ref %outputs "out"))
2386 "UNITDIR=$(PREFIX)/lib/systemd/system")
2388 (modify-phases %standard-phases
2389 (delete 'configure)))) ; no ./configure script
2390 (home-page "https://www.chronox.de/jent.html")
2391 (synopsis "CPU jitter random number generator daemon")
2393 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
2394 number generator} core to the kernel Linux's entropy estimator. This prevents
2395 the @file{/dev/random} device from blocking and should benefit users of the
2396 preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
2398 The CPU Jitter RNG itself is part of the kernel and claims to provide good
2399 entropy by collecting and magnifying differences in CPU execution time as
2400 measured by the high-resolution timer built into modern CPUs. It requires no
2401 additional hardware or external entropy source.
2403 The random bit stream generated by @command{jitterentropy-rngd} is not processed
2404 by a cryptographically secure whitening function. Nonetheless, its authors
2405 believe it to be a suitable source of cryptographically secure key material or
2406 other cryptographically sensitive data.
2408 If you agree with them, start this daemon as early as possible to provide
2409 properly seeded random numbers to services like SSH or those using TLS during
2410 early boot when entropy may be low, especially in virtualised environments.")
2411 (license (list license:bsd-3 ; or
2414 (define-public lsscsi
2421 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2424 "0jp458m2b3wckr18qkln69i01152qlwz33zm49103lq8fgx0n6d4"))))
2425 (build-system gnu-build-system)
2426 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2427 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2429 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2430 also list NVMe namespaces or controllers and show the relationship between a
2431 device's primary node name, its SCSI generic (sg) node name and its kernel
2433 (license license:gpl2)))
2435 (define-public ebtables
2442 "mirror://netfilter.org/ebtables/ebtables-"
2446 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2447 (build-system gnu-build-system)
2450 ("iptables" ,iptables)))
2451 (synopsis "Ethernet bridge frame table administration")
2452 (home-page "https://ebtables.netfilter.org/")
2454 "ebtables is an application program used to set up and maintain the
2455 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2456 analogous to the iptables application, but less complicated, due to the fact
2457 that the Ethernet protocol is much simpler than the IP protocol.")
2458 (license license:gpl2+)))
2460 (define-public iproute
2467 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2471 "0vrjbzhwzcvaxyyhkr2ii89w2vznzwp2pfgk7w72mviniawqs9lx"))))
2472 (build-system gnu-build-system)
2474 `( ;; There is a test suite, but it wants network namespaces and sudo.
2476 #:make-flags (let ((out (assoc-ref %outputs "out")))
2478 (string-append "CC=" ,(cc-for-target))
2480 (string-append "BASH_COMPDIR=" out
2481 "/etc/bash_completion.d")
2482 (string-append "LIBDIR=" out "/lib")
2483 (string-append "HDRDIR=" out "/include")
2484 (string-append "SBINDIR=" out "/sbin")
2485 (string-append "CONFDIR=" out "/etc")
2486 (string-append "DOCDIR=" out "/share/doc/"
2488 (string-append "MANDIR=" out "/share/man")))
2489 #:phases (modify-phases %standard-phases
2490 (add-before 'install 'pre-install
2492 ;; Don't attempt to create /var/lib/arpd.
2493 (substitute* "Makefile"
2494 (("^.*ARPDDIR.*$") ""))
2496 (add-after 'unpack 'patch-configure
2498 (let ((target ,(%current-target-system)))
2499 (substitute* "configure"
2502 (string-append target "-pkg-config")
2507 ("iptables" ,iptables)
2508 ("libmnl" ,libmnl)))
2512 ("pkg-config" ,pkg-config)))
2514 ;; ("libmnl" ,libmnl)
2515 ;; ("util-linux" ,util-linux)
2517 "https://wiki.linuxfoundation.org/networking/iproute2")
2519 "Utilities for controlling TCP/IP networking and traffic in Linux")
2521 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2522 and traffic with the Linux kernel. The most important of these are
2523 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2526 Most network configuration manuals still refer to ifconfig and route as the
2527 primary network configuration tools, but ifconfig is known to behave
2528 inadequately in modern network environments, and both should be deprecated.")
2529 (license license:gpl2+)))
2531 (define-public net-tools
2532 ;; XXX: This package is basically unmaintained, but it provides a few
2533 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2535 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2539 (version (string-append "1.60-" revision "." (string-take commit 7)))
2542 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2543 "n/ne/net-tools/code.git/net-tools-code-"
2545 (file-name (string-append name "-" version ".zip"))
2548 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2549 (home-page "http://net-tools.sourceforge.net/")
2550 (build-system gnu-build-system)
2552 `(#:modules ((guix build gnu-build-system)
2557 (modify-phases %standard-phases
2559 (lambda* (#:key outputs #:allow-other-keys)
2560 (let ((out (assoc-ref outputs "out")))
2561 (mkdir-p (string-append out "/bin"))
2562 (mkdir-p (string-append out "/sbin"))
2564 ;; Pretend we have everything...
2565 (system "yes | make config")
2567 ;; ... except for the things we don't have.
2568 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2569 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2570 ;; that have been removed.
2571 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2572 ;; think about adding them later.
2573 (substitute* '("config.make" "config.h")
2574 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2577 (add-after 'install 'remove-redundant-commands
2578 (lambda* (#:key outputs #:allow-other-keys)
2579 ;; Remove commands and man pages redundant with Inetutils.
2580 (let* ((out (assoc-ref outputs "out"))
2581 (dup (append-map (cut find-files out <>)
2583 "^(yp|nis|dns)?domainname"))))
2584 (for-each delete-file dup)
2586 ;; Binaries that depend on libnet-tools.a don't declare that
2587 ;; dependency, making it parallel-unsafe.
2588 #:parallel-build? #f
2590 #:tests? #f ; no test suite
2591 #:make-flags (let ((out (assoc-ref %outputs "out")))
2592 (list ,(string-append "CC=" (cc-for-target))
2593 (string-append "BASEDIR=" out)
2594 (string-append "INSTALLNLSDIR=" out "/share/locale")
2595 (string-append "mandir=/share/man")))))
2596 (native-inputs `(("gettext" ,gettext-minimal)
2598 (supported-systems (delete "i586-gnu" %supported-systems))
2599 (synopsis "Tools for controlling the network subsystem in Linux")
2601 "This package includes the important tools for controlling the network
2602 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2603 route. Additionally, this package contains utilities relating to particular
2604 network hardware types (plipconfig, slattach) and advanced aspects of IP
2605 configuration (iptunnel, ipmaddr).")
2606 (license license:gpl2+))))
2608 (define-public libcap-2.31
2615 "mirror://kernel.org/linux/libs/security/linux-privs/"
2616 "libcap2/libcap-" version ".tar.xz"))
2619 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2620 (build-system gnu-build-system)
2621 (arguments '(#:phases
2622 (modify-phases %standard-phases
2624 ;; Add $libdir to the RUNPATH of executables.
2626 (substitute* "Make.Rules"
2628 (string-append "LDFLAGS := -Wl,-rpath="
2631 #:test-target "test"
2632 #:make-flags (list "lib=lib"
2633 (string-append "prefix="
2634 (assoc-ref %outputs "out"))
2635 "RAISE_SETFCAP=no")))
2636 (native-inputs `(("perl" ,perl)))
2637 (supported-systems (delete "i586-gnu" %supported-systems))
2638 (home-page "https://sites.google.com/site/fullycapable/")
2639 (synopsis "Library for working with POSIX capabilities")
2641 "Libcap2 provides a programming interface to POSIX capabilities on
2642 Linux-based operating systems.")
2644 ;; License is BSD-3 or GPLv2, at the user's choice.
2645 (license license:gpl2)))
2647 ;; libcap 2.31 has problems with newer kernels, so provide this newer variant.
2648 ;; Keep the old libcap around to avoid rebuilding 'coreutils' and 'avahi'.
2649 ;; To be merged with libcap on the next rebuild cycle.
2650 (define-public libcap
2652 (inherit libcap-2.31)
2657 "mirror://kernel.org/linux/libs/security/linux-privs/"
2658 "libcap2/libcap-" version ".tar.xz"))
2661 "11ijmi7jik9iw6pdszc6bylhggghr8cza03bcrbhbqf0cpvkjrnn"))))
2663 (substitute-keyword-arguments (package-arguments libcap-2.31)
2665 `(modify-phases ,phases
2668 ;; Add $libdir to the RUNPATH of executables.
2669 (substitute* "Make.Rules"
2670 (("LDFLAGS \\?= #-g")
2671 (string-append "LDFLAGS ?= -Wl,-rpath="
2675 (define-deprecated libcap/next libcap)
2676 (export libcap/next)
2678 (define-public bridge-utils
2680 (name "bridge-utils")
2685 (uri (string-append "mirror://kernel.org/linux/kernel/people/shemminger/"
2686 "bridge-utils/bridge-utils-" version ".tar.xz"))
2688 (base32 "0zlrigizac2nfwgvksm92v4wafrpgxlbci3gwimc795ib7k8g6ck"))))
2689 (build-system gnu-build-system)
2691 ;; The tarball lacks all the generated files.
2692 (native-inputs `(("autoconf" ,autoconf)
2693 ("automake" ,automake)))
2696 (modify-phases %standard-phases
2697 (add-before 'bootstrap 'patch-stuff
2699 ;; Fix "field ‘ip6’ has incomplete type" errors.
2700 (substitute* "libbridge/libbridge.h"
2701 (("#include <linux/if_bridge.h>")
2702 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2704 ;; Ensure that the entire build fails if one of the
2705 ;; sub-Makefiles fails.
2706 (substitute* "Makefile.in"
2707 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2708 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2711 #:tests? #f)) ; no 'check' target
2713 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2714 (synopsis "Manipulate Ethernet bridges")
2716 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2717 to connect two Ethernet segments together in a protocol independent way.
2718 Packets are forwarded based on Ethernet address, rather than IP address (like
2719 a router). Since forwarding is done at Layer 2, all protocols can go
2720 transparently through a bridge.")
2721 (license license:gpl2+)))
2723 (define-public libnl
2730 "https://github.com/thom311/libnl/releases/download/"
2731 "libnl" (string-join (string-split version #\.) "_")
2732 "/libnl-" version ".tar.gz"))
2735 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2736 (build-system gnu-build-system)
2740 ("pkg-config" ,pkg-config)
2746 "https://github.com/thom311/libnl/releases/download/libnl"
2747 (string-join (string-split version #\.) "_")
2748 "/libnl-doc-" version ".tar.gz"))
2750 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2751 (outputs `("out" "doc"))
2754 (modify-phases %standard-phases
2755 (add-after 'install 'install-doc
2756 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2757 (let ((dest (string-append (assoc-ref outputs "doc")
2758 "/share/doc/libnl")))
2760 (invoke "tar" "xf" (assoc-ref
2761 (or native-inputs inputs)
2763 "--strip-components=1" "-C" dest)))))))
2764 (home-page "https://www.infradead.org/~tgr/libnl/")
2765 (synopsis "NetLink protocol library suite")
2767 "The libnl suite is a collection of libraries providing APIs to netlink
2768 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2769 between the kernel and user space processes. It was designed to be a more
2770 flexible successor to ioctl to provide mainly networking related kernel
2771 configuration and monitoring interfaces.")
2773 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2774 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2775 (license license:gpl2)))
2777 ;; libnl python extensions used to be outputs of libnl. However, as
2778 ;; cross-compiling python extensions is currently broken, create separate
2779 ;; packages for libnl python extensions.
2780 (define (libnl-python-package python)
2781 (let ((name (string-append "libnl-" python)))
2786 ((string=? python "python2")
2787 `(("python-2" ,python-2)))
2788 ((string=? python "python3")
2789 `(("python-3" ,python-3))))))
2790 (propagated-inputs `(("libnl" ,libnl)))
2793 `(#:modules ((guix build gnu-build-system)
2797 (modify-phases %standard-phases
2799 (lambda* (#:key inputs outputs #:allow-other-keys)
2800 (define (python-inst python)
2801 (invoke python "setup.py" "build")
2802 (invoke python "setup.py" "install"
2803 (string-append "--prefix="
2804 (assoc-ref %outputs "out")))
2805 (invoke python "setup.py" "clean"))
2806 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2807 (assoc-ref inputs "libnl")))
2808 (with-directory-excursion "./python" (python-inst ,python))
2811 (define-public libnl-python2 (libnl-python-package "python2"))
2812 (define-public libnl-python3 (libnl-python-package "python3"))
2821 "mirror://kernel.org/software/network/iw/iw-"
2825 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2826 (build-system gnu-build-system)
2827 (native-inputs `(("pkg-config" ,pkg-config)))
2828 (inputs `(("libnl" ,libnl)))
2831 (let* ((target ,(%current-target-system))
2832 (pkg-config (if target
2833 (string-append target "-pkg-config")
2836 ,(string-append "CC=" (cc-for-target))
2837 (string-append "PKG_CONFIG="
2838 (assoc-ref %build-inputs "pkg-config")
2840 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2841 #:phases (modify-phases %standard-phases (delete 'configure))))
2842 (home-page "https://wireless.wiki.kernel.org/")
2843 (synopsis "Tool for configuring wireless devices")
2845 "iw is a new nl80211 based CLI configuration utility for wireless
2846 devices. It replaces @code{iwconfig}, which is deprecated.")
2847 (license license:isc)))
2849 (define-public powertop
2857 (url "https://github.com/fenrus75/powertop")
2858 (commit (string-append "v" version))))
2859 (file-name (git-file-name name version))
2861 (base32 "1zkr2y5nb1nr22nq8a3zli87iyfasfq6489p7h1k428pv8k45w4f"))))
2862 (build-system gnu-build-system)
2865 (list "LDFLAGS=-pthread")
2867 (modify-phases %standard-phases
2868 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2869 ;; allow calibrating the network interface in Guix System.
2870 (add-after 'unpack 'patch-absolute-file-names
2871 (lambda* (#:key inputs #:allow-other-keys)
2872 (let ((kmod (assoc-ref inputs "kmod")))
2873 (substitute* (find-files "src" "\\.cpp$")
2874 ;; Give the right 'modprobe' file name so that essential
2875 ;; modules such as msr.ko can be loaded.
2876 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2877 ;; These programs are only needed to calibrate, so using
2878 ;; relative file names avoids adding extra inputs. When they
2879 ;; are missing powertop gracefully handles it.
2880 (("/usr/bin/hcitool") "hcitool")
2881 (("/usr/bin/xset") "xset")
2882 (("/usr/sbin/hciconfig") "hciconfig"))
2887 ("ncurses" ,ncurses)
2888 ("pciutils" ,pciutils)
2891 `(("autoconf" ,autoconf)
2892 ("automake" ,automake)
2893 ("gettext" ,gettext-minimal)
2894 ("libtool" ,libtool)
2895 ("pkg-config" ,pkg-config)))
2896 (home-page "https://01.org/powertop/")
2897 (synopsis "Analyze power consumption on Intel-based laptops")
2899 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2900 power management. In addition to being a diagnostic tool, PowerTOP also has
2901 an interactive mode where the user can experiment various power management
2902 settings for cases where the operating system has not enabled these
2904 (license license:gpl2)))
2906 (define-public aumix
2913 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2914 version ".tar.bz2"))
2917 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2918 (build-system gnu-build-system)
2919 (inputs `(("ncurses" ,ncurses)))
2920 (home-page "http://www.jpj.net/~trevor/aumix.html")
2921 (synopsis "Audio mixer for X and the console")
2923 "Aumix adjusts an audio mixer from X, the console, a terminal,
2924 the command line or a script.")
2925 (license license:gpl2+)))
2927 (define-public iotop
2934 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2937 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2938 (build-system python-build-system)
2941 (modify-phases %standard-phases
2942 (add-after 'unpack 'fix-build-with-python3
2944 (substitute* "setup.py"
2945 (("itervalues") "values"))
2947 ;; There are currently no checks in the package.
2949 (native-inputs `(("python" ,python)))
2950 (home-page "http://guichaz.free.fr/iotop/")
2952 "Displays the IO activity of running processes")
2954 "Iotop is a Python program with a top like user interface to show the
2955 processes currently causing I/O.")
2956 (license license:gpl2+)))
2964 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2965 "download/fuse-" version
2966 "/fuse-" version ".tar.gz"))
2969 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2970 (patches (search-patches "fuse-overlapping-headers.patch"))))
2971 (build-system gnu-build-system)
2972 (inputs `(("util-linux" ,util-linux)))
2974 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2975 (assoc-ref %outputs "out")
2977 (string-append "INIT_D_PATH="
2978 (assoc-ref %outputs "out")
2981 ;; The rule makes /dev/fuse 666.
2982 (string-append "UDEV_RULES_PATH="
2983 (assoc-ref %outputs "out")
2984 "/lib/udev/rules.d"))
2986 (modify-phases %standard-phases
2987 (add-before 'build 'set-file-names
2988 (lambda* (#:key inputs #:allow-other-keys)
2989 ;; libfuse calls out to mount(8) and umount(8). Make sure
2990 ;; it refers to the right ones.
2991 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2992 (("/bin/(u?)mount" _ maybe-u)
2993 (string-append (assoc-ref inputs "util-linux")
2994 "/bin/" maybe-u "mount")))
2995 (substitute* '("util/mount.fuse.c")
2999 ;; This hack leads libfuse to search for 'fusermount' in
3000 ;; $PATH, where it may find a setuid-root binary, instead of
3001 ;; trying solely $out/sbin/fusermount and failing because
3003 (substitute* "lib/Makefile"
3004 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
3005 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
3007 (supported-systems (delete "i586-gnu" %supported-systems))
3008 (home-page "https://github.com/libfuse/libfuse")
3009 (synopsis "Support file systems implemented in user space")
3011 "As a consequence of its monolithic design, file system code for Linux
3012 normally goes into the kernel itself---which is not only a robustness issue,
3013 but also an impediment to system extensibility. FUSE, for \"file systems in
3014 user space\", is a kernel module and user-space library that tries to address
3015 part of this problem by allowing users to run file system implementations as
3016 user-space processes.")
3017 (license (list license:lgpl2.1 ;library
3018 license:gpl2+)))) ;command-line utilities
3020 (define-public unionfs-fuse
3022 (name "unionfs-fuse")
3027 (url "https://github.com/rpodgorny/unionfs-fuse")
3028 (commit (string-append "v" version))))
3029 (file-name (git-file-name name version))
3032 "0bwx70x834qgqh53vqp18bhbxbsny80hz922rbgj8k9wj7cbfilm"))))
3033 (build-system cmake-build-system)
3035 `(("python" ,python)))
3036 (inputs `(("fuse" ,fuse)))
3038 ;; The tests were never actually run ("collected 0 items"), but in recent
3039 ;; versions of pytest that causes an error.
3041 (home-page "https://github.com/rpodgorny/unionfs-fuse")
3042 (synopsis "User-space union file system")
3044 "UnionFS-FUSE is a flexible union file system implementation in user
3045 space, using the FUSE library. Mounting a union file system allows you to
3046 \"aggregate\" the contents of several directories into a single mount point.
3047 UnionFS-FUSE additionally supports copy-on-write.")
3048 (license license:bsd-3)))
3051 (package (inherit fuse)
3052 (name "fuse-static")
3053 (source (origin (inherit (package-source fuse))
3054 (modules '((guix build utils)))
3057 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
3058 ;; updated. Change calls to 'mtab_needs_update' to 0 so
3059 ;; that it doesn't do that, allowing us to remove the
3060 ;; dependency on util-linux (something that is useful in
3062 (substitute* '("lib/mount_util.c"
3063 "util/mount_util.c")
3064 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
3070 (define-public unionfs-fuse/static
3071 (package (inherit unionfs-fuse)
3072 (synopsis "User-space union file system (statically linked)")
3073 (name (string-append (package-name unionfs-fuse) "-static"))
3074 (source (origin (inherit (package-source unionfs-fuse))
3075 (modules '((guix build utils)))
3078 ;; Add -ldl to the libraries, because libfuse.a needs that.
3079 (substitute* "src/CMakeLists.txt"
3080 (("target_link_libraries(.*)\\)" _ libs)
3081 (string-append "target_link_libraries"
3086 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
3088 (modify-phases %standard-phases
3089 (add-after 'install 'post-install
3090 (lambda* (#:key outputs #:allow-other-keys)
3091 (let* ((out (assoc-ref outputs "out"))
3092 (exe (string-append out "/bin/unionfs")))
3093 ;; By default, 'unionfs' keeps references to
3094 ;; $glibc/share/locale and similar stuff. Remove them.
3095 (remove-store-references exe)
3097 ;; 'unionfsctl' has references to glibc as well. Since
3098 ;; we don't need it, remove it.
3099 (delete-file (string-append out "/bin/unionfsctl"))
3101 (inputs `(("fuse" ,fuse-static)))))
3103 (define-public sshfs
3109 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
3110 "download/sshfs-" version "/sshfs-" version
3114 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
3115 (build-system gnu-build-system)
3120 `(("pkg-config" ,pkg-config)))
3121 (home-page "https://github.com/libfuse/sshfs")
3122 (synopsis "Mount remote file systems over SSH")
3124 "This is a file system client based on the SSH File Transfer Protocol.
3125 Since most SSH servers already support this protocol it is very easy to set
3126 up: on the server side there's nothing to do; on the client side mounting the
3127 file system is as easy as logging into the server with an SSH client.")
3128 (license license:gpl2+)))
3130 (define-public sshfs-fuse
3131 (package (inherit sshfs)
3133 (properties `((superseded . ,sshfs)))))
3135 (define-public archivemount
3137 (name "archivemount")
3142 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
3143 "archivemount-" version ".tar.gz"))
3145 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
3146 (build-system gnu-build-system)
3147 (inputs `(("fuse" ,fuse)
3148 ("libarchive" ,libarchive)))
3149 (native-inputs `(("pkg-config" ,pkg-config)))
3150 (home-page "https://www.cybernoia.de/software/archivemount.html")
3151 (synopsis "Tool for mounting archive files with FUSE")
3152 (description "archivemount is a FUSE-based file system for Unix variants,
3153 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
3154 mount point where it can be read from or written to as with any other file
3155 system. This makes accessing the contents of the archive, which may be
3156 compressed, transparent to other programs, without decompressing them.")
3157 (license license:lgpl2.0+)))
3159 (define-public numactl
3166 "https://github.com/numactl/numactl/releases/download/v"
3167 version "/numactl-" version ".tar.gz"))
3170 "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2"))))
3171 (build-system gnu-build-system)
3173 '(;; There's a 'test' target, but it requires NUMA support in the kernel
3174 ;; to run, which we can't assume to have.
3177 ;; NUMA is apparently not supported on armhf, see
3178 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
3179 (supported-systems (delete "armhf-linux" %supported-systems))
3180 (home-page "https://github.com/numactl/numactl")
3181 (synopsis "Tools for non-uniform memory access (NUMA) machines")
3183 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
3184 memory is not all in one place. The @command{numactl} program allows you to
3185 run your application program on specific CPUs and memory nodes. It does this
3186 by supplying a NUMA memory policy to the operating system before running your
3189 The package contains other commands, such as @command{numastat},
3190 @command{memhog}, and @command{numademo} which provides a quick overview of
3191 NUMA performance on your system.")
3192 (license (list license:gpl2 ;programs
3193 license:lgpl2.1)))) ;library
3195 (define-public kbd-neo
3202 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
3203 version "/linux/console/neo.map"))
3204 (file-name (string-append name "-" version ".map"))
3207 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
3208 (build-system trivial-build-system)
3210 `(#:modules ((guix build utils))
3212 (use-modules (guix build utils))
3213 (let ((out (string-append %output "/share/keymaps"))
3214 (source (assoc-ref %build-inputs "source")))
3216 (copy-file source (string-append out "/neo.map"))
3218 (home-page "https://neo-layout.org")
3219 (synopsis "Neo2 console layout")
3221 "Kbd-neo provides the Neo2 keyboard layout for use with
3222 @command{loadkeys(1)} from @code{kbd(4)}.")
3223 ;; The file is located in an svn directory, the entire content of
3224 ;; the directory is licensed as GPL3.
3225 (license license:gpl3+)))
3233 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
3237 "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m"))
3238 (modules '((guix build utils)))
3241 (substitute* '("src/unicode_start" "src/unicode_stop")
3242 ;; Assume the Coreutils are in $PATH.
3245 (build-system gnu-build-system)
3248 (modify-phases %standard-phases
3249 (add-before 'build 'pre-build
3250 (lambda* (#:key inputs #:allow-other-keys)
3251 (let ((bzip2 (assoc-ref inputs "bzip2"))
3252 (gzip (assoc-ref inputs "gzip"))
3253 (xz (assoc-ref inputs "xz"))
3254 (zstd (assoc-ref inputs "zstd")))
3255 (substitute* "src/libkbdfile/kbdfile.c"
3256 (("bzip2") (string-append bzip2 "/bin/bzip2"))
3257 (("gzip") (string-append gzip "/bin/gzip"))
3258 (("xz -d") (string-append xz "/bin/xz -d"))
3259 (("zstd") (string-append zstd "/bin/zstd"))))))
3260 (add-after 'install 'post-install
3261 (lambda* (#:key outputs #:allow-other-keys)
3262 ;; Make sure these programs find their comrades.
3263 (let* ((out (assoc-ref outputs "out"))
3264 (bin (string-append out "/bin")))
3265 (for-each (lambda (prog)
3266 (wrap-program (string-append bin "/" prog)
3267 `("PATH" ":" prefix (,bin))))
3268 '("unicode_start" "unicode_stop"))))))))
3270 `(("autoconf" ,autoconf)
3271 ("pkg-config" ,pkg-config)))
3278 (native-search-paths
3279 (list (search-path-specification
3280 (variable "LOADKEYS_KEYMAP_PATH")
3281 ;; Append ‘/**’ to recursively search all directories. One can then
3282 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
3283 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
3284 (files (list "share/keymaps/**")))))
3285 (home-page "http://kbd-project.org/")
3286 (synopsis "Linux keyboard utilities and keyboard maps")
3288 "This package contains keytable files and keyboard utilities compatible
3289 for systems using the Linux kernel. This includes commands such as
3290 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3291 (license license:gpl2+)))
3293 (define-public loadkeys-static
3296 (name "loadkeys-static")
3298 (substitute-keyword-arguments (package-arguments kbd)
3299 ((#:configure-flags flags ''())
3300 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
3301 "--disable-vlock" ;so we don't need libpam
3302 "--disable-libkeymap")
3304 ((#:make-flags flags ''())
3305 `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
3306 ((#:phases phases '%standard-phases)
3307 `(modify-phases ,phases
3309 (lambda* (#:key outputs #:allow-other-keys)
3310 (let ((out (assoc-ref outputs "out")))
3311 ;; The binary keeps references to gzip, among other things,
3312 ;; which we don't need in the initrd, so strip references.
3313 (remove-store-references "src/loadkeys")
3315 (install-file "src/loadkeys"
3316 (string-append out "/bin")))))
3317 (delete 'post-install)))
3318 ((#:strip-flags _ '())
3320 ((#:allowed-references _ '())
3323 (synopsis "Statically-linked @command{loadkeys} program")
3325 ;; This package is meant to be used internally in the initrd so don't
3327 (properties '((hidden? . #t)))))
3329 (define-public inotify-tools
3331 (name "inotify-tools")
3332 (version "3.20.11.0")
3336 (url "https://github.com/rvoicilas/inotify-tools")
3338 (file-name (git-file-name name version))
3341 "1m8avqccrhm38krlhp88a7v949f3hrzx060bbrr5dp5qw2nmw9j2"))))
3342 (build-system gnu-build-system)
3344 `(("autoconf" ,autoconf)
3345 ("automake" ,automake)
3346 ("libtool" ,libtool)))
3349 (list "--disable-static")))
3350 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3351 (synopsis "Monitor file accesses")
3353 "The inotify-tools packages provides a C library and command-line tools
3354 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3355 (license license:gpl2+)))
3364 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3365 "kmod-" version ".tar.xz"))
3368 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3369 (patches (search-patches "kmod-module-directory.patch"))))
3370 (build-system gnu-build-system)
3372 `(("pkg-config" ,pkg-config)))
3377 `(#:configure-flags '("--with-xz" "--with-zlib"
3378 "--disable-test-modules")
3380 (modify-phases %standard-phases
3381 (add-after 'unpack 'disable-tests
3383 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3384 (substitute* "Makefile.in"
3385 (("testsuite/test-modprobe") "")
3386 (("testsuite/test-depmod") "")
3387 (("testsuite/test-blacklist") ""))
3389 (add-after 'install 'install-modprobe&co
3390 (lambda* (#:key outputs #:allow-other-keys)
3391 (let* ((out (assoc-ref outputs "out"))
3392 (bin (string-append out "/bin")))
3393 (for-each (lambda (tool)
3395 (string-append bin "/" tool)))
3396 '("insmod" "rmmod" "lsmod" "modprobe"
3397 "modinfo" "depmod"))
3399 (supported-systems (delete "i586-gnu" %supported-systems))
3400 (home-page "https://www.kernel.org/")
3401 (synopsis "Kernel module tools")
3402 (description "Kmod is a set of tools to handle common tasks with Linux
3403 kernel modules like insert, remove, list, check properties, resolve
3404 dependencies and aliases.
3406 These tools are designed on top of libkmod, a library that is shipped with
3407 kmod. The aim is to be compatible with tools, configurations and indices
3408 from the module-init-tools project.")
3409 (license license:gpl2+))) ; library under lgpl2.1+
3411 (define-public earlyoom
3418 (url "https://github.com/rfjakob/earlyoom")
3419 (commit (string-append "v" version))))
3420 (file-name (git-file-name name version))
3423 "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))))
3424 (build-system gnu-build-system)
3427 (modify-phases %standard-phases
3428 (delete 'configure) ; no configure script
3429 (add-before 'check 'set-go-HOME
3431 (setenv "HOME" (getcwd))
3433 (add-before 'check 'disable-failing-test
3435 ;; This test relies on writing to /proc/%d/oom_score_adj.
3436 (substitute* "testsuite_cli_test.go"
3438 (string-append "skipped" match)))
3440 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3441 (list ,(string-append "CC=" (cc-for-target))
3442 (string-append "VERSION=v" ,version)
3443 (string-append "PREFIX=" prefix)
3444 (string-append "SYSCONFDIR=" prefix "/etc")))
3445 #:test-target "test"))
3446 (native-inputs `(("go" ,go) ;for the test suite
3447 ("pandoc" ,pandoc))) ;to generate the manpage
3448 (home-page "https://github.com/rfjakob/earlyoom")
3449 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3450 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3451 runs in user space and provides a more responsive and configurable alternative
3452 to the in-kernel OOM killer.")
3453 (license license:expat)))
3455 (define-public eudev
3456 ;; The post-systemd fork, maintained by Gentoo.
3462 (uri (git-reference (url "https://github.com/gentoo/eudev")
3463 (commit (string-append "v" version))))
3464 (file-name (git-file-name name version))
3467 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3468 (patches (search-patches "eudev-rules-directory.patch"))))
3469 (build-system gnu-build-system)
3472 (modify-phases %standard-phases
3473 (add-after 'unpack 'make-source-writable
3475 ;; XXX: Git checkouts are read-only, but this package needs to
3476 ;; modify some of its files.
3477 (for-each make-file-writable (find-files "."))
3479 (add-before 'bootstrap 'patch-file-names
3480 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3481 (substitute* "man/make.sh"
3482 (("/usr/bin/xsltproc")
3483 (string-append (assoc-ref
3484 (or native-inputs inputs) "xsltproc")
3487 (add-before 'configure 'patch-bindir-in-btrfs-rules
3488 (lambda* (#:key outputs #:allow-other-keys)
3489 ;; The "@bindir@" substitution incorrectly expands to a literal
3490 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3492 (let ((out (assoc-ref outputs "out")))
3493 (substitute* "rules/64-btrfs.rules.in"
3495 (string-append out "/bin")))
3497 (add-after 'install 'move-static-library
3498 (lambda* (#:key outputs #:allow-other-keys)
3499 (let* ((out (assoc-ref outputs "out"))
3500 (static (assoc-ref outputs "static"))
3501 (source (string-append out "/lib/libudev.a"))
3502 (target (string-append static "/lib/libudev.a")))
3503 (mkdir-p (dirname target))
3504 (link source target)
3505 (delete-file source)
3506 ;; Remove reference to the static library from the .la file
3507 ;; such that Libtool looks for it in the usual places.
3508 (substitute* (string-append out "/lib/libudev.la")
3510 "old_library=''\n"))
3512 (add-after 'install 'build-hwdb
3513 (lambda* (#:key outputs #:allow-other-keys)
3514 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3515 ;; similar tools to display product names.
3517 ;; XXX: This can't be done when cross-compiling. Find another way
3518 ;; to generate hwdb.bin for cross-built systems.
3519 (let ((out (assoc-ref outputs "out")))
3520 ,@(if (%current-target-system)
3522 '((invoke (string-append out "/bin/udevadm")
3523 "hwdb" "--update")))))))
3524 #:configure-flags (list "--enable-manpages")))
3526 `(("autoconf" ,autoconf)
3527 ("automake" ,automake)
3529 ("libtool" ,libtool)
3530 ("pkg-config" ,pkg-config)
3533 ("python" ,python-wrapper)
3534 ;; For documentation.
3535 ("docbook-xml" ,docbook-xml-4.2)
3536 ("docbook-xsl" ,docbook-xsl)
3537 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3538 ("xsltproc" ,libxslt)))
3540 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3541 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3542 ;; which contains the rules to do that.
3543 `(("util-linux" ,util-linux "lib") ;for blkid
3545 (outputs '("out" "static"))
3546 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3547 (synopsis "Userspace device management")
3548 (description "Udev is a daemon which dynamically creates and removes
3549 device nodes from /dev/, handles hotplug events and loads drivers at boot
3551 (license license:gpl2+)))
3553 (define-public python-evdev
3555 (name "python-evdev")
3560 (uri (pypi-uri "evdev" version))
3562 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3563 (build-system python-build-system)
3565 `(("kernel-headers" ,linux-libre-headers)))
3567 `(#:tests? #f ;no rule for tests
3569 (modify-phases %standard-phases
3570 (add-before 'build 'fix-hard-coded-directory
3571 (lambda* (#:key inputs #:allow-other-keys)
3572 (substitute* "setup.py"
3573 (("/usr/include/linux")
3575 (assoc-ref inputs "kernel-headers") "/include/linux")))
3577 (home-page "https://github.com/gvalkov/python-evdev")
3578 (synopsis "Bindings to the Linux input handling subsystem")
3580 "Python-evdev provides bindings to the generic input event interface in
3581 Linux. The @code{evdev} interface serves the purpose of passing events
3582 generated in the kernel directly to userspace through character devices that
3583 are typically located in @file{/dev/input/}.
3585 This package also comes with bindings to @code{uinput}, the userspace input
3586 subsystem. @code{uinput} allows userspace programs to create and handle input
3587 devices that can inject events directly into the input subsystem.")
3588 (license license:bsd-3)))
3590 (define-public interception-tools
3592 (name "interception-tools")
3594 (home-page "https://gitlab.com/interception/linux/tools")
3599 (commit (string-append "v" version))))
3600 (file-name (git-file-name name version))
3603 "121jy40ynkbzlqnx7g0dqwvkb7dm2ahcy6vwrz6ylsyd0jmi6s5a"))))
3604 (build-system cmake-build-system)
3607 ("libevdev" ,libevdev)
3609 ("yaml-cpp" ,yaml-cpp)))
3612 (modify-phases %standard-phases
3613 (add-after 'unpack 'fix-libevdev-path
3614 (lambda* (#:key inputs #:allow-other-keys)
3615 (let ((libevdev (assoc-ref inputs "libevdev")))
3616 (substitute* "CMakeLists.txt"
3617 (("/usr/include/libevdev-1.0")
3618 (string-append libevdev "/include/libevdev-1.0")))
3620 ;; No tests are included.
3622 (synopsis "Utilities for operating on input events of evdev devices")
3624 "Interception Tools provides a composable infrastructure on top of
3625 @code{libudev} and @code{libevdev}. The following utilities are provided:
3628 @item @command{udevmon} --- monitor input devices for launching tasks
3629 @item @command{intercept} --- redirect device input events to stdout
3630 @item @command{uinput} --- redirect device input events from stding to virtual device
3631 @item @command{mux} --- mux streams of input events
3633 ;; Dual-licensed under GPLv3+ or "something else" on request, per
3635 (license license:gpl3+)))
3637 (define-public interception-dual-function-keys
3639 (name "interception-dual-function-keys")
3641 (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
3647 (file-name (git-file-name name version))
3650 "1gvhkmwzl5fyyc7k8rc4rf2b9mzh05wa8wcybf9hz2x1mqkc7lmz"))))
3651 (build-system gnu-build-system)
3653 `(("libevdev" ,libevdev)
3654 ("yaml-cpp" ,yaml-cpp)))
3656 `(#:make-flags (list "CC=gcc" "CXX=g++"
3657 (string-append "PREFIX=" (assoc-ref %outputs "out")))
3659 (modify-phases %standard-phases
3660 (add-after 'unpack 'fix-libevdev-path
3661 (lambda* (#:key inputs #:allow-other-keys)
3662 (let ((libevdev (assoc-ref inputs "libevdev")))
3663 (substitute* "config.mk"
3664 (("/usr/include/libevdev-1.0")
3665 (string-append libevdev "/include/libevdev-1.0")))
3667 ;; No configure script
3669 ;; No target 'check'
3671 (synopsis "Tap for one key, hold for another")
3673 "Dual Function Keys is a plugin for @code{interception-tools} that allows
3674 one to send arbitrary keycodes when a given key is tapped or held.")
3675 (license license:expat)))
3683 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
3685 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3689 "1m4xpda8vbyd89ca0w8nacvnl4j34yzsa625gn990fb5sh84ab44"))
3690 (modules '((guix build utils)))
3693 (use-modules (guix build utils))
3695 ;; Honor sysconfdir.
3696 (substitute* "make.tmpl.in"
3698 "confdir = @sysconfdir@\n")
3699 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3700 "DEFAULT_SYS_DIR = @sysconfdir@"))
3702 (patches (search-patches "lvm2-static-link.patch"))))
3703 (build-system gnu-build-system)
3705 `(("pkg-config" ,pkg-config)
3706 ("procps" ,procps))) ;tests use 'pgrep'
3708 `(("libaio" ,libaio)
3712 (modify-phases %standard-phases
3713 (add-after 'configure 'set-makefile-shell
3715 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3717 (setenv "SHELL" (which "sh"))
3719 ;; Replace /bin/sh with the right file name.
3720 (patch-makefile-SHELL "make.tmpl")
3723 #:configure-flags (list (string-append "--sysconfdir="
3724 (assoc-ref %outputs "out")
3726 "--enable-udev_sync"
3727 "--enable-udev_rules"
3728 "--enable-pkgconfig"
3730 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3732 ;; Make sure programs such as 'dmsetup' can
3733 ;; find libdevmapper.so.
3734 (string-append "LDFLAGS=-Wl,-rpath="
3735 (assoc-ref %outputs "out")
3737 (assoc-ref %outputs "out")
3738 "/lib/device-mapper")
3739 ;; This is needed when cross-compiling.
3740 ,@(if (%current-target-system)
3741 '("ac_cv_func_malloc_0_nonnull=yes"
3742 "ac_cv_func_realloc_0_nonnull=yes")
3745 ;; The tests use 'mknod', which requires root access.
3747 (supported-systems (delete "i586-gnu" %supported-systems))
3748 (home-page "https://sourceware.org/lvm2/")
3749 (synopsis "Logical volume management for Linux")
3751 "LVM2 is the logical volume management tool set for Linux-based systems.
3752 This package includes the user-space libraries and tools, including the device
3753 mapper. Kernel components are part of Linux-libre.")
3755 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3756 ;; Command-line tools are GPLv2.
3757 (license (list license:gpl2 license:lgpl2.1))))
3759 (define-public lvm2-static
3762 (name "lvm2-static")
3764 ;; Propagate udev because libdevmapper.a depends on libudev.
3765 (propagated-inputs `(("udev:static" ,eudev "static")))
3768 (substitute-keyword-arguments (package-arguments lvm2)
3769 ((#:configure-flags flags '())
3770 ;; LVM2 doesn't use Libtool, hence the custom option.
3771 `(append '("--enable-static_link")
3772 ;; Building dmeventd statically is complicated due to a
3773 ;; requirement on libdevmapper.a, which is being phased out
3774 ;; in favor of libdevice-mapper.a, which in turn is is not
3775 ;; easily made available at dmeventd build time. Just ignore
3776 ;; it until the situation improves.
3777 (delete "--enable-dmeventd" ,flags)))
3779 `(modify-phases ,phases
3780 (add-before 'configure 'adjust-Makefile
3782 ;; These fixes are related to the upstream libdm->device_mapper
3783 ;; migration and will hopefully be fixed upstream in due time.
3784 (substitute* "tools/Makefile.in"
3785 ;; This variable is empty in a static configuration and causes
3786 ;; an erroneous GCC command line.
3787 (("-L\\$\\(interfacebuilddir\\)") "")
3788 ;; Remove obsolete reference to libdevmapper.a.
3789 (("-ldevmapper") ""))
3791 (synopsis "Logical volume management for Linux (statically linked)")))
3793 (define-public thin-provisioning-tools
3795 (name "thin-provisioning-tools")
3801 (url "https://github.com/jthornber/thin-provisioning-tools")
3802 (commit (string-append "v" version))))
3803 (file-name (git-file-name name version))
3805 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
3806 (build-system gnu-build-system)
3808 ;; Doesn't build with --enable-testing due to a function name collision
3809 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
3812 `(("automake" ,automake)
3813 ("autoreconf" ,autoconf)))
3817 ("libaio" ,libaio)))
3818 (synopsis "Tools for manipulating the metadata of device-mapper targets")
3819 (description "A suite of tools for manipulating the metadata of the
3820 dm-thin, dm-cache and dm-era device-mapper targets.")
3821 (home-page "https://github.com/jthornber/thin-provisioning-tools")
3822 (license license:gpl3+)))
3824 (define-public wireless-tools
3826 (name "wireless-tools")
3830 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3834 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3837 ;; Remove the older header files that are not free software.
3838 (for-each (lambda (n)
3839 (delete-file (format #f "wireless.~a.h" n)))
3840 '(10 11 12 13 14 15 16 17 18 19 20))
3842 (build-system gnu-build-system)
3845 (list (string-append "PREFIX=" %output)
3846 (string-append "INSTALL_MAN=" %output "/share/man")
3847 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3850 (modify-phases %standard-phases
3852 (lambda* (#:key target #:allow-other-keys)
3853 (when ,(%current-target-system)
3854 ;; Cross-compilation: use the cross tools.
3855 (substitute* (find-files "." "Makefile")
3857 (string-append "CC = " target "-gcc\n"))
3859 (string-append "AR = " target "-ar\n"))
3861 (string-append "RANLIB = " target "-ranlib\n"))))
3864 (synopsis "Tools for manipulating Linux Wireless Extensions")
3865 (description "Wireless Tools are used to manipulate the now-deprecated
3866 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3867 Extension was an interface allowing you to set Wireless LAN specific
3868 parameters and get the specific stats. It is deprecated in favor the nl80211
3870 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3871 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3872 ;; other files are distributed under gpl2.
3873 (license (list license:gpl2 license:lgpl2.1+))))
3881 (uri (string-append "mirror://kernel.org/software/network/crda/"
3882 "crda-" version ".tar.xz"))
3885 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3886 (patches (search-patches "crda-optional-gcrypt.patch"))))
3887 (build-system gnu-build-system)
3889 `(#:phases (modify-phases %standard-phases
3891 (add-after 'unpack 'gzip-determinism
3893 (substitute* "Makefile"
3894 (("gzip") "gzip --no-name"))
3896 ,@(if (%current-target-system)
3898 'unpack 'fix-pkg-config
3899 (lambda* (#:key target #:allow-other-keys)
3903 (string-append target "-pkg-config")))
3907 'build 'no-werror-no-ldconfig
3909 (substitute* "Makefile"
3911 (("ldconfig") "true"))
3914 'build 'set-regulator-db-file-name
3915 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3916 ;; Tell CRDA where to find our database.
3917 (let ((regdb (assoc-ref (or native-inputs inputs)
3919 (substitute* "crda.c"
3920 (("\"/lib/crda/regulatory.bin\"")
3921 (string-append "\"" regdb
3922 "/lib/crda/regulatory.bin\"")))
3924 #:test-target "verify"
3925 #:make-flags (let ((out (assoc-ref %outputs "out"))
3926 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3928 (string-append "CC=" ,(cc-for-target))
3931 ;; Disable signature-checking on 'regulatory.bin'.
3932 ;; The reason is that this simplifies maintenance
3933 ;; on our side (no need to manage a distro key
3934 ;; pair), and we can guarantee integrity of
3935 ;; 'regulatory.bin' by other means anyway, such as
3936 ;; 'guix gc --verify'. See
3937 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3941 (string-append "PREFIX=" out)
3942 (string-append "SBINDIR=" out "/sbin/")
3943 (string-append "UDEV_RULE_DIR="
3944 out "/lib/udev/rules.d")
3945 (string-append "LDFLAGS=-Wl,-rpath="
3947 (string-append "REG_BIN=" regdb
3948 "/lib/crda/regulatory.bin")
3950 (native-inputs `(("pkg-config" ,pkg-config)
3951 ("wireless-regdb" ,wireless-regdb)))
3952 (inputs `(("libnl" ,libnl)))
3954 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3955 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3957 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3958 communication between the kernel Linux and user space for regulatory
3960 (license license:copyleft-next)))
3962 (define-public wireless-regdb
3964 (name "wireless-regdb")
3965 (version "2020.11.20")
3969 "mirror://kernel.org/software/network/wireless-regdb/"
3970 "wireless-regdb-" version ".tar.xz"))
3973 "0liagyi6ppf5w474qk9j4jz5gbvvn8mc8al1dq4b1xrgv28485ml"))
3975 ;; We're building 'regulatory.bin' by ourselves.
3977 (delete-file "regulatory.bin")
3979 (build-system gnu-build-system)
3982 (modify-phases %standard-phases
3983 (add-after 'unpack 'gzip-determinism
3985 (substitute* "Makefile"
3986 (("gzip") "gzip --no-name"))
3988 (add-after 'unpack 'omit-signature
3990 (substitute* "Makefile"
3991 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3992 ;; don't provide (see below). Disable it.
3993 ((" regulatory\\.db\\.p7s") "")
3994 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3995 ;; but ‘make install’ depends only on the latter while installing
3996 ;; both (and failing). Depend on it explicitly.
3997 (("^install: " all) (string-append all "regulatory.db ")))
3999 (delete 'configure)) ; no configure script
4001 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
4002 ;; is computed and can be equal to 'maintainer-clean'; when that
4003 ;; happens, we can end up deleting the 'regulatory.bin' file that we
4004 ;; just built. Thus, build things sequentially.
4005 #:parallel-build? #f
4007 #:tests? #f ; no tests
4009 (let ((out (assoc-ref %outputs "out")))
4010 (list (string-append "PREFIX=" out)
4011 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
4013 ;; Leave this empty so that db2bin.py doesn't try to sign
4014 ;; ‘regulatory.bin’. This allows us to avoid managing a key
4015 ;; pair for the whole distribution.
4016 (string-append "REGDB_PRIVKEY=")
4017 ;; Don't generate a public key for the same reason. These are
4018 ;; used as Makefile targets and can't be the empty string.
4019 (string-append "REGDB_PUBCERT=/dev/null")
4020 (string-append "REGDB_PUBKEY=/dev/null")))))
4022 `(("python" ,python-wrapper)))
4024 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
4025 (synopsis "Wireless regulatory database")
4027 "This package contains the wireless regulatory database for the Central
4028 Regulatory Database Agent (CRDA). The database contains information on
4029 country-specific regulations for the wireless spectrum.")
4030 (license license:isc)))
4032 (define-public lm-sensors
4040 (url "https://github.com/groeck/lm-sensors")
4041 (commit (string-append "V" (string-join
4042 (string-split version #\.) "-")))))
4043 (file-name (git-file-name name version))
4045 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
4046 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
4047 (build-system gnu-build-system)
4048 (inputs `(("rrdtool" ,rrdtool)
4051 ("gnuplot" ,gnuplot)))
4052 (native-inputs `(("pkg-config" ,pkg-config)
4056 (outputs '("lib" ; avoid perl in closure
4059 `(#:tests? #f ; no 'check' target
4060 #:make-flags (list (string-append "PREFIX=" %output)
4061 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
4062 (string-append "INCLUDEDIR="
4063 (assoc-ref %outputs "lib") "/include")
4064 (string-append "MANDIR=" %output "/share/man")
4065 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
4067 (modify-phases %standard-phases
4069 (add-before 'build 'patch-exec-paths
4070 (lambda* (#:key inputs outputs #:allow-other-keys)
4071 (substitute* "prog/detect/sensors-detect"
4073 (string-append "`" (assoc-ref inputs "coreutils")
4075 (("(`|\")modprobe" all open-quote)
4076 (string-append open-quote
4077 (assoc-ref inputs "kmod")
4079 (substitute* '("prog/pwm/pwmconfig"
4080 "prog/pwm/fancontrol")
4082 (string-append (assoc-ref inputs "gnuplot")
4085 (string-append (assoc-ref inputs "coreutils")
4088 (string-append (assoc-ref inputs "grep")
4091 (string-append (assoc-ref inputs "sed")
4094 (string-append (assoc-ref inputs "coreutils")
4097 (string-append (assoc-ref inputs "coreutils")
4100 (string-append (assoc-ref inputs "coreutils")
4101 "/bin/readlink -f")))
4103 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
4104 (synopsis "Utilities to read temperature/voltage/fan sensors")
4106 "Lm-sensors is a hardware health monitoring package for Linux. It allows
4107 you to access information from temperature, voltage, and fan speed sensors.
4108 It works with most newer systems.")
4109 (license license:gpl2+)))
4111 (define-public iucode-tool
4113 (name "iucode-tool")
4117 (uri (string-append "https://gitlab.com/iucode-tool/releases"
4118 "/raw/latest/iucode-tool_" version ".tar.xz"))
4121 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
4122 (build-system gnu-build-system)
4123 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
4124 (synopsis "Manipulate Intel microcode bundles")
4126 "@command{iucode_tool} is a utility to work with microcode packages for
4127 Intel processors. It can convert between formats, extract specific versions,
4128 create a firmware image suitable for the Linux kernel, and more.")
4129 ;; cpuid.h is available for i686, x86_64, and ia64.
4130 (supported-systems '("i686-linux" "x86_64-linux"))
4131 (license license:gpl2+)))
4133 (define-public i2c-tools
4140 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
4141 version ".tar.bz2"))
4144 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
4145 (build-system gnu-build-system)
4147 `(#:tests? #f ; no 'check' target
4148 #:make-flags (list (string-append "prefix=" %output)
4149 ,(string-append "CC=" (cc-for-target)))
4150 ;; No configure script.
4151 #:phases (modify-phases %standard-phases (delete 'configure))))
4154 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
4155 (synopsis "I2C tools for Linux")
4157 "The i2c-tools package contains a heterogeneous set of I2C tools for
4158 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
4159 EEPROM decoding scripts, EEPROM programming tools, and a python module for
4161 (license license:gpl2+)))
4163 (define-public xsensors
4170 "http://www.linuxhardware.org/xsensors/xsensors-"
4174 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
4175 (build-system gnu-build-system)
4176 (inputs `(("lm-sensors" ,lm-sensors "lib")
4178 (native-inputs `(("pkg-config" ,pkg-config)))
4181 (modify-phases %standard-phases
4182 (add-before 'configure 'enable-deprecated
4184 (substitute* "src/Makefile.in"
4185 (("-DGDK_DISABLE_DEPRECATED") "")
4186 (("-DGTK_DISABLE_DEPRECATED") ""))
4188 (add-before 'configure 'remove-Werror
4190 (substitute* '("configure" "src/Makefile.in")
4193 (home-page "http://www.linuxhardware.org/xsensors/")
4194 (synopsis "Hardware health information viewer")
4196 "Xsensors reads data from the libsensors library regarding hardware
4197 health such as temperature, voltage and fan speed and displays the information
4198 in a digital read-out.")
4199 (license license:gpl2+)))
4204 (version (package-version linux-libre))
4205 (source (package-source linux-libre))
4206 (build-system gnu-build-system)
4209 (modify-phases %standard-phases
4211 (lambda* (#:key inputs #:allow-other-keys)
4212 (setenv "SHELL_PATH" (which "bash"))
4213 (chdir "tools/perf")
4215 #:make-flags (list (string-append "prefix="
4216 (assoc-ref %outputs "out"))
4220 ;; By default, 'config/Makefile' uses lib64 on
4221 ;; x86_64. Work around that.
4223 #:tests? #f)) ;no tests
4225 `(("pkg-config" ,pkg-config)
4229 ;; There are build scripts written in these languages.
4231 ("python2" ,python-2)
4232 ("python3" ,python-3)))
4234 `(("slang" ,slang) ;for the interactive TUI
4236 ("python" ,python-2) ;'perf' links against libpython
4237 ("elfutils" ,elfutils)
4238 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
4239 ("libunwind" ,libunwind) ;better stack walking
4240 ("numactl" ,numactl) ;for 'perf bench numa mem'
4243 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
4244 ("docbook-xsl" ,docbook-xsl)
4246 ("asciidoc" ,asciidoc)))
4247 (home-page "https://perf.wiki.kernel.org/")
4248 (synopsis "Linux profiling with performance counters")
4250 "perf is a tool suite for profiling using hardware performance counters,
4251 with support in the Linux kernel. perf can instrument CPU performance
4252 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
4253 of lightweight profiling. This package contains the user-land tools and in
4254 particular the @code{perf} command.")
4255 (license (package-license linux-libre))))
4257 (define-public pflask
4264 (url "https://github.com/ghedo/pflask")
4265 (commit (string-append "v" version))))
4266 (file-name (git-file-name name version))
4269 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
4270 (build-system cmake-build-system)
4272 '(#:tests? #f)) ; no tests
4273 (home-page "https://ghedo.github.io/pflask/")
4274 (synopsis "Simple tool for creating Linux namespace containers")
4275 (description "pflask is a simple tool for creating Linux namespace
4276 containers. It can be used for running a command or even booting an OS inside
4277 an isolated container, created with the help of Linux namespaces. It is
4278 similar in functionality to chroot, although pflask provides better isolation
4279 thanks to the use of namespaces.")
4280 (license license:bsd-2)))
4282 (define-public singularity
4284 (name "singularity")
4288 (uri (string-append "https://github.com/singularityware/singularity/"
4289 "releases/download/" version
4290 "/singularity-" version ".tar.gz"))
4293 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
4294 (modules '((guix build utils)))
4297 ;; Do not create directories in /var.
4298 (substitute* "Makefile.in"
4299 (("\\$\\(MAKE\\) .*install-data-hook") ""))
4301 ;; The original source overrides PATH so that it points to
4302 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
4303 ;; on Guix System. Leave PATH unchanged so we refer to the
4304 ;; installed Coreutils, grep, etc.
4305 (substitute* "bin/singularity.in"
4307 (string-append "#" all "\n")))
4309 (substitute* (find-files "libexec/cli" "\\.exec$")
4310 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
4312 (string-append "/run/setuid-programs/singularity-"
4313 program "-helper")))
4315 ;; These squashfs mount options are apparently no longer
4316 ;; supported since Linux-libre 5.4.5.
4317 (substitute* "src/lib/image/squashfs/mount.c"
4318 (("\"errors=remount-ro\"")
4321 (build-system gnu-build-system)
4323 `(#:configure-flags '("--localstatedir=/var")
4325 (modify-phases %standard-phases
4326 (add-after 'unpack 'patch-references
4328 (substitute* "libexec/cli/build.exec.in"
4329 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
4330 (substitute* (append
4331 (find-files "libexec" "functions")
4332 (find-files "libexec/bootstrap-scripts" ".*sh$")
4333 (find-files "libexec/cli" ".*exec$"))
4335 (string-append "| " (which "grep") " "))
4337 (string-append (which "egrep") " "))
4339 (string-append " " (which "sed") " ")))
4341 (add-after 'install 'set-PATH
4342 (lambda* (#:key inputs outputs #:allow-other-keys)
4343 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
4344 (let ((out (assoc-ref outputs "out"))
4345 (coreutils (assoc-ref inputs "coreutils")))
4346 (wrap-program (string-append out "/bin/singularity")
4347 `("PATH" ":" = (,(string-append coreutils "/bin"))))
4348 (substitute* (string-append out "/bin/run-singularity")
4349 (("/usr/bin/env singularity")
4350 (string-append (which "env") " "
4351 out "/bin/singularity")))
4354 `(("libarchive" ,libarchive)
4355 ("python" ,python-wrapper)
4357 ("squashfs-tools" ,squashfs-tools)))
4358 (home-page "https://singularity.lbl.gov/")
4359 (synopsis "Container platform")
4360 (description "Singularity is a container platform supporting a number of
4361 container image formats. It can build SquashFS container images or import
4362 existing Docker images. Singularity requires kernel support for container
4363 isolation or root privileges.")
4364 (license license:bsd-3)))
4366 (define-public hdparm
4372 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
4373 "hdparm-" version ".tar.gz"))
4376 "0zvppv8qw0y1shlhn34iq1g4883i1cywsa514n595nmyrmsrs3rc"))))
4377 (build-system gnu-build-system)
4380 (let ((out (assoc-ref %outputs "out")))
4381 (list (string-append "binprefix=" out)
4382 (string-append "manprefix=" out)
4383 ,(string-append "CC=" (cc-for-target))
4384 ;; Let Guix strip the binaries and not break cross-compilation.
4387 (modify-phases %standard-phases
4388 (delete 'configure)) ; no configure script
4389 #:tests? #f)) ; no test suite
4390 (home-page "https://sourceforge.net/projects/hdparm/")
4391 (synopsis "View and tune ATA disk drive parameters")
4393 "@command{hdparm} is a command-line utility to control ATA controllers and
4394 disk drives. It can increase performance and/or reliability by careful tuning
4395 of hardware settings like power and acoustic management, DMA modes, and caching.
4396 It can also display detailed device information, or be used as a simple
4397 performance benchmarking tool.
4399 @command{hdparm} provides a command line interface to various Linux kernel
4400 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
4401 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4402 Translation (@dfn{SAT}) are also supported.")
4403 (license (license:non-copyleft "file://LICENSE.TXT"))))
4405 (define-public nvme-cli
4409 (home-page "https://github.com/linux-nvme/nvme-cli")
4414 (commit (string-append "v" version))))
4416 (base32 "0dpadz945482srqpsbfx1bh7rc499fgpyzz1flhk9g9xjbpapkzc"))
4417 (file-name (git-file-name name version))))
4418 (build-system gnu-build-system)
4421 (list ,(string-append "CC=" (cc-for-target)))
4422 #:phases (modify-phases %standard-phases
4423 (delete 'configure) ; no ./configure script
4426 (invoke "make" "install-spec" "PREFIX="
4427 (string-append "DESTDIR=" %output)))))
4428 ;; The tests require sysfs, which is not accessible from from the build
4431 (synopsis "NVM-Express user space tooling for Linux")
4432 (description "Nvme-cli is a utility to provide standards compliant tooling
4433 for NVM-Express drives. It was made specifically for Linux as it relies on the
4434 IOCTLs defined by the mainline kernel driver.")
4435 (license license:gpl2+)))
4437 (define-public rfkill
4443 (uri (string-append "mirror://kernel.org/software/network/"
4444 name "/" name "-" version ".tar.xz"))
4447 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4448 (build-system gnu-build-system)
4450 `(#:make-flags (list "CC=gcc"
4451 (string-append "PREFIX=" %output))
4452 #:phases (modify-phases %standard-phases
4453 (delete 'configure))
4455 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4456 (synopsis "Tool for enabling and disabling wireless devices")
4458 "rfkill is a simple tool for accessing the rfkill device interface,
4459 which is used to enable and disable wireless networking devices, typically
4460 WLAN, Bluetooth and mobile broadband.")
4461 (license (license:non-copyleft "file://COPYING"
4462 "See COPYING in the distribution."))
4463 ;; rfkill is part of util-linux as of 2.31.
4464 (properties `((superseded . ,util-linux)))))
4472 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4473 version "/" name "-" version ".tar.gz"))
4476 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4477 (build-system gnu-build-system)
4478 (home-page "http://acpiclient.sourceforge.net")
4479 (synopsis "Display information on ACPI devices")
4480 (description "@code{acpi} attempts to replicate the functionality of the
4481 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4482 information. It does not support ACPI suspending, only displays information
4483 about ACPI devices.")
4484 (license license:gpl2+)))
4486 (define-public acpid
4492 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4496 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4497 (build-system gnu-build-system)
4498 (home-page "https://sourceforge.net/projects/acpid2/")
4499 (synopsis "Daemon for delivering ACPI events to user-space programs")
4501 "acpid is designed to notify user-space programs of Advanced
4502 Configuration and Power Interface (ACPI) events. acpid should be started
4503 during the system boot, and will run as a background process. When an ACPI
4504 event is received from the kernel, acpid will examine the list of rules
4505 specified in /etc/acpi/events and execute the rules that match the event.")
4506 (license license:gpl2+)))
4508 (define-public sysfsutils
4517 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4520 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4521 (build-system gnu-build-system)
4522 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4523 (synopsis "System utilities based on Linux sysfs")
4525 "These are a set of utilities built upon sysfs, a virtual file system in
4526 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4527 also contains the libsysfs library.")
4528 ;; The library is under lgpl2.1+ (all files say "or any later version").
4529 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4530 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4532 (define-public sysfsutils-1
4534 (inherit sysfsutils)
4541 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4542 "/sysfsutils-" version ".tar.gz"))
4544 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4545 (modules '((guix build utils)))
4548 (substitute* "Makefile.in"
4549 (("includedir = /usr/include/sysfs")
4550 "includedir = @includedir@"))
4551 (substitute* "configure"
4552 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4553 (string-append "includedir='" orig "/sysfs'")))
4555 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4557 (define-public cpufrequtils
4559 (name "cpufrequtils")
4564 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4565 "cpufrequtils-" version ".tar.gz"))
4567 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4568 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4569 (build-system gnu-build-system)
4571 `(("sysfsutils" ,sysfsutils-1)))
4573 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4574 (assoc-ref %outputs "out") "/lib"))))
4575 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4576 (synopsis "Utilities to get and set CPU frequency on Linux")
4578 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4579 information, and set the CPU frequency if supported, using the cpufreq
4580 capabilities of the Linux kernel.")
4581 (license license:gpl2)))
4583 (define-public libraw1394
4590 "mirror://kernel.org/linux/libs/ieee1394/"
4591 name "-" version ".tar.xz"))
4594 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4595 (build-system gnu-build-system)
4596 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4597 (synopsis "Interface library for the Linux IEEE1394 drivers")
4599 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4600 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4601 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4602 send to and receive from other nodes without requiring a kernel driver for the
4603 protocol in question.")
4604 (license license:lgpl2.1+)))
4606 (define-public libavc1394
4612 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4613 name "-" version ".tar.gz"))
4616 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4617 (build-system gnu-build-system)
4619 `(("pkg-config" ,pkg-config)))
4621 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4622 (home-page "https://sourceforge.net/projects/libavc1394/")
4623 (synopsis "AV/C protocol library for IEEE 1394")
4625 "Libavc1394 is a programming interface to the AV/C specification from
4626 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4627 (license license:lgpl2.1+)))
4629 (define-public libiec61883
4631 (name "libiec61883")
4636 "mirror://kernel.org/linux/libs/ieee1394/"
4637 name "-" version ".tar.xz"))
4640 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4641 (build-system gnu-build-system)
4643 `(("pkg-config" ,pkg-config)))
4645 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4646 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4647 (synopsis "Isochronous streaming media library for IEEE 1394")
4649 "The libiec61883 library provides a higher level API for streaming DV,
4650 MPEG-2 and audio over Linux IEEE 1394.")
4651 (license license:lgpl2.1+)))
4653 (define-public mdadm
4660 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4664 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4665 (build-system gnu-build-system)
4669 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4670 (list ,(string-append "CC=" (cc-for-target))
4673 ;; TODO: tell it where to find 'sendmail'
4674 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4675 (string-append "BINDIR=" out "/sbin")
4676 (string-append "MANDIR=" out "/share/man")
4677 (string-append "UDEVDIR=" out "/lib/udev")))
4679 (modify-phases %standard-phases
4680 (add-before 'build 'patch-program-paths
4681 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4682 (let ((coreutils (assoc-ref (or native-inputs inputs)
4684 (substitute* "udev-md-raid-arrays.rules"
4685 (("/usr/bin/(readlink|basename)" all program)
4686 (string-append coreutils "/bin/" program))))
4688 (add-before 'build 'remove-W-error
4690 ;; We cannot build with -Werror on i686 due to a
4691 ;; 'sign-compare' warning in util.c.
4692 (substitute* "Makefile"
4695 (delete 'configure))
4696 ;;tests must be done as root
4698 (supported-systems (delete "i586-gnu" %supported-systems))
4699 (home-page "http://neil.brown.name/blog/mdadm")
4700 (synopsis "Tool for managing Linux Software RAID arrays")
4702 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4703 assemble, report on, and monitor arrays. It can also move spares between raid
4704 arrays when needed.")
4705 (license license:gpl2+)))
4707 (define-public mdadm-static
4710 (name "mdadm-static")
4712 (substitute-keyword-arguments (package-arguments mdadm)
4713 ((#:make-flags flags)
4714 `(cons "LDFLAGS = -static" ,flags))
4716 `(modify-phases ,phases
4717 (add-after 'install 'remove-cruft
4718 (lambda* (#:key outputs #:allow-other-keys)
4719 (let* ((out (assoc-ref outputs "out"))
4720 (precious? (lambda (file)
4721 (member file '("." ".." "sbin"))))
4722 (directories (scandir out (negate precious?))))
4723 (with-directory-excursion out
4724 (for-each delete-file-recursively directories)
4725 (remove-store-references "sbin/mdadm")
4726 (delete-file "sbin/mdmon")
4728 ((#:modules modules %gnu-build-system-modules)
4729 `((ice-9 ftw) ,@modules))
4730 ((#:strip-flags _ '())
4731 ''("--strip-all")) ;strip a few extra KiB
4732 ((#:allowed-references _ '("out"))
4733 '("out")))) ;refer only self
4734 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4736 (define-public multipath-tools
4738 (name "multipath-tools")
4743 (url "https://git.opensvc.com/multipath-tools/.git")
4745 (file-name (git-file-name name version))
4748 "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg"))
4749 (modules '((guix build utils)))
4752 ;; Drop bundled valgrind headers.
4753 (delete-file-recursively "third-party")
4754 (substitute* '("multipathd/main.c"
4755 "libmultipath/debug.c")
4756 (("#include \"../third-party/")
4759 (build-system gnu-build-system)
4761 '(#:test-target "test"
4762 #:parallel-build? #f ;XXX: broken in 0.8.4
4763 #:make-flags (list "CC=gcc"
4764 (string-append "DESTDIR="
4765 (assoc-ref %outputs "out"))
4766 ;; Install Udev rules below this directory, relative
4769 (string-append "LDFLAGS=-Wl,-rpath="
4770 (assoc-ref %outputs "out")
4773 (modify-phases %standard-phases
4774 (add-after 'unpack 'patch-source
4775 (lambda* (#:key inputs #:allow-other-keys)
4776 (let ((lvm2 (assoc-ref inputs "lvm2"))
4777 (udev (assoc-ref inputs "udev")))
4778 (substitute* "Makefile.inc"
4779 (("\\$\\(prefix\\)/usr") "$(prefix)")
4780 ;; Do not save timestamp to avoid gzip "timestamp
4781 ;; out-of-range" warnings.
4782 (("gzip -9") "gzip -9n"))
4783 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4784 (("/usr/include/libdevmapper.h")
4785 (string-append lvm2 "/include/libdevmapper.h"))
4786 (("/usr/include/libudev.h")
4787 (string-append udev "/include/libudev.h")))
4789 (add-after 'unpack 'fix-maybe-uninitialized-variable
4791 ;; This variable gets initialized later if needed, but GCC 7
4792 ;; fails to notice. Should be fixed for > 0.8.4.
4793 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4794 (substitute* "libmultipath/structs_vec.c"
4795 (("bool is_queueing;")
4796 "bool is_queueing = false;"))
4798 (add-after 'unpack 'fix-linking-tests
4800 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4801 ;; for versions > 0.8.4.
4802 (substitute* "tests/Makefile"
4803 (("-lmultipath -lcmocka")
4804 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4806 (add-after 'unpack 'skip-failing-tests
4808 ;; This test and the module's setup() test an arbitrary block
4809 ;; device node name, but the build environment has none.
4810 (substitute* "tests/devt.c"
4811 (("return get_one_devt.*") "return 0;\n")
4812 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
4813 ;; The above triggers -Werror=unused-function. Ignore it.
4814 (substitute* "tests/Makefile"
4815 (("CFLAGS \\+= " match)
4816 (string-append match "-Wno-error=unused-function ")))
4818 (delete 'configure)))) ; no configure script
4821 ("pkg-config" ,pkg-config)
4822 ("valgrind" ,valgrind)
4825 ("cmocka" ,cmocka)))
4827 `(("json-c" ,json-c)
4829 ("liburcu" ,liburcu)
4831 ("readline" ,readline)
4833 (home-page "http://christophe.varoqui.free.fr/")
4834 (synopsis "Access block devices through multiple paths")
4836 "This package provides the following binaries to drive the
4837 Linux Device Mapper multipathing driver:
4839 @item @command{multipath} - Device mapper target autoconfig.
4840 @item @command{multipathd} - Multipath daemon.
4841 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4842 @code{dm} multipath devices.
4843 @item @command{kpartx} - Create device maps from partition tables.
4845 (license (list license:gpl2+ ; main distribution
4846 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4848 (define-public libaio
4855 (string-append "https://releases.pagure.org/libaio/"
4856 name "-" version ".tar.gz")))
4859 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4860 (build-system gnu-build-system)
4863 (let ((target ,(%current-target-system)))
4864 (list (string-append "prefix=" %output)
4867 (string-append (assoc-ref %build-inputs "cross-gcc")
4868 "/bin/" target "-gcc")
4870 #:test-target "partcheck" ; need root for a full 'check'
4872 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4873 (home-page "https://pagure.io/libaio")
4874 (synopsis "Linux-native asynchronous I/O access library")
4876 "This library enables userspace to use Linux kernel asynchronous I/O
4877 system calls, important for the performance of databases and other advanced
4879 (license license:lgpl2.1+)))
4881 (define-public blktrace
4882 ;; Take a newer commit to get the fix for CVE-2018-10689.
4883 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4887 (version (git-version "1.2.0" revision commit))
4889 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4896 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4897 (file-name (git-file-name name version))))
4898 (build-system gnu-build-system)
4901 (list ,(string-append "CC=" (cc-for-target))
4902 (string-append "prefix=" %output))
4903 #:tests? #f ; no tests
4905 (modify-phases %standard-phases
4906 (delete 'configure) ; no configure script
4907 (add-after 'unpack 'fix-gnuplot-path
4908 (lambda* (#:key inputs #:allow-other-keys)
4909 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4910 (substitute* "btt/bno_plot.py"
4912 (string-append gnuplot "/bin/gnuplot %s")))
4915 `(("libaio" ,libaio)
4916 ("gnuplot" ,gnuplot)
4917 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4918 (synopsis "Block layer IO tracing mechanism")
4919 (description "Blktrace is a block layer IO tracing mechanism which provides
4920 detailed information about request queue operations to user space. It extracts
4921 event traces from the kernel (via the relaying through the debug file system).")
4922 (license license:gpl2))))
4930 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4932 (patches (search-patches "sbc-fix-build-non-x86.patch"))
4935 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
4936 (build-system gnu-build-system)
4938 `(("libsndfile" ,libsndfile)))
4940 `(("pkg-config" ,pkg-config)))
4941 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4942 (synopsis "Bluetooth subband audio codec")
4944 "The SBC is a digital audio encoder and decoder used to transfer data to
4945 Bluetooth audio output devices like headphones or loudspeakers.")
4946 (license license:gpl2+)))
4948 (define-public bluez
4955 "mirror://kernel.org/linux/bluetooth/bluez-"
4959 "124v9s4y1s7s6klx5vlmzpk1jlr4x84ch7r7scm7x2f42dqp2qw8"))))
4960 (build-system gnu-build-system)
4963 (let ((out (assoc-ref %outputs "out")))
4964 (list "--sysconfdir=/etc"
4965 "--localstatedir=/var"
4968 ;; TODO: is this needed? Not installed by default since 5.55.
4970 ;; Install dbus/udev files to the correct location.
4971 (string-append "--with-dbusconfdir=" out "/etc")
4972 (string-append "--with-udevdir=" out "/lib/udev")))
4974 (modify-phases %standard-phases
4975 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4976 ;; issue (discussion on upstream mailing list:
4977 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4978 (add-before 'check 'skip-wonky-test
4980 (substitute* "unit/test-gatt.c"
4981 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4983 (add-after 'install 'post-install
4984 (lambda* (#:key inputs outputs #:allow-other-keys)
4985 (let* ((out (assoc-ref outputs "out"))
4986 (servicedir (string-append out "/share/dbus-1/services"))
4987 (service "obexd/src/org.bluez.obex.service")
4988 (rule (string-append
4989 out "/lib/udev/rules.d/97-hid2hci.rules")))
4990 ;; Install the obex dbus service file.
4991 (substitute* service
4993 (string-append out "/libexec/bluetooth/obexd")))
4994 (install-file service servicedir)
4995 ;; Fix paths in the udev rule.
4997 (("hid2hci --method")
4998 (string-append out "/lib/udev/hid2hci --method"))
5000 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
5003 `(("pkg-config" ,pkg-config)
5004 ("gettext" ,gettext-minimal)))
5009 ("libical" ,libical)
5010 ("readline" ,readline)))
5011 (home-page "http://www.bluez.org/")
5012 (synopsis "Linux Bluetooth protocol stack")
5014 "BlueZ provides support for the core Bluetooth layers and protocols. It
5015 is flexible, efficient and uses a modular implementation.")
5016 (license license:gpl2+)))
5018 (define-public fuse-exfat
5025 "https://github.com/relan/exfat/releases/download/v"
5026 version "/" name "-" version ".tar.gz"))
5029 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
5030 (build-system gnu-build-system)
5032 `(("pkg-config" ,pkg-config)))
5035 (home-page "https://github.com/relan/exfat")
5036 (synopsis "Mount exFAT file systems")
5038 "This package provides a FUSE-based file system that provides read and
5039 write access to exFAT devices.")
5040 (license license:gpl2+)))
5042 (define-public fuseiso
5045 (version "20070708")
5048 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
5049 version "/fuseiso-" version ".tar.bz2"))
5052 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
5053 (build-system gnu-build-system)
5055 `(("pkg-config" ,pkg-config)))
5060 (home-page "https://sourceforge.net/projects/fuseiso/")
5061 (synopsis "Mount ISO file system images")
5063 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
5064 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
5065 Ridge, Joliet, and zisofs.")
5066 (license license:gpl2)))
5075 "https://www.nico.schottelius.org/software/gpm/archives/"
5076 "gpm-" version ".tar.bz2"))
5077 (patches (search-patches "gpm-glibc-2.26.patch"))
5080 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
5081 (build-system gnu-build-system)
5083 '(#:phases (modify-phases %standard-phases
5086 ;; The tarball was not generated with 'make dist' so we
5087 ;; need to bootstrap things ourselves.
5088 (substitute* "autogen.sh"
5089 (("/bin/sh") (which "sh")))
5090 (invoke "./autogen.sh")
5091 (patch-makefile-SHELL "Makefile.include.in")
5094 ;; Make sure programs find libgpm.so.
5095 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
5096 (assoc-ref %outputs "out")
5099 `(("texinfo" ,texinfo)
5102 ("autoconf" ,autoconf)
5103 ("automake" ,automake)
5104 ("libtool" ,libtool)))
5105 (home-page "https://www.nico.schottelius.org/software/gpm/")
5106 (synopsis "Mouse support for the Linux console")
5108 "The GPM (general-purpose mouse) daemon is a mouse server for
5109 applications running on the Linux console. It allows users to select items
5110 and copy/paste text in the console and in xterm.")
5111 (license license:gpl2+)))
5113 (define-public btrfs-progs
5115 (name "btrfs-progs")
5119 (uri (string-append "mirror://kernel.org/linux/kernel/"
5120 "people/kdave/btrfs-progs/"
5121 "btrfs-progs-v" version ".tar.xz"))
5124 "0n9p8zaz4nrkgc20cp6zj7gp4ib4hd4lbyph74f4pysllkz4c24m"))))
5125 (build-system gnu-build-system)
5127 "static")) ; static versions of the binaries in "out"
5129 '(#:phases (modify-phases %standard-phases
5130 (add-after 'unpack 'patch-makefile
5131 (lambda* (#:key outputs #:allow-other-keys)
5132 (substitute* "Makefile"
5133 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
5134 (string-append (assoc-ref outputs "out")
5135 "/lib/udev/rules.d")))
5137 (add-after 'build 'build-static
5138 (lambda _ (invoke "make" "static")))
5139 (add-after 'install 'install-bash-completion
5140 (lambda* (#:key outputs #:allow-other-keys)
5141 (let* ((out (assoc-ref outputs "out"))
5142 (bashcomp (string-append out "/etc/bash_completion.d")))
5144 (copy-file "btrfs-completion"
5145 (string-append bashcomp "/btrfs"))
5147 (add-after 'install 'install-static
5148 (let ((staticbin (string-append (assoc-ref %outputs "static")
5152 (string-append "bindir=" staticbin)
5153 "install-static")))))
5154 #:tests? #f ; XXX: require the 'btrfs' kernel module.
5155 #:test-target "test"
5156 #:parallel-tests? #f)) ; tests fail when run in parallel
5157 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
5159 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
5160 ("util-linux:static" ,util-linux "static") ;ditto
5162 ("zlib:static" ,zlib "static")
5163 ("zstd" ,zstd "lib")
5164 ("zstd:static" ,zstd "static")))
5165 (native-inputs `(("pkg-config" ,pkg-config)
5166 ("asciidoc" ,asciidoc)
5169 ;; Remove this input entirely when the default headers
5170 ;; version provides blk_zone.capacity (>= 5.9).
5171 ("linux-libre-headers" ,linux-libre-headers-5.10)
5172 ;; For building documentation.
5173 ("libxml2" ,libxml2)
5174 ("docbook-xsl" ,docbook-xsl)
5180 ;; The tests need 'grep' with perl regexp support.
5182 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
5183 (synopsis "Create and manage btrfs copy-on-write file systems")
5184 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
5185 aimed at implementing advanced features while focusing on fault tolerance,
5186 repair and easy administration.")
5187 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
5188 ;; GPL2: Everything else.
5189 (license (list license:gpl2 license:gpl2+))))
5191 (define-public btrfs-progs/static
5193 (name "btrfs-progs-static")
5194 (version (package-version btrfs-progs))
5196 (build-system trivial-build-system)
5198 `(("btrfs-progs:static" ,btrfs-progs "static")))
5200 `(#:modules ((guix build utils))
5203 (use-modules (guix build utils)
5207 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
5208 (out (assoc-ref %outputs "out"))
5209 (source (string-append btrfs "/bin/btrfs.static"))
5210 (target (string-append out "/bin/btrfs")))
5211 (mkdir-p (dirname target))
5212 (copy-file source target)
5213 (remove-store-references target)
5214 (chmod target #o555)
5216 (home-page (package-home-page btrfs-progs))
5217 (synopsis "Statically-linked btrfs command from btrfs-progs")
5218 (description "This package provides the statically-linked @command{btrfs}
5219 from the btrfs-progs package. It is meant to be used in initrds.")
5220 (license (package-license btrfs-progs))))
5222 (define-public cramfs-tools
5224 (name "cramfs-tools")
5225 (home-page "https://github.com/npitre/cramfs-tools")
5231 (commit (string-append "v" version))))
5233 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
5234 (file-name (git-file-name name version))))
5235 (build-system gnu-build-system)
5237 '(#:tests? #f ; No tests.
5239 (modify-phases %standard-phases
5242 (lambda* (#:key outputs #:allow-other-keys)
5243 (let ((out (assoc-ref outputs "out")))
5244 (install-file "mkcramfs" (string-append out "/sbin"))
5245 (install-file "cramfsck" (string-append out "/sbin")))
5249 (synopsis "Tools to manage Cramfs file systems")
5250 (description "Cramfs is a Linux file system designed to be simple, small,
5251 and to compress things well. It is used on a number of embedded systems and
5252 small devices. This version has additional features such as uncompressed
5253 blocks and random block placement.")
5254 (license license:gpl2+)))
5256 (define-public compsize
5260 (home-page "https://github.com/kilobyte/compsize")
5265 (commit (string-append "v" version))))
5267 (base32 "0vqnrwgpv6pc1yjl0g4gl71xyl6v0xl3pyqjanjpwps73c53azir"))
5268 (file-name (git-file-name name version))))
5269 (build-system gnu-build-system)
5271 `(("btrfs-progs" ,btrfs-progs)))
5273 `(#:tests? #f ; No tests.
5275 (list (string-append "CC=" ,(cc-for-target)))
5277 (modify-phases %standard-phases
5280 (lambda* (#:key outputs #:allow-other-keys)
5281 (let ((out (assoc-ref outputs "out")))
5282 (install-file "compsize" (string-append out "/bin"))
5283 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
5284 (synopsis "Find compression type/ratio on Btrfs files")
5285 (description "@command{compsize} takes a list of files (given as
5286 arguments) on a Btrfs file system and measures used compression types and
5287 effective compression ratio, producing a report.
5289 A directory has no extents but has a (recursive) list of files. A non-regular
5290 file is silently ignored.
5292 As it makes no sense to talk about compression ratio of a partial extent,
5293 every referenced extent is counted whole, exactly once -- no matter if you use
5294 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
5295 uncompressed size will not match the number given by @command{tar} or
5296 @command{du}. On the other hand, the space used should be accurate (although
5297 obviously it can be shared with files outside our set).")
5298 (license license:gpl2+)))
5300 (define-public f2fs-tools-1.7
5307 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5308 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5311 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
5313 (build-system gnu-build-system)
5316 (modify-phases %standard-phases
5317 (add-after 'install 'install-headers
5318 (lambda* (#:key outputs #:allow-other-keys)
5319 (let* ((out (assoc-ref outputs "out"))
5320 (out-include (string-append out "/include")))
5321 (install-file "include/f2fs_fs.h" out-include)
5322 (install-file "mkfs/f2fs_format_utils.h" out-include)
5325 `(("autoconf" ,autoconf)
5326 ("automake" ,automake)
5327 ("libtool" ,libtool)
5328 ("pkg-config" ,pkg-config)))
5330 `(("libuuid" ,util-linux "lib")
5331 ("libselinux" ,libselinux)))
5332 (home-page "https://f2fs.wiki.kernel.org/")
5333 (synopsis "Userland tools for f2fs")
5335 "F2FS, the Flash-Friendly File System, is a modern file system
5336 designed to be fast and durable on flash devices such as solid-state
5337 disks and SD cards. This package provides the userland utilities.")
5338 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
5339 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
5340 (license (list license:gpl2 license:lgpl2.1))))
5342 (define-public f2fs-tools
5344 (inherit f2fs-tools-1.7)
5350 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5351 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5354 "1lab1446c78xsjwhpki7s85z4171m8p9279c8yhm4882wba674k1"))))
5356 `(("libuuid" ,util-linux "lib")))))
5358 (define-public f2fs-tools/static
5361 (inherit f2fs-tools)
5362 (name "f2fs-tools-static")
5365 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
5366 (libuuid (assoc-ref %build-inputs "libuuid")))
5368 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
5369 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
5370 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
5371 "-I" libuuid "/include/blkid")
5372 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
5373 #:disallowed-references (,util-linux)
5375 (modify-phases %standard-phases ; TODO: f2fs phases.
5376 (add-after 'unpack 'make-static
5378 (define (append-to-file name body)
5379 (let ((file (open-file name "a")))
5382 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
5383 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
5384 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
5386 (add-after 'install 'remove-store-references
5387 (lambda* (#:key outputs #:allow-other-keys)
5388 ;; Work around bug in our util-linux.
5389 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
5390 (remove-store-references (string-append (assoc-ref outputs "out")
5394 `(("libuuid:static" ,util-linux "static")
5395 ("libuuid" ,util-linux "lib")))))) ; for include files
5397 (define-public f2fs-fsck/static
5399 (name "f2fs-fsck-static")
5400 (version (package-version f2fs-tools/static))
5402 (build-system trivial-build-system)
5404 `(#:modules ((guix build utils))
5407 (use-modules (guix build utils)
5410 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
5412 (out (assoc-ref %outputs "out"))
5413 (sbin (string-append out "/sbin")))
5415 (with-directory-excursion sbin
5416 (install-file (string-append f2fs-tools "/sbin/" fsck)
5418 (remove-store-references fsck)
5422 `(("f2fs-tools-static" ,f2fs-tools/static)))
5423 (home-page (package-home-page f2fs-tools/static))
5424 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5425 (description "This package provides statically-linked fsck.f2fs command taken
5426 from the f2fs-tools package. It is meant to be used in initrds.")
5427 (license (package-license f2fs-tools/static))))
5429 (define-public freefall
5432 (version (package-version linux-libre))
5433 (source (package-source linux-libre))
5434 (build-system gnu-build-system)
5436 '(#:phases (modify-phases %standard-phases
5437 (add-after 'unpack 'enter-subdirectory
5439 (chdir "tools/laptop/freefall")
5442 (add-before 'build 'increase-timeout
5444 ;; The default of 2 seconds is too low: it assumes an
5445 ;; open lid and AC power without actually checking.
5446 (substitute* "freefall.c"
5447 (("alarm\\(2\\)") "alarm(5)"))
5449 #:make-flags (list (string-append "PREFIX="
5450 (assoc-ref %outputs "out"))
5452 #:tests? #f)) ;no tests
5453 (home-page (package-home-page linux-libre))
5454 (synopsis "Free-fall protection for spinning laptop hard drives")
5456 "Prevents shock damage to the internal spinning hard drive(s) of some
5457 HP and Dell laptops. When sudden movement is detected, all input/output
5458 operations on the drive are suspended and its heads are parked on the ramp,
5459 where they are less likely to cause damage to the spinning disc. Requires a
5460 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5461 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5462 (license license:gpl2)))
5464 (define-public thinkfan
5472 (url "https://github.com/vmatare/thinkfan")
5474 (file-name (git-file-name name version))
5476 (base32 "18vgm5w5pjnpipa34j4x87q10695w2jnqwvc2f027afy7mnzw7kz"))))
5477 (build-system cmake-build-system)
5479 `(#:modules ((guix build cmake-build-system)
5482 #:tests? #f ; no test target
5484 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5485 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5487 `("-DUSE_ATASMART:BOOL=ON")
5489 (modify-phases %standard-phases
5490 (add-after 'unpack 'create-init-scripts
5491 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5492 ;; systemd to patch and install their service files. Fake their
5493 ;; presence rather than duplicating the build system below. Leave
5494 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5495 ;; The sysvinit needs manual patching, but since upstream doesn't
5496 ;; even provide the option to install it: don't.
5497 (lambda* (#:key outputs #:allow-other-keys)
5498 (let* ((out (assoc-ref outputs "out"))
5499 (share (string-append out "/share/" ,name)))
5500 (substitute* "CMakeLists.txt"
5501 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5502 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5503 ;; That was easy! Now we just need to fix the destinations.
5505 (string-append out directory)))
5508 `(("pkg-config" ,pkg-config)))
5510 `(("libatasmart" ,libatasmart)
5511 ("yaml-cpp" ,yaml-cpp)))
5512 (home-page "https://github.com/vmatare/thinkfan")
5513 (synopsis "Simple fan control program")
5515 "Thinkfan is a simple fan control program. It reads temperatures,
5516 checks them against configured limits and switches to appropriate (also
5517 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5518 other @code{hwmon} driver that enables temperature reading and fan control
5520 (license license:gpl3+)))
5522 (define-public tpacpi-bat
5530 (url "https://github.com/teleshoes/tpacpi-bat")
5531 (commit (string-append "v" version))))
5532 (file-name (git-file-name name version))
5534 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5535 (build-system gnu-build-system)
5537 `(#:tests? #f ; no test target
5539 (modify-phases %standard-phases
5540 (add-after 'unpack 'refer-to-inputs
5542 (substitute* "tpacpi-bat"
5544 (format #f "~a " (which "cat")))
5545 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5546 ;; loaded. That's the administrator's prerogative; disable it.
5547 (("system \"(modprobe .*)\"" _ match)
5548 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5550 (delete 'configure) ; nothing to configure
5551 (delete 'build) ; nothing to build
5553 (lambda* (#:key outputs #:allow-other-keys)
5554 (let* ((out (assoc-ref outputs "out"))
5555 (bin (string-append out "/bin"))
5556 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5557 (install-file "tpacpi-bat" bin)
5559 ;; There's no man page. Install other forms of documentation.
5560 (for-each (lambda (file)
5561 (let ((target (string-append doc "/" file)))
5562 (mkdir-p (dirname target))
5563 (copy-recursively file target)))
5564 (list "battery_asl" "examples" "README.md"))
5568 (home-page "https://github.com/teleshoes/tpacpi-bat")
5569 (synopsis "ThinkPad battery charge controller")
5571 "Tpacpi-bat is a command-line interface to control battery charging on
5572 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5573 ThinkPad models released after 2011}, starting with the xx20 series. It can
5574 query and set the thresholds at which one or both batteries will start and stop
5575 charging, inhibit charging batteries for a set period of time, or force them to
5576 discharge when they otherwise would not.
5578 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5579 kernel module provided by the @code{acpi-call-linux-module} package, which must
5580 be installed and loaded separately. Only the original vendor firmware is
5582 (license license:gpl3+)))
5587 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
5588 (version (package-version linux-libre))
5589 (source (package-source linux-libre))
5590 (build-system gnu-build-system)
5592 `(#:tests? #f ; no test suite
5594 (list (string-append "CC=" ,(cc-for-target))
5595 (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out"))
5598 (modify-phases %standard-phases
5599 (add-after 'unpack 'enter-subdirectory
5601 (chdir "tools/thermal/tmon")
5603 (add-after 'install 'install-man-page
5604 (lambda* (#:key outputs #:allow-other-keys)
5605 (let* ((out (assoc-ref outputs "out"))
5606 (man8 (string-append out "/share/man/man8")))
5607 (install-file "tmon.8" man8)
5609 (delete 'configure)))) ; no configure script
5611 `(("ncurses" ,ncurses)))
5612 (home-page (package-home-page linux-libre))
5613 (synopsis "Monitor and test the Linux thermal subsystem in real time")
5615 "Tmon is a tool to interact with the complex thermal subsystem of the
5616 kernel Linux. It helps visualize thermal relationships and real-time thermal
5617 data, tune and test cooling devices and sensors, and collect thermal data for
5620 As computers become smaller and more thermally constrained, more sensors are
5621 added and new cooling capabilities introduced. Thermal relationships can change
5622 dynamically. Their complexity grows exponentially among cooling devices, zones,
5623 sensors, and trip points.
5625 Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
5626 of symbolic links, trip point bindings, and device instances. To traverse it
5627 by hand is no trivial task: @command{tmon} aims to make it understandable.")
5628 (license (list license:gpl2 ; the man page
5629 license:gpl2+)))) ; the actual rest
5631 (define-public turbostat
5634 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
5635 ;; make it harder to benefit from ‘free’ linux-libre package updates.
5636 (version (package-version linux-libre))
5637 (source (package-source linux-libre))
5638 (build-system gnu-build-system)
5640 `(#:tests? #f ; no test suite
5642 (list (string-append "CC=" ,(cc-for-target))
5643 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5645 (modify-phases %standard-phases
5646 (add-after 'unpack 'enter-subdirectory
5648 (chdir "tools/power/x86/turbostat")
5650 (delete 'configure)))) ; no configure script
5652 `(("libcap" ,libcap)))
5653 (supported-systems '("i686-linux" "x86_64-linux"))
5654 (home-page (package-home-page linux-libre))
5655 (synopsis "Report x86 processor frequency and idle statistics")
5657 "Turbostat reports x86 processor topology, frequency, idle power state
5658 statistics, temperature, and power consumption. Some information is unavailable
5659 on older processors.
5661 It can be used to identify machines that are inefficient in terms of power usage
5662 or idle time, report the rate of @acronym{SMI, system management interrupt}s
5663 occurring on the system, or verify the effects of power management tuning.
5665 @command{turbostat} reads hardware counters but doesn't write to them, so it
5666 won't interfere with the OS or other running processes---including multiple
5667 invocations of itself.")
5668 (license license:gpl2)))
5670 (define-public ntfs-3g
5673 (version "2017.3.23")
5676 (uri (string-append "https://tuxera.com/opensource/"
5677 "ntfs-3g_ntfsprogs-" version ".tgz"))
5678 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5681 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5682 (modules '((guix build utils)))
5684 ;; Install under $prefix.
5685 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5689 (build-system gnu-build-system)
5690 (inputs `(("util-linux" ,util-linux)
5691 ("fuse" ,fuse))) ;libuuid
5692 (native-inputs `(("pkg-config" ,pkg-config)))
5694 '(#:configure-flags (list "--disable-static"
5695 "--exec-prefix=${prefix}"
5696 "--with-fuse=external" ;use our own FUSE
5697 "--enable-mount-helper"
5698 "--enable-posix-acls"
5699 "--enable-xattr-mappings")
5701 (modify-phases %standard-phases
5702 ;; If users install ntfs-3g, they probably want to make it the
5703 ;; default driver as well, so we opt for sensible defaults and link
5704 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5705 ;; mount NTFS file systems.)
5706 (add-after 'install 'install-link
5707 (lambda* (#:key outputs #:allow-other-keys)
5708 (let* ((out (assoc-ref outputs "out"))
5709 (sbin (string-append out "/sbin")))
5710 (symlink "mount.ntfs-3g"
5711 (string-append sbin "/mount.ntfs")))
5713 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5714 (synopsis "Read-write access to NTFS file systems")
5716 "NTFS-3G provides read-write access to NTFS file systems, which are
5717 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5718 The package provides additional NTFS tools.")
5719 (license license:gpl2+)))
5721 (define-public rdma-core
5727 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5728 "/releases/download/v" version "/rdma-core-"
5732 "1rah0v9gq9rksqd2c17nmydsxcjz178n7m2y4ricwlf5pq1b2yfi"))))
5733 (build-system cmake-build-system)
5735 `(#:tests? #f ; no tests
5736 ;; Upstream uses the "ninja" build system and encourage distros
5737 ;; to do the same for consistency.
5738 #:configure-flags (list "-GNinja"
5740 (string-append "-DRST2MAN_EXECUTABLE="
5741 (assoc-ref %build-inputs
5745 (modify-phases %standard-phases
5749 "-j" (number->string (parallel-job-count)))))
5752 (invoke "ninja" "install"))))))
5755 ("pkg-config" ,pkg-config)
5756 ("python" ,python-wrapper)
5757 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5761 (home-page "https://github.com/linux-rdma/rdma-core")
5762 (synopsis "Utilities and libraries for working with RDMA devices")
5764 "This package provides userspace components for the InfiniBand
5765 subsystem of the Linux kernel. Specifically it contains userspace
5766 libraries for the following device nodes:
5769 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5770 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5771 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5774 The following service daemons are also provided:
5776 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5777 @item @code{iwpmd} (for iWARP kernel providers)
5778 @item @code{ibacm} (for InfiniBand communication management assistant)
5780 ;; All library code is dual licensed under GPL2 and a custom MIT
5781 ;; variant. The package also includes some components covered by
5782 ;; other licenses. Consult COPYING.md for full details.
5785 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5786 license:bsd-2 ; Files referring to COPYING.BSD_FB
5787 license:cc0 ; most files in ccan/
5788 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5790 (define-public perftest
5797 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5798 version "/perftest-" version ".g0927198.tar.gz"))
5800 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5801 (build-system gnu-build-system)
5804 (modify-phases %standard-phases
5805 (add-after 'unpack 'patch-header-paths
5807 (substitute* '("src/raw_ethernet_fs_rate.c"
5808 "src/raw_ethernet_resources.c"
5809 "src/raw_ethernet_resources.h"
5810 "src/raw_ethernet_send_burst_lat.c"
5811 "src/raw_ethernet_send_bw.c"
5812 "src/raw_ethernet_send_lat.c")
5813 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5815 (inputs `(("rdma-core" ,rdma-core)))
5816 (home-page "https://github.com/linux-rdma/perftest/")
5817 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5818 (description "This is a collection of tests written over uverbs intended for
5819 use as a performance micro-benchmark. The tests may be used for hardware or
5820 software tuning as well as for functional testing.
5822 The collection contains a set of bandwidth and latency benchmark such as:
5824 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5825 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5826 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5827 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5828 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5830 (license license:gpl2)))
5832 (define-public rng-tools
5835 (home-page "https://github.com/nhorman/rng-tools")
5839 (uri (git-reference (url home-page)
5840 (commit (string-append "v" version))))
5841 (file-name (git-file-name name version))
5844 "0z4j3kqh9k3zsrx6257hwh4fa51vqg79c6dnfrj6lhpcll0wh0hm"))))
5845 (build-system gnu-build-system)
5847 `(;; Disable support for various hardware entropy sources as they need
5848 ;; dependencies that are not yet in Guix, and would significantly
5849 ;; increase closure size.
5850 #:configure-flags '("--without-nistbeacon"
5852 "--without-rtlsdr")))
5854 `(("autoconf" ,autoconf)
5855 ("automake" ,automake)
5856 ("pkg-config" ,pkg-config)))
5858 `(("libsysfs" ,sysfsutils)
5859 ("openssl" ,openssl)))
5860 (synopsis "Random number generator daemon")
5862 "Monitor a hardware random number generator, and supply entropy
5863 from that to the system kernel's @file{/dev/random} machinery.")
5864 ;; The source package is offered under the GPL2+, but the files
5865 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5866 (license (list license:gpl2 license:gpl2+))))
5868 (define-public cpupower
5871 (version (package-version linux-libre))
5872 (source (package-source linux-libre))
5873 (build-system gnu-build-system)
5875 '(#:phases (modify-phases %standard-phases
5876 (add-after 'unpack 'enter-subdirectory
5878 (chdir "tools/power/cpupower")
5881 (add-before 'build 'fix-makefiles
5883 (substitute* "Makefile"
5885 (("/bin/(install|pwd)" _ command) command))
5886 (substitute* "bench/Makefile"
5887 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5889 #:make-flags (let ((out (assoc-ref %outputs "out")))
5890 (list (string-append "DESTDIR=" out)
5891 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5893 "docdir=/share/doc/cpupower"
5894 "confdir=$(docdir)/examples"
5895 ;; The Makefile recommends the following changes
5897 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5898 #:tests? #f)) ;no tests
5899 (native-inputs `(("gettext" ,gettext-minimal)))
5900 (inputs `(("pciutils" ,pciutils)))
5901 (home-page (package-home-page linux-libre))
5902 (synopsis "CPU frequency and voltage scaling tools for Linux")
5904 "cpupower is a set of user-space tools that use the cpufreq feature of the
5905 Linux kernel to retrieve and control processor features related to power saving,
5906 such as frequency and voltage scaling.")
5907 (license license:gpl2)))
5909 (define-public x86-energy-perf-policy
5911 (name "x86-energy-perf-policy")
5912 (version (package-version linux-libre))
5913 (source (package-source linux-libre))
5914 (build-system gnu-build-system)
5918 (modify-phases %standard-phases
5919 (add-after 'unpack 'enter-subdirectory
5921 (chdir "tools/power/x86/x86_energy_perf_policy")
5924 (add-before 'build 'fix-makefile
5926 (substitute* "Makefile" (("/usr") ""))
5929 (let ((out (assoc-ref %outputs "out")))
5930 (list (string-append "DESTDIR=" out)
5931 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5932 (supported-systems '("i686-linux" "x86_64-linux"))
5933 (home-page (package-home-page linux-libre))
5934 (synopsis "Display and update Intel-CPU energy-performance policy")
5936 "@command{x86_energy_perf_policy} displays and updates energy-performance
5937 policy settings specific to Intel Architecture Processors. Settings are
5938 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5939 cpufreq sub-system is enabled or not.")
5940 (license license:gpl2)))
5942 (define-public haveged
5950 (url "https://github.com/jirka-h/haveged")
5951 (commit (string-append "v" version))))
5952 (file-name (git-file-name name version))
5954 (base32 "050hmnh5s2s4mb83f4d1fk23mk27pprg840c1aagc6v1sz6x5dhq"))))
5955 (build-system gnu-build-system)
5956 (home-page "https://www.issihosts.com/haveged")
5957 (synopsis "Entropy source for the Linux random number generator")
5959 "haveged generates an unpredictable stream of random numbers for use by
5960 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5961 standard mechanisms for filling the entropy pool may not be sufficient for
5962 systems with high needs or limited user interaction, such as headless servers.
5964 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5965 indirect effects of hardware events on hidden processor state using the
5966 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5967 It tunes itself to its environment and provides the same built-in test suite
5968 for the output stream as used on certified hardware security devices.
5970 The quality of the randomness produced by this algorithm has not been proven.
5971 It is recommended to run it together with another entropy source like rngd, and
5972 not as a replacement for it.")
5973 (license (list (license:non-copyleft "file://nist/mconf.h")
5974 (license:non-copyleft "file://nist/packtest.c")
5975 license:public-domain ; nist/dfft.c
5976 license:gpl3+)))) ; everything else
5978 (define-public ecryptfs-utils
5980 (name "ecryptfs-utils")
5985 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5986 version "/+download/ecryptfs-utils_"
5987 version ".orig.tar.gz"))
5990 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5991 (build-system gnu-build-system)
5993 `(#:configure-flags (list "--disable-pywrap")
5995 (modify-phases %standard-phases
5996 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5997 (lambda* (#:key inputs outputs #:allow-other-keys)
5998 (let ((out (assoc-ref outputs "out"))
5999 (utils-linux (assoc-ref inputs "utils-linux"))
6000 (cryptsetup (assoc-ref inputs "cryptsetup"))
6001 (linux-pam (assoc-ref inputs "linux-pam"))
6002 (lvm2 (assoc-ref inputs "lvm2")))
6003 (substitute* '("src/utils/ecryptfs-mount-private"
6004 "src/utils/ecryptfs-umount-private"
6005 "src/utils/ecryptfs-setup-private"
6006 "src/utils/ecryptfs-setup-swap"
6007 "src/utils/mount.ecryptfs.c"
6008 "src/utils/umount.ecryptfs.c"
6009 "src/pam_ecryptfs/pam_ecryptfs.c"
6010 "src/desktop/ecryptfs-mount-private.desktop.in"
6011 "src/desktop/ecryptfs-setup-private.desktop.in")
6013 (string-append utils-linux "/bin/mount"))
6015 (string-append utils-linux "/bin/umount"))
6016 (("/sbin/mount.ecryptfs_private")
6017 (string-append out "/sbin/mount.ecryptfs_private"))
6018 (("/sbin/umount.ecryptfs_private")
6019 (string-append out "/sbin/umount.ecryptfs_private"))
6020 (("/usr/bin/ecryptfs-mount-private")
6021 (string-append out "/bin/ecryptfs-mount-private"))
6022 (("/usr/bin/ecryptfs-rewrite-file")
6023 (string-append out "/bin/ecryptfs-rewrite-file"))
6024 (("/usr/bin/ecryptfs-setup-private")
6025 (string-append out "/bin/ecryptfs-setup-private"))
6026 (("/sbin/cryptsetup")
6027 (string-append cryptsetup "/sbin/cryptsetup"))
6028 (("/sbin/unix_chkpwd")
6029 (string-append linux-pam "/sbin/unix_chkpwd"))
6031 (string-append lvm2 "/sbin/dmsetup")))))))))
6033 `(("intltool" ,intltool)
6034 ("perl" ,perl) ; for pod2man
6035 ("pkg-config" ,pkg-config)))
6037 `(("keyutils" ,keyutils)
6038 ("linux-pam" ,linux-pam)
6039 ("utils-linux" ,util-linux)
6040 ("cryptsetup" ,cryptsetup)
6043 (home-page "https://ecryptfs.org/")
6044 (synopsis "eCryptfs cryptographic file system utilities")
6046 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
6047 Each file's cryptographic meta-data is stored inside the file itself, along
6048 with the encrypted contents. This allows individual encrypted files to be
6049 copied between hosts and still be decrypted with the proper key. eCryptfs is a
6050 native Linux file system, and has been part of the Linux kernel since version
6051 2.6.19. This package contains the userland utilities to manage it.")
6052 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
6053 ;; grant additional permission to link with OpenSSL.
6054 (license license:gpl2+)))
6056 (define-public libnfsidmap
6058 (name "libnfsidmap")
6063 (uri (string-append "https://fedorapeople.org/~steved/"
6064 name "/" version "/" name "-" version ".tar.bz2"))
6066 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
6067 (build-system gnu-build-system)
6069 `(#:configure-flags (list
6070 (string-append "--with-pluginpath="
6071 (assoc-ref %outputs "out")
6072 "/lib/libnfsidmap"))))
6074 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
6076 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
6077 (synopsis "NFSv4 support library for name/ID mapping")
6078 (description "Libnfsidmap is a library holding mulitiple methods of
6079 mapping names to ids and visa versa, mainly for NFSv4. It provides an
6080 extensible array of mapping functions, currently consisting of two choices:
6081 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
6082 (license (license:non-copyleft "file://COPYING"
6083 "See COPYING in the distribution."))))
6085 (define-public module-init-tools
6087 (name "module-init-tools")
6092 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
6093 "module-init-tools-" version ".tar.bz2"))
6096 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
6097 (patches (search-patches "module-init-tools-moduledir.patch"))))
6098 (build-system gnu-build-system)
6100 ;; FIXME: The upstream tarball lacks man pages, and building them would
6101 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
6102 ;; but they vanished. In the meantime, fake it.
6104 (modify-phases %standard-phases
6105 (add-before 'configure 'fake-docbook
6107 (substitute* "Makefile.in"
6108 (("^DOCBOOKTOMAN.*$")
6109 "DOCBOOKTOMAN = true\n"))
6111 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
6112 (synopsis "Tools for loading and managing Linux kernel modules")
6114 "Tools for loading and managing Linux kernel modules, such as
6115 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
6116 (license license:gpl2+)))
6118 (define-public mcelog
6126 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
6127 (commit (string-append "v" version))))
6128 (file-name (git-file-name name version))
6130 (base32 "1mlwn6ck9qiwqa2vg5wg1gvfva3jv7ygjr7p7bam0qszajs5pirk"))
6131 (modules '((guix build utils)))
6134 ;; The checkout lacks a .git directory, breaking ‘git describe’.
6135 (substitute* "Makefile"
6136 (("\"unknown\"") (string-append "\"v" ,version "\"")))
6138 (build-system gnu-build-system)
6140 `(#:phases (modify-phases %standard-phases
6141 (delete 'configure)) ; no configure script
6142 #:make-flags (let ((out (assoc-ref %outputs "out")))
6143 (list (string-append "CC=" ,(cc-for-target))
6144 (string-append "prefix=" out)
6145 (string-append "DOCDIR=" out "/share/doc/"
6147 "etcprefix=$(DOCDIR)/examples"))
6148 ;; The tests will only run as root on certain supported CPU models.
6150 (supported-systems (list "i686-linux" "x86_64-linux"))
6151 (home-page "https://mcelog.org/")
6152 (synopsis "Machine check monitor for x86 Linux systems")
6154 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
6155 systems running the kernel Linux. It can also perform user-defined tasks, such
6156 as bringing bad pages off-line, when configurable error thresholds are
6158 (license license:gpl2)))
6160 (define-public mtd-utils
6167 "ftp://ftp.infradead.org/pub/mtd-utils/"
6168 "mtd-utils-" version ".tar.bz2"))
6171 "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
6173 '(#:configure-flags '("--enable-unit-tests")))
6175 `(("cmocka" ,cmocka)
6176 ("pkg-config" ,pkg-config)))
6178 `(("acl" ,acl) ; extended attributes (xattr)
6179 ("libuuid" ,util-linux "lib")
6181 ("openssl" ,openssl) ; optional crypto support
6183 ("zstd" ,zstd "lib")))
6184 (build-system gnu-build-system)
6185 (synopsis "MTD Flash Storage Utilities")
6186 (description "This package provides utilities for testing, partitioning, etc
6188 (home-page "http://www.linux-mtd.infradead.org/")
6190 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
6191 license:mpl1.1 ; All ftl* files
6192 license:expat)))) ; libiniparser
6194 (define-public libseccomp
6200 (uri (string-append "https://github.com/seccomp/libseccomp/"
6201 "releases/download/v" version
6202 "/libseccomp-" version ".tar.gz"))
6205 "0m8dlg1v7kflcxvajs4p76p275qwsm2abbf5mfapkakp7hw7wc7f"))))
6206 (build-system gnu-build-system)
6208 '(#:configure-flags '("--disable-static")
6209 #:phases (modify-phases %standard-phases
6210 (add-before 'check 'skip-load-test
6212 ;; This test does a native system call and fails when
6213 ;; run under QEMU user-mode emulation. Just skip it.
6214 (delete-file "tests/52-basic-load.tests")
6219 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
6220 (description "The libseccomp library provides an easy to use, platform
6221 independent, interface to the Linux Kernel's syscall filtering mechanism. The
6222 libseccomp API is designed to abstract away the underlying BPF based syscall
6223 filter language and present a more conventional function-call based filtering
6224 interface that should be familiar to, and easily adopted by, application
6226 (home-page "https://github.com/seccomp/libseccomp")
6227 (license license:lgpl2.1)))
6229 (define-public radeontop
6237 (url "https://github.com/clbr/radeontop")
6238 (commit (string-append "v" version))))
6239 (file-name (git-file-name name version))
6241 (base32 "0ay6vl9zsz9b2scy0fnsy482pzizj52i27syxwny4z4i9wrk2wmn"))))
6242 (build-system gnu-build-system)
6244 `(#:phases (modify-phases %standard-phases
6245 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
6246 ;; dependency, and doesn't even work on release(!) tarballs.
6247 (add-after 'unpack 'report-correct-version
6249 (substitute* "getver.sh"
6251 (string-append "ver=" ,version)))
6253 (delete 'configure)) ; no configure script
6254 #:make-flags (list "CC=gcc"
6255 (string-append "PREFIX=" %output))
6256 #:tests? #f)) ; no tests
6258 `(("gettext" ,gettext-minimal)
6259 ("pkg-config" ,pkg-config)))
6261 `(("libdrm" ,libdrm)
6262 ("libpciaccess" ,libpciaccess)
6264 ("ncurses" ,ncurses)))
6265 (home-page "https://github.com/clbr/radeontop/")
6266 (synopsis "Usage monitor for AMD Radeon graphics")
6267 (description "RadeonTop monitors resource consumption on supported AMD
6268 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
6269 a terminal or saved to a file for further processing. It measures both the
6270 activity of the GPU as a whole, which is also accurate during OpenCL
6271 computations, as well as separate component statistics that are only meaningful
6272 under OpenGL graphics workloads.")
6273 (license license:gpl3)))
6275 (define-public efivar
6281 (uri (string-append "https://github.com/rhboot/" name
6282 "/releases/download/" version "/" name
6283 "-" version ".tar.bz2"))
6286 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
6287 (build-system gnu-build-system)
6289 `(;; Tests require a UEFI system and is not detected in the chroot.
6291 #:make-flags (list (string-append "prefix=" %output)
6292 (string-append "libdir=" %output "/lib")
6294 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6296 (modify-phases %standard-phases
6297 (delete 'configure))))
6299 `(("pkg-config" ,pkg-config)))
6302 (home-page "https://github.com/rhboot/efivar")
6303 (synopsis "Tool and library to manipulate EFI variables")
6304 (description "This package provides a library and a command line
6305 interface to the variable facility of UEFI boot firmware.")
6306 (license license:lgpl2.1+)))
6308 (define-public efibootmgr
6316 (url "https://github.com/rhinstaller/efibootmgr")
6318 (file-name (git-file-name name version))
6320 (base32 "1niicijxg59rsmiw3rsjwy4bvi1n42dynvm01lnp9haixdzdpq03"))
6321 (patches (search-patches "efibootmgr-remove-extra-decl.patch"))))
6322 (build-system gnu-build-system)
6324 `(#:tests? #f ;no tests
6325 #:make-flags (list (string-append "prefix=" %output)
6326 (string-append "libdir=" %output "/lib")
6327 ;; EFIDIR denotes a subdirectory relative to the
6328 ;; EFI System Partition where the loader will be
6329 ;; installed (known as OS_VENDOR in the code).
6330 ;; GRUB overrides this, as such it's only used if
6331 ;; nothing else is specified on the command line.
6333 #:phases (modify-phases %standard-phases (delete 'configure))))
6335 `(("pkg-config" ,pkg-config)))
6337 `(("efivar" ,efivar)
6339 (home-page "https://github.com/rhinstaller/efibootmgr")
6340 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
6342 "@code{efibootmgr} is a user-space application to modify the Intel
6343 Extensible Firmware Interface (EFI) Boot Manager. This application can
6344 create and destroy boot entries, change the boot order, change the next
6345 running boot option, and more.")
6346 (license license:gpl2+)))
6348 (define-public sysstat
6355 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6356 "sysstat-" version ".tar.xz"))
6358 (base32 "1z8bdyj92q0capbrdscwzb51bqh54ng15gpvmjmvrb2syhqj8hxf"))))
6359 (build-system gnu-build-system)
6361 `(#:tests? #f ; no test suite.
6362 ;; Without this flag, it tries to install the man pages with group 'root'
6363 ;; and fails because /etc/passwd lacks an entry for the root user.
6365 (list "--disable-file-attr"
6366 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
6368 (modify-phases %standard-phases
6369 ;; The build process tries to create '/var/lib/sa', so we skip that
6371 (add-after 'build 'skip-touching-var
6373 (substitute* "Makefile"
6374 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
6377 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
6378 (synopsis "Performance monitoring tools for Linux")
6379 (description "The sysstat utilities are a collection of performance
6380 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
6381 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
6382 @code{sadf} and @code{sa}.")
6383 (license license:gpl2+)))
6385 (define-public light
6393 (url "https://github.com/haikarainen/light")
6394 (commit (string-append "v" version))))
6396 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
6397 (file-name (git-file-name name version))))
6398 (build-system gnu-build-system)
6401 (modify-phases %standard-phases
6402 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
6403 (lambda* (#:key inputs #:allow-other-keys)
6404 (substitute* "90-backlight.rules"
6405 (("/bin/chgrp") (which "chgrp"))
6406 (("/bin/chmod") (which "chmod")))
6408 (add-after 'install 'install-udev-rules
6409 (lambda* (#:key outputs #:allow-other-keys)
6410 (let ((out (assoc-ref outputs "out")))
6412 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
6415 `(("autoconf" ,autoconf)
6416 ("automake" ,automake)))
6417 (home-page "https://haikarainen.github.io/light/")
6418 (synopsis "GNU/Linux application to control backlights")
6420 "Light is a program to send commands to screen backlight controllers
6421 under GNU/Linux. Features include:
6424 @item It does not rely on X.
6425 @item Light can automatically figure out the best controller to use, making
6426 full use of underlying hardware.
6427 @item It is possible to set a minimum brightness value, as some controllers
6428 set the screen to be pitch black at a value of 0 (or higher).
6430 (license license:gpl3+)))
6432 (define-public brightnessctl
6434 (name "brightnessctl")
6436 (home-page "https://github.com/Hummer12007/brightnessctl")
6439 (uri (git-reference (url home-page) (commit version)))
6440 (file-name (git-file-name name version))
6443 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))))
6444 (build-system gnu-build-system)
6446 `(#:tests? #f ; no tests
6447 #:make-flags (list (string-append "CC=" ,(cc-for-target))
6448 (string-append "PREFIX=" %output)
6449 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
6451 (modify-phases %standard-phases
6453 (add-after 'unpack 'adjust-udev-rules
6455 (substitute* "90-brightnessctl.rules"
6456 (("/bin/") "/run/current-system/profile/bin/"))
6458 (synopsis "Backlight and LED brightness control")
6460 "This program allows you read and control device brightness. Devices
6461 include backlight and LEDs. It can also preserve current brightness before
6462 applying the operation, such as on lid close.
6464 The appropriate permissions must be set on the backlight or LED control
6465 interface in sysfs, which can be accomplished with the included udev rules.")
6466 (license license:expat)))
6476 (url "https://github.com/linrunner/TLP")
6478 (file-name (git-file-name name version))
6480 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
6482 `(("shellcheck" ,shellcheck)))
6486 ("ethtool" ,ethtool)
6490 ("inetutils" ,inetutils)
6493 ("pciutils" ,pciutils)
6497 ("usbutils" ,usbutils)
6498 ("util-linux" ,util-linux)
6499 ("wireless-tools" ,wireless-tools)
6500 ,@(if (let ((system (or (%current-target-system)
6501 (%current-system))))
6502 (or (string-prefix? "i686-" system)
6503 (string-prefix? "x86_64-" system)))
6504 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
6506 (build-system gnu-build-system)
6508 ;; XXX: The full test suite is run with "checkall" but it requires
6509 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
6510 `(#:test-target "shellcheck"
6511 #:modules ((guix build gnu-build-system)
6515 (modify-phases %standard-phases
6516 (delete 'configure) ; no configure script
6517 (add-before 'build 'setenv
6518 (lambda* (#:key outputs #:allow-other-keys)
6519 (let ((out (assoc-ref outputs "out")))
6520 (setenv "TLP_WITH_SYSTEMD" "0")
6521 (setenv "TLP_NO_INIT" "1")
6522 (setenv "TLP_NO_PMUTILS" "1")
6523 (setenv "TLP_SBIN" (string-append out "/bin"))
6524 (setenv "TLP_BIN" (string-append out "/bin"))
6525 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
6526 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
6527 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
6528 (setenv "TLP_CONFDEF"
6529 (string-append out "/share/tlp/defaults.conf"))
6530 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
6532 (string-append out "/lib/elogind/system-sleep"))
6534 (string-append out "/share/bash-completion/completions"))
6535 (setenv "TLP_MAN" (string-append out "/share/man"))
6536 (setenv "TLP_META" (string-append out "/share/metainfo"))
6538 (add-before 'install 'fix-installation
6540 ;; Stop the Makefile from trying to create system directories.
6541 (substitute* "Makefile"
6542 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6543 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6546 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6547 (add-after 'install 'wrap
6548 (lambda* (#:key inputs outputs #:allow-other-keys)
6549 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6550 (bin-files (find-files bin ".*")))
6551 (define (bin-directory input-name)
6552 (let ((p (assoc-ref inputs input-name)))
6553 (and p (string-append p "/bin"))))
6554 (define (sbin-directory input-name)
6555 (string-append (assoc-ref inputs input-name) "/sbin"))
6556 (for-each (lambda (program)
6557 (wrap-program program
6560 (filter-map bin-directory
6572 "x86-energy-perf-policy"))
6573 (filter-map sbin-directory
6579 "wireless-tools"))))))
6582 (home-page "https://linrunner.de/en/tlp/tlp.html")
6583 (synopsis "Power management tool for Linux")
6584 (description "TLP is a power management tool for Linux. It comes with
6585 a default configuration already optimized for battery life. Nevertheless,
6586 TLP is customizable to fulfil system requirements. TLP settings are applied
6587 every time the power supply source is changed.")
6588 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6590 (license (list license:gpl2+ license:gpl3+))))
6595 (version "B.02.19.2")
6598 (uri (string-append "https://www.ezix.org/software/"
6599 "files/lshw-" version
6603 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
6604 (build-system gnu-build-system)
6606 `(#:phases (modify-phases %standard-phases (delete 'configure))
6607 #:tests? #f ; no tests
6609 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6610 (synopsis "List hardware information")
6612 "@command{lshw} (Hardware Lister) is a small tool to provide
6613 detailed information on the hardware configuration of the machine.
6614 It can report exact memory configuration, firmware version, mainboard
6615 configuration, CPU version and speed, cache configuration, bus speed,
6616 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6617 machines (PowerMac G4 is known to work).")
6618 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6619 (license license:gpl2+)))
6621 (define-public libmnl
6628 (uri (string-append "mirror://netfilter.org/libmnl/"
6629 "libmnl-" version ".tar.bz2"))
6632 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6633 (build-system gnu-build-system)
6634 (home-page "https://www.netfilter.org/projects/libmnl/")
6635 (synopsis "Netlink utility library")
6636 (description "Libmnl is a minimalistic user-space library oriented to
6637 Netlink developers. There are a lot of common tasks in parsing, validating,
6638 constructing of both the Netlink header and TLVs that are repetitive and easy to
6639 get wrong. This library aims to provide simple helpers that allows you to
6640 re-use code and to avoid re-inventing the wheel.")
6641 (license license:lgpl2.1+)))
6643 (define-public libnftnl
6650 (uri (string-append "mirror://netfilter.org/libnftnl/"
6651 "libnftnl-" version ".tar.bz2"))
6653 (base32 "16jbp4fs5dz2yf4c3bl1sb48x9x9wi1chv39zwmfgya1k9pimcp9"))))
6654 (build-system gnu-build-system)
6656 `(("pkg-config" ,pkg-config)))
6658 `(("libmnl" ,libmnl)))
6659 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6660 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6661 (description "Libnftnl is a userspace library providing a low-level netlink
6662 programming interface to the in-kernel nf_tables subsystem. The library
6663 libnftnl has been previously known as libnftables. This library is currently
6665 (license license:gpl2+)))
6667 (define-public nftables
6674 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6676 (string-append "https://www.nftables.org/projects/nftables"
6677 "/files/nftables-" version ".tar.bz2")))
6679 (base32 "1r4g22grhd4s1918wws9vggb8821sv4kkj8197ygxr6sar301z30"))))
6680 (build-system gnu-build-system)
6681 (arguments `(#:configure-flags
6682 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6683 (inputs `(("gmp" ,gmp)
6685 ("libnftnl" ,libnftnl)
6686 ("readline" ,readline)))
6687 (native-inputs `(("pkg-config" ,pkg-config)
6690 (home-page "https://www.nftables.org")
6691 (synopsis "Userspace utility for Linux packet filtering")
6692 (description "nftables is the project that aims to replace the existing
6693 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6694 filtering framework, a new userspace utility and also a compatibility layer for
6695 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6696 infrastructure such as the existing hooks, the connection tracking system, the
6697 userspace queueing component and the logging subsystem.")
6698 (license license:gpl2)))
6700 (define-public proot
6708 (url "https://github.com/proot-me/PRoot")
6709 (commit (string-append "v" version))))
6710 (file-name (git-file-name name version))
6712 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6713 (patches (search-patches "proot-test-fhs.patch"))))
6714 (build-system gnu-build-system)
6716 '(#:make-flags '("-C" "src")
6718 #:phases (modify-phases %standard-phases
6720 (add-before 'build 'set-shell-file-name
6721 (lambda* (#:key inputs #:allow-other-keys)
6722 (substitute* (find-files "src" "\\.[ch]$")
6725 (assoc-ref inputs "bash")
6728 (add-before 'check 'fix-fhs-assumptions-in-tests
6730 (substitute* "tests/test-c6b77b77.mk"
6731 (("/bin/bash") (which "bash"))
6732 (("/usr/bin/test") (which "test")))
6733 (substitute* '("tests/test-16573e73.c")
6734 (("/bin/([a-z-]+)" _ program)
6737 (substitute* (find-files "tests" "\\.sh$")
6738 ;; Some of the tests try to "bind-mount" /bin/true.
6740 (string-append "-b " (which "true") ":"))
6741 ;; Likewise for /bin.
6742 (("-b /bin:") "-b /gnu:")
6743 ;; Others try to run /bin/sh.
6744 (("/bin/sh") (which "sh"))
6745 ;; Others assume /etc/fstab exists.
6746 (("/etc/fstab") "/etc/passwd"))
6748 (substitute* "tests/GNUmakefile"
6749 (("-b /bin:") "-b /gnu:"))
6751 ;; XXX: This test fails in an obscure corner case, just
6753 (delete-file "tests/test-kkkkkkkk.c")
6758 (let ((n (parallel-job-count)))
6759 ;; For some reason we get lots of segfaults with
6760 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6761 (setenv "PROOT_NO_SECCOMP" "1")
6763 ;; Most of the tests expect "/bin" to be in $PATH so
6764 ;; they can run things that live in $ROOTFS/bin.
6766 (string-append (getenv "PATH") ":/bin"))
6768 (invoke "make" "check" "-C" "tests"
6770 "-j" (number->string n)))))
6772 (lambda* (#:key outputs #:allow-other-keys)
6773 ;; The 'install' rule does nearly nothing.
6774 (let* ((out (assoc-ref outputs "out"))
6775 (man1 (string-append out "/share/man/man1")))
6776 ;; TODO: 'make install-care' (does not even
6777 ;; build currently.)
6778 (invoke "make" "-C" "src" "install"
6779 (string-append "PREFIX=" out))
6782 (copy-file "doc/proot/man.1"
6783 (string-append man1 "/proot.1"))
6785 (native-inputs `(("which" ,which)
6787 ;; For 'mcookie', used by some of the tests.
6788 ("util-linux" ,util-linux)
6790 ;; XXX: Choose the old coreutils because its 'stat'
6791 ;; program does not use statx(2) when running 'stat -c
6792 ;; %a' or similar, which PRoot doesn't properly support.
6793 ("coreutils-old" ,coreutils-8.30)
6795 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6796 ;; make 4.3 to segfault.
6797 ("make-old" ,gnu-make-4.2)))
6798 (inputs `(("talloc" ,talloc)))
6799 (home-page "https://github.com/proot-me/PRoot")
6800 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6802 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6803 and @code{binfmt_misc}. This means that users don't need any privileges or
6804 setup to do things like using an arbitrary directory as the new root
6805 file system, making files accessible somewhere else in the file system
6806 hierarchy, or executing programs built for another CPU architecture
6807 transparently through QEMU user-mode. Also, developers can use PRoot as a
6808 generic process instrumentation engine thanks to its extension mechanism.
6809 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6810 available in the kernel Linux.")
6811 (license license:gpl2+)))
6813 (define-public proot-static
6816 (name "proot-static")
6818 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6819 (inputs `(("talloc" ,talloc/static)))
6821 (substitute-keyword-arguments (package-arguments proot)
6822 ((#:make-flags flags)
6823 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6825 `(modify-phases ,phases
6826 (add-after 'strip 'remove-store-references
6827 (lambda* (#:key outputs #:allow-other-keys)
6828 (let* ((out (assoc-ref outputs "out")))
6829 (with-directory-excursion out
6830 (remove-store-references "bin/proot")
6832 ((#:allowed-references _ '("out"))
6835 (define-public cpuid
6838 (version "20201006")
6841 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6842 version ".src.tar.gz"))
6845 "19jnkh57f979b78ak5mpxmdvnkgc33r55cw9shgd2hc380b3zi8k"))))
6846 (build-system gnu-build-system)
6849 (list (string-append "CC=" ,(cc-for-target)))
6850 #:tests? #f ; no tests
6851 #:phases (modify-phases %standard-phases
6852 (delete 'configure) ; no configure script
6853 (add-before 'install 'fix-makefile
6854 (lambda* (#:key outputs #:allow-other-keys)
6855 (substitute* "Makefile"
6856 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6857 ;; Make the compressed manpages writable so that the
6858 ;; reset-gzip-timestamps phase does not error out.
6859 (substitute* "Makefile"
6860 (("-m 444") "-m 644"))
6862 (inputs `(("perl" ,perl)))
6863 (supported-systems '("i686-linux" "x86_64-linux"))
6864 (home-page "http://www.etallen.com/cpuid.html")
6865 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6866 (description "cpuid dumps detailed information about the CPU(s) gathered
6867 from the CPUID instruction, and also determines the exact model of CPU(s). It
6868 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6869 NexGen, Rise, and SiS CPUs.")
6870 (license license:gpl2+)))
6872 (define-public jmtpfs
6880 (url "https://github.com/JasonFerrara/jmtpfs")
6881 (commit (string-append "v" version))))
6882 (file-name (git-file-name name version))
6885 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6886 (build-system gnu-build-system)
6890 ("libmtp" ,libmtp)))
6892 `(("pkg-config" ,pkg-config)))
6893 (home-page "https://github.com/JasonFerrara/jmtpfs")
6894 (synopsis "Use a FUSE file system to access data over MTP")
6895 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6896 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6897 the MTP device as a file system.")
6898 (license license:gpl3)))
6900 (define-public procenv
6908 (url "https://github.com/jamesodhunt/procenv")
6910 (file-name (git-file-name name version))
6912 (base32 "13fnr4gfj2xlxghw93m5gsxzlwzv3s6jv9hja0w0pb23hlncbmhy"))))
6913 (build-system gnu-build-system)
6915 `(("pkg-config" ,pkg-config)
6923 ("libselinux" ,libselinux)))
6924 (synopsis "Utility to show process environment")
6925 (description "Procenv is a command-line tool that displays as much detail about
6926 itself and its environment as possible. It can be used as a test
6927 tool, to understand the type of environment a process runs in, and for
6928 comparing system environments.")
6929 (home-page "https://github.com/jamesodhunt/procenv/")
6930 (license license:gpl3+)))
6932 (define-public libfabric
6940 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6941 version "/libfabric-" version ".tar.bz2"))
6943 (base32 "1nnpfkwxhim2nqjkb1vwrb4wj4j3l6w6yvvy69fqam2snlhshazz"))))
6944 (build-system gnu-build-system)
6945 (inputs `(("rdma-core" ,rdma-core)
6946 ,@(match (%current-system)
6947 ((member (package-supported-systems psm))
6951 (home-page "https://ofiwg.github.io/libfabric/")
6952 (synopsis "Open Fabric Interfaces")
6954 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6955 communication services to applications. OFI is best described as a collection
6956 of libraries and applications used to export fabric services. The key
6957 components of OFI are: application interfaces, provider libraries, kernel
6958 services, daemons, and test applications.
6960 Libfabric is a core component of OFI. It is the library that defines and
6961 exports the user-space API of OFI, and is typically the only software that
6962 applications deal with directly. It works in conjunction with provider
6963 libraries, which are often integrated directly into libfabric.")
6964 (license (list license:bsd-2 license:gpl2)))) ;dual
6969 (version "3.3.20170428")
6970 (home-page "https://github.com/intel/psm")
6974 (uri (git-reference (url home-page)
6975 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6976 (file-name (string-append "psm-" version ".tar.gz"))
6978 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6979 (patches (search-patches
6980 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6981 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6982 "psm-repro.patch" ; reproducibility
6983 "psm-disable-memory-stats.patch"))))
6984 (build-system gnu-build-system)
6985 (outputs '("out" "debug"))
6986 (inputs `(("libuuid" ,util-linux "lib")))
6988 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6989 ,(string-append "INSTALL_PREFIX=" %output)
6990 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6992 #:phases (modify-phases %standard-phases
6994 (add-after 'unpack 'patch-/usr/include
6996 (substitute* "Makefile"
6997 (("\\$\\{DESTDIR}/usr/include")
6998 (string-append %output "/include")))
6999 (substitute* "Makefile"
7000 (("/lib64") "/lib"))
7002 (add-after 'unpack 'patch-sysmacros
7004 (substitute* "ipath/ipath_proto.c"
7005 (("#include <sys/poll.h>" m)
7006 (string-append m "\n"
7007 "#include <sys/sysmacros.h>")))
7009 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
7011 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
7012 communications interface for the True Scale family of products. PSM users are
7013 enabled with mechanisms necessary to implement higher level communications
7014 interfaces in parallel environments.")
7015 ;; Only Intel-compatable processors are supported.
7016 (supported-systems '("i686-linux" "x86_64-linux"))
7017 (license (list license:bsd-2 license:gpl2)))) ;dual
7019 (define-public snapscreenshot
7021 (name "snapscreenshot")
7022 (version "1.0.14.3")
7026 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
7027 name "-" version ".tar.bz2"))
7029 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
7030 (build-system gnu-build-system)
7033 (let ((out (assoc-ref %outputs "out")))
7034 (list (string-append "BINDIR=" out "/bin")
7035 (string-append "MANDIR=" out "/share/man")))
7036 #:tests? #f ; no test suite
7038 (modify-phases %standard-phases
7039 (delete 'configure) ; ./configure is a snarky no-op
7040 (add-before 'install 'fix-ownership
7041 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
7043 (substitute* "depfun.mak"
7044 ((" -o bin -g bin ") " "))
7046 (add-before 'install 'create-output-directories
7047 (lambda* (#:key outputs #:allow-other-keys)
7048 (let ((out (assoc-ref outputs "out")))
7049 (mkdir-p (string-append out "/share/man/man1"))
7051 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
7052 (synopsis "Take screenshots of one or more Linux text consoles")
7054 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
7055 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
7056 relevant @file{/dev/vcs*} file(s).")
7057 (license license:gpl2)))
7059 (define-public fbcat
7066 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
7067 version "/" name "-" version ".tar.gz"))
7069 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
7070 (build-system gnu-build-system)
7072 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
7073 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
7074 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
7075 `(("pnmtopng" ,netpbm)))
7076 (outputs (list "out" "fbgrab"))
7080 (string-append "PREFIX=" (assoc-ref %outputs "out")))
7081 #:tests? #f ; no tests
7083 (modify-phases %standard-phases
7084 (delete 'configure) ; no configure script
7085 (add-after 'build 'qualify-references
7086 (lambda* (#:key inputs outputs #:allow-other-keys)
7087 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
7088 (out (assoc-ref outputs "out")))
7089 (substitute* "fbgrab"
7091 (string-append out "/bin/" all))
7093 (string-append pnmtopng "/bin/" all)))
7095 (add-after 'install 'split-fbgrab-output
7096 (lambda* (#:key outputs #:allow-other-keys)
7097 (let* ((out (assoc-ref outputs "out"))
7098 (out:fbgrab (assoc-ref outputs "fbgrab")))
7099 (for-each (lambda (file)
7100 (let ((old (string-append out "/" file))
7101 (new (string-append out:fbgrab "/" file)))
7102 (mkdir-p (dirname new))
7103 (rename-file old new)))
7105 "share/man/man1/fbgrab.1"))
7107 (home-page "https://jwilk.net/software/fbcat")
7108 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
7110 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
7111 a dump therof. It supports a wide range of drivers and pixel formats.
7112 @command{fbcat} can take screenshots of virtually any application that can be
7113 made to write its output to the framebuffer, including (but not limited to)
7114 text-mode or graphical applications that don't use a display server.
7116 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
7117 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
7118 (license license:gpl2)))
7120 (define-public libcgroup
7128 "mirror://sourceforge/libcg/" name "/"
7129 version "/" name "-" version ".tar.bz2"))
7131 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
7132 (build-system gnu-build-system)
7139 `(("linux-pam" ,linux-pam)))
7140 (home-page "https://sourceforge.net/projects/libcg/")
7141 (synopsis "Control groups management tools")
7142 (description "Control groups is Linux kernel method for process resource
7143 restriction, permission handling and more. This package provides userspace
7144 interface to this kernel feature.")
7145 (license license:lgpl2.1)))
7147 (define-public mbpfan
7155 (url "https://github.com/dgraziotin/mbpfan")
7156 (commit (string-append "v" version))))
7157 (file-name (git-file-name name version))
7159 (base32 "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr"))))
7160 (build-system gnu-build-system)
7162 `(#:tests? #f ; tests ask to be run as root
7163 #:make-flags (let ((out (assoc-ref %outputs "out")))
7164 (list (string-append "DESTDIR=" out)
7165 ,(string-append "CC=" (cc-for-target))))
7167 (modify-phases %standard-phases
7168 (add-after 'unpack 'patch-paths
7170 (substitute* "Makefile"
7173 (delete 'configure)))) ; there's no configure phase
7174 (home-page "https://github.com/dgraziotin/mbpfan")
7175 (synopsis "Control fan speed on Macbooks")
7177 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
7178 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
7179 module. It can be executed as a daemon or in the foreground with root
7181 (license license:gpl3+)))
7186 (version "11.2.185")
7190 (url "https://github.com/intel/opa-psm2")
7191 (commit (string-append "PSM2_" version))))
7192 (file-name (git-file-name name version))
7195 "062hg4r6gz7pla9df70nqs5i2a3mp1wszmp4l0g771fykhhrxsjg"))))
7196 (build-system gnu-build-system)
7199 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
7201 #:phases (modify-phases %standard-phases
7203 (add-after 'unpack 'patch-Makefiles
7205 (substitute* "Makefile"
7208 (substitute* "compat/Makefile"
7214 (setenv "DESTDIR" %output)
7215 (invoke "make" "install")
7218 `(("rdma-core" ,rdma-core)
7219 ("numactl" ,numactl)))
7220 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
7222 "This package is low-level user-level Intel's communications interface.
7223 The PSM2 API is a high-performance vendor-specific protocol that provides a
7224 low-level communications interface for the Intel Omni-Path family of
7225 high-speed networking devices.")
7226 (home-page "https://github.com/intel/opa-psm2")
7227 ;; Only the x86_64 architecure is supported.
7228 (supported-systems '("x86_64-linux"))
7229 (license (list license:bsd-3 license:gpl2)))) ; dual
7231 (define-public libpfm4
7237 (uri (string-append "mirror://sourceforge/perfmon2/"
7238 name "/libpfm-" version ".tar.gz"))
7241 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
7242 (build-system gnu-build-system)
7244 '(#:modules ((guix build utils)
7245 (guix build gnu-build-system))
7246 #:phases (modify-phases %standard-phases
7250 (lambda* (#:key inputs outputs #:allow-other-keys)
7251 (let* ((out (assoc-ref outputs "out")))
7256 (lambda* (#:key outputs #:allow-other-keys)
7257 (let* ((out (assoc-ref outputs "out")))
7259 (string-append "PREFIX=" out)
7262 (synopsis "Performance event monitoring library")
7264 "This package provides a library called libpfm4, which is used to develop
7265 monitoring tools exploiting the performance monitoring events such as those
7266 provided by the Performance Monitoring Unit (PMU) of modern processors.
7268 Libpfm4 helps convert from an event name, expressed as a string, to the event
7269 encoding that is either the raw event as documented by the hardware vendor or
7270 the OS-specific encoding. In the latter case, the library is able to prepare
7271 the OS-specific data structures needed by the kernel to setup the event.
7273 libpfm4 provides support for the @code{perf_events} interface, which was
7274 introduced in Linux 2.6.31.")
7275 (home-page "http://perfmon2.sourceforge.net/")
7276 (license license:expat)))
7278 (define-public libnfnetlink
7280 (name "libnfnetlink")
7285 "https://www.netfilter.org/projects/libnfnetlink/files/"
7286 "libnfnetlink-" version ".tar.bz2"))
7289 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
7290 (build-system gnu-build-system)
7291 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
7292 (synopsis "Low-level netfilter netlink communication library")
7294 "@code{libnfnetlink} is the low-level library for netfilter related
7295 kernel/userspace communication. It provides a generic messaging
7296 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
7297 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
7298 management tools in userspace.")
7299 (license license:gpl2)))
7301 (define-public go-netlink
7308 (url "https://github.com/vishvananda/netlink")
7309 (commit (string-append "v" version))))
7310 (file-name (git-file-name name version))
7313 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
7314 (build-system go-build-system)
7316 `(#:import-path "github.com/vishvananda/netlink"))
7318 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
7319 ("go-netns" ,go-netns)))
7320 (home-page "https://github.com/vishvananda/netlink")
7321 (synopsis "Simple netlink library for Go")
7322 (description "The netlink package provides a simple netlink library for
7323 Go. Netlink is the interface a user-space program in Linux uses to
7324 communicate with the kernel. It can be used to add and remove interfaces, set
7325 IP addresses and routes, and configure IPsec.")
7326 (license license:asl2.0)))
7328 (define-public libinih
7335 (url "https://github.com/benhoyt/inih")
7336 (commit (string-append "r" version))))
7337 (file-name (git-file-name name version))
7340 "0dqf5j2sw4hq68rqvxbrsf44ygfzx9ypiyzipk4cvp9aimbvsbc6"))))
7341 (build-system meson-build-system)
7343 '(#:configure-flags '("-Ddistro_install=true" "-Ddefault_library=shared")))
7344 (home-page "https://github.com/benhoyt/inih")
7345 (synopsis "Simple .INI parser library for C")
7346 (description "The inih (INI Not Invented Here) library is a simple .INI file
7347 parser written in C. It's only a couple of pages of code, and it was designed to
7348 be small and simple, so it's good for embedded systems. It's also more or less
7349 compatible with Python's ConfigParser style of .INI files, including RFC
7350 822-style multi-line syntax and name: value entries.")
7351 (license license:bsd-3)))
7353 (define-public xfsprogs
7360 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
7361 "xfsprogs-" version ".tar.gz"))
7364 "1byj53qdwsii35d0f11nz0dl618mpvwy5aa44pc9zg281g2r27ab"))))
7365 (build-system gnu-build-system)
7366 (outputs (list "out" "python"))
7368 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
7370 (modify-phases %standard-phases
7371 (add-after 'install 'separate-python-output
7372 (lambda* (#:key outputs #:allow-other-keys)
7373 (let ((out (assoc-ref outputs "out"))
7374 (python (assoc-ref outputs "python")))
7377 (mkdir-p (string-append python (dirname script)))
7378 (rename-file (string-append out script)
7379 (string-append python script)))
7380 (list "/sbin/xfs_scrub_all"))
7382 (add-after 'install 'install-headers
7384 (invoke "make" "install-dev"))))))
7386 `(("gettext" ,gettext-minimal)))
7388 `(("libinih" ,libinih)
7389 ("libuuid" ,util-linux "lib")
7390 ("python" ,python-wrapper)))
7391 (home-page "https://xfs.wiki.kernel.org/")
7392 (synopsis "XFS file system tools")
7393 (description "This package provides commands to create and check XFS
7395 ;; The library "libhandle" and the headers in "xfslibs-dev" are
7396 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
7397 (license (list license:gpl2 license:lgpl2.1))))
7399 (define-public genext2fs
7406 (url "https://github.com/jeremie-koenig/genext2fs")
7407 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
7408 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
7409 (file-name (git-file-name name version))
7411 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
7412 (build-system gnu-build-system)
7415 (modify-phases %standard-phases
7416 (add-after 'unpack 'apply-debian-patches
7417 ;; Debian changes (the revision after ‘-’ in VERSION) are
7418 ;; maintained as separate patches. Apply those relevant to us.
7422 (invoke "patch" "-p1" "-i"
7423 (string-append "debian/patches/" file-name)))
7424 (list "blocksize+creator.diff" ; add -B/-o options
7425 "byteswap_fix.diff"))
7428 `(("autoconf" ,autoconf)
7429 ("automake" ,automake)))
7430 (home-page "https://github.com/jeremie-koenig/genext2fs")
7431 (synopsis "Generate ext2 file system as a normal user")
7432 (description "This package provides a program to generate an ext2
7433 file system as a normal (non-root) user. It does not require you to mount
7434 the image file to copy files on it, nor does it require that you become
7435 the superuser to make device nodes.")
7436 (license license:gpl2)))
7438 (define-public fakeroot
7443 ;; There are no tags in the repository, so take this snapshot.
7445 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
7446 "fakeroot/fakeroot_" version ".orig.tar.gz"))
7447 (file-name (string-append name "-" version ".tar.gz"))
7450 "0v4m3v1bdqvblwj3vqsb3mllgbci6dsgsydq6765nzvz6n1kd44f"))))
7451 (build-system gnu-build-system)
7454 (modify-phases %standard-phases
7457 ;; The "preroll" script takes care of Autoconf and also
7458 ;; prepares the translated manuals.
7459 (invoke "sh" "./preroll")))
7460 (add-after 'configure 'patch-Makefile
7462 ;; Note: The root of the problem is already in "Makefile.am".
7463 (substitute* "Makefile"
7464 (("/bin/sh") (which "sh")))
7466 (add-after 'unpack 'patch-script
7467 (lambda* (#:key inputs #:allow-other-keys)
7468 (substitute* "scripts/fakeroot.in"
7470 (string-append (assoc-ref inputs "util-linux")
7473 (string-append (assoc-ref inputs "sed")
7476 (string-append (assoc-ref inputs "coreutils")
7479 (add-before 'configure 'setenv
7481 (setenv "LIBS" "-lacl")
7483 (add-before 'check 'prepare-check
7485 (setenv "SHELL" (which "bash"))
7486 (setenv "VERBOSE" "1")
7487 (substitute* "test/t.touchinstall"
7488 ;; We don't have the name of the root user, so use ID=0.
7489 (("grep root") "grep \"\\<0\\>\""))
7490 (substitute* "test/tartest"
7491 ;; We don't have the name of the root group, so use ID=0.
7492 (("ROOTGROUP=root") "ROOTGROUP=0")
7493 ;; We don't have the name of the daemon user, so use IDs.
7494 (("daemon:sys") "1:3")
7496 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
7497 (substitute* "test/compare-tar"
7498 (("tar -tvf") "tar --numeric-owner -tvf"))
7501 `(;; For bootstrapping the package.
7502 ("autoconf" ,autoconf)
7503 ("automake" ,automake)
7504 ("libtool" ,libtool)
7505 ("gettext" ,gettext-minimal)
7509 ("sharutils" ,sharutils)
7514 ("util-linux" ,util-linux)
7516 ("coreutils" ,coreutils)))
7517 (synopsis "Provides a fake root environment")
7518 (description "@command{fakeroot} runs a command in an environment where
7519 it appears to have root privileges for file manipulation. This is useful
7520 for allowing users to create archives (tar, ar, .deb etc.) with files in
7521 them with root permissions/ownership. Without fakeroot one would have to
7522 have root privileges to create the constituent files of the archives with
7523 the correct permissions and ownership, and then pack them up, or one would
7524 have to construct the archives directly, without using the archiver.")
7525 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
7526 (license license:gpl3+)))
7528 (define-public fakechroot
7535 "https://github.com/dex4er/fakechroot/releases/download/"
7536 version "/fakechroot-" version ".tar.gz"))
7539 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
7540 (build-system gnu-build-system)
7542 ;; XXX: The tests heavily assume they run on an FHS system so for now
7545 #:configure-flags '("--disable-static")))
7546 (synopsis "Emulate @code{chroot} by overriding file system calls")
7548 "@command{fakechroot} runs a command in an environment were is additional
7549 possibility to use @code{chroot} command without root privileges. This is
7550 useful for allowing users to create own chrooted environment with possibility
7551 to install another packages without need for root privileges.
7553 It works by providing @file{libfakechroot.so}, a shared library meant to be
7554 set as @code{LD_PRELOAD} to override the C library file system functions.")
7555 (home-page "https://github.com/dex4er/fakechroot/")
7556 (license license:lgpl2.1+)))
7558 (define-public inputattach
7560 (name "inputattach")
7565 (url "https://github.com/linuxwacom/input-wacom")
7566 (commit (string-append "input-wacom-" version))))
7567 (file-name (git-file-name name version))
7569 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
7570 (build-system gnu-build-system)
7573 (modify-phases %standard-phases
7577 (lambda* (#:key inputs #:allow-other-keys)
7578 (with-directory-excursion "inputattach"
7579 (invoke (string-append (assoc-ref inputs "gcc")
7581 "-O2" "-o" "inputattach" "inputattach.c"))
7585 (lambda* (#:key outputs #:allow-other-keys)
7586 (let ((target-dir (string-append
7587 (assoc-ref outputs "out")
7589 (mkdir-p target-dir)
7590 (copy-file "inputattach/inputattach"
7591 (string-append target-dir
7594 (home-page "https://linuxwacom.github.io/")
7595 (synopsis "Dispatch input peripherals events to a device file")
7596 (description "inputattach dispatches input events from several device
7597 types and interfaces and translates so that the X server can use them.")
7598 (license license:gpl2+)))
7600 (define-public pipewire
7607 (url "https://github.com/PipeWire/pipewire")
7609 (file-name (git-file-name name version))
7612 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
7613 (build-system meson-build-system)
7615 '(#:configure-flags '("-Dsystemd=false")))
7617 `(("pkg-config" ,pkg-config)))
7619 `(("alsa-lib" ,alsa-lib)
7623 ("gstreamer" ,gstreamer)
7624 ("gst-plugins-base" ,gst-plugins-base)
7628 (home-page "https://pipewire.org/")
7629 (synopsis "Server and user space API to deal with multimedia pipelines")
7631 "PipeWire is a project that aims to greatly improve handling of audio and
7632 video under Linux. It aims to support the usecases currently handled by both
7633 PulseAudio and Jack and at the same time provide same level of powerful handling
7634 of Video input and output. It also introduces a security model that makes
7635 interacting with audio and video devices from containerized applications easy,
7636 with supporting Flatpak applications being the primary goal. Alongside Wayland
7637 and Flatpak we expect PipeWire to provide a core building block for the future
7638 of Linux application development.")
7639 (license license:lgpl2.0+)))
7641 (define-public pipewire-0.3
7649 (url "https://github.com/PipeWire/pipewire")
7651 (file-name (git-file-name name version))
7654 "1ywna5f5v8s79ivrqfwwc8vy6sn3a2zvfwqyalf1fypj5d90w8g9"))))
7657 (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
7658 "/lib/udev/rules.d")
7661 (modify-phases %standard-phases
7662 ;; Skip shrink-runpath, otherwise validate-runpath fails.
7663 (delete 'shrink-runpath))))
7665 (append (package-inputs pipewire)
7668 ("pulseaudio" ,pulseaudio)
7669 ("vulkan-loader" ,vulkan-loader)
7670 ("vulkan-headers" ,vulkan-headers))))))
7679 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7681 (file-name (git-file-name name version))
7684 "1zzpbfdpmfldd7w0h7mwbq0mfqgqwz54nqbq0rmbqlqqpwlkrgb2"))))
7685 (build-system gnu-build-system)
7688 (modify-phases %standard-phases
7689 (add-after 'unpack 'fix-dbus-tests
7691 (substitute* '("unit/test-dbus-message-fds.c"
7692 "unit/test-dbus-properties.c"
7694 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7699 `(("autoconf" ,autoconf)
7700 ("libtool" ,libtool)
7701 ("pkgconfig" ,pkg-config)
7702 ("automake" ,automake)))
7703 (home-page "https://01.org/ell")
7704 (synopsis "Embedded Linux Library")
7705 (description "The Embedded Linux* Library (ELL) provides core, low-level
7706 functionality for system daemons. It typically has no dependencies other than
7707 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7708 ELL is designed to be efficient and compact enough for use on embedded Linux
7709 platforms, it is not limited to resource-constrained systems.")
7710 (license license:lgpl2.1+)))
7712 (define-public lttng-ust
7718 (uri (string-append "https://lttng.org/files/lttng-ust/"
7719 "lttng-ust-" version ".tar.bz2"))
7722 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7723 (build-system gnu-build-system)
7725 `(("liburcu" ,liburcu)
7726 ("numactl" ,numactl)))
7728 `(("python" ,python-3)))
7729 (home-page "https://lttng.org/")
7730 (synopsis "LTTng userspace tracer libraries")
7731 (description "The user space tracing library, liblttng-ust, is the LTTng
7732 user space tracer. It receives commands from a session daemon, for example to
7733 enable and disable specific instrumentation points, and writes event records
7734 to ring buffers shared with a consumer daemon.")
7735 (license license:lgpl2.1+)))
7737 (define-public kexec-tools
7739 (name "kexec-tools")
7743 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7744 "/kexec/kexec-tools-" version ".tar.xz"))
7747 "1hj9mj6x3qs9c8x8mrri9xd3wsg3gwzbab3jfa5ry146xm4pzjcn"))))
7748 (build-system gnu-build-system)
7750 ;; There are no automated tests.
7752 (home-page "https://projects.horms.net/projects/kexec/")
7753 (synopsis "Tools for booting directly into different kernels")
7754 (description "This package provides the @code{kexec} program and ancillary
7755 utilities. Using @code{kexec}, it is possible to boot directly into a new
7756 kernel from the context of an already-running kernel, bypassing the normal
7757 system boot process.")
7758 (license license:gpl2)))
7760 (define-public cachefilesd
7762 (name "cachefilesd")
7767 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7768 "/cachefilesd.git/snapshot/cachefilesd-"
7772 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7773 (build-system gnu-build-system)
7776 `(#:tests? #f ; there are no tests
7778 (let ((prefix-dir (lambda (var dir)
7779 (string-append var "=" %output "/" dir))))
7780 (list (string-append "CC=" ,(cc-for-target))
7781 (prefix-dir "SBINDIR" "sbin/")
7782 (prefix-dir "ETCDIR" "etc/")
7783 (prefix-dir "MANDIR" "share/man/")))
7784 #:phases (modify-phases %standard-phases (delete 'configure))))
7785 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7786 (synopsis "CacheFiles userspace management daemon")
7787 (description "@code{cachefilesd} is a userspace daemon that manages the
7788 cache data store that is used by network file systems such as @code{AFS} and
7789 @code{NFS} to cache data locally on disk. The content of the cache is
7790 persistent over reboots.")
7791 (license license:gpl2+)))
7793 (define-public libbpf
7801 (url "https://github.com/libbpf/libbpf")
7802 (commit (string-append "v" version))))
7803 (file-name (git-file-name name version))
7806 "0ilnnm4q22f8fagwp8kb37licy4ks861i2iqh2djsypqhnxvx3fv"))))
7807 (build-system gnu-build-system)
7809 `(("pkg-config" ,pkg-config)))
7811 ;; In Requires.private of libbpf.pc.
7812 `(("libelf" ,libelf)
7815 `(#:tests? #f ; no tests
7818 (string-append "PREFIX=" (assoc-ref %outputs "out"))
7819 (string-append "LIBDIR=$(PREFIX)/lib")
7821 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
7823 (modify-phases %standard-phases
7825 (add-before 'build 'pre-build
7829 (home-page "https://github.com/libbpf/libbpf")
7830 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
7832 "Libbpf supports building BPF CO-RE-enabled applications, which, in
7833 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
7835 (license `(,license:lgpl2.1 ,license:bsd-2))))
7845 (url "https://github.com/iovisor/bcc")
7846 (commit (string-append "v" version))))
7847 (file-name (git-file-name name version))
7850 "1367c0bzrpclvjvmk0sxgi49rh7j2f9izqk5a7g3yvawh1fmvvjh"))))
7851 (build-system cmake-build-system)
7856 `(("clang-toolchain" ,clang-toolchain)
7857 ("libbpf" ,(package-source libbpf))
7858 ;; LibElf required but libelf does not contain
7859 ;; archives, only object files.
7860 ;; https://github.com/iovisor/bcc/issues/504
7861 ("elfutils" ,elfutils)
7862 ("linux-libre-headers" ,linux-libre-headers)
7864 ("python-wrapper" ,python-wrapper)))
7866 `(;; Tests all require root permissions and a "standard" file hierarchy.
7869 (let ((revision ,version))
7870 `(,(string-append "-DREVISION=" revision)))
7872 (modify-phases %standard-phases
7873 ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
7874 (add-after 'unpack 'copy-libbpf
7875 (lambda* (#:key inputs #:allow-other-keys)
7876 (delete-file-recursively "src/cc/libbpf")
7878 (assoc-ref inputs "libbpf") "src/cc/libbpf")))
7879 (add-after 'copy-libbpf 'substitute-libbc
7880 (lambda* (#:key outputs #:allow-other-keys)
7881 (substitute* "src/python/bcc/libbcc.py"
7882 (("(libbcc\\.so.*)\\b" _ libbcc)
7884 (assoc-ref outputs "out") "/lib/" libbcc)))))
7885 (add-after 'install 'wrap-tools
7886 (lambda* (#:key outputs #:allow-other-keys)
7887 (use-modules (ice-9 textual-ports))
7888 (let* ((out (assoc-ref outputs "out"))
7889 (lib (string-append out "/lib"))
7890 (tools (string-append out "/share/bcc/tools"))
7892 (lambda (filename _)
7893 (call-with-input-file filename
7895 (string-contains (get-line port)
7898 (lambda (python-executable)
7899 (format #t "Wrapping: ~A.~%" python-executable)
7900 (wrap-program python-executable
7901 `("PYTHONPATH" ":" prefix
7902 (,(string-append lib
7904 ,(version-major+minor
7905 (package-version python))
7906 "/site-packages")))))
7907 (find-files tools python-executable?))
7909 (home-page "https://github.com/iovisor/bcc")
7910 (synopsis "Tools for BPF on Linux")
7912 "BCC is a toolkit for creating efficient kernel tracing and manipulation
7913 programs, and includes several useful tools and examples. It makes use of
7914 extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
7915 that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
7917 (license license:asl2.0)))
7919 (define-public bpftrace
7927 (url "https://github.com/iovisor/bpftrace")
7928 (commit (string-append "v" version))))
7929 (file-name (git-file-name name version))
7931 (base32 "0y4qgm2cpccrsm20rnh92hqplddqsc5q5zhw9nqn2igm3h9i0z7h"))
7932 (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
7933 (build-system cmake-build-system)
7939 ("clang-toolchain" ,clang-toolchain)
7940 ("elfutils" ,elfutils)
7942 ("linux-libre-headers" ,linux-libre-headers)))
7944 `(#:tests? #f ;Tests require googletest sources.
7946 '("-DBUILD_TESTING=OFF"
7947 ;; FIXME: libbfd misses some link dependencies, when fixed, remove
7948 ;; the associated patch.
7949 "-DHAVE_BFD_DISASM=OFF")))
7950 (home-page "https://github.com/iovisor/bpftrace")
7951 (synopsis "High-level tracing language for Linux eBPF")
7953 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
7954 Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
7955 LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
7956 interacting with the Linux BPF system, as well as existing Linux tracing
7957 capabilities: kernel dynamic tracing (kprobes), user-level dynamic
7958 tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
7959 and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
7960 created by Alastair Robertson.")
7961 (license license:asl2.0)))
7963 (define-public ttyebus-linux-module
7964 (let ((revision "0")
7965 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
7967 (name "ttyebus-linux-module")
7968 (version (git-version "1.5" revision commit))
7973 (url "https://github.com/eBUS/ttyebus")
7974 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
7975 (file-name (git-file-name name version))
7978 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
7979 (supported-systems '("armhf-linux" "aarch64-linux"))
7980 (build-system linux-module-build-system)
7983 (home-page "https://github.com/eBUS/ttyebus")
7984 (synopsis "Low-latency Raspberry Pi UART driver")
7985 (description "This package provides a Linux kernel module that will
7986 provide a serial device @code{/dev/ttyebus} with almost no latency upon
7987 receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
7988 (license license:gpl3+))))
7990 (define-public ipset
7997 (uri (string-append "https://ipset.netfilter.org/"
7998 "ipset-" version ".tar.bz2"))
8000 (base32 "0zdzp9fhpp6hmirzxy7w27fb9xx9lxd2ykxbn8by7ngi62nvll9i"))))
8001 (build-system gnu-build-system)
8003 `(("libmnl" ,libmnl)))
8005 `(("pkg-config" ,pkg-config)))
8007 `(#:configure-flags '("--with-kmod=no")))
8008 (home-page "https://ipset.netfilter.org/")
8009 (synopsis "Administration tool for IP sets")
8010 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
8011 can be administered by the ipset utility. Depending on the type,
8012 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
8013 IP addresses with MAC addresses in a way which ensures lightning speed
8014 when matching an entry against a set.
8018 @item store multiple IP addresses or port numbers and match against the entire
8019 collection using a single iptables rule.
8020 @item dynamically update iptables rules against IP addresses or ports without
8021 performance penalty.
8022 @item express complex IP address and ports based rulesets with a single
8023 iptables rule and benefit from the speed of IP sets.
8025 then IP sets may be the proper tool for you.")
8026 (license license:gpl2+)))
8028 (define-public liburing
8035 (url "https://git.kernel.dk/liburing")
8036 (commit (string-append "liburing-" version))))
8037 (file-name (git-file-name name version))
8040 "15z44l7y4c6s6dlf7v8lq4znlsjbja2r4ifbni0l8cdcnq0w3zh3"))))
8041 (build-system gnu-build-system)
8043 `(;; Tests are dependent on kernel version and features
8046 (modify-phases %standard-phases
8048 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
8049 ;; --enable-fast-install, and --build
8050 (lambda* (#:key outputs #:allow-other-keys)
8051 (let ((out (assoc-ref outputs "out")))
8052 (setenv "SHELL" (which "sh"))
8053 (setenv "CONFIG_SHELL" (which "sh"))
8054 (invoke "./configure" (string-append "--prefix=" out))))))))
8055 (home-page "https://github.com/axboe/liburing")
8056 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
8057 (description "This is the io_uring library, liburing. liburing provides
8058 helpers to setup and teardown io_uring instances, and also a simplified
8059 interface for applications that don't need (or want) to deal with the full
8060 kernel side implementation.")
8061 (license license:expat)))
8063 (define-public erofs-utils
8065 (name "erofs-utils")
8071 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
8072 (commit (string-append "v" version))))
8073 (file-name (git-file-name name version))
8075 (base32 "1vb4mxsb59g29x7l22cffsqa8x743sra4j5zbmx89hjwpwm9vvcg"))))
8076 (build-system gnu-build-system)
8079 ("libuuid" ,util-linux "lib")))
8081 `(("autoconf" ,autoconf)
8082 ("automake" ,automake)
8083 ("libtool" ,libtool)
8084 ("pkg-config" ,pkg-config)))
8085 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
8086 (synopsis "User-space tools for EROFS file system")
8087 (description "EROFS (Enhanced Read-Only File System) is a compressed,
8088 read-only file system optimized for resource-scarce devices. This package
8089 provides user-space tools for creating EROFS file systems.")
8090 (license license:gpl2+)))
8092 (define-public rasdaemon
8100 (url "https://github.com/mchehab/rasdaemon")
8101 (commit (string-append "v" version))))
8102 (file-name (git-file-name name version))
8104 (base32 "13g39x19lfjf9izdcb0nlyfjrgpliivhv4nw3ndgyzi59l3yqc0v"))))
8105 (native-inputs `(("autoconf" ,autoconf)
8106 ("automake" ,automake)
8107 ("libtool" ,libtool)))
8108 (inputs `(("sqlite" ,sqlite)))
8110 `(#:configure-flags '("--enable-all"
8111 "--localstatedir=/var")
8113 (modify-phases %standard-phases
8114 (add-before 'configure 'munge-autotools
8116 ;; For some reason upstream forces sysconfdir=/etc. This results
8117 ;; in EPERM during the install phase. Removing the offending
8118 ;; line lets sysconfdir correctly pick up DESTDIR.
8119 (substitute* "configure.ac"
8120 (("^test .* sysconfdir=/etc\n$") ""))
8121 ;; Upstream tries to create /var/lib/rasdaemon at install time.
8122 ;; This results in EPERM on guix. Instead, the service should
8123 ;; create this at activation time.
8124 (substitute* "Makefile.am"
8125 (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") "")))))))
8126 (build-system gnu-build-system)
8127 (home-page "https://github.com/mchehab/rasdaemon")
8128 (synopsis "Platform Reliability, Availability, and Serviceability tools")
8130 "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
8131 Availability and Serviceability} reports from Linux kernel trace events.
8132 These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
8133 through standard log mechanisms like syslog.")
8134 (license license:gpl2)))