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