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