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