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