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