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