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