gnu: perf: Treat kernel headers as system headers.
[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)
3094 (setenv "SHELL_PATH" (which "bash"))
3095 (chdir "tools/perf")
3096 #t)))
65dabe4e 3097 #:make-flags (list (string-append "prefix="
b62fe07f 3098 (assoc-ref %outputs "out"))
5157edd8
MB
3099 ;; Make sure the kernel headers are treated as system
3100 ;; headers to suppress warnings from those.
3101 (string-append "C_INCLUDE_PATH="
3102 (assoc-ref %build-inputs "kernel-headers")
3103 "/include")
2af29d23
LC
3104 "WERROR=0"
3105
3106 ;; By default, 'config/Makefile' uses lib64 on
3107 ;; x86_64. Work around that.
3108 "lib=lib")
b62fe07f
LC
3109 #:tests? #f)) ;no tests
3110 (native-inputs
3111 `(("pkg-config" ,pkg-config)
3112 ("bison" ,bison)
3113 ("flex" ,flex)
3114
3115 ;; There are build scripts written in these languages.
3116 ("perl" ,perl)
3117 ("python" ,python-2)))
3118 (inputs
b1fb4b23 3119 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 3120 ;; ("newt" ,newt)
6c030d10 3121 ("python" ,python-2) ;'perf' links against libpython
b62fe07f 3122 ("elfutils" ,elfutils)
b25d3bd9 3123 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
1d484507
LC
3124 ("libunwind" ,libunwind) ;better stack walking
3125 ("numactl" ,numactl) ;for 'perf bench numa mem'
b62fe07f 3126
d7ece67a
LC
3127 ;; Documentation.
3128 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
d7ece67a
LC
3129 ("docbook-xsl" ,docbook-xsl)
3130 ("xmlto" ,xmlto)
3131 ("asciidoc" ,asciidoc)))
b62fe07f
LC
3132 (home-page "https://perf.wiki.kernel.org/")
3133 (synopsis "Linux profiling with performance counters")
3134 (description
3135 "perf is a tool suite for profiling using hardware performance counters,
3136with support in the Linux kernel. perf can instrument CPU performance
3137counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3138of lightweight profiling. This package contains the user-land tools and in
36a4366d 3139particular the @code{perf} command.")
b62fe07f 3140 (license (package-license linux-libre))))
c09e60e4
DT
3141
3142(define-public pflask
3143 (package
3144 (name "pflask")
3145 (version "0.2")
3146 (source (origin
3147 (method url-fetch)
3148 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3149 version ".tar.gz"))
f586c877 3150 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
3151 (sha256
3152 (base32
3153 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3154 (build-system cmake-build-system)
3155 (arguments
3156 '(#:tests? #f)) ; no tests
81e59e41 3157 (home-page "https://ghedo.github.io/pflask/")
c09e60e4
DT
3158 (synopsis "Simple tool for creating Linux namespace containers")
3159 (description "pflask is a simple tool for creating Linux namespace
3160containers. It can be used for running a command or even booting an OS inside
3161an isolated container, created with the help of Linux namespaces. It is
3162similar in functionality to chroot, although pflask provides better isolation
3163thanks to the use of namespaces.")
3ac73271 3164 (license license:bsd-2)))
288084d5 3165
3ec07ced
RW
3166(define-public singularity
3167 (package
3168 (name "singularity")
edc6dd03 3169 (version "2.6.1")
3ec07ced
RW
3170 (source (origin
3171 (method url-fetch)
3172 (uri (string-append "https://github.com/singularityware/singularity/"
3173 "releases/download/" version
3174 "/singularity-" version ".tar.gz"))
3175 (sha256
3176 (base32
fbf26cbc
LC
3177 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3178 (modules '((guix build utils)))
3179 (snippet
3180 '(begin
3181 ;; Do not create directories in /var.
3182 (substitute* "Makefile.in"
3183 (("\\$\\(MAKE\\) .*install-data-hook") ""))
af857579
LC
3184
3185 ;; The original source overrides PATH so that it points to
3186 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3187 ;; on Guix System. Leave PATH unchanged so we refer to the
3188 ;; installed Coreutils, grep, etc.
3189 (substitute* "bin/singularity.in"
3190 (("^PATH=.*" all)
3191 (string-append "#" all "\n")))
08814aec
LC
3192
3193 (substitute* (find-files "libexec/cli" "\\.exec$")
3194 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3195 _ program)
3196 (string-append "/run/setuid-programs/singularity-"
3197 program "-helper")))
fbf26cbc 3198 #t))))
3ec07ced
RW
3199 (build-system gnu-build-system)
3200 (arguments
08814aec 3201 `(#:configure-flags '("--localstatedir=/var")
3ec07ced
RW
3202 #:phases
3203 (modify-phases %standard-phases
3ec07ced
RW
3204 (add-after 'unpack 'patch-reference-to-squashfs-tools
3205 (lambda _
3206 (substitute* "libexec/cli/build.exec"
3207 (("if ! singularity_which mksquashfs") "if 0")
3208 (("if ! mksquashfs")
3209 (string-append "if ! " (which "mksquashfs"))))
3210 #t)))))
3211 (inputs
3212 `(("libarchive" ,libarchive)
3213 ("python" ,python-wrapper)
3ec07ced
RW
3214 ("zlib" ,zlib)
3215 ("squashfs-tools" ,squashfs-tools)))
3216 (home-page "https://singularity.lbl.gov/")
3217 (synopsis "Container platform")
3218 (description "Singularity is a container platform supporting a number of
3219container image formats. It can build SquashFS container images or import
3220existing Docker images. Singularity requires kernel support for container
3221isolation or root privileges.")
3222 (license license:bsd-3)))
3223
288084d5
MW
3224(define-public hdparm
3225 (package
3226 (name "hdparm")
abb90ff9 3227 (version "9.58")
288084d5
MW
3228 (source (origin
3229 (method url-fetch)
1b1ef87e
TGR
3230 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3231 "hdparm-" version ".tar.gz"))
288084d5
MW
3232 (sha256
3233 (base32
abb90ff9 3234 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
288084d5
MW
3235 (build-system gnu-build-system)
3236 (arguments
3237 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3238 (list (string-append "binprefix=" out)
3239 (string-append "manprefix=" out)
3240 "CC=gcc"))
ec238332
TGR
3241 #:phases
3242 (modify-phases %standard-phases
3243 (delete 'configure)) ; no configure script
3244 #:tests? #f)) ; no test suite
3b3b60d0 3245 (home-page "https://sourceforge.net/projects/hdparm/")
02052b2c 3246 (synopsis "View and tune ATA disk drive parameters")
288084d5 3247 (description
02052b2c
TGR
3248 "@command{hdparm} is a command-line utility to control ATA controllers and
3249disk drives. It can increase performance and/or reliability by careful tuning
3250of hardware settings like power and acoustic management, DMA modes, and caching.
3251It can also display detailed device information, or be used as a simple
3252performance benchmarking tool.
3253
3254@command{hdparm} provides a command line interface to various Linux kernel
3255interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
d08be77a
TGR
3256IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3257Translation (@dfn{SAT}) are also supported.")
3ac73271 3258 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 3259
c755c854
MW
3260(define-public rfkill
3261 (package
3262 (name "rfkill")
3263 (version "0.5")
3264 (source (origin
3265 (method url-fetch)
3266 (uri (string-append "mirror://kernel.org/software/network/"
3267 name "/" name "-" version ".tar.xz"))
3268 (sha256
3269 (base32
3270 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3271 (build-system gnu-build-system)
3272 (arguments
3273 `(#:make-flags (list "CC=gcc"
3274 (string-append "PREFIX=" %output))
3275 #:phases (modify-phases %standard-phases
3276 (delete 'configure))
3277 #:tests? #f))
3278 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3279 (synopsis "Tool for enabling and disabling wireless devices")
3280 (description
3281 "rfkill is a simple tool for accessing the rfkill device interface,
3282which is used to enable and disable wireless networking devices, typically
3283WLAN, Bluetooth and mobile broadband.")
3ac73271 3284 (license (license:non-copyleft "file://COPYING"
5146f22b
EF
3285 "See COPYING in the distribution."))
3286 ;; rfkill is part of util-linux as of 2.31.
3287 (properties `((superseded . ,util-linux)))))
c755c854 3288
dc9bdb1e
ML
3289(define-public acpi
3290 (package
3291 (name "acpi")
3292 (version "1.7")
3293 (source (origin
3294 (method url-fetch)
81e59e41 3295 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
de67e922 3296 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
3297 (sha256
3298 (base32
3299 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3300 (build-system gnu-build-system)
3301 (home-page "http://acpiclient.sourceforge.net")
3302 (synopsis "Display information on ACPI devices")
3303 (description "@code{acpi} attempts to replicate the functionality of the
3304\"old\" @code{apm} command on ACPI systems, including battery and thermal
3305information. It does not support ACPI suspending, only displays information
3306about ACPI devices.")
3307 (license license:gpl2+)))
3308
57a516d3
LC
3309(define-public acpid
3310 (package
3311 (name "acpid")
b928c587 3312 (version "2.0.32")
57a516d3
LC
3313 (source (origin
3314 (method url-fetch)
3315 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3316 version ".tar.xz"))
3317 (sha256
3318 (base32
b928c587 3319 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
57a516d3 3320 (build-system gnu-build-system)
3b3b60d0 3321 (home-page "https://sourceforge.net/projects/acpid2/")
57a516d3
LC
3322 (synopsis "Daemon for delivering ACPI events to user-space programs")
3323 (description
3324 "acpid is designed to notify user-space programs of Advanced
3325Configuration and Power Interface (ACPI) events. acpid should be started
3326during the system boot, and will run as a background process. When an ACPI
3327event is received from the kernel, acpid will examine the list of rules
3328specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 3329 (license license:gpl2+)))
37f5caec
TUBK
3330
3331(define-public sysfsutils
3332 (package
3333 (name "sysfsutils")
3334 (version "2.1.0")
3335 (source
3336 (origin
3337 (method url-fetch)
3338 (uri
3339 (string-append
3340 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3341 version ".tar.gz"))
3342 (sha256
3343 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3344 (build-system gnu-build-system)
3345 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3346 (synopsis "System utilities based on Linux sysfs")
3347 (description
8f65585b 3348 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
3349Linux kernel versions 2.5+ that exposes a system's device tree. The package
3350also contains the libsysfs library.")
3351 ;; The library is under lgpl2.1+ (all files say "or any later version").
3352 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 3353 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
3354
3355(define-public sysfsutils-1
3356 (package
3357 (inherit sysfsutils)
3358 (version "1.3.0")
3359 (source
3360 (origin
3361 (method url-fetch)
3362 (uri
3363 (string-append
3364 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3365 "/sysfsutils-" version ".tar.gz"))
3366 (sha256
3367 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3368 (modules '((guix build utils)))
3369 (snippet
3370 '(begin
3371 (substitute* "Makefile.in"
3372 (("includedir = /usr/include/sysfs")
3373 "includedir = @includedir@"))
3374 (substitute* "configure"
3375 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
6cbee49d
MW
3376 (string-append "includedir='" orig "/sysfs'")))
3377 #t))))
a9a1a40b 3378 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
3379
3380(define-public cpufrequtils
3381 (package
3382 (name "cpufrequtils")
3383 (version "0.3")
3384 (source
3385 (origin
3386 (method url-fetch)
18160c34
MB
3387 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3388 "cpufrequtils-" version ".tar.gz"))
e6caa52d
TUBK
3389 (sha256
3390 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 3391 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
3392 (build-system gnu-build-system)
3393 (native-inputs
3394 `(("sysfsutils" ,sysfsutils-1)))
3395 (arguments
3396 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3397 (assoc-ref %outputs "out") "/lib"))))
3398 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3399 (synopsis "Utilities to get and set CPU frequency on Linux")
3400 (description
e881752c 3401 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
3402information, and set the CPU frequency if supported, using the cpufreq
3403capabilities of the Linux kernel.")
3ac73271 3404 (license license:gpl2)))
0a588bf9
SB
3405
3406(define-public libraw1394
3407 (package
3408 (name "libraw1394")
7c58c852 3409 (version "2.1.2")
0a588bf9
SB
3410 (source (origin
3411 (method url-fetch)
3412 (uri (string-append
3413 "mirror://kernel.org/linux/libs/ieee1394/"
3414 name "-" version ".tar.xz"))
3415 (sha256
3416 (base32
7c58c852 3417 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
0a588bf9
SB
3418 (build-system gnu-build-system)
3419 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3420 (synopsis "Interface library for the Linux IEEE1394 drivers")
3421 (description
3422 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3423the Linux IEEE-1394 subsystem, which provides direct access to the connected
34241394 buses to user space. Through libraw1394/raw1394, applications can directly
3425send to and receive from other nodes without requiring a kernel driver for the
3426protocol in question.")
3ac73271 3427 (license license:lgpl2.1+)))
68e3c29d
SB
3428
3429(define-public libavc1394
3430 (package
3431 (name "libavc1394")
3432 (version "0.5.4")
3433 (source (origin
3434 (method url-fetch)
de67e922 3435 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
3436 name "-" version ".tar.gz"))
3437 (sha256
3438 (base32
3439 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3440 (build-system gnu-build-system)
3441 (native-inputs
3442 `(("pkg-config" ,pkg-config)))
3443 (propagated-inputs
3444 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3b3b60d0 3445 (home-page "https://sourceforge.net/projects/libavc1394/")
68e3c29d
SB
3446 (synopsis "AV/C protocol library for IEEE 1394")
3447 (description
3448 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 3449the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 3450 (license license:lgpl2.1+)))
3f7bf86a
SB
3451
3452(define-public libiec61883
3453 (package
3454 (name "libiec61883")
3455 (version "1.2.0")
3456 (source (origin
3457 (method url-fetch)
3458 (uri (string-append
3459 "mirror://kernel.org/linux/libs/ieee1394/"
3460 name "-" version ".tar.xz"))
3461 (sha256
3462 (base32
3463 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3464 (build-system gnu-build-system)
3465 (native-inputs
3466 `(("pkg-config" ,pkg-config)))
3467 (propagated-inputs
3468 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3469 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3470 (synopsis "Isochronous streaming media library for IEEE 1394")
3471 (description
3472 "The libiec61883 library provides a higher level API for streaming DV,
3473MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 3474 (license license:lgpl2.1+)))
69159125
MW
3475
3476(define-public mdadm
3477 (package
3478 (name "mdadm")
30288ae5 3479 (version "4.1")
69159125
MW
3480 (source (origin
3481 (method url-fetch)
3482 (uri (string-append
3483 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3484 version ".tar.xz"))
3485 (sha256
3486 (base32
30288ae5 3487 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
69159125
MW
3488 (build-system gnu-build-system)
3489 (inputs
3490 `(("udev" ,eudev)))
3491 (arguments
3492 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
fae88ae8
LC
3493 (list "CC=gcc"
3494 "INSTALL=install"
69159125
MW
3495 "CHECK_RUN_DIR=0"
3496 ;; TODO: tell it where to find 'sendmail'
3497 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3498 (string-append "BINDIR=" out "/sbin")
3499 (string-append "MANDIR=" out "/share/man")
3500 (string-append "UDEVDIR=" out "/lib/udev")))
dc1d3cde
KK
3501 #:phases
3502 (modify-phases %standard-phases
3503 (add-before 'build 'patch-program-paths
3504 (lambda* (#:key inputs #:allow-other-keys)
3505 (let ((coreutils (assoc-ref inputs "coreutils")))
3506 (substitute* "udev-md-raid-arrays.rules"
3507 (("/usr/bin/(readlink|basename)" all program)
3508 (string-append coreutils "/bin/" program))))
3509 #t))
3510 (add-before 'build 'remove-W-error
3511 (lambda _
3512 ;; We cannot build with -Werror on i686 due to a
3513 ;; 'sign-compare' warning in util.c.
3514 (substitute* "Makefile"
3515 (("-Werror") ""))
3516 #t))
3517 (delete 'configure))
69159125
MW
3518 ;;tests must be done as root
3519 #:tests? #f))
3520 (home-page "http://neil.brown.name/blog/mdadm")
3521 (synopsis "Tool for managing Linux Software RAID arrays")
3522 (description
3523 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3524assemble, report on, and monitor arrays. It can also move spares between raid
3525arrays when needed.")
3ac73271 3526 (license license:gpl2+)))
01ccdfb6 3527
631fda7e
LC
3528(define-public mdadm-static
3529 (package
3530 (inherit mdadm)
3531 (name "mdadm-static")
3532 (arguments
3533 (substitute-keyword-arguments (package-arguments mdadm)
3534 ((#:make-flags flags)
3535 `(cons "LDFLAGS = -static" ,flags))
3536 ((#:phases phases)
3537 `(modify-phases ,phases
3538 (add-after 'install 'remove-cruft
3539 (lambda* (#:key outputs #:allow-other-keys)
3540 (let* ((out (assoc-ref outputs "out"))
3541 (precious? (lambda (file)
3542 (member file '("." ".." "sbin"))))
3543 (directories (scandir out (negate precious?))))
3544 (with-directory-excursion out
3545 (for-each delete-file-recursively directories)
3546 (remove-store-references "sbin/mdadm")
3547 (delete-file "sbin/mdmon")
3548 #t))))))
3549 ((#:modules modules %gnu-build-system-modules)
3550 `((ice-9 ftw) ,@modules))
3551 ((#:strip-flags _ '())
3552 ''("--strip-all")) ;strip a few extra KiB
3553 ((#:allowed-references _ '("out"))
3554 '("out")))) ;refer only self
3555 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3556
b3ed50e6
MB
3557(define-public multipath-tools
3558 (package
3559 (name "multipath-tools")
dcc773e5 3560 (version "0.8.2")
b3ed50e6
MB
3561 (source (origin
3562 (method url-fetch)
3e57b7d9 3563 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
b3ed50e6
MB
3564 ".git;a=snapshot;h=" version ";sf=tgz"))
3565 (file-name (string-append name "-" version ".tar.gz"))
3566 (sha256
3567 (base32
dcc773e5 3568 "0kb4mhzwyygdbikikmby6hj39pb3nrzv05v526c75wnycwnpxg31"))
b3ed50e6
MB
3569 (modules '((guix build utils)))
3570 (snippet
3571 '(begin
3572 ;; Drop bundled valgrind headers.
3573 (delete-file-recursively "third-party")
3574 (substitute* '("multipathd/main.c"
3575 "libmultipath/debug.c")
3576 (("#include \"../third-party/")
3577 "#include \""))
3578 #t))))
3579 (build-system gnu-build-system)
3580 (arguments
bd835ff2
TGR
3581 '(#:tests? #f ; no tests
3582 #:make-flags (list "CC=gcc"
3583 (string-append "DESTDIR="
b3ed50e6 3584 (assoc-ref %outputs "out"))
b5fb9430 3585 "SYSTEMDPATH=lib"
5247aab8
MB
3586 ;; Add the libaio headers to GCCs system header
3587 ;; search path to suppress -Werror=cast-qual on
3588 ;; the included headers.
3589 (string-append "C_INCLUDE_PATH="
3590 (assoc-ref %build-inputs "libaio")
3591 "/include")
b3ed50e6
MB
3592 (string-append "LDFLAGS=-Wl,-rpath="
3593 (assoc-ref %outputs "out")
3594 "/lib"))
3595 #:phases
3596 (modify-phases %standard-phases
b5fb9430 3597 (add-after 'unpack 'patch-source
7f412f33
MB
3598 (lambda* (#:key inputs #:allow-other-keys)
3599 (let ((lvm2 (assoc-ref inputs "lvm2"))
3600 (udev (assoc-ref inputs "udev")))
3601 (substitute* "Makefile.inc"
a9e7d656
MO
3602 (("\\$\\(prefix\\)/usr") "$(prefix)")
3603 ;; Do not save timestamp to avoid gzip "timestamp
3604 ;; out-of-range" warnings.
3605 (("gzip -9") "gzip -9n"))
7f412f33
MB
3606 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3607 (("/usr/include/libdevmapper.h")
3608 (string-append lvm2 "/include/libdevmapper.h"))
3609 (("/usr/include/libudev.h")
3610 (string-append udev "/include/libudev.h")))
3611 #t)))
57e3f06b 3612 (delete 'configure)))) ; no configure script
b3ed50e6 3613 (native-inputs
7f412f33
MB
3614 `(("perl" ,perl)
3615 ("pkg-config" ,pkg-config)
3616 ("valgrind" ,valgrind)))
b3ed50e6 3617 (inputs
6f850a19 3618 `(("json-c" ,json-c)
b3ed50e6
MB
3619 ("libaio" ,libaio)
3620 ("liburcu" ,liburcu)
3621 ("lvm2" ,lvm2)
3622 ("readline" ,readline)
3623 ("udev" ,eudev)))
3624 (home-page "http://christophe.varoqui.free.fr/")
3625 (synopsis "Access block devices through multiple paths")
3626 (description
3627 "This package provides the following binaries to drive the
3628Linux Device Mapper multipathing driver:
3629@enumerate
3630@item @command{multipath} - Device mapper target autoconfig.
3631@item @command{multipathd} - Multipath daemon.
3632@item @command{mpathpersist} - Manages SCSI persistent reservations on
3633@code{dm} multipath devices.
3634@item @command{kpartx} - Create device maps from partition tables.
3635@end enumerate")
57e3f06b 3636 (license (list license:gpl2+ ; main distribution
b3ed50e6
MB
3637 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3638
01ccdfb6
SB
3639(define-public libaio
3640 (package
3641 (name "libaio")
87dc306b 3642 (version "0.3.111")
01ccdfb6
SB
3643 (source (origin
3644 (method url-fetch)
87dc306b
MB
3645 (uri (list
3646 (string-append "https://releases.pagure.org/libaio/"
3647 name "-" version ".tar.gz")))
3648 (sha256
3649 (base32
3650 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
01ccdfb6
SB
3651 (build-system gnu-build-system)
3652 (arguments
3653 '(#:make-flags
3654 (list "CC=gcc" (string-append "prefix=" %output))
3655 #:test-target "partcheck" ; need root for a full 'check'
3656 #:phases
dc1d3cde 3657 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
87dc306b 3658 (home-page "https://pagure.io/libaio")
01ccdfb6
SB
3659 (synopsis "Linux-native asynchronous I/O access library")
3660 (description
3661 "This library enables userspace to use Linux kernel asynchronous I/O
3662system calls, important for the performance of databases and other advanced
3663applications.")
3ac73271 3664 (license license:lgpl2.1+)))
eb7c43c3 3665
81b98756
RW
3666(define-public sbc
3667 (package
3668 (name "sbc")
2a11a029 3669 (version "1.4")
81b98756
RW
3670 (source (origin
3671 (method url-fetch)
18160c34
MB
3672 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
3673 version ".tar.xz"))
81b98756
RW
3674 (sha256
3675 (base32
2a11a029 3676 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
81b98756
RW
3677 (build-system gnu-build-system)
3678 (inputs
3679 `(("libsndfile" ,libsndfile)))
3680 (native-inputs
3681 `(("pkg-config" ,pkg-config)))
3682 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3683 (synopsis "Bluetooth subband audio codec")
3684 (description
3685 "The SBC is a digital audio encoder and decoder used to transfer data to
3686Bluetooth audio output devices like headphones or loudspeakers.")
3687 (license license:gpl2+)))
3688
eb7c43c3
DT
3689(define-public bluez
3690 (package
3691 (name "bluez")
b5724230 3692 (version "5.50")
eb7c43c3
DT
3693 (source (origin
3694 (method url-fetch)
3695 (uri (string-append
e9eb24b1 3696 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
3697 version ".tar.xz"))
3698 (sha256
3699 (base32
b5724230 3700 "048r91vx9gs5nwwbah2s0xig04nwk14c5s0vb7qmaqdvighsmz2z"))))
eb7c43c3
DT
3701 (build-system gnu-build-system)
3702 (arguments
90ea83ee 3703 `(#:configure-flags
eb7c43c3 3704 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
3705 (list "--sysconfdir=/etc"
3706 "--localstatedir=/var"
3707 "--enable-library"
53142109 3708 "--disable-systemd"
eb7c43c3
DT
3709 ;; Install dbus/udev files to the correct location.
3710 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
3711 (string-append "--with-udevdir=" out "/lib/udev")))
3712 #:phases
3713 (modify-phases %standard-phases
fbea821a
TD
3714 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3715 ;; issue (discussion on upstream mailing list:
3716 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3717 (add-before 'check 'skip-wonky-test
3718 (lambda _
3719 (substitute* "unit/test-gatt.c"
3720 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3721 #t))
87a16de7
SB
3722 (add-after 'install 'post-install
3723 (lambda* (#:key inputs outputs #:allow-other-keys)
3724 (let* ((out (assoc-ref outputs "out"))
3725 (servicedir (string-append out "/share/dbus-1/services"))
3726 (service "obexd/src/org.bluez.obex.service")
3727 (rule (string-append
3728 out "/lib/udev/rules.d/97-hid2hci.rules")))
3729 ;; Install the obex dbus service file.
3730 (substitute* service
3731 (("/bin/false")
3732 (string-append out "/libexec/bluetooth/obexd")))
3733 (install-file service servicedir)
3734 ;; Fix paths in the udev rule.
3735 (substitute* rule
3736 (("hid2hci --method")
3737 (string-append out "/lib/udev/hid2hci --method"))
3738 (("/sbin/udevadm")
3739 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
de47cfed 3740 #t))))))
eb7c43c3
DT
3741 (native-inputs
3742 `(("pkg-config" ,pkg-config)
b94a6ca0 3743 ("gettext" ,gettext-minimal)))
eb7c43c3
DT
3744 (inputs
3745 `(("glib" ,glib)
3746 ("dbus" ,dbus)
3747 ("eudev" ,eudev)
3748 ("libical" ,libical)
3749 ("readline" ,readline)))
3750 (home-page "http://www.bluez.org/")
3751 (synopsis "Linux Bluetooth protocol stack")
3752 (description
3753 "BlueZ provides support for the core Bluetooth layers and protocols. It
3754is flexible, efficient and uses a modular implementation.")
3ac73271 3755 (license license:gpl2+)))
3d890318
LC
3756
3757(define-public fuse-exfat
3758 (package
3759 (name "fuse-exfat")
1372754d 3760 (version "1.3.0")
3d890318
LC
3761 (source (origin
3762 (method url-fetch)
c0cc805e
TGR
3763 (uri (string-append
3764 "https://github.com/relan/exfat/releases/download/v"
3765 version "/" name "-" version ".tar.gz"))
3d890318
LC
3766 (sha256
3767 (base32
1372754d 3768 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3d890318
LC
3769 (build-system gnu-build-system)
3770 (native-inputs
c0cc805e 3771 `(("pkg-config" ,pkg-config)))
3d890318
LC
3772 (inputs
3773 `(("fuse" ,fuse)))
c0cc805e 3774 (home-page "https://github.com/relan/exfat")
3d890318
LC
3775 (synopsis "Mount exFAT file systems")
3776 (description
3777 "This package provides a FUSE-based file system that provides read and
3778write access to exFAT devices.")
3ac73271 3779 (license license:gpl2+)))
53ec8d48 3780
1564e0fe
PN
3781(define-public fuseiso
3782 (package
3783 (name "fuseiso")
3784 (version "20070708")
3785 (source (origin
3786 (method url-fetch)
3787 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
3788 version "/fuseiso-" version ".tar.bz2"))
3789 (sha256
3790 (base32
3791 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
3792 (build-system gnu-build-system)
3793 (native-inputs
3794 `(("pkg-config" ,pkg-config)))
3795 (inputs
3796 `(("fuse" ,fuse)
3797 ("glib" ,glib)
3798 ("zlib" ,zlib)))
3799 (home-page "https://sourceforge.net/projects/fuseiso/")
dff79364 3800 (synopsis "Mount ISO file system images")
1564e0fe 3801 (description
52beae7b 3802 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
b60e9fb8
PN
3803.bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
3804Ridge, Joliet, and zisofs.")
1564e0fe
PN
3805 (license license:gpl2)))
3806
53ec8d48
LC
3807(define-public gpm
3808 (package
3809 (name "gpm")
3810 (version "1.20.7")
3811 (source (origin
3812 (method url-fetch)
3813 (uri (string-append
3814 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3815 version ".tar.bz2"))
fddb22ac 3816 (patches (search-patches "gpm-glibc-2.26.patch"))
53ec8d48
LC
3817 (sha256
3818 (base32
3819 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3820 (build-system gnu-build-system)
3821 (arguments
3822 '(#:phases (modify-phases %standard-phases
189be331 3823 (replace 'bootstrap
53ec8d48
LC
3824 (lambda _
3825 ;; The tarball was not generated with 'make dist' so we
3826 ;; need to bootstrap things ourselves.
77bb6c22
EF
3827 (substitute* "autogen.sh"
3828 (("/bin/sh") (which "sh")))
90a54e36
MW
3829 (invoke "./autogen.sh")
3830 (patch-makefile-SHELL "Makefile.include.in")
3831 #t)))
53ec8d48
LC
3832
3833 ;; Make sure programs find libgpm.so.
3834 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3835 (assoc-ref %outputs "out")
3836 "/lib"))))
3837 (native-inputs
3838 `(("texinfo" ,texinfo)
3839 ("bison" ,bison)
3840 ("flex" ,flex)
3841 ("autoconf" ,autoconf)
3842 ("automake" ,automake)
3843 ("libtool" ,libtool)))
3844 (home-page "http://www.nico.schottelius.org/software/gpm/")
3845 (synopsis "Mouse support for the Linux console")
3846 (description
3847 "The GPM (general-purpose mouse) daemon is a mouse server for
3848applications running on the Linux console. It allows users to select items
3849and copy/paste text in the console and in xterm.")
3ac73271 3850 (license license:gpl2+)))
fc686f9a
TGR
3851
3852(define-public btrfs-progs
3853 (package
3854 (name "btrfs-progs")
6b4bc27a 3855 (version "5.2.2")
fc686f9a
TGR
3856 (source (origin
3857 (method url-fetch)
3858 (uri (string-append "mirror://kernel.org/linux/kernel/"
3859 "people/kdave/btrfs-progs/"
3860 "btrfs-progs-v" version ".tar.xz"))
3861 (sha256
3862 (base32
6b4bc27a 3863 "1imivxjppi8zl27gn472pwpk8bg5dijkbyi340by31vhy7dj24w2"))))
fc686f9a 3864 (build-system gnu-build-system)
7cad981d 3865 (outputs '("out"
c4b006ba 3866 "static")) ; static versions of the binaries in "out"
fc686f9a 3867 (arguments
7cad981d
TGR
3868 '(#:phases (modify-phases %standard-phases
3869 (add-after 'build 'build-static
caf4c7c8 3870 (lambda _ (invoke "make" "static")))
9a1c4a98
MB
3871 (add-after 'install 'install-bash-completion
3872 (lambda* (#:key outputs #:allow-other-keys)
3ce4e265
MB
3873 (let* ((out (assoc-ref outputs "out"))
3874 (bashcomp (string-append out "/etc/bash_completion.d")))
3875 (mkdir-p bashcomp)
3876 (copy-file "btrfs-completion"
3877 (string-append bashcomp "/btrfs"))
3878 #t)))
7cad981d
TGR
3879 (add-after 'install 'install-static
3880 (let ((staticbin (string-append (assoc-ref %outputs "static")
3881 "/bin")))
3882 (lambda _
caf4c7c8
MW
3883 (invoke "make"
3884 (string-append "bindir=" staticbin)
3885 "install-static")))))
d6fb0985 3886 #:tests? #f ; XXX: require the 'btrfs' kernel module.
7cad981d 3887 #:test-target "test"
fc686f9a
TGR
3888 #:parallel-tests? #f)) ; tests fail when run in parallel
3889 (inputs `(("e2fsprogs" ,e2fsprogs)
3890 ("libblkid" ,util-linux)
7cad981d 3891 ("libblkid:static" ,util-linux "static")
fc686f9a 3892 ("libuuid" ,util-linux)
7cad981d 3893 ("libuuid:static" ,util-linux "static")
e2937a55 3894 ("lzo" ,lzo)
fc686f9a 3895 ("zlib" ,zlib)
029c2ba0 3896 ("zlib:static" ,zlib "static")
ec0de9d8
MB
3897 ("zstd" ,zstd "lib")
3898 ("zstd:static" ,zstd "static")))
fc686f9a
TGR
3899 (native-inputs `(("pkg-config" ,pkg-config)
3900 ("asciidoc" ,asciidoc)
1dfb14d2 3901 ("python" ,python)
fc686f9a 3902 ("xmlto" ,xmlto)
41d23dd1 3903 ;; For building documentation.
fc686f9a 3904 ("libxml2" ,libxml2)
48b7e4a6 3905 ("docbook-xsl" ,docbook-xsl)
41d23dd1 3906 ;; For tests.
bc64676c 3907 ("acl" ,acl)
caf4c7c8
MW
3908 ("which" ,which)
3909 ;; The tests need 'grep' with perl regexp support.
3910 ("grep" ,grep)))
fc83ca2b 3911 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
fc686f9a 3912 (synopsis "Create and manage btrfs copy-on-write file systems")
039601e0
TGR
3913 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3914aimed at implementing advanced features while focusing on fault tolerance,
3915repair and easy administration.")
68bcac6b
LF
3916 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3917 ;; GPL2: Everything else.
3918 (license (list license:gpl2 license:gpl2+))))
08e9daf5 3919
f3e44f5c
DC
3920(define-public btrfs-progs/static
3921 (package
3922 (name "btrfs-progs-static")
3923 (version (package-version btrfs-progs))
3924 (source #f)
3925 (build-system trivial-build-system)
3926 (inputs
3927 `(("btrfs-progs:static" ,btrfs-progs "static")))
3928 (arguments
3929 `(#:modules ((guix build utils))
3930 #:builder
3931 (begin
3932 (use-modules (guix build utils)
3933 (ice-9 ftw)
3934 (srfi srfi-26))
3935
3936 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3937 (out (assoc-ref %outputs "out"))
3938 (source (string-append btrfs "/bin/btrfs.static"))
3939 (target (string-append out "/bin/btrfs")))
3940 (mkdir-p (dirname target))
3941 (copy-file source target)
3942 (remove-store-references target)
e3cfef22
MW
3943 (chmod target #o555)
3944 #t))))
f3e44f5c 3945 (home-page (package-home-page btrfs-progs))
ff797172
TGR
3946 (synopsis "Statically-linked btrfs command from btrfs-progs")
3947 (description "This package provides the statically-linked @command{btrfs}
3948from the btrfs-progs package. It is meant to be used in initrds.")
f3e44f5c
DC
3949 (license (package-license btrfs-progs))))
3950
49b28a74
PN
3951(define-public compsize
3952 (package
3953 (name "compsize")
3954 (version "1.3")
3955 (home-page "https://github.com/kilobyte/compsize")
3956 (source (origin
3957 (method git-fetch)
3958 (uri (git-reference
3959 (url home-page)
3960 (commit (string-append "v" version))))
3961 (sha256
3962 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
3963 (file-name (git-file-name name version))))
3964 (build-system gnu-build-system)
3965 (inputs
3966 `(("btrfs-progs" ,btrfs-progs)))
3967 (arguments
3968 `(#:tests? #f ; No tests.
3969 #:make-flags (list "CC=gcc")
3970 #:phases
3971 (modify-phases %standard-phases
3972 (delete 'configure)
3973 (replace 'install
3974 (lambda* (#:key outputs #:allow-other-keys)
3975 (let ((out (assoc-ref outputs "out")))
3976 (install-file "compsize" (string-append out "/bin"))
3977 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
3978 (synopsis "Find compression type/ratio on Btrfs files")
3979 (description "@command{compsize} takes a list of files (given as
3980arguments) on a Btrfs file system and measures used compression types and
3981effective compression ratio, producing a report.
3982
3983A directory has no extents but has a (recursive) list of files. A non-regular
3984file is silently ignored.
3985
3986As it makes no sense to talk about compression ratio of a partial extent,
3987every referenced extent is counted whole, exactly once -- no matter if you use
3988only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
3989uncompressed size will not match the number given by @command{tar} or
3990@command{du}. On the other hand, the space used should be accurate (although
3991obviously it can be shared with files outside our set).")
3992 (license license:gpl2+)))
3993
72aa295e 3994(define-public f2fs-tools-1.7
2e456982
MB
3995 (package
3996 (name "f2fs-tools")
72aa295e 3997 (version "1.7.0")
2e456982
MB
3998 (source (origin
3999 (method url-fetch)
4000 (uri (string-append
4001 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
2d588f3c 4002 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
2e456982
MB
4003 (sha256
4004 (base32
72aa295e
DM
4005 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4006
2e456982
MB
4007 (build-system gnu-build-system)
4008 (arguments
4009 `(#:phases
4010 (modify-phases %standard-phases
72aa295e
DM
4011 (add-after 'install 'install-headers
4012 (lambda* (#:key outputs #:allow-other-keys)
4013 (let* ((out (assoc-ref outputs "out"))
4014 (out-include (string-append out "/include")))
4015 (install-file "include/f2fs_fs.h" out-include)
4016 (install-file "mkfs/f2fs_format_utils.h" out-include)
4017 #t))))))
2e456982
MB
4018 (native-inputs
4019 `(("autoconf" ,autoconf)
4020 ("automake" ,automake)
4021 ("libtool" ,libtool)
4022 ("pkg-config" ,pkg-config)))
4023 (inputs
72aa295e
DM
4024 `(("libuuid" ,util-linux)
4025 ("libselinux" ,libselinux)))
2e456982
MB
4026 (home-page "https://f2fs.wiki.kernel.org/")
4027 (synopsis "Userland tools for f2fs")
4028 (description
4029 "F2FS, the Flash-Friendly File System, is a modern file system
4030designed to be fast and durable on flash devices such as solid-state
4031disks and SD cards. This package provides the userland utilities.")
4032 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4033 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4034 (license (list license:gpl2 license:lgpl2.1))))
4035
72aa295e
DM
4036(define-public f2fs-tools
4037 (package
4038 (inherit f2fs-tools-1.7)
4039 (name "f2fs-tools")
59ac0a2a 4040 (version "1.12.0")
72aa295e
DM
4041 (source (origin
4042 (method url-fetch)
4043 (uri (string-append
4044 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
2d588f3c 4045 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
72aa295e
DM
4046 (sha256
4047 (base32
59ac0a2a 4048 "15pn2fm9knn7p1vzfzy6msnrdl14p6y1gn4m2ka6ba5bzx6lw4p2"))))
72aa295e
DM
4049 (inputs
4050 `(("libuuid" ,util-linux)))))
4051
08e9daf5
TGR
4052(define-public freefall
4053 (package
4054 (name "freefall")
4055 (version (package-version linux-libre))
4056 (source (package-source linux-libre))
4057 (build-system gnu-build-system)
4058 (arguments
4059 '(#:phases (modify-phases %standard-phases
4060 (add-after 'unpack 'enter-subdirectory
4061 (lambda _
2ee42f7e
MW
4062 (chdir "tools/laptop/freefall")
4063 #t))
08e9daf5
TGR
4064 (delete 'configure)
4065 (add-before 'build 'increase-timeout
4066 (lambda _
4067 ;; The default of 2 seconds is too low: it assumes an
4068 ;; open lid and AC power without actually checking.
4069 (substitute* "freefall.c"
2ee42f7e
MW
4070 (("alarm\\(2\\)") "alarm(5)"))
4071 #t)))
08e9daf5 4072 #:make-flags (list (string-append "PREFIX="
c80629e7
EF
4073 (assoc-ref %outputs "out"))
4074 "CC=gcc")
08e9daf5
TGR
4075 #:tests? #f)) ;no tests
4076 (home-page (package-home-page linux-libre))
4077 (synopsis "Free-fall protection for spinning laptop hard drives")
4078 (description
4079 "Prevents shock damage to the internal spinning hard drive(s) of some
4080HP and Dell laptops. When sudden movement is detected, all input/output
4081operations on the drive are suspended and its heads are parked on the ramp,
4082where they are less likely to cause damage to the spinning disc. Requires a
4083drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4084feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4085 (license license:gpl2)))
d17ae8c0
NG
4086
4087(define-public thinkfan
4088 (package
4089 (name "thinkfan")
9a3d176e
TGR
4090 (version "1.0.2")
4091 (source
4092 (origin
4093 (method git-fetch)
4094 (uri (git-reference
4095 (url "https://github.com/vmatare/thinkfan.git")
4096 (commit version)))
4097 (file-name (git-file-name name version))
4098 (sha256
4099 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
d17ae8c0
NG
4100 (build-system cmake-build-system)
4101 (arguments
4102 `(#:modules ((guix build cmake-build-system)
4103 (guix build utils)
4104 (srfi srfi-26))
9a3d176e 4105 #:tests? #f ; no test target
d17ae8c0
NG
4106 #:configure-flags
4107 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
9a3d176e
TGR
4108 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4109 ;; inefficient’.
d17ae8c0
NG
4110 `("-DUSE_ATASMART:BOOL=ON")
4111 #:phases
4112 (modify-phases %standard-phases
908a3f36
TGR
4113 (add-after 'unpack 'create-init-scripts
4114 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4115 ;; systemd to patch and install their service files. Fake their
4116 ;; presence rather than duplicating the build system below. Leave
4117 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4118 ;; The sysvinit needs manual patching, but since upstream doesn't
4119 ;; even provide the option to install it: don't.
d17ae8c0 4120 (lambda* (#:key outputs #:allow-other-keys)
908a3f36
TGR
4121 (let* ((out (assoc-ref outputs "out"))
4122 (share (string-append out "/share/" ,name)))
4123 (substitute* "CMakeLists.txt"
4124 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4125 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4126 ;; That was easy! Now we just need to fix the destinations.
4127 (("/etc" directory)
4128 (string-append out directory)))
4129 #t))))))
9a3d176e
TGR
4130 (native-inputs
4131 `(("pkg-config" ,pkg-config)))
d17ae8c0 4132 (inputs
9a3d176e
TGR
4133 `(("libatasmart" ,libatasmart)
4134 ("yaml-cpp" ,yaml-cpp)))
d17ae8c0
NG
4135 (home-page "http://thinkfan.sourceforge.net/")
4136 (synopsis "Simple fan control program")
4137 (description
4138 "Thinkfan is a simple fan control program. It reads temperatures,
4139checks them against configured limits and switches to appropriate (also
4140pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4141other @code{hwmon} driver that enables temperature reading and fan control
4142from userspace.")
4143 (license license:gpl3+)))
91231156 4144
b313665f
TGR
4145(define-public tpacpi-bat
4146 (package
4147 (name "tpacpi-bat")
4148 (version "3.1")
4149 (source
4150 (origin
4151 (method git-fetch)
4152 (uri (git-reference
4153 (url "https://github.com/teleshoes/tpacpi-bat.git")
4154 (commit (string-append "v" version))))
4155 (file-name (git-file-name name version))
4156 (sha256
4157 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4158 (build-system gnu-build-system)
4159 (arguments
4160 `(#:tests? #f ; no test target
4161 #:phases
4162 (modify-phases %standard-phases
4163 (add-after 'unpack 'refer-to-inputs
4164 (lambda _
4165 (substitute* "tpacpi-bat"
4166 (("cat ")
4167 (format "~a " (which "cat")))
4168 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4169 ;; loaded. That's the administrator's prerogative; disable it.
4170 (("system \"(modprobe .*)\"" _ match)
4171 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4172 #t))
4173 (delete 'configure) ; nothing to configure
4174 (delete 'build) ; nothing to build
4175 (replace 'install
4176 (lambda* (#:key outputs #:allow-other-keys)
4177 (let* ((out (assoc-ref outputs "out"))
4178 (bin (string-append out "/bin"))
4179 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4180 (install-file "tpacpi-bat" bin)
4181
4182 ;; There's no man page. Install other forms of documentation.
4183 (for-each (lambda (file)
4184 (let ((target (string-append doc "/" file)))
4185 (mkdir-p (dirname target))
4186 (copy-recursively file target)))
4187 (list "battery_asl" "examples" "README.md"))
4188 #t))))))
4189 (inputs
4190 `(("perl" ,perl)))
4191 (home-page "https://github.com/teleshoes/tpacpi-bat")
4192 (synopsis "ThinkPad battery charge controller")
4193 (description
4194 "Tpacpi-bat is a command-line interface to control battery charging on
4195@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4196ThinkPad models released after 2011}, starting with the xx20 series. It can
4197query and set the thresholds at which one or both batteries will start and stop
4198charging, inhibit charging batteries for a set period of time, or force them to
4199discharge when they otherwise would not.
4200
4201This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4202kernel module provided by the @code{acpi-call-linux-module} package, which must
4203be installed and loaded separately. Only the original vendor firmware is
4204supported.")
4205 (license license:gpl3+)))
4206
91231156
LC
4207(define-public ntfs-3g
4208 (package
4209 (name "ntfs-3g")
d8af4f6d 4210 (version "2017.3.23")
91231156
LC
4211 (source (origin
4212 (method url-fetch)
4213 (uri (string-append "https://tuxera.com/opensource/"
4214 "ntfs-3g_ntfsprogs-" version ".tgz"))
6d01a7f4 4215 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
91231156
LC
4216 (sha256
4217 (base32
d8af4f6d 4218 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
91231156 4219 (modules '((guix build utils)))
6cbee49d
MW
4220 (snippet '(begin
4221 ;; Install under $prefix.
4222 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4223 (("/sbin")
4224 "@sbindir@"))
4225 #t))))
91231156
LC
4226 (build-system gnu-build-system)
4227 (inputs `(("util-linux" ,util-linux)
4228 ("fuse" ,fuse))) ;libuuid
4229 (native-inputs `(("pkg-config" ,pkg-config)))
4230 (arguments
4231 '(#:configure-flags (list "--exec-prefix=${prefix}"
4232 "--with-fuse=external" ;use our own FUSE
4233 "--enable-mount-helper"
4234 "--enable-posix-acls"
91420521
PN
4235 "--enable-xattr-mappings")
4236 #:phases
4237 (modify-phases %standard-phases
4238 ;; If users install ntfs-3g, they probably want to make it the
4239 ;; default driver as well, so we opt for sensible defaults and link
4240 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
52beae7b 4241 ;; mount NTFS file systems.)
91420521
PN
4242 (add-after 'install 'install-link
4243 (lambda* (#:key outputs #:allow-other-keys)
4244 (let* ((out (assoc-ref outputs "out"))
4245 (sbin (string-append out "/sbin")))
4246 (symlink "mount.ntfs-3g"
9922278b
MW
4247 (string-append sbin "/mount.ntfs")))
4248 #t)))))
8bad0c0b 4249 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
91231156
LC
4250 (synopsis "Read-write access to NTFS file systems")
4251 (description
4252 "NTFS-3G provides read-write access to NTFS file systems, which are
4253commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4254The package provides additional NTFS tools.")
4255 (license license:gpl2+)))
9b0942c1 4256
f8f44dd7
MB
4257(define-public rdma-core
4258 (package
4259 (name "rdma-core")
344f358f 4260 (version "22.3")
f8f44dd7
MB
4261 (source (origin
4262 (method url-fetch)
4263 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4264 "/releases/download/v" version "/rdma-core-"
4265 version ".tar.gz"))
4266 (sha256
4267 (base32
344f358f 4268 "0jgp1xh328x0kr6lkn4vq71cc627zd05wczr74b3j3151flhj828"))))
f8f44dd7
MB
4269 (build-system cmake-build-system)
4270 (arguments
4271 '(#:tests? #f ; no tests
4272 ;; Upstream uses the "ninja" build system and encourage distros
4273 ;; to do the same for consistency. They also recommend using the
4274 ;; "Release" build type.
3def739d
TGR
4275 #:build-type "Release"
4276 #:configure-flags (list "-GNinja")
f8f44dd7
MB
4277 #:phases
4278 (modify-phases %standard-phases
4279 (replace 'build
4280 (lambda _
8c3101b8
MW
4281 (invoke "ninja"
4282 "-j" (number->string (parallel-job-count)))))
f8f44dd7
MB
4283 (replace 'install
4284 (lambda _
8c3101b8 4285 (invoke "ninja" "install"))))))
f8f44dd7
MB
4286 (native-inputs
4287 `(("ninja" ,ninja)
4288 ("pkg-config" ,pkg-config)
4289 ("python" ,python-wrapper)))
4290 (inputs
4291 `(("libnl" ,libnl)
4292 ("udev" ,eudev)))
4293 (home-page "https://github.com/linux-rdma/rdma-core")
4294 (synopsis "Utilities and libraries for working with RDMA devices")
4295 (description
4296 "This package provides userspace components for the InfiniBand
4297subsystem of the Linux kernel. Specifically it contains userspace
4298libraries for the following device nodes:
4299
4300@enumerate
4301@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4302@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4303@item @file{/dev/infiniband/umadX} (@code{libibumad})
4304@end enumerate
4305
4306The following service daemons are also provided:
4307@enumerate
4308@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4309@item @code{iwpmd} (for iWARP kernel providers)
4310@item @code{ibacm} (for InfiniBand communication management assistant)
4311@end enumerate")
4312 ;; All library code is dual licensed under GPL2 and a custom MIT
4313 ;; variant. The package also includes some components covered by
4314 ;; other licenses. Consult COPYING.md for full details.
4315 (license
4316 (list license:gpl2
4317 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4318 license:bsd-2 ; Files referring to COPYING.BSD_FB
4319 license:cc0 ; most files in ccan/
4320 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4321
a0a273c1
MG
4322(define-public perftest
4323 (package
4324 (name "perftest")
50298d4a 4325 (version "4.4-0.4")
a0a273c1
MG
4326 (source
4327 (origin
4328 (method url-fetch)
50298d4a
TGR
4329 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4330 version "/perftest-" version ".g0927198.tar.gz"))
a0a273c1 4331 (sha256
50298d4a 4332 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
a0a273c1
MG
4333 (build-system gnu-build-system)
4334 (arguments
4335 `(#:phases
4336 (modify-phases %standard-phases
4337 (add-after 'unpack 'patch-header-paths
4338 (lambda _
4339 (substitute* '("src/raw_ethernet_fs_rate.c"
4340 "src/raw_ethernet_resources.c"
4341 "src/raw_ethernet_resources.h"
4342 "src/raw_ethernet_send_burst_lat.c"
4343 "src/raw_ethernet_send_bw.c"
4344 "src/raw_ethernet_send_lat.c")
4345 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4346 #t)))))
4347 (inputs `(("rdma-core" ,rdma-core)))
4348 (home-page "https://github.com/linux-rdma/perftest/")
4349 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4350 (description "This is a collection of tests written over uverbs intended for
4351use as a performance micro-benchmark. The tests may be used for hardware or
4352software tuning as well as for functional testing.
4353
4354The collection contains a set of bandwidth and latency benchmark such as:
4355@enumerate
4356@item Send - @code{ib_send_bw} and @code{ib_send_lat}
4357@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4358@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4359@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4360@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4361@end enumerate")
4362 (license license:gpl2)))
4363
9b0942c1
DC
4364(define-public rng-tools
4365 (package
4366 (name "rng-tools")
c6b772a0 4367 (home-page "https://github.com/nhorman/rng-tools")
ae67d70d 4368 (version "6.7")
9b0942c1 4369 (source (origin
f289820c
MB
4370 (method git-fetch)
4371 (uri (git-reference (url home-page)
4372 (commit (string-append "v" version))))
4373 (file-name (git-file-name name version))
9b0942c1
DC
4374 (sha256
4375 (base32
ae67d70d 4376 "19f75m6mzg8h7b4snzg7d6ypvkz6nq32lrpi9ja95gqz4wsd18a5"))))
9b0942c1 4377 (build-system gnu-build-system)
8bc6956b
LF
4378 (arguments
4379 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
ae67d70d
TGR
4380 #:configure-flags '("--without-nistbeacon"
4381 "--without-pkcs11")))
8bc6956b
LF
4382 (native-inputs
4383 `(("autoconf" ,autoconf)
4384 ("automake" ,automake)
4385 ("pkg-config" ,pkg-config)))
4386 (inputs
4387 `(("libsysfs" ,sysfsutils)))
9b0942c1
DC
4388 (synopsis "Random number generator daemon")
4389 (description
4390 "Monitor a hardware random number generator, and supply entropy
4391from that to the system kernel's @file{/dev/random} machinery.")
9b0942c1
DC
4392 ;; The source package is offered under the GPL2+, but the files
4393 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4394 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
4395
4396(define-public cpupower
4397 (package
4398 (name "cpupower")
4399 (version (package-version linux-libre))
4400 (source (package-source linux-libre))
4401 (build-system gnu-build-system)
4402 (arguments
4403 '(#:phases (modify-phases %standard-phases
4404 (add-after 'unpack 'enter-subdirectory
4405 (lambda _
9922278b
MW
4406 (chdir "tools/power/cpupower")
4407 #t))
58d6a1f2
TGR
4408 (delete 'configure)
4409 (add-before 'build 'fix-makefiles
4410 (lambda _
4411 (substitute* "Makefile"
4412 (("/usr/") "/")
4413 (("/bin/(install|pwd)" _ command) command))
4414 (substitute* "bench/Makefile"
9922278b
MW
4415 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4416 #t)))
58d6a1f2
TGR
4417 #:make-flags (let ((out (assoc-ref %outputs "out")))
4418 (list (string-append "DESTDIR=" out)
4419 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4420 "docdir=/share/doc/cpupower"
4421 "confdir=$(docdir)/examples"
4422 ;; The Makefile recommends the following changes
4423 "DEBUG=false"
4424 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4425 #:tests? #f)) ;no tests
b94a6ca0 4426 (native-inputs `(("gettext" ,gettext-minimal)))
58d6a1f2
TGR
4427 (inputs `(("pciutils" ,pciutils)))
4428 (home-page (package-home-page linux-libre))
4429 (synopsis "CPU frequency and voltage scaling tools for Linux")
4430 (description
4431 "cpupower is a set of user-space tools that use the cpufreq feature of the
4432Linux kernel to retrieve and control processor features related to power saving,
4433such as frequency and voltage scaling.")
4434 (license license:gpl2)))
2b76f135 4435
71bd55cb
SS
4436(define-public x86-energy-perf-policy
4437 (package
4438 (name "x86-energy-perf-policy")
4439 (version (package-version linux-libre))
4440 (source (package-source linux-libre))
4441 (build-system gnu-build-system)
4442 (arguments
4443 '(#:tests? #f
4444 #:phases
4445 (modify-phases %standard-phases
4446 (add-after 'unpack 'enter-subdirectory
4447 (lambda _
4448 (chdir "tools/power/x86/x86_energy_perf_policy")
4449 #t))
4450 (delete 'configure)
4451 (add-before 'build 'fix-makefile
4452 (lambda _
4453 (substitute* "Makefile" (("/usr") ""))
4454 #t)))
4455 #:make-flags
4456 (let ((out (assoc-ref %outputs "out")))
4457 (list (string-append "DESTDIR=" out)
4458 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4459 (supported-systems '("i686-linux" "x86_64-linux"))
4460 (home-page (package-home-page linux-libre))
4461 (synopsis "Display and update Intel-CPU energy-performance policy")
4462 (description
4463 "@command{x86_energy_perf_policy} displays and updates energy-performance
4464policy settings specific to Intel Architecture Processors. Settings are
4465accessed via Model Specific Register (MSR) updates, no matter if the Linux
4466cpufreq sub-system is enabled or not.")
4467 (license license:gpl2)))
4468
2b76f135
TGR
4469(define-public haveged
4470 (package
4471 (name "haveged")
389cae8b 4472 (version "1.9.6")
2b76f135
TGR
4473 (source
4474 (origin
893c340c
TGR
4475 (method git-fetch)
4476 (uri (git-reference
4477 (url "https://github.com/jirka-h/haveged.git")
389cae8b 4478 (commit (string-append "v" version))))
893c340c 4479 (file-name (git-file-name name version))
2b76f135 4480 (sha256
389cae8b 4481 (base32 "11kr19n2f87izsj341lv5amhd1wc2ckfmqr9pq5fxix8pkbs94rh"))))
2b76f135 4482 (build-system gnu-build-system)
6664ec0c 4483 (home-page "https://www.issihosts.com/haveged")
2b76f135
TGR
4484 (synopsis "Entropy source for the Linux random number generator")
4485 (description
4486 "haveged generates an unpredictable stream of random numbers for use by
4487Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4488standard mechanisms for filling the entropy pool may not be sufficient for
4489systems with high needs or limited user interaction, such as headless servers.
b71a3488 4490
2b76f135 4491@command{haveged} runs as a privileged daemon, harvesting randomness from the
8e42b087
TGR
4492indirect effects of hardware events on hidden processor state using the
4493@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
4494It tunes itself to its environment and provides the same built-in test suite
4495for the output stream as used on certified hardware security devices.
4a147986
TGR
4496
4497The quality of the randomness produced by this algorithm has not been proven.
4498It is recommended to run it together with another entropy source like rngd, and
4499not as a replacement for it.")
2b76f135
TGR
4500 (license (list (license:non-copyleft "file://nist/mconf.h")
4501 (license:non-copyleft "file://nist/packtest.c")
4502 license:public-domain ; nist/dfft.c
4503 license:gpl3+)))) ; everything else
e385e957
TGR
4504
4505(define-public ecryptfs-utils
4506 (package
4507 (name "ecryptfs-utils")
4508 (version "111")
4509 (source
4510 (origin
4511 (method url-fetch)
4512 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4513 version "/+download/ecryptfs-utils_"
4514 version ".orig.tar.gz"))
4515 (sha256
4516 (base32
4517 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4518 (build-system gnu-build-system)
4519 (arguments
17a21bcf
BT
4520 `(#:configure-flags (list "--disable-pywrap")
4521 #:phases
4522 (modify-phases %standard-phases
4523 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4524 (lambda* (#:key inputs outputs #:allow-other-keys)
4525 (let ((out (assoc-ref outputs "out"))
4526 (utils-linux (assoc-ref inputs "utils-linux"))
4527 (cryptsetup (assoc-ref inputs "cryptsetup"))
4528 (linux-pam (assoc-ref inputs "linux-pam"))
4529 (lvm2 (assoc-ref inputs "lvm2")))
4530 (substitute* '("src/utils/ecryptfs-mount-private"
4531 "src/utils/ecryptfs-umount-private"
4532 "src/utils/ecryptfs-setup-private"
e8ec2dda 4533 "src/utils/ecryptfs-setup-swap"
17a21bcf 4534 "src/utils/mount.ecryptfs.c"
e8ec2dda 4535 "src/utils/umount.ecryptfs.c"
17a21bcf
BT
4536 "src/pam_ecryptfs/pam_ecryptfs.c"
4537 "src/desktop/ecryptfs-mount-private.desktop.in"
e8ec2dda 4538 "src/desktop/ecryptfs-setup-private.desktop.in")
17a21bcf
BT
4539 (("/bin/mount")
4540 (string-append utils-linux "/bin/mount"))
4541 (("/bin/umount")
4542 (string-append utils-linux "/bin/umount"))
4543 (("/sbin/mount.ecryptfs_private")
4544 (string-append out "/sbin/mount.ecryptfs_private"))
4545 (("/sbin/umount.ecryptfs_private")
4546 (string-append out "/sbin/umount.ecryptfs_private"))
4547 (("/usr/bin/ecryptfs-mount-private")
4548 (string-append out "/bin/ecryptfs-mount-private"))
4549 (("/usr/bin/ecryptfs-rewrite-file")
4550 (string-append out "/bin/ecryptfs-rewrite-file"))
4551 (("/usr/bin/ecryptfs-setup-private")
4552 (string-append out "/bin/ecryptfs-setup-private"))
4553 (("/sbin/cryptsetup")
4554 (string-append cryptsetup "/sbin/cryptsetup"))
4555 (("/sbin/unix_chkpwd")
4556 (string-append linux-pam "/sbin/unix_chkpwd"))
4557 (("/sbin/dmsetup")
4558 (string-append lvm2 "/sbin/dmsetup")))))))))
e385e957
TGR
4559 (native-inputs
4560 `(("intltool" ,intltool)
4561 ("perl" ,perl) ; for pod2man
4562 ("pkg-config" ,pkg-config)))
4563 (inputs
4564 `(("keyutils" ,keyutils)
4565 ("linux-pam" ,linux-pam)
17a21bcf
BT
4566 ("utils-linux" ,util-linux)
4567 ("cryptsetup" ,cryptsetup)
4568 ("lvm2" ,lvm2)
e385e957
TGR
4569 ("nss" ,nss)))
4570 (home-page "http://ecryptfs.org/")
4571 (synopsis "eCryptfs cryptographic file system utilities")
4572 (description
4573 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4574Each file's cryptographic meta-data is stored inside the file itself, along
4575with the encrypted contents. This allows individual encrypted files to be
4576copied between hosts and still be decrypted with the proper key. eCryptfs is a
4577native Linux file system, and has been part of the Linux kernel since version
45782.6.19. This package contains the userland utilities to manage it.")
4579 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4580 ;; grant additional permission to link with OpenSSL.
4581 (license license:gpl2+)))
cff0adec
DC
4582
4583(define-public libnfsidmap
4584 (package
4585 (name "libnfsidmap")
4505369c
TGR
4586 (version "0.27")
4587 (source
4588 (origin
4589 (method url-fetch)
4590 (uri (string-append "https://fedorapeople.org/~steved/"
4591 name "/" version "/" name "-" version ".tar.bz2"))
4592 (sha256
4593 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
cff0adec
DC
4594 (build-system gnu-build-system)
4595 (arguments
4596 `(#:configure-flags (list
4597 (string-append "--with-pluginpath="
4598 (assoc-ref %outputs "out")
4599 "/lib/libnfsidmap"))))
4505369c
TGR
4600 (native-inputs
4601 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
cff0adec
DC
4602 (home-page
4603 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4505369c 4604 (synopsis "NFSv4 support library for name/ID mapping")
cff0adec
DC
4605 (description "Libnfsidmap is a library holding mulitiple methods of
4606mapping names to ids and visa versa, mainly for NFSv4. It provides an
4607extensible array of mapping functions, currently consisting of two choices:
4608the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4609 (license (license:non-copyleft "file://COPYING"
4610 "See COPYING in the distribution."))))
035d3593
DC
4611
4612(define-public module-init-tools
4613 (package
4614 (name "module-init-tools")
4615 (version "3.16")
4616 (source (origin
4617 (method url-fetch)
4618 (uri (string-append
4619 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
4620 "module-init-tools-" version ".tar.bz2"))
4621 (sha256
4622 (base32
4623 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
4624 (patches (search-patches "module-init-tools-moduledir.patch"))))
4625 (build-system gnu-build-system)
4626 (arguments
4627 ;; FIXME: The upstream tarball lacks man pages, and building them would
4628 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
4629 ;; but they vanished. In the meantime, fake it.
dc1d3cde
KK
4630 '(#:phases
4631 (modify-phases %standard-phases
4632 (add-before 'configure 'fake-docbook
4633 (lambda _
4634 (substitute* "Makefile.in"
4635 (("^DOCBOOKTOMAN.*$")
4636 "DOCBOOKTOMAN = true\n"))
4637 #t)))))
81e59e41 4638 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
035d3593
DC
4639 (synopsis "Tools for loading and managing Linux kernel modules")
4640 (description
36a4366d
EF
4641 "Tools for loading and managing Linux kernel modules, such as
4642@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
035d3593 4643 (license license:gpl2+)))
dd65f3b7
TGR
4644
4645(define-public mcelog
4646 (package
4647 (name "mcelog")
e03e9c86 4648 (version "154")
dd65f3b7
TGR
4649 (source (origin
4650 (method url-fetch)
4651 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
4652 "mcelog.git/snapshot/v" version ".tar.gz"))
4653 (sha256
4654 (base32
e03e9c86 4655 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
dd65f3b7
TGR
4656 (file-name (string-append name "-" version ".tar.gz"))
4657 (modules '((guix build utils)))
4658 (snippet
6cbee49d
MW
4659 `(begin
4660 ;; The snapshots lack a .git directory,
4661 ;; breaking ‘git describe’.
4662 (substitute* "Makefile"
4663 (("\"unknown\"") (string-append "\"v" ,version "\"")))
4664 #t))))
dd65f3b7
TGR
4665 (build-system gnu-build-system)
4666 (arguments
4667 `(#:phases (modify-phases %standard-phases
4668 (delete 'configure)) ; no configure script
4669 #:make-flags (let ((out (assoc-ref %outputs "out")))
4670 (list "CC=gcc"
4671 (string-append "prefix=" out)
4672 (string-append "DOCDIR=" out "/share/doc/mcelog")
4673 "etcprefix=$(DOCDIR)/examples"))
4674 ;; The tests will only run as root on certain supported CPU models.
4675 #:tests? #f))
4676 (supported-systems (list "i686-linux" "x86_64-linux"))
71d60b96 4677 (home-page "https://mcelog.org/")
dd65f3b7
TGR
4678 (synopsis "Machine check monitor for x86 Linux systems")
4679 (description
4680 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
4681and other hardware errors on x86 systems. It can also perform user-defined
4682tasks, such as bringing bad pages off-line, when configurable error thresholds
4683are exceeded.")
4684 (license license:gpl2)))
0c60cc53
DM
4685
4686(define-public mtd-utils
4687 (package
4688 (name "mtd-utils")
9ea820a5 4689 (version "2.1.1")
0c60cc53
DM
4690 (source (origin
4691 (method url-fetch)
4692 (uri (string-append
4693 "ftp://ftp.infradead.org/pub/mtd-utils/"
4694 "mtd-utils-" version ".tar.bz2"))
4695 (sha256
4696 (base32
9ea820a5 4697 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
e8b9aaf0
EF
4698 (arguments
4699 '(#:configure-flags '("--enable-unit-tests")))
4700 (native-inputs
4701 `(("cmocka" ,cmocka)
4702 ("pkg-config" ,pkg-config)))
0c60cc53 4703 (inputs
f8f2b048 4704 `(("acl" ,acl) ; extended attributes (xattr)
0c60cc53 4705 ("libuuid" ,util-linux)
c695fb76 4706 ("lzo" ,lzo)
f8f2b048 4707 ("openssl" ,openssl) ; optional crypto support
9ea820a5
TGR
4708 ("zlib" ,zlib)
4709 ("zstd" ,zstd "lib")))
0c60cc53 4710 (build-system gnu-build-system)
0c60cc53
DM
4711 (synopsis "MTD Flash Storage Utilities")
4712 (description "This package provides utilities for testing, partitioning, etc
4713of flash storage.")
4714 (home-page "http://www.linux-mtd.infradead.org/")
4715 (license
4716 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
4717 license:mpl1.1 ; All ftl* files
4718 license:expat)))) ; libiniparser
def6213f
LF
4719
4720(define-public libseccomp
4721 (package
4722 (name "libseccomp")
e01bd1a6 4723 (version "2.4.1")
def6213f
LF
4724 (source (origin
4725 (method url-fetch)
4726 (uri (string-append "https://github.com/seccomp/libseccomp/"
4727 "releases/download/v" version
4728 "/libseccomp-" version ".tar.gz"))
4729 (sha256
4730 (base32
e01bd1a6 4731 "1s06h2cgk0xxwmhwj72z33bllafc1xqnxzk2yyra2rmg959778qw"))))
def6213f
LF
4732 (build-system gnu-build-system)
4733 (native-inputs
4734 `(("which" ,which)))
4735 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
4736 (description "The libseccomp library provides an easy to use, platform
4737independent, interface to the Linux Kernel's syscall filtering mechanism. The
4738libseccomp API is designed to abstract away the underlying BPF based syscall
4739filter language and present a more conventional function-call based filtering
4740interface that should be familiar to, and easily adopted by, application
4741developers.")
4742 (home-page "https://github.com/seccomp/libseccomp")
4743 (license license:lgpl2.1)))
58c4f11e
TGR
4744
4745(define-public radeontop
4746 (package
4747 (name "radeontop")
88e1bce5 4748 (version "1.2")
ee861a54
TGR
4749 (source
4750 (origin
4751 (method git-fetch)
4752 (uri (git-reference
4753 (url "https://github.com/clbr/radeontop.git")
4754 (commit (string-append "v" version))))
4755 (file-name (git-file-name name version))
4756 (sha256
4757 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
58c4f11e
TGR
4758 (build-system gnu-build-system)
4759 (arguments
4760 `(#:phases (modify-phases %standard-phases
4761 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4762 ;; dependency, and doesn't even work on release(!) tarballs.
4763 (add-after 'unpack 'report-correct-version
9922278b
MW
4764 (lambda _
4765 (substitute* "getver.sh"
4766 (("ver=unknown")
4767 (string-append "ver=" ,version)))
4768 #t))
58c4f11e
TGR
4769 (delete 'configure)) ; no configure script
4770 #:make-flags (list "CC=gcc"
4771 (string-append "PREFIX=" %output))
4772 #:tests? #f)) ; no tests
4773 (native-inputs
7c90d0f4 4774 `(("gettext" ,gettext-minimal)
58c4f11e
TGR
4775 ("pkg-config" ,pkg-config)))
4776 (inputs
4777 `(("libdrm" ,libdrm)
4778 ("libpciaccess" ,libpciaccess)
a7c61512 4779 ("libxcb" ,libxcb)
58c4f11e 4780 ("ncurses" ,ncurses)))
ee861a54 4781 (home-page "https://github.com/clbr/radeontop/")
58c4f11e
TGR
4782 (synopsis "Usage monitor for AMD Radeon graphics")
4783 (description "RadeonTop monitors resource consumption on supported AMD
4784Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4785a terminal or saved to a file for further processing. It measures both the
4786activity of the GPU as a whole, which is also accurate during OpenCL
4787computations, as well as separate component statistics that are only meaningful
4788under OpenGL graphics workloads.")
4789 (license license:gpl3)))
0d74462a
MB
4790
4791(define-public efivar
4792 (package
4793 (name "efivar")
f19dfeeb 4794 (version "37")
0d74462a
MB
4795 (source (origin
4796 (method url-fetch)
c6dd2790 4797 (uri (string-append "https://github.com/rhboot/" name
0d74462a
MB
4798 "/releases/download/" version "/" name
4799 "-" version ".tar.bz2"))
4800 (sha256
4801 (base32
f19dfeeb 4802 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
0d74462a
MB
4803 (build-system gnu-build-system)
4804 (arguments
4805 `(;; Tests require a UEFI system and is not detected in the chroot.
4806 #:tests? #f
4807 #:make-flags (list (string-append "prefix=" %output)
4808 (string-append "libdir=" %output "/lib")
b2b2ba40 4809 "CC_FOR_BUILD=gcc"
0d74462a
MB
4810 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4811 #:phases
4812 (modify-phases %standard-phases
f90d6c3f
MB
4813 (delete 'configure)
4814 (add-before 'build 'kernel-headers-are-system-headers
4815 (lambda* (#:key inputs #:allow-other-keys)
4816 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
4817 ;; Make sure the kernel headers are treated as system headers
4818 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
4819 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
4820 #t))))))
0d74462a
MB
4821 (native-inputs
4822 `(("pkg-config" ,pkg-config)))
4823 (inputs
4824 `(("popt" ,popt)))
c6dd2790 4825 (home-page "https://github.com/rhboot/efivar")
0d74462a
MB
4826 (synopsis "Tool and library to manipulate EFI variables")
4827 (description "This package provides a library and a command line
4828interface to the variable facility of UEFI boot firmware.")
4829 (license license:lgpl2.1+)))
1581406e
MB
4830
4831(define-public efibootmgr
4832 (package
4833 (name "efibootmgr")
732825f3 4834 (version "16")
1581406e
MB
4835 (source (origin
4836 (method url-fetch)
30559d8f
MB
4837 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
4838 "/releases/download/" version "/efibootmgr"
1581406e
MB
4839 "-" version ".tar.bz2"))
4840 (sha256
4841 (base32
732825f3 4842 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
1581406e
MB
4843 (build-system gnu-build-system)
4844 (arguments
82e7a51c 4845 `(#:tests? #f ;no tests
1581406e
MB
4846 #:make-flags (list (string-append "prefix=" %output)
4847 (string-append "libdir=" %output "/lib")
732825f3
MB
4848 ;; EFIDIR denotes a subdirectory relative to the
4849 ;; EFI System Partition where the loader will be
4850 ;; installed (known as OS_VENDOR in the code).
4851 ;; GRUB overrides this, as such it's only used if
4852 ;; nothing else is specified on the command line.
b9a30e0d
MB
4853 "EFIDIR=gnu"
4854 ;; Treat kernel headers as system headers to prevent
4855 ;; warnings about conflicting types.
4856 (string-append "C_INCLUDE_PATH="
4857 (assoc-ref %build-inputs "kernel-headers")
4858 "/include"))
732825f3 4859 #:phases (modify-phases %standard-phases (delete 'configure))))
1581406e
MB
4860 (native-inputs
4861 `(("pkg-config" ,pkg-config)))
4862 (inputs
4863 `(("efivar" ,efivar)
4864 ("popt" ,popt)))
4865 (home-page "https://github.com/rhinstaller/efibootmgr")
4866 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
4867 (description
4868 "@code{efibootmgr} is a user-space application to modify the Intel
4869Extensible Firmware Interface (EFI) Boot Manager. This application can
4870create and destroy boot entries, change the boot order, change the next
4871running boot option, and more.")
4872 (license license:gpl2+)))
6d3e08d4
LF
4873
4874(define-public sysstat
4875 (package
4876 (name "sysstat")
3d761127 4877 (version "12.1.6")
6d3e08d4
LF
4878 (source (origin
4879 (method url-fetch)
36ac9520 4880 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6d3e08d4
LF
4881 "sysstat-" version ".tar.xz"))
4882 (sha256
4883 (base32
3d761127 4884 "0agi17n82k363mf9f7cky3isq195hw112vs98v26yfhm0v2g6lpp"))))
6d3e08d4
LF
4885 (build-system gnu-build-system)
4886 (arguments
4887 `(#:tests? #f ; No test suite.
4888 ;; Without this flag, it tries to install the man pages with group 'root'
4889 ;; and fails because /etc/passwd lacks an entry for the root user.
4890 #:configure-flags
4891 (list "--disable-file-attr"
4892 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
4893 #:phases
4894 (modify-phases %standard-phases
4895 ;; The build process tries to create '/var/lib/sa', so we skip that
4896 ;; instruction.
4897 (add-after 'build 'skip-touching-var
4898 (lambda _
4899 (substitute* "Makefile"
4900 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
4901 ""))
4902 #t)))))
4903 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
4904 (synopsis "Performance monitoring tools for Linux")
4905 (description "The sysstat utilities are a collection of performance
4906monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
4907@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
4908@code{sadf} and @code{sa}.")
4909 (license license:gpl2+)))
01be4f93
JMSG
4910
4911(define-public light
4912 (package
4913 (name "light")
ff598353 4914 (version "1.2")
01be4f93 4915 (source (origin
ff598353
PL
4916 (method url-fetch)
4917 (uri (string-append
4918 "https://github.com/haikarainen/light/archive/v"
4919 version ".tar.gz"))
01be4f93
JMSG
4920 (sha256
4921 (base32
ff598353
PL
4922 "1gfvsw7gh5pis733l7j54vzp272pvjyzbg8a0pvapfmg0s7mip97"))
4923 (file-name (string-append name "-" version ".tar.gz"))))
01be4f93 4924 (build-system gnu-build-system)
01be4f93 4925 (native-inputs
ff598353
PL
4926 `(("autoconf" ,autoconf)
4927 ("automake" ,automake)))
4928 (home-page "https://haikarainen.github.io/light/")
01be4f93
JMSG
4929 (synopsis "GNU/Linux application to control backlights")
4930 (description
4931 "Light is a program to send commands to screen backlight controllers
4932under GNU/Linux. Features include:
4933
4934@itemize
4935@item It does not rely on X.
4936@item Light can automatically figure out the best controller to use, making
4937full use of underlying hardware.
4938@item It is possible to set a minimum brightness value, as some controllers
4939set the screen to be pitch black at a vaĺue of 0 (or higher).
4940@end itemize
4941
4942Light is the successor of lightscript.")
4943 (license license:gpl3+)))
189d8422 4944
ab7f1eb9
VC
4945(define-public brightnessctl
4946 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
4947 (package
4948 (name "brightnessctl")
4949 (version (git-version "0.4" "0" commit))
4950 (source (origin
4951 (method git-fetch)
4952 (uri (git-reference
4953 (url "https://github.com/Hummer12007/brightnessctl/")
4954 (commit commit)))
4955 (file-name (git-file-name name version))
4956 (sha256
4957 (base32
4958 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
4959 (build-system gnu-build-system)
4960 (arguments
4961 '(#:tests? #f ; no tests
4962 #:make-flags (list "CC=gcc"
4963 (string-append "PREFIX=" %output)
4964 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
4965 #:phases
4966 (modify-phases %standard-phases
4967 (delete 'configure)
4968 (add-after 'unpack 'adjust-udev-rules
4969 (lambda _
4970 (substitute* "90-brightnessctl.rules"
4971 (("/bin/") "/run/current-system/profile/bin/"))
4972 #t)))))
4973 (home-page "https://github.com/Hummer12007/brightnessctl")
4974 (synopsis "Backlight and LED brightness control")
4975 (description
4976 "This program allows you read and control device brightness. Devices
4977include backlight and LEDs. It can also preserve current brightness before
4978applying the operation, such as on lid close.
4979
4980The appropriate permissions must be set on the backlight or LED control
4981interface in sysfs, which can be accomplished with the included udev rules.")
4982 (license license:expat))))
4983
c7adafa7
MO
4984(define-public tlp
4985 (package
4986 (name "tlp")
5d51a977 4987 (version "1.2.2")
c7adafa7
MO
4988 (source (origin
4989 (method url-fetch)
4990 (uri (string-append
4991 "https://github.com/linrunner/"
4992 (string-upcase name)
4993 "/archive/" version ".tar.gz"))
4994 (file-name (string-append name "-" version ".tar.gz"))
4995 (sha256
4996 (base32
5d51a977 4997 "059kxrpxx580mm6p0z2a421nxngszyh4yqqhbgvn04b6a7dbsa2w"))))
c7adafa7
MO
4998 (inputs `(("bash" ,bash)
4999 ("dbus" ,dbus)
5000 ("ethtool" ,ethtool)
5001 ("eudev" ,eudev)
5002 ("grep" ,grep)
5003 ("hdparm" ,hdparm)
5004 ("inetutils" ,inetutils)
5005 ("iw" ,iw)
5006 ("kmod" ,kmod)
5007 ("pciutils" ,pciutils)
5008 ("perl" ,perl)
5009 ("rfkill" ,rfkill)
5010 ("sed" ,sed)
5011 ("usbutils" ,usbutils)
5012 ("util-linux" ,util-linux)
cf342a85
SS
5013 ("wireless-tools" ,wireless-tools)
5014 ,@(if (let ((system (or (%current-target-system)
5015 (%current-system))))
5016 (or (string-prefix? "i686-" system)
5017 (string-prefix? "x86_64-" system)))
5018 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5019 '())))
c7adafa7
MO
5020 (build-system gnu-build-system)
5021 (arguments
cf342a85
SS
5022 `(#:modules ((guix build gnu-build-system)
5023 (guix build utils)
5024 (srfi srfi-1))
5025 #:phases
c7adafa7 5026 (modify-phases %standard-phases
cef3f146 5027 (delete 'configure) ; no configure script
c7adafa7
MO
5028 (add-before 'build 'setenv
5029 (lambda* (#:key outputs #:allow-other-keys)
5030 (let ((out (assoc-ref outputs "out")))
5031 (setenv "TLP_WITH_SYSTEMD" "0")
5032 (setenv "TLP_NO_INIT" "1")
5033 (setenv "TLP_NO_PMUTILS" "1")
5034 (setenv "TLP_SBIN" (string-append out "/bin"))
5035 (setenv "TLP_BIN" (string-append out "/bin"))
c6e775a8
NG
5036 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5037 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
c7adafa7 5038 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
32e75b48 5039 (setenv "TLP_CONF" "/etc/tlp")
5d51a977
NG
5040 (setenv "TLP_ELOD"
5041 (string-append out "/lib/elogind/system-sleep"))
c7adafa7
MO
5042 (setenv "TLP_SHCPL"
5043 (string-append out "/share/bash-completion/completions"))
6db6c3a9 5044 (setenv "TLP_MAN" (string-append out "/share/man"))
272fc9dc
TGR
5045 (setenv "TLP_META" (string-append out "/share/metainfo"))
5046 #t)))
cef3f146
TGR
5047 (delete 'check) ; no tests
5048 (add-before 'install 'fix-installation
5049 (lambda _
5050 ;; Stop the Makefile from trying to create system directories.
5d51a977
NG
5051 (substitute* "Makefile"
5052 (("\\[ -f \\$\\(_CONF\\) \\]") "#")
5053 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
272fc9dc 5054 #t))
c7adafa7
MO
5055 (replace 'install
5056 (lambda _
9922278b 5057 (invoke "make" "install-tlp" "install-man")))
c7adafa7
MO
5058 (add-after 'install 'wrap
5059 (lambda* (#:key inputs outputs #:allow-other-keys)
5060 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5061 (bin-files (find-files bin ".*")))
5062 (define (bin-directory input-name)
cf342a85
SS
5063 (let ((p (assoc-ref inputs input-name)))
5064 (and p (string-append p "/bin"))))
c7adafa7
MO
5065 (define (sbin-directory input-name)
5066 (string-append (assoc-ref inputs input-name) "/sbin"))
5067 (for-each (lambda (program)
5068 (wrap-program program
5069 `("PATH" ":" prefix
5070 ,(append
cf342a85
SS
5071 (filter-map bin-directory
5072 '("bash"
5073 "coreutils"
5074 "dbus"
5075 "eudev"
5076 "grep"
5077 "inetutils"
5078 "kmod"
5079 "perl"
5080 "sed"
5081 "usbutils"
5082 "util-linux"
5083 "x86-energy-perf-policy"))
5084 (filter-map sbin-directory
5085 '("ethtool"
5086 "hdparm"
5087 "iw"
5088 "pciutils"
5089 "rfkill"
5090 "wireless-tools"))))))
272fc9dc
TGR
5091 bin-files)
5092 #t))))))
c7adafa7
MO
5093 (home-page "http://linrunner.de/en/tlp/tlp.html")
5094 (synopsis "Power management tool for Linux")
5095 (description "TLP is a power management tool for Linux. It comes with
5096a default configuration already optimized for battery life. Nevertheless,
5097TLP is customizable to fulfil system requirements. TLP settings are applied
5098every time the power supply source is changed.")
c7adafa7
MO
5099 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5100 ;; rest is GPLv2+.
5101 (license (list license:gpl2+ license:gpl3+))))
5102
189d8422
BG
5103(define-public lshw
5104 (package
5105 (name "lshw")
5106 (version "B.02.18")
5107 (source (origin
5108 (method url-fetch)
5109 (uri (string-append "https://www.ezix.org/software/"
5110 "files/lshw-" version
5111 ".tar.gz"))
5112 (sha256
5113 (base32
5114 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5115 (build-system gnu-build-system)
5116 (arguments
5117 `(#:phases (modify-phases %standard-phases (delete 'configure))
5118 #:tests? #f ; no tests
5119 #:make-flags
5120 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5121 (synopsis "List hardware information")
5122 (description
5123 "@command{lshw} (Hardware Lister) is a small tool to provide
5124detailed information on the hardware configuration of the machine.
5125It can report exact memory configuration, firmware version, mainboard
5126configuration, CPU version and speed, cache configuration, bus speed,
5127and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5128machines (PowerMac G4 is known to work).")
5129 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5130 (license license:gpl2+)))
2f4a58b5
LF
5131
5132(define-public libmnl
5133 (package
5134 (name "libmnl")
5135 (version "1.0.4")
5136 (source
5137 (origin
5138 (method url-fetch)
f11ae44f 5139 (uri (string-append "mirror://netfilter.org/libmnl/"
2f4a58b5
LF
5140 "libmnl-" version ".tar.bz2"))
5141 (sha256
5142 (base32
5143 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5144 (build-system gnu-build-system)
5145 (home-page "https://www.netfilter.org/projects/libmnl/")
5146 (synopsis "Netlink utility library")
5147 (description "Libmnl is a minimalistic user-space library oriented to
5148Netlink developers. There are a lot of common tasks in parsing, validating,
5149constructing of both the Netlink header and TLVs that are repetitive and easy to
5150get wrong. This library aims to provide simple helpers that allows you to
5151re-use code and to avoid re-inventing the wheel.")
5152 (license license:lgpl2.1+)))
b754c612
LF
5153
5154(define-public libnftnl
5155 (package
5156 (name "libnftnl")
c5e3f4f0 5157 (version "1.1.4")
b754c612 5158 (source
e569c772
TGR
5159 (origin
5160 (method url-fetch)
5161 (uri (string-append "mirror://netfilter.org/libnftnl/"
5162 "libnftnl-" version ".tar.bz2"))
5163 (sha256
c5e3f4f0 5164 (base32 "087dfc2n4saf2k68hyi4byvgz5grwpw5kfjvmkpn3wmd8y1riiy8"))))
b754c612
LF
5165 (build-system gnu-build-system)
5166 (native-inputs
5167 `(("pkg-config" ,pkg-config)))
5168 (inputs
5169 `(("libmnl" ,libmnl)))
5170 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5171 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5172 (description "Libnftnl is a userspace library providing a low-level netlink
5173programming interface to the in-kernel nf_tables subsystem. The library
5174libnftnl has been previously known as libnftables. This library is currently
5175used by nftables.")
5176 (license license:gpl2+)))
62b28c0e 5177
dfe93c9a
RH
5178(define-public nftables
5179 (package
5180 (name "nftables")
f8b7c35a 5181 (version "0.9.2")
dfe93c9a
RH
5182 (source
5183 (origin
5184 (method url-fetch)
5185 (uri (string-append "http://www.nftables.org/projects/nftables"
5186 "/files/nftables-" version ".tar.bz2"))
5187 (sha256
5188 (base32
f8b7c35a 5189 "1x8kalbggjq44j4916i6vyv1rb20dlh1dcsf9xvzqsry2j063djw"))))
dfe93c9a 5190 (build-system gnu-build-system)
9cb4bda2
RH
5191 (arguments `(#:configure-flags
5192 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
c695fb76
TGR
5193 (inputs `(("bison" ,bison)
5194 ("flex" ,flex)
5195 ("gmp" ,gmp)
5196 ("libmnl" ,libmnl)
5197 ("libnftnl" ,libnftnl)
5198 ("readline" ,readline)))
5199 (native-inputs `(("pkg-config" ,pkg-config)))
dfe93c9a
RH
5200 (home-page "http://www.nftables.org")
5201 (synopsis "Userspace utility for Linux packet filtering")
5202 (description "nftables is the project that aims to replace the existing
5203{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5204filtering framework, a new userspace utility and also a compatibility layer for
5205{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5206infrastructure such as the existing hooks, the connection tracking system, the
5207userspace queueing component and the logging subsystem.")
5208 (license license:gpl2)))
5209
62b28c0e
LC
5210(define-public proot
5211 (package
5212 (name "proot")
5213 (version "5.1.0")
674495b7
TGR
5214 (source
5215 (origin
5216 (method git-fetch)
5217 (uri (git-reference
5218 (url "https://github.com/proot-me/PRoot.git")
5219 (commit (string-append "v" version))))
5220 (file-name (git-file-name name version))
5221 (sha256
5222 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5223 (patches (search-patches "proot-test-fhs.patch"))))
62b28c0e
LC
5224 (build-system gnu-build-system)
5225 (arguments
5226 '(#:make-flags '("-C" "src")
5227
5228 #:phases (modify-phases %standard-phases
5229 (delete 'configure)
5230 (add-before 'build 'set-shell-file-name
5231 (lambda* (#:key inputs #:allow-other-keys)
5232 (substitute* (find-files "src" "\\.[ch]$")
5233 (("\"/bin/sh\"")
5234 (string-append "\""
5235 (assoc-ref inputs "bash")
5236 "/bin/sh\"")))
5237 #t))
5238 (add-before 'check 'fix-fhs-assumptions-in-tests
5239 (lambda _
5240 (substitute* "tests/test-c6b77b77.mk"
5241 (("/bin/bash") (which "bash"))
5242 (("/usr/bin/test") (which "test")))
5243 (substitute* '("tests/test-16573e73.c")
5244 (("/bin/([a-z-]+)" _ program)
5245 (which program)))
5246
5247 (substitute* (find-files "tests" "\\.sh$")
5248 ;; Some of the tests try to "bind-mount" /bin/true.
5249 (("-b /bin/true:")
5250 (string-append "-b " (which "true") ":"))
5251 ;; Likewise for /bin.
5252 (("-b /bin:") "-b /gnu:")
5253 ;; Others try to run /bin/sh.
5254 (("/bin/sh") (which "sh"))
5255 ;; Others assume /etc/fstab exists.
5256 (("/etc/fstab") "/etc/passwd"))
5257
5258 (substitute* "tests/GNUmakefile"
5259 (("-b /bin:") "-b /gnu:"))
5260
5261 ;; XXX: This test fails in an obscure corner case, just
5262 ;; skip it.
5263 (delete-file "tests/test-kkkkkkkk.c")
5264
5265 #t))
5266 (replace 'check
5267 (lambda _
5268 (let ((n (parallel-job-count)))
5269 ;; For some reason we get lots of segfaults with
5270 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5271 (setenv "PROOT_NO_SECCOMP" "1")
5272
5273 ;; Most of the tests expect "/bin" to be in $PATH so
5274 ;; they can run things that live in $ROOTFS/bin.
5275 (setenv "PATH"
5276 (string-append (getenv "PATH") ":/bin"))
5277
06153a30
MW
5278 (invoke "make" "check" "-C" "tests"
5279 ;;"V=1"
5280 "-j" (number->string n)))))
62b28c0e
LC
5281 (replace 'install
5282 (lambda* (#:key outputs #:allow-other-keys)
5283 ;; The 'install' rule does nearly nothing.
06153a30
MW
5284 (let* ((out (assoc-ref outputs "out"))
5285 (man1 (string-append out "/share/man/man1")))
5286 ;; TODO: 'make install-care' (does not even
5287 ;; build currently.)
5288 (invoke "make" "-C" "src" "install"
5289 (string-append "PREFIX=" out))
5290
5291 (mkdir-p man1)
5292 (copy-file "doc/proot/man.1"
5293 (string-append man1 "/proot.1"))
5294 #t))))))
62b28c0e
LC
5295 (native-inputs `(("which" ,which)
5296
5297 ;; For 'mcookie', used by some of the tests.
5298 ("util-linux" ,util-linux)))
5299 (inputs `(("talloc" ,talloc)))
674495b7 5300 (home-page "https://github.com/proot-me/PRoot")
62b28c0e
LC
5301 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5302 (description
5303 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5304and @code{binfmt_misc}. This means that users don't need any privileges or
5305setup to do things like using an arbitrary directory as the new root
162a1374 5306file system, making files accessible somewhere else in the file system
62b28c0e
LC
5307hierarchy, or executing programs built for another CPU architecture
5308transparently through QEMU user-mode. Also, developers can use PRoot as a
5309generic process instrumentation engine thanks to its extension mechanism.
5310Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5311available in the kernel Linux.")
5312 (license license:gpl2+)))
b9048a14
LC
5313
5314(define-public proot-static
5315 (package
5316 (inherit proot)
5317 (name "proot-static")
5318 (synopsis
5319 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5320 (inputs `(("talloc" ,talloc/static)))
5321 (arguments
5322 (substitute-keyword-arguments (package-arguments proot)
5323 ((#:make-flags flags)
5324 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5325 ((#:phases phases)
5326 `(modify-phases ,phases
5327 (add-after 'strip 'remove-store-references
5328 (lambda* (#:key outputs #:allow-other-keys)
5329 (let* ((out (assoc-ref outputs "out")))
5330 (with-directory-excursion out
5331 (remove-store-references "bin/proot")
5332 #t))))))
5333 ((#:allowed-references _ '("out"))
5334 '("out"))))))
1113386b
CL
5335
5336(define-public cpuid
5337 (package
5338 (name "cpuid")
ad21323c 5339 (version "20180519")
1113386b
CL
5340 (source (origin
5341 (method url-fetch)
5342 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5343 version ".src.tar.gz"))
5344 (sha256
5345 (base32
ad21323c 5346 "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
1113386b
CL
5347 (build-system gnu-build-system)
5348 (arguments
5349 '(#:make-flags '("CC=gcc")
fb9232d7 5350 #:tests? #f ; no tests
1113386b 5351 #:phases (modify-phases %standard-phases
fb9232d7 5352 (delete 'configure) ; no configure script
1113386b
CL
5353 (add-before 'install 'fix-makefile
5354 (lambda* (#:key outputs #:allow-other-keys)
5355 (substitute* "Makefile"
5356 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5357 ;; Make the compressed manpages writable so that the
5358 ;; reset-gzip-timestamps phase does not error out.
5359 (substitute* "Makefile"
5360 (("-m 444") "-m 644"))
5361 #t)))))
5362 (inputs `(("perl" ,perl)))
5363 (supported-systems '("i686-linux" "x86_64-linux"))
5364 (home-page "http://www.etallen.com/cpuid.html")
5365 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5366 (description "cpuid dumps detailed information about the CPU(s) gathered
5367from the CPUID instruction, and also determines the exact model of CPU(s). It
5368supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5369NexGen, Rise, and SiS CPUs.")
5370 (license license:gpl2+)))
afc9d8ec
LF
5371
5372(define-public jmtpfs
5373 (package
5374 (name "jmtpfs")
5375 (version "0.5")
5376 (source
5377 (origin
5378 (method url-fetch)
5379 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5380 version ".tar.gz"))
5381 (file-name (string-append name "-" version ".tar.gz"))
5382 (sha256
5383 (base32
5384 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5385 (build-system gnu-build-system)
5386 (inputs
5387 `(("file" ,file)
5388 ("fuse" ,fuse)
5389 ("libmtp" ,libmtp)))
5390 (native-inputs
5391 `(("pkg-config" ,pkg-config)))
5392 (home-page "https://github.com/JasonFerrara/jmtpfs")
162a1374
TGR
5393 (synopsis "Use a FUSE file system to access data over MTP")
5394 (description "jmtpfs uses FUSE (file system in userspace) to provide access
afc9d8ec 5395to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
162a1374 5396the MTP device as a file system.")
afc9d8ec 5397 (license license:gpl3)))
a73e7dd3
DL
5398
5399(define-public procenv
5400 (package
5401 (name "procenv")
cb9b1a04 5402 (version "0.50")
a73e7dd3
DL
5403 (source
5404 (origin
5405 (method url-fetch)
5406 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5407 version ".tar.gz"))
5408 (file-name (string-append name "-" version ".tar.gz"))
5409 (sha256
cb9b1a04 5410 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
a73e7dd3
DL
5411 (build-system gnu-build-system)
5412 (arguments `(#:configure-flags '("--disable-silent-rules")))
86574116 5413 (native-inputs `(("pkg-config" ,pkg-config)))
a73e7dd3
DL
5414 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5415 ("groff" ,groff) ; for tests
5416 ("libselinux" ,libselinux)))
5417 (synopsis "Utility to show process environment")
5418 (description "Procenv is a command-line tool that displays as much detail about
5419itself and its environment as possible. It can be used as a test
5420tool, to understand the type of environment a process runs in, and for
5421comparing system environments.")
5422 (home-page "http://github.com/jamesodhunt/procenv/")
5423 (license license:gpl3+)))
ae5947b0
DL
5424
5425(define-public libfabric
5426 (package
5427 (name "libfabric")
5428 (version "1.4.1")
5429 (source
5430 (origin
5431 (method url-fetch)
5432 (uri
5433 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5434 version "/libfabric-" version ".tar.bz2"))
5435 (sha256
5436 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5437 (build-system gnu-build-system)
5438 (inputs `(("rdma-core" ,rdma-core)
91298042
EF
5439 ,@(match (%current-system)
5440 ((member (package-supported-systems psm))
5441 `(("psm" ,psm)))
5442 (_ `()))
ae5947b0
DL
5443 ("libnl" ,libnl)))
5444 (home-page "https://ofiwg.github.io/libfabric/")
5445 (synopsis "Open Fabric Interfaces")
5446 (description
5447 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5448communication services to applications. OFI is best described as a collection
5449of libraries and applications used to export fabric services. The key
5450components of OFI are: application interfaces, provider libraries, kernel
5451services, daemons, and test applications.
5452
5453Libfabric is a core component of OFI. It is the library that defines and
5454exports the user-space API of OFI, and is typically the only software that
5455applications deal with directly. It works in conjunction with provider
5456libraries, which are often integrated directly into libfabric.")
5457 (license (list license:bsd-2 license:gpl2)))) ;dual
fd23d259
DL
5458
5459(define-public psm
5460 (package
5461 (name "psm")
5462 (version "3.3.20170428")
b50a9cc0 5463 (home-page "https://github.com/intel/psm")
fd23d259
DL
5464 (source
5465 (origin
5466 (method git-fetch)
b50a9cc0 5467 (uri (git-reference (url home-page)
fd23d259
DL
5468 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5469 (file-name (string-append "psm-" version ".tar.gz"))
5470 (sha256
5471 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5472 (patches (search-patches
5473 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5474 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5475 "psm-repro.patch")))) ; reproducibility
5476 (build-system gnu-build-system)
5477 (inputs `(("libuuid" ,util-linux)))
5478 (arguments
5479 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5480 ,(string-append "INSTALL_PREFIX=" %output)
5481 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5482 #:tests? #f
5483 #:phases (modify-phases %standard-phases
5484 (delete 'configure)
5485 (add-after 'unpack 'patch-/usr/include
5486 (lambda _
5487 (substitute* "Makefile"
5488 (("\\$\\{DESTDIR}/usr/include")
5489 (string-append %output "/include")))
5490 (substitute* "Makefile"
5491 (("/lib64") "/lib"))
41313ace
EB
5492 #t))
5493 (add-after 'unpack 'patch-sysmacros
5494 (lambda _
5495 (substitute* "ipath/ipath_proto.c"
5496 (("#include <sys/poll.h>" m)
5497 (string-append m "\n"
5498 "#include <sys/sysmacros.h>")))
fd23d259 5499 #t)))))
fd23d259
DL
5500 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5501 (description
5502 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5503communications interface for the True Scale family of products. PSM users are
5504enabled with mechanisms necessary to implement higher level communications
5505interfaces in parallel environments.")
b516b780
EF
5506 ;; Only Intel-compatable processors are supported.
5507 (supported-systems '("i686-linux" "x86_64-linux"))
fd23d259 5508 (license (list license:bsd-2 license:gpl2)))) ;dual
c1c82584
TGR
5509
5510(define-public snapscreenshot
5511 (package
5512 (name "snapscreenshot")
5513 (version "1.0.14.3")
5514 (source
5515 (origin
5516 (method url-fetch)
5517 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5518 name "-" version ".tar.bz2"))
5519 (sha256
5520 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5521 (build-system gnu-build-system)
5522 (arguments
5523 `(#:make-flags
5524 (let ((out (assoc-ref %outputs "out")))
5525 (list (string-append "BINDIR=" out "/bin")
5526 (string-append "MANDIR=" out "/share/man")))
5527 #:tests? #f ; no test suite
5528 #:phases
5529 (modify-phases %standard-phases
5530 (delete 'configure) ; ./configure is a snarky no-op
5531 (add-before 'install 'fix-ownership
5532 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5533 (lambda _
5534 (substitute* "depfun.mak"
5535 ((" -o bin -g bin ") " "))
5536 #t))
5537 (add-before 'install 'create-output-directories
5538 (lambda* (#:key outputs #:allow-other-keys)
5539 (let ((out (assoc-ref outputs "out")))
5540 (mkdir-p (string-append out "/share/man/man1"))
5541 #t))))))
81e59e41 5542 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
c1c82584
TGR
5543 (synopsis "Take screenshots of one or more Linux text consoles")
5544 (description
5545 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
5546Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
5547relevant @file{/dev/vcs*} file(s).")
5548 (license license:gpl2)))
8d8d227b
TGR
5549
5550(define-public fbcat
5551 (package
5552 (name "fbcat")
7f86e5e7 5553 (version "0.5.1")
8d8d227b
TGR
5554 (source
5555 (origin
5556 (method url-fetch)
5557 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
5558 version "/" name "-" version ".tar.gz"))
5559 (sha256
7f86e5e7 5560 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
8d8d227b 5561 (build-system gnu-build-system)
8d8d227b
TGR
5562 (inputs
5563 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
5564 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
5565 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
5566 `(("pnmtopng" ,netpbm)))
5567 (outputs (list "out" "fbgrab"))
5568 (arguments
7f86e5e7
TGR
5569 `(#:make-flags
5570 (list "CC=gcc"
5571 (string-append "PREFIX=" (assoc-ref %outputs "out")))
8d8d227b
TGR
5572 #:tests? #f ; no tests
5573 #:phases
5574 (modify-phases %standard-phases
8d8d227b 5575 (delete 'configure) ; no configure script
8d8d227b
TGR
5576 (add-after 'build 'qualify-references
5577 (lambda* (#:key inputs outputs #:allow-other-keys)
5578 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5579 (out (assoc-ref outputs "out")))
5580 (substitute* "fbgrab"
5581 (("fbcat" all)
5582 (string-append out "/bin/" all))
5583 (("pnmtopng" all)
5584 (string-append pnmtopng "/bin/" all)))
5585 #t)))
7f86e5e7 5586 (add-after 'install 'split-fbgrab-output
8d8d227b
TGR
5587 (lambda* (#:key outputs #:allow-other-keys)
5588 (let* ((out (assoc-ref outputs "out"))
5589 (out:fbgrab (assoc-ref outputs "fbgrab")))
7f86e5e7
TGR
5590 (for-each (lambda (file)
5591 (let ((old (string-append out "/" file))
5592 (new (string-append out:fbgrab "/" file)))
5593 (mkdir-p (dirname new))
5594 (rename-file old new)))
5595 (list "bin/fbgrab"
5596 "share/man/man1/fbgrab.1"))
8d8d227b
TGR
5597 #t))))))
5598 (home-page "https://jwilk.net/software/fbcat")
5599 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
5600 (description
5601 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
5602a dump therof. It supports a wide range of drivers and pixel formats.
5603@command{fbcat} can take screenshots of virtually any application that can be
5604made to write its output to the framebuffer, including (but not limited to)
5605text-mode or graphical applications that don't use a display server.
5606
5607Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
5608emulates the behaviour of Gunnar Monell's older fbgrab utility.")
5609 (license license:gpl2)))
a69e0cf3
5610
5611(define-public libcgroup
5612 (package
5613 (name "libcgroup")
5614 (version "0.41")
5615 (source
5616 (origin
5617 (method url-fetch)
5618 (uri (string-append
5619 "mirror://sourceforge/libcg/" name "/"
5620 version "/" name "-" version ".tar.bz2"))
5621 (sha256
5622 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
5623 (build-system gnu-build-system)
5624 (arguments
5625 `(#:tests? #f))
5626 (native-inputs
5627 `(("bison" ,bison)
5628 ("flex" ,flex)))
5629 (inputs
5630 `(("linux-pam" ,linux-pam)))
5631 (home-page "https://sourceforge.net/projects/libcg/")
5632 (synopsis "Control groups management tools")
5633 (description "Control groups is Linux kernel method for process resource
5634restriction, permission handling and more. This package provides userspace
5635interface to this kernel feature.")
5636 (license license:lgpl2.1)))
5849c68a
R
5637
5638(define-public mbpfan
5639 (package
5640 (name "mbpfan")
26fad5b7 5641 (version "2.1.1")
5849c68a
R
5642 (source
5643 (origin
5478ab1e
TGR
5644 (method git-fetch)
5645 (uri (git-reference
5646 (url "https://github.com/dgraziotin/mbpfan.git")
5647 (commit (string-append "v" version))))
5648 (file-name (git-file-name name version))
5849c68a 5649 (sha256
26fad5b7 5650 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5849c68a
R
5651 (build-system gnu-build-system)
5652 (arguments
697c5846 5653 '(#:tests? #f ; tests ask to be run as root
5849c68a
R
5654 #:make-flags (let ((out (assoc-ref %outputs "out")))
5655 (list (string-append "DESTDIR=" out)
5656 "CC=gcc"))
5657 #:phases
5658 (modify-phases %standard-phases
5659 (add-after 'unpack 'patch-paths
5660 (lambda _
5661 (substitute* "Makefile"
5662 (("/usr") ""))
5663 #t))
697c5846 5664 (delete 'configure)))) ; there's no configure phase
5849c68a
R
5665 (home-page "https://github.com/dgraziotin/mbpfan")
5666 (synopsis "Control fan speed on Macbooks")
5667 (description
5668 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
5669the @code{coretemp} module and sets the fan speed using the @code{applesmc}
5670module. It can be executed as a daemon or in the foreground with root
5671privileges.")
5672 (license license:gpl3+)))
25637b77
PAR
5673
5674(define-public psm2
5675 (package
5676 (name "psm2")
5677 (version "10.3-46")
5678 (source (origin
5679 (method git-fetch)
5680 (uri (git-reference
5681 (url "https://github.com/intel/opa-psm2.git")
5682 (commit (string-append "PSM2_" version))))
5683 (file-name (git-file-name name version))
5684 (sha256
5685 (base32
5686 "0wadphv4rl5p38x6a3dgpbijlzqdvcn02cfafnp72nh9faz0zvlx"))))
5687 (build-system gnu-build-system)
5688 (arguments
5689 '(#:make-flags
5690 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5691 #:tests? #f
5692 #:phases (modify-phases %standard-phases
5693 (delete 'configure)
5694 (add-after 'unpack 'patch-Makefiles
5695 (lambda _
5696 (substitute* "Makefile"
5697 (("/lib64") "/lib")
5698 (("/usr") ""))
5699 (substitute* "compat/Makefile"
5700 (("/lib64") "/lib")
5701 (("/usr") ""))
5702 #t))
5703 (replace 'install
5704 (lambda _
5705 (setenv "DESTDIR" %output)
5706 (invoke "make" "install")
5707 #t)))))
5708 (inputs
5709 `(("rdma-core" ,rdma-core)
5710 ("numactl" ,numactl)))
5711 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
5712 (description
5713 "This package is low-level user-level Intel's communications interface.
5714The PSM2 API is a high-performance vendor-specific protocol that provides a
5715low-level communications interface for the Intel Omni-Path family of
5716high-speed networking devices.")
5717 (home-page "https://github.com/intel/opa-psm2")
5718 ;; Only the x86_64 architecure is supported.
5719 (supported-systems '("x86_64-linux"))
5720 (license (list license:bsd-3 license:gpl2)))) ; dual
2690b6ce
PAR
5721
5722(define-public libpfm4
5723 (package
5724 (name "libpfm4")
5725 (version "4.9.0")
5726 (source (origin
5727 (method url-fetch)
5728 (uri (string-append "mirror://sourceforge/perfmon2/"
5729 name "/libpfm-" version ".tar.gz"))
5730 (sha256
5731 (base32
5732 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
5733 (build-system gnu-build-system)
5734 (arguments
5735 '(#:modules ((guix build utils)
5736 (guix build gnu-build-system))
5737 #:phases (modify-phases %standard-phases
5738 (delete 'configure)
5739 (delete 'check)
5740 (replace 'build
5741 (lambda* (#:key inputs outputs #:allow-other-keys)
5742 (let* ((out (assoc-ref outputs "out")))
5743 (setenv "CC" "gcc")
5744 (invoke "make")
5745 #t)))
5746 (replace 'install
5747 (lambda* (#:key outputs #:allow-other-keys)
5748 (let* ((out (assoc-ref outputs "out")))
5749 (invoke "make"
5750 (string-append "PREFIX=" out)
5751 "install")
5752 #t))))))
5753 (synopsis "Performance event monitoring library")
5754 (description
5755 "This package provides a library called libpfm4, which is used to develop
5756monitoring tools exploiting the performance monitoring events such as those
5757provided by the Performance Monitoring Unit (PMU) of modern processors.
5758
5759Libpfm4 helps convert from an event name, expressed as a string, to the event
5760encoding that is either the raw event as documented by the hardware vendor or
5761the OS-specific encoding. In the latter case, the library is able to prepare
5762the OS-specific data structures needed by the kernel to setup the event.
5763
5764libpfm4 provides support for the @code{perf_events} interface, which was
5765introduced in Linux 2.6.31.")
5766 (home-page "http://perfmon2.sourceforge.net/")
5767 (license license:expat)))
4dd1fb79
SB
5768
5769(define-public libnfnetlink
5770 (package
5771 (name "libnfnetlink")
5772 (version "1.0.1")
5773 (source (origin
5774 (method url-fetch)
5775 (uri (string-append
5776 "https://www.netfilter.org/projects/libnfnetlink/files/"
5777 "libnfnetlink-" version ".tar.bz2"))
5778 (sha256
5779 (base32
5780 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
5781 (build-system gnu-build-system)
5782 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
5783 (synopsis "Low-level netfilter netlink communication library")
5784 (description
5785 "@code{libnfnetlink} is the low-level library for netfilter related
5786kernel/userspace communication. It provides a generic messaging
5787infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
5788nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
5789management tools in userspace.")
5790 (license license:gpl2)))
e4231cfe 5791
626de0d1
MC
5792(define-public go-netlink
5793 (package
5794 (name "go-netlink")
5795 (version "1.0.0")
5796 (source (origin
5797 (method git-fetch)
5798 (uri (git-reference
5799 (url "https://github.com/vishvananda/netlink.git")
5800 (commit (string-append "v" version))))
5801 (file-name (git-file-name name version))
5802 (sha256
5803 (base32
5804 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
5805 (build-system go-build-system)
5806 (arguments
5807 `(#:import-path "github.com/vishvananda/netlink"))
5808 (native-inputs
5809 `(("go-golang-org-x-sys-unix" ,go-golang-org-x-sys-unix)
5810 ("go-netns" ,go-netns)))
5811 (home-page "https://github.com/vishvananda/netlink")
5812 (synopsis "Simple netlink library for Go")
5813 (description "The netlink package provides a simple netlink library for
5814Go. Netlink is the interface a user-space program in Linux uses to
5815communicate with the kernel. It can be used to add and remove interfaces, set
5816IP addresses and routes, and configure IPsec.")
5817 (license license:asl2.0)))
5818
e4231cfe
DM
5819(define-public xfsprogs
5820 (package
5821 (name "xfsprogs")
9e6008b7 5822 (version "4.20.0")
e4231cfe
DM
5823 (source (origin
5824 (method url-fetch)
5825 (uri (string-append
5826 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
5827 "xfsprogs-" version ".tar.gz"))
5828 (sha256
5829 (base32
9e6008b7 5830 "0ss0r6jlxxinf9fhpc0fgf7b89n9mzirpa85xxjmi1ix9l6cls6x"))))
e4231cfe
DM
5831 (build-system gnu-build-system)
5832 (arguments
2f2ef9d9
MB
5833 `(#:tests? #f ;kernel/user integration tests are in package "xfstests"
5834 #:phases (modify-phases %standard-phases
5835 (add-after 'install 'install-headers
5836 (lambda _
5837 (invoke "make" "install-dev"))))))
e4231cfe
DM
5838 (native-inputs
5839 `(("gettext" ,gettext-minimal)
5840 ("util-linux" ,util-linux)))
5841 (home-page "https://xfs.wiki.kernel.org/")
5842 (synopsis "XFS file system tools")
5843 (description "This package provides commands to create and check XFS
5844file systems.")
5845 ;; The library "libhandle" and the headers in "xfslibs-dev" are
5846 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
5847 (license (list license:gpl2 license:lgpl2.1))))
c63d7b79
DM
5848
5849(define-public genext2fs
5850 (package
5851 (name "genext2fs")
083639a5 5852 (version "1.4.1-4")
c63d7b79
DM
5853 (source (origin
5854 (method git-fetch)
5855 (uri (git-reference
5856 (url "https://github.com/jeremie-koenig/genext2fs.git")
083639a5
TGR
5857 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
5858 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
c63d7b79
DM
5859 (file-name (git-file-name name version))
5860 (sha256
083639a5 5861 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
c63d7b79 5862 (build-system gnu-build-system)
083639a5
TGR
5863 (arguments
5864 `(#:phases
5865 (modify-phases %standard-phases
5866 (add-after 'unpack 'apply-debian-patches
5867 ;; Debian changes (the revision after ‘-’ in VERSION) are
5868 ;; maintained as separate patches. Apply those relevant to us.
5869 (lambda _
5870 (for-each
5871 (lambda (file-name)
5872 (invoke "patch" "-p1" "-i"
5873 (string-append "debian/patches/" file-name)))
5874 (list "blocksize+creator.diff" ; add -B/-o options
5875 "byteswap_fix.diff"))
5876 #t)))))
5877 (native-inputs
5878 `(("autoconf" ,autoconf)
5879 ("automake" ,automake)))
c63d7b79 5880 (home-page "https://github.com/jeremie-koenig/genext2fs")
52beae7b
TGR
5881 (synopsis "Generate ext2 file system as a normal user")
5882 (description "This package provides a program to generate an ext2
5883file system as a normal (non-root) user. It does not require you to mount
c63d7b79
DM
5884the image file to copy files on it, nor does it require that you become
5885the superuser to make device nodes.")
5886 (license license:gpl2)))
d1dfcc7c
DM
5887
5888(define-public fakeroot
5889 (package
5890 (name "fakeroot")
ae1bab3e 5891 (version "1.24")
d1dfcc7c
DM
5892 (source (origin
5893 (method url-fetch)
ae1bab3e
TGR
5894 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
5895 "fakeroot/fakeroot_" version ".orig.tar.gz"))
d1dfcc7c
DM
5896 (file-name (string-append name "-" version ".tar.gz"))
5897 (sha256
5898 (base32
ae1bab3e 5899 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
d1dfcc7c
DM
5900 (build-system gnu-build-system)
5901 (arguments
5902 `(#:phases
5903 (modify-phases %standard-phases
5904 (add-after 'configure 'patch-Makefile
5905 (lambda _
5906 ;; Note: The root of the problem is already in "Makefile.am".
5907 (substitute* "Makefile"
5908 (("/bin/sh") (which "sh")))
5909 #t))
5910 (add-after 'unpack 'patch-getopt
5911 (lambda* (#:key inputs #:allow-other-keys)
5912 (substitute* "scripts/fakeroot.in"
5913 (("getopt")
5914 (string-append (assoc-ref inputs "util-linux")
5915 "/bin/getopt")))
5916 #t))
0d5c5b1b
DM
5917 (add-before 'configure 'setenv
5918 (lambda _
5919 (setenv "LIBS" "-lacl")
5920 #t))
d1dfcc7c
DM
5921 (add-before 'check 'prepare-check
5922 (lambda _
5923 (setenv "SHELL" (which "bash"))
5924 (setenv "VERBOSE" "1")
5925 (substitute* "test/t.touchinstall"
5926 ;; We don't have the name of the root user, so use ID=0.
5927 (("grep root") "grep \"\\<0\\>\""))
5928 (substitute* "test/tartest"
5929 ;; We don't have the name of the root group, so use ID=0.
5930 (("ROOTGROUP=root") "ROOTGROUP=0")
5931 ;; We don't have the name of the daemon user, so use IDs.
5932 (("daemon:sys") "1:3")
5933 (("daemon:") "1:"))
5934 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
5935 (substitute* "test/compare-tar"
5936 (("tar -tvf") "tar --numeric-owner -tvf"))
5937 #t)))))
5938 (native-inputs
0d5c5b1b
DM
5939 `(("acl" ,acl)
5940 ("sharutils" ,sharutils) ; for the tests
d1dfcc7c
DM
5941 ("xz" ,xz))) ; for the tests
5942 (inputs
5943 `(("libcap" ,libcap)
5944 ("util-linux" ,util-linux)))
5945 (synopsis "Provides a fake root environment")
5946 (description "@command{fakeroot} runs a command in an environment where
5947it appears to have root privileges for file manipulation. This is useful
5948for allowing users to create archives (tar, ar, .deb etc.) with files in
5949them with root permissions/ownership. Without fakeroot one would have to
5950have root privileges to create the constituent files of the archives with
5951the correct permissions and ownership, and then pack them up, or one would
5952have to construct the archives directly, without using the archiver.")
5953 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
5954 (license license:gpl3+)))
bf2a9969
TG
5955
5956(define-public inputattach
5957 (package
5958 (name "inputattach")
5959 (version "0.42.0")
5960 (source (origin
5961 (method git-fetch)
5962 (uri (git-reference
5963 (url "https://github.com/linuxwacom/input-wacom.git")
5964 (commit (string-append "input-wacom-" version))))
5965 (file-name (git-file-name name version))
5966 (sha256
5967 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
5968 (build-system gnu-build-system)
5969 (arguments
5970 `(#:phases
5971 (modify-phases %standard-phases
5972 (delete 'bootstrap)
5973 (delete 'configure)
5974 (replace 'build
5975 (lambda* (#:key inputs #:allow-other-keys)
5976 (with-directory-excursion "inputattach"
5977 (invoke (string-append (assoc-ref inputs "gcc")
5978 "/bin/gcc")
5ddf98da 5979 "-O2" "-o" "inputattach" "inputattach.c"))
bf2a9969
TG
5980 #t))
5981 (delete 'check)
5982 (replace 'install
5983 (lambda* (#:key outputs #:allow-other-keys)
5984 (let ((target-dir (string-append
5985 (assoc-ref outputs "out")
5986 "/bin/")))
5987 (mkdir-p target-dir)
5988 (copy-file "inputattach/inputattach"
5989 (string-append target-dir
5990 "inputattach"))
5991 #t))))))
5992 (home-page "https://linuxwacom.github.io/")
5993 (synopsis "Dispatch input peripherals events to a device file")
5994 (description "inputattach dispatches input events from several device
5995types and interfaces and translates so that the X server can use them.")
5996 (license license:gpl2+)))
de3896fb
BW
5997
5998(define-public ell
5999 (package
6000 (name "ell")
6001 (version "0.23")
6002 (source (origin
6003 (method git-fetch)
6004 (uri (git-reference
6005 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6006 (commit version)))
6007 (file-name (git-file-name name version))
6008 (sha256
6009 (base32
6010 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6011 (build-system gnu-build-system)
6012 (arguments
6013 `(#:phases
6014 (modify-phases %standard-phases
6015 (add-after 'unpack 'fix-dbus-tests
6016 (lambda _
6017 (substitute* '("unit/test-dbus-message-fds.c"
6018 "unit/test-dbus-properties.c"
6019 "unit/test-dbus.c")
6020 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6021 #t)))))
6022 (inputs
6023 `(("dbus" ,dbus)
6024 ("libtool" ,libtool)))
6025 (native-inputs
6026 `(("autoconf" ,autoconf)
6027 ("pkgconfig" ,pkg-config)
6028 ("automake" ,automake)))
6029 (home-page "https://01.org/ell")
6030 (synopsis "Embedded Linux Library")
6031 (description "The Embedded Linux* Library (ELL) provides core, low-level
6032functionality for system daemons. It typically has no dependencies other than
6033the Linux kernel, C standard library, and libdl (for dynamic linking). While
6034ELL is designed to be efficient and compact enough for use on embedded Linux
6035platforms, it is not limited to resource-constrained systems.")
6036 (license license:lgpl2.1+)))