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