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