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>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
24 (define-module (gnu packages linux)
25 #:use-module ((guix licenses)
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 (gnu packages readline)
59 #:use-module (gnu packages calendar)
60 #:use-module (guix packages)
61 #:use-module (guix download)
62 #:use-module (guix utils)
63 #:use-module (guix build-system gnu)
64 #:use-module (guix build-system cmake)
65 #:use-module (guix build-system python)
66 #:use-module (guix build-system trivial)
67 #:use-module (srfi srfi-26)
68 #:use-module (ice-9 match))
70 (define-public (system->linux-architecture arch)
71 "Return the Linux architecture name for ARCH, a Guix system name such as
73 (let ((arch (car (string-split arch #\-))))
74 (cond ((string=? arch "i686") "i386")
75 ((string-prefix? "mips" arch) "mips")
76 ((string-prefix? "arm" arch) "arm")
79 (define (linux-libre-urls version)
80 "Return a list of URLs for Linux-Libre VERSION."
82 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
83 version "-gnu/linux-libre-" version "-gnu.tar.xz")
85 ;; XXX: Work around <http://bugs.gnu.org/14851>.
87 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
88 version "-gnu.tar.xz")
90 ;; Maybe this URL will become valid eventually.
92 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
93 version "-gnu.tar.xz")))
95 (define-public linux-libre-headers
96 (let* ((version "3.14.37")
100 (setenv "ARCH" ,(system->linux-architecture arch))
101 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
103 (and (zero? (system* "make" "defconfig"))
104 (zero? (system* "make" "mrproper" "headers_check"))))))
106 `(lambda* (#:key outputs #:allow-other-keys)
107 (let ((out (assoc-ref outputs "out")))
108 (and (zero? (system* "make"
109 (string-append "INSTALL_HDR_PATH=" out)
111 (mkdir (string-append out "/include/config"))
112 (call-with-output-file
114 "/include/config/kernel.release")
116 (format p "~a-default~%" ,version))))))))
118 (name "linux-libre-headers")
122 (uri (linux-libre-urls version))
125 "1blxr2bsvfqi9khj4cpspv434bmx252zak2wsbi2mgl60zh77gza"))))
126 (build-system gnu-build-system)
127 (native-inputs `(("perl" ,perl)))
129 `(#:modules ((guix build gnu-build-system)
132 #:phases (alist-replace
133 'build ,(build-phase (or (%current-target-system)
136 'install ,install-phase
137 (alist-delete 'configure %standard-phases)))
139 (synopsis "GNU Linux-Libre kernel headers")
140 (description "Headers of the Linux-Libre kernel.")
142 (home-page "http://www.gnu.org/software/linux-libre/"))))
144 (define-public module-init-tools
146 (name "module-init-tools")
151 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
155 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
157 (list (search-patch "module-init-tools-moduledir.patch")))))
158 (build-system gnu-build-system)
160 ;; FIXME: The upstream tarball lacks man pages, and building them would
161 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
162 ;; but they vanished. In the meantime, fake it.
163 '(#:phases (alist-cons-before
164 'configure 'fake-docbook
166 (substitute* "Makefile.in"
167 (("^DOCBOOKTOMAN.*$")
168 "DOCBOOKTOMAN = true\n")))
170 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
171 (synopsis "Tools for loading and managing Linux kernel modules")
173 "Tools for loading and managing Linux kernel modules, such as `modprobe',
174 `insmod', `lsmod', and more.")
177 (define %boot-logo-patch
178 ;; Linux-Libre boot logo featuring Freedo and a gnu.
181 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
182 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
185 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
187 (define (kernel-config system)
188 "Return the absolute file name of the Linux-Libre build configuration file
189 for SYSTEM, or #f if there is no configuration for SYSTEM."
190 (define (lookup file)
191 (let ((file (string-append "gnu/packages/" file)))
192 (search-path %load-path file)))
196 (lookup "linux-libre-i686.conf"))
198 (lookup "linux-libre-x86_64.conf"))
202 (define-public linux-libre
203 (let* ((version "4.0.4")
205 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
206 ;; Apply the neat patch.
207 (system* "patch" "-p1" "--force"
208 "-i" (assoc-ref inputs "patch/freedo+gnu"))
210 (let ((arch (car (string-split system #\-))))
212 (cond ((string=? arch "i686") "i386")
214 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
216 (let ((build (assoc-ref %standard-phases 'build))
217 (config (assoc-ref inputs "kconfig")))
219 ;; Use the architecture-specific config if available, and
220 ;; 'defconfig' otherwise.
223 (copy-file config ".config")
224 (chmod ".config" #o666))
225 (system* "make" "defconfig"))
227 ;; Appending works even when the option wasn't in the
228 ;; file. The last one prevails if duplicated.
229 (let ((port (open-file ".config" "a")))
230 (display (string-append "CONFIG_NET_9P=m\n"
231 "CONFIG_NET_9P_VIRTIO=m\n"
232 "CONFIG_VIRTIO_BLK=m\n"
233 "CONFIG_VIRTIO_NET=m\n"
234 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
235 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
236 "CONFIG_VIRTIO_PCI=m\n"
237 "CONFIG_VIRTIO_BALLOON=m\n"
238 "CONFIG_VIRTIO_MMIO=m\n"
245 (zero? (system* "make" "oldconfig"))
247 ;; Call the default `build' phase so `-j' is correctly
249 (apply build #:make-flags "all" args))))
251 `(lambda* (#:key inputs outputs #:allow-other-keys)
252 (let* ((out (assoc-ref outputs "out"))
253 (moddir (string-append out "/lib/modules"))
254 (mit (assoc-ref inputs "module-init-tools")))
256 (for-each (lambda (file)
258 (string-append out "/" (basename file))))
259 (find-files "." "^(bzImage|System\\.map)$"))
260 (copy-file ".config" (string-append out "/config"))
261 (zero? (system* "make"
262 (string-append "DEPMOD=" mit "/sbin/depmod")
263 (string-append "MODULE_DIR=" moddir)
264 (string-append "INSTALL_PATH=" out)
265 (string-append "INSTALL_MOD_PATH=" out)
266 "INSTALL_MOD_STRIP=1"
267 "modules_install"))))))
273 (uri (linux-libre-urls version))
276 "1czjhyczzaz1dvhy9lrlxlk6gf45wcw3rnpcmh697dxgf37clmzp"))))
277 (build-system gnu-build-system)
278 (native-inputs `(("perl" ,perl)
280 ("module-init-tools" ,module-init-tools)
281 ("patch/freedo+gnu" ,%boot-logo-patch)
283 ,@(let ((conf (kernel-config (or (%current-target-system)
284 (%current-system)))))
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)))
294 `(#:modules ((guix build gnu-build-system)
298 #:phases (alist-replace
301 'install ,install-phase
302 (alist-delete 'configure %standard-phases)))
304 (synopsis "100% free redistribution of a cleaned Linux kernel")
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.")
309 (home-page "http://www.gnu.org/software/linux-libre/"))))
313 ;;; Pluggable authentication modules (PAM).
316 (define-public linux-pam
323 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
325 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
326 version ".tar.bz2")))
329 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
330 (build-system gnu-build-system)
334 ;; TODO: optional dependencies
335 ;; ("libxcrypt" ,libxcrypt)
336 ;; ("cracklib" ,cracklib)
339 '(;; Most users, such as `shadow', expect the headers to be under
341 #:configure-flags (list (string-append "--includedir="
342 (assoc-ref %outputs "out")
343 "/include/security"))
345 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
348 (home-page "http://www.linux-pam.org/")
349 (synopsis "Pluggable authentication modules for Linux")
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")
362 (define-public psmisc
369 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
373 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
374 (build-system gnu-build-system)
375 (inputs `(("ncurses" ,ncurses)))
376 (home-page "http://psmisc.sourceforge.net/")
378 "Small utilities that use the proc filesystem")
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.")
385 (define-public util-linux
391 (uri (string-append "mirror://kernel.org/linux/utils/"
392 name "/v" (version-major+minor version) "/"
393 name "-" version ".tar.xz"))
396 "1miwwdq1zwvhf0smrxx3fjddq3mz22s8rc5cw54s7x3kbdqpyig0"))
397 (patches (list (search-patch "util-linux-tests.patch")))
398 (modules '((guix build utils)))
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)
407 `(#:configure-flags (list "--disable-use-tty-group"
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
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"
423 (string-append net "/etc/services")))
426 (inputs `(("zlib" ,zlib)
427 ("ncurses" ,ncurses)))
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")
434 "Util-linux is a random collection of utilities for the Linux kernel.")
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))))
442 (define-public procps
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-"
454 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
455 (patches (list (search-patch "procps-make-3.82.patch")))))
456 (build-system gnu-build-system)
457 (inputs `(("ncurses" ,ncurses)))
459 '(#:modules ((guix build utils)
460 (guix build gnu-build-system)
463 #:phases (alist-replace
465 (lambda* (#:key outputs #:allow-other-keys)
466 ;; No `configure', just a single Makefile.
467 (let ((out (assoc-ref outputs "out")))
468 (substitute* "Makefile"
470 (("--(owner|group) 0") "")
471 (("ldconfig") "true")
472 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
473 ;; Add libproc to the RPATH.
474 (string-append "LDFLAGS := -Wl,-rpath="
479 (lambda* (#:key outputs #:allow-other-keys)
480 (let ((out (assoc-ref outputs "out")))
482 (system* "make" "install"
483 (string-append "DESTDIR=" out)))
485 ;; Remove commands and man pages redundant with
487 (let ((dup (append-map (cut find-files out <>)
488 '("^kill" "^uptime"))))
489 (for-each delete-file dup)
494 (system* (string-append out "/bin/ps")
498 ;; What did you expect? Tests?
500 (home-page "http://procps.sourceforge.net/")
501 (synopsis "Utilities that give information about processes")
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.")
509 (define-public usbutils
516 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
517 "usbutils-" version ".tar.xz"))
520 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
521 (build-system gnu-build-system)
523 `(("libusb" ,libusb)))
525 `(("pkg-config" ,pkg-config)))
526 (home-page "http://www.linux-usb.org/")
528 "Tools for working with USB devices, such as lsusb")
530 "Tools for working with USB devices, such as lsusb.")
533 (define-public e2fsprogs
539 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
543 "0v0qcfyls0dlrjy8gx9m3s2wbkp5z3lbsr5hb7x8kp8f3bclcy71"))
544 (modules '((guix build utils)))
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
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"
561 ;; Install libext2fs et al.
562 "--enable-elf-shlibs")
564 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
565 (assoc-ref %outputs "out")
568 #:phases (alist-cons-before
569 'configure 'patch-shells
571 (substitute* "configure"
572 (("/bin/sh (.*)parse-types.sh" _ dir)
573 (string-append (which "sh") " " dir
575 (substitute* (find-files "." "^Makefile.in$")
577 (string-append "#!" (which "sh")))))
579 'install 'install-libs
580 (lambda* (#:key outputs #:allow-other-keys)
581 (let* ((out (assoc-ref outputs "out"))
582 (lib (string-append out "/lib")))
583 (and (zero? (system* "make" "install-libs"))
585 ;; Make the .a writable so that 'strip' works.
586 ;; Failing to do that, due to debug symbols, we
587 ;; retain a reference to the final
588 ;; linux-libre-headers, which refer to the
589 ;; bootstrap binaries.
590 (let ((archives (find-files lib "\\.a$")))
591 (for-each (lambda (file)
597 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
598 ;; they fail because we get an extra line that says "Can't check if
599 ;; filesystem is mounted due to missing mtab file".
601 (home-page "http://e2fsprogs.sourceforge.net/")
602 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
604 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
605 (license (list gpl2 ; programs
609 (define e2fsprogs/static
611 (package (inherit e2fsprogs)
613 ;; Do not build shared libraries.
614 (substitute-keyword-arguments (package-arguments e2fsprogs)
615 ((#:configure-flags _)
616 '(list "--disable-blkid"))
620 (define-public e2fsck/static
622 (name "e2fsck-static")
623 (version (package-version e2fsprogs))
624 (build-system trivial-build-system)
627 `(#:modules ((guix build utils))
630 (use-modules (guix build utils)
634 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
636 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
638 (with-directory-excursion bin
639 (for-each (lambda (file)
640 (copy-file (string-append source "/" file)
642 (remove-store-references file)
644 (scandir source (cut string-prefix? "fsck." <>))))))))
645 (inputs `(("e2fsprogs" ,e2fsprogs/static)))
646 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
648 "This package provides statically-linked command of fsck.ext[234] taken
649 from the e2fsprogs package. It is meant to be used in initrds.")
650 (home-page (package-home-page e2fsprogs))
651 (license (package-license e2fsprogs))))
653 (define-public zerofree
657 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
660 (uri (string-append home-page name "-" version
664 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
665 (build-system gnu-build-system)
667 '(#:phases (alist-replace
669 (lambda* (#:key outputs #:allow-other-keys)
670 (let* ((out (assoc-ref outputs "out"))
671 (bin (string-append out "/bin")))
673 (copy-file "zerofree"
674 (string-append bin "/zerofree"))
675 (chmod (string-append bin "/zerofree")
678 (alist-delete 'configure %standard-phases))
679 #:tests? #f)) ;no tests
680 (inputs `(("libext2fs" ,e2fsprogs)))
681 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
683 "The zerofree command scans the free blocks in an ext2 file system and
684 fills any non-zero blocks with zeroes. This is a useful way to make disk
685 images more compressible.")
688 (define-public strace
694 (uri (string-append "mirror://sourceforge/strace/strace-"
698 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
699 (build-system gnu-build-system)
700 (native-inputs `(("perl" ,perl)))
701 (home-page "http://strace.sourceforge.net/")
702 (synopsis "System call tracer for Linux")
704 "strace is a system call tracer, i.e. a debugging tool which prints out a
705 trace of all the system calls made by a another process/program.")
708 (define-public ltrace
714 (uri (string-append "http://www.ltrace.org/ltrace_" version
718 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
719 (build-system gnu-build-system)
720 (inputs `(("libelf" ,libelf)))
722 ;; Compilation uses -Werror by default, but it fails.
723 '(#:configure-flags '("--disable-werror")))
724 (home-page "http://www.ltrace.org/")
725 (synopsis "Library call tracer for Linux")
727 "ltrace intercepts and records dynamic library calls which are called by
728 an executed process and the signals received by that process. It can also
729 intercept and print the system calls executed by the program.")
732 (define-public alsa-lib
739 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
743 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
744 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
745 (build-system gnu-build-system)
746 (home-page "http://www.alsa-project.org/")
747 (synopsis "The Advanced Linux Sound Architecture libraries")
749 "The Advanced Linux Sound Architecture (ALSA) provides audio and
750 MIDI functionality to the Linux-based operating system.")
753 (define-public alsa-utils
759 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
763 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
764 (build-system gnu-build-system)
766 ;; XXX: Disable man page creation until we have DocBook.
767 '(#:configure-flags (list "--disable-xmlto"
769 ;; The udev rule is responsible for restoring
771 (string-append "--with-udev-rules-dir="
772 (assoc-ref %outputs "out")
773 "/lib/udev/rules.d"))
774 #:phases (alist-cons-before
775 'install 'pre-install
777 ;; Don't try to mkdir /var/lib/alsa.
778 (substitute* "Makefile"
779 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
783 `(("libsamplerate" ,libsamplerate)
785 ("alsa-lib" ,alsa-lib)
787 ("gettext" ,gnu-gettext)))
788 (home-page "http://www.alsa-project.org/")
789 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
791 "The Advanced Linux Sound Architecture (ALSA) provides audio and
792 MIDI functionality to the Linux-based operating system.")
794 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
798 (define-public iptables
805 "http://www.netfilter.org/projects/iptables/files/iptables-"
809 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
810 (build-system gnu-build-system)
812 '(#:tests? #f ; no test suite
813 #:configure-flags ; add $libdir to the RUNPATH of executables
814 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
815 (home-page "http://www.netfilter.org/projects/iptables/index.html")
816 (synopsis "Program to configure the Linux IP packet filtering rules")
818 "iptables is the userspace command line program used to configure the
819 Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
820 system administrators. Since Network Address Translation is also configured
821 from the packet filter ruleset, iptables is used for this, too. The iptables
822 package also includes ip6tables. ip6tables is used for configuring the IPv6
826 (define-public iproute
833 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
837 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
838 (build-system gnu-build-system)
840 `(#:tests? #f ; no test suite
841 #:make-flags (let ((out (assoc-ref %outputs "out")))
843 (string-append "LIBDIR=" out "/lib")
844 (string-append "SBINDIR=" out "/sbin")
845 (string-append "CONFDIR=" out "/etc")
846 (string-append "DOCDIR=" out "/share/doc/"
848 (string-append "MANDIR=" out "/share/man")))
849 #:phases (alist-cons-before
850 'install 'pre-install
852 ;; Don't attempt to create /var/lib/arpd.
853 (substitute* "Makefile"
854 (("^.*ARPDDIR.*$") "")))
857 `(("iptables" ,iptables)
860 `(("pkg-config" ,pkg-config)
864 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
866 "Utilities for controlling TCP/IP networking and traffic in Linux")
868 "Iproute2 is a collection of utilities for controlling TCP/IP
869 networking and traffic with the Linux kernel.
871 Most network configuration manuals still refer to ifconfig and route as the
872 primary network configuration tools, but ifconfig is known to behave
873 inadequately in modern network environments. They should be deprecated, but
874 most distros still include them. Most network configuration systems make use
875 of ifconfig and thus provide a limited feature set. The /etc/net project aims
876 to support most modern network technologies, as it doesn't use ifconfig and
877 allows a system administrator to make use of all iproute2 features, including
880 iproute2 is usually shipped in a package called iproute or iproute2 and
881 consists of several tools, of which the most important are ip and tc. ip
882 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
883 tools print detailed usage messages and are accompanied by a set of
887 (define-public net-tools
888 ;; XXX: This package is basically unmaintained, but it provides a few
889 ;; commands not yet provided by Inetutils, such as 'route', so we have to
894 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
897 (uri (string-append home-page "/" name "-"
901 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
903 (list (search-patch "net-tools-bitrot.patch")))))
904 (build-system gnu-build-system)
906 '(#:modules ((guix build gnu-build-system)
910 #:phases (alist-cons-after
912 (lambda* (#:key inputs #:allow-other-keys)
913 (define (apply-patch file)
914 (zero? (system* "patch" "-p1" "--force"
917 (let ((patch.gz (assoc-ref inputs "patch")))
918 (format #t "applying Debian patch set '~a'...~%"
920 (system (string-append "gunzip < " patch.gz " > the-patch"))
921 (and (apply-patch "the-patch")
922 (for-each apply-patch
923 (find-files "debian/patches"
927 (lambda* (#:key outputs #:allow-other-keys)
928 (let ((out (assoc-ref outputs "out")))
929 (mkdir-p (string-append out "/bin"))
930 (mkdir-p (string-append out "/sbin"))
932 ;; Pretend we have everything...
933 (system "yes | make config")
935 ;; ... except for the things we don't have.
936 ;; HAVE_AFDECnet requires libdnet, which we don't have.
937 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
938 ;; that have been removed.
939 (substitute* '("config.make" "config.h")
940 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
942 'install 'remove-redundant-commands
943 (lambda* (#:key outputs #:allow-other-keys)
944 ;; Remove commands and man pages redundant with
946 (let* ((out (assoc-ref outputs "out"))
947 (dup (append-map (cut find-files out <>)
949 "^(yp|nis|dns)?domainname"))))
950 (for-each delete-file dup)
954 ;; Binaries that depend on libnet-tools.a don't declare that
955 ;; dependency, making it parallel-unsafe.
958 #:tests? #f ; no test suite
959 #:make-flags (let ((out (assoc-ref %outputs "out")))
961 (string-append "BASEDIR=" out)
962 (string-append "INSTALLNLSDIR=" out "/share/locale")
963 (string-append "mandir=/share/man")))))
965 ;; Use the big Debian patch set (the thing does not even compile out of
967 (inputs `(("patch" ,(origin
970 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
973 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
974 (native-inputs `(("gettext" ,gnu-gettext)))
976 (synopsis "Tools for controlling the network subsystem in Linux")
978 "This package includes the important tools for controlling the network
979 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
980 netstat, rarp and route. Additionally, this package contains utilities
981 relating to particular network hardware types (plipconfig, slattach) and
982 advanced aspects of IP configuration (iptunnel, ipmaddr).")
985 (define-public libcap
992 ;; Tarballs used to be available from
993 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
994 ;; but they never came back after kernel.org was compromised.
996 "mirror://debian/pool/main/libc/libcap2/libcap2_"
997 version ".orig.tar.gz"))
1000 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
1001 (build-system gnu-build-system)
1002 (arguments '(#:phases
1003 (modify-phases %standard-phases
1005 ;; Add $libdir to the RUNPATH of executables.
1007 (substitute* "Make.Rules"
1009 (string-append "LDFLAGS := -Wl,-rpath="
1010 %output "/lib"))))))
1011 #:tests? #f ; no 'check' target
1012 #:make-flags (list "lib=lib"
1013 (string-append "prefix="
1014 (assoc-ref %outputs "out"))
1015 "RAISE_SETFCAP=no")))
1016 (native-inputs `(("perl" ,perl)))
1017 (inputs `(("attr" ,attr)))
1018 (home-page "https://sites.google.com/site/fullycapable/")
1019 (synopsis "Library for working with POSIX capabilities")
1021 "Libcap2 provides a programming interface to POSIX capabilities on
1022 Linux-based operating systems.")
1024 ;; License is BSD-3 or GPLv2, at the user's choice.
1027 (define-public bridge-utils
1029 (name "bridge-utils")
1033 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
1037 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1038 (build-system gnu-build-system)
1040 ;; The tarball lacks all the generated files.
1041 (native-inputs `(("autoconf" ,autoconf)
1042 ("automake" ,automake)))
1044 '(#:phases (alist-cons-after
1047 ;; Fix "field ‘ip6’ has incomplete type" errors.
1048 (substitute* "libbridge/libbridge.h"
1049 (("#include <linux/if_bridge.h>")
1050 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1052 ;; Ensure that the entire build fails if one of the
1053 ;; sub-Makefiles fails.
1054 (substitute* "Makefile.in"
1055 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1056 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1058 (zero? (system* "autoreconf" "-vf")))
1060 #:tests? #f)) ; no 'check' target
1063 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1064 (synopsis "Manipulate Ethernet bridges")
1066 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1067 to connect two Ethernet segments together in a protocol independent way.
1068 Packets are forwarded based on Ethernet address, rather than IP address (like
1069 a router). Since forwarding is done at Layer 2, all protocols can go
1070 transparently through a bridge.")
1073 (define-public libnl
1080 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1084 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
1085 (build-system gnu-build-system)
1086 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1087 (home-page "http://www.infradead.org/~tgr/libnl/")
1088 (synopsis "NetLink protocol library suite")
1090 "The libnl suite is a collection of libraries providing APIs to netlink
1091 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
1092 between the kernel and user space processes. It was designed to be a more
1093 flexible successor to ioctl to provide mainly networking related kernel
1094 configuration and monitoring interfaces.")
1096 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1097 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1107 "https://www.kernel.org/pub/software/network/iw/iw-"
1111 "14zsapqhivk0ws5z21y1ys2c2czi05mzk7bl2yb7qxcfrnsjx9j8"))))
1112 (build-system gnu-build-system)
1113 (native-inputs `(("pkg-config" ,pkg-config)))
1114 (inputs `(("libnl" ,libnl)))
1116 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1118 #:phases (alist-delete 'configure %standard-phases)))
1119 (home-page "http://wireless.kernel.org/en/users/Documentation/iw")
1120 (synopsis "Tool for configuring wireless devices")
1122 "iw is a new nl80211 based CLI configuration utility for wireless
1123 devices. It replaces 'iwconfig', which is deprecated.")
1126 (define-public powertop
1134 "https://01.org/powertop/sites/default/files/downloads/powertop-"
1138 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
1139 (build-system gnu-build-system)
1141 ;; TODO: Add pciutils.
1143 ;; ("pciutils" ,pciutils)
1144 ("ncurses" ,ncurses)
1147 `(("pkg-config" ,pkg-config)))
1148 (home-page "https://01.org/powertop/")
1149 (synopsis "Analyze power consumption on Intel-based laptops")
1151 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1152 power management. In addition to being a diagnostic tool, PowerTOP also has
1153 an interactive mode where the user can experiment various power management
1154 settings for cases where the operating system has not enabled these
1158 (define-public aumix
1165 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1166 version ".tar.bz2"))
1169 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1170 (build-system gnu-build-system)
1171 (inputs `(("ncurses" ,ncurses)))
1172 (home-page "http://www.jpj.net/~trevor/aumix.html")
1173 (synopsis "Audio mixer for X and the console")
1175 "Aumix adjusts an audio mixer from X, the console, a terminal,
1176 the command line or a script.")
1179 (define-public iotop
1186 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1189 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1190 (build-system python-build-system)
1192 ;; The setup.py script expects python-2.
1193 `(#:python ,python-2
1194 ;; There are currently no checks in the package.
1196 (native-inputs `(("python" ,python-2)))
1197 (home-page "http://guichaz.free.fr/iotop/")
1199 "Displays the IO activity of running processes")
1201 "Iotop is a Python program with a top like user interface to show the
1202 processes currently causing I/O.")
1211 (uri (string-append "mirror://sourceforge/fuse/fuse-"
1215 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))
1216 (patches (list (search-patch "fuse-CVE-2015-3202.patch")))))
1217 (build-system gnu-build-system)
1218 (inputs `(("util-linux" ,util-linux)))
1220 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1221 (assoc-ref %outputs "out")
1223 (string-append "INIT_D_PATH="
1224 (assoc-ref %outputs "out")
1227 ;; The rule makes /dev/fuse 666.
1228 (string-append "UDEV_RULES_PATH="
1229 (assoc-ref %outputs "out")
1230 "/lib/udev/rules.d"))
1231 #:phases (alist-cons-before
1232 'build 'set-file-names
1233 (lambda* (#:key inputs #:allow-other-keys)
1234 ;; libfuse calls out to mount(8) and umount(8). Make sure
1235 ;; it refers to the right ones.
1236 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1237 (("/bin/(u?)mount" _ maybe-u)
1238 (string-append (assoc-ref inputs "util-linux")
1239 "/bin/" maybe-u "mount")))
1240 (substitute* '("util/mount.fuse.c")
1244 ;; This hack leads libfuse to search for 'fusermount' in
1245 ;; $PATH, where it may find a setuid-root binary, instead of
1246 ;; trying solely $out/sbin/fusermount and failing because
1248 (substitute* "lib/Makefile"
1249 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1250 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1252 (home-page "http://fuse.sourceforge.net/")
1253 (synopsis "Support file systems implemented in user space")
1255 "As a consequence of its monolithic design, file system code for Linux
1256 normally goes into the kernel itself---which is not only a robustness issue,
1257 but also an impediment to system extensibility. FUSE, for \"file systems in
1258 user space\", is a kernel module and user-space library that tries to address
1259 part of this problem by allowing users to run file system implementations as
1260 user-space processes.")
1261 (license (list lgpl2.1 ; library
1262 gpl2+)))) ; command-line utilities
1264 (define-public unionfs-fuse
1266 (name "unionfs-fuse")
1271 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1275 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1276 (build-system cmake-build-system)
1277 (inputs `(("fuse" ,fuse)))
1278 (arguments '(#:tests? #f)) ; no tests
1279 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1280 (synopsis "User-space union file system")
1282 "UnionFS-FUSE is a flexible union file system implementation in user
1283 space, using the FUSE library. Mounting a union file system allows you to
1284 \"aggregate\" the contents of several directories into a single mount point.
1285 UnionFS-FUSE additionally supports copy-on-write.")
1289 (package (inherit fuse)
1290 (name "fuse-static")
1291 (source (origin (inherit (package-source fuse))
1292 (modules '((guix build utils)))
1294 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1295 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1296 ;; it doesn't do that, allowing us to remove the dependency on
1297 ;; util-linux (something that is useful in initrds.)
1298 '(substitute* '("lib/mount_util.c"
1299 "util/mount_util.c")
1300 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1305 (define-public unionfs-fuse/static
1306 (package (inherit unionfs-fuse)
1307 (synopsis "User-space union file system (statically linked)")
1308 (name (string-append (package-name unionfs-fuse) "-static"))
1309 (source (origin (inherit (package-source unionfs-fuse))
1310 (modules '((guix build utils)))
1312 ;; Add -ldl to the libraries, because libfuse.a needs that.
1313 '(substitute* "src/CMakeLists.txt"
1314 (("target_link_libraries(.*)\\)" _ libs)
1315 (string-append "target_link_libraries"
1319 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1320 #:phases (alist-cons-after
1321 'install 'post-install
1322 (lambda* (#:key outputs #:allow-other-keys)
1323 (let* ((out (assoc-ref outputs "out"))
1324 (exe (string-append out "/bin/unionfs")))
1325 ;; By default, 'unionfs' keeps references to
1326 ;; $glibc/share/locale and similar stuff. Remove them.
1327 (remove-store-references exe)))
1329 (inputs `(("fuse" ,fuse-static)))))
1331 (define-public sshfs-fuse
1337 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1341 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1342 (build-system gnu-build-system)
1347 `(("pkg-config" ,pkg-config)))
1348 (home-page "http://fuse.sourceforge.net/sshfs.html")
1349 (synopsis "Mount remote file systems over SSH")
1351 "This is a file system client based on the SSH File Transfer Protocol.
1352 Since most SSH servers already support this protocol it is very easy to set
1353 up: on the server side there's nothing to do; on the client side mounting the
1354 file system is as easy as logging into the server with an SSH client.")
1357 (define-public numactl
1364 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1369 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1370 (build-system gnu-build-system)
1372 '(#:phases (alist-replace
1374 (lambda* (#:key outputs #:allow-other-keys)
1375 ;; There's no 'configure' script, just a raw makefile.
1376 (substitute* "Makefile"
1378 (string-append "prefix := " (assoc-ref outputs "out")
1381 ;; By default the thing tries to install under
1382 ;; $prefix/lib64 when on a 64-bit platform.
1383 (string-append "libdir := $(prefix)/lib\n"))))
1387 ;; By default the thing tries to use 'cc'.
1390 ;; Make sure programs have an RPATH so they can find
1392 (string-append "LDLIBS=-Wl,-rpath="
1393 (assoc-ref %outputs "out") "/lib"))
1395 ;; There's a 'test' target, but it requires NUMA support in the kernel
1396 ;; to run, which we can't assume to have.
1398 (home-page "http://oss.sgi.com/projects/libnuma/")
1399 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1401 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1402 memory is not all in one place. The numactl program allows you to run your
1403 application program on specific CPU's and memory nodes. It does this by
1404 supplying a NUMA memory policy to the operating system before running your
1407 The package contains other commands, such as numademo, numastat and memhog.
1408 The numademo command provides a quick overview of NUMA performance on your
1410 (license (list gpl2 ; programs
1411 lgpl2.1)))) ; library
1419 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1423 "04mrms12nm5sas0nxs94yrr3hz7gmqhnmfgb9ff34bh1jszxmzcx"))
1424 (modules '((guix build utils)))
1427 (substitute* "tests/Makefile.in"
1428 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1431 (substitute* '("src/unicode_start" "src/unicode_stop")
1432 ;; Assume the Coreutils are in $PATH.
1435 (build-system gnu-build-system)
1437 '(#:phases (alist-cons-before
1439 (lambda* (#:key inputs #:allow-other-keys)
1440 (let ((gzip (assoc-ref %build-inputs "gzip"))
1441 (bzip2 (assoc-ref %build-inputs "bzip2")))
1442 (substitute* "src/libkeymap/findfile.c"
1444 (string-append gzip "/bin/gzip"))
1446 (string-append bzip2 "/bin/bzip2")))))
1448 'install 'post-install
1449 (lambda* (#:key outputs #:allow-other-keys)
1450 ;; Make sure these programs find their comrades.
1451 (let* ((out (assoc-ref outputs "out"))
1452 (bin (string-append out "/bin")))
1453 (for-each (lambda (prog)
1454 (wrap-program (string-append bin "/" prog)
1455 `("PATH" ":" prefix (,bin))))
1456 '("unicode_start" "unicode_stop"))))
1457 %standard-phases))))
1458 (inputs `(("check" ,check)
1461 ("pam" ,linux-pam)))
1462 (native-inputs `(("pkg-config" ,pkg-config)))
1463 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1464 (synopsis "Linux keyboard utilities and keyboard maps")
1466 "This package contains keytable files and keyboard utilities compatible
1467 for systems using the Linux kernel. This includes commands such as
1468 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1471 (define-public inotify-tools
1473 (name "inotify-tools")
1478 "mirror://sourceforge/inotify-tools/inotify-tools/"
1479 version "/inotify-tools-" version ".tar.gz"))
1482 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1483 (build-system gnu-build-system)
1484 (home-page "http://inotify-tools.sourceforge.net/")
1485 (synopsis "Monitor file accesses")
1487 "The inotify-tools packages provides a C library and command-line tools
1488 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1498 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1499 "kmod-" version ".tar.xz"))
1502 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1503 (patches (list (search-patch "kmod-module-directory.patch")))))
1504 (build-system gnu-build-system)
1506 `(("pkg-config" ,pkg-config)))
1511 `(#:tests? #f ; FIXME: Investigate test failures
1512 #:configure-flags '("--with-xz" "--with-zlib")
1513 #:phases (alist-cons-after
1514 'install 'install-modprobe&co
1515 (lambda* (#:key outputs #:allow-other-keys)
1516 (let* ((out (assoc-ref outputs "out"))
1517 (bin (string-append out "/bin")))
1518 (for-each (lambda (tool)
1520 (string-append bin "/" tool)))
1521 '("insmod" "rmmod" "lsmod" "modprobe"
1522 "modinfo" "depmod"))))
1524 (home-page "https://www.kernel.org/")
1525 (synopsis "Kernel module tools")
1526 (description "Kmod is a set of tools to handle common tasks with Linux
1527 kernel modules like insert, remove, list, check properties, resolve
1528 dependencies and aliases.
1530 These tools are designed on top of libkmod, a library that is shipped with
1531 kmod. The aim is to be compatible with tools, configurations and indices
1532 from the module-init-tools project.")
1533 (license gpl2+))) ; library under lgpl2.1+
1535 (define-public eudev
1536 ;; The post-systemd fork, maintained by Gentoo.
1543 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1547 "0shf5vqiz9fdxl95aa1a8vh0xjxwim3psc39wr2xr8lnahf11vva"))
1548 (patches (list (search-patch "eudev-rules-directory.patch")))
1549 (modules '((guix build utils)))
1551 ;; 'configure' checks uses <linux/btrfs.h> as an indication of
1552 ;; whether Linux headers are available, but it doesn't actually
1553 ;; use it, and our 'linux-libre-headers' package doesn't
1554 ;; provide it. So just remove that.
1555 '(substitute* "configure"
1556 (("linux/btrfs\\.h")
1558 (build-system gnu-build-system)
1560 `(("pkg-config" ,pkg-config)
1562 ("glib" ,glib "bin") ; glib-genmarshal, etc.
1563 ("perl" ,perl) ; for the tests
1564 ("python" ,python-2))) ; ditto
1567 ("pciutils" ,pciutils)
1568 ("usbutils" ,usbutils)
1569 ("util-linux" ,util-linux)
1571 ("gobject-introspection" ,gobject-introspection)))
1573 `(#:configure-flags (list "--enable-libkmod"
1576 "--with-pci-ids-path="
1577 (assoc-ref %build-inputs "pciutils")
1578 "/share/pci.ids.gz")
1580 "--with-firmware-path=/no/firmware"
1582 ;; Work around undefined reference to
1583 ;; 'mq_getattr' in sc-daemon.c.
1588 ;; The program 'g-ir-scanner' (part of the package
1589 ;; 'gobject-introspection'), to generate .gir files, makes some
1590 ;; library pre-processing. During that phase it looks for the C
1591 ;; compiler as either 'cc' or as defined by the environment variable
1592 ;; 'CC' (with code in 'giscanner/dumper.py').
1594 (setenv "CC" "gcc"))
1596 (home-page "http://www.gentoo.org/proj/en/eudev/")
1597 (synopsis "Userspace device management")
1598 (description "Udev is a daemon which dynamically creates and removes
1599 device nodes from /dev/, handles hotplug events and loads drivers at boot
1606 (version "2.02.109")
1609 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1613 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1614 (modules '((guix build utils)))
1617 (use-modules (guix build utils))
1619 ;; Honor sysconfdir.
1620 (substitute* "make.tmpl.in"
1622 "confdir = @sysconfdir@\n")
1623 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1624 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1625 (build-system gnu-build-system)
1627 `(("pkg-config" ,pkg-config)
1628 ("procps" ,procps))) ;tests use 'pgrep'
1632 '(#:phases (alist-cons-after
1633 'configure 'set-makefile-shell
1635 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1637 (setenv "SHELL" (which "sh"))
1639 ;; Replace /bin/sh with the right file name.
1640 (patch-makefile-SHELL "make.tmpl"))
1643 #:configure-flags (list (string-append "--sysconfdir="
1644 (assoc-ref %outputs "out")
1646 "--enable-udev_sync"
1647 "--enable-udev_rules"
1649 ;; Make sure programs such as 'dmsetup' can
1650 ;; find libdevmapper.so.
1651 (string-append "LDFLAGS=-Wl,-rpath="
1652 (assoc-ref %outputs "out")
1655 ;; The tests use 'mknod', which requires root access.
1657 (home-page "http://sourceware.org/lvm2/")
1658 (synopsis "Logical volume management for Linux")
1660 "LVM2 is the logical volume management tool set for Linux-based systems.
1661 This package includes the user-space libraries and tools, including the device
1662 mapper. Kernel components are part of Linux-libre.")
1664 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1665 ;; Command-line tools are GPLv2.
1666 (license (list gpl2 lgpl2.1))))
1668 (define-public wireless-tools
1670 (name "wireless-tools")
1674 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1678 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
1679 (modules '((guix build utils)))
1681 ;; Install the manual pages in the right place.
1682 '(substitute* "Makefile"
1683 (("INSTALL_MAN= .*")
1684 "INSTALL_MAN= $(PREFIX)/share/man")))))
1685 (build-system gnu-build-system)
1687 `(#:phases (alist-replace
1689 (lambda* (#:key outputs #:allow-other-keys)
1690 (setenv "PREFIX" (assoc-ref outputs "out")))
1693 (synopsis "Tools for manipulating Linux Wireless Extensions")
1694 (description "Wireless Tools are used to manipulate the now-deprecated
1695 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1696 Extension was an interface allowing you to set Wireless LAN specific
1697 parameters and get the specific stats. It is deprecated in favor the nl80211
1699 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1702 (define-public lm-sensors
1709 "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-"
1710 version ".tar.bz2"))
1713 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1714 (patches (list (search-patch "lm-sensors-hwmon-attrs.patch")))))
1715 (build-system gnu-build-system)
1716 (inputs `(("rrdtool" ,rrdtool)
1719 ("gnuplot" ,gnuplot)))
1720 (native-inputs `(("pkg-config" ,pkg-config)
1725 `(#:tests? #f ; no 'check' target
1726 #:make-flags (list (string-append "PREFIX=" %output)
1727 (string-append "ETCDIR=" %output "/etc")
1728 (string-append "MANDIR=" %output "/share/man"))
1733 'build 'patch-exec-paths
1734 (lambda* (#:key inputs outputs #:allow-other-keys)
1735 (substitute* "prog/detect/sensors-detect"
1737 (string-append "`" (assoc-ref inputs "coreutils")
1739 (("(`|\")modprobe" all open-quote)
1740 (string-append open-quote
1741 (assoc-ref inputs "kmod")
1743 (substitute* '("prog/pwm/pwmconfig"
1744 "prog/pwm/fancontrol")
1746 (string-append (assoc-ref inputs "gnuplot")
1749 (string-append (assoc-ref inputs "coreutils")
1752 (string-append (assoc-ref inputs "grep")
1755 (string-append (assoc-ref inputs "sed")
1758 (string-append (assoc-ref inputs "coreutils")
1761 (string-append (assoc-ref inputs "coreutils")
1764 (string-append (assoc-ref inputs "coreutils")
1765 "/bin/readlink -f"))))
1766 %standard-phases))))
1767 (home-page "http://www.lm-sensors.org/")
1768 (synopsis "Utilities to read temperature/voltage/fan sensors")
1770 "Lm-sensors is a hardware health monitoring package for Linux. It allows
1771 you to access information from temperature, voltage, and fan speed sensors.
1772 It works with most newer systems.")
1775 (define-public i2c-tools
1782 "http://dl.lm-sensors.org/i2c-tools/releases/i2c-tools-"
1783 version ".tar.bz2"))
1786 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
1787 (build-system gnu-build-system)
1789 `(#:tests? #f ; no 'check' target
1790 #:make-flags (list (string-append "prefix=" %output)
1792 ;; no configure script
1793 #:phases (alist-delete 'configure %standard-phases)))
1796 (home-page "http://www.lm-sensors.org/wiki/I2CTools")
1797 (synopsis "I2C tools for Linux")
1799 "The i2c-tools package contains a heterogeneous set of I2C tools for
1800 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
1801 EEPROM decoding scripts, EEPROM programming tools, and a python module for
1805 (define-public xsensors
1812 "http://www.linuxhardware.org/xsensors/xsensors-"
1816 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1817 (build-system gnu-build-system)
1818 (inputs `(("lm-sensors" ,lm-sensors)
1820 (native-inputs `(("pkg-config" ,pkg-config)))
1822 `(#:phases (alist-cons-before
1823 'configure 'enable-deprecated
1825 (substitute* "src/Makefile.in"
1826 (("-DGDK_DISABLE_DEPRECATED") "")
1827 (("-DGTK_DISABLE_DEPRECATED") "")))
1829 'configure 'remove-Werror
1831 (substitute* '("configure" "src/Makefile.in")
1833 %standard-phases))))
1834 (home-page "http://www.linuxhardware.org/xsensors/")
1835 (synopsis "Hardware health information viewer")
1837 "Xsensors reads data from the libsensors library regarding hardware
1838 health such as temperature, voltage and fan speed and displays the information
1839 in a digital read-out.")
1845 (version (package-version linux-libre))
1846 (source (package-source linux-libre))
1847 (build-system gnu-build-system)
1849 '(#:phases (alist-replace
1851 (lambda* (#:key inputs #:allow-other-keys)
1852 (setenv "SHELL_PATH" (which "bash"))
1853 (chdir "tools/perf"))
1855 #:make-flags (list (string-append "DESTDIR="
1856 (assoc-ref %outputs "out"))
1859 ;; By default, 'config/Makefile' uses lib64 on
1860 ;; x86_64. Work around that.
1862 #:tests? #f)) ;no tests
1864 `(("pkg-config" ,pkg-config)
1868 ;; There are build scripts written in these languages.
1870 ("python" ,python-2)))
1872 `(("slang" ,slang) ;for the interactive TUI
1874 ("python" ,python-2) ;'perf' links against libpython
1875 ("elfutils" ,elfutils)
1878 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
1879 ("libxslt" ,libxslt)
1880 ("docbook-xml" ,docbook-xml)
1881 ("docbook-xsl" ,docbook-xsl)
1883 ("asciidoc" ,asciidoc)))
1884 (home-page "https://perf.wiki.kernel.org/")
1885 (synopsis "Linux profiling with performance counters")
1887 "perf is a tool suite for profiling using hardware performance counters,
1888 with support in the Linux kernel. perf can instrument CPU performance
1889 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
1890 of lightweight profiling. This package contains the user-land tools and in
1891 particular the 'perf' command.")
1892 (license (package-license linux-libre))))
1894 (define-public pflask
1900 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
1902 (file-name (string-append name "-" version ".tar.gz"))
1905 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
1906 (build-system cmake-build-system)
1908 '(#:tests? #f)) ; no tests
1909 (home-page "http://ghedo.github.io/pflask/")
1910 (synopsis "Simple tool for creating Linux namespace containers")
1911 (description "pflask is a simple tool for creating Linux namespace
1912 containers. It can be used for running a command or even booting an OS inside
1913 an isolated container, created with the help of Linux namespaces. It is
1914 similar in functionality to chroot, although pflask provides better isolation
1915 thanks to the use of namespaces.")
1918 (define-public hdparm
1924 (uri (string-append "mirror://sourceforge/" name "/"
1925 name "-" version ".tar.gz"))
1928 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
1929 (build-system gnu-build-system)
1931 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
1932 (list (string-append "binprefix=" out)
1933 (string-append "manprefix=" out)
1935 #:phases (alist-delete 'configure %standard-phases)
1936 #:tests? #f)) ; no test suite
1937 (home-page "http://sourceforge.net/projects/hdparm/")
1938 (synopsis "tune hard disk parameters for high performance")
1940 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
1941 is for enabling irq-unmasking and IDE multiplemode.")
1942 (license (non-copyleft "file://LICENSE.TXT"))))
1944 (define-public acpid
1950 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
1954 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
1955 (build-system gnu-build-system)
1956 (home-page "http://sourceforge.net/projects/acpid2/")
1957 (synopsis "Daemon for delivering ACPI events to user-space programs")
1959 "acpid is designed to notify user-space programs of Advanced
1960 Configuration and Power Interface (ACPI) events. acpid should be started
1961 during the system boot, and will run as a background process. When an ACPI
1962 event is received from the kernel, acpid will examine the list of rules
1963 specified in /etc/acpi/events and execute the rules that match the event.")
1966 (define-public sysfsutils
1975 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
1978 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
1979 (build-system gnu-build-system)
1980 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
1981 (synopsis "System utilities based on Linux sysfs")
1983 "These are a set of utilites built upon sysfs, a virtual filesystem in
1984 Linux kernel versions 2.5+ that exposes a system's device tree. The package
1985 also contains the libsysfs library.")
1986 ;; The library is under lgpl2.1+ (all files say "or any later version").
1987 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
1988 (license (list gpl2 gpl2+ lgpl2.1+))))
1990 (define-public sysfsutils-1
1992 (inherit sysfsutils)
1999 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2000 "/sysfsutils-" version ".tar.gz"))
2002 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2003 (modules '((guix build utils)))
2006 (substitute* "Makefile.in"
2007 (("includedir = /usr/include/sysfs")
2008 "includedir = @includedir@"))
2009 (substitute* "configure"
2010 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2011 (string-append "includedir='" orig "/sysfs'")))))))
2012 ;; XXX sysfsutils-1.3.0's config.guess fails on mips64el
2013 (arguments `(#:configure-flags
2014 '(,@(if (%current-target-system)
2017 (nix-system->gnu-triplet (%current-system))))
2018 (list (string-append "--build=" triplet)))))))
2019 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2021 (define-public cpufrequtils
2023 (name "cpufrequtils")
2030 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2033 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2034 (patches (list (search-patch "cpufrequtils-fix-aclocal.patch")))))
2035 (build-system gnu-build-system)
2037 `(("sysfsutils" ,sysfsutils-1)))
2039 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2040 (assoc-ref %outputs "out") "/lib"))))
2041 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2042 (synopsis "Utilities to get and set CPU frequency on Linux")
2044 "The cpufrequtils suite contains utilities to retreive CPU frequency
2045 information, and set the CPU frequency if supported, using the cpufreq
2046 capabilities of the Linux kernel.")
2049 (define-public libraw1394
2056 "mirror://kernel.org/linux/libs/ieee1394/"
2057 name "-" version ".tar.xz"))
2060 "0kwnf4ha45c04mhc4yla672aqmvqqihxix1gvblns5cd2pc2cc8b"))))
2061 (build-system gnu-build-system)
2062 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2063 (synopsis "Interface library for the Linux IEEE1394 drivers")
2065 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2066 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2067 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2068 send to and receive from other nodes without requiring a kernel driver for the
2069 protocol in question.")
2070 (license lgpl2.1+)))
2072 (define-public libavc1394
2078 (uri (string-append "mirror://sourceforge/libavc1394/"
2079 name "-" version ".tar.gz"))
2082 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2083 (build-system gnu-build-system)
2085 `(("pkg-config" ,pkg-config)))
2087 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2088 (home-page "http://sourceforge.net/projects/libavc1394/")
2089 (synopsis "AV/C protocol library for IEEE 1394")
2091 "Libavc1394 is a programming interface to the AV/C specification from
2092 the 1394 Trade Assocation. AV/C stands for Audio/Video Control.")
2093 (license lgpl2.1+)))
2095 (define-public libiec61883
2097 (name "libiec61883")
2102 "mirror://kernel.org/linux/libs/ieee1394/"
2103 name "-" version ".tar.xz"))
2106 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2107 (build-system gnu-build-system)
2109 `(("pkg-config" ,pkg-config)))
2111 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2112 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2113 (synopsis "Isochronous streaming media library for IEEE 1394")
2115 "The libiec61883 library provides a higher level API for streaming DV,
2116 MPEG-2 and audio over Linux IEEE 1394.")
2117 (license lgpl2.1+)))
2119 (define-public mdadm
2126 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2130 "132vdvh3myjgcjn6i9w90ck16ddjxjcszklzkyvr4f5ifqd7wfhg"))))
2131 (build-system gnu-build-system)
2135 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2136 (list "INSTALL=install"
2138 ;; TODO: tell it where to find 'sendmail'
2139 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2140 (string-append "BINDIR=" out "/sbin")
2141 (string-append "MANDIR=" out "/share/man")
2142 (string-append "UDEVDIR=" out "/lib/udev")))
2143 #:phases (alist-cons-before
2144 'build 'patch-program-paths
2145 (lambda* (#:key inputs #:allow-other-keys)
2146 (let ((coreutils (assoc-ref inputs "coreutils")))
2147 (substitute* "udev-md-raid-arrays.rules"
2148 (("/usr/bin/(readlink|basename)" all program)
2149 (string-append coreutils "/bin/" program)))))
2150 (alist-delete 'configure %standard-phases))
2151 ;;tests must be done as root
2153 (home-page "http://neil.brown.name/blog/mdadm")
2154 (synopsis "Tool for managing Linux Software RAID arrays")
2156 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2157 assemble, report on, and monitor arrays. It can also move spares between raid
2158 arrays when needed.")
2161 (define-public libaio
2168 (string-append "mirror://debian/pool/main/liba/libaio/"
2169 name "_" version ".orig.tar.gz")
2170 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2171 name "-" version ".tar.gz")))
2174 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2175 (build-system gnu-build-system)
2178 (list "CC=gcc" (string-append "prefix=" %output))
2179 #:test-target "partcheck" ; need root for a full 'check'
2181 (alist-delete 'configure %standard-phases))) ; no configure script
2182 (home-page "http://lse.sourceforge.net/io/aio.html")
2183 (synopsis "Linux-native asynchronous I/O access library")
2185 "This library enables userspace to use Linux kernel asynchronous I/O
2186 system calls, important for the performance of databases and other advanced
2188 (license lgpl2.1+)))
2190 (define-public bluez
2197 "https://www.kernel.org/pub/linux/bluetooth/bluez-"
2201 "0b1qbnq1xzcdw5rajg9yyg31bf21jnff0n6gnf1snz89bbdllfhy"))))
2202 (build-system gnu-build-system)
2205 (let ((out (assoc-ref %outputs "out")))
2206 (list "--disable-systemd"
2207 ;; Install dbus/udev files to the correct location.
2208 (string-append "--with-dbusconfdir=" out "/etc")
2209 (string-append "--with-udevdir=" out "/lib/udev")))))
2211 `(("pkg-config" ,pkg-config)
2212 ("gettext" ,gnu-gettext)))
2217 ("libical" ,libical)
2218 ("readline" ,readline)))
2219 (home-page "http://www.bluez.org/")
2220 (synopsis "Linux Bluetooth protocol stack")
2222 "BlueZ provides support for the core Bluetooth layers and protocols. It
2223 is flexible, efficient and uses a modular implementation.")