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>
16 ;;; This file is part of GNU Guix.
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31 (define-module (gnu packages linux)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages gcc)
36 #:use-module (gnu packages flex)
37 #:use-module (gnu packages bison)
38 #:use-module (gnu packages admin)
39 #:use-module (gnu packages gperf)
40 #:use-module (gnu packages libusb)
41 #:use-module (gnu packages ncurses)
42 #:use-module (gnu packages pciutils)
43 #:use-module (gnu packages databases)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages slang)
48 #:use-module (gnu packages algebra)
49 #:use-module (gnu packages gettext)
50 #:use-module (gnu packages glib)
51 #:use-module (gnu packages pulseaudio)
52 #:use-module (gnu packages attr)
53 #:use-module (gnu packages xml)
54 #:use-module (gnu packages autotools)
55 #:use-module (gnu packages texinfo)
56 #:use-module (gnu packages check)
57 #:use-module (gnu packages maths)
58 #:use-module (gnu packages base)
59 #:use-module (gnu packages rrdtool)
60 #:use-module (gnu packages elf)
61 #:use-module (gnu packages gtk)
62 #:use-module (gnu packages docbook)
63 #:use-module (gnu packages documentation)
64 #:use-module (gnu packages readline)
65 #:use-module (gnu packages calendar)
66 #:use-module (gnu packages tls)
67 #:use-module (gnu packages freedesktop)
68 #:use-module (guix packages)
69 #:use-module (guix download)
70 #:use-module (guix utils)
71 #:use-module (guix build-system gnu)
72 #:use-module (guix build-system cmake)
73 #:use-module (guix build-system python)
74 #:use-module (guix build-system trivial)
75 #:use-module (srfi srfi-1)
76 #:use-module (srfi srfi-2)
77 #:use-module (srfi srfi-26)
78 #:use-module (ice-9 match))
80 (define-public (system->linux-architecture arch)
81 "Return the Linux architecture name for ARCH, a Guix system name such as
83 (let ((arch (car (string-split arch #\-))))
84 (cond ((string=? arch "i686") "i386")
85 ((string-prefix? "mips" arch) "mips")
86 ((string-prefix? "arm" arch) "arm")
87 ((string-prefix? "aarch64" arch) "arm64")
90 (define (linux-libre-urls version)
91 "Return a list of URLs for Linux-Libre VERSION."
93 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
94 version "-gnu/linux-libre-" version "-gnu.tar.xz")
96 ;; XXX: Work around <http://bugs.gnu.org/14851>.
98 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
99 version "-gnu.tar.xz")
101 ;; Maybe this URL will become valid eventually.
103 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
104 version "-gnu.tar.xz")))
106 (define-public linux-libre-headers
107 (let* ((version "4.1.18")
111 (setenv "ARCH" ,(system->linux-architecture arch))
112 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
114 (and (zero? (system* "make" "defconfig"))
115 (zero? (system* "make" "mrproper" "headers_check"))))))
117 `(lambda* (#:key outputs #:allow-other-keys)
118 (let ((out (assoc-ref outputs "out")))
119 (and (zero? (system* "make"
120 (string-append "INSTALL_HDR_PATH=" out)
123 (mkdir (string-append out "/include/config"))
124 (call-with-output-file
126 "/include/config/kernel.release")
128 (format p "~a-default~%" ,version)))
130 ;; Remove the '.install' and '..install.cmd' files; the
131 ;; latter contains store paths, which pulls in bootstrap
132 ;; binaries in the build environment, and prevents bit
133 ;; reproducibility for the bootstrap binaries.
134 (for-each delete-file (find-files out "\\.install"))
138 (name "linux-libre-headers")
142 (uri (linux-libre-urls version))
145 "1bddh2rg645lavhjkk9z75vflba5y0g73z2fjwgbfrj5jb44x9i7"))))
146 (build-system gnu-build-system)
147 (native-inputs `(("perl" ,perl)))
149 `(#:modules ((guix build gnu-build-system)
152 #:phases (alist-replace
153 'build ,(build-phase (or (%current-target-system)
156 'install ,install-phase
157 (alist-delete 'configure %standard-phases)))
158 #:allowed-references ()
160 (synopsis "GNU Linux-Libre kernel headers")
161 (description "Headers of the Linux-Libre kernel.")
162 (license license:gpl2)
163 (home-page "http://www.gnu.org/software/linux-libre/"))))
165 (define-public module-init-tools
167 (name "module-init-tools")
172 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
176 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
177 (patches (search-patches "module-init-tools-moduledir.patch"))))
178 (build-system gnu-build-system)
180 ;; FIXME: The upstream tarball lacks man pages, and building them would
181 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
182 ;; but they vanished. In the meantime, fake it.
183 '(#:phases (alist-cons-before
184 'configure 'fake-docbook
186 (substitute* "Makefile.in"
187 (("^DOCBOOKTOMAN.*$")
188 "DOCBOOKTOMAN = true\n")))
190 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
191 (synopsis "Tools for loading and managing Linux kernel modules")
193 "Tools for loading and managing Linux kernel modules, such as `modprobe',
194 `insmod', `lsmod', and more.")
195 (license license:gpl2+)))
197 (define %boot-logo-patch
198 ;; Linux-Libre boot logo featuring Freedo and a gnu.
201 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
202 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
205 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
207 (define* (kernel-config system #:key variant)
208 "Return the absolute file name of the Linux-Libre build configuration file
209 for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
210 (and-let* ((arch (match system
217 (name (string-append "linux-libre-"
219 (string-append variant "-")
223 (file (string-append "gnu/packages/" name)))
224 (search-path %load-path file)))
226 (define-public linux-libre
227 (let* ((version "4.5.4")
229 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
230 ;; Avoid introducing timestamps
231 (setenv "KCONFIG_NOTIMESTAMP" "1")
232 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
234 ;; Apply the neat patch.
235 (system* "patch" "-p1" "--force"
236 "-i" (assoc-ref inputs "patch/freedo+gnu"))
238 (let ((arch (car (string-split system #\-))))
240 (cond ((string=? arch "i686") "i386")
241 ((string=? arch "mips64el") "mips")
243 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
245 (let ((build (assoc-ref %standard-phases 'build))
246 (config (assoc-ref inputs "kconfig")))
248 ;; Use the architecture-specific config if available, and
249 ;; 'defconfig' otherwise.
252 (copy-file config ".config")
253 (chmod ".config" #o666))
254 (system* "make" "defconfig"))
256 ;; Appending works even when the option wasn't in the
257 ;; file. The last one prevails if duplicated.
258 (let ((port (open-file ".config" "a")))
259 (display (string-append "CONFIG_NET_9P=m\n"
260 "CONFIG_NET_9P_VIRTIO=m\n"
261 "CONFIG_VIRTIO_BLK=m\n"
262 "CONFIG_VIRTIO_NET=m\n"
263 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
264 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
265 "CONFIG_VIRTIO_PCI=m\n"
266 "CONFIG_VIRTIO_BALLOON=m\n"
267 "CONFIG_VIRTIO_MMIO=m\n"
274 (zero? (system* "make" "oldconfig"))
276 ;; Call the default `build' phase so `-j' is correctly
278 (apply build #:make-flags "all" args))))
280 `(lambda* (#:key inputs outputs #:allow-other-keys)
281 (let* ((out (assoc-ref outputs "out"))
282 (moddir (string-append out "/lib/modules"))
283 (mit (assoc-ref inputs "module-init-tools")))
285 (for-each (lambda (file)
287 (string-append out "/" (basename file))))
288 (find-files "." "^(bzImage|vmlinuz|System\\.map)$"))
289 (copy-file ".config" (string-append out "/config"))
290 (zero? (system* "make"
291 (string-append "DEPMOD=" mit "/sbin/depmod")
292 (string-append "MODULE_DIR=" moddir)
293 (string-append "INSTALL_PATH=" out)
294 (string-append "INSTALL_MOD_PATH=" out)
295 "INSTALL_MOD_STRIP=1"
296 "modules_install"))))))
302 (uri (linux-libre-urls version))
305 "0c587v03kz5whh82apva6gwqvczdi6djy29gk0gfd9dbkb2518b1"))))
306 (build-system gnu-build-system)
307 (supported-systems '("x86_64-linux" "i686-linux"))
308 (native-inputs `(("perl" ,perl)
311 ("module-init-tools" ,module-init-tools)
312 ("patch/freedo+gnu" ,%boot-logo-patch)
314 ,@(let ((conf (kernel-config
315 (or (%current-target-system)
317 #:variant (version-major+minor version))))
322 `(#:modules ((guix build gnu-build-system)
326 #:phases (alist-replace
329 'install ,install-phase
330 (alist-delete 'configure %standard-phases)))
332 (synopsis "100% free redistribution of a cleaned Linux kernel")
334 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
335 It has been modified to remove all non-free binary blobs.")
336 (license license:gpl2)
337 (home-page "http://www.gnu.org/software/linux-libre/"))))
339 (define-public linux-libre-4.4
341 (inherit linux-libre)
345 (uri (linux-libre-urls version))
348 "1k7h632vgh3wlz44qqawy238f4mzn19bm9sz9zqq0ql6wwhkjdkj"))))
350 (let ((conf (kernel-config (or (%current-target-system)
353 `(,@(alist-delete "kconfig" (package-native-inputs linux-libre))
354 ("kconfig" ,conf))))))
356 (define-public linux-libre-4.1
358 (inherit linux-libre)
362 (uri (linux-libre-urls version))
365 "14jlnq0k86bl4wj8shmvgf34w90bbm9in44j1pdjwwvn169zh9ra"))))
367 (let ((conf (kernel-config (or (%current-target-system)
370 `(,@(alist-delete "kconfig" (package-native-inputs linux-libre))
371 ("kconfig" ,conf))))))
375 ;;; Pluggable authentication modules (PAM).
378 (define-public linux-pam
385 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
387 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
388 version ".tar.bz2")))
391 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))))
392 (build-system gnu-build-system)
396 ;; TODO: optional dependencies
397 ;; ("libxcrypt" ,libxcrypt)
398 ;; ("cracklib" ,cracklib)
401 '(;; Most users, such as `shadow', expect the headers to be under
403 #:configure-flags (list (string-append "--includedir="
404 (assoc-ref %outputs "out")
405 "/include/security"))
407 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
410 (home-page "http://www.linux-pam.org/")
411 (synopsis "Pluggable authentication modules for Linux")
413 "A *Free* project to implement OSF's RFC 86.0.
414 Pluggable authentication modules are small shared object files that can
415 be used through the PAM API to perform tasks, like authenticating a user
416 at login. Local and dynamic reconfiguration are its key features.")
417 (license license:bsd-3)))
424 (define-public psmisc
431 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
435 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
436 (build-system gnu-build-system)
437 (inputs `(("ncurses" ,ncurses)))
438 (home-page "http://psmisc.sourceforge.net/")
440 "Small utilities that use the proc filesystem")
442 "This PSmisc package is a set of some small useful utilities that
443 use the proc filesystem. We're not about changing the world, but
444 providing the system administrator with some help in common tasks.")
445 (license license:gpl2+)))
447 (define-public util-linux
453 (uri (string-append "mirror://kernel.org/linux/utils/"
454 name "/v" (version-major+minor version) "/"
455 name "-" version ".tar.xz"))
458 "1ivdx1bhjbakf77agm9dn3wyxia1wgz9lzxgd61zqxw3xzih9gzw"))
459 (patches (search-patches "util-linux-tests.patch"))
460 (modules '((guix build utils)))
462 ;; We take the 'logger' program from GNU Inetutils and 'kill'
463 ;; from GNU Coreutils.
465 (substitute* "configure"
466 (("build_logger=yes") "build_logger=no")
467 (("build_kill=yes") "build_kill=no"))
469 (build-system gnu-build-system)
471 "static")) ; >2 MiB of static .a libraries
473 `(#:configure-flags (list "--disable-use-tty-group"
475 ;; Install completions where our
476 ;; bash-completion package expects them.
477 (string-append "--with-bashcompletiondir="
478 (assoc-ref %outputs "out")
479 "/etc/bash_completion.d"))
480 #:phases (modify-phases %standard-phases
482 'build 'set-umount-file-name
483 (lambda* (#:key outputs #:allow-other-keys)
484 ;; Tell 'eject' the right file name of 'umount'.
485 (let ((out (assoc-ref outputs "out")))
486 (substitute* "sys-utils/eject.c"
488 (string-append "\"" out "/bin/umount\"")))
492 (lambda* (#:key inputs outputs #:allow-other-keys)
493 (let ((out (assoc-ref outputs "out"))
494 (net (assoc-ref inputs "net-base")))
495 ;; Change the test to refer to the right file.
496 (substitute* "tests/ts/misc/mcookie"
498 (string-append net "/etc/services")))
501 'install 'move-static-libraries
502 (lambda* (#:key outputs #:allow-other-keys)
503 (let ((out (assoc-ref outputs "out"))
504 (static (assoc-ref outputs "static")))
505 (mkdir-p (string-append static "/lib"))
506 (with-directory-excursion out
507 (for-each (lambda (file)
509 (string-append static "/"
511 (find-files "lib" "\\.a$")))
513 (inputs `(("zlib" ,zlib)
514 ("ncurses" ,ncurses)))
517 ("net-base" ,net-base))) ;for tests
518 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
519 (synopsis "Collection of utilities for the Linux kernel")
520 (description "Util-linux is a diverse collection of Linux kernel
521 utilities. It provides dmesg and includes tools for working with filesystems,
522 block devices, UUIDs, TTYs, and many other tools.")
524 ;; Note that util-linux doesn't use the same license for all the
525 ;; code. GPLv2+ is the default license for a code without an
526 ;; explicitly defined license.
527 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
528 license:bsd-4 license:public-domain))))
530 (define-public procps
536 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
537 "procps-ng-" version ".tar.xz"))
540 "1va4n0mpsq327ca9dqp4hnrpgs6821rp0f2m0jyc1bfjl9lk2jg9"))
542 (list (search-patch "procps-non-linux.patch")))))
543 (build-system gnu-build-system)
545 '(#:modules ((guix build utils)
546 (guix build gnu-build-system)
550 (modify-phases %standard-phases
552 'install 'post-install
553 ;; Remove commands and man pages redudant with
555 (lambda* (#:key outputs #:allow-other-keys)
556 (let* ((out (assoc-ref outputs "out"))
557 (dup (append-map (cut find-files out <>)
558 '("^kill" "^uptime"))))
559 (for-each delete-file dup)
561 (inputs `(("ncurses" ,ncurses)))
562 (home-page "https://gitlab.com/procps-ng/procps/")
563 (synopsis "Utilities that give information about processes")
565 "Procps is the package that has a bunch of small useful utilities
566 that give information about processes using the Linux /proc file system.
567 The package includes the programs ps, top, vmstat, w, kill, free,
568 slabtop, and skill.")
569 (license license:gpl2)))
571 (define-public usbutils
578 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
579 "usbutils-" version ".tar.xz"))
582 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
583 (build-system gnu-build-system)
585 `(("libusb" ,libusb)))
587 `(("pkg-config" ,pkg-config)))
588 (home-page "http://www.linux-usb.org/")
590 "Tools for working with USB devices, such as lsusb")
592 "Tools for working with USB devices, such as lsusb.")
593 (license license:gpl2+)))
595 (define-public e2fsprogs
602 "mirror://kernel.org/linux/kernel/people/tytso/"
603 name "/v" version "/"
604 name "-" version ".tar.xz"))
607 "1ix0b83zgw5n0p2grh2961c6796m92yr2jqc2sbr23x3lfsp8r71"))
608 (modules '((guix build utils)))
610 '(substitute* "MCONFIG.in"
611 (("INSTALL_SYMLINK = /bin/sh")
612 "INSTALL_SYMLINK = sh")))))
613 (build-system gnu-build-system)
614 (inputs `(("util-linux" ,util-linux)))
615 (native-inputs `(("pkg-config" ,pkg-config)
616 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
618 '(;; util-linux is the preferred source for some of the libraries and
619 ;; commands, so disable them (see, e.g.,
620 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
621 #:configure-flags '("--disable-libblkid"
622 "--disable-libuuid" "--disable-uuidd"
625 ;; Install libext2fs et al.
626 "--enable-elf-shlibs")
628 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
629 (assoc-ref %outputs "out")
632 #:phases (alist-cons-before
633 'configure 'patch-shells
635 (substitute* "configure"
636 (("/bin/sh (.*)parse-types.sh" _ dir)
637 (string-append (which "sh") " " dir
639 (substitute* (find-files "." "^Makefile.in$")
641 (string-append "#!" (which "sh")))))
643 'install 'install-libs
644 (lambda* (#:key outputs #:allow-other-keys)
645 (let* ((out (assoc-ref outputs "out"))
646 (lib (string-append out "/lib")))
647 (and (zero? (system* "make" "install-libs"))
649 ;; Make the .a writable so that 'strip' works.
650 ;; Failing to do that, due to debug symbols, we
651 ;; retain a reference to the final
652 ;; linux-libre-headers, which refer to the
653 ;; bootstrap binaries.
654 (let ((archives (find-files lib "\\.a$")))
655 (for-each (lambda (file)
661 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
662 ;; they fail because we get an extra line that says "Can't check if
663 ;; filesystem is mounted due to missing mtab file".
665 (home-page "http://e2fsprogs.sourceforge.net/")
666 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
668 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
669 (license (list license:gpl2 ;programs
670 license:lgpl2.0 ;libext2fs
671 license:x11)))) ;libuuid
673 (define e2fsprogs/static
675 (package (inherit e2fsprogs)
677 ;; Do not build shared libraries.
678 (substitute-keyword-arguments (package-arguments e2fsprogs)
679 ((#:configure-flags _)
680 '(list "--disable-blkid"))
684 (define-public e2fsck/static
686 (name "e2fsck-static")
687 (version (package-version e2fsprogs))
688 (build-system trivial-build-system)
691 `(#:modules ((guix build utils))
694 (use-modules (guix build utils)
698 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
700 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
702 (with-directory-excursion bin
703 (for-each (lambda (file)
704 (copy-file (string-append source "/" file)
706 (remove-store-references file)
708 (scandir source (cut string-prefix? "fsck." <>))))))))
709 (inputs `(("e2fsprogs" ,e2fsprogs/static)))
710 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
712 "This package provides statically-linked command of fsck.ext[234] taken
713 from the e2fsprogs package. It is meant to be used in initrds.")
714 (home-page (package-home-page e2fsprogs))
715 (license (package-license e2fsprogs))))
717 (define-public extundelete
723 (uri (string-append "mirror://sourceforge/extundelete/"
724 version "/extundelete-" version ".tar.bz2"))
727 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
728 (build-system gnu-build-system)
729 (inputs `(("e2fsprogs" ,e2fsprogs)))
730 (home-page "http://extundelete.sourceforge.net/")
731 (synopsis "Recover deleted files from ext2/3/4 partitions")
733 "Extundelete is a set of tools that can recover deleted files from an
734 ext3 or ext4 partition.")
735 (license license:gpl2)))
737 (define-public zerofree
741 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
744 (uri (string-append home-page name "-" version
748 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
749 (build-system gnu-build-system)
751 '(#:phases (alist-replace
753 (lambda* (#:key outputs #:allow-other-keys)
754 (let* ((out (assoc-ref outputs "out"))
755 (bin (string-append out "/bin")))
757 (copy-file "zerofree"
758 (string-append bin "/zerofree"))
759 (chmod (string-append bin "/zerofree")
762 (alist-delete 'configure %standard-phases))
763 #:tests? #f)) ;no tests
764 (inputs `(("libext2fs" ,e2fsprogs)))
765 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
767 "The zerofree command scans the free blocks in an ext2 file system and
768 fills any non-zero blocks with zeroes. This is a useful way to make disk
769 images more compressible.")
770 (license license:gpl2)))
772 (define-public strace
778 (uri (string-append "mirror://sourceforge/strace/strace-"
782 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
783 (build-system gnu-build-system)
784 (native-inputs `(("perl" ,perl)))
785 (home-page "http://strace.sourceforge.net/")
786 (synopsis "System call tracer for Linux")
788 "strace is a system call tracer, i.e. a debugging tool which prints out a
789 trace of all the system calls made by a another process/program.")
790 (license license:bsd-3)))
792 (define-public ltrace
798 (uri (string-append "http://www.ltrace.org/ltrace_" version
802 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
803 (build-system gnu-build-system)
804 (inputs `(("libelf" ,libelf)))
806 ;; Compilation uses -Werror by default, but it fails.
807 '(#:configure-flags '("--disable-werror")))
808 (home-page "http://www.ltrace.org/")
809 (synopsis "Library call tracer for Linux")
811 "ltrace intercepts and records dynamic library calls which are called by
812 an executed process and the signals received by that process. It can also
813 intercept and print the system calls executed by the program.")
814 (license license:gpl2+)))
816 (define-public alsa-lib
823 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
827 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
828 (patches (search-patches "alsa-lib-mips-atomic-fix.patch"))))
829 (build-system gnu-build-system)
830 (home-page "http://www.alsa-project.org/")
831 (synopsis "The Advanced Linux Sound Architecture libraries")
833 "The Advanced Linux Sound Architecture (ALSA) provides audio and
834 MIDI functionality to the Linux-based operating system.")
835 (license license:lgpl2.1+)))
837 (define-public alsa-utils
843 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
844 name "-" version ".tar.bz2"))
847 "1wa88wvqcfhak9x3y65wzzwxmmyxb5bv2gyj7lnm653fnwsk271v"))))
848 (build-system gnu-build-system)
850 ;; XXX: Disable man page creation until we have DocBook.
851 '(#:configure-flags (list "--disable-xmlto"
853 ;; The udev rule is responsible for restoring
855 (string-append "--with-udev-rules-dir="
856 (assoc-ref %outputs "out")
857 "/lib/udev/rules.d"))
858 #:phases (alist-cons-before
859 'install 'pre-install
861 ;; Don't try to mkdir /var/lib/alsa.
862 (substitute* "Makefile"
863 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
867 `(("libsamplerate" ,libsamplerate)
869 ("alsa-lib" ,alsa-lib)
871 ("gettext" ,gnu-gettext)))
872 (home-page "http://www.alsa-project.org/")
873 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
875 "The Advanced Linux Sound Architecture (ALSA) provides audio and
876 MIDI functionality to the Linux-based operating system.")
878 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
880 (license license:gpl2)))
882 (define-public iptables
889 "http://www.netfilter.org/projects/iptables/files/iptables-"
893 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
894 (build-system gnu-build-system)
896 '(#:tests? #f ; no test suite
897 #:configure-flags ; add $libdir to the RUNPATH of executables
898 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
899 (home-page "http://www.netfilter.org/projects/iptables/index.html")
900 (synopsis "Program to configure the Linux IP packet filtering rules")
902 "iptables is the userspace command line program used to configure the
903 Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
904 system administrators. Since Network Address Translation is also configured
905 from the packet filter ruleset, iptables is used for this, too. The iptables
906 package also includes ip6tables. ip6tables is used for configuring the IPv6
908 (license license:gpl2+)))
910 (define-public iproute
917 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
921 "05351m4m0whsivlblvs3m0nz5q9v6r06ik80z27gf6ca51kw74dw"))))
922 (build-system gnu-build-system)
924 `(#:tests? #f ; no test suite
925 #:make-flags (let ((out (assoc-ref %outputs "out")))
927 (string-append "LIBDIR=" out "/lib")
928 (string-append "SBINDIR=" out "/sbin")
929 (string-append "CONFDIR=" out "/etc")
930 (string-append "DOCDIR=" out "/share/doc/"
932 (string-append "MANDIR=" out "/share/man")))
933 #:phases (modify-phases %standard-phases
934 (add-before 'install 'pre-install
936 ;; Don't attempt to create /var/lib/arpd.
937 (substitute* "Makefile"
938 (("^.*ARPDDIR.*$") "")))))))
940 `(("iptables" ,iptables)
943 `(("pkg-config" ,pkg-config)
947 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
949 "Utilities for controlling TCP/IP networking and traffic in Linux")
951 "Iproute2 is a collection of utilities for controlling TCP/IP
952 networking and traffic with the Linux kernel.
954 Most network configuration manuals still refer to ifconfig and route as the
955 primary network configuration tools, but ifconfig is known to behave
956 inadequately in modern network environments. They should be deprecated, but
957 most distros still include them. Most network configuration systems make use
958 of ifconfig and thus provide a limited feature set. The /etc/net project aims
959 to support most modern network technologies, as it doesn't use ifconfig and
960 allows a system administrator to make use of all iproute2 features, including
963 iproute2 is usually shipped in a package called iproute or iproute2 and
964 consists of several tools, of which the most important are ip and tc. ip
965 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
966 tools print detailed usage messages and are accompanied by a set of
968 (license license:gpl2+)))
970 (define-public net-tools
971 ;; XXX: This package is basically unmaintained, but it provides a few
972 ;; commands not yet provided by Inetutils, such as 'route', so we have to
977 (home-page "http://net-tools.sourceforge.net/")
980 (uri (list (string-append
981 "mirror://sourceforge/net-tools/net-tools-"
984 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
985 "/base/net-tools/net-tools-1.60.tar.bz2")))
988 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
989 (patches (search-patches "net-tools-bitrot.patch"))))
990 (build-system gnu-build-system)
992 '(#:modules ((guix build gnu-build-system)
996 #:phases (alist-cons-after
998 (lambda* (#:key inputs #:allow-other-keys)
999 (define (apply-patch file)
1000 (zero? (system* "patch" "-p1" "--force"
1003 (let ((patch.gz (assoc-ref inputs "patch")))
1004 (format #t "applying Debian patch set '~a'...~%"
1006 (system (string-append "gunzip < " patch.gz " > the-patch"))
1007 (and (apply-patch "the-patch")
1008 (for-each apply-patch
1009 (find-files "debian/patches"
1013 (lambda* (#:key outputs #:allow-other-keys)
1014 (let ((out (assoc-ref outputs "out")))
1015 (mkdir-p (string-append out "/bin"))
1016 (mkdir-p (string-append out "/sbin"))
1018 ;; Pretend we have everything...
1019 (system "yes | make config")
1021 ;; ... except for the things we don't have.
1022 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1023 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1024 ;; that have been removed.
1025 (substitute* '("config.make" "config.h")
1026 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1028 'install 'remove-redundant-commands
1029 (lambda* (#:key outputs #:allow-other-keys)
1030 ;; Remove commands and man pages redundant with
1032 (let* ((out (assoc-ref outputs "out"))
1033 (dup (append-map (cut find-files out <>)
1035 "^(yp|nis|dns)?domainname"))))
1036 (for-each delete-file dup)
1040 ;; Binaries that depend on libnet-tools.a don't declare that
1041 ;; dependency, making it parallel-unsafe.
1042 #:parallel-build? #f
1044 #:tests? #f ; no test suite
1045 #:make-flags (let ((out (assoc-ref %outputs "out")))
1047 (string-append "BASEDIR=" out)
1048 (string-append "INSTALLNLSDIR=" out "/share/locale")
1049 (string-append "mandir=/share/man")))))
1051 ;; Use the big Debian patch set (the thing does not even compile out of
1053 (inputs `(("patch" ,(origin
1056 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1059 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1060 (native-inputs `(("gettext" ,gnu-gettext)))
1062 (synopsis "Tools for controlling the network subsystem in Linux")
1064 "This package includes the important tools for controlling the network
1065 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1066 netstat, rarp and route. Additionally, this package contains utilities
1067 relating to particular network hardware types (plipconfig, slattach) and
1068 advanced aspects of IP configuration (iptunnel, ipmaddr).")
1069 (license license:gpl2+)))
1071 (define-public libcap
1078 "mirror://kernel.org/linux/libs/security/linux-privs/"
1079 "libcap2/libcap-" version ".tar.xz"))
1082 "0rbc9qbqs5bp9am9s9g83wxj5k4ixps2agy9dxr1v1fwg27mdr6f"))))
1083 (build-system gnu-build-system)
1084 (arguments '(#:phases
1085 (modify-phases %standard-phases
1087 ;; Add $libdir to the RUNPATH of executables.
1089 (substitute* "Make.Rules"
1091 (string-append "LDFLAGS := -Wl,-rpath="
1092 %output "/lib"))))))
1093 #:tests? #f ; no 'check' target
1094 #:make-flags (list "lib=lib"
1095 (string-append "prefix="
1096 (assoc-ref %outputs "out"))
1097 "RAISE_SETFCAP=no")))
1098 (native-inputs `(("perl" ,perl)))
1099 (inputs `(("attr" ,attr)))
1100 (home-page "https://sites.google.com/site/fullycapable/")
1101 (synopsis "Library for working with POSIX capabilities")
1103 "Libcap2 provides a programming interface to POSIX capabilities on
1104 Linux-based operating systems.")
1106 ;; License is BSD-3 or GPLv2, at the user's choice.
1107 (license license:gpl2)))
1109 (define-public bridge-utils
1111 (name "bridge-utils")
1115 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
1119 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1120 (build-system gnu-build-system)
1122 ;; The tarball lacks all the generated files.
1123 (native-inputs `(("autoconf" ,autoconf)
1124 ("automake" ,automake)))
1126 '(#:phases (alist-cons-after
1129 ;; Fix "field ‘ip6’ has incomplete type" errors.
1130 (substitute* "libbridge/libbridge.h"
1131 (("#include <linux/if_bridge.h>")
1132 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1134 ;; Ensure that the entire build fails if one of the
1135 ;; sub-Makefiles fails.
1136 (substitute* "Makefile.in"
1137 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1138 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1140 (zero? (system* "autoreconf" "-vf")))
1142 #:tests? #f)) ; no 'check' target
1145 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1146 (synopsis "Manipulate Ethernet bridges")
1148 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1149 to connect two Ethernet segments together in a protocol independent way.
1150 Packets are forwarded based on Ethernet address, rather than IP address (like
1151 a router). Since forwarding is done at Layer 2, all protocols can go
1152 transparently through a bridge.")
1153 (license license:gpl2+)))
1155 (define-public libnl
1162 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1166 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
1167 (build-system gnu-build-system)
1168 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1169 (home-page "http://www.infradead.org/~tgr/libnl/")
1170 (synopsis "NetLink protocol library suite")
1172 "The libnl suite is a collection of libraries providing APIs to netlink
1173 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1174 between the kernel and user space processes. It was designed to be a more
1175 flexible successor to ioctl to provide mainly networking related kernel
1176 configuration and monitoring interfaces.")
1178 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1179 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1180 (license license:gpl2)))
1189 "https://www.kernel.org/pub/software/network/iw/iw-"
1193 "14zsapqhivk0ws5z21y1ys2c2czi05mzk7bl2yb7qxcfrnsjx9j8"))))
1194 (build-system gnu-build-system)
1195 (native-inputs `(("pkg-config" ,pkg-config)))
1196 (inputs `(("libnl" ,libnl)))
1198 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1200 #:phases (alist-delete 'configure %standard-phases)))
1201 (home-page "http://wireless.kernel.org/en/users/Documentation/iw")
1202 (synopsis "Tool for configuring wireless devices")
1204 "iw is a new nl80211 based CLI configuration utility for wireless
1205 devices. It replaces 'iwconfig', which is deprecated.")
1206 (license license:isc)))
1208 (define-public powertop
1216 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1220 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1221 (build-system gnu-build-system)
1224 (modify-phases %standard-phases
1225 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1226 ;; allow calibrating the network interface in GuixSD.
1227 (add-after 'unpack 'patch-absolute-file-names
1228 (lambda* (#:key inputs #:allow-other-keys)
1229 (let ((kmod (assoc-ref inputs "kmod")))
1230 (substitute* (find-files "src" "\\.cpp$")
1231 ;; Give the right 'modprobe' file name so that essential
1232 ;; modules such as msr.ko can be loaded.
1233 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1234 ;; These programs are only needed to calibrate, so using
1235 ;; relative file names avoids adding extra inputs. When they
1236 ;; are missing powertop gracefully handles it.
1237 (("/usr/bin/hcitool") "hcitool")
1238 (("/usr/bin/xset") "xset")
1239 (("/usr/sbin/hciconfig") "hciconfig"))
1244 ("ncurses" ,ncurses)
1245 ("pciutils" ,pciutils)
1248 `(("pkg-config" ,pkg-config)))
1249 (home-page "https://01.org/powertop/")
1250 (synopsis "Analyze power consumption on Intel-based laptops")
1252 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1253 power management. In addition to being a diagnostic tool, PowerTOP also has
1254 an interactive mode where the user can experiment various power management
1255 settings for cases where the operating system has not enabled these
1257 (license license:gpl2)))
1259 (define-public aumix
1266 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1267 version ".tar.bz2"))
1270 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1271 (build-system gnu-build-system)
1272 (inputs `(("ncurses" ,ncurses)))
1273 (home-page "http://www.jpj.net/~trevor/aumix.html")
1274 (synopsis "Audio mixer for X and the console")
1276 "Aumix adjusts an audio mixer from X, the console, a terminal,
1277 the command line or a script.")
1278 (license license:gpl2+)))
1280 (define-public iotop
1287 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1290 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1291 (build-system python-build-system)
1293 ;; The setup.py script expects python-2.
1294 `(#:python ,python-2
1295 ;; There are currently no checks in the package.
1297 (native-inputs `(("python" ,python-2)))
1298 (home-page "http://guichaz.free.fr/iotop/")
1300 "Displays the IO activity of running processes")
1302 "Iotop is a Python program with a top like user interface to show the
1303 processes currently causing I/O.")
1304 (license license:gpl2+)))
1312 (uri (let ((version-with-underscores
1313 (string-join (string-split version #\.) "_")))
1315 "https://github.com/libfuse/libfuse/"
1316 "releases/download/fuse_" version-with-underscores
1317 "/fuse-" version ".tar.gz")))
1320 "1dfvbi1p57svbv2sfnbqwpnsk219spvjnlapf35azhgzqlf3g7sp"))))
1321 (build-system gnu-build-system)
1322 (inputs `(("util-linux" ,util-linux)))
1324 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1325 (assoc-ref %outputs "out")
1327 (string-append "INIT_D_PATH="
1328 (assoc-ref %outputs "out")
1331 ;; The rule makes /dev/fuse 666.
1332 (string-append "UDEV_RULES_PATH="
1333 (assoc-ref %outputs "out")
1334 "/lib/udev/rules.d"))
1335 #:phases (alist-cons-before
1336 'build 'set-file-names
1337 (lambda* (#:key inputs #:allow-other-keys)
1338 ;; libfuse calls out to mount(8) and umount(8). Make sure
1339 ;; it refers to the right ones.
1340 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1341 (("/bin/(u?)mount" _ maybe-u)
1342 (string-append (assoc-ref inputs "util-linux")
1343 "/bin/" maybe-u "mount")))
1344 (substitute* '("util/mount.fuse.c")
1348 ;; This hack leads libfuse to search for 'fusermount' in
1349 ;; $PATH, where it may find a setuid-root binary, instead of
1350 ;; trying solely $out/sbin/fusermount and failing because
1352 (substitute* "lib/Makefile"
1353 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1354 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1356 (home-page "http://fuse.sourceforge.net/")
1357 (synopsis "Support file systems implemented in user space")
1359 "As a consequence of its monolithic design, file system code for Linux
1360 normally goes into the kernel itself---which is not only a robustness issue,
1361 but also an impediment to system extensibility. FUSE, for \"file systems in
1362 user space\", is a kernel module and user-space library that tries to address
1363 part of this problem by allowing users to run file system implementations as
1364 user-space processes.")
1365 (license (list license:lgpl2.1 ;library
1366 license:gpl2+)))) ;command-line utilities
1368 (define-public unionfs-fuse
1370 (name "unionfs-fuse")
1375 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1379 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1380 (build-system cmake-build-system)
1381 (inputs `(("fuse" ,fuse)))
1382 (arguments '(#:tests? #f)) ; no tests
1383 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1384 (synopsis "User-space union file system")
1386 "UnionFS-FUSE is a flexible union file system implementation in user
1387 space, using the FUSE library. Mounting a union file system allows you to
1388 \"aggregate\" the contents of several directories into a single mount point.
1389 UnionFS-FUSE additionally supports copy-on-write.")
1390 (license license:bsd-3)))
1393 (package (inherit fuse)
1394 (name "fuse-static")
1395 (source (origin (inherit (package-source fuse))
1396 (modules '((guix build utils)))
1398 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1399 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1400 ;; it doesn't do that, allowing us to remove the dependency on
1401 ;; util-linux (something that is useful in initrds.)
1402 '(substitute* '("lib/mount_util.c"
1403 "util/mount_util.c")
1404 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1409 (define-public unionfs-fuse/static
1410 (package (inherit unionfs-fuse)
1411 (synopsis "User-space union file system (statically linked)")
1412 (name (string-append (package-name unionfs-fuse) "-static"))
1413 (source (origin (inherit (package-source unionfs-fuse))
1414 (modules '((guix build utils)))
1416 ;; Add -ldl to the libraries, because libfuse.a needs that.
1417 '(substitute* "src/CMakeLists.txt"
1418 (("target_link_libraries(.*)\\)" _ libs)
1419 (string-append "target_link_libraries"
1423 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1424 #:phases (alist-cons-after
1425 'install 'post-install
1426 (lambda* (#:key outputs #:allow-other-keys)
1427 (let* ((out (assoc-ref outputs "out"))
1428 (exe (string-append out "/bin/unionfs")))
1429 ;; By default, 'unionfs' keeps references to
1430 ;; $glibc/share/locale and similar stuff. Remove them.
1431 (remove-store-references exe)))
1433 (inputs `(("fuse" ,fuse-static)))))
1435 (define-public sshfs-fuse
1441 (uri (let ((version-with-underscores
1442 (string-join (string-split version #\.) "_")))
1443 (string-append "https://github.com/libfuse/sshfs/releases/"
1444 "download/sshfs_" version-with-underscores
1445 "/sshfs-fuse-" version ".tar.gz")))
1448 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1449 (build-system gnu-build-system)
1454 `(("pkg-config" ,pkg-config)))
1455 (home-page "http://fuse.sourceforge.net/sshfs.html")
1456 (synopsis "Mount remote file systems over SSH")
1458 "This is a file system client based on the SSH File Transfer Protocol.
1459 Since most SSH servers already support this protocol it is very easy to set
1460 up: on the server side there's nothing to do; on the client side mounting the
1461 file system is as easy as logging into the server with an SSH client.")
1462 (license license:gpl2+)))
1464 (define-public numactl
1471 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1476 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1477 (build-system gnu-build-system)
1479 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1480 ;; to run, which we can't assume to have.
1483 ;; NUMA is apparently not supported on armhf, see
1484 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1485 (supported-systems (delete "armhf-linux" %supported-systems))
1486 (home-page "http://oss.sgi.com/projects/libnuma/")
1487 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1489 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1490 memory is not all in one place. The numactl program allows you to run your
1491 application program on specific CPU's and memory nodes. It does this by
1492 supplying a NUMA memory policy to the operating system before running your
1495 The package contains other commands, such as numademo, numastat and memhog.
1496 The numademo command provides a quick overview of NUMA performance on your
1498 (license (list license:gpl2 ;programs
1499 license:lgpl2.1)))) ;library
1507 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1511 "0ppv953gn2zylcagr4z6zg5y2x93dxrml29plypg6xgbq3hrv2bs"))
1512 (modules '((guix build utils)))
1515 (substitute* "tests/Makefile.in"
1516 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1519 (substitute* '("src/unicode_start" "src/unicode_stop")
1520 ;; Assume the Coreutils are in $PATH.
1523 (build-system gnu-build-system)
1526 (modify-phases %standard-phases
1527 (add-before 'build 'pre-build
1528 (lambda* (#:key inputs #:allow-other-keys)
1529 (let ((gzip (assoc-ref %build-inputs "gzip"))
1530 (bzip2 (assoc-ref %build-inputs "bzip2")))
1531 (substitute* "src/libkeymap/findfile.c"
1533 (string-append gzip "/bin/gzip"))
1535 (string-append bzip2 "/bin/bzip2"))))))
1536 (add-after 'install 'post-install
1537 (lambda* (#:key outputs #:allow-other-keys)
1538 ;; Make sure these programs find their comrades.
1539 (let* ((out (assoc-ref outputs "out"))
1540 (bin (string-append out "/bin")))
1541 (for-each (lambda (prog)
1542 (wrap-program (string-append bin "/" prog)
1543 `("PATH" ":" prefix (,bin))))
1544 '("unicode_start" "unicode_stop"))))))))
1545 (inputs `(("check" ,check)
1548 ("pam" ,linux-pam)))
1549 (native-inputs `(("pkg-config" ,pkg-config)))
1550 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1551 (synopsis "Linux keyboard utilities and keyboard maps")
1553 "This package contains keytable files and keyboard utilities compatible
1554 for systems using the Linux kernel. This includes commands such as
1555 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1556 (license license:gpl2+)))
1558 (define-public inotify-tools
1560 (name "inotify-tools")
1565 "mirror://sourceforge/inotify-tools/inotify-tools/"
1566 version "/inotify-tools-" version ".tar.gz"))
1569 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1570 (build-system gnu-build-system)
1571 (home-page "http://inotify-tools.sourceforge.net/")
1572 (synopsis "Monitor file accesses")
1574 "The inotify-tools packages provides a C library and command-line tools
1575 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1576 (license license:gpl2+)))
1585 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1586 "kmod-" version ".tar.xz"))
1589 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1590 (patches (search-patches "kmod-module-directory.patch"))))
1591 (build-system gnu-build-system)
1593 `(("pkg-config" ,pkg-config)))
1598 `(#:tests? #f ; FIXME: Investigate test failures
1599 #:configure-flags '("--with-xz" "--with-zlib")
1600 #:phases (alist-cons-after
1601 'install 'install-modprobe&co
1602 (lambda* (#:key outputs #:allow-other-keys)
1603 (let* ((out (assoc-ref outputs "out"))
1604 (bin (string-append out "/bin")))
1605 (for-each (lambda (tool)
1607 (string-append bin "/" tool)))
1608 '("insmod" "rmmod" "lsmod" "modprobe"
1609 "modinfo" "depmod"))))
1611 (home-page "https://www.kernel.org/")
1612 (synopsis "Kernel module tools")
1613 (description "Kmod is a set of tools to handle common tasks with Linux
1614 kernel modules like insert, remove, list, check properties, resolve
1615 dependencies and aliases.
1617 These tools are designed on top of libkmod, a library that is shipped with
1618 kmod. The aim is to be compatible with tools, configurations and indices
1619 from the module-init-tools project.")
1620 (license license:gpl2+))) ; library under lgpl2.1+
1622 (define-public eudev
1623 ;; The post-systemd fork, maintained by Gentoo.
1630 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1634 "0akg9gcc3c2p56xbhlvbybqavcprly5q0bvk655zwl6d62j8an7p"))
1635 (patches (search-patches "eudev-rules-directory.patch"))))
1636 (build-system gnu-build-system)
1638 `(("pkg-config" ,pkg-config)
1642 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1643 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1644 ;; which contains the rules to do that.
1645 `(("util-linux" ,util-linux) ;for blkid
1647 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1648 (synopsis "Userspace device management")
1649 (description "Udev is a daemon which dynamically creates and removes
1650 device nodes from /dev/, handles hotplug events and loads drivers at boot
1652 (license license:gpl2+)))
1657 (version "2.02.109")
1660 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1664 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1665 (modules '((guix build utils)))
1668 (use-modules (guix build utils))
1670 ;; Honor sysconfdir.
1671 (substitute* "make.tmpl.in"
1673 "confdir = @sysconfdir@\n")
1674 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1675 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1676 (build-system gnu-build-system)
1678 `(("pkg-config" ,pkg-config)
1679 ("procps" ,procps))) ;tests use 'pgrep'
1683 '(#:phases (alist-cons-after
1684 'configure 'set-makefile-shell
1686 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1688 (setenv "SHELL" (which "sh"))
1690 ;; Replace /bin/sh with the right file name.
1691 (patch-makefile-SHELL "make.tmpl"))
1694 #:configure-flags (list (string-append "--sysconfdir="
1695 (assoc-ref %outputs "out")
1697 "--enable-udev_sync"
1698 "--enable-udev_rules"
1700 ;; Make sure programs such as 'dmsetup' can
1701 ;; find libdevmapper.so.
1702 (string-append "LDFLAGS=-Wl,-rpath="
1703 (assoc-ref %outputs "out")
1706 ;; The tests use 'mknod', which requires root access.
1708 (home-page "http://sourceware.org/lvm2/")
1709 (synopsis "Logical volume management for Linux")
1711 "LVM2 is the logical volume management tool set for Linux-based systems.
1712 This package includes the user-space libraries and tools, including the device
1713 mapper. Kernel components are part of Linux-libre.")
1715 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1716 ;; Command-line tools are GPLv2.
1717 (license (list license:gpl2 license:lgpl2.1))))
1719 (define-public wireless-tools
1721 (name "wireless-tools")
1725 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1729 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
1732 ;; Remove the older header files that are not free software.
1733 (for-each (lambda (n)
1734 (delete-file (format #f "wireless.~a.h" n)))
1735 '(10 11 12 13 14 15 16 17 18 19 20))
1737 (build-system gnu-build-system)
1740 (list (string-append "PREFIX=" %output)
1741 (string-append "INSTALL_MAN=" %output "/share/man")
1742 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1744 #:phases (modify-phases %standard-phases
1745 (delete 'configure))
1747 (synopsis "Tools for manipulating Linux Wireless Extensions")
1748 (description "Wireless Tools are used to manipulate the now-deprecated
1749 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1750 Extension was an interface allowing you to set Wireless LAN specific
1751 parameters and get the specific stats. It is deprecated in favor the nl80211
1753 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1754 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1755 ;; other files are distributed under gpl2.
1756 (license (list license:gpl2 license:lgpl2.1+))))
1764 (uri (string-append "mirror://kernel.org/software/network/crda/"
1765 "crda-" version ".tar.xz"))
1768 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
1769 (patches (search-patches "crda-optional-gcrypt.patch"))))
1770 (build-system gnu-build-system)
1772 '(#:phases (modify-phases %standard-phases
1775 'build 'no-werror-no-ldconfig
1777 (substitute* "Makefile"
1779 (("ldconfig") "true"))
1782 'build 'set-regulator-db-file-name
1783 (lambda* (#:key inputs #:allow-other-keys)
1784 ;; Tell CRDA where to find our database.
1785 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1786 (substitute* "crda.c"
1787 (("\"/lib/crda/regulatory.bin\"")
1788 (string-append "\"" regdb
1789 "/lib/crda/regulatory.bin\"")))
1791 #:test-target "verify"
1792 #:make-flags (let ((out (assoc-ref %outputs "out"))
1793 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1794 (list "CC=gcc" "V=1"
1796 ;; Disable signature-checking on 'regulatory.bin'.
1797 ;; The reason is that this simplifies maintenance
1798 ;; on our side (no need to manage a distro key
1799 ;; pair), and we can guarantee integrity of
1800 ;; 'regulatory.bin' by other means anyway, such as
1801 ;; 'guix gc --verify'. See
1802 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1806 (string-append "PREFIX=" out)
1807 (string-append "SBINDIR=" out "/sbin/")
1808 (string-append "UDEV_RULE_DIR="
1809 out "/lib/udev/rules.d")
1810 (string-append "LDFLAGS=-Wl,-rpath="
1812 (string-append "REG_BIN=" regdb
1813 "/lib/crda/regulatory.bin")))))
1814 (native-inputs `(("pkg-config" ,pkg-config)
1815 ("python" ,python-2)
1816 ("wireless-regdb" ,wireless-regdb)))
1817 (inputs `(("libnl" ,libnl)))
1819 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
1820 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
1822 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
1823 communication between the kernel Linux and user space for regulatory
1825 (license license:copyleft-next)))
1827 (define-public wireless-regdb
1829 (name "wireless-regdb")
1830 (version "2015.04.06")
1834 "mirror://kernel.org/software/network/wireless-regdb/"
1835 "wireless-regdb-" version ".tar.xz"))
1838 "0czi83k311fp27z42hxjm8vi88fsbc23mhavv96lkb4pmari0jjc"))
1840 ;; We're building 'regulatory.bin' by ourselves.
1841 (snippet '(delete-file "regulatory.bin"))))
1842 (build-system gnu-build-system)
1844 '(#:phases (modify-phases %standard-phases
1845 (delete 'configure))
1847 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
1848 ;; is computed and can be equal to 'maintainer-clean'; when that
1849 ;; happens, we can end up deleting the 'regulatory.bin' file that we
1850 ;; just built. Thus, build things sequentially.
1851 #:parallel-build? #f
1853 #:tests? #f ;no tests
1854 #:make-flags (let ((out (assoc-ref %outputs "out")))
1855 (list (string-append "PREFIX=" out)
1856 (string-append "LSB_ID=GuixSD")
1857 (string-append "DISTRO_PUBKEY=/dev/null")
1858 (string-append "DISTRO_PRIVKEY=/dev/null")
1859 (string-append "REGDB_PUBKEY=/dev/null")
1861 ;; Leave that empty so that db2bin.py doesn't try
1862 ;; to sign 'regulatory.bin'. This allows us to
1863 ;; avoid managing a key pair for the whole distro.
1864 (string-append "REGDB_PRIVKEY=")))))
1865 (native-inputs `(("python" ,python-2)))
1867 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
1868 (synopsis "Wireless regulatory database")
1870 "This package contains the wireless regulatory database Central
1871 Regulatory Database Agent (CRDA) daemon. The database contains information on
1872 country-specific regulations for the wireless spectrum.")
1873 (license license:isc)))
1875 (define-public lm-sensors
1882 "ftp://ftp.netroedge.com/pub/lm-sensors/lm_sensors-"
1883 version ".tar.bz2"))
1886 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1887 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
1888 (build-system gnu-build-system)
1889 (inputs `(("rrdtool" ,rrdtool)
1892 ("gnuplot" ,gnuplot)))
1893 (native-inputs `(("pkg-config" ,pkg-config)
1898 `(#:tests? #f ; no 'check' target
1899 #:make-flags (list (string-append "PREFIX=" %output)
1900 (string-append "ETCDIR=" %output "/etc")
1901 (string-append "MANDIR=" %output "/share/man"))
1906 'build 'patch-exec-paths
1907 (lambda* (#:key inputs outputs #:allow-other-keys)
1908 (substitute* "prog/detect/sensors-detect"
1910 (string-append "`" (assoc-ref inputs "coreutils")
1912 (("(`|\")modprobe" all open-quote)
1913 (string-append open-quote
1914 (assoc-ref inputs "kmod")
1916 (substitute* '("prog/pwm/pwmconfig"
1917 "prog/pwm/fancontrol")
1919 (string-append (assoc-ref inputs "gnuplot")
1922 (string-append (assoc-ref inputs "coreutils")
1925 (string-append (assoc-ref inputs "grep")
1928 (string-append (assoc-ref inputs "sed")
1931 (string-append (assoc-ref inputs "coreutils")
1934 (string-append (assoc-ref inputs "coreutils")
1937 (string-append (assoc-ref inputs "coreutils")
1938 "/bin/readlink -f"))))
1939 %standard-phases))))
1940 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
1941 (synopsis "Utilities to read temperature/voltage/fan sensors")
1943 "Lm-sensors is a hardware health monitoring package for Linux. It allows
1944 you to access information from temperature, voltage, and fan speed sensors.
1945 It works with most newer systems.")
1946 (license license:gpl2+)))
1948 (define-public i2c-tools
1955 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
1956 version ".tar.bz2"))
1959 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
1960 (build-system gnu-build-system)
1962 `(#:tests? #f ; no 'check' target
1963 #:make-flags (list (string-append "prefix=" %output)
1965 ;; no configure script
1966 #:phases (alist-delete 'configure %standard-phases)))
1969 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
1970 (synopsis "I2C tools for Linux")
1972 "The i2c-tools package contains a heterogeneous set of I2C tools for
1973 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
1974 EEPROM decoding scripts, EEPROM programming tools, and a python module for
1976 (license license:gpl2+)))
1978 (define-public xsensors
1985 "http://www.linuxhardware.org/xsensors/xsensors-"
1989 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1990 (build-system gnu-build-system)
1991 (inputs `(("lm-sensors" ,lm-sensors)
1993 (native-inputs `(("pkg-config" ,pkg-config)))
1995 `(#:phases (alist-cons-before
1996 'configure 'enable-deprecated
1998 (substitute* "src/Makefile.in"
1999 (("-DGDK_DISABLE_DEPRECATED") "")
2000 (("-DGTK_DISABLE_DEPRECATED") "")))
2002 'configure 'remove-Werror
2004 (substitute* '("configure" "src/Makefile.in")
2006 %standard-phases))))
2007 (home-page "http://www.linuxhardware.org/xsensors/")
2008 (synopsis "Hardware health information viewer")
2010 "Xsensors reads data from the libsensors library regarding hardware
2011 health such as temperature, voltage and fan speed and displays the information
2012 in a digital read-out.")
2013 (license license:gpl2+)))
2018 (version (package-version linux-libre))
2019 (source (package-source linux-libre))
2020 (build-system gnu-build-system)
2022 '(#:phases (alist-replace
2024 (lambda* (#:key inputs #:allow-other-keys)
2025 (setenv "SHELL_PATH" (which "bash"))
2026 (chdir "tools/perf"))
2028 #:make-flags (list (string-append "DESTDIR="
2029 (assoc-ref %outputs "out"))
2032 ;; By default, 'config/Makefile' uses lib64 on
2033 ;; x86_64. Work around that.
2035 #:tests? #f)) ;no tests
2037 `(("pkg-config" ,pkg-config)
2041 ;; There are build scripts written in these languages.
2043 ("python" ,python-2)))
2045 `(("slang" ,slang) ;for the interactive TUI
2047 ("python" ,python-2) ;'perf' links against libpython
2048 ("elfutils" ,elfutils)
2051 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2052 ("libxslt" ,libxslt)
2053 ("docbook-xml" ,docbook-xml)
2054 ("docbook-xsl" ,docbook-xsl)
2056 ("asciidoc" ,asciidoc)))
2057 (home-page "https://perf.wiki.kernel.org/")
2058 (synopsis "Linux profiling with performance counters")
2060 "perf is a tool suite for profiling using hardware performance counters,
2061 with support in the Linux kernel. perf can instrument CPU performance
2062 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2063 of lightweight profiling. This package contains the user-land tools and in
2064 particular the 'perf' command.")
2065 (license (package-license linux-libre))))
2067 (define-public pflask
2073 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2075 (file-name (string-append name "-" version ".tar.gz"))
2078 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2079 (build-system cmake-build-system)
2081 '(#:tests? #f)) ; no tests
2082 (home-page "http://ghedo.github.io/pflask/")
2083 (synopsis "Simple tool for creating Linux namespace containers")
2084 (description "pflask is a simple tool for creating Linux namespace
2085 containers. It can be used for running a command or even booting an OS inside
2086 an isolated container, created with the help of Linux namespaces. It is
2087 similar in functionality to chroot, although pflask provides better isolation
2088 thanks to the use of namespaces.")
2089 (license license:bsd-2)))
2091 (define-public hdparm
2097 (uri (string-append "mirror://sourceforge/" name "/"
2098 name "-" version ".tar.gz"))
2101 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
2102 (build-system gnu-build-system)
2104 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2105 (list (string-append "binprefix=" out)
2106 (string-append "manprefix=" out)
2108 #:phases (alist-delete 'configure %standard-phases)
2109 #:tests? #f)) ; no test suite
2110 (home-page "http://sourceforge.net/projects/hdparm/")
2111 (synopsis "Tune hard disk parameters for high performance")
2113 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
2114 is for enabling irq-unmasking and IDE multiple-mode.")
2115 (license (license:non-copyleft "file://LICENSE.TXT"))))
2117 (define-public rfkill
2123 (uri (string-append "mirror://kernel.org/software/network/"
2124 name "/" name "-" version ".tar.xz"))
2127 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2128 (build-system gnu-build-system)
2130 `(#:make-flags (list "CC=gcc"
2131 (string-append "PREFIX=" %output))
2132 #:phases (modify-phases %standard-phases
2133 (delete 'configure))
2135 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2136 (synopsis "Tool for enabling and disabling wireless devices")
2138 "rfkill is a simple tool for accessing the rfkill device interface,
2139 which is used to enable and disable wireless networking devices, typically
2140 WLAN, Bluetooth and mobile broadband.")
2141 (license (license:non-copyleft "file://COPYING"
2142 "See COPYING in the distribution."))))
2150 (uri (string-append "mirror://sourceforge/acpiclient/"
2151 name "-" version ".tar.gz"))
2154 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2155 (build-system gnu-build-system)
2156 (home-page "http://acpiclient.sourceforge.net")
2157 (synopsis "Display information on ACPI devices")
2158 (description "@code{acpi} attempts to replicate the functionality of the
2159 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2160 information. It does not support ACPI suspending, only displays information
2161 about ACPI devices.")
2162 (license license:gpl2+)))
2164 (define-public acpid
2170 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2174 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
2175 (build-system gnu-build-system)
2176 (home-page "http://sourceforge.net/projects/acpid2/")
2177 (synopsis "Daemon for delivering ACPI events to user-space programs")
2179 "acpid is designed to notify user-space programs of Advanced
2180 Configuration and Power Interface (ACPI) events. acpid should be started
2181 during the system boot, and will run as a background process. When an ACPI
2182 event is received from the kernel, acpid will examine the list of rules
2183 specified in /etc/acpi/events and execute the rules that match the event.")
2184 (license license:gpl2+)))
2186 (define-public sysfsutils
2195 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2198 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2199 (build-system gnu-build-system)
2200 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2201 (synopsis "System utilities based on Linux sysfs")
2203 "These are a set of utilities built upon sysfs, a virtual filesystem in
2204 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2205 also contains the libsysfs library.")
2206 ;; The library is under lgpl2.1+ (all files say "or any later version").
2207 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2208 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2210 (define-public sysfsutils-1
2212 (inherit sysfsutils)
2219 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2220 "/sysfsutils-" version ".tar.gz"))
2222 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2223 (modules '((guix build utils)))
2226 (substitute* "Makefile.in"
2227 (("includedir = /usr/include/sysfs")
2228 "includedir = @includedir@"))
2229 (substitute* "configure"
2230 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2231 (string-append "includedir='" orig "/sysfs'")))))))
2232 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2234 (define-public cpufrequtils
2236 (name "cpufrequtils")
2243 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2246 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2247 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2248 (build-system gnu-build-system)
2250 `(("sysfsutils" ,sysfsutils-1)))
2252 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2253 (assoc-ref %outputs "out") "/lib"))))
2254 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2255 (synopsis "Utilities to get and set CPU frequency on Linux")
2257 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2258 information, and set the CPU frequency if supported, using the cpufreq
2259 capabilities of the Linux kernel.")
2260 (license license:gpl2)))
2262 (define-public libraw1394
2269 "mirror://kernel.org/linux/libs/ieee1394/"
2270 name "-" version ".tar.xz"))
2273 "0kwnf4ha45c04mhc4yla672aqmvqqihxix1gvblns5cd2pc2cc8b"))))
2274 (build-system gnu-build-system)
2275 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2276 (synopsis "Interface library for the Linux IEEE1394 drivers")
2278 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2279 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2280 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2281 send to and receive from other nodes without requiring a kernel driver for the
2282 protocol in question.")
2283 (license license:lgpl2.1+)))
2285 (define-public libavc1394
2291 (uri (string-append "mirror://sourceforge/libavc1394/"
2292 name "-" version ".tar.gz"))
2295 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2296 (build-system gnu-build-system)
2298 `(("pkg-config" ,pkg-config)))
2300 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2301 (home-page "http://sourceforge.net/projects/libavc1394/")
2302 (synopsis "AV/C protocol library for IEEE 1394")
2304 "Libavc1394 is a programming interface to the AV/C specification from
2305 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2306 (license license:lgpl2.1+)))
2308 (define-public libiec61883
2310 (name "libiec61883")
2315 "mirror://kernel.org/linux/libs/ieee1394/"
2316 name "-" version ".tar.xz"))
2319 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2320 (build-system gnu-build-system)
2322 `(("pkg-config" ,pkg-config)))
2324 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2325 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2326 (synopsis "Isochronous streaming media library for IEEE 1394")
2328 "The libiec61883 library provides a higher level API for streaming DV,
2329 MPEG-2 and audio over Linux IEEE 1394.")
2330 (license license:lgpl2.1+)))
2332 (define-public mdadm
2339 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2343 "132vdvh3myjgcjn6i9w90ck16ddjxjcszklzkyvr4f5ifqd7wfhg"))
2344 (patches (search-patches "mdadm-gcc-4.9-fix.patch"))))
2345 (build-system gnu-build-system)
2349 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2350 (list "INSTALL=install"
2352 ;; TODO: tell it where to find 'sendmail'
2353 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2354 (string-append "BINDIR=" out "/sbin")
2355 (string-append "MANDIR=" out "/share/man")
2356 (string-append "UDEVDIR=" out "/lib/udev")))
2357 #:phases (alist-cons-before
2358 'build 'patch-program-paths
2359 (lambda* (#:key inputs #:allow-other-keys)
2360 (let ((coreutils (assoc-ref inputs "coreutils")))
2361 (substitute* "udev-md-raid-arrays.rules"
2362 (("/usr/bin/(readlink|basename)" all program)
2363 (string-append coreutils "/bin/" program)))))
2364 (alist-delete 'configure %standard-phases))
2365 ;;tests must be done as root
2367 (home-page "http://neil.brown.name/blog/mdadm")
2368 (synopsis "Tool for managing Linux Software RAID arrays")
2370 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2371 assemble, report on, and monitor arrays. It can also move spares between raid
2372 arrays when needed.")
2373 (license license:gpl2+)))
2375 (define-public libaio
2382 (string-append "mirror://debian/pool/main/liba/libaio/"
2383 name "_" version ".orig.tar.gz")
2384 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2385 name "-" version ".tar.gz")))
2388 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2389 (build-system gnu-build-system)
2392 (list "CC=gcc" (string-append "prefix=" %output))
2393 #:test-target "partcheck" ; need root for a full 'check'
2395 (alist-delete 'configure %standard-phases))) ; no configure script
2396 (home-page "http://lse.sourceforge.net/io/aio.html")
2397 (synopsis "Linux-native asynchronous I/O access library")
2399 "This library enables userspace to use Linux kernel asynchronous I/O
2400 system calls, important for the performance of databases and other advanced
2402 (license license:lgpl2.1+)))
2404 (define-public bluez
2411 "https://www.kernel.org/pub/linux/bluetooth/bluez-"
2415 "1wkqwmi5krr37mxcqqlp5m2xnw7vw70v3ww7j09vvlskxcdflhx3"))))
2416 (build-system gnu-build-system)
2419 (let ((out (assoc-ref %outputs "out")))
2420 (list "--enable-library"
2422 ;; Install dbus/udev files to the correct location.
2423 (string-append "--with-dbusconfdir=" out "/etc")
2424 (string-append "--with-udevdir=" out "/lib/udev")))))
2426 `(("pkg-config" ,pkg-config)
2427 ("gettext" ,gnu-gettext)))
2432 ("libical" ,libical)
2433 ("readline" ,readline)))
2434 (home-page "http://www.bluez.org/")
2435 (synopsis "Linux Bluetooth protocol stack")
2437 "BlueZ provides support for the core Bluetooth layers and protocols. It
2438 is flexible, efficient and uses a modular implementation.")
2439 (license license:gpl2+)))
2441 (define-public fuse-exfat
2447 (uri "https://docs.google.com/uc?export=download&\
2448 id=0B7CLI-REKbE3VTdaa0EzTkhYdU0")
2451 "0glmgwrf0nv09am54i6s35ksbvrywrwc51w6q32mv5by8475530r"))
2452 (file-name (string-append name "-" version ".tar.gz"))))
2453 (build-system gnu-build-system)
2456 ("pkg-config" ,pkg-config)))
2460 '(#:tests? #f ;no test suite
2462 ;; XXX: Factorize with 'exfat-utils'.
2463 #:phases (modify-phases %standard-phases
2465 (add-after 'unpack 'scons-propagate-environment
2467 ;; Modify the SConstruct file to arrange for
2468 ;; environment variables to be propagated.
2469 (substitute* "SConstruct"
2470 (("^env = Environment\\(")
2471 "env = Environment(ENV=os.environ, "))))
2474 (zero? (system* "scons"))))
2476 (lambda* (#:key outputs #:allow-other-keys)
2477 (let* ((out (assoc-ref outputs "out"))
2478 (bin (string-append out "/bin"))
2479 (man8 (string-append out
2480 "/share/man/man8")))
2483 (for-each (lambda (file)
2486 (string-append man8 "/"
2488 (find-files "." "\\.8$"))
2489 (zero? (system* "scons" "install"
2490 (string-append "DESTDIR="
2492 (home-page "http://code.google.com/p/exfat/")
2493 (synopsis "Mount exFAT file systems")
2495 "This package provides a FUSE-based file system that provides read and
2496 write access to exFAT devices.")
2497 (license license:gpl2+)))
2506 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2507 version ".tar.bz2"))
2510 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2511 (build-system gnu-build-system)
2513 '(#:phases (modify-phases %standard-phases
2514 (add-before 'configure 'bootstrap
2516 ;; The tarball was not generated with 'make dist' so we
2517 ;; need to bootstrap things ourselves.
2518 (and (zero? (system* "./autogen.sh"))
2520 (patch-makefile-SHELL "Makefile.include.in")
2523 ;; Make sure programs find libgpm.so.
2524 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2525 (assoc-ref %outputs "out")
2528 `(("texinfo" ,texinfo)
2531 ("autoconf" ,autoconf)
2532 ("automake" ,automake)
2533 ("libtool" ,libtool)))
2534 (home-page "http://www.nico.schottelius.org/software/gpm/")
2535 (synopsis "Mouse support for the Linux console")
2537 "The GPM (general-purpose mouse) daemon is a mouse server for
2538 applications running on the Linux console. It allows users to select items
2539 and copy/paste text in the console and in xterm.")
2540 (license license:gpl2+)))
2542 (define-public btrfs-progs
2544 (name "btrfs-progs")
2548 (uri (string-append "mirror://kernel.org/linux/kernel/"
2549 "people/kdave/btrfs-progs/"
2550 "btrfs-progs-v" version ".tar.xz"))
2553 "1znf2zhb56zbmdjk3lq107678xwsqwc5gczspypmc5i31qnppy7f"))))
2554 (build-system gnu-build-system)
2556 "static")) ; static versions of binaries in "out" (~16MiB!)
2558 '(#:phases (modify-phases %standard-phases
2559 (add-after 'build 'build-static
2560 (lambda _ (zero? (system* "make" "static"))))
2561 (add-after 'install 'install-static
2562 (let ((staticbin (string-append (assoc-ref %outputs "static")
2565 (zero? (system* "make"
2566 (string-append "bindir=" staticbin)
2567 "install-static"))))))
2568 #:test-target "test"
2569 #:parallel-tests? #f)) ; tests fail when run in parallel
2570 (inputs `(("e2fsprogs" ,e2fsprogs)
2571 ("libblkid" ,util-linux)
2572 ("libblkid:static" ,util-linux "static")
2573 ("libuuid" ,util-linux)
2574 ("libuuid:static" ,util-linux "static")
2577 (native-inputs `(("pkg-config" ,pkg-config)
2578 ("asciidoc" ,asciidoc)
2580 ;; For building documentation
2581 ("libxml2" ,libxml2)
2582 ("docbook-xml" ,docbook-xml)
2583 ("docbook-xsl" ,docbook-xsl)))
2584 (home-page "https://btrfs.wiki.kernel.org/")
2585 (synopsis "Create and manage btrfs copy-on-write file systems")
2586 (description "Btrfs is a copy-on-write (CoW) filesystem for Linux aimed at
2587 implementing advanced features while focusing on fault tolerance, repair and
2588 easy administration.")
2589 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2590 ;; GPL2: Everything else.
2591 (license (list license:gpl2 license:gpl2+))))
2593 (define-public freefall
2596 (version (package-version linux-libre))
2597 (source (package-source linux-libre))
2598 (build-system gnu-build-system)
2600 '(#:phases (modify-phases %standard-phases
2601 (add-after 'unpack 'enter-subdirectory
2603 (chdir "tools/laptop/freefall")))
2605 (add-before 'build 'increase-timeout
2607 ;; The default of 2 seconds is too low: it assumes an
2608 ;; open lid and AC power without actually checking.
2609 (substitute* "freefall.c"
2610 (("alarm\\(2\\)") "alarm(5)")))))
2611 #:make-flags (list (string-append "PREFIX="
2612 (assoc-ref %outputs "out")))
2613 #:tests? #f)) ;no tests
2614 (home-page (package-home-page linux-libre))
2615 (synopsis "Free-fall protection for spinning laptop hard drives")
2617 "Prevents shock damage to the internal spinning hard drive(s) of some
2618 HP and Dell laptops. When sudden movement is detected, all input/output
2619 operations on the drive are suspended and its heads are parked on the ramp,
2620 where they are less likely to cause damage to the spinning disc. Requires a
2621 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2622 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2623 (license license:gpl2)))
2625 (define-public thinkfan
2631 (uri (string-append "mirror://sourceforge/thinkfan/"
2632 version "/thinkfan-" version ".tar.gz"))
2635 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2636 (modules '((guix build utils)))
2637 ;; Fix erroneous man page location in Makefile leading to
2638 ;; a compilation failure.
2640 '(substitute* "CMakeLists.txt"
2641 (("thinkfan\\.1") "src/thinkfan.1")))))
2642 (build-system cmake-build-system)
2644 `(#:modules ((guix build cmake-build-system)
2647 #:tests? #f ;no test target
2649 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
2650 `("-DUSE_ATASMART:BOOL=ON")
2652 (modify-phases %standard-phases
2653 ;; Install scripts for various foreign init systems. Also fix
2654 ;; hard-coded path for daemon.
2655 (add-after 'install 'install-rc-scripts
2656 (lambda* (#:key outputs #:allow-other-keys)
2657 (let ((out (assoc-ref outputs "out"))
2659 (string-append "../thinkfan-" ,version "/rcscripts")
2662 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
2663 (string-append out "/sbin/" name)))
2664 (for-each (cute install-file <>
2665 (string-append out "/share/thinkfan"))
2669 `(("libatasmart" ,libatasmart)))
2670 (home-page "http://thinkfan.sourceforge.net/")
2671 (synopsis "Simple fan control program")
2673 "Thinkfan is a simple fan control program. It reads temperatures,
2674 checks them against configured limits and switches to appropriate (also
2675 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
2676 other @code{hwmon} driver that enables temperature reading and fan control
2678 (license license:gpl3+)))