gnu: Add libical.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015 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 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages linux)
25 #:use-module ((guix licenses)
26 #:hide (zlib))
27 #:use-module (gnu packages)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages gcc)
30 #:use-module (gnu packages flex)
31 #:use-module (gnu packages bison)
32 #:use-module (gnu packages admin)
33 #:use-module (gnu packages gperf)
34 #:use-module (gnu packages libusb)
35 #:use-module (gnu packages ncurses)
36 #:use-module (gnu packages pciutils)
37 #:use-module (gnu packages databases)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages python)
41 #:use-module (gnu packages slang)
42 #:use-module (gnu packages algebra)
43 #:use-module (gnu packages gettext)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages pulseaudio)
46 #:use-module (gnu packages attr)
47 #:use-module (gnu packages xml)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages texinfo)
50 #:use-module (gnu packages check)
51 #:use-module (gnu packages maths)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages rrdtool)
54 #:use-module (gnu packages elf)
55 #:use-module (gnu packages gtk)
56 #:use-module (gnu packages docbook)
57 #:use-module (gnu packages asciidoc)
58 #:use-module (guix packages)
59 #:use-module (guix download)
60 #:use-module (guix utils)
61 #:use-module (guix build-system gnu)
62 #:use-module (guix build-system cmake)
63 #:use-module (guix build-system python)
64 #:use-module (guix build-system trivial)
65 #:use-module (srfi srfi-26)
66 #:use-module (ice-9 match))
67
68 (define-public (system->linux-architecture arch)
69 "Return the Linux architecture name for ARCH, a Guix system name such as
70 \"x86_64-linux\"."
71 (let ((arch (car (string-split arch #\-))))
72 (cond ((string=? arch "i686") "i386")
73 ((string-prefix? "mips" arch) "mips")
74 ((string-prefix? "arm" arch) "arm")
75 (else arch))))
76
77 (define (linux-libre-urls version)
78 "Return a list of URLs for Linux-Libre VERSION."
79 (list (string-append
80 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
81 version "-gnu/linux-libre-" version "-gnu.tar.xz")
82
83 ;; XXX: Work around <http://bugs.gnu.org/14851>.
84 (string-append
85 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
86 version "-gnu.tar.xz")
87
88 ;; Maybe this URL will become valid eventually.
89 (string-append
90 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
91 version "-gnu.tar.xz")))
92
93 (define-public linux-libre-headers
94 (let* ((version "3.14.37")
95 (build-phase
96 (lambda (arch)
97 `(lambda _
98 (setenv "ARCH" ,(system->linux-architecture arch))
99 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
100
101 (and (zero? (system* "make" "defconfig"))
102 (zero? (system* "make" "mrproper" "headers_check"))))))
103 (install-phase
104 `(lambda* (#:key outputs #:allow-other-keys)
105 (let ((out (assoc-ref outputs "out")))
106 (and (zero? (system* "make"
107 (string-append "INSTALL_HDR_PATH=" out)
108 "headers_install"))
109 (mkdir (string-append out "/include/config"))
110 (call-with-output-file
111 (string-append out
112 "/include/config/kernel.release")
113 (lambda (p)
114 (format p "~a-default~%" ,version))))))))
115 (package
116 (name "linux-libre-headers")
117 (version version)
118 (source (origin
119 (method url-fetch)
120 (uri (linux-libre-urls version))
121 (sha256
122 (base32
123 "1blxr2bsvfqi9khj4cpspv434bmx252zak2wsbi2mgl60zh77gza"))))
124 (build-system gnu-build-system)
125 (native-inputs `(("perl" ,perl)))
126 (arguments
127 `(#:modules ((guix build gnu-build-system)
128 (guix build utils)
129 (srfi srfi-1))
130 #:phases (alist-replace
131 'build ,(build-phase (or (%current-target-system)
132 (%current-system)))
133 (alist-replace
134 'install ,install-phase
135 (alist-delete 'configure %standard-phases)))
136 #:tests? #f))
137 (synopsis "GNU Linux-Libre kernel headers")
138 (description "Headers of the Linux-Libre kernel.")
139 (license gpl2)
140 (home-page "http://www.gnu.org/software/linux-libre/"))))
141
142 (define-public module-init-tools
143 (package
144 (name "module-init-tools")
145 (version "3.16")
146 (source (origin
147 (method url-fetch)
148 (uri (string-append
149 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
150 version ".tar.bz2"))
151 (sha256
152 (base32
153 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
154 (patches
155 (list (search-patch "module-init-tools-moduledir.patch")))))
156 (build-system gnu-build-system)
157 (arguments
158 ;; FIXME: The upstream tarball lacks man pages, and building them would
159 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
160 ;; but they vanished. In the meantime, fake it.
161 '(#:phases (alist-cons-before
162 'configure 'fake-docbook
163 (lambda _
164 (substitute* "Makefile.in"
165 (("^DOCBOOKTOMAN.*$")
166 "DOCBOOKTOMAN = true\n")))
167 %standard-phases)))
168 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
169 (synopsis "Tools for loading and managing Linux kernel modules")
170 (description
171 "Tools for loading and managing Linux kernel modules, such as `modprobe',
172 `insmod', `lsmod', and more.")
173 (license gpl2+)))
174
175 (define %boot-logo-patch
176 ;; Linux-Libre boot logo featuring Freedo and a gnu.
177 (origin
178 (method url-fetch)
179 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
180 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
181 (sha256
182 (base32
183 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
184
185 (define (kernel-config system)
186 "Return the absolute file name of the Linux-Libre build configuration file
187 for SYSTEM, or #f if there is no configuration for SYSTEM."
188 (define (lookup file)
189 (let ((file (string-append "gnu/packages/" file)))
190 (search-path %load-path file)))
191
192 (match system
193 ("i686-linux"
194 (lookup "linux-libre-i686.conf"))
195 ("x86_64-linux"
196 (lookup "linux-libre-x86_64.conf"))
197 (_
198 #f)))
199
200 (define-public linux-libre
201 (let* ((version "4.0.1")
202 (build-phase
203 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
204 ;; Apply the neat patch.
205 (system* "patch" "-p1" "--force"
206 "-i" (assoc-ref inputs "patch/freedo+gnu"))
207
208 (let ((arch (car (string-split system #\-))))
209 (setenv "ARCH"
210 (cond ((string=? arch "i686") "i386")
211 (else arch)))
212 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
213
214 (let ((build (assoc-ref %standard-phases 'build))
215 (config (assoc-ref inputs "kconfig")))
216
217 ;; Use the architecture-specific config if available, and
218 ;; 'defconfig' otherwise.
219 (if config
220 (begin
221 (copy-file config ".config")
222 (chmod ".config" #o666))
223 (system* "make" "defconfig"))
224
225 ;; Appending works even when the option wasn't in the
226 ;; file. The last one prevails if duplicated.
227 (let ((port (open-file ".config" "a")))
228 (display (string-append "CONFIG_NET_9P=m\n"
229 "CONFIG_NET_9P_VIRTIO=m\n"
230 "CONFIG_VIRTIO_BLK=m\n"
231 "CONFIG_VIRTIO_NET=m\n"
232 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
233 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
234 "CONFIG_VIRTIO_PCI=m\n"
235 "CONFIG_VIRTIO_BALLOON=m\n"
236 "CONFIG_VIRTIO_MMIO=m\n"
237 "CONFIG_FUSE_FS=m\n"
238 "CONFIG_CIFS=m\n"
239 "CONFIG_9P_FS=m\n")
240 port)
241 (close-port port))
242
243 (zero? (system* "make" "oldconfig"))
244
245 ;; Call the default `build' phase so `-j' is correctly
246 ;; passed.
247 (apply build #:make-flags "all" args))))
248 (install-phase
249 `(lambda* (#:key inputs outputs #:allow-other-keys)
250 (let* ((out (assoc-ref outputs "out"))
251 (moddir (string-append out "/lib/modules"))
252 (mit (assoc-ref inputs "module-init-tools")))
253 (mkdir-p moddir)
254 (for-each (lambda (file)
255 (copy-file file
256 (string-append out "/" (basename file))))
257 (find-files "." "^(bzImage|System\\.map)$"))
258 (copy-file ".config" (string-append out "/config"))
259 (zero? (system* "make"
260 (string-append "DEPMOD=" mit "/sbin/depmod")
261 (string-append "MODULE_DIR=" moddir)
262 (string-append "INSTALL_PATH=" out)
263 (string-append "INSTALL_MOD_PATH=" out)
264 "INSTALL_MOD_STRIP=1"
265 "modules_install"))))))
266 (package
267 (name "linux-libre")
268 (version version)
269 (source (origin
270 (method url-fetch)
271 (uri (linux-libre-urls version))
272 (sha256
273 (base32
274 "1d5r26fh7dpdckvxfyn69r72h02yvri92rcmi2r658k56snsxs2k"))
275 (patches
276 (list (search-patch "linux-libre-libreboot-fix.patch")))))
277 (build-system gnu-build-system)
278 (native-inputs `(("perl" ,perl)
279 ("bc" ,bc)
280 ("module-init-tools" ,module-init-tools)
281 ("patch/freedo+gnu" ,%boot-logo-patch)
282
283 ,@(let ((conf (kernel-config (or (%current-target-system)
284 (%current-system)))))
285 (if conf
286 `(("kconfig" ,conf))
287 '()))))
288
289 ;; XXX: Work around an ICE with our patched GCC 4.8.3 while compiling
290 ;; 'drivers/staging/vt6656/michael.o': <http://hydra.gnu.org/build/96389/>.
291 (inputs `(("gcc" ,gcc-4.9)))
292
293 (arguments
294 `(#:modules ((guix build gnu-build-system)
295 (guix build utils)
296 (srfi srfi-1)
297 (ice-9 match))
298 #:phases (alist-replace
299 'build ,build-phase
300 (alist-replace
301 'install ,install-phase
302 (alist-delete 'configure %standard-phases)))
303 #:tests? #f))
304 (synopsis "100% free redistribution of a cleaned Linux kernel")
305 (description
306 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
307 It has been modified to remove all non-free binary blobs.")
308 (license gpl2)
309 (home-page "http://www.gnu.org/software/linux-libre/"))))
310
311 \f
312 ;;;
313 ;;; Pluggable authentication modules (PAM).
314 ;;;
315
316 (define-public linux-pam
317 (package
318 (name "linux-pam")
319 (version "1.1.6")
320 (source
321 (origin
322 (method url-fetch)
323 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
324 version ".tar.bz2")
325 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
326 version ".tar.bz2")))
327 (sha256
328 (base32
329 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
330 (build-system gnu-build-system)
331 (native-inputs
332 `(("flex" ,flex)
333
334 ;; TODO: optional dependencies
335 ;; ("libxcrypt" ,libxcrypt)
336 ;; ("cracklib" ,cracklib)
337 ))
338 (arguments
339 '(;; Most users, such as `shadow', expect the headers to be under
340 ;; `security'.
341 #:configure-flags (list (string-append "--includedir="
342 (assoc-ref %outputs "out")
343 "/include/security"))
344
345 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
346 ;; isn't available.
347 #:tests? #f))
348 (home-page "http://www.linux-pam.org/")
349 (synopsis "Pluggable authentication modules for Linux")
350 (description
351 "A *Free* project to implement OSF's RFC 86.0.
352 Pluggable authentication modules are small shared object files that can
353 be used through the PAM API to perform tasks, like authenticating a user
354 at login. Local and dynamic reconfiguration are its key features")
355 (license bsd-3)))
356
357 \f
358 ;;;
359 ;;; Miscellaneous.
360 ;;;
361
362 (define-public psmisc
363 (package
364 (name "psmisc")
365 (version "22.20")
366 (source
367 (origin
368 (method url-fetch)
369 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
370 version ".tar.gz"))
371 (sha256
372 (base32
373 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
374 (build-system gnu-build-system)
375 (inputs `(("ncurses" ,ncurses)))
376 (home-page "http://psmisc.sourceforge.net/")
377 (synopsis
378 "Small utilities that use the proc filesystem")
379 (description
380 "This PSmisc package is a set of some small useful utilities that
381 use the proc filesystem. We're not about changing the world, but
382 providing the system administrator with some help in common tasks.")
383 (license gpl2+)))
384
385 (define-public util-linux
386 (package
387 (name "util-linux")
388 (version "2.25.2")
389 (source (origin
390 (method url-fetch)
391 (uri (string-append "mirror://kernel.org/linux/utils/"
392 name "/v" (version-major+minor version) "/"
393 name "-" version ".tar.xz"))
394 (sha256
395 (base32
396 "1miwwdq1zwvhf0smrxx3fjddq3mz22s8rc5cw54s7x3kbdqpyig0"))
397 (patches (list (search-patch "util-linux-tests.patch")))
398 (modules '((guix build utils)))
399 (snippet
400 ;; We take the 'logger' program from GNU Inetutils and 'kill'
401 ;; from GNU Coreutils.
402 '(substitute* "configure"
403 (("build_logger=yes") "build_logger=no")
404 (("build_kill=yes") "build_kill=no")))))
405 (build-system gnu-build-system)
406 (arguments
407 `(#:configure-flags (list "--disable-use-tty-group"
408 "--enable-ddate"
409
410 ;; Install completions where our
411 ;; bash-completion package expects them.
412 (string-append "--with-bashcompletiondir="
413 (assoc-ref %outputs "out")
414 "/etc/bash_completion.d"))
415 #:phases (alist-cons-before
416 'check 'pre-check
417 (lambda* (#:key inputs outputs #:allow-other-keys)
418 (let ((out (assoc-ref outputs "out"))
419 (net (assoc-ref inputs "net-base")))
420 ;; Change the test to refer to the right file.
421 (substitute* "tests/ts/misc/mcookie"
422 (("/etc/services")
423 (string-append net "/etc/services")))
424 #t))
425 %standard-phases)))
426 (inputs `(("zlib" ,zlib)
427 ("ncurses" ,ncurses)))
428 (native-inputs
429 `(("perl" ,perl)
430 ("net-base" ,net-base))) ;for tests
431 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
432 (synopsis "Collection of utilities for the Linux kernel")
433 (description
434 "Util-linux is a random collection of utilities for the Linux kernel.")
435
436 ;; Note that util-linux doesn't use the same license for all the
437 ;; code. GPLv2+ is the default license for a code without an
438 ;; explicitly defined license.
439 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
440 bsd-4 public-domain))))
441
442 (define-public procps
443 (package
444 (name "procps")
445 (version "3.2.8")
446 (source (origin
447 (method url-fetch)
448 ;; A mirror://sourceforge URI doesn't work, presumably becuase
449 ;; the SourceForge project is misconfigured.
450 (uri (string-append "http://procps.sourceforge.net/procps-"
451 version ".tar.gz"))
452 (sha256
453 (base32
454 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
455 (patches (list (search-patch "procps-make-3.82.patch")))))
456 (build-system gnu-build-system)
457 (inputs `(("ncurses" ,ncurses)))
458 (arguments
459 '(#:modules ((guix build utils)
460 (guix build gnu-build-system)
461 (srfi srfi-1)
462 (srfi srfi-26))
463 #:phases (alist-replace
464 'configure
465 (lambda* (#:key outputs #:allow-other-keys)
466 ;; No `configure', just a single Makefile.
467 (let ((out (assoc-ref outputs "out")))
468 (substitute* "Makefile"
469 (("/usr/") "/")
470 (("--(owner|group) 0") "")
471 (("ldconfig") "true")
472 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
473 ;; Add libproc to the RPATH.
474 (string-append "LDFLAGS := -Wl,-rpath="
475 out "/lib" value))))
476 (setenv "CC" "gcc"))
477 (alist-replace
478 'install
479 (lambda* (#:key outputs #:allow-other-keys)
480 (let ((out (assoc-ref outputs "out")))
481 (and (zero?
482 (system* "make" "install"
483 (string-append "DESTDIR=" out)))
484
485 ;; Remove commands and man pages redundant with
486 ;; Coreutils.
487 (let ((dup (append-map (cut find-files out <>)
488 '("^kill" "^uptime"))))
489 (for-each delete-file dup)
490 #t)
491
492 ;; Sanity check.
493 (zero?
494 (system* (string-append out "/bin/ps")
495 "--version")))))
496 %standard-phases))
497
498 ;; What did you expect? Tests?
499 #:tests? #f))
500 (home-page "http://procps.sourceforge.net/")
501 (synopsis "Utilities that give information about processes")
502 (description
503 "Procps is the package that has a bunch of small useful utilities
504 that give information about processes using the Linux /proc file system.
505 The package includes the programs ps, top, vmstat, w, kill, free,
506 slabtop, and skill.")
507 (license gpl2)))
508
509 (define-public usbutils
510 (package
511 (name "usbutils")
512 (version "006")
513 (source
514 (origin
515 (method url-fetch)
516 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
517 "usbutils-" version ".tar.xz"))
518 (sha256
519 (base32
520 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
521 (build-system gnu-build-system)
522 (inputs
523 `(("libusb" ,libusb)))
524 (native-inputs
525 `(("pkg-config" ,pkg-config)))
526 (home-page "http://www.linux-usb.org/")
527 (synopsis
528 "Tools for working with USB devices, such as lsusb")
529 (description
530 "Tools for working with USB devices, such as lsusb.")
531 (license gpl2+)))
532
533 (define-public e2fsprogs
534 (package
535 (name "e2fsprogs")
536 (version "1.42.12")
537 (source (origin
538 (method url-fetch)
539 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
540 version ".tar.gz"))
541 (sha256
542 (base32
543 "0v0qcfyls0dlrjy8gx9m3s2wbkp5z3lbsr5hb7x8kp8f3bclcy71"))
544 (modules '((guix build utils)))
545 (snippet
546 '(substitute* "MCONFIG.in"
547 (("INSTALL_SYMLINK = /bin/sh")
548 "INSTALL_SYMLINK = sh")))))
549 (build-system gnu-build-system)
550 (inputs `(("util-linux" ,util-linux)))
551 (native-inputs `(("pkg-config" ,pkg-config)
552 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
553 (arguments
554 '(;; util-linux is not the preferred source for some of the libraries and
555 ;; commands, so disable them (see, e.g.,
556 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b336339909c90559b7db40b455f172>.)
557 #:configure-flags '("--disable-libblkid"
558 "--disable-libuuid" "--disable-uuidd"
559 "--disable-fsck"
560
561 ;; Install libext2fs et al.
562 "--enable-elf-shlibs")
563
564 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
565 (assoc-ref %outputs "out")
566 "/lib"))
567
568 #:phases (alist-cons-before
569 'configure 'patch-shells
570 (lambda _
571 (substitute* "configure"
572 (("/bin/sh (.*)parse-types.sh" _ dir)
573 (string-append (which "sh") " " dir
574 "parse-types.sh")))
575 (substitute* (find-files "." "^Makefile.in$")
576 (("#!/bin/sh")
577 (string-append "#!" (which "sh")))))
578 (alist-cons-after
579 'install 'install-libs
580 (lambda _
581 (zero? (system* "make" "install-libs")))
582 %standard-phases))
583
584 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
585 ;; they fail because we get an extra line that says "Can't check if
586 ;; filesystem is mounted due to missing mtab file".
587 #:tests? #f))
588 (home-page "http://e2fsprogs.sourceforge.net/")
589 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
590 (description
591 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
592 (license (list gpl2 ; programs
593 lgpl2.0 ; libext2fs
594 x11)))) ; libuuid
595
596 (define e2fsprogs/static
597 (static-package
598 (package (inherit e2fsprogs)
599 (arguments
600 ;; Do not build shared libraries.
601 (substitute-keyword-arguments (package-arguments e2fsprogs)
602 ((#:configure-flags _)
603 '(list "--disable-blkid"))
604 ((#:make-flags _)
605 '(list)))))))
606
607 (define-public e2fsck/static
608 (package
609 (name "e2fsck-static")
610 (version (package-version e2fsprogs))
611 (build-system trivial-build-system)
612 (source #f)
613 (arguments
614 `(#:modules ((guix build utils))
615 #:builder
616 (begin
617 (use-modules (guix build utils)
618 (ice-9 ftw)
619 (srfi srfi-26))
620
621 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
622 "/sbin"))
623 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
624 (mkdir-p bin)
625 (with-directory-excursion bin
626 (for-each (lambda (file)
627 (copy-file (string-append source "/" file)
628 file)
629 (remove-store-references file)
630 (chmod file #o555))
631 (scandir source (cut string-prefix? "fsck." <>))))))))
632 (inputs `(("e2fsprogs" ,e2fsprogs/static)))
633 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
634 (description
635 "This package provides statically-linked command of fsck.ext[234] taken
636 from the e2fsprogs package. It is meant to be used in initrds.")
637 (home-page (package-home-page e2fsprogs))
638 (license (package-license e2fsprogs))))
639
640 (define-public zerofree
641 (package
642 (name "zerofree")
643 (version "1.0.3")
644 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
645 (source (origin
646 (method url-fetch)
647 (uri (string-append home-page name "-" version
648 ".tgz"))
649 (sha256
650 (base32
651 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
652 (build-system gnu-build-system)
653 (arguments
654 '(#:phases (alist-replace
655 'install
656 (lambda* (#:key outputs #:allow-other-keys)
657 (let* ((out (assoc-ref outputs "out"))
658 (bin (string-append out "/bin")))
659 (mkdir-p bin)
660 (copy-file "zerofree"
661 (string-append bin "/zerofree"))
662 (chmod (string-append bin "/zerofree")
663 #o555)
664 #t))
665 (alist-delete 'configure %standard-phases))
666 #:tests? #f)) ;no tests
667 (inputs `(("libext2fs" ,e2fsprogs)))
668 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
669 (description
670 "The zerofree command scans the free blocks in an ext2 file system and
671 fills any non-zero blocks with zeroes. This is a useful way to make disk
672 images more compressible.")
673 (license gpl2)))
674
675 (define-public strace
676 (package
677 (name "strace")
678 (version "4.7")
679 (source (origin
680 (method url-fetch)
681 (uri (string-append "mirror://sourceforge/strace/strace-"
682 version ".tar.xz"))
683 (sha256
684 (base32
685 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
686 (build-system gnu-build-system)
687 (native-inputs `(("perl" ,perl)))
688 (home-page "http://strace.sourceforge.net/")
689 (synopsis "System call tracer for Linux")
690 (description
691 "strace is a system call tracer, i.e. a debugging tool which prints out a
692 trace of all the system calls made by a another process/program.")
693 (license bsd-3)))
694
695 (define-public ltrace
696 (package
697 (name "ltrace")
698 (version "0.7.3")
699 (source (origin
700 (method url-fetch)
701 (uri (string-append "http://www.ltrace.org/ltrace_" version
702 ".orig.tar.bz2"))
703 (sha256
704 (base32
705 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
706 (build-system gnu-build-system)
707 (inputs `(("libelf" ,libelf)))
708 (arguments
709 ;; Compilation uses -Werror by default, but it fails.
710 '(#:configure-flags '("--disable-werror")))
711 (home-page "http://www.ltrace.org/")
712 (synopsis "Library call tracer for Linux")
713 (description
714 "ltrace intercepts and records dynamic library calls which are called by
715 an executed process and the signals received by that process. It can also
716 intercept and print the system calls executed by the program.")
717 (license gpl2+)))
718
719 (define-public alsa-lib
720 (package
721 (name "alsa-lib")
722 (version "1.0.27.1")
723 (source (origin
724 (method url-fetch)
725 (uri (string-append
726 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
727 version ".tar.bz2"))
728 (sha256
729 (base32
730 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
731 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
732 (build-system gnu-build-system)
733 (home-page "http://www.alsa-project.org/")
734 (synopsis "The Advanced Linux Sound Architecture libraries")
735 (description
736 "The Advanced Linux Sound Architecture (ALSA) provides audio and
737 MIDI functionality to the Linux-based operating system.")
738 (license lgpl2.1+)))
739
740 (define-public alsa-utils
741 (package
742 (name "alsa-utils")
743 (version "1.0.27.2")
744 (source (origin
745 (method url-fetch)
746 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
747 version ".tar.bz2"))
748 (sha256
749 (base32
750 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
751 (build-system gnu-build-system)
752 (arguments
753 ;; XXX: Disable man page creation until we have DocBook.
754 '(#:configure-flags (list "--disable-xmlto"
755
756 ;; The udev rule is responsible for restoring
757 ;; the volume.
758 (string-append "--with-udev-rules-dir="
759 (assoc-ref %outputs "out")
760 "/lib/udev/rules.d"))
761 #:phases (alist-cons-before
762 'install 'pre-install
763 (lambda _
764 ;; Don't try to mkdir /var/lib/alsa.
765 (substitute* "Makefile"
766 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
767 "true\n")))
768 %standard-phases)))
769 (inputs
770 `(("libsamplerate" ,libsamplerate)
771 ("ncurses" ,ncurses)
772 ("alsa-lib" ,alsa-lib)
773 ("xmlto" ,xmlto)
774 ("gettext" ,gnu-gettext)))
775 (home-page "http://www.alsa-project.org/")
776 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
777 (description
778 "The Advanced Linux Sound Architecture (ALSA) provides audio and
779 MIDI functionality to the Linux-based operating system.")
780
781 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
782 ;; GPLv2-only.
783 (license gpl2)))
784
785 (define-public iptables
786 (package
787 (name "iptables")
788 (version "1.4.16.2")
789 (source (origin
790 (method url-fetch)
791 (uri (string-append
792 "http://www.netfilter.org/projects/iptables/files/iptables-"
793 version ".tar.bz2"))
794 (sha256
795 (base32
796 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
797 (build-system gnu-build-system)
798 (arguments
799 '(#:tests? #f ; no test suite
800 #:configure-flags ; add $libdir to the RUNPATH of executables
801 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
802 (home-page "http://www.netfilter.org/projects/iptables/index.html")
803 (synopsis "Program to configure the Linux IP packet filtering rules")
804 (description
805 "iptables is the userspace command line program used to configure the
806 Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
807 system administrators. Since Network Address Translation is also configured
808 from the packet filter ruleset, iptables is used for this, too. The iptables
809 package also includes ip6tables. ip6tables is used for configuring the IPv6
810 packet filter.")
811 (license gpl2+)))
812
813 (define-public iproute
814 (package
815 (name "iproute2")
816 (version "3.12.0")
817 (source (origin
818 (method url-fetch)
819 (uri (string-append
820 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
821 version ".tar.xz"))
822 (sha256
823 (base32
824 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
825 (build-system gnu-build-system)
826 (arguments
827 `(#:tests? #f ; no test suite
828 #:make-flags (let ((out (assoc-ref %outputs "out")))
829 (list "DESTDIR="
830 (string-append "LIBDIR=" out "/lib")
831 (string-append "SBINDIR=" out "/sbin")
832 (string-append "CONFDIR=" out "/etc")
833 (string-append "DOCDIR=" out "/share/doc/"
834 ,name "-" ,version)
835 (string-append "MANDIR=" out "/share/man")))
836 #:phases (alist-cons-before
837 'install 'pre-install
838 (lambda _
839 ;; Don't attempt to create /var/lib/arpd.
840 (substitute* "Makefile"
841 (("^.*ARPDDIR.*$") "")))
842 %standard-phases)))
843 (inputs
844 `(("iptables" ,iptables)
845 ("db4" ,bdb)))
846 (native-inputs
847 `(("pkg-config" ,pkg-config)
848 ("flex" ,flex)
849 ("bison" ,bison)))
850 (home-page
851 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
852 (synopsis
853 "Utilities for controlling TCP/IP networking and traffic in Linux")
854 (description
855 "Iproute2 is a collection of utilities for controlling TCP/IP
856 networking and traffic with the Linux kernel.
857
858 Most network configuration manuals still refer to ifconfig and route as the
859 primary network configuration tools, but ifconfig is known to behave
860 inadequately in modern network environments. They should be deprecated, but
861 most distros still include them. Most network configuration systems make use
862 of ifconfig and thus provide a limited feature set. The /etc/net project aims
863 to support most modern network technologies, as it doesn't use ifconfig and
864 allows a system administrator to make use of all iproute2 features, including
865 traffic control.
866
867 iproute2 is usually shipped in a package called iproute or iproute2 and
868 consists of several tools, of which the most important are ip and tc. ip
869 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
870 tools print detailed usage messages and are accompanied by a set of
871 manpages.")
872 (license gpl2+)))
873
874 (define-public net-tools
875 ;; XXX: This package is basically unmaintained, but it provides a few
876 ;; commands not yet provided by Inetutils, such as 'route', so we have to
877 ;; live with it.
878 (package
879 (name "net-tools")
880 (version "1.60")
881 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
882 (source (origin
883 (method url-fetch)
884 (uri (string-append home-page "/" name "-"
885 version ".tar.bz2"))
886 (sha256
887 (base32
888 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
889 (patches
890 (list (search-patch "net-tools-bitrot.patch")))))
891 (build-system gnu-build-system)
892 (arguments
893 '(#:modules ((guix build gnu-build-system)
894 (guix build utils)
895 (srfi srfi-1)
896 (srfi srfi-26))
897 #:phases (alist-cons-after
898 'unpack 'patch
899 (lambda* (#:key inputs #:allow-other-keys)
900 (define (apply-patch file)
901 (zero? (system* "patch" "-p1" "--force"
902 "--input" file)))
903
904 (let ((patch.gz (assoc-ref inputs "patch")))
905 (format #t "applying Debian patch set '~a'...~%"
906 patch.gz)
907 (system (string-append "gunzip < " patch.gz " > the-patch"))
908 (and (apply-patch "the-patch")
909 (for-each apply-patch
910 (find-files "debian/patches"
911 "\\.patch")))))
912 (alist-replace
913 'configure
914 (lambda* (#:key outputs #:allow-other-keys)
915 (let ((out (assoc-ref outputs "out")))
916 (mkdir-p (string-append out "/bin"))
917 (mkdir-p (string-append out "/sbin"))
918
919 ;; Pretend we have everything...
920 (system "yes | make config")
921
922 ;; ... except for the things we don't have.
923 ;; HAVE_AFDECnet requires libdnet, which we don't have.
924 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
925 ;; that have been removed.
926 (substitute* '("config.make" "config.h")
927 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
928 (alist-cons-after
929 'install 'remove-redundant-commands
930 (lambda* (#:key outputs #:allow-other-keys)
931 ;; Remove commands and man pages redundant with
932 ;; Inetutils.
933 (let* ((out (assoc-ref outputs "out"))
934 (dup (append-map (cut find-files out <>)
935 '("^hostname"
936 "^(yp|nis|dns)?domainname"))))
937 (for-each delete-file dup)
938 #t))
939 %standard-phases)))
940
941 ;; Binaries that depend on libnet-tools.a don't declare that
942 ;; dependency, making it parallel-unsafe.
943 #:parallel-build? #f
944
945 #:tests? #f ; no test suite
946 #:make-flags (let ((out (assoc-ref %outputs "out")))
947 (list "CC=gcc"
948 (string-append "BASEDIR=" out)
949 (string-append "INSTALLNLSDIR=" out "/share/locale")
950 (string-append "mandir=/share/man")))))
951
952 ;; Use the big Debian patch set (the thing does not even compile out of
953 ;; the box.)
954 (inputs `(("patch" ,(origin
955 (method url-fetch)
956 (uri
957 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
958 (sha256
959 (base32
960 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
961 (native-inputs `(("gettext" ,gnu-gettext)))
962
963 (synopsis "Tools for controlling the network subsystem in Linux")
964 (description
965 "This package includes the important tools for controlling the network
966 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
967 netstat, rarp and route. Additionally, this package contains utilities
968 relating to particular network hardware types (plipconfig, slattach) and
969 advanced aspects of IP configuration (iptunnel, ipmaddr).")
970 (license gpl2+)))
971
972 (define-public libcap
973 (package
974 (name "libcap")
975 (version "2.22")
976 (source (origin
977 (method url-fetch)
978
979 ;; Tarballs used to be available from
980 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
981 ;; but they never came back after kernel.org was compromised.
982 (uri (string-append
983 "mirror://debian/pool/main/libc/libcap2/libcap2_"
984 version ".orig.tar.gz"))
985 (sha256
986 (base32
987 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
988 (build-system gnu-build-system)
989 (arguments '(#:phases
990 (modify-phases %standard-phases
991 (replace 'configure
992 ;; Add $libdir to the RUNPATH of executables.
993 (lambda _
994 (substitute* "Make.Rules"
995 (("LDFLAGS := #-g")
996 (string-append "LDFLAGS := -Wl,-rpath="
997 %output "/lib"))))))
998 #:tests? #f ; no 'check' target
999 #:make-flags (list "lib=lib"
1000 (string-append "prefix="
1001 (assoc-ref %outputs "out"))
1002 "RAISE_SETFCAP=no")))
1003 (native-inputs `(("perl" ,perl)))
1004 (inputs `(("attr" ,attr)))
1005 (home-page "https://sites.google.com/site/fullycapable/")
1006 (synopsis "Library for working with POSIX capabilities")
1007 (description
1008 "Libcap2 provides a programming interface to POSIX capabilities on
1009 Linux-based operating systems.")
1010
1011 ;; License is BSD-3 or GPLv2, at the user's choice.
1012 (license gpl2)))
1013
1014 (define-public bridge-utils
1015 (package
1016 (name "bridge-utils")
1017 (version "1.5")
1018 (source (origin
1019 (method url-fetch)
1020 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
1021 version ".tar.gz"))
1022 (sha256
1023 (base32
1024 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1025 (build-system gnu-build-system)
1026
1027 ;; The tarball lacks all the generated files.
1028 (native-inputs `(("autoconf" ,autoconf)
1029 ("automake" ,automake)))
1030 (arguments
1031 '(#:phases (alist-cons-after
1032 'unpack 'bootstrap
1033 (lambda _
1034 (zero? (system* "autoreconf" "-vf")))
1035 %standard-phases)
1036 #:tests? #f)) ; no 'check' target
1037
1038 (home-page
1039 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1040 (synopsis "Manipulate Ethernet bridges")
1041 (description
1042 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1043 to connect two Ethernet segments together in a protocol independent way.
1044 Packets are forwarded based on Ethernet address, rather than IP address (like
1045 a router). Since forwarding is done at Layer 2, all protocols can go
1046 transparently through a bridge.")
1047 (license gpl2+)))
1048
1049 (define-public libnl
1050 (package
1051 (name "libnl")
1052 (version "3.2.25")
1053 (source (origin
1054 (method url-fetch)
1055 (uri (string-append
1056 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1057 version ".tar.gz"))
1058 (sha256
1059 (base32
1060 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
1061 (build-system gnu-build-system)
1062 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1063 (home-page "http://www.infradead.org/~tgr/libnl/")
1064 (synopsis "NetLink protocol library suite")
1065 (description
1066 "The libnl suite is a collection of libraries providing APIs to netlink
1067 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
1068 between the kernel and user space processes. It was designed to be a more
1069 flexible successor to ioctl to provide mainly networking related kernel
1070 configuration and monitoring interfaces.")
1071
1072 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1073 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1074 (license gpl2)))
1075
1076 (define-public iw
1077 (package
1078 (name "iw")
1079 (version "3.17")
1080 (source (origin
1081 (method url-fetch)
1082 (uri (string-append
1083 "https://www.kernel.org/pub/software/network/iw/iw-"
1084 version ".tar.xz"))
1085 (sha256
1086 (base32
1087 "14zsapqhivk0ws5z21y1ys2c2czi05mzk7bl2yb7qxcfrnsjx9j8"))))
1088 (build-system gnu-build-system)
1089 (native-inputs `(("pkg-config" ,pkg-config)))
1090 (inputs `(("libnl" ,libnl)))
1091 (arguments
1092 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1093 "CC=gcc")
1094 #:phases (alist-delete 'configure %standard-phases)))
1095 (home-page "http://wireless.kernel.org/en/users/Documentation/iw")
1096 (synopsis "Tool for configuring wireless devices")
1097 (description
1098 "iw is a new nl80211 based CLI configuration utility for wireless
1099 devices. It replaces 'iwconfig', which is deprecated.")
1100 (license isc)))
1101
1102 (define-public powertop
1103 (package
1104 (name "powertop")
1105 (version "2.5")
1106 (source
1107 (origin
1108 (method url-fetch)
1109 (uri (string-append
1110 "https://01.org/powertop/sites/default/files/downloads/powertop-"
1111 version ".tar.gz"))
1112 (sha256
1113 (base32
1114 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
1115 (build-system gnu-build-system)
1116 (inputs
1117 ;; TODO: Add pciutils.
1118 `(("zlib" ,zlib)
1119 ;; ("pciutils" ,pciutils)
1120 ("ncurses" ,ncurses)
1121 ("libnl" ,libnl)))
1122 (native-inputs
1123 `(("pkg-config" ,pkg-config)))
1124 (home-page "https://01.org/powertop/")
1125 (synopsis "Analyze power consumption on Intel-based laptops")
1126 (description
1127 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1128 power management. In addition to being a diagnostic tool, PowerTOP also has
1129 an interactive mode where the user can experiment various power management
1130 settings for cases where the operating system has not enabled these
1131 settings.")
1132 (license gpl2)))
1133
1134 (define-public aumix
1135 (package
1136 (name "aumix")
1137 (version "2.9.1")
1138 (source (origin
1139 (method url-fetch)
1140 (uri (string-append
1141 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1142 version ".tar.bz2"))
1143 (sha256
1144 (base32
1145 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1146 (build-system gnu-build-system)
1147 (inputs `(("ncurses" ,ncurses)))
1148 (home-page "http://www.jpj.net/~trevor/aumix.html")
1149 (synopsis "Audio mixer for X and the console")
1150 (description
1151 "Aumix adjusts an audio mixer from X, the console, a terminal,
1152 the command line or a script.")
1153 (license gpl2+)))
1154
1155 (define-public iotop
1156 (package
1157 (name "iotop")
1158 (version "0.6")
1159 (source
1160 (origin
1161 (method url-fetch)
1162 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1163 version ".tar.gz"))
1164 (sha256 (base32
1165 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1166 (build-system python-build-system)
1167 (arguments
1168 ;; The setup.py script expects python-2.
1169 `(#:python ,python-2
1170 ;; There are currently no checks in the package.
1171 #:tests? #f))
1172 (native-inputs `(("python" ,python-2)))
1173 (home-page "http://guichaz.free.fr/iotop/")
1174 (synopsis
1175 "Displays the IO activity of running processes")
1176 (description
1177 "Iotop is a Python program with a top like user interface to show the
1178 processes currently causing I/O.")
1179 (license gpl2+)))
1180
1181 (define-public fuse
1182 (package
1183 (name "fuse")
1184 (version "2.9.3")
1185 (source (origin
1186 (method url-fetch)
1187 (uri (string-append "mirror://sourceforge/fuse/fuse-"
1188 version ".tar.gz"))
1189 (sha256
1190 (base32
1191 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))))
1192 (build-system gnu-build-system)
1193 (inputs `(("util-linux" ,util-linux)))
1194 (arguments
1195 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1196 (assoc-ref %outputs "out")
1197 "/sbin")
1198 (string-append "INIT_D_PATH="
1199 (assoc-ref %outputs "out")
1200 "/etc/init.d")
1201
1202 ;; The rule makes /dev/fuse 666.
1203 (string-append "UDEV_RULES_PATH="
1204 (assoc-ref %outputs "out")
1205 "/lib/udev/rules.d"))
1206 #:phases (alist-cons-before
1207 'build 'set-file-names
1208 (lambda* (#:key inputs #:allow-other-keys)
1209 ;; libfuse calls out to mount(8) and umount(8). Make sure
1210 ;; it refers to the right ones.
1211 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1212 (("/bin/(u?)mount" _ maybe-u)
1213 (string-append (assoc-ref inputs "util-linux")
1214 "/bin/" maybe-u "mount")))
1215 (substitute* '("util/mount.fuse.c")
1216 (("/bin/sh")
1217 (which "sh")))
1218
1219 ;; This hack leads libfuse to search for 'fusermount' in
1220 ;; $PATH, where it may find a setuid-root binary, instead of
1221 ;; trying solely $out/sbin/fusermount and failing because
1222 ;; it's not setuid.
1223 (substitute* "lib/Makefile"
1224 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1225 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1226 %standard-phases)))
1227 (home-page "http://fuse.sourceforge.net/")
1228 (synopsis "Support file systems implemented in user space")
1229 (description
1230 "As a consequence of its monolithic design, file system code for Linux
1231 normally goes into the kernel itself---which is not only a robustness issue,
1232 but also an impediment to system extensibility. FUSE, for \"file systems in
1233 user space\", is a kernel module and user-space library that tries to address
1234 part of this problem by allowing users to run file system implementations as
1235 user-space processes.")
1236 (license (list lgpl2.1 ; library
1237 gpl2+)))) ; command-line utilities
1238
1239 (define-public unionfs-fuse
1240 (package
1241 (name "unionfs-fuse")
1242 (version "0.26")
1243 (source (origin
1244 (method url-fetch)
1245 (uri (string-append
1246 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1247 version ".tar.xz"))
1248 (sha256
1249 (base32
1250 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1251 (build-system cmake-build-system)
1252 (inputs `(("fuse" ,fuse)))
1253 (arguments '(#:tests? #f)) ; no tests
1254 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1255 (synopsis "User-space union file system")
1256 (description
1257 "UnionFS-FUSE is a flexible union file system implementation in user
1258 space, using the FUSE library. Mounting a union file system allows you to
1259 \"aggregate\" the contents of several directories into a single mount point.
1260 UnionFS-FUSE additionally supports copy-on-write.")
1261 (license bsd-3)))
1262
1263 (define fuse-static
1264 (package (inherit fuse)
1265 (name "fuse-static")
1266 (source (origin (inherit (package-source fuse))
1267 (modules '((guix build utils)))
1268 (snippet
1269 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1270 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1271 ;; it doesn't do that, allowing us to remove the dependency on
1272 ;; util-linux (something that is useful in initrds.)
1273 '(substitute* '("lib/mount_util.c"
1274 "util/mount_util.c")
1275 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1276 "0")
1277 (("/bin/")
1278 "")))))))
1279
1280 (define-public unionfs-fuse/static
1281 (package (inherit unionfs-fuse)
1282 (synopsis "User-space union file system (statically linked)")
1283 (name (string-append (package-name unionfs-fuse) "-static"))
1284 (source (origin (inherit (package-source unionfs-fuse))
1285 (modules '((guix build utils)))
1286 (snippet
1287 ;; Add -ldl to the libraries, because libfuse.a needs that.
1288 '(substitute* "src/CMakeLists.txt"
1289 (("target_link_libraries(.*)\\)" _ libs)
1290 (string-append "target_link_libraries"
1291 libs " dl)"))))))
1292 (arguments
1293 '(#:tests? #f
1294 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1295 #:phases (alist-cons-after
1296 'install 'post-install
1297 (lambda* (#:key outputs #:allow-other-keys)
1298 (let* ((out (assoc-ref outputs "out"))
1299 (exe (string-append out "/bin/unionfs")))
1300 ;; By default, 'unionfs' keeps references to
1301 ;; $glibc/share/locale and similar stuff. Remove them.
1302 (remove-store-references exe)))
1303 %standard-phases)))
1304 (inputs `(("fuse" ,fuse-static)))))
1305
1306 (define-public sshfs-fuse
1307 (package
1308 (name "sshfs-fuse")
1309 (version "2.5")
1310 (source (origin
1311 (method url-fetch)
1312 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1313 version ".tar.gz"))
1314 (sha256
1315 (base32
1316 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1317 (build-system gnu-build-system)
1318 (inputs
1319 `(("fuse" ,fuse)
1320 ("glib" ,glib)))
1321 (native-inputs
1322 `(("pkg-config" ,pkg-config)))
1323 (home-page "http://fuse.sourceforge.net/sshfs.html")
1324 (synopsis "Mount remote file systems over SSH")
1325 (description
1326 "This is a file system client based on the SSH File Transfer Protocol.
1327 Since most SSH servers already support this protocol it is very easy to set
1328 up: on the server side there's nothing to do; on the client side mounting the
1329 file system is as easy as logging into the server with an SSH client.")
1330 (license gpl2+)))
1331
1332 (define-public numactl
1333 (package
1334 (name "numactl")
1335 (version "2.0.9")
1336 (source (origin
1337 (method url-fetch)
1338 (uri (string-append
1339 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1340 version
1341 ".tar.gz"))
1342 (sha256
1343 (base32
1344 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1345 (build-system gnu-build-system)
1346 (arguments
1347 '(#:phases (alist-replace
1348 'configure
1349 (lambda* (#:key outputs #:allow-other-keys)
1350 ;; There's no 'configure' script, just a raw makefile.
1351 (substitute* "Makefile"
1352 (("^prefix := .*$")
1353 (string-append "prefix := " (assoc-ref outputs "out")
1354 "\n"))
1355 (("^libdir := .*$")
1356 ;; By default the thing tries to install under
1357 ;; $prefix/lib64 when on a 64-bit platform.
1358 (string-append "libdir := $(prefix)/lib\n"))))
1359 %standard-phases)
1360
1361 #:make-flags (list
1362 ;; By default the thing tries to use 'cc'.
1363 "CC=gcc"
1364
1365 ;; Make sure programs have an RPATH so they can find
1366 ;; libnuma.so.
1367 (string-append "LDLIBS=-Wl,-rpath="
1368 (assoc-ref %outputs "out") "/lib"))
1369
1370 ;; There's a 'test' target, but it requires NUMA support in the kernel
1371 ;; to run, which we can't assume to have.
1372 #:tests? #f))
1373 (home-page "http://oss.sgi.com/projects/libnuma/")
1374 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1375 (description
1376 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1377 memory is not all in one place. The numactl program allows you to run your
1378 application program on specific CPU's and memory nodes. It does this by
1379 supplying a NUMA memory policy to the operating system before running your
1380 program.
1381
1382 The package contains other commands, such as numademo, numastat and memhog.
1383 The numademo command provides a quick overview of NUMA performance on your
1384 system.")
1385 (license (list gpl2 ; programs
1386 lgpl2.1)))) ; library
1387
1388 (define-public kbd
1389 (package
1390 (name "kbd")
1391 (version "2.0.2")
1392 (source (origin
1393 (method url-fetch)
1394 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1395 version ".tar.xz"))
1396 (sha256
1397 (base32
1398 "04mrms12nm5sas0nxs94yrr3hz7gmqhnmfgb9ff34bh1jszxmzcx"))
1399 (modules '((guix build utils)))
1400 (snippet
1401 '(begin
1402 (substitute* "tests/Makefile.in"
1403 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1404 (("@VERSION@")
1405 "[@]VERSION[@]"))
1406 (substitute* '("src/unicode_start" "src/unicode_stop")
1407 ;; Assume the Coreutils are in $PATH.
1408 (("/usr/bin/tty")
1409 "tty"))))))
1410 (build-system gnu-build-system)
1411 (arguments
1412 '(#:phases (alist-cons-before
1413 'build 'pre-build
1414 (lambda* (#:key inputs #:allow-other-keys)
1415 (let ((gzip (assoc-ref %build-inputs "gzip"))
1416 (bzip2 (assoc-ref %build-inputs "bzip2")))
1417 (substitute* "src/libkeymap/findfile.c"
1418 (("gzip")
1419 (string-append gzip "/bin/gzip"))
1420 (("bzip2")
1421 (string-append bzip2 "/bin/bzip2")))))
1422 (alist-cons-after
1423 'install 'post-install
1424 (lambda* (#:key outputs #:allow-other-keys)
1425 ;; Make sure these programs find their comrades.
1426 (let* ((out (assoc-ref outputs "out"))
1427 (bin (string-append out "/bin")))
1428 (for-each (lambda (prog)
1429 (wrap-program (string-append bin "/" prog)
1430 `("PATH" ":" prefix (,bin))))
1431 '("unicode_start" "unicode_stop"))))
1432 %standard-phases))))
1433 (inputs `(("check" ,check)
1434 ("gzip" ,gzip)
1435 ("bzip2" ,bzip2)
1436 ("pam" ,linux-pam)))
1437 (native-inputs `(("pkg-config" ,pkg-config)))
1438 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1439 (synopsis "Linux keyboard utilities and keyboard maps")
1440 (description
1441 "This package contains keytable files and keyboard utilities compatible
1442 for systems using the Linux kernel. This includes commands such as
1443 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1444 (license gpl2+)))
1445
1446 (define-public inotify-tools
1447 (package
1448 (name "inotify-tools")
1449 (version "3.13")
1450 (source (origin
1451 (method url-fetch)
1452 (uri (string-append
1453 "mirror://sourceforge/inotify-tools/inotify-tools/"
1454 version "/inotify-tools-" version ".tar.gz"))
1455 (sha256
1456 (base32
1457 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1458 (build-system gnu-build-system)
1459 (home-page "http://inotify-tools.sourceforge.net/")
1460 (synopsis "Monitor file accesses")
1461 (description
1462 "The inotify-tools packages provides a C library and command-line tools
1463 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1464 (license gpl2+)))
1465
1466 (define-public kmod
1467 (package
1468 (name "kmod")
1469 (version "17")
1470 (source (origin
1471 (method url-fetch)
1472 (uri
1473 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1474 "kmod-" version ".tar.xz"))
1475 (sha256
1476 (base32
1477 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1478 (patches (list (search-patch "kmod-module-directory.patch")))))
1479 (build-system gnu-build-system)
1480 (native-inputs
1481 `(("pkg-config" ,pkg-config)))
1482 (inputs
1483 `(("xz" ,xz)
1484 ("zlib" ,zlib)))
1485 (arguments
1486 `(#:tests? #f ; FIXME: Investigate test failures
1487 #:configure-flags '("--with-xz" "--with-zlib")
1488 #:phases (alist-cons-after
1489 'install 'install-modprobe&co
1490 (lambda* (#:key outputs #:allow-other-keys)
1491 (let* ((out (assoc-ref outputs "out"))
1492 (bin (string-append out "/bin")))
1493 (for-each (lambda (tool)
1494 (symlink "kmod"
1495 (string-append bin "/" tool)))
1496 '("insmod" "rmmod" "lsmod" "modprobe"
1497 "modinfo" "depmod"))))
1498 %standard-phases)))
1499 (home-page "https://www.kernel.org/")
1500 (synopsis "Kernel module tools")
1501 (description "Kmod is a set of tools to handle common tasks with Linux
1502 kernel modules like insert, remove, list, check properties, resolve
1503 dependencies and aliases.
1504
1505 These tools are designed on top of libkmod, a library that is shipped with
1506 kmod. The aim is to be compatible with tools, configurations and indices
1507 from the module-init-tools project.")
1508 (license gpl2+))) ; library under lgpl2.1+
1509
1510 (define-public eudev
1511 ;; The post-systemd fork, maintained by Gentoo.
1512 (package
1513 (name "eudev")
1514 (version "2.1.1")
1515 (source (origin
1516 (method url-fetch)
1517 (uri (string-append
1518 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1519 version ".tar.gz"))
1520 (sha256
1521 (base32
1522 "0shf5vqiz9fdxl95aa1a8vh0xjxwim3psc39wr2xr8lnahf11vva"))
1523 (patches (list (search-patch "eudev-rules-directory.patch")))
1524 (modules '((guix build utils)))
1525 (snippet
1526 ;; 'configure' checks uses <linux/btrfs.h> as an indication of
1527 ;; whether Linux headers are available, but it doesn't actually
1528 ;; use it, and our 'linux-libre-headers' package doesn't
1529 ;; provide it. So just remove that.
1530 '(substitute* "configure"
1531 (("linux/btrfs\\.h")
1532 "")))))
1533 (build-system gnu-build-system)
1534 (native-inputs
1535 `(("pkg-config" ,pkg-config)
1536 ("gperf" ,gperf)
1537 ("glib" ,glib "bin") ; glib-genmarshal, etc.
1538 ("perl" ,perl) ; for the tests
1539 ("python" ,python-2))) ; ditto
1540 (inputs
1541 `(("kmod" ,kmod)
1542 ("pciutils" ,pciutils)
1543 ("usbutils" ,usbutils)
1544 ("util-linux" ,util-linux)
1545 ("glib" ,glib)
1546 ("gobject-introspection" ,gobject-introspection)))
1547 (arguments
1548 `(#:configure-flags (list "--enable-libkmod"
1549
1550 (string-append
1551 "--with-pci-ids-path="
1552 (assoc-ref %build-inputs "pciutils")
1553 "/share/pci.ids.gz")
1554
1555 "--with-firmware-path=/no/firmware"
1556
1557 ;; Work around undefined reference to
1558 ;; 'mq_getattr' in sc-daemon.c.
1559 "LDFLAGS=-lrt")
1560 #:phases
1561 (alist-cons-before
1562 'build 'pre-build
1563 ;; The program 'g-ir-scanner' (part of the package
1564 ;; 'gobject-introspection'), to generate .gir files, makes some
1565 ;; library pre-processing. During that phase it looks for the C
1566 ;; compiler as either 'cc' or as defined by the environment variable
1567 ;; 'CC' (with code in 'giscanner/dumper.py').
1568 (lambda* _
1569 (setenv "CC" "gcc"))
1570 %standard-phases)))
1571 (home-page "http://www.gentoo.org/proj/en/eudev/")
1572 (synopsis "Userspace device management")
1573 (description "Udev is a daemon which dynamically creates and removes
1574 device nodes from /dev/, handles hotplug events and loads drivers at boot
1575 time.")
1576 (license gpl2+)))
1577
1578 (define-public lvm2
1579 (package
1580 (name "lvm2")
1581 (version "2.02.109")
1582 (source (origin
1583 (method url-fetch)
1584 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1585 version ".tgz"))
1586 (sha256
1587 (base32
1588 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1589 (modules '((guix build utils)))
1590 (snippet
1591 '(begin
1592 (use-modules (guix build utils))
1593
1594 ;; Honor sysconfdir.
1595 (substitute* "make.tmpl.in"
1596 (("confdir = .*$")
1597 "confdir = @sysconfdir@\n")
1598 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1599 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1600 (build-system gnu-build-system)
1601 (native-inputs
1602 `(("pkg-config" ,pkg-config)
1603 ("procps" ,procps))) ;tests use 'pgrep'
1604 (inputs
1605 `(("udev" ,eudev)))
1606 (arguments
1607 '(#:phases (alist-cons-after
1608 'configure 'set-makefile-shell
1609 (lambda _
1610 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1611 ;; expected.
1612 (setenv "SHELL" (which "sh"))
1613
1614 ;; Replace /bin/sh with the right file name.
1615 (patch-makefile-SHELL "make.tmpl"))
1616 %standard-phases)
1617
1618 #:configure-flags (list (string-append "--sysconfdir="
1619 (assoc-ref %outputs "out")
1620 "/etc/lvm")
1621 "--enable-udev_sync"
1622 "--enable-udev_rules"
1623
1624 ;; Make sure programs such as 'dmsetup' can
1625 ;; find libdevmapper.so.
1626 (string-append "LDFLAGS=-Wl,-rpath="
1627 (assoc-ref %outputs "out")
1628 "/lib"))
1629
1630 ;; The tests use 'mknod', which requires root access.
1631 #:tests? #f))
1632 (home-page "http://sourceware.org/lvm2/")
1633 (synopsis "Logical volume management for Linux")
1634 (description
1635 "LVM2 is the logical volume management tool set for Linux-based systems.
1636 This package includes the user-space libraries and tools, including the device
1637 mapper. Kernel components are part of Linux-libre.")
1638
1639 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1640 ;; Command-line tools are GPLv2.
1641 (license (list gpl2 lgpl2.1))))
1642
1643 (define-public wireless-tools
1644 (package
1645 (name "wireless-tools")
1646 (version "30.pre9")
1647 (source (origin
1648 (method url-fetch)
1649 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1650 version ".tar.gz"))
1651 (sha256
1652 (base32
1653 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
1654 (modules '((guix build utils)))
1655 (snippet
1656 ;; Install the manual pages in the right place.
1657 '(substitute* "Makefile"
1658 (("INSTALL_MAN= .*")
1659 "INSTALL_MAN= $(PREFIX)/share/man")))))
1660 (build-system gnu-build-system)
1661 (arguments
1662 `(#:phases (alist-replace
1663 'configure
1664 (lambda* (#:key outputs #:allow-other-keys)
1665 (setenv "PREFIX" (assoc-ref outputs "out")))
1666 %standard-phases)
1667 #:tests? #f))
1668 (synopsis "Tools for manipulating Linux Wireless Extensions")
1669 (description "Wireless Tools are used to manipulate the now-deprecated
1670 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1671 Extension was an interface allowing you to set Wireless LAN specific
1672 parameters and get the specific stats. It is deprecated in favor the nl80211
1673 interface.")
1674 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1675 (license gpl2+)))
1676
1677 (define-public lm-sensors
1678 (package
1679 (name "lm-sensors")
1680 (version "3.3.5")
1681 (source (origin
1682 (method url-fetch)
1683 (uri (string-append
1684 "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-"
1685 version ".tar.bz2"))
1686 (sha256
1687 (base32
1688 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1689 (patches (list (search-patch "lm-sensors-hwmon-attrs.patch")))))
1690 (build-system gnu-build-system)
1691 (inputs `(("rrdtool" ,rrdtool)
1692 ("perl" ,perl)
1693 ("kmod" ,kmod)
1694 ("gnuplot" ,gnuplot)))
1695 (native-inputs `(("pkg-config" ,pkg-config)
1696 ("flex" ,flex)
1697 ("bison" ,bison)
1698 ("which" ,which)))
1699 (arguments
1700 `(#:tests? #f ; no 'check' target
1701 #:make-flags (list (string-append "PREFIX=" %output)
1702 (string-append "ETCDIR=" %output "/etc")
1703 (string-append "MANDIR=" %output "/share/man"))
1704 #:phases
1705 (alist-delete
1706 'configure
1707 (alist-cons-before
1708 'build 'patch-exec-paths
1709 (lambda* (#:key inputs outputs #:allow-other-keys)
1710 (substitute* "prog/detect/sensors-detect"
1711 (("`uname")
1712 (string-append "`" (assoc-ref inputs "coreutils")
1713 "/bin/uname"))
1714 (("(`|\")modprobe" all open-quote)
1715 (string-append open-quote
1716 (assoc-ref inputs "kmod")
1717 "/bin/modprobe")))
1718 (substitute* '("prog/pwm/pwmconfig"
1719 "prog/pwm/fancontrol")
1720 (("gnuplot")
1721 (string-append (assoc-ref inputs "gnuplot")
1722 "/bin/gnuplot"))
1723 (("cat ")
1724 (string-append (assoc-ref inputs "coreutils")
1725 "/bin/cat "))
1726 (("egrep ")
1727 (string-append (assoc-ref inputs "grep")
1728 "/bin/egrep "))
1729 (("sed -e")
1730 (string-append (assoc-ref inputs "sed")
1731 "/bin/sed -e"))
1732 (("cut -d")
1733 (string-append (assoc-ref inputs "coreutils")
1734 "/bin/cut -d"))
1735 (("sleep ")
1736 (string-append (assoc-ref inputs "coreutils")
1737 "/bin/sleep "))
1738 (("readlink -f")
1739 (string-append (assoc-ref inputs "coreutils")
1740 "/bin/readlink -f"))))
1741 %standard-phases))))
1742 (home-page "http://www.lm-sensors.org/")
1743 (synopsis "Utilities to read temperature/voltage/fan sensors")
1744 (description
1745 "Lm-sensors is a hardware health monitoring package for Linux. It allows
1746 you to access information from temperature, voltage, and fan speed sensors.
1747 It works with most newer systems.")
1748 (license gpl2+)))
1749
1750 (define-public i2c-tools
1751 (package
1752 (name "i2c-tools")
1753 (version "3.1.1")
1754 (source (origin
1755 (method url-fetch)
1756 (uri (string-append
1757 "http://dl.lm-sensors.org/i2c-tools/releases/i2c-tools-"
1758 version ".tar.bz2"))
1759 (sha256
1760 (base32
1761 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
1762 (build-system gnu-build-system)
1763 (arguments
1764 `(#:tests? #f ; no 'check' target
1765 #:make-flags (list (string-append "prefix=" %output)
1766 "CC=gcc")
1767 ;; no configure script
1768 #:phases (alist-delete 'configure %standard-phases)))
1769 (inputs
1770 `(("perl" ,perl)))
1771 (home-page "http://www.lm-sensors.org/wiki/I2CTools")
1772 (synopsis "I2C tools for Linux")
1773 (description
1774 "The i2c-tools package contains a heterogeneous set of I2C tools for
1775 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
1776 EEPROM decoding scripts, EEPROM programming tools, and a python module for
1777 SMBus access.")
1778 (license gpl2+)))
1779
1780 (define-public xsensors
1781 (package
1782 (name "xsensors")
1783 (version "0.70")
1784 (source (origin
1785 (method url-fetch)
1786 (uri (string-append
1787 "http://www.linuxhardware.org/xsensors/xsensors-"
1788 version ".tar.gz"))
1789 (sha256
1790 (base32
1791 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1792 (build-system gnu-build-system)
1793 (inputs `(("lm-sensors" ,lm-sensors)
1794 ("gtk" ,gtk+-2)))
1795 (native-inputs `(("pkg-config" ,pkg-config)))
1796 (arguments
1797 `(#:phases (alist-cons-before
1798 'configure 'enable-deprecated
1799 (lambda _
1800 (substitute* "src/Makefile.in"
1801 (("-DGDK_DISABLE_DEPRECATED") "")
1802 (("-DGTK_DISABLE_DEPRECATED") "")))
1803 (alist-cons-before
1804 'configure 'remove-Werror
1805 (lambda _
1806 (substitute* '("configure" "src/Makefile.in")
1807 (("-Werror") "")))
1808 %standard-phases))))
1809 (home-page "http://www.linuxhardware.org/xsensors/")
1810 (synopsis "Hardware health information viewer")
1811 (description
1812 "Xsensors reads data from the libsensors library regarding hardware
1813 health such as temperature, voltage and fan speed and displays the information
1814 in a digital read-out.")
1815 (license gpl2+)))
1816
1817 (define-public perf
1818 (package
1819 (name "perf")
1820 (version (package-version linux-libre))
1821 (source (package-source linux-libre))
1822 (build-system gnu-build-system)
1823 (arguments
1824 '(#:phases (alist-replace
1825 'configure
1826 (lambda* (#:key inputs #:allow-other-keys)
1827 (setenv "SHELL_PATH" (which "bash"))
1828 (chdir "tools/perf"))
1829 %standard-phases)
1830 #:make-flags (list (string-append "DESTDIR="
1831 (assoc-ref %outputs "out"))
1832 "WERROR=0"
1833
1834 ;; By default, 'config/Makefile' uses lib64 on
1835 ;; x86_64. Work around that.
1836 "lib=lib")
1837 #:tests? #f)) ;no tests
1838 (native-inputs
1839 `(("pkg-config" ,pkg-config)
1840 ("bison" ,bison)
1841 ("flex" ,flex)
1842
1843 ;; There are build scripts written in these languages.
1844 ("perl" ,perl)
1845 ("python" ,python-2)))
1846 (inputs
1847 `(("slang" ,slang) ;for the interactive TUI
1848 ;; ("newt" ,newt)
1849 ("python" ,python-2) ;'perf' links against libpython
1850 ("elfutils" ,elfutils)
1851
1852 ;; Documentation.
1853 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
1854 ("libxslt" ,libxslt)
1855 ("docbook-xml" ,docbook-xml)
1856 ("docbook-xsl" ,docbook-xsl)
1857 ("xmlto" ,xmlto)
1858 ("asciidoc" ,asciidoc)))
1859 (home-page "https://perf.wiki.kernel.org/")
1860 (synopsis "Linux profiling with performance counters")
1861 (description
1862 "perf is a tool suite for profiling using hardware performance counters,
1863 with support in the Linux kernel. perf can instrument CPU performance
1864 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
1865 of lightweight profiling. This package contains the user-land tools and in
1866 particular the 'perf' command.")
1867 (license (package-license linux-libre))))
1868
1869 (define-public pflask
1870 (package
1871 (name "pflask")
1872 (version "0.2")
1873 (source (origin
1874 (method url-fetch)
1875 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
1876 version ".tar.gz"))
1877 (file-name (string-append name "-" version ".tar.gz"))
1878 (sha256
1879 (base32
1880 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
1881 (build-system cmake-build-system)
1882 (arguments
1883 '(#:tests? #f)) ; no tests
1884 (home-page "http://ghedo.github.io/pflask/")
1885 (synopsis "Simple tool for creating Linux namespace containers")
1886 (description "pflask is a simple tool for creating Linux namespace
1887 containers. It can be used for running a command or even booting an OS inside
1888 an isolated container, created with the help of Linux namespaces. It is
1889 similar in functionality to chroot, although pflask provides better isolation
1890 thanks to the use of namespaces.")
1891 (license bsd-2)))
1892
1893 (define-public hdparm
1894 (package
1895 (name "hdparm")
1896 (version "9.45")
1897 (source (origin
1898 (method url-fetch)
1899 (uri (string-append "mirror://sourceforge/" name "/"
1900 name "-" version ".tar.gz"))
1901 (sha256
1902 (base32
1903 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
1904 (build-system gnu-build-system)
1905 (arguments
1906 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
1907 (list (string-append "binprefix=" out)
1908 (string-append "manprefix=" out)
1909 "CC=gcc"))
1910 #:phases (alist-delete 'configure %standard-phases)
1911 #:tests? #f)) ; no test suite
1912 (home-page "http://sourceforge.net/projects/hdparm/")
1913 (synopsis "tune hard disk parameters for high performance")
1914 (description
1915 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
1916 is for enabling irq-unmasking and IDE multiplemode.")
1917 (license (non-copyleft "file://LICENSE.TXT"))))
1918
1919 (define-public acpid
1920 (package
1921 (name "acpid")
1922 (version "2.0.23")
1923 (source (origin
1924 (method url-fetch)
1925 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
1926 version ".tar.xz"))
1927 (sha256
1928 (base32
1929 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
1930 (build-system gnu-build-system)
1931 (home-page "http://sourceforge.net/projects/acpid2/")
1932 (synopsis "Daemon for delivering ACPI events to user-space programs")
1933 (description
1934 "acpid is designed to notify user-space programs of Advanced
1935 Configuration and Power Interface (ACPI) events. acpid should be started
1936 during the system boot, and will run as a background process. When an ACPI
1937 event is received from the kernel, acpid will examine the list of rules
1938 specified in /etc/acpi/events and execute the rules that match the event.")
1939 (license gpl2+)))
1940
1941 (define-public sysfsutils
1942 (package
1943 (name "sysfsutils")
1944 (version "2.1.0")
1945 (source
1946 (origin
1947 (method url-fetch)
1948 (uri
1949 (string-append
1950 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
1951 version ".tar.gz"))
1952 (sha256
1953 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
1954 (build-system gnu-build-system)
1955 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
1956 (synopsis "System utilities based on Linux sysfs")
1957 (description
1958 "These are a set of utilites built upon sysfs, a virtual filesystem in
1959 Linux kernel versions 2.5+ that exposes a system's device tree. The package
1960 also contains the libsysfs library.")
1961 ;; The library is under lgpl2.1+ (all files say "or any later version").
1962 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
1963 (license (list gpl2 gpl2+ lgpl2.1+))))
1964
1965 (define-public sysfsutils-1
1966 (package
1967 (inherit sysfsutils)
1968 (version "1.3.0")
1969 (source
1970 (origin
1971 (method url-fetch)
1972 (uri
1973 (string-append
1974 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
1975 "/sysfsutils-" version ".tar.gz"))
1976 (sha256
1977 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
1978 (modules '((guix build utils)))
1979 (snippet
1980 '(begin
1981 (substitute* "Makefile.in"
1982 (("includedir = /usr/include/sysfs")
1983 "includedir = @includedir@"))
1984 (substitute* "configure"
1985 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
1986 (string-append "includedir='" orig "/sysfs'")))))))
1987 ;; XXX sysfsutils-1.3.0's config.guess fails on mips64el
1988 (arguments `(#:configure-flags
1989 '(,@(if (%current-target-system)
1990 '()
1991 (let ((triplet
1992 (nix-system->gnu-triplet (%current-system))))
1993 (list (string-append "--build=" triplet)))))))
1994 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
1995
1996 (define-public cpufrequtils
1997 (package
1998 (name "cpufrequtils")
1999 (version "0.3")
2000 (source
2001 (origin
2002 (method url-fetch)
2003 (uri
2004 (string-append
2005 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2006 version ".tar.gz"))
2007 (sha256
2008 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2009 (patches (list (search-patch "cpufrequtils-fix-aclocal.patch")))))
2010 (build-system gnu-build-system)
2011 (native-inputs
2012 `(("sysfsutils" ,sysfsutils-1)))
2013 (arguments
2014 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2015 (assoc-ref %outputs "out") "/lib"))))
2016 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2017 (synopsis "Utilities to get and set CPU frequency on Linux")
2018 (description
2019 "The cpufrequtils suite contains utilities to retreive CPU frequency
2020 information, and set the CPU frequency if supported, using the cpufreq
2021 capabilities of the Linux kernel.")
2022 (license gpl2)))
2023
2024 (define-public libraw1394
2025 (package
2026 (name "libraw1394")
2027 (version "2.1.0")
2028 (source (origin
2029 (method url-fetch)
2030 (uri (string-append
2031 "mirror://kernel.org/linux/libs/ieee1394/"
2032 name "-" version ".tar.xz"))
2033 (sha256
2034 (base32
2035 "0kwnf4ha45c04mhc4yla672aqmvqqihxix1gvblns5cd2pc2cc8b"))))
2036 (build-system gnu-build-system)
2037 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2038 (synopsis "Interface library for the Linux IEEE1394 drivers")
2039 (description
2040 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2041 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2042 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2043 send to and receive from other nodes without requiring a kernel driver for the
2044 protocol in question.")
2045 (license lgpl2.1+)))
2046
2047 (define-public libavc1394
2048 (package
2049 (name "libavc1394")
2050 (version "0.5.4")
2051 (source (origin
2052 (method url-fetch)
2053 (uri (string-append "mirror://sourceforge/libavc1394/"
2054 name "-" version ".tar.gz"))
2055 (sha256
2056 (base32
2057 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2058 (build-system gnu-build-system)
2059 (native-inputs
2060 `(("pkg-config" ,pkg-config)))
2061 (propagated-inputs
2062 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2063 (home-page "http://sourceforge.net/projects/libavc1394/")
2064 (synopsis "AV/C protocol library for IEEE 1394")
2065 (description
2066 "Libavc1394 is a programming interface to the AV/C specification from
2067 the 1394 Trade Assocation. AV/C stands for Audio/Video Control.")
2068 (license lgpl2.1+)))
2069
2070 (define-public libiec61883
2071 (package
2072 (name "libiec61883")
2073 (version "1.2.0")
2074 (source (origin
2075 (method url-fetch)
2076 (uri (string-append
2077 "mirror://kernel.org/linux/libs/ieee1394/"
2078 name "-" version ".tar.xz"))
2079 (sha256
2080 (base32
2081 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2082 (build-system gnu-build-system)
2083 (native-inputs
2084 `(("pkg-config" ,pkg-config)))
2085 (propagated-inputs
2086 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2087 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2088 (synopsis "Isochronous streaming media library for IEEE 1394")
2089 (description
2090 "The libiec61883 library provides a higher level API for streaming DV,
2091 MPEG-2 and audio over Linux IEEE 1394.")
2092 (license lgpl2.1+)))
2093
2094 (define-public mdadm
2095 (package
2096 (name "mdadm")
2097 (version "3.3.2")
2098 (source (origin
2099 (method url-fetch)
2100 (uri (string-append
2101 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2102 version ".tar.xz"))
2103 (sha256
2104 (base32
2105 "132vdvh3myjgcjn6i9w90ck16ddjxjcszklzkyvr4f5ifqd7wfhg"))))
2106 (build-system gnu-build-system)
2107 (inputs
2108 `(("udev" ,eudev)))
2109 (arguments
2110 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2111 (list "INSTALL=install"
2112 "CHECK_RUN_DIR=0"
2113 ;; TODO: tell it where to find 'sendmail'
2114 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2115 (string-append "BINDIR=" out "/sbin")
2116 (string-append "MANDIR=" out "/share/man")
2117 (string-append "UDEVDIR=" out "/lib/udev")))
2118 #:phases (alist-cons-before
2119 'build 'patch-program-paths
2120 (lambda* (#:key inputs #:allow-other-keys)
2121 (let ((coreutils (assoc-ref inputs "coreutils")))
2122 (substitute* "udev-md-raid-arrays.rules"
2123 (("/usr/bin/(readlink|basename)" all program)
2124 (string-append coreutils "/bin/" program)))))
2125 (alist-delete 'configure %standard-phases))
2126 ;;tests must be done as root
2127 #:tests? #f))
2128 (home-page "http://neil.brown.name/blog/mdadm")
2129 (synopsis "Tool for managing Linux Software RAID arrays")
2130 (description
2131 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2132 assemble, report on, and monitor arrays. It can also move spares between raid
2133 arrays when needed.")
2134 (license gpl2+)))
2135
2136 (define-public libaio
2137 (package
2138 (name "libaio")
2139 (version "0.3.110")
2140 (source (origin
2141 (method url-fetch)
2142 (uri (list
2143 (string-append "mirror://debian/pool/main/liba/libaio/"
2144 name "_" version ".orig.tar.gz")
2145 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2146 name "-" version ".tar.gz")))
2147 (sha256
2148 (base32
2149 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2150 (build-system gnu-build-system)
2151 (arguments
2152 '(#:make-flags
2153 (list "CC=gcc" (string-append "prefix=" %output))
2154 #:test-target "partcheck" ; need root for a full 'check'
2155 #:phases
2156 (alist-delete 'configure %standard-phases))) ; no configure script
2157 (home-page "http://lse.sourceforge.net/io/aio.html")
2158 (synopsis "Linux-native asynchronous I/O access library")
2159 (description
2160 "This library enables userspace to use Linux kernel asynchronous I/O
2161 system calls, important for the performance of databases and other advanced
2162 applications.")
2163 (license lgpl2.1+)))