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 (guix packages)
59 #:use-module (guix download)
60 #:use-module (guix utils)
61 #:use-module (guix build-system gnu)
62 #:use-module (guix build-system cmake)
63 #:use-module (guix build-system python)
64 #:use-module (guix build-system trivial)
65 #:use-module (srfi srfi-26)
66 #:use-module (ice-9 match))
68 (define-public (system->linux-architecture arch)
69 "Return the Linux architecture name for ARCH, a Guix system name such as
71 (let ((arch (car (string-split arch #\-))))
72 (cond ((string=? arch "i686") "i386")
73 ((string-prefix? "mips" arch) "mips")
74 ((string-prefix? "arm" arch) "arm")
77 (define (linux-libre-urls version)
78 "Return a list of URLs for Linux-Libre VERSION."
80 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
81 version "-gnu/linux-libre-" version "-gnu.tar.xz")
83 ;; XXX: Work around <http://bugs.gnu.org/14851>.
85 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
86 version "-gnu.tar.xz")
88 ;; Maybe this URL will become valid eventually.
90 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
91 version "-gnu.tar.xz")))
93 (define-public linux-libre-headers
94 (let* ((version "3.14.37")
98 (setenv "ARCH" ,(system->linux-architecture arch))
99 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
101 (and (zero? (system* "make" "defconfig"))
102 (zero? (system* "make" "mrproper" "headers_check"))))))
104 `(lambda* (#:key outputs #:allow-other-keys)
105 (let ((out (assoc-ref outputs "out")))
106 (and (zero? (system* "make"
107 (string-append "INSTALL_HDR_PATH=" out)
109 (mkdir (string-append out "/include/config"))
110 (call-with-output-file
112 "/include/config/kernel.release")
114 (format p "~a-default~%" ,version))))))))
116 (name "linux-libre-headers")
120 (uri (linux-libre-urls version))
123 "1blxr2bsvfqi9khj4cpspv434bmx252zak2wsbi2mgl60zh77gza"))))
124 (build-system gnu-build-system)
125 (native-inputs `(("perl" ,perl)))
127 `(#:modules ((guix build gnu-build-system)
130 #:phases (alist-replace
131 'build ,(build-phase (or (%current-target-system)
134 'install ,install-phase
135 (alist-delete 'configure %standard-phases)))
137 (synopsis "GNU Linux-Libre kernel headers")
138 (description "Headers of the Linux-Libre kernel.")
140 (home-page "http://www.gnu.org/software/linux-libre/"))))
142 (define-public module-init-tools
144 (name "module-init-tools")
149 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
153 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
155 (list (search-patch "module-init-tools-moduledir.patch")))))
156 (build-system gnu-build-system)
158 ;; FIXME: The upstream tarball lacks man pages, and building them would
159 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
160 ;; but they vanished. In the meantime, fake it.
161 '(#:phases (alist-cons-before
162 'configure 'fake-docbook
164 (substitute* "Makefile.in"
165 (("^DOCBOOKTOMAN.*$")
166 "DOCBOOKTOMAN = true\n")))
168 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
169 (synopsis "Tools for loading and managing Linux kernel modules")
171 "Tools for loading and managing Linux kernel modules, such as `modprobe',
172 `insmod', `lsmod', and more.")
175 (define %boot-logo-patch
176 ;; Linux-Libre boot logo featuring Freedo and a gnu.
179 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
180 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
183 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
185 (define (kernel-config system)
186 "Return the absolute file name of the Linux-Libre build configuration file
187 for SYSTEM, or #f if there is no configuration for SYSTEM."
188 (define (lookup file)
189 (let ((file (string-append "gnu/packages/" file)))
190 (search-path %load-path file)))
194 (lookup "linux-libre-i686.conf"))
196 (lookup "linux-libre-x86_64.conf"))
200 (define-public linux-libre
201 (let* ((version "3.18.10")
203 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
204 ;; Apply the neat patch.
205 (system* "patch" "-p1" "--force"
206 "-i" (assoc-ref inputs "patch/freedo+gnu"))
208 (let ((arch (car (string-split system #\-))))
210 (cond ((string=? arch "i686") "i386")
212 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
214 (let ((build (assoc-ref %standard-phases 'build))
215 (config (assoc-ref inputs "kconfig")))
217 ;; Use the architecture-specific config if available, and
218 ;; 'defconfig' otherwise.
221 (copy-file config ".config")
222 (chmod ".config" #o666))
223 (system* "make" "defconfig"))
225 ;; Appending works even when the option wasn't in the
226 ;; file. The last one prevails if duplicated.
227 (let ((port (open-file ".config" "a")))
228 (display (string-append "CONFIG_NET_9P=m\n"
229 "CONFIG_NET_9P_VIRTIO=m\n"
230 "CONFIG_VIRTIO_BLK=m\n"
231 "CONFIG_VIRTIO_NET=m\n"
232 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
233 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
234 "CONFIG_VIRTIO_PCI=m\n"
235 "CONFIG_VIRTIO_BALLOON=m\n"
236 "CONFIG_VIRTIO_MMIO=m\n"
243 (zero? (system* "make" "oldconfig"))
245 ;; Call the default `build' phase so `-j' is correctly
247 (apply build #:make-flags "all" args))))
249 `(lambda* (#:key inputs outputs #:allow-other-keys)
250 (let* ((out (assoc-ref outputs "out"))
251 (moddir (string-append out "/lib/modules"))
252 (mit (assoc-ref inputs "module-init-tools")))
254 (for-each (lambda (file)
256 (string-append out "/" (basename file))))
257 (find-files "." "^(bzImage|System\\.map)$"))
258 (copy-file ".config" (string-append out "/config"))
259 (zero? (system* "make"
260 (string-append "DEPMOD=" mit "/sbin/depmod")
261 (string-append "MODULE_DIR=" moddir)
262 (string-append "INSTALL_PATH=" out)
263 (string-append "INSTALL_MOD_PATH=" out)
264 "INSTALL_MOD_STRIP=1"
265 "modules_install"))))))
271 (uri (linux-libre-urls version))
274 "0ckbi94b56klp59wsfcmlkbyrj7hj7kb7ys2jjsrqsk39dd77zg5"))))
275 (build-system gnu-build-system)
276 (native-inputs `(("perl" ,perl)
278 ("module-init-tools" ,module-init-tools)
279 ("patch/freedo+gnu" ,%boot-logo-patch)
281 ,@(let ((conf (kernel-config (or (%current-target-system)
282 (%current-system)))))
287 ;; XXX: Work around an ICE with our patched GCC 4.8.3 while compiling
288 ;; 'drivers/staging/vt6656/michael.o': <http://hydra.gnu.org/build/96389/>.
289 (inputs `(("gcc" ,gcc-4.9)))
292 `(#:modules ((guix build gnu-build-system)
296 #:phases (alist-replace
299 'install ,install-phase
300 (alist-delete 'configure %standard-phases)))
302 (synopsis "100% free redistribution of a cleaned Linux kernel")
304 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
305 It has been modified to remove all non-free binary blobs.")
307 (home-page "http://www.gnu.org/software/linux-libre/"))))
311 ;;; Pluggable authentication modules (PAM).
314 (define-public linux-pam
321 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
323 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
324 version ".tar.bz2")))
327 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
328 (build-system gnu-build-system)
332 ;; TODO: optional dependencies
333 ;; ("libxcrypt" ,libxcrypt)
334 ;; ("cracklib" ,cracklib)
337 '(;; Most users, such as `shadow', expect the headers to be under
339 #:configure-flags (list (string-append "--includedir="
340 (assoc-ref %outputs "out")
341 "/include/security"))
343 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
346 (home-page "http://www.linux-pam.org/")
347 (synopsis "Pluggable authentication modules for Linux")
349 "A *Free* project to implement OSF's RFC 86.0.
350 Pluggable authentication modules are small shared object files that can
351 be used through the PAM API to perform tasks, like authenticating a user
352 at login. Local and dynamic reconfiguration are its key features")
360 (define-public psmisc
367 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
371 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
372 (build-system gnu-build-system)
373 (inputs `(("ncurses" ,ncurses)))
374 (home-page "http://psmisc.sourceforge.net/")
376 "Small utilities that use the proc filesystem")
378 "This PSmisc package is a set of some small useful utilities that
379 use the proc filesystem. We're not about changing the world, but
380 providing the system administrator with some help in common tasks.")
383 (define-public util-linux
389 (uri (string-append "mirror://kernel.org/linux/utils/"
390 name "/v" (version-major+minor version) "/"
391 name "-" version ".tar.xz"))
394 "1miwwdq1zwvhf0smrxx3fjddq3mz22s8rc5cw54s7x3kbdqpyig0"))
395 (patches (list (search-patch "util-linux-tests.patch")))
396 (modules '((guix build utils)))
398 ;; We take the 'logger' program from GNU Inetutils and 'kill'
399 ;; from GNU Coreutils.
400 '(substitute* "configure"
401 (("build_logger=yes") "build_logger=no")
402 (("build_kill=yes") "build_kill=no")))))
403 (build-system gnu-build-system)
405 `(#:configure-flags (list "--disable-use-tty-group"
408 ;; Install completions where our
409 ;; bash-completion package expects them.
410 (string-append "--with-bashcompletiondir="
411 (assoc-ref %outputs "out")
412 "/etc/bash_completion.d"))
413 #:phases (alist-cons-before
415 (lambda* (#:key inputs outputs #:allow-other-keys)
416 (let ((out (assoc-ref outputs "out"))
417 (net (assoc-ref inputs "net-base")))
418 ;; Change the test to refer to the right file.
419 (substitute* "tests/ts/misc/mcookie"
421 (string-append net "/etc/services")))
424 (inputs `(("zlib" ,zlib)
425 ("ncurses" ,ncurses)))
428 ("net-base" ,net-base))) ;for tests
429 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
430 (synopsis "Collection of utilities for the Linux kernel")
432 "Util-linux is a random collection of utilities for the Linux kernel.")
434 ;; Note that util-linux doesn't use the same license for all the
435 ;; code. GPLv2+ is the default license for a code without an
436 ;; explicitly defined license.
437 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
438 bsd-4 public-domain))))
440 (define-public procps
446 ;; A mirror://sourceforge URI doesn't work, presumably becuase
447 ;; the SourceForge project is misconfigured.
448 (uri (string-append "http://procps.sourceforge.net/procps-"
452 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
453 (patches (list (search-patch "procps-make-3.82.patch")))))
454 (build-system gnu-build-system)
455 (inputs `(("ncurses" ,ncurses)))
457 '(#:modules ((guix build utils)
458 (guix build gnu-build-system)
461 #:phases (alist-replace
463 (lambda* (#:key outputs #:allow-other-keys)
464 ;; No `configure', just a single Makefile.
465 (let ((out (assoc-ref outputs "out")))
466 (substitute* "Makefile"
468 (("--(owner|group) 0") "")
469 (("ldconfig") "true")
470 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
471 ;; Add libproc to the RPATH.
472 (string-append "LDFLAGS := -Wl,-rpath="
477 (lambda* (#:key outputs #:allow-other-keys)
478 (let ((out (assoc-ref outputs "out")))
480 (system* "make" "install"
481 (string-append "DESTDIR=" out)))
483 ;; Remove commands and man pages redundant with
485 (let ((dup (append-map (cut find-files out <>)
486 '("^kill" "^uptime"))))
487 (for-each delete-file dup)
492 (system* (string-append out "/bin/ps")
496 ;; What did you expect? Tests?
498 (home-page "http://procps.sourceforge.net/")
499 (synopsis "Utilities that give information about processes")
501 "Procps is the package that has a bunch of small useful utilities
502 that give information about processes using the Linux /proc file system.
503 The package includes the programs ps, top, vmstat, w, kill, free,
504 slabtop, and skill.")
507 (define-public usbutils
514 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
515 "usbutils-" version ".tar.xz"))
518 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
519 (build-system gnu-build-system)
521 `(("libusb" ,libusb)))
523 `(("pkg-config" ,pkg-config)))
524 (home-page "http://www.linux-usb.org/")
526 "Tools for working with USB devices, such as lsusb")
528 "Tools for working with USB devices, such as lsusb.")
531 (define-public e2fsprogs
537 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
541 "0v0qcfyls0dlrjy8gx9m3s2wbkp5z3lbsr5hb7x8kp8f3bclcy71"))
542 (modules '((guix build utils)))
544 '(substitute* "MCONFIG.in"
545 (("INSTALL_SYMLINK = /bin/sh")
546 "INSTALL_SYMLINK = sh")))))
547 (build-system gnu-build-system)
548 (inputs `(("util-linux" ,util-linux)))
549 (native-inputs `(("pkg-config" ,pkg-config)
550 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
552 '(;; util-linux is not the preferred source for some of the libraries and
553 ;; commands, so disable them (see, e.g.,
554 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b336339909c90559b7db40b455f172>.)
555 #:configure-flags '("--disable-libblkid"
556 "--disable-libuuid" "--disable-uuidd"
559 ;; Install libext2fs et al.
560 "--enable-elf-shlibs")
562 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
563 (assoc-ref %outputs "out")
566 #:phases (alist-cons-before
567 'configure 'patch-shells
569 (substitute* "configure"
570 (("/bin/sh (.*)parse-types.sh" _ dir)
571 (string-append (which "sh") " " dir
573 (substitute* (find-files "." "^Makefile.in$")
575 (string-append "#!" (which "sh")))))
577 'install 'install-libs
579 (zero? (system* "make" "install-libs")))
582 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
583 ;; they fail because we get an extra line that says "Can't check if
584 ;; filesystem is mounted due to missing mtab file".
586 (home-page "http://e2fsprogs.sourceforge.net/")
587 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
589 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
590 (license (list gpl2 ; programs
594 (define e2fsprogs/static
596 (package (inherit e2fsprogs)
598 ;; Do not build shared libraries.
599 (substitute-keyword-arguments (package-arguments e2fsprogs)
600 ((#:configure-flags _)
601 '(list "--disable-blkid"))
605 (define-public e2fsck/static
607 (name "e2fsck-static")
608 (version (package-version e2fsprogs))
609 (build-system trivial-build-system)
612 `(#:modules ((guix build utils))
615 (use-modules (guix build utils)
619 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
621 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
623 (with-directory-excursion bin
624 (for-each (lambda (file)
625 (copy-file (string-append source "/" file)
627 (remove-store-references file)
629 (scandir source (cut string-prefix? "fsck." <>))))))))
630 (inputs `(("e2fsprogs" ,e2fsprogs/static)))
631 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
633 "This package provides statically-linked command of fsck.ext[234] taken
634 from the e2fsprogs package. It is meant to be used in initrds.")
635 (home-page (package-home-page e2fsprogs))
636 (license (package-license e2fsprogs))))
638 (define-public zerofree
642 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
645 (uri (string-append home-page name "-" version
649 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
650 (build-system gnu-build-system)
652 '(#:phases (alist-replace
654 (lambda* (#:key outputs #:allow-other-keys)
655 (let* ((out (assoc-ref outputs "out"))
656 (bin (string-append out "/bin")))
658 (copy-file "zerofree"
659 (string-append bin "/zerofree"))
660 (chmod (string-append bin "/zerofree")
663 (alist-delete 'configure %standard-phases))
664 #:tests? #f)) ;no tests
665 (inputs `(("libext2fs" ,e2fsprogs)))
666 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
668 "The zerofree command scans the free blocks in an ext2 file system and
669 fills any non-zero blocks with zeroes. This is a useful way to make disk
670 images more compressible.")
673 (define-public strace
679 (uri (string-append "mirror://sourceforge/strace/strace-"
683 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
684 (build-system gnu-build-system)
685 (native-inputs `(("perl" ,perl)))
686 (home-page "http://strace.sourceforge.net/")
687 (synopsis "System call tracer for Linux")
689 "strace is a system call tracer, i.e. a debugging tool which prints out a
690 trace of all the system calls made by a another process/program.")
693 (define-public ltrace
699 (uri (string-append "http://www.ltrace.org/ltrace_" version
703 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
704 (build-system gnu-build-system)
705 (inputs `(("libelf" ,libelf)))
707 ;; Compilation uses -Werror by default, but it fails.
708 '(#:configure-flags '("--disable-werror")))
709 (home-page "http://www.ltrace.org/")
710 (synopsis "Library call tracer for Linux")
712 "ltrace intercepts and records dynamic library calls which are called by
713 an executed process and the signals received by that process. It can also
714 intercept and print the system calls executed by the program.")
717 (define-public alsa-lib
724 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
728 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
729 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
730 (build-system gnu-build-system)
731 (home-page "http://www.alsa-project.org/")
732 (synopsis "The Advanced Linux Sound Architecture libraries")
734 "The Advanced Linux Sound Architecture (ALSA) provides audio and
735 MIDI functionality to the Linux-based operating system.")
738 (define-public alsa-utils
744 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
748 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
749 (build-system gnu-build-system)
751 ;; XXX: Disable man page creation until we have DocBook.
752 '(#:configure-flags (list "--disable-xmlto"
754 ;; The udev rule is responsible for restoring
756 (string-append "--with-udev-rules-dir="
757 (assoc-ref %outputs "out")
758 "/lib/udev/rules.d"))
759 #:phases (alist-cons-before
760 'install 'pre-install
762 ;; Don't try to mkdir /var/lib/alsa.
763 (substitute* "Makefile"
764 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
768 `(("libsamplerate" ,libsamplerate)
770 ("alsa-lib" ,alsa-lib)
772 ("gettext" ,gnu-gettext)))
773 (home-page "http://www.alsa-project.org/")
774 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
776 "The Advanced Linux Sound Architecture (ALSA) provides audio and
777 MIDI functionality to the Linux-based operating system.")
779 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
783 (define-public iptables
790 "http://www.netfilter.org/projects/iptables/files/iptables-"
794 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
795 (build-system gnu-build-system)
796 (arguments '(#:tests? #f)) ; no test suite
797 (home-page "http://www.netfilter.org/projects/iptables/index.html")
798 (synopsis "Program to configure the Linux IP packet filtering rules")
800 "iptables is the userspace command line program used to configure the
801 Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
802 system administrators. Since Network Address Translation is also configured
803 from the packet filter ruleset, iptables is used for this, too. The iptables
804 package also includes ip6tables. ip6tables is used for configuring the IPv6
808 (define-public iproute
815 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
819 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
820 (build-system gnu-build-system)
822 `(#:tests? #f ; no test suite
823 #:make-flags (let ((out (assoc-ref %outputs "out")))
825 (string-append "LIBDIR=" out "/lib")
826 (string-append "SBINDIR=" out "/sbin")
827 (string-append "CONFDIR=" out "/etc")
828 (string-append "DOCDIR=" out "/share/doc/"
830 (string-append "MANDIR=" out "/share/man")))
831 #:phases (alist-cons-before
832 'install 'pre-install
834 ;; Don't attempt to create /var/lib/arpd.
835 (substitute* "Makefile"
836 (("^.*ARPDDIR.*$") "")))
839 `(("iptables" ,iptables)
842 `(("pkg-config" ,pkg-config)
846 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
848 "Utilities for controlling TCP/IP networking and traffic in Linux")
850 "Iproute2 is a collection of utilities for controlling TCP/IP
851 networking and traffic with the Linux kernel.
853 Most network configuration manuals still refer to ifconfig and route as the
854 primary network configuration tools, but ifconfig is known to behave
855 inadequately in modern network environments. They should be deprecated, but
856 most distros still include them. Most network configuration systems make use
857 of ifconfig and thus provide a limited feature set. The /etc/net project aims
858 to support most modern network technologies, as it doesn't use ifconfig and
859 allows a system administrator to make use of all iproute2 features, including
862 iproute2 is usually shipped in a package called iproute or iproute2 and
863 consists of several tools, of which the most important are ip and tc. ip
864 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
865 tools print detailed usage messages and are accompanied by a set of
869 (define-public net-tools
870 ;; XXX: This package is basically unmaintained, but it provides a few
871 ;; commands not yet provided by Inetutils, such as 'route', so we have to
876 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
879 (uri (string-append home-page "/" name "-"
883 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
885 (list (search-patch "net-tools-bitrot.patch")))))
886 (build-system gnu-build-system)
888 '(#:modules ((guix build gnu-build-system)
892 #:phases (alist-cons-after
894 (lambda* (#:key inputs #:allow-other-keys)
895 (define (apply-patch file)
896 (zero? (system* "patch" "-p1" "--force"
899 (let ((patch.gz (assoc-ref inputs "patch")))
900 (format #t "applying Debian patch set '~a'...~%"
902 (system (string-append "gunzip < " patch.gz " > the-patch"))
903 (and (apply-patch "the-patch")
904 (for-each apply-patch
905 (find-files "debian/patches"
909 (lambda* (#:key outputs #:allow-other-keys)
910 (let ((out (assoc-ref outputs "out")))
911 (mkdir-p (string-append out "/bin"))
912 (mkdir-p (string-append out "/sbin"))
914 ;; Pretend we have everything...
915 (system "yes | make config")
917 ;; ... except we don't have libdnet, so remove that
919 (substitute* '("config.make" "config.h")
920 (("^.*HAVE_AFDECnet.*$") ""))))
922 'install 'remove-redundant-commands
923 (lambda* (#:key outputs #:allow-other-keys)
924 ;; Remove commands and man pages redundant with
926 (let* ((out (assoc-ref outputs "out"))
927 (dup (append-map (cut find-files out <>)
929 "^(yp|nis|dns)?domainname"))))
930 (for-each delete-file dup)
934 ;; Binaries that depend on libnet-tools.a don't declare that
935 ;; dependency, making it parallel-unsafe.
938 #:tests? #f ; no test suite
939 #:make-flags (let ((out (assoc-ref %outputs "out")))
941 (string-append "BASEDIR=" out)
942 (string-append "INSTALLNLSDIR=" out "/share/locale")
943 (string-append "mandir=/share/man")))))
945 ;; Use the big Debian patch set (the thing does not even compile out of
947 (inputs `(("patch" ,(origin
950 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
953 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
954 (native-inputs `(("gettext" ,gnu-gettext)))
956 (synopsis "Tools for controlling the network subsystem in Linux")
958 "This package includes the important tools for controlling the network
959 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
960 netstat, rarp and route. Additionally, this package contains utilities
961 relating to particular network hardware types (plipconfig, slattach) and
962 advanced aspects of IP configuration (iptunnel, ipmaddr).")
965 (define-public libcap
972 ;; Tarballs used to be available from
973 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
974 ;; but they never came back after kernel.org was compromised.
976 "mirror://debian/pool/main/libc/libcap2/libcap2_"
977 version ".orig.tar.gz"))
980 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
981 (build-system gnu-build-system)
982 (arguments '(#:phases (alist-delete 'configure %standard-phases)
983 #:tests? #f ; no 'check' target
984 #:make-flags (list "lib=lib"
985 (string-append "prefix="
986 (assoc-ref %outputs "out"))
987 "RAISE_SETFCAP=no")))
988 (native-inputs `(("perl" ,perl)))
989 (inputs `(("attr" ,attr)))
990 (home-page "https://sites.google.com/site/fullycapable/")
991 (synopsis "Library for working with POSIX capabilities")
993 "Libcap2 provides a programming interface to POSIX capabilities on
994 Linux-based operating systems.")
996 ;; License is BSD-3 or GPLv2, at the user's choice.
999 (define-public bridge-utils
1001 (name "bridge-utils")
1005 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
1009 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1010 (build-system gnu-build-system)
1012 ;; The tarball lacks all the generated files.
1013 (native-inputs `(("autoconf" ,autoconf)
1014 ("automake" ,automake)))
1016 '(#:phases (alist-cons-after
1019 (zero? (system* "autoreconf" "-vf")))
1021 #:tests? #f)) ; no 'check' target
1024 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1025 (synopsis "Manipulate Ethernet bridges")
1027 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1028 to connect two Ethernet segments together in a protocol independent way.
1029 Packets are forwarded based on Ethernet address, rather than IP address (like
1030 a router). Since forwarding is done at Layer 2, all protocols can go
1031 transparently through a bridge.")
1034 (define-public libnl
1041 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1045 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
1046 (build-system gnu-build-system)
1047 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1048 (home-page "http://www.infradead.org/~tgr/libnl/")
1049 (synopsis "NetLink protocol library suite")
1051 "The libnl suite is a collection of libraries providing APIs to netlink
1052 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
1053 between the kernel and user space processes. It was designed to be a more
1054 flexible successor to ioctl to provide mainly networking related kernel
1055 configuration and monitoring interfaces.")
1057 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1058 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1068 "https://www.kernel.org/pub/software/network/iw/iw-"
1072 "14zsapqhivk0ws5z21y1ys2c2czi05mzk7bl2yb7qxcfrnsjx9j8"))))
1073 (build-system gnu-build-system)
1074 (native-inputs `(("pkg-config" ,pkg-config)))
1075 (inputs `(("libnl" ,libnl)))
1077 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1079 #:phases (alist-delete 'configure %standard-phases)))
1080 (home-page "http://wireless.kernel.org/en/users/Documentation/iw")
1081 (synopsis "Tool for configuring wireless devices")
1083 "iw is a new nl80211 based CLI configuration utility for wireless
1084 devices. It replaces 'iwconfig', which is deprecated.")
1087 (define-public powertop
1095 "https://01.org/powertop/sites/default/files/downloads/powertop-"
1099 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
1100 (build-system gnu-build-system)
1102 ;; TODO: Add pciutils.
1104 ;; ("pciutils" ,pciutils)
1105 ("ncurses" ,ncurses)
1108 `(("pkg-config" ,pkg-config)))
1109 (home-page "https://01.org/powertop/")
1110 (synopsis "Analyze power consumption on Intel-based laptops")
1112 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1113 power management. In addition to being a diagnostic tool, PowerTOP also has
1114 an interactive mode where the user can experiment various power management
1115 settings for cases where the operating system has not enabled these
1119 (define-public aumix
1126 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1127 version ".tar.bz2"))
1130 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1131 (build-system gnu-build-system)
1132 (inputs `(("ncurses" ,ncurses)))
1133 (home-page "http://www.jpj.net/~trevor/aumix.html")
1134 (synopsis "Audio mixer for X and the console")
1136 "Aumix adjusts an audio mixer from X, the console, a terminal,
1137 the command line or a script.")
1140 (define-public iotop
1147 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1150 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1151 (build-system python-build-system)
1153 ;; The setup.py script expects python-2.
1154 `(#:python ,python-2
1155 ;; There are currently no checks in the package.
1157 (native-inputs `(("python" ,python-2)))
1158 (home-page "http://guichaz.free.fr/iotop/")
1160 "Displays the IO activity of running processes")
1162 "Iotop is a Python program with a top like user interface to show the
1163 processes currently causing I/O.")
1172 (uri (string-append "mirror://sourceforge/fuse/fuse-"
1176 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))))
1177 (build-system gnu-build-system)
1178 (inputs `(("util-linux" ,util-linux)))
1180 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1181 (assoc-ref %outputs "out")
1183 (string-append "INIT_D_PATH="
1184 (assoc-ref %outputs "out")
1187 ;; The rule makes /dev/fuse 666.
1188 (string-append "UDEV_RULES_PATH="
1189 (assoc-ref %outputs "out")
1190 "/lib/udev/rules.d"))
1191 #:phases (alist-cons-before
1192 'build 'set-file-names
1193 (lambda* (#:key inputs #:allow-other-keys)
1194 ;; libfuse calls out to mount(8) and umount(8). Make sure
1195 ;; it refers to the right ones.
1196 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1197 (("/bin/(u?)mount" _ maybe-u)
1198 (string-append (assoc-ref inputs "util-linux")
1199 "/bin/" maybe-u "mount")))
1200 (substitute* '("util/mount.fuse.c")
1204 ;; This hack leads libfuse to search for 'fusermount' in
1205 ;; $PATH, where it may find a setuid-root binary, instead of
1206 ;; trying solely $out/sbin/fusermount and failing because
1208 (substitute* "lib/Makefile"
1209 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1210 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1212 (home-page "http://fuse.sourceforge.net/")
1213 (synopsis "Support file systems implemented in user space")
1215 "As a consequence of its monolithic design, file system code for Linux
1216 normally goes into the kernel itself---which is not only a robustness issue,
1217 but also an impediment to system extensibility. FUSE, for \"file systems in
1218 user space\", is a kernel module and user-space library that tries to address
1219 part of this problem by allowing users to run file system implementations as
1220 user-space processes.")
1221 (license (list lgpl2.1 ; library
1222 gpl2+)))) ; command-line utilities
1224 (define-public unionfs-fuse
1226 (name "unionfs-fuse")
1231 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1235 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1236 (build-system cmake-build-system)
1237 (inputs `(("fuse" ,fuse)))
1238 (arguments '(#:tests? #f)) ; no tests
1239 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1240 (synopsis "User-space union file system")
1242 "UnionFS-FUSE is a flexible union file system implementation in user
1243 space, using the FUSE library. Mounting a union file system allows you to
1244 \"aggregate\" the contents of several directories into a single mount point.
1245 UnionFS-FUSE additionally supports copy-on-write.")
1249 (package (inherit fuse)
1250 (name "fuse-static")
1251 (source (origin (inherit (package-source fuse))
1252 (modules '((guix build utils)))
1254 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1255 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1256 ;; it doesn't do that, allowing us to remove the dependency on
1257 ;; util-linux (something that is useful in initrds.)
1258 '(substitute* '("lib/mount_util.c"
1259 "util/mount_util.c")
1260 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1265 (define-public unionfs-fuse/static
1266 (package (inherit unionfs-fuse)
1267 (synopsis "User-space union file system (statically linked)")
1268 (name (string-append (package-name unionfs-fuse) "-static"))
1269 (source (origin (inherit (package-source unionfs-fuse))
1270 (modules '((guix build utils)))
1272 ;; Add -ldl to the libraries, because libfuse.a needs that.
1273 '(substitute* "src/CMakeLists.txt"
1274 (("target_link_libraries(.*)\\)" _ libs)
1275 (string-append "target_link_libraries"
1279 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1280 #:phases (alist-cons-after
1281 'install 'post-install
1282 (lambda* (#:key outputs #:allow-other-keys)
1283 (let* ((out (assoc-ref outputs "out"))
1284 (exe (string-append out "/bin/unionfs")))
1285 ;; By default, 'unionfs' keeps references to
1286 ;; $glibc/share/locale and similar stuff. Remove them.
1287 (remove-store-references exe)))
1289 (inputs `(("fuse" ,fuse-static)))))
1291 (define-public sshfs-fuse
1297 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1301 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1302 (build-system gnu-build-system)
1307 `(("pkg-config" ,pkg-config)))
1308 (home-page "http://fuse.sourceforge.net/sshfs.html")
1309 (synopsis "Mount remote file systems over SSH")
1311 "This is a file system client based on the SSH File Transfer Protocol.
1312 Since most SSH servers already support this protocol it is very easy to set
1313 up: on the server side there's nothing to do; on the client side mounting the
1314 file system is as easy as logging into the server with an SSH client.")
1317 (define-public numactl
1324 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1329 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1330 (build-system gnu-build-system)
1332 '(#:phases (alist-replace
1334 (lambda* (#:key outputs #:allow-other-keys)
1335 ;; There's no 'configure' script, just a raw makefile.
1336 (substitute* "Makefile"
1338 (string-append "prefix := " (assoc-ref outputs "out")
1341 ;; By default the thing tries to install under
1342 ;; $prefix/lib64 when on a 64-bit platform.
1343 (string-append "libdir := $(prefix)/lib\n"))))
1347 ;; By default the thing tries to use 'cc'.
1350 ;; Make sure programs have an RPATH so they can find
1352 (string-append "LDLIBS=-Wl,-rpath="
1353 (assoc-ref %outputs "out") "/lib"))
1355 ;; There's a 'test' target, but it requires NUMA support in the kernel
1356 ;; to run, which we can't assume to have.
1358 (home-page "http://oss.sgi.com/projects/libnuma/")
1359 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1361 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1362 memory is not all in one place. The numactl program allows you to run your
1363 application program on specific CPU's and memory nodes. It does this by
1364 supplying a NUMA memory policy to the operating system before running your
1367 The package contains other commands, such as numademo, numastat and memhog.
1368 The numademo command provides a quick overview of NUMA performance on your
1370 (license (list gpl2 ; programs
1371 lgpl2.1)))) ; library
1379 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1383 "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm"))
1384 (modules '((guix build utils)))
1387 (substitute* "tests/Makefile.in"
1388 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1391 (substitute* '("src/unicode_start" "src/unicode_stop")
1392 ;; Assume the Coreutils are in $PATH.
1395 (build-system gnu-build-system)
1397 '(#:phases (alist-cons-before
1399 (lambda* (#:key inputs #:allow-other-keys)
1400 (let ((gzip (assoc-ref %build-inputs "gzip"))
1401 (bzip2 (assoc-ref %build-inputs "bzip2")))
1402 (substitute* "src/libkeymap/findfile.c"
1404 (string-append gzip "/bin/gzip"))
1406 (string-append bzip2 "/bin/bzip2")))))
1408 'install 'post-install
1409 (lambda* (#:key outputs #:allow-other-keys)
1410 ;; Make sure these programs find their comrades.
1411 (let* ((out (assoc-ref outputs "out"))
1412 (bin (string-append out "/bin")))
1413 (for-each (lambda (prog)
1414 (wrap-program (string-append bin "/" prog)
1415 `("PATH" ":" prefix (,bin))))
1416 '("unicode_start" "unicode_stop"))))
1417 %standard-phases))))
1418 (inputs `(("check" ,check)
1421 ("pam" ,linux-pam)))
1422 (native-inputs `(("pkg-config" ,pkg-config)))
1423 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1424 (synopsis "Linux keyboard utilities and keyboard maps")
1426 "This package contains keytable files and keyboard utilities compatible
1427 for systems using the Linux kernel. This includes commands such as
1428 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1431 (define-public inotify-tools
1433 (name "inotify-tools")
1438 "mirror://sourceforge/inotify-tools/inotify-tools/"
1439 version "/inotify-tools-" version ".tar.gz"))
1442 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1443 (build-system gnu-build-system)
1444 (home-page "http://inotify-tools.sourceforge.net/")
1445 (synopsis "Monitor file accesses")
1447 "The inotify-tools packages provides a C library and command-line tools
1448 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1458 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1459 "kmod-" version ".tar.xz"))
1462 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1463 (patches (list (search-patch "kmod-module-directory.patch")))))
1464 (build-system gnu-build-system)
1466 `(("pkg-config" ,pkg-config)))
1471 `(#:tests? #f ; FIXME: Investigate test failures
1472 #:configure-flags '("--with-xz" "--with-zlib")
1473 #:phases (alist-cons-after
1474 'install 'install-modprobe&co
1475 (lambda* (#:key outputs #:allow-other-keys)
1476 (let* ((out (assoc-ref outputs "out"))
1477 (bin (string-append out "/bin")))
1478 (for-each (lambda (tool)
1480 (string-append bin "/" tool)))
1481 '("insmod" "rmmod" "lsmod" "modprobe"
1482 "modinfo" "depmod"))))
1484 (home-page "https://www.kernel.org/")
1485 (synopsis "Kernel module tools")
1486 (description "Kmod is a set of tools to handle common tasks with Linux
1487 kernel modules like insert, remove, list, check properties, resolve
1488 dependencies and aliases.
1490 These tools are designed on top of libkmod, a library that is shipped with
1491 kmod. The aim is to be compatible with tools, configurations and indices
1492 from the module-init-tools project.")
1493 (license gpl2+))) ; library under lgpl2.1+
1495 (define-public eudev
1496 ;; The post-systemd fork, maintained by Gentoo.
1503 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1507 "0shf5vqiz9fdxl95aa1a8vh0xjxwim3psc39wr2xr8lnahf11vva"))
1508 (patches (list (search-patch "eudev-rules-directory.patch")))
1509 (modules '((guix build utils)))
1511 ;; 'configure' checks uses <linux/btrfs.h> as an indication of
1512 ;; whether Linux headers are available, but it doesn't actually
1513 ;; use it, and our 'linux-libre-headers' package doesn't
1514 ;; provide it. So just remove that.
1515 '(substitute* "configure"
1516 (("linux/btrfs\\.h")
1518 (build-system gnu-build-system)
1520 `(("pkg-config" ,pkg-config)
1522 ("glib" ,glib "bin") ; glib-genmarshal, etc.
1523 ("perl" ,perl) ; for the tests
1524 ("python" ,python-2))) ; ditto
1527 ("pciutils" ,pciutils)
1528 ("usbutils" ,usbutils)
1529 ("util-linux" ,util-linux)
1531 ("gobject-introspection" ,gobject-introspection)))
1533 `(#:configure-flags (list "--enable-libkmod"
1536 "--with-pci-ids-path="
1537 (assoc-ref %build-inputs "pciutils")
1538 "/share/pci.ids.gz")
1540 "--with-firmware-path=/no/firmware"
1542 ;; Work around undefined reference to
1543 ;; 'mq_getattr' in sc-daemon.c.
1548 ;; The program 'g-ir-scanner' (part of the package
1549 ;; 'gobject-introspection'), to generate .gir files, makes some
1550 ;; library pre-processing. During that phase it looks for the C
1551 ;; compiler as either 'cc' or as defined by the environment variable
1552 ;; 'CC' (with code in 'giscanner/dumper.py').
1554 (setenv "CC" "gcc"))
1556 (home-page "http://www.gentoo.org/proj/en/eudev/")
1557 (synopsis "Userspace device management")
1558 (description "Udev is a daemon which dynamically creates and removes
1559 device nodes from /dev/, handles hotplug events and loads drivers at boot
1566 (version "2.02.109")
1569 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1573 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1574 (modules '((guix build utils)))
1577 (use-modules (guix build utils))
1579 ;; Honor sysconfdir.
1580 (substitute* "make.tmpl.in"
1582 "confdir = @sysconfdir@\n")
1583 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1584 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1585 (build-system gnu-build-system)
1587 `(("pkg-config" ,pkg-config)
1588 ("procps" ,procps))) ;tests use 'pgrep'
1592 '(#:phases (alist-cons-after
1593 'configure 'set-makefile-shell
1595 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1597 (setenv "SHELL" (which "sh"))
1599 ;; Replace /bin/sh with the right file name.
1600 (patch-makefile-SHELL "make.tmpl"))
1603 #:configure-flags (list (string-append "--sysconfdir="
1604 (assoc-ref %outputs "out")
1606 "--enable-udev_sync"
1607 "--enable-udev_rules"
1609 ;; Make sure programs such as 'dmsetup' can
1610 ;; find libdevmapper.so.
1611 (string-append "LDFLAGS=-Wl,-rpath="
1612 (assoc-ref %outputs "out")
1615 ;; The tests use 'mknod', which requires root access.
1617 (home-page "http://sourceware.org/lvm2/")
1618 (synopsis "Logical volume management for Linux")
1620 "LVM2 is the logical volume management tool set for Linux-based systems.
1621 This package includes the user-space libraries and tools, including the device
1622 mapper. Kernel components are part of Linux-libre.")
1624 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1625 ;; Command-line tools are GPLv2.
1626 (license (list gpl2 lgpl2.1))))
1628 (define-public wireless-tools
1630 (name "wireless-tools")
1634 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1638 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
1639 (modules '((guix build utils)))
1641 ;; Install the manual pages in the right place.
1642 '(substitute* "Makefile"
1643 (("INSTALL_MAN= .*")
1644 "INSTALL_MAN= $(PREFIX)/share/man")))))
1645 (build-system gnu-build-system)
1647 `(#:phases (alist-replace
1649 (lambda* (#:key outputs #:allow-other-keys)
1650 (setenv "PREFIX" (assoc-ref outputs "out")))
1653 (synopsis "Tools for manipulating Linux Wireless Extensions")
1654 (description "Wireless Tools are used to manipulate the now-deprecated
1655 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1656 Extension was an interface allowing you to set Wireless LAN specific
1657 parameters and get the specific stats. It is deprecated in favor the nl80211
1659 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1662 (define-public lm-sensors
1669 "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-"
1670 version ".tar.bz2"))
1673 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1674 (patches (list (search-patch "lm-sensors-hwmon-attrs.patch")))))
1675 (build-system gnu-build-system)
1676 (inputs `(("rrdtool" ,rrdtool)
1679 ("gnuplot" ,gnuplot)))
1680 (native-inputs `(("pkg-config" ,pkg-config)
1685 `(#:tests? #f ; no 'check' target
1686 #:make-flags (list (string-append "PREFIX=" %output)
1687 (string-append "ETCDIR=" %output "/etc")
1688 (string-append "MANDIR=" %output "/share/man"))
1693 'build 'patch-exec-paths
1694 (lambda* (#:key inputs outputs #:allow-other-keys)
1695 (substitute* "prog/detect/sensors-detect"
1697 (string-append "`" (assoc-ref inputs "coreutils")
1699 (("(`|\")modprobe" all open-quote)
1700 (string-append open-quote
1701 (assoc-ref inputs "kmod")
1703 (substitute* '("prog/pwm/pwmconfig"
1704 "prog/pwm/fancontrol")
1706 (string-append (assoc-ref inputs "gnuplot")
1709 (string-append (assoc-ref inputs "coreutils")
1712 (string-append (assoc-ref inputs "grep")
1715 (string-append (assoc-ref inputs "sed")
1718 (string-append (assoc-ref inputs "coreutils")
1721 (string-append (assoc-ref inputs "coreutils")
1724 (string-append (assoc-ref inputs "coreutils")
1725 "/bin/readlink -f"))))
1726 %standard-phases))))
1727 (home-page "http://www.lm-sensors.org/")
1728 (synopsis "Utilities to read temperature/voltage/fan sensors")
1730 "Lm-sensors is a hardware health monitoring package for Linux. It allows
1731 you to access information from temperature, voltage, and fan speed sensors.
1732 It works with most newer systems.")
1735 (define-public i2c-tools
1742 "http://dl.lm-sensors.org/i2c-tools/releases/i2c-tools-"
1743 version ".tar.bz2"))
1746 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
1747 (build-system gnu-build-system)
1749 `(#:tests? #f ; no 'check' target
1750 #:make-flags (list (string-append "prefix=" %output)
1752 ;; no configure script
1753 #:phases (alist-delete 'configure %standard-phases)))
1756 (home-page "http://www.lm-sensors.org/wiki/I2CTools")
1757 (synopsis "I2C tools for Linux")
1759 "The i2c-tools package contains a heterogeneous set of I2C tools for
1760 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
1761 EEPROM decoding scripts, EEPROM programming tools, and a python module for
1765 (define-public xsensors
1772 "http://www.linuxhardware.org/xsensors/xsensors-"
1776 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1777 (build-system gnu-build-system)
1778 (inputs `(("lm-sensors" ,lm-sensors)
1780 (native-inputs `(("pkg-config" ,pkg-config)))
1782 `(#:phases (alist-cons-before
1783 'configure 'enable-deprecated
1785 (substitute* "src/Makefile.in"
1786 (("-DGDK_DISABLE_DEPRECATED") "")
1787 (("-DGTK_DISABLE_DEPRECATED") "")))
1789 'configure 'remove-Werror
1791 (substitute* '("configure" "src/Makefile.in")
1793 %standard-phases))))
1794 (home-page "http://www.linuxhardware.org/xsensors/")
1795 (synopsis "Hardware health information viewer")
1797 "Xsensors reads data from the libsensors library regarding hardware
1798 health such as temperature, voltage and fan speed and displays the information
1799 in a digital read-out.")
1805 (version (package-version linux-libre))
1806 (source (package-source linux-libre))
1807 (build-system gnu-build-system)
1809 '(#:phases (alist-replace
1811 (lambda* (#:key inputs #:allow-other-keys)
1812 (setenv "SHELL_PATH" (which "bash"))
1813 (chdir "tools/perf"))
1815 #:make-flags (list (string-append "DESTDIR="
1816 (assoc-ref %outputs "out"))
1819 ;; By default, 'config/Makefile' uses lib64 on
1820 ;; x86_64. Work around that.
1822 #:tests? #f)) ;no tests
1824 `(("pkg-config" ,pkg-config)
1828 ;; There are build scripts written in these languages.
1830 ("python" ,python-2)))
1832 `(("slang" ,slang) ;for the interactive TUI
1834 ("python" ,python-2) ;'perf' links against libpython
1835 ("elfutils" ,elfutils)
1838 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
1839 ("libxslt" ,libxslt)
1840 ("docbook-xml" ,docbook-xml)
1841 ("docbook-xsl" ,docbook-xsl)
1843 ("asciidoc" ,asciidoc)))
1844 (home-page "https://perf.wiki.kernel.org/")
1845 (synopsis "Linux profiling with performance counters")
1847 "perf is a tool suite for profiling using hardware performance counters,
1848 with support in the Linux kernel. perf can instrument CPU performance
1849 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
1850 of lightweight profiling. This package contains the user-land tools and in
1851 particular the 'perf' command.")
1852 (license (package-license linux-libre))))
1854 (define-public pflask
1860 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
1862 (file-name (string-append name "-" version ".tar.gz"))
1865 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
1866 (build-system cmake-build-system)
1868 '(#:tests? #f)) ; no tests
1869 (home-page "http://ghedo.github.io/pflask/")
1870 (synopsis "Simple tool for creating Linux namespace containers")
1871 (description "pflask is a simple tool for creating Linux namespace
1872 containers. It can be used for running a command or even booting an OS inside
1873 an isolated container, created with the help of Linux namespaces. It is
1874 similar in functionality to chroot, although pflask provides better isolation
1875 thanks to the use of namespaces.")
1878 (define-public hdparm
1884 (uri (string-append "mirror://sourceforge/" name "/"
1885 name "-" version ".tar.gz"))
1888 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
1889 (build-system gnu-build-system)
1891 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
1892 (list (string-append "binprefix=" out)
1893 (string-append "manprefix=" out)
1895 #:phases (alist-delete 'configure %standard-phases)
1896 #:tests? #f)) ; no test suite
1897 (home-page "http://sourceforge.net/projects/hdparm/")
1898 (synopsis "tune hard disk parameters for high performance")
1900 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
1901 is for enabling irq-unmasking and IDE multiplemode.")
1902 (license (non-copyleft "file://LICENSE.TXT"))))
1904 (define-public acpid
1910 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
1914 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
1915 (build-system gnu-build-system)
1916 (home-page "http://sourceforge.net/projects/acpid2/")
1917 (synopsis "Daemon for delivering ACPI events to user-space programs")
1919 "acpid is designed to notify user-space programs of Advanced
1920 Configuration and Power Interface (ACPI) events. acpid should be started
1921 during the system boot, and will run as a background process. When an ACPI
1922 event is received from the kernel, acpid will examine the list of rules
1923 specified in /etc/acpi/events and execute the rules that match the event.")
1926 (define-public sysfsutils
1935 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
1938 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
1939 (build-system gnu-build-system)
1940 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
1941 (synopsis "System utilities based on Linux sysfs")
1943 "These are a set of utilites built upon sysfs, a virtual filesystem in
1944 Linux kernel versions 2.5+ that exposes a system's device tree. The package
1945 also contains the libsysfs library.")
1946 ;; The library is under lgpl2.1+ (all files say "or any later version").
1947 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
1948 (license (list gpl2 gpl2+ lgpl2.1+))))
1950 (define-public sysfsutils-1
1952 (inherit sysfsutils)
1959 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
1960 "/sysfsutils-" version ".tar.gz"))
1962 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
1963 (modules '((guix build utils)))
1966 (substitute* "Makefile.in"
1967 (("includedir = /usr/include/sysfs")
1968 "includedir = @includedir@"))
1969 (substitute* "configure"
1970 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
1971 (string-append "includedir='" orig "/sysfs'")))))))
1972 ;; XXX sysfsutils-1.3.0's config.guess fails on mips64el
1973 (arguments `(#:configure-flags
1974 '(,@(if (%current-target-system)
1977 (nix-system->gnu-triplet (%current-system))))
1978 (list (string-append "--build=" triplet)))))))
1979 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
1981 (define-public cpufrequtils
1983 (name "cpufrequtils")
1990 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
1993 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
1994 (patches (list (search-patch "cpufrequtils-fix-aclocal.patch")))))
1995 (build-system gnu-build-system)
1997 `(("sysfsutils" ,sysfsutils-1)))
1999 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2000 (assoc-ref %outputs "out") "/lib"))))
2001 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2002 (synopsis "Utilities to get and set CPU frequency on Linux")
2004 "The cpufrequtils suite contains utilities to retreive CPU frequency
2005 information, and set the CPU frequency if supported, using the cpufreq
2006 capabilities of the Linux kernel.")