1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015 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)
112 (mkdir (string-append out "/include/config"))
113 (call-with-output-file
115 "/include/config/kernel.release")
117 (format p "~a-default~%" ,version)))
119 ;; Remove the '.install' and '..install.cmd' files; the
120 ;; latter contains store paths, which pulls in bootstrap
121 ;; binaries in the build environment, and prevents bit
122 ;; reproducibility for the bootstrap binaries.
123 (for-each delete-file (find-files out "\\.install"))
127 (name "linux-libre-headers")
131 (uri (linux-libre-urls version))
134 "1blxr2bsvfqi9khj4cpspv434bmx252zak2wsbi2mgl60zh77gza"))))
135 (build-system gnu-build-system)
136 (native-inputs `(("perl" ,perl)))
138 `(#:modules ((guix build gnu-build-system)
141 #:phases (alist-replace
142 'build ,(build-phase (or (%current-target-system)
145 'install ,install-phase
146 (alist-delete 'configure %standard-phases)))
147 #:allowed-references ()
149 (synopsis "GNU Linux-Libre kernel headers")
150 (description "Headers of the Linux-Libre kernel.")
152 (home-page "http://www.gnu.org/software/linux-libre/"))))
154 (define-public module-init-tools
156 (name "module-init-tools")
161 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
165 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
167 (list (search-patch "module-init-tools-moduledir.patch")))))
168 (build-system gnu-build-system)
170 ;; FIXME: The upstream tarball lacks man pages, and building them would
171 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
172 ;; but they vanished. In the meantime, fake it.
173 '(#:phases (alist-cons-before
174 'configure 'fake-docbook
176 (substitute* "Makefile.in"
177 (("^DOCBOOKTOMAN.*$")
178 "DOCBOOKTOMAN = true\n")))
180 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
181 (synopsis "Tools for loading and managing Linux kernel modules")
183 "Tools for loading and managing Linux kernel modules, such as `modprobe',
184 `insmod', `lsmod', and more.")
187 (define %boot-logo-patch
188 ;; Linux-Libre boot logo featuring Freedo and a gnu.
191 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
192 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
195 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
197 (define (kernel-config system)
198 "Return the absolute file name of the Linux-Libre build configuration file
199 for SYSTEM, or #f if there is no configuration for SYSTEM."
200 (define (lookup file)
201 (let ((file (string-append "gnu/packages/" file)))
202 (search-path %load-path file)))
206 (lookup "linux-libre-i686.conf"))
208 (lookup "linux-libre-x86_64.conf"))
212 (define-public linux-libre
213 (let* ((version "4.1.1")
215 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
216 ;; Apply the neat patch.
217 (system* "patch" "-p1" "--force"
218 "-i" (assoc-ref inputs "patch/freedo+gnu"))
220 (let ((arch (car (string-split system #\-))))
222 (cond ((string=? arch "i686") "i386")
224 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
226 (let ((build (assoc-ref %standard-phases 'build))
227 (config (assoc-ref inputs "kconfig")))
229 ;; Use the architecture-specific config if available, and
230 ;; 'defconfig' otherwise.
233 (copy-file config ".config")
234 (chmod ".config" #o666))
235 (system* "make" "defconfig"))
237 ;; Appending works even when the option wasn't in the
238 ;; file. The last one prevails if duplicated.
239 (let ((port (open-file ".config" "a")))
240 (display (string-append "CONFIG_NET_9P=m\n"
241 "CONFIG_NET_9P_VIRTIO=m\n"
242 "CONFIG_VIRTIO_BLK=m\n"
243 "CONFIG_VIRTIO_NET=m\n"
244 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
245 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
246 "CONFIG_VIRTIO_PCI=m\n"
247 "CONFIG_VIRTIO_BALLOON=m\n"
248 "CONFIG_VIRTIO_MMIO=m\n"
255 (zero? (system* "make" "oldconfig"))
257 ;; Call the default `build' phase so `-j' is correctly
259 (apply build #:make-flags "all" args))))
261 `(lambda* (#:key inputs outputs #:allow-other-keys)
262 (let* ((out (assoc-ref outputs "out"))
263 (moddir (string-append out "/lib/modules"))
264 (mit (assoc-ref inputs "module-init-tools")))
266 (for-each (lambda (file)
268 (string-append out "/" (basename file))))
269 (find-files "." "^(bzImage|System\\.map)$"))
270 (copy-file ".config" (string-append out "/config"))
271 (zero? (system* "make"
272 (string-append "DEPMOD=" mit "/sbin/depmod")
273 (string-append "MODULE_DIR=" moddir)
274 (string-append "INSTALL_PATH=" out)
275 (string-append "INSTALL_MOD_PATH=" out)
276 "INSTALL_MOD_STRIP=1"
277 "modules_install"))))))
283 (uri (linux-libre-urls version))
286 "12fdrawzjqhlmjvw79iy9419pf7m3k29xcjri57i4ynaf3yfzkk0"))))
287 (build-system gnu-build-system)
288 (native-inputs `(("perl" ,perl)
290 ("module-init-tools" ,module-init-tools)
291 ("patch/freedo+gnu" ,%boot-logo-patch)
293 ,@(let ((conf (kernel-config (or (%current-target-system)
294 (%current-system)))))
299 `(#:modules ((guix build gnu-build-system)
303 #:phases (alist-replace
306 'install ,install-phase
307 (alist-delete 'configure %standard-phases)))
309 (synopsis "100% free redistribution of a cleaned Linux kernel")
311 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
312 It has been modified to remove all non-free binary blobs.")
314 (home-page "http://www.gnu.org/software/linux-libre/"))))
318 ;;; Pluggable authentication modules (PAM).
321 (define-public linux-pam
328 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
330 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
331 version ".tar.bz2")))
334 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
335 (build-system gnu-build-system)
339 ;; TODO: optional dependencies
340 ;; ("libxcrypt" ,libxcrypt)
341 ;; ("cracklib" ,cracklib)
344 '(;; Most users, such as `shadow', expect the headers to be under
346 #:configure-flags (list (string-append "--includedir="
347 (assoc-ref %outputs "out")
348 "/include/security"))
350 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
353 (home-page "http://www.linux-pam.org/")
354 (synopsis "Pluggable authentication modules for Linux")
356 "A *Free* project to implement OSF's RFC 86.0.
357 Pluggable authentication modules are small shared object files that can
358 be used through the PAM API to perform tasks, like authenticating a user
359 at login. Local and dynamic reconfiguration are its key features")
367 (define-public psmisc
374 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
378 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
379 (build-system gnu-build-system)
380 (inputs `(("ncurses" ,ncurses)))
381 (home-page "http://psmisc.sourceforge.net/")
383 "Small utilities that use the proc filesystem")
385 "This PSmisc package is a set of some small useful utilities that
386 use the proc filesystem. We're not about changing the world, but
387 providing the system administrator with some help in common tasks.")
390 (define-public util-linux
396 (uri (string-append "mirror://kernel.org/linux/utils/"
397 name "/v" (version-major+minor version) "/"
398 name "-" version ".tar.xz"))
401 "1miwwdq1zwvhf0smrxx3fjddq3mz22s8rc5cw54s7x3kbdqpyig0"))
402 (patches (list (search-patch "util-linux-tests.patch")))
403 (modules '((guix build utils)))
405 ;; We take the 'logger' program from GNU Inetutils and 'kill'
406 ;; from GNU Coreutils.
407 '(substitute* "configure"
408 (("build_logger=yes") "build_logger=no")
409 (("build_kill=yes") "build_kill=no")))))
410 (build-system gnu-build-system)
412 `(#:configure-flags (list "--disable-use-tty-group"
415 ;; Install completions where our
416 ;; bash-completion package expects them.
417 (string-append "--with-bashcompletiondir="
418 (assoc-ref %outputs "out")
419 "/etc/bash_completion.d"))
420 #:phases (alist-cons-before
422 (lambda* (#:key inputs outputs #:allow-other-keys)
423 (let ((out (assoc-ref outputs "out"))
424 (net (assoc-ref inputs "net-base")))
425 ;; Change the test to refer to the right file.
426 (substitute* "tests/ts/misc/mcookie"
428 (string-append net "/etc/services")))
431 (inputs `(("zlib" ,zlib)
432 ("ncurses" ,ncurses)))
435 ("net-base" ,net-base))) ;for tests
436 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
437 (synopsis "Collection of utilities for the Linux kernel")
439 "Util-linux is a random collection of utilities for the Linux kernel.")
441 ;; Note that util-linux doesn't use the same license for all the
442 ;; code. GPLv2+ is the default license for a code without an
443 ;; explicitly defined license.
444 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
445 bsd-4 public-domain))))
447 (define-public procps
453 ;; A mirror://sourceforge URI doesn't work, presumably becuase
454 ;; the SourceForge project is misconfigured.
455 (uri (string-append "http://procps.sourceforge.net/procps-"
459 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
460 (patches (list (search-patch "procps-make-3.82.patch")))))
461 (build-system gnu-build-system)
462 (inputs `(("ncurses" ,ncurses)))
464 '(#:modules ((guix build utils)
465 (guix build gnu-build-system)
468 #:phases (alist-replace
470 (lambda* (#:key outputs #:allow-other-keys)
471 ;; No `configure', just a single Makefile.
472 (let ((out (assoc-ref outputs "out")))
473 (substitute* "Makefile"
475 (("--(owner|group) 0") "")
476 (("ldconfig") "true")
477 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
478 ;; Add libproc to the RPATH.
479 (string-append "LDFLAGS := -Wl,-rpath="
484 (lambda* (#:key outputs #:allow-other-keys)
485 (let ((out (assoc-ref outputs "out")))
487 (system* "make" "install"
488 (string-append "DESTDIR=" out)))
490 ;; Remove commands and man pages redundant with
492 (let ((dup (append-map (cut find-files out <>)
493 '("^kill" "^uptime"))))
494 (for-each delete-file dup)
499 (system* (string-append out "/bin/ps")
503 ;; What did you expect? Tests?
505 (home-page "http://procps.sourceforge.net/")
506 (synopsis "Utilities that give information about processes")
508 "Procps is the package that has a bunch of small useful utilities
509 that give information about processes using the Linux /proc file system.
510 The package includes the programs ps, top, vmstat, w, kill, free,
511 slabtop, and skill.")
514 (define-public usbutils
521 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
522 "usbutils-" version ".tar.xz"))
525 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
526 (build-system gnu-build-system)
528 `(("libusb" ,libusb)))
530 `(("pkg-config" ,pkg-config)))
531 (home-page "http://www.linux-usb.org/")
533 "Tools for working with USB devices, such as lsusb")
535 "Tools for working with USB devices, such as lsusb.")
538 (define-public e2fsprogs
544 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
548 "0v0qcfyls0dlrjy8gx9m3s2wbkp5z3lbsr5hb7x8kp8f3bclcy71"))
549 (modules '((guix build utils)))
551 '(substitute* "MCONFIG.in"
552 (("INSTALL_SYMLINK = /bin/sh")
553 "INSTALL_SYMLINK = sh")))))
554 (build-system gnu-build-system)
555 (inputs `(("util-linux" ,util-linux)))
556 (native-inputs `(("pkg-config" ,pkg-config)
557 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
559 '(;; util-linux is not the preferred source for some of the libraries and
560 ;; commands, so disable them (see, e.g.,
561 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b336339909c90559b7db40b455f172>.)
562 #:configure-flags '("--disable-libblkid"
563 "--disable-libuuid" "--disable-uuidd"
566 ;; Install libext2fs et al.
567 "--enable-elf-shlibs")
569 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
570 (assoc-ref %outputs "out")
573 #:phases (alist-cons-before
574 'configure 'patch-shells
576 (substitute* "configure"
577 (("/bin/sh (.*)parse-types.sh" _ dir)
578 (string-append (which "sh") " " dir
580 (substitute* (find-files "." "^Makefile.in$")
582 (string-append "#!" (which "sh")))))
584 'install 'install-libs
585 (lambda* (#:key outputs #:allow-other-keys)
586 (let* ((out (assoc-ref outputs "out"))
587 (lib (string-append out "/lib")))
588 (and (zero? (system* "make" "install-libs"))
590 ;; Make the .a writable so that 'strip' works.
591 ;; Failing to do that, due to debug symbols, we
592 ;; retain a reference to the final
593 ;; linux-libre-headers, which refer to the
594 ;; bootstrap binaries.
595 (let ((archives (find-files lib "\\.a$")))
596 (for-each (lambda (file)
602 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
603 ;; they fail because we get an extra line that says "Can't check if
604 ;; filesystem is mounted due to missing mtab file".
606 (home-page "http://e2fsprogs.sourceforge.net/")
607 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
609 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
610 (license (list gpl2 ; programs
614 (define e2fsprogs/static
616 (package (inherit e2fsprogs)
618 ;; Do not build shared libraries.
619 (substitute-keyword-arguments (package-arguments e2fsprogs)
620 ((#:configure-flags _)
621 '(list "--disable-blkid"))
625 (define-public e2fsck/static
627 (name "e2fsck-static")
628 (version (package-version e2fsprogs))
629 (build-system trivial-build-system)
632 `(#:modules ((guix build utils))
635 (use-modules (guix build utils)
639 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
641 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
643 (with-directory-excursion bin
644 (for-each (lambda (file)
645 (copy-file (string-append source "/" file)
647 (remove-store-references file)
649 (scandir source (cut string-prefix? "fsck." <>))))))))
650 (inputs `(("e2fsprogs" ,e2fsprogs/static)))
651 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
653 "This package provides statically-linked command of fsck.ext[234] taken
654 from the e2fsprogs package. It is meant to be used in initrds.")
655 (home-page (package-home-page e2fsprogs))
656 (license (package-license e2fsprogs))))
658 (define-public zerofree
662 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
665 (uri (string-append home-page name "-" version
669 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
670 (build-system gnu-build-system)
672 '(#:phases (alist-replace
674 (lambda* (#:key outputs #:allow-other-keys)
675 (let* ((out (assoc-ref outputs "out"))
676 (bin (string-append out "/bin")))
678 (copy-file "zerofree"
679 (string-append bin "/zerofree"))
680 (chmod (string-append bin "/zerofree")
683 (alist-delete 'configure %standard-phases))
684 #:tests? #f)) ;no tests
685 (inputs `(("libext2fs" ,e2fsprogs)))
686 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
688 "The zerofree command scans the free blocks in an ext2 file system and
689 fills any non-zero blocks with zeroes. This is a useful way to make disk
690 images more compressible.")
693 (define-public strace
699 (uri (string-append "mirror://sourceforge/strace/strace-"
703 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
704 (build-system gnu-build-system)
705 (native-inputs `(("perl" ,perl)))
706 (home-page "http://strace.sourceforge.net/")
707 (synopsis "System call tracer for Linux")
709 "strace is a system call tracer, i.e. a debugging tool which prints out a
710 trace of all the system calls made by a another process/program.")
713 (define-public ltrace
719 (uri (string-append "http://www.ltrace.org/ltrace_" version
723 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
724 (build-system gnu-build-system)
725 (inputs `(("libelf" ,libelf)))
727 ;; Compilation uses -Werror by default, but it fails.
728 '(#:configure-flags '("--disable-werror")))
729 (home-page "http://www.ltrace.org/")
730 (synopsis "Library call tracer for Linux")
732 "ltrace intercepts and records dynamic library calls which are called by
733 an executed process and the signals received by that process. It can also
734 intercept and print the system calls executed by the program.")
737 (define-public alsa-lib
744 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
748 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
749 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
750 (build-system gnu-build-system)
751 (home-page "http://www.alsa-project.org/")
752 (synopsis "The Advanced Linux Sound Architecture libraries")
754 "The Advanced Linux Sound Architecture (ALSA) provides audio and
755 MIDI functionality to the Linux-based operating system.")
758 (define-public alsa-utils
764 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
768 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
769 (build-system gnu-build-system)
771 ;; XXX: Disable man page creation until we have DocBook.
772 '(#:configure-flags (list "--disable-xmlto"
774 ;; The udev rule is responsible for restoring
776 (string-append "--with-udev-rules-dir="
777 (assoc-ref %outputs "out")
778 "/lib/udev/rules.d"))
779 #:phases (alist-cons-before
780 'install 'pre-install
782 ;; Don't try to mkdir /var/lib/alsa.
783 (substitute* "Makefile"
784 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
788 `(("libsamplerate" ,libsamplerate)
790 ("alsa-lib" ,alsa-lib)
792 ("gettext" ,gnu-gettext)))
793 (home-page "http://www.alsa-project.org/")
794 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
796 "The Advanced Linux Sound Architecture (ALSA) provides audio and
797 MIDI functionality to the Linux-based operating system.")
799 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
803 (define-public iptables
810 "http://www.netfilter.org/projects/iptables/files/iptables-"
814 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
815 (build-system gnu-build-system)
817 '(#:tests? #f ; no test suite
818 #:configure-flags ; add $libdir to the RUNPATH of executables
819 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
820 (home-page "http://www.netfilter.org/projects/iptables/index.html")
821 (synopsis "Program to configure the Linux IP packet filtering rules")
823 "iptables is the userspace command line program used to configure the
824 Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
825 system administrators. Since Network Address Translation is also configured
826 from the packet filter ruleset, iptables is used for this, too. The iptables
827 package also includes ip6tables. ip6tables is used for configuring the IPv6
831 (define-public iproute
838 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
842 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
843 (build-system gnu-build-system)
845 `(#:tests? #f ; no test suite
846 #:make-flags (let ((out (assoc-ref %outputs "out")))
848 (string-append "LIBDIR=" out "/lib")
849 (string-append "SBINDIR=" out "/sbin")
850 (string-append "CONFDIR=" out "/etc")
851 (string-append "DOCDIR=" out "/share/doc/"
853 (string-append "MANDIR=" out "/share/man")))
854 #:phases (alist-cons-before
855 'install 'pre-install
857 ;; Don't attempt to create /var/lib/arpd.
858 (substitute* "Makefile"
859 (("^.*ARPDDIR.*$") "")))
862 `(("iptables" ,iptables)
865 `(("pkg-config" ,pkg-config)
869 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
871 "Utilities for controlling TCP/IP networking and traffic in Linux")
873 "Iproute2 is a collection of utilities for controlling TCP/IP
874 networking and traffic with the Linux kernel.
876 Most network configuration manuals still refer to ifconfig and route as the
877 primary network configuration tools, but ifconfig is known to behave
878 inadequately in modern network environments. They should be deprecated, but
879 most distros still include them. Most network configuration systems make use
880 of ifconfig and thus provide a limited feature set. The /etc/net project aims
881 to support most modern network technologies, as it doesn't use ifconfig and
882 allows a system administrator to make use of all iproute2 features, including
885 iproute2 is usually shipped in a package called iproute or iproute2 and
886 consists of several tools, of which the most important are ip and tc. ip
887 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
888 tools print detailed usage messages and are accompanied by a set of
892 (define-public net-tools
893 ;; XXX: This package is basically unmaintained, but it provides a few
894 ;; commands not yet provided by Inetutils, such as 'route', so we have to
899 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
902 (uri (string-append home-page "/" name "-"
906 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
908 (list (search-patch "net-tools-bitrot.patch")))))
909 (build-system gnu-build-system)
911 '(#:modules ((guix build gnu-build-system)
915 #:phases (alist-cons-after
917 (lambda* (#:key inputs #:allow-other-keys)
918 (define (apply-patch file)
919 (zero? (system* "patch" "-p1" "--force"
922 (let ((patch.gz (assoc-ref inputs "patch")))
923 (format #t "applying Debian patch set '~a'...~%"
925 (system (string-append "gunzip < " patch.gz " > the-patch"))
926 (and (apply-patch "the-patch")
927 (for-each apply-patch
928 (find-files "debian/patches"
932 (lambda* (#:key outputs #:allow-other-keys)
933 (let ((out (assoc-ref outputs "out")))
934 (mkdir-p (string-append out "/bin"))
935 (mkdir-p (string-append out "/sbin"))
937 ;; Pretend we have everything...
938 (system "yes | make config")
940 ;; ... except for the things we don't have.
941 ;; HAVE_AFDECnet requires libdnet, which we don't have.
942 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
943 ;; that have been removed.
944 (substitute* '("config.make" "config.h")
945 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
947 'install 'remove-redundant-commands
948 (lambda* (#:key outputs #:allow-other-keys)
949 ;; Remove commands and man pages redundant with
951 (let* ((out (assoc-ref outputs "out"))
952 (dup (append-map (cut find-files out <>)
954 "^(yp|nis|dns)?domainname"))))
955 (for-each delete-file dup)
959 ;; Binaries that depend on libnet-tools.a don't declare that
960 ;; dependency, making it parallel-unsafe.
963 #:tests? #f ; no test suite
964 #:make-flags (let ((out (assoc-ref %outputs "out")))
966 (string-append "BASEDIR=" out)
967 (string-append "INSTALLNLSDIR=" out "/share/locale")
968 (string-append "mandir=/share/man")))))
970 ;; Use the big Debian patch set (the thing does not even compile out of
972 (inputs `(("patch" ,(origin
975 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
978 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
979 (native-inputs `(("gettext" ,gnu-gettext)))
981 (synopsis "Tools for controlling the network subsystem in Linux")
983 "This package includes the important tools for controlling the network
984 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
985 netstat, rarp and route. Additionally, this package contains utilities
986 relating to particular network hardware types (plipconfig, slattach) and
987 advanced aspects of IP configuration (iptunnel, ipmaddr).")
990 (define-public libcap
997 ;; Tarballs used to be available from
998 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
999 ;; but they never came back after kernel.org was compromised.
1001 "mirror://debian/pool/main/libc/libcap2/libcap2_"
1002 version ".orig.tar.gz"))
1005 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
1006 (build-system gnu-build-system)
1007 (arguments '(#:phases
1008 (modify-phases %standard-phases
1010 ;; Add $libdir to the RUNPATH of executables.
1012 (substitute* "Make.Rules"
1014 (string-append "LDFLAGS := -Wl,-rpath="
1015 %output "/lib"))))))
1016 #:tests? #f ; no 'check' target
1017 #:make-flags (list "lib=lib"
1018 (string-append "prefix="
1019 (assoc-ref %outputs "out"))
1020 "RAISE_SETFCAP=no")))
1021 (native-inputs `(("perl" ,perl)))
1022 (inputs `(("attr" ,attr)))
1023 (home-page "https://sites.google.com/site/fullycapable/")
1024 (synopsis "Library for working with POSIX capabilities")
1026 "Libcap2 provides a programming interface to POSIX capabilities on
1027 Linux-based operating systems.")
1029 ;; License is BSD-3 or GPLv2, at the user's choice.
1032 (define-public bridge-utils
1034 (name "bridge-utils")
1038 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
1042 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1043 (build-system gnu-build-system)
1045 ;; The tarball lacks all the generated files.
1046 (native-inputs `(("autoconf" ,autoconf)
1047 ("automake" ,automake)))
1049 '(#:phases (alist-cons-after
1052 ;; Fix "field ‘ip6’ has incomplete type" errors.
1053 (substitute* "libbridge/libbridge.h"
1054 (("#include <linux/if_bridge.h>")
1055 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1057 ;; Ensure that the entire build fails if one of the
1058 ;; sub-Makefiles fails.
1059 (substitute* "Makefile.in"
1060 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1061 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1063 (zero? (system* "autoreconf" "-vf")))
1065 #:tests? #f)) ; no 'check' target
1068 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1069 (synopsis "Manipulate Ethernet bridges")
1071 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1072 to connect two Ethernet segments together in a protocol independent way.
1073 Packets are forwarded based on Ethernet address, rather than IP address (like
1074 a router). Since forwarding is done at Layer 2, all protocols can go
1075 transparently through a bridge.")
1078 (define-public libnl
1085 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1089 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
1090 (build-system gnu-build-system)
1091 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1092 (home-page "http://www.infradead.org/~tgr/libnl/")
1093 (synopsis "NetLink protocol library suite")
1095 "The libnl suite is a collection of libraries providing APIs to netlink
1096 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
1097 between the kernel and user space processes. It was designed to be a more
1098 flexible successor to ioctl to provide mainly networking related kernel
1099 configuration and monitoring interfaces.")
1101 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1102 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1112 "https://www.kernel.org/pub/software/network/iw/iw-"
1116 "14zsapqhivk0ws5z21y1ys2c2czi05mzk7bl2yb7qxcfrnsjx9j8"))))
1117 (build-system gnu-build-system)
1118 (native-inputs `(("pkg-config" ,pkg-config)))
1119 (inputs `(("libnl" ,libnl)))
1121 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1123 #:phases (alist-delete 'configure %standard-phases)))
1124 (home-page "http://wireless.kernel.org/en/users/Documentation/iw")
1125 (synopsis "Tool for configuring wireless devices")
1127 "iw is a new nl80211 based CLI configuration utility for wireless
1128 devices. It replaces 'iwconfig', which is deprecated.")
1131 (define-public powertop
1139 "https://01.org/powertop/sites/default/files/downloads/powertop-"
1143 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
1144 (build-system gnu-build-system)
1146 ;; TODO: Add pciutils.
1148 ;; ("pciutils" ,pciutils)
1149 ("ncurses" ,ncurses)
1152 `(("pkg-config" ,pkg-config)))
1153 (home-page "https://01.org/powertop/")
1154 (synopsis "Analyze power consumption on Intel-based laptops")
1156 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1157 power management. In addition to being a diagnostic tool, PowerTOP also has
1158 an interactive mode where the user can experiment various power management
1159 settings for cases where the operating system has not enabled these
1163 (define-public aumix
1170 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1171 version ".tar.bz2"))
1174 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1175 (build-system gnu-build-system)
1176 (inputs `(("ncurses" ,ncurses)))
1177 (home-page "http://www.jpj.net/~trevor/aumix.html")
1178 (synopsis "Audio mixer for X and the console")
1180 "Aumix adjusts an audio mixer from X, the console, a terminal,
1181 the command line or a script.")
1184 (define-public iotop
1191 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1194 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1195 (build-system python-build-system)
1197 ;; The setup.py script expects python-2.
1198 `(#:python ,python-2
1199 ;; There are currently no checks in the package.
1201 (native-inputs `(("python" ,python-2)))
1202 (home-page "http://guichaz.free.fr/iotop/")
1204 "Displays the IO activity of running processes")
1206 "Iotop is a Python program with a top like user interface to show the
1207 processes currently causing I/O.")
1216 (uri (string-append "mirror://sourceforge/fuse/fuse-"
1220 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))
1221 (patches (list (search-patch "fuse-CVE-2015-3202.patch")))))
1222 (build-system gnu-build-system)
1223 (inputs `(("util-linux" ,util-linux)))
1225 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1226 (assoc-ref %outputs "out")
1228 (string-append "INIT_D_PATH="
1229 (assoc-ref %outputs "out")
1232 ;; The rule makes /dev/fuse 666.
1233 (string-append "UDEV_RULES_PATH="
1234 (assoc-ref %outputs "out")
1235 "/lib/udev/rules.d"))
1236 #:phases (alist-cons-before
1237 'build 'set-file-names
1238 (lambda* (#:key inputs #:allow-other-keys)
1239 ;; libfuse calls out to mount(8) and umount(8). Make sure
1240 ;; it refers to the right ones.
1241 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1242 (("/bin/(u?)mount" _ maybe-u)
1243 (string-append (assoc-ref inputs "util-linux")
1244 "/bin/" maybe-u "mount")))
1245 (substitute* '("util/mount.fuse.c")
1249 ;; This hack leads libfuse to search for 'fusermount' in
1250 ;; $PATH, where it may find a setuid-root binary, instead of
1251 ;; trying solely $out/sbin/fusermount and failing because
1253 (substitute* "lib/Makefile"
1254 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1255 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1257 (home-page "http://fuse.sourceforge.net/")
1258 (synopsis "Support file systems implemented in user space")
1260 "As a consequence of its monolithic design, file system code for Linux
1261 normally goes into the kernel itself---which is not only a robustness issue,
1262 but also an impediment to system extensibility. FUSE, for \"file systems in
1263 user space\", is a kernel module and user-space library that tries to address
1264 part of this problem by allowing users to run file system implementations as
1265 user-space processes.")
1266 (license (list lgpl2.1 ; library
1267 gpl2+)))) ; command-line utilities
1269 (define-public unionfs-fuse
1271 (name "unionfs-fuse")
1276 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1280 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1281 (build-system cmake-build-system)
1282 (inputs `(("fuse" ,fuse)))
1283 (arguments '(#:tests? #f)) ; no tests
1284 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1285 (synopsis "User-space union file system")
1287 "UnionFS-FUSE is a flexible union file system implementation in user
1288 space, using the FUSE library. Mounting a union file system allows you to
1289 \"aggregate\" the contents of several directories into a single mount point.
1290 UnionFS-FUSE additionally supports copy-on-write.")
1294 (package (inherit fuse)
1295 (name "fuse-static")
1296 (source (origin (inherit (package-source fuse))
1297 (modules '((guix build utils)))
1299 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1300 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1301 ;; it doesn't do that, allowing us to remove the dependency on
1302 ;; util-linux (something that is useful in initrds.)
1303 '(substitute* '("lib/mount_util.c"
1304 "util/mount_util.c")
1305 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1310 (define-public unionfs-fuse/static
1311 (package (inherit unionfs-fuse)
1312 (synopsis "User-space union file system (statically linked)")
1313 (name (string-append (package-name unionfs-fuse) "-static"))
1314 (source (origin (inherit (package-source unionfs-fuse))
1315 (modules '((guix build utils)))
1317 ;; Add -ldl to the libraries, because libfuse.a needs that.
1318 '(substitute* "src/CMakeLists.txt"
1319 (("target_link_libraries(.*)\\)" _ libs)
1320 (string-append "target_link_libraries"
1324 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1325 #:phases (alist-cons-after
1326 'install 'post-install
1327 (lambda* (#:key outputs #:allow-other-keys)
1328 (let* ((out (assoc-ref outputs "out"))
1329 (exe (string-append out "/bin/unionfs")))
1330 ;; By default, 'unionfs' keeps references to
1331 ;; $glibc/share/locale and similar stuff. Remove them.
1332 (remove-store-references exe)))
1334 (inputs `(("fuse" ,fuse-static)))))
1336 (define-public sshfs-fuse
1342 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1346 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1347 (build-system gnu-build-system)
1352 `(("pkg-config" ,pkg-config)))
1353 (home-page "http://fuse.sourceforge.net/sshfs.html")
1354 (synopsis "Mount remote file systems over SSH")
1356 "This is a file system client based on the SSH File Transfer Protocol.
1357 Since most SSH servers already support this protocol it is very easy to set
1358 up: on the server side there's nothing to do; on the client side mounting the
1359 file system is as easy as logging into the server with an SSH client.")
1362 (define-public numactl
1369 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1374 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1375 (build-system gnu-build-system)
1377 '(#:phases (alist-replace
1379 (lambda* (#:key outputs #:allow-other-keys)
1380 ;; There's no 'configure' script, just a raw makefile.
1381 (substitute* "Makefile"
1383 (string-append "prefix := " (assoc-ref outputs "out")
1386 ;; By default the thing tries to install under
1387 ;; $prefix/lib64 when on a 64-bit platform.
1388 (string-append "libdir := $(prefix)/lib\n"))))
1392 ;; By default the thing tries to use 'cc'.
1395 ;; Make sure programs have an RPATH so they can find
1397 (string-append "LDLIBS=-Wl,-rpath="
1398 (assoc-ref %outputs "out") "/lib"))
1400 ;; There's a 'test' target, but it requires NUMA support in the kernel
1401 ;; to run, which we can't assume to have.
1403 (home-page "http://oss.sgi.com/projects/libnuma/")
1404 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1406 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1407 memory is not all in one place. The numactl program allows you to run your
1408 application program on specific CPU's and memory nodes. It does this by
1409 supplying a NUMA memory policy to the operating system before running your
1412 The package contains other commands, such as numademo, numastat and memhog.
1413 The numademo command provides a quick overview of NUMA performance on your
1415 (license (list gpl2 ; programs
1416 lgpl2.1)))) ; library
1424 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1428 "04mrms12nm5sas0nxs94yrr3hz7gmqhnmfgb9ff34bh1jszxmzcx"))
1429 (modules '((guix build utils)))
1432 (substitute* "tests/Makefile.in"
1433 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1436 (substitute* '("src/unicode_start" "src/unicode_stop")
1437 ;; Assume the Coreutils are in $PATH.
1440 (build-system gnu-build-system)
1442 '(#:phases (alist-cons-before
1444 (lambda* (#:key inputs #:allow-other-keys)
1445 (let ((gzip (assoc-ref %build-inputs "gzip"))
1446 (bzip2 (assoc-ref %build-inputs "bzip2")))
1447 (substitute* "src/libkeymap/findfile.c"
1449 (string-append gzip "/bin/gzip"))
1451 (string-append bzip2 "/bin/bzip2")))))
1453 'install 'post-install
1454 (lambda* (#:key outputs #:allow-other-keys)
1455 ;; Make sure these programs find their comrades.
1456 (let* ((out (assoc-ref outputs "out"))
1457 (bin (string-append out "/bin")))
1458 (for-each (lambda (prog)
1459 (wrap-program (string-append bin "/" prog)
1460 `("PATH" ":" prefix (,bin))))
1461 '("unicode_start" "unicode_stop"))))
1462 %standard-phases))))
1463 (inputs `(("check" ,check)
1466 ("pam" ,linux-pam)))
1467 (native-inputs `(("pkg-config" ,pkg-config)))
1468 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1469 (synopsis "Linux keyboard utilities and keyboard maps")
1471 "This package contains keytable files and keyboard utilities compatible
1472 for systems using the Linux kernel. This includes commands such as
1473 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1476 (define-public inotify-tools
1478 (name "inotify-tools")
1483 "mirror://sourceforge/inotify-tools/inotify-tools/"
1484 version "/inotify-tools-" version ".tar.gz"))
1487 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1488 (build-system gnu-build-system)
1489 (home-page "http://inotify-tools.sourceforge.net/")
1490 (synopsis "Monitor file accesses")
1492 "The inotify-tools packages provides a C library and command-line tools
1493 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1503 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1504 "kmod-" version ".tar.xz"))
1507 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1508 (patches (list (search-patch "kmod-module-directory.patch")))))
1509 (build-system gnu-build-system)
1511 `(("pkg-config" ,pkg-config)))
1516 `(#:tests? #f ; FIXME: Investigate test failures
1517 #:configure-flags '("--with-xz" "--with-zlib")
1518 #:phases (alist-cons-after
1519 'install 'install-modprobe&co
1520 (lambda* (#:key outputs #:allow-other-keys)
1521 (let* ((out (assoc-ref outputs "out"))
1522 (bin (string-append out "/bin")))
1523 (for-each (lambda (tool)
1525 (string-append bin "/" tool)))
1526 '("insmod" "rmmod" "lsmod" "modprobe"
1527 "modinfo" "depmod"))))
1529 (home-page "https://www.kernel.org/")
1530 (synopsis "Kernel module tools")
1531 (description "Kmod is a set of tools to handle common tasks with Linux
1532 kernel modules like insert, remove, list, check properties, resolve
1533 dependencies and aliases.
1535 These tools are designed on top of libkmod, a library that is shipped with
1536 kmod. The aim is to be compatible with tools, configurations and indices
1537 from the module-init-tools project.")
1538 (license gpl2+))) ; library under lgpl2.1+
1540 (define-public eudev
1541 ;; The post-systemd fork, maintained by Gentoo.
1548 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1552 "0shf5vqiz9fdxl95aa1a8vh0xjxwim3psc39wr2xr8lnahf11vva"))
1553 (patches (list (search-patch "eudev-rules-directory.patch")))
1554 (modules '((guix build utils)))
1556 ;; 'configure' checks uses <linux/btrfs.h> as an indication of
1557 ;; whether Linux headers are available, but it doesn't actually
1558 ;; use it, and our 'linux-libre-headers' package doesn't
1559 ;; provide it. So just remove that.
1560 '(substitute* "configure"
1561 (("linux/btrfs\\.h")
1563 (build-system gnu-build-system)
1565 `(("pkg-config" ,pkg-config)
1567 ("glib" ,glib "bin") ; glib-genmarshal, etc.
1568 ("perl" ,perl) ; for the tests
1569 ("python" ,python-2))) ; ditto
1572 ("pciutils" ,pciutils)
1573 ("usbutils" ,usbutils)
1574 ("util-linux" ,util-linux)
1576 ("gobject-introspection" ,gobject-introspection)))
1578 `(#:configure-flags (list "--enable-libkmod"
1581 "--with-pci-ids-path="
1582 (assoc-ref %build-inputs "pciutils")
1583 "/share/pci.ids.gz")
1585 "--with-firmware-path=/no/firmware"
1587 ;; Work around undefined reference to
1588 ;; 'mq_getattr' in sc-daemon.c.
1593 ;; The program 'g-ir-scanner' (part of the package
1594 ;; 'gobject-introspection'), to generate .gir files, makes some
1595 ;; library pre-processing. During that phase it looks for the C
1596 ;; compiler as either 'cc' or as defined by the environment variable
1597 ;; 'CC' (with code in 'giscanner/dumper.py').
1599 (setenv "CC" "gcc"))
1601 (home-page "http://www.gentoo.org/proj/en/eudev/")
1602 (synopsis "Userspace device management")
1603 (description "Udev is a daemon which dynamically creates and removes
1604 device nodes from /dev/, handles hotplug events and loads drivers at boot
1611 (version "2.02.109")
1614 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1618 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1619 (modules '((guix build utils)))
1622 (use-modules (guix build utils))
1624 ;; Honor sysconfdir.
1625 (substitute* "make.tmpl.in"
1627 "confdir = @sysconfdir@\n")
1628 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1629 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1630 (build-system gnu-build-system)
1632 `(("pkg-config" ,pkg-config)
1633 ("procps" ,procps))) ;tests use 'pgrep'
1637 '(#:phases (alist-cons-after
1638 'configure 'set-makefile-shell
1640 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1642 (setenv "SHELL" (which "sh"))
1644 ;; Replace /bin/sh with the right file name.
1645 (patch-makefile-SHELL "make.tmpl"))
1648 #:configure-flags (list (string-append "--sysconfdir="
1649 (assoc-ref %outputs "out")
1651 "--enable-udev_sync"
1652 "--enable-udev_rules"
1654 ;; Make sure programs such as 'dmsetup' can
1655 ;; find libdevmapper.so.
1656 (string-append "LDFLAGS=-Wl,-rpath="
1657 (assoc-ref %outputs "out")
1660 ;; The tests use 'mknod', which requires root access.
1662 (home-page "http://sourceware.org/lvm2/")
1663 (synopsis "Logical volume management for Linux")
1665 "LVM2 is the logical volume management tool set for Linux-based systems.
1666 This package includes the user-space libraries and tools, including the device
1667 mapper. Kernel components are part of Linux-libre.")
1669 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1670 ;; Command-line tools are GPLv2.
1671 (license (list gpl2 lgpl2.1))))
1673 (define-public wireless-tools
1675 (name "wireless-tools")
1679 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1683 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
1684 (modules '((guix build utils)))
1686 ;; Install the manual pages in the right place.
1687 '(substitute* "Makefile"
1688 (("INSTALL_MAN= .*")
1689 "INSTALL_MAN= $(PREFIX)/share/man")))))
1690 (build-system gnu-build-system)
1692 `(#:phases (alist-replace
1694 (lambda* (#:key outputs #:allow-other-keys)
1695 (setenv "PREFIX" (assoc-ref outputs "out")))
1698 (synopsis "Tools for manipulating Linux Wireless Extensions")
1699 (description "Wireless Tools are used to manipulate the now-deprecated
1700 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1701 Extension was an interface allowing you to set Wireless LAN specific
1702 parameters and get the specific stats. It is deprecated in favor the nl80211
1704 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1707 (define-public lm-sensors
1714 "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-"
1715 version ".tar.bz2"))
1718 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1719 (patches (list (search-patch "lm-sensors-hwmon-attrs.patch")))))
1720 (build-system gnu-build-system)
1721 (inputs `(("rrdtool" ,rrdtool)
1724 ("gnuplot" ,gnuplot)))
1725 (native-inputs `(("pkg-config" ,pkg-config)
1730 `(#:tests? #f ; no 'check' target
1731 #:make-flags (list (string-append "PREFIX=" %output)
1732 (string-append "ETCDIR=" %output "/etc")
1733 (string-append "MANDIR=" %output "/share/man"))
1738 'build 'patch-exec-paths
1739 (lambda* (#:key inputs outputs #:allow-other-keys)
1740 (substitute* "prog/detect/sensors-detect"
1742 (string-append "`" (assoc-ref inputs "coreutils")
1744 (("(`|\")modprobe" all open-quote)
1745 (string-append open-quote
1746 (assoc-ref inputs "kmod")
1748 (substitute* '("prog/pwm/pwmconfig"
1749 "prog/pwm/fancontrol")
1751 (string-append (assoc-ref inputs "gnuplot")
1754 (string-append (assoc-ref inputs "coreutils")
1757 (string-append (assoc-ref inputs "grep")
1760 (string-append (assoc-ref inputs "sed")
1763 (string-append (assoc-ref inputs "coreutils")
1766 (string-append (assoc-ref inputs "coreutils")
1769 (string-append (assoc-ref inputs "coreutils")
1770 "/bin/readlink -f"))))
1771 %standard-phases))))
1772 (home-page "http://www.lm-sensors.org/")
1773 (synopsis "Utilities to read temperature/voltage/fan sensors")
1775 "Lm-sensors is a hardware health monitoring package for Linux. It allows
1776 you to access information from temperature, voltage, and fan speed sensors.
1777 It works with most newer systems.")
1780 (define-public i2c-tools
1787 "http://dl.lm-sensors.org/i2c-tools/releases/i2c-tools-"
1788 version ".tar.bz2"))
1791 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
1792 (build-system gnu-build-system)
1794 `(#:tests? #f ; no 'check' target
1795 #:make-flags (list (string-append "prefix=" %output)
1797 ;; no configure script
1798 #:phases (alist-delete 'configure %standard-phases)))
1801 (home-page "http://www.lm-sensors.org/wiki/I2CTools")
1802 (synopsis "I2C tools for Linux")
1804 "The i2c-tools package contains a heterogeneous set of I2C tools for
1805 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
1806 EEPROM decoding scripts, EEPROM programming tools, and a python module for
1810 (define-public xsensors
1817 "http://www.linuxhardware.org/xsensors/xsensors-"
1821 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1822 (build-system gnu-build-system)
1823 (inputs `(("lm-sensors" ,lm-sensors)
1825 (native-inputs `(("pkg-config" ,pkg-config)))
1827 `(#:phases (alist-cons-before
1828 'configure 'enable-deprecated
1830 (substitute* "src/Makefile.in"
1831 (("-DGDK_DISABLE_DEPRECATED") "")
1832 (("-DGTK_DISABLE_DEPRECATED") "")))
1834 'configure 'remove-Werror
1836 (substitute* '("configure" "src/Makefile.in")
1838 %standard-phases))))
1839 (home-page "http://www.linuxhardware.org/xsensors/")
1840 (synopsis "Hardware health information viewer")
1842 "Xsensors reads data from the libsensors library regarding hardware
1843 health such as temperature, voltage and fan speed and displays the information
1844 in a digital read-out.")
1850 (version (package-version linux-libre))
1851 (source (package-source linux-libre))
1852 (build-system gnu-build-system)
1854 '(#:phases (alist-replace
1856 (lambda* (#:key inputs #:allow-other-keys)
1857 (setenv "SHELL_PATH" (which "bash"))
1858 (chdir "tools/perf"))
1860 #:make-flags (list (string-append "DESTDIR="
1861 (assoc-ref %outputs "out"))
1864 ;; By default, 'config/Makefile' uses lib64 on
1865 ;; x86_64. Work around that.
1867 #:tests? #f)) ;no tests
1869 `(("pkg-config" ,pkg-config)
1873 ;; There are build scripts written in these languages.
1875 ("python" ,python-2)))
1877 `(("slang" ,slang) ;for the interactive TUI
1879 ("python" ,python-2) ;'perf' links against libpython
1880 ("elfutils" ,elfutils)
1883 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
1884 ("libxslt" ,libxslt)
1885 ("docbook-xml" ,docbook-xml)
1886 ("docbook-xsl" ,docbook-xsl)
1888 ("asciidoc" ,asciidoc)))
1889 (home-page "https://perf.wiki.kernel.org/")
1890 (synopsis "Linux profiling with performance counters")
1892 "perf is a tool suite for profiling using hardware performance counters,
1893 with support in the Linux kernel. perf can instrument CPU performance
1894 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
1895 of lightweight profiling. This package contains the user-land tools and in
1896 particular the 'perf' command.")
1897 (license (package-license linux-libre))))
1899 (define-public pflask
1905 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
1907 (file-name (string-append name "-" version ".tar.gz"))
1910 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
1911 (build-system cmake-build-system)
1913 '(#:tests? #f)) ; no tests
1914 (home-page "http://ghedo.github.io/pflask/")
1915 (synopsis "Simple tool for creating Linux namespace containers")
1916 (description "pflask is a simple tool for creating Linux namespace
1917 containers. It can be used for running a command or even booting an OS inside
1918 an isolated container, created with the help of Linux namespaces. It is
1919 similar in functionality to chroot, although pflask provides better isolation
1920 thanks to the use of namespaces.")
1923 (define-public hdparm
1929 (uri (string-append "mirror://sourceforge/" name "/"
1930 name "-" version ".tar.gz"))
1933 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
1934 (build-system gnu-build-system)
1936 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
1937 (list (string-append "binprefix=" out)
1938 (string-append "manprefix=" out)
1940 #:phases (alist-delete 'configure %standard-phases)
1941 #:tests? #f)) ; no test suite
1942 (home-page "http://sourceforge.net/projects/hdparm/")
1943 (synopsis "tune hard disk parameters for high performance")
1945 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
1946 is for enabling irq-unmasking and IDE multiplemode.")
1947 (license (non-copyleft "file://LICENSE.TXT"))))
1949 (define-public acpid
1955 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
1959 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
1960 (build-system gnu-build-system)
1961 (home-page "http://sourceforge.net/projects/acpid2/")
1962 (synopsis "Daemon for delivering ACPI events to user-space programs")
1964 "acpid is designed to notify user-space programs of Advanced
1965 Configuration and Power Interface (ACPI) events. acpid should be started
1966 during the system boot, and will run as a background process. When an ACPI
1967 event is received from the kernel, acpid will examine the list of rules
1968 specified in /etc/acpi/events and execute the rules that match the event.")
1971 (define-public sysfsutils
1980 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
1983 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
1984 (build-system gnu-build-system)
1985 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
1986 (synopsis "System utilities based on Linux sysfs")
1988 "These are a set of utilites built upon sysfs, a virtual filesystem in
1989 Linux kernel versions 2.5+ that exposes a system's device tree. The package
1990 also contains the libsysfs library.")
1991 ;; The library is under lgpl2.1+ (all files say "or any later version").
1992 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
1993 (license (list gpl2 gpl2+ lgpl2.1+))))
1995 (define-public sysfsutils-1
1997 (inherit sysfsutils)
2004 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2005 "/sysfsutils-" version ".tar.gz"))
2007 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2008 (modules '((guix build utils)))
2011 (substitute* "Makefile.in"
2012 (("includedir = /usr/include/sysfs")
2013 "includedir = @includedir@"))
2014 (substitute* "configure"
2015 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2016 (string-append "includedir='" orig "/sysfs'")))))))
2017 ;; XXX sysfsutils-1.3.0's config.guess fails on mips64el
2018 (arguments `(#:configure-flags
2019 '(,@(if (%current-target-system)
2022 (nix-system->gnu-triplet (%current-system))))
2023 (list (string-append "--build=" triplet)))))))
2024 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2026 (define-public cpufrequtils
2028 (name "cpufrequtils")
2035 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2038 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2039 (patches (list (search-patch "cpufrequtils-fix-aclocal.patch")))))
2040 (build-system gnu-build-system)
2042 `(("sysfsutils" ,sysfsutils-1)))
2044 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2045 (assoc-ref %outputs "out") "/lib"))))
2046 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2047 (synopsis "Utilities to get and set CPU frequency on Linux")
2049 "The cpufrequtils suite contains utilities to retreive CPU frequency
2050 information, and set the CPU frequency if supported, using the cpufreq
2051 capabilities of the Linux kernel.")
2054 (define-public libraw1394
2061 "mirror://kernel.org/linux/libs/ieee1394/"
2062 name "-" version ".tar.xz"))
2065 "0kwnf4ha45c04mhc4yla672aqmvqqihxix1gvblns5cd2pc2cc8b"))))
2066 (build-system gnu-build-system)
2067 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2068 (synopsis "Interface library for the Linux IEEE1394 drivers")
2070 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2071 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2072 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2073 send to and receive from other nodes without requiring a kernel driver for the
2074 protocol in question.")
2075 (license lgpl2.1+)))
2077 (define-public libavc1394
2083 (uri (string-append "mirror://sourceforge/libavc1394/"
2084 name "-" version ".tar.gz"))
2087 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2088 (build-system gnu-build-system)
2090 `(("pkg-config" ,pkg-config)))
2092 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2093 (home-page "http://sourceforge.net/projects/libavc1394/")
2094 (synopsis "AV/C protocol library for IEEE 1394")
2096 "Libavc1394 is a programming interface to the AV/C specification from
2097 the 1394 Trade Assocation. AV/C stands for Audio/Video Control.")
2098 (license lgpl2.1+)))
2100 (define-public libiec61883
2102 (name "libiec61883")
2107 "mirror://kernel.org/linux/libs/ieee1394/"
2108 name "-" version ".tar.xz"))
2111 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2112 (build-system gnu-build-system)
2114 `(("pkg-config" ,pkg-config)))
2116 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2117 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2118 (synopsis "Isochronous streaming media library for IEEE 1394")
2120 "The libiec61883 library provides a higher level API for streaming DV,
2121 MPEG-2 and audio over Linux IEEE 1394.")
2122 (license lgpl2.1+)))
2124 (define-public mdadm
2131 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2135 "132vdvh3myjgcjn6i9w90ck16ddjxjcszklzkyvr4f5ifqd7wfhg"))
2136 (patches (list (search-patch "mdadm-gcc-4.9-fix.patch")))))
2137 (build-system gnu-build-system)
2141 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2142 (list "INSTALL=install"
2144 ;; TODO: tell it where to find 'sendmail'
2145 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2146 (string-append "BINDIR=" out "/sbin")
2147 (string-append "MANDIR=" out "/share/man")
2148 (string-append "UDEVDIR=" out "/lib/udev")))
2149 #:phases (alist-cons-before
2150 'build 'patch-program-paths
2151 (lambda* (#:key inputs #:allow-other-keys)
2152 (let ((coreutils (assoc-ref inputs "coreutils")))
2153 (substitute* "udev-md-raid-arrays.rules"
2154 (("/usr/bin/(readlink|basename)" all program)
2155 (string-append coreutils "/bin/" program)))))
2156 (alist-delete 'configure %standard-phases))
2157 ;;tests must be done as root
2159 (home-page "http://neil.brown.name/blog/mdadm")
2160 (synopsis "Tool for managing Linux Software RAID arrays")
2162 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2163 assemble, report on, and monitor arrays. It can also move spares between raid
2164 arrays when needed.")
2167 (define-public libaio
2174 (string-append "mirror://debian/pool/main/liba/libaio/"
2175 name "_" version ".orig.tar.gz")
2176 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2177 name "-" version ".tar.gz")))
2180 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2181 (build-system gnu-build-system)
2184 (list "CC=gcc" (string-append "prefix=" %output))
2185 #:test-target "partcheck" ; need root for a full 'check'
2187 (alist-delete 'configure %standard-phases))) ; no configure script
2188 (home-page "http://lse.sourceforge.net/io/aio.html")
2189 (synopsis "Linux-native asynchronous I/O access library")
2191 "This library enables userspace to use Linux kernel asynchronous I/O
2192 system calls, important for the performance of databases and other advanced
2194 (license lgpl2.1+)))
2196 (define-public bluez
2203 "https://www.kernel.org/pub/linux/bluetooth/bluez-"
2207 "0b1qbnq1xzcdw5rajg9yyg31bf21jnff0n6gnf1snz89bbdllfhy"))))
2208 (build-system gnu-build-system)
2211 (let ((out (assoc-ref %outputs "out")))
2212 (list "--enable-library"
2214 ;; Install dbus/udev files to the correct location.
2215 (string-append "--with-dbusconfdir=" out "/etc")
2216 (string-append "--with-udevdir=" out "/lib/udev")))))
2218 `(("pkg-config" ,pkg-config)
2219 ("gettext" ,gnu-gettext)))
2224 ("libical" ,libical)
2225 ("readline" ,readline)))
2226 (home-page "http://www.bluez.org/")
2227 (synopsis "Linux Bluetooth protocol stack")
2229 "BlueZ provides support for the core Bluetooth layers and protocols. It
2230 is flexible, efficient and uses a modular implementation.")