gnu: Add rename.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
... / ...
CommitLineData
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 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 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 Efraim Flashner <efraim@flashner.co.il>
9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10;;; Copyright © 2016, 2017, 2018 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 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15;;; Copyright © 2016 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 Marius Bakke <mbakke@fastmail.com>
19;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
20;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
22;;; Copyright © 2017 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 Mathieu Othacehe <m.othacehe@gmail.com>
26;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
27;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
28;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29;;; Copyright © 2017 Dave Love <fx@gnu.org>
30;;;
31;;; This file is part of GNU Guix.
32;;;
33;;; GNU Guix is free software; you can redistribute it and/or modify it
34;;; under the terms of the GNU General Public License as published by
35;;; the Free Software Foundation; either version 3 of the License, or (at
36;;; your option) any later version.
37;;;
38;;; GNU Guix is distributed in the hope that it will be useful, but
39;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41;;; GNU General Public License for more details.
42;;;
43;;; You should have received a copy of the GNU General Public License
44;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
45
46(define-module (gnu packages linux)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages acl)
49 #:use-module (gnu packages admin)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages attr)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages backup)
54 #:use-module (gnu packages base)
55 #:use-module (gnu packages bash)
56 #:use-module (gnu packages bison)
57 #:use-module (gnu packages calendar)
58 #:use-module (gnu packages check)
59 #:use-module (gnu packages crypto)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages databases)
62 #:use-module (gnu packages datastructures)
63 #:use-module (gnu packages docbook)
64 #:use-module (gnu packages documentation)
65 #:use-module (gnu packages elf)
66 #:use-module (gnu packages flex)
67 #:use-module (gnu packages file)
68 #:use-module (gnu packages freedesktop)
69 #:use-module (gnu packages gcc)
70 #:use-module (gnu packages gettext)
71 #:use-module (gnu packages glib)
72 #:use-module (gnu packages gnuzilla)
73 #:use-module (gnu packages gperf)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages libunwind)
76 #:use-module (gnu packages libusb)
77 #:use-module (gnu packages man)
78 #:use-module (gnu packages maths)
79 #:use-module (gnu packages multiprecision)
80 #:use-module (gnu packages ncurses)
81 #:use-module (gnu packages netpbm)
82 #:use-module (gnu packages networking)
83 #:use-module (gnu packages ninja)
84 #:use-module (gnu packages perl)
85 #:use-module (gnu packages pciutils)
86 #:use-module (gnu packages pkg-config)
87 #:use-module (gnu packages popt)
88 #:use-module (gnu packages pulseaudio)
89 #:use-module (gnu packages python)
90 #:use-module (gnu packages readline)
91 #:use-module (gnu packages rrdtool)
92 #:use-module (gnu packages samba)
93 #:use-module (gnu packages slang)
94 #:use-module (gnu packages storage)
95 #:use-module (gnu packages texinfo)
96 #:use-module (gnu packages tls)
97 #:use-module (gnu packages valgrind)
98 #:use-module (gnu packages video)
99 #:use-module (gnu packages web)
100 #:use-module (gnu packages xiph)
101 #:use-module (gnu packages xml)
102 #:use-module (gnu packages xdisorg)
103 #:use-module (gnu packages xorg)
104 #:use-module (gnu packages groff)
105 #:use-module (gnu packages selinux)
106 #:use-module (gnu packages swig)
107 #:use-module (guix build-system cmake)
108 #:use-module (guix build-system gnu)
109 #:use-module (guix build-system python)
110 #:use-module (guix build-system trivial)
111 #:use-module (guix download)
112 #:use-module (guix git-download)
113 #:use-module ((guix licenses) #:prefix license:)
114 #:use-module (guix packages)
115 #:use-module (guix utils)
116 #:use-module (srfi srfi-1)
117 #:use-module (srfi srfi-2)
118 #:use-module (srfi srfi-26)
119 #:use-module (ice-9 match))
120
121(define-public (system->linux-architecture arch)
122 "Return the Linux architecture name for ARCH, a Guix system name such as
123\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
124 (let ((arch (car (string-split arch #\-))))
125 (cond ((string=? arch "i686") "i386")
126 ((string-prefix? "mips" arch) "mips")
127 ((string-prefix? "arm" arch) "arm")
128 ((string-prefix? "aarch64" arch) "arm64")
129 ((string-prefix? "alpha" arch) "alpha")
130 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
131 (else arch))))
132
133(define-public (system->defconfig system)
134 "Some systems (notably powerpc-linux) require a special target for kernel
135defconfig. Return the appropriate make target if applicable, otherwise return
136\"defconfig\"."
137 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
138 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
139 (else "defconfig")))
140
141(define (linux-libre-urls version)
142 "Return a list of URLs for Linux-Libre VERSION."
143 (list (string-append
144 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
145 version "-gnu/linux-libre-" version "-gnu.tar.xz")
146
147 ;; XXX: Work around <http://bugs.gnu.org/14851>.
148 (string-append
149 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
150 version "-gnu.tar.xz")
151
152 ;; Maybe this URL will become valid eventually.
153 (string-append
154 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
155 version "-gnu.tar.xz")))
156
157(define-public linux-libre-headers
158 (package
159 (name "linux-libre-headers")
160 (version "4.4.47")
161 (source (origin
162 (method url-fetch)
163 (uri (linux-libre-urls version))
164 (sha256
165 (base32
166 "00zdq7swhvzbbnnhzizq6m34q5k4fycpcp215bmkbxh1ic76v7bs"))))
167 (build-system gnu-build-system)
168 (native-inputs `(("perl" ,perl)))
169 (arguments
170 `(#:modules ((guix build gnu-build-system)
171 (guix build utils)
172 (srfi srfi-1))
173 #:phases
174 (modify-phases %standard-phases
175 (delete 'configure)
176 (replace 'build
177 (lambda _
178 (let ((arch ,(system->linux-architecture
179 (or (%current-target-system)
180 (%current-system))))
181 (defconfig ,(system->defconfig
182 (or (%current-target-system)
183 (%current-system)))))
184 (setenv "ARCH" arch)
185 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
186 (and (zero? (system* "make" defconfig))
187 (zero? (system* "make" "mrproper" "headers_check"))))))
188 (replace 'install
189 (lambda* (#:key outputs #:allow-other-keys)
190 (let ((out (assoc-ref outputs "out")))
191 (and (zero? (system* "make"
192 (string-append "INSTALL_HDR_PATH=" out)
193 "headers_install"))
194 (begin
195 (mkdir (string-append out "/include/config"))
196 (call-with-output-file
197 (string-append out
198 "/include/config/kernel.release")
199 (lambda (p)
200 (format p "~a-default~%" ,version)))
201
202 ;; Remove the '.install' and '..install.cmd' files; the
203 ;; latter contains store paths, which pulls in bootstrap
204 ;; binaries in the build environment, and prevents bit
205 ;; reproducibility for the bootstrap binaries.
206 (for-each delete-file (find-files out "\\.install"))
207
208 #t))))))
209 #:allowed-references ()
210 #:tests? #f))
211 (home-page "https://www.gnu.org/software/linux-libre/")
212 (synopsis "GNU Linux-Libre kernel headers")
213 (description "Headers of the Linux-Libre kernel.")
214 (license license:gpl2)))
215
216(define %boot-logo-patch
217 ;; Linux-Libre boot logo featuring Freedo and a gnu.
218 (origin
219 (method url-fetch)
220 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
221 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
222 (sha256
223 (base32
224 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
225
226(define* (kernel-config arch #:key variant)
227 "Return the absolute file name of the Linux-Libre build configuration file
228for ARCH and optionally VARIANT, or #f if there is no such configuration."
229 (let* ((name (string-append (if variant (string-append variant "-") "")
230 (if (string=? "i386" arch) "i686" arch) ".conf"))
231 (file (string-append "linux-libre/" name)))
232 (search-auxiliary-file file)))
233
234(define %default-extra-linux-options
235 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
236 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
237 ;; Modules required for initrd:
238 ("CONFIG_NET_9P" . m)
239 ("CONFIG_NET_9P_VIRTIO" . m)
240 ("CONFIG_VIRTIO_BLK" . m)
241 ("CONFIG_VIRTIO_NET" . m)
242 ("CONFIG_VIRTIO_PCI" . m)
243 ("CONFIG_VIRTIO_BALLOON" . m)
244 ("CONFIG_VIRTIO_MMIO" . m)
245 ("CONFIG_FUSE_FS" . m)
246 ("CONFIG_CIFS" . m)
247 ("CONFIG_9P_FS" . m)))
248
249(define (config->string options)
250 (string-join (map (match-lambda
251 ((option . 'm)
252 (string-append option "=m"))
253 ((option . #t)
254 (string-append option "=y"))
255 ((option . #f)
256 (string-append option "=n")))
257 options)
258 "\n"))
259
260(define* (make-linux-libre version hash supported-systems
261 #:key
262 ;; A function that takes an arch and a variant.
263 ;; See kernel-config for an example.
264 (extra-version #f)
265 (configuration-file #f)
266 (defconfig "defconfig")
267 (extra-options %default-extra-linux-options)
268 (patches (list %boot-logo-patch)))
269 (package
270 (name (if extra-version
271 (string-append "linux-libre-" extra-version)
272 "linux-libre"))
273 (version version)
274 (source (origin
275 (method url-fetch)
276 (uri (linux-libre-urls version))
277 (sha256 (base32 hash))
278 (patches patches)))
279 (supported-systems supported-systems)
280 (build-system gnu-build-system)
281 (native-inputs
282 `(("perl" ,perl)
283 ("bc" ,bc)
284 ("openssl" ,openssl)
285 ("kmod" ,kmod)
286 ,@(match (and configuration-file
287 (configuration-file
288 (system->linux-architecture
289 (or (%current-target-system) (%current-system)))
290 #:variant (version-major+minor version)))
291 (#f ;no config for this platform
292 '())
293 ((? string? config)
294 `(("kconfig" ,config))))))
295 (arguments
296 `(#:modules ((guix build gnu-build-system)
297 (guix build utils)
298 (srfi srfi-1)
299 (ice-9 match))
300 #:phases
301 (modify-phases %standard-phases
302 (replace 'configure
303 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
304 ;; Avoid introducing timestamps
305 (setenv "KCONFIG_NOTIMESTAMP" "1")
306 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
307
308 ;; Set ARCH and CROSS_COMPILE
309 (let ((arch ,(system->linux-architecture
310 (or (%current-target-system)
311 (%current-system)))))
312 (setenv "ARCH" arch)
313 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
314
315 (when target
316 (setenv "CROSS_COMPILE" (string-append target "-"))
317 (format #t "`CROSS_COMPILE' set to `~a'~%"
318 (getenv "CROSS_COMPILE"))))
319
320 (setenv "EXTRA_VERSION" ,extra-version)
321
322 (let ((build (assoc-ref %standard-phases 'build))
323 (config (assoc-ref (or native-inputs inputs) "kconfig")))
324
325 ;; Use a custom kernel configuration file or a default
326 ;; configuration file.
327 (if config
328 (begin
329 (copy-file config ".config")
330 (chmod ".config" #o666))
331 (system* "make" ,defconfig))
332
333 ;; Appending works even when the option wasn't in the
334 ;; file. The last one prevails if duplicated.
335 (let ((port (open-file ".config" "a"))
336 (extra-configuration ,(config->string extra-options)))
337 (display extra-configuration port)
338 (close-port port))
339
340 (zero? (system* "make" "oldconfig")))))
341 (replace 'install
342 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
343 (let* ((out (assoc-ref outputs "out"))
344 (moddir (string-append out "/lib/modules"))
345 (dtbdir (string-append out "/lib/dtbs"))
346 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
347 ;; Install kernel image, kernel configuration and link map.
348 (for-each (lambda (file) (install-file file out))
349 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map)$"))
350 ;; Install device tree files
351 (for-each (lambda (file) (install-file file dtbdir))
352 (find-files "." "\\.dtb$"))
353 ;; Install kernel modules
354 (mkdir-p moddir)
355 (zero? (system* "make"
356 (string-append "DEPMOD=" kmod "/bin/depmod")
357 (string-append "MODULE_DIR=" moddir)
358 (string-append "INSTALL_PATH=" out)
359 (string-append "INSTALL_MOD_PATH=" out)
360 "INSTALL_MOD_STRIP=1"
361 "modules_install"))))))
362 #:tests? #f))
363 (home-page "https://www.gnu.org/software/linux-libre//")
364 (synopsis "100% free redistribution of a cleaned Linux kernel")
365 (description
366 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
367It has been modified to remove all non-free binary blobs.")
368 (license license:gpl2)))
369
370(define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
371(define %linux-compatible-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
372
373(define %linux-libre-version "4.14.12")
374(define %linux-libre-hash "1gc2yng3vnkb0bw65z3x5cy99h772hc9div30kly039x85gqwp1y")
375
376;; linux-libre configuration for armhf-linux is derived from Debian armmp. It
377;; supports qemu "virt" machine and possibly a large number of ARM boards.
378;; See : https://wiki.debian.org/DebianKernel/ARMMP.
379
380(define-public linux-libre
381 (make-linux-libre %linux-libre-version
382 %linux-libre-hash
383 %linux-compatible-systems
384 #:configuration-file kernel-config))
385
386(define-public linux-libre-4.9
387 (make-linux-libre "4.9.75"
388 "1zk98vx08s8fvrnxz190k4b0f6ndqv5bjps9wvv0ydclckqz3gwj"
389 %intel-compatible-systems
390 #:configuration-file kernel-config))
391
392(define-public linux-libre-4.4
393 (make-linux-libre "4.4.110"
394 "14nnxya8kgax75mkrrsz7zcky7gjk8sbjfhx5q1gifdiywjcbn5k"
395 %intel-compatible-systems
396 #:configuration-file kernel-config))
397
398(define-public linux-libre-4.1
399 (make-linux-libre "4.1.48"
400 "13ii6ixcm46hzk1ns6n4hrrv4dyc0n3wvj2qhmxi178akdcgbn8a"
401 %intel-compatible-systems
402 #:configuration-file kernel-config))
403
404(define-public linux-libre-arm-generic
405 (make-linux-libre %linux-libre-version
406 %linux-libre-hash
407 '("armhf-linux")
408 #:defconfig "multi_v7_defconfig"
409 #:extra-version "arm-generic"))
410
411(define-public linux-libre-arm-omap2plus
412 (make-linux-libre %linux-libre-version
413 %linux-libre-hash
414 '("armhf-linux")
415 #:defconfig "omap2plus_defconfig"
416 #:extra-version "arm-omap2plus"))
417
418\f
419;;;
420;;; Pluggable authentication modules (PAM).
421;;;
422
423(define-public linux-pam
424 (package
425 (name "linux-pam")
426 (version "1.3.0")
427 (source
428 (origin
429 (method url-fetch)
430 (uri (string-append
431 "http://www.linux-pam.org/library/"
432 "Linux-PAM-" version ".tar.bz2"))
433 (sha256
434 (base32
435 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
436 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
437
438 (build-system gnu-build-system)
439 (native-inputs
440 `(("flex" ,flex)
441
442 ;; TODO: optional dependencies
443 ;; ("libxcrypt" ,libxcrypt)
444 ;; ("cracklib" ,cracklib)
445 ))
446 (arguments
447 `(;; Most users, such as `shadow', expect the headers to be under
448 ;; `security'.
449 #:configure-flags (list (string-append "--includedir="
450 (assoc-ref %outputs "out")
451 "/include/security")
452
453 ;; XXX: <rpc/rpc.h> is missing from glibc when
454 ;; cross-compiling, so we have to disable NIS
455 ;; support altogether.
456 ,@(if (%current-target-system)
457 '("--disable-nis")
458 '()))
459
460 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
461 ;; isn't available.
462 #:tests? #f))
463 (home-page "http://www.linux-pam.org/")
464 (synopsis "Pluggable authentication modules for Linux")
465 (description
466 "A *Free* project to implement OSF's RFC 86.0.
467Pluggable authentication modules are small shared object files that can
468be used through the PAM API to perform tasks, like authenticating a user
469at login. Local and dynamic reconfiguration are its key features.")
470 (license license:bsd-3)))
471
472(define-public linux-pam-1.2
473 (package
474 (inherit linux-pam)
475 (version "1.2.1")
476 (source
477 (origin
478 (method url-fetch)
479 (uri (string-append
480 "http://www.linux-pam.org/library/"
481 "Linux-PAM-" version ".tar.bz2"))
482 (sha256
483 (base32
484 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
485 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
486
487
488;;;
489;;; Miscellaneous.
490;;;
491
492(define-public psmisc
493 (package
494 (name "psmisc")
495 (version "22.21")
496 (source
497 (origin
498 (method url-fetch)
499 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
500 version ".tar.gz"))
501 (sha256
502 (base32
503 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
504 (build-system gnu-build-system)
505 (inputs `(("ncurses" ,ncurses)))
506 (home-page "https://gitlab.com/psmisc/psmisc")
507 (synopsis
508 "Small utilities that use the proc file system")
509 (description
510 "This PSmisc package is a set of some small useful utilities that
511use the proc file system. We're not about changing the world, but
512providing the system administrator with some help in common tasks.")
513 (license license:gpl2+)))
514
515(define-public util-linux
516 (package
517 (name "util-linux")
518 (version "2.30.1")
519 (source (origin
520 (method url-fetch)
521 (uri (string-append "mirror://kernel.org/linux/utils/"
522 name "/v" (version-major+minor version) "/"
523 name "-" version ".tar.xz"))
524 (sha256
525 (base32
526 "0hdq2fz405a89fyha4bgwg0rx8b65inxq17w8fg8qhmcj4x3dr0v"))
527 (patches (search-patches "util-linux-tests.patch"))
528 (modules '((guix build utils)))
529 (snippet
530 ;; We take the 'logger' program from GNU Inetutils and 'kill'
531 ;; from GNU Coreutils.
532 '(begin
533 (substitute* "configure"
534 (("build_logger=yes") "build_logger=no")
535 (("build_kill=yes") "build_kill=no"))
536 #t))))
537 (build-system gnu-build-system)
538 (outputs '("out"
539 "static")) ; >2 MiB of static .a libraries
540 (arguments
541 `(#:configure-flags (list "--disable-use-tty-group"
542 "--enable-fs-paths-default=/run/current-system/profile/sbin"
543 ;; Install completions where our
544 ;; bash-completion package expects them.
545 (string-append "--with-bashcompletiondir="
546 (assoc-ref %outputs "out")
547 "/etc/bash_completion.d"))
548 #:phases (modify-phases %standard-phases
549 (add-before
550 'build 'set-umount-file-name
551 (lambda* (#:key outputs #:allow-other-keys)
552 ;; Tell 'eject' the right file name of 'umount'.
553 (let ((out (assoc-ref outputs "out")))
554 (substitute* "sys-utils/eject.c"
555 (("\"/bin/umount\"")
556 (string-append "\"" out "/bin/umount\"")))
557 #t)))
558 (add-before
559 'check 'pre-check
560 (lambda* (#:key inputs outputs #:allow-other-keys)
561 (let ((out (assoc-ref outputs "out"))
562 (net (assoc-ref inputs "net-base")))
563 ;; Change the test to refer to the right file.
564 (substitute* "tests/ts/misc/mcookie"
565 (("/etc/services")
566 (string-append net "/etc/services")))
567 #t)))
568 (add-after
569 'install 'move-static-libraries
570 (lambda* (#:key outputs #:allow-other-keys)
571 (let ((out (assoc-ref outputs "out"))
572 (static (assoc-ref outputs "static")))
573 (mkdir-p (string-append static "/lib"))
574 (with-directory-excursion out
575 (for-each (lambda (file)
576 (rename-file file
577 (string-append static "/"
578 file)))
579 (find-files "lib" "\\.a$")))
580 #t))))))
581 (inputs `(("zlib" ,zlib)
582 ("ncurses" ,ncurses)
583
584 ;; XXX: This is so that the 'pre-check' phase can find it.
585 ,@(if (%current-target-system)
586 `(("net-base" ,net-base))
587 '())))
588 (native-inputs
589 `(("perl" ,perl)
590 ("net-base" ,net-base))) ;for tests
591 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
592 (synopsis "Collection of utilities for the Linux kernel")
593 (description "Util-linux is a diverse collection of Linux kernel
594utilities. It provides dmesg and includes tools for working with file systems,
595block devices, UUIDs, TTYs, and many other tools.")
596
597 ;; Note that util-linux doesn't use the same license for all the
598 ;; code. GPLv2+ is the default license for a code without an
599 ;; explicitly defined license.
600 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
601 license:bsd-4 license:public-domain))))
602
603(define-public ddate
604 (package
605 (name "ddate")
606 (version "0.2.2")
607 (source (origin
608 (method url-fetch)
609 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
610 version ".tar.gz"))
611 (file-name (string-append name "-" version ".tar.gz"))
612 (sha256
613 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
614 (build-system cmake-build-system)
615 (arguments '(#:tests? #f))
616 (home-page "https://github.com/bo0ts/ddate")
617 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
618 (description
619 "ddate displays the Discordian date and holidays of a given date.
620The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
621by Robert Shea and Robert Anton Wilson.")
622 (license license:public-domain)))
623
624(define-public procps
625 (package
626 (name "procps")
627 (version "3.3.12")
628 (source (origin
629 (method url-fetch)
630 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
631 "procps-ng-" version ".tar.xz"))
632 (sha256
633 (base32
634 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
635 (build-system gnu-build-system)
636 (arguments
637 '(#:modules ((guix build utils)
638 (guix build gnu-build-system)
639 (srfi srfi-1)
640 (srfi srfi-26))
641 #:phases
642 (modify-phases %standard-phases
643 (add-before 'check 'disable-strtod-test
644 (lambda _
645 ;; Disable the 'strtod' test, which fails on 32-bit systems.
646 ;; This is what upstream does:
647 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
648 (substitute* "Makefile"
649 (("^(TESTS|check_PROGRAMS) = .*$" all)
650 (string-append "# " all "\n")))
651 #t))
652 (add-after
653 'install 'post-install
654 ;; Remove commands and man pages redudant with
655 ;; Coreutils.
656 (lambda* (#:key outputs #:allow-other-keys)
657 (let* ((out (assoc-ref outputs "out"))
658 (dup (append-map (cut find-files out <>)
659 '("^kill" "^uptime"))))
660 (for-each delete-file dup)
661 #t))))))
662 (inputs `(("ncurses" ,ncurses)))
663 (home-page "https://gitlab.com/procps-ng/procps/")
664 (synopsis "Utilities that give information about processes")
665 (description
666 "Procps is the package that has a bunch of small useful utilities
667that give information about processes using the Linux /proc file system.
668The package includes the programs ps, top, vmstat, w, kill, free,
669slabtop, and skill.")
670 (license license:gpl2)))
671
672(define-public usbutils
673 (package
674 (name "usbutils")
675 (version "008")
676 (source
677 (origin
678 (method url-fetch)
679 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
680 "usbutils-" version ".tar.xz"))
681 (sha256
682 (base32
683 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
684 (build-system gnu-build-system)
685 (inputs
686 `(("libusb" ,libusb)
687 ("eudev" ,eudev)))
688 (native-inputs
689 `(("pkg-config" ,pkg-config)))
690 (home-page "http://www.linux-usb.org/")
691 (synopsis
692 "Tools for working with USB devices, such as lsusb")
693 (description
694 "Tools for working with USB devices, such as lsusb.")
695 (license license:gpl2+)))
696
697(define-public e2fsprogs
698 (package
699 (name "e2fsprogs")
700 (version "1.43.6")
701 (source (origin
702 (method url-fetch)
703 (uri (string-append
704 "mirror://kernel.org/linux/kernel/people/tytso/"
705 name "/v" version "/"
706 name "-" version ".tar.xz"))
707 (sha256
708 (base32
709 "00ilv65dzcgiap435j89xk86shf7rrav3wsik7cahy789qijdcn9"))))
710 (build-system gnu-build-system)
711 (inputs `(("util-linux" ,util-linux)))
712 (native-inputs `(("pkg-config" ,pkg-config)
713 ("texinfo" ,texinfo) ;for the libext2fs Info manual
714
715 ;; For tests.
716 ("perl" ,perl)
717 ("procps" ,procps)))
718 (arguments
719 '(;; util-linux is the preferred source for some of the libraries and
720 ;; commands, so disable them (see, e.g.,
721 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
722 #:configure-flags (list "--disable-libblkid"
723 "--disable-libuuid" "--disable-uuidd"
724 "--disable-fsck"
725
726 ;; Use symlinks instead of hard links for
727 ;; 'fsck.extN' etc. This makes the resulting nar
728 ;; smaller and is preserved across copies.
729 "--enable-symlink-install"
730
731 (string-append "LDFLAGS=-Wl,-rpath="
732 (assoc-ref %outputs "out")
733 "/lib")
734
735 ;; Install libext2fs et al.
736 "--enable-elf-shlibs")
737
738 #:phases
739 (modify-phases %standard-phases
740 (add-before 'configure 'patch-shells
741 (lambda _
742 (substitute* "configure"
743 (("/bin/sh (.*)parse-types.sh" _ dir)
744 (string-append (which "sh") " " dir
745 "parse-types.sh")))
746 (substitute* "MCONFIG.in"
747 (("INSTALL_SYMLINK = /bin/sh")
748 "INSTALL_SYMLINK = sh"))
749 (substitute* (find-files "." "^Makefile.in$")
750 (("#!/bin/sh")
751 (string-append "#!" (which "sh"))))
752 #t))
753 (add-after 'install 'install-libs
754 (lambda* (#:key outputs #:allow-other-keys)
755 (let* ((out (assoc-ref outputs "out"))
756 (lib (string-append out "/lib")))
757 (and (zero? (system* "make" "install-libs"))
758
759 ;; Make the .a writable so that 'strip' works.
760 ;; Failing to do that, due to debug symbols, we
761 ;; retain a reference to the final
762 ;; linux-libre-headers, which refer to the
763 ;; bootstrap binaries.
764 (let ((archives (find-files lib "\\.a$")))
765 (for-each (lambda (file)
766 (chmod file #o666))
767 archives)
768 #t))))))))
769 (home-page "http://e2fsprogs.sourceforge.net/")
770 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
771 (description
772 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
773 (license (list license:gpl2 ;programs
774 license:lgpl2.0 ;libext2fs
775 license:x11)))) ;libuuid
776
777(define e2fsprogs/static
778 (static-package
779 (package (inherit e2fsprogs)
780 (arguments
781 ;; Do not build shared libraries.
782 (substitute-keyword-arguments (package-arguments e2fsprogs)
783 ((#:configure-flags _)
784 '(list "--disable-blkid"))
785 ((#:make-flags _)
786 '(list)))))))
787
788(define-public e2fsck/static
789 (package
790 (name "e2fsck-static")
791 (version (package-version e2fsprogs))
792 (build-system trivial-build-system)
793 (source #f)
794 (inputs
795 `(("e2fsprogs" ,e2fsprogs/static)))
796 (arguments
797 `(#:modules ((guix build utils))
798 #:builder
799 (begin
800 (use-modules (guix build utils)
801 (ice-9 ftw)
802 (srfi srfi-26))
803
804 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
805 "/sbin/e2fsck"))
806 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
807 (mkdir-p bin)
808 (with-directory-excursion bin
809 (copy-file e2fsck "e2fsck")
810 (remove-store-references "e2fsck")
811 (chmod "e2fsck" #o555))))))
812 (home-page (package-home-page e2fsprogs))
813 (synopsis "Statically-linked e2fsck command from e2fsprogs")
814 (description "This package provides statically-linked e2fsck command taken
815from the e2fsprogs package. It is meant to be used in initrds.")
816 (license (package-license e2fsprogs))))
817
818(define-public extundelete
819 (package
820 (name "extundelete")
821 (version "0.2.4")
822 (source (origin
823 (method url-fetch)
824 (uri (string-append "mirror://sourceforge/extundelete/"
825 "extundelete/" version "/extundelete-"
826 version ".tar.bz2"))
827 (sha256
828 (base32
829 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
830 (build-system gnu-build-system)
831 (inputs `(("e2fsprogs" ,e2fsprogs)))
832 (home-page "http://extundelete.sourceforge.net/")
833 (synopsis "Recover deleted files from ext2/3/4 partitions")
834 (description
835 "Extundelete is a set of tools that can recover deleted files from an
836ext3 or ext4 partition.")
837 (license license:gpl2)))
838
839(define-public zerofree
840 (package
841 (name "zerofree")
842 (version "1.1.0")
843 (home-page "https://frippery.org/uml/")
844 (source (origin
845 (method url-fetch)
846 (uri (string-append home-page name "-" version
847 ".tgz"))
848 (sha256
849 (base32
850 "059g29x5r1xj6wcj4xj85l8w6qrxyl86yqbybjqqz6nxz4falxzf"))))
851 (build-system gnu-build-system)
852 (arguments
853 '(#:phases
854 (modify-phases %standard-phases
855 (delete 'configure) ; no configure script
856 (replace 'install
857 ;; The Makefile lacks an ‘install’ target.
858 (lambda* (#:key outputs #:allow-other-keys)
859 (let* ((out (assoc-ref outputs "out"))
860 (bin (string-append out "/bin")))
861 (chmod "zerofree" #o555)
862 (install-file "zerofree" bin)
863 #t))))
864 #:tests? #f)) ; no tests
865 (inputs `(("libext2fs" ,e2fsprogs)))
866 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
867 (description
868 "Zerofree finds the unallocated blocks with non-zero value content in an
869ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
870This is a simple way to make disk images more compressible.
871Zerofree requires the file system to be unmounted or mounted read-only.")
872 (license license:gpl2)))
873
874(define-public strace
875 (package
876 (name "strace")
877 (version "4.20")
878 (source (origin
879 (method url-fetch)
880 (uri (string-append "mirror://sourceforge/strace/strace/" version
881 "/strace-" version ".tar.xz"))
882 (sha256
883 (base32
884 "08y5b07vb8jc7ak5xc3x2kx1ly6xiwv1gnppcqjs81kks66i9wsv"))))
885 (build-system gnu-build-system)
886 (arguments
887 '(#:phases
888 (modify-phases %standard-phases
889 (add-after 'unpack 'patch-/bin/sh
890 (lambda _
891 (substitute* "strace.c"
892 (("/bin/sh") (which "sh")))
893 #t)))))
894 (native-inputs `(("perl" ,perl)))
895 (home-page "https://strace.io/")
896 (synopsis "System call tracer for Linux")
897 (description
898 "strace is a system call tracer, i.e. a debugging tool which prints out a
899trace of all the system calls made by a another process/program.")
900 (license license:bsd-3)))
901
902(define-public ltrace
903 (package
904 (name "ltrace")
905 (version "0.7.3")
906 (source (origin
907 (method url-fetch)
908 (uri (string-append "http://www.ltrace.org/ltrace_" version
909 ".orig.tar.bz2"))
910 (sha256
911 (base32
912 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
913 (build-system gnu-build-system)
914 (inputs `(("libelf" ,libelf)))
915 (arguments
916 ;; Compilation uses -Werror by default, but it fails.
917 '(#:configure-flags '("--disable-werror")))
918 (home-page "http://www.ltrace.org/")
919 (synopsis "Library call tracer for Linux")
920 (description
921 "ltrace intercepts and records dynamic library calls which are called by
922an executed process and the signals received by that process. It can also
923intercept and print the system calls executed by the program.")
924 (license license:gpl2+)))
925
926(define-public alsa-lib
927 (package
928 (name "alsa-lib")
929 (version "1.1.4.1")
930 (source (origin
931 (method url-fetch)
932 (uri (string-append
933 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
934 version ".tar.bz2"))
935 (sha256
936 (base32
937 "0xjvi381105gldhv0z872a0x58sghznyx19j45lw5iyi2h68gfwi"))))
938 (build-system gnu-build-system)
939 (home-page "https://www.alsa-project.org/")
940 (synopsis "The Advanced Linux Sound Architecture libraries")
941 (description
942 "The Advanced Linux Sound Architecture (ALSA) provides audio and
943MIDI functionality to the Linux-based operating system.")
944 (license license:lgpl2.1+)))
945
946(define-public alsa-utils
947 (package
948 (name "alsa-utils")
949 (version "1.1.4")
950 (source (origin
951 (method url-fetch)
952 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
953 name "-" version ".tar.bz2"))
954 (sha256
955 (base32
956 "17cxih9ibjp1193dyd79j50pyfa9dvrs6r9kpwrvzicjvr2110x7"))))
957 (build-system gnu-build-system)
958 (arguments
959 ;; XXX: Disable man page creation until we have DocBook.
960 '(#:configure-flags (list "--disable-xmlto"
961
962 ;; The udev rule is responsible for restoring
963 ;; the volume.
964 (string-append "--with-udev-rules-dir="
965 (assoc-ref %outputs "out")
966 "/lib/udev/rules.d"))
967 #:phases
968 (modify-phases %standard-phases
969 (add-before
970 'install 'pre-install
971 (lambda _
972 ;; Don't try to mkdir /var/lib/alsa.
973 (substitute* "Makefile"
974 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
975 "true\n"))
976 #t)))))
977 (inputs
978 `(("libsamplerate" ,libsamplerate)
979 ("ncurses" ,ncurses)
980 ("alsa-lib" ,alsa-lib)
981 ("xmlto" ,xmlto)
982 ("gettext" ,gettext-minimal)))
983 (home-page "http://www.alsa-project.org/")
984 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
985 (description
986 "The Advanced Linux Sound Architecture (ALSA) provides audio and
987MIDI functionality to the Linux-based operating system.")
988
989 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
990 ;; GPLv2-only.
991 (license license:gpl2)))
992
993(define-public alsa-plugins
994 (package
995 (name "alsa-plugins")
996 (version "1.1.4")
997 (source (origin
998 (method url-fetch)
999 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1000 name "-" version ".tar.bz2"))
1001 (sha256
1002 (base32
1003 "12hsvm6rpinjkg06pa9hzndkdrbfw6wk6yk00cm8y1gbv8xiq3ak"))))
1004 (build-system gnu-build-system)
1005 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1006 ;; be split, there are references to both in files.
1007 ;; TODO: Remove OSS related plugins, they add support to run native
1008 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1009 ;; obsolete.
1010 (outputs '("out" "pulseaudio"))
1011 (arguments
1012 `(#:phases
1013 (modify-phases %standard-phases
1014 (add-after 'install 'split
1015 (lambda* (#:key inputs outputs #:allow-other-keys)
1016 ;; Distribute the binaries to the various outputs.
1017 (let* ((out (assoc-ref outputs "out"))
1018 (pua (assoc-ref outputs "pulseaudio"))
1019 (pualib (string-append pua "/lib/alsa-lib"))
1020 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
1021 (mkdir-p puaconf)
1022 (mkdir-p pualib)
1023 (chdir (string-append out "/share"))
1024 (for-each (lambda (file)
1025 (rename-file file (string-append puaconf "/" (basename file))))
1026 (find-files out "\\.(conf|example)"))
1027 (for-each (lambda (file)
1028 (rename-file file (string-append pualib "/" (basename file))))
1029 (find-files out ".*pulse\\.(la|so)"))
1030 (chdir "..")
1031 ;; We have moved the files to output pulsaudio, the
1032 ;; directory is now empty.
1033 (delete-file-recursively (string-append out "/share"))
1034 #t))))))
1035 (inputs
1036 `(("alsa-lib" ,alsa-lib)
1037 ("speex" ,speex) ; libspeexdsp resampling plugin
1038 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1039 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1040 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1041 (native-inputs
1042 `(("pkg-config" ,pkg-config)))
1043 (home-page "http://www.alsa-project.org/")
1044 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1045 (description
1046 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1047MIDI functionality to the Linux-based operating system. This package enhances ALSA
1048by providing additional plugins which include: upmixing, downmixing, jackd and
1049pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1050external rate conversion.")
1051 (license (list license:gpl2+
1052 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1053 license:lgpl2.1+))))
1054
1055(define-public iptables
1056 (package
1057 (name "iptables")
1058 (version "1.6.1")
1059 (source (origin
1060 (method url-fetch)
1061 (uri (string-append
1062 "mirror://netfilter.org/iptables/iptables-"
1063 version ".tar.bz2"))
1064 (sha256
1065 (base32
1066 "1x8c9y340x79djsq54bc1674ryv59jfphrk4f88i7qbvbnyxghhg"))))
1067 (build-system gnu-build-system)
1068 (native-inputs
1069 `(("pkg-config" ,pkg-config)
1070 ("flex" ,flex)
1071 ("bison" ,bison)))
1072 (inputs
1073 `(("libmnl" ,libmnl)
1074 ("libnftnl" ,libnftnl)))
1075 (arguments
1076 '(#:tests? #f ; no test suite
1077 #:configure-flags ; add $libdir to the RUNPATH of executables
1078 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1079 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1080 (synopsis "Program to configure the Linux IP packet filtering rules")
1081 (description
1082 "iptables is the userspace command line program used to configure the
1083Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
1084system administrators. Since Network Address Translation is also configured
1085from the packet filter ruleset, iptables is used for this, too. The iptables
1086package also includes ip6tables. ip6tables is used for configuring the IPv6
1087packet filter.")
1088 (license license:gpl2+)))
1089
1090(define-public ebtables
1091 (package
1092 (name "ebtables")
1093 (version "2.0.10-4")
1094 (source (origin
1095 (method url-fetch)
1096 (uri (string-append
1097 "mirror://netfilter.org/ebtables/ebtables-v"
1098 version ".tar.gz"))
1099 (sha256
1100 (base32
1101 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1102 (build-system gnu-build-system)
1103 (arguments
1104 '(#:tests? #f ; no test suite
1105 #:make-flags
1106 (let* ((out (assoc-ref %outputs "out"))
1107 (bin (string-append out "/sbin"))
1108 (lib (string-append out "/lib"))
1109 (man (string-append out "/share/man"))
1110 (iptables (assoc-ref %build-inputs "iptables"))
1111 (ethertypes (string-append iptables "/etc/ethertypes")))
1112 (list (string-append "LIBDIR=" lib)
1113 (string-append "MANDIR=" man)
1114 (string-append "BINDIR=" bin)
1115 (string-append "ETHERTYPESFILE=" ethertypes)
1116 ;; With the default CFLAGS, it falis with:
1117 ;; communication.c:259:58: error: variable ‘ret’ set but not
1118 ;; used [-Werror=unused-but-set-variable]
1119 "CFLAGS=-Wall"))
1120 #:phases
1121 (modify-phases %standard-phases
1122 (replace 'configure
1123 ;; no configure script
1124 (lambda _
1125 (substitute* "Makefile"
1126 ;; Remove user and group options from install commands,
1127 ;; otherwise it fails with: invalid user 'root'.
1128 (("-o root -g root") "")
1129 ;; Remove 'ethertypes' from the install target.
1130 (("install: .*")
1131 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1132 #t)))))
1133 (inputs
1134 `(("perl" ,perl)
1135 ("iptables" ,iptables)))
1136 (synopsis "Ethernet bridge frame table administration")
1137 (home-page "http://ebtables.netfilter.org/")
1138 (description
1139 "ebtables is an application program used to set up and maintain the
1140tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1141analogous to the iptables application, but less complicated, due to the fact
1142that the Ethernet protocol is much simpler than the IP protocol.")
1143 (license license:gpl2+)))
1144
1145(define-public iproute
1146 (package
1147 (name "iproute2")
1148 (version "4.14.1")
1149 (source (origin
1150 (method url-fetch)
1151 (uri (string-append
1152 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1153 version ".tar.xz"))
1154 (sha256
1155 (base32
1156 "0rq0n7yxb0hmk0s6wx5awzjgf7ikjbibd0a5ix20ldfcmxlc0fnl"))))
1157 (build-system gnu-build-system)
1158 (arguments
1159 `(#:tests? #f ; no test suite
1160 #:make-flags (let ((out (assoc-ref %outputs "out")))
1161 (list "DESTDIR="
1162 (string-append "BASH_COMPDIR=" out
1163 "/etc/bash_completion.d")
1164 (string-append "LIBDIR=" out "/lib")
1165 (string-append "HDRDIR=" out "/include")
1166 (string-append "SBINDIR=" out "/sbin")
1167 (string-append "CONFDIR=" out "/etc")
1168 (string-append "DOCDIR=" out "/share/doc/"
1169 ,name "-" ,version)
1170 (string-append "MANDIR=" out "/share/man")))
1171 #:phases (modify-phases %standard-phases
1172 (add-before 'install 'pre-install
1173 (lambda _
1174 ;; Don't attempt to create /var/lib/arpd.
1175 (substitute* "Makefile"
1176 (("^.*ARPDDIR.*$") "")))))))
1177 (inputs
1178 `(("iptables" ,iptables)
1179 ("db4" ,bdb)))
1180 (native-inputs
1181 `(("pkg-config" ,pkg-config)
1182 ("flex" ,flex)
1183 ("bison" ,bison)))
1184 (home-page
1185 "https://wiki.linuxfoundation.org/networking/iproute2")
1186 (synopsis
1187 "Utilities for controlling TCP/IP networking and traffic in Linux")
1188 (description
1189 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1190and traffic with the Linux kernel. The most important of these are
1191@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1192control.
1193
1194Most network configuration manuals still refer to ifconfig and route as the
1195primary network configuration tools, but ifconfig is known to behave
1196inadequately in modern network environments, and both should be deprecated.")
1197 (license license:gpl2+)))
1198
1199;; There are two packages for net-tools. The first, net-tools, is more recent
1200;; and probably safer to use with untrusted inputs (i.e. the internet). The
1201;; second, net-tools-for-tests, is relatively old and buggy. It can be used in
1202;; package test suites and should never be referred to by a built package. Use
1203;; #:disallowed-references to enforce this.
1204;;
1205;; When we are able to rebuild many packages (i.e. core-updates), we can update
1206;; net-tools-for-tests if appropriate.
1207;;
1208;; See <https://bugs.gnu.org/27811> for more information.
1209(define-public net-tools
1210 ;; XXX: This package is basically unmaintained, but it provides a few
1211 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1212 ;; live with it.
1213 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1214 (revision "0"))
1215 (package
1216 (name "net-tools")
1217 (version (string-append "1.60-" revision "." (string-take commit 7)))
1218 (source (origin
1219 (method url-fetch)
1220 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1221 "n/ne/net-tools/code.git/net-tools-code-"
1222 commit ".zip"))
1223 (file-name (string-append name "-" version ".zip"))
1224 (sha256
1225 (base32
1226 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1227 (home-page "http://net-tools.sourceforge.net/")
1228 (build-system gnu-build-system)
1229 (arguments
1230 '(#:modules ((guix build gnu-build-system)
1231 (guix build utils)
1232 (srfi srfi-1)
1233 (srfi srfi-26))
1234 #:phases
1235 (modify-phases %standard-phases
1236 (replace 'configure
1237 (lambda* (#:key outputs #:allow-other-keys)
1238 (let ((out (assoc-ref outputs "out")))
1239 (mkdir-p (string-append out "/bin"))
1240 (mkdir-p (string-append out "/sbin"))
1241
1242 ;; Pretend we have everything...
1243 (system "yes | make config")
1244
1245 ;; ... except for the things we don't have.
1246 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1247 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1248 ;; that have been removed.
1249 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1250 ;; think about adding them later.
1251 (substitute* '("config.make" "config.h")
1252 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1253 "")))))
1254 (add-after 'install 'remove-redundant-commands
1255 (lambda* (#:key outputs #:allow-other-keys)
1256 ;; Remove commands and man pages redundant with Inetutils.
1257 (let* ((out (assoc-ref outputs "out"))
1258 (dup (append-map (cut find-files out <>)
1259 '("^hostname"
1260 "^(yp|nis|dns)?domainname"))))
1261 (for-each delete-file dup)
1262 #t))))
1263 ;; Binaries that depend on libnet-tools.a don't declare that
1264 ;; dependency, making it parallel-unsafe.
1265 #:parallel-build? #f
1266
1267 #:tests? #f ; no test suite
1268 #:make-flags (let ((out (assoc-ref %outputs "out")))
1269 (list "CC=gcc"
1270 (string-append "BASEDIR=" out)
1271 (string-append "INSTALLNLSDIR=" out "/share/locale")
1272 (string-append "mandir=/share/man")))))
1273 (native-inputs `(("gettext" ,gettext-minimal)
1274 ("unzip" ,unzip)))
1275 (synopsis "Tools for controlling the network subsystem in Linux")
1276 (description
1277 "This package includes the important tools for controlling the network
1278subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1279route. Additionally, this package contains utilities relating to particular
1280network hardware types (plipconfig, slattach) and advanced aspects of IP
1281configuration (iptunnel, ipmaddr).")
1282 (license license:gpl2+))))
1283
1284(define-public net-tools-for-tests
1285 (hidden-package (package (inherit net-tools)
1286 (version "1.60")
1287 ;; Git depends on net-tools-for-tests via GnuTLS, so we can't use git-fetch
1288 ;; here. We should find a better workaround for this problem so that we can
1289 ;; use the latest upstream source.
1290 (source (origin
1291 (method url-fetch)
1292 (uri (list (string-append
1293 "mirror://sourceforge/net-tools/net-tools-"
1294 version ".tar.bz2")
1295 (string-append
1296 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1297 "/base/net-tools/net-tools-1.60.tar.bz2")))
1298 (sha256
1299 (base32
1300 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1301 (patches (search-patches "net-tools-bitrot.patch"))))
1302 (build-system gnu-build-system)
1303 (arguments
1304 '(#:modules ((guix build gnu-build-system)
1305 (guix build utils)
1306 (srfi srfi-1)
1307 (srfi srfi-26))
1308 #:phases (alist-cons-after
1309 'unpack 'patch
1310 (lambda* (#:key inputs #:allow-other-keys)
1311 (define (apply-patch file)
1312 (zero? (system* "patch" "-p1" "--force"
1313 "--input" file)))
1314
1315 (let ((patch.gz (assoc-ref inputs "patch")))
1316 (format #t "applying Debian patch set '~a'...~%"
1317 patch.gz)
1318 (system (string-append "gunzip < " patch.gz " > the-patch"))
1319 (and (apply-patch "the-patch")
1320 (for-each apply-patch
1321 (find-files "debian/patches"
1322 "\\.patch")))))
1323 (alist-replace
1324 'configure
1325 (lambda* (#:key outputs #:allow-other-keys)
1326 (let ((out (assoc-ref outputs "out")))
1327 (mkdir-p (string-append out "/bin"))
1328 (mkdir-p (string-append out "/sbin"))
1329
1330 ;; Pretend we have everything...
1331 (system "yes | make config")
1332
1333 ;; ... except for the things we don't have.
1334 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1335 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1336 ;; that have been removed.
1337 (substitute* '("config.make" "config.h")
1338 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1339 (alist-cons-after
1340 'install 'remove-redundant-commands
1341 (lambda* (#:key outputs #:allow-other-keys)
1342 ;; Remove commands and man pages redundant with
1343 ;; Inetutils.
1344 (let* ((out (assoc-ref outputs "out"))
1345 (dup (append-map (cut find-files out <>)
1346 '("^hostname"
1347 "^(yp|nis|dns)?domainname"))))
1348 (for-each delete-file dup)
1349 #t))
1350 %standard-phases)))
1351
1352 ;; Binaries that depend on libnet-tools.a don't declare that
1353 ;; dependency, making it parallel-unsafe.
1354 #:parallel-build? #f
1355
1356 #:tests? #f ; no test suite
1357 #:make-flags (let ((out (assoc-ref %outputs "out")))
1358 (list "CC=gcc"
1359 (string-append "BASEDIR=" out)
1360 (string-append "INSTALLNLSDIR=" out "/share/locale")
1361 (string-append "mandir=/share/man")))))
1362
1363 ;; We added unzip to the net-tools package's native-inputs when
1364 ;; switching its source from a Git checkout to a zip archive. We
1365 ;; need to specify the native-inputs here to keep unzip out of the
1366 ;; build of net-tools-for-tests, so that we don't have to rebuild
1367 ;; many packages on the master branch. We can make
1368 ;; net-tools-for-tests inherit directly from net-tools in the next
1369 ;; core-updates cycle.
1370 (native-inputs `(("gettext" ,gettext-minimal)))
1371
1372 ;; Use the big Debian patch set (the thing does not even compile out of
1373 ;; the box.)
1374 ;; XXX The patch is not actually applied, due to a bug in the 'patch' phase
1375 ;; above. However, this package variant is only used in GnuTLS's tests. It
1376 ;; will be adjusted when convenient for the build farm.
1377 ;; See <https://bugs.gnu.org/27811> for more information.
1378 (inputs `(("patch" ,(origin
1379 (method url-fetch)
1380 (uri
1381 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1382 (sha256
1383 (base32
1384 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p")))))))))
1385
1386(define-public libcap
1387 (package
1388 (name "libcap")
1389 (version "2.25")
1390 (source (origin
1391 (method url-fetch)
1392 (uri (string-append
1393 "mirror://kernel.org/linux/libs/security/linux-privs/"
1394 "libcap2/libcap-" version ".tar.xz"))
1395 (sha256
1396 (base32
1397 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1398 (build-system gnu-build-system)
1399 (arguments '(#:phases
1400 (modify-phases %standard-phases
1401 (replace 'configure
1402 ;; Add $libdir to the RUNPATH of executables.
1403 (lambda _
1404 (substitute* "Make.Rules"
1405 (("LDFLAGS := #-g")
1406 (string-append "LDFLAGS := -Wl,-rpath="
1407 %output "/lib"))))))
1408 #:tests? #f ; no 'check' target
1409 #:make-flags (list "lib=lib"
1410 (string-append "prefix="
1411 (assoc-ref %outputs "out"))
1412 "RAISE_SETFCAP=no")))
1413 (native-inputs `(("perl" ,perl)))
1414 (inputs `(("attr" ,attr)))
1415 (home-page "https://sites.google.com/site/fullycapable/")
1416 (synopsis "Library for working with POSIX capabilities")
1417 (description
1418 "Libcap2 provides a programming interface to POSIX capabilities on
1419Linux-based operating systems.")
1420
1421 ;; License is BSD-3 or GPLv2, at the user's choice.
1422 (license license:gpl2)))
1423
1424(define-public bridge-utils
1425 (package
1426 (name "bridge-utils")
1427 (version "1.5")
1428 (source (origin
1429 (method url-fetch)
1430 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1431 "bridge-utils-" version ".tar.gz"))
1432 (sha256
1433 (base32
1434 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1435 (build-system gnu-build-system)
1436
1437 ;; The tarball lacks all the generated files.
1438 (native-inputs `(("autoconf" ,autoconf)
1439 ("automake" ,automake)))
1440 (arguments
1441 '(#:phases
1442 (modify-phases %standard-phases
1443 (add-after 'unpack 'bootstrap
1444 (lambda _
1445 ;; Fix "field ‘ip6’ has incomplete type" errors.
1446 (substitute* "libbridge/libbridge.h"
1447 (("#include <linux/if_bridge.h>")
1448 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1449
1450 ;; Ensure that the entire build fails if one of the
1451 ;; sub-Makefiles fails.
1452 (substitute* "Makefile.in"
1453 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1454 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1455
1456 (zero? (system* "autoreconf" "-vf")))))
1457 #:tests? #f)) ; no 'check' target
1458
1459 (home-page
1460 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1461 (synopsis "Manipulate Ethernet bridges")
1462 (description
1463 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1464to connect two Ethernet segments together in a protocol independent way.
1465Packets are forwarded based on Ethernet address, rather than IP address (like
1466a router). Since forwarding is done at Layer 2, all protocols can go
1467transparently through a bridge.")
1468 (license license:gpl2+)))
1469
1470(define-public libnl
1471 (package
1472 (name "libnl")
1473 (version "3.4.0")
1474 (source (origin
1475 (method url-fetch)
1476 (uri (string-append
1477 "https://github.com/thom311/libnl/releases/download/"
1478 "libnl" (string-join (string-split version #\.) "_")
1479 "/libnl-" version ".tar.gz"))
1480 (sha256
1481 (base32
1482 "1gzm444rnsib64dddv0cwlpzy1q4bycjqhp1i5pxpikimqvpca5p"))))
1483 (build-system gnu-build-system)
1484 (native-inputs
1485 `(("bison" ,bison)
1486 ("flex" ,flex)
1487 ("pkg-config" ,pkg-config)
1488 ("swig" ,swig)
1489 ("libnl3-doc"
1490 ,(origin
1491 (method url-fetch)
1492 (uri (string-append
1493 "https://github.com/thom311/libnl/releases/download/libnl"
1494 (string-join (string-split version #\.) "_")
1495 "/libnl-doc-" version ".tar.gz"))
1496 (sha256
1497 (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
1498 (inputs
1499 `(("python-2" ,python-2)
1500 ("python-3" ,python-3)))
1501 (outputs '("out" "doc" "python2" "python3"))
1502 (arguments
1503 `(#:modules ((guix build gnu-build-system)
1504 (guix build utils)
1505 (srfi srfi-1))
1506 #:phases
1507 (modify-phases %standard-phases
1508 (add-after 'install 'install-python
1509 (lambda* (#:key outputs #:allow-other-keys)
1510 (define (python-inst python)
1511 (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib"
1512 (assoc-ref %outputs "out")))
1513 (pyout (assoc-ref %outputs python)))
1514 (and
1515 (zero? (system (format #f "~a ~a setup.py build"
1516 ldflags python pyout)))
1517 (zero?
1518 (system (format #f "~a ~a setup.py install --prefix=~a"
1519 ldflags python pyout)))
1520 (zero? (system* python "setup.py" "clean")))))
1521 (with-directory-excursion "./python"
1522 (every python-inst '("python2" "python3")))))
1523 (add-after 'install 'install-doc
1524 (lambda* (#:key inputs outputs #:allow-other-keys)
1525 (let ((dest (string-append (assoc-ref outputs "doc")
1526 "/share/doc/libnl")))
1527 (mkdir-p dest)
1528 (zero? (system* "tar" "xf" (assoc-ref inputs "libnl3-doc")
1529 "--strip-components=1" "-C" dest))))))))
1530 (home-page "http://www.infradead.org/~tgr/libnl/")
1531 (synopsis "NetLink protocol library suite")
1532 (description
1533 "The libnl suite is a collection of libraries providing APIs to netlink
1534protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1535between the kernel and user space processes. It was designed to be a more
1536flexible successor to ioctl to provide mainly networking related kernel
1537configuration and monitoring interfaces.")
1538
1539 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1540 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1541 (license license:gpl2)))
1542
1543(define-public iw
1544 (package
1545 (name "iw")
1546 (version "4.9")
1547 (source (origin
1548 (method url-fetch)
1549 (uri (string-append
1550 "mirror://kernel.org/software/network/iw/iw-"
1551 version ".tar.xz"))
1552 (sha256
1553 (base32
1554 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
1555 (build-system gnu-build-system)
1556 (native-inputs `(("pkg-config" ,pkg-config)))
1557 (inputs `(("libnl" ,libnl)))
1558 (arguments
1559 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1560 "CC=gcc")
1561 #:phases (modify-phases %standard-phases (delete 'configure))))
1562 (home-page "https://wireless.wiki.kernel.org/")
1563 (synopsis "Tool for configuring wireless devices")
1564 (description
1565 "iw is a new nl80211 based CLI configuration utility for wireless
1566devices. It replaces @code{iwconfig}, which is deprecated.")
1567 (license license:isc)))
1568
1569(define-public powertop
1570 (package
1571 (name "powertop")
1572 (version "2.9")
1573 (source
1574 (origin
1575 (method url-fetch)
1576 (uri (string-append
1577 "https://01.org/sites/default/files/downloads/powertop/powertop-v"
1578 version ".tar.gz"))
1579 (sha256
1580 (base32
1581 "0l4jjlf05li2mc6g8nrss3h435wjhmnqd8m7v3kha3x0x7cbfzxa"))))
1582 (build-system gnu-build-system)
1583 (arguments
1584 '(#:phases
1585 (modify-phases %standard-phases
1586 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1587 ;; allow calibrating the network interface in GuixSD.
1588 (add-after 'unpack 'patch-absolute-file-names
1589 (lambda* (#:key inputs #:allow-other-keys)
1590 (let ((kmod (assoc-ref inputs "kmod")))
1591 (substitute* (find-files "src" "\\.cpp$")
1592 ;; Give the right 'modprobe' file name so that essential
1593 ;; modules such as msr.ko can be loaded.
1594 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1595 ;; These programs are only needed to calibrate, so using
1596 ;; relative file names avoids adding extra inputs. When they
1597 ;; are missing powertop gracefully handles it.
1598 (("/usr/bin/hcitool") "hcitool")
1599 (("/usr/bin/xset") "xset")
1600 (("/usr/sbin/hciconfig") "hciconfig"))
1601 #t))))))
1602 (inputs
1603 `(("kmod" ,kmod)
1604 ("libnl" ,libnl)
1605 ("ncurses" ,ncurses)
1606 ("pciutils" ,pciutils)
1607 ("zlib" ,zlib)))
1608 (native-inputs
1609 `(("pkg-config" ,pkg-config)))
1610 (home-page "https://01.org/powertop/")
1611 (synopsis "Analyze power consumption on Intel-based laptops")
1612 (description
1613 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1614power management. In addition to being a diagnostic tool, PowerTOP also has
1615an interactive mode where the user can experiment various power management
1616settings for cases where the operating system has not enabled these
1617settings.")
1618 (license license:gpl2)))
1619
1620(define-public aumix
1621 (package
1622 (name "aumix")
1623 (version "2.9.1")
1624 (source (origin
1625 (method url-fetch)
1626 (uri (string-append
1627 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1628 version ".tar.bz2"))
1629 (sha256
1630 (base32
1631 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1632 (build-system gnu-build-system)
1633 (inputs `(("ncurses" ,ncurses)))
1634 (home-page "http://www.jpj.net/~trevor/aumix.html")
1635 (synopsis "Audio mixer for X and the console")
1636 (description
1637 "Aumix adjusts an audio mixer from X, the console, a terminal,
1638the command line or a script.")
1639 (license license:gpl2+)))
1640
1641(define-public iotop
1642 (package
1643 (name "iotop")
1644 (version "0.6")
1645 (source
1646 (origin
1647 (method url-fetch)
1648 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1649 version ".tar.gz"))
1650 (sha256 (base32
1651 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1652 (build-system python-build-system)
1653 (arguments
1654 ;; The setup.py script expects python-2.
1655 `(#:python ,python-2
1656 ;; There are currently no checks in the package.
1657 #:tests? #f))
1658 (native-inputs `(("python" ,python-2)))
1659 (home-page "http://guichaz.free.fr/iotop/")
1660 (synopsis
1661 "Displays the IO activity of running processes")
1662 (description
1663 "Iotop is a Python program with a top like user interface to show the
1664processes currently causing I/O.")
1665 (license license:gpl2+)))
1666
1667(define-public fuse
1668 (package
1669 (name "fuse")
1670 (version "2.9.7")
1671 (source (origin
1672 (method url-fetch)
1673 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1674 "download/fuse-" version
1675 "/fuse-" version ".tar.gz"))
1676 (sha256
1677 (base32
1678 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
1679 (patches (search-patches "fuse-overlapping-headers.patch"))))
1680 (build-system gnu-build-system)
1681 (inputs `(("util-linux" ,util-linux)))
1682 (arguments
1683 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1684 (assoc-ref %outputs "out")
1685 "/sbin")
1686 (string-append "INIT_D_PATH="
1687 (assoc-ref %outputs "out")
1688 "/etc/init.d")
1689
1690 ;; The rule makes /dev/fuse 666.
1691 (string-append "UDEV_RULES_PATH="
1692 (assoc-ref %outputs "out")
1693 "/lib/udev/rules.d"))
1694 #:phases
1695 (modify-phases %standard-phases
1696 (add-before 'build 'set-file-names
1697 (lambda* (#:key inputs #:allow-other-keys)
1698 ;; libfuse calls out to mount(8) and umount(8). Make sure
1699 ;; it refers to the right ones.
1700 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1701 (("/bin/(u?)mount" _ maybe-u)
1702 (string-append (assoc-ref inputs "util-linux")
1703 "/bin/" maybe-u "mount")))
1704 (substitute* '("util/mount.fuse.c")
1705 (("/bin/sh")
1706 (which "sh")))
1707
1708 ;; This hack leads libfuse to search for 'fusermount' in
1709 ;; $PATH, where it may find a setuid-root binary, instead of
1710 ;; trying solely $out/sbin/fusermount and failing because
1711 ;; it's not setuid.
1712 (substitute* "lib/Makefile"
1713 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1714 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
1715 #t)))))
1716 (home-page "https://github.com/libfuse/libfuse")
1717 (synopsis "Support file systems implemented in user space")
1718 (description
1719 "As a consequence of its monolithic design, file system code for Linux
1720normally goes into the kernel itself---which is not only a robustness issue,
1721but also an impediment to system extensibility. FUSE, for \"file systems in
1722user space\", is a kernel module and user-space library that tries to address
1723part of this problem by allowing users to run file system implementations as
1724user-space processes.")
1725 (license (list license:lgpl2.1 ;library
1726 license:gpl2+)))) ;command-line utilities
1727
1728(define-public unionfs-fuse
1729 (package
1730 (name "unionfs-fuse")
1731 (version "2.0")
1732 (source (origin
1733 (method url-fetch)
1734 (uri (string-append
1735 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1736 version ".tar.gz"))
1737 (file-name (string-append name "-" version ".tar.gz"))
1738 (sha256
1739 (base32
1740 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1741 (build-system cmake-build-system)
1742 (native-inputs
1743 `(("python" ,python)
1744 ("python-pytest" ,python-pytest)))
1745 (inputs `(("fuse" ,fuse)))
1746 (arguments
1747 '(#:phases
1748 (modify-phases %standard-phases
1749 (replace 'check
1750 ;; Borrowed from the Makefile
1751 (lambda _ (zero? (system* "python3" "-m" "pytest")))))))
1752 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1753 (synopsis "User-space union file system")
1754 (description
1755 "UnionFS-FUSE is a flexible union file system implementation in user
1756space, using the FUSE library. Mounting a union file system allows you to
1757\"aggregate\" the contents of several directories into a single mount point.
1758UnionFS-FUSE additionally supports copy-on-write.")
1759 (license license:bsd-3)))
1760
1761(define fuse-static
1762 (package (inherit fuse)
1763 (name "fuse-static")
1764 (source (origin (inherit (package-source fuse))
1765 (modules '((guix build utils)))
1766 (snippet
1767 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1768 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1769 ;; it doesn't do that, allowing us to remove the dependency on
1770 ;; util-linux (something that is useful in initrds.)
1771 '(substitute* '("lib/mount_util.c"
1772 "util/mount_util.c")
1773 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1774 "0")
1775 (("/bin/")
1776 "")))))))
1777
1778(define-public unionfs-fuse/static
1779 (package (inherit unionfs-fuse)
1780 (synopsis "User-space union file system (statically linked)")
1781 (name (string-append (package-name unionfs-fuse) "-static"))
1782 (source (origin (inherit (package-source unionfs-fuse))
1783 (modules '((guix build utils)))
1784 (snippet
1785 ;; Add -ldl to the libraries, because libfuse.a needs that.
1786 '(substitute* "src/CMakeLists.txt"
1787 (("target_link_libraries(.*)\\)" _ libs)
1788 (string-append "target_link_libraries"
1789 libs " dl)"))))))
1790 (arguments
1791 '(#:tests? #f
1792 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1793 #:phases
1794 (modify-phases %standard-phases
1795 (add-after 'install 'post-install
1796 (lambda* (#:key outputs #:allow-other-keys)
1797 (let* ((out (assoc-ref outputs "out"))
1798 (exe (string-append out "/bin/unionfs")))
1799 ;; By default, 'unionfs' keeps references to
1800 ;; $glibc/share/locale and similar stuff. Remove them.
1801 (remove-store-references exe)
1802
1803 ;; 'unionfsctl' has references to glibc as well. Since
1804 ;; we don't need it, remove it.
1805 (delete-file (string-append out "/bin/unionfsctl"))
1806 #t))))))
1807 (inputs `(("fuse" ,fuse-static)))))
1808
1809(define-public sshfs-fuse
1810 (package
1811 (name "sshfs-fuse")
1812 (version "2.10")
1813 (source (origin
1814 (method url-fetch)
1815 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1816 "download/sshfs-" version "/sshfs-" version
1817 ".tar.gz"))
1818 (sha256
1819 (base32
1820 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
1821 (build-system gnu-build-system)
1822 (inputs
1823 `(("fuse" ,fuse)
1824 ("glib" ,glib)))
1825 (native-inputs
1826 `(("pkg-config" ,pkg-config)))
1827 (home-page "https://github.com/libfuse/sshfs")
1828 (synopsis "Mount remote file systems over SSH")
1829 (description
1830 "This is a file system client based on the SSH File Transfer Protocol.
1831Since most SSH servers already support this protocol it is very easy to set
1832up: on the server side there's nothing to do; on the client side mounting the
1833file system is as easy as logging into the server with an SSH client.")
1834 (license license:gpl2+)))
1835
1836(define-public archivemount
1837 (package
1838 (name "archivemount")
1839 (version "0.8.7")
1840 (source
1841 (origin
1842 (method url-fetch)
1843 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1844 "archivemount-" version ".tar.gz"))
1845 (sha256
1846 (base32
1847 "1diiw6pnlnrnikn6l5ld92dx59lhrxjlqms8885vwbynsjl5q127"))))
1848 (build-system gnu-build-system)
1849 (inputs `(("fuse", fuse)
1850 ("libarchive", libarchive)))
1851 (native-inputs `(("pkg-config", pkg-config)))
1852 (home-page "http://www.cybernoia.de/software/archivemount")
1853 (synopsis "Tool for mounting archive files with FUSE")
1854 (description "archivemount is a FUSE-based file system for Unix variants,
1855including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1856mount point where it can be read from or written to as with any other file
1857system. This makes accessing the contents of the archive, which may be
1858compressed, transparent to other programs, without decompressing them.")
1859 (license license:lgpl2.0+)))
1860
1861(define-public numactl
1862 (package
1863 (name "numactl")
1864 (version "2.0.11")
1865 (source (origin
1866 (method url-fetch)
1867 (uri (string-append
1868 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1869 version
1870 ".tar.gz"))
1871 (sha256
1872 (base32
1873 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1874 (build-system gnu-build-system)
1875 (arguments
1876 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1877 ;; to run, which we can't assume to have.
1878 #:tests? #f))
1879
1880 ;; NUMA is apparently not supported on armhf, see
1881 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1882 (supported-systems (delete "armhf-linux" %supported-systems))
1883 (home-page "http://oss.sgi.com/projects/libnuma/")
1884 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1885 (description
1886 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1887memory is not all in one place. The numactl program allows you to run your
1888application program on specific CPU's and memory nodes. It does this by
1889supplying a NUMA memory policy to the operating system before running your
1890program.
1891
1892The package contains other commands, such as numademo, numastat and memhog.
1893The numademo command provides a quick overview of NUMA performance on your
1894system.")
1895 (license (list license:gpl2 ;programs
1896 license:lgpl2.1)))) ;library
1897
1898(define-public kbd-neo
1899 (package
1900 (name "kbd-neo")
1901 (version "2486")
1902 (source
1903 (origin
1904 (method url-fetch)
1905 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1906 version "/linux/console/neo.map"))
1907 (file-name (string-append name "-" version ".map"))
1908 (sha256
1909 (base32
1910 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1911 (build-system trivial-build-system)
1912 (arguments
1913 `(#:modules ((guix build utils))
1914 #:builder (begin
1915 (use-modules (guix build utils))
1916 (let ((out (string-append %output "/share/keymaps"))
1917 (source (assoc-ref %build-inputs "source")))
1918 (mkdir-p out)
1919 (copy-file source (string-append out "/neo.map"))
1920 #t))))
1921 (home-page "https://neo-layout.org")
1922 (synopsis "Neo2 console layout")
1923 (description
1924 "Kbd-neo provides the Neo2 keyboard layout for use with
1925@command{loadkeys(1)} from @code{kbd(4)}.")
1926 ;; The file is located in an svn directory, the entire content of
1927 ;; the directory is licensed as GPL3.
1928 (license license:gpl3+)))
1929
1930(define-public kbd
1931 (package
1932 (name "kbd")
1933 (version "2.0.4")
1934 (source (origin
1935 (method url-fetch)
1936 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1937 version ".tar.xz"))
1938 (sha256
1939 (base32
1940 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1941 (modules '((guix build utils)))
1942 (snippet
1943 '(begin
1944 (substitute* "tests/Makefile.in"
1945 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1946 (("@VERSION@")
1947 "[@]VERSION[@]"))
1948 (substitute* '("src/unicode_start" "src/unicode_stop")
1949 ;; Assume the Coreutils are in $PATH.
1950 (("/usr/bin/tty")
1951 "tty"))))))
1952 (build-system gnu-build-system)
1953 (arguments
1954 '(#:phases
1955 (modify-phases %standard-phases
1956 (add-before 'build 'pre-build
1957 (lambda* (#:key inputs #:allow-other-keys)
1958 (let ((gzip (assoc-ref %build-inputs "gzip"))
1959 (bzip2 (assoc-ref %build-inputs "bzip2")))
1960 (substitute* "src/libkeymap/findfile.c"
1961 (("gzip")
1962 (string-append gzip "/bin/gzip"))
1963 (("bzip2")
1964 (string-append bzip2 "/bin/bzip2"))))))
1965 (add-after 'install 'post-install
1966 (lambda* (#:key outputs #:allow-other-keys)
1967 ;; Make sure these programs find their comrades.
1968 (let* ((out (assoc-ref outputs "out"))
1969 (bin (string-append out "/bin")))
1970 (for-each (lambda (prog)
1971 (wrap-program (string-append bin "/" prog)
1972 `("PATH" ":" prefix (,bin))))
1973 '("unicode_start" "unicode_stop"))))))))
1974 (inputs `(("check" ,check)
1975 ("gzip" ,gzip)
1976 ("bzip2" ,bzip2)
1977 ("pam" ,linux-pam)))
1978 (native-search-paths
1979 (list (search-path-specification
1980 (variable "LOADKEYS_KEYMAP_PATH")
1981 ;; Append ‘/**’ to recursively search all directories. One can then
1982 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
1983 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
1984 (files (list "share/keymaps/**")))))
1985 (native-inputs `(("pkg-config" ,pkg-config)))
1986 (home-page "http://kbd-project.org/")
1987 (synopsis "Linux keyboard utilities and keyboard maps")
1988 (description
1989 "This package contains keytable files and keyboard utilities compatible
1990for systems using the Linux kernel. This includes commands such as
1991'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1992 (license license:gpl2+)))
1993
1994(define-public inotify-tools
1995 (package
1996 (name "inotify-tools")
1997 (version "3.13")
1998 (source (origin
1999 (method url-fetch)
2000 (uri (string-append
2001 "mirror://sourceforge/inotify-tools/inotify-tools/"
2002 version "/inotify-tools-" version ".tar.gz"))
2003 (sha256
2004 (base32
2005 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
2006 (build-system gnu-build-system)
2007 (home-page "http://inotify-tools.sourceforge.net/")
2008 (synopsis "Monitor file accesses")
2009 (description
2010 "The inotify-tools packages provides a C library and command-line tools
2011to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2012 (license license:gpl2+)))
2013
2014(define-public kmod
2015 (package
2016 (name "kmod")
2017 (version "24")
2018 (source (origin
2019 (method url-fetch)
2020 (uri
2021 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2022 "kmod-" version ".tar.xz"))
2023 (sha256
2024 (base32
2025 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
2026 (patches (search-patches "kmod-module-directory.patch"))))
2027 (build-system gnu-build-system)
2028 (native-inputs
2029 `(("pkg-config" ,pkg-config)))
2030 (inputs
2031 `(("xz" ,xz)
2032 ("zlib" ,zlib)))
2033 (arguments
2034 `(#:tests? #f ; FIXME: Investigate test failures
2035 #:configure-flags '("--with-xz" "--with-zlib")
2036 #:phases (alist-cons-after
2037 'install 'install-modprobe&co
2038 (lambda* (#:key outputs #:allow-other-keys)
2039 (let* ((out (assoc-ref outputs "out"))
2040 (bin (string-append out "/bin")))
2041 (for-each (lambda (tool)
2042 (symlink "kmod"
2043 (string-append bin "/" tool)))
2044 '("insmod" "rmmod" "lsmod" "modprobe"
2045 "modinfo" "depmod"))))
2046 %standard-phases)))
2047 (home-page "https://www.kernel.org/")
2048 (synopsis "Kernel module tools")
2049 (description "Kmod is a set of tools to handle common tasks with Linux
2050kernel modules like insert, remove, list, check properties, resolve
2051dependencies and aliases.
2052
2053These tools are designed on top of libkmod, a library that is shipped with
2054kmod. The aim is to be compatible with tools, configurations and indices
2055from the module-init-tools project.")
2056 (license license:gpl2+))) ; library under lgpl2.1+
2057
2058(define-public eudev
2059 ;; The post-systemd fork, maintained by Gentoo.
2060 (package
2061 (name "eudev")
2062 (version "3.2.2")
2063 (source (origin
2064 (method url-fetch)
2065 (uri (string-append
2066 "http://dev.gentoo.org/~blueness/eudev/eudev-"
2067 version ".tar.gz"))
2068 (sha256
2069 (base32
2070 "0qqgbgpm5wdllk0s04pf80nwc8pr93xazwri1bylm1f15zn5ck1y"))
2071 (patches (search-patches "eudev-rules-directory.patch"))))
2072 (build-system gnu-build-system)
2073 (arguments
2074 '(#:phases (modify-phases %standard-phases
2075 (add-after 'install 'build-hwdb
2076 (lambda* (#:key outputs #:allow-other-keys)
2077 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2078 ;; similar tools to display product names.
2079 (let ((out (assoc-ref outputs "out")))
2080 (zero? (system* (string-append out "/bin/udevadm")
2081 "hwdb" "--update"))))))))
2082 (native-inputs
2083 `(("pkg-config" ,pkg-config)
2084 ("perl" ,perl)
2085 ("gperf" ,gperf)))
2086 (inputs
2087 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2088 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2089 ;; which contains the rules to do that.
2090 `(("util-linux" ,util-linux) ;for blkid
2091 ("kmod" ,kmod)))
2092 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2093 (synopsis "Userspace device management")
2094 (description "Udev is a daemon which dynamically creates and removes
2095device nodes from /dev/, handles hotplug events and loads drivers at boot
2096time.")
2097 (license license:gpl2+)))
2098
2099(define-public eudev-with-hwdb
2100 (deprecated-package "eudev-with-hwdb" eudev))
2101
2102(define-public lvm2
2103 (package
2104 (name "lvm2")
2105 (version "2.02.176")
2106 (source (origin
2107 (method url-fetch)
2108 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2109 version ".tgz"))
2110 (sha256
2111 (base32
2112 "0wx4rvy4frdmb66znh2xms2j2n06sm361ki6l5ks4y1ciii87kny"))
2113 (modules '((guix build utils)))
2114 (snippet
2115 '(begin
2116 (use-modules (guix build utils))
2117
2118 ;; Honor sysconfdir.
2119 (substitute* "make.tmpl.in"
2120 (("confdir = .*$")
2121 "confdir = @sysconfdir@\n")
2122 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2123 "DEFAULT_SYS_DIR = @sysconfdir@"))))
2124 (patches (search-patches "lvm2-static-link.patch"))))
2125 (build-system gnu-build-system)
2126 (native-inputs
2127 `(("pkg-config" ,pkg-config)
2128 ("procps" ,procps))) ;tests use 'pgrep'
2129 (inputs
2130 `(("udev" ,eudev)))
2131 (arguments
2132 '(#:phases
2133 (modify-phases %standard-phases
2134 (add-after 'configure 'set-makefile-shell
2135 (lambda _
2136 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2137 ;; expected.
2138 (setenv "SHELL" (which "sh"))
2139
2140 ;; Replace /bin/sh with the right file name.
2141 (patch-makefile-SHELL "make.tmpl")
2142 #t))
2143 (add-before 'strip 'make-objects-writable
2144 (lambda* (#:key outputs #:allow-other-keys)
2145 ;; Make compiled objects writable so they can be stripped.
2146 (let ((out (assoc-ref outputs "out")))
2147 (for-each (lambda (file)
2148 (chmod file #o755))
2149 (append
2150 (find-files (string-append out "/lib"))
2151 (find-files (string-append out "/sbin"))))
2152 #t))))
2153
2154 #:configure-flags (list (string-append "--sysconfdir="
2155 (assoc-ref %outputs "out")
2156 "/etc/lvm")
2157 "--enable-udev_sync"
2158 "--enable-udev_rules"
2159
2160 ;; Make sure programs such as 'dmsetup' can
2161 ;; find libdevmapper.so.
2162 (string-append "LDFLAGS=-Wl,-rpath="
2163 (assoc-ref %outputs "out")
2164 "/lib"))
2165
2166 ;; The tests use 'mknod', which requires root access.
2167 #:tests? #f))
2168 (home-page "https://sourceware.org/lvm2/")
2169 (synopsis "Logical volume management for Linux")
2170 (description
2171 "LVM2 is the logical volume management tool set for Linux-based systems.
2172This package includes the user-space libraries and tools, including the device
2173mapper. Kernel components are part of Linux-libre.")
2174
2175 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2176 ;; Command-line tools are GPLv2.
2177 (license (list license:gpl2 license:lgpl2.1))))
2178
2179(define-public lvm2-static
2180 (package
2181 (inherit lvm2)
2182 (name "lvm2-static")
2183
2184 ;; Propagate udev because libdevmapper.a depends on libudev.
2185 (inputs (alist-delete "udev" (package-inputs lvm2)))
2186 (propagated-inputs `(("udev" ,eudev)))
2187
2188 (arguments
2189 (substitute-keyword-arguments (package-arguments lvm2)
2190 ((#:configure-flags flags '())
2191 ;; LVM2 doesn't use Libtool, hence the custom option.
2192 `(cons "--enable-static_link" ,flags))))
2193 (synopsis "Logical volume management for Linux (statically linked)")))
2194
2195(define-public wireless-tools
2196 (package
2197 (name "wireless-tools")
2198 (version "30.pre9")
2199 (source (origin
2200 (method url-fetch)
2201 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2202 version ".tar.gz"))
2203 (sha256
2204 (base32
2205 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2206 (snippet
2207 '(begin
2208 ;; Remove the older header files that are not free software.
2209 (for-each (lambda (n)
2210 (delete-file (format #f "wireless.~a.h" n)))
2211 '(10 11 12 13 14 15 16 17 18 19 20))
2212 #t))))
2213 (build-system gnu-build-system)
2214 (arguments
2215 `(#:make-flags
2216 (list (string-append "PREFIX=" %output)
2217 (string-append "INSTALL_MAN=" %output "/share/man")
2218 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2219 "BUILD_STATIC=")
2220 #:phases (modify-phases %standard-phases
2221 (delete 'configure))
2222 #:tests? #f))
2223 (synopsis "Tools for manipulating Linux Wireless Extensions")
2224 (description "Wireless Tools are used to manipulate the now-deprecated
2225Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2226Extension was an interface allowing you to set Wireless LAN specific
2227parameters and get the specific stats. It is deprecated in favor the nl80211
2228interface.")
2229 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2230 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2231 ;; other files are distributed under gpl2.
2232 (license (list license:gpl2 license:lgpl2.1+))))
2233
2234(define-public crda
2235 (package
2236 (name "crda")
2237 (version "3.18")
2238 (source (origin
2239 (method url-fetch)
2240 (uri (string-append "mirror://kernel.org/software/network/crda/"
2241 "crda-" version ".tar.xz"))
2242 (sha256
2243 (base32
2244 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2245 (patches (search-patches "crda-optional-gcrypt.patch"))))
2246 (build-system gnu-build-system)
2247 (arguments
2248 '(#:phases (modify-phases %standard-phases
2249 (delete 'configure)
2250 (add-before
2251 'build 'no-werror-no-ldconfig
2252 (lambda _
2253 (substitute* "Makefile"
2254 (("-Werror") "")
2255 (("ldconfig") "true"))
2256 #t))
2257 (add-before
2258 'build 'set-regulator-db-file-name
2259 (lambda* (#:key inputs #:allow-other-keys)
2260 ;; Tell CRDA where to find our database.
2261 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2262 (substitute* "crda.c"
2263 (("\"/lib/crda/regulatory.bin\"")
2264 (string-append "\"" regdb
2265 "/lib/crda/regulatory.bin\"")))
2266 #t))))
2267 #:test-target "verify"
2268 #:make-flags (let ((out (assoc-ref %outputs "out"))
2269 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2270 (list "CC=gcc" "V=1"
2271
2272 ;; Disable signature-checking on 'regulatory.bin'.
2273 ;; The reason is that this simplifies maintenance
2274 ;; on our side (no need to manage a distro key
2275 ;; pair), and we can guarantee integrity of
2276 ;; 'regulatory.bin' by other means anyway, such as
2277 ;; 'guix gc --verify'. See
2278 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2279 ;; for a discssion.
2280 "USE_OPENSSL=0"
2281
2282 (string-append "PREFIX=" out)
2283 (string-append "SBINDIR=" out "/sbin/")
2284 (string-append "UDEV_RULE_DIR="
2285 out "/lib/udev/rules.d")
2286 (string-append "LDFLAGS=-Wl,-rpath="
2287 out "/lib -L.")
2288 (string-append "REG_BIN=" regdb
2289 "/lib/crda/regulatory.bin")))))
2290 (native-inputs `(("pkg-config" ,pkg-config)
2291 ("python" ,python-2)
2292 ("wireless-regdb" ,wireless-regdb)))
2293 (inputs `(("libnl" ,libnl)))
2294 (home-page
2295 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2296 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2297 (description
2298 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2299communication between the kernel Linux and user space for regulatory
2300compliance.")
2301 (license license:copyleft-next)))
2302
2303(define-public wireless-regdb
2304 (package
2305 (name "wireless-regdb")
2306 (version "2017.03.07")
2307 (source (origin
2308 (method url-fetch)
2309 (uri (string-append
2310 "mirror://kernel.org/software/network/wireless-regdb/"
2311 "wireless-regdb-" version ".tar.xz"))
2312 (sha256
2313 (base32
2314 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2315
2316 ;; We're building 'regulatory.bin' by ourselves.
2317 (snippet '(delete-file "regulatory.bin"))))
2318 (build-system gnu-build-system)
2319 (arguments
2320 '(#:phases (modify-phases %standard-phases
2321 (delete 'configure))
2322
2323 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2324 ;; is computed and can be equal to 'maintainer-clean'; when that
2325 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2326 ;; just built. Thus, build things sequentially.
2327 #:parallel-build? #f
2328
2329 #:tests? #f ;no tests
2330 #:make-flags (let ((out (assoc-ref %outputs "out")))
2331 (list (string-append "PREFIX=" out)
2332 (string-append "LSB_ID=GuixSD")
2333 (string-append "DISTRO_PUBKEY=/dev/null")
2334 (string-append "DISTRO_PRIVKEY=/dev/null")
2335 (string-append "REGDB_PUBKEY=/dev/null")
2336
2337 ;; Leave that empty so that db2bin.py doesn't try
2338 ;; to sign 'regulatory.bin'. This allows us to
2339 ;; avoid managing a key pair for the whole distro.
2340 (string-append "REGDB_PRIVKEY=")))))
2341 (native-inputs `(("python" ,python-2)))
2342 (home-page
2343 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2344 (synopsis "Wireless regulatory database")
2345 (description
2346 "This package contains the wireless regulatory database Central
2347Regulatory Database Agent (CRDA) daemon. The database contains information on
2348country-specific regulations for the wireless spectrum.")
2349 (license license:isc)))
2350
2351(define-public lm-sensors
2352 (package
2353 (name "lm-sensors")
2354 (version "3.4.0")
2355 (source (origin
2356 (method url-fetch)
2357 (uri (list (string-append
2358 "https://github.com/groeck/lm-sensors/archive/V"
2359 (string-join (string-split version #\.) "-")
2360 ".tar.gz")))
2361 (file-name (string-append name "-" version ".tar.gz"))
2362 (sha256
2363 (base32
2364 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2365 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2366 (build-system gnu-build-system)
2367 (inputs `(("rrdtool" ,rrdtool)
2368 ("perl" ,perl)
2369 ("kmod" ,kmod)
2370 ("gnuplot" ,gnuplot)))
2371 (native-inputs `(("pkg-config" ,pkg-config)
2372 ("flex" ,flex)
2373 ("bison" ,bison)
2374 ("which" ,which)))
2375 (outputs '("lib" ;avoid perl in closure
2376 "out"))
2377 (arguments
2378 `(#:tests? #f ; no 'check' target
2379 #:make-flags (list (string-append "PREFIX=" %output)
2380 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
2381 (string-append "INCLUDEDIR="
2382 (assoc-ref %outputs "lib") "/include")
2383 (string-append "MANDIR=" %output "/share/man")
2384 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
2385 #:phases
2386 (modify-phases %standard-phases
2387 (delete 'configure)
2388 (add-before 'build 'patch-exec-paths
2389 (lambda* (#:key inputs outputs #:allow-other-keys)
2390 (substitute* "prog/detect/sensors-detect"
2391 (("`uname")
2392 (string-append "`" (assoc-ref inputs "coreutils")
2393 "/bin/uname"))
2394 (("(`|\")modprobe" all open-quote)
2395 (string-append open-quote
2396 (assoc-ref inputs "kmod")
2397 "/bin/modprobe")))
2398 (substitute* '("prog/pwm/pwmconfig"
2399 "prog/pwm/fancontrol")
2400 (("gnuplot")
2401 (string-append (assoc-ref inputs "gnuplot")
2402 "/bin/gnuplot"))
2403 (("cat ")
2404 (string-append (assoc-ref inputs "coreutils")
2405 "/bin/cat "))
2406 (("egrep ")
2407 (string-append (assoc-ref inputs "grep")
2408 "/bin/egrep "))
2409 (("sed -e")
2410 (string-append (assoc-ref inputs "sed")
2411 "/bin/sed -e"))
2412 (("cut -d")
2413 (string-append (assoc-ref inputs "coreutils")
2414 "/bin/cut -d"))
2415 (("sleep ")
2416 (string-append (assoc-ref inputs "coreutils")
2417 "/bin/sleep "))
2418 (("readlink -f")
2419 (string-append (assoc-ref inputs "coreutils")
2420 "/bin/readlink -f")))
2421 #t)))))
2422 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2423 (synopsis "Utilities to read temperature/voltage/fan sensors")
2424 (description
2425 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2426you to access information from temperature, voltage, and fan speed sensors.
2427It works with most newer systems.")
2428 (license license:gpl2+)))
2429
2430(define-public i2c-tools
2431 (package
2432 (name "i2c-tools")
2433 (version "3.1.1")
2434 (source (origin
2435 (method url-fetch)
2436 (uri (string-append
2437 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2438 version ".tar.bz2"))
2439 (sha256
2440 (base32
2441 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2442 (build-system gnu-build-system)
2443 (arguments
2444 `(#:tests? #f ; no 'check' target
2445 #:make-flags (list (string-append "prefix=" %output)
2446 "CC=gcc")
2447 ;; no configure script
2448 #:phases (modify-phases %standard-phases (delete 'configure))))
2449 (inputs
2450 `(("perl" ,perl)))
2451 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2452 (synopsis "I2C tools for Linux")
2453 (description
2454 "The i2c-tools package contains a heterogeneous set of I2C tools for
2455Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2456EEPROM decoding scripts, EEPROM programming tools, and a python module for
2457SMBus access.")
2458 (license license:gpl2+)))
2459
2460(define-public xsensors
2461 (package
2462 (name "xsensors")
2463 (version "0.70")
2464 (source (origin
2465 (method url-fetch)
2466 (uri (string-append
2467 "http://www.linuxhardware.org/xsensors/xsensors-"
2468 version ".tar.gz"))
2469 (sha256
2470 (base32
2471 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2472 (build-system gnu-build-system)
2473 (inputs `(("lm-sensors" ,lm-sensors "lib")
2474 ("gtk" ,gtk+-2)))
2475 (native-inputs `(("pkg-config" ,pkg-config)))
2476 (arguments
2477 `(#:phases
2478 (modify-phases %standard-phases
2479 (add-before 'configure 'enable-deprecated
2480 (lambda _
2481 (substitute* "src/Makefile.in"
2482 (("-DGDK_DISABLE_DEPRECATED") "")
2483 (("-DGTK_DISABLE_DEPRECATED") ""))
2484 #t))
2485 (add-before 'configure 'remove-Werror
2486 (lambda _
2487 (substitute* '("configure" "src/Makefile.in")
2488 (("-Werror") ""))
2489 #t)))))
2490 (home-page "http://www.linuxhardware.org/xsensors/")
2491 (synopsis "Hardware health information viewer")
2492 (description
2493 "Xsensors reads data from the libsensors library regarding hardware
2494health such as temperature, voltage and fan speed and displays the information
2495in a digital read-out.")
2496 (license license:gpl2+)))
2497
2498(define-public perf
2499 (package
2500 (name "perf")
2501 (version (package-version linux-libre))
2502 (source (package-source linux-libre))
2503 (build-system gnu-build-system)
2504 (arguments
2505 '(#:phases
2506 (modify-phases %standard-phases
2507 (replace 'configure
2508 (lambda* (#:key inputs #:allow-other-keys)
2509 (setenv "SHELL_PATH" (which "bash"))
2510 (chdir "tools/perf")
2511 #t)))
2512 #:make-flags (list (string-append "prefix="
2513 (assoc-ref %outputs "out"))
2514 "WERROR=0"
2515
2516 ;; By default, 'config/Makefile' uses lib64 on
2517 ;; x86_64. Work around that.
2518 "lib=lib")
2519 #:tests? #f)) ;no tests
2520 (native-inputs
2521 `(("pkg-config" ,pkg-config)
2522 ("bison" ,bison)
2523 ("flex" ,flex)
2524
2525 ;; There are build scripts written in these languages.
2526 ("perl" ,perl)
2527 ("python" ,python-2)))
2528 (inputs
2529 `(("slang" ,slang) ;for the interactive TUI
2530 ;; ("newt" ,newt)
2531 ("python" ,python-2) ;'perf' links against libpython
2532 ("elfutils" ,elfutils)
2533 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2534 ("libunwind" ,libunwind) ;better stack walking
2535 ("numactl" ,numactl) ;for 'perf bench numa mem'
2536
2537 ;; Documentation.
2538 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2539 ("docbook-xsl" ,docbook-xsl)
2540 ("xmlto" ,xmlto)
2541 ("asciidoc" ,asciidoc)))
2542 (home-page "https://perf.wiki.kernel.org/")
2543 (synopsis "Linux profiling with performance counters")
2544 (description
2545 "perf is a tool suite for profiling using hardware performance counters,
2546with support in the Linux kernel. perf can instrument CPU performance
2547counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2548of lightweight profiling. This package contains the user-land tools and in
2549particular the 'perf' command.")
2550 (license (package-license linux-libre))))
2551
2552(define-public pflask
2553 (package
2554 (name "pflask")
2555 (version "0.2")
2556 (source (origin
2557 (method url-fetch)
2558 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2559 version ".tar.gz"))
2560 (file-name (string-append name "-" version ".tar.gz"))
2561 (sha256
2562 (base32
2563 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2564 (build-system cmake-build-system)
2565 (arguments
2566 '(#:tests? #f)) ; no tests
2567 (home-page "http://ghedo.github.io/pflask/")
2568 (synopsis "Simple tool for creating Linux namespace containers")
2569 (description "pflask is a simple tool for creating Linux namespace
2570containers. It can be used for running a command or even booting an OS inside
2571an isolated container, created with the help of Linux namespaces. It is
2572similar in functionality to chroot, although pflask provides better isolation
2573thanks to the use of namespaces.")
2574 (license license:bsd-2)))
2575
2576(define-public hdparm
2577 (package
2578 (name "hdparm")
2579 (version "9.53")
2580 (source (origin
2581 (method url-fetch)
2582 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2583 name "-" version ".tar.gz"))
2584 (sha256
2585 (base32
2586 "1rb5086gp4l1h1fn2nk10ziqxjxigsd0c1zczahwc5k9vy8zawr6"))))
2587 (build-system gnu-build-system)
2588 (arguments
2589 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2590 (list (string-append "binprefix=" out)
2591 (string-append "manprefix=" out)
2592 "CC=gcc"))
2593 #:phases
2594 (modify-phases %standard-phases
2595 (delete 'configure)) ; no configure script
2596 #:tests? #f)) ; no test suite
2597 (home-page "https://sourceforge.net/projects/hdparm/")
2598 (synopsis "View and tune ATA disk drive parameters")
2599 (description
2600 "@command{hdparm} is a command-line utility to control ATA controllers and
2601disk drives. It can increase performance and/or reliability by careful tuning
2602of hardware settings like power and acoustic management, DMA modes, and caching.
2603It can also display detailed device information, or be used as a simple
2604performance benchmarking tool.
2605
2606@command{hdparm} provides a command line interface to various Linux kernel
2607interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2608IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
2609Translation (@dfn{SAT}) are also supported.")
2610 (license (license:non-copyleft "file://LICENSE.TXT"))))
2611
2612(define-public rfkill
2613 (package
2614 (name "rfkill")
2615 (version "0.5")
2616 (source (origin
2617 (method url-fetch)
2618 (uri (string-append "mirror://kernel.org/software/network/"
2619 name "/" name "-" version ".tar.xz"))
2620 (sha256
2621 (base32
2622 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2623 (build-system gnu-build-system)
2624 (arguments
2625 `(#:make-flags (list "CC=gcc"
2626 (string-append "PREFIX=" %output))
2627 #:phases (modify-phases %standard-phases
2628 (delete 'configure))
2629 #:tests? #f))
2630 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2631 (synopsis "Tool for enabling and disabling wireless devices")
2632 (description
2633 "rfkill is a simple tool for accessing the rfkill device interface,
2634which is used to enable and disable wireless networking devices, typically
2635WLAN, Bluetooth and mobile broadband.")
2636 (license (license:non-copyleft "file://COPYING"
2637 "See COPYING in the distribution."))))
2638
2639(define-public acpi
2640 (package
2641 (name "acpi")
2642 (version "1.7")
2643 (source (origin
2644 (method url-fetch)
2645 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2646 version "/" name "-" version ".tar.gz"))
2647 (sha256
2648 (base32
2649 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2650 (build-system gnu-build-system)
2651 (home-page "http://acpiclient.sourceforge.net")
2652 (synopsis "Display information on ACPI devices")
2653 (description "@code{acpi} attempts to replicate the functionality of the
2654\"old\" @code{apm} command on ACPI systems, including battery and thermal
2655information. It does not support ACPI suspending, only displays information
2656about ACPI devices.")
2657 (license license:gpl2+)))
2658
2659(define-public acpid
2660 (package
2661 (name "acpid")
2662 (version "2.0.28")
2663 (source (origin
2664 (method url-fetch)
2665 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2666 version ".tar.xz"))
2667 (sha256
2668 (base32
2669 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2670 (build-system gnu-build-system)
2671 (home-page "https://sourceforge.net/projects/acpid2/")
2672 (synopsis "Daemon for delivering ACPI events to user-space programs")
2673 (description
2674 "acpid is designed to notify user-space programs of Advanced
2675Configuration and Power Interface (ACPI) events. acpid should be started
2676during the system boot, and will run as a background process. When an ACPI
2677event is received from the kernel, acpid will examine the list of rules
2678specified in /etc/acpi/events and execute the rules that match the event.")
2679 (license license:gpl2+)))
2680
2681(define-public sysfsutils
2682 (package
2683 (name "sysfsutils")
2684 (version "2.1.0")
2685 (source
2686 (origin
2687 (method url-fetch)
2688 (uri
2689 (string-append
2690 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2691 version ".tar.gz"))
2692 (sha256
2693 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2694 (build-system gnu-build-system)
2695 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2696 (synopsis "System utilities based on Linux sysfs")
2697 (description
2698 "These are a set of utilities built upon sysfs, a virtual file system in
2699Linux kernel versions 2.5+ that exposes a system's device tree. The package
2700also contains the libsysfs library.")
2701 ;; The library is under lgpl2.1+ (all files say "or any later version").
2702 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2703 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2704
2705(define-public sysfsutils-1
2706 (package
2707 (inherit sysfsutils)
2708 (version "1.3.0")
2709 (source
2710 (origin
2711 (method url-fetch)
2712 (uri
2713 (string-append
2714 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2715 "/sysfsutils-" version ".tar.gz"))
2716 (sha256
2717 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2718 (modules '((guix build utils)))
2719 (snippet
2720 '(begin
2721 (substitute* "Makefile.in"
2722 (("includedir = /usr/include/sysfs")
2723 "includedir = @includedir@"))
2724 (substitute* "configure"
2725 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2726 (string-append "includedir='" orig "/sysfs'")))))))
2727 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2728
2729(define-public cpufrequtils
2730 (package
2731 (name "cpufrequtils")
2732 (version "0.3")
2733 (source
2734 (origin
2735 (method url-fetch)
2736 (uri
2737 (string-append
2738 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2739 version ".tar.gz"))
2740 (sha256
2741 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2742 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2743 (build-system gnu-build-system)
2744 (native-inputs
2745 `(("sysfsutils" ,sysfsutils-1)))
2746 (arguments
2747 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2748 (assoc-ref %outputs "out") "/lib"))))
2749 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2750 (synopsis "Utilities to get and set CPU frequency on Linux")
2751 (description
2752 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2753information, and set the CPU frequency if supported, using the cpufreq
2754capabilities of the Linux kernel.")
2755 (license license:gpl2)))
2756
2757(define-public libraw1394
2758 (package
2759 (name "libraw1394")
2760 (version "2.1.2")
2761 (source (origin
2762 (method url-fetch)
2763 (uri (string-append
2764 "mirror://kernel.org/linux/libs/ieee1394/"
2765 name "-" version ".tar.xz"))
2766 (sha256
2767 (base32
2768 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2769 (build-system gnu-build-system)
2770 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2771 (synopsis "Interface library for the Linux IEEE1394 drivers")
2772 (description
2773 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2774the Linux IEEE-1394 subsystem, which provides direct access to the connected
27751394 buses to user space. Through libraw1394/raw1394, applications can directly
2776send to and receive from other nodes without requiring a kernel driver for the
2777protocol in question.")
2778 (license license:lgpl2.1+)))
2779
2780(define-public libavc1394
2781 (package
2782 (name "libavc1394")
2783 (version "0.5.4")
2784 (source (origin
2785 (method url-fetch)
2786 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2787 name "-" version ".tar.gz"))
2788 (sha256
2789 (base32
2790 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2791 (build-system gnu-build-system)
2792 (native-inputs
2793 `(("pkg-config" ,pkg-config)))
2794 (propagated-inputs
2795 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2796 (home-page "https://sourceforge.net/projects/libavc1394/")
2797 (synopsis "AV/C protocol library for IEEE 1394")
2798 (description
2799 "Libavc1394 is a programming interface to the AV/C specification from
2800the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2801 (license license:lgpl2.1+)))
2802
2803(define-public libiec61883
2804 (package
2805 (name "libiec61883")
2806 (version "1.2.0")
2807 (source (origin
2808 (method url-fetch)
2809 (uri (string-append
2810 "mirror://kernel.org/linux/libs/ieee1394/"
2811 name "-" version ".tar.xz"))
2812 (sha256
2813 (base32
2814 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2815 (build-system gnu-build-system)
2816 (native-inputs
2817 `(("pkg-config" ,pkg-config)))
2818 (propagated-inputs
2819 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2820 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2821 (synopsis "Isochronous streaming media library for IEEE 1394")
2822 (description
2823 "The libiec61883 library provides a higher level API for streaming DV,
2824MPEG-2 and audio over Linux IEEE 1394.")
2825 (license license:lgpl2.1+)))
2826
2827(define-public mdadm
2828 (package
2829 (name "mdadm")
2830 (version "4.0")
2831 (source (origin
2832 (method url-fetch)
2833 (uri (string-append
2834 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2835 version ".tar.xz"))
2836 (sha256
2837 (base32
2838 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2839 (build-system gnu-build-system)
2840 (inputs
2841 `(("udev" ,eudev)))
2842 (arguments
2843 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2844 (list "CC=gcc"
2845 "INSTALL=install"
2846 "CHECK_RUN_DIR=0"
2847 ;; TODO: tell it where to find 'sendmail'
2848 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2849 (string-append "BINDIR=" out "/sbin")
2850 (string-append "MANDIR=" out "/share/man")
2851 (string-append "UDEVDIR=" out "/lib/udev")))
2852 #:phases
2853 (modify-phases %standard-phases
2854 (add-before 'build 'patch-program-paths
2855 (lambda* (#:key inputs #:allow-other-keys)
2856 (let ((coreutils (assoc-ref inputs "coreutils")))
2857 (substitute* "udev-md-raid-arrays.rules"
2858 (("/usr/bin/(readlink|basename)" all program)
2859 (string-append coreutils "/bin/" program))))
2860 #t))
2861 (add-before 'build 'remove-W-error
2862 (lambda _
2863 ;; We cannot build with -Werror on i686 due to a
2864 ;; 'sign-compare' warning in util.c.
2865 (substitute* "Makefile"
2866 (("-Werror") ""))
2867 #t))
2868 (delete 'configure))
2869 ;;tests must be done as root
2870 #:tests? #f))
2871 (home-page "http://neil.brown.name/blog/mdadm")
2872 (synopsis "Tool for managing Linux Software RAID arrays")
2873 (description
2874 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2875assemble, report on, and monitor arrays. It can also move spares between raid
2876arrays when needed.")
2877 (license license:gpl2+)))
2878
2879(define-public mdadm-static
2880 (package
2881 (inherit mdadm)
2882 (name "mdadm-static")
2883 (arguments
2884 (substitute-keyword-arguments (package-arguments mdadm)
2885 ((#:make-flags flags)
2886 `(cons "LDFLAGS = -static" ,flags))
2887 ((#:phases phases)
2888 `(modify-phases ,phases
2889 (add-after 'install 'remove-cruft
2890 (lambda* (#:key outputs #:allow-other-keys)
2891 (let* ((out (assoc-ref outputs "out"))
2892 (precious? (lambda (file)
2893 (member file '("." ".." "sbin"))))
2894 (directories (scandir out (negate precious?))))
2895 (with-directory-excursion out
2896 (for-each delete-file-recursively directories)
2897 (remove-store-references "sbin/mdadm")
2898 (delete-file "sbin/mdmon")
2899 #t))))))
2900 ((#:modules modules %gnu-build-system-modules)
2901 `((ice-9 ftw) ,@modules))
2902 ((#:strip-flags _ '())
2903 ''("--strip-all")) ;strip a few extra KiB
2904 ((#:allowed-references _ '("out"))
2905 '("out")))) ;refer only self
2906 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2907
2908(define-public multipath-tools
2909 (package
2910 (name "multipath-tools")
2911 (version "0.7.1")
2912 (source (origin
2913 (method url-fetch)
2914 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2915 ".git;a=snapshot;h=" version ";sf=tgz"))
2916 (file-name (string-append name "-" version ".tar.gz"))
2917 (sha256
2918 (base32
2919 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
2920 (modules '((guix build utils)))
2921 (snippet
2922 '(begin
2923 ;; Drop bundled valgrind headers.
2924 (delete-file-recursively "third-party")
2925 (substitute* '("multipathd/main.c"
2926 "libmultipath/debug.c")
2927 (("#include \"../third-party/")
2928 "#include \""))
2929 #t))))
2930 (build-system gnu-build-system)
2931 (arguments
2932 '(#:tests? #f ; No tests.
2933 #:make-flags (list (string-append "DESTDIR="
2934 (assoc-ref %outputs "out"))
2935 "SYSTEMDPATH=lib"
2936 (string-append "LDFLAGS=-Wl,-rpath="
2937 (assoc-ref %outputs "out")
2938 "/lib"))
2939 #:phases
2940 (modify-phases %standard-phases
2941 (add-after 'unpack 'patch-source
2942 (lambda* (#:key inputs #:allow-other-keys)
2943 (let ((lvm2 (assoc-ref inputs "lvm2"))
2944 (udev (assoc-ref inputs "udev")))
2945 (substitute* "Makefile.inc"
2946 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2947 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2948 (("/usr/include/libdevmapper.h")
2949 (string-append lvm2 "/include/libdevmapper.h"))
2950 (("/usr/include/libudev.h")
2951 (string-append udev "/include/libudev.h")))
2952 #t)))
2953 (delete 'configure)
2954 (add-before 'build 'set-CC
2955 (lambda _
2956 (setenv "CC" "gcc")
2957 #t)))))
2958 (native-inputs
2959 `(("perl" ,perl)
2960 ("pkg-config" ,pkg-config)
2961 ("valgrind" ,valgrind)))
2962 (inputs
2963 `(("ceph:lib" ,ceph "lib")
2964 ("json-c" ,json-c)
2965 ("libaio" ,libaio)
2966 ("liburcu" ,liburcu)
2967 ("lvm2" ,lvm2)
2968 ("readline" ,readline)
2969 ("udev" ,eudev)))
2970 (home-page "http://christophe.varoqui.free.fr/")
2971 (synopsis "Access block devices through multiple paths")
2972 (description
2973 "This package provides the following binaries to drive the
2974Linux Device Mapper multipathing driver:
2975@enumerate
2976@item @command{multipath} - Device mapper target autoconfig.
2977@item @command{multipathd} - Multipath daemon.
2978@item @command{mpathpersist} - Manages SCSI persistent reservations on
2979@code{dm} multipath devices.
2980@item @command{kpartx} - Create device maps from partition tables.
2981@end enumerate")
2982 (license (list license:gpl2+ ; Main distribution.
2983 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2984
2985(define-public libaio
2986 (package
2987 (name "libaio")
2988 (version "0.3.110")
2989 (source (origin
2990 (method url-fetch)
2991 (uri (list
2992 (string-append "mirror://debian/pool/main/liba/libaio/"
2993 name "_" version ".orig.tar.gz")))
2994 (sha256
2995 (base32
2996 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2997 (build-system gnu-build-system)
2998 (arguments
2999 '(#:make-flags
3000 (list "CC=gcc" (string-append "prefix=" %output))
3001 #:test-target "partcheck" ; need root for a full 'check'
3002 #:phases
3003 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
3004 (home-page "http://lse.sourceforge.net/io/aio.html")
3005 (synopsis "Linux-native asynchronous I/O access library")
3006 (description
3007 "This library enables userspace to use Linux kernel asynchronous I/O
3008system calls, important for the performance of databases and other advanced
3009applications.")
3010 (license license:lgpl2.1+)))
3011
3012(define-public sbc
3013 (package
3014 (name "sbc")
3015 (version "1.3")
3016 (source (origin
3017 (method url-fetch)
3018 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
3019 name "-" version ".tar.xz"))
3020 (sha256
3021 (base32
3022 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
3023 (build-system gnu-build-system)
3024 (inputs
3025 `(("libsndfile" ,libsndfile)))
3026 (native-inputs
3027 `(("pkg-config" ,pkg-config)))
3028 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3029 (synopsis "Bluetooth subband audio codec")
3030 (description
3031 "The SBC is a digital audio encoder and decoder used to transfer data to
3032Bluetooth audio output devices like headphones or loudspeakers.")
3033 (license license:gpl2+)))
3034
3035(define-public bluez
3036 (package
3037 (name "bluez")
3038 (version "5.47")
3039 (source (origin
3040 (method url-fetch)
3041 (uri (string-append
3042 "mirror://kernel.org/linux/bluetooth/bluez-"
3043 version ".tar.xz"))
3044 (sha256
3045 (base32
3046 "1j22hfjz0fp4pgclgz9mfcwjbr4wqgah3gd2qhfg4r6msmybyxfg"))))
3047 (build-system gnu-build-system)
3048 (arguments
3049 `(#:configure-flags
3050 (let ((out (assoc-ref %outputs "out")))
3051 (list "--sysconfdir=/etc"
3052 "--localstatedir=/var"
3053 "--enable-library"
3054 "--disable-systemd"
3055 ;; Install dbus/udev files to the correct location.
3056 (string-append "--with-dbusconfdir=" out "/etc")
3057 (string-append "--with-udevdir=" out "/lib/udev")))
3058 #:phases
3059 (modify-phases %standard-phases
3060 ,@(if (string=? (%current-system) "armhf-linux")
3061 ;; This test fails unpredictably.
3062 ;; TODO: skip it for all architectures.
3063 `((add-before 'check 'skip-wonky-test
3064 (lambda _
3065 (substitute* "unit/test-gatt.c"
3066 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3067 #t)))
3068 `())
3069
3070 (add-after 'install 'post-install
3071 (lambda* (#:key inputs outputs #:allow-other-keys)
3072 (let* ((out (assoc-ref outputs "out"))
3073 (servicedir (string-append out "/share/dbus-1/services"))
3074 (service "obexd/src/org.bluez.obex.service")
3075 (rule (string-append
3076 out "/lib/udev/rules.d/97-hid2hci.rules")))
3077 ;; Install the obex dbus service file.
3078 (substitute* service
3079 (("/bin/false")
3080 (string-append out "/libexec/bluetooth/obexd")))
3081 (install-file service servicedir)
3082 ;; Fix paths in the udev rule.
3083 (substitute* rule
3084 (("hid2hci --method")
3085 (string-append out "/lib/udev/hid2hci --method"))
3086 (("/sbin/udevadm")
3087 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3088 #t))))))
3089 (native-inputs
3090 `(("pkg-config" ,pkg-config)
3091 ("gettext" ,gettext-minimal)))
3092 (inputs
3093 `(("glib" ,glib)
3094 ("dbus" ,dbus)
3095 ("eudev" ,eudev)
3096 ("libical" ,libical)
3097 ("readline" ,readline)))
3098 (home-page "http://www.bluez.org/")
3099 (synopsis "Linux Bluetooth protocol stack")
3100 (description
3101 "BlueZ provides support for the core Bluetooth layers and protocols. It
3102is flexible, efficient and uses a modular implementation.")
3103 (license license:gpl2+)))
3104
3105(define-public fuse-exfat
3106 (package
3107 (name "fuse-exfat")
3108 (version "1.2.7")
3109 (source (origin
3110 (method url-fetch)
3111 (uri (string-append
3112 "https://github.com/relan/exfat/releases/download/v"
3113 version "/" name "-" version ".tar.gz"))
3114 (sha256
3115 (base32
3116 "0df0ccnd0dgwc6rvk9qmrz0nfb8whc5s3wg9qnw1mzbrh4rcvhw2"))))
3117 (build-system gnu-build-system)
3118 (native-inputs
3119 `(("pkg-config" ,pkg-config)))
3120 (inputs
3121 `(("fuse" ,fuse)))
3122 (home-page "https://github.com/relan/exfat")
3123 (synopsis "Mount exFAT file systems")
3124 (description
3125 "This package provides a FUSE-based file system that provides read and
3126write access to exFAT devices.")
3127 (license license:gpl2+)))
3128
3129(define-public gpm
3130 (package
3131 (name "gpm")
3132 (version "1.20.7")
3133 (source (origin
3134 (method url-fetch)
3135 (uri (string-append
3136 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3137 version ".tar.bz2"))
3138 (sha256
3139 (base32
3140 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3141 (build-system gnu-build-system)
3142 (arguments
3143 '(#:phases (modify-phases %standard-phases
3144 (add-after 'unpack 'bootstrap
3145 (lambda _
3146 ;; The tarball was not generated with 'make dist' so we
3147 ;; need to bootstrap things ourselves.
3148 (substitute* "autogen.sh"
3149 (("/bin/sh") (which "sh")))
3150 (and (zero? (system* "./autogen.sh"))
3151 (begin
3152 (patch-makefile-SHELL "Makefile.include.in")
3153 #t)))))
3154
3155 ;; Make sure programs find libgpm.so.
3156 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3157 (assoc-ref %outputs "out")
3158 "/lib"))))
3159 (native-inputs
3160 `(("texinfo" ,texinfo)
3161 ("bison" ,bison)
3162 ("flex" ,flex)
3163 ("autoconf" ,autoconf)
3164 ("automake" ,automake)
3165 ("libtool" ,libtool)))
3166 (home-page "http://www.nico.schottelius.org/software/gpm/")
3167 (synopsis "Mouse support for the Linux console")
3168 (description
3169 "The GPM (general-purpose mouse) daemon is a mouse server for
3170applications running on the Linux console. It allows users to select items
3171and copy/paste text in the console and in xterm.")
3172 (license license:gpl2+)))
3173
3174(define-public btrfs-progs
3175 (package
3176 (name "btrfs-progs")
3177 (version "4.14.1")
3178 (source (origin
3179 (method url-fetch)
3180 (uri (string-append "mirror://kernel.org/linux/kernel/"
3181 "people/kdave/btrfs-progs/"
3182 "btrfs-progs-v" version ".tar.xz"))
3183 (sha256
3184 (base32
3185 "1palnddw3d50kyflwk1j4xapbc6jniid6j5i9dsr8l8a7nkv7ich"))))
3186 (build-system gnu-build-system)
3187 (outputs '("out"
3188 "static")) ; static versions of the binaries in "out"
3189 (arguments
3190 '(#:phases (modify-phases %standard-phases
3191 (add-after 'build 'build-static
3192 (lambda _ (zero? (system* "make" "static"))))
3193 (add-after 'install 'install-bash-completion
3194 (lambda* (#:key outputs #:allow-other-keys)
3195 (install-file "btrfs-completion"
3196 (string-append (assoc-ref outputs "out")
3197 "/etc/bash_completion.d"))
3198 #t))
3199 (add-after 'install 'install-static
3200 (let ((staticbin (string-append (assoc-ref %outputs "static")
3201 "/bin")))
3202 (lambda _
3203 (zero? (system* "make"
3204 (string-append "bindir=" staticbin)
3205 "install-static"))))))
3206 #:test-target "test"
3207 #:parallel-tests? #f)) ; tests fail when run in parallel
3208 (inputs `(("e2fsprogs" ,e2fsprogs)
3209 ("libblkid" ,util-linux)
3210 ("libblkid:static" ,util-linux "static")
3211 ("libuuid" ,util-linux)
3212 ("libuuid:static" ,util-linux "static")
3213 ("lzo" ,lzo)
3214 ("zlib" ,zlib)
3215 ("zstd" ,zstd)))
3216 (native-inputs `(("pkg-config" ,pkg-config)
3217 ("asciidoc" ,asciidoc)
3218 ("xmlto" ,xmlto)
3219 ;; For building documentation.
3220 ("libxml2" ,libxml2)
3221 ("docbook-xsl" ,docbook-xsl)
3222 ;; For tests.
3223 ("acl" ,acl)
3224 ("which" ,which)))
3225 (home-page "https://btrfs.wiki.kernel.org/")
3226 (synopsis "Create and manage btrfs copy-on-write file systems")
3227 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3228aimed at implementing advanced features while focusing on fault tolerance,
3229repair and easy administration.")
3230 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3231 ;; GPL2: Everything else.
3232 (license (list license:gpl2 license:gpl2+))))
3233
3234(define-public btrfs-progs/static
3235 (package
3236 (name "btrfs-progs-static")
3237 (version (package-version btrfs-progs))
3238 (source #f)
3239 (build-system trivial-build-system)
3240 (inputs
3241 `(("btrfs-progs:static" ,btrfs-progs "static")))
3242 (arguments
3243 `(#:modules ((guix build utils))
3244 #:builder
3245 (begin
3246 (use-modules (guix build utils)
3247 (ice-9 ftw)
3248 (srfi srfi-26))
3249
3250 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3251 (out (assoc-ref %outputs "out"))
3252 (source (string-append btrfs "/bin/btrfs.static"))
3253 (target (string-append out "/bin/btrfs")))
3254 (mkdir-p (dirname target))
3255 (copy-file source target)
3256 (remove-store-references target)
3257 (chmod target #o555)))))
3258 (home-page (package-home-page btrfs-progs))
3259 (synopsis "Statically-linked btrfs command from btrfs-progs")
3260 (description "This package provides the statically-linked @command{btrfs}
3261from the btrfs-progs package. It is meant to be used in initrds.")
3262 (license (package-license btrfs-progs))))
3263
3264(define-public f2fs-tools
3265 (package
3266 (name "f2fs-tools")
3267 (version "1.8.0")
3268 (source (origin
3269 (method url-fetch)
3270 (uri (string-append
3271 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3272 "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
3273 (sha256
3274 (base32
3275 "1bir9ladb58ijlcvrjrq1fb1xv5ys50zdjaq0yzliib0apsyrnyl"))))
3276 (build-system gnu-build-system)
3277 (arguments
3278 `(#:phases
3279 (modify-phases %standard-phases
3280 (add-after 'unpack 'bootstrap
3281 (lambda _
3282 (zero? (system* "autoreconf" "-vif")))))))
3283 (native-inputs
3284 `(("autoconf" ,autoconf)
3285 ("automake" ,automake)
3286 ("libtool" ,libtool)
3287 ("pkg-config" ,pkg-config)))
3288 (inputs
3289 `(("libuuid" ,util-linux)))
3290 (home-page "https://f2fs.wiki.kernel.org/")
3291 (synopsis "Userland tools for f2fs")
3292 (description
3293 "F2FS, the Flash-Friendly File System, is a modern file system
3294designed to be fast and durable on flash devices such as solid-state
3295disks and SD cards. This package provides the userland utilities.")
3296 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
3297 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
3298 (license (list license:gpl2 license:lgpl2.1))))
3299
3300(define-public freefall
3301 (package
3302 (name "freefall")
3303 (version (package-version linux-libre))
3304 (source (package-source linux-libre))
3305 (build-system gnu-build-system)
3306 (arguments
3307 '(#:phases (modify-phases %standard-phases
3308 (add-after 'unpack 'enter-subdirectory
3309 (lambda _
3310 (chdir "tools/laptop/freefall")))
3311 (delete 'configure)
3312 (add-before 'build 'increase-timeout
3313 (lambda _
3314 ;; The default of 2 seconds is too low: it assumes an
3315 ;; open lid and AC power without actually checking.
3316 (substitute* "freefall.c"
3317 (("alarm\\(2\\)") "alarm(5)")))))
3318 #:make-flags (list (string-append "PREFIX="
3319 (assoc-ref %outputs "out")))
3320 #:tests? #f)) ;no tests
3321 (home-page (package-home-page linux-libre))
3322 (synopsis "Free-fall protection for spinning laptop hard drives")
3323 (description
3324 "Prevents shock damage to the internal spinning hard drive(s) of some
3325HP and Dell laptops. When sudden movement is detected, all input/output
3326operations on the drive are suspended and its heads are parked on the ramp,
3327where they are less likely to cause damage to the spinning disc. Requires a
3328drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3329feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3330 (license license:gpl2)))
3331
3332(define-public thinkfan
3333 (package
3334 (name "thinkfan")
3335 (version "0.9.3")
3336 (source (origin
3337 (method url-fetch)
3338 (uri (string-append "mirror://sourceforge/thinkfan/"
3339 "/thinkfan-" version ".tar.gz"))
3340 (sha256
3341 (base32
3342 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3343 (modules '((guix build utils)))
3344 ;; Fix erroneous man page location in Makefile leading to
3345 ;; a compilation failure.
3346 (snippet
3347 '(substitute* "CMakeLists.txt"
3348 (("thinkfan\\.1") "src/thinkfan.1")))))
3349 (build-system cmake-build-system)
3350 (arguments
3351 `(#:modules ((guix build cmake-build-system)
3352 (guix build utils)
3353 (srfi srfi-26))
3354 #:tests? #f ;no test target
3355 #:configure-flags
3356 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3357 `("-DUSE_ATASMART:BOOL=ON")
3358 #:phases
3359 (modify-phases %standard-phases
3360 ;; Install scripts for various foreign init systems. Also fix
3361 ;; hard-coded path for daemon.
3362 (add-after 'install 'install-rc-scripts
3363 (lambda* (#:key outputs #:allow-other-keys)
3364 (let ((out (assoc-ref outputs "out"))
3365 (files (find-files
3366 (string-append "../thinkfan-" ,version "/rcscripts")
3367 ".*")))
3368 (substitute* files
3369 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3370 (string-append out "/sbin/" name)))
3371 (for-each (cute install-file <>
3372 (string-append out "/share/thinkfan"))
3373 files))
3374 #t)))))
3375 (inputs
3376 `(("libatasmart" ,libatasmart)))
3377 (home-page "http://thinkfan.sourceforge.net/")
3378 (synopsis "Simple fan control program")
3379 (description
3380 "Thinkfan is a simple fan control program. It reads temperatures,
3381checks them against configured limits and switches to appropriate (also
3382pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3383other @code{hwmon} driver that enables temperature reading and fan control
3384from userspace.")
3385 (license license:gpl3+)))
3386
3387(define-public ntfs-3g
3388 (package
3389 (name "ntfs-3g")
3390 (version "2017.3.23")
3391 (source (origin
3392 (method url-fetch)
3393 (uri (string-append "https://tuxera.com/opensource/"
3394 "ntfs-3g_ntfsprogs-" version ".tgz"))
3395 (sha256
3396 (base32
3397 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
3398 (modules '((guix build utils)))
3399 (snippet
3400 ;; Install under $prefix.
3401 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3402 (("/sbin")
3403 "@sbindir@")))))
3404 (build-system gnu-build-system)
3405 (inputs `(("util-linux" ,util-linux)
3406 ("fuse" ,fuse))) ;libuuid
3407 (native-inputs `(("pkg-config" ,pkg-config)))
3408 (arguments
3409 '(#:configure-flags (list "--exec-prefix=${prefix}"
3410 "--with-fuse=external" ;use our own FUSE
3411 "--enable-mount-helper"
3412 "--enable-posix-acls"
3413 "--enable-xattr-mappings")))
3414 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
3415 (synopsis "Read-write access to NTFS file systems")
3416 (description
3417 "NTFS-3G provides read-write access to NTFS file systems, which are
3418commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3419The package provides additional NTFS tools.")
3420 (license license:gpl2+)))
3421
3422(define-public rdma-core
3423 (package
3424 (name "rdma-core")
3425 (version "14")
3426 (source (origin
3427 (method url-fetch)
3428 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3429 "/releases/download/v" version "/rdma-core-"
3430 version ".tar.gz"))
3431 (sha256
3432 (base32
3433 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
3434 (build-system cmake-build-system)
3435 (arguments
3436 '(#:tests? #f ; no tests
3437 ;; Upstream uses the "ninja" build system and encourage distros
3438 ;; to do the same for consistency. They also recommend using the
3439 ;; "Release" build type.
3440 #:configure-flags (list "-GNinja"
3441 ;; Defaults to "lib64" on 64-bit archs.
3442 (string-append "-DCMAKE_INSTALL_LIBDIR="
3443 (assoc-ref %outputs "out") "/lib")
3444 "-DCMAKE_BUILD_TYPE=Release")
3445 #:phases
3446 (modify-phases %standard-phases
3447 (replace 'build
3448 (lambda _
3449 (zero? (system* "ninja"
3450 "-j" (number->string (parallel-job-count))))))
3451 (replace 'install
3452 (lambda _
3453 (zero? (system* "ninja" "install")))))))
3454 (native-inputs
3455 `(("ninja" ,ninja)
3456 ("pkg-config" ,pkg-config)
3457 ("python" ,python-wrapper)))
3458 (inputs
3459 `(("libnl" ,libnl)
3460 ("udev" ,eudev)))
3461 (home-page "https://github.com/linux-rdma/rdma-core")
3462 (synopsis "Utilities and libraries for working with RDMA devices")
3463 (description
3464 "This package provides userspace components for the InfiniBand
3465subsystem of the Linux kernel. Specifically it contains userspace
3466libraries for the following device nodes:
3467
3468@enumerate
3469@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3470@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3471@item @file{/dev/infiniband/umadX} (@code{libibumad})
3472@end enumerate
3473
3474The following service daemons are also provided:
3475@enumerate
3476@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3477@item @code{iwpmd} (for iWARP kernel providers)
3478@item @code{ibacm} (for InfiniBand communication management assistant)
3479@end enumerate")
3480 ;; All library code is dual licensed under GPL2 and a custom MIT
3481 ;; variant. The package also includes some components covered by
3482 ;; other licenses. Consult COPYING.md for full details.
3483 (license
3484 (list license:gpl2
3485 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3486 license:bsd-2 ; Files referring to COPYING.BSD_FB
3487 license:cc0 ; most files in ccan/
3488 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3489
3490(define-public rng-tools
3491 (package
3492 (name "rng-tools")
3493 (version "6.1")
3494 (source (origin
3495 (method url-fetch)
3496 (uri (string-append "https://github.com/nhorman/rng-tools/"
3497 "archive/v" version ".tar.gz"))
3498 (file-name (string-append name "-" version ".tar.gz"))
3499 (sha256
3500 (base32
3501 "00ywsknjpc9jd9kfmz2syk9l0xkiiwyx5qhl5zvhhc69v6682i31"))))
3502 (build-system gnu-build-system)
3503 (arguments
3504 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
3505 #:configure-flags '("--without-nistbeacon")
3506 #:phases
3507 (modify-phases %standard-phases
3508 (add-after 'unpack 'bootstrap
3509 (lambda _
3510 (zero? (system* "sh" "autogen.sh")))))))
3511 (native-inputs
3512 `(("autoconf" ,autoconf)
3513 ("automake" ,automake)
3514 ("pkg-config" ,pkg-config)))
3515 (inputs
3516 `(("libsysfs" ,sysfsutils)))
3517 (synopsis "Random number generator daemon")
3518 (description
3519 "Monitor a hardware random number generator, and supply entropy
3520from that to the system kernel's @file{/dev/random} machinery.")
3521 (home-page "https://sourceforge.net/projects/gkernel")
3522 ;; The source package is offered under the GPL2+, but the files
3523 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3524 (license (list license:gpl2 license:gpl2+))))
3525
3526(define-public cpupower
3527 (package
3528 (name "cpupower")
3529 (version (package-version linux-libre))
3530 (source (package-source linux-libre))
3531 (build-system gnu-build-system)
3532 (arguments
3533 '(#:phases (modify-phases %standard-phases
3534 (add-after 'unpack 'enter-subdirectory
3535 (lambda _
3536 (chdir "tools/power/cpupower")))
3537 (delete 'configure)
3538 (add-before 'build 'fix-makefiles
3539 (lambda _
3540 (substitute* "Makefile"
3541 (("/usr/") "/")
3542 (("/bin/(install|pwd)" _ command) command))
3543 (substitute* "bench/Makefile"
3544 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3545 #:make-flags (let ((out (assoc-ref %outputs "out")))
3546 (list (string-append "DESTDIR=" out)
3547 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3548 "docdir=/share/doc/cpupower"
3549 "confdir=$(docdir)/examples"
3550 ;; The Makefile recommends the following changes
3551 "DEBUG=false"
3552 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3553 #:tests? #f)) ;no tests
3554 (native-inputs `(("gettext" ,gettext-minimal)))
3555 (inputs `(("pciutils" ,pciutils)))
3556 (home-page (package-home-page linux-libre))
3557 (synopsis "CPU frequency and voltage scaling tools for Linux")
3558 (description
3559 "cpupower is a set of user-space tools that use the cpufreq feature of the
3560Linux kernel to retrieve and control processor features related to power saving,
3561such as frequency and voltage scaling.")
3562 (license license:gpl2)))
3563
3564(define-public haveged
3565 (package
3566 (name "haveged")
3567 (version "1.9.1")
3568 (source
3569 (origin
3570 (method url-fetch)
3571 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3572 version ".tar.gz"))
3573 (sha256
3574 (base32
3575 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3576 (build-system gnu-build-system)
3577 (home-page "http://www.issihosts.com/haveged")
3578 (synopsis "Entropy source for the Linux random number generator")
3579 (description
3580 "haveged generates an unpredictable stream of random numbers for use by
3581Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3582standard mechanisms for filling the entropy pool may not be sufficient for
3583systems with high needs or limited user interaction, such as headless servers.
3584@command{haveged} runs as a privileged daemon, harvesting randomness from the
3585indirect effects of hardware events on hidden processor state using the HArdware
3586Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3587its environment and provides the same built-in test suite for the output stream
3588as used on certified hardware security devices.")
3589 (license (list (license:non-copyleft "file://nist/mconf.h")
3590 (license:non-copyleft "file://nist/packtest.c")
3591 license:public-domain ; nist/dfft.c
3592 license:gpl3+)))) ; everything else
3593
3594(define-public ecryptfs-utils
3595 (package
3596 (name "ecryptfs-utils")
3597 (version "111")
3598 (source
3599 (origin
3600 (method url-fetch)
3601 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3602 version "/+download/ecryptfs-utils_"
3603 version ".orig.tar.gz"))
3604 (sha256
3605 (base32
3606 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3607 (build-system gnu-build-system)
3608 (arguments
3609 `(#:configure-flags (list "--disable-pywrap")))
3610 (native-inputs
3611 `(("intltool" ,intltool)
3612 ("perl" ,perl) ; for pod2man
3613 ("pkg-config" ,pkg-config)))
3614 (inputs
3615 `(("keyutils" ,keyutils)
3616 ("linux-pam" ,linux-pam)
3617 ("nss" ,nss)))
3618 (home-page "http://ecryptfs.org/")
3619 (synopsis "eCryptfs cryptographic file system utilities")
3620 (description
3621 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3622Each file's cryptographic meta-data is stored inside the file itself, along
3623with the encrypted contents. This allows individual encrypted files to be
3624copied between hosts and still be decrypted with the proper key. eCryptfs is a
3625native Linux file system, and has been part of the Linux kernel since version
36262.6.19. This package contains the userland utilities to manage it.")
3627 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3628 ;; grant additional permission to link with OpenSSL.
3629 (license license:gpl2+)))
3630
3631(define-public libnfsidmap
3632 (package
3633 (name "libnfsidmap")
3634 (version "0.25")
3635 (source (origin
3636 (method url-fetch)
3637 (uri (string-append
3638 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3639 name "/" name "-" version ".tar.gz"))
3640 (sha256
3641 (base32
3642 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3643 (build-system gnu-build-system)
3644 (arguments
3645 `(#:configure-flags (list
3646 (string-append "--with-pluginpath="
3647 (assoc-ref %outputs "out")
3648 "/lib/libnfsidmap"))))
3649 (home-page
3650 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3651 (synopsis
3652 "NFSv4 support library for name/ID mapping")
3653 (description "Libnfsidmap is a library holding mulitiple methods of
3654mapping names to ids and visa versa, mainly for NFSv4. It provides an
3655extensible array of mapping functions, currently consisting of two choices:
3656the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3657 (license (license:non-copyleft "file://COPYING"
3658 "See COPYING in the distribution."))))
3659
3660(define-public module-init-tools
3661 (package
3662 (name "module-init-tools")
3663 (version "3.16")
3664 (source (origin
3665 (method url-fetch)
3666 (uri (string-append
3667 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3668 "module-init-tools-" version ".tar.bz2"))
3669 (sha256
3670 (base32
3671 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3672 (patches (search-patches "module-init-tools-moduledir.patch"))))
3673 (build-system gnu-build-system)
3674 (arguments
3675 ;; FIXME: The upstream tarball lacks man pages, and building them would
3676 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3677 ;; but they vanished. In the meantime, fake it.
3678 '(#:phases
3679 (modify-phases %standard-phases
3680 (add-before 'configure 'fake-docbook
3681 (lambda _
3682 (substitute* "Makefile.in"
3683 (("^DOCBOOKTOMAN.*$")
3684 "DOCBOOKTOMAN = true\n"))
3685 #t)))))
3686 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3687 (synopsis "Tools for loading and managing Linux kernel modules")
3688 (description
3689 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3690`insmod', `lsmod', and more.")
3691 (license license:gpl2+)))
3692
3693(define-public mcelog
3694 (package
3695 (name "mcelog")
3696 (version "154")
3697 (source (origin
3698 (method url-fetch)
3699 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3700 "mcelog.git/snapshot/v" version ".tar.gz"))
3701 (sha256
3702 (base32
3703 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
3704 (file-name (string-append name "-" version ".tar.gz"))
3705 (modules '((guix build utils)))
3706 (snippet
3707 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3708 `(substitute* "Makefile"
3709 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3710 (build-system gnu-build-system)
3711 (arguments
3712 `(#:phases (modify-phases %standard-phases
3713 (delete 'configure)) ; no configure script
3714 #:make-flags (let ((out (assoc-ref %outputs "out")))
3715 (list "CC=gcc"
3716 (string-append "prefix=" out)
3717 (string-append "DOCDIR=" out "/share/doc/mcelog")
3718 "etcprefix=$(DOCDIR)/examples"))
3719 ;; The tests will only run as root on certain supported CPU models.
3720 #:tests? #f))
3721 (supported-systems (list "i686-linux" "x86_64-linux"))
3722 (home-page "https://mcelog.org/")
3723 (synopsis "Machine check monitor for x86 Linux systems")
3724 (description
3725 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3726and other hardware errors on x86 systems. It can also perform user-defined
3727tasks, such as bringing bad pages off-line, when configurable error thresholds
3728are exceeded.")
3729 (license license:gpl2)))
3730
3731(define-public mtd-utils
3732 (package
3733 (name "mtd-utils")
3734 (version "1.5.2")
3735 (source (origin
3736 (method url-fetch)
3737 (uri (string-append
3738 "ftp://ftp.infradead.org/pub/mtd-utils/"
3739 "mtd-utils-" version ".tar.bz2"))
3740 (sha256
3741 (base32
3742 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3743 (inputs
3744 `(("acl" ,acl)
3745 ("libuuid" ,util-linux)
3746 ("lzo", lzo)
3747 ("zlib" ,zlib)))
3748 (build-system gnu-build-system)
3749 (arguments
3750 `(#:test-target "tests"
3751 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3752 #:phases (modify-phases %standard-phases
3753 (delete 'configure))))
3754 (synopsis "MTD Flash Storage Utilities")
3755 (description "This package provides utilities for testing, partitioning, etc
3756of flash storage.")
3757 (home-page "http://www.linux-mtd.infradead.org/")
3758 (license
3759 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3760 license:mpl1.1 ; All ftl* files
3761 license:expat)))) ; libiniparser
3762
3763(define-public libseccomp
3764 (package
3765 (name "libseccomp")
3766 (version "2.3.2")
3767 (source (origin
3768 (method url-fetch)
3769 (uri (string-append "https://github.com/seccomp/libseccomp/"
3770 "releases/download/v" version
3771 "/libseccomp-" version ".tar.gz"))
3772 (sha256
3773 (base32
3774 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
3775 (build-system gnu-build-system)
3776 (native-inputs
3777 `(("which" ,which)))
3778 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3779 (description "The libseccomp library provides an easy to use, platform
3780independent, interface to the Linux Kernel's syscall filtering mechanism. The
3781libseccomp API is designed to abstract away the underlying BPF based syscall
3782filter language and present a more conventional function-call based filtering
3783interface that should be familiar to, and easily adopted by, application
3784developers.")
3785 (home-page "https://github.com/seccomp/libseccomp")
3786 (license license:lgpl2.1)))
3787
3788(define-public radeontop
3789 (package
3790 (name "radeontop")
3791 (version "1.0")
3792 (home-page "https://github.com/clbr/radeontop/")
3793 (source (origin
3794 (method url-fetch)
3795 (uri (string-append home-page "archive/v" version ".tar.gz"))
3796 (file-name (string-append name "-" version ".tar.gz"))
3797 (sha256
3798 (base32
3799 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
3800 (build-system gnu-build-system)
3801 (arguments
3802 `(#:phases (modify-phases %standard-phases
3803 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3804 ;; dependency, and doesn't even work on release(!) tarballs.
3805 (add-after 'unpack 'report-correct-version
3806 (lambda _ (substitute* "getver.sh"
3807 (("ver=unknown")
3808 (string-append "ver=" ,version)))))
3809 (delete 'configure)) ; no configure script
3810 #:make-flags (list "CC=gcc"
3811 (string-append "PREFIX=" %output))
3812 #:tests? #f)) ; no tests
3813 (native-inputs
3814 `(("gettext" ,gettext-minimal)
3815 ("pkg-config" ,pkg-config)))
3816 (inputs
3817 `(("libdrm" ,libdrm)
3818 ("libpciaccess" ,libpciaccess)
3819 ("libxcb" ,libxcb)
3820 ("ncurses" ,ncurses)))
3821 (synopsis "Usage monitor for AMD Radeon graphics")
3822 (description "RadeonTop monitors resource consumption on supported AMD
3823Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3824a terminal or saved to a file for further processing. It measures both the
3825activity of the GPU as a whole, which is also accurate during OpenCL
3826computations, as well as separate component statistics that are only meaningful
3827under OpenGL graphics workloads.")
3828 (license license:gpl3)))
3829
3830(define-public efivar
3831 (package
3832 (name "efivar")
3833 (version "30")
3834 (source (origin
3835 (method url-fetch)
3836 (uri (string-append "https://github.com/rhinstaller/" name
3837 "/releases/download/" version "/" name
3838 "-" version ".tar.bz2"))
3839 (sha256
3840 (base32
3841 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3842 (build-system gnu-build-system)
3843 (arguments
3844 `(;; Tests require a UEFI system and is not detected in the chroot.
3845 #:tests? #f
3846 #:make-flags (list (string-append "prefix=" %output)
3847 (string-append "libdir=" %output "/lib")
3848 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3849 #:phases
3850 (modify-phases %standard-phases
3851 (delete 'configure))))
3852 (native-inputs
3853 `(("pkg-config" ,pkg-config)))
3854 (inputs
3855 `(("popt" ,popt)))
3856 (home-page "https://github.com/rhinstaller/efivar")
3857 (synopsis "Tool and library to manipulate EFI variables")
3858 (description "This package provides a library and a command line
3859interface to the variable facility of UEFI boot firmware.")
3860 (license license:lgpl2.1+)))
3861
3862(define-public efibootmgr
3863 (package
3864 (name "efibootmgr")
3865 (version "14")
3866 (source (origin
3867 (method url-fetch)
3868 (uri (string-append "https://github.com/rhinstaller/" name
3869 "/releases/download/" version "/" name
3870 "-" version ".tar.bz2"))
3871 (sha256
3872 (base32
3873 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3874 (build-system gnu-build-system)
3875 (arguments
3876 `(#:tests? #f ; No tests.
3877 #:make-flags (list (string-append "prefix=" %output)
3878 (string-append "libdir=" %output "/lib")
3879 ;; Override CFLAGS to add efivar include directory.
3880 (string-append "CFLAGS=-O2 -g -flto -I"
3881 (assoc-ref %build-inputs "efivar")
3882 "/include/efivar"))
3883 #:phases
3884 (modify-phases %standard-phases
3885 (add-after 'unpack 'branding
3886 ;; Replace default loader path with something more familiar.
3887 (lambda _
3888 (substitute* "src/efibootmgr.c"
3889 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3890 "EFI\\\\gnu"))
3891 #t))
3892 (delete 'configure))))
3893 (native-inputs
3894 `(("pkg-config" ,pkg-config)))
3895 (inputs
3896 `(("efivar" ,efivar)
3897 ("popt" ,popt)))
3898 (home-page "https://github.com/rhinstaller/efibootmgr")
3899 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3900 (description
3901 "@code{efibootmgr} is a user-space application to modify the Intel
3902Extensible Firmware Interface (EFI) Boot Manager. This application can
3903create and destroy boot entries, change the boot order, change the next
3904running boot option, and more.")
3905 (license license:gpl2+)))
3906
3907(define-public sysstat
3908 (package
3909 (name "sysstat")
3910 (version "11.4.3")
3911 (source (origin
3912 (method url-fetch)
3913 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3914 "sysstat-" version ".tar.xz"))
3915 (sha256
3916 (base32
3917 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3918 (build-system gnu-build-system)
3919 (arguments
3920 `(#:tests? #f ; No test suite.
3921 ;; Without this flag, it tries to install the man pages with group 'root'
3922 ;; and fails because /etc/passwd lacks an entry for the root user.
3923 #:configure-flags
3924 (list "--disable-file-attr"
3925 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3926 #:phases
3927 (modify-phases %standard-phases
3928 ;; The build process tries to create '/var/lib/sa', so we skip that
3929 ;; instruction.
3930 (add-after 'build 'skip-touching-var
3931 (lambda _
3932 (substitute* "Makefile"
3933 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3934 ""))
3935 #t)))))
3936 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3937 (synopsis "Performance monitoring tools for Linux")
3938 (description "The sysstat utilities are a collection of performance
3939monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3940@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3941@code{sadf} and @code{sa}.")
3942 (license license:gpl2+)))
3943
3944(define-public light
3945 (package
3946 (name "light")
3947 (version "1.0")
3948 (source (origin
3949 (method url-fetch)
3950 (uri (string-append "https://github.com/haikarainen/" name
3951 "/archive/v" version ".tar.gz"))
3952 (sha256
3953 (base32
3954 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3955 (file-name (string-append name "-" version ".tar.gz"))))
3956 (build-system gnu-build-system)
3957 (arguments
3958 '(#:tests? #f ; no tests
3959 #:make-flags (list "CC=gcc"
3960 (string-append "PREFIX=" %output))
3961 #:phases
3962 (modify-phases %standard-phases
3963 (delete 'configure)
3964 (add-after 'unpack 'patch-makefile
3965 (lambda _
3966 (substitute* "Makefile" (("chown") "#")))))))
3967 (native-inputs
3968 `(("help2man" ,help2man)))
3969 (home-page "https://haikarainen.github.io/light")
3970 (synopsis "GNU/Linux application to control backlights")
3971 (description
3972 "Light is a program to send commands to screen backlight controllers
3973under GNU/Linux. Features include:
3974
3975@itemize
3976@item It does not rely on X.
3977@item Light can automatically figure out the best controller to use, making
3978full use of underlying hardware.
3979@item It is possible to set a minimum brightness value, as some controllers
3980set the screen to be pitch black at a vaĺue of 0 (or higher).
3981@end itemize
3982
3983Light is the successor of lightscript.")
3984 (license license:gpl3+)))
3985
3986(define-public tlp
3987 (package
3988 (name "tlp")
3989 (version "1.0")
3990 (source (origin
3991 (method url-fetch)
3992 (uri (string-append
3993 "https://github.com/linrunner/"
3994 (string-upcase name)
3995 "/archive/" version ".tar.gz"))
3996 (file-name (string-append name "-" version ".tar.gz"))
3997 (sha256
3998 (base32
3999 "1v3qpj9kp4rxwqapayd0i9419wwv4bikyrzjvqn0r9xkgnr1f9v4"))))
4000 (inputs `(("bash" ,bash)
4001 ("dbus" ,dbus)
4002 ("ethtool" ,ethtool)
4003 ("eudev" ,eudev)
4004 ("grep" ,grep)
4005 ("hdparm" ,hdparm)
4006 ("inetutils" ,inetutils)
4007 ("iw" ,iw)
4008 ("kmod" ,kmod)
4009 ("pciutils" ,pciutils)
4010 ("perl" ,perl)
4011 ("rfkill" ,rfkill)
4012 ("sed" ,sed)
4013 ("usbutils" ,usbutils)
4014 ("util-linux" ,util-linux)
4015 ("wireless-tools" ,wireless-tools)))
4016 (build-system gnu-build-system)
4017 (arguments
4018 `(#:phases
4019 (modify-phases %standard-phases
4020 (delete 'configure) ; no configure script
4021 (add-before 'build 'setenv
4022 (lambda* (#:key outputs #:allow-other-keys)
4023 (let ((out (assoc-ref outputs "out")))
4024 (setenv "TLP_WITH_SYSTEMD" "0")
4025 (setenv "TLP_NO_INIT" "1")
4026 (setenv "TLP_NO_PMUTILS" "1")
4027 (setenv "TLP_SBIN" (string-append out "/bin"))
4028 (setenv "TLP_BIN" (string-append out "/bin"))
4029 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
4030 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
4031 (setenv "TLP_CONF" "/etc/tlp")
4032 (setenv "TLP_SHCPL"
4033 (string-append out "/share/bash-completion/completions"))
4034 (setenv "TLP_MAN" (string-append out "/share/man")))))
4035 (delete 'check) ; no tests
4036 (add-before 'install 'fix-installation
4037 (lambda _
4038 ;; Stop the Makefile from trying to create system directories.
4039 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
4040 (replace 'install
4041 (lambda _
4042 (zero? (system* "make" "install-tlp" "install-man"))))
4043 (add-after 'install 'wrap
4044 (lambda* (#:key inputs outputs #:allow-other-keys)
4045 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
4046 (bin-files (find-files bin ".*")))
4047 (define (bin-directory input-name)
4048 (string-append (assoc-ref inputs input-name) "/bin"))
4049 (define (sbin-directory input-name)
4050 (string-append (assoc-ref inputs input-name) "/sbin"))
4051 (for-each (lambda (program)
4052 (wrap-program program
4053 `("PATH" ":" prefix
4054 ,(append
4055 (map bin-directory '("bash"
4056 "coreutils"
4057 "dbus"
4058 "eudev"
4059 "grep"
4060 "inetutils"
4061 "kmod"
4062 "perl"
4063 "sed"
4064 "usbutils"
4065 "util-linux"))
4066 (map sbin-directory '("ethtool"
4067 "hdparm"
4068 "iw"
4069 "pciutils"
4070 "rfkill"
4071 "wireless-tools"))))))
4072 bin-files)))))))
4073 (home-page "http://linrunner.de/en/tlp/tlp.html")
4074 (synopsis "Power management tool for Linux")
4075 (description "TLP is a power management tool for Linux. It comes with
4076a default configuration already optimized for battery life. Nevertheless,
4077TLP is customizable to fulfil system requirements. TLP settings are applied
4078every time the power supply source is changed.")
4079
4080 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
4081 ;; rest is GPLv2+.
4082 (license (list license:gpl2+ license:gpl3+))))
4083
4084(define-public lshw
4085 (package
4086 (name "lshw")
4087 (version "B.02.18")
4088 (source (origin
4089 (method url-fetch)
4090 (uri (string-append "https://www.ezix.org/software/"
4091 "files/lshw-" version
4092 ".tar.gz"))
4093 (sha256
4094 (base32
4095 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
4096 (build-system gnu-build-system)
4097 (arguments
4098 `(#:phases (modify-phases %standard-phases (delete 'configure))
4099 #:tests? #f ; no tests
4100 #:make-flags
4101 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
4102 (synopsis "List hardware information")
4103 (description
4104 "@command{lshw} (Hardware Lister) is a small tool to provide
4105detailed information on the hardware configuration of the machine.
4106It can report exact memory configuration, firmware version, mainboard
4107configuration, CPU version and speed, cache configuration, bus speed,
4108and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
4109machines (PowerMac G4 is known to work).")
4110 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
4111 (license license:gpl2+)))
4112
4113(define-public libmnl
4114 (package
4115 (name "libmnl")
4116 (version "1.0.4")
4117 (source
4118 (origin
4119 (method url-fetch)
4120 (uri (string-append "mirror://netfilter.org/libmnl/"
4121 "libmnl-" version ".tar.bz2"))
4122 (sha256
4123 (base32
4124 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
4125 (build-system gnu-build-system)
4126 (home-page "https://www.netfilter.org/projects/libmnl/")
4127 (synopsis "Netlink utility library")
4128 (description "Libmnl is a minimalistic user-space library oriented to
4129Netlink developers. There are a lot of common tasks in parsing, validating,
4130constructing of both the Netlink header and TLVs that are repetitive and easy to
4131get wrong. This library aims to provide simple helpers that allows you to
4132re-use code and to avoid re-inventing the wheel.")
4133 (license license:lgpl2.1+)))
4134
4135(define-public libnftnl
4136 (package
4137 (name "libnftnl")
4138 (version "1.0.8")
4139 (source
4140 (origin
4141 (method url-fetch)
4142 (uri (string-append "mirror://netfilter.org/libnftnl/"
4143 "libnftnl-" version ".tar.bz2"))
4144 (sha256
4145 (base32
4146 "0f10cfiyl4c0f8k3brxfrw28x7a6qvrakaslg4jgqncwxycxggg6"))))
4147 (build-system gnu-build-system)
4148 (native-inputs
4149 `(("pkg-config" ,pkg-config)))
4150 (inputs
4151 `(("libmnl" ,libmnl)))
4152 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
4153 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
4154 (description "Libnftnl is a userspace library providing a low-level netlink
4155programming interface to the in-kernel nf_tables subsystem. The library
4156libnftnl has been previously known as libnftables. This library is currently
4157used by nftables.")
4158 (license license:gpl2+)))
4159
4160(define-public nftables
4161 (package
4162 (name "nftables")
4163 (version "0.8")
4164 (source
4165 (origin
4166 (method url-fetch)
4167 (uri (string-append "http://www.nftables.org/projects/nftables"
4168 "/files/nftables-" version ".tar.bz2"))
4169 (sha256
4170 (base32
4171 "16iq9x0qxikdhp1nan500rk33ycqddl1k57876m4dfv3n7kqhnrz"))))
4172 (build-system gnu-build-system)
4173 (inputs `(("bison", bison)
4174 ("flex", flex)
4175 ("gmp", gmp)
4176 ("libmnl", libmnl)
4177 ("libnftnl", libnftnl)
4178 ("readline", readline)))
4179 (native-inputs `(("pkg-config", pkg-config)))
4180 (home-page "http://www.nftables.org")
4181 (synopsis "Userspace utility for Linux packet filtering")
4182 (description "nftables is the project that aims to replace the existing
4183{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
4184filtering framework, a new userspace utility and also a compatibility layer for
4185{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
4186infrastructure such as the existing hooks, the connection tracking system, the
4187userspace queueing component and the logging subsystem.")
4188 (license license:gpl2)))
4189
4190(define-public proot
4191 (package
4192 (name "proot")
4193 (version "5.1.0")
4194 (home-page "https://github.com/proot-me/PRoot")
4195 (source (origin
4196 (method url-fetch)
4197 (uri (string-append home-page "/archive/v" version ".tar.gz"))
4198 (file-name (string-append name "-" version ".tar.gz"))
4199 (sha256
4200 (base32
4201 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
4202 (patches (search-patches "proot-test-fhs.patch"))))
4203 (build-system gnu-build-system)
4204 (arguments
4205 '(#:make-flags '("-C" "src")
4206
4207 #:phases (modify-phases %standard-phases
4208 (delete 'configure)
4209 (add-before 'build 'set-shell-file-name
4210 (lambda* (#:key inputs #:allow-other-keys)
4211 (substitute* (find-files "src" "\\.[ch]$")
4212 (("\"/bin/sh\"")
4213 (string-append "\""
4214 (assoc-ref inputs "bash")
4215 "/bin/sh\"")))
4216 #t))
4217 (add-before 'check 'fix-fhs-assumptions-in-tests
4218 (lambda _
4219 (substitute* "tests/test-c6b77b77.mk"
4220 (("/bin/bash") (which "bash"))
4221 (("/usr/bin/test") (which "test")))
4222 (substitute* '("tests/test-16573e73.c")
4223 (("/bin/([a-z-]+)" _ program)
4224 (which program)))
4225
4226 (substitute* (find-files "tests" "\\.sh$")
4227 ;; Some of the tests try to "bind-mount" /bin/true.
4228 (("-b /bin/true:")
4229 (string-append "-b " (which "true") ":"))
4230 ;; Likewise for /bin.
4231 (("-b /bin:") "-b /gnu:")
4232 ;; Others try to run /bin/sh.
4233 (("/bin/sh") (which "sh"))
4234 ;; Others assume /etc/fstab exists.
4235 (("/etc/fstab") "/etc/passwd"))
4236
4237 (substitute* "tests/GNUmakefile"
4238 (("-b /bin:") "-b /gnu:"))
4239
4240 ;; XXX: This test fails in an obscure corner case, just
4241 ;; skip it.
4242 (delete-file "tests/test-kkkkkkkk.c")
4243
4244 #t))
4245 (replace 'check
4246 (lambda _
4247 (let ((n (parallel-job-count)))
4248 ;; For some reason we get lots of segfaults with
4249 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4250 (setenv "PROOT_NO_SECCOMP" "1")
4251
4252 ;; Most of the tests expect "/bin" to be in $PATH so
4253 ;; they can run things that live in $ROOTFS/bin.
4254 (setenv "PATH"
4255 (string-append (getenv "PATH") ":/bin"))
4256
4257 (zero? (system* "make" "check" "-C" "tests"
4258 ;;"V=1"
4259 "-j" (number->string n))))))
4260 (replace 'install
4261 (lambda* (#:key outputs #:allow-other-keys)
4262 ;; The 'install' rule does nearly nothing.
4263 (let ((out (assoc-ref outputs "out")))
4264 (and (zero?
4265 ;; TODO: 'make install-care' (does not even
4266 ;; build currently.)
4267 (system* "make" "-C" "src" "install"
4268 (string-append "PREFIX=" out)))
4269 (let ((man1 (string-append out
4270 "/share/man/man1")))
4271 (mkdir-p man1)
4272 (copy-file "doc/proot/man.1"
4273 (string-append man1 "/proot.1"))
4274 #t))))))))
4275 (native-inputs `(("which" ,which)
4276
4277 ;; For 'mcookie', used by some of the tests.
4278 ("util-linux" ,util-linux)))
4279 (inputs `(("talloc" ,talloc)))
4280 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4281 (description
4282 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4283and @code{binfmt_misc}. This means that users don't need any privileges or
4284setup to do things like using an arbitrary directory as the new root
4285filesystem, making files accessible somewhere else in the file system
4286hierarchy, or executing programs built for another CPU architecture
4287transparently through QEMU user-mode. Also, developers can use PRoot as a
4288generic process instrumentation engine thanks to its extension mechanism.
4289Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4290available in the kernel Linux.")
4291 (license license:gpl2+)))
4292
4293(define-public proot-static
4294 (package
4295 (inherit proot)
4296 (name "proot-static")
4297 (synopsis
4298 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4299 (inputs `(("talloc" ,talloc/static)))
4300 (arguments
4301 (substitute-keyword-arguments (package-arguments proot)
4302 ((#:make-flags flags)
4303 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4304 ((#:phases phases)
4305 `(modify-phases ,phases
4306 (add-after 'strip 'remove-store-references
4307 (lambda* (#:key outputs #:allow-other-keys)
4308 (let* ((out (assoc-ref outputs "out")))
4309 (with-directory-excursion out
4310 (remove-store-references "bin/proot")
4311 #t))))))
4312 ((#:allowed-references _ '("out"))
4313 '("out"))))))
4314
4315(define-public cpuid
4316 (package
4317 (name "cpuid")
4318 (version "20170122")
4319 (source (origin
4320 (method url-fetch)
4321 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4322 version ".src.tar.gz"))
4323 (sha256
4324 (base32
4325 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4326 (build-system gnu-build-system)
4327 (arguments
4328 '(#:make-flags '("CC=gcc")
4329 #:tests? #f ; no tests
4330 #:phases (modify-phases %standard-phases
4331 (delete 'configure)
4332 (add-before 'install 'fix-makefile
4333 (lambda* (#:key outputs #:allow-other-keys)
4334 (substitute* "Makefile"
4335 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4336 ;; Make the compressed manpages writable so that the
4337 ;; reset-gzip-timestamps phase does not error out.
4338 (substitute* "Makefile"
4339 (("-m 444") "-m 644"))
4340 #t)))))
4341 (inputs `(("perl" ,perl)))
4342 (supported-systems '("i686-linux" "x86_64-linux"))
4343 (home-page "http://www.etallen.com/cpuid.html")
4344 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4345 (description "cpuid dumps detailed information about the CPU(s) gathered
4346from the CPUID instruction, and also determines the exact model of CPU(s). It
4347supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4348NexGen, Rise, and SiS CPUs.")
4349 (license license:gpl2+)))
4350
4351(define-public jmtpfs
4352 (package
4353 (name "jmtpfs")
4354 (version "0.5")
4355 (source
4356 (origin
4357 (method url-fetch)
4358 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4359 version ".tar.gz"))
4360 (file-name (string-append name "-" version ".tar.gz"))
4361 (sha256
4362 (base32
4363 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4364 (build-system gnu-build-system)
4365 (inputs
4366 `(("file" ,file)
4367 ("fuse" ,fuse)
4368 ("libmtp" ,libmtp)))
4369 (native-inputs
4370 `(("pkg-config" ,pkg-config)))
4371 (home-page "https://github.com/JasonFerrara/jmtpfs")
4372 (synopsis "Use a FUSE filesystem to access data over MTP")
4373 (description "jmtpfs uses FUSE (filesystem in userspace) to provide access
4374to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4375the MTP device as a filesystem.")
4376 (license license:gpl3)))
4377
4378(define-public procenv
4379 (package
4380 (name "procenv")
4381 (version "0.50")
4382 (source
4383 (origin
4384 (method url-fetch)
4385 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4386 version ".tar.gz"))
4387 (file-name (string-append name "-" version ".tar.gz"))
4388 (sha256
4389 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
4390 (build-system gnu-build-system)
4391 (arguments `(#:configure-flags '("--disable-silent-rules")))
4392 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4393 ("groff" ,groff) ; for tests
4394 ("libselinux" ,libselinux)))
4395 (synopsis "Utility to show process environment")
4396 (description "Procenv is a command-line tool that displays as much detail about
4397itself and its environment as possible. It can be used as a test
4398tool, to understand the type of environment a process runs in, and for
4399comparing system environments.")
4400 (home-page "http://github.com/jamesodhunt/procenv/")
4401 (license license:gpl3+)))
4402
4403(define-public libfabric
4404 (package
4405 (name "libfabric")
4406 (version "1.4.1")
4407 (source
4408 (origin
4409 (method url-fetch)
4410 (uri
4411 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
4412 version "/libfabric-" version ".tar.bz2"))
4413 (sha256
4414 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
4415 (build-system gnu-build-system)
4416 (inputs `(("rdma-core" ,rdma-core)
4417 ,@(match (%current-system)
4418 ((member (package-supported-systems psm))
4419 `(("psm" ,psm)))
4420 (_ `()))
4421 ("libnl" ,libnl)))
4422 (home-page "https://ofiwg.github.io/libfabric/")
4423 (synopsis "Open Fabric Interfaces")
4424 (description
4425 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
4426communication services to applications. OFI is best described as a collection
4427of libraries and applications used to export fabric services. The key
4428components of OFI are: application interfaces, provider libraries, kernel
4429services, daemons, and test applications.
4430
4431Libfabric is a core component of OFI. It is the library that defines and
4432exports the user-space API of OFI, and is typically the only software that
4433applications deal with directly. It works in conjunction with provider
4434libraries, which are often integrated directly into libfabric.")
4435 (license (list license:bsd-2 license:gpl2)))) ;dual
4436
4437(define-public psm
4438 (package
4439 (name "psm")
4440 (version "3.3.20170428")
4441 (home-page "https://github.com/intel/psm")
4442 (source
4443 (origin
4444 (method git-fetch)
4445 (uri (git-reference (url home-page)
4446 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
4447 (file-name (string-append "psm-" version ".tar.gz"))
4448 (sha256
4449 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
4450 (patches (search-patches
4451 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
4452 "psm-ldflags.patch" ; build shared lib with LDFLAGS
4453 "psm-repro.patch")))) ; reproducibility
4454 (build-system gnu-build-system)
4455 (inputs `(("libuuid" ,util-linux)))
4456 (arguments
4457 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
4458 ,(string-append "INSTALL_PREFIX=" %output)
4459 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4460 #:tests? #f
4461 #:phases (modify-phases %standard-phases
4462 (delete 'configure)
4463 (add-after 'unpack 'patch-/usr/include
4464 (lambda _
4465 (substitute* "Makefile"
4466 (("\\$\\{DESTDIR}/usr/include")
4467 (string-append %output "/include")))
4468 (substitute* "Makefile"
4469 (("/lib64") "/lib"))
4470 #t)))))
4471 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
4472 (description
4473 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
4474communications interface for the True Scale family of products. PSM users are
4475enabled with mechanisms necessary to implement higher level communications
4476interfaces in parallel environments.")
4477 ;; Only Intel-compatable processors are supported.
4478 (supported-systems '("i686-linux" "x86_64-linux"))
4479 (license (list license:bsd-2 license:gpl2)))) ;dual
4480
4481(define-public snapscreenshot
4482 (package
4483 (name "snapscreenshot")
4484 (version "1.0.14.3")
4485 (source
4486 (origin
4487 (method url-fetch)
4488 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
4489 name "-" version ".tar.bz2"))
4490 (sha256
4491 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
4492 (build-system gnu-build-system)
4493 (arguments
4494 `(#:make-flags
4495 (let ((out (assoc-ref %outputs "out")))
4496 (list (string-append "BINDIR=" out "/bin")
4497 (string-append "MANDIR=" out "/share/man")))
4498 #:tests? #f ; no test suite
4499 #:phases
4500 (modify-phases %standard-phases
4501 (delete 'configure) ; ./configure is a snarky no-op
4502 (add-before 'install 'fix-ownership
4503 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
4504 (lambda _
4505 (substitute* "depfun.mak"
4506 ((" -o bin -g bin ") " "))
4507 #t))
4508 (add-before 'install 'create-output-directories
4509 (lambda* (#:key outputs #:allow-other-keys)
4510 (let ((out (assoc-ref outputs "out")))
4511 (mkdir-p (string-append out "/share/man/man1"))
4512 #t))))))
4513 (home-page "http://bisqwit.iki.fi/source/snapscreenshot.html")
4514 (synopsis "Take screenshots of one or more Linux text consoles")
4515 (description
4516 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
4517Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
4518relevant @file{/dev/vcs*} file(s).")
4519 (license license:gpl2)))
4520
4521(define-public fbcat
4522 (package
4523 (name "fbcat")
4524 (version "0.5")
4525 (source
4526 (origin
4527 (method url-fetch)
4528 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
4529 version "/" name "-" version ".tar.gz"))
4530 (sha256
4531 (base32 "1dla1na3nf3s4xy0p6w0v54zipg1x8c14yqsw8w9qjzhchr4caxw"))))
4532 (build-system gnu-build-system)
4533 (native-inputs
4534 ;; For building the man pages.
4535 `(("docbook-xml" ,docbook-xml)
4536 ("docbook-xsl" ,docbook-xsl)
4537 ("xsltproc" ,libxslt)))
4538 (inputs
4539 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
4540 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
4541 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
4542 `(("pnmtopng" ,netpbm)))
4543 (outputs (list "out" "fbgrab"))
4544 (arguments
4545 `(#:make-flags (list "CC=gcc")
4546 #:tests? #f ; no tests
4547 #:phases
4548 (modify-phases %standard-phases
4549 (add-after 'unpack 'fix-docbook-location
4550 (lambda* (#:key inputs #:allow-other-keys)
4551 (substitute* "doc/Makefile"
4552 (("http://docbook.sourceforge.net/release/xsl/current")
4553 (string-append (assoc-ref inputs "docbook-xsl")
4554 "/xml/xsl/docbook-xsl-"
4555 ,(package-version docbook-xsl))))
4556 #t))
4557 (delete 'configure) ; no configure script
4558 (add-after 'build 'build-documentation
4559 (lambda* (#:key make-flags #:allow-other-keys)
4560 (zero? (apply system* "make" "-C" "doc"
4561 make-flags))))
4562 (add-after 'build 'qualify-references
4563 (lambda* (#:key inputs outputs #:allow-other-keys)
4564 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
4565 (out (assoc-ref outputs "out")))
4566 (substitute* "fbgrab"
4567 (("fbcat" all)
4568 (string-append out "/bin/" all))
4569 (("pnmtopng" all)
4570 (string-append pnmtopng "/bin/" all)))
4571 #t)))
4572 (replace 'install
4573 ;; The Makefile lacks an ‘install’ target. Install files manually.
4574 (lambda* (#:key outputs #:allow-other-keys)
4575 (let* ((out (assoc-ref outputs "out"))
4576 (out:fbgrab (assoc-ref outputs "fbgrab")))
4577 (install-file "fbcat" (string-append out "/bin"))
4578 (install-file "doc/fbcat.1"
4579 (string-append out "/share/man/man1"))
4580 (install-file "fbgrab" (string-append out:fbgrab "/bin"))
4581 (install-file "doc/fbgrab.1"
4582 (string-append out:fbgrab "/share/man/man1"))
4583 #t))))))
4584 (home-page "https://jwilk.net/software/fbcat")
4585 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
4586 (description
4587 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
4588a dump therof. It supports a wide range of drivers and pixel formats.
4589@command{fbcat} can take screenshots of virtually any application that can be
4590made to write its output to the framebuffer, including (but not limited to)
4591text-mode or graphical applications that don't use a display server.
4592
4593Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
4594emulates the behaviour of Gunnar Monell's older fbgrab utility.")
4595 (license license:gpl2)))