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