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