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