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