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