gnu: instantmusic: Fix build failure.
[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)
3085 (setenv "SHELL_PATH" (which "bash"))
3086 (chdir "tools/perf")
3087 #t)))
65dabe4e 3088 #:make-flags (list (string-append "prefix="
b62fe07f 3089 (assoc-ref %outputs "out"))
2af29d23
LC
3090 "WERROR=0"
3091
3092 ;; By default, 'config/Makefile' uses lib64 on
3093 ;; x86_64. Work around that.
3094 "lib=lib")
b62fe07f
LC
3095 #:tests? #f)) ;no tests
3096 (native-inputs
3097 `(("pkg-config" ,pkg-config)
3098 ("bison" ,bison)
3099 ("flex" ,flex)
3100
3101 ;; There are build scripts written in these languages.
3102 ("perl" ,perl)
3103 ("python" ,python-2)))
3104 (inputs
b1fb4b23 3105 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 3106 ;; ("newt" ,newt)
6c030d10 3107 ("python" ,python-2) ;'perf' links against libpython
b62fe07f 3108 ("elfutils" ,elfutils)
b25d3bd9 3109 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
1d484507
LC
3110 ("libunwind" ,libunwind) ;better stack walking
3111 ("numactl" ,numactl) ;for 'perf bench numa mem'
b62fe07f 3112
d7ece67a
LC
3113 ;; Documentation.
3114 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
d7ece67a
LC
3115 ("docbook-xsl" ,docbook-xsl)
3116 ("xmlto" ,xmlto)
3117 ("asciidoc" ,asciidoc)))
b62fe07f
LC
3118 (home-page "https://perf.wiki.kernel.org/")
3119 (synopsis "Linux profiling with performance counters")
3120 (description
3121 "perf is a tool suite for profiling using hardware performance counters,
3122with support in the Linux kernel. perf can instrument CPU performance
3123counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3124of lightweight profiling. This package contains the user-land tools and in
36a4366d 3125particular the @code{perf} command.")
b62fe07f 3126 (license (package-license linux-libre))))
c09e60e4
DT
3127
3128(define-public pflask
3129 (package
3130 (name "pflask")
3131 (version "0.2")
3132 (source (origin
3133 (method url-fetch)
3134 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3135 version ".tar.gz"))
f586c877 3136 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
3137 (sha256
3138 (base32
3139 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3140 (build-system cmake-build-system)
3141 (arguments
3142 '(#:tests? #f)) ; no tests
81e59e41 3143 (home-page "https://ghedo.github.io/pflask/")
c09e60e4
DT
3144 (synopsis "Simple tool for creating Linux namespace containers")
3145 (description "pflask is a simple tool for creating Linux namespace
3146containers. It can be used for running a command or even booting an OS inside
3147an isolated container, created with the help of Linux namespaces. It is
3148similar in functionality to chroot, although pflask provides better isolation
3149thanks to the use of namespaces.")
3ac73271 3150 (license license:bsd-2)))
288084d5 3151
3ec07ced
RW
3152(define-public singularity
3153 (package
3154 (name "singularity")
edc6dd03 3155 (version "2.6.1")
3ec07ced
RW
3156 (source (origin
3157 (method url-fetch)
3158 (uri (string-append "https://github.com/singularityware/singularity/"
3159 "releases/download/" version
3160 "/singularity-" version ".tar.gz"))
3161 (sha256
3162 (base32
fbf26cbc
LC
3163 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3164 (modules '((guix build utils)))
3165 (snippet
3166 '(begin
3167 ;; Do not create directories in /var.
3168 (substitute* "Makefile.in"
3169 (("\\$\\(MAKE\\) .*install-data-hook") ""))
af857579
LC
3170
3171 ;; The original source overrides PATH so that it points to
3172 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3173 ;; on Guix System. Leave PATH unchanged so we refer to the
3174 ;; installed Coreutils, grep, etc.
3175 (substitute* "bin/singularity.in"
3176 (("^PATH=.*" all)
3177 (string-append "#" all "\n")))
08814aec
LC
3178
3179 (substitute* (find-files "libexec/cli" "\\.exec$")
3180 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3181 _ program)
3182 (string-append "/run/setuid-programs/singularity-"
3183 program "-helper")))
fbf26cbc 3184 #t))))
3ec07ced
RW
3185 (build-system gnu-build-system)
3186 (arguments
08814aec 3187 `(#:configure-flags '("--localstatedir=/var")
3ec07ced
RW
3188 #:phases
3189 (modify-phases %standard-phases
3ec07ced
RW
3190 (add-after 'unpack 'patch-reference-to-squashfs-tools
3191 (lambda _
3192 (substitute* "libexec/cli/build.exec"
3193 (("if ! singularity_which mksquashfs") "if 0")
3194 (("if ! mksquashfs")
3195 (string-append "if ! " (which "mksquashfs"))))
3196 #t)))))
3197 (inputs
3198 `(("libarchive" ,libarchive)
3199 ("python" ,python-wrapper)
3ec07ced
RW
3200 ("zlib" ,zlib)
3201 ("squashfs-tools" ,squashfs-tools)))
3202 (home-page "https://singularity.lbl.gov/")
3203 (synopsis "Container platform")
3204 (description "Singularity is a container platform supporting a number of
3205container image formats. It can build SquashFS container images or import
3206existing Docker images. Singularity requires kernel support for container
3207isolation or root privileges.")
3208 (license license:bsd-3)))
3209
288084d5
MW
3210(define-public hdparm
3211 (package
3212 (name "hdparm")
abb90ff9 3213 (version "9.58")
288084d5
MW
3214 (source (origin
3215 (method url-fetch)
1b1ef87e
TGR
3216 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3217 "hdparm-" version ".tar.gz"))
288084d5
MW
3218 (sha256
3219 (base32
abb90ff9 3220 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
288084d5
MW
3221 (build-system gnu-build-system)
3222 (arguments
3223 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3224 (list (string-append "binprefix=" out)
3225 (string-append "manprefix=" out)
3226 "CC=gcc"))
ec238332
TGR
3227 #:phases
3228 (modify-phases %standard-phases
3229 (delete 'configure)) ; no configure script
3230 #:tests? #f)) ; no test suite
3b3b60d0 3231 (home-page "https://sourceforge.net/projects/hdparm/")
02052b2c 3232 (synopsis "View and tune ATA disk drive parameters")
288084d5 3233 (description
02052b2c
TGR
3234 "@command{hdparm} is a command-line utility to control ATA controllers and
3235disk drives. It can increase performance and/or reliability by careful tuning
3236of hardware settings like power and acoustic management, DMA modes, and caching.
3237It can also display detailed device information, or be used as a simple
3238performance benchmarking tool.
3239
3240@command{hdparm} provides a command line interface to various Linux kernel
3241interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
d08be77a
TGR
3242IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3243Translation (@dfn{SAT}) are also supported.")
3ac73271 3244 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 3245
c755c854
MW
3246(define-public rfkill
3247 (package
3248 (name "rfkill")
3249 (version "0.5")
3250 (source (origin
3251 (method url-fetch)
3252 (uri (string-append "mirror://kernel.org/software/network/"
3253 name "/" name "-" version ".tar.xz"))
3254 (sha256
3255 (base32
3256 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3257 (build-system gnu-build-system)
3258 (arguments
3259 `(#:make-flags (list "CC=gcc"
3260 (string-append "PREFIX=" %output))
3261 #:phases (modify-phases %standard-phases
3262 (delete 'configure))
3263 #:tests? #f))
3264 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3265 (synopsis "Tool for enabling and disabling wireless devices")
3266 (description
3267 "rfkill is a simple tool for accessing the rfkill device interface,
3268which is used to enable and disable wireless networking devices, typically
3269WLAN, Bluetooth and mobile broadband.")
3ac73271 3270 (license (license:non-copyleft "file://COPYING"
5146f22b
EF
3271 "See COPYING in the distribution."))
3272 ;; rfkill is part of util-linux as of 2.31.
3273 (properties `((superseded . ,util-linux)))))
c755c854 3274
dc9bdb1e
ML
3275(define-public acpi
3276 (package
3277 (name "acpi")
3278 (version "1.7")
3279 (source (origin
3280 (method url-fetch)
81e59e41 3281 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
de67e922 3282 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
3283 (sha256
3284 (base32
3285 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3286 (build-system gnu-build-system)
3287 (home-page "http://acpiclient.sourceforge.net")
3288 (synopsis "Display information on ACPI devices")
3289 (description "@code{acpi} attempts to replicate the functionality of the
3290\"old\" @code{apm} command on ACPI systems, including battery and thermal
3291information. It does not support ACPI suspending, only displays information
3292about ACPI devices.")
3293 (license license:gpl2+)))
3294
57a516d3
LC
3295(define-public acpid
3296 (package
3297 (name "acpid")
ed7dc857 3298 (version "2.0.31")
57a516d3
LC
3299 (source (origin
3300 (method url-fetch)
3301 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3302 version ".tar.xz"))
3303 (sha256
3304 (base32
ed7dc857 3305 "1hrc0xm6q12knbgzhq0i8g2rfrkwcvh1asd7k9rs3nc5xmlwd7gw"))))
57a516d3 3306 (build-system gnu-build-system)
3b3b60d0 3307 (home-page "https://sourceforge.net/projects/acpid2/")
57a516d3
LC
3308 (synopsis "Daemon for delivering ACPI events to user-space programs")
3309 (description
3310 "acpid is designed to notify user-space programs of Advanced
3311Configuration and Power Interface (ACPI) events. acpid should be started
3312during the system boot, and will run as a background process. When an ACPI
3313event is received from the kernel, acpid will examine the list of rules
3314specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 3315 (license license:gpl2+)))
37f5caec
TUBK
3316
3317(define-public sysfsutils
3318 (package
3319 (name "sysfsutils")
3320 (version "2.1.0")
3321 (source
3322 (origin
3323 (method url-fetch)
3324 (uri
3325 (string-append
3326 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3327 version ".tar.gz"))
3328 (sha256
3329 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3330 (build-system gnu-build-system)
3331 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3332 (synopsis "System utilities based on Linux sysfs")
3333 (description
8f65585b 3334 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
3335Linux kernel versions 2.5+ that exposes a system's device tree. The package
3336also contains the libsysfs library.")
3337 ;; The library is under lgpl2.1+ (all files say "or any later version").
3338 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 3339 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
3340
3341(define-public sysfsutils-1
3342 (package
3343 (inherit sysfsutils)
3344 (version "1.3.0")
3345 (source
3346 (origin
3347 (method url-fetch)
3348 (uri
3349 (string-append
3350 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3351 "/sysfsutils-" version ".tar.gz"))
3352 (sha256
3353 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3354 (modules '((guix build utils)))
3355 (snippet
3356 '(begin
3357 (substitute* "Makefile.in"
3358 (("includedir = /usr/include/sysfs")
3359 "includedir = @includedir@"))
3360 (substitute* "configure"
3361 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
6cbee49d
MW
3362 (string-append "includedir='" orig "/sysfs'")))
3363 #t))))
a9a1a40b 3364 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
3365
3366(define-public cpufrequtils
3367 (package
3368 (name "cpufrequtils")
3369 (version "0.3")
3370 (source
3371 (origin
3372 (method url-fetch)
18160c34
MB
3373 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3374 "cpufrequtils-" version ".tar.gz"))
e6caa52d
TUBK
3375 (sha256
3376 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 3377 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
3378 (build-system gnu-build-system)
3379 (native-inputs
3380 `(("sysfsutils" ,sysfsutils-1)))
3381 (arguments
3382 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3383 (assoc-ref %outputs "out") "/lib"))))
3384 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3385 (synopsis "Utilities to get and set CPU frequency on Linux")
3386 (description
e881752c 3387 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
3388information, and set the CPU frequency if supported, using the cpufreq
3389capabilities of the Linux kernel.")
3ac73271 3390 (license license:gpl2)))
0a588bf9
SB
3391
3392(define-public libraw1394
3393 (package
3394 (name "libraw1394")
7c58c852 3395 (version "2.1.2")
0a588bf9
SB
3396 (source (origin
3397 (method url-fetch)
3398 (uri (string-append
3399 "mirror://kernel.org/linux/libs/ieee1394/"
3400 name "-" version ".tar.xz"))
3401 (sha256
3402 (base32
7c58c852 3403 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
0a588bf9
SB
3404 (build-system gnu-build-system)
3405 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3406 (synopsis "Interface library for the Linux IEEE1394 drivers")
3407 (description
3408 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3409the Linux IEEE-1394 subsystem, which provides direct access to the connected
34101394 buses to user space. Through libraw1394/raw1394, applications can directly
3411send to and receive from other nodes without requiring a kernel driver for the
3412protocol in question.")
3ac73271 3413 (license license:lgpl2.1+)))
68e3c29d
SB
3414
3415(define-public libavc1394
3416 (package
3417 (name "libavc1394")
3418 (version "0.5.4")
3419 (source (origin
3420 (method url-fetch)
de67e922 3421 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
3422 name "-" version ".tar.gz"))
3423 (sha256
3424 (base32
3425 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3426 (build-system gnu-build-system)
3427 (native-inputs
3428 `(("pkg-config" ,pkg-config)))
3429 (propagated-inputs
3430 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3b3b60d0 3431 (home-page "https://sourceforge.net/projects/libavc1394/")
68e3c29d
SB
3432 (synopsis "AV/C protocol library for IEEE 1394")
3433 (description
3434 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 3435the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 3436 (license license:lgpl2.1+)))
3f7bf86a
SB
3437
3438(define-public libiec61883
3439 (package
3440 (name "libiec61883")
3441 (version "1.2.0")
3442 (source (origin
3443 (method url-fetch)
3444 (uri (string-append
3445 "mirror://kernel.org/linux/libs/ieee1394/"
3446 name "-" version ".tar.xz"))
3447 (sha256
3448 (base32
3449 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3450 (build-system gnu-build-system)
3451 (native-inputs
3452 `(("pkg-config" ,pkg-config)))
3453 (propagated-inputs
3454 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3455 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3456 (synopsis "Isochronous streaming media library for IEEE 1394")
3457 (description
3458 "The libiec61883 library provides a higher level API for streaming DV,
3459MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 3460 (license license:lgpl2.1+)))
69159125
MW
3461
3462(define-public mdadm
3463 (package
3464 (name "mdadm")
30288ae5 3465 (version "4.1")
69159125
MW
3466 (source (origin
3467 (method url-fetch)
3468 (uri (string-append
3469 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3470 version ".tar.xz"))
3471 (sha256
3472 (base32
30288ae5 3473 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
69159125
MW
3474 (build-system gnu-build-system)
3475 (inputs
3476 `(("udev" ,eudev)))
3477 (arguments
3478 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
fae88ae8
LC
3479 (list "CC=gcc"
3480 "INSTALL=install"
69159125
MW
3481 "CHECK_RUN_DIR=0"
3482 ;; TODO: tell it where to find 'sendmail'
3483 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3484 (string-append "BINDIR=" out "/sbin")
3485 (string-append "MANDIR=" out "/share/man")
3486 (string-append "UDEVDIR=" out "/lib/udev")))
dc1d3cde
KK
3487 #:phases
3488 (modify-phases %standard-phases
3489 (add-before 'build 'patch-program-paths
3490 (lambda* (#:key inputs #:allow-other-keys)
3491 (let ((coreutils (assoc-ref inputs "coreutils")))
3492 (substitute* "udev-md-raid-arrays.rules"
3493 (("/usr/bin/(readlink|basename)" all program)
3494 (string-append coreutils "/bin/" program))))
3495 #t))
3496 (add-before 'build 'remove-W-error
3497 (lambda _
3498 ;; We cannot build with -Werror on i686 due to a
3499 ;; 'sign-compare' warning in util.c.
3500 (substitute* "Makefile"
3501 (("-Werror") ""))
3502 #t))
3503 (delete 'configure))
69159125
MW
3504 ;;tests must be done as root
3505 #:tests? #f))
3506 (home-page "http://neil.brown.name/blog/mdadm")
3507 (synopsis "Tool for managing Linux Software RAID arrays")
3508 (description
3509 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3510assemble, report on, and monitor arrays. It can also move spares between raid
3511arrays when needed.")
3ac73271 3512 (license license:gpl2+)))
01ccdfb6 3513
631fda7e
LC
3514(define-public mdadm-static
3515 (package
3516 (inherit mdadm)
3517 (name "mdadm-static")
3518 (arguments
3519 (substitute-keyword-arguments (package-arguments mdadm)
3520 ((#:make-flags flags)
3521 `(cons "LDFLAGS = -static" ,flags))
3522 ((#:phases phases)
3523 `(modify-phases ,phases
3524 (add-after 'install 'remove-cruft
3525 (lambda* (#:key outputs #:allow-other-keys)
3526 (let* ((out (assoc-ref outputs "out"))
3527 (precious? (lambda (file)
3528 (member file '("." ".." "sbin"))))
3529 (directories (scandir out (negate precious?))))
3530 (with-directory-excursion out
3531 (for-each delete-file-recursively directories)
3532 (remove-store-references "sbin/mdadm")
3533 (delete-file "sbin/mdmon")
3534 #t))))))
3535 ((#:modules modules %gnu-build-system-modules)
3536 `((ice-9 ftw) ,@modules))
3537 ((#:strip-flags _ '())
3538 ''("--strip-all")) ;strip a few extra KiB
3539 ((#:allowed-references _ '("out"))
3540 '("out")))) ;refer only self
3541 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3542
b3ed50e6
MB
3543(define-public multipath-tools
3544 (package
3545 (name "multipath-tools")
dcc773e5 3546 (version "0.8.2")
b3ed50e6
MB
3547 (source (origin
3548 (method url-fetch)
3e57b7d9 3549 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
b3ed50e6
MB
3550 ".git;a=snapshot;h=" version ";sf=tgz"))
3551 (file-name (string-append name "-" version ".tar.gz"))
3552 (sha256
3553 (base32
dcc773e5 3554 "0kb4mhzwyygdbikikmby6hj39pb3nrzv05v526c75wnycwnpxg31"))
b3ed50e6
MB
3555 (modules '((guix build utils)))
3556 (snippet
3557 '(begin
3558 ;; Drop bundled valgrind headers.
3559 (delete-file-recursively "third-party")
3560 (substitute* '("multipathd/main.c"
3561 "libmultipath/debug.c")
3562 (("#include \"../third-party/")
3563 "#include \""))
3564 #t))))
3565 (build-system gnu-build-system)
3566 (arguments
bd835ff2
TGR
3567 '(#:tests? #f ; no tests
3568 #:make-flags (list "CC=gcc"
3569 (string-append "DESTDIR="
b3ed50e6 3570 (assoc-ref %outputs "out"))
b5fb9430 3571 "SYSTEMDPATH=lib"
5247aab8
MB
3572 ;; Add the libaio headers to GCCs system header
3573 ;; search path to suppress -Werror=cast-qual on
3574 ;; the included headers.
3575 (string-append "C_INCLUDE_PATH="
3576 (assoc-ref %build-inputs "libaio")
3577 "/include")
b3ed50e6
MB
3578 (string-append "LDFLAGS=-Wl,-rpath="
3579 (assoc-ref %outputs "out")
3580 "/lib"))
3581 #:phases
3582 (modify-phases %standard-phases
b5fb9430 3583 (add-after 'unpack 'patch-source
7f412f33
MB
3584 (lambda* (#:key inputs #:allow-other-keys)
3585 (let ((lvm2 (assoc-ref inputs "lvm2"))
3586 (udev (assoc-ref inputs "udev")))
3587 (substitute* "Makefile.inc"
a9e7d656
MO
3588 (("\\$\\(prefix\\)/usr") "$(prefix)")
3589 ;; Do not save timestamp to avoid gzip "timestamp
3590 ;; out-of-range" warnings.
3591 (("gzip -9") "gzip -9n"))
7f412f33
MB
3592 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3593 (("/usr/include/libdevmapper.h")
3594 (string-append lvm2 "/include/libdevmapper.h"))
3595 (("/usr/include/libudev.h")
3596 (string-append udev "/include/libudev.h")))
3597 #t)))
57e3f06b 3598 (delete 'configure)))) ; no configure script
b3ed50e6 3599 (native-inputs
7f412f33
MB
3600 `(("perl" ,perl)
3601 ("pkg-config" ,pkg-config)
3602 ("valgrind" ,valgrind)))
b3ed50e6 3603 (inputs
6f850a19 3604 `(("json-c" ,json-c)
b3ed50e6
MB
3605 ("libaio" ,libaio)
3606 ("liburcu" ,liburcu)
3607 ("lvm2" ,lvm2)
3608 ("readline" ,readline)
3609 ("udev" ,eudev)))
3610 (home-page "http://christophe.varoqui.free.fr/")
3611 (synopsis "Access block devices through multiple paths")
3612 (description
3613 "This package provides the following binaries to drive the
3614Linux Device Mapper multipathing driver:
3615@enumerate
3616@item @command{multipath} - Device mapper target autoconfig.
3617@item @command{multipathd} - Multipath daemon.
3618@item @command{mpathpersist} - Manages SCSI persistent reservations on
3619@code{dm} multipath devices.
3620@item @command{kpartx} - Create device maps from partition tables.
3621@end enumerate")
57e3f06b 3622 (license (list license:gpl2+ ; main distribution
b3ed50e6
MB
3623 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3624
01ccdfb6
SB
3625(define-public libaio
3626 (package
3627 (name "libaio")
87dc306b 3628 (version "0.3.111")
01ccdfb6
SB
3629 (source (origin
3630 (method url-fetch)
87dc306b
MB
3631 (uri (list
3632 (string-append "https://releases.pagure.org/libaio/"
3633 name "-" version ".tar.gz")))
3634 (sha256
3635 (base32
3636 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
01ccdfb6
SB
3637 (build-system gnu-build-system)
3638 (arguments
3639 '(#:make-flags
3640 (list "CC=gcc" (string-append "prefix=" %output))
3641 #:test-target "partcheck" ; need root for a full 'check'
3642 #:phases
dc1d3cde 3643 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
87dc306b 3644 (home-page "https://pagure.io/libaio")
01ccdfb6
SB
3645 (synopsis "Linux-native asynchronous I/O access library")
3646 (description
3647 "This library enables userspace to use Linux kernel asynchronous I/O
3648system calls, important for the performance of databases and other advanced
3649applications.")
3ac73271 3650 (license license:lgpl2.1+)))
eb7c43c3 3651
81b98756
RW
3652(define-public sbc
3653 (package
3654 (name "sbc")
2a11a029 3655 (version "1.4")
81b98756
RW
3656 (source (origin
3657 (method url-fetch)
18160c34
MB
3658 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
3659 version ".tar.xz"))
81b98756
RW
3660 (sha256
3661 (base32
2a11a029 3662 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
81b98756
RW
3663 (build-system gnu-build-system)
3664 (inputs
3665 `(("libsndfile" ,libsndfile)))
3666 (native-inputs
3667 `(("pkg-config" ,pkg-config)))
3668 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3669 (synopsis "Bluetooth subband audio codec")
3670 (description
3671 "The SBC is a digital audio encoder and decoder used to transfer data to
3672Bluetooth audio output devices like headphones or loudspeakers.")
3673 (license license:gpl2+)))
3674
eb7c43c3
DT
3675(define-public bluez
3676 (package
3677 (name "bluez")
b5724230 3678 (version "5.50")
eb7c43c3
DT
3679 (source (origin
3680 (method url-fetch)
3681 (uri (string-append
e9eb24b1 3682 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
3683 version ".tar.xz"))
3684 (sha256
3685 (base32
b5724230 3686 "048r91vx9gs5nwwbah2s0xig04nwk14c5s0vb7qmaqdvighsmz2z"))))
eb7c43c3
DT
3687 (build-system gnu-build-system)
3688 (arguments
90ea83ee 3689 `(#:configure-flags
eb7c43c3 3690 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
3691 (list "--sysconfdir=/etc"
3692 "--localstatedir=/var"
3693 "--enable-library"
53142109 3694 "--disable-systemd"
eb7c43c3
DT
3695 ;; Install dbus/udev files to the correct location.
3696 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
3697 (string-append "--with-udevdir=" out "/lib/udev")))
3698 #:phases
3699 (modify-phases %standard-phases
fbea821a
TD
3700 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3701 ;; issue (discussion on upstream mailing list:
3702 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3703 (add-before 'check 'skip-wonky-test
3704 (lambda _
3705 (substitute* "unit/test-gatt.c"
3706 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3707 #t))
87a16de7
SB
3708 (add-after 'install 'post-install
3709 (lambda* (#:key inputs outputs #:allow-other-keys)
3710 (let* ((out (assoc-ref outputs "out"))
3711 (servicedir (string-append out "/share/dbus-1/services"))
3712 (service "obexd/src/org.bluez.obex.service")
3713 (rule (string-append
3714 out "/lib/udev/rules.d/97-hid2hci.rules")))
3715 ;; Install the obex dbus service file.
3716 (substitute* service
3717 (("/bin/false")
3718 (string-append out "/libexec/bluetooth/obexd")))
3719 (install-file service servicedir)
3720 ;; Fix paths in the udev rule.
3721 (substitute* rule
3722 (("hid2hci --method")
3723 (string-append out "/lib/udev/hid2hci --method"))
3724 (("/sbin/udevadm")
3725 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
de47cfed 3726 #t))))))
eb7c43c3
DT
3727 (native-inputs
3728 `(("pkg-config" ,pkg-config)
b94a6ca0 3729 ("gettext" ,gettext-minimal)))
eb7c43c3
DT
3730 (inputs
3731 `(("glib" ,glib)
3732 ("dbus" ,dbus)
3733 ("eudev" ,eudev)
3734 ("libical" ,libical)
3735 ("readline" ,readline)))
3736 (home-page "http://www.bluez.org/")
3737 (synopsis "Linux Bluetooth protocol stack")
3738 (description
3739 "BlueZ provides support for the core Bluetooth layers and protocols. It
3740is flexible, efficient and uses a modular implementation.")
3ac73271 3741 (license license:gpl2+)))
3d890318
LC
3742
3743(define-public fuse-exfat
3744 (package
3745 (name "fuse-exfat")
1372754d 3746 (version "1.3.0")
3d890318
LC
3747 (source (origin
3748 (method url-fetch)
c0cc805e
TGR
3749 (uri (string-append
3750 "https://github.com/relan/exfat/releases/download/v"
3751 version "/" name "-" version ".tar.gz"))
3d890318
LC
3752 (sha256
3753 (base32
1372754d 3754 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3d890318
LC
3755 (build-system gnu-build-system)
3756 (native-inputs
c0cc805e 3757 `(("pkg-config" ,pkg-config)))
3d890318
LC
3758 (inputs
3759 `(("fuse" ,fuse)))
c0cc805e 3760 (home-page "https://github.com/relan/exfat")
3d890318
LC
3761 (synopsis "Mount exFAT file systems")
3762 (description
3763 "This package provides a FUSE-based file system that provides read and
3764write access to exFAT devices.")
3ac73271 3765 (license license:gpl2+)))
53ec8d48 3766
1564e0fe
PN
3767(define-public fuseiso
3768 (package
3769 (name "fuseiso")
3770 (version "20070708")
3771 (source (origin
3772 (method url-fetch)
3773 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
3774 version "/fuseiso-" version ".tar.bz2"))
3775 (sha256
3776 (base32
3777 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
3778 (build-system gnu-build-system)
3779 (native-inputs
3780 `(("pkg-config" ,pkg-config)))
3781 (inputs
3782 `(("fuse" ,fuse)
3783 ("glib" ,glib)
3784 ("zlib" ,zlib)))
3785 (home-page "https://sourceforge.net/projects/fuseiso/")
dff79364 3786 (synopsis "Mount ISO file system images")
1564e0fe 3787 (description
52beae7b 3788 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
b60e9fb8
PN
3789.bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
3790Ridge, Joliet, and zisofs.")
1564e0fe
PN
3791 (license license:gpl2)))
3792
53ec8d48
LC
3793(define-public gpm
3794 (package
3795 (name "gpm")
3796 (version "1.20.7")
3797 (source (origin
3798 (method url-fetch)
3799 (uri (string-append
3800 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3801 version ".tar.bz2"))
fddb22ac 3802 (patches (search-patches "gpm-glibc-2.26.patch"))
53ec8d48
LC
3803 (sha256
3804 (base32
3805 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3806 (build-system gnu-build-system)
3807 (arguments
3808 '(#:phases (modify-phases %standard-phases
189be331 3809 (replace 'bootstrap
53ec8d48
LC
3810 (lambda _
3811 ;; The tarball was not generated with 'make dist' so we
3812 ;; need to bootstrap things ourselves.
77bb6c22
EF
3813 (substitute* "autogen.sh"
3814 (("/bin/sh") (which "sh")))
90a54e36
MW
3815 (invoke "./autogen.sh")
3816 (patch-makefile-SHELL "Makefile.include.in")
3817 #t)))
53ec8d48
LC
3818
3819 ;; Make sure programs find libgpm.so.
3820 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3821 (assoc-ref %outputs "out")
3822 "/lib"))))
3823 (native-inputs
3824 `(("texinfo" ,texinfo)
3825 ("bison" ,bison)
3826 ("flex" ,flex)
3827 ("autoconf" ,autoconf)
3828 ("automake" ,automake)
3829 ("libtool" ,libtool)))
3830 (home-page "http://www.nico.schottelius.org/software/gpm/")
3831 (synopsis "Mouse support for the Linux console")
3832 (description
3833 "The GPM (general-purpose mouse) daemon is a mouse server for
3834applications running on the Linux console. It allows users to select items
3835and copy/paste text in the console and in xterm.")
3ac73271 3836 (license license:gpl2+)))
fc686f9a
TGR
3837
3838(define-public btrfs-progs
3839 (package
3840 (name "btrfs-progs")
6b4bc27a 3841 (version "5.2.2")
fc686f9a
TGR
3842 (source (origin
3843 (method url-fetch)
3844 (uri (string-append "mirror://kernel.org/linux/kernel/"
3845 "people/kdave/btrfs-progs/"
3846 "btrfs-progs-v" version ".tar.xz"))
3847 (sha256
3848 (base32
6b4bc27a 3849 "1imivxjppi8zl27gn472pwpk8bg5dijkbyi340by31vhy7dj24w2"))))
fc686f9a 3850 (build-system gnu-build-system)
7cad981d 3851 (outputs '("out"
c4b006ba 3852 "static")) ; static versions of the binaries in "out"
fc686f9a 3853 (arguments
7cad981d
TGR
3854 '(#:phases (modify-phases %standard-phases
3855 (add-after 'build 'build-static
caf4c7c8 3856 (lambda _ (invoke "make" "static")))
9a1c4a98
MB
3857 (add-after 'install 'install-bash-completion
3858 (lambda* (#:key outputs #:allow-other-keys)
3ce4e265
MB
3859 (let* ((out (assoc-ref outputs "out"))
3860 (bashcomp (string-append out "/etc/bash_completion.d")))
3861 (mkdir-p bashcomp)
3862 (copy-file "btrfs-completion"
3863 (string-append bashcomp "/btrfs"))
3864 #t)))
7cad981d
TGR
3865 (add-after 'install 'install-static
3866 (let ((staticbin (string-append (assoc-ref %outputs "static")
3867 "/bin")))
3868 (lambda _
caf4c7c8
MW
3869 (invoke "make"
3870 (string-append "bindir=" staticbin)
3871 "install-static")))))
d6fb0985 3872 #:tests? #f ; XXX: require the 'btrfs' kernel module.
7cad981d 3873 #:test-target "test"
fc686f9a
TGR
3874 #:parallel-tests? #f)) ; tests fail when run in parallel
3875 (inputs `(("e2fsprogs" ,e2fsprogs)
3876 ("libblkid" ,util-linux)
7cad981d 3877 ("libblkid:static" ,util-linux "static")
fc686f9a 3878 ("libuuid" ,util-linux)
7cad981d 3879 ("libuuid:static" ,util-linux "static")
e2937a55 3880 ("lzo" ,lzo)
fc686f9a 3881 ("zlib" ,zlib)
029c2ba0 3882 ("zlib:static" ,zlib "static")
ec0de9d8
MB
3883 ("zstd" ,zstd "lib")
3884 ("zstd:static" ,zstd "static")))
fc686f9a
TGR
3885 (native-inputs `(("pkg-config" ,pkg-config)
3886 ("asciidoc" ,asciidoc)
1dfb14d2 3887 ("python" ,python)
fc686f9a 3888 ("xmlto" ,xmlto)
41d23dd1 3889 ;; For building documentation.
fc686f9a 3890 ("libxml2" ,libxml2)
48b7e4a6 3891 ("docbook-xsl" ,docbook-xsl)
41d23dd1 3892 ;; For tests.
bc64676c 3893 ("acl" ,acl)
caf4c7c8
MW
3894 ("which" ,which)
3895 ;; The tests need 'grep' with perl regexp support.
3896 ("grep" ,grep)))
fc83ca2b 3897 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
fc686f9a 3898 (synopsis "Create and manage btrfs copy-on-write file systems")
039601e0
TGR
3899 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3900aimed at implementing advanced features while focusing on fault tolerance,
3901repair and easy administration.")
68bcac6b
LF
3902 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3903 ;; GPL2: Everything else.
3904 (license (list license:gpl2 license:gpl2+))))
08e9daf5 3905
f3e44f5c
DC
3906(define-public btrfs-progs/static
3907 (package
3908 (name "btrfs-progs-static")
3909 (version (package-version btrfs-progs))
3910 (source #f)
3911 (build-system trivial-build-system)
3912 (inputs
3913 `(("btrfs-progs:static" ,btrfs-progs "static")))
3914 (arguments
3915 `(#:modules ((guix build utils))
3916 #:builder
3917 (begin
3918 (use-modules (guix build utils)
3919 (ice-9 ftw)
3920 (srfi srfi-26))
3921
3922 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3923 (out (assoc-ref %outputs "out"))
3924 (source (string-append btrfs "/bin/btrfs.static"))
3925 (target (string-append out "/bin/btrfs")))
3926 (mkdir-p (dirname target))
3927 (copy-file source target)
3928 (remove-store-references target)
e3cfef22
MW
3929 (chmod target #o555)
3930 #t))))
f3e44f5c 3931 (home-page (package-home-page btrfs-progs))
ff797172
TGR
3932 (synopsis "Statically-linked btrfs command from btrfs-progs")
3933 (description "This package provides the statically-linked @command{btrfs}
3934from the btrfs-progs package. It is meant to be used in initrds.")
f3e44f5c
DC
3935 (license (package-license btrfs-progs))))
3936
49b28a74
PN
3937(define-public compsize
3938 (package
3939 (name "compsize")
3940 (version "1.3")
3941 (home-page "https://github.com/kilobyte/compsize")
3942 (source (origin
3943 (method git-fetch)
3944 (uri (git-reference
3945 (url home-page)
3946 (commit (string-append "v" version))))
3947 (sha256
3948 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
3949 (file-name (git-file-name name version))))
3950 (build-system gnu-build-system)
3951 (inputs
3952 `(("btrfs-progs" ,btrfs-progs)))
3953 (arguments
3954 `(#:tests? #f ; No tests.
3955 #:make-flags (list "CC=gcc")
3956 #:phases
3957 (modify-phases %standard-phases
3958 (delete 'configure)
3959 (replace 'install
3960 (lambda* (#:key outputs #:allow-other-keys)
3961 (let ((out (assoc-ref outputs "out")))
3962 (install-file "compsize" (string-append out "/bin"))
3963 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
3964 (synopsis "Find compression type/ratio on Btrfs files")
3965 (description "@command{compsize} takes a list of files (given as
3966arguments) on a Btrfs file system and measures used compression types and
3967effective compression ratio, producing a report.
3968
3969A directory has no extents but has a (recursive) list of files. A non-regular
3970file is silently ignored.
3971
3972As it makes no sense to talk about compression ratio of a partial extent,
3973every referenced extent is counted whole, exactly once -- no matter if you use
3974only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
3975uncompressed size will not match the number given by @command{tar} or
3976@command{du}. On the other hand, the space used should be accurate (although
3977obviously it can be shared with files outside our set).")
3978 (license license:gpl2+)))
3979
72aa295e 3980(define-public f2fs-tools-1.7
2e456982
MB
3981 (package
3982 (name "f2fs-tools")
72aa295e 3983 (version "1.7.0")
2e456982
MB
3984 (source (origin
3985 (method url-fetch)
3986 (uri (string-append
3987 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
2d588f3c 3988 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
2e456982
MB
3989 (sha256
3990 (base32
72aa295e
DM
3991 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
3992
2e456982
MB
3993 (build-system gnu-build-system)
3994 (arguments
3995 `(#:phases
3996 (modify-phases %standard-phases
72aa295e
DM
3997 (add-after 'install 'install-headers
3998 (lambda* (#:key outputs #:allow-other-keys)
3999 (let* ((out (assoc-ref outputs "out"))
4000 (out-include (string-append out "/include")))
4001 (install-file "include/f2fs_fs.h" out-include)
4002 (install-file "mkfs/f2fs_format_utils.h" out-include)
4003 #t))))))
2e456982
MB
4004 (native-inputs
4005 `(("autoconf" ,autoconf)
4006 ("automake" ,automake)
4007 ("libtool" ,libtool)
4008 ("pkg-config" ,pkg-config)))
4009 (inputs
72aa295e
DM
4010 `(("libuuid" ,util-linux)
4011 ("libselinux" ,libselinux)))
2e456982
MB
4012 (home-page "https://f2fs.wiki.kernel.org/")
4013 (synopsis "Userland tools for f2fs")
4014 (description
4015 "F2FS, the Flash-Friendly File System, is a modern file system
4016designed to be fast and durable on flash devices such as solid-state
4017disks and SD cards. This package provides the userland utilities.")
4018 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4019 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4020 (license (list license:gpl2 license:lgpl2.1))))
4021
72aa295e
DM
4022(define-public f2fs-tools
4023 (package
4024 (inherit f2fs-tools-1.7)
4025 (name "f2fs-tools")
59ac0a2a 4026 (version "1.12.0")
72aa295e
DM
4027 (source (origin
4028 (method url-fetch)
4029 (uri (string-append
4030 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
2d588f3c 4031 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
72aa295e
DM
4032 (sha256
4033 (base32
59ac0a2a 4034 "15pn2fm9knn7p1vzfzy6msnrdl14p6y1gn4m2ka6ba5bzx6lw4p2"))))
72aa295e
DM
4035 (inputs
4036 `(("libuuid" ,util-linux)))))
4037
08e9daf5
TGR
4038(define-public freefall
4039 (package
4040 (name "freefall")
4041 (version (package-version linux-libre))
4042 (source (package-source linux-libre))
4043 (build-system gnu-build-system)
4044 (arguments
4045 '(#:phases (modify-phases %standard-phases
4046 (add-after 'unpack 'enter-subdirectory
4047 (lambda _
2ee42f7e
MW
4048 (chdir "tools/laptop/freefall")
4049 #t))
08e9daf5
TGR
4050 (delete 'configure)
4051 (add-before 'build 'increase-timeout
4052 (lambda _
4053 ;; The default of 2 seconds is too low: it assumes an
4054 ;; open lid and AC power without actually checking.
4055 (substitute* "freefall.c"
2ee42f7e
MW
4056 (("alarm\\(2\\)") "alarm(5)"))
4057 #t)))
08e9daf5 4058 #:make-flags (list (string-append "PREFIX="
c80629e7
EF
4059 (assoc-ref %outputs "out"))
4060 "CC=gcc")
08e9daf5
TGR
4061 #:tests? #f)) ;no tests
4062 (home-page (package-home-page linux-libre))
4063 (synopsis "Free-fall protection for spinning laptop hard drives")
4064 (description
4065 "Prevents shock damage to the internal spinning hard drive(s) of some
4066HP and Dell laptops. When sudden movement is detected, all input/output
4067operations on the drive are suspended and its heads are parked on the ramp,
4068where they are less likely to cause damage to the spinning disc. Requires a
4069drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4070feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4071 (license license:gpl2)))
d17ae8c0
NG
4072
4073(define-public thinkfan
4074 (package
4075 (name "thinkfan")
9a3d176e
TGR
4076 (version "1.0.2")
4077 (source
4078 (origin
4079 (method git-fetch)
4080 (uri (git-reference
4081 (url "https://github.com/vmatare/thinkfan.git")
4082 (commit version)))
4083 (file-name (git-file-name name version))
4084 (sha256
4085 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
d17ae8c0
NG
4086 (build-system cmake-build-system)
4087 (arguments
4088 `(#:modules ((guix build cmake-build-system)
4089 (guix build utils)
4090 (srfi srfi-26))
9a3d176e 4091 #:tests? #f ; no test target
d17ae8c0
NG
4092 #:configure-flags
4093 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
9a3d176e
TGR
4094 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4095 ;; inefficient’.
d17ae8c0
NG
4096 `("-DUSE_ATASMART:BOOL=ON")
4097 #:phases
4098 (modify-phases %standard-phases
908a3f36
TGR
4099 (add-after 'unpack 'create-init-scripts
4100 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4101 ;; systemd to patch and install their service files. Fake their
4102 ;; presence rather than duplicating the build system below. Leave
4103 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4104 ;; The sysvinit needs manual patching, but since upstream doesn't
4105 ;; even provide the option to install it: don't.
d17ae8c0 4106 (lambda* (#:key outputs #:allow-other-keys)
908a3f36
TGR
4107 (let* ((out (assoc-ref outputs "out"))
4108 (share (string-append out "/share/" ,name)))
4109 (substitute* "CMakeLists.txt"
4110 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4111 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4112 ;; That was easy! Now we just need to fix the destinations.
4113 (("/etc" directory)
4114 (string-append out directory)))
4115 #t))))))
9a3d176e
TGR
4116 (native-inputs
4117 `(("pkg-config" ,pkg-config)))
d17ae8c0 4118 (inputs
9a3d176e
TGR
4119 `(("libatasmart" ,libatasmart)
4120 ("yaml-cpp" ,yaml-cpp)))
d17ae8c0
NG
4121 (home-page "http://thinkfan.sourceforge.net/")
4122 (synopsis "Simple fan control program")
4123 (description
4124 "Thinkfan is a simple fan control program. It reads temperatures,
4125checks them against configured limits and switches to appropriate (also
4126pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4127other @code{hwmon} driver that enables temperature reading and fan control
4128from userspace.")
4129 (license license:gpl3+)))
91231156 4130
b313665f
TGR
4131(define-public tpacpi-bat
4132 (package
4133 (name "tpacpi-bat")
4134 (version "3.1")
4135 (source
4136 (origin
4137 (method git-fetch)
4138 (uri (git-reference
4139 (url "https://github.com/teleshoes/tpacpi-bat.git")
4140 (commit (string-append "v" version))))
4141 (file-name (git-file-name name version))
4142 (sha256
4143 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4144 (build-system gnu-build-system)
4145 (arguments
4146 `(#:tests? #f ; no test target
4147 #:phases
4148 (modify-phases %standard-phases
4149 (add-after 'unpack 'refer-to-inputs
4150 (lambda _
4151 (substitute* "tpacpi-bat"
4152 (("cat ")
4153 (format "~a " (which "cat")))
4154 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4155 ;; loaded. That's the administrator's prerogative; disable it.
4156 (("system \"(modprobe .*)\"" _ match)
4157 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4158 #t))
4159 (delete 'configure) ; nothing to configure
4160 (delete 'build) ; nothing to build
4161 (replace 'install
4162 (lambda* (#:key outputs #:allow-other-keys)
4163 (let* ((out (assoc-ref outputs "out"))
4164 (bin (string-append out "/bin"))
4165 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4166 (install-file "tpacpi-bat" bin)
4167
4168 ;; There's no man page. Install other forms of documentation.
4169 (for-each (lambda (file)
4170 (let ((target (string-append doc "/" file)))
4171 (mkdir-p (dirname target))
4172 (copy-recursively file target)))
4173 (list "battery_asl" "examples" "README.md"))
4174 #t))))))
4175 (inputs
4176 `(("perl" ,perl)))
4177 (home-page "https://github.com/teleshoes/tpacpi-bat")
4178 (synopsis "ThinkPad battery charge controller")
4179 (description
4180 "Tpacpi-bat is a command-line interface to control battery charging on
4181@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4182ThinkPad models released after 2011}, starting with the xx20 series. It can
4183query and set the thresholds at which one or both batteries will start and stop
4184charging, inhibit charging batteries for a set period of time, or force them to
4185discharge when they otherwise would not.
4186
4187This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4188kernel module provided by the @code{acpi-call-linux-module} package, which must
4189be installed and loaded separately. Only the original vendor firmware is
4190supported.")
4191 (license license:gpl3+)))
4192
91231156
LC
4193(define-public ntfs-3g
4194 (package
4195 (name "ntfs-3g")
d8af4f6d 4196 (version "2017.3.23")
91231156
LC
4197 (source (origin
4198 (method url-fetch)
4199 (uri (string-append "https://tuxera.com/opensource/"
4200 "ntfs-3g_ntfsprogs-" version ".tgz"))
6d01a7f4 4201 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
91231156
LC
4202 (sha256
4203 (base32
d8af4f6d 4204 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
91231156 4205 (modules '((guix build utils)))
6cbee49d
MW
4206 (snippet '(begin
4207 ;; Install under $prefix.
4208 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4209 (("/sbin")
4210 "@sbindir@"))
4211 #t))))
91231156
LC
4212 (build-system gnu-build-system)
4213 (inputs `(("util-linux" ,util-linux)
4214 ("fuse" ,fuse))) ;libuuid
4215 (native-inputs `(("pkg-config" ,pkg-config)))
4216 (arguments
4217 '(#:configure-flags (list "--exec-prefix=${prefix}"
4218 "--with-fuse=external" ;use our own FUSE
4219 "--enable-mount-helper"
4220 "--enable-posix-acls"
91420521
PN
4221 "--enable-xattr-mappings")
4222 #:phases
4223 (modify-phases %standard-phases
4224 ;; If users install ntfs-3g, they probably want to make it the
4225 ;; default driver as well, so we opt for sensible defaults and link
4226 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
52beae7b 4227 ;; mount NTFS file systems.)
91420521
PN
4228 (add-after 'install 'install-link
4229 (lambda* (#:key outputs #:allow-other-keys)
4230 (let* ((out (assoc-ref outputs "out"))
4231 (sbin (string-append out "/sbin")))
4232 (symlink "mount.ntfs-3g"
9922278b
MW
4233 (string-append sbin "/mount.ntfs")))
4234 #t)))))
8bad0c0b 4235 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
91231156
LC
4236 (synopsis "Read-write access to NTFS file systems")
4237 (description
4238 "NTFS-3G provides read-write access to NTFS file systems, which are
4239commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4240The package provides additional NTFS tools.")
4241 (license license:gpl2+)))
9b0942c1 4242
f8f44dd7
MB
4243(define-public rdma-core
4244 (package
4245 (name "rdma-core")
344f358f 4246 (version "22.3")
f8f44dd7
MB
4247 (source (origin
4248 (method url-fetch)
4249 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4250 "/releases/download/v" version "/rdma-core-"
4251 version ".tar.gz"))
4252 (sha256
4253 (base32
344f358f 4254 "0jgp1xh328x0kr6lkn4vq71cc627zd05wczr74b3j3151flhj828"))))
f8f44dd7
MB
4255 (build-system cmake-build-system)
4256 (arguments
4257 '(#:tests? #f ; no tests
4258 ;; Upstream uses the "ninja" build system and encourage distros
4259 ;; to do the same for consistency. They also recommend using the
4260 ;; "Release" build type.
3def739d
TGR
4261 #:build-type "Release"
4262 #:configure-flags (list "-GNinja")
f8f44dd7
MB
4263 #:phases
4264 (modify-phases %standard-phases
4265 (replace 'build
4266 (lambda _
8c3101b8
MW
4267 (invoke "ninja"
4268 "-j" (number->string (parallel-job-count)))))
f8f44dd7
MB
4269 (replace 'install
4270 (lambda _
8c3101b8 4271 (invoke "ninja" "install"))))))
f8f44dd7
MB
4272 (native-inputs
4273 `(("ninja" ,ninja)
4274 ("pkg-config" ,pkg-config)
4275 ("python" ,python-wrapper)))
4276 (inputs
4277 `(("libnl" ,libnl)
4278 ("udev" ,eudev)))
4279 (home-page "https://github.com/linux-rdma/rdma-core")
4280 (synopsis "Utilities and libraries for working with RDMA devices")
4281 (description
4282 "This package provides userspace components for the InfiniBand
4283subsystem of the Linux kernel. Specifically it contains userspace
4284libraries for the following device nodes:
4285
4286@enumerate
4287@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4288@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4289@item @file{/dev/infiniband/umadX} (@code{libibumad})
4290@end enumerate
4291
4292The following service daemons are also provided:
4293@enumerate
4294@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4295@item @code{iwpmd} (for iWARP kernel providers)
4296@item @code{ibacm} (for InfiniBand communication management assistant)
4297@end enumerate")
4298 ;; All library code is dual licensed under GPL2 and a custom MIT
4299 ;; variant. The package also includes some components covered by
4300 ;; other licenses. Consult COPYING.md for full details.
4301 (license
4302 (list license:gpl2
4303 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4304 license:bsd-2 ; Files referring to COPYING.BSD_FB
4305 license:cc0 ; most files in ccan/
4306 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4307
a0a273c1
MG
4308(define-public perftest
4309 (package
4310 (name "perftest")
50298d4a 4311 (version "4.4-0.4")
a0a273c1
MG
4312 (source
4313 (origin
4314 (method url-fetch)
50298d4a
TGR
4315 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4316 version "/perftest-" version ".g0927198.tar.gz"))
a0a273c1 4317 (sha256
50298d4a 4318 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
a0a273c1
MG
4319 (build-system gnu-build-system)
4320 (arguments
4321 `(#:phases
4322 (modify-phases %standard-phases
4323 (add-after 'unpack 'patch-header-paths
4324 (lambda _
4325 (substitute* '("src/raw_ethernet_fs_rate.c"
4326 "src/raw_ethernet_resources.c"
4327 "src/raw_ethernet_resources.h"
4328 "src/raw_ethernet_send_burst_lat.c"
4329 "src/raw_ethernet_send_bw.c"
4330 "src/raw_ethernet_send_lat.c")
4331 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4332 #t)))))
4333 (inputs `(("rdma-core" ,rdma-core)))
4334 (home-page "https://github.com/linux-rdma/perftest/")
4335 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4336 (description "This is a collection of tests written over uverbs intended for
4337use as a performance micro-benchmark. The tests may be used for hardware or
4338software tuning as well as for functional testing.
4339
4340The collection contains a set of bandwidth and latency benchmark such as:
4341@enumerate
4342@item Send - @code{ib_send_bw} and @code{ib_send_lat}
4343@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4344@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4345@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4346@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4347@end enumerate")
4348 (license license:gpl2)))
4349
9b0942c1
DC
4350(define-public rng-tools
4351 (package
4352 (name "rng-tools")
c6b772a0 4353 (home-page "https://github.com/nhorman/rng-tools")
ae67d70d 4354 (version "6.7")
9b0942c1 4355 (source (origin
f289820c
MB
4356 (method git-fetch)
4357 (uri (git-reference (url home-page)
4358 (commit (string-append "v" version))))
4359 (file-name (git-file-name name version))
9b0942c1
DC
4360 (sha256
4361 (base32
ae67d70d 4362 "19f75m6mzg8h7b4snzg7d6ypvkz6nq32lrpi9ja95gqz4wsd18a5"))))
9b0942c1 4363 (build-system gnu-build-system)
8bc6956b
LF
4364 (arguments
4365 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
ae67d70d
TGR
4366 #:configure-flags '("--without-nistbeacon"
4367 "--without-pkcs11")))
8bc6956b
LF
4368 (native-inputs
4369 `(("autoconf" ,autoconf)
4370 ("automake" ,automake)
4371 ("pkg-config" ,pkg-config)))
4372 (inputs
4373 `(("libsysfs" ,sysfsutils)))
9b0942c1
DC
4374 (synopsis "Random number generator daemon")
4375 (description
4376 "Monitor a hardware random number generator, and supply entropy
4377from that to the system kernel's @file{/dev/random} machinery.")
9b0942c1
DC
4378 ;; The source package is offered under the GPL2+, but the files
4379 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4380 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
4381
4382(define-public cpupower
4383 (package
4384 (name "cpupower")
4385 (version (package-version linux-libre))
4386 (source (package-source linux-libre))
4387 (build-system gnu-build-system)
4388 (arguments
4389 '(#:phases (modify-phases %standard-phases
4390 (add-after 'unpack 'enter-subdirectory
4391 (lambda _
9922278b
MW
4392 (chdir "tools/power/cpupower")
4393 #t))
58d6a1f2
TGR
4394 (delete 'configure)
4395 (add-before 'build 'fix-makefiles
4396 (lambda _
4397 (substitute* "Makefile"
4398 (("/usr/") "/")
4399 (("/bin/(install|pwd)" _ command) command))
4400 (substitute* "bench/Makefile"
9922278b
MW
4401 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4402 #t)))
58d6a1f2
TGR
4403 #:make-flags (let ((out (assoc-ref %outputs "out")))
4404 (list (string-append "DESTDIR=" out)
4405 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4406 "docdir=/share/doc/cpupower"
4407 "confdir=$(docdir)/examples"
4408 ;; The Makefile recommends the following changes
4409 "DEBUG=false"
4410 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4411 #:tests? #f)) ;no tests
b94a6ca0 4412 (native-inputs `(("gettext" ,gettext-minimal)))
58d6a1f2
TGR
4413 (inputs `(("pciutils" ,pciutils)))
4414 (home-page (package-home-page linux-libre))
4415 (synopsis "CPU frequency and voltage scaling tools for Linux")
4416 (description
4417 "cpupower is a set of user-space tools that use the cpufreq feature of the
4418Linux kernel to retrieve and control processor features related to power saving,
4419such as frequency and voltage scaling.")
4420 (license license:gpl2)))
2b76f135 4421
71bd55cb
SS
4422(define-public x86-energy-perf-policy
4423 (package
4424 (name "x86-energy-perf-policy")
4425 (version (package-version linux-libre))
4426 (source (package-source linux-libre))
4427 (build-system gnu-build-system)
4428 (arguments
4429 '(#:tests? #f
4430 #:phases
4431 (modify-phases %standard-phases
4432 (add-after 'unpack 'enter-subdirectory
4433 (lambda _
4434 (chdir "tools/power/x86/x86_energy_perf_policy")
4435 #t))
4436 (delete 'configure)
4437 (add-before 'build 'fix-makefile
4438 (lambda _
4439 (substitute* "Makefile" (("/usr") ""))
4440 #t)))
4441 #:make-flags
4442 (let ((out (assoc-ref %outputs "out")))
4443 (list (string-append "DESTDIR=" out)
4444 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4445 (supported-systems '("i686-linux" "x86_64-linux"))
4446 (home-page (package-home-page linux-libre))
4447 (synopsis "Display and update Intel-CPU energy-performance policy")
4448 (description
4449 "@command{x86_energy_perf_policy} displays and updates energy-performance
4450policy settings specific to Intel Architecture Processors. Settings are
4451accessed via Model Specific Register (MSR) updates, no matter if the Linux
4452cpufreq sub-system is enabled or not.")
4453 (license license:gpl2)))
4454
2b76f135
TGR
4455(define-public haveged
4456 (package
4457 (name "haveged")
389cae8b 4458 (version "1.9.6")
2b76f135
TGR
4459 (source
4460 (origin
893c340c
TGR
4461 (method git-fetch)
4462 (uri (git-reference
4463 (url "https://github.com/jirka-h/haveged.git")
389cae8b 4464 (commit (string-append "v" version))))
893c340c 4465 (file-name (git-file-name name version))
2b76f135 4466 (sha256
389cae8b 4467 (base32 "11kr19n2f87izsj341lv5amhd1wc2ckfmqr9pq5fxix8pkbs94rh"))))
2b76f135 4468 (build-system gnu-build-system)
6664ec0c 4469 (home-page "https://www.issihosts.com/haveged")
2b76f135
TGR
4470 (synopsis "Entropy source for the Linux random number generator")
4471 (description
4472 "haveged generates an unpredictable stream of random numbers for use by
4473Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4474standard mechanisms for filling the entropy pool may not be sufficient for
4475systems with high needs or limited user interaction, such as headless servers.
b71a3488 4476
2b76f135 4477@command{haveged} runs as a privileged daemon, harvesting randomness from the
8e42b087
TGR
4478indirect effects of hardware events on hidden processor state using the
4479@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
4480It tunes itself to its environment and provides the same built-in test suite
4481for the output stream as used on certified hardware security devices.
4a147986
TGR
4482
4483The quality of the randomness produced by this algorithm has not been proven.
4484It is recommended to run it together with another entropy source like rngd, and
4485not as a replacement for it.")
2b76f135
TGR
4486 (license (list (license:non-copyleft "file://nist/mconf.h")
4487 (license:non-copyleft "file://nist/packtest.c")
4488 license:public-domain ; nist/dfft.c
4489 license:gpl3+)))) ; everything else
e385e957
TGR
4490
4491(define-public ecryptfs-utils
4492 (package
4493 (name "ecryptfs-utils")
4494 (version "111")
4495 (source
4496 (origin
4497 (method url-fetch)
4498 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4499 version "/+download/ecryptfs-utils_"
4500 version ".orig.tar.gz"))
4501 (sha256
4502 (base32
4503 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4504 (build-system gnu-build-system)
4505 (arguments
17a21bcf
BT
4506 `(#:configure-flags (list "--disable-pywrap")
4507 #:phases
4508 (modify-phases %standard-phases
4509 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4510 (lambda* (#:key inputs outputs #:allow-other-keys)
4511 (let ((out (assoc-ref outputs "out"))
4512 (utils-linux (assoc-ref inputs "utils-linux"))
4513 (cryptsetup (assoc-ref inputs "cryptsetup"))
4514 (linux-pam (assoc-ref inputs "linux-pam"))
4515 (lvm2 (assoc-ref inputs "lvm2")))
4516 (substitute* '("src/utils/ecryptfs-mount-private"
4517 "src/utils/ecryptfs-umount-private"
4518 "src/utils/ecryptfs-setup-private"
e8ec2dda 4519 "src/utils/ecryptfs-setup-swap"
17a21bcf 4520 "src/utils/mount.ecryptfs.c"
e8ec2dda 4521 "src/utils/umount.ecryptfs.c"
17a21bcf
BT
4522 "src/pam_ecryptfs/pam_ecryptfs.c"
4523 "src/desktop/ecryptfs-mount-private.desktop.in"
e8ec2dda 4524 "src/desktop/ecryptfs-setup-private.desktop.in")
17a21bcf
BT
4525 (("/bin/mount")
4526 (string-append utils-linux "/bin/mount"))
4527 (("/bin/umount")
4528 (string-append utils-linux "/bin/umount"))
4529 (("/sbin/mount.ecryptfs_private")
4530 (string-append out "/sbin/mount.ecryptfs_private"))
4531 (("/sbin/umount.ecryptfs_private")
4532 (string-append out "/sbin/umount.ecryptfs_private"))
4533 (("/usr/bin/ecryptfs-mount-private")
4534 (string-append out "/bin/ecryptfs-mount-private"))
4535 (("/usr/bin/ecryptfs-rewrite-file")
4536 (string-append out "/bin/ecryptfs-rewrite-file"))
4537 (("/usr/bin/ecryptfs-setup-private")
4538 (string-append out "/bin/ecryptfs-setup-private"))
4539 (("/sbin/cryptsetup")
4540 (string-append cryptsetup "/sbin/cryptsetup"))
4541 (("/sbin/unix_chkpwd")
4542 (string-append linux-pam "/sbin/unix_chkpwd"))
4543 (("/sbin/dmsetup")
4544 (string-append lvm2 "/sbin/dmsetup")))))))))
e385e957
TGR
4545 (native-inputs
4546 `(("intltool" ,intltool)
4547 ("perl" ,perl) ; for pod2man
4548 ("pkg-config" ,pkg-config)))
4549 (inputs
4550 `(("keyutils" ,keyutils)
4551 ("linux-pam" ,linux-pam)
17a21bcf
BT
4552 ("utils-linux" ,util-linux)
4553 ("cryptsetup" ,cryptsetup)
4554 ("lvm2" ,lvm2)
e385e957
TGR
4555 ("nss" ,nss)))
4556 (home-page "http://ecryptfs.org/")
4557 (synopsis "eCryptfs cryptographic file system utilities")
4558 (description
4559 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4560Each file's cryptographic meta-data is stored inside the file itself, along
4561with the encrypted contents. This allows individual encrypted files to be
4562copied between hosts and still be decrypted with the proper key. eCryptfs is a
4563native Linux file system, and has been part of the Linux kernel since version
45642.6.19. This package contains the userland utilities to manage it.")
4565 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4566 ;; grant additional permission to link with OpenSSL.
4567 (license license:gpl2+)))
cff0adec
DC
4568
4569(define-public libnfsidmap
4570 (package
4571 (name "libnfsidmap")
4505369c
TGR
4572 (version "0.27")
4573 (source
4574 (origin
4575 (method url-fetch)
4576 (uri (string-append "https://fedorapeople.org/~steved/"
4577 name "/" version "/" name "-" version ".tar.bz2"))
4578 (sha256
4579 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
cff0adec
DC
4580 (build-system gnu-build-system)
4581 (arguments
4582 `(#:configure-flags (list
4583 (string-append "--with-pluginpath="
4584 (assoc-ref %outputs "out")
4585 "/lib/libnfsidmap"))))
4505369c
TGR
4586 (native-inputs
4587 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
cff0adec
DC
4588 (home-page
4589 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4505369c 4590 (synopsis "NFSv4 support library for name/ID mapping")
cff0adec
DC
4591 (description "Libnfsidmap is a library holding mulitiple methods of
4592mapping names to ids and visa versa, mainly for NFSv4. It provides an
4593extensible array of mapping functions, currently consisting of two choices:
4594the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4595 (license (license:non-copyleft "file://COPYING"
4596 "See COPYING in the distribution."))))
035d3593
DC
4597
4598(define-public module-init-tools
4599 (package
4600 (name "module-init-tools")
4601 (version "3.16")
4602 (source (origin
4603 (method url-fetch)
4604 (uri (string-append
4605 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
4606 "module-init-tools-" version ".tar.bz2"))
4607 (sha256
4608 (base32
4609 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
4610 (patches (search-patches "module-init-tools-moduledir.patch"))))
4611 (build-system gnu-build-system)
4612 (arguments
4613 ;; FIXME: The upstream tarball lacks man pages, and building them would
4614 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
4615 ;; but they vanished. In the meantime, fake it.
dc1d3cde
KK
4616 '(#:phases
4617 (modify-phases %standard-phases
4618 (add-before 'configure 'fake-docbook
4619 (lambda _
4620 (substitute* "Makefile.in"
4621 (("^DOCBOOKTOMAN.*$")
4622 "DOCBOOKTOMAN = true\n"))
4623 #t)))))
81e59e41 4624 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
035d3593
DC
4625 (synopsis "Tools for loading and managing Linux kernel modules")
4626 (description
36a4366d
EF
4627 "Tools for loading and managing Linux kernel modules, such as
4628@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
035d3593 4629 (license license:gpl2+)))
dd65f3b7
TGR
4630
4631(define-public mcelog
4632 (package
4633 (name "mcelog")
e03e9c86 4634 (version "154")
dd65f3b7
TGR
4635 (source (origin
4636 (method url-fetch)
4637 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
4638 "mcelog.git/snapshot/v" version ".tar.gz"))
4639 (sha256
4640 (base32
e03e9c86 4641 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
dd65f3b7
TGR
4642 (file-name (string-append name "-" version ".tar.gz"))
4643 (modules '((guix build utils)))
4644 (snippet
6cbee49d
MW
4645 `(begin
4646 ;; The snapshots lack a .git directory,
4647 ;; breaking ‘git describe’.
4648 (substitute* "Makefile"
4649 (("\"unknown\"") (string-append "\"v" ,version "\"")))
4650 #t))))
dd65f3b7
TGR
4651 (build-system gnu-build-system)
4652 (arguments
4653 `(#:phases (modify-phases %standard-phases
4654 (delete 'configure)) ; no configure script
4655 #:make-flags (let ((out (assoc-ref %outputs "out")))
4656 (list "CC=gcc"
4657 (string-append "prefix=" out)
4658 (string-append "DOCDIR=" out "/share/doc/mcelog")
4659 "etcprefix=$(DOCDIR)/examples"))
4660 ;; The tests will only run as root on certain supported CPU models.
4661 #:tests? #f))
4662 (supported-systems (list "i686-linux" "x86_64-linux"))
71d60b96 4663 (home-page "https://mcelog.org/")
dd65f3b7
TGR
4664 (synopsis "Machine check monitor for x86 Linux systems")
4665 (description
4666 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
4667and other hardware errors on x86 systems. It can also perform user-defined
4668tasks, such as bringing bad pages off-line, when configurable error thresholds
4669are exceeded.")
4670 (license license:gpl2)))
0c60cc53
DM
4671
4672(define-public mtd-utils
4673 (package
4674 (name "mtd-utils")
9ea820a5 4675 (version "2.1.1")
0c60cc53
DM
4676 (source (origin
4677 (method url-fetch)
4678 (uri (string-append
4679 "ftp://ftp.infradead.org/pub/mtd-utils/"
4680 "mtd-utils-" version ".tar.bz2"))
4681 (sha256
4682 (base32
9ea820a5 4683 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
e8b9aaf0
EF
4684 (arguments
4685 '(#:configure-flags '("--enable-unit-tests")))
4686 (native-inputs
4687 `(("cmocka" ,cmocka)
4688 ("pkg-config" ,pkg-config)))
0c60cc53 4689 (inputs
f8f2b048 4690 `(("acl" ,acl) ; extended attributes (xattr)
0c60cc53 4691 ("libuuid" ,util-linux)
c695fb76 4692 ("lzo" ,lzo)
f8f2b048 4693 ("openssl" ,openssl) ; optional crypto support
9ea820a5
TGR
4694 ("zlib" ,zlib)
4695 ("zstd" ,zstd "lib")))
0c60cc53 4696 (build-system gnu-build-system)
0c60cc53
DM
4697 (synopsis "MTD Flash Storage Utilities")
4698 (description "This package provides utilities for testing, partitioning, etc
4699of flash storage.")
4700 (home-page "http://www.linux-mtd.infradead.org/")
4701 (license
4702 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
4703 license:mpl1.1 ; All ftl* files
4704 license:expat)))) ; libiniparser
def6213f
LF
4705
4706(define-public libseccomp
4707 (package
4708 (name "libseccomp")
e01bd1a6 4709 (version "2.4.1")
def6213f
LF
4710 (source (origin
4711 (method url-fetch)
4712 (uri (string-append "https://github.com/seccomp/libseccomp/"
4713 "releases/download/v" version
4714 "/libseccomp-" version ".tar.gz"))
4715 (sha256
4716 (base32
e01bd1a6 4717 "1s06h2cgk0xxwmhwj72z33bllafc1xqnxzk2yyra2rmg959778qw"))))
def6213f
LF
4718 (build-system gnu-build-system)
4719 (native-inputs
4720 `(("which" ,which)))
4721 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
4722 (description "The libseccomp library provides an easy to use, platform
4723independent, interface to the Linux Kernel's syscall filtering mechanism. The
4724libseccomp API is designed to abstract away the underlying BPF based syscall
4725filter language and present a more conventional function-call based filtering
4726interface that should be familiar to, and easily adopted by, application
4727developers.")
4728 (home-page "https://github.com/seccomp/libseccomp")
4729 (license license:lgpl2.1)))
58c4f11e
TGR
4730
4731(define-public radeontop
4732 (package
4733 (name "radeontop")
88e1bce5 4734 (version "1.2")
ee861a54
TGR
4735 (source
4736 (origin
4737 (method git-fetch)
4738 (uri (git-reference
4739 (url "https://github.com/clbr/radeontop.git")
4740 (commit (string-append "v" version))))
4741 (file-name (git-file-name name version))
4742 (sha256
4743 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
58c4f11e
TGR
4744 (build-system gnu-build-system)
4745 (arguments
4746 `(#:phases (modify-phases %standard-phases
4747 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4748 ;; dependency, and doesn't even work on release(!) tarballs.
4749 (add-after 'unpack 'report-correct-version
9922278b
MW
4750 (lambda _
4751 (substitute* "getver.sh"
4752 (("ver=unknown")
4753 (string-append "ver=" ,version)))
4754 #t))
58c4f11e
TGR
4755 (delete 'configure)) ; no configure script
4756 #:make-flags (list "CC=gcc"
4757 (string-append "PREFIX=" %output))
4758 #:tests? #f)) ; no tests
4759 (native-inputs
7c90d0f4 4760 `(("gettext" ,gettext-minimal)
58c4f11e
TGR
4761 ("pkg-config" ,pkg-config)))
4762 (inputs
4763 `(("libdrm" ,libdrm)
4764 ("libpciaccess" ,libpciaccess)
a7c61512 4765 ("libxcb" ,libxcb)
58c4f11e 4766 ("ncurses" ,ncurses)))
ee861a54 4767 (home-page "https://github.com/clbr/radeontop/")
58c4f11e
TGR
4768 (synopsis "Usage monitor for AMD Radeon graphics")
4769 (description "RadeonTop monitors resource consumption on supported AMD
4770Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4771a terminal or saved to a file for further processing. It measures both the
4772activity of the GPU as a whole, which is also accurate during OpenCL
4773computations, as well as separate component statistics that are only meaningful
4774under OpenGL graphics workloads.")
4775 (license license:gpl3)))
0d74462a
MB
4776
4777(define-public efivar
4778 (package
4779 (name "efivar")
f19dfeeb 4780 (version "37")
0d74462a
MB
4781 (source (origin
4782 (method url-fetch)
c6dd2790 4783 (uri (string-append "https://github.com/rhboot/" name
0d74462a
MB
4784 "/releases/download/" version "/" name
4785 "-" version ".tar.bz2"))
4786 (sha256
4787 (base32
f19dfeeb 4788 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
0d74462a
MB
4789 (build-system gnu-build-system)
4790 (arguments
4791 `(;; Tests require a UEFI system and is not detected in the chroot.
4792 #:tests? #f
4793 #:make-flags (list (string-append "prefix=" %output)
4794 (string-append "libdir=" %output "/lib")
b2b2ba40 4795 "CC_FOR_BUILD=gcc"
0d74462a
MB
4796 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4797 #:phases
4798 (modify-phases %standard-phases
f90d6c3f
MB
4799 (delete 'configure)
4800 (add-before 'build 'kernel-headers-are-system-headers
4801 (lambda* (#:key inputs #:allow-other-keys)
4802 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
4803 ;; Make sure the kernel headers are treated as system headers
4804 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
4805 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
4806 #t))))))
0d74462a
MB
4807 (native-inputs
4808 `(("pkg-config" ,pkg-config)))
4809 (inputs
4810 `(("popt" ,popt)))
c6dd2790 4811 (home-page "https://github.com/rhboot/efivar")
0d74462a
MB
4812 (synopsis "Tool and library to manipulate EFI variables")
4813 (description "This package provides a library and a command line
4814interface to the variable facility of UEFI boot firmware.")
4815 (license license:lgpl2.1+)))
1581406e
MB
4816
4817(define-public efibootmgr
4818 (package
4819 (name "efibootmgr")
732825f3 4820 (version "16")
1581406e
MB
4821 (source (origin
4822 (method url-fetch)
30559d8f
MB
4823 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
4824 "/releases/download/" version "/efibootmgr"
1581406e
MB
4825 "-" version ".tar.bz2"))
4826 (sha256
4827 (base32
732825f3 4828 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
1581406e
MB
4829 (build-system gnu-build-system)
4830 (arguments
82e7a51c 4831 `(#:tests? #f ;no tests
1581406e
MB
4832 #:make-flags (list (string-append "prefix=" %output)
4833 (string-append "libdir=" %output "/lib")
732825f3
MB
4834 ;; EFIDIR denotes a subdirectory relative to the
4835 ;; EFI System Partition where the loader will be
4836 ;; installed (known as OS_VENDOR in the code).
4837 ;; GRUB overrides this, as such it's only used if
4838 ;; nothing else is specified on the command line.
b9a30e0d
MB
4839 "EFIDIR=gnu"
4840 ;; Treat kernel headers as system headers to prevent
4841 ;; warnings about conflicting types.
4842 (string-append "C_INCLUDE_PATH="
4843 (assoc-ref %build-inputs "kernel-headers")
4844 "/include"))
732825f3 4845 #:phases (modify-phases %standard-phases (delete 'configure))))
1581406e
MB
4846 (native-inputs
4847 `(("pkg-config" ,pkg-config)))
4848 (inputs
4849 `(("efivar" ,efivar)
4850 ("popt" ,popt)))
4851 (home-page "https://github.com/rhinstaller/efibootmgr")
4852 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
4853 (description
4854 "@code{efibootmgr} is a user-space application to modify the Intel
4855Extensible Firmware Interface (EFI) Boot Manager. This application can
4856create and destroy boot entries, change the boot order, change the next
4857running boot option, and more.")
4858 (license license:gpl2+)))
6d3e08d4
LF
4859
4860(define-public sysstat
4861 (package
4862 (name "sysstat")
3d761127 4863 (version "12.1.6")
6d3e08d4
LF
4864 (source (origin
4865 (method url-fetch)
36ac9520 4866 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6d3e08d4
LF
4867 "sysstat-" version ".tar.xz"))
4868 (sha256
4869 (base32
3d761127 4870 "0agi17n82k363mf9f7cky3isq195hw112vs98v26yfhm0v2g6lpp"))))
6d3e08d4
LF
4871 (build-system gnu-build-system)
4872 (arguments
4873 `(#:tests? #f ; No test suite.
4874 ;; Without this flag, it tries to install the man pages with group 'root'
4875 ;; and fails because /etc/passwd lacks an entry for the root user.
4876 #:configure-flags
4877 (list "--disable-file-attr"
4878 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
4879 #:phases
4880 (modify-phases %standard-phases
4881 ;; The build process tries to create '/var/lib/sa', so we skip that
4882 ;; instruction.
4883 (add-after 'build 'skip-touching-var
4884 (lambda _
4885 (substitute* "Makefile"
4886 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
4887 ""))
4888 #t)))))
4889 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
4890 (synopsis "Performance monitoring tools for Linux")
4891 (description "The sysstat utilities are a collection of performance
4892monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
4893@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
4894@code{sadf} and @code{sa}.")
4895 (license license:gpl2+)))
01be4f93
JMSG
4896
4897(define-public light
4898 (package
4899 (name "light")
ff598353 4900 (version "1.2")
01be4f93 4901 (source (origin
ff598353
PL
4902 (method url-fetch)
4903 (uri (string-append
4904 "https://github.com/haikarainen/light/archive/v"
4905 version ".tar.gz"))
01be4f93
JMSG
4906 (sha256
4907 (base32
ff598353
PL
4908 "1gfvsw7gh5pis733l7j54vzp272pvjyzbg8a0pvapfmg0s7mip97"))
4909 (file-name (string-append name "-" version ".tar.gz"))))
01be4f93 4910 (build-system gnu-build-system)
01be4f93 4911 (native-inputs
ff598353
PL
4912 `(("autoconf" ,autoconf)
4913 ("automake" ,automake)))
4914 (home-page "https://haikarainen.github.io/light/")
01be4f93
JMSG
4915 (synopsis "GNU/Linux application to control backlights")
4916 (description
4917 "Light is a program to send commands to screen backlight controllers
4918under GNU/Linux. Features include:
4919
4920@itemize
4921@item It does not rely on X.
4922@item Light can automatically figure out the best controller to use, making
4923full use of underlying hardware.
4924@item It is possible to set a minimum brightness value, as some controllers
4925set the screen to be pitch black at a vaĺue of 0 (or higher).
4926@end itemize
4927
4928Light is the successor of lightscript.")
4929 (license license:gpl3+)))
189d8422 4930
ab7f1eb9
VC
4931(define-public brightnessctl
4932 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
4933 (package
4934 (name "brightnessctl")
4935 (version (git-version "0.4" "0" commit))
4936 (source (origin
4937 (method git-fetch)
4938 (uri (git-reference
4939 (url "https://github.com/Hummer12007/brightnessctl/")
4940 (commit commit)))
4941 (file-name (git-file-name name version))
4942 (sha256
4943 (base32
4944 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
4945 (build-system gnu-build-system)
4946 (arguments
4947 '(#:tests? #f ; no tests
4948 #:make-flags (list "CC=gcc"
4949 (string-append "PREFIX=" %output)
4950 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
4951 #:phases
4952 (modify-phases %standard-phases
4953 (delete 'configure)
4954 (add-after 'unpack 'adjust-udev-rules
4955 (lambda _
4956 (substitute* "90-brightnessctl.rules"
4957 (("/bin/") "/run/current-system/profile/bin/"))
4958 #t)))))
4959 (home-page "https://github.com/Hummer12007/brightnessctl")
4960 (synopsis "Backlight and LED brightness control")
4961 (description
4962 "This program allows you read and control device brightness. Devices
4963include backlight and LEDs. It can also preserve current brightness before
4964applying the operation, such as on lid close.
4965
4966The appropriate permissions must be set on the backlight or LED control
4967interface in sysfs, which can be accomplished with the included udev rules.")
4968 (license license:expat))))
4969
c7adafa7
MO
4970(define-public tlp
4971 (package
4972 (name "tlp")
5d51a977 4973 (version "1.2.2")
c7adafa7
MO
4974 (source (origin
4975 (method url-fetch)
4976 (uri (string-append
4977 "https://github.com/linrunner/"
4978 (string-upcase name)
4979 "/archive/" version ".tar.gz"))
4980 (file-name (string-append name "-" version ".tar.gz"))
4981 (sha256
4982 (base32
5d51a977 4983 "059kxrpxx580mm6p0z2a421nxngszyh4yqqhbgvn04b6a7dbsa2w"))))
c7adafa7
MO
4984 (inputs `(("bash" ,bash)
4985 ("dbus" ,dbus)
4986 ("ethtool" ,ethtool)
4987 ("eudev" ,eudev)
4988 ("grep" ,grep)
4989 ("hdparm" ,hdparm)
4990 ("inetutils" ,inetutils)
4991 ("iw" ,iw)
4992 ("kmod" ,kmod)
4993 ("pciutils" ,pciutils)
4994 ("perl" ,perl)
4995 ("rfkill" ,rfkill)
4996 ("sed" ,sed)
4997 ("usbutils" ,usbutils)
4998 ("util-linux" ,util-linux)
cf342a85
SS
4999 ("wireless-tools" ,wireless-tools)
5000 ,@(if (let ((system (or (%current-target-system)
5001 (%current-system))))
5002 (or (string-prefix? "i686-" system)
5003 (string-prefix? "x86_64-" system)))
5004 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5005 '())))
c7adafa7
MO
5006 (build-system gnu-build-system)
5007 (arguments
cf342a85
SS
5008 `(#:modules ((guix build gnu-build-system)
5009 (guix build utils)
5010 (srfi srfi-1))
5011 #:phases
c7adafa7 5012 (modify-phases %standard-phases
cef3f146 5013 (delete 'configure) ; no configure script
c7adafa7
MO
5014 (add-before 'build 'setenv
5015 (lambda* (#:key outputs #:allow-other-keys)
5016 (let ((out (assoc-ref outputs "out")))
5017 (setenv "TLP_WITH_SYSTEMD" "0")
5018 (setenv "TLP_NO_INIT" "1")
5019 (setenv "TLP_NO_PMUTILS" "1")
5020 (setenv "TLP_SBIN" (string-append out "/bin"))
5021 (setenv "TLP_BIN" (string-append out "/bin"))
c6e775a8
NG
5022 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5023 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
c7adafa7 5024 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
32e75b48 5025 (setenv "TLP_CONF" "/etc/tlp")
5d51a977
NG
5026 (setenv "TLP_ELOD"
5027 (string-append out "/lib/elogind/system-sleep"))
c7adafa7
MO
5028 (setenv "TLP_SHCPL"
5029 (string-append out "/share/bash-completion/completions"))
6db6c3a9 5030 (setenv "TLP_MAN" (string-append out "/share/man"))
272fc9dc
TGR
5031 (setenv "TLP_META" (string-append out "/share/metainfo"))
5032 #t)))
cef3f146
TGR
5033 (delete 'check) ; no tests
5034 (add-before 'install 'fix-installation
5035 (lambda _
5036 ;; Stop the Makefile from trying to create system directories.
5d51a977
NG
5037 (substitute* "Makefile"
5038 (("\\[ -f \\$\\(_CONF\\) \\]") "#")
5039 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
272fc9dc 5040 #t))
c7adafa7
MO
5041 (replace 'install
5042 (lambda _
9922278b 5043 (invoke "make" "install-tlp" "install-man")))
c7adafa7
MO
5044 (add-after 'install 'wrap
5045 (lambda* (#:key inputs outputs #:allow-other-keys)
5046 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5047 (bin-files (find-files bin ".*")))
5048 (define (bin-directory input-name)
cf342a85
SS
5049 (let ((p (assoc-ref inputs input-name)))
5050 (and p (string-append p "/bin"))))
c7adafa7
MO
5051 (define (sbin-directory input-name)
5052 (string-append (assoc-ref inputs input-name) "/sbin"))
5053 (for-each (lambda (program)
5054 (wrap-program program
5055 `("PATH" ":" prefix
5056 ,(append
cf342a85
SS
5057 (filter-map bin-directory
5058 '("bash"
5059 "coreutils"
5060 "dbus"
5061 "eudev"
5062 "grep"
5063 "inetutils"
5064 "kmod"
5065 "perl"
5066 "sed"
5067 "usbutils"
5068 "util-linux"
5069 "x86-energy-perf-policy"))
5070 (filter-map sbin-directory
5071 '("ethtool"
5072 "hdparm"
5073 "iw"
5074 "pciutils"
5075 "rfkill"
5076 "wireless-tools"))))))
272fc9dc
TGR
5077 bin-files)
5078 #t))))))
c7adafa7
MO
5079 (home-page "http://linrunner.de/en/tlp/tlp.html")
5080 (synopsis "Power management tool for Linux")
5081 (description "TLP is a power management tool for Linux. It comes with
5082a default configuration already optimized for battery life. Nevertheless,
5083TLP is customizable to fulfil system requirements. TLP settings are applied
5084every time the power supply source is changed.")
c7adafa7
MO
5085 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5086 ;; rest is GPLv2+.
5087 (license (list license:gpl2+ license:gpl3+))))
5088
189d8422
BG
5089(define-public lshw
5090 (package
5091 (name "lshw")
5092 (version "B.02.18")
5093 (source (origin
5094 (method url-fetch)
5095 (uri (string-append "https://www.ezix.org/software/"
5096 "files/lshw-" version
5097 ".tar.gz"))
5098 (sha256
5099 (base32
5100 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5101 (build-system gnu-build-system)
5102 (arguments
5103 `(#:phases (modify-phases %standard-phases (delete 'configure))
5104 #:tests? #f ; no tests
5105 #:make-flags
5106 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5107 (synopsis "List hardware information")
5108 (description
5109 "@command{lshw} (Hardware Lister) is a small tool to provide
5110detailed information on the hardware configuration of the machine.
5111It can report exact memory configuration, firmware version, mainboard
5112configuration, CPU version and speed, cache configuration, bus speed,
5113and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5114machines (PowerMac G4 is known to work).")
5115 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5116 (license license:gpl2+)))
2f4a58b5
LF
5117
5118(define-public libmnl
5119 (package
5120 (name "libmnl")
5121 (version "1.0.4")
5122 (source
5123 (origin
5124 (method url-fetch)
f11ae44f 5125 (uri (string-append "mirror://netfilter.org/libmnl/"
2f4a58b5
LF
5126 "libmnl-" version ".tar.bz2"))
5127 (sha256
5128 (base32
5129 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5130 (build-system gnu-build-system)
5131 (home-page "https://www.netfilter.org/projects/libmnl/")
5132 (synopsis "Netlink utility library")
5133 (description "Libmnl is a minimalistic user-space library oriented to
5134Netlink developers. There are a lot of common tasks in parsing, validating,
5135constructing of both the Netlink header and TLVs that are repetitive and easy to
5136get wrong. This library aims to provide simple helpers that allows you to
5137re-use code and to avoid re-inventing the wheel.")
5138 (license license:lgpl2.1+)))
b754c612
LF
5139
5140(define-public libnftnl
5141 (package
5142 (name "libnftnl")
c5e3f4f0 5143 (version "1.1.4")
b754c612 5144 (source
e569c772
TGR
5145 (origin
5146 (method url-fetch)
5147 (uri (string-append "mirror://netfilter.org/libnftnl/"
5148 "libnftnl-" version ".tar.bz2"))
5149 (sha256
c5e3f4f0 5150 (base32 "087dfc2n4saf2k68hyi4byvgz5grwpw5kfjvmkpn3wmd8y1riiy8"))))
b754c612
LF
5151 (build-system gnu-build-system)
5152 (native-inputs
5153 `(("pkg-config" ,pkg-config)))
5154 (inputs
5155 `(("libmnl" ,libmnl)))
5156 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5157 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5158 (description "Libnftnl is a userspace library providing a low-level netlink
5159programming interface to the in-kernel nf_tables subsystem. The library
5160libnftnl has been previously known as libnftables. This library is currently
5161used by nftables.")
5162 (license license:gpl2+)))
62b28c0e 5163
dfe93c9a
RH
5164(define-public nftables
5165 (package
5166 (name "nftables")
f8b7c35a 5167 (version "0.9.2")
dfe93c9a
RH
5168 (source
5169 (origin
5170 (method url-fetch)
5171 (uri (string-append "http://www.nftables.org/projects/nftables"
5172 "/files/nftables-" version ".tar.bz2"))
5173 (sha256
5174 (base32
f8b7c35a 5175 "1x8kalbggjq44j4916i6vyv1rb20dlh1dcsf9xvzqsry2j063djw"))))
dfe93c9a 5176 (build-system gnu-build-system)
9cb4bda2
RH
5177 (arguments `(#:configure-flags
5178 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
c695fb76
TGR
5179 (inputs `(("bison" ,bison)
5180 ("flex" ,flex)
5181 ("gmp" ,gmp)
5182 ("libmnl" ,libmnl)
5183 ("libnftnl" ,libnftnl)
5184 ("readline" ,readline)))
5185 (native-inputs `(("pkg-config" ,pkg-config)))
dfe93c9a
RH
5186 (home-page "http://www.nftables.org")
5187 (synopsis "Userspace utility for Linux packet filtering")
5188 (description "nftables is the project that aims to replace the existing
5189{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5190filtering framework, a new userspace utility and also a compatibility layer for
5191{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5192infrastructure such as the existing hooks, the connection tracking system, the
5193userspace queueing component and the logging subsystem.")
5194 (license license:gpl2)))
5195
62b28c0e
LC
5196(define-public proot
5197 (package
5198 (name "proot")
5199 (version "5.1.0")
674495b7
TGR
5200 (source
5201 (origin
5202 (method git-fetch)
5203 (uri (git-reference
5204 (url "https://github.com/proot-me/PRoot.git")
5205 (commit (string-append "v" version))))
5206 (file-name (git-file-name name version))
5207 (sha256
5208 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5209 (patches (search-patches "proot-test-fhs.patch"))))
62b28c0e
LC
5210 (build-system gnu-build-system)
5211 (arguments
5212 '(#:make-flags '("-C" "src")
5213
5214 #:phases (modify-phases %standard-phases
5215 (delete 'configure)
5216 (add-before 'build 'set-shell-file-name
5217 (lambda* (#:key inputs #:allow-other-keys)
5218 (substitute* (find-files "src" "\\.[ch]$")
5219 (("\"/bin/sh\"")
5220 (string-append "\""
5221 (assoc-ref inputs "bash")
5222 "/bin/sh\"")))
5223 #t))
5224 (add-before 'check 'fix-fhs-assumptions-in-tests
5225 (lambda _
5226 (substitute* "tests/test-c6b77b77.mk"
5227 (("/bin/bash") (which "bash"))
5228 (("/usr/bin/test") (which "test")))
5229 (substitute* '("tests/test-16573e73.c")
5230 (("/bin/([a-z-]+)" _ program)
5231 (which program)))
5232
5233 (substitute* (find-files "tests" "\\.sh$")
5234 ;; Some of the tests try to "bind-mount" /bin/true.
5235 (("-b /bin/true:")
5236 (string-append "-b " (which "true") ":"))
5237 ;; Likewise for /bin.
5238 (("-b /bin:") "-b /gnu:")
5239 ;; Others try to run /bin/sh.
5240 (("/bin/sh") (which "sh"))
5241 ;; Others assume /etc/fstab exists.
5242 (("/etc/fstab") "/etc/passwd"))
5243
5244 (substitute* "tests/GNUmakefile"
5245 (("-b /bin:") "-b /gnu:"))
5246
5247 ;; XXX: This test fails in an obscure corner case, just
5248 ;; skip it.
5249 (delete-file "tests/test-kkkkkkkk.c")
5250
5251 #t))
5252 (replace 'check
5253 (lambda _
5254 (let ((n (parallel-job-count)))
5255 ;; For some reason we get lots of segfaults with
5256 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5257 (setenv "PROOT_NO_SECCOMP" "1")
5258
5259 ;; Most of the tests expect "/bin" to be in $PATH so
5260 ;; they can run things that live in $ROOTFS/bin.
5261 (setenv "PATH"
5262 (string-append (getenv "PATH") ":/bin"))
5263
06153a30
MW
5264 (invoke "make" "check" "-C" "tests"
5265 ;;"V=1"
5266 "-j" (number->string n)))))
62b28c0e
LC
5267 (replace 'install
5268 (lambda* (#:key outputs #:allow-other-keys)
5269 ;; The 'install' rule does nearly nothing.
06153a30
MW
5270 (let* ((out (assoc-ref outputs "out"))
5271 (man1 (string-append out "/share/man/man1")))
5272 ;; TODO: 'make install-care' (does not even
5273 ;; build currently.)
5274 (invoke "make" "-C" "src" "install"
5275 (string-append "PREFIX=" out))
5276
5277 (mkdir-p man1)
5278 (copy-file "doc/proot/man.1"
5279 (string-append man1 "/proot.1"))
5280 #t))))))
62b28c0e
LC
5281 (native-inputs `(("which" ,which)
5282
5283 ;; For 'mcookie', used by some of the tests.
5284 ("util-linux" ,util-linux)))
5285 (inputs `(("talloc" ,talloc)))
674495b7 5286 (home-page "https://github.com/proot-me/PRoot")
62b28c0e
LC
5287 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5288 (description
5289 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5290and @code{binfmt_misc}. This means that users don't need any privileges or
5291setup to do things like using an arbitrary directory as the new root
162a1374 5292file system, making files accessible somewhere else in the file system
62b28c0e
LC
5293hierarchy, or executing programs built for another CPU architecture
5294transparently through QEMU user-mode. Also, developers can use PRoot as a
5295generic process instrumentation engine thanks to its extension mechanism.
5296Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5297available in the kernel Linux.")
5298 (license license:gpl2+)))
b9048a14
LC
5299
5300(define-public proot-static
5301 (package
5302 (inherit proot)
5303 (name "proot-static")
5304 (synopsis
5305 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5306 (inputs `(("talloc" ,talloc/static)))
5307 (arguments
5308 (substitute-keyword-arguments (package-arguments proot)
5309 ((#:make-flags flags)
5310 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5311 ((#:phases phases)
5312 `(modify-phases ,phases
5313 (add-after 'strip 'remove-store-references
5314 (lambda* (#:key outputs #:allow-other-keys)
5315 (let* ((out (assoc-ref outputs "out")))
5316 (with-directory-excursion out
5317 (remove-store-references "bin/proot")
5318 #t))))))
5319 ((#:allowed-references _ '("out"))
5320 '("out"))))))
1113386b
CL
5321
5322(define-public cpuid
5323 (package
5324 (name "cpuid")
ad21323c 5325 (version "20180519")
1113386b
CL
5326 (source (origin
5327 (method url-fetch)
5328 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5329 version ".src.tar.gz"))
5330 (sha256
5331 (base32
ad21323c 5332 "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
1113386b
CL
5333 (build-system gnu-build-system)
5334 (arguments
5335 '(#:make-flags '("CC=gcc")
fb9232d7 5336 #:tests? #f ; no tests
1113386b 5337 #:phases (modify-phases %standard-phases
fb9232d7 5338 (delete 'configure) ; no configure script
1113386b
CL
5339 (add-before 'install 'fix-makefile
5340 (lambda* (#:key outputs #:allow-other-keys)
5341 (substitute* "Makefile"
5342 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5343 ;; Make the compressed manpages writable so that the
5344 ;; reset-gzip-timestamps phase does not error out.
5345 (substitute* "Makefile"
5346 (("-m 444") "-m 644"))
5347 #t)))))
5348 (inputs `(("perl" ,perl)))
5349 (supported-systems '("i686-linux" "x86_64-linux"))
5350 (home-page "http://www.etallen.com/cpuid.html")
5351 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5352 (description "cpuid dumps detailed information about the CPU(s) gathered
5353from the CPUID instruction, and also determines the exact model of CPU(s). It
5354supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5355NexGen, Rise, and SiS CPUs.")
5356 (license license:gpl2+)))
afc9d8ec
LF
5357
5358(define-public jmtpfs
5359 (package
5360 (name "jmtpfs")
5361 (version "0.5")
5362 (source
5363 (origin
5364 (method url-fetch)
5365 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5366 version ".tar.gz"))
5367 (file-name (string-append name "-" version ".tar.gz"))
5368 (sha256
5369 (base32
5370 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5371 (build-system gnu-build-system)
5372 (inputs
5373 `(("file" ,file)
5374 ("fuse" ,fuse)
5375 ("libmtp" ,libmtp)))
5376 (native-inputs
5377 `(("pkg-config" ,pkg-config)))
5378 (home-page "https://github.com/JasonFerrara/jmtpfs")
162a1374
TGR
5379 (synopsis "Use a FUSE file system to access data over MTP")
5380 (description "jmtpfs uses FUSE (file system in userspace) to provide access
afc9d8ec 5381to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
162a1374 5382the MTP device as a file system.")
afc9d8ec 5383 (license license:gpl3)))
a73e7dd3
DL
5384
5385(define-public procenv
5386 (package
5387 (name "procenv")
cb9b1a04 5388 (version "0.50")
a73e7dd3
DL
5389 (source
5390 (origin
5391 (method url-fetch)
5392 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5393 version ".tar.gz"))
5394 (file-name (string-append name "-" version ".tar.gz"))
5395 (sha256
cb9b1a04 5396 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
a73e7dd3
DL
5397 (build-system gnu-build-system)
5398 (arguments `(#:configure-flags '("--disable-silent-rules")))
86574116 5399 (native-inputs `(("pkg-config" ,pkg-config)))
a73e7dd3
DL
5400 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5401 ("groff" ,groff) ; for tests
5402 ("libselinux" ,libselinux)))
5403 (synopsis "Utility to show process environment")
5404 (description "Procenv is a command-line tool that displays as much detail about
5405itself and its environment as possible. It can be used as a test
5406tool, to understand the type of environment a process runs in, and for
5407comparing system environments.")
5408 (home-page "http://github.com/jamesodhunt/procenv/")
5409 (license license:gpl3+)))
ae5947b0
DL
5410
5411(define-public libfabric
5412 (package
5413 (name "libfabric")
5414 (version "1.4.1")
5415 (source
5416 (origin
5417 (method url-fetch)
5418 (uri
5419 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5420 version "/libfabric-" version ".tar.bz2"))
5421 (sha256
5422 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5423 (build-system gnu-build-system)
5424 (inputs `(("rdma-core" ,rdma-core)
91298042
EF
5425 ,@(match (%current-system)
5426 ((member (package-supported-systems psm))
5427 `(("psm" ,psm)))
5428 (_ `()))
ae5947b0
DL
5429 ("libnl" ,libnl)))
5430 (home-page "https://ofiwg.github.io/libfabric/")
5431 (synopsis "Open Fabric Interfaces")
5432 (description
5433 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5434communication services to applications. OFI is best described as a collection
5435of libraries and applications used to export fabric services. The key
5436components of OFI are: application interfaces, provider libraries, kernel
5437services, daemons, and test applications.
5438
5439Libfabric is a core component of OFI. It is the library that defines and
5440exports the user-space API of OFI, and is typically the only software that
5441applications deal with directly. It works in conjunction with provider
5442libraries, which are often integrated directly into libfabric.")
5443 (license (list license:bsd-2 license:gpl2)))) ;dual
fd23d259
DL
5444
5445(define-public psm
5446 (package
5447 (name "psm")
5448 (version "3.3.20170428")
b50a9cc0 5449 (home-page "https://github.com/intel/psm")
fd23d259
DL
5450 (source
5451 (origin
5452 (method git-fetch)
b50a9cc0 5453 (uri (git-reference (url home-page)
fd23d259
DL
5454 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5455 (file-name (string-append "psm-" version ".tar.gz"))
5456 (sha256
5457 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5458 (patches (search-patches
5459 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5460 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5461 "psm-repro.patch")))) ; reproducibility
5462 (build-system gnu-build-system)
5463 (inputs `(("libuuid" ,util-linux)))
5464 (arguments
5465 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5466 ,(string-append "INSTALL_PREFIX=" %output)
5467 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5468 #:tests? #f
5469 #:phases (modify-phases %standard-phases
5470 (delete 'configure)
5471 (add-after 'unpack 'patch-/usr/include
5472 (lambda _
5473 (substitute* "Makefile"
5474 (("\\$\\{DESTDIR}/usr/include")
5475 (string-append %output "/include")))
5476 (substitute* "Makefile"
5477 (("/lib64") "/lib"))
41313ace
EB
5478 #t))
5479 (add-after 'unpack 'patch-sysmacros
5480 (lambda _
5481 (substitute* "ipath/ipath_proto.c"
5482 (("#include <sys/poll.h>" m)
5483 (string-append m "\n"
5484 "#include <sys/sysmacros.h>")))
fd23d259 5485 #t)))))
fd23d259
DL
5486 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5487 (description
5488 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5489communications interface for the True Scale family of products. PSM users are
5490enabled with mechanisms necessary to implement higher level communications
5491interfaces in parallel environments.")
b516b780
EF
5492 ;; Only Intel-compatable processors are supported.
5493 (supported-systems '("i686-linux" "x86_64-linux"))
fd23d259 5494 (license (list license:bsd-2 license:gpl2)))) ;dual
c1c82584
TGR
5495
5496(define-public snapscreenshot
5497 (package
5498 (name "snapscreenshot")
5499 (version "1.0.14.3")
5500 (source
5501 (origin
5502 (method url-fetch)
5503 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5504 name "-" version ".tar.bz2"))
5505 (sha256
5506 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5507 (build-system gnu-build-system)
5508 (arguments
5509 `(#:make-flags
5510 (let ((out (assoc-ref %outputs "out")))
5511 (list (string-append "BINDIR=" out "/bin")
5512 (string-append "MANDIR=" out "/share/man")))
5513 #:tests? #f ; no test suite
5514 #:phases
5515 (modify-phases %standard-phases
5516 (delete 'configure) ; ./configure is a snarky no-op
5517 (add-before 'install 'fix-ownership
5518 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5519 (lambda _
5520 (substitute* "depfun.mak"
5521 ((" -o bin -g bin ") " "))
5522 #t))
5523 (add-before 'install 'create-output-directories
5524 (lambda* (#:key outputs #:allow-other-keys)
5525 (let ((out (assoc-ref outputs "out")))
5526 (mkdir-p (string-append out "/share/man/man1"))
5527 #t))))))
81e59e41 5528 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
c1c82584
TGR
5529 (synopsis "Take screenshots of one or more Linux text consoles")
5530 (description
5531 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
5532Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
5533relevant @file{/dev/vcs*} file(s).")
5534 (license license:gpl2)))
8d8d227b
TGR
5535
5536(define-public fbcat
5537 (package
5538 (name "fbcat")
7f86e5e7 5539 (version "0.5.1")
8d8d227b
TGR
5540 (source
5541 (origin
5542 (method url-fetch)
5543 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
5544 version "/" name "-" version ".tar.gz"))
5545 (sha256
7f86e5e7 5546 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
8d8d227b 5547 (build-system gnu-build-system)
8d8d227b
TGR
5548 (inputs
5549 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
5550 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
5551 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
5552 `(("pnmtopng" ,netpbm)))
5553 (outputs (list "out" "fbgrab"))
5554 (arguments
7f86e5e7
TGR
5555 `(#:make-flags
5556 (list "CC=gcc"
5557 (string-append "PREFIX=" (assoc-ref %outputs "out")))
8d8d227b
TGR
5558 #:tests? #f ; no tests
5559 #:phases
5560 (modify-phases %standard-phases
8d8d227b 5561 (delete 'configure) ; no configure script
8d8d227b
TGR
5562 (add-after 'build 'qualify-references
5563 (lambda* (#:key inputs outputs #:allow-other-keys)
5564 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5565 (out (assoc-ref outputs "out")))
5566 (substitute* "fbgrab"
5567 (("fbcat" all)
5568 (string-append out "/bin/" all))
5569 (("pnmtopng" all)
5570 (string-append pnmtopng "/bin/" all)))
5571 #t)))
7f86e5e7 5572 (add-after 'install 'split-fbgrab-output
8d8d227b
TGR
5573 (lambda* (#:key outputs #:allow-other-keys)
5574 (let* ((out (assoc-ref outputs "out"))
5575 (out:fbgrab (assoc-ref outputs "fbgrab")))
7f86e5e7
TGR
5576 (for-each (lambda (file)
5577 (let ((old (string-append out "/" file))
5578 (new (string-append out:fbgrab "/" file)))
5579 (mkdir-p (dirname new))
5580 (rename-file old new)))
5581 (list "bin/fbgrab"
5582 "share/man/man1/fbgrab.1"))
8d8d227b
TGR
5583 #t))))))
5584 (home-page "https://jwilk.net/software/fbcat")
5585 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
5586 (description
5587 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
5588a dump therof. It supports a wide range of drivers and pixel formats.
5589@command{fbcat} can take screenshots of virtually any application that can be
5590made to write its output to the framebuffer, including (but not limited to)
5591text-mode or graphical applications that don't use a display server.
5592
5593Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
5594emulates the behaviour of Gunnar Monell's older fbgrab utility.")
5595 (license license:gpl2)))
a69e0cf3
5596
5597(define-public libcgroup
5598 (package
5599 (name "libcgroup")
5600 (version "0.41")
5601 (source
5602 (origin
5603 (method url-fetch)
5604 (uri (string-append
5605 "mirror://sourceforge/libcg/" name "/"
5606 version "/" name "-" version ".tar.bz2"))
5607 (sha256
5608 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
5609 (build-system gnu-build-system)
5610 (arguments
5611 `(#:tests? #f))
5612 (native-inputs
5613 `(("bison" ,bison)
5614 ("flex" ,flex)))
5615 (inputs
5616 `(("linux-pam" ,linux-pam)))
5617 (home-page "https://sourceforge.net/projects/libcg/")
5618 (synopsis "Control groups management tools")
5619 (description "Control groups is Linux kernel method for process resource
5620restriction, permission handling and more. This package provides userspace
5621interface to this kernel feature.")
5622 (license license:lgpl2.1)))
5849c68a
R
5623
5624(define-public mbpfan
5625 (package
5626 (name "mbpfan")
26fad5b7 5627 (version "2.1.1")
5849c68a
R
5628 (source
5629 (origin
5478ab1e
TGR
5630 (method git-fetch)
5631 (uri (git-reference
5632 (url "https://github.com/dgraziotin/mbpfan.git")
5633 (commit (string-append "v" version))))
5634 (file-name (git-file-name name version))
5849c68a 5635 (sha256
26fad5b7 5636 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5849c68a
R
5637 (build-system gnu-build-system)
5638 (arguments
697c5846 5639 '(#:tests? #f ; tests ask to be run as root
5849c68a
R
5640 #:make-flags (let ((out (assoc-ref %outputs "out")))
5641 (list (string-append "DESTDIR=" out)
5642 "CC=gcc"))
5643 #:phases
5644 (modify-phases %standard-phases
5645 (add-after 'unpack 'patch-paths
5646 (lambda _
5647 (substitute* "Makefile"
5648 (("/usr") ""))
5649 #t))
697c5846 5650 (delete 'configure)))) ; there's no configure phase
5849c68a
R
5651 (home-page "https://github.com/dgraziotin/mbpfan")
5652 (synopsis "Control fan speed on Macbooks")
5653 (description
5654 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
5655the @code{coretemp} module and sets the fan speed using the @code{applesmc}
5656module. It can be executed as a daemon or in the foreground with root
5657privileges.")
5658 (license license:gpl3+)))
25637b77
PAR
5659
5660(define-public psm2
5661 (package
5662 (name "psm2")
5663 (version "10.3-46")
5664 (source (origin
5665 (method git-fetch)
5666 (uri (git-reference
5667 (url "https://github.com/intel/opa-psm2.git")
5668 (commit (string-append "PSM2_" version))))
5669 (file-name (git-file-name name version))
5670 (sha256
5671 (base32
5672 "0wadphv4rl5p38x6a3dgpbijlzqdvcn02cfafnp72nh9faz0zvlx"))))
5673 (build-system gnu-build-system)
5674 (arguments
5675 '(#:make-flags
5676 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5677 #:tests? #f
5678 #:phases (modify-phases %standard-phases
5679 (delete 'configure)
5680 (add-after 'unpack 'patch-Makefiles
5681 (lambda _
5682 (substitute* "Makefile"
5683 (("/lib64") "/lib")
5684 (("/usr") ""))
5685 (substitute* "compat/Makefile"
5686 (("/lib64") "/lib")
5687 (("/usr") ""))
5688 #t))
5689 (replace 'install
5690 (lambda _
5691 (setenv "DESTDIR" %output)
5692 (invoke "make" "install")
5693 #t)))))
5694 (inputs
5695 `(("rdma-core" ,rdma-core)
5696 ("numactl" ,numactl)))
5697 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
5698 (description
5699 "This package is low-level user-level Intel's communications interface.
5700The PSM2 API is a high-performance vendor-specific protocol that provides a
5701low-level communications interface for the Intel Omni-Path family of
5702high-speed networking devices.")
5703 (home-page "https://github.com/intel/opa-psm2")
5704 ;; Only the x86_64 architecure is supported.
5705 (supported-systems '("x86_64-linux"))
5706 (license (list license:bsd-3 license:gpl2)))) ; dual
2690b6ce
PAR
5707
5708(define-public libpfm4
5709 (package
5710 (name "libpfm4")
5711 (version "4.9.0")
5712 (source (origin
5713 (method url-fetch)
5714 (uri (string-append "mirror://sourceforge/perfmon2/"
5715 name "/libpfm-" version ".tar.gz"))
5716 (sha256
5717 (base32
5718 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
5719 (build-system gnu-build-system)
5720 (arguments
5721 '(#:modules ((guix build utils)
5722 (guix build gnu-build-system))
5723 #:phases (modify-phases %standard-phases
5724 (delete 'configure)
5725 (delete 'check)
5726 (replace 'build
5727 (lambda* (#:key inputs outputs #:allow-other-keys)
5728 (let* ((out (assoc-ref outputs "out")))
5729 (setenv "CC" "gcc")
5730 (invoke "make")
5731 #t)))
5732 (replace 'install
5733 (lambda* (#:key outputs #:allow-other-keys)
5734 (let* ((out (assoc-ref outputs "out")))
5735 (invoke "make"
5736 (string-append "PREFIX=" out)
5737 "install")
5738 #t))))))
5739 (synopsis "Performance event monitoring library")
5740 (description
5741 "This package provides a library called libpfm4, which is used to develop
5742monitoring tools exploiting the performance monitoring events such as those
5743provided by the Performance Monitoring Unit (PMU) of modern processors.
5744
5745Libpfm4 helps convert from an event name, expressed as a string, to the event
5746encoding that is either the raw event as documented by the hardware vendor or
5747the OS-specific encoding. In the latter case, the library is able to prepare
5748the OS-specific data structures needed by the kernel to setup the event.
5749
5750libpfm4 provides support for the @code{perf_events} interface, which was
5751introduced in Linux 2.6.31.")
5752 (home-page "http://perfmon2.sourceforge.net/")
5753 (license license:expat)))
4dd1fb79
SB
5754
5755(define-public libnfnetlink
5756 (package
5757 (name "libnfnetlink")
5758 (version "1.0.1")
5759 (source (origin
5760 (method url-fetch)
5761 (uri (string-append
5762 "https://www.netfilter.org/projects/libnfnetlink/files/"
5763 "libnfnetlink-" version ".tar.bz2"))
5764 (sha256
5765 (base32
5766 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
5767 (build-system gnu-build-system)
5768 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
5769 (synopsis "Low-level netfilter netlink communication library")
5770 (description
5771 "@code{libnfnetlink} is the low-level library for netfilter related
5772kernel/userspace communication. It provides a generic messaging
5773infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
5774nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
5775management tools in userspace.")
5776 (license license:gpl2)))
e4231cfe 5777
626de0d1
MC
5778(define-public go-netlink
5779 (package
5780 (name "go-netlink")
5781 (version "1.0.0")
5782 (source (origin
5783 (method git-fetch)
5784 (uri (git-reference
5785 (url "https://github.com/vishvananda/netlink.git")
5786 (commit (string-append "v" version))))
5787 (file-name (git-file-name name version))
5788 (sha256
5789 (base32
5790 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
5791 (build-system go-build-system)
5792 (arguments
5793 `(#:import-path "github.com/vishvananda/netlink"))
5794 (native-inputs
5795 `(("go-golang-org-x-sys-unix" ,go-golang-org-x-sys-unix)
5796 ("go-netns" ,go-netns)))
5797 (home-page "https://github.com/vishvananda/netlink")
5798 (synopsis "Simple netlink library for Go")
5799 (description "The netlink package provides a simple netlink library for
5800Go. Netlink is the interface a user-space program in Linux uses to
5801communicate with the kernel. It can be used to add and remove interfaces, set
5802IP addresses and routes, and configure IPsec.")
5803 (license license:asl2.0)))
5804
e4231cfe
DM
5805(define-public xfsprogs
5806 (package
5807 (name "xfsprogs")
9e6008b7 5808 (version "4.20.0")
e4231cfe
DM
5809 (source (origin
5810 (method url-fetch)
5811 (uri (string-append
5812 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
5813 "xfsprogs-" version ".tar.gz"))
5814 (sha256
5815 (base32
9e6008b7 5816 "0ss0r6jlxxinf9fhpc0fgf7b89n9mzirpa85xxjmi1ix9l6cls6x"))))
e4231cfe
DM
5817 (build-system gnu-build-system)
5818 (arguments
2f2ef9d9
MB
5819 `(#:tests? #f ;kernel/user integration tests are in package "xfstests"
5820 #:phases (modify-phases %standard-phases
5821 (add-after 'install 'install-headers
5822 (lambda _
5823 (invoke "make" "install-dev"))))))
e4231cfe
DM
5824 (native-inputs
5825 `(("gettext" ,gettext-minimal)
5826 ("util-linux" ,util-linux)))
5827 (home-page "https://xfs.wiki.kernel.org/")
5828 (synopsis "XFS file system tools")
5829 (description "This package provides commands to create and check XFS
5830file systems.")
5831 ;; The library "libhandle" and the headers in "xfslibs-dev" are
5832 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
5833 (license (list license:gpl2 license:lgpl2.1))))
c63d7b79
DM
5834
5835(define-public genext2fs
5836 (package
5837 (name "genext2fs")
083639a5 5838 (version "1.4.1-4")
c63d7b79
DM
5839 (source (origin
5840 (method git-fetch)
5841 (uri (git-reference
5842 (url "https://github.com/jeremie-koenig/genext2fs.git")
083639a5
TGR
5843 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
5844 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
c63d7b79
DM
5845 (file-name (git-file-name name version))
5846 (sha256
083639a5 5847 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
c63d7b79 5848 (build-system gnu-build-system)
083639a5
TGR
5849 (arguments
5850 `(#:phases
5851 (modify-phases %standard-phases
5852 (add-after 'unpack 'apply-debian-patches
5853 ;; Debian changes (the revision after ‘-’ in VERSION) are
5854 ;; maintained as separate patches. Apply those relevant to us.
5855 (lambda _
5856 (for-each
5857 (lambda (file-name)
5858 (invoke "patch" "-p1" "-i"
5859 (string-append "debian/patches/" file-name)))
5860 (list "blocksize+creator.diff" ; add -B/-o options
5861 "byteswap_fix.diff"))
5862 #t)))))
5863 (native-inputs
5864 `(("autoconf" ,autoconf)
5865 ("automake" ,automake)))
c63d7b79 5866 (home-page "https://github.com/jeremie-koenig/genext2fs")
52beae7b
TGR
5867 (synopsis "Generate ext2 file system as a normal user")
5868 (description "This package provides a program to generate an ext2
5869file system as a normal (non-root) user. It does not require you to mount
c63d7b79
DM
5870the image file to copy files on it, nor does it require that you become
5871the superuser to make device nodes.")
5872 (license license:gpl2)))
d1dfcc7c
DM
5873
5874(define-public fakeroot
5875 (package
5876 (name "fakeroot")
ae1bab3e 5877 (version "1.24")
d1dfcc7c
DM
5878 (source (origin
5879 (method url-fetch)
ae1bab3e
TGR
5880 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
5881 "fakeroot/fakeroot_" version ".orig.tar.gz"))
d1dfcc7c
DM
5882 (file-name (string-append name "-" version ".tar.gz"))
5883 (sha256
5884 (base32
ae1bab3e 5885 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
d1dfcc7c
DM
5886 (build-system gnu-build-system)
5887 (arguments
5888 `(#:phases
5889 (modify-phases %standard-phases
5890 (add-after 'configure 'patch-Makefile
5891 (lambda _
5892 ;; Note: The root of the problem is already in "Makefile.am".
5893 (substitute* "Makefile"
5894 (("/bin/sh") (which "sh")))
5895 #t))
5896 (add-after 'unpack 'patch-getopt
5897 (lambda* (#:key inputs #:allow-other-keys)
5898 (substitute* "scripts/fakeroot.in"
5899 (("getopt")
5900 (string-append (assoc-ref inputs "util-linux")
5901 "/bin/getopt")))
5902 #t))
0d5c5b1b
DM
5903 (add-before 'configure 'setenv
5904 (lambda _
5905 (setenv "LIBS" "-lacl")
5906 #t))
d1dfcc7c
DM
5907 (add-before 'check 'prepare-check
5908 (lambda _
5909 (setenv "SHELL" (which "bash"))
5910 (setenv "VERBOSE" "1")
5911 (substitute* "test/t.touchinstall"
5912 ;; We don't have the name of the root user, so use ID=0.
5913 (("grep root") "grep \"\\<0\\>\""))
5914 (substitute* "test/tartest"
5915 ;; We don't have the name of the root group, so use ID=0.
5916 (("ROOTGROUP=root") "ROOTGROUP=0")
5917 ;; We don't have the name of the daemon user, so use IDs.
5918 (("daemon:sys") "1:3")
5919 (("daemon:") "1:"))
5920 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
5921 (substitute* "test/compare-tar"
5922 (("tar -tvf") "tar --numeric-owner -tvf"))
5923 #t)))))
5924 (native-inputs
0d5c5b1b
DM
5925 `(("acl" ,acl)
5926 ("sharutils" ,sharutils) ; for the tests
d1dfcc7c
DM
5927 ("xz" ,xz))) ; for the tests
5928 (inputs
5929 `(("libcap" ,libcap)
5930 ("util-linux" ,util-linux)))
5931 (synopsis "Provides a fake root environment")
5932 (description "@command{fakeroot} runs a command in an environment where
5933it appears to have root privileges for file manipulation. This is useful
5934for allowing users to create archives (tar, ar, .deb etc.) with files in
5935them with root permissions/ownership. Without fakeroot one would have to
5936have root privileges to create the constituent files of the archives with
5937the correct permissions and ownership, and then pack them up, or one would
5938have to construct the archives directly, without using the archiver.")
5939 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
5940 (license license:gpl3+)))
bf2a9969
TG
5941
5942(define-public inputattach
5943 (package
5944 (name "inputattach")
5945 (version "0.42.0")
5946 (source (origin
5947 (method git-fetch)
5948 (uri (git-reference
5949 (url "https://github.com/linuxwacom/input-wacom.git")
5950 (commit (string-append "input-wacom-" version))))
5951 (file-name (git-file-name name version))
5952 (sha256
5953 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
5954 (build-system gnu-build-system)
5955 (arguments
5956 `(#:phases
5957 (modify-phases %standard-phases
5958 (delete 'bootstrap)
5959 (delete 'configure)
5960 (replace 'build
5961 (lambda* (#:key inputs #:allow-other-keys)
5962 (with-directory-excursion "inputattach"
5963 (invoke (string-append (assoc-ref inputs "gcc")
5964 "/bin/gcc")
5ddf98da 5965 "-O2" "-o" "inputattach" "inputattach.c"))
bf2a9969
TG
5966 #t))
5967 (delete 'check)
5968 (replace 'install
5969 (lambda* (#:key outputs #:allow-other-keys)
5970 (let ((target-dir (string-append
5971 (assoc-ref outputs "out")
5972 "/bin/")))
5973 (mkdir-p target-dir)
5974 (copy-file "inputattach/inputattach"
5975 (string-append target-dir
5976 "inputattach"))
5977 #t))))))
5978 (home-page "https://linuxwacom.github.io/")
5979 (synopsis "Dispatch input peripherals events to a device file")
5980 (description "inputattach dispatches input events from several device
5981types and interfaces and translates so that the X server can use them.")
5982 (license license:gpl2+)))