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