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