1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016 Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>
11 ;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
12 ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
13 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
14 ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
17 ;;; This file is part of GNU Guix.
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32 (define-module (gnu packages linux)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages gcc)
37 #:use-module (gnu packages flex)
38 #:use-module (gnu packages bison)
39 #:use-module (gnu packages admin)
40 #:use-module (gnu packages gperf)
41 #:use-module (gnu packages libusb)
42 #:use-module (gnu packages ncurses)
43 #:use-module (gnu packages pciutils)
44 #:use-module (gnu packages databases)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages slang)
49 #:use-module (gnu packages algebra)
50 #:use-module (gnu packages gettext)
51 #:use-module (gnu packages glib)
52 #:use-module (gnu packages pulseaudio)
53 #:use-module (gnu packages attr)
54 #:use-module (gnu packages xml)
55 #:use-module (gnu packages autotools)
56 #:use-module (gnu packages texinfo)
57 #:use-module (gnu packages check)
58 #:use-module (gnu packages maths)
59 #:use-module (gnu packages base)
60 #:use-module (gnu packages rrdtool)
61 #:use-module (gnu packages elf)
62 #:use-module (gnu packages gtk)
63 #:use-module (gnu packages docbook)
64 #:use-module (gnu packages documentation)
65 #:use-module (gnu packages readline)
66 #:use-module (gnu packages calendar)
67 #:use-module (gnu packages tls)
68 #:use-module (gnu packages freedesktop)
69 #:use-module (guix packages)
70 #:use-module (guix download)
71 #:use-module (guix utils)
72 #:use-module (guix build-system gnu)
73 #:use-module (guix build-system cmake)
74 #:use-module (guix build-system python)
75 #:use-module (guix build-system trivial)
76 #:use-module (srfi srfi-1)
77 #:use-module (srfi srfi-2)
78 #:use-module (srfi srfi-26)
79 #:use-module (ice-9 match))
81 (define-public (system->linux-architecture arch)
82 "Return the Linux architecture name for ARCH, a Guix system name such as
84 (let ((arch (car (string-split arch #\-))))
85 (cond ((string=? arch "i686") "i386")
86 ((string-prefix? "mips" arch) "mips")
87 ((string-prefix? "arm" arch) "arm")
88 ((string-prefix? "aarch64" arch) "arm64")
91 (define (linux-libre-urls version)
92 "Return a list of URLs for Linux-Libre VERSION."
94 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
95 version "-gnu/linux-libre-" version "-gnu.tar.xz")
97 ;; XXX: Work around <http://bugs.gnu.org/14851>.
99 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
100 version "-gnu.tar.xz")
102 ;; Maybe this URL will become valid eventually.
104 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
105 version "-gnu.tar.xz")))
107 (define-public linux-libre-headers
108 (let* ((version "3.14.37")
112 (setenv "ARCH" ,(system->linux-architecture arch))
113 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
115 (and (zero? (system* "make" "defconfig"))
116 (zero? (system* "make" "mrproper" "headers_check"))))))
118 `(lambda* (#:key outputs #:allow-other-keys)
119 (let ((out (assoc-ref outputs "out")))
120 (and (zero? (system* "make"
121 (string-append "INSTALL_HDR_PATH=" out)
124 (mkdir (string-append out "/include/config"))
125 (call-with-output-file
127 "/include/config/kernel.release")
129 (format p "~a-default~%" ,version)))
131 ;; Remove the '.install' and '..install.cmd' files; the
132 ;; latter contains store paths, which pulls in bootstrap
133 ;; binaries in the build environment, and prevents bit
134 ;; reproducibility for the bootstrap binaries.
135 (for-each delete-file (find-files out "\\.install"))
139 (name "linux-libre-headers")
143 (uri (linux-libre-urls version))
146 "1blxr2bsvfqi9khj4cpspv434bmx252zak2wsbi2mgl60zh77gza"))))
147 (build-system gnu-build-system)
148 (native-inputs `(("perl" ,perl)))
150 `(#:modules ((guix build gnu-build-system)
153 #:phases (alist-replace
154 'build ,(build-phase (or (%current-target-system)
157 'install ,install-phase
158 (alist-delete 'configure %standard-phases)))
159 #:allowed-references ()
161 (synopsis "GNU Linux-Libre kernel headers")
162 (description "Headers of the Linux-Libre kernel.")
163 (license license:gpl2)
164 (home-page "http://www.gnu.org/software/linux-libre/"))))
166 (define-public module-init-tools
168 (name "module-init-tools")
173 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
177 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
178 (patches (search-patches "module-init-tools-moduledir.patch"))))
179 (build-system gnu-build-system)
181 ;; FIXME: The upstream tarball lacks man pages, and building them would
182 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
183 ;; but they vanished. In the meantime, fake it.
184 '(#:phases (alist-cons-before
185 'configure 'fake-docbook
187 (substitute* "Makefile.in"
188 (("^DOCBOOKTOMAN.*$")
189 "DOCBOOKTOMAN = true\n")))
191 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
192 (synopsis "Tools for loading and managing Linux kernel modules")
194 "Tools for loading and managing Linux kernel modules, such as `modprobe',
195 `insmod', `lsmod', and more.")
196 (license license:gpl2+)))
198 (define %boot-logo-patch
199 ;; Linux-Libre boot logo featuring Freedo and a gnu.
202 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
203 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
206 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
208 (define* (kernel-config system #:key variant)
209 "Return the absolute file name of the Linux-Libre build configuration file
210 for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
211 (and-let* ((arch (match system
218 (name (string-append "linux-libre-"
220 (string-append variant "-")
224 (file (string-append "gnu/packages/" name)))
225 (search-path %load-path file)))
227 (define-public linux-libre
228 (let* ((version "4.5.4")
230 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
231 ;; Avoid introducing timestamps
232 (setenv "KCONFIG_NOTIMESTAMP" "1")
233 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
235 ;; Apply the neat patch.
236 (system* "patch" "-p1" "--force"
237 "-i" (assoc-ref inputs "patch/freedo+gnu"))
239 (let ((arch (car (string-split system #\-))))
241 (cond ((string=? arch "i686") "i386")
242 ((string=? arch "mips64el") "mips")
244 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
246 (let ((build (assoc-ref %standard-phases 'build))
247 (config (assoc-ref inputs "kconfig")))
249 ;; Use the architecture-specific config if available, and
250 ;; 'defconfig' otherwise.
253 (copy-file config ".config")
254 (chmod ".config" #o666))
255 (system* "make" "defconfig"))
257 ;; Appending works even when the option wasn't in the
258 ;; file. The last one prevails if duplicated.
259 (let ((port (open-file ".config" "a")))
260 (display (string-append "CONFIG_NET_9P=m\n"
261 "CONFIG_NET_9P_VIRTIO=m\n"
262 "CONFIG_VIRTIO_BLK=m\n"
263 "CONFIG_VIRTIO_NET=m\n"
264 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
265 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
266 "CONFIG_VIRTIO_PCI=m\n"
267 "CONFIG_VIRTIO_BALLOON=m\n"
268 "CONFIG_VIRTIO_MMIO=m\n"
275 (zero? (system* "make" "oldconfig"))
277 ;; Call the default `build' phase so `-j' is correctly
279 (apply build #:make-flags "all" args))))
281 `(lambda* (#:key inputs outputs #:allow-other-keys)
282 (let* ((out (assoc-ref outputs "out"))
283 (moddir (string-append out "/lib/modules"))
284 (mit (assoc-ref inputs "module-init-tools")))
286 (for-each (lambda (file)
288 (string-append out "/" (basename file))))
289 (find-files "." "^(bzImage|vmlinuz|System\\.map)$"))
290 (copy-file ".config" (string-append out "/config"))
291 (zero? (system* "make"
292 (string-append "DEPMOD=" mit "/sbin/depmod")
293 (string-append "MODULE_DIR=" moddir)
294 (string-append "INSTALL_PATH=" out)
295 (string-append "INSTALL_MOD_PATH=" out)
296 "INSTALL_MOD_STRIP=1"
297 "modules_install"))))))
303 (uri (linux-libre-urls version))
306 "0c587v03kz5whh82apva6gwqvczdi6djy29gk0gfd9dbkb2518b1"))))
307 (build-system gnu-build-system)
308 (supported-systems '("x86_64-linux" "i686-linux"))
309 (native-inputs `(("perl" ,perl)
312 ("module-init-tools" ,module-init-tools)
313 ("patch/freedo+gnu" ,%boot-logo-patch)
315 ,@(let ((conf (kernel-config
316 (or (%current-target-system)
318 #:variant (version-major+minor version))))
323 `(#:modules ((guix build gnu-build-system)
327 #:phases (alist-replace
330 'install ,install-phase
331 (alist-delete 'configure %standard-phases)))
333 (synopsis "100% free redistribution of a cleaned Linux kernel")
335 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
336 It has been modified to remove all non-free binary blobs.")
337 (license license:gpl2)
338 (home-page "http://www.gnu.org/software/linux-libre/"))))
340 (define-public linux-libre-4.4
342 (inherit linux-libre)
346 (uri (linux-libre-urls version))
349 "1k7h632vgh3wlz44qqawy238f4mzn19bm9sz9zqq0ql6wwhkjdkj"))))
351 (let ((conf (kernel-config (or (%current-target-system)
354 `(,@(alist-delete "kconfig" (package-native-inputs linux-libre))
355 ("kconfig" ,conf))))))
357 (define-public linux-libre-4.1
359 (inherit linux-libre)
363 (uri (linux-libre-urls version))
366 "14jlnq0k86bl4wj8shmvgf34w90bbm9in44j1pdjwwvn169zh9ra"))))
368 (let ((conf (kernel-config (or (%current-target-system)
371 `(,@(alist-delete "kconfig" (package-native-inputs linux-libre))
372 ("kconfig" ,conf))))))
376 ;;; Pluggable authentication modules (PAM).
379 (define-public linux-pam
386 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
388 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
389 version ".tar.bz2")))
392 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))))
393 (build-system gnu-build-system)
397 ;; TODO: optional dependencies
398 ;; ("libxcrypt" ,libxcrypt)
399 ;; ("cracklib" ,cracklib)
402 '(;; Most users, such as `shadow', expect the headers to be under
404 #:configure-flags (list (string-append "--includedir="
405 (assoc-ref %outputs "out")
406 "/include/security"))
408 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
411 (home-page "http://www.linux-pam.org/")
412 (synopsis "Pluggable authentication modules for Linux")
414 "A *Free* project to implement OSF's RFC 86.0.
415 Pluggable authentication modules are small shared object files that can
416 be used through the PAM API to perform tasks, like authenticating a user
417 at login. Local and dynamic reconfiguration are its key features.")
418 (license license:bsd-3)))
425 (define-public psmisc
432 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
436 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
437 (build-system gnu-build-system)
438 (inputs `(("ncurses" ,ncurses)))
439 (home-page "http://psmisc.sourceforge.net/")
441 "Small utilities that use the proc filesystem")
443 "This PSmisc package is a set of some small useful utilities that
444 use the proc filesystem. We're not about changing the world, but
445 providing the system administrator with some help in common tasks.")
446 (license license:gpl2+)))
448 (define-public util-linux
454 (uri (string-append "mirror://kernel.org/linux/utils/"
455 name "/v" (version-major+minor version) "/"
456 name "-" version ".tar.xz"))
459 "1ivdx1bhjbakf77agm9dn3wyxia1wgz9lzxgd61zqxw3xzih9gzw"))
460 (patches (search-patches "util-linux-tests.patch"))
461 (modules '((guix build utils)))
463 ;; We take the 'logger' program from GNU Inetutils and 'kill'
464 ;; from GNU Coreutils.
466 (substitute* "configure"
467 (("build_logger=yes") "build_logger=no")
468 (("build_kill=yes") "build_kill=no"))
470 (build-system gnu-build-system)
472 `(#:configure-flags (list "--disable-use-tty-group"
474 ;; Do not build .a files to save 2 MiB.
477 ;; Install completions where our
478 ;; bash-completion package expects them.
479 (string-append "--with-bashcompletiondir="
480 (assoc-ref %outputs "out")
481 "/etc/bash_completion.d"))
482 #:phases (modify-phases %standard-phases
484 'build 'set-umount-file-name
485 (lambda* (#:key outputs #:allow-other-keys)
486 ;; Tell 'eject' the right file name of 'umount'.
487 (let ((out (assoc-ref outputs "out")))
488 (substitute* "sys-utils/eject.c"
490 (string-append "\"" out "/bin/umount\"")))
494 (lambda* (#:key inputs outputs #:allow-other-keys)
495 (let ((out (assoc-ref outputs "out"))
496 (net (assoc-ref inputs "net-base")))
497 ;; Change the test to refer to the right file.
498 (substitute* "tests/ts/misc/mcookie"
500 (string-append net "/etc/services")))
502 (inputs `(("zlib" ,zlib)
503 ("ncurses" ,ncurses)))
506 ("net-base" ,net-base))) ;for tests
507 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
508 (synopsis "Collection of utilities for the Linux kernel")
509 (description "Util-linux is a diverse collection of Linux kernel
510 utilities. It provides dmesg and includes tools for working with filesystems,
511 block devices, UUIDs, TTYs, and many other tools.")
513 ;; Note that util-linux doesn't use the same license for all the
514 ;; code. GPLv2+ is the default license for a code without an
515 ;; explicitly defined license.
516 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
517 license:bsd-4 license:public-domain))))
519 (define-public procps
525 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
526 "procps-ng-" version ".tar.xz"))
529 "1va4n0mpsq327ca9dqp4hnrpgs6821rp0f2m0jyc1bfjl9lk2jg9"))))
530 (build-system gnu-build-system)
532 '(#:modules ((guix build utils)
533 (guix build gnu-build-system)
537 (modify-phases %standard-phases
539 'install 'post-install
540 ;; Remove commands and man pages redudant with
542 (lambda* (#:key outputs #:allow-other-keys)
543 (let* ((out (assoc-ref outputs "out"))
544 (dup (append-map (cut find-files out <>)
545 '("^kill" "^uptime"))))
546 (for-each delete-file dup)
548 (inputs `(("ncurses" ,ncurses)))
549 (home-page "https://gitlab.com/procps-ng/procps/")
550 (synopsis "Utilities that give information about processes")
552 "Procps is the package that has a bunch of small useful utilities
553 that give information about processes using the Linux /proc file system.
554 The package includes the programs ps, top, vmstat, w, kill, free,
555 slabtop, and skill.")
556 (license license:gpl2)))
558 (define-public usbutils
565 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
566 "usbutils-" version ".tar.xz"))
569 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
570 (build-system gnu-build-system)
572 `(("libusb" ,libusb)))
574 `(("pkg-config" ,pkg-config)))
575 (home-page "http://www.linux-usb.org/")
577 "Tools for working with USB devices, such as lsusb")
579 "Tools for working with USB devices, such as lsusb.")
580 (license license:gpl2+)))
582 (define-public e2fsprogs
589 "mirror://kernel.org/linux/kernel/people/tytso/"
590 name "/v" version "/"
591 name "-" version ".tar.xz"))
594 "1ix0b83zgw5n0p2grh2961c6796m92yr2jqc2sbr23x3lfsp8r71"))
595 (modules '((guix build utils)))
597 '(substitute* "MCONFIG.in"
598 (("INSTALL_SYMLINK = /bin/sh")
599 "INSTALL_SYMLINK = sh")))))
600 (build-system gnu-build-system)
601 (inputs `(("util-linux" ,util-linux)))
602 (native-inputs `(("pkg-config" ,pkg-config)
603 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
605 '(;; util-linux is the preferred source for some of the libraries and
606 ;; commands, so disable them (see, e.g.,
607 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
608 #:configure-flags '("--disable-libblkid"
609 "--disable-libuuid" "--disable-uuidd"
612 ;; Install libext2fs et al.
613 "--enable-elf-shlibs")
615 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
616 (assoc-ref %outputs "out")
619 #:phases (alist-cons-before
620 'configure 'patch-shells
622 (substitute* "configure"
623 (("/bin/sh (.*)parse-types.sh" _ dir)
624 (string-append (which "sh") " " dir
626 (substitute* (find-files "." "^Makefile.in$")
628 (string-append "#!" (which "sh")))))
630 'install 'install-libs
631 (lambda* (#:key outputs #:allow-other-keys)
632 (let* ((out (assoc-ref outputs "out"))
633 (lib (string-append out "/lib")))
634 (and (zero? (system* "make" "install-libs"))
636 ;; Make the .a writable so that 'strip' works.
637 ;; Failing to do that, due to debug symbols, we
638 ;; retain a reference to the final
639 ;; linux-libre-headers, which refer to the
640 ;; bootstrap binaries.
641 (let ((archives (find-files lib "\\.a$")))
642 (for-each (lambda (file)
648 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
649 ;; they fail because we get an extra line that says "Can't check if
650 ;; filesystem is mounted due to missing mtab file".
652 (home-page "http://e2fsprogs.sourceforge.net/")
653 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
655 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
656 (license (list license:gpl2 ;programs
657 license:lgpl2.0 ;libext2fs
658 license:x11)))) ;libuuid
660 (define e2fsprogs/static
662 (package (inherit e2fsprogs)
664 ;; Do not build shared libraries.
665 (substitute-keyword-arguments (package-arguments e2fsprogs)
666 ((#:configure-flags _)
667 '(list "--disable-blkid"))
671 (define-public e2fsck/static
673 (name "e2fsck-static")
674 (version (package-version e2fsprogs))
675 (build-system trivial-build-system)
678 `(#:modules ((guix build utils))
681 (use-modules (guix build utils)
685 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
687 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
689 (with-directory-excursion bin
690 (for-each (lambda (file)
691 (copy-file (string-append source "/" file)
693 (remove-store-references file)
695 (scandir source (cut string-prefix? "fsck." <>))))))))
696 (inputs `(("e2fsprogs" ,e2fsprogs/static)))
697 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
699 "This package provides statically-linked command of fsck.ext[234] taken
700 from the e2fsprogs package. It is meant to be used in initrds.")
701 (home-page (package-home-page e2fsprogs))
702 (license (package-license e2fsprogs))))
704 (define-public extundelete
710 (uri (string-append "mirror://sourceforge/extundelete/"
711 version "/extundelete-" version ".tar.bz2"))
714 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
715 (build-system gnu-build-system)
716 (inputs `(("e2fsprogs" ,e2fsprogs)))
717 (home-page "http://extundelete.sourceforge.net/")
718 (synopsis "Recover deleted files from ext2/3/4 partitions")
720 "Extundelete is a set of tools that can recover deleted files from an
721 ext3 or ext4 partition.")
722 (license license:gpl2)))
724 (define-public zerofree
728 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
731 (uri (string-append home-page name "-" version
735 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
736 (build-system gnu-build-system)
738 '(#:phases (alist-replace
740 (lambda* (#:key outputs #:allow-other-keys)
741 (let* ((out (assoc-ref outputs "out"))
742 (bin (string-append out "/bin")))
744 (copy-file "zerofree"
745 (string-append bin "/zerofree"))
746 (chmod (string-append bin "/zerofree")
749 (alist-delete 'configure %standard-phases))
750 #:tests? #f)) ;no tests
751 (inputs `(("libext2fs" ,e2fsprogs)))
752 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
754 "The zerofree command scans the free blocks in an ext2 file system and
755 fills any non-zero blocks with zeroes. This is a useful way to make disk
756 images more compressible.")
757 (license license:gpl2)))
759 (define-public strace
765 (uri (string-append "mirror://sourceforge/strace/strace-"
769 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
770 (build-system gnu-build-system)
771 (native-inputs `(("perl" ,perl)))
772 (home-page "http://strace.sourceforge.net/")
773 (synopsis "System call tracer for Linux")
775 "strace is a system call tracer, i.e. a debugging tool which prints out a
776 trace of all the system calls made by a another process/program.")
777 (license license:bsd-3)))
779 (define-public ltrace
785 (uri (string-append "http://www.ltrace.org/ltrace_" version
789 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
790 (build-system gnu-build-system)
791 (inputs `(("libelf" ,libelf)))
793 ;; Compilation uses -Werror by default, but it fails.
794 '(#:configure-flags '("--disable-werror")))
795 (home-page "http://www.ltrace.org/")
796 (synopsis "Library call tracer for Linux")
798 "ltrace intercepts and records dynamic library calls which are called by
799 an executed process and the signals received by that process. It can also
800 intercept and print the system calls executed by the program.")
801 (license license:gpl2+)))
803 (define-public alsa-lib
810 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
814 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
815 (patches (search-patches "alsa-lib-mips-atomic-fix.patch"))))
816 (build-system gnu-build-system)
817 (home-page "http://www.alsa-project.org/")
818 (synopsis "The Advanced Linux Sound Architecture libraries")
820 "The Advanced Linux Sound Architecture (ALSA) provides audio and
821 MIDI functionality to the Linux-based operating system.")
822 (license license:lgpl2.1+)))
824 (define-public alsa-utils
830 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
831 name "-" version ".tar.bz2"))
834 "1wa88wvqcfhak9x3y65wzzwxmmyxb5bv2gyj7lnm653fnwsk271v"))))
835 (build-system gnu-build-system)
837 ;; XXX: Disable man page creation until we have DocBook.
838 '(#:configure-flags (list "--disable-xmlto"
840 ;; The udev rule is responsible for restoring
842 (string-append "--with-udev-rules-dir="
843 (assoc-ref %outputs "out")
844 "/lib/udev/rules.d"))
845 #:phases (alist-cons-before
846 'install 'pre-install
848 ;; Don't try to mkdir /var/lib/alsa.
849 (substitute* "Makefile"
850 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
854 `(("libsamplerate" ,libsamplerate)
856 ("alsa-lib" ,alsa-lib)
858 ("gettext" ,gnu-gettext)))
859 (home-page "http://www.alsa-project.org/")
860 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
862 "The Advanced Linux Sound Architecture (ALSA) provides audio and
863 MIDI functionality to the Linux-based operating system.")
865 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
867 (license license:gpl2)))
869 (define-public iptables
876 "http://www.netfilter.org/projects/iptables/files/iptables-"
880 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
881 (build-system gnu-build-system)
883 '(#:tests? #f ; no test suite
884 #:configure-flags ; add $libdir to the RUNPATH of executables
885 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
886 (home-page "http://www.netfilter.org/projects/iptables/index.html")
887 (synopsis "Program to configure the Linux IP packet filtering rules")
889 "iptables is the userspace command line program used to configure the
890 Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
891 system administrators. Since Network Address Translation is also configured
892 from the packet filter ruleset, iptables is used for this, too. The iptables
893 package also includes ip6tables. ip6tables is used for configuring the IPv6
895 (license license:gpl2+)))
897 (define-public iproute
904 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
908 "05351m4m0whsivlblvs3m0nz5q9v6r06ik80z27gf6ca51kw74dw"))))
909 (build-system gnu-build-system)
911 `(#:tests? #f ; no test suite
912 #:make-flags (let ((out (assoc-ref %outputs "out")))
914 (string-append "LIBDIR=" out "/lib")
915 (string-append "SBINDIR=" out "/sbin")
916 (string-append "CONFDIR=" out "/etc")
917 (string-append "DOCDIR=" out "/share/doc/"
919 (string-append "MANDIR=" out "/share/man")))
920 #:phases (modify-phases %standard-phases
921 (add-before 'install 'pre-install
923 ;; Don't attempt to create /var/lib/arpd.
924 (substitute* "Makefile"
925 (("^.*ARPDDIR.*$") "")))))))
927 `(("iptables" ,iptables)
930 `(("pkg-config" ,pkg-config)
934 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
936 "Utilities for controlling TCP/IP networking and traffic in Linux")
938 "Iproute2 is a collection of utilities for controlling TCP/IP
939 networking and traffic with the Linux kernel.
941 Most network configuration manuals still refer to ifconfig and route as the
942 primary network configuration tools, but ifconfig is known to behave
943 inadequately in modern network environments. They should be deprecated, but
944 most distros still include them. Most network configuration systems make use
945 of ifconfig and thus provide a limited feature set. The /etc/net project aims
946 to support most modern network technologies, as it doesn't use ifconfig and
947 allows a system administrator to make use of all iproute2 features, including
950 iproute2 is usually shipped in a package called iproute or iproute2 and
951 consists of several tools, of which the most important are ip and tc. ip
952 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
953 tools print detailed usage messages and are accompanied by a set of
955 (license license:gpl2+)))
957 (define-public net-tools
958 ;; XXX: This package is basically unmaintained, but it provides a few
959 ;; commands not yet provided by Inetutils, such as 'route', so we have to
964 (home-page "http://net-tools.sourceforge.net/")
967 (uri (list (string-append
968 "mirror://sourceforge/net-tools/net-tools-"
971 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
972 "/base/net-tools/net-tools-1.60.tar.bz2")))
975 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
976 (patches (search-patches "net-tools-bitrot.patch"))))
977 (build-system gnu-build-system)
979 '(#:modules ((guix build gnu-build-system)
983 #:phases (alist-cons-after
985 (lambda* (#:key inputs #:allow-other-keys)
986 (define (apply-patch file)
987 (zero? (system* "patch" "-p1" "--force"
990 (let ((patch.gz (assoc-ref inputs "patch")))
991 (format #t "applying Debian patch set '~a'...~%"
993 (system (string-append "gunzip < " patch.gz " > the-patch"))
994 (and (apply-patch "the-patch")
995 (for-each apply-patch
996 (find-files "debian/patches"
1000 (lambda* (#:key outputs #:allow-other-keys)
1001 (let ((out (assoc-ref outputs "out")))
1002 (mkdir-p (string-append out "/bin"))
1003 (mkdir-p (string-append out "/sbin"))
1005 ;; Pretend we have everything...
1006 (system "yes | make config")
1008 ;; ... except for the things we don't have.
1009 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1010 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1011 ;; that have been removed.
1012 (substitute* '("config.make" "config.h")
1013 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1015 'install 'remove-redundant-commands
1016 (lambda* (#:key outputs #:allow-other-keys)
1017 ;; Remove commands and man pages redundant with
1019 (let* ((out (assoc-ref outputs "out"))
1020 (dup (append-map (cut find-files out <>)
1022 "^(yp|nis|dns)?domainname"))))
1023 (for-each delete-file dup)
1027 ;; Binaries that depend on libnet-tools.a don't declare that
1028 ;; dependency, making it parallel-unsafe.
1029 #:parallel-build? #f
1031 #:tests? #f ; no test suite
1032 #:make-flags (let ((out (assoc-ref %outputs "out")))
1034 (string-append "BASEDIR=" out)
1035 (string-append "INSTALLNLSDIR=" out "/share/locale")
1036 (string-append "mandir=/share/man")))))
1038 ;; Use the big Debian patch set (the thing does not even compile out of
1040 (inputs `(("patch" ,(origin
1043 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1046 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1047 (native-inputs `(("gettext" ,gnu-gettext)))
1049 (synopsis "Tools for controlling the network subsystem in Linux")
1051 "This package includes the important tools for controlling the network
1052 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1053 netstat, rarp and route. Additionally, this package contains utilities
1054 relating to particular network hardware types (plipconfig, slattach) and
1055 advanced aspects of IP configuration (iptunnel, ipmaddr).")
1056 (license license:gpl2+)))
1058 (define-public libcap
1065 "mirror://kernel.org/linux/libs/security/linux-privs/"
1066 "libcap2/libcap-" version ".tar.xz"))
1069 "0rbc9qbqs5bp9am9s9g83wxj5k4ixps2agy9dxr1v1fwg27mdr6f"))))
1070 (build-system gnu-build-system)
1071 (arguments '(#:phases
1072 (modify-phases %standard-phases
1074 ;; Add $libdir to the RUNPATH of executables.
1076 (substitute* "Make.Rules"
1078 (string-append "LDFLAGS := -Wl,-rpath="
1079 %output "/lib"))))))
1080 #:tests? #f ; no 'check' target
1081 #:make-flags (list "lib=lib"
1082 (string-append "prefix="
1083 (assoc-ref %outputs "out"))
1084 "RAISE_SETFCAP=no")))
1085 (native-inputs `(("perl" ,perl)))
1086 (inputs `(("attr" ,attr)))
1087 (home-page "https://sites.google.com/site/fullycapable/")
1088 (synopsis "Library for working with POSIX capabilities")
1090 "Libcap2 provides a programming interface to POSIX capabilities on
1091 Linux-based operating systems.")
1093 ;; License is BSD-3 or GPLv2, at the user's choice.
1094 (license license:gpl2)))
1096 (define-public bridge-utils
1098 (name "bridge-utils")
1102 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
1106 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1107 (build-system gnu-build-system)
1109 ;; The tarball lacks all the generated files.
1110 (native-inputs `(("autoconf" ,autoconf)
1111 ("automake" ,automake)))
1113 '(#:phases (alist-cons-after
1116 ;; Fix "field ‘ip6’ has incomplete type" errors.
1117 (substitute* "libbridge/libbridge.h"
1118 (("#include <linux/if_bridge.h>")
1119 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1121 ;; Ensure that the entire build fails if one of the
1122 ;; sub-Makefiles fails.
1123 (substitute* "Makefile.in"
1124 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1125 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1127 (zero? (system* "autoreconf" "-vf")))
1129 #:tests? #f)) ; no 'check' target
1132 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1133 (synopsis "Manipulate Ethernet bridges")
1135 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1136 to connect two Ethernet segments together in a protocol independent way.
1137 Packets are forwarded based on Ethernet address, rather than IP address (like
1138 a router). Since forwarding is done at Layer 2, all protocols can go
1139 transparently through a bridge.")
1140 (license license:gpl2+)))
1142 (define-public libnl
1149 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1153 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
1154 (build-system gnu-build-system)
1155 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1156 (home-page "http://www.infradead.org/~tgr/libnl/")
1157 (synopsis "NetLink protocol library suite")
1159 "The libnl suite is a collection of libraries providing APIs to netlink
1160 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1161 between the kernel and user space processes. It was designed to be a more
1162 flexible successor to ioctl to provide mainly networking related kernel
1163 configuration and monitoring interfaces.")
1165 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1166 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1167 (license license:gpl2)))
1176 "mirror://kernel.org/software/network/iw/iw-"
1180 "085jyvrxzarvn5jl0fk618jjxy50nqx7ifngszc4jxk6a4ddibd6"))))
1181 (build-system gnu-build-system)
1182 (native-inputs `(("pkg-config" ,pkg-config)))
1183 (inputs `(("libnl" ,libnl)))
1185 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1187 #:phases (alist-delete 'configure %standard-phases)))
1188 (home-page "https://wireless.wiki.kernel.org/")
1189 (synopsis "Tool for configuring wireless devices")
1191 "iw is a new nl80211 based CLI configuration utility for wireless
1192 devices. It replaces @code{iwconfig}, which is deprecated.")
1193 (license license:isc)))
1195 (define-public powertop
1203 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1207 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1208 (build-system gnu-build-system)
1211 (modify-phases %standard-phases
1212 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1213 ;; allow calibrating the network interface in GuixSD.
1214 (add-after 'unpack 'patch-absolute-file-names
1215 (lambda* (#:key inputs #:allow-other-keys)
1216 (let ((kmod (assoc-ref inputs "kmod")))
1217 (substitute* (find-files "src" "\\.cpp$")
1218 ;; Give the right 'modprobe' file name so that essential
1219 ;; modules such as msr.ko can be loaded.
1220 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1221 ;; These programs are only needed to calibrate, so using
1222 ;; relative file names avoids adding extra inputs. When they
1223 ;; are missing powertop gracefully handles it.
1224 (("/usr/bin/hcitool") "hcitool")
1225 (("/usr/bin/xset") "xset")
1226 (("/usr/sbin/hciconfig") "hciconfig"))
1231 ("ncurses" ,ncurses)
1232 ("pciutils" ,pciutils)
1235 `(("pkg-config" ,pkg-config)))
1236 (home-page "https://01.org/powertop/")
1237 (synopsis "Analyze power consumption on Intel-based laptops")
1239 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1240 power management. In addition to being a diagnostic tool, PowerTOP also has
1241 an interactive mode where the user can experiment various power management
1242 settings for cases where the operating system has not enabled these
1244 (license license:gpl2)))
1246 (define-public aumix
1253 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1254 version ".tar.bz2"))
1257 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1258 (build-system gnu-build-system)
1259 (inputs `(("ncurses" ,ncurses)))
1260 (home-page "http://www.jpj.net/~trevor/aumix.html")
1261 (synopsis "Audio mixer for X and the console")
1263 "Aumix adjusts an audio mixer from X, the console, a terminal,
1264 the command line or a script.")
1265 (license license:gpl2+)))
1267 (define-public iotop
1274 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1277 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1278 (build-system python-build-system)
1280 ;; The setup.py script expects python-2.
1281 `(#:python ,python-2
1282 ;; There are currently no checks in the package.
1284 (native-inputs `(("python" ,python-2)))
1285 (home-page "http://guichaz.free.fr/iotop/")
1287 "Displays the IO activity of running processes")
1289 "Iotop is a Python program with a top like user interface to show the
1290 processes currently causing I/O.")
1291 (license license:gpl2+)))
1299 (uri (let ((version-with-underscores
1300 (string-join (string-split version #\.) "_")))
1302 "https://github.com/libfuse/libfuse/"
1303 "releases/download/fuse_" version-with-underscores
1304 "/fuse-" version ".tar.gz")))
1307 "1dfvbi1p57svbv2sfnbqwpnsk219spvjnlapf35azhgzqlf3g7sp"))))
1308 (build-system gnu-build-system)
1309 (inputs `(("util-linux" ,util-linux)))
1311 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1312 (assoc-ref %outputs "out")
1314 (string-append "INIT_D_PATH="
1315 (assoc-ref %outputs "out")
1318 ;; The rule makes /dev/fuse 666.
1319 (string-append "UDEV_RULES_PATH="
1320 (assoc-ref %outputs "out")
1321 "/lib/udev/rules.d"))
1322 #:phases (alist-cons-before
1323 'build 'set-file-names
1324 (lambda* (#:key inputs #:allow-other-keys)
1325 ;; libfuse calls out to mount(8) and umount(8). Make sure
1326 ;; it refers to the right ones.
1327 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1328 (("/bin/(u?)mount" _ maybe-u)
1329 (string-append (assoc-ref inputs "util-linux")
1330 "/bin/" maybe-u "mount")))
1331 (substitute* '("util/mount.fuse.c")
1335 ;; This hack leads libfuse to search for 'fusermount' in
1336 ;; $PATH, where it may find a setuid-root binary, instead of
1337 ;; trying solely $out/sbin/fusermount and failing because
1339 (substitute* "lib/Makefile"
1340 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1341 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1343 (home-page "http://fuse.sourceforge.net/")
1344 (synopsis "Support file systems implemented in user space")
1346 "As a consequence of its monolithic design, file system code for Linux
1347 normally goes into the kernel itself---which is not only a robustness issue,
1348 but also an impediment to system extensibility. FUSE, for \"file systems in
1349 user space\", is a kernel module and user-space library that tries to address
1350 part of this problem by allowing users to run file system implementations as
1351 user-space processes.")
1352 (license (list license:lgpl2.1 ;library
1353 license:gpl2+)))) ;command-line utilities
1355 (define-public unionfs-fuse
1357 (name "unionfs-fuse")
1362 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1366 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1367 (build-system cmake-build-system)
1368 (inputs `(("fuse" ,fuse)))
1369 (arguments '(#:tests? #f)) ; no tests
1370 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1371 (synopsis "User-space union file system")
1373 "UnionFS-FUSE is a flexible union file system implementation in user
1374 space, using the FUSE library. Mounting a union file system allows you to
1375 \"aggregate\" the contents of several directories into a single mount point.
1376 UnionFS-FUSE additionally supports copy-on-write.")
1377 (license license:bsd-3)))
1380 (package (inherit fuse)
1381 (name "fuse-static")
1382 (source (origin (inherit (package-source fuse))
1383 (modules '((guix build utils)))
1385 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1386 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1387 ;; it doesn't do that, allowing us to remove the dependency on
1388 ;; util-linux (something that is useful in initrds.)
1389 '(substitute* '("lib/mount_util.c"
1390 "util/mount_util.c")
1391 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1396 (define-public unionfs-fuse/static
1397 (package (inherit unionfs-fuse)
1398 (synopsis "User-space union file system (statically linked)")
1399 (name (string-append (package-name unionfs-fuse) "-static"))
1400 (source (origin (inherit (package-source unionfs-fuse))
1401 (modules '((guix build utils)))
1403 ;; Add -ldl to the libraries, because libfuse.a needs that.
1404 '(substitute* "src/CMakeLists.txt"
1405 (("target_link_libraries(.*)\\)" _ libs)
1406 (string-append "target_link_libraries"
1410 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1411 #:phases (alist-cons-after
1412 'install 'post-install
1413 (lambda* (#:key outputs #:allow-other-keys)
1414 (let* ((out (assoc-ref outputs "out"))
1415 (exe (string-append out "/bin/unionfs")))
1416 ;; By default, 'unionfs' keeps references to
1417 ;; $glibc/share/locale and similar stuff. Remove them.
1418 (remove-store-references exe)))
1420 (inputs `(("fuse" ,fuse-static)))))
1422 (define-public sshfs-fuse
1428 (uri (let ((version-with-underscores
1429 (string-join (string-split version #\.) "_")))
1430 (string-append "https://github.com/libfuse/sshfs/releases/"
1431 "download/sshfs_" version-with-underscores
1432 "/sshfs-fuse-" version ".tar.gz")))
1435 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1436 (build-system gnu-build-system)
1441 `(("pkg-config" ,pkg-config)))
1442 (home-page "http://fuse.sourceforge.net/sshfs.html")
1443 (synopsis "Mount remote file systems over SSH")
1445 "This is a file system client based on the SSH File Transfer Protocol.
1446 Since most SSH servers already support this protocol it is very easy to set
1447 up: on the server side there's nothing to do; on the client side mounting the
1448 file system is as easy as logging into the server with an SSH client.")
1449 (license license:gpl2+)))
1451 (define-public numactl
1458 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1463 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1464 (build-system gnu-build-system)
1466 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1467 ;; to run, which we can't assume to have.
1470 ;; NUMA is apparently not supported on armhf, see
1471 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1472 (supported-systems (delete "armhf-linux" %supported-systems))
1473 (home-page "http://oss.sgi.com/projects/libnuma/")
1474 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1476 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1477 memory is not all in one place. The numactl program allows you to run your
1478 application program on specific CPU's and memory nodes. It does this by
1479 supplying a NUMA memory policy to the operating system before running your
1482 The package contains other commands, such as numademo, numastat and memhog.
1483 The numademo command provides a quick overview of NUMA performance on your
1485 (license (list license:gpl2 ;programs
1486 license:lgpl2.1)))) ;library
1494 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1498 "0ppv953gn2zylcagr4z6zg5y2x93dxrml29plypg6xgbq3hrv2bs"))
1499 (modules '((guix build utils)))
1502 (substitute* "tests/Makefile.in"
1503 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1506 (substitute* '("src/unicode_start" "src/unicode_stop")
1507 ;; Assume the Coreutils are in $PATH.
1510 (build-system gnu-build-system)
1513 (modify-phases %standard-phases
1514 (add-before 'build 'pre-build
1515 (lambda* (#:key inputs #:allow-other-keys)
1516 (let ((gzip (assoc-ref %build-inputs "gzip"))
1517 (bzip2 (assoc-ref %build-inputs "bzip2")))
1518 (substitute* "src/libkeymap/findfile.c"
1520 (string-append gzip "/bin/gzip"))
1522 (string-append bzip2 "/bin/bzip2"))))))
1523 (add-after 'install 'post-install
1524 (lambda* (#:key outputs #:allow-other-keys)
1525 ;; Make sure these programs find their comrades.
1526 (let* ((out (assoc-ref outputs "out"))
1527 (bin (string-append out "/bin")))
1528 (for-each (lambda (prog)
1529 (wrap-program (string-append bin "/" prog)
1530 `("PATH" ":" prefix (,bin))))
1531 '("unicode_start" "unicode_stop"))))))))
1532 (inputs `(("check" ,check)
1535 ("pam" ,linux-pam)))
1536 (native-inputs `(("pkg-config" ,pkg-config)))
1537 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1538 (synopsis "Linux keyboard utilities and keyboard maps")
1540 "This package contains keytable files and keyboard utilities compatible
1541 for systems using the Linux kernel. This includes commands such as
1542 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1543 (license license:gpl2+)))
1545 (define-public inotify-tools
1547 (name "inotify-tools")
1552 "mirror://sourceforge/inotify-tools/inotify-tools/"
1553 version "/inotify-tools-" version ".tar.gz"))
1556 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1557 (build-system gnu-build-system)
1558 (home-page "http://inotify-tools.sourceforge.net/")
1559 (synopsis "Monitor file accesses")
1561 "The inotify-tools packages provides a C library and command-line tools
1562 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1563 (license license:gpl2+)))
1572 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1573 "kmod-" version ".tar.xz"))
1576 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1577 (patches (search-patches "kmod-module-directory.patch"))))
1578 (build-system gnu-build-system)
1580 `(("pkg-config" ,pkg-config)))
1585 `(#:tests? #f ; FIXME: Investigate test failures
1586 #:configure-flags '("--with-xz" "--with-zlib")
1587 #:phases (alist-cons-after
1588 'install 'install-modprobe&co
1589 (lambda* (#:key outputs #:allow-other-keys)
1590 (let* ((out (assoc-ref outputs "out"))
1591 (bin (string-append out "/bin")))
1592 (for-each (lambda (tool)
1594 (string-append bin "/" tool)))
1595 '("insmod" "rmmod" "lsmod" "modprobe"
1596 "modinfo" "depmod"))))
1598 (home-page "https://www.kernel.org/")
1599 (synopsis "Kernel module tools")
1600 (description "Kmod is a set of tools to handle common tasks with Linux
1601 kernel modules like insert, remove, list, check properties, resolve
1602 dependencies and aliases.
1604 These tools are designed on top of libkmod, a library that is shipped with
1605 kmod. The aim is to be compatible with tools, configurations and indices
1606 from the module-init-tools project.")
1607 (license license:gpl2+))) ; library under lgpl2.1+
1609 (define-public eudev
1610 ;; The post-systemd fork, maintained by Gentoo.
1617 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1621 "0akg9gcc3c2p56xbhlvbybqavcprly5q0bvk655zwl6d62j8an7p"))
1622 (patches (search-patches "eudev-rules-directory.patch"))))
1623 (build-system gnu-build-system)
1625 `(("pkg-config" ,pkg-config)
1629 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1630 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1631 ;; which contains the rules to do that.
1632 `(("util-linux" ,util-linux) ;for blkid
1634 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1635 (synopsis "Userspace device management")
1636 (description "Udev is a daemon which dynamically creates and removes
1637 device nodes from /dev/, handles hotplug events and loads drivers at boot
1639 (license license:gpl2+)))
1644 (version "2.02.109")
1647 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1651 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1652 (modules '((guix build utils)))
1655 (use-modules (guix build utils))
1657 ;; Honor sysconfdir.
1658 (substitute* "make.tmpl.in"
1660 "confdir = @sysconfdir@\n")
1661 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1662 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1663 (build-system gnu-build-system)
1665 `(("pkg-config" ,pkg-config)
1666 ("procps" ,procps))) ;tests use 'pgrep'
1670 '(#:phases (alist-cons-after
1671 'configure 'set-makefile-shell
1673 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1675 (setenv "SHELL" (which "sh"))
1677 ;; Replace /bin/sh with the right file name.
1678 (patch-makefile-SHELL "make.tmpl"))
1681 #:configure-flags (list (string-append "--sysconfdir="
1682 (assoc-ref %outputs "out")
1684 "--enable-udev_sync"
1685 "--enable-udev_rules"
1687 ;; Make sure programs such as 'dmsetup' can
1688 ;; find libdevmapper.so.
1689 (string-append "LDFLAGS=-Wl,-rpath="
1690 (assoc-ref %outputs "out")
1693 ;; The tests use 'mknod', which requires root access.
1695 (home-page "http://sourceware.org/lvm2/")
1696 (synopsis "Logical volume management for Linux")
1698 "LVM2 is the logical volume management tool set for Linux-based systems.
1699 This package includes the user-space libraries and tools, including the device
1700 mapper. Kernel components are part of Linux-libre.")
1702 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1703 ;; Command-line tools are GPLv2.
1704 (license (list license:gpl2 license:lgpl2.1))))
1706 (define-public wireless-tools
1708 (name "wireless-tools")
1712 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1716 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
1719 ;; Remove the older header files that are not free software.
1720 (for-each (lambda (n)
1721 (delete-file (format #f "wireless.~a.h" n)))
1722 '(10 11 12 13 14 15 16 17 18 19 20))
1724 (build-system gnu-build-system)
1727 (list (string-append "PREFIX=" %output)
1728 (string-append "INSTALL_MAN=" %output "/share/man")
1729 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1731 #:phases (modify-phases %standard-phases
1732 (delete 'configure))
1734 (synopsis "Tools for manipulating Linux Wireless Extensions")
1735 (description "Wireless Tools are used to manipulate the now-deprecated
1736 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1737 Extension was an interface allowing you to set Wireless LAN specific
1738 parameters and get the specific stats. It is deprecated in favor the nl80211
1740 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1741 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1742 ;; other files are distributed under gpl2.
1743 (license (list license:gpl2 license:lgpl2.1+))))
1751 (uri (string-append "mirror://kernel.org/software/network/crda/"
1752 "crda-" version ".tar.xz"))
1755 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
1756 (patches (search-patches "crda-optional-gcrypt.patch"))))
1757 (build-system gnu-build-system)
1759 '(#:phases (modify-phases %standard-phases
1762 'build 'no-werror-no-ldconfig
1764 (substitute* "Makefile"
1766 (("ldconfig") "true"))
1769 'build 'set-regulator-db-file-name
1770 (lambda* (#:key inputs #:allow-other-keys)
1771 ;; Tell CRDA where to find our database.
1772 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1773 (substitute* "crda.c"
1774 (("\"/lib/crda/regulatory.bin\"")
1775 (string-append "\"" regdb
1776 "/lib/crda/regulatory.bin\"")))
1778 #:test-target "verify"
1779 #:make-flags (let ((out (assoc-ref %outputs "out"))
1780 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1781 (list "CC=gcc" "V=1"
1783 ;; Disable signature-checking on 'regulatory.bin'.
1784 ;; The reason is that this simplifies maintenance
1785 ;; on our side (no need to manage a distro key
1786 ;; pair), and we can guarantee integrity of
1787 ;; 'regulatory.bin' by other means anyway, such as
1788 ;; 'guix gc --verify'. See
1789 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1793 (string-append "PREFIX=" out)
1794 (string-append "SBINDIR=" out "/sbin/")
1795 (string-append "UDEV_RULE_DIR="
1796 out "/lib/udev/rules.d")
1797 (string-append "LDFLAGS=-Wl,-rpath="
1799 (string-append "REG_BIN=" regdb
1800 "/lib/crda/regulatory.bin")))))
1801 (native-inputs `(("pkg-config" ,pkg-config)
1802 ("python" ,python-2)
1803 ("wireless-regdb" ,wireless-regdb)))
1804 (inputs `(("libnl" ,libnl)))
1806 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
1807 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
1809 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
1810 communication between the kernel Linux and user space for regulatory
1812 (license license:copyleft-next)))
1814 (define-public wireless-regdb
1816 (name "wireless-regdb")
1817 (version "2016.05.02")
1821 "mirror://kernel.org/software/network/wireless-regdb/"
1822 "wireless-regdb-" version ".tar.xz"))
1825 "07n6gcwfbddz3awbdflv3dhxjszsqq2lrdwih0a0ahcliac4qry9"))
1827 ;; We're building 'regulatory.bin' by ourselves.
1828 (snippet '(delete-file "regulatory.bin"))))
1829 (build-system gnu-build-system)
1831 '(#:phases (modify-phases %standard-phases
1832 (delete 'configure))
1834 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
1835 ;; is computed and can be equal to 'maintainer-clean'; when that
1836 ;; happens, we can end up deleting the 'regulatory.bin' file that we
1837 ;; just built. Thus, build things sequentially.
1838 #:parallel-build? #f
1840 #:tests? #f ;no tests
1841 #:make-flags (let ((out (assoc-ref %outputs "out")))
1842 (list (string-append "PREFIX=" out)
1843 (string-append "LSB_ID=GuixSD")
1844 (string-append "DISTRO_PUBKEY=/dev/null")
1845 (string-append "DISTRO_PRIVKEY=/dev/null")
1846 (string-append "REGDB_PUBKEY=/dev/null")
1848 ;; Leave that empty so that db2bin.py doesn't try
1849 ;; to sign 'regulatory.bin'. This allows us to
1850 ;; avoid managing a key pair for the whole distro.
1851 (string-append "REGDB_PRIVKEY=")))))
1852 (native-inputs `(("python" ,python-2)))
1854 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
1855 (synopsis "Wireless regulatory database")
1857 "This package contains the wireless regulatory database Central
1858 Regulatory Database Agent (CRDA) daemon. The database contains information on
1859 country-specific regulations for the wireless spectrum.")
1860 (license license:isc)))
1862 (define-public lm-sensors
1869 "ftp://ftp.netroedge.com/pub/lm-sensors/lm_sensors-"
1870 version ".tar.bz2"))
1873 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1874 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
1875 (build-system gnu-build-system)
1876 (inputs `(("rrdtool" ,rrdtool)
1879 ("gnuplot" ,gnuplot)))
1880 (native-inputs `(("pkg-config" ,pkg-config)
1885 `(#:tests? #f ; no 'check' target
1886 #:make-flags (list (string-append "PREFIX=" %output)
1887 (string-append "ETCDIR=" %output "/etc")
1888 (string-append "MANDIR=" %output "/share/man"))
1893 'build 'patch-exec-paths
1894 (lambda* (#:key inputs outputs #:allow-other-keys)
1895 (substitute* "prog/detect/sensors-detect"
1897 (string-append "`" (assoc-ref inputs "coreutils")
1899 (("(`|\")modprobe" all open-quote)
1900 (string-append open-quote
1901 (assoc-ref inputs "kmod")
1903 (substitute* '("prog/pwm/pwmconfig"
1904 "prog/pwm/fancontrol")
1906 (string-append (assoc-ref inputs "gnuplot")
1909 (string-append (assoc-ref inputs "coreutils")
1912 (string-append (assoc-ref inputs "grep")
1915 (string-append (assoc-ref inputs "sed")
1918 (string-append (assoc-ref inputs "coreutils")
1921 (string-append (assoc-ref inputs "coreutils")
1924 (string-append (assoc-ref inputs "coreutils")
1925 "/bin/readlink -f"))))
1926 %standard-phases))))
1927 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
1928 (synopsis "Utilities to read temperature/voltage/fan sensors")
1930 "Lm-sensors is a hardware health monitoring package for Linux. It allows
1931 you to access information from temperature, voltage, and fan speed sensors.
1932 It works with most newer systems.")
1933 (license license:gpl2+)))
1935 (define-public i2c-tools
1942 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
1943 version ".tar.bz2"))
1946 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
1947 (build-system gnu-build-system)
1949 `(#:tests? #f ; no 'check' target
1950 #:make-flags (list (string-append "prefix=" %output)
1952 ;; no configure script
1953 #:phases (alist-delete 'configure %standard-phases)))
1956 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
1957 (synopsis "I2C tools for Linux")
1959 "The i2c-tools package contains a heterogeneous set of I2C tools for
1960 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
1961 EEPROM decoding scripts, EEPROM programming tools, and a python module for
1963 (license license:gpl2+)))
1965 (define-public xsensors
1972 "http://www.linuxhardware.org/xsensors/xsensors-"
1976 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1977 (build-system gnu-build-system)
1978 (inputs `(("lm-sensors" ,lm-sensors)
1980 (native-inputs `(("pkg-config" ,pkg-config)))
1982 `(#:phases (alist-cons-before
1983 'configure 'enable-deprecated
1985 (substitute* "src/Makefile.in"
1986 (("-DGDK_DISABLE_DEPRECATED") "")
1987 (("-DGTK_DISABLE_DEPRECATED") "")))
1989 'configure 'remove-Werror
1991 (substitute* '("configure" "src/Makefile.in")
1993 %standard-phases))))
1994 (home-page "http://www.linuxhardware.org/xsensors/")
1995 (synopsis "Hardware health information viewer")
1997 "Xsensors reads data from the libsensors library regarding hardware
1998 health such as temperature, voltage and fan speed and displays the information
1999 in a digital read-out.")
2000 (license license:gpl2+)))
2005 (version (package-version linux-libre))
2006 (source (package-source linux-libre))
2007 (build-system gnu-build-system)
2009 '(#:phases (alist-replace
2011 (lambda* (#:key inputs #:allow-other-keys)
2012 (setenv "SHELL_PATH" (which "bash"))
2013 (chdir "tools/perf"))
2015 #:make-flags (list (string-append "DESTDIR="
2016 (assoc-ref %outputs "out"))
2019 ;; By default, 'config/Makefile' uses lib64 on
2020 ;; x86_64. Work around that.
2022 #:tests? #f)) ;no tests
2024 `(("pkg-config" ,pkg-config)
2028 ;; There are build scripts written in these languages.
2030 ("python" ,python-2)))
2032 `(("slang" ,slang) ;for the interactive TUI
2034 ("python" ,python-2) ;'perf' links against libpython
2035 ("elfutils" ,elfutils)
2038 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2039 ("libxslt" ,libxslt)
2040 ("docbook-xml" ,docbook-xml)
2041 ("docbook-xsl" ,docbook-xsl)
2043 ("asciidoc" ,asciidoc)))
2044 (home-page "https://perf.wiki.kernel.org/")
2045 (synopsis "Linux profiling with performance counters")
2047 "perf is a tool suite for profiling using hardware performance counters,
2048 with support in the Linux kernel. perf can instrument CPU performance
2049 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2050 of lightweight profiling. This package contains the user-land tools and in
2051 particular the 'perf' command.")
2052 (license (package-license linux-libre))))
2054 (define-public pflask
2060 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2062 (file-name (string-append name "-" version ".tar.gz"))
2065 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2066 (build-system cmake-build-system)
2068 '(#:tests? #f)) ; no tests
2069 (home-page "http://ghedo.github.io/pflask/")
2070 (synopsis "Simple tool for creating Linux namespace containers")
2071 (description "pflask is a simple tool for creating Linux namespace
2072 containers. It can be used for running a command or even booting an OS inside
2073 an isolated container, created with the help of Linux namespaces. It is
2074 similar in functionality to chroot, although pflask provides better isolation
2075 thanks to the use of namespaces.")
2076 (license license:bsd-2)))
2078 (define-public hdparm
2084 (uri (string-append "mirror://sourceforge/" name "/"
2085 name "-" version ".tar.gz"))
2088 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
2089 (build-system gnu-build-system)
2091 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2092 (list (string-append "binprefix=" out)
2093 (string-append "manprefix=" out)
2095 #:phases (alist-delete 'configure %standard-phases)
2096 #:tests? #f)) ; no test suite
2097 (home-page "http://sourceforge.net/projects/hdparm/")
2098 (synopsis "Tune hard disk parameters for high performance")
2100 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
2101 is for enabling irq-unmasking and IDE multiple-mode.")
2102 (license (license:non-copyleft "file://LICENSE.TXT"))))
2104 (define-public rfkill
2110 (uri (string-append "mirror://kernel.org/software/network/"
2111 name "/" name "-" version ".tar.xz"))
2114 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2115 (build-system gnu-build-system)
2117 `(#:make-flags (list "CC=gcc"
2118 (string-append "PREFIX=" %output))
2119 #:phases (modify-phases %standard-phases
2120 (delete 'configure))
2122 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2123 (synopsis "Tool for enabling and disabling wireless devices")
2125 "rfkill is a simple tool for accessing the rfkill device interface,
2126 which is used to enable and disable wireless networking devices, typically
2127 WLAN, Bluetooth and mobile broadband.")
2128 (license (license:non-copyleft "file://COPYING"
2129 "See COPYING in the distribution."))))
2137 (uri (string-append "mirror://sourceforge/acpiclient/"
2138 name "-" version ".tar.gz"))
2141 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2142 (build-system gnu-build-system)
2143 (home-page "http://acpiclient.sourceforge.net")
2144 (synopsis "Display information on ACPI devices")
2145 (description "@code{acpi} attempts to replicate the functionality of the
2146 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2147 information. It does not support ACPI suspending, only displays information
2148 about ACPI devices.")
2149 (license license:gpl2+)))
2151 (define-public acpid
2157 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2161 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
2162 (build-system gnu-build-system)
2163 (home-page "http://sourceforge.net/projects/acpid2/")
2164 (synopsis "Daemon for delivering ACPI events to user-space programs")
2166 "acpid is designed to notify user-space programs of Advanced
2167 Configuration and Power Interface (ACPI) events. acpid should be started
2168 during the system boot, and will run as a background process. When an ACPI
2169 event is received from the kernel, acpid will examine the list of rules
2170 specified in /etc/acpi/events and execute the rules that match the event.")
2171 (license license:gpl2+)))
2173 (define-public sysfsutils
2182 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2185 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2186 (build-system gnu-build-system)
2187 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2188 (synopsis "System utilities based on Linux sysfs")
2190 "These are a set of utilities built upon sysfs, a virtual filesystem in
2191 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2192 also contains the libsysfs library.")
2193 ;; The library is under lgpl2.1+ (all files say "or any later version").
2194 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2195 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2197 (define-public sysfsutils-1
2199 (inherit sysfsutils)
2206 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2207 "/sysfsutils-" version ".tar.gz"))
2209 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2210 (modules '((guix build utils)))
2213 (substitute* "Makefile.in"
2214 (("includedir = /usr/include/sysfs")
2215 "includedir = @includedir@"))
2216 (substitute* "configure"
2217 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2218 (string-append "includedir='" orig "/sysfs'")))))))
2219 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2221 (define-public cpufrequtils
2223 (name "cpufrequtils")
2230 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2233 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2234 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2235 (build-system gnu-build-system)
2237 `(("sysfsutils" ,sysfsutils-1)))
2239 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2240 (assoc-ref %outputs "out") "/lib"))))
2241 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2242 (synopsis "Utilities to get and set CPU frequency on Linux")
2244 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2245 information, and set the CPU frequency if supported, using the cpufreq
2246 capabilities of the Linux kernel.")
2247 (license license:gpl2)))
2249 (define-public libraw1394
2256 "mirror://kernel.org/linux/libs/ieee1394/"
2257 name "-" version ".tar.xz"))
2260 "0kwnf4ha45c04mhc4yla672aqmvqqihxix1gvblns5cd2pc2cc8b"))))
2261 (build-system gnu-build-system)
2262 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2263 (synopsis "Interface library for the Linux IEEE1394 drivers")
2265 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2266 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2267 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2268 send to and receive from other nodes without requiring a kernel driver for the
2269 protocol in question.")
2270 (license license:lgpl2.1+)))
2272 (define-public libavc1394
2278 (uri (string-append "mirror://sourceforge/libavc1394/"
2279 name "-" version ".tar.gz"))
2282 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2283 (build-system gnu-build-system)
2285 `(("pkg-config" ,pkg-config)))
2287 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2288 (home-page "http://sourceforge.net/projects/libavc1394/")
2289 (synopsis "AV/C protocol library for IEEE 1394")
2291 "Libavc1394 is a programming interface to the AV/C specification from
2292 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2293 (license license:lgpl2.1+)))
2295 (define-public libiec61883
2297 (name "libiec61883")
2302 "mirror://kernel.org/linux/libs/ieee1394/"
2303 name "-" version ".tar.xz"))
2306 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2307 (build-system gnu-build-system)
2309 `(("pkg-config" ,pkg-config)))
2311 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2312 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2313 (synopsis "Isochronous streaming media library for IEEE 1394")
2315 "The libiec61883 library provides a higher level API for streaming DV,
2316 MPEG-2 and audio over Linux IEEE 1394.")
2317 (license license:lgpl2.1+)))
2319 (define-public mdadm
2326 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2330 "0248v9f28mrbwabl94ck22gfim29sqhkf70wrpfi52nk4x3bxl17"))))
2331 (build-system gnu-build-system)
2335 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2336 (list "INSTALL=install"
2338 ;; TODO: tell it where to find 'sendmail'
2339 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2340 (string-append "BINDIR=" out "/sbin")
2341 (string-append "MANDIR=" out "/share/man")
2342 (string-append "UDEVDIR=" out "/lib/udev")))
2343 #:phases (alist-cons-before
2344 'build 'patch-program-paths
2345 (lambda* (#:key inputs #:allow-other-keys)
2346 (let ((coreutils (assoc-ref inputs "coreutils")))
2347 (substitute* "udev-md-raid-arrays.rules"
2348 (("/usr/bin/(readlink|basename)" all program)
2349 (string-append coreutils "/bin/" program)))))
2350 (alist-delete 'configure %standard-phases))
2351 ;;tests must be done as root
2353 (home-page "http://neil.brown.name/blog/mdadm")
2354 (synopsis "Tool for managing Linux Software RAID arrays")
2356 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2357 assemble, report on, and monitor arrays. It can also move spares between raid
2358 arrays when needed.")
2359 (license license:gpl2+)))
2361 (define-public libaio
2368 (string-append "mirror://debian/pool/main/liba/libaio/"
2369 name "_" version ".orig.tar.gz")
2370 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2371 name "-" version ".tar.gz")))
2374 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2375 (build-system gnu-build-system)
2378 (list "CC=gcc" (string-append "prefix=" %output))
2379 #:test-target "partcheck" ; need root for a full 'check'
2381 (alist-delete 'configure %standard-phases))) ; no configure script
2382 (home-page "http://lse.sourceforge.net/io/aio.html")
2383 (synopsis "Linux-native asynchronous I/O access library")
2385 "This library enables userspace to use Linux kernel asynchronous I/O
2386 system calls, important for the performance of databases and other advanced
2388 (license license:lgpl2.1+)))
2396 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2397 name "-" version ".tar.xz"))
2400 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2401 (build-system gnu-build-system)
2403 `(("libsndfile" ,libsndfile)))
2405 `(("pkg-config" ,pkg-config)))
2406 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2407 (synopsis "Bluetooth subband audio codec")
2409 "The SBC is a digital audio encoder and decoder used to transfer data to
2410 Bluetooth audio output devices like headphones or loudspeakers.")
2411 (license license:gpl2+)))
2413 (define-public bluez
2420 "mirror://kernel.org/linux/bluetooth/bluez-"
2424 "0fsrf9rdmrdyx0vmcpfji4imjsvliawyy5sjb6b64myka28vrl91"))))
2425 (build-system gnu-build-system)
2428 (let ((out (assoc-ref %outputs "out")))
2429 (list "--enable-library"
2431 ;; Install dbus/udev files to the correct location.
2432 (string-append "--with-dbusconfdir=" out "/etc")
2433 (string-append "--with-udevdir=" out "/lib/udev")))))
2435 `(("pkg-config" ,pkg-config)
2436 ("gettext" ,gnu-gettext)))
2441 ("libical" ,libical)
2442 ("readline" ,readline)))
2443 (home-page "http://www.bluez.org/")
2444 (synopsis "Linux Bluetooth protocol stack")
2446 "BlueZ provides support for the core Bluetooth layers and protocols. It
2447 is flexible, efficient and uses a modular implementation.")
2448 (license license:gpl2+)))
2450 (define-public fuse-exfat
2456 (uri "https://docs.google.com/uc?export=download&\
2457 id=0B7CLI-REKbE3VTdaa0EzTkhYdU0")
2460 "0glmgwrf0nv09am54i6s35ksbvrywrwc51w6q32mv5by8475530r"))
2461 (file-name (string-append name "-" version ".tar.gz"))))
2462 (build-system gnu-build-system)
2465 ("pkg-config" ,pkg-config)))
2469 '(#:tests? #f ;no test suite
2471 ;; XXX: Factorize with 'exfat-utils'.
2472 #:phases (modify-phases %standard-phases
2474 (add-after 'unpack 'scons-propagate-environment
2476 ;; Modify the SConstruct file to arrange for
2477 ;; environment variables to be propagated.
2478 (substitute* "SConstruct"
2479 (("^env = Environment\\(")
2480 "env = Environment(ENV=os.environ, "))))
2483 (zero? (system* "scons"))))
2485 (lambda* (#:key outputs #:allow-other-keys)
2486 (let* ((out (assoc-ref outputs "out"))
2487 (bin (string-append out "/bin"))
2488 (man8 (string-append out
2489 "/share/man/man8")))
2492 (for-each (lambda (file)
2495 (string-append man8 "/"
2497 (find-files "." "\\.8$"))
2498 (zero? (system* "scons" "install"
2499 (string-append "DESTDIR="
2501 (home-page "http://code.google.com/p/exfat/")
2502 (synopsis "Mount exFAT file systems")
2504 "This package provides a FUSE-based file system that provides read and
2505 write access to exFAT devices.")
2506 (license license:gpl2+)))
2515 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2516 version ".tar.bz2"))
2519 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2520 (build-system gnu-build-system)
2522 '(#:phases (modify-phases %standard-phases
2523 (add-before 'configure 'bootstrap
2525 ;; The tarball was not generated with 'make dist' so we
2526 ;; need to bootstrap things ourselves.
2527 (and (zero? (system* "./autogen.sh"))
2529 (patch-makefile-SHELL "Makefile.include.in")
2532 ;; Make sure programs find libgpm.so.
2533 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2534 (assoc-ref %outputs "out")
2537 `(("texinfo" ,texinfo)
2540 ("autoconf" ,autoconf)
2541 ("automake" ,automake)
2542 ("libtool" ,libtool)))
2543 (home-page "http://www.nico.schottelius.org/software/gpm/")
2544 (synopsis "Mouse support for the Linux console")
2546 "The GPM (general-purpose mouse) daemon is a mouse server for
2547 applications running on the Linux console. It allows users to select items
2548 and copy/paste text in the console and in xterm.")
2549 (license license:gpl2+)))
2551 (define-public btrfs-progs
2553 (name "btrfs-progs")
2557 (uri (string-append "mirror://kernel.org/linux/kernel/"
2558 "people/kdave/btrfs-progs/"
2559 "btrfs-progs-v" version ".tar.xz"))
2562 "1znf2zhb56zbmdjk3lq107678xwsqwc5gczspypmc5i31qnppy7f"))))
2563 (build-system gnu-build-system)
2565 '(#:test-target "test"
2566 #:parallel-tests? #f)) ; tests fail when run in parallel
2567 (inputs `(("e2fsprogs" ,e2fsprogs)
2568 ("libblkid" ,util-linux)
2569 ("libuuid" ,util-linux)
2572 (native-inputs `(("pkg-config" ,pkg-config)
2573 ("asciidoc" ,asciidoc)
2575 ;; For building documentation
2576 ("libxml2" ,libxml2)
2577 ("docbook-xml" ,docbook-xml)
2578 ("docbook-xsl" ,docbook-xsl)))
2579 (home-page "https://btrfs.wiki.kernel.org/")
2580 (synopsis "Create and manage btrfs copy-on-write file systems")
2581 (description "Btrfs is a copy-on-write (CoW) filesystem for Linux aimed at
2582 implementing advanced features while focusing on fault tolerance, repair and
2583 easy administration.")
2584 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2585 ;; GPL2: Everything else.
2586 (license (list license:gpl2 license:gpl2+))))
2588 (define-public freefall
2591 (version (package-version linux-libre))
2592 (source (package-source linux-libre))
2593 (build-system gnu-build-system)
2595 '(#:phases (modify-phases %standard-phases
2596 (add-after 'unpack 'enter-subdirectory
2598 (chdir "tools/laptop/freefall")))
2600 (add-before 'build 'increase-timeout
2602 ;; The default of 2 seconds is too low: it assumes an
2603 ;; open lid and AC power without actually checking.
2604 (substitute* "freefall.c"
2605 (("alarm\\(2\\)") "alarm(5)")))))
2606 #:make-flags (list (string-append "PREFIX="
2607 (assoc-ref %outputs "out")))
2608 #:tests? #f)) ;no tests
2609 (home-page (package-home-page linux-libre))
2610 (synopsis "Free-fall protection for spinning laptop hard drives")
2612 "Prevents shock damage to the internal spinning hard drive(s) of some
2613 HP and Dell laptops. When sudden movement is detected, all input/output
2614 operations on the drive are suspended and its heads are parked on the ramp,
2615 where they are less likely to cause damage to the spinning disc. Requires a
2616 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2617 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2618 (license license:gpl2)))
2620 (define-public thinkfan
2626 (uri (string-append "mirror://sourceforge/thinkfan/"
2627 version "/thinkfan-" version ".tar.gz"))
2630 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2631 (modules '((guix build utils)))
2632 ;; Fix erroneous man page location in Makefile leading to
2633 ;; a compilation failure.
2635 '(substitute* "CMakeLists.txt"
2636 (("thinkfan\\.1") "src/thinkfan.1")))))
2637 (build-system cmake-build-system)
2639 `(#:modules ((guix build cmake-build-system)
2642 #:tests? #f ;no test target
2644 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
2645 `("-DUSE_ATASMART:BOOL=ON")
2647 (modify-phases %standard-phases
2648 ;; Install scripts for various foreign init systems. Also fix
2649 ;; hard-coded path for daemon.
2650 (add-after 'install 'install-rc-scripts
2651 (lambda* (#:key outputs #:allow-other-keys)
2652 (let ((out (assoc-ref outputs "out"))
2654 (string-append "../thinkfan-" ,version "/rcscripts")
2657 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
2658 (string-append out "/sbin/" name)))
2659 (for-each (cute install-file <>
2660 (string-append out "/share/thinkfan"))
2664 `(("libatasmart" ,libatasmart)))
2665 (home-page "http://thinkfan.sourceforge.net/")
2666 (synopsis "Simple fan control program")
2668 "Thinkfan is a simple fan control program. It reads temperatures,
2669 checks them against configured limits and switches to appropriate (also
2670 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
2671 other @code{hwmon} driver that enables temperature reading and fan control
2673 (license license:gpl3+)))