gnu: procenv: Don't use unstable tarball.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
24a4a635 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
35dfcdd7 3;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
233e7676 4;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
ec80220c 5;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
31aa4379 6;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
e1e27737 7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
a428fdd4 8;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
1348185a 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
e0dde179 10;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
7994250f 11;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
96e9f097 12;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
dc9bdb1e 13;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
8a890f3c 14;;; Copyright © 2016, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
35faa006 15;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
9b0942c1 16;;; Copyright © 2016 David Craven <david@craven.ch>
594d740d 17;;; Copyright © 2016 John Darrington <jmd@gnu.org>
71e0f1e9 18;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
5849c68a 19;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
440a3143 20;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
3c986a7d 21;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
af23710f 22;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
01be4f93 23;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
189d8422 24;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
9b70f2c3 25;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
1113386b 26;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
9cb4bda2 27;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
3116c8b5 28;;; Copyright © 2017 nee <nee-git@hidamari.blue>
a73e7dd3 29;;; Copyright © 2017 Dave Love <fx@gnu.org>
25637b77 30;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
e74b2c8e 31;;; Copyright © 2018, 2020 Brendan Tildesley <mail@brendan.scot>
a0a273c1 32;;; Copyright © 2018 Manuel Graf <graf@init.at>
ff598353 33;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
b2a5ef2e 34;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
bf2a9969 35;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
76f5428b 36;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
71bd55cb 37;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
2f3c0fb3 38;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
9844848b 39;;; Copyright © 2019, 2020 Brice Waegeneire <brice@waegenei.re>
8c6c97de 40;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
baa195dd 41;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
a69bc738 42;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
dedbdacf 43;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
c06c7a3a 44;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
11a5ffba 45;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
ddcfc467 46;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
1acf4c59 47;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
fd76c904 48;;;
233e7676 49;;; This file is part of GNU Guix.
fd76c904 50;;;
233e7676 51;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
52;;; under the terms of the GNU General Public License as published by
53;;; the Free Software Foundation; either version 3 of the License, or (at
54;;; your option) any later version.
55;;;
233e7676 56;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
57;;; WITHOUT ANY WARRANTY; without even the implied warranty of
58;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59;;; GNU General Public License for more details.
60;;;
61;;; You should have received a copy of the GNU General Public License
233e7676 62;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 63
1ffa7090 64(define-module (gnu packages linux)
59a43334 65 #:use-module (gnu packages)
0c60cc53 66 #:use-module (gnu packages acl)
75750abb
DC
67 #:use-module (gnu packages admin)
68 #:use-module (gnu packages algebra)
624ee211 69 #:use-module (gnu packages audio)
75750abb 70 #:use-module (gnu packages autotools)
1eacffb9 71 #:use-module (gnu packages backup)
75750abb 72 #:use-module (gnu packages base)
c7adafa7 73 #:use-module (gnu packages bash)
75750abb
DC
74 #:use-module (gnu packages bison)
75 #:use-module (gnu packages calendar)
76 #:use-module (gnu packages check)
e385e957 77 #:use-module (gnu packages crypto)
17a21bcf 78 #:use-module (gnu packages cryptsetup)
f61e0e79 79 #:use-module (gnu packages compression)
255d1bbe 80 #:use-module (gnu packages dbm)
b3ed50e6 81 #:use-module (gnu packages datastructures)
75750abb
DC
82 #:use-module (gnu packages docbook)
83 #:use-module (gnu packages documentation)
84 #:use-module (gnu packages elf)
1ffa7090 85 #:use-module (gnu packages flex)
afc9d8ec 86 #:use-module (gnu packages file)
75750abb
DC
87 #:use-module (gnu packages freedesktop)
88 #:use-module (gnu packages gcc)
89 #:use-module (gnu packages gettext)
90 #:use-module (gnu packages glib)
626de0d1 91 #:use-module (gnu packages golang)
d7d42d6b 92 #:use-module (gnu packages gperf)
8c6c97de 93 #:use-module (gnu packages gstreamer)
75750abb 94 #:use-module (gnu packages gtk)
8a890f3c 95 #:use-module (gnu packages haskell-apps)
76f5428b 96 #:use-module (gnu packages haskell-xyz)
1d484507 97 #:use-module (gnu packages libunwind)
1ffa7090 98 #:use-module (gnu packages libusb)
01be4f93 99 #:use-module (gnu packages man)
75750abb 100 #:use-module (gnu packages maths)
dfe93c9a 101 #:use-module (gnu packages multiprecision)
1ffa7090 102 #:use-module (gnu packages ncurses)
8d8d227b 103 #:use-module (gnu packages netpbm)
c7adafa7 104 #:use-module (gnu packages networking)
f8f44dd7 105 #:use-module (gnu packages ninja)
aff0cce9 106 #:use-module (gnu packages nss)
1ffa7090 107 #:use-module (gnu packages perl)
75750abb 108 #:use-module (gnu packages pciutils)
1ffa7090 109 #:use-module (gnu packages pkg-config)
0d74462a 110 #:use-module (gnu packages popt)
75750abb 111 #:use-module (gnu packages pulseaudio)
7c0dbe78 112 #:use-module (gnu packages python)
e68f954e 113 #:use-module (gnu packages python-xyz)
75750abb
DC
114 #:use-module (gnu packages readline)
115 #:use-module (gnu packages rrdtool)
62b28c0e 116 #:use-module (gnu packages samba)
8c6c97de 117 #:use-module (gnu packages sdl)
9a3d176e 118 #:use-module (gnu packages serialization)
b1fb4b23 119 #:use-module (gnu packages slang)
f57d2639 120 #:use-module (gnu packages texinfo)
75343704 121 #:use-module (gnu packages tls)
b3ed50e6 122 #:use-module (gnu packages valgrind)
7d2511bc 123 #:use-module (gnu packages video)
7f412f33 124 #:use-module (gnu packages web)
7d2511bc 125 #:use-module (gnu packages xiph)
75750abb 126 #:use-module (gnu packages xml)
58c4f11e
TGR
127 #:use-module (gnu packages xdisorg)
128 #:use-module (gnu packages xorg)
a73e7dd3 129 #:use-module (gnu packages groff)
e8ded3ee 130 #:use-module (gnu packages rsync)
a73e7dd3 131 #:use-module (gnu packages selinux)
3eb7c000 132 #:use-module (gnu packages swig)
220193ad 133 #:use-module (guix build-system cmake)
75750abb 134 #:use-module (guix build-system gnu)
626de0d1 135 #:use-module (guix build-system go)
8c6c97de 136 #:use-module (guix build-system meson)
e102f940 137 #:use-module (guix build-system python)
a94546ec 138 #:use-module (guix build-system trivial)
6a8c4b9e 139 #:use-module (guix build-system linux-module)
75750abb 140 #:use-module (guix download)
6d31c175 141 #:use-module (guix git-download)
75750abb
DC
142 #:use-module ((guix licenses) #:prefix license:)
143 #:use-module (guix packages)
1ad9c105
MW
144 #:use-module (guix gexp)
145 #:use-module (guix store)
146 #:use-module (guix monads)
75750abb 147 #:use-module (guix utils)
adddd5ba 148 #:use-module (srfi srfi-1)
17db0706 149 #:use-module (srfi srfi-2)
a94546ec
LC
150 #:use-module (srfi srfi-26)
151 #:use-module (ice-9 match))
fd76c904 152
aaf4cb20
LC
153(define-public (system->linux-architecture arch)
154 "Return the Linux architecture name for ARCH, a Guix system name such as
6d7ef2aa 155\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
618cea69
NK
156 (let ((arch (car (string-split arch #\-))))
157 (cond ((string=? arch "i686") "i386")
158 ((string-prefix? "mips" arch) "mips")
aaf4cb20 159 ((string-prefix? "arm" arch) "arm")
503275e9 160 ((string-prefix? "aarch64" arch) "arm64")
605fec78 161 ((string-prefix? "alpha" arch) "alpha")
c89e2107 162 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
b91004c2 163 ((string-prefix? "s390" arch) "s390")
7180dd67 164 ((string-prefix? "riscv" arch) "riscv")
618cea69
NK
165 (else arch))))
166
440a3143
CSLL
167(define-public (system->defconfig system)
168 "Some systems (notably powerpc-linux) require a special target for kernel
70c68ed5 169defconfig. Return the appropriate make target if applicable, otherwise return
440a3143
CSLL
170\"defconfig\"."
171 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
c89e2107 172 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
440a3143
CSLL
173 (else "defconfig")))
174
1ad9c105
MW
175\f
176;;;
177;;; Kernel source code deblobbing.
178;;;
179
180(define (linux-libre-deblob-scripts version
181 deblob-hash
182 deblob-check-hash)
183 (list (version-major+minor version)
184 (origin
185 (method url-fetch)
186 (uri (string-append "https://linux-libre.fsfla.org"
187 "/pub/linux-libre/releases/" version "-gnu/"
188 "deblob-" (version-major+minor version)))
189 (sha256 deblob-hash))
190 (origin
191 (method url-fetch)
192 (uri (string-append "https://linux-libre.fsfla.org"
193 "/pub/linux-libre/releases/" version "-gnu/"
194 "deblob-check"))
195 (sha256 deblob-check-hash))))
196
21569e53
VC
197(define deblob-scripts-5.7
198 (linux-libre-deblob-scripts
199 "5.7.1"
200 (base32 "1c0n39wg6xij4x63ppg0m80kfcffkn3iilm3chyiix09n9g7vb78")
201 (base32 "02is246xaql1br3kizqicrkp982nw4gdwpn7nlzjazvsmyd1hcv2")))
202
952820c5 203(define deblob-scripts-5.4
9e34a5f3 204 (linux-libre-deblob-scripts
00e0240e 205 "5.4.37"
952820c5 206 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
00e0240e 207 (base32 "10qb890is4z58vr8czh3xx69q62l3b3j38y410kgiw8nii3zx5lr")))
9e34a5f3 208
1ad9c105
MW
209(define deblob-scripts-4.19
210 (linux-libre-deblob-scripts
856650d9 211 "4.19.103"
1ad9c105 212 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
cf5c44a3 213 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
1ad9c105
MW
214
215(define deblob-scripts-4.14
216 (linux-libre-deblob-scripts
856650d9 217 "4.14.170"
1ad9c105 218 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
cf5c44a3 219 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
1ad9c105
MW
220
221(define deblob-scripts-4.9
222 (linux-libre-deblob-scripts
856650d9 223 "4.9.213"
1ad9c105 224 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
cf5c44a3 225 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
1ad9c105
MW
226
227(define deblob-scripts-4.4
228 (linux-libre-deblob-scripts
856650d9 229 "4.4.213"
1ad9c105 230 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
cf5c44a3 231 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
1ad9c105
MW
232
233(define* (computed-origin-method gexp-promise hash-algo hash
234 #:optional (name "source")
235 #:key (system (%current-system))
236 (guile (default-guile)))
237 "Return a derivation that executes the G-expression that results
238from forcing GEXP-PROMISE."
239 (mlet %store-monad ((guile (package->derivation guile system)))
240 (gexp->derivation (or name "computed-origin")
241 (force gexp-promise)
242 #:graft? #f ;nothing to graft
243 #:system system
244 #:guile-for-build guile)))
245
246(define (make-linux-libre-source version
247 upstream-source
248 deblob-scripts)
249 "Return a 'computed' origin that generates a Linux-libre tarball from the
250corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
251 (match deblob-scripts
252 ((deblob-version (? origin? deblob) (? origin? deblob-check))
253 (unless (string=? deblob-version (version-major+minor version))
254 ;; The deblob script cannot be expected to work properly on a
255 ;; different version (major+minor) of Linux, even if no errors
256 ;; are signaled during execution.
257 (error "deblob major+minor version mismatch"))
258 (origin
259 (method computed-origin-method)
260 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
261 (sha256 #f)
262 (uri
263 (delay
264 (with-imported-modules '((guix build utils))
265 #~(begin
266 (use-modules (guix build utils)
267 (srfi srfi-1)
268 (ice-9 match)
269 (ice-9 ftw))
270 (let ((dir (string-append "linux-" #$version)))
271
272 (mkdir "/tmp/bin")
273 (set-path-environment-variable
274 "PATH" '("bin")
275 (list "/tmp"
276 #+(canonical-package bash)
277 #+(canonical-package coreutils)
278 #+(canonical-package diffutils)
279 #+(canonical-package findutils)
280 #+(canonical-package patch)
281 #+(canonical-package xz)
282 #+(canonical-package sed)
283 #+(canonical-package grep)
284 #+(canonical-package bzip2)
285 #+(canonical-package gzip)
286 #+(canonical-package tar)
287 ;; The comments in the 'deblob-check' script
288 ;; claim that it supports Python 2 and 3, but
289 ;; in fact it fails when run in Python 3 as
290 ;; of version 5.1.3.
291 #+python-2))
292
293 (with-directory-excursion "/tmp/bin"
294
295 (copy-file #+deblob "deblob")
296 (chmod "deblob" #o755)
297 (substitute* "deblob"
298 (("/bin/sh") (which "sh")))
299
300 (copy-file #+deblob-check "deblob-check")
301 (chmod "deblob-check" #o755)
302 (substitute* "deblob-check"
303 (("/bin/sh") (which "sh"))
304 (("/bin/sed") (which "sed"))
305 (("/usr/bin/python") (which "python"))))
306
307 (if (file-is-directory? #+upstream-source)
308 (begin
309 (format #t "Copying upstream linux source...~%")
310 (force-output)
311 (invoke "cp" "--archive" #+upstream-source dir)
312 (invoke "chmod" "--recursive" "u+w" dir))
313 (begin
314 (format #t "Unpacking upstream linux tarball...~%")
315 (force-output)
316 (invoke "tar" "xf" #$upstream-source)
317 (match (scandir "."
318 (lambda (name)
319 (and (not (member name '("." "..")))
320 (file-is-directory? name))))
321 ((unpacked-dir)
322 (unless (string=? dir unpacked-dir)
323 (rename-file unpacked-dir dir)))
324 (dirs
325 (error "multiple directories found" dirs)))))
326
327 (with-directory-excursion dir
328 (setenv "PYTHON" (which "python"))
329 (format #t "Running deblob script...~%")
330 (force-output)
331 (invoke "/tmp/bin/deblob"))
332
333 (format #t "~%Packing new Linux-libre tarball...~%")
334 (force-output)
d0aff873 335 (invoke "tar" "cvfa" #$output
1ad9c105
MW
336 ;; Avoid non-determinism in the archive.
337 "--mtime=@0"
338 "--owner=root:0"
339 "--group=root:0"
340 "--sort=name"
341 "--hard-dereference"
342 dir))))))))))
343
344\f
345;;;
346;;; Kernel sources.
347;;;
348
6023cc74
LC
349(define (linux-libre-urls version)
350 "Return a list of URLs for Linux-Libre VERSION."
351 (list (string-append
8420c7a3 352 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
6023cc74
LC
353 version "-gnu/linux-libre-" version "-gnu.tar.xz")
354
355 ;; XXX: Work around <http://bugs.gnu.org/14851>.
356 (string-append
357 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
358 version "-gnu.tar.xz")
359
360 ;; Maybe this URL will become valid eventually.
361 (string-append
362 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
363 version "-gnu.tar.xz")))
364
1ad9c105
MW
365(define (%upstream-linux-source version hash)
366 (origin
367 (method url-fetch)
368 (uri (string-append "mirror://kernel.org"
369 "/linux/kernel/v" (version-major version) ".x/"
370 "linux-" version ".tar.xz"))
371 (sha256 hash)))
372
1b131e1f 373
83cbfa20 374(define-public linux-libre-5.7-version "5.7.5")
21569e53
VC
375(define-public linux-libre-5.7-pristine-source
376 (let ((version linux-libre-5.7-version)
83cbfa20 377 (hash (base32 "008bpcvcdbwy3w829zc0s6ighn820nr51y24l6df5qfvah1zjdvc")))
21569e53
VC
378 (make-linux-libre-source version
379 (%upstream-linux-source version hash)
380 deblob-scripts-5.7)))
381
42a2ee1f 382(define-public linux-libre-5.4-version "5.4.48")
952820c5
MW
383(define-public linux-libre-5.4-pristine-source
384 (let ((version linux-libre-5.4-version)
42a2ee1f 385 (hash (base32 "0lqxryxn0bfly337ddhl7m7qdwblxg8i1fsl8v9i9h84rnpxs85z")))
9e34a5f3
TGR
386 (make-linux-libre-source version
387 (%upstream-linux-source version hash)
952820c5 388 deblob-scripts-5.4)))
9e34a5f3 389
d460e737 390(define-public linux-libre-4.19-version "4.19.129")
1ad9c105
MW
391(define-public linux-libre-4.19-pristine-source
392 (let ((version linux-libre-4.19-version)
d460e737 393 (hash (base32 "0p0apfviv699mda5zmqphymfybcm932s5yffhvrpqvy2fpas0yx8")))
1ad9c105
MW
394 (make-linux-libre-source version
395 (%upstream-linux-source version hash)
396 deblob-scripts-4.19)))
397
5a9a4381 398(define-public linux-libre-4.14-version "4.14.185")
1ad9c105
MW
399(define-public linux-libre-4.14-pristine-source
400 (let ((version linux-libre-4.14-version)
5a9a4381 401 (hash (base32 "1iixxwidp53s2i2br58wbx5s69f2jcllb116z73pv7fmd06b2czk")))
1ad9c105
MW
402 (make-linux-libre-source version
403 (%upstream-linux-source version hash)
404 deblob-scripts-4.14)))
405
f1922ee1 406(define-public linux-libre-4.9-version "4.9.228")
1ad9c105
MW
407(define-public linux-libre-4.9-pristine-source
408 (let ((version linux-libre-4.9-version)
f1922ee1 409 (hash (base32 "0d7w2zzs79ywxzfrh4bmk5lw318qbkcb8mcsyyh3cc25qqlz9gwg")))
1ad9c105
MW
410 (make-linux-libre-source version
411 (%upstream-linux-source version hash)
412 deblob-scripts-4.9)))
413
8e5b1728 414(define-public linux-libre-4.4-version "4.4.228")
1ad9c105
MW
415(define-public linux-libre-4.4-pristine-source
416 (let ((version linux-libre-4.4-version)
8e5b1728 417 (hash (base32 "0y1xc5lk8j3p5maarksmh18wy921rgcngzsih7q1a82rah1fsjxr")))
1ad9c105
MW
418 (make-linux-libre-source version
419 (%upstream-linux-source version hash)
420 deblob-scripts-4.4)))
421
422(define %boot-logo-patch
423 ;; Linux-Libre boot logo featuring Freedo and a gnu.
424 (origin
425 (method url-fetch)
426 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
427 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
428 (sha256
429 (base32
430 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
431
432(define %linux-libre-arm-export-__sync_icache_dcache-patch
433 (origin
434 (method url-fetch)
435 (uri (string-append
436 "https://salsa.debian.org/kernel-team/linux"
437 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
438 "/debian/patches/bugfix/arm/"
439 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
440 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
441 (sha256
442 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
443
444(define (source-with-patches source patches)
445 (origin
446 (inherit source)
447 (patches (append (origin-patches source)
448 patches))))
449
21569e53
VC
450(define-public linux-libre-5.7-source
451 (source-with-patches linux-libre-5.7-pristine-source
452 (list %boot-logo-patch
453 %linux-libre-arm-export-__sync_icache_dcache-patch)))
454
952820c5
MW
455(define-public linux-libre-5.4-source
456 (source-with-patches linux-libre-5.4-pristine-source
457 (list %boot-logo-patch
730a4b10
VC
458 %linux-libre-arm-export-__sync_icache_dcache-patch
459 ;; Pinebook Pro patch from linux-next,
460 ;; can be dropped for linux-libre 5.7
461 (search-patch
462 "linux-libre-support-for-Pinebook-Pro.patch"))))
9e34a5f3 463
1ad9c105
MW
464(define-public linux-libre-4.19-source
465 (source-with-patches linux-libre-4.19-pristine-source
466 (list %boot-logo-patch
467 %linux-libre-arm-export-__sync_icache_dcache-patch)))
468
469(define-public linux-libre-4.14-source
470 (source-with-patches linux-libre-4.14-pristine-source
471 (list %boot-logo-patch)))
472
473(define-public linux-libre-4.9-source
474 (source-with-patches linux-libre-4.9-pristine-source
475 (list %boot-logo-patch)))
476
477(define-public linux-libre-4.4-source
478 (source-with-patches linux-libre-4.4-pristine-source
479 (list %boot-logo-patch)))
480
481\f
482;;;
483;;; Kernel headers.
484;;;
485
486(define (make-linux-libre-headers version hash-string)
487 (make-linux-libre-headers* version
488 (origin
489 (method url-fetch)
490 (uri (linux-libre-urls version))
491 (sha256 (base32 hash-string)))))
492
493(define (make-linux-libre-headers* version source)
b450d2b4
DC
494 (package
495 (name "linux-libre-headers")
a15cee50 496 (version version)
1ad9c105 497 (source source)
b450d2b4 498 (build-system gnu-build-system)
a15cee50
CD
499 (native-inputs `(("perl" ,perl)
500 ,@(if (version>=? version "4.16")
501 `(("flex" ,flex)
502 ("bison" ,bison))
e8ded3ee
TGR
503 '())
504 ,@(if (version>=? version "5.3")
505 `(("rsync" ,rsync))
a15cee50 506 '())))
b450d2b4
DC
507 (arguments
508 `(#:modules ((guix build gnu-build-system)
509 (guix build utils)
510 (srfi srfi-1))
511 #:phases
512 (modify-phases %standard-phases
513 (delete 'configure)
514 (replace 'build
515 (lambda _
516 (let ((arch ,(system->linux-architecture
517 (or (%current-target-system)
440a3143
CSLL
518 (%current-system))))
519 (defconfig ,(system->defconfig
520 (or (%current-target-system)
521 (%current-system)))))
b450d2b4 522 (setenv "ARCH" arch)
618cea69 523 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
5dc9ded1
MW
524 (invoke "make" defconfig)
525 (invoke "make" "mrproper" "headers_check"))))
b450d2b4
DC
526 (replace 'install
527 (lambda* (#:key outputs #:allow-other-keys)
80fe5c60 528 (let ((out (assoc-ref outputs "out")))
5dc9ded1
MW
529 (invoke "make"
530 (string-append "INSTALL_HDR_PATH=" out)
531 "headers_install")
b15389e1 532
5dc9ded1
MW
533 (mkdir (string-append out "/include/config"))
534 (call-with-output-file
535 (string-append out
536 "/include/config/kernel.release")
537 (lambda (p)
538 (format p "~a-default~%" ,version)))
b15389e1 539
5dc9ded1
MW
540 ;; Remove the '.install' and '..install.cmd' files; the
541 ;; latter contains store paths, which pulls in bootstrap
542 ;; binaries in the build environment, and prevents bit
543 ;; reproducibility for the bootstrap binaries.
544 (for-each delete-file (find-files out "\\.install"))
545
546 #t))))
b15389e1 547 #:allowed-references ()
80fe5c60 548 #:tests? #f))
6fd52309 549 (home-page "https://www.gnu.org/software/linux-libre/")
80fe5c60
LC
550 (synopsis "GNU Linux-Libre kernel headers")
551 (description "Headers of the Linux-Libre kernel.")
b450d2b4 552 (license license:gpl2)))
80fe5c60 553
21569e53
VC
554(define-public linux-libre-headers-5.7
555 (make-linux-libre-headers* linux-libre-5.7-version
556 linux-libre-5.7-source))
557
952820c5
MW
558(define-public linux-libre-headers-5.4
559 (make-linux-libre-headers* linux-libre-5.4-version
560 linux-libre-5.4-source))
9e34a5f3 561
1ad9c105
MW
562(define-public linux-libre-headers-4.19
563 (make-linux-libre-headers* linux-libre-4.19-version
564 linux-libre-4.19-source))
565
566(define-public linux-libre-headers-4.14
567 (make-linux-libre-headers* linux-libre-4.14-version
568 linux-libre-4.14-source))
569
570(define-public linux-libre-headers-4.9
571 (make-linux-libre-headers* linux-libre-4.9-version
572 linux-libre-4.9-source))
573
574(define-public linux-libre-headers-4.4
575 (make-linux-libre-headers* linux-libre-4.4-version
576 linux-libre-4.4-source))
577
578;; The following package is used in the early bootstrap, and thus must be kept
579;; stable and with minimal build requirements.
429243a4
MB
580(define-public linux-libre-headers-5.4.20
581 (make-linux-libre-headers "5.4.20"
582 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
1ad9c105 583
429243a4 584(define-public linux-libre-headers linux-libre-headers-5.4.20)
1ad9c105
MW
585
586\f
587;;;
588;;; Kernel configurations.
589;;;
3fb7b612 590
c258807a 591(define* (kernel-config arch #:key variant)
a94546ec 592 "Return the absolute file name of the Linux-Libre build configuration file
c258807a 593for ARCH and optionally VARIANT, or #f if there is no such configuration."
7994250f 594 (let* ((name (string-append (if variant (string-append variant "-") "")
25847b32 595 (if (string=? "i386" arch) "i686" arch) ".conf"))
7994250f
AK
596 (file (string-append "linux-libre/" name)))
597 (search-auxiliary-file file)))
a94546ec 598
90c18c32 599(define %default-extra-linux-options
24446ce2
TGR
600 `(;; Some very mild hardening.
601 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
18b3ba6f
VC
602 ;; All kernels should have NAMESPACES options enabled
603 ("CONFIG_NAMESPACES" . #t)
604 ("CONFIG_UTS_NS" . #t)
605 ("CONFIG_IPC_NS" . #t)
606 ("CONFIG_USER_NS" . #t)
607 ("CONFIG_PID_NS" . #t)
608 ("CONFIG_NET_NS" . #t)
24446ce2 609 ;; Modules required for initrd:
b9f7895d
DC
610 ("CONFIG_NET_9P" . m)
611 ("CONFIG_NET_9P_VIRTIO" . m)
612 ("CONFIG_VIRTIO_BLK" . m)
613 ("CONFIG_VIRTIO_NET" . m)
614 ("CONFIG_VIRTIO_PCI" . m)
615 ("CONFIG_VIRTIO_BALLOON" . m)
616 ("CONFIG_VIRTIO_MMIO" . m)
617 ("CONFIG_FUSE_FS" . m)
618 ("CONFIG_CIFS" . m)
619 ("CONFIG_9P_FS" . m)))
90c18c32
DC
620
621(define (config->string options)
622 (string-join (map (match-lambda
623 ((option . 'm)
624 (string-append option "=m"))
625 ((option . #t)
626 (string-append option "=y"))
627 ((option . #f)
628 (string-append option "=n")))
629 options)
630 "\n"))
631
1ad9c105
MW
632\f
633;;;
634;;; Kernel package utilities.
635;;;
636
637(define* (make-linux-libre version hash-string supported-systems
c258807a
DC
638 #:key
639 ;; A function that takes an arch and a variant.
640 ;; See kernel-config for an example.
a6d01325 641 (extra-version #f)
c258807a 642 (configuration-file #f)
90c18c32 643 (defconfig "defconfig")
64de7d1c
MW
644 (extra-options %default-extra-linux-options)
645 (patches (list %boot-logo-patch)))
1ad9c105
MW
646 (make-linux-libre* version
647 (origin
648 (method url-fetch)
649 (uri (linux-libre-urls version))
650 (sha256 (base32 hash-string))
651 (patches patches))
652 supported-systems
653 #:extra-version extra-version
654 #:configuration-file configuration-file
655 #:defconfig defconfig
656 #:extra-options extra-options))
657
658(define* (make-linux-libre* version source supported-systems
659 #:key
660 ;; A function that takes an arch and a variant.
661 ;; See kernel-config for an example.
662 (extra-version #f)
663 (configuration-file #f)
664 (defconfig "defconfig")
665 (extra-options %default-extra-linux-options))
614d1738 666 (package
a6d01325
DC
667 (name (if extra-version
668 (string-append "linux-libre-" extra-version)
669 "linux-libre"))
c258807a 670 (version version)
1ad9c105 671 (source source)
3129b9c2 672 (supported-systems supported-systems)
614d1738 673 (build-system gnu-build-system)
614d1738
DC
674 (native-inputs
675 `(("perl" ,perl)
676 ("bc" ,bc)
677 ("openssl" ,openssl)
78602fad 678 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
81d98d7e
MW
679 ("flex" ,flex)
680 ("bison" ,bison)
ce899af1 681
ce899af1
MW
682 ;; These are needed to compile the GCC plugins.
683 ("gmp" ,gmp)
684 ("mpfr" ,mpfr)
685 ("mpc" ,mpc)
686
64b5e413
LC
687 ,@(match (and configuration-file
688 (configuration-file
689 (system->linux-architecture
690 (or (%current-target-system) (%current-system)))
691 #:variant (version-major+minor version)))
692 (#f ;no config for this platform
693 '())
694 ((? string? config)
695 `(("kconfig" ,config))))))
614d1738
DC
696 (arguments
697 `(#:modules ((guix build gnu-build-system)
698 (guix build utils)
699 (srfi srfi-1)
c5ceec41 700 (srfi srfi-26)
5c79f238 701 (ice-9 ftw)
614d1738
DC
702 (ice-9 match))
703 #:phases
704 (modify-phases %standard-phases
c5bd8753
MW
705 (add-after 'unpack 'patch-/bin/pwd
706 (lambda _
707 (substitute* (find-files "." "^Makefile(\\.include)?$")
708 (("/bin/pwd") "pwd"))
709 #t))
9416459b 710 (replace 'configure
4b42703e 711 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
96e9f097
RN
712 ;; Avoid introducing timestamps
713 (setenv "KCONFIG_NOTIMESTAMP" "1")
714 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
715
4b42703e 716 ;; Set ARCH and CROSS_COMPILE
6d7ef2aa
DC
717 (let ((arch ,(system->linux-architecture
718 (or (%current-target-system)
719 (%current-system)))))
4b42703e
DC
720 (setenv "ARCH" arch)
721 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
6d7ef2aa 722
4b42703e
DC
723 (when target
724 (setenv "CROSS_COMPILE" (string-append target "-"))
725 (format #t "`CROSS_COMPILE' set to `~a'~%"
726 (getenv "CROSS_COMPILE"))))
beacfcab 727
a6d01325
DC
728 (setenv "EXTRA_VERSION" ,extra-version)
729
a94546ec 730 (let ((build (assoc-ref %standard-phases 'build))
65416733 731 (config (assoc-ref (or native-inputs inputs) "kconfig")))
1650dd8a 732
e4e9c0a0
DC
733 ;; Use a custom kernel configuration file or a default
734 ;; configuration file.
1650dd8a
LC
735 (if config
736 (begin
737 (copy-file config ".config")
738 (chmod ".config" #o666))
fdd400d8 739 (invoke "make" ,defconfig))
a94546ec
LC
740
741 ;; Appending works even when the option wasn't in the
742 ;; file. The last one prevails if duplicated.
90c18c32
DC
743 (let ((port (open-file ".config" "a"))
744 (extra-configuration ,(config->string extra-options)))
745 (display extra-configuration port)
a94546ec
LC
746 (close-port port))
747
fdd400d8 748 (invoke "make" "oldconfig"))))
614d1738 749 (replace 'install
4b42703e 750 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
beacfcab
LC
751 (let* ((out (assoc-ref outputs "out"))
752 (moddir (string-append out "/lib/modules"))
5c79f238 753 (dtbdir (string-append out "/lib/dtbs")))
e4e9c0a0
DC
754 ;; Install kernel image, kernel configuration and link map.
755 (for-each (lambda (file) (install-file file out))
d0a39b92 756 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
e4e9c0a0 757 ;; Install device tree files
a8e3fd5f
VC
758 (unless (null? (find-files "." "\\.dtb$"))
759 (mkdir-p dtbdir)
760 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
761 "dtbs_install"))
e4e9c0a0 762 ;; Install kernel modules
beacfcab 763 (mkdir-p moddir)
fdd400d8 764 (invoke "make"
5c79f238
DM
765 ;; Disable depmod because the Guix system's module directory
766 ;; is an union of potentially multiple packages. It is not
767 ;; possible to use depmod to usefully calculate a dependency
768 ;; graph while building only one of those packages.
769 "DEPMOD=true"
fdd400d8
DM
770 (string-append "MODULE_DIR=" moddir)
771 (string-append "INSTALL_PATH=" out)
772 (string-append "INSTALL_MOD_PATH=" out)
773 "INSTALL_MOD_STRIP=1"
5c79f238
DM
774 "modules_install")
775 (let* ((versions (filter (lambda (name)
776 (not (string-prefix? "." name)))
777 (scandir moddir)))
778 (version (match versions
779 ((x) x))))
780 ;; There are symlinks to the build and source directory,
781 ;; both of which will point to target /tmp/guix-build*
782 ;; and thus not be useful in a profile. Delete the symlinks.
783 (false-if-file-not-found
784 (delete-file (string-append moddir "/" version "/build")))
785 (false-if-file-not-found
786 (delete-file (string-append moddir "/" version "/source"))))
787 #t))))
beacfcab 788 #:tests? #f))
f8aa265e 789 (home-page "https://www.gnu.org/software/linux-libre/")
f50d2669 790 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 791 (description
79c311b8
LC
792 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
793It has been modified to remove all non-free binary blobs.")
614d1738 794 (license license:gpl2)))
beacfcab 795
1ad9c105
MW
796\f
797;;;
798;;; Generic kernel packages.
799;;;
adbe6dea 800
952820c5
MW
801(define-public linux-libre-5.4
802 (make-linux-libre* linux-libre-5.4-version
803 linux-libre-5.4-source
b3d25e21 804 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
9e34a5f3
TGR
805 #:configuration-file kernel-config))
806
952820c5
MW
807(define-public linux-libre-version linux-libre-5.4-version)
808(define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
809(define-public linux-libre-source linux-libre-5.4-source)
810(define-public linux-libre linux-libre-5.4)
9a68b89e 811
ff148ea5 812(define-public linux-libre-4.19
1ad9c105
MW
813 (make-linux-libre* linux-libre-4.19-version
814 linux-libre-4.19-source
815 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
816 #:configuration-file kernel-config))
adbe6dea
MW
817
818(define-public linux-libre-4.14
1ad9c105
MW
819 (make-linux-libre* linux-libre-4.14-version
820 linux-libre-4.14-source
821 '("x86_64-linux" "i686-linux" "armhf-linux")
822 #:configuration-file kernel-config))
a15cee50 823
52d901da 824(define-public linux-libre-4.9
1ad9c105
MW
825 (make-linux-libre* linux-libre-4.9-version
826 linux-libre-4.9-source
827 '("x86_64-linux" "i686-linux")
828 #:configuration-file kernel-config))
52d901da 829
75b314a6 830(define-public linux-libre-4.4
1ad9c105
MW
831 (make-linux-libre* linux-libre-4.4-version
832 linux-libre-4.4-source
833 '("x86_64-linux" "i686-linux")
834 #:configuration-file kernel-config
835 #:extra-options
836 (append
837 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
838 ;; This option was removed upstream in version 4.7.
839 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
840 %default-extra-linux-options)))
75b314a6 841
1ad9c105
MW
842\f
843;;;
844;;; Specialized kernel variants.
845;;;
a15cee50 846
403b3a8c 847(define-public linux-libre-arm-generic
1ad9c105
MW
848 (make-linux-libre* linux-libre-version
849 linux-libre-source
850 '("armhf-linux")
851 #:defconfig "multi_v7_defconfig"
6978df6a
VC
852 #:extra-version "arm-generic"
853 #:extra-options
854 (append
855 `(;; needed to fix the RTC on rockchip platforms
856 ("CONFIG_RTC_DRV_RK808" . #t))
857 %default-extra-linux-options)))
1dbb9302 858
076779c4
VC
859(define-public linux-libre-arm-generic-5.7
860 (make-linux-libre* linux-libre-5.7-version
861 linux-libre-5.7-source
862 '("armhf-linux")
863 #:defconfig "multi_v7_defconfig"
864 #:extra-version "arm-generic"
865 #:extra-options
6978df6a
VC
866 (append
867 `(;; needed to fix the RTC on rockchip platforms
868 ("CONFIG_RTC_DRV_RK808" . #t))
869 %default-extra-linux-options)))
3e91ca44 870
1eb27d5c
LF
871(define-public linux-libre-arm-veyron
872 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
873
ff148ea5 874(define-public linux-libre-arm-generic-4.19
1ad9c105
MW
875 (make-linux-libre* linux-libre-4.19-version
876 linux-libre-4.19-source
877 '("armhf-linux")
878 #:defconfig "multi_v7_defconfig"
879 #:extra-version "arm-generic"))
cde7c23f 880
adbe6dea 881(define-public linux-libre-arm-generic-4.14
1ad9c105
MW
882 (make-linux-libre* linux-libre-4.14-version
883 linux-libre-4.14-source
884 '("armhf-linux")
885 #:defconfig "multi_v7_defconfig"
886 #:extra-version "arm-generic"))
adbe6dea 887
f6948189 888(define-public linux-libre-arm-omap2plus
1ad9c105
MW
889 (make-linux-libre* linux-libre-version
890 linux-libre-source
891 '("armhf-linux")
892 #:defconfig "omap2plus_defconfig"
893 #:extra-version "arm-omap2plus"))
ff148ea5
MW
894
895(define-public linux-libre-arm-omap2plus-4.19
1ad9c105
MW
896 (make-linux-libre* linux-libre-4.19-version
897 linux-libre-4.19-source
898 '("armhf-linux")
899 #:defconfig "omap2plus_defconfig"
900 #:extra-version "arm-omap2plus"))
f6948189 901
adbe6dea 902(define-public linux-libre-arm-omap2plus-4.14
1ad9c105
MW
903 (make-linux-libre* linux-libre-4.14-version
904 linux-libre-4.14-source
905 '("armhf-linux")
906 #:defconfig "omap2plus_defconfig"
907 #:extra-version "arm-omap2plus"))
adbe6dea 908
058e96c5
VC
909(define-public linux-libre-arm64-generic
910 (make-linux-libre* linux-libre-version
911 linux-libre-source
912 '("aarch64-linux")
913 #:defconfig "defconfig"
6978df6a
VC
914 #:extra-version "arm64-generic"
915 #:extra-options
916 (append
917 `(;; needed to fix the RTC on rockchip platforms
918 ("CONFIG_RTC_DRV_RK808" . #t))
919 %default-extra-linux-options)))
058e96c5 920
637b64ce
VC
921(define-public linux-libre-arm64-generic-5.7
922 (make-linux-libre* linux-libre-5.7-version
923 linux-libre-5.7-source
924 '("aarch64-linux")
925 #:defconfig "defconfig"
926 #:extra-version "arm64-generic"
927 #:extra-options
928 (append
6978df6a
VC
929 `(;; needed to fix the RTC on rockchip platforms
930 ("CONFIG_RTC_DRV_RK808" . #t))
931 %default-extra-linux-options)))
f97a4279 932
b3d25e21
VC
933(define-public linux-libre-riscv64-generic
934 (make-linux-libre* linux-libre-version
935 linux-libre-source
936 '("riscv64-linux")
937 #:extra-version "riscv64-generic"))
938
e1f640db
TGR
939\f
940;;;
941;;; Linux kernel modules.
942;;;
943
7bf28446 944(define-public acpi-call-linux-module
ae1cda76
TGR
945 (let ((commit "70b9c80bd700e6a4d10797eaac9fd34b7e8cbd4a")
946 (revision "0"))
947 (package
948 (name "acpi-call-linux-module")
949 (version (git-version "3.17" revision commit))
950 (source
951 (origin
952 (method git-fetch)
953 (uri (git-reference
954 (url "https://github.com/teleshoes/acpi_call.git")
955 (commit commit)))
956 (file-name (git-file-name name version))
957 (sha256
958 (base32 "09c1vw6vcrkqxbwhpgfgpj4d1grzn4qq6ka8pwwzm7cvm405xj7x"))))
959 (build-system linux-module-build-system)
960 (arguments
961 `(#:tests? #f ; no tests
962 #:phases
963 (modify-phases %standard-phases
964 (add-after 'install 'install-documentation
965 (lambda* (#:key outputs #:allow-other-keys)
966 (let* ((out (assoc-ref outputs "out"))
967 (doc (string-append out "/share/doc/" ,name "-" ,version)))
968 (for-each (lambda (file)
969 (let ((target (string-append doc "/" file)))
970 (mkdir-p (dirname target))
971 (copy-recursively file target)))
972 (list "README.md" "examples"))
973 #t))))))
974 (home-page "https://github.com/teleshoes/acpi_call")
975 (synopsis "Linux kernel module to perform ACPI method calls")
976 (description
977 "This simple Linux kernel module allows calls from user space to any
7bf28446
TGR
978@acronym{ACPI, Advanced Configuration and Power Interface} method provided by
979your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
44585a0e 980any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
7bf28446
TGR
981and @code{ACPI_BUFFER}.
982
983It grants direct and undocumented access to your hardware that may cause damage
984and should be used with caution, especially on untested models.")
ae1cda76 985 (license license:gpl3+)))) ; see README.md (no licence headers)
7bf28446 986
ce5af131 987(define-public rtl8812au-aircrack-ng-linux-module
44adf883
TGR
988 (let ((commit "df2b8dfd8cb7d9f6cfeb55abaeab8a5372011fc9")
989 (revision "1"))
ce5af131
TGR
990 (package
991 (name "rtl8812au-aircrack-ng-linux-module")
992 (version (git-version "5.6.4.2" revision commit))
993 (source
994 (origin
995 (method git-fetch)
996 (uri (git-reference
997 (url "https://github.com/aircrack-ng/rtl8812au.git")
998 (commit commit)))
999 (file-name (git-file-name name version))
1000 (sha256
44adf883 1001 (base32 "1qcr0j8yhg8l9l0f5y55zcsk1mgf3qd46yh9xfqgg91szxa3yvca"))
ce5af131
TGR
1002 (modules '((guix build utils)))
1003 (snippet
1004 '(begin
1005 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1006 ;; and other unnecessary unlicenced things.
1007 (for-each delete-file-recursively (list "android"
1008 "docs"
1009 "tools"))
1010 #t))))
1011 (build-system linux-module-build-system)
1012 (arguments
de728cb8
TGR
1013 `(#:make-flags
1014 (list (string-append "KSRC="
1015 (assoc-ref %build-inputs "linux-module-builder")
1016 "/lib/modules/build"))
1017 #:phases
ce5af131
TGR
1018 (modify-phases %standard-phases
1019 (replace 'build
de728cb8
TGR
1020 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1021 (apply invoke "make" make-flags))))
ce5af131
TGR
1022 #:tests? #f)) ; no test suite
1023 (supported-systems '("x86_64-linux" "i686-linux"))
1024 (home-page "https://github.com/aircrack-ng/rtl8812au")
1025 (synopsis "Linux driver for Realtek USB wireless network adapters")
1026 (description
1027 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1028network adapters, modified by the aircrack-ng project to support monitor mode
1029and frame injection. It provides a @code{88XXau} kernel module that supports
1030RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1031 (license license:gpl2+))))
1032
f3b075a0
MR
1033(define-public rtl8821ce-linux-module
1034 (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea")
1035 (revision "0"))
1036 (package
1037 (name "rtl8821ce-linux-module")
1038 (version (git-version "0.0.0" revision commit))
1039 (source
1040 (origin
1041 (method git-fetch)
1042 (uri (git-reference
1043 (url "https://github.com/tomaspinho/rtl8821ce.git")
1044 (commit commit)))
1045 (file-name (git-file-name name version))
1046 (sha256
1047 (base32
1048 "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))
1049 (build-system linux-module-build-system)
1050 (arguments
d1fe14be
TGR
1051 `(#:make-flags
1052 (list "CC=gcc"
1053 (string-append "KSRC="
1054 (assoc-ref %build-inputs "linux-module-builder")
1055 "/lib/modules/build"))
1056 #:phases
f3b075a0
MR
1057 (modify-phases %standard-phases
1058 (replace 'build
d1fe14be
TGR
1059 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1060 (apply invoke "make" make-flags))))
1061 #:tests? #f)) ; no test suite
f3b075a0
MR
1062 (home-page "https://github.com/tomaspinho/rtl8821ce")
1063 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1064 (description "This is Realtek's RTL8821CE Linux driver for wireless
1065network adapters.")
1066 (license license:gpl2))))
1067
b40a36ba
MW
1068(define-public vhba-module
1069 (package
1070 (name "vhba-module")
0847e479 1071 (version "20200106")
b40a36ba
MW
1072 (source (origin
1073 (method url-fetch)
1074 (uri (string-append
1075 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1076 version ".tar.bz2"))
1077 (sha256
1078 (base32
0847e479 1079 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
b40a36ba
MW
1080 (build-system linux-module-build-system)
1081 (arguments
1082 ;; TODO: No tests?
1083 `(#:tests? #f))
1084 (home-page "https://cdemu.sourceforge.io/")
1085 (synopsis "Kernel module that emulates SCSI devices")
1086 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1087between the CDemu userspace daemon and linux kernel.")
1088 (license license:gpl2+)))
1089
cc62eab1
PN
1090(define-public bbswitch-module
1091 (package
1092 (name "bbswitch-module")
1093 (version "0.8")
1094 (source (origin
1095 (method git-fetch)
1096 (uri (git-reference
1097 (url "https://github.com/Bumblebee-Project/bbswitch")
1098 (commit (string-append "v" version))))
1099 (file-name (git-file-name name version))
1100 (sha256
1101 (base32
1102 "1glch4j0x1dzlp2yrb67v2r5jg9609jb6p8m251y78m74advqw0l"))))
1103 (build-system linux-module-build-system)
1104 (arguments
1105 ;; No tests.
1106 `(#:tests? #f))
1107 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1108 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1109 (description "The bbswitch module provides a way to toggle the Nvidia
1110graphics card on Optimus laptops.")
1111 (license license:gpl2)))
1112
7eea1de7
BW
1113(define-public ddcci-driver-linux
1114 (package
1115 (name "ddcci-driver-linux")
1116 (version "0.3.3")
1117 (source
1118 (origin
1119 (method git-fetch)
1120 (uri
1121 (git-reference
1122 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1123 (commit (string-append "v" version))))
1124 (file-name (git-file-name name version))
1125 (sha256
1126 (base32
1127 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1128 (build-system linux-module-build-system)
1129 (arguments
1130 `(#:tests? #f ; no tests
1131 #:phases
1132 (modify-phases %standard-phases
1133 (replace 'build
1134 (lambda args
1135 (for-each
1136 (lambda (module)
1137 (with-directory-excursion module
1138 (apply (assoc-ref %standard-phases 'build) args)))
1139 '("ddcci" "ddcci-backlight"))
1140 #t))
1141 (replace 'install
1142 (lambda args
1143 (for-each
1144 (lambda (module)
1145 (with-directory-excursion module
1146 (apply (assoc-ref %standard-phases 'install) args)))
1147 '("ddcci" "ddcci-backlight"))
1148 #t)))))
1149 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1150 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1151 (description "This package provides two Linux kernel drivers, ddcci and
1152ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1153interface. The ddcci module creates a character device for each DDC/CI
1154monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1155module allows the control of the backlight level or luminance property when
1156supported under @file{/sys/class/backlight/}.")
1157 (license license:gpl2+)))
1158
1acf4c59
MS
1159(define-public v4l2loopback-linux-module
1160 (package
1161 (name "v4l2loopback-linux-module")
1162 (version "0.12.5")
1163 (source (origin
1164 (method git-fetch)
1165 (uri (git-reference
1166 (url "https://github.com/umlaeute/v4l2loopback.git")
1167 (commit (string-append "v" version))))
1168 (file-name (git-file-name name version))
1169 (sha256
1170 (base32
1171 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1172 (build-system linux-module-build-system)
c34a7dc2
TGR
1173 (arguments
1174 `(#:tests? #f)) ; no test suite
1acf4c59 1175 (home-page "https://github.com/umlaeute/v4l2loopback")
ecb65812
TGR
1176 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1177 (description
1178 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1179for Linux 2} applications will treat these as ordinary video devices but read
1180video data generated by another application, instead of a hardware device such
1181as a capture card.
1182
1183This lets you apply nifty effects to your Jitsi video, for example, but also
1184allows some more serious things like adding streaming capabilities to an
1185application by hooking GStreamer into the loopback device.")
1acf4c59
MS
1186 (license license:gpl2+)))
1187
97121c2a 1188\f
c84d0eca
LC
1189;;;
1190;;; Pluggable authentication modules (PAM).
1191;;;
1192
fd76c904
LC
1193(define-public linux-pam
1194 (package
1195 (name "linux-pam")
eca24b2f 1196 (version "1.3.1")
fd76c904
LC
1197 (source
1198 (origin
eca24b2f
TGR
1199 (method url-fetch)
1200 (uri (string-append
1201 "https://github.com/linux-pam/linux-pam/releases/download/v"
1202 version "/Linux-PAM-" version ".tar.xz"))
1203 (sha256
1204 (base32
1205 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1206 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
411264c2 1207
fd76c904 1208 (build-system gnu-build-system)
c4c4cc05 1209 (native-inputs
fd76c904
LC
1210 `(("flex" ,flex)
1211
1212 ;; TODO: optional dependencies
1213 ;; ("libxcrypt" ,libxcrypt)
1214 ;; ("cracklib" ,cracklib)
1215 ))
1216 (arguments
ed8111ea 1217 `(;; Most users, such as `shadow', expect the headers to be under
c134056a
LC
1218 ;; `security'.
1219 #:configure-flags (list (string-append "--includedir="
1220 (assoc-ref %outputs "out")
ed8111ea
LC
1221 "/include/security")
1222
1223 ;; XXX: <rpc/rpc.h> is missing from glibc when
1224 ;; cross-compiling, so we have to disable NIS
1225 ;; support altogether.
1226 ,@(if (%current-target-system)
1227 '("--disable-nis")
1228 '()))
c134056a
LC
1229
1230 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1231 ;; isn't available.
1232 #:tests? #f))
fd76c904
LC
1233 (home-page "http://www.linux-pam.org/")
1234 (synopsis "Pluggable authentication modules for Linux")
1235 (description
1236 "A *Free* project to implement OSF's RFC 86.0.
1237Pluggable authentication modules are small shared object files that can
1238be used through the PAM API to perform tasks, like authenticating a user
e881752c 1239at login. Local and dynamic reconfiguration are its key features.")
3ac73271 1240 (license license:bsd-3)))
686f14e8 1241
4c93ce42
EF
1242(define-public linux-pam-1.2
1243 (package
1244 (inherit linux-pam)
4c93ce42
EF
1245 (version "1.2.1")
1246 (source
1247 (origin
1248 (method url-fetch)
1249 (uri (string-append
1250 "http://www.linux-pam.org/library/"
1251 "Linux-PAM-" version ".tar.bz2"))
1252 (sha256
1253 (base32
411264c2
RS
1254 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1255 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
4c93ce42 1256
53142109 1257
c84d0eca
LC
1258;;;
1259;;; Miscellaneous.
1260;;;
1261
510a8eb1
TGR
1262(define-public powerstat
1263 (package
1264 (name "powerstat")
1265 (version "0.02.22")
1266 (source
1267 (origin
1268 (method url-fetch)
1269 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1270 "powerstat/powerstat-" version ".tar.gz"))
1271 (sha256
1272 (base32 "0r355b9syqa2nhfy8ksvxyy5d58v0isf983842js091s6liy0x7g"))))
1273 (build-system gnu-build-system)
1274 (arguments
1275 `(#:make-flags
1ca44ae3
MB
1276 (list (string-append "CC=" ,(cc-for-target))
1277 (string-append "prefix=" (assoc-ref %outputs "out")))
510a8eb1
TGR
1278 #:tests? #f ; no test suite
1279 #:phases
1280 (modify-phases %standard-phases
1281 (add-after 'unpack 'respect-$prefix
1282 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1283 (lambda _
1284 (substitute* "Makefile"
1285 (("DIR=/usr/") "DIR=$(prefix)/"))
1286 #t))
1287 (delete 'configure)))) ; no configure script
1288 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1289 (synopsis "Measure system power consumption")
1290 (description
1291 "Powerstat measures and reports your computer's power consumption in real
1292time. On mobile PCs, it uses ACPI battery information to measure the power
1293drain of the entire system.
1294
1295Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1296domain measurements. These are available only on some hardware such as Intel
1297Sandybridge and newer, and cover only part of the machine's components such as
1298CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1299and don't require a battery at all.
1300
1301The output is like @command{vmstat} but also shows power consumption statistics:
1302at the end of a run, @command{powerstat} will calculate the average, standard
1303deviation, and minimum and maximum values. It can show a nice histogram too.")
1304 (license license:gpl2)))
1305
686f14e8
LC
1306(define-public psmisc
1307 (package
1308 (name "psmisc")
bd88082d 1309 (version "23.3")
686f14e8
LC
1310 (source
1311 (origin
1312 (method url-fetch)
03113e31 1313 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
f42846b2 1314 version ".tar.xz"))
686f14e8 1315 (sha256
bd88082d 1316 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
686f14e8 1317 (build-system gnu-build-system)
46429444
MO
1318 (arguments
1319 `(,@(if (%current-target-system)
1320 '(#:configure-flags
1321 (list
1322 "ac_cv_func_malloc_0_nonnull=yes"
1323 "ac_cv_func_realloc_0_nonnull=yes"))
1324 '())))
686f14e8 1325 (inputs `(("ncurses" ,ncurses)))
aa9c221f 1326 (home-page "https://gitlab.com/psmisc/psmisc")
70a4fb6f 1327 (synopsis "Small utilities that use the proc file system")
686f14e8
LC
1328 (description
1329 "This PSmisc package is a set of some small useful utilities that
8f65585b 1330use the proc file system. We're not about changing the world, but
686f14e8 1331providing the system administrator with some help in common tasks.")
3ac73271 1332 (license license:gpl2+)))
02b80c3f
NK
1333
1334(define-public util-linux
1335 (package
1336 (name "util-linux")
fef24361 1337 (version "2.35.1")
5a6a3ba4
LC
1338 (source (origin
1339 (method url-fetch)
1340 (uri (string-append "mirror://kernel.org/linux/utils/"
80095bd3
TGR
1341 "util-linux/v" (version-major+minor version) "/"
1342 "util-linux-" version ".tar.xz"))
5a6a3ba4
LC
1343 (sha256
1344 (base32
fef24361 1345 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
ab0bdd54 1346 (patches (search-patches "util-linux-tests.patch"))
9d77da2a
LC
1347 (modules '((guix build utils)))
1348 (snippet
0223db58
MB
1349 ;; We take 'nologin' from Shadow, the 'logger' program from
1350 ;; GNU Inetutils and 'kill' from GNU Coreutils.
8338c241
MW
1351 '(begin
1352 (substitute* "configure"
0223db58 1353 (("build_nologin=yes") "build_nologin=no")
8338c241
MW
1354 (("build_logger=yes") "build_logger=no")
1355 (("build_kill=yes") "build_kill=no"))
1356 #t))))
02b80c3f 1357 (build-system gnu-build-system)
bb93042c
MB
1358 (outputs '("out" ;6.4 MiB executables and documentation
1359 "lib" ;8.8 MiB shared libraries, headers and locales
1360 "static")) ;2.9 MiB static .a libraries
02b80c3f 1361 (arguments
29ec55ee 1362 `(#:configure-flags (list "--disable-use-tty-group"
d9804e50 1363 "--enable-fs-paths-default=/run/current-system/profile/sbin"
db9107b9
EF
1364 ;; Don't try to chown root:root mount and umount
1365 "--disable-makeinstall-chown"
bb93042c
MB
1366 "--localstatedir=/var"
1367 (string-append "--localedir="
1368 (assoc-ref %outputs "lib")
1369 "/share/locale")
29ec55ee
LC
1370 ;; Install completions where our
1371 ;; bash-completion package expects them.
1372 (string-append "--with-bashcompletiondir="
1373 (assoc-ref %outputs "out")
1374 "/etc/bash_completion.d"))
1b9cf4ad 1375 #:phases (modify-phases %standard-phases
bb93042c
MB
1376 (add-before 'configure 'patch-build-scripts
1377 (lambda* (#:key outputs #:allow-other-keys)
1378 (substitute* "configure"
1379 ;; The build system assumes that we want to install
1380 ;; libraries below $exec_prefix when $libdir does not
1381 ;; match any of the "usual" locations. Fix that.
1382 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1383 "usrlib_execdir=$libdir"))
1384 #t))
a4a70cc4
MB
1385 (add-before 'build 'set-umount-file-name
1386 (lambda* (#:key outputs #:allow-other-keys)
1387 ;; Tell 'eject' the right file name of 'umount'.
1388 (let ((out (assoc-ref outputs "out")))
1389 (substitute* "sys-utils/eject.c"
1390 (("\"/bin/umount\"")
1391 (string-append "\"" out "/bin/umount\"")))
1392 #t)))
1393 (add-before 'check 'pre-check
1394 (lambda* (#:key inputs outputs #:allow-other-keys)
1395 (let ((out (assoc-ref outputs "out"))
1396 (net (assoc-ref inputs "net-base")))
1397 ;; Change the test to refer to the right file.
1398 (substitute* "tests/ts/misc/mcookie"
1399 (("/etc/services")
1400 (string-append net "/etc/services")))
f69a22ac
MB
1401
1402 ;; The C.UTF-8 locale does not exist in our libc.
1403 (substitute* "tests/ts/column/invalid-multibyte"
1404 (("C\\.UTF-8") "en_US.utf8"))
a4a70cc4 1405 #t)))
3e902bbb
MB
1406 ;; TODO: Remove the conditional on the next rebuild cycle.
1407 ,@(if (string-prefix? "arm" (%current-system))
1408 '((add-before 'check 'disable-setarch-test
1409 (lambda _
1410 ;; The setarch tests are unreliable in QEMU's
1411 ;; user-mode emulation, which is our primary
1412 ;; method of building ARMv7 packages.
1413 ;; <https://github.com/karelzak/util-linux/issues/601>
1414 (substitute* "tests/ts/misc/setarch"
1415 (("ts_init_subtest.*" all)
1416 (string-append
1417 all "\n"
1418 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1419 #t)))
1420 '())
a4a70cc4
MB
1421 (add-after 'install 'move-static-libraries
1422 (lambda* (#:key outputs #:allow-other-keys)
bb93042c 1423 (let ((lib (assoc-ref outputs "lib"))
a4a70cc4 1424 (static (assoc-ref outputs "static")))
bb93042c
MB
1425
1426 ;; Move static libraries to the "static" output.
a4a70cc4 1427 (mkdir-p (string-append static "/lib"))
bb93042c 1428 (with-directory-excursion lib
a4a70cc4
MB
1429 (for-each (lambda (file)
1430 (rename-file file
1431 (string-append static "/"
1432 file)))
1433 (find-files "lib" "\\.a$"))
1434
1435 ;; Remove references to the static library from the '.la'
1436 ;; files so that Libtool does the right thing when both
1437 ;; the shared and static library is available.
1438 (substitute* (find-files "lib" "\\.la$")
1439 (("old_library=.*") "old_library=''\n")))
1440
bb93042c
MB
1441 #t)))
1442 (add-after 'install 'adjust-pkg-config-files
1443 (lambda* (#:key outputs #:allow-other-keys)
1444 (let ((lib (assoc-ref outputs "lib")))
1445 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1446 ;; the pkg-config files to avoid a cyclic reference on "out".
1447 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1448 "\\.pc$")
1449 (("^(exec_)?prefix=.*") "")))
1450 #t)))))
f61e0e79 1451 (inputs `(("zlib" ,zlib)
ba4aca3a
LC
1452 ("ncurses" ,ncurses)
1453
1454 ;; XXX: This is so that the 'pre-check' phase can find it.
1455 ,@(if (%current-target-system)
1456 `(("net-base" ,net-base))
1457 '())))
c4c4cc05 1458 (native-inputs
9f533d60 1459 `(("perl" ,perl)
a4a70cc4 1460 ("net-base" ,net-base))) ;for tests
02b80c3f 1461 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 1462 (synopsis "Collection of utilities for the Linux kernel")
437d7286 1463 (description "Util-linux is a diverse collection of Linux kernel
8f65585b 1464utilities. It provides dmesg and includes tools for working with file systems,
437d7286 1465block devices, UUIDs, TTYs, and many other tools.")
fe8ccfcc 1466
02b80c3f 1467 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 1468 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 1469 ;; explicitly defined license.
3ac73271
LC
1470 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1471 license:bsd-4 license:public-domain))))
5d5c4278 1472
71e0f1e9
MB
1473;; util-linux optionally supports udev, which allows lsblk to read file system
1474;; metadata without special privileges. Add it as a separate package to avoid
1475;; a circular dependency, and to keep the size small.
1476(define-public util-linux+udev
1477 (package/inherit
1478 util-linux
60a366ec 1479 (name "util-linux-with-udev")
71e0f1e9
MB
1480 (inputs
1481 `(("udev" ,eudev)
60a366ec 1482 ,@(package-inputs util-linux)))))
71e0f1e9 1483
3116c8b5 1484(define-public ddate
1485 (package
1486 (name "ddate")
1487 (version "0.2.2")
1488 (source (origin
eb4cfec2
EF
1489 (method git-fetch)
1490 (uri (git-reference
1491 (url "https://github.com/bo0ts/ddate")
1492 (commit (string-append "v" version))))
1493 (file-name (git-file-name name version))
3116c8b5 1494 (sha256
eb4cfec2 1495 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
3116c8b5 1496 (build-system cmake-build-system)
1497 (arguments '(#:tests? #f))
1498 (home-page "https://github.com/bo0ts/ddate")
1499 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1500 (description
1501 "ddate displays the Discordian date and holidays of a given date.
1502The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1503by Robert Shea and Robert Anton Wilson.")
1504 (license license:public-domain)))
1505
96636e49
TGR
1506(define-public fbset
1507 (package
1508 (name "fbset")
1509 (version "2.1")
1510 (source
1511 (origin
1512 (method url-fetch)
1513 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1514 version ".tar.gz"))
1515 (sha256
1516 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1517 (build-system gnu-build-system)
1518 (arguments
1519 '(#:modules ((guix build gnu-build-system)
1520 (guix build utils)
1521 (srfi srfi-26))
1522 #:phases
1523 (modify-phases %standard-phases
1524 (delete 'configure) ; no configure script
1525 (add-before 'install 'pre-install
1526 (lambda* (#:key outputs #:allow-other-keys)
1527 (let ((out (assoc-ref outputs "out")))
1528 (substitute* "Makefile"
1529 (("mknod ") "true ")
1530 ;; The Makefile doesn't honour PREFIX or similar.
1531 (("/usr") out))
1532 (mkdir out)
1533 (with-directory-excursion out
1534 (for-each mkdir-p (list "sbin"
1535 "man/man5"
1536 "man/man8")))
1537 #t)))
1538 (add-after 'install 'install-fb.modes
1539 (lambda* (#:key outputs #:allow-other-keys)
1540 (let* ((out (assoc-ref outputs "out"))
1541 (etc (string-append out "/etc")))
1542 (for-each (cut install-file <> etc)
1543 (find-files "etc" "^fb\\.modes"))
1544 (symlink "fb.modes.ATI"
1545 (string-append etc "/fb.modes"))
1546 #t))))
1547 ;; Parallel building races to create modes.tab.c.
1548 #:parallel-build? #f
1549 #:tests? #f)) ; no test suite
1550 (native-inputs
1551 `(("bison" ,bison)
1552 ("flex" ,flex)))
1553 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1554 (synopsis "Show and modify Linux frame buffer settings")
1555 (description
1556 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1557different kinds of graphic displays. The @command{fbset} utility can query and
1558change various device settings such as depth, virtual resolution, and timing
1559parameters.")
1560 (license license:gpl2)))
1561
e47e3eff
LC
1562(define-public procps
1563 (package
1564 (name "procps")
89a6d2d1 1565 (version "3.3.16")
e47e3eff 1566 (source (origin
0cc22848
SB
1567 (method url-fetch)
1568 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1569 "procps-ng-" version ".tar.xz"))
1570 (sha256
1571 (base32
89a6d2d1 1572 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
e47e3eff 1573 (build-system gnu-build-system)
e47e3eff 1574 (arguments
f0d5ce5a 1575 `(#:modules ((guix build utils)
80393eed
LC
1576 (guix build gnu-build-system)
1577 (srfi srfi-1)
1578 (srfi srfi-26))
f0d5ce5a
MO
1579 ,@(if (%current-target-system)
1580 '(#:configure-flags
1581 (list
1582 "ac_cv_func_malloc_0_nonnull=yes"
1583 "ac_cv_func_realloc_0_nonnull=yes"))
1584 '())
0cc22848
SB
1585 #:phases
1586 (modify-phases %standard-phases
1587 (add-after
1588 'install 'post-install
1589 ;; Remove commands and man pages redudant with
1590 ;; Coreutils.
1591 (lambda* (#:key outputs #:allow-other-keys)
1592 (let* ((out (assoc-ref outputs "out"))
1593 (dup (append-map (cut find-files out <>)
1594 '("^kill" "^uptime"))))
1595 (for-each delete-file dup)
1596 #t))))))
1597 (inputs `(("ncurses" ,ncurses)))
1598 (home-page "https://gitlab.com/procps-ng/procps/")
35ec07c7 1599 (synopsis "Utilities that give information about processes")
e47e3eff 1600 (description
35b9e423 1601 "Procps is the package that has a bunch of small useful utilities
e47e3eff
LC
1602that give information about processes using the Linux /proc file system.
1603The package includes the programs ps, top, vmstat, w, kill, free,
1604slabtop, and skill.")
3ac73271 1605 (license license:gpl2)))
e47e3eff 1606
5d5c4278
NK
1607(define-public usbutils
1608 (package
1609 (name "usbutils")
5b266358 1610 (version "012")
5d5c4278
NK
1611 (source
1612 (origin
1613 (method url-fetch)
1614 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1615 "usbutils-" version ".tar.xz"))
1616 (sha256
5b266358 1617 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
5d5c4278 1618 (build-system gnu-build-system)
429a38a0 1619 (outputs (list "out" "python"))
5b266358
TGR
1620 (arguments
1621 `(#:phases
1622 (modify-phases %standard-phases
1623 (add-before 'bootstrap 'patch-bootstrap-scripts
1624 (lambda _
1625 (substitute* "usbhid-dump/bootstrap"
1626 (("/bin/bash") (which "bash")))
1627
1628 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1629 (substitute* "autogen.sh"
1630 (("^\\./configure.*") ""))
429a38a0
TGR
1631 #t))
1632 (add-after 'install 'separate-python-output
1633 ;; Separating one Python script shaves more than 106 MiB from :out.
1634 (lambda* (#:key outputs #:allow-other-keys)
1635 (let ((out (assoc-ref outputs "out"))
1636 (out:python (assoc-ref outputs "python")))
1637 (for-each (lambda (file)
1638 (let ((old (string-append out "/" file))
1639 (new (string-append out:python "/" file)))
1640 (mkdir-p (dirname new))
1641 (rename-file old new)))
1642 (list "bin/lsusb.py"))
1643 #t))))))
5d5c4278 1644 (inputs
a6592732
TGR
1645 `(("eudev" ,eudev)
1646 ("libusb" ,libusb)
1647 ("python" ,python)))
c4c4cc05 1648 (native-inputs
5b266358
TGR
1649 `(("autoconf" ,autoconf)
1650 ("automake" ,automake)
1651 ("libtool" ,libtool)
1652 ("pkg-config" ,pkg-config)))
5d5c4278
NK
1653 (home-page "http://www.linux-usb.org/")
1654 (synopsis
1655 "Tools for working with USB devices, such as lsusb")
1656 (description
1657 "Tools for working with USB devices, such as lsusb.")
3ac73271 1658 (license license:gpl2+)))
0750452a
LC
1659
1660(define-public e2fsprogs
1661 (package
1662 (name "e2fsprogs")
5687fdb7 1663 (version "1.45.6")
0750452a
LC
1664 (source (origin
1665 (method url-fetch)
7409c8d4
MW
1666 (uri (string-append
1667 "mirror://kernel.org/linux/kernel/people/tytso/"
5687fdb7
TGR
1668 "e2fsprogs/v" version "/"
1669 "e2fsprogs-" version ".tar.xz"))
0750452a
LC
1670 (sha256
1671 (base32
5687fdb7 1672 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
0750452a 1673 (build-system gnu-build-system)
bb93042c 1674 (inputs `(("util-linux" ,util-linux "lib")))
f57d2639 1675 (native-inputs `(("pkg-config" ,pkg-config)
75f796bb
MB
1676 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1677
1678 ;; For tests.
1679 ("perl" ,perl)
1680 ("procps" ,procps)))
0750452a 1681 (arguments
b047a86b 1682 '(;; util-linux is the preferred source for some of the libraries and
c44ed26c 1683 ;; commands, so disable them (see, e.g.,
a124bbd2 1684 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
b047a86b
MB
1685 #:configure-flags (list "--disable-libblkid"
1686 "--disable-libuuid" "--disable-uuidd"
1687 "--disable-fsck"
7c594a2c 1688
b047a86b
MB
1689 ;; Use symlinks instead of hard links for
1690 ;; 'fsck.extN' etc. This makes the resulting nar
1691 ;; smaller and is preserved across copies.
1692 "--enable-symlink-install"
74d21291 1693
b047a86b
MB
1694 (string-append "LDFLAGS=-Wl,-rpath="
1695 (assoc-ref %outputs "out")
1696 "/lib")
7c594a2c 1697
b047a86b
MB
1698 ;; Install libext2fs et al.
1699 "--enable-elf-shlibs")
ddfc2fd8 1700
55acb372
MB
1701 #:phases
1702 (modify-phases %standard-phases
1703 (add-before 'configure 'patch-shells
1704 (lambda _
1705 (substitute* "configure"
1706 (("/bin/sh (.*)parse-types.sh" _ dir)
1707 (string-append (which "sh") " " dir
1708 "parse-types.sh")))
b047a86b
MB
1709 (substitute* "MCONFIG.in"
1710 (("INSTALL_SYMLINK = /bin/sh")
1711 "INSTALL_SYMLINK = sh"))
55acb372
MB
1712 (substitute* (find-files "." "^Makefile.in$")
1713 (("#!/bin/sh")
1714 (string-append "#!" (which "sh"))))
1715 #t))
1716 (add-after 'install 'install-libs
1717 (lambda* (#:key outputs #:allow-other-keys)
1718 (let* ((out (assoc-ref outputs "out"))
1719 (lib (string-append out "/lib")))
b132ad3a
MW
1720 (invoke "make" "install-libs")
1721
1722 ;; Make the .a writable so that 'strip' works.
1723 ;; Failing to do that, due to debug symbols, we
1724 ;; retain a reference to the final
1725 ;; linux-libre-headers, which refer to the
1726 ;; bootstrap binaries.
1727 (let ((archives (find-files lib "\\.a$")))
1728 (for-each (lambda (file)
1729 (chmod file #o666))
1730 archives))
1731 #t))))))
0750452a 1732 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 1733 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
1734 (description
1735 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
3ac73271
LC
1736 (license (list license:gpl2 ;programs
1737 license:lgpl2.0 ;libext2fs
1738 license:x11)))) ;libuuid
d8482ad0 1739
e48977e7
LC
1740(define e2fsprogs/static
1741 (static-package
1742 (package (inherit e2fsprogs)
1743 (arguments
1744 ;; Do not build shared libraries.
1745 (substitute-keyword-arguments (package-arguments e2fsprogs)
1746 ((#:configure-flags _)
1747 '(list "--disable-blkid"))
1748 ((#:make-flags _)
1749 '(list)))))))
1750
e102f940
LC
1751(define-public e2fsck/static
1752 (package
1753 (name "e2fsck-static")
0997771a 1754 (version (package-version e2fsprogs))
e102f940
LC
1755 (build-system trivial-build-system)
1756 (source #f)
313880c7
DC
1757 (inputs
1758 `(("e2fsprogs" ,e2fsprogs/static)))
e102f940
LC
1759 (arguments
1760 `(#:modules ((guix build utils))
1761 #:builder
1762 (begin
1763 (use-modules (guix build utils)
1764 (ice-9 ftw)
1765 (srfi srfi-26))
1766
313880c7
DC
1767 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1768 "/sbin/e2fsck"))
e102f940
LC
1769 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1770 (mkdir-p bin)
1771 (with-directory-excursion bin
313880c7
DC
1772 (copy-file e2fsck "e2fsck")
1773 (remove-store-references "e2fsck")
e3cfef22
MW
1774 (chmod "e2fsck" #o555))
1775 #t))))
0997771a 1776 (home-page (package-home-page e2fsprogs))
313880c7
DC
1777 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1778 (description "This package provides statically-linked e2fsck command taken
1779from the e2fsprogs package. It is meant to be used in initrds.")
0997771a 1780 (license (package-license e2fsprogs))))
e102f940 1781
7c0a9104
LC
1782(define-public extundelete
1783 (package
1784 (name "extundelete")
1785 (version "0.2.4")
76c888cb
TGR
1786 (source
1787 (origin
1788 (method url-fetch)
1789 (uri (string-append "mirror://sourceforge/extundelete/"
1790 "extundelete/" version "/extundelete-"
1791 version ".tar.bz2"))
1792 (sha256
1793 (base32
1794 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1795 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
7c0a9104
LC
1796 (build-system gnu-build-system)
1797 (inputs `(("e2fsprogs" ,e2fsprogs)))
1798 (home-page "http://extundelete.sourceforge.net/")
1799 (synopsis "Recover deleted files from ext2/3/4 partitions")
1800 (description
1801 "Extundelete is a set of tools that can recover deleted files from an
1802ext3 or ext4 partition.")
3ac73271 1803 (license license:gpl2)))
7c0a9104 1804
1c975f60
LC
1805(define-public zerofree
1806 (package
1807 (name "zerofree")
5658b4ce 1808 (version "1.1.1")
30ac4cc7 1809 (home-page "https://frippery.org/uml/")
1c975f60
LC
1810 (source (origin
1811 (method url-fetch)
1812 (uri (string-append home-page name "-" version
1813 ".tgz"))
1814 (sha256
1815 (base32
5658b4ce 1816 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1c975f60
LC
1817 (build-system gnu-build-system)
1818 (arguments
0f08917d
TGR
1819 '(#:phases
1820 (modify-phases %standard-phases
1821 (delete 'configure) ; no configure script
1822 (replace 'install
1823 ;; The Makefile lacks an ‘install’ target.
1824 (lambda* (#:key outputs #:allow-other-keys)
1825 (let* ((out (assoc-ref outputs "out"))
1826 (bin (string-append out "/bin")))
7a068459
TGR
1827 (chmod "zerofree" #o555)
1828 (install-file "zerofree" bin)
0f08917d
TGR
1829 #t))))
1830 #:tests? #f)) ; no tests
1c975f60
LC
1831 (inputs `(("libext2fs" ,e2fsprogs)))
1832 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1833 (description
4de4a1cf
TGR
1834 "Zerofree finds the unallocated blocks with non-zero value content in an
1835ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1836This is a simple way to make disk images more compressible.
1837Zerofree requires the file system to be unmounted or mounted read-only.")
3ac73271 1838 (license license:gpl2)))
1c975f60 1839
d8482ad0
LC
1840(define-public strace
1841 (package
1842 (name "strace")
53428597 1843 (version "5.7")
426284d8 1844 (home-page "https://strace.io")
d8482ad0
LC
1845 (source (origin
1846 (method url-fetch)
426284d8
MB
1847 (uri (string-append home-page "/files/" version
1848 "/strace-" version ".tar.xz"))
d8482ad0
LC
1849 (sha256
1850 (base32
53428597 1851 "1n6cfz3i2krkyvxpdp3kmxhf7sy5xp0danzaiirbk5fdkfgvb15j"))))
d8482ad0 1852 (build-system gnu-build-system)
6983b8a8
MB
1853 (arguments
1854 '(#:phases
1855 (modify-phases %standard-phases
1856 (add-after 'unpack 'patch-/bin/sh
1857 (lambda _
1858 (substitute* "strace.c"
1859 (("/bin/sh") (which "sh")))
53428597
TGR
1860 #t))
1861 (add-after 'unpack 'disable-failing-tests
1862 (lambda _
1863 ;; XXX These hang forever even if the test time-out is extended.
1864 (substitute* "tests/Makefile.in"
1865 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
d1eb4234 1866 #t)))
1d437561
EF
1867 ;; Don't fail if the architecture doesn't support different personalities.
1868 #:configure-flags '("--enable-mpers=check")
72e782b2
TGR
1869 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1870 #:parallel-tests? #f)) ; undeterministic failures
c4c4cc05 1871 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
1872 (synopsis "System call tracer for Linux")
1873 (description
1874 "strace is a system call tracer, i.e. a debugging tool which prints out a
1875trace of all the system calls made by a another process/program.")
035f9161 1876 (license license:lgpl2.1+)))
ba04571a 1877
e1e27737
TUBK
1878(define-public ltrace
1879 (package
1880 (name "ltrace")
1881 (version "0.7.3")
1882 (source (origin
1883 (method url-fetch)
1884 (uri (string-append "http://www.ltrace.org/ltrace_" version
1885 ".orig.tar.bz2"))
1886 (sha256
1887 (base32
1888 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1889 (build-system gnu-build-system)
1890 (inputs `(("libelf" ,libelf)))
1891 (arguments
1892 ;; Compilation uses -Werror by default, but it fails.
1893 '(#:configure-flags '("--disable-werror")))
81e59e41 1894 (home-page "https://www.ltrace.org/")
e1e27737
TUBK
1895 (synopsis "Library call tracer for Linux")
1896 (description
1897 "ltrace intercepts and records dynamic library calls which are called by
1898an executed process and the signals received by that process. It can also
1899intercept and print the system calls executed by the program.")
3ac73271 1900 (license license:gpl2+)))
e1e27737 1901
ba04571a
LC
1902(define-public alsa-lib
1903 (package
1904 (name "alsa-lib")
c494e899 1905 (version "1.2.2")
ba04571a
LC
1906 (source (origin
1907 (method url-fetch)
1908 (uri (string-append
1909 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1910 version ".tar.bz2"))
1911 (sha256
1912 (base32
c494e899 1913 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
ba04571a 1914 (build-system gnu-build-system)
ddf31e9a
MB
1915 (arguments
1916 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1917 (assoc-ref %outputs "out")
1918 "/lib"))))
5f3070a5 1919 (home-page "https://www.alsa-project.org/")
ba04571a
LC
1920 (synopsis "The Advanced Linux Sound Architecture libraries")
1921 (description
1922 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1923MIDI functionality to the Linux-based operating system.")
3ac73271 1924 (license license:lgpl2.1+)))
10afdf50 1925
17b293a0
LC
1926(define-public alsa-utils
1927 (package
1928 (name "alsa-utils")
c494e899 1929 (version "1.2.2")
17b293a0
LC
1930 (source (origin
1931 (method url-fetch)
992b527d
EF
1932 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1933 name "-" version ".tar.bz2"))
17b293a0
LC
1934 (sha256
1935 (base32
c494e899 1936 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
17b293a0
LC
1937 (build-system gnu-build-system)
1938 (arguments
1939 ;; XXX: Disable man page creation until we have DocBook.
1940 '(#:configure-flags (list "--disable-xmlto"
f2817d43
LC
1941
1942 ;; The udev rule is responsible for restoring
1943 ;; the volume.
17b293a0
LC
1944 (string-append "--with-udev-rules-dir="
1945 (assoc-ref %outputs "out")
1946 "/lib/udev/rules.d"))
49165145
EF
1947 #:phases
1948 (modify-phases %standard-phases
46bf8b2b
MB
1949 (add-before 'check 'disable-broken-test
1950 (lambda _
1951 ;; XXX: The 1.1.8 release tarball is missing a header that's
1952 ;; required for this test to work. Fixed in 1.1.9.
1953 (substitute* "axfer/test/Makefile"
1954 ((".*container-test.*") ""))
1955 #t))
49165145
EF
1956 (add-before
1957 'install 'pre-install
1958 (lambda _
1959 ;; Don't try to mkdir /var/lib/alsa.
1960 (substitute* "Makefile"
1961 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
457d154f
EF
1962 "true\n"))
1963 #t)))))
9b70f2c3
MO
1964 (native-inputs
1965 `(("gettext" ,gettext-minimal)))
17b293a0
LC
1966 (inputs
1967 `(("libsamplerate" ,libsamplerate)
1968 ("ncurses" ,ncurses)
1969 ("alsa-lib" ,alsa-lib)
9b70f2c3 1970 ("xmlto" ,xmlto)))
17b293a0
LC
1971 (home-page "http://www.alsa-project.org/")
1972 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1973 (description
1974 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1975MIDI functionality to the Linux-based operating system.")
1976
1977 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1978 ;; GPLv2-only.
3ac73271 1979 (license license:gpl2)))
17b293a0 1980
7d2511bc 1981(define-public alsa-plugins
1982 (package
1983 (name "alsa-plugins")
c494e899 1984 (version "1.2.2")
7d2511bc 1985 (source (origin
1986 (method url-fetch)
1987 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1988 name "-" version ".tar.bz2"))
1989 (sha256
1990 (base32
c494e899 1991 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
7d2511bc 1992 (build-system gnu-build-system)
1993 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1994 ;; be split, there are references to both in files.
1995 ;; TODO: Remove OSS related plugins, they add support to run native
1996 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1997 ;; obsolete.
624ee211 1998 (outputs '("out" "pulseaudio" "jack"))
7d2511bc 1999 (arguments
10b96d29 2000 `(#:configure-flags '(;; Do not install a "local" configuration targeted
59e80445 2001 ;; for /etc/alsa. On Guix System plugins are loaded from
10b96d29
MB
2002 ;; the ALSA service, and other distributions likely
2003 ;; won't use these files.
2004 "--with-alsalconfdir=/tmp/noop")
2005 #:phases
7d2511bc 2006 (modify-phases %standard-phases
2007 (add-after 'install 'split
2008 (lambda* (#:key inputs outputs #:allow-other-keys)
2009 ;; Distribute the binaries to the various outputs.
2010 (let* ((out (assoc-ref outputs "out"))
624ee211
SB
2011 (jack (assoc-ref outputs "jack"))
2012 (jacklib (string-append jack "/lib/alsa-lib"))
7d2511bc 2013 (pua (assoc-ref outputs "pulseaudio"))
10b96d29 2014 (pualib (string-append pua "/lib/alsa-lib")))
624ee211
SB
2015 ;; For jack.
2016 (mkdir-p jacklib)
2017 (for-each (lambda (file)
2018 (rename-file file (string-append jacklib "/" (basename file))))
2019 (find-files out ".*jack\\.(la|so)"))
10b96d29 2020 ;; For pulseaudio.
7d2511bc 2021 (mkdir-p pualib)
7d2511bc 2022 (for-each (lambda (file)
2023 (rename-file file (string-append pualib "/" (basename file))))
2024 (find-files out ".*pulse\\.(la|so)"))
7d2511bc 2025 #t))))))
2026 (inputs
2027 `(("alsa-lib" ,alsa-lib)
624ee211 2028 ("jack" ,jack-1)
7d2511bc 2029 ("speex" ,speex) ; libspeexdsp resampling plugin
2030 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2031 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2032 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2033 (native-inputs
2034 `(("pkg-config" ,pkg-config)))
2035 (home-page "http://www.alsa-project.org/")
2036 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2037 (description
2038 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2039MIDI functionality to the Linux-based operating system. This package enhances ALSA
2040by providing additional plugins which include: upmixing, downmixing, jackd and
2041pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2042external rate conversion.")
2043 (license (list license:gpl2+
2044 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2045 license:lgpl2.1+))))
2046
10afdf50
LC
2047(define-public iptables
2048 (package
2049 (name "iptables")
0cafb90d
TGR
2050 ;; XXX When updating, remove the ‘install-missing-script’ phase.
2051 (version "1.8.5")
2052 (source
2053 (origin
2054 (method url-fetch)
2055 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2056 version ".tar.bz2")
2057 (string-append "https://www.netfilter.org/projects/iptables/"
2058 "files/iptables-" version ".tar.bz2")))
2059 (sha256
2060 (base32 "02a3575ypdpg6a2x752mhk3f7h1381ymkq1n0gss6fp6292xfmyl"))))
10afdf50 2061 (build-system gnu-build-system)
13223c8e
LF
2062 (native-inputs
2063 `(("pkg-config" ,pkg-config)
2064 ("flex" ,flex)
2065 ("bison" ,bison)))
2066 (inputs
2067 `(("libmnl" ,libmnl)
2068 ("libnftnl" ,libnftnl)))
50c26d9e
SB
2069 (arguments
2070 '(#:tests? #f ; no test suite
2071 #:configure-flags ; add $libdir to the RUNPATH of executables
0cafb90d
TGR
2072 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
2073 #:phases
2074 (modify-phases %standard-phases
2075 (add-after 'install 'install-missing-script
2076 ;; A typo prevents installation of /sbin/iptables-apply. It's been
2077 ;; fixed upstream (d4ed0c741fc789bb09d977d74d30875fdd50d08b), but
2078 ;; a patch would require bootstrapping and more inputs. Simply copy
2079 ;; the file ourselves.
2080 (lambda* (#:key outputs #:allow-other-keys)
2081 (let* ((out (assoc-ref outputs "out"))
2082 (sbin (string-append out "/sbin")))
2083 (install-file "iptables/iptables-apply" sbin)
2084 #t))))))
13223c8e 2085 (home-page "https://www.netfilter.org/projects/iptables/index.html")
be5dc5fb 2086 (synopsis "Programs to configure Linux IP packet filtering rules")
10afdf50 2087 (description
be5dc5fb
TGR
2088 "@command{iptables} is the user-space command line program used to
2089configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2090(@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2091
2092This package also includes @command{ip6tables}, which is used to configure the
2093IPv6 packet filter.
2094
fadc5533 2095Both commands are targeted at system administrators.")
3ac73271 2096 (license license:gpl2+)))
90a0048f 2097
c06c7a3a
VL
2098(define-public lsscsi
2099 (package
2100 (name "lsscsi")
2101 (version "0.31")
2102 (source (origin
2103 (method url-fetch)
2104 (uri (string-append
2105 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2106 (sha256
2107 (base32
2108 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
2109 (build-system gnu-build-system)
2110 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2111 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2112 (description
2113 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2114also list NVMe namespaces or controllers and show the relationship between a
2115device's primary node name, its SCSI generic (sg) node name and its kernel
2116name.")
2117 (license license:gpl2)))
2118
6876a6fe
SB
2119(define-public ebtables
2120 (package
2121 (name "ebtables")
b614a223 2122 (version "2.0.11")
6876a6fe
SB
2123 (source (origin
2124 (method url-fetch)
2125 (uri (string-append
b614a223 2126 "mirror://netfilter.org/ebtables/ebtables-"
6876a6fe
SB
2127 version ".tar.gz"))
2128 (sha256
2129 (base32
b614a223 2130 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
6876a6fe 2131 (build-system gnu-build-system)
6876a6fe
SB
2132 (inputs
2133 `(("perl" ,perl)
2134 ("iptables" ,iptables)))
2135 (synopsis "Ethernet bridge frame table administration")
82c89ead 2136 (home-page "https://ebtables.netfilter.org/")
6876a6fe
SB
2137 (description
2138 "ebtables is an application program used to set up and maintain the
2139tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2140analogous to the iptables application, but less complicated, due to the fact
2141that the Ethernet protocol is much simpler than the IP protocol.")
2142 (license license:gpl2+)))
2143
90a0048f
LC
2144(define-public iproute
2145 (package
2146 (name "iproute2")
f0bebc57 2147 (version "5.7.0")
90a0048f 2148 (source (origin
75cd4b05
AK
2149 (method url-fetch)
2150 (uri (string-append
2151 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2152 version ".tar.xz"))
2153 (sha256
2154 (base32
f0bebc57 2155 "088gs56iqhdlpw1iqjwrss4zxd4zbl2wl8s2implrrdajjxcfpbj"))))
90a0048f
LC
2156 (build-system gnu-build-system)
2157 (arguments
54933202
TGR
2158 `( ;; There is a test suite, but it wants network namespaces and sudo.
2159 #:tests? #f
90a0048f
LC
2160 #:make-flags (let ((out (assoc-ref %outputs "out")))
2161 (list "DESTDIR="
e777d07d
LF
2162 (string-append "BASH_COMPDIR=" out
2163 "/etc/bash_completion.d")
90a0048f 2164 (string-append "LIBDIR=" out "/lib")
61f78e72 2165 (string-append "HDRDIR=" out "/include")
90a0048f
LC
2166 (string-append "SBINDIR=" out "/sbin")
2167 (string-append "CONFDIR=" out "/etc")
2168 (string-append "DOCDIR=" out "/share/doc/"
2169 ,name "-" ,version)
2170 (string-append "MANDIR=" out "/share/man")))
b53e44fb
AK
2171 #:phases (modify-phases %standard-phases
2172 (add-before 'install 'pre-install
2173 (lambda _
2174 ;; Don't attempt to create /var/lib/arpd.
2175 (substitute* "Makefile"
9922278b
MW
2176 (("^.*ARPDDIR.*$") ""))
2177 #t)))))
90a0048f 2178 (inputs
54933202 2179 `(("db4" ,bdb)
3b636296
TGR
2180 ("iptables" ,iptables)
2181 ("libmnl" ,libmnl)))
c4c4cc05 2182 (native-inputs
54933202 2183 `(("bison" ,bison)
90a0048f 2184 ("flex" ,flex)
54933202
TGR
2185 ("pkg-config" ,pkg-config)))
2186 ;; For tests.
2187 ;; ("libmnl" ,libmnl)
2188 ;; ("util-linux" ,util-linux)
90a0048f 2189 (home-page
d7f84eab 2190 "https://wiki.linuxfoundation.org/networking/iproute2")
90a0048f 2191 (synopsis
9e771e3b 2192 "Utilities for controlling TCP/IP networking and traffic in Linux")
90a0048f 2193 (description
35a4fefc
TGR
2194 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2195and traffic with the Linux kernel. The most important of these are
2196@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2197control.
90a0048f
LC
2198
2199Most network configuration manuals still refer to ifconfig and route as the
2200primary network configuration tools, but ifconfig is known to behave
35a4fefc 2201inadequately in modern network environments, and both should be deprecated.")
3ac73271 2202 (license license:gpl2+)))
85e0dc6a
LC
2203
2204(define-public net-tools
2205 ;; XXX: This package is basically unmaintained, but it provides a few
2206 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2207 ;; live with it.
6d31c175
LF
2208 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2209 (revision "0"))
2210 (package
2211 (name "net-tools")
2212 (version (string-append "1.60-" revision "." (string-take commit 7)))
2213 (source (origin
631c9f74
LF
2214 (method url-fetch)
2215 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2216 "n/ne/net-tools/code.git/net-tools-code-"
2217 commit ".zip"))
2218 (file-name (string-append name "-" version ".zip"))
6d31c175
LF
2219 (sha256
2220 (base32
631c9f74 2221 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
6d31c175
LF
2222 (home-page "http://net-tools.sourceforge.net/")
2223 (build-system gnu-build-system)
2224 (arguments
898e8b52 2225 `(#:modules ((guix build gnu-build-system)
6d31c175
LF
2226 (guix build utils)
2227 (srfi srfi-1)
2228 (srfi srfi-26))
2229 #:phases
2230 (modify-phases %standard-phases
2231 (replace 'configure
2232 (lambda* (#:key outputs #:allow-other-keys)
2233 (let ((out (assoc-ref outputs "out")))
2234 (mkdir-p (string-append out "/bin"))
2235 (mkdir-p (string-append out "/sbin"))
2236
2237 ;; Pretend we have everything...
2238 (system "yes | make config")
2239
2240 ;; ... except for the things we don't have.
2241 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2242 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2243 ;; that have been removed.
2244 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2245 ;; think about adding them later.
2246 (substitute* '("config.make" "config.h")
2247 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
8ea5d868
MW
2248 ""))
2249 #t)))
6d31c175
LF
2250 (add-after 'install 'remove-redundant-commands
2251 (lambda* (#:key outputs #:allow-other-keys)
2252 ;; Remove commands and man pages redundant with Inetutils.
2253 (let* ((out (assoc-ref outputs "out"))
2254 (dup (append-map (cut find-files out <>)
2255 '("^hostname"
2256 "^(yp|nis|dns)?domainname"))))
2257 (for-each delete-file dup)
2258 #t))))
2259 ;; Binaries that depend on libnet-tools.a don't declare that
2260 ;; dependency, making it parallel-unsafe.
2261 #:parallel-build? #f
2262
2263 #:tests? #f ; no test suite
2264 #:make-flags (let ((out (assoc-ref %outputs "out")))
898e8b52 2265 (list ,(string-append "CC=" (cc-for-target))
6d31c175
LF
2266 (string-append "BASEDIR=" out)
2267 (string-append "INSTALLNLSDIR=" out "/share/locale")
2268 (string-append "mandir=/share/man")))))
631c9f74
LF
2269 (native-inputs `(("gettext" ,gettext-minimal)
2270 ("unzip" ,unzip)))
3d3ca76f 2271 (supported-systems (delete "i586-gnu" %supported-systems))
6d31c175
LF
2272 (synopsis "Tools for controlling the network subsystem in Linux")
2273 (description
2274 "This package includes the important tools for controlling the network
2275subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2276route. Additionally, this package contains utilities relating to particular
2277network hardware types (plipconfig, slattach) and advanced aspects of IP
2278configuration (iptunnel, ipmaddr).")
2279 (license license:gpl2+))))
2280
c762e82e
LC
2281(define-public libcap
2282 (package
2283 (name "libcap")
e21b70ac 2284 (version "2.31")
c762e82e
LC
2285 (source (origin
2286 (method url-fetch)
c762e82e 2287 (uri (string-append
f6c2d05c
LC
2288 "mirror://kernel.org/linux/libs/security/linux-privs/"
2289 "libcap2/libcap-" version ".tar.xz"))
c762e82e
LC
2290 (sha256
2291 (base32
e21b70ac 2292 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
c762e82e 2293 (build-system gnu-build-system)
6d889daf
SB
2294 (arguments '(#:phases
2295 (modify-phases %standard-phases
2296 (replace 'configure
2297 ;; Add $libdir to the RUNPATH of executables.
2298 (lambda _
2299 (substitute* "Make.Rules"
2300 (("LDFLAGS := #-g")
2301 (string-append "LDFLAGS := -Wl,-rpath="
d70d59d6
MW
2302 %output "/lib")))
2303 #t)))
2a65cd8c 2304 #:test-target "test"
c762e82e
LC
2305 #:make-flags (list "lib=lib"
2306 (string-append "prefix="
2307 (assoc-ref %outputs "out"))
2308 "RAISE_SETFCAP=no")))
2309 (native-inputs `(("perl" ,perl)))
11a5ffba 2310 (supported-systems (delete "i586-gnu" %supported-systems))
c762e82e
LC
2311 (home-page "https://sites.google.com/site/fullycapable/")
2312 (synopsis "Library for working with POSIX capabilities")
2313 (description
35b9e423 2314 "Libcap2 provides a programming interface to POSIX capabilities on
c762e82e
LC
2315Linux-based operating systems.")
2316
2317 ;; License is BSD-3 or GPLv2, at the user's choice.
3ac73271 2318 (license license:gpl2)))
215b6431 2319
7431553b
MB
2320;; libcap 2.31 causes problems for 'fakeroot', so provide this newer variant.
2321;; To be merged with libcap on the next rebuild cycle.
2322(define-public libcap/next
2323 (package
2324 (inherit libcap)
2325 (version "2.34")
2326 (source (origin
2327 (method url-fetch)
2328 (uri (string-append
2329 "mirror://kernel.org/linux/libs/security/linux-privs/"
2330 "libcap2/libcap-" version ".tar.xz"))
2331 (sha256
2332 (base32
2333 "048n1gy2p48vl9hkrr9wymfxxcpwj2aslz2bv79nhl4m2lhd9kdf"))))))
2334
215b6431
LC
2335(define-public bridge-utils
2336 (package
2337 (name "bridge-utils")
4863773e
TGR
2338 (version "1.6")
2339 (source
2340 (origin
2341 (method url-fetch)
18160c34
MB
2342 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2343 "bridge-utils-" version ".tar.xz"))
4863773e
TGR
2344 (sha256
2345 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
215b6431
LC
2346 (build-system gnu-build-system)
2347
2348 ;; The tarball lacks all the generated files.
2349 (native-inputs `(("autoconf" ,autoconf)
2350 ("automake" ,automake)))
2351 (arguments
dc1d3cde
KK
2352 '(#:phases
2353 (modify-phases %standard-phases
189be331 2354 (add-before 'bootstrap 'patch-stuff
dc1d3cde
KK
2355 (lambda _
2356 ;; Fix "field ‘ip6’ has incomplete type" errors.
2357 (substitute* "libbridge/libbridge.h"
2358 (("#include <linux/if_bridge.h>")
2359 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2360
2361 ;; Ensure that the entire build fails if one of the
2362 ;; sub-Makefiles fails.
2363 (substitute* "Makefile.in"
2364 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2365 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2366
189be331 2367 #t)))
215b6431
LC
2368 #:tests? #f)) ; no 'check' target
2369
e496ee67 2370 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
215b6431
LC
2371 (synopsis "Manipulate Ethernet bridges")
2372 (description
2373 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2374to connect two Ethernet segments together in a protocol independent way.
2375Packets are forwarded based on Ethernet address, rather than IP address (like
2376a router). Since forwarding is done at Layer 2, all protocols can go
2377transparently through a bridge.")
3ac73271 2378 (license license:gpl2+)))
3cc20675
LC
2379
2380(define-public libnl
2381 (package
2382 (name "libnl")
276e7739 2383 (version "3.5.0")
3cc20675
LC
2384 (source (origin
2385 (method url-fetch)
2386 (uri (string-append
a2265ea3
MB
2387 "https://github.com/thom311/libnl/releases/download/"
2388 "libnl" (string-join (string-split version #\.) "_")
2389 "/libnl-" version ".tar.gz"))
3cc20675
LC
2390 (sha256
2391 (base32
276e7739 2392 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
3cc20675 2393 (build-system gnu-build-system)
d80a47f2
DL
2394 (native-inputs
2395 `(("bison" ,bison)
2396 ("flex" ,flex)
3eb7c000
DL
2397 ("pkg-config" ,pkg-config)
2398 ("swig" ,swig)
d80a47f2
DL
2399 ("libnl3-doc"
2400 ,(origin
2401 (method url-fetch)
2402 (uri (string-append
2403 "https://github.com/thom311/libnl/releases/download/libnl"
2404 (string-join (string-split version #\.) "_")
2405 "/libnl-doc-" version ".tar.gz"))
2406 (sha256
276e7739 2407 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
c41f8869 2408 (outputs `("out" "doc"))
d80a47f2 2409 (arguments
c41f8869 2410 `(#:phases
d80a47f2
DL
2411 (modify-phases %standard-phases
2412 (add-after 'install 'install-doc
c41f8869 2413 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
d80a47f2
DL
2414 (let ((dest (string-append (assoc-ref outputs "doc")
2415 "/share/doc/libnl")))
2416 (mkdir-p dest)
c41f8869
MO
2417 (invoke "tar" "xf" (assoc-ref
2418 (or native-inputs inputs)
2419 "libnl3-doc")
35faa006 2420 "--strip-components=1" "-C" dest)))))))
81e59e41 2421 (home-page "https://www.infradead.org/~tgr/libnl/")
3cc20675
LC
2422 (synopsis "NetLink protocol library suite")
2423 (description
2424 "The libnl suite is a collection of libraries providing APIs to netlink
69b4ffcf 2425protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
3cc20675
LC
2426between the kernel and user space processes. It was designed to be a more
2427flexible successor to ioctl to provide mainly networking related kernel
2428configuration and monitoring interfaces.")
2429
2430 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2431 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
3ac73271 2432 (license license:gpl2)))
023fef7d 2433
c41f8869
MO
2434;; libnl python extensions used to be outputs of libnl. However, as
2435;; cross-compiling python extensions is currently broken, create separate
2436;; packages for libnl python extensions.
2437(define (libnl-python-package python)
2438 (let ((name (string-append "libnl-" python)))
2439 (package
2440 (inherit libnl)
2441 (name name)
2442 (inputs `(,@(cond
2443 ((string=? python "python2")
2444 `(("python-2" ,python-2)))
2445 ((string=? python "python3")
2446 `(("python-3" ,python-3))))))
2447 (propagated-inputs `(("libnl" ,libnl)))
2448 (outputs '("out"))
2449 (arguments
2450 `(#:modules ((guix build gnu-build-system)
2451 (guix build utils)
2452 (srfi srfi-1))
2453 #:phases
2454 (modify-phases %standard-phases
2455 (replace 'install
2456 (lambda* (#:key inputs outputs #:allow-other-keys)
2457 (define (python-inst python)
2458 (invoke python "setup.py" "build")
2459 (invoke python "setup.py" "install"
2460 (string-append "--prefix="
2461 (assoc-ref %outputs "out")))
2462 (invoke python "setup.py" "clean"))
2463 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2464 (assoc-ref inputs "libnl")))
2465 (with-directory-excursion "./python" (python-inst ,python))
2466 #t))))))))
2467
2468(define-public libnl-python2 (libnl-python-package "python2"))
2469(define-public libnl-python3 (libnl-python-package "python3"))
2470
65cd77db
MW
2471(define-public iw
2472 (package
2473 (name "iw")
4b0111a4 2474 (version "4.14")
65cd77db
MW
2475 (source (origin
2476 (method url-fetch)
2477 (uri (string-append
2f9e312a 2478 "mirror://kernel.org/software/network/iw/iw-"
65cd77db
MW
2479 version ".tar.xz"))
2480 (sha256
2481 (base32
4b0111a4 2482 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
65cd77db
MW
2483 (build-system gnu-build-system)
2484 (native-inputs `(("pkg-config" ,pkg-config)))
2485 (inputs `(("libnl" ,libnl)))
2486 (arguments
88ca4029
MO
2487 `(#:make-flags
2488 (let* ((target ,(%current-target-system))
88ca4029
MO
2489 (pkg-config (if target
2490 (string-append target "-pkg-config")
2491 "pkg-config")))
2492 (list
56a9ef22 2493 ,(string-append "CC=" (cc-for-target))
88ca4029
MO
2494 (string-append "PKG_CONFIG="
2495 (assoc-ref %build-inputs "pkg-config")
2496 "/bin/" pkg-config)
2497 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
dc1d3cde 2498 #:phases (modify-phases %standard-phases (delete 'configure))))
2f9e312a 2499 (home-page "https://wireless.wiki.kernel.org/")
65cd77db
MW
2500 (synopsis "Tool for configuring wireless devices")
2501 (description
2502 "iw is a new nl80211 based CLI configuration utility for wireless
2f9e312a 2503devices. It replaces @code{iwconfig}, which is deprecated.")
3ac73271 2504 (license license:isc)))
65cd77db 2505
023fef7d
LC
2506(define-public powertop
2507 (package
2508 (name "powertop")
4d36a278 2509 (version "2.12")
023fef7d
LC
2510 (source
2511 (origin
2512 (method url-fetch)
8118a086 2513 (uri (string-append "https://01.org/sites/default/files/downloads/"
4d36a278 2514 "powertop-" version ".tar.gz"))
023fef7d 2515 (sha256
4d36a278 2516 (base32 "1kiiwa5p2r7h1lzcf53xq61ckaa4wk565s9fs6vw4bfk84y3mfsw"))))
023fef7d 2517 (build-system gnu-build-system)
4c48bf55
ML
2518 (arguments
2519 '(#:phases
2520 (modify-phases %standard-phases
2521 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
59e80445 2522 ;; allow calibrating the network interface in Guix System.
4c48bf55
ML
2523 (add-after 'unpack 'patch-absolute-file-names
2524 (lambda* (#:key inputs #:allow-other-keys)
2525 (let ((kmod (assoc-ref inputs "kmod")))
2526 (substitute* (find-files "src" "\\.cpp$")
2527 ;; Give the right 'modprobe' file name so that essential
2528 ;; modules such as msr.ko can be loaded.
2529 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2530 ;; These programs are only needed to calibrate, so using
2531 ;; relative file names avoids adding extra inputs. When they
2532 ;; are missing powertop gracefully handles it.
2533 (("/usr/bin/hcitool") "hcitool")
2534 (("/usr/bin/xset") "xset")
2535 (("/usr/sbin/hciconfig") "hciconfig"))
2536 #t))))))
023fef7d 2537 (inputs
4c48bf55
ML
2538 `(("kmod" ,kmod)
2539 ("libnl" ,libnl)
023fef7d 2540 ("ncurses" ,ncurses)
4c48bf55
ML
2541 ("pciutils" ,pciutils)
2542 ("zlib" ,zlib)))
c4c4cc05 2543 (native-inputs
ebacb0de 2544 `(("pkg-config" ,pkg-config)))
023fef7d
LC
2545 (home-page "https://01.org/powertop/")
2546 (synopsis "Analyze power consumption on Intel-based laptops")
2547 (description
2548 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2549power management. In addition to being a diagnostic tool, PowerTOP also has
2550an interactive mode where the user can experiment various power management
2551settings for cases where the operating system has not enabled these
2552settings.")
3ac73271 2553 (license license:gpl2)))
6869e5c9
LC
2554
2555(define-public aumix
2556 (package
2557 (name "aumix")
2558 (version "2.9.1")
2559 (source (origin
2560 (method url-fetch)
2561 (uri (string-append
2562 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2563 version ".tar.bz2"))
2564 (sha256
2565 (base32
2566 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2567 (build-system gnu-build-system)
2568 (inputs `(("ncurses" ,ncurses)))
2569 (home-page "http://www.jpj.net/~trevor/aumix.html")
2570 (synopsis "Audio mixer for X and the console")
2571 (description
2572 "Aumix adjusts an audio mixer from X, the console, a terminal,
2573the command line or a script.")
3ac73271 2574 (license license:gpl2+)))
7c0dbe78
SHT
2575
2576(define-public iotop
2577 (package
2578 (name "iotop")
2579 (version "0.6")
2580 (source
2581 (origin
2582 (method url-fetch)
2583 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2584 version ".tar.gz"))
2585 (sha256 (base32
2586 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2587 (build-system python-build-system)
2588 (arguments
d79db39d
EF
2589 '(#:phases
2590 (modify-phases %standard-phases
2591 (add-after 'unpack 'fix-build-with-python3
2592 (lambda _
2593 (substitute* "setup.py"
2594 (("itervalues") "values"))
2595 #t)))
35cebf01 2596 ;; There are currently no checks in the package.
7c0dbe78 2597 #:tests? #f))
d79db39d 2598 (native-inputs `(("python" ,python)))
7c0dbe78
SHT
2599 (home-page "http://guichaz.free.fr/iotop/")
2600 (synopsis
2601 "Displays the IO activity of running processes")
2602 (description
2603 "Iotop is a Python program with a top like user interface to show the
2604processes currently causing I/O.")
3ac73271 2605 (license license:gpl2+)))
e30835e2
LC
2606
2607(define-public fuse
2608 (package
2609 (name "fuse")
e905c8d6 2610 (version "2.9.9")
e30835e2
LC
2611 (source (origin
2612 (method url-fetch)
0e9bc883
LF
2613 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2614 "download/fuse-" version
2615 "/fuse-" version ".tar.gz"))
e30835e2
LC
2616 (sha256
2617 (base32
e905c8d6 2618 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
cd48a549 2619 (patches (search-patches "fuse-overlapping-headers.patch"))))
e30835e2 2620 (build-system gnu-build-system)
b148bd71 2621 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
2622 (arguments
2623 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2624 (assoc-ref %outputs "out")
2625 "/sbin")
2626 (string-append "INIT_D_PATH="
2627 (assoc-ref %outputs "out")
2628 "/etc/init.d")
9a4efac9
LC
2629
2630 ;; The rule makes /dev/fuse 666.
e30835e2
LC
2631 (string-append "UDEV_RULES_PATH="
2632 (assoc-ref %outputs "out")
9a4efac9 2633 "/lib/udev/rules.d"))
dc1d3cde
KK
2634 #:phases
2635 (modify-phases %standard-phases
2636 (add-before 'build 'set-file-names
2637 (lambda* (#:key inputs #:allow-other-keys)
2638 ;; libfuse calls out to mount(8) and umount(8). Make sure
2639 ;; it refers to the right ones.
2640 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2641 (("/bin/(u?)mount" _ maybe-u)
2642 (string-append (assoc-ref inputs "util-linux")
2643 "/bin/" maybe-u "mount")))
2644 (substitute* '("util/mount.fuse.c")
2645 (("/bin/sh")
2646 (which "sh")))
2647
2648 ;; This hack leads libfuse to search for 'fusermount' in
2649 ;; $PATH, where it may find a setuid-root binary, instead of
2650 ;; trying solely $out/sbin/fusermount and failing because
2651 ;; it's not setuid.
2652 (substitute* "lib/Makefile"
2653 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2654 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2655 #t)))))
654de94e 2656 (supported-systems (delete "i586-gnu" %supported-systems))
0e9bc883 2657 (home-page "https://github.com/libfuse/libfuse")
e30835e2
LC
2658 (synopsis "Support file systems implemented in user space")
2659 (description
2660 "As a consequence of its monolithic design, file system code for Linux
2661normally goes into the kernel itself---which is not only a robustness issue,
2662but also an impediment to system extensibility. FUSE, for \"file systems in
2663user space\", is a kernel module and user-space library that tries to address
2664part of this problem by allowing users to run file system implementations as
2665user-space processes.")
3ac73271
LC
2666 (license (list license:lgpl2.1 ;library
2667 license:gpl2+)))) ;command-line utilities
220193ad
LC
2668
2669(define-public unionfs-fuse
2670 (package
2671 (name "unionfs-fuse")
2f861edf 2672 (version "2.0")
220193ad 2673 (source (origin
a428fdd4
EF
2674 (method git-fetch)
2675 (uri (git-reference
2676 (url "https://github.com/rpodgorny/unionfs-fuse")
2677 (commit (string-append "v" version))))
2678 (file-name (git-file-name name version))
220193ad
LC
2679 (sha256
2680 (base32
a428fdd4 2681 "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6"))))
220193ad 2682 (build-system cmake-build-system)
094f4b53 2683 (native-inputs
3ef27337 2684 `(("python" ,python)))
220193ad 2685 (inputs `(("fuse" ,fuse)))
094f4b53 2686 (arguments
3ef27337
LF
2687 ;; The tests were never actually run ("collected 0 items"), but in recent
2688 ;; versions of pytest that causes an error.
2689 '(#:tests? #f))
2f861edf 2690 (home-page "https://github.com/rpodgorny/unionfs-fuse")
220193ad
LC
2691 (synopsis "User-space union file system")
2692 (description
2693 "UnionFS-FUSE is a flexible union file system implementation in user
2694space, using the FUSE library. Mounting a union file system allows you to
2695\"aggregate\" the contents of several directories into a single mount point.
2696UnionFS-FUSE additionally supports copy-on-write.")
3ac73271 2697 (license license:bsd-3)))
ed748588 2698
0b7a0c20
LC
2699(define fuse-static
2700 (package (inherit fuse)
2701 (name "fuse-static")
2702 (source (origin (inherit (package-source fuse))
2703 (modules '((guix build utils)))
2704 (snippet
6cbee49d
MW
2705 '(begin
2706 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2707 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2708 ;; that it doesn't do that, allowing us to remove the
2709 ;; dependency on util-linux (something that is useful in
2710 ;; initrds.)
2711 (substitute* '("lib/mount_util.c"
2712 "util/mount_util.c")
2713 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2714 "0")
2715 (("/bin/")
2716 ""))
2717 #t))))))
0b7a0c20 2718
ed748588
LC
2719(define-public unionfs-fuse/static
2720 (package (inherit unionfs-fuse)
2721 (synopsis "User-space union file system (statically linked)")
2722 (name (string-append (package-name unionfs-fuse) "-static"))
2723 (source (origin (inherit (package-source unionfs-fuse))
2724 (modules '((guix build utils)))
2725 (snippet
6cbee49d
MW
2726 '(begin
2727 ;; Add -ldl to the libraries, because libfuse.a needs that.
2728 (substitute* "src/CMakeLists.txt"
2729 (("target_link_libraries(.*)\\)" _ libs)
2730 (string-append "target_link_libraries"
2731 libs " dl)")))
2732 #t))))
ed748588
LC
2733 (arguments
2734 '(#:tests? #f
1456cff1 2735 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
dc1d3cde
KK
2736 #:phases
2737 (modify-phases %standard-phases
2738 (add-after 'install 'post-install
2739 (lambda* (#:key outputs #:allow-other-keys)
2740 (let* ((out (assoc-ref outputs "out"))
2741 (exe (string-append out "/bin/unionfs")))
2742 ;; By default, 'unionfs' keeps references to
2743 ;; $glibc/share/locale and similar stuff. Remove them.
2744 (remove-store-references exe)
2745
2746 ;; 'unionfsctl' has references to glibc as well. Since
2747 ;; we don't need it, remove it.
2748 (delete-file (string-append out "/bin/unionfsctl"))
2749 #t))))))
0b7a0c20 2750 (inputs `(("fuse" ,fuse-static)))))
67b66003 2751
357b9f9d 2752(define-public sshfs
db288efa 2753 (package
357b9f9d 2754 (name "sshfs")
20f8d1dd 2755 (version "2.10")
db288efa
LC
2756 (source (origin
2757 (method url-fetch)
b58c1b2d 2758 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
f5c6edd6
TGR
2759 "download/sshfs-" version "/sshfs-" version
2760 ".tar.gz"))
db288efa
LC
2761 (sha256
2762 (base32
20f8d1dd 2763 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
db288efa
LC
2764 (build-system gnu-build-system)
2765 (inputs
2766 `(("fuse" ,fuse)
2767 ("glib" ,glib)))
2768 (native-inputs
2769 `(("pkg-config" ,pkg-config)))
f5c6edd6 2770 (home-page "https://github.com/libfuse/sshfs")
db288efa
LC
2771 (synopsis "Mount remote file systems over SSH")
2772 (description
2773 "This is a file system client based on the SSH File Transfer Protocol.
2774Since most SSH servers already support this protocol it is very easy to set
2775up: on the server side there's nothing to do; on the client side mounting the
2776file system is as easy as logging into the server with an SSH client.")
3ac73271 2777 (license license:gpl2+)))
db288efa 2778
357b9f9d 2779(define-public sshfs-fuse
2780 (package (inherit sshfs)
2781 (name "sshfs-fuse")
2782 (properties `((superseded . ,sshfs)))))
2783
1eacffb9
RH
2784(define-public archivemount
2785 (package
2786 (name "archivemount")
903deeea 2787 (version "0.8.12")
1eacffb9
RH
2788 (source
2789 (origin
2790 (method url-fetch)
c6d8817e 2791 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
1eacffb9
RH
2792 "archivemount-" version ".tar.gz"))
2793 (sha256
903deeea 2794 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
1eacffb9 2795 (build-system gnu-build-system)
c695fb76
TGR
2796 (inputs `(("fuse" ,fuse)
2797 ("libarchive" ,libarchive)))
2798 (native-inputs `(("pkg-config" ,pkg-config)))
c6d8817e 2799 (home-page "https://www.cybernoia.de/software/archivemount.html")
1eacffb9
RH
2800 (synopsis "Tool for mounting archive files with FUSE")
2801 (description "archivemount is a FUSE-based file system for Unix variants,
2802including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2803mount point where it can be read from or written to as with any other file
2804system. This makes accessing the contents of the archive, which may be
2805compressed, transparent to other programs, without decompressing them.")
2806 (license license:lgpl2.0+)))
2807
67b66003
LC
2808(define-public numactl
2809 (package
2810 (name "numactl")
93a16e4d 2811 (version "2.0.13")
67b66003
LC
2812 (source (origin
2813 (method url-fetch)
2814 (uri (string-append
0b4f8767 2815 "https://github.com/numactl/numactl/releases/download/v"
1ec29dff 2816 version "/numactl-" version ".tar.gz"))
67b66003
LC
2817 (sha256
2818 (base32
93a16e4d 2819 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
67b66003
LC
2820 (build-system gnu-build-system)
2821 (arguments
e35dff97 2822 '(;; There's a 'test' target, but it requires NUMA support in the kernel
67b66003
LC
2823 ;; to run, which we can't assume to have.
2824 #:tests? #f))
b0015064 2825
35dfcdd7
AE
2826 ;; NUMA is apparently not supported on armhf, see
2827 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2828 (supported-systems (delete "armhf-linux" %supported-systems))
0b4f8767 2829 (home-page "https://github.com/numactl/numactl")
67b66003
LC
2830 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2831 (description
2832 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
79d5ac59
TGR
2833memory is not all in one place. The @command{numactl} program allows you to
2834run your application program on specific CPUs and memory nodes. It does this
2835by supplying a NUMA memory policy to the operating system before running your
67b66003
LC
2836program.
2837
79d5ac59
TGR
2838The package contains other commands, such as @command{numastat},
2839@command{memhog}, and @command{numademo} which provides a quick overview of
2840NUMA performance on your system.")
3ac73271
LC
2841 (license (list license:gpl2 ;programs
2842 license:lgpl2.1)))) ;library
b10e9ff6 2843
103b7e79 2844(define-public kbd-neo
2845 (package
2846 (name "kbd-neo")
2847 (version "2486")
2848 (source
2849 (origin
2850 (method url-fetch)
2851 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2852 version "/linux/console/neo.map"))
2853 (file-name (string-append name "-" version ".map"))
2854 (sha256
2855 (base32
2856 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2857 (build-system trivial-build-system)
2858 (arguments
2859 `(#:modules ((guix build utils))
2860 #:builder (begin
2861 (use-modules (guix build utils))
2862 (let ((out (string-append %output "/share/keymaps"))
2863 (source (assoc-ref %build-inputs "source")))
2864 (mkdir-p out)
2865 (copy-file source (string-append out "/neo.map"))
2866 #t))))
2867 (home-page "https://neo-layout.org")
2868 (synopsis "Neo2 console layout")
2869 (description
2870 "Kbd-neo provides the Neo2 keyboard layout for use with
2871@command{loadkeys(1)} from @code{kbd(4)}.")
2872 ;; The file is located in an svn directory, the entire content of
2873 ;; the directory is licensed as GPL3.
2874 (license license:gpl3+)))
2875
b10e9ff6
LC
2876(define-public kbd
2877 (package
2878 (name "kbd")
8555a609 2879 (version "2.0.4")
b10e9ff6
LC
2880 (source (origin
2881 (method url-fetch)
2882 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
710b4928 2883 version ".tar.xz"))
b10e9ff6
LC
2884 (sha256
2885 (base32
8555a609 2886 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
c8f60748
LC
2887 (modules '((guix build utils)))
2888 (snippet
f2cdcafb
LC
2889 '(begin
2890 (substitute* "tests/Makefile.in"
2891 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2892 (("@VERSION@")
2893 "[@]VERSION[@]"))
2894 (substitute* '("src/unicode_start" "src/unicode_stop")
2895 ;; Assume the Coreutils are in $PATH.
2896 (("/usr/bin/tty")
6cbee49d
MW
2897 "tty"))
2898 #t))))
b10e9ff6
LC
2899 (build-system gnu-build-system)
2900 (arguments
5953d2b7
AK
2901 '(#:phases
2902 (modify-phases %standard-phases
2903 (add-before 'build 'pre-build
2904 (lambda* (#:key inputs #:allow-other-keys)
2905 (let ((gzip (assoc-ref %build-inputs "gzip"))
2906 (bzip2 (assoc-ref %build-inputs "bzip2")))
2907 (substitute* "src/libkeymap/findfile.c"
2908 (("gzip")
2909 (string-append gzip "/bin/gzip"))
2910 (("bzip2")
0d47fdf8
MW
2911 (string-append bzip2 "/bin/bzip2")))
2912 #t)))
5953d2b7
AK
2913 (add-after 'install 'post-install
2914 (lambda* (#:key outputs #:allow-other-keys)
2915 ;; Make sure these programs find their comrades.
2916 (let* ((out (assoc-ref outputs "out"))
2917 (bin (string-append out "/bin")))
2918 (for-each (lambda (prog)
2919 (wrap-program (string-append bin "/" prog)
2920 `("PATH" ":" prefix (,bin))))
0d47fdf8
MW
2921 '("unicode_start" "unicode_stop"))
2922 #t))))))
b10e9ff6 2923 (inputs `(("check" ,check)
f61e0e79
LC
2924 ("gzip" ,gzip)
2925 ("bzip2" ,bzip2)
b10e9ff6 2926 ("pam" ,linux-pam)))
fd7000fe 2927 (native-search-paths
2928 (list (search-path-specification
2929 (variable "LOADKEYS_KEYMAP_PATH")
674d4e13
TGR
2930 ;; Append ‘/**’ to recursively search all directories. One can then
2931 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2932 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2933 (files (list "share/keymaps/**")))))
b10e9ff6 2934 (native-inputs `(("pkg-config" ,pkg-config)))
0ed81d04 2935 (home-page "http://kbd-project.org/")
b10e9ff6
LC
2936 (synopsis "Linux keyboard utilities and keyboard maps")
2937 (description
2938 "This package contains keytable files and keyboard utilities compatible
2939for systems using the Linux kernel. This includes commands such as
36a4366d 2940@code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3ac73271 2941 (license license:gpl2+)))
de0b620e 2942
48e595b7
LC
2943(define-public loadkeys-static
2944 (package
2945 (inherit kbd)
2946 (name "loadkeys-static")
2947 (arguments
2948 (substitute-keyword-arguments (package-arguments kbd)
2949 ((#:configure-flags flags ''())
2950 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2951 "--disable-vlock" ;so we don't need libpam
2952 "--disable-libkeymap")
2953 ,flags))
2954 ((#:make-flags flags ''())
2955 `(cons "LDFLAGS=-all-static" ,flags))
2956 ((#:phases phases '%standard-phases)
2957 `(modify-phases ,phases
2958 (replace 'install
2959 (lambda* (#:key outputs #:allow-other-keys)
2960 (let ((out (assoc-ref outputs "out")))
2961 ;; The binary keeps references to gzip, among other things,
2962 ;; which we don't need in the initrd, so strip references.
2963 (remove-store-references "src/loadkeys")
2964
2965 (install-file "src/loadkeys"
2966 (string-append out "/bin"))
2967 #t)))
2968 (delete 'post-install)))
2969 ((#:strip-flags _ '())
2970 ''("--strip-all"))
2971 ((#:allowed-references _ '())
2972 '())))
2973
2974 (synopsis "Statically-linked @command{loadkeys} program")
2975
2976 ;; This package is meant to be used internally in the initrd so don't
2977 ;; expose it.
2978 (properties '((hidden? . #t)))))
2979
de0b620e
LC
2980(define-public inotify-tools
2981 (package
2982 (name "inotify-tools")
fb5b359d 2983 (version "3.20.1")
de0b620e 2984 (source (origin
88f9fea7
RW
2985 (method git-fetch)
2986 (uri (git-reference
2987 (url "https://github.com/rvoicilas/inotify-tools.git")
2988 (commit version)))
2989 (file-name (git-file-name name version))
de0b620e
LC
2990 (sha256
2991 (base32
88f9fea7 2992 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
de0b620e 2993 (build-system gnu-build-system)
fb5b359d
MB
2994 (native-inputs
2995 `(("autoconf" ,autoconf)
2996 ("automake" ,automake)
2997 ("libtool" ,libtool)))
2998 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
de0b620e
LC
2999 (synopsis "Monitor file accesses")
3000 (description
3001 "The inotify-tools packages provides a C library and command-line tools
3002to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3ac73271 3003 (license license:gpl2+)))
e062d542
AE
3004
3005(define-public kmod
3006 (package
3007 (name "kmod")
ddcfc467 3008 (version "27")
e062d542
AE
3009 (source (origin
3010 (method url-fetch)
3011 (uri
3012 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3013 "kmod-" version ".tar.xz"))
3014 (sha256
3015 (base32
ddcfc467 3016 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
fc1adab1 3017 (patches (search-patches "kmod-module-directory.patch"))))
e062d542
AE
3018 (build-system gnu-build-system)
3019 (native-inputs
3020 `(("pkg-config" ,pkg-config)))
3021 (inputs
f61e0e79
LC
3022 `(("xz" ,xz)
3023 ("zlib" ,zlib)))
e062d542 3024 (arguments
ddcfc467
BW
3025 `(#:configure-flags '("--with-xz" "--with-zlib"
3026 "--disable-test-modules")
9f2eb4ff
TGR
3027 #:phases
3028 (modify-phases %standard-phases
ddcfc467
BW
3029 (add-after 'unpack 'disable-tests
3030 (lambda _
3031 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
312d9a33 3032 (substitute* "Makefile.in"
ddcfc467
BW
3033 (("testsuite/test-modprobe") "")
3034 (("testsuite/test-depmod") "")
3035 (("testsuite/test-blacklist") ""))
3036 #t))
9f2eb4ff
TGR
3037 (add-after 'install 'install-modprobe&co
3038 (lambda* (#:key outputs #:allow-other-keys)
3039 (let* ((out (assoc-ref outputs "out"))
3040 (bin (string-append out "/bin")))
3041 (for-each (lambda (tool)
3042 (symlink "kmod"
3043 (string-append bin "/" tool)))
3044 '("insmod" "rmmod" "lsmod" "modprobe"
3045 "modinfo" "depmod"))
3046 #t))))))
22ee7209 3047 (supported-systems (delete "i586-gnu" %supported-systems))
e062d542
AE
3048 (home-page "https://www.kernel.org/")
3049 (synopsis "Kernel module tools")
35b9e423 3050 (description "Kmod is a set of tools to handle common tasks with Linux
e062d542
AE
3051kernel modules like insert, remove, list, check properties, resolve
3052dependencies and aliases.
3053
3054These tools are designed on top of libkmod, a library that is shipped with
3055kmod. The aim is to be compatible with tools, configurations and indices
3056from the module-init-tools project.")
3ac73271 3057 (license license:gpl2+))) ; library under lgpl2.1+
d7d42d6b 3058
76f5428b
MC
3059(define-public earlyoom
3060 (package
3061 (name "earlyoom")
9f7a441d 3062 (version "1.3.1")
76f5428b
MC
3063 (source (origin
3064 (method git-fetch)
3065 (uri (git-reference
3066 (url "https://github.com/rfjakob/earlyoom.git")
3067 (commit (string-append "v" version))))
3068 (file-name (git-file-name name version))
3069 (sha256
3070 (base32
9f7a441d 3071 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
76f5428b
MC
3072 (build-system gnu-build-system)
3073 (arguments
3074 `(#:phases (modify-phases %standard-phases
3075 (delete 'configure)
3076 (add-before 'check 'set-home
3077 (lambda _
3078 (setenv "HOME" (getcwd))
3079 #t))
3080 (add-after 'build 'install-contribs
3081 ;; Install what seems useful from the contrib directory.
3082 (lambda* (#:key outputs #:allow-other-keys)
3083 (let* ((out (assoc-ref outputs "out"))
3084 (contrib (string-append
3085 out "/share/earlyoom/contrib")))
3086 (install-file "contrib/notify_all_users.py" contrib)
3087 #t))))
3088 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
15c8b172 3089 (list ,(string-append "CC=" (cc-for-target))
76f5428b
MC
3090 (string-append "VERSION=v" ,version)
3091 (string-append "PREFIX=" prefix)
3092 (string-append "SYSCONFDIR=" prefix "/etc")))
3093 #:test-target "test"))
3094 (native-inputs `(("go" ,go) ;for the test suite
3095 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
3096 (home-page "https://github.com/rfjakob/earlyoom")
3097 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3098 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3099runs in user space and provides a more responsive and configurable alternative
3100to the in-kernel OOM killer.")
3101 (license license:expat)))
3102
7fa715e7
LC
3103(define-public eudev
3104 ;; The post-systemd fork, maintained by Gentoo.
fe32c7f7 3105 (package
7fa715e7 3106 (name "eudev")
ed05d6b2 3107 (version "3.2.9")
7fa715e7 3108 (source (origin
ee2d63db
MB
3109 (method git-fetch)
3110 (uri (git-reference (url "https://github.com/gentoo/eudev")
3111 (commit (string-append "v" version))))
3112 (file-name (git-file-name name version))
7fa715e7
LC
3113 (sha256
3114 (base32
ed05d6b2 3115 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
202342fd 3116 (patches (search-patches "eudev-rules-directory.patch"))))
fe32c7f7 3117 (build-system gnu-build-system)
4e859e92 3118 (arguments
213e1764 3119 `(#:phases
172a9b44 3120 (modify-phases %standard-phases
ee2d63db
MB
3121 (add-after 'unpack 'make-source-writable
3122 (lambda _
3123 ;; XXX: Git checkouts are read-only, but this package needs to
3124 ;; modify some of its files.
3125 (for-each make-file-writable (find-files "."))
3126 #t))
189be331 3127 (add-before 'bootstrap 'patch-file-names
213e1764 3128 (lambda* (#:key inputs native-inputs #:allow-other-keys)
172a9b44
MC
3129 (substitute* "man/make.sh"
3130 (("/usr/bin/xsltproc")
213e1764
MO
3131 (string-append (assoc-ref
3132 (or native-inputs inputs) "xsltproc")
172a9b44 3133 "/bin/xsltproc")))
189be331 3134 #t))
d5949638
MB
3135 (add-before 'configure 'patch-bindir-in-btrfs-rules
3136 (lambda* (#:key outputs #:allow-other-keys)
3137 ;; The "@bindir@" substitution incorrectly expands to a literal
3138 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3139 ;; around it.
3140 (let ((out (assoc-ref outputs "out")))
3141 (substitute* "rules/64-btrfs.rules.in"
3142 (("@bindir@")
3143 (string-append out "/bin")))
3144 #t)))
d85f8e46
MB
3145 (add-after 'install 'move-static-library
3146 (lambda* (#:key outputs #:allow-other-keys)
3147 (let* ((out (assoc-ref outputs "out"))
3148 (static (assoc-ref outputs "static"))
3149 (source (string-append out "/lib/libudev.a"))
3150 (target (string-append static "/lib/libudev.a")))
3151 (mkdir-p (dirname target))
3152 (link source target)
3153 (delete-file source)
3154 ;; Remove reference to the static library from the .la file
3155 ;; such that Libtool looks for it in the usual places.
3156 (substitute* (string-append out "/lib/libudev.la")
3157 (("old_library=.*")
3158 "old_library=''\n"))
3159 #t)))
172a9b44
MC
3160 (add-after 'install 'build-hwdb
3161 (lambda* (#:key outputs #:allow-other-keys)
3162 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3163 ;; similar tools to display product names.
213e1764
MO
3164 ;;
3165 ;; XXX: This can't be done when cross-compiling. Find another way
3166 ;; to generate hwdb.bin for cross-built systems.
172a9b44 3167 (let ((out (assoc-ref outputs "out")))
213e1764
MO
3168 ,@(if (%current-target-system)
3169 '(#t)
3170 '((invoke (string-append out "/bin/udevadm")
3171 "hwdb" "--update")))))))
d85f8e46 3172 #:configure-flags (list "--enable-manpages")))
fe32c7f7 3173 (native-inputs
172a9b44
MC
3174 `(("autoconf" ,autoconf)
3175 ("automake" ,automake)
3176 ("gperf" ,gperf)
3177 ("libtool" ,libtool)
3178 ("pkg-config" ,pkg-config)
3179 ;; For tests.
e75230c1 3180 ("perl" ,perl)
172a9b44
MC
3181 ("python" ,python-wrapper)
3182 ;; For documentation.
3183 ("docbook-xml" ,docbook-xml-4.2)
3184 ("docbook-xsl" ,docbook-xsl)
3185 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
c695fb76 3186 ("xsltproc" ,libxslt)))
fe32c7f7 3187 (inputs
255f7308
LC
3188 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3189 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3190 ;; which contains the rules to do that.
bb93042c 3191 `(("util-linux" ,util-linux "lib") ;for blkid
255f7308 3192 ("kmod" ,kmod)))
d85f8e46 3193 (outputs '("out" "static"))
e1921a38 3194 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
3195 (synopsis "Userspace device management")
3196 (description "Udev is a daemon which dynamically creates and removes
3197device nodes from /dev/, handles hotplug events and loads drivers at boot
3198time.")
3ac73271 3199 (license license:gpl2+)))
7fa715e7 3200
e74b2c8e
BT
3201(define-public python-evdev
3202 (package
3203 (name "python-evdev")
3204 (version "1.3.0")
3205 (source
3206 (origin
3207 (method url-fetch)
3208 (uri (pypi-uri "evdev" version))
3209 (sha256
3210 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3211 (build-system python-build-system)
3212 (native-inputs
3213 `(("kernel-headers" ,linux-libre-headers)))
3214 (arguments
3215 `(#:tests? #f ;no rule for tests
3216 #:phases
3217 (modify-phases %standard-phases
3218 (add-before 'build 'fix-hard-coded-directory
3219 (lambda* (#:key inputs #:allow-other-keys)
3220 (substitute* "setup.py"
3221 (("/usr/include/linux")
3222 (string-append
3223 (assoc-ref inputs "kernel-headers") "/include/linux")))
3224 #t)))))
3225 (home-page "https://github.com/gvalkov/python-evdev")
3226 (synopsis "Bindings to the Linux input handling subsystem")
3227 (description
3228 "Python-evdev provides bindings to the generic input event interface in
3229Linux. The @code{evdev} interface serves the purpose of passing events
3230generated in the kernel directly to userspace through character devices that
3231are typically located in @file{/dev/input/}.
3232
3233This package also comes with bindings to @code{uinput}, the userspace input
3234subsystem. @code{uinput} allows userspace programs to create and handle input
3235devices that can inject events directly into the input subsystem.")
3236 (license license:bsd-3)))
3237
66269d47
LC
3238(define-public lvm2
3239 (package
3240 (name "lvm2")
a709af58 3241 (version "2.03.09")
66269d47
LC
3242 (source (origin
3243 (method url-fetch)
57bd483f
MB
3244 (uri (list (string-append "ftp://sourceware.org/pub/lvm2/LVM2."
3245 version ".tgz")
3246 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3247 version ".tgz")))
66269d47
LC
3248 (sha256
3249 (base32
a709af58 3250 "0xdr9qbqw6kja267wmx6ajnfv1nhw056gpxx9v2qmfh3bj6qnfn0"))
66269d47
LC
3251 (modules '((guix build utils)))
3252 (snippet
3253 '(begin
3254 (use-modules (guix build utils))
3255
3256 ;; Honor sysconfdir.
3257 (substitute* "make.tmpl.in"
57bd483f 3258 (("^confdir = .*$")
66269d47
LC
3259 "confdir = @sysconfdir@\n")
3260 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
6cbee49d
MW
3261 "DEFAULT_SYS_DIR = @sysconfdir@"))
3262 #t))
01f94cca 3263 (patches (search-patches "lvm2-static-link.patch"))))
66269d47
LC
3264 (build-system gnu-build-system)
3265 (native-inputs
3266 `(("pkg-config" ,pkg-config)
3267 ("procps" ,procps))) ;tests use 'pgrep'
3268 (inputs
57bd483f
MB
3269 `(("libaio" ,libaio)
3270 ("udev" ,eudev)))
66269d47 3271 (arguments
eff63325 3272 `(#:phases
3afbc6b3
LF
3273 (modify-phases %standard-phases
3274 (add-after 'configure 'set-makefile-shell
3275 (lambda _
3276 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3277 ;; expected.
3278 (setenv "SHELL" (which "sh"))
66269d47 3279
3afbc6b3
LF
3280 ;; Replace /bin/sh with the right file name.
3281 (patch-makefile-SHELL "make.tmpl")
1ac18721 3282 #t)))
66269d47
LC
3283
3284 #:configure-flags (list (string-append "--sysconfdir="
3285 (assoc-ref %outputs "out")
3286 "/etc/lvm")
3287 "--enable-udev_sync"
f2817d43 3288 "--enable-udev_rules"
9324d92e 3289 "--enable-pkgconfig"
a3ed69b6
PN
3290 "--enable-cmdlib"
3291 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
f2817d43
LC
3292
3293 ;; Make sure programs such as 'dmsetup' can
3294 ;; find libdevmapper.so.
3295 (string-append "LDFLAGS=-Wl,-rpath="
a3ed69b6
PN
3296 (assoc-ref %outputs "out")
3297 "/lib,-rpath="
3298 (assoc-ref %outputs "out")
a3ed69b6 3299 "/lib/device-mapper")
eff63325
MO
3300 ;; This is needed when cross-compiling.
3301 ,@(if (%current-target-system)
3302 '("ac_cv_func_malloc_0_nonnull=yes"
3303 "ac_cv_func_realloc_0_nonnull=yes")
3304 '()))
66269d47
LC
3305
3306 ;; The tests use 'mknod', which requires root access.
3307 #:tests? #f))
654de94e 3308 (supported-systems (delete "i586-gnu" %supported-systems))
62ec02bf 3309 (home-page "https://sourceware.org/lvm2/")
66269d47
LC
3310 (synopsis "Logical volume management for Linux")
3311 (description
3312 "LVM2 is the logical volume management tool set for Linux-based systems.
3313This package includes the user-space libraries and tools, including the device
3314mapper. Kernel components are part of Linux-libre.")
3315
3316 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3317 ;; Command-line tools are GPLv2.
3ac73271 3318 (license (list license:gpl2 license:lgpl2.1))))
66269d47 3319
01f94cca
LC
3320(define-public lvm2-static
3321 (package
3322 (inherit lvm2)
3323 (name "lvm2-static")
3324
3325 ;; Propagate udev because libdevmapper.a depends on libudev.
d85f8e46 3326 (propagated-inputs `(("udev:static" ,eudev "static")))
01f94cca
LC
3327
3328 (arguments
3329 (substitute-keyword-arguments (package-arguments lvm2)
3330 ((#:configure-flags flags '())
3331 ;; LVM2 doesn't use Libtool, hence the custom option.
57bd483f
MB
3332 `(append '("--enable-static_link")
3333 ;; Building dmeventd statically is complicated due to a
3334 ;; requirement on libdevmapper.a, which is being phased out
3335 ;; in favor of libdevice-mapper.a, which in turn is is not
3336 ;; easily made available at dmeventd build time. Just ignore
3337 ;; it until the situation improves.
3338 (delete "--enable-dmeventd" ,flags)))
3339 ((#:phases phases)
3340 `(modify-phases ,phases
3341 (add-before 'configure 'adjust-Makefile
3342 (lambda _
3343 ;; These fixes are related to the upstream libdm->device_mapper
3344 ;; migration and will hopefully be fixed upstream in due time.
3345 (substitute* "tools/Makefile.in"
3346 ;; This variable is empty in a static configuration and causes
3347 ;; an erroneous GCC command line.
3348 (("-L\\$\\(interfacebuilddir\\)") "")
3349 ;; Remove obsolete reference to libdevmapper.a.
3350 (("-ldevmapper") ""))
3351 #t))))))
01f94cca
LC
3352 (synopsis "Logical volume management for Linux (statically linked)")))
3353
000f7559
DT
3354(define-public wireless-tools
3355 (package
3356 (name "wireless-tools")
3357 (version "30.pre9")
3358 (source (origin
3359 (method url-fetch)
3360 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3361 version ".tar.gz"))
3362 (sha256
3363 (base32
ec01f22d 3364 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 3365 (snippet
c2099a4c
MW
3366 '(begin
3367 ;; Remove the older header files that are not free software.
3368 (for-each (lambda (n)
3369 (delete-file (format #f "wireless.~a.h" n)))
3370 '(10 11 12 13 14 15 16 17 18 19 20))
3371 #t))))
000f7559
DT
3372 (build-system gnu-build-system)
3373 (arguments
c2099a4c
MW
3374 `(#:make-flags
3375 (list (string-append "PREFIX=" %output)
3376 (string-append "INSTALL_MAN=" %output "/share/man")
3377 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3378 "BUILD_STATIC=")
a21b88f1
MO
3379 #:phases
3380 (modify-phases %standard-phases
3381 (replace 'configure
3382 (lambda* (#:key target #:allow-other-keys)
3383 (when ,(%current-target-system)
3384 ;; Cross-compilation: use the cross tools.
3385 (substitute* (find-files "." "Makefile")
3386 (("CC = .*$")
3387 (string-append "CC = " target "-gcc\n"))
3388 (("AR = .*$")
3389 (string-append "AR = " target "-ar\n"))
3390 (("RANLIB = .*$")
3391 (string-append "RANLIB = " target "-ranlib\n"))))
3392 #t)))
000f7559
DT
3393 #:tests? #f))
3394 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2 3395 (description "Wireless Tools are used to manipulate the now-deprecated
36a4366d 3396Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
fb9b7ce2
LC
3397Extension was an interface allowing you to set Wireless LAN specific
3398parameters and get the specific stats. It is deprecated in favor the nl80211
3399interface.")
fe5ed0bb 3400 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
3401 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3402 ;; other files are distributed under gpl2.
3ac73271 3403 (license (list license:gpl2 license:lgpl2.1+))))
30016044 3404
cc205dac
LC
3405(define-public crda
3406 (package
3407 (name "crda")
3408 (version "3.18")
3409 (source (origin
3410 (method url-fetch)
3411 (uri (string-append "mirror://kernel.org/software/network/crda/"
3412 "crda-" version ".tar.xz"))
3413 (sha256
3414 (base32
3415 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 3416 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
3417 (build-system gnu-build-system)
3418 (arguments
3403a420 3419 `(#:phases (modify-phases %standard-phases
cc205dac 3420 (delete 'configure)
0bc7c2e4
MW
3421 (add-after 'unpack 'gzip-determinism
3422 (lambda _
3423 (substitute* "Makefile"
3424 (("gzip") "gzip --no-name"))
3425 #t))
3403a420
PML
3426 ,@(if (%current-target-system)
3427 '((add-after
3428 'unpack 'fix-pkg-config
3429 (lambda* (#:key target #:allow-other-keys)
3430 (substitute*
3431 "Makefile"
3432 (("pkg-config")
3433 (string-append target "-pkg-config")))
3434 #t)))
3435 '())
cc205dac
LC
3436 (add-before
3437 'build 'no-werror-no-ldconfig
3438 (lambda _
3439 (substitute* "Makefile"
3440 (("-Werror") "")
3441 (("ldconfig") "true"))
3442 #t))
3443 (add-before
3444 'build 'set-regulator-db-file-name
3403a420 3445 (lambda* (#:key native-inputs inputs #:allow-other-keys)
cc205dac 3446 ;; Tell CRDA where to find our database.
3403a420
PML
3447 (let ((regdb (assoc-ref (or native-inputs inputs)
3448 "wireless-regdb")))
cc205dac
LC
3449 (substitute* "crda.c"
3450 (("\"/lib/crda/regulatory.bin\"")
3451 (string-append "\"" regdb
3452 "/lib/crda/regulatory.bin\"")))
3453 #t))))
3454 #:test-target "verify"
3403a420 3455 #:make-flags (let ((out (assoc-ref %outputs "out"))
1ca44ae3 3456 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3403a420 3457 (list
1ca44ae3 3458 (string-append "CC=" ,(cc-for-target))
3403a420
PML
3459 "V=1"
3460
3461 ;; Disable signature-checking on 'regulatory.bin'.
3462 ;; The reason is that this simplifies maintenance
3463 ;; on our side (no need to manage a distro key
3464 ;; pair), and we can guarantee integrity of
3465 ;; 'regulatory.bin' by other means anyway, such as
3466 ;; 'guix gc --verify'. See
3467 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3468 ;; for a discssion.
3469 "USE_OPENSSL=0"
3470
3471 (string-append "PREFIX=" out)
3472 (string-append "SBINDIR=" out "/sbin/")
3473 (string-append "UDEV_RULE_DIR="
3474 out "/lib/udev/rules.d")
3475 (string-append "LDFLAGS=-Wl,-rpath="
3476 out "/lib -L.")
3477 (string-append "REG_BIN=" regdb
3478 "/lib/crda/regulatory.bin")
3479 "all_noverify"))))
cc205dac 3480 (native-inputs `(("pkg-config" ,pkg-config)
cc205dac
LC
3481 ("wireless-regdb" ,wireless-regdb)))
3482 (inputs `(("libnl" ,libnl)))
3483 (home-page
3484 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3485 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3486 (description
3487 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3488communication between the kernel Linux and user space for regulatory
3489compliance.")
3ac73271 3490 (license license:copyleft-next)))
cc205dac 3491
c80b4a3e
LC
3492(define-public wireless-regdb
3493 (package
3494 (name "wireless-regdb")
321292e1 3495 (version "2019.06.03")
c80b4a3e
LC
3496 (source (origin
3497 (method url-fetch)
3498 (uri (string-append
3499 "mirror://kernel.org/software/network/wireless-regdb/"
3500 "wireless-regdb-" version ".tar.xz"))
3501 (sha256
3502 (base32
321292e1 3503 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
5568151f
LC
3504
3505 ;; We're building 'regulatory.bin' by ourselves.
6cbee49d
MW
3506 (snippet '(begin
3507 (delete-file "regulatory.bin")
3508 #t))))
c80b4a3e
LC
3509 (build-system gnu-build-system)
3510 (arguments
321292e1
TGR
3511 '(#:phases
3512 (modify-phases %standard-phases
3513 (add-after 'unpack 'gzip-determinism
3514 (lambda _
3515 (substitute* "Makefile"
3516 (("gzip") "gzip --no-name"))
3517 #t))
3518 (add-after 'unpack 'omit-signature
3519 (lambda _
3520 (substitute* "Makefile"
3521 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3522 ;; don't provide (see below). Disable it.
3523 ((" regulatory\\.db\\.p7s") "")
3524 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3525 ;; but ‘make install’ depends only on the latter while installing
3526 ;; both (and failing). Depend on it explicitly.
3527 (("^install: " all) (string-append all "regulatory.db ")))
3528 #t))
3529 (delete 'configure)) ; no configure script
5568151f
LC
3530
3531 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3532 ;; is computed and can be equal to 'maintainer-clean'; when that
3533 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3534 ;; just built. Thus, build things sequentially.
3535 #:parallel-build? #f
3536
321292e1
TGR
3537 #:tests? #f ; no tests
3538 #:make-flags
3539 (let ((out (assoc-ref %outputs "out")))
3540 (list (string-append "PREFIX=" out)
3541 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3542
3543 ;; Leave this empty so that db2bin.py doesn't try to sign
3544 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3545 ;; pair for the whole distribution.
3546 (string-append "REGDB_PRIVKEY=")
3547 ;; Don't generate a public key for the same reason. These are
3548 ;; used as Makefile targets and can't be the empty string.
3549 (string-append "REGDB_PUBCERT=/dev/null")
3550 (string-append "REGDB_PUBKEY=/dev/null")))))
3551 (native-inputs
3552 `(("python" ,python-wrapper)))
c80b4a3e
LC
3553 (home-page
3554 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3555 (synopsis "Wireless regulatory database")
3556 (description
3557 "This package contains the wireless regulatory database Central
3558Regulatory Database Agent (CRDA) daemon. The database contains information on
3559country-specific regulations for the wireless spectrum.")
3ac73271 3560 (license license:isc)))
c80b4a3e 3561
30016044
MW
3562(define-public lm-sensors
3563 (package
3564 (name "lm-sensors")
3feae386 3565 (version "3.6.0")
b7448627
TGR
3566 (source
3567 (origin
3568 (method git-fetch)
3569 (uri (git-reference
3570 (url "https://github.com/groeck/lm-sensors.git")
3571 (commit (string-append "V" (string-join
3572 (string-split version #\.) "-")))))
3573 (file-name (git-file-name name version))
3574 (sha256
3feae386 3575 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
b7448627 3576 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
3577 (build-system gnu-build-system)
3578 (inputs `(("rrdtool" ,rrdtool)
3579 ("perl" ,perl)
3580 ("kmod" ,kmod)
3581 ("gnuplot" ,gnuplot)))
3582 (native-inputs `(("pkg-config" ,pkg-config)
3583 ("flex" ,flex)
3584 ("bison" ,bison)
3585 ("which" ,which)))
3feae386 3586 (outputs '("lib" ; avoid perl in closure
8ddf20b2 3587 "out"))
30016044 3588 (arguments
3feae386 3589 `(#:tests? #f ; no 'check' target
30016044 3590 #:make-flags (list (string-append "PREFIX=" %output)
8ddf20b2
DL
3591 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3592 (string-append "INCLUDEDIR="
3593 (assoc-ref %outputs "lib") "/include")
3594 (string-append "MANDIR=" %output "/share/man")
3595 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
30016044 3596 #:phases
dc1d3cde
KK
3597 (modify-phases %standard-phases
3598 (delete 'configure)
3599 (add-before 'build 'patch-exec-paths
3600 (lambda* (#:key inputs outputs #:allow-other-keys)
3601 (substitute* "prog/detect/sensors-detect"
3602 (("`uname")
3603 (string-append "`" (assoc-ref inputs "coreutils")
3604 "/bin/uname"))
3605 (("(`|\")modprobe" all open-quote)
3606 (string-append open-quote
3607 (assoc-ref inputs "kmod")
3608 "/bin/modprobe")))
3609 (substitute* '("prog/pwm/pwmconfig"
3610 "prog/pwm/fancontrol")
3611 (("gnuplot")
3612 (string-append (assoc-ref inputs "gnuplot")
3613 "/bin/gnuplot"))
3614 (("cat ")
3615 (string-append (assoc-ref inputs "coreutils")
3616 "/bin/cat "))
074cd595 3617 (("e?grep " match)
dc1d3cde 3618 (string-append (assoc-ref inputs "grep")
074cd595 3619 "/bin/" match))
dc1d3cde
KK
3620 (("sed -e")
3621 (string-append (assoc-ref inputs "sed")
3622 "/bin/sed -e"))
3623 (("cut -d")
3624 (string-append (assoc-ref inputs "coreutils")
3625 "/bin/cut -d"))
3626 (("sleep ")
3627 (string-append (assoc-ref inputs "coreutils")
3628 "/bin/sleep "))
3629 (("readlink -f")
3630 (string-append (assoc-ref inputs "coreutils")
3631 "/bin/readlink -f")))
3632 #t)))))
afab450c 3633 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
30016044
MW
3634 (synopsis "Utilities to read temperature/voltage/fan sensors")
3635 (description
35b9e423 3636 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
3637you to access information from temperature, voltage, and fan speed sensors.
3638It works with most newer systems.")
3ac73271 3639 (license license:gpl2+)))
b087d413 3640
55e1d39b
MB
3641(define-public iucode-tool
3642 (package
3643 (name "iucode-tool")
9eb7cde0 3644 (version "2.3.1")
55e1d39b
MB
3645 (source (origin
3646 (method url-fetch)
3647 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3648 "/raw/latest/iucode-tool_" version ".tar.xz"))
3649 (sha256
3650 (base32
9eb7cde0 3651 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
55e1d39b
MB
3652 (build-system gnu-build-system)
3653 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3654 (synopsis "Manipulate Intel microcode bundles")
3655 (description
3656 "@command{iucode_tool} is a utility to work with microcode packages for
3657Intel processors. It can convert between formats, extract specific versions,
3658create a firmware image suitable for the Linux kernel, and more.")
513dc568
EF
3659 ;; cpuid.h is available for i686, x86_64, and ia64.
3660 (supported-systems '("i686-linux" "x86_64-linux"))
55e1d39b
MB
3661 (license license:gpl2+)))
3662
f5b2a53d
RW
3663(define-public i2c-tools
3664 (package
3665 (name "i2c-tools")
3666 (version "3.1.1")
3667 (source (origin
3668 (method url-fetch)
3669 (uri (string-append
f32274a7 3670 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
3671 version ".tar.bz2"))
3672 (sha256
3673 (base32
3674 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3675 (build-system gnu-build-system)
3676 (arguments
1f0e1c49 3677 `(#:tests? #f ; no 'check' target
f5b2a53d 3678 #:make-flags (list (string-append "prefix=" %output)
1f0e1c49
TGR
3679 ,(string-append "CC=" (cc-for-target)))
3680 ;; No configure script.
dc1d3cde 3681 #:phases (modify-phases %standard-phases (delete 'configure))))
bccf27cb
RW
3682 (inputs
3683 `(("perl" ,perl)))
f32274a7 3684 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
3685 (synopsis "I2C tools for Linux")
3686 (description
3687 "The i2c-tools package contains a heterogeneous set of I2C tools for
3688Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3689EEPROM decoding scripts, EEPROM programming tools, and a python module for
3690SMBus access.")
3ac73271 3691 (license license:gpl2+)))
f5b2a53d 3692
b087d413
MW
3693(define-public xsensors
3694 (package
3695 (name "xsensors")
3696 (version "0.70")
3697 (source (origin
3698 (method url-fetch)
3699 (uri (string-append
3700 "http://www.linuxhardware.org/xsensors/xsensors-"
3701 version ".tar.gz"))
3702 (sha256
3703 (base32
3704 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3705 (build-system gnu-build-system)
8ddf20b2 3706 (inputs `(("lm-sensors" ,lm-sensors "lib")
b087d413
MW
3707 ("gtk" ,gtk+-2)))
3708 (native-inputs `(("pkg-config" ,pkg-config)))
3709 (arguments
dc1d3cde
KK
3710 `(#:phases
3711 (modify-phases %standard-phases
3712 (add-before 'configure 'enable-deprecated
3713 (lambda _
3714 (substitute* "src/Makefile.in"
3715 (("-DGDK_DISABLE_DEPRECATED") "")
3716 (("-DGTK_DISABLE_DEPRECATED") ""))
3717 #t))
3718 (add-before 'configure 'remove-Werror
3719 (lambda _
3720 (substitute* '("configure" "src/Makefile.in")
3721 (("-Werror") ""))
3722 #t)))))
b087d413
MW
3723 (home-page "http://www.linuxhardware.org/xsensors/")
3724 (synopsis "Hardware health information viewer")
3725 (description
35b9e423 3726 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
3727health such as temperature, voltage and fan speed and displays the information
3728in a digital read-out.")
3ac73271 3729 (license license:gpl2+)))
b62fe07f
LC
3730
3731(define-public perf
3732 (package
3733 (name "perf")
3734 (version (package-version linux-libre))
fb76ef84 3735 (source (package-source linux-libre))
b62fe07f
LC
3736 (build-system gnu-build-system)
3737 (arguments
dc1d3cde
KK
3738 '(#:phases
3739 (modify-phases %standard-phases
3740 (replace 'configure
3741 (lambda* (#:key inputs #:allow-other-keys)
3742 (setenv "SHELL_PATH" (which "bash"))
3743 (chdir "tools/perf")
3744 #t)))
65dabe4e 3745 #:make-flags (list (string-append "prefix="
b62fe07f 3746 (assoc-ref %outputs "out"))
ff30860b 3747 "CC=gcc"
2af29d23
LC
3748 "WERROR=0"
3749
3750 ;; By default, 'config/Makefile' uses lib64 on
3751 ;; x86_64. Work around that.
3752 "lib=lib")
b62fe07f
LC
3753 #:tests? #f)) ;no tests
3754 (native-inputs
3755 `(("pkg-config" ,pkg-config)
3756 ("bison" ,bison)
3757 ("flex" ,flex)
3758
3759 ;; There are build scripts written in these languages.
3760 ("perl" ,perl)
3761 ("python" ,python-2)))
3762 (inputs
b1fb4b23 3763 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 3764 ;; ("newt" ,newt)
6c030d10 3765 ("python" ,python-2) ;'perf' links against libpython
b62fe07f 3766 ("elfutils" ,elfutils)
b25d3bd9 3767 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
1d484507
LC
3768 ("libunwind" ,libunwind) ;better stack walking
3769 ("numactl" ,numactl) ;for 'perf bench numa mem'
b62fe07f 3770
d7ece67a
LC
3771 ;; Documentation.
3772 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
d7ece67a
LC
3773 ("docbook-xsl" ,docbook-xsl)
3774 ("xmlto" ,xmlto)
3775 ("asciidoc" ,asciidoc)))
b62fe07f
LC
3776 (home-page "https://perf.wiki.kernel.org/")
3777 (synopsis "Linux profiling with performance counters")
3778 (description
3779 "perf is a tool suite for profiling using hardware performance counters,
3780with support in the Linux kernel. perf can instrument CPU performance
3781counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3782of lightweight profiling. This package contains the user-land tools and in
36a4366d 3783particular the @code{perf} command.")
b62fe07f 3784 (license (package-license linux-libre))))
c09e60e4
DT
3785
3786(define-public pflask
3787 (package
3788 (name "pflask")
3789 (version "0.2")
3790 (source (origin
3791 (method url-fetch)
3792 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3793 version ".tar.gz"))
f586c877 3794 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
3795 (sha256
3796 (base32
3797 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3798 (build-system cmake-build-system)
3799 (arguments
3800 '(#:tests? #f)) ; no tests
81e59e41 3801 (home-page "https://ghedo.github.io/pflask/")
c09e60e4
DT
3802 (synopsis "Simple tool for creating Linux namespace containers")
3803 (description "pflask is a simple tool for creating Linux namespace
3804containers. It can be used for running a command or even booting an OS inside
3805an isolated container, created with the help of Linux namespaces. It is
3806similar in functionality to chroot, although pflask provides better isolation
3807thanks to the use of namespaces.")
3ac73271 3808 (license license:bsd-2)))
288084d5 3809
3ec07ced
RW
3810(define-public singularity
3811 (package
3812 (name "singularity")
edc6dd03 3813 (version "2.6.1")
3ec07ced
RW
3814 (source (origin
3815 (method url-fetch)
3816 (uri (string-append "https://github.com/singularityware/singularity/"
3817 "releases/download/" version
3818 "/singularity-" version ".tar.gz"))
3819 (sha256
3820 (base32
fbf26cbc
LC
3821 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3822 (modules '((guix build utils)))
3823 (snippet
3824 '(begin
3825 ;; Do not create directories in /var.
3826 (substitute* "Makefile.in"
3827 (("\\$\\(MAKE\\) .*install-data-hook") ""))
af857579
LC
3828
3829 ;; The original source overrides PATH so that it points to
3830 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3831 ;; on Guix System. Leave PATH unchanged so we refer to the
3832 ;; installed Coreutils, grep, etc.
3833 (substitute* "bin/singularity.in"
3834 (("^PATH=.*" all)
3835 (string-append "#" all "\n")))
08814aec
LC
3836
3837 (substitute* (find-files "libexec/cli" "\\.exec$")
3838 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3839 _ program)
3840 (string-append "/run/setuid-programs/singularity-"
3841 program "-helper")))
e0dbed64
LC
3842
3843 ;; These squashfs mount options are apparently no longer
3844 ;; supported since Linux-libre 5.4.5.
3845 (substitute* "src/lib/image/squashfs/mount.c"
3846 (("\"errors=remount-ro\"")
3847 "NULL"))
fbf26cbc 3848 #t))))
3ec07ced
RW
3849 (build-system gnu-build-system)
3850 (arguments
08814aec 3851 `(#:configure-flags '("--localstatedir=/var")
3ec07ced
RW
3852 #:phases
3853 (modify-phases %standard-phases
3ec07ced
RW
3854 (add-after 'unpack 'patch-reference-to-squashfs-tools
3855 (lambda _
3856 (substitute* "libexec/cli/build.exec"
3857 (("if ! singularity_which mksquashfs") "if 0")
3858 (("if ! mksquashfs")
3859 (string-append "if ! " (which "mksquashfs"))))
22464cf3
LC
3860 #t))
3861 (add-after 'install 'set-PATH
3862 (lambda* (#:key inputs outputs #:allow-other-keys)
3863 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
3864 (let ((out (assoc-ref outputs "out"))
3865 (coreutils (assoc-ref inputs "coreutils")))
3866 (wrap-program (string-append out "/bin/singularity")
3867 `("PATH" ":" = (,(string-append coreutils "/bin"))))
3868 (substitute* (string-append out "/bin/run-singularity")
3869 (("/usr/bin/env singularity")
3870 (string-append (which "env") " "
3871 out "/bin/singularity")))
3872 #t))))))
3ec07ced
RW
3873 (inputs
3874 `(("libarchive" ,libarchive)
3875 ("python" ,python-wrapper)
3ec07ced
RW
3876 ("zlib" ,zlib)
3877 ("squashfs-tools" ,squashfs-tools)))
3878 (home-page "https://singularity.lbl.gov/")
3879 (synopsis "Container platform")
3880 (description "Singularity is a container platform supporting a number of
3881container image formats. It can build SquashFS container images or import
3882existing Docker images. Singularity requires kernel support for container
3883isolation or root privileges.")
3884 (license license:bsd-3)))
3885
288084d5
MW
3886(define-public hdparm
3887 (package
3888 (name "hdparm")
abb90ff9 3889 (version "9.58")
288084d5
MW
3890 (source (origin
3891 (method url-fetch)
1b1ef87e
TGR
3892 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3893 "hdparm-" version ".tar.gz"))
288084d5
MW
3894 (sha256
3895 (base32
abb90ff9 3896 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
288084d5
MW
3897 (build-system gnu-build-system)
3898 (arguments
7dd57cc0
TGR
3899 `(#:make-flags
3900 (let ((out (assoc-ref %outputs "out")))
3901 (list (string-append "binprefix=" out)
3902 (string-append "manprefix=" out)
3903 ,(string-append "CC=" (cc-for-target))
3904 ;; Let Guix strip the binaries and not break cross-compilation.
3905 "STRIP=true"))
ec238332
TGR
3906 #:phases
3907 (modify-phases %standard-phases
3908 (delete 'configure)) ; no configure script
3909 #:tests? #f)) ; no test suite
3b3b60d0 3910 (home-page "https://sourceforge.net/projects/hdparm/")
02052b2c 3911 (synopsis "View and tune ATA disk drive parameters")
288084d5 3912 (description
02052b2c
TGR
3913 "@command{hdparm} is a command-line utility to control ATA controllers and
3914disk drives. It can increase performance and/or reliability by careful tuning
3915of hardware settings like power and acoustic management, DMA modes, and caching.
3916It can also display detailed device information, or be used as a simple
3917performance benchmarking tool.
3918
3919@command{hdparm} provides a command line interface to various Linux kernel
3920interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
d08be77a
TGR
3921IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3922Translation (@dfn{SAT}) are also supported.")
3ac73271 3923 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 3924
323841bd
VL
3925(define-public nvme-cli
3926 (package
3927 (name "nvme-cli")
5bc22ba8 3928 (version "1.11.2")
323841bd
VL
3929 (home-page "https://github.com/linux-nvme/nvme-cli")
3930 (source (origin
3931 (method git-fetch)
3932 (uri (git-reference
3933 (url home-page)
3934 (commit (string-append "v" version))))
3935 (sha256
5bc22ba8 3936 (base32 "0ngh7zffjf6ac8b22hdi4ry7hjlafih172hrbpw8j17r7c0wjy9i"))
323841bd
VL
3937 (file-name (git-file-name name version))))
3938 (build-system gnu-build-system)
3939 (arguments
2b9ce100
TGR
3940 `(#:make-flags
3941 (list ,(string-append "CC=" (cc-for-target)))
323841bd 3942 #:phases (modify-phases %standard-phases
2b9ce100 3943 (delete 'configure) ; no ./configure script
323841bd
VL
3944 (replace 'install
3945 (lambda _
3946 (invoke "make" "install-spec" "PREFIX="
3947 (string-append "DESTDIR=" %output)))))
2b9ce100
TGR
3948 ;; The tests require sysfs, which is not accessible from from the build
3949 ;; environment
3950 #:tests? #f))
323841bd
VL
3951 (synopsis "NVM-Express user space tooling for Linux")
3952 (description "Nvme-cli is a utility to provide standards compliant tooling
3953for NVM-Express drives. It was made specifically for Linux as it relies on the
3954IOCTLs defined by the mainline kernel driver.")
3955 (license license:gpl2+)))
3956
c755c854
MW
3957(define-public rfkill
3958 (package
3959 (name "rfkill")
3960 (version "0.5")
3961 (source (origin
3962 (method url-fetch)
3963 (uri (string-append "mirror://kernel.org/software/network/"
3964 name "/" name "-" version ".tar.xz"))
3965 (sha256
3966 (base32
3967 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3968 (build-system gnu-build-system)
3969 (arguments
3970 `(#:make-flags (list "CC=gcc"
3971 (string-append "PREFIX=" %output))
3972 #:phases (modify-phases %standard-phases
3973 (delete 'configure))
3974 #:tests? #f))
3975 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3976 (synopsis "Tool for enabling and disabling wireless devices")
3977 (description
3978 "rfkill is a simple tool for accessing the rfkill device interface,
3979which is used to enable and disable wireless networking devices, typically
3980WLAN, Bluetooth and mobile broadband.")
3ac73271 3981 (license (license:non-copyleft "file://COPYING"
5146f22b
EF
3982 "See COPYING in the distribution."))
3983 ;; rfkill is part of util-linux as of 2.31.
3984 (properties `((superseded . ,util-linux)))))
c755c854 3985
dc9bdb1e
ML
3986(define-public acpi
3987 (package
3988 (name "acpi")
3989 (version "1.7")
3990 (source (origin
3991 (method url-fetch)
81e59e41 3992 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
de67e922 3993 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
3994 (sha256
3995 (base32
3996 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3997 (build-system gnu-build-system)
3998 (home-page "http://acpiclient.sourceforge.net")
3999 (synopsis "Display information on ACPI devices")
4000 (description "@code{acpi} attempts to replicate the functionality of the
4001\"old\" @code{apm} command on ACPI systems, including battery and thermal
4002information. It does not support ACPI suspending, only displays information
4003about ACPI devices.")
4004 (license license:gpl2+)))
4005
57a516d3
LC
4006(define-public acpid
4007 (package
4008 (name "acpid")
b928c587 4009 (version "2.0.32")
57a516d3
LC
4010 (source (origin
4011 (method url-fetch)
4012 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4013 version ".tar.xz"))
4014 (sha256
4015 (base32
b928c587 4016 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
57a516d3 4017 (build-system gnu-build-system)
3b3b60d0 4018 (home-page "https://sourceforge.net/projects/acpid2/")
57a516d3
LC
4019 (synopsis "Daemon for delivering ACPI events to user-space programs")
4020 (description
4021 "acpid is designed to notify user-space programs of Advanced
4022Configuration and Power Interface (ACPI) events. acpid should be started
4023during the system boot, and will run as a background process. When an ACPI
4024event is received from the kernel, acpid will examine the list of rules
4025specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 4026 (license license:gpl2+)))
37f5caec
TUBK
4027
4028(define-public sysfsutils
4029 (package
4030 (name "sysfsutils")
4031 (version "2.1.0")
4032 (source
4033 (origin
4034 (method url-fetch)
4035 (uri
4036 (string-append
4037 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4038 version ".tar.gz"))
4039 (sha256
4040 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4041 (build-system gnu-build-system)
4042 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4043 (synopsis "System utilities based on Linux sysfs")
4044 (description
8f65585b 4045 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
4046Linux kernel versions 2.5+ that exposes a system's device tree. The package
4047also contains the libsysfs library.")
4048 ;; The library is under lgpl2.1+ (all files say "or any later version").
4049 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 4050 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
4051
4052(define-public sysfsutils-1
4053 (package
4054 (inherit sysfsutils)
4055 (version "1.3.0")
4056 (source
4057 (origin
4058 (method url-fetch)
4059 (uri
4060 (string-append
4061 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4062 "/sysfsutils-" version ".tar.gz"))
4063 (sha256
4064 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4065 (modules '((guix build utils)))
4066 (snippet
4067 '(begin
4068 (substitute* "Makefile.in"
4069 (("includedir = /usr/include/sysfs")
4070 "includedir = @includedir@"))
4071 (substitute* "configure"
4072 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
6cbee49d
MW
4073 (string-append "includedir='" orig "/sysfs'")))
4074 #t))))
a9a1a40b 4075 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
4076
4077(define-public cpufrequtils
4078 (package
4079 (name "cpufrequtils")
4080 (version "0.3")
4081 (source
4082 (origin
4083 (method url-fetch)
18160c34
MB
4084 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4085 "cpufrequtils-" version ".tar.gz"))
e6caa52d
TUBK
4086 (sha256
4087 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 4088 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
4089 (build-system gnu-build-system)
4090 (native-inputs
4091 `(("sysfsutils" ,sysfsutils-1)))
4092 (arguments
4093 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4094 (assoc-ref %outputs "out") "/lib"))))
4095 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4096 (synopsis "Utilities to get and set CPU frequency on Linux")
4097 (description
e881752c 4098 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
4099information, and set the CPU frequency if supported, using the cpufreq
4100capabilities of the Linux kernel.")
3ac73271 4101 (license license:gpl2)))
0a588bf9
SB
4102
4103(define-public libraw1394
4104 (package
4105 (name "libraw1394")
7c58c852 4106 (version "2.1.2")
0a588bf9
SB
4107 (source (origin
4108 (method url-fetch)
4109 (uri (string-append
4110 "mirror://kernel.org/linux/libs/ieee1394/"
4111 name "-" version ".tar.xz"))
4112 (sha256
4113 (base32
7c58c852 4114 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
0a588bf9
SB
4115 (build-system gnu-build-system)
4116 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4117 (synopsis "Interface library for the Linux IEEE1394 drivers")
4118 (description
4119 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4120the Linux IEEE-1394 subsystem, which provides direct access to the connected
41211394 buses to user space. Through libraw1394/raw1394, applications can directly
4122send to and receive from other nodes without requiring a kernel driver for the
4123protocol in question.")
3ac73271 4124 (license license:lgpl2.1+)))
68e3c29d
SB
4125
4126(define-public libavc1394
4127 (package
4128 (name "libavc1394")
4129 (version "0.5.4")
4130 (source (origin
4131 (method url-fetch)
de67e922 4132 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
4133 name "-" version ".tar.gz"))
4134 (sha256
4135 (base32
4136 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4137 (build-system gnu-build-system)
4138 (native-inputs
4139 `(("pkg-config" ,pkg-config)))
4140 (propagated-inputs
4141 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3b3b60d0 4142 (home-page "https://sourceforge.net/projects/libavc1394/")
68e3c29d
SB
4143 (synopsis "AV/C protocol library for IEEE 1394")
4144 (description
4145 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 4146the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 4147 (license license:lgpl2.1+)))
3f7bf86a
SB
4148
4149(define-public libiec61883
4150 (package
4151 (name "libiec61883")
4152 (version "1.2.0")
4153 (source (origin
4154 (method url-fetch)
4155 (uri (string-append
4156 "mirror://kernel.org/linux/libs/ieee1394/"
4157 name "-" version ".tar.xz"))
4158 (sha256
4159 (base32
4160 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4161 (build-system gnu-build-system)
4162 (native-inputs
4163 `(("pkg-config" ,pkg-config)))
4164 (propagated-inputs
4165 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4166 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4167 (synopsis "Isochronous streaming media library for IEEE 1394")
4168 (description
4169 "The libiec61883 library provides a higher level API for streaming DV,
4170MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 4171 (license license:lgpl2.1+)))
69159125
MW
4172
4173(define-public mdadm
4174 (package
4175 (name "mdadm")
30288ae5 4176 (version "4.1")
69159125
MW
4177 (source (origin
4178 (method url-fetch)
4179 (uri (string-append
4180 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4181 version ".tar.xz"))
4182 (sha256
4183 (base32
30288ae5 4184 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
69159125
MW
4185 (build-system gnu-build-system)
4186 (inputs
4187 `(("udev" ,eudev)))
4188 (arguments
4189 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3dec317f 4190 (list ,(string-append "CC=" (cc-for-target))
fae88ae8 4191 "INSTALL=install"
69159125
MW
4192 "CHECK_RUN_DIR=0"
4193 ;; TODO: tell it where to find 'sendmail'
4194 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4195 (string-append "BINDIR=" out "/sbin")
4196 (string-append "MANDIR=" out "/share/man")
4197 (string-append "UDEVDIR=" out "/lib/udev")))
dc1d3cde
KK
4198 #:phases
4199 (modify-phases %standard-phases
4200 (add-before 'build 'patch-program-paths
7dbd3a8e
MO
4201 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4202 (let ((coreutils (assoc-ref (or native-inputs inputs)
4203 "coreutils")))
dc1d3cde
KK
4204 (substitute* "udev-md-raid-arrays.rules"
4205 (("/usr/bin/(readlink|basename)" all program)
4206 (string-append coreutils "/bin/" program))))
4207 #t))
4208 (add-before 'build 'remove-W-error
4209 (lambda _
4210 ;; We cannot build with -Werror on i686 due to a
4211 ;; 'sign-compare' warning in util.c.
4212 (substitute* "Makefile"
4213 (("-Werror") ""))
4214 #t))
4215 (delete 'configure))
69159125
MW
4216 ;;tests must be done as root
4217 #:tests? #f))
654de94e 4218 (supported-systems (delete "i586-gnu" %supported-systems))
69159125
MW
4219 (home-page "http://neil.brown.name/blog/mdadm")
4220 (synopsis "Tool for managing Linux Software RAID arrays")
4221 (description
4222 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4223assemble, report on, and monitor arrays. It can also move spares between raid
4224arrays when needed.")
3ac73271 4225 (license license:gpl2+)))
01ccdfb6 4226
631fda7e
LC
4227(define-public mdadm-static
4228 (package
4229 (inherit mdadm)
4230 (name "mdadm-static")
4231 (arguments
4232 (substitute-keyword-arguments (package-arguments mdadm)
4233 ((#:make-flags flags)
4234 `(cons "LDFLAGS = -static" ,flags))
4235 ((#:phases phases)
4236 `(modify-phases ,phases
4237 (add-after 'install 'remove-cruft
4238 (lambda* (#:key outputs #:allow-other-keys)
4239 (let* ((out (assoc-ref outputs "out"))
4240 (precious? (lambda (file)
4241 (member file '("." ".." "sbin"))))
4242 (directories (scandir out (negate precious?))))
4243 (with-directory-excursion out
4244 (for-each delete-file-recursively directories)
4245 (remove-store-references "sbin/mdadm")
4246 (delete-file "sbin/mdmon")
4247 #t))))))
4248 ((#:modules modules %gnu-build-system-modules)
4249 `((ice-9 ftw) ,@modules))
4250 ((#:strip-flags _ '())
4251 ''("--strip-all")) ;strip a few extra KiB
4252 ((#:allowed-references _ '("out"))
4253 '("out")))) ;refer only self
4254 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4255
b3ed50e6
MB
4256(define-public multipath-tools
4257 (package
4258 (name "multipath-tools")
cfdd023b 4259 (version "0.8.4")
b3ed50e6 4260 (source (origin
d1ed1d75
MB
4261 (method git-fetch)
4262 (uri (git-reference
4263 (url "https://git.opensvc.com/multipath-tools/.git")
4264 (commit version)))
4265 (file-name (git-file-name name version))
b3ed50e6
MB
4266 (sha256
4267 (base32
cfdd023b
MB
4268 "14n8pcgnliicqxzc40xvjxk4cafm4qx7a3rsx5qva74r3ydzx8rn"))
4269 (patches (search-patches "multipath-tools-sans-systemd.patch"))
b3ed50e6
MB
4270 (modules '((guix build utils)))
4271 (snippet
4272 '(begin
4273 ;; Drop bundled valgrind headers.
4274 (delete-file-recursively "third-party")
4275 (substitute* '("multipathd/main.c"
4276 "libmultipath/debug.c")
4277 (("#include \"../third-party/")
4278 "#include \""))
4279 #t))))
4280 (build-system gnu-build-system)
4281 (arguments
a43fe7ac 4282 '(#:test-target "test"
cfdd023b 4283 #:parallel-build? #f ;XXX: broken in 0.8.4
bd835ff2
TGR
4284 #:make-flags (list "CC=gcc"
4285 (string-append "DESTDIR="
b3ed50e6 4286 (assoc-ref %outputs "out"))
cfdd023b
MB
4287 ;; Install Udev rules below this directory, relative
4288 ;; to the prefix.
b5fb9430 4289 "SYSTEMDPATH=lib"
b3ed50e6
MB
4290 (string-append "LDFLAGS=-Wl,-rpath="
4291 (assoc-ref %outputs "out")
4292 "/lib"))
4293 #:phases
4294 (modify-phases %standard-phases
b5fb9430 4295 (add-after 'unpack 'patch-source
7f412f33
MB
4296 (lambda* (#:key inputs #:allow-other-keys)
4297 (let ((lvm2 (assoc-ref inputs "lvm2"))
4298 (udev (assoc-ref inputs "udev")))
4299 (substitute* "Makefile.inc"
a9e7d656
MO
4300 (("\\$\\(prefix\\)/usr") "$(prefix)")
4301 ;; Do not save timestamp to avoid gzip "timestamp
4302 ;; out-of-range" warnings.
4303 (("gzip -9") "gzip -9n"))
7f412f33
MB
4304 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4305 (("/usr/include/libdevmapper.h")
4306 (string-append lvm2 "/include/libdevmapper.h"))
4307 (("/usr/include/libudev.h")
4308 (string-append udev "/include/libudev.h")))
4309 #t)))
cfdd023b
MB
4310 (add-after 'unpack 'fix-maybe-uninitialized-variable
4311 (lambda _
4312 ;; This variable gets initialized later if needed, but GCC 7
4313 ;; fails to notice. Should be fixed for > 0.8.4.
4314 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4315 (substitute* "libmultipath/structs_vec.c"
4316 (("bool is_queueing;")
4317 "bool is_queueing = false;"))
4318 #t))
a43fe7ac
MB
4319 (add-after 'unpack 'fix-linking-tests
4320 (lambda _
4321 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4322 ;; for versions > 0.8.4.
4323 (substitute* "tests/Makefile"
4324 (("-lmultipath -lcmocka")
4325 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4326 #t))
57e3f06b 4327 (delete 'configure)))) ; no configure script
b3ed50e6 4328 (native-inputs
7f412f33
MB
4329 `(("perl" ,perl)
4330 ("pkg-config" ,pkg-config)
a43fe7ac
MB
4331 ("valgrind" ,valgrind)
4332
4333 ;; For tests.
4334 ("cmocka" ,cmocka)))
b3ed50e6 4335 (inputs
beec29da 4336 `(("json-c" ,json-c-0.13)
b3ed50e6
MB
4337 ("libaio" ,libaio)
4338 ("liburcu" ,liburcu)
4339 ("lvm2" ,lvm2)
4340 ("readline" ,readline)
4341 ("udev" ,eudev)))
4342 (home-page "http://christophe.varoqui.free.fr/")
4343 (synopsis "Access block devices through multiple paths")
4344 (description
4345 "This package provides the following binaries to drive the
4346Linux Device Mapper multipathing driver:
4347@enumerate
4348@item @command{multipath} - Device mapper target autoconfig.
4349@item @command{multipathd} - Multipath daemon.
4350@item @command{mpathpersist} - Manages SCSI persistent reservations on
4351@code{dm} multipath devices.
4352@item @command{kpartx} - Create device maps from partition tables.
4353@end enumerate")
57e3f06b 4354 (license (list license:gpl2+ ; main distribution
b3ed50e6
MB
4355 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4356
01ccdfb6
SB
4357(define-public libaio
4358 (package
4359 (name "libaio")
2fabf398 4360 (version "0.3.112")
01ccdfb6
SB
4361 (source (origin
4362 (method url-fetch)
87dc306b
MB
4363 (uri (list
4364 (string-append "https://releases.pagure.org/libaio/"
4365 name "-" version ".tar.gz")))
4366 (sha256
4367 (base32
2fabf398 4368 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
01ccdfb6
SB
4369 (build-system gnu-build-system)
4370 (arguments
f847d9dc
MB
4371 `(#:make-flags
4372 (let ((target ,(%current-target-system)))
4373 (list (string-append "prefix=" %output)
4374 (string-append
4375 "CC=" (if target
4376 (string-append (assoc-ref %build-inputs "cross-gcc")
4377 "/bin/" target "-gcc")
4378 "gcc"))))
01ccdfb6
SB
4379 #:test-target "partcheck" ; need root for a full 'check'
4380 #:phases
21bdf383 4381 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
87dc306b 4382 (home-page "https://pagure.io/libaio")
01ccdfb6
SB
4383 (synopsis "Linux-native asynchronous I/O access library")
4384 (description
4385 "This library enables userspace to use Linux kernel asynchronous I/O
4386system calls, important for the performance of databases and other advanced
4387applications.")
3ac73271 4388 (license license:lgpl2.1+)))
eb7c43c3 4389
12eb7bb8
VL
4390(define-public blktrace
4391 ;; Take a newer commit to get the fix for CVE-2018-10689.
93a267b7
VL
4392 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4393 (revision "1"))
12eb7bb8
VL
4394 (package
4395 (name "blktrace")
4396 (version (git-version "1.2.0" revision commit))
4397 (home-page
4398 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4399 (source (origin
4400 (method git-fetch)
4401 (uri (git-reference
4402 (url home-page)
4403 (commit commit)))
4404 (sha256
93a267b7
VL
4405 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4406 (file-name (git-file-name name version))))
12eb7bb8
VL
4407 (build-system gnu-build-system)
4408 (arguments
ac68ab33
TGR
4409 `(#:make-flags
4410 (list ,(string-append "CC=" (cc-for-target))
4411 (string-append "prefix=" %output))
4412 #:tests? #f ; no tests
12eb7bb8
VL
4413 #:phases
4414 (modify-phases %standard-phases
ac68ab33 4415 (delete 'configure) ; no configure script
12eb7bb8
VL
4416 (add-after 'unpack 'fix-gnuplot-path
4417 (lambda* (#:key inputs #:allow-other-keys)
4418 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4419 (substitute* "btt/bno_plot.py"
4420 (("gnuplot %s")
4421 (string-append gnuplot "/bin/gnuplot %s")))
4422 #t))))))
4423 (inputs
4424 `(("libaio" ,libaio)
4425 ("gnuplot" ,gnuplot)
4426 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4427 (synopsis "Block layer IO tracing mechanism")
4428 (description "Blktrace is a block layer IO tracing mechanism which provides
4429detailed information about request queue operations to user space. It extracts
4430event traces from the kernel (via the relaying through the debug file system).")
4431 (license license:gpl2))))
4432
81b98756
RW
4433(define-public sbc
4434 (package
4435 (name "sbc")
2a11a029 4436 (version "1.4")
81b98756
RW
4437 (source (origin
4438 (method url-fetch)
18160c34
MB
4439 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4440 version ".tar.xz"))
81b98756
RW
4441 (sha256
4442 (base32
2a11a029 4443 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
81b98756
RW
4444 (build-system gnu-build-system)
4445 (inputs
4446 `(("libsndfile" ,libsndfile)))
4447 (native-inputs
4448 `(("pkg-config" ,pkg-config)))
4449 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4450 (synopsis "Bluetooth subband audio codec")
4451 (description
4452 "The SBC is a digital audio encoder and decoder used to transfer data to
4453Bluetooth audio output devices like headphones or loudspeakers.")
4454 (license license:gpl2+)))
4455
eb7c43c3
DT
4456(define-public bluez
4457 (package
4458 (name "bluez")
34ad1a55 4459 (version "5.54")
eb7c43c3
DT
4460 (source (origin
4461 (method url-fetch)
4462 (uri (string-append
e9eb24b1 4463 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
4464 version ".tar.xz"))
4465 (sha256
4466 (base32
34ad1a55 4467 "1p2ncvjz6alr9n3l5wvq2arqgc7xjs6dqyar1l9jp0z8cfgapkb8"))))
eb7c43c3
DT
4468 (build-system gnu-build-system)
4469 (arguments
90ea83ee 4470 `(#:configure-flags
eb7c43c3 4471 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
4472 (list "--sysconfdir=/etc"
4473 "--localstatedir=/var"
4474 "--enable-library"
53142109 4475 "--disable-systemd"
eb7c43c3
DT
4476 ;; Install dbus/udev files to the correct location.
4477 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
4478 (string-append "--with-udevdir=" out "/lib/udev")))
4479 #:phases
4480 (modify-phases %standard-phases
fbea821a
TD
4481 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4482 ;; issue (discussion on upstream mailing list:
4483 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4484 (add-before 'check 'skip-wonky-test
4485 (lambda _
4486 (substitute* "unit/test-gatt.c"
4487 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4488 #t))
87a16de7
SB
4489 (add-after 'install 'post-install
4490 (lambda* (#:key inputs outputs #:allow-other-keys)
4491 (let* ((out (assoc-ref outputs "out"))
4492 (servicedir (string-append out "/share/dbus-1/services"))
4493 (service "obexd/src/org.bluez.obex.service")
4494 (rule (string-append
4495 out "/lib/udev/rules.d/97-hid2hci.rules")))
4496 ;; Install the obex dbus service file.
4497 (substitute* service
4498 (("/bin/false")
4499 (string-append out "/libexec/bluetooth/obexd")))
4500 (install-file service servicedir)
4501 ;; Fix paths in the udev rule.
4502 (substitute* rule
4503 (("hid2hci --method")
4504 (string-append out "/lib/udev/hid2hci --method"))
4505 (("/sbin/udevadm")
4506 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
de47cfed 4507 #t))))))
eb7c43c3
DT
4508 (native-inputs
4509 `(("pkg-config" ,pkg-config)
b94a6ca0 4510 ("gettext" ,gettext-minimal)))
eb7c43c3
DT
4511 (inputs
4512 `(("glib" ,glib)
4513 ("dbus" ,dbus)
4514 ("eudev" ,eudev)
4515 ("libical" ,libical)
4516 ("readline" ,readline)))
4517 (home-page "http://www.bluez.org/")
4518 (synopsis "Linux Bluetooth protocol stack")
4519 (description
4520 "BlueZ provides support for the core Bluetooth layers and protocols. It
4521is flexible, efficient and uses a modular implementation.")
3ac73271 4522 (license license:gpl2+)))
3d890318
LC
4523
4524(define-public fuse-exfat
4525 (package
4526 (name "fuse-exfat")
1372754d 4527 (version "1.3.0")
3d890318
LC
4528 (source (origin
4529 (method url-fetch)
c0cc805e
TGR
4530 (uri (string-append
4531 "https://github.com/relan/exfat/releases/download/v"
4532 version "/" name "-" version ".tar.gz"))
3d890318
LC
4533 (sha256
4534 (base32
1372754d 4535 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3d890318
LC
4536 (build-system gnu-build-system)
4537 (native-inputs
c0cc805e 4538 `(("pkg-config" ,pkg-config)))
3d890318
LC
4539 (inputs
4540 `(("fuse" ,fuse)))
c0cc805e 4541 (home-page "https://github.com/relan/exfat")
3d890318
LC
4542 (synopsis "Mount exFAT file systems")
4543 (description
4544 "This package provides a FUSE-based file system that provides read and
4545write access to exFAT devices.")
3ac73271 4546 (license license:gpl2+)))
53ec8d48 4547
1564e0fe
PN
4548(define-public fuseiso
4549 (package
4550 (name "fuseiso")
4551 (version "20070708")
4552 (source (origin
4553 (method url-fetch)
4554 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4555 version "/fuseiso-" version ".tar.bz2"))
4556 (sha256
4557 (base32
4558 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4559 (build-system gnu-build-system)
4560 (native-inputs
4561 `(("pkg-config" ,pkg-config)))
4562 (inputs
4563 `(("fuse" ,fuse)
4564 ("glib" ,glib)
4565 ("zlib" ,zlib)))
4566 (home-page "https://sourceforge.net/projects/fuseiso/")
dff79364 4567 (synopsis "Mount ISO file system images")
1564e0fe 4568 (description
52beae7b 4569 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
b60e9fb8
PN
4570.bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4571Ridge, Joliet, and zisofs.")
1564e0fe
PN
4572 (license license:gpl2)))
4573
53ec8d48
LC
4574(define-public gpm
4575 (package
4576 (name "gpm")
4577 (version "1.20.7")
4578 (source (origin
4579 (method url-fetch)
4580 (uri (string-append
a5374cde
NG
4581 "https://www.nico.schottelius.org/software/gpm/archives/"
4582 "gpm-" version ".tar.bz2"))
fddb22ac 4583 (patches (search-patches "gpm-glibc-2.26.patch"))
53ec8d48
LC
4584 (sha256
4585 (base32
4586 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4587 (build-system gnu-build-system)
4588 (arguments
4589 '(#:phases (modify-phases %standard-phases
189be331 4590 (replace 'bootstrap
53ec8d48
LC
4591 (lambda _
4592 ;; The tarball was not generated with 'make dist' so we
4593 ;; need to bootstrap things ourselves.
77bb6c22
EF
4594 (substitute* "autogen.sh"
4595 (("/bin/sh") (which "sh")))
90a54e36
MW
4596 (invoke "./autogen.sh")
4597 (patch-makefile-SHELL "Makefile.include.in")
4598 #t)))
53ec8d48
LC
4599
4600 ;; Make sure programs find libgpm.so.
4601 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4602 (assoc-ref %outputs "out")
4603 "/lib"))))
4604 (native-inputs
4605 `(("texinfo" ,texinfo)
4606 ("bison" ,bison)
4607 ("flex" ,flex)
4608 ("autoconf" ,autoconf)
4609 ("automake" ,automake)
4610 ("libtool" ,libtool)))
a5374cde 4611 (home-page "https://www.nico.schottelius.org/software/gpm/")
53ec8d48
LC
4612 (synopsis "Mouse support for the Linux console")
4613 (description
4614 "The GPM (general-purpose mouse) daemon is a mouse server for
4615applications running on the Linux console. It allows users to select items
4616and copy/paste text in the console and in xterm.")
3ac73271 4617 (license license:gpl2+)))
fc686f9a
TGR
4618
4619(define-public btrfs-progs
4620 (package
4621 (name "btrfs-progs")
5714920a 4622 (version "5.6")
fc686f9a
TGR
4623 (source (origin
4624 (method url-fetch)
4625 (uri (string-append "mirror://kernel.org/linux/kernel/"
4626 "people/kdave/btrfs-progs/"
4627 "btrfs-progs-v" version ".tar.xz"))
4628 (sha256
4629 (base32
5714920a 4630 "0srg276yccfmqz0skmmga3vbqx4wiqsk1l6h86n6ryhxa9viqcm1"))))
fc686f9a 4631 (build-system gnu-build-system)
7cad981d 4632 (outputs '("out"
c4b006ba 4633 "static")) ; static versions of the binaries in "out"
fc686f9a 4634 (arguments
7cad981d 4635 '(#:phases (modify-phases %standard-phases
0c26e43e
BW
4636 (add-after 'unpack 'patch-makefile
4637 (lambda* (#:key outputs #:allow-other-keys)
4638 (substitute* "Makefile"
4639 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4640 (string-append (assoc-ref outputs "out")
4641 "/lib/udev/rules.d")))
4642 #t))
7cad981d 4643 (add-after 'build 'build-static
caf4c7c8 4644 (lambda _ (invoke "make" "static")))
9a1c4a98
MB
4645 (add-after 'install 'install-bash-completion
4646 (lambda* (#:key outputs #:allow-other-keys)
3ce4e265
MB
4647 (let* ((out (assoc-ref outputs "out"))
4648 (bashcomp (string-append out "/etc/bash_completion.d")))
4649 (mkdir-p bashcomp)
4650 (copy-file "btrfs-completion"
4651 (string-append bashcomp "/btrfs"))
4652 #t)))
7cad981d
TGR
4653 (add-after 'install 'install-static
4654 (let ((staticbin (string-append (assoc-ref %outputs "static")
4655 "/bin")))
4656 (lambda _
caf4c7c8
MW
4657 (invoke "make"
4658 (string-append "bindir=" staticbin)
4659 "install-static")))))
d6fb0985 4660 #:tests? #f ; XXX: require the 'btrfs' kernel module.
7cad981d 4661 #:test-target "test"
fc686f9a 4662 #:parallel-tests? #f)) ; tests fail when run in parallel
0c26e43e 4663 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
e2937a55 4664 ("lzo" ,lzo)
bb93042c
MB
4665 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
4666 ("util-linux:static" ,util-linux "static") ;ditto
fc686f9a 4667 ("zlib" ,zlib)
029c2ba0 4668 ("zlib:static" ,zlib "static")
ec0de9d8
MB
4669 ("zstd" ,zstd "lib")
4670 ("zstd:static" ,zstd "static")))
fc686f9a
TGR
4671 (native-inputs `(("pkg-config" ,pkg-config)
4672 ("asciidoc" ,asciidoc)
1dfb14d2 4673 ("python" ,python)
fc686f9a 4674 ("xmlto" ,xmlto)
41d23dd1 4675 ;; For building documentation.
fc686f9a 4676 ("libxml2" ,libxml2)
48b7e4a6 4677 ("docbook-xsl" ,docbook-xsl)
41d23dd1 4678 ;; For tests.
bc64676c 4679 ("acl" ,acl)
caf4c7c8 4680 ("which" ,which)
0c26e43e
BW
4681 ("dmsetup" ,lvm2)
4682 ("udevadm" ,eudev)
caf4c7c8
MW
4683 ;; The tests need 'grep' with perl regexp support.
4684 ("grep" ,grep)))
fc83ca2b 4685 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
fc686f9a 4686 (synopsis "Create and manage btrfs copy-on-write file systems")
039601e0
TGR
4687 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4688aimed at implementing advanced features while focusing on fault tolerance,
4689repair and easy administration.")
68bcac6b
LF
4690 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4691 ;; GPL2: Everything else.
4692 (license (list license:gpl2 license:gpl2+))))
08e9daf5 4693
f3e44f5c
DC
4694(define-public btrfs-progs/static
4695 (package
4696 (name "btrfs-progs-static")
4697 (version (package-version btrfs-progs))
4698 (source #f)
4699 (build-system trivial-build-system)
4700 (inputs
4701 `(("btrfs-progs:static" ,btrfs-progs "static")))
4702 (arguments
4703 `(#:modules ((guix build utils))
4704 #:builder
4705 (begin
4706 (use-modules (guix build utils)
4707 (ice-9 ftw)
4708 (srfi srfi-26))
4709
4710 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4711 (out (assoc-ref %outputs "out"))
4712 (source (string-append btrfs "/bin/btrfs.static"))
4713 (target (string-append out "/bin/btrfs")))
4714 (mkdir-p (dirname target))
4715 (copy-file source target)
4716 (remove-store-references target)
e3cfef22
MW
4717 (chmod target #o555)
4718 #t))))
f3e44f5c 4719 (home-page (package-home-page btrfs-progs))
ff797172
TGR
4720 (synopsis "Statically-linked btrfs command from btrfs-progs")
4721 (description "This package provides the statically-linked @command{btrfs}
4722from the btrfs-progs package. It is meant to be used in initrds.")
f3e44f5c
DC
4723 (license (package-license btrfs-progs))))
4724
0f4be78f
VL
4725(define-public cramfs-tools
4726 (package
4727 (name "cramfs-tools")
4728 (home-page "https://github.com/npitre/cramfs-tools")
4729 (version "2.1")
4730 (source (origin
4731 (method git-fetch)
4732 (uri (git-reference
4733 (url home-page)
4734 (commit (string-append "v" version))))
4735 (sha256
4736 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
4737 (file-name (git-file-name name version))))
4738 (build-system gnu-build-system)
4739 (arguments
4740 '(#:tests? #f ; No tests.
4741 #:phases
4742 (modify-phases %standard-phases
4743 (delete 'configure)
4744 (replace 'install
4745 (lambda* (#:key outputs #:allow-other-keys)
4746 (let ((out (assoc-ref outputs "out")))
4747 (install-file "mkcramfs" (string-append out "/sbin"))
4748 (install-file "cramfsck" (string-append out "/sbin")))
4749 #t)))))
4750 (inputs
4751 `(("zlib" ,zlib)))
4752 (synopsis "Tools to manage Cramfs file systems")
4753 (description "Cramfs is a Linux file system designed to be simple, small,
4754and to compress things well. It is used on a number of embedded systems and
4755small devices. This version has additional features such as uncompressed
4756blocks and random block placement.")
4757 (license license:gpl2+)))
4758
49b28a74
PN
4759(define-public compsize
4760 (package
4761 (name "compsize")
4762 (version "1.3")
4763 (home-page "https://github.com/kilobyte/compsize")
4764 (source (origin
4765 (method git-fetch)
4766 (uri (git-reference
4767 (url home-page)
4768 (commit (string-append "v" version))))
4769 (sha256
4770 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4771 (file-name (git-file-name name version))))
4772 (build-system gnu-build-system)
4773 (inputs
4774 `(("btrfs-progs" ,btrfs-progs)))
4775 (arguments
4776 `(#:tests? #f ; No tests.
4777 #:make-flags (list "CC=gcc")
4778 #:phases
4779 (modify-phases %standard-phases
4780 (delete 'configure)
4781 (replace 'install
4782 (lambda* (#:key outputs #:allow-other-keys)
4783 (let ((out (assoc-ref outputs "out")))
4784 (install-file "compsize" (string-append out "/bin"))
4785 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4786 (synopsis "Find compression type/ratio on Btrfs files")
4787 (description "@command{compsize} takes a list of files (given as
4788arguments) on a Btrfs file system and measures used compression types and
4789effective compression ratio, producing a report.
4790
4791A directory has no extents but has a (recursive) list of files. A non-regular
4792file is silently ignored.
4793
4794As it makes no sense to talk about compression ratio of a partial extent,
4795every referenced extent is counted whole, exactly once -- no matter if you use
4796only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4797uncompressed size will not match the number given by @command{tar} or
4798@command{du}. On the other hand, the space used should be accurate (although
4799obviously it can be shared with files outside our set).")
4800 (license license:gpl2+)))
4801
72aa295e 4802(define-public f2fs-tools-1.7
2e456982
MB
4803 (package
4804 (name "f2fs-tools")
72aa295e 4805 (version "1.7.0")
2e456982
MB
4806 (source (origin
4807 (method url-fetch)
4808 (uri (string-append
4809 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
2d588f3c 4810 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
2e456982
MB
4811 (sha256
4812 (base32
72aa295e
DM
4813 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4814
2e456982
MB
4815 (build-system gnu-build-system)
4816 (arguments
4817 `(#:phases
4818 (modify-phases %standard-phases
72aa295e
DM
4819 (add-after 'install 'install-headers
4820 (lambda* (#:key outputs #:allow-other-keys)
4821 (let* ((out (assoc-ref outputs "out"))
4822 (out-include (string-append out "/include")))
4823 (install-file "include/f2fs_fs.h" out-include)
4824 (install-file "mkfs/f2fs_format_utils.h" out-include)
4825 #t))))))
2e456982
MB
4826 (native-inputs
4827 `(("autoconf" ,autoconf)
4828 ("automake" ,automake)
4829 ("libtool" ,libtool)
4830 ("pkg-config" ,pkg-config)))
4831 (inputs
bb93042c 4832 `(("libuuid" ,util-linux "lib")
72aa295e 4833 ("libselinux" ,libselinux)))
2e456982
MB
4834 (home-page "https://f2fs.wiki.kernel.org/")
4835 (synopsis "Userland tools for f2fs")
4836 (description
4837 "F2FS, the Flash-Friendly File System, is a modern file system
4838designed to be fast and durable on flash devices such as solid-state
4839disks and SD cards. This package provides the userland utilities.")
4840 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4841 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4842 (license (list license:gpl2 license:lgpl2.1))))
4843
72aa295e
DM
4844(define-public f2fs-tools
4845 (package
4846 (inherit f2fs-tools-1.7)
4847 (name "f2fs-tools")
d2119ddf 4848 (version "1.13.0")
72aa295e
DM
4849 (source (origin
4850 (method url-fetch)
4851 (uri (string-append
4852 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
2d588f3c 4853 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
72aa295e
DM
4854 (sha256
4855 (base32
d2119ddf 4856 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
72aa295e 4857 (inputs
bb93042c 4858 `(("libuuid" ,util-linux "lib")))))
72aa295e 4859
807986a5 4860(define-public f2fs-tools/static
4861 (static-package
4862 (package
4863 (inherit f2fs-tools)
4864 (name "f2fs-tools-static")
4865 (arguments
4866 `(#:configure-flags
4867 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
4868 (libuuid (assoc-ref %build-inputs "libuuid")))
4869 (list
4870 (string-append "libuuid_CFLAGS=-I" libuuid "/include")
4871 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
4872 (string-append "libblkid_CFLAGS=-I" libuuid "/include")
4873 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
4874 #:disallowed-references (,util-linux)
4875 #:phases
4876 (modify-phases %standard-phases ; TODO: f2fs phases.
4877 (add-after 'unpack 'make-static
4878 (lambda _
4879 (define (append-to-file name body)
4880 (let ((file (open-file name "a")))
4881 (display body file)
4882 (close-port file)))
4883 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
4884 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
4885 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
da09c63e
DM
4886 #t))
4887 (add-after 'install 'remove-store-references
4888 (lambda* (#:key outputs #:allow-other-keys)
4889 ;; Work around bug in our util-linux.
4890 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
4891 (remove-store-references (string-append (assoc-ref outputs "out")
4892 "/sbin/mkfs.f2fs"))
4893 #t)))))
807986a5 4894 (inputs
4895 `(("libuuid:static" ,util-linux "static")
50e6c1bf 4896 ("libuuid" ,util-linux "lib")))))) ; for include files
807986a5 4897
a5cf52d3 4898(define-public f2fs-fsck/static
4899 (package
4900 (name "f2fs-fsck-static")
4901 (version (package-version f2fs-tools/static))
4902 (source #f)
4903 (build-system trivial-build-system)
4904 (arguments
4905 `(#:modules ((guix build utils))
4906 #:builder
4907 (begin
4908 (use-modules (guix build utils)
4909 (ice-9 ftw)
4910 (srfi srfi-26))
4911 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
4912 (fsck "fsck.f2fs")
4913 (out (assoc-ref %outputs "out"))
4914 (sbin (string-append out "/sbin")))
4915 (mkdir-p sbin)
4916 (with-directory-excursion sbin
4917 (install-file (string-append f2fs-tools "/sbin/" fsck)
4918 ".")
4919 (remove-store-references fsck)
4920 (chmod fsck #o555))
4921 #t))))
4922 (inputs
4923 `(("f2fs-tools-static" ,f2fs-tools/static)))
4924 (home-page (package-home-page f2fs-tools/static))
4925 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
4926 (description "This package provides statically-linked fsck.f2fs command taken
4927from the f2fs-tools package. It is meant to be used in initrds.")
4928 (license (package-license f2fs-tools/static))))
4929
08e9daf5
TGR
4930(define-public freefall
4931 (package
4932 (name "freefall")
4933 (version (package-version linux-libre))
4934 (source (package-source linux-libre))
4935 (build-system gnu-build-system)
4936 (arguments
4937 '(#:phases (modify-phases %standard-phases
4938 (add-after 'unpack 'enter-subdirectory
4939 (lambda _
2ee42f7e
MW
4940 (chdir "tools/laptop/freefall")
4941 #t))
08e9daf5
TGR
4942 (delete 'configure)
4943 (add-before 'build 'increase-timeout
4944 (lambda _
4945 ;; The default of 2 seconds is too low: it assumes an
4946 ;; open lid and AC power without actually checking.
4947 (substitute* "freefall.c"
2ee42f7e
MW
4948 (("alarm\\(2\\)") "alarm(5)"))
4949 #t)))
08e9daf5 4950 #:make-flags (list (string-append "PREFIX="
c80629e7
EF
4951 (assoc-ref %outputs "out"))
4952 "CC=gcc")
08e9daf5
TGR
4953 #:tests? #f)) ;no tests
4954 (home-page (package-home-page linux-libre))
4955 (synopsis "Free-fall protection for spinning laptop hard drives")
4956 (description
4957 "Prevents shock damage to the internal spinning hard drive(s) of some
4958HP and Dell laptops. When sudden movement is detected, all input/output
4959operations on the drive are suspended and its heads are parked on the ramp,
4960where they are less likely to cause damage to the spinning disc. Requires a
4961drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4962feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4963 (license license:gpl2)))
d17ae8c0
NG
4964
4965(define-public thinkfan
4966 (package
4967 (name "thinkfan")
a8c8b890 4968 (version "1.2")
9a3d176e
TGR
4969 (source
4970 (origin
4971 (method git-fetch)
4972 (uri (git-reference
4973 (url "https://github.com/vmatare/thinkfan.git")
4974 (commit version)))
4975 (file-name (git-file-name name version))
4976 (sha256
a8c8b890 4977 (base32 "0vmkpj575a1w52zx1jn6kdrk8rc9vp0f1bldi1bajicpgbs6rjd3"))))
d17ae8c0
NG
4978 (build-system cmake-build-system)
4979 (arguments
4980 `(#:modules ((guix build cmake-build-system)
4981 (guix build utils)
4982 (srfi srfi-26))
9a3d176e 4983 #:tests? #f ; no test target
d17ae8c0
NG
4984 #:configure-flags
4985 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
9a3d176e
TGR
4986 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4987 ;; inefficient’.
d17ae8c0
NG
4988 `("-DUSE_ATASMART:BOOL=ON")
4989 #:phases
4990 (modify-phases %standard-phases
908a3f36
TGR
4991 (add-after 'unpack 'create-init-scripts
4992 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4993 ;; systemd to patch and install their service files. Fake their
4994 ;; presence rather than duplicating the build system below. Leave
4995 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4996 ;; The sysvinit needs manual patching, but since upstream doesn't
4997 ;; even provide the option to install it: don't.
d17ae8c0 4998 (lambda* (#:key outputs #:allow-other-keys)
908a3f36
TGR
4999 (let* ((out (assoc-ref outputs "out"))
5000 (share (string-append out "/share/" ,name)))
5001 (substitute* "CMakeLists.txt"
5002 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
f989dffd 5003 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
908a3f36
TGR
5004 ;; That was easy! Now we just need to fix the destinations.
5005 (("/etc" directory)
5006 (string-append out directory)))
5007 #t))))))
9a3d176e
TGR
5008 (native-inputs
5009 `(("pkg-config" ,pkg-config)))
d17ae8c0 5010 (inputs
9a3d176e
TGR
5011 `(("libatasmart" ,libatasmart)
5012 ("yaml-cpp" ,yaml-cpp)))
a8c8b890 5013 (home-page "https://github.com/vmatare/thinkfan")
d17ae8c0
NG
5014 (synopsis "Simple fan control program")
5015 (description
5016 "Thinkfan is a simple fan control program. It reads temperatures,
5017checks them against configured limits and switches to appropriate (also
5018pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5019other @code{hwmon} driver that enables temperature reading and fan control
5020from userspace.")
5021 (license license:gpl3+)))
91231156 5022
b313665f
TGR
5023(define-public tpacpi-bat
5024 (package
5025 (name "tpacpi-bat")
5026 (version "3.1")
5027 (source
5028 (origin
5029 (method git-fetch)
5030 (uri (git-reference
5031 (url "https://github.com/teleshoes/tpacpi-bat.git")
5032 (commit (string-append "v" version))))
5033 (file-name (git-file-name name version))
5034 (sha256
5035 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5036 (build-system gnu-build-system)
5037 (arguments
5038 `(#:tests? #f ; no test target
5039 #:phases
5040 (modify-phases %standard-phases
5041 (add-after 'unpack 'refer-to-inputs
5042 (lambda _
5043 (substitute* "tpacpi-bat"
5044 (("cat ")
05e3ed30 5045 (format #f "~a " (which "cat")))
b313665f
TGR
5046 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5047 ;; loaded. That's the administrator's prerogative; disable it.
5048 (("system \"(modprobe .*)\"" _ match)
05e3ed30 5049 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
b313665f
TGR
5050 #t))
5051 (delete 'configure) ; nothing to configure
5052 (delete 'build) ; nothing to build
5053 (replace 'install
5054 (lambda* (#:key outputs #:allow-other-keys)
5055 (let* ((out (assoc-ref outputs "out"))
5056 (bin (string-append out "/bin"))
5057 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5058 (install-file "tpacpi-bat" bin)
5059
5060 ;; There's no man page. Install other forms of documentation.
5061 (for-each (lambda (file)
5062 (let ((target (string-append doc "/" file)))
5063 (mkdir-p (dirname target))
5064 (copy-recursively file target)))
5065 (list "battery_asl" "examples" "README.md"))
5066 #t))))))
5067 (inputs
5068 `(("perl" ,perl)))
5069 (home-page "https://github.com/teleshoes/tpacpi-bat")
5070 (synopsis "ThinkPad battery charge controller")
5071 (description
5072 "Tpacpi-bat is a command-line interface to control battery charging on
5073@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5074ThinkPad models released after 2011}, starting with the xx20 series. It can
5075query and set the thresholds at which one or both batteries will start and stop
5076charging, inhibit charging batteries for a set period of time, or force them to
5077discharge when they otherwise would not.
5078
5079This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5080kernel module provided by the @code{acpi-call-linux-module} package, which must
5081be installed and loaded separately. Only the original vendor firmware is
5082supported.")
5083 (license license:gpl3+)))
5084
91231156
LC
5085(define-public ntfs-3g
5086 (package
5087 (name "ntfs-3g")
d8af4f6d 5088 (version "2017.3.23")
91231156
LC
5089 (source (origin
5090 (method url-fetch)
5091 (uri (string-append "https://tuxera.com/opensource/"
5092 "ntfs-3g_ntfsprogs-" version ".tgz"))
6d01a7f4 5093 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
91231156
LC
5094 (sha256
5095 (base32
d8af4f6d 5096 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
91231156 5097 (modules '((guix build utils)))
6cbee49d
MW
5098 (snippet '(begin
5099 ;; Install under $prefix.
5100 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5101 (("/sbin")
5102 "@sbindir@"))
5103 #t))))
91231156
LC
5104 (build-system gnu-build-system)
5105 (inputs `(("util-linux" ,util-linux)
5106 ("fuse" ,fuse))) ;libuuid
5107 (native-inputs `(("pkg-config" ,pkg-config)))
5108 (arguments
5109 '(#:configure-flags (list "--exec-prefix=${prefix}"
5110 "--with-fuse=external" ;use our own FUSE
5111 "--enable-mount-helper"
5112 "--enable-posix-acls"
91420521
PN
5113 "--enable-xattr-mappings")
5114 #:phases
5115 (modify-phases %standard-phases
5116 ;; If users install ntfs-3g, they probably want to make it the
5117 ;; default driver as well, so we opt for sensible defaults and link
5118 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
52beae7b 5119 ;; mount NTFS file systems.)
91420521
PN
5120 (add-after 'install 'install-link
5121 (lambda* (#:key outputs #:allow-other-keys)
5122 (let* ((out (assoc-ref outputs "out"))
5123 (sbin (string-append out "/sbin")))
5124 (symlink "mount.ntfs-3g"
9922278b
MW
5125 (string-append sbin "/mount.ntfs")))
5126 #t)))))
8bad0c0b 5127 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
91231156
LC
5128 (synopsis "Read-write access to NTFS file systems")
5129 (description
5130 "NTFS-3G provides read-write access to NTFS file systems, which are
5131commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5132The package provides additional NTFS tools.")
5133 (license license:gpl2+)))
9b0942c1 5134
f8f44dd7
MB
5135(define-public rdma-core
5136 (package
5137 (name "rdma-core")
e68f954e 5138 (version "26.0")
f8f44dd7
MB
5139 (source (origin
5140 (method url-fetch)
5141 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5142 "/releases/download/v" version "/rdma-core-"
5143 version ".tar.gz"))
5144 (sha256
5145 (base32
e68f954e 5146 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
f8f44dd7
MB
5147 (build-system cmake-build-system)
5148 (arguments
e68f954e 5149 `(#:tests? #f ; no tests
f8f44dd7
MB
5150 ;; Upstream uses the "ninja" build system and encourage distros
5151 ;; to do the same for consistency. They also recommend using the
5152 ;; "Release" build type.
3def739d 5153 #:build-type "Release"
2b14c60d
LC
5154 #:configure-flags (list "-GNinja"
5155
e68f954e
LC
5156 (string-append "-DRST2MAN_EXECUTABLE="
5157 (assoc-ref %build-inputs
5158 "python-docutils")
5159 "/bin/rst2man.py")
5160
2b14c60d
LC
5161 ;; On some configurations, the
5162 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
5163 ;; used by default, would return ENODEV. To
5164 ;; avoid that, use 'write' instead of ioctls,
5165 ;; as suggested in 'CMakeList.txt'.
5166 "-DIOCTL_MODE=write")
f8f44dd7
MB
5167 #:phases
5168 (modify-phases %standard-phases
5169 (replace 'build
5170 (lambda _
8c3101b8
MW
5171 (invoke "ninja"
5172 "-j" (number->string (parallel-job-count)))))
f8f44dd7
MB
5173 (replace 'install
5174 (lambda _
8c3101b8 5175 (invoke "ninja" "install"))))))
f8f44dd7
MB
5176 (native-inputs
5177 `(("ninja" ,ninja)
5178 ("pkg-config" ,pkg-config)
e68f954e
LC
5179 ("python" ,python-wrapper)
5180 ("python-docutils" ,python-docutils))) ;for 'rst2man'
f8f44dd7
MB
5181 (inputs
5182 `(("libnl" ,libnl)
5183 ("udev" ,eudev)))
5184 (home-page "https://github.com/linux-rdma/rdma-core")
5185 (synopsis "Utilities and libraries for working with RDMA devices")
5186 (description
5187 "This package provides userspace components for the InfiniBand
5188subsystem of the Linux kernel. Specifically it contains userspace
5189libraries for the following device nodes:
5190
5191@enumerate
5192@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5193@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5194@item @file{/dev/infiniband/umadX} (@code{libibumad})
5195@end enumerate
5196
5197The following service daemons are also provided:
5198@enumerate
5199@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5200@item @code{iwpmd} (for iWARP kernel providers)
5201@item @code{ibacm} (for InfiniBand communication management assistant)
5202@end enumerate")
5203 ;; All library code is dual licensed under GPL2 and a custom MIT
5204 ;; variant. The package also includes some components covered by
5205 ;; other licenses. Consult COPYING.md for full details.
5206 (license
5207 (list license:gpl2
5208 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5209 license:bsd-2 ; Files referring to COPYING.BSD_FB
5210 license:cc0 ; most files in ccan/
5211 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5212
a0a273c1
MG
5213(define-public perftest
5214 (package
5215 (name "perftest")
50298d4a 5216 (version "4.4-0.4")
a0a273c1
MG
5217 (source
5218 (origin
5219 (method url-fetch)
50298d4a
TGR
5220 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5221 version "/perftest-" version ".g0927198.tar.gz"))
a0a273c1 5222 (sha256
50298d4a 5223 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
a0a273c1
MG
5224 (build-system gnu-build-system)
5225 (arguments
5226 `(#:phases
5227 (modify-phases %standard-phases
5228 (add-after 'unpack 'patch-header-paths
5229 (lambda _
5230 (substitute* '("src/raw_ethernet_fs_rate.c"
5231 "src/raw_ethernet_resources.c"
5232 "src/raw_ethernet_resources.h"
5233 "src/raw_ethernet_send_burst_lat.c"
5234 "src/raw_ethernet_send_bw.c"
5235 "src/raw_ethernet_send_lat.c")
5236 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5237 #t)))))
5238 (inputs `(("rdma-core" ,rdma-core)))
5239 (home-page "https://github.com/linux-rdma/perftest/")
5240 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5241 (description "This is a collection of tests written over uverbs intended for
5242use as a performance micro-benchmark. The tests may be used for hardware or
5243software tuning as well as for functional testing.
5244
5245The collection contains a set of bandwidth and latency benchmark such as:
5246@enumerate
5247@item Send - @code{ib_send_bw} and @code{ib_send_lat}
5248@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5249@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5250@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5251@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5252@end enumerate")
5253 (license license:gpl2)))
5254
9b0942c1
DC
5255(define-public rng-tools
5256 (package
5257 (name "rng-tools")
c6b772a0 5258 (home-page "https://github.com/nhorman/rng-tools")
fc66a560 5259 (version "6.10")
9b0942c1 5260 (source (origin
f289820c
MB
5261 (method git-fetch)
5262 (uri (git-reference (url home-page)
5263 (commit (string-append "v" version))))
5264 (file-name (git-file-name name version))
9b0942c1
DC
5265 (sha256
5266 (base32
fc66a560 5267 "0hbml37yxs0fs69g7f2x4ixq61z0029swy99rn7ykma9mi6b7ni9"))))
9b0942c1 5268 (build-system gnu-build-system)
8bc6956b 5269 (arguments
fc66a560
MB
5270 `(;; Disable support for various hardware entropy sources as they need
5271 ;; dependencies that are not yet in Guix, and would significantly
5272 ;; increase closure size.
ae67d70d 5273 #:configure-flags '("--without-nistbeacon"
fc66a560
MB
5274 "--without-pkcs11"
5275 "--without-rtlsdr")))
8bc6956b
LF
5276 (native-inputs
5277 `(("autoconf" ,autoconf)
5278 ("automake" ,automake)
5279 ("pkg-config" ,pkg-config)))
5280 (inputs
fc66a560
MB
5281 `(("libsysfs" ,sysfsutils)
5282 ("openssl" ,openssl)))
9b0942c1
DC
5283 (synopsis "Random number generator daemon")
5284 (description
5285 "Monitor a hardware random number generator, and supply entropy
5286from that to the system kernel's @file{/dev/random} machinery.")
9b0942c1
DC
5287 ;; The source package is offered under the GPL2+, but the files
5288 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5289 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
5290
5291(define-public cpupower
5292 (package
5293 (name "cpupower")
5294 (version (package-version linux-libre))
5295 (source (package-source linux-libre))
5296 (build-system gnu-build-system)
5297 (arguments
5298 '(#:phases (modify-phases %standard-phases
5299 (add-after 'unpack 'enter-subdirectory
5300 (lambda _
9922278b
MW
5301 (chdir "tools/power/cpupower")
5302 #t))
58d6a1f2
TGR
5303 (delete 'configure)
5304 (add-before 'build 'fix-makefiles
5305 (lambda _
5306 (substitute* "Makefile"
5307 (("/usr/") "/")
5308 (("/bin/(install|pwd)" _ command) command))
5309 (substitute* "bench/Makefile"
9922278b
MW
5310 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5311 #t)))
58d6a1f2
TGR
5312 #:make-flags (let ((out (assoc-ref %outputs "out")))
5313 (list (string-append "DESTDIR=" out)
5314 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
cd7e6885 5315 "libdir=/lib"
58d6a1f2
TGR
5316 "docdir=/share/doc/cpupower"
5317 "confdir=$(docdir)/examples"
5318 ;; The Makefile recommends the following changes
5319 "DEBUG=false"
5320 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5321 #:tests? #f)) ;no tests
b94a6ca0 5322 (native-inputs `(("gettext" ,gettext-minimal)))
58d6a1f2
TGR
5323 (inputs `(("pciutils" ,pciutils)))
5324 (home-page (package-home-page linux-libre))
5325 (synopsis "CPU frequency and voltage scaling tools for Linux")
5326 (description
5327 "cpupower is a set of user-space tools that use the cpufreq feature of the
5328Linux kernel to retrieve and control processor features related to power saving,
5329such as frequency and voltage scaling.")
5330 (license license:gpl2)))
2b76f135 5331
71bd55cb
SS
5332(define-public x86-energy-perf-policy
5333 (package
5334 (name "x86-energy-perf-policy")
5335 (version (package-version linux-libre))
5336 (source (package-source linux-libre))
5337 (build-system gnu-build-system)
5338 (arguments
5339 '(#:tests? #f
5340 #:phases
5341 (modify-phases %standard-phases
5342 (add-after 'unpack 'enter-subdirectory
5343 (lambda _
5344 (chdir "tools/power/x86/x86_energy_perf_policy")
5345 #t))
5346 (delete 'configure)
5347 (add-before 'build 'fix-makefile
5348 (lambda _
5349 (substitute* "Makefile" (("/usr") ""))
5350 #t)))
5351 #:make-flags
5352 (let ((out (assoc-ref %outputs "out")))
5353 (list (string-append "DESTDIR=" out)
5354 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5355 (supported-systems '("i686-linux" "x86_64-linux"))
5356 (home-page (package-home-page linux-libre))
5357 (synopsis "Display and update Intel-CPU energy-performance policy")
5358 (description
5359 "@command{x86_energy_perf_policy} displays and updates energy-performance
5360policy settings specific to Intel Architecture Processors. Settings are
5361accessed via Model Specific Register (MSR) updates, no matter if the Linux
5362cpufreq sub-system is enabled or not.")
5363 (license license:gpl2)))
5364
2b76f135
TGR
5365(define-public haveged
5366 (package
5367 (name "haveged")
5bcf4d4c 5368 (version "1.9.8")
2b76f135
TGR
5369 (source
5370 (origin
893c340c
TGR
5371 (method git-fetch)
5372 (uri (git-reference
5373 (url "https://github.com/jirka-h/haveged.git")
389cae8b 5374 (commit (string-append "v" version))))
893c340c 5375 (file-name (git-file-name name version))
2b76f135 5376 (sha256
5bcf4d4c 5377 (base32 "1znr58fb3faq4nmrvc3c5whkc1f3chivm4vhicdwr9pdsyqqsd51"))))
2b76f135 5378 (build-system gnu-build-system)
6664ec0c 5379 (home-page "https://www.issihosts.com/haveged")
2b76f135
TGR
5380 (synopsis "Entropy source for the Linux random number generator")
5381 (description
5382 "haveged generates an unpredictable stream of random numbers for use by
5383Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5384standard mechanisms for filling the entropy pool may not be sufficient for
5385systems with high needs or limited user interaction, such as headless servers.
b71a3488 5386
2b76f135 5387@command{haveged} runs as a privileged daemon, harvesting randomness from the
8e42b087
TGR
5388indirect effects of hardware events on hidden processor state using the
5389@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5390It tunes itself to its environment and provides the same built-in test suite
5391for the output stream as used on certified hardware security devices.
4a147986
TGR
5392
5393The quality of the randomness produced by this algorithm has not been proven.
5394It is recommended to run it together with another entropy source like rngd, and
5395not as a replacement for it.")
2b76f135
TGR
5396 (license (list (license:non-copyleft "file://nist/mconf.h")
5397 (license:non-copyleft "file://nist/packtest.c")
5398 license:public-domain ; nist/dfft.c
5399 license:gpl3+)))) ; everything else
e385e957
TGR
5400
5401(define-public ecryptfs-utils
5402 (package
5403 (name "ecryptfs-utils")
5404 (version "111")
5405 (source
5406 (origin
5407 (method url-fetch)
5408 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5409 version "/+download/ecryptfs-utils_"
5410 version ".orig.tar.gz"))
5411 (sha256
5412 (base32
5413 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5414 (build-system gnu-build-system)
5415 (arguments
17a21bcf
BT
5416 `(#:configure-flags (list "--disable-pywrap")
5417 #:phases
5418 (modify-phases %standard-phases
5419 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5420 (lambda* (#:key inputs outputs #:allow-other-keys)
5421 (let ((out (assoc-ref outputs "out"))
5422 (utils-linux (assoc-ref inputs "utils-linux"))
5423 (cryptsetup (assoc-ref inputs "cryptsetup"))
5424 (linux-pam (assoc-ref inputs "linux-pam"))
5425 (lvm2 (assoc-ref inputs "lvm2")))
5426 (substitute* '("src/utils/ecryptfs-mount-private"
5427 "src/utils/ecryptfs-umount-private"
5428 "src/utils/ecryptfs-setup-private"
e8ec2dda 5429 "src/utils/ecryptfs-setup-swap"
17a21bcf 5430 "src/utils/mount.ecryptfs.c"
e8ec2dda 5431 "src/utils/umount.ecryptfs.c"
17a21bcf
BT
5432 "src/pam_ecryptfs/pam_ecryptfs.c"
5433 "src/desktop/ecryptfs-mount-private.desktop.in"
e8ec2dda 5434 "src/desktop/ecryptfs-setup-private.desktop.in")
17a21bcf
BT
5435 (("/bin/mount")
5436 (string-append utils-linux "/bin/mount"))
5437 (("/bin/umount")
5438 (string-append utils-linux "/bin/umount"))
5439 (("/sbin/mount.ecryptfs_private")
5440 (string-append out "/sbin/mount.ecryptfs_private"))
5441 (("/sbin/umount.ecryptfs_private")
5442 (string-append out "/sbin/umount.ecryptfs_private"))
5443 (("/usr/bin/ecryptfs-mount-private")
5444 (string-append out "/bin/ecryptfs-mount-private"))
5445 (("/usr/bin/ecryptfs-rewrite-file")
5446 (string-append out "/bin/ecryptfs-rewrite-file"))
5447 (("/usr/bin/ecryptfs-setup-private")
5448 (string-append out "/bin/ecryptfs-setup-private"))
5449 (("/sbin/cryptsetup")
5450 (string-append cryptsetup "/sbin/cryptsetup"))
5451 (("/sbin/unix_chkpwd")
5452 (string-append linux-pam "/sbin/unix_chkpwd"))
5453 (("/sbin/dmsetup")
5454 (string-append lvm2 "/sbin/dmsetup")))))))))
e385e957
TGR
5455 (native-inputs
5456 `(("intltool" ,intltool)
5457 ("perl" ,perl) ; for pod2man
5458 ("pkg-config" ,pkg-config)))
5459 (inputs
5460 `(("keyutils" ,keyutils)
5461 ("linux-pam" ,linux-pam)
17a21bcf
BT
5462 ("utils-linux" ,util-linux)
5463 ("cryptsetup" ,cryptsetup)
5464 ("lvm2" ,lvm2)
e385e957 5465 ("nss" ,nss)))
c04cbcf7 5466 (home-page "https://ecryptfs.org/")
e385e957
TGR
5467 (synopsis "eCryptfs cryptographic file system utilities")
5468 (description
5469 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5470Each file's cryptographic meta-data is stored inside the file itself, along
5471with the encrypted contents. This allows individual encrypted files to be
5472copied between hosts and still be decrypted with the proper key. eCryptfs is a
5473native Linux file system, and has been part of the Linux kernel since version
54742.6.19. This package contains the userland utilities to manage it.")
5475 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5476 ;; grant additional permission to link with OpenSSL.
5477 (license license:gpl2+)))
cff0adec
DC
5478
5479(define-public libnfsidmap
5480 (package
5481 (name "libnfsidmap")
4505369c
TGR
5482 (version "0.27")
5483 (source
5484 (origin
5485 (method url-fetch)
5486 (uri (string-append "https://fedorapeople.org/~steved/"
5487 name "/" version "/" name "-" version ".tar.bz2"))
5488 (sha256
5489 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
cff0adec
DC
5490 (build-system gnu-build-system)
5491 (arguments
5492 `(#:configure-flags (list
5493 (string-append "--with-pluginpath="
5494 (assoc-ref %outputs "out")
5495 "/lib/libnfsidmap"))))
4505369c
TGR
5496 (native-inputs
5497 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
cff0adec
DC
5498 (home-page
5499 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4505369c 5500 (synopsis "NFSv4 support library for name/ID mapping")
cff0adec
DC
5501 (description "Libnfsidmap is a library holding mulitiple methods of
5502mapping names to ids and visa versa, mainly for NFSv4. It provides an
5503extensible array of mapping functions, currently consisting of two choices:
5504the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5505 (license (license:non-copyleft "file://COPYING"
5506 "See COPYING in the distribution."))))
035d3593
DC
5507
5508(define-public module-init-tools
5509 (package
5510 (name "module-init-tools")
5511 (version "3.16")
5512 (source (origin
5513 (method url-fetch)
5514 (uri (string-append
5515 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5516 "module-init-tools-" version ".tar.bz2"))
5517 (sha256
5518 (base32
5519 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5520 (patches (search-patches "module-init-tools-moduledir.patch"))))
5521 (build-system gnu-build-system)
5522 (arguments
5523 ;; FIXME: The upstream tarball lacks man pages, and building them would
5524 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5525 ;; but they vanished. In the meantime, fake it.
dc1d3cde
KK
5526 '(#:phases
5527 (modify-phases %standard-phases
5528 (add-before 'configure 'fake-docbook
5529 (lambda _
5530 (substitute* "Makefile.in"
5531 (("^DOCBOOKTOMAN.*$")
5532 "DOCBOOKTOMAN = true\n"))
5533 #t)))))
81e59e41 5534 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
035d3593
DC
5535 (synopsis "Tools for loading and managing Linux kernel modules")
5536 (description
36a4366d
EF
5537 "Tools for loading and managing Linux kernel modules, such as
5538@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
035d3593 5539 (license license:gpl2+)))
dd65f3b7
TGR
5540
5541(define-public mcelog
5542 (package
5543 (name "mcelog")
ed139ee7 5544 (version "170")
dd65f3b7
TGR
5545 (source (origin
5546 (method url-fetch)
5547 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5548 "mcelog.git/snapshot/v" version ".tar.gz"))
5549 (sha256
5550 (base32
ed139ee7 5551 "1m11v1y7cvpm7hwsghj23z77ps1w5jzn8000iwiyxpb939h2km5l"))
dd65f3b7
TGR
5552 (file-name (string-append name "-" version ".tar.gz"))
5553 (modules '((guix build utils)))
5554 (snippet
6cbee49d
MW
5555 `(begin
5556 ;; The snapshots lack a .git directory,
5557 ;; breaking ‘git describe’.
5558 (substitute* "Makefile"
5559 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5560 #t))))
dd65f3b7
TGR
5561 (build-system gnu-build-system)
5562 (arguments
5563 `(#:phases (modify-phases %standard-phases
5564 (delete 'configure)) ; no configure script
5565 #:make-flags (let ((out (assoc-ref %outputs "out")))
5566 (list "CC=gcc"
5567 (string-append "prefix=" out)
df305cea
TGR
5568 (string-append "DOCDIR=" out "/share/doc/"
5569 ,name "-" ,version)
dd65f3b7
TGR
5570 "etcprefix=$(DOCDIR)/examples"))
5571 ;; The tests will only run as root on certain supported CPU models.
5572 #:tests? #f))
5573 (supported-systems (list "i686-linux" "x86_64-linux"))
71d60b96 5574 (home-page "https://mcelog.org/")
dd65f3b7
TGR
5575 (synopsis "Machine check monitor for x86 Linux systems")
5576 (description
de382528
TGR
5577 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
5578systems running the kernel Linux. It can also perform user-defined tasks, such
5579as bringing bad pages off-line, when configurable error thresholds are
5580exceeded.")
dd65f3b7 5581 (license license:gpl2)))
0c60cc53
DM
5582
5583(define-public mtd-utils
5584 (package
5585 (name "mtd-utils")
9ea820a5 5586 (version "2.1.1")
0c60cc53
DM
5587 (source (origin
5588 (method url-fetch)
5589 (uri (string-append
5590 "ftp://ftp.infradead.org/pub/mtd-utils/"
5591 "mtd-utils-" version ".tar.bz2"))
5592 (sha256
5593 (base32
9ea820a5 5594 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
e8b9aaf0
EF
5595 (arguments
5596 '(#:configure-flags '("--enable-unit-tests")))
5597 (native-inputs
5598 `(("cmocka" ,cmocka)
5599 ("pkg-config" ,pkg-config)))
0c60cc53 5600 (inputs
f8f2b048 5601 `(("acl" ,acl) ; extended attributes (xattr)
bb93042c 5602 ("libuuid" ,util-linux "lib")
c695fb76 5603 ("lzo" ,lzo)
f8f2b048 5604 ("openssl" ,openssl) ; optional crypto support
9ea820a5
TGR
5605 ("zlib" ,zlib)
5606 ("zstd" ,zstd "lib")))
0c60cc53 5607 (build-system gnu-build-system)
0c60cc53
DM
5608 (synopsis "MTD Flash Storage Utilities")
5609 (description "This package provides utilities for testing, partitioning, etc
5610of flash storage.")
5611 (home-page "http://www.linux-mtd.infradead.org/")
5612 (license
5613 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5614 license:mpl1.1 ; All ftl* files
5615 license:expat)))) ; libiniparser
def6213f
LF
5616
5617(define-public libseccomp
5618 (package
5619 (name "libseccomp")
c3bde0b7 5620 (version "2.4.3")
def6213f
LF
5621 (source (origin
5622 (method url-fetch)
5623 (uri (string-append "https://github.com/seccomp/libseccomp/"
5624 "releases/download/v" version
5625 "/libseccomp-" version ".tar.gz"))
5626 (sha256
5627 (base32
c3bde0b7 5628 "07crwxqzvl5k2b90a47ii9wgvi09s9hsy5b5jddw9ylp351d25fg"))))
def6213f
LF
5629 (build-system gnu-build-system)
5630 (native-inputs
5631 `(("which" ,which)))
5632 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5633 (description "The libseccomp library provides an easy to use, platform
5634independent, interface to the Linux Kernel's syscall filtering mechanism. The
5635libseccomp API is designed to abstract away the underlying BPF based syscall
5636filter language and present a more conventional function-call based filtering
5637interface that should be familiar to, and easily adopted by, application
5638developers.")
5639 (home-page "https://github.com/seccomp/libseccomp")
5640 (license license:lgpl2.1)))
58c4f11e
TGR
5641
5642(define-public radeontop
5643 (package
5644 (name "radeontop")
88e1bce5 5645 (version "1.2")
ee861a54
TGR
5646 (source
5647 (origin
5648 (method git-fetch)
5649 (uri (git-reference
5650 (url "https://github.com/clbr/radeontop.git")
5651 (commit (string-append "v" version))))
5652 (file-name (git-file-name name version))
5653 (sha256
5654 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
58c4f11e
TGR
5655 (build-system gnu-build-system)
5656 (arguments
5657 `(#:phases (modify-phases %standard-phases
5658 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5659 ;; dependency, and doesn't even work on release(!) tarballs.
5660 (add-after 'unpack 'report-correct-version
9922278b
MW
5661 (lambda _
5662 (substitute* "getver.sh"
5663 (("ver=unknown")
5664 (string-append "ver=" ,version)))
5665 #t))
58c4f11e
TGR
5666 (delete 'configure)) ; no configure script
5667 #:make-flags (list "CC=gcc"
5668 (string-append "PREFIX=" %output))
5669 #:tests? #f)) ; no tests
5670 (native-inputs
7c90d0f4 5671 `(("gettext" ,gettext-minimal)
58c4f11e
TGR
5672 ("pkg-config" ,pkg-config)))
5673 (inputs
5674 `(("libdrm" ,libdrm)
5675 ("libpciaccess" ,libpciaccess)
a7c61512 5676 ("libxcb" ,libxcb)
58c4f11e 5677 ("ncurses" ,ncurses)))
ee861a54 5678 (home-page "https://github.com/clbr/radeontop/")
58c4f11e
TGR
5679 (synopsis "Usage monitor for AMD Radeon graphics")
5680 (description "RadeonTop monitors resource consumption on supported AMD
5681Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5682a terminal or saved to a file for further processing. It measures both the
5683activity of the GPU as a whole, which is also accurate during OpenCL
5684computations, as well as separate component statistics that are only meaningful
5685under OpenGL graphics workloads.")
5686 (license license:gpl3)))
0d74462a
MB
5687
5688(define-public efivar
5689 (package
5690 (name "efivar")
f19dfeeb 5691 (version "37")
0d74462a
MB
5692 (source (origin
5693 (method url-fetch)
c6dd2790 5694 (uri (string-append "https://github.com/rhboot/" name
0d74462a
MB
5695 "/releases/download/" version "/" name
5696 "-" version ".tar.bz2"))
5697 (sha256
5698 (base32
f19dfeeb 5699 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
0d74462a
MB
5700 (build-system gnu-build-system)
5701 (arguments
5702 `(;; Tests require a UEFI system and is not detected in the chroot.
5703 #:tests? #f
5704 #:make-flags (list (string-append "prefix=" %output)
5705 (string-append "libdir=" %output "/lib")
b2b2ba40 5706 "CC_FOR_BUILD=gcc"
0d74462a
MB
5707 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5708 #:phases
5709 (modify-phases %standard-phases
6388bed7 5710 (delete 'configure))))
0d74462a
MB
5711 (native-inputs
5712 `(("pkg-config" ,pkg-config)))
5713 (inputs
5714 `(("popt" ,popt)))
c6dd2790 5715 (home-page "https://github.com/rhboot/efivar")
0d74462a
MB
5716 (synopsis "Tool and library to manipulate EFI variables")
5717 (description "This package provides a library and a command line
5718interface to the variable facility of UEFI boot firmware.")
5719 (license license:lgpl2.1+)))
1581406e
MB
5720
5721(define-public efibootmgr
5722 (package
5723 (name "efibootmgr")
732825f3 5724 (version "16")
1581406e
MB
5725 (source (origin
5726 (method url-fetch)
30559d8f
MB
5727 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5728 "/releases/download/" version "/efibootmgr"
1581406e
MB
5729 "-" version ".tar.bz2"))
5730 (sha256
5731 (base32
732825f3 5732 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
1581406e
MB
5733 (build-system gnu-build-system)
5734 (arguments
82e7a51c 5735 `(#:tests? #f ;no tests
1581406e
MB
5736 #:make-flags (list (string-append "prefix=" %output)
5737 (string-append "libdir=" %output "/lib")
732825f3
MB
5738 ;; EFIDIR denotes a subdirectory relative to the
5739 ;; EFI System Partition where the loader will be
5740 ;; installed (known as OS_VENDOR in the code).
5741 ;; GRUB overrides this, as such it's only used if
5742 ;; nothing else is specified on the command line.
87d3e94d 5743 "EFIDIR=gnu")
732825f3 5744 #:phases (modify-phases %standard-phases (delete 'configure))))
1581406e
MB
5745 (native-inputs
5746 `(("pkg-config" ,pkg-config)))
5747 (inputs
5748 `(("efivar" ,efivar)
5749 ("popt" ,popt)))
5750 (home-page "https://github.com/rhinstaller/efibootmgr")
5751 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5752 (description
5753 "@code{efibootmgr} is a user-space application to modify the Intel
5754Extensible Firmware Interface (EFI) Boot Manager. This application can
5755create and destroy boot entries, change the boot order, change the next
5756running boot option, and more.")
5757 (license license:gpl2+)))
6d3e08d4
LF
5758
5759(define-public sysstat
5760 (package
5761 (name "sysstat")
baa195dd 5762 (version "12.3.1")
6d3e08d4
LF
5763 (source (origin
5764 (method url-fetch)
36ac9520 5765 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6d3e08d4
LF
5766 "sysstat-" version ".tar.xz"))
5767 (sha256
5768 (base32
baa195dd 5769 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
6d3e08d4
LF
5770 (build-system gnu-build-system)
5771 (arguments
5772 `(#:tests? #f ; No test suite.
5773 ;; Without this flag, it tries to install the man pages with group 'root'
5774 ;; and fails because /etc/passwd lacks an entry for the root user.
5775 #:configure-flags
5776 (list "--disable-file-attr"
5777 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5778 #:phases
5779 (modify-phases %standard-phases
5780 ;; The build process tries to create '/var/lib/sa', so we skip that
5781 ;; instruction.
5782 (add-after 'build 'skip-touching-var
5783 (lambda _
5784 (substitute* "Makefile"
5785 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5786 ""))
5787 #t)))))
5788 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5789 (synopsis "Performance monitoring tools for Linux")
5790 (description "The sysstat utilities are a collection of performance
5791monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5792@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5793@code{sadf} and @code{sa}.")
5794 (license license:gpl2+)))
01be4f93
JMSG
5795
5796(define-public light
5797 (package
5798 (name "light")
e3fdc019 5799 (version "1.2.2")
664cb939
TGR
5800 (source
5801 (origin
5802 (method git-fetch)
5803 (uri (git-reference
5804 (url "https://github.com/haikarainen/light.git")
5805 (commit (string-append "v" version))))
5806 (sha256
e3fdc019 5807 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
664cb939 5808 (file-name (git-file-name name version))))
01be4f93 5809 (build-system gnu-build-system)
fcb510c5
AB
5810 (arguments
5811 `(#:phases
5812 (modify-phases %standard-phases
5813 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5814 (lambda* (#:key inputs #:allow-other-keys)
5815 (substitute* "90-backlight.rules"
5816 (("/bin/chgrp") (which "chgrp"))
5817 (("/bin/chmod") (which "chmod")))
5818 #t))
5819 (add-after 'install 'install-udev-rules
5820 (lambda* (#:key outputs #:allow-other-keys)
5821 (let ((out (assoc-ref outputs "out")))
5822 (install-file
5823 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5824 #t))))))
01be4f93 5825 (native-inputs
ff598353
PL
5826 `(("autoconf" ,autoconf)
5827 ("automake" ,automake)))
5828 (home-page "https://haikarainen.github.io/light/")
01be4f93
JMSG
5829 (synopsis "GNU/Linux application to control backlights")
5830 (description
5831 "Light is a program to send commands to screen backlight controllers
5832under GNU/Linux. Features include:
5833
5834@itemize
5835@item It does not rely on X.
5836@item Light can automatically figure out the best controller to use, making
5837full use of underlying hardware.
5838@item It is possible to set a minimum brightness value, as some controllers
5839set the screen to be pitch black at a vaĺue of 0 (or higher).
5840@end itemize
5841
5842Light is the successor of lightscript.")
5843 (license license:gpl3+)))
189d8422 5844
ab7f1eb9
VC
5845(define-public brightnessctl
5846 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5847 (package
5848 (name "brightnessctl")
5849 (version (git-version "0.4" "0" commit))
5850 (source (origin
5851 (method git-fetch)
5852 (uri (git-reference
5853 (url "https://github.com/Hummer12007/brightnessctl/")
5854 (commit commit)))
5855 (file-name (git-file-name name version))
5856 (sha256
5857 (base32
5858 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5859 (build-system gnu-build-system)
5860 (arguments
5861 '(#:tests? #f ; no tests
5862 #:make-flags (list "CC=gcc"
5863 (string-append "PREFIX=" %output)
5864 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5865 #:phases
5866 (modify-phases %standard-phases
5867 (delete 'configure)
5868 (add-after 'unpack 'adjust-udev-rules
5869 (lambda _
5870 (substitute* "90-brightnessctl.rules"
5871 (("/bin/") "/run/current-system/profile/bin/"))
5872 #t)))))
5873 (home-page "https://github.com/Hummer12007/brightnessctl")
5874 (synopsis "Backlight and LED brightness control")
5875 (description
5876 "This program allows you read and control device brightness. Devices
5877include backlight and LEDs. It can also preserve current brightness before
5878applying the operation, such as on lid close.
5879
5880The appropriate permissions must be set on the backlight or LED control
5881interface in sysfs, which can be accomplished with the included udev rules.")
5882 (license license:expat))))
5883
c7adafa7
MO
5884(define-public tlp
5885 (package
5886 (name "tlp")
0d4e780e 5887 (version "1.3.1")
8a890f3c
NG
5888 (source
5889 (origin
0d4e780e
NG
5890 (method git-fetch)
5891 (uri (git-reference
5892 (url "https://github.com/linrunner/TLP.git")
5893 (commit version)))
5894 (file-name (git-file-name name version))
8a890f3c 5895 (sha256
0d4e780e 5896 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
8a890f3c
NG
5897 (native-inputs
5898 `(("shellcheck" ,shellcheck)))
5899 (inputs
5900 `(("bash" ,bash)
5901 ("dbus" ,dbus)
5902 ("ethtool" ,ethtool)
5903 ("eudev" ,eudev)
5904 ("grep" ,grep)
5905 ("hdparm" ,hdparm)
5906 ("inetutils" ,inetutils)
5907 ("iw" ,iw)
5908 ("kmod" ,kmod)
5909 ("pciutils" ,pciutils)
5910 ("perl" ,perl)
5911 ("rfkill" ,rfkill)
5912 ("sed" ,sed)
5913 ("usbutils" ,usbutils)
5914 ("util-linux" ,util-linux)
5915 ("wireless-tools" ,wireless-tools)
5916 ,@(if (let ((system (or (%current-target-system)
5917 (%current-system))))
5918 (or (string-prefix? "i686-" system)
5919 (string-prefix? "x86_64-" system)))
5920 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5921 '())))
c7adafa7
MO
5922 (build-system gnu-build-system)
5923 (arguments
8a890f3c
NG
5924 ;; XXX: The full test suite is run with "checkall" but it requires
5925 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
5926 `(#:test-target "shellcheck"
5927 #:modules ((guix build gnu-build-system)
cf342a85
SS
5928 (guix build utils)
5929 (srfi srfi-1))
5930 #:phases
c7adafa7 5931 (modify-phases %standard-phases
cef3f146 5932 (delete 'configure) ; no configure script
c7adafa7
MO
5933 (add-before 'build 'setenv
5934 (lambda* (#:key outputs #:allow-other-keys)
5935 (let ((out (assoc-ref outputs "out")))
5936 (setenv "TLP_WITH_SYSTEMD" "0")
5937 (setenv "TLP_NO_INIT" "1")
5938 (setenv "TLP_NO_PMUTILS" "1")
5939 (setenv "TLP_SBIN" (string-append out "/bin"))
5940 (setenv "TLP_BIN" (string-append out "/bin"))
c6e775a8
NG
5941 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5942 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
c7adafa7 5943 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
8a890f3c
NG
5944 (setenv "TLP_CONFDEF"
5945 (string-append out "/share/tlp/defaults.conf"))
5946 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
5d51a977
NG
5947 (setenv "TLP_ELOD"
5948 (string-append out "/lib/elogind/system-sleep"))
c7adafa7
MO
5949 (setenv "TLP_SHCPL"
5950 (string-append out "/share/bash-completion/completions"))
6db6c3a9 5951 (setenv "TLP_MAN" (string-append out "/share/man"))
272fc9dc
TGR
5952 (setenv "TLP_META" (string-append out "/share/metainfo"))
5953 #t)))
cef3f146
TGR
5954 (add-before 'install 'fix-installation
5955 (lambda _
5956 ;; Stop the Makefile from trying to create system directories.
5d51a977 5957 (substitute* "Makefile"
8a890f3c 5958 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
5d51a977 5959 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
272fc9dc 5960 #t))
c7adafa7 5961 (replace 'install
8a890f3c 5962 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
c7adafa7
MO
5963 (add-after 'install 'wrap
5964 (lambda* (#:key inputs outputs #:allow-other-keys)
5965 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5966 (bin-files (find-files bin ".*")))
5967 (define (bin-directory input-name)
cf342a85
SS
5968 (let ((p (assoc-ref inputs input-name)))
5969 (and p (string-append p "/bin"))))
c7adafa7
MO
5970 (define (sbin-directory input-name)
5971 (string-append (assoc-ref inputs input-name) "/sbin"))
5972 (for-each (lambda (program)
5973 (wrap-program program
5974 `("PATH" ":" prefix
5975 ,(append
cf342a85
SS
5976 (filter-map bin-directory
5977 '("bash"
5978 "coreutils"
5979 "dbus"
5980 "eudev"
5981 "grep"
5982 "inetutils"
5983 "kmod"
5984 "perl"
5985 "sed"
5986 "usbutils"
5987 "util-linux"
5988 "x86-energy-perf-policy"))
5989 (filter-map sbin-directory
5990 '("ethtool"
5991 "hdparm"
5992 "iw"
5993 "pciutils"
5994 "rfkill"
5995 "wireless-tools"))))))
272fc9dc
TGR
5996 bin-files)
5997 #t))))))
e4c60dcf 5998 (home-page "https://linrunner.de/en/tlp/tlp.html")
c7adafa7
MO
5999 (synopsis "Power management tool for Linux")
6000 (description "TLP is a power management tool for Linux. It comes with
6001a default configuration already optimized for battery life. Nevertheless,
6002TLP is customizable to fulfil system requirements. TLP settings are applied
6003every time the power supply source is changed.")
c7adafa7
MO
6004 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6005 ;; rest is GPLv2+.
6006 (license (list license:gpl2+ license:gpl3+))))
6007
189d8422
BG
6008(define-public lshw
6009 (package
6010 (name "lshw")
6011 (version "B.02.18")
6012 (source (origin
6013 (method url-fetch)
6014 (uri (string-append "https://www.ezix.org/software/"
6015 "files/lshw-" version
6016 ".tar.gz"))
6017 (sha256
6018 (base32
6019 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
6020 (build-system gnu-build-system)
6021 (arguments
6022 `(#:phases (modify-phases %standard-phases (delete 'configure))
6023 #:tests? #f ; no tests
6024 #:make-flags
6025 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6026 (synopsis "List hardware information")
6027 (description
6028 "@command{lshw} (Hardware Lister) is a small tool to provide
6029detailed information on the hardware configuration of the machine.
6030It can report exact memory configuration, firmware version, mainboard
6031configuration, CPU version and speed, cache configuration, bus speed,
6032and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6033machines (PowerMac G4 is known to work).")
6034 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6035 (license license:gpl2+)))
2f4a58b5
LF
6036
6037(define-public libmnl
6038 (package
6039 (name "libmnl")
6040 (version "1.0.4")
6041 (source
6042 (origin
6043 (method url-fetch)
f11ae44f 6044 (uri (string-append "mirror://netfilter.org/libmnl/"
2f4a58b5
LF
6045 "libmnl-" version ".tar.bz2"))
6046 (sha256
6047 (base32
6048 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6049 (build-system gnu-build-system)
6050 (home-page "https://www.netfilter.org/projects/libmnl/")
6051 (synopsis "Netlink utility library")
6052 (description "Libmnl is a minimalistic user-space library oriented to
6053Netlink developers. There are a lot of common tasks in parsing, validating,
6054constructing of both the Netlink header and TLVs that are repetitive and easy to
6055get wrong. This library aims to provide simple helpers that allows you to
6056re-use code and to avoid re-inventing the wheel.")
6057 (license license:lgpl2.1+)))
b754c612
LF
6058
6059(define-public libnftnl
6060 (package
6061 (name "libnftnl")
67e890ec 6062 (version "1.1.7")
b754c612 6063 (source
e569c772
TGR
6064 (origin
6065 (method url-fetch)
6066 (uri (string-append "mirror://netfilter.org/libnftnl/"
6067 "libnftnl-" version ".tar.bz2"))
6068 (sha256
67e890ec 6069 (base32 "13zd90bfrr0q3j0l0cbc8kiizccw6n8gp727kqnfljh024zw3nr0"))))
b754c612
LF
6070 (build-system gnu-build-system)
6071 (native-inputs
6072 `(("pkg-config" ,pkg-config)))
6073 (inputs
6074 `(("libmnl" ,libmnl)))
6075 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6076 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6077 (description "Libnftnl is a userspace library providing a low-level netlink
6078programming interface to the in-kernel nf_tables subsystem. The library
6079libnftnl has been previously known as libnftables. This library is currently
6080used by nftables.")
6081 (license license:gpl2+)))
62b28c0e 6082
dfe93c9a
RH
6083(define-public nftables
6084 (package
6085 (name "nftables")
2d63cca1 6086 (version "0.9.5")
dfe93c9a
RH
6087 (source
6088 (origin
6089 (method url-fetch)
e221e9a7
TGR
6090 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6091 version ".tar.bz2")
6092 (string-append "https://www.nftables.org/projects/nftables"
6093 "/files/nftables-" version ".tar.bz2")))
dfe93c9a 6094 (sha256
2d63cca1 6095 (base32 "05kyri19q776mymkbcxq3786l6nrf4xg7f3n8my0aw63mdz9bhgj"))))
dfe93c9a 6096 (build-system gnu-build-system)
9cb4bda2
RH
6097 (arguments `(#:configure-flags
6098 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5450e301 6099 (inputs `(("gmp" ,gmp)
c695fb76
TGR
6100 ("libmnl" ,libmnl)
6101 ("libnftnl" ,libnftnl)
6102 ("readline" ,readline)))
5450e301
VL
6103 (native-inputs `(("pkg-config" ,pkg-config)
6104 ("bison" ,bison)
6105 ("flex" ,flex)))
4a27b0f1 6106 (home-page "https://www.nftables.org")
dfe93c9a
RH
6107 (synopsis "Userspace utility for Linux packet filtering")
6108 (description "nftables is the project that aims to replace the existing
6109{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6110filtering framework, a new userspace utility and also a compatibility layer for
6111{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6112infrastructure such as the existing hooks, the connection tracking system, the
6113userspace queueing component and the logging subsystem.")
6114 (license license:gpl2)))
6115
62b28c0e
LC
6116(define-public proot
6117 (package
6118 (name "proot")
6119 (version "5.1.0")
674495b7
TGR
6120 (source
6121 (origin
6122 (method git-fetch)
6123 (uri (git-reference
6124 (url "https://github.com/proot-me/PRoot.git")
6125 (commit (string-append "v" version))))
6126 (file-name (git-file-name name version))
6127 (sha256
6128 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6129 (patches (search-patches "proot-test-fhs.patch"))))
62b28c0e
LC
6130 (build-system gnu-build-system)
6131 (arguments
6132 '(#:make-flags '("-C" "src")
6133
6134 #:phases (modify-phases %standard-phases
6135 (delete 'configure)
6136 (add-before 'build 'set-shell-file-name
6137 (lambda* (#:key inputs #:allow-other-keys)
6138 (substitute* (find-files "src" "\\.[ch]$")
6139 (("\"/bin/sh\"")
6140 (string-append "\""
6141 (assoc-ref inputs "bash")
6142 "/bin/sh\"")))
6143 #t))
6144 (add-before 'check 'fix-fhs-assumptions-in-tests
6145 (lambda _
6146 (substitute* "tests/test-c6b77b77.mk"
6147 (("/bin/bash") (which "bash"))
6148 (("/usr/bin/test") (which "test")))
6149 (substitute* '("tests/test-16573e73.c")
6150 (("/bin/([a-z-]+)" _ program)
6151 (which program)))
6152
6153 (substitute* (find-files "tests" "\\.sh$")
6154 ;; Some of the tests try to "bind-mount" /bin/true.
6155 (("-b /bin/true:")
6156 (string-append "-b " (which "true") ":"))
6157 ;; Likewise for /bin.
6158 (("-b /bin:") "-b /gnu:")
6159 ;; Others try to run /bin/sh.
6160 (("/bin/sh") (which "sh"))
6161 ;; Others assume /etc/fstab exists.
6162 (("/etc/fstab") "/etc/passwd"))
6163
6164 (substitute* "tests/GNUmakefile"
6165 (("-b /bin:") "-b /gnu:"))
6166
6167 ;; XXX: This test fails in an obscure corner case, just
6168 ;; skip it.
6169 (delete-file "tests/test-kkkkkkkk.c")
6170
6171 #t))
6172 (replace 'check
6173 (lambda _
6174 (let ((n (parallel-job-count)))
6175 ;; For some reason we get lots of segfaults with
6176 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6177 (setenv "PROOT_NO_SECCOMP" "1")
6178
6179 ;; Most of the tests expect "/bin" to be in $PATH so
6180 ;; they can run things that live in $ROOTFS/bin.
6181 (setenv "PATH"
6182 (string-append (getenv "PATH") ":/bin"))
6183
06153a30
MW
6184 (invoke "make" "check" "-C" "tests"
6185 ;;"V=1"
6186 "-j" (number->string n)))))
62b28c0e
LC
6187 (replace 'install
6188 (lambda* (#:key outputs #:allow-other-keys)
6189 ;; The 'install' rule does nearly nothing.
06153a30
MW
6190 (let* ((out (assoc-ref outputs "out"))
6191 (man1 (string-append out "/share/man/man1")))
6192 ;; TODO: 'make install-care' (does not even
6193 ;; build currently.)
6194 (invoke "make" "-C" "src" "install"
6195 (string-append "PREFIX=" out))
6196
6197 (mkdir-p man1)
6198 (copy-file "doc/proot/man.1"
6199 (string-append man1 "/proot.1"))
6200 #t))))))
62b28c0e
LC
6201 (native-inputs `(("which" ,which)
6202
6203 ;; For 'mcookie', used by some of the tests.
cef0e08c
LC
6204 ("util-linux" ,util-linux)
6205
6206 ;; XXX: Choose the old coreutils because its 'stat'
6207 ;; program does not use statx(2) when running 'stat -c
6208 ;; %a' or similar, which PRoot doesn't properly support.
6209 ("coreutils-old" ,coreutils-8.30)
6210
6211 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6212 ;; make 4.3 to segfault.
6213 ("make-old" ,gnu-make-4.2)))
62b28c0e 6214 (inputs `(("talloc" ,talloc)))
674495b7 6215 (home-page "https://github.com/proot-me/PRoot")
62b28c0e
LC
6216 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6217 (description
6218 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6219and @code{binfmt_misc}. This means that users don't need any privileges or
6220setup to do things like using an arbitrary directory as the new root
162a1374 6221file system, making files accessible somewhere else in the file system
62b28c0e
LC
6222hierarchy, or executing programs built for another CPU architecture
6223transparently through QEMU user-mode. Also, developers can use PRoot as a
6224generic process instrumentation engine thanks to its extension mechanism.
6225Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6226available in the kernel Linux.")
6227 (license license:gpl2+)))
b9048a14
LC
6228
6229(define-public proot-static
6230 (package
6231 (inherit proot)
6232 (name "proot-static")
6233 (synopsis
6234 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6235 (inputs `(("talloc" ,talloc/static)))
6236 (arguments
6237 (substitute-keyword-arguments (package-arguments proot)
6238 ((#:make-flags flags)
6239 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6240 ((#:phases phases)
6241 `(modify-phases ,phases
6242 (add-after 'strip 'remove-store-references
6243 (lambda* (#:key outputs #:allow-other-keys)
6244 (let* ((out (assoc-ref outputs "out")))
6245 (with-directory-excursion out
6246 (remove-store-references "bin/proot")
6247 #t))))))
6248 ((#:allowed-references _ '("out"))
6249 '("out"))))))
1113386b
CL
6250
6251(define-public cpuid
6252 (package
6253 (name "cpuid")
08fee94d 6254 (version "20200211")
1113386b
CL
6255 (source (origin
6256 (method url-fetch)
6257 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6258 version ".src.tar.gz"))
6259 (sha256
6260 (base32
08fee94d 6261 "06sjbqqp80l7nhsp6khglkzdp9qy4vhbvjxbfilznhsmrqiwlw55"))))
1113386b
CL
6262 (build-system gnu-build-system)
6263 (arguments
6264 '(#:make-flags '("CC=gcc")
fb9232d7 6265 #:tests? #f ; no tests
1113386b 6266 #:phases (modify-phases %standard-phases
fb9232d7 6267 (delete 'configure) ; no configure script
1113386b
CL
6268 (add-before 'install 'fix-makefile
6269 (lambda* (#:key outputs #:allow-other-keys)
6270 (substitute* "Makefile"
6271 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6272 ;; Make the compressed manpages writable so that the
6273 ;; reset-gzip-timestamps phase does not error out.
6274 (substitute* "Makefile"
6275 (("-m 444") "-m 644"))
6276 #t)))))
6277 (inputs `(("perl" ,perl)))
6278 (supported-systems '("i686-linux" "x86_64-linux"))
6279 (home-page "http://www.etallen.com/cpuid.html")
6280 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6281 (description "cpuid dumps detailed information about the CPU(s) gathered
6282from the CPUID instruction, and also determines the exact model of CPU(s). It
6283supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6284NexGen, Rise, and SiS CPUs.")
6285 (license license:gpl2+)))
afc9d8ec
LF
6286
6287(define-public jmtpfs
6288 (package
6289 (name "jmtpfs")
6290 (version "0.5")
6291 (source
6292 (origin
6293 (method url-fetch)
6294 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
6295 version ".tar.gz"))
6296 (file-name (string-append name "-" version ".tar.gz"))
6297 (sha256
6298 (base32
6299 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
6300 (build-system gnu-build-system)
6301 (inputs
6302 `(("file" ,file)
6303 ("fuse" ,fuse)
6304 ("libmtp" ,libmtp)))
6305 (native-inputs
6306 `(("pkg-config" ,pkg-config)))
6307 (home-page "https://github.com/JasonFerrara/jmtpfs")
162a1374
TGR
6308 (synopsis "Use a FUSE file system to access data over MTP")
6309 (description "jmtpfs uses FUSE (file system in userspace) to provide access
afc9d8ec 6310to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
162a1374 6311the MTP device as a file system.")
afc9d8ec 6312 (license license:gpl3)))
a73e7dd3
DL
6313
6314(define-public procenv
6315 (package
6316 (name "procenv")
252f44ff 6317 (version "0.51")
a73e7dd3
DL
6318 (source
6319 (origin
cfaf5bcc
EF
6320 (method git-fetch)
6321 (uri (git-reference
6322 (url "https://github.com/jamesodhunt/procenv")
6323 (commit version)))
6324 (file-name (git-file-name name version))
a73e7dd3 6325 (sha256
cfaf5bcc 6326 (base32 "1ilrsw1rc85w29mkbkmm5n5w427gapv43yrjzvkb4kc9xhscgdjn"))))
a73e7dd3
DL
6327 (build-system gnu-build-system)
6328 (arguments `(#:configure-flags '("--disable-silent-rules")))
479e74d6
VL
6329 (native-inputs `(("groff" ,groff) ; for tests
6330 ("pkg-config" ,pkg-config)))
6331 (inputs `(("check" ,check)
6332 ("expat" ,expat)
6333 ("libcap" ,libcap)
a73e7dd3
DL
6334 ("libselinux" ,libselinux)))
6335 (synopsis "Utility to show process environment")
6336 (description "Procenv is a command-line tool that displays as much detail about
6337itself and its environment as possible. It can be used as a test
6338tool, to understand the type of environment a process runs in, and for
6339comparing system environments.")
6340 (home-page "http://github.com/jamesodhunt/procenv/")
6341 (license license:gpl3+)))
ae5947b0
DL
6342
6343(define-public libfabric
6344 (package
6345 (name "libfabric")
6346 (version "1.4.1")
6347 (source
6348 (origin
6349 (method url-fetch)
6350 (uri
6351 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6352 version "/libfabric-" version ".tar.bz2"))
6353 (sha256
6354 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
6355 (build-system gnu-build-system)
6356 (inputs `(("rdma-core" ,rdma-core)
91298042
EF
6357 ,@(match (%current-system)
6358 ((member (package-supported-systems psm))
6359 `(("psm" ,psm)))
6360 (_ `()))
ae5947b0
DL
6361 ("libnl" ,libnl)))
6362 (home-page "https://ofiwg.github.io/libfabric/")
6363 (synopsis "Open Fabric Interfaces")
6364 (description
6365 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6366communication services to applications. OFI is best described as a collection
6367of libraries and applications used to export fabric services. The key
6368components of OFI are: application interfaces, provider libraries, kernel
6369services, daemons, and test applications.
6370
6371Libfabric is a core component of OFI. It is the library that defines and
6372exports the user-space API of OFI, and is typically the only software that
6373applications deal with directly. It works in conjunction with provider
6374libraries, which are often integrated directly into libfabric.")
6375 (license (list license:bsd-2 license:gpl2)))) ;dual
fd23d259
DL
6376
6377(define-public psm
6378 (package
6379 (name "psm")
6380 (version "3.3.20170428")
b50a9cc0 6381 (home-page "https://github.com/intel/psm")
fd23d259
DL
6382 (source
6383 (origin
6384 (method git-fetch)
b50a9cc0 6385 (uri (git-reference (url home-page)
fd23d259
DL
6386 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6387 (file-name (string-append "psm-" version ".tar.gz"))
6388 (sha256
6389 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6390 (patches (search-patches
6391 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6392 "psm-ldflags.patch" ; build shared lib with LDFLAGS
d8f8adfe
LC
6393 "psm-repro.patch" ; reproducibility
6394 "psm-disable-memory-stats.patch"))))
fd23d259 6395 (build-system gnu-build-system)
348caf3d 6396 (outputs '("out" "debug"))
bb93042c 6397 (inputs `(("libuuid" ,util-linux "lib")))
fd23d259
DL
6398 (arguments
6399 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6400 ,(string-append "INSTALL_PREFIX=" %output)
6401 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6402 #:tests? #f
6403 #:phases (modify-phases %standard-phases
6404 (delete 'configure)
6405 (add-after 'unpack 'patch-/usr/include
6406 (lambda _
6407 (substitute* "Makefile"
6408 (("\\$\\{DESTDIR}/usr/include")
6409 (string-append %output "/include")))
6410 (substitute* "Makefile"
6411 (("/lib64") "/lib"))
41313ace
EB
6412 #t))
6413 (add-after 'unpack 'patch-sysmacros
6414 (lambda _
6415 (substitute* "ipath/ipath_proto.c"
6416 (("#include <sys/poll.h>" m)
6417 (string-append m "\n"
6418 "#include <sys/sysmacros.h>")))
fd23d259 6419 #t)))))
fd23d259
DL
6420 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6421 (description
6422 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6423communications interface for the True Scale family of products. PSM users are
6424enabled with mechanisms necessary to implement higher level communications
6425interfaces in parallel environments.")
b516b780
EF
6426 ;; Only Intel-compatable processors are supported.
6427 (supported-systems '("i686-linux" "x86_64-linux"))
fd23d259 6428 (license (list license:bsd-2 license:gpl2)))) ;dual
c1c82584
TGR
6429
6430(define-public snapscreenshot
6431 (package
6432 (name "snapscreenshot")
6433 (version "1.0.14.3")
6434 (source
6435 (origin
6436 (method url-fetch)
6437 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6438 name "-" version ".tar.bz2"))
6439 (sha256
6440 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6441 (build-system gnu-build-system)
6442 (arguments
6443 `(#:make-flags
6444 (let ((out (assoc-ref %outputs "out")))
6445 (list (string-append "BINDIR=" out "/bin")
6446 (string-append "MANDIR=" out "/share/man")))
6447 #:tests? #f ; no test suite
6448 #:phases
6449 (modify-phases %standard-phases
6450 (delete 'configure) ; ./configure is a snarky no-op
6451 (add-before 'install 'fix-ownership
6452 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6453 (lambda _
6454 (substitute* "depfun.mak"
6455 ((" -o bin -g bin ") " "))
6456 #t))
6457 (add-before 'install 'create-output-directories
6458 (lambda* (#:key outputs #:allow-other-keys)
6459 (let ((out (assoc-ref outputs "out")))
6460 (mkdir-p (string-append out "/share/man/man1"))
6461 #t))))))
81e59e41 6462 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
c1c82584
TGR
6463 (synopsis "Take screenshots of one or more Linux text consoles")
6464 (description
6465 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6466Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6467relevant @file{/dev/vcs*} file(s).")
6468 (license license:gpl2)))
8d8d227b
TGR
6469
6470(define-public fbcat
6471 (package
6472 (name "fbcat")
7f86e5e7 6473 (version "0.5.1")
8d8d227b
TGR
6474 (source
6475 (origin
6476 (method url-fetch)
6477 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6478 version "/" name "-" version ".tar.gz"))
6479 (sha256
7f86e5e7 6480 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
8d8d227b 6481 (build-system gnu-build-system)
8d8d227b
TGR
6482 (inputs
6483 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6484 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6485 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6486 `(("pnmtopng" ,netpbm)))
6487 (outputs (list "out" "fbgrab"))
6488 (arguments
7f86e5e7
TGR
6489 `(#:make-flags
6490 (list "CC=gcc"
6491 (string-append "PREFIX=" (assoc-ref %outputs "out")))
8d8d227b
TGR
6492 #:tests? #f ; no tests
6493 #:phases
6494 (modify-phases %standard-phases
8d8d227b 6495 (delete 'configure) ; no configure script
8d8d227b
TGR
6496 (add-after 'build 'qualify-references
6497 (lambda* (#:key inputs outputs #:allow-other-keys)
6498 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6499 (out (assoc-ref outputs "out")))
6500 (substitute* "fbgrab"
6501 (("fbcat" all)
6502 (string-append out "/bin/" all))
6503 (("pnmtopng" all)
6504 (string-append pnmtopng "/bin/" all)))
6505 #t)))
7f86e5e7 6506 (add-after 'install 'split-fbgrab-output
8d8d227b
TGR
6507 (lambda* (#:key outputs #:allow-other-keys)
6508 (let* ((out (assoc-ref outputs "out"))
6509 (out:fbgrab (assoc-ref outputs "fbgrab")))
7f86e5e7
TGR
6510 (for-each (lambda (file)
6511 (let ((old (string-append out "/" file))
6512 (new (string-append out:fbgrab "/" file)))
6513 (mkdir-p (dirname new))
6514 (rename-file old new)))
6515 (list "bin/fbgrab"
6516 "share/man/man1/fbgrab.1"))
8d8d227b
TGR
6517 #t))))))
6518 (home-page "https://jwilk.net/software/fbcat")
6519 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6520 (description
6521 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6522a dump therof. It supports a wide range of drivers and pixel formats.
6523@command{fbcat} can take screenshots of virtually any application that can be
6524made to write its output to the framebuffer, including (but not limited to)
6525text-mode or graphical applications that don't use a display server.
6526
6527Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6528emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6529 (license license:gpl2)))
a69e0cf3
6530
6531(define-public libcgroup
6532 (package
6533 (name "libcgroup")
6534 (version "0.41")
6535 (source
6536 (origin
6537 (method url-fetch)
6538 (uri (string-append
6539 "mirror://sourceforge/libcg/" name "/"
6540 version "/" name "-" version ".tar.bz2"))
6541 (sha256
6542 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6543 (build-system gnu-build-system)
6544 (arguments
6545 `(#:tests? #f))
6546 (native-inputs
6547 `(("bison" ,bison)
6548 ("flex" ,flex)))
6549 (inputs
6550 `(("linux-pam" ,linux-pam)))
6551 (home-page "https://sourceforge.net/projects/libcg/")
6552 (synopsis "Control groups management tools")
6553 (description "Control groups is Linux kernel method for process resource
6554restriction, permission handling and more. This package provides userspace
6555interface to this kernel feature.")
6556 (license license:lgpl2.1)))
5849c68a
R
6557
6558(define-public mbpfan
6559 (package
6560 (name "mbpfan")
26fad5b7 6561 (version "2.1.1")
5849c68a
R
6562 (source
6563 (origin
5478ab1e
TGR
6564 (method git-fetch)
6565 (uri (git-reference
6566 (url "https://github.com/dgraziotin/mbpfan.git")
6567 (commit (string-append "v" version))))
6568 (file-name (git-file-name name version))
5849c68a 6569 (sha256
26fad5b7 6570 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5849c68a
R
6571 (build-system gnu-build-system)
6572 (arguments
e45f0c79 6573 `(#:tests? #f ; tests ask to be run as root
5849c68a
R
6574 #:make-flags (let ((out (assoc-ref %outputs "out")))
6575 (list (string-append "DESTDIR=" out)
e45f0c79 6576 ,(string-append "CC=" (cc-for-target))))
5849c68a
R
6577 #:phases
6578 (modify-phases %standard-phases
6579 (add-after 'unpack 'patch-paths
6580 (lambda _
6581 (substitute* "Makefile"
6582 (("/usr") ""))
6583 #t))
697c5846 6584 (delete 'configure)))) ; there's no configure phase
5849c68a
R
6585 (home-page "https://github.com/dgraziotin/mbpfan")
6586 (synopsis "Control fan speed on Macbooks")
6587 (description
6588 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6589the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6590module. It can be executed as a daemon or in the foreground with root
6591privileges.")
6592 (license license:gpl3+)))
25637b77
PAR
6593
6594(define-public psm2
6595 (package
6596 (name "psm2")
17a5cb45 6597 (version "11.2.86")
25637b77
PAR
6598 (source (origin
6599 (method git-fetch)
6600 (uri (git-reference
6601 (url "https://github.com/intel/opa-psm2.git")
6602 (commit (string-append "PSM2_" version))))
6603 (file-name (git-file-name name version))
6604 (sha256
6605 (base32
17a5cb45 6606 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
25637b77
PAR
6607 (build-system gnu-build-system)
6608 (arguments
6609 '(#:make-flags
6610 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6611 #:tests? #f
6612 #:phases (modify-phases %standard-phases
6613 (delete 'configure)
6614 (add-after 'unpack 'patch-Makefiles
6615 (lambda _
6616 (substitute* "Makefile"
6617 (("/lib64") "/lib")
6618 (("/usr") ""))
6619 (substitute* "compat/Makefile"
6620 (("/lib64") "/lib")
6621 (("/usr") ""))
6622 #t))
6623 (replace 'install
6624 (lambda _
6625 (setenv "DESTDIR" %output)
6626 (invoke "make" "install")
6627 #t)))))
6628 (inputs
6629 `(("rdma-core" ,rdma-core)
6630 ("numactl" ,numactl)))
6631 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6632 (description
6633 "This package is low-level user-level Intel's communications interface.
6634The PSM2 API is a high-performance vendor-specific protocol that provides a
6635low-level communications interface for the Intel Omni-Path family of
6636high-speed networking devices.")
6637 (home-page "https://github.com/intel/opa-psm2")
6638 ;; Only the x86_64 architecure is supported.
6639 (supported-systems '("x86_64-linux"))
6640 (license (list license:bsd-3 license:gpl2)))) ; dual
2690b6ce
PAR
6641
6642(define-public libpfm4
6643 (package
6644 (name "libpfm4")
6645 (version "4.9.0")
6646 (source (origin
6647 (method url-fetch)
6648 (uri (string-append "mirror://sourceforge/perfmon2/"
6649 name "/libpfm-" version ".tar.gz"))
6650 (sha256
6651 (base32
6652 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6653 (build-system gnu-build-system)
6654 (arguments
6655 '(#:modules ((guix build utils)
6656 (guix build gnu-build-system))
6657 #:phases (modify-phases %standard-phases
6658 (delete 'configure)
6659 (delete 'check)
6660 (replace 'build
6661 (lambda* (#:key inputs outputs #:allow-other-keys)
6662 (let* ((out (assoc-ref outputs "out")))
6663 (setenv "CC" "gcc")
6664 (invoke "make")
6665 #t)))
6666 (replace 'install
6667 (lambda* (#:key outputs #:allow-other-keys)
6668 (let* ((out (assoc-ref outputs "out")))
6669 (invoke "make"
6670 (string-append "PREFIX=" out)
6671 "install")
6672 #t))))))
6673 (synopsis "Performance event monitoring library")
6674 (description
6675 "This package provides a library called libpfm4, which is used to develop
6676monitoring tools exploiting the performance monitoring events such as those
6677provided by the Performance Monitoring Unit (PMU) of modern processors.
6678
6679Libpfm4 helps convert from an event name, expressed as a string, to the event
6680encoding that is either the raw event as documented by the hardware vendor or
6681the OS-specific encoding. In the latter case, the library is able to prepare
6682the OS-specific data structures needed by the kernel to setup the event.
6683
6684libpfm4 provides support for the @code{perf_events} interface, which was
6685introduced in Linux 2.6.31.")
6686 (home-page "http://perfmon2.sourceforge.net/")
6687 (license license:expat)))
4dd1fb79
SB
6688
6689(define-public libnfnetlink
6690 (package
6691 (name "libnfnetlink")
6692 (version "1.0.1")
6693 (source (origin
6694 (method url-fetch)
6695 (uri (string-append
6696 "https://www.netfilter.org/projects/libnfnetlink/files/"
6697 "libnfnetlink-" version ".tar.bz2"))
6698 (sha256
6699 (base32
6700 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6701 (build-system gnu-build-system)
6702 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6703 (synopsis "Low-level netfilter netlink communication library")
6704 (description
6705 "@code{libnfnetlink} is the low-level library for netfilter related
6706kernel/userspace communication. It provides a generic messaging
6707infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6708nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6709management tools in userspace.")
6710 (license license:gpl2)))
e4231cfe 6711
626de0d1
MC
6712(define-public go-netlink
6713 (package
6714 (name "go-netlink")
6715 (version "1.0.0")
6716 (source (origin
6717 (method git-fetch)
6718 (uri (git-reference
6719 (url "https://github.com/vishvananda/netlink.git")
6720 (commit (string-append "v" version))))
6721 (file-name (git-file-name name version))
6722 (sha256
6723 (base32
6724 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6725 (build-system go-build-system)
6726 (arguments
6727 `(#:import-path "github.com/vishvananda/netlink"))
6728 (native-inputs
561d391b 6729 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
626de0d1
MC
6730 ("go-netns" ,go-netns)))
6731 (home-page "https://github.com/vishvananda/netlink")
6732 (synopsis "Simple netlink library for Go")
6733 (description "The netlink package provides a simple netlink library for
6734Go. Netlink is the interface a user-space program in Linux uses to
6735communicate with the kernel. It can be used to add and remove interfaces, set
6736IP addresses and routes, and configure IPsec.")
6737 (license license:asl2.0)))
6738
e4231cfe
DM
6739(define-public xfsprogs
6740 (package
6741 (name "xfsprogs")
faa78e88 6742 (version "5.2.1")
e4231cfe
DM
6743 (source (origin
6744 (method url-fetch)
6745 (uri (string-append
6746 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6747 "xfsprogs-" version ".tar.gz"))
6748 (sha256
6749 (base32
faa78e88 6750 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
e4231cfe 6751 (build-system gnu-build-system)
c78778e7 6752 (outputs (list "out" "python"))
e4231cfe 6753 (arguments
c78778e7
TGR
6754 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6755 #:phases
6756 (modify-phases %standard-phases
6757 (add-after 'install 'separate-python-output
6758 (lambda* (#:key outputs #:allow-other-keys)
6759 (let ((out (assoc-ref outputs "out"))
6760 (python (assoc-ref outputs "python")))
6761 (for-each
6762 (lambda (script)
6763 (mkdir-p (string-append python (dirname script)))
6764 (rename-file (string-append out script)
6765 (string-append python script)))
6766 (list "/sbin/xfs_scrub_all"))
6767 #t)))
6768 (add-after 'install 'install-headers
6769 (lambda _
6770 (invoke "make" "install-dev"))))))
e4231cfe 6771 (native-inputs
c148d2eb 6772 `(("gettext" ,gettext-minimal)))
c78778e7 6773 (inputs
bb93042c 6774 `(("libuuid" ,util-linux "lib")
c148d2eb 6775 ("python" ,python-wrapper)))
e4231cfe
DM
6776 (home-page "https://xfs.wiki.kernel.org/")
6777 (synopsis "XFS file system tools")
6778 (description "This package provides commands to create and check XFS
6779file systems.")
6780 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6781 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6782 (license (list license:gpl2 license:lgpl2.1))))
c63d7b79
DM
6783
6784(define-public genext2fs
6785 (package
6786 (name "genext2fs")
083639a5 6787 (version "1.4.1-4")
c63d7b79
DM
6788 (source (origin
6789 (method git-fetch)
6790 (uri (git-reference
6791 (url "https://github.com/jeremie-koenig/genext2fs.git")
083639a5
TGR
6792 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6793 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
c63d7b79
DM
6794 (file-name (git-file-name name version))
6795 (sha256
083639a5 6796 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
c63d7b79 6797 (build-system gnu-build-system)
083639a5
TGR
6798 (arguments
6799 `(#:phases
6800 (modify-phases %standard-phases
6801 (add-after 'unpack 'apply-debian-patches
6802 ;; Debian changes (the revision after ‘-’ in VERSION) are
6803 ;; maintained as separate patches. Apply those relevant to us.
6804 (lambda _
6805 (for-each
6806 (lambda (file-name)
6807 (invoke "patch" "-p1" "-i"
6808 (string-append "debian/patches/" file-name)))
6809 (list "blocksize+creator.diff" ; add -B/-o options
6810 "byteswap_fix.diff"))
6811 #t)))))
6812 (native-inputs
6813 `(("autoconf" ,autoconf)
6814 ("automake" ,automake)))
c63d7b79 6815 (home-page "https://github.com/jeremie-koenig/genext2fs")
52beae7b
TGR
6816 (synopsis "Generate ext2 file system as a normal user")
6817 (description "This package provides a program to generate an ext2
6818file system as a normal (non-root) user. It does not require you to mount
c63d7b79
DM
6819the image file to copy files on it, nor does it require that you become
6820the superuser to make device nodes.")
6821 (license license:gpl2)))
d1dfcc7c
DM
6822
6823(define-public fakeroot
6824 (package
6825 (name "fakeroot")
ae1bab3e 6826 (version "1.24")
d1dfcc7c
DM
6827 (source (origin
6828 (method url-fetch)
ae1bab3e
TGR
6829 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6830 "fakeroot/fakeroot_" version ".orig.tar.gz"))
d1dfcc7c
DM
6831 (file-name (string-append name "-" version ".tar.gz"))
6832 (sha256
6833 (base32
ae1bab3e 6834 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
d1dfcc7c
DM
6835 (build-system gnu-build-system)
6836 (arguments
6837 `(#:phases
6838 (modify-phases %standard-phases
6839 (add-after 'configure 'patch-Makefile
6840 (lambda _
6841 ;; Note: The root of the problem is already in "Makefile.am".
6842 (substitute* "Makefile"
6843 (("/bin/sh") (which "sh")))
6844 #t))
c29bb909 6845 (add-after 'unpack 'patch-script
d1dfcc7c
DM
6846 (lambda* (#:key inputs #:allow-other-keys)
6847 (substitute* "scripts/fakeroot.in"
6848 (("getopt")
6849 (string-append (assoc-ref inputs "util-linux")
c29bb909
MO
6850 "/bin/getopt"))
6851 (("sed")
6852 (string-append (assoc-ref inputs "sed")
6853 "/bin/sed"))
6854 (("cut")
6855 (string-append (assoc-ref inputs "coreutils")
6856 "/bin/cut")) )
d1dfcc7c 6857 #t))
0d5c5b1b
DM
6858 (add-before 'configure 'setenv
6859 (lambda _
6860 (setenv "LIBS" "-lacl")
6861 #t))
d1dfcc7c
DM
6862 (add-before 'check 'prepare-check
6863 (lambda _
6864 (setenv "SHELL" (which "bash"))
6865 (setenv "VERBOSE" "1")
6866 (substitute* "test/t.touchinstall"
6867 ;; We don't have the name of the root user, so use ID=0.
6868 (("grep root") "grep \"\\<0\\>\""))
6869 (substitute* "test/tartest"
6870 ;; We don't have the name of the root group, so use ID=0.
6871 (("ROOTGROUP=root") "ROOTGROUP=0")
6872 ;; We don't have the name of the daemon user, so use IDs.
6873 (("daemon:sys") "1:3")
6874 (("daemon:") "1:"))
6875 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6876 (substitute* "test/compare-tar"
6877 (("tar -tvf") "tar --numeric-owner -tvf"))
ba151b7e
MB
6878
6879 ;; coreutils 8.32 changed 'ls' to use the statx() syscall instead
6880 ;; of lstat(). fakeroot 1.24 does not support the former, so
6881 ;; adjust these tests to use 'test -b' instead of 'ls' to test for
6882 ;; block device. See <https://bugs.gnu.org/41090>.
6883 (substitute* '("test/t.mknod" "test/t.chmod_dev")
6884 (("ls -ld? \\$tmp/hda3")
6885 "test -b $tmp/hda3 && echo block || echo fail"))
d1dfcc7c
DM
6886 #t)))))
6887 (native-inputs
0d5c5b1b
DM
6888 `(("acl" ,acl)
6889 ("sharutils" ,sharutils) ; for the tests
d1dfcc7c
DM
6890 ("xz" ,xz))) ; for the tests
6891 (inputs
ba151b7e 6892 `(("libcap" ,libcap/next)
c29bb909
MO
6893 ("util-linux" ,util-linux)
6894 ("sed" ,sed)
6895 ("coreutils" ,coreutils)))
d1dfcc7c
DM
6896 (synopsis "Provides a fake root environment")
6897 (description "@command{fakeroot} runs a command in an environment where
6898it appears to have root privileges for file manipulation. This is useful
6899for allowing users to create archives (tar, ar, .deb etc.) with files in
6900them with root permissions/ownership. Without fakeroot one would have to
6901have root privileges to create the constituent files of the archives with
6902the correct permissions and ownership, and then pack them up, or one would
6903have to construct the archives directly, without using the archiver.")
6904 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6905 (license license:gpl3+)))
bf2a9969 6906
4449e7c5
LC
6907(define-public fakechroot
6908 (package
6909 (name "fakechroot")
6910 (version "2.20.1")
6911 (source (origin
6912 (method url-fetch)
6913 (uri (string-append
6914 "https://github.com/dex4er/fakechroot/releases/download/"
6915 version "/fakechroot-" version ".tar.gz"))
6916 (sha256
6917 (base32
6918 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
6919 (build-system gnu-build-system)
6920 (arguments
6921 ;; XXX: The tests heavily assume they run on an FHS system so for now
6922 ;; skip them.
6923 '(#:tests? #f
6924 #:configure-flags '("--disable-static")))
6925 (synopsis "Emulate @code{chroot} by overriding file system calls")
6926 (description
6927 "@command{fakechroot} runs a command in an environment were is additional
6928possibility to use @code{chroot} command without root privileges. This is
6929useful for allowing users to create own chrooted environment with possibility
6930to install another packages without need for root privileges.
6931
6932It works by providing @file{libfakechroot.so}, a shared library meant to be
6933set as @code{LD_PRELOAD} to override the C library file system functions.")
6934 (home-page "https://github.com/dex4er/fakechroot/")
6935 (license license:lgpl2.1+)))
6936
bf2a9969
TG
6937(define-public inputattach
6938 (package
6939 (name "inputattach")
6940 (version "0.42.0")
6941 (source (origin
6942 (method git-fetch)
6943 (uri (git-reference
6944 (url "https://github.com/linuxwacom/input-wacom.git")
6945 (commit (string-append "input-wacom-" version))))
6946 (file-name (git-file-name name version))
6947 (sha256
6948 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6949 (build-system gnu-build-system)
6950 (arguments
6951 `(#:phases
6952 (modify-phases %standard-phases
6953 (delete 'bootstrap)
6954 (delete 'configure)
6955 (replace 'build
6956 (lambda* (#:key inputs #:allow-other-keys)
6957 (with-directory-excursion "inputattach"
6958 (invoke (string-append (assoc-ref inputs "gcc")
6959 "/bin/gcc")
5ddf98da 6960 "-O2" "-o" "inputattach" "inputattach.c"))
bf2a9969
TG
6961 #t))
6962 (delete 'check)
6963 (replace 'install
6964 (lambda* (#:key outputs #:allow-other-keys)
6965 (let ((target-dir (string-append
6966 (assoc-ref outputs "out")
6967 "/bin/")))
6968 (mkdir-p target-dir)
6969 (copy-file "inputattach/inputattach"
6970 (string-append target-dir
6971 "inputattach"))
6972 #t))))))
6973 (home-page "https://linuxwacom.github.io/")
6974 (synopsis "Dispatch input peripherals events to a device file")
6975 (description "inputattach dispatches input events from several device
6976types and interfaces and translates so that the X server can use them.")
6977 (license license:gpl2+)))
de3896fb 6978
8c6c97de
KK
6979(define-public pipewire
6980 (package
6981 (name "pipewire")
e7d710af 6982 (version "0.2.7")
8c6c97de
KK
6983 (source (origin
6984 (method git-fetch)
6985 (uri (git-reference
6986 (url "https://github.com/PipeWire/pipewire")
6987 (commit version)))
6988 (file-name (git-file-name name version))
6989 (sha256
6990 (base32
e7d710af 6991 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
8c6c97de
KK
6992 (build-system meson-build-system)
6993 (arguments
6994 '(#:configure-flags '("-Dsystemd=false")))
6995 (native-inputs
6996 `(("pkg-config" ,pkg-config)))
6997 (inputs
6998 `(("alsa-lib" ,alsa-lib)
6999 ("dbus" ,dbus)
7000 ("eudev" ,eudev)
7001 ("ffmpeg" ,ffmpeg)
7002 ("gstreamer" ,gstreamer)
7003 ("gst-plugins-base" ,gst-plugins-base)
7004 ("libva" ,libva)
7005 ("sbc" ,sbc)
7006 ("sdl2" ,sdl2)))
7007 (home-page "https://pipewire.org/")
7008 (synopsis "Server and user space API to deal with multimedia pipelines")
7009 (description
7010 "PipeWire is a project that aims to greatly improve handling of audio and
7011video under Linux. It aims to support the usecases currently handled by both
7012PulseAudio and Jack and at the same time provide same level of powerful handling
7013of Video input and output. It also introduces a security model that makes
7014interacting with audio and video devices from containerized applications easy,
7015with supporting Flatpak applications being the primary goal. Alongside Wayland
7016and Flatpak we expect PipeWire to provide a core building block for the future
7017of Linux application development.")
7018 (license license:lgpl2.0+)))
7019
de3896fb
BW
7020(define-public ell
7021 (package
7022 (name "ell")
7023 (version "0.23")
7024 (source (origin
7025 (method git-fetch)
7026 (uri (git-reference
7027 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7028 (commit version)))
7029 (file-name (git-file-name name version))
7030 (sha256
7031 (base32
7032 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
7033 (build-system gnu-build-system)
7034 (arguments
7035 `(#:phases
7036 (modify-phases %standard-phases
7037 (add-after 'unpack 'fix-dbus-tests
7038 (lambda _
7039 (substitute* '("unit/test-dbus-message-fds.c"
7040 "unit/test-dbus-properties.c"
7041 "unit/test-dbus.c")
7042 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7043 #t)))))
7044 (inputs
d6f1f607 7045 `(("dbus" ,dbus)))
de3896fb
BW
7046 (native-inputs
7047 `(("autoconf" ,autoconf)
d6f1f607 7048 ("libtool" ,libtool)
de3896fb
BW
7049 ("pkgconfig" ,pkg-config)
7050 ("automake" ,automake)))
7051 (home-page "https://01.org/ell")
7052 (synopsis "Embedded Linux Library")
7053 (description "The Embedded Linux* Library (ELL) provides core, low-level
7054functionality for system daemons. It typically has no dependencies other than
7055the Linux kernel, C standard library, and libdl (for dynamic linking). While
7056ELL is designed to be efficient and compact enough for use on embedded Linux
7057platforms, it is not limited to resource-constrained systems.")
7058 (license license:lgpl2.1+)))
a69bc738
PN
7059
7060(define-public lttng-ust
7061 (package
7062 (name "lttng-ust")
7063 (version "2.11.0")
7064 (source (origin
7065 (method url-fetch)
7066 (uri (string-append "https://lttng.org/files/lttng-ust/"
7067 "lttng-ust-" version ".tar.bz2"))
7068 (sha256
7069 (base32
7070 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7071 (build-system gnu-build-system)
7072 (inputs
7073 `(("liburcu" ,liburcu)
7074 ("numactl" ,numactl)))
7075 (native-inputs
7076 `(("python" ,python-3)))
7077 (home-page "https://lttng.org/")
7078 (synopsis "LTTng userspace tracer libraries")
7079 (description "The user space tracing library, liblttng-ust, is the LTTng
7080user space tracer. It receives commands from a session daemon, for example to
7081enable and disable specific instrumentation points, and writes event records
7082to ring buffers shared with a consumer daemon.")
7083 (license license:lgpl2.1+)))
dedbdacf
CM
7084
7085(define-public kexec-tools
7086 (package
7087 (name "kexec-tools")
7088 (version "2.0.20")
7089 (source (origin
7090 (method url-fetch)
7091 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7092 "/kexec/kexec-tools-" version ".tar.xz"))
7093 (sha256
7094 (base32
7095 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
7096 (build-system gnu-build-system)
7097 (arguments
7098 ;; There are no automated tests.
7099 '(#:tests? #f))
7100 (home-page "https://projects.horms.net/projects/kexec/")
7101 (synopsis "Tools for booting directly into different kernels")
7102 (description "This package provides the @code{kexec} program and ancillary
7103utilities. Using @code{kexec}, it is possible to boot directly into a new
7104kernel from the context of an already-running kernel, bypassing the normal
7105system boot process.")
7106 (license license:gpl2)))
c0792d77
JBN
7107
7108(define-public cachefilesd
7109 (package
7110 (name "cachefilesd")
7111 (version "0.10.10")
7112 (source (origin
7113 (method url-fetch)
7114 (uri (string-append
7115 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7116 "/cachefilesd.git/snapshot/cachefilesd-"
7117 version ".tar.gz"))
7118 (sha256
7119 (base32
7120 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7121 (build-system gnu-build-system)
7122 (outputs '("out"))
7123 (arguments
7124 `(#:tests? #f ; there are no tests
7125 #:make-flags
7126 (let ((prefix-dir (lambda (var dir)
1ca44ae3
MB
7127 (string-append var "=" %output "/" dir))))
7128 (list (string-append "CC=" ,(cc-for-target))
c0792d77
JBN
7129 (prefix-dir "SBINDIR" "sbin/")
7130 (prefix-dir "ETCDIR" "etc/")
7131 (prefix-dir "MANDIR" "share/man/")))
7132 #:phases (modify-phases %standard-phases (delete 'configure))))
7133 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7134 (synopsis "CacheFiles userspace management daemon")
7135 (description "@code{cachefilesd} is a userspace daemon that manages the
7136cache data store that is used by network file systems such as @code{AFS} and
7137@code{NFS} to cache data locally on disk. The content of the cache is
7138persistent over reboots.")
7139 (license license:gpl2+)))