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