1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 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 Mark H Weaver <mhw@netris.org>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages linux)
23 #:use-module ((guix licenses)
25 #:use-module (gnu packages)
26 #:use-module ((gnu packages compression) #:prefix guix:)
27 #:use-module (gnu packages flex)
28 #:use-module (gnu packages bison)
29 #:use-module (gnu packages gperf)
30 #:use-module (gnu packages libusb)
31 #:use-module (gnu packages ncurses)
32 #:use-module (gnu packages pciutils)
33 #:use-module (gnu packages databases)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages python)
37 #:use-module (gnu packages algebra)
38 #:use-module (gnu packages gettext)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages pulseaudio)
41 #:use-module (gnu packages attr)
42 #:use-module (gnu packages xml)
43 #:use-module (gnu packages autotools)
44 #:use-module (gnu packages texinfo)
45 #:use-module (gnu packages check)
46 #:use-module (gnu packages maths)
47 #:use-module (gnu packages which)
48 #:use-module (gnu packages rrdtool)
49 #:use-module (gnu packages gtk)
50 #:use-module (guix packages)
51 #:use-module (guix download)
52 #:use-module (guix build-system gnu)
53 #:use-module (guix build-system cmake)
54 #:use-module (guix build-system python)
55 #:use-module (guix build-system trivial)
56 #:use-module (srfi srfi-26)
57 #:use-module (ice-9 match))
59 (define-public (system->linux-architecture arch)
60 "Return the Linux architecture name for ARCH, a Guix system name such as
62 (let ((arch (car (string-split arch #\-))))
63 (cond ((string=? arch "i686") "i386")
64 ((string-prefix? "mips" arch) "mips")
65 ((string-prefix? "arm" arch) "arm")
68 (define (linux-libre-urls version)
69 "Return a list of URLs for Linux-Libre VERSION."
71 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
72 version "-gnu/linux-libre-" version "-gnu.tar.xz")
74 ;; XXX: Work around <http://bugs.gnu.org/14851>.
76 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
77 version "-gnu.tar.xz")
79 ;; Maybe this URL will become valid eventually.
81 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
82 version "-gnu.tar.xz")))
84 (define-public linux-libre-headers
85 (let* ((version "3.3.8")
89 (setenv "ARCH" ,(system->linux-architecture arch))
90 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
92 (and (zero? (system* "make" "defconfig"))
93 (zero? (system* "make" "mrproper" "headers_check"))))))
95 `(lambda* (#:key outputs #:allow-other-keys)
96 (let ((out (assoc-ref outputs "out")))
97 (and (zero? (system* "make"
98 (string-append "INSTALL_HDR_PATH=" out)
100 (mkdir (string-append out "/include/config"))
101 (call-with-output-file
103 "/include/config/kernel.release")
105 (format p "~a-default~%" ,version))))))))
107 (name "linux-libre-headers")
111 (uri (linux-libre-urls version))
114 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
115 (build-system gnu-build-system)
116 (native-inputs `(("perl" ,perl)))
118 `(#:modules ((guix build gnu-build-system)
121 #:phases (alist-replace
122 'build ,(build-phase (or (%current-target-system)
125 'install ,install-phase
126 (alist-delete 'configure %standard-phases)))
128 (synopsis "GNU Linux-Libre kernel headers")
129 (description "Headers of the Linux-Libre kernel.")
131 (home-page "http://www.gnu.org/software/linux-libre/"))))
133 (define-public module-init-tools
135 (name "module-init-tools")
140 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
144 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
146 (list (search-patch "module-init-tools-moduledir.patch")))))
147 (build-system gnu-build-system)
149 ;; FIXME: The upstream tarball lacks man pages, and building them would
150 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
151 ;; but they vanished. In the meantime, fake it.
152 '(#:phases (alist-cons-before
153 'configure 'fake-docbook
155 (substitute* "Makefile.in"
156 (("^DOCBOOKTOMAN.*$")
157 "DOCBOOKTOMAN = true\n")))
159 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
160 (synopsis "Tools for loading and managing Linux kernel modules")
162 "Tools for loading and managing Linux kernel modules, such as `modprobe',
163 `insmod', `lsmod', and more.")
166 (define %boot-logo-patch
167 ;; Linux-Libre boot logo featuring Freedo and a gnu.
170 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
171 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
174 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
176 (define (kernel-config system)
177 "Return the absolute file name of the Linux-Libre build configuration file
178 for SYSTEM, or #f if there is no configuration for SYSTEM."
179 (define (lookup file)
180 (let ((file (string-append "gnu/packages/" file)))
181 (search-path %load-path file)))
185 (lookup "linux-libre-i686.conf"))
187 (lookup "linux-libre-x86_64.conf"))
191 (define-public linux-libre
192 (let* ((version "3.16.2")
194 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
195 ;; Apply the neat patch.
196 (system* "patch" "-p1" "--batch"
197 "-i" (assoc-ref inputs "patch/freedo+gnu"))
199 (let ((arch (car (string-split system #\-))))
201 (cond ((string=? arch "i686") "i386")
203 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
205 (let ((build (assoc-ref %standard-phases 'build))
206 (config (assoc-ref inputs "kconfig")))
208 ;; Use the architecture-specific config if available, and
209 ;; 'defconfig' otherwise.
212 (copy-file config ".config")
213 (chmod ".config" #o666))
214 (system* "make" "defconfig"))
216 ;; Appending works even when the option wasn't in the
217 ;; file. The last one prevails if duplicated.
218 (let ((port (open-file ".config" "a")))
219 (display (string-append "CONFIG_NET_9P=m\n"
220 "CONFIG_NET_9P_VIRTIO=m\n"
221 "CONFIG_VIRTIO_BLK=m\n"
222 "CONFIG_VIRTIO_NET=m\n"
223 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
224 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
225 "CONFIG_VIRTIO_PCI=m\n"
226 "CONFIG_VIRTIO_BALLOON=m\n"
227 "CONFIG_VIRTIO_MMIO=m\n"
234 (zero? (system* "make" "oldconfig"))
236 ;; Call the default `build' phase so `-j' is correctly
238 (apply build #:make-flags "all" args))))
240 `(lambda* (#:key inputs outputs #:allow-other-keys)
241 (let* ((out (assoc-ref outputs "out"))
242 (moddir (string-append out "/lib/modules"))
243 (mit (assoc-ref inputs "module-init-tools")))
245 (for-each (lambda (file)
247 (string-append out "/" (basename file))))
248 (find-files "." "^(bzImage|System\\.map)$"))
249 (copy-file ".config" (string-append out "/config"))
250 (zero? (system* "make"
251 (string-append "DEPMOD=" mit "/sbin/depmod")
252 (string-append "MODULE_DIR=" moddir)
253 (string-append "INSTALL_PATH=" out)
254 (string-append "INSTALL_MOD_PATH=" out)
255 "INSTALL_MOD_STRIP=1"
256 "modules_install"))))))
262 (uri (linux-libre-urls version))
265 "1p08cqy6427yi808fpbwbb4zbwhnkibj2i1wbrfa5rjhd4vnnffz"))))
266 (build-system gnu-build-system)
267 (native-inputs `(("perl" ,perl)
269 ("module-init-tools" ,module-init-tools)
270 ("patch/freedo+gnu" ,%boot-logo-patch)
272 ,@(let ((conf (kernel-config (or (%current-target-system)
273 (%current-system)))))
278 `(#:modules ((guix build gnu-build-system)
282 #:phases (alist-replace
285 'install ,install-phase
286 (alist-delete 'configure %standard-phases)))
288 (synopsis "100% free redistribution of a cleaned Linux kernel")
290 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
291 It has been modified to remove all non-free binary blobs.")
293 (home-page "http://www.gnu.org/software/linux-libre/"))))
297 ;;; Pluggable authentication modules (PAM).
300 (define-public linux-pam
307 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
309 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
310 version ".tar.bz2")))
313 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
314 (build-system gnu-build-system)
318 ;; TODO: optional dependencies
319 ;; ("libxcrypt" ,libxcrypt)
320 ;; ("cracklib" ,cracklib)
323 '(;; Most users, such as `shadow', expect the headers to be under
325 #:configure-flags (list (string-append "--includedir="
326 (assoc-ref %outputs "out")
327 "/include/security"))
329 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
332 (home-page "http://www.linux-pam.org/")
333 (synopsis "Pluggable authentication modules for Linux")
335 "A *Free* project to implement OSF's RFC 86.0.
336 Pluggable authentication modules are small shared object files that can
337 be used through the PAM API to perform tasks, like authenticating a user
338 at login. Local and dynamic reconfiguration are its key features")
346 (define-public psmisc
353 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
357 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
358 (build-system gnu-build-system)
359 (inputs `(("ncurses" ,ncurses)))
360 (home-page "http://psmisc.sourceforge.net/")
362 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
364 "This PSmisc package is a set of some small useful utilities that
365 use the proc filesystem. We're not about changing the world, but
366 providing the system administrator with some help in common tasks.")
369 (define-public util-linux
375 (uri (string-append "mirror://kernel.org/linux/utils/"
376 name "/v" version "/"
377 name "-" version ".2" ".tar.xz"))
380 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))
381 (patches (list (search-patch "util-linux-perl.patch")))))
382 (build-system gnu-build-system)
384 `(#:configure-flags '("--disable-use-tty-group"
386 #:phases (alist-cons-after
387 'install 'patch-chkdupexe
388 (lambda* (#:key outputs #:allow-other-keys)
389 (let ((out (assoc-ref outputs "out")))
390 (substitute* (string-append out "/bin/chkdupexe")
391 ;; Allow 'patch-shebang' to do its work.
392 (("@PERL@") "/bin/perl"))))
394 (inputs `(("zlib" ,guix:zlib)
395 ("ncurses" ,ncurses)))
398 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
399 (synopsis "Collection of utilities for the Linux kernel")
401 "util-linux is a random collection of utilities for the Linux kernel.")
403 ;; Note that util-linux doesn't use the same license for all the
404 ;; code. GPLv2+ is the default license for a code without an
405 ;; explicitly defined license.
406 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
407 bsd-4 public-domain))))
409 (define-public procps
415 (uri (string-append "http://procps.sourceforge.net/procps-"
419 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
420 (patches (list (search-patch "procps-make-3.82.patch")))))
421 (build-system gnu-build-system)
422 (inputs `(("ncurses" ,ncurses)))
424 '(#:phases (alist-replace
426 (lambda* (#:key outputs #:allow-other-keys)
427 ;; No `configure', just a single Makefile.
428 (let ((out (assoc-ref outputs "out")))
429 (substitute* "Makefile"
431 (("--(owner|group) 0") "")
432 (("ldconfig") "true")
433 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
434 ;; Add libproc to the RPATH.
435 (string-append "LDFLAGS := -Wl,-rpath="
440 (lambda* (#:key outputs #:allow-other-keys)
441 (let ((out (assoc-ref outputs "out")))
443 (system* "make" "install"
444 (string-append "DESTDIR=" out)))
448 (system* (string-append out "/bin/ps")
452 ;; What did you expect? Tests?
454 (home-page "http://procps.sourceforge.net/")
455 (synopsis "Utilities that give information about processes")
457 "procps is the package that has a bunch of small useful utilities
458 that give information about processes using the Linux /proc file system.
459 The package includes the programs ps, top, vmstat, w, kill, free,
460 slabtop, and skill.")
463 (define-public usbutils
470 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
471 "usbutils-" version ".tar.xz"))
474 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
475 (build-system gnu-build-system)
477 `(("libusb" ,libusb)))
479 `(("pkg-config" ,pkg-config)))
480 (home-page "http://www.linux-usb.org/")
482 "Tools for working with USB devices, such as lsusb")
484 "Tools for working with USB devices, such as lsusb.")
487 (define-public e2fsprogs
493 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
497 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
498 (build-system gnu-build-system)
499 (inputs `(("util-linux" ,util-linux)))
500 (native-inputs `(("pkg-config" ,pkg-config)
501 ("texinfo" ,texinfo))) ; for the libext2fs Info manual
503 '(#:phases (alist-cons-before
504 'configure 'patch-shells
506 (substitute* "configure"
507 (("/bin/sh (.*)parse-types.sh" _ dir)
508 (string-append (which "sh") " " dir
510 (substitute* (find-files "." "^Makefile.in$")
512 (string-append "#!" (which "sh")))))
515 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
516 ;; they fail because we get an extra line that says "Can't check if
517 ;; filesystem is mounted due to missing mtab file".
519 (home-page "http://e2fsprogs.sourceforge.net/")
520 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
522 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
523 (license (list gpl2 ; programs
527 (define-public e2fsck/static
529 (name "e2fsck-static")
530 (version (package-version e2fsprogs))
531 (build-system trivial-build-system)
534 `(#:modules ((guix build utils))
537 (use-modules (guix build utils)
541 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
543 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
545 (with-directory-excursion bin
546 (for-each (lambda (file)
547 (copy-file (string-append source "/" file)
549 (remove-store-references file)
551 (scandir source (cut string-prefix? "fsck." <>))))))))
552 (inputs `(("e2fsprogs" ,(static-package e2fsprogs))))
553 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
555 "This package provides statically-linked command of fsck.ext[234] taken
556 from the e2fsprogs package. It is meant to be used in initrds.")
557 (home-page (package-home-page e2fsprogs))
558 (license (package-license e2fsprogs))))
560 (define-public strace
566 (uri (string-append "mirror://sourceforge/strace/strace-"
570 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
571 (build-system gnu-build-system)
572 (native-inputs `(("perl" ,perl)))
573 (home-page "http://strace.sourceforge.net/")
574 (synopsis "System call tracer for Linux")
576 "strace is a system call tracer, i.e. a debugging tool which prints out a
577 trace of all the system calls made by a another process/program.")
580 (define-public alsa-lib
587 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
591 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
592 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
593 (build-system gnu-build-system)
594 (home-page "http://www.alsa-project.org/")
595 (synopsis "The Advanced Linux Sound Architecture libraries")
597 "The Advanced Linux Sound Architecture (ALSA) provides audio and
598 MIDI functionality to the Linux-based operating system.")
601 (define-public alsa-utils
607 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
611 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
612 (build-system gnu-build-system)
614 ;; XXX: Disable man page creation until we have DocBook.
615 '(#:configure-flags (list "--disable-xmlto"
617 ;; The udev rule is responsible for restoring
619 (string-append "--with-udev-rules-dir="
620 (assoc-ref %outputs "out")
621 "/lib/udev/rules.d"))
622 #:phases (alist-cons-before
623 'install 'pre-install
625 ;; Don't try to mkdir /var/lib/alsa.
626 (substitute* "Makefile"
627 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
631 `(("libsamplerate" ,libsamplerate)
633 ("alsa-lib" ,alsa-lib)
635 ("gettext" ,gnu-gettext)))
636 (home-page "http://www.alsa-project.org/")
637 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
639 "The Advanced Linux Sound Architecture (ALSA) provides audio and
640 MIDI functionality to the Linux-based operating system.")
642 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
646 (define-public iptables
653 "http://www.netfilter.org/projects/iptables/files/iptables-"
657 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
658 (build-system gnu-build-system)
659 (arguments '(#:tests? #f)) ; no test suite
660 (home-page "http://www.netfilter.org/projects/iptables/index.html")
661 (synopsis "Program to configure the Linux IP packet filtering rules")
663 "iptables is the userspace command line program used to configure the
664 Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
665 system administrators. Since Network Address Translation is also configured
666 from the packet filter ruleset, iptables is used for this, too. The iptables
667 package also includes ip6tables. ip6tables is used for configuring the IPv6
671 (define-public iproute
678 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
682 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
683 (build-system gnu-build-system)
685 `(#:tests? #f ; no test suite
686 #:make-flags (let ((out (assoc-ref %outputs "out")))
688 (string-append "LIBDIR=" out "/lib")
689 (string-append "SBINDIR=" out "/sbin")
690 (string-append "CONFDIR=" out "/etc")
691 (string-append "DOCDIR=" out "/share/doc/"
693 (string-append "MANDIR=" out "/share/man")))
694 #:phases (alist-cons-before
695 'install 'pre-install
697 ;; Don't attempt to create /var/lib/arpd.
698 (substitute* "Makefile"
699 (("^.*ARPDDIR.*$") "")))
702 `(("iptables" ,iptables)
705 `(("pkg-config" ,pkg-config)
709 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
711 "A collection of utilities for controlling TCP/IP networking and traffic control in Linux")
713 "Iproute2 is a collection of utilities for controlling TCP/IP
714 networking and traffic with the Linux kernel.
716 Most network configuration manuals still refer to ifconfig and route as the
717 primary network configuration tools, but ifconfig is known to behave
718 inadequately in modern network environments. They should be deprecated, but
719 most distros still include them. Most network configuration systems make use
720 of ifconfig and thus provide a limited feature set. The /etc/net project aims
721 to support most modern network technologies, as it doesn't use ifconfig and
722 allows a system administrator to make use of all iproute2 features, including
725 iproute2 is usually shipped in a package called iproute or iproute2 and
726 consists of several tools, of which the most important are ip and tc. ip
727 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
728 tools print detailed usage messages and are accompanied by a set of
732 (define-public net-tools
733 ;; XXX: This package is basically unmaintained, but it provides a few
734 ;; commands not yet provided by Inetutils, such as 'route', so we have to
739 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
742 (uri (string-append home-page "/" name "-"
746 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))))
747 (build-system gnu-build-system)
749 '(#:phases (alist-cons-after
751 (lambda* (#:key inputs #:allow-other-keys)
752 (define (apply-patch file)
753 (zero? (system* "patch" "-p1" "--batch"
756 (let ((patch.gz (assoc-ref inputs "patch")))
757 (format #t "applying Debian patch set '~a'...~%"
759 (system (string-append "gunzip < " patch.gz " > the-patch"))
761 (and (apply-patch "the-patch")
762 (for-each apply-patch
763 (find-files "debian/patches"
767 (lambda* (#:key outputs #:allow-other-keys)
768 (let ((out (assoc-ref outputs "out")))
769 (mkdir-p (string-append out "/bin"))
770 (mkdir-p (string-append out "/sbin"))
772 ;; Pretend we have everything...
773 (system "yes | make config")
775 ;; ... except we don't have libdnet, so remove that
777 (substitute* '("config.make" "config.h")
778 (("^.*HAVE_AFDECnet.*$") ""))))
781 ;; Binaries that depend on libnet-tools.a don't declare that
782 ;; dependency, making it parallel-unsafe.
785 #:tests? #f ; no test suite
786 #:make-flags (let ((out (assoc-ref %outputs "out")))
788 (string-append "BASEDIR=" out)
789 (string-append "INSTALLNLSDIR=" out "/share/locale")
790 (string-append "mandir=/share/man")))))
792 ;; Use the big Debian patch set (the thing does not even compile out of
794 (inputs `(("patch" ,(origin
797 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
800 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
801 (native-inputs `(("gettext" ,gnu-gettext)))
803 (synopsis "Tools for controlling the network subsystem in Linux")
805 "This package includes the important tools for controlling the network
806 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
807 netstat, rarp and route. Additionally, this package contains utilities
808 relating to particular network hardware types (plipconfig, slattach) and
809 advanced aspects of IP configuration (iptunnel, ipmaddr).")
812 (define-public libcap
819 ;; Tarballs used to be available from
820 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
821 ;; but they never came back after kernel.org was compromised.
823 "mirror://debian/pool/main/libc/libcap2/libcap2_"
824 version ".orig.tar.gz"))
827 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
828 (build-system gnu-build-system)
829 (arguments '(#:phases (alist-delete 'configure %standard-phases)
830 #:tests? #f ; no 'check' target
831 #:make-flags (list "lib=lib"
832 (string-append "prefix="
833 (assoc-ref %outputs "out"))
834 "RAISE_SETFCAP=no")))
835 (native-inputs `(("perl" ,perl)))
836 (inputs `(("attr" ,attr)))
837 (home-page "https://sites.google.com/site/fullycapable/")
838 (synopsis "Library for working with POSIX capabilities")
840 "libcap2 provides a programming interface to POSIX capabilities on
841 Linux-based operating systems.")
843 ;; License is BSD-3 or GPLv2, at the user's choice.
846 (define-public bridge-utils
848 (name "bridge-utils")
852 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
856 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
857 (build-system gnu-build-system)
859 ;; The tarball lacks all the generated files.
860 (native-inputs `(("autoconf" ,autoconf)
861 ("automake" ,automake)))
863 '(#:phases (alist-cons-before
864 'configure 'bootstrap
866 (zero? (system* "autoreconf" "-vf")))
868 #:tests? #f)) ; no 'check' target
871 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
872 (synopsis "Manipulate Ethernet bridges")
874 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
875 to connect two Ethernet segments together in a protocol independent way.
876 Packets are forwarded based on Ethernet address, rather than IP address (like
877 a router). Since forwarding is done at Layer 2, all protocols can go
878 transparently through a bridge.")
888 "http://www.infradead.org/~tgr/libnl/files/libnl-"
892 "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd"))))
893 (build-system gnu-build-system)
894 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
895 (home-page "http://www.infradead.org/~tgr/libnl/")
896 (synopsis "NetLink protocol library suite")
898 "The libnl suite is a collection of libraries providing APIs to netlink
899 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
900 between the kernel and user space processes. It was designed to be a more
901 flexible successor to ioctl to provide mainly networking related kernel
902 configuration and monitoring interfaces.")
904 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
905 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
908 (define-public powertop
916 "https://01.org/powertop/sites/default/files/downloads/powertop-"
920 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
921 (build-system gnu-build-system)
923 ;; TODO: Add pciutils.
924 `(("zlib" ,guix:zlib)
925 ;; ("pciutils" ,pciutils)
929 `(("pkg-config" ,pkg-config)))
930 (home-page "https://01.org/powertop/")
931 (synopsis "Analyze power consumption on Intel-based laptops")
933 "PowerTOP is a Linux tool to diagnose issues with power consumption and
934 power management. In addition to being a diagnostic tool, PowerTOP also has
935 an interactive mode where the user can experiment various power management
936 settings for cases where the operating system has not enabled these
947 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
951 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
952 (build-system gnu-build-system)
953 (inputs `(("ncurses" ,ncurses)))
954 (home-page "http://www.jpj.net/~trevor/aumix.html")
955 (synopsis "Audio mixer for X and the console")
957 "Aumix adjusts an audio mixer from X, the console, a terminal,
958 the command line or a script.")
968 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
971 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
972 (build-system python-build-system)
974 ;; The setup.py script expects python-2.
976 ;; There are currently no checks in the package.
978 (native-inputs `(("python" ,python-2)))
979 (home-page "http://guichaz.free.fr/iotop/")
981 "Displays the IO activity of running processes")
983 "Iotop is a Python program with a top like user interface to show the
984 processes currently causing I/O.")
993 (uri (string-append "mirror://sourceforge/fuse/fuse-"
997 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))))
998 (build-system gnu-build-system)
999 (inputs `(("util-linux" ,util-linux)))
1001 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1002 (assoc-ref %outputs "out")
1004 (string-append "INIT_D_PATH="
1005 (assoc-ref %outputs "out")
1007 (string-append "UDEV_RULES_PATH="
1008 (assoc-ref %outputs "out")
1010 #:phases (alist-cons-before
1011 'build 'set-file-names
1012 (lambda* (#:key inputs #:allow-other-keys)
1013 ;; libfuse calls out to mount(8) and umount(8). Make sure
1014 ;; it refers to the right ones.
1015 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1016 (("/bin/(u?)mount" _ maybe-u)
1017 (string-append (assoc-ref inputs "util-linux")
1018 "/bin/" maybe-u "mount")))
1019 (substitute* '("util/mount.fuse.c")
1023 ;; This hack leads libfuse to search for 'fusermount' in
1024 ;; $PATH, where it may find a setuid-root binary, instead of
1025 ;; trying solely $out/sbin/fusermount and failing because
1027 (substitute* "lib/Makefile"
1028 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1029 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1031 (home-page "http://fuse.sourceforge.net/")
1032 (synopsis "Support file systems implemented in user space")
1034 "As a consequence of its monolithic design, file system code for Linux
1035 normally goes into the kernel itself---which is not only a robustness issue,
1036 but also an impediment to system extensibility. FUSE, for \"file systems in
1037 user space\", is a kernel module and user-space library that tries to address
1038 part of this problem by allowing users to run file system implementations as
1039 user-space processes.")
1040 (license (list lgpl2.1 ; library
1041 gpl2+)))) ; command-line utilities
1043 (define-public unionfs-fuse
1045 (name "unionfs-fuse")
1050 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1054 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1055 (build-system cmake-build-system)
1056 (inputs `(("fuse" ,fuse)))
1057 (arguments '(#:tests? #f)) ; no tests
1058 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1059 (synopsis "User-space union file system")
1061 "UnionFS-FUSE is a flexible union file system implementation in user
1062 space, using the FUSE library. Mounting a union file system allows you to
1063 \"aggregate\" the contents of several directories into a single mount point.
1064 UnionFS-FUSE additionally supports copy-on-write.")
1068 (package (inherit fuse)
1069 (name "fuse-static")
1070 (source (origin (inherit (package-source fuse))
1071 (modules '((guix build utils)))
1073 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1074 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1075 ;; it doesn't do that, allowing us to remove the dependency on
1076 ;; util-linux (something that is useful in initrds.)
1077 '(substitute* '("lib/mount_util.c"
1078 "util/mount_util.c")
1079 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1084 (define-public unionfs-fuse/static
1085 (package (inherit unionfs-fuse)
1086 (synopsis "User-space union file system (statically linked)")
1087 (name (string-append (package-name unionfs-fuse) "-static"))
1088 (source (origin (inherit (package-source unionfs-fuse))
1089 (modules '((guix build utils)))
1091 ;; Add -ldl to the libraries, because libfuse.a needs that.
1092 '(substitute* "src/CMakeLists.txt"
1093 (("target_link_libraries(.*)\\)" _ libs)
1094 (string-append "target_link_libraries"
1098 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1099 #:phases (alist-cons-after
1100 'install 'post-install
1101 (lambda* (#:key outputs #:allow-other-keys)
1102 (let* ((out (assoc-ref outputs "out"))
1103 (exe (string-append out "/bin/unionfs")))
1104 ;; By default, 'unionfs' keeps references to
1105 ;; $glibc/share/locale and similar stuff. Remove them.
1106 (remove-store-references exe)))
1108 (inputs `(("fuse" ,fuse-static)))))
1110 (define-public sshfs-fuse
1116 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1120 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1121 (build-system gnu-build-system)
1126 `(("pkg-config" ,pkg-config)))
1127 (home-page "http://fuse.sourceforge.net/sshfs.html")
1128 (synopsis "Mount remote file systems over SSH")
1130 "This is a file system client based on the SSH File Transfer Protocol.
1131 Since most SSH servers already support this protocol it is very easy to set
1132 up: on the server side there's nothing to do; on the client side mounting the
1133 file system is as easy as logging into the server with an SSH client.")
1136 (define-public numactl
1143 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1148 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1149 (build-system gnu-build-system)
1151 '(#:phases (alist-replace
1153 (lambda* (#:key outputs #:allow-other-keys)
1154 ;; There's no 'configure' script, just a raw makefile.
1155 (substitute* "Makefile"
1157 (string-append "prefix := " (assoc-ref outputs "out")
1160 ;; By default the thing tries to install under
1161 ;; $prefix/lib64 when on a 64-bit platform.
1162 (string-append "libdir := $(prefix)/lib\n"))))
1166 ;; By default the thing tries to use 'cc'.
1169 ;; Make sure programs have an RPATH so they can find
1171 (string-append "LDLIBS=-Wl,-rpath="
1172 (assoc-ref %outputs "out") "/lib"))
1174 ;; There's a 'test' target, but it requires NUMA support in the kernel
1175 ;; to run, which we can't assume to have.
1177 (home-page "http://oss.sgi.com/projects/libnuma/")
1178 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1180 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1181 memory is not all in one place. The numactl program allows you to run your
1182 application program on specific CPU's and memory nodes. It does this by
1183 supplying a NUMA memory policy to the operating system before running your
1186 The package contains other commands, such as numademo, numastat and memhog.
1187 The numademo command provides a quick overview of NUMA performance on your
1189 (license (list gpl2 ; programs
1190 lgpl2.1)))) ; library
1198 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1202 "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm"))
1203 (modules '((guix build utils)))
1206 (substitute* "tests/Makefile.in"
1207 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1210 (substitute* '("src/unicode_start" "src/unicode_stop")
1211 ;; Assume the Coreutils are in $PATH.
1214 (build-system gnu-build-system)
1216 '(#:phases (alist-cons-before
1218 (lambda* (#:key inputs #:allow-other-keys)
1219 (let ((gzip (assoc-ref %build-inputs "gzip"))
1220 (bzip2 (assoc-ref %build-inputs "bzip2")))
1221 (substitute* "src/libkeymap/findfile.c"
1223 (string-append gzip "/bin/gzip"))
1225 (string-append bzip2 "/bin/bzip2")))))
1227 'install 'post-install
1228 (lambda* (#:key outputs #:allow-other-keys)
1229 ;; Make sure these programs find their comrades.
1230 (let* ((out (assoc-ref outputs "out"))
1231 (bin (string-append out "/bin")))
1232 (for-each (lambda (prog)
1233 (wrap-program (string-append bin "/" prog)
1234 `("PATH" ":" prefix (,bin))))
1235 '("unicode_start" "unicode_stop"))))
1236 %standard-phases))))
1237 (inputs `(("check" ,check)
1239 ("bzip2" ,guix:bzip2)
1240 ("pam" ,linux-pam)))
1241 (native-inputs `(("pkg-config" ,pkg-config)))
1242 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1243 (synopsis "Linux keyboard utilities and keyboard maps")
1245 "This package contains keytable files and keyboard utilities compatible
1246 for systems using the Linux kernel. This includes commands such as
1247 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1250 (define-public inotify-tools
1252 (name "inotify-tools")
1257 "mirror://sourceforge/inotify-tools/inotify-tools/"
1258 version "/inotify-tools-" version ".tar.gz"))
1261 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1262 (build-system gnu-build-system)
1263 (home-page "http://inotify-tools.sourceforge.net/")
1264 (synopsis "Monitor file accesses")
1266 "The inotify-tools packages provides a C library and command-line tools
1267 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1277 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1278 "kmod-" version ".tar.xz"))
1281 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1282 (patches (list (search-patch "kmod-module-directory.patch")))))
1283 (build-system gnu-build-system)
1285 `(("pkg-config" ,pkg-config)))
1288 ("zlib" ,guix:zlib)))
1290 `(#:tests? #f ; FIXME: Investigate test failures
1291 #:configure-flags '("--with-xz" "--with-zlib")
1292 #:phases (alist-cons-after
1293 'install 'install-modprobe&co
1294 (lambda* (#:key outputs #:allow-other-keys)
1295 (let* ((out (assoc-ref outputs "out"))
1296 (bin (string-append out "/bin")))
1297 (for-each (lambda (tool)
1299 (string-append bin "/" tool)))
1300 '("insmod" "rmmod" "lsmod" "modprobe"
1301 "modinfo" "depmod"))))
1303 (home-page "https://www.kernel.org/")
1304 (synopsis "Kernel module tools")
1305 (description "kmod is a set of tools to handle common tasks with Linux
1306 kernel modules like insert, remove, list, check properties, resolve
1307 dependencies and aliases.
1309 These tools are designed on top of libkmod, a library that is shipped with
1310 kmod. The aim is to be compatible with tools, configurations and indices
1311 from the module-init-tools project.")
1312 (license gpl2+))) ; library under lgpl2.1+
1321 "mirror://kernel.org/linux/utils/kernel/hotplug/udev-"
1325 "1awp7p07gi083w0dwqhhbbas68a7fx2sbm1yf1ip2jwf7cpqkf5d"))
1326 (patches (list (search-patch "udev-gir-libtool.patch")))))
1327 (build-system gnu-build-system)
1329 `(#:configure-flags (list (string-append
1330 "--with-pci-ids-path="
1331 (assoc-ref %build-inputs "pciutils")
1332 "/share/pci.ids.gz")
1334 "--with-firmware-path=/no/firmware"
1336 ;; Work around undefined reference to
1337 ;; 'mq_getattr' in sc-daemon.c.
1340 `(("pkg-config" ,pkg-config)
1342 ("glib" ,glib "bin") ; glib-genmarshal, etc.
1343 ("perl" ,perl) ; for the tests
1344 ("python" ,python-2))) ; ditto
1347 ("pciutils" ,pciutils)
1348 ("usbutils" ,usbutils)
1349 ("util-linux" ,util-linux)
1351 ("gobject-introspection" ,gobject-introspection)))
1352 (home-page "http://www.freedesktop.org/software/systemd/libudev/")
1353 (synopsis "Userspace device management")
1354 (description "Udev is a daemon which dynamically creates and removes
1355 device nodes from /dev/, handles hotplug events and loads drivers at boot
1357 (license gpl2+))) ; libudev is under lgpl2.1+
1362 (version "2.02.109")
1365 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1369 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1370 (modules '((guix build utils)))
1373 (use-modules (guix build utils))
1375 ;; Honor sysconfdir.
1376 (substitute* "make.tmpl.in"
1378 "confdir = @sysconfdir@\n")
1379 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1380 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1381 (build-system gnu-build-system)
1383 `(("pkg-config" ,pkg-config)
1384 ("procps" ,procps))) ;tests use 'pgrep'
1388 '(#:phases (alist-cons-after
1389 'configure 'set-makefile-shell
1391 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1393 (setenv "SHELL" (which "sh"))
1395 ;; Replace /bin/sh with the right file name.
1396 (patch-makefile-SHELL "make.tmpl"))
1399 #:configure-flags (list (string-append "--sysconfdir="
1400 (assoc-ref %outputs "out")
1402 "--enable-udev_sync"
1403 "--enable-udev_rules"
1405 ;; Make sure programs such as 'dmsetup' can
1406 ;; find libdevmapper.so.
1407 (string-append "LDFLAGS=-Wl,-rpath="
1408 (assoc-ref %outputs "out")
1411 ;; The tests use 'mknod', which requires root access.
1413 (home-page "http://sourceware.org/lvm2/")
1414 (synopsis "Logical volume management for Linux")
1416 "LVM2 is the logical volume management tool set for Linux-based systems.
1417 This package includes the user-space libraries and tools, including the device
1418 mapper. Kernel components are part of Linux-libre.")
1420 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1421 ;; Command-line tools are GPLv2.
1422 (license (list gpl2 lgpl2.1))))
1424 (define-public wireless-tools
1426 (name "wireless-tools")
1430 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1434 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))))
1435 (build-system gnu-build-system)
1437 `(#:phases (alist-replace
1439 (lambda* (#:key outputs #:allow-other-keys)
1440 (setenv "PREFIX" (assoc-ref outputs "out")))
1443 (synopsis "Tools for manipulating Linux Wireless Extensions")
1444 (description "Wireless Tools are used to manipulate the Linux Wireless
1445 Extensions. The Wireless Extension is an interface allowing you to set
1446 Wireless LAN specific parameters and get the specific stats.")
1447 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1450 (define-public lm-sensors
1457 "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-"
1458 version ".tar.bz2"))
1461 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1462 (patches (list (search-patch "lm-sensors-hwmon-attrs.patch")))))
1463 (build-system gnu-build-system)
1464 (inputs `(("rrdtool" ,rrdtool)
1467 ("gnuplot" ,gnuplot)))
1468 (native-inputs `(("pkg-config" ,pkg-config)
1473 `(#:tests? #f ; no 'check' target
1474 #:make-flags (list (string-append "PREFIX=" %output)
1475 (string-append "ETCDIR=" %output "/etc")
1476 (string-append "MANDIR=" %output "/share/man"))
1481 'build 'patch-exec-paths
1482 (lambda* (#:key inputs outputs #:allow-other-keys)
1483 (substitute* "prog/detect/sensors-detect"
1485 (string-append "`" (assoc-ref inputs "coreutils")
1487 (("(`|\")modprobe" all open-quote)
1488 (string-append open-quote
1489 (assoc-ref inputs "kmod")
1491 (substitute* '("prog/pwm/pwmconfig"
1492 "prog/pwm/fancontrol")
1494 (string-append (assoc-ref inputs "gnuplot")
1497 (string-append (assoc-ref inputs "coreutils")
1500 (string-append (assoc-ref inputs "grep")
1503 (string-append (assoc-ref inputs "sed")
1506 (string-append (assoc-ref inputs "coreutils")
1509 (string-append (assoc-ref inputs "coreutils")
1512 (string-append (assoc-ref inputs "coreutils")
1513 "/bin/readlink -f"))))
1514 %standard-phases))))
1515 (home-page "http://www.lm-sensors.org/")
1516 (synopsis "Utilities to read temperature/voltage/fan sensors")
1518 "lm-sensors is a hardware health monitoring package for Linux. It allows
1519 you to access information from temperature, voltage, and fan speed sensors.
1520 It works with most newer systems.")
1523 (define-public xsensors
1530 "http://www.linuxhardware.org/xsensors/xsensors-"
1534 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1535 (build-system gnu-build-system)
1536 (inputs `(("lm-sensors" ,lm-sensors)
1538 (native-inputs `(("pkg-config" ,pkg-config)))
1540 `(#:phases (alist-cons-before
1541 'configure 'enable-deprecated
1543 (substitute* "src/Makefile.in"
1544 (("-DGDK_DISABLE_DEPRECATED") "")
1545 (("-DGTK_DISABLE_DEPRECATED") "")))
1547 'configure 'remove-Werror
1549 (substitute* '("configure" "src/Makefile.in")
1551 %standard-phases))))
1552 (home-page "http://www.linuxhardware.org/xsensors/")
1553 (synopsis "Hardware health information viewer")
1555 "xsensors reads data from the libsensors library regarding hardware
1556 health such as temperature, voltage and fan speed and displays the information
1557 in a digital read-out.")