1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 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, 2017 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, 2017 Tobias Geerinckx-Rice <me@tobias.gr>
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>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
20 ;;; Copyright © 2016 ng0 <ng0@libertad.pw>
21 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
22 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
24 ;;; This file is part of GNU Guix.
26 ;;; GNU Guix is free software; you can redistribute it and/or modify it
27 ;;; under the terms of the GNU General Public License as published by
28 ;;; the Free Software Foundation; either version 3 of the License, or (at
29 ;;; your option) any later version.
31 ;;; GNU Guix is distributed in the hope that it will be useful, but
32 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
33 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 ;;; GNU General Public License for more details.
36 ;;; You should have received a copy of the GNU General Public License
37 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
39 (define-module (gnu packages linux)
40 #:use-module (gnu packages)
41 #:use-module (gnu packages acl)
42 #:use-module (gnu packages admin)
43 #:use-module (gnu packages algebra)
44 #:use-module (gnu packages attr)
45 #:use-module (gnu packages autotools)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages bison)
48 #:use-module (gnu packages calendar)
49 #:use-module (gnu packages check)
50 #:use-module (gnu packages crypto)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages databases)
53 #:use-module (gnu packages docbook)
54 #:use-module (gnu packages documentation)
55 #:use-module (gnu packages elf)
56 #:use-module (gnu packages flex)
57 #:use-module (gnu packages freedesktop)
58 #:use-module (gnu packages gcc)
59 #:use-module (gnu packages gettext)
60 #:use-module (gnu packages glib)
61 #:use-module (gnu packages gnuzilla)
62 #:use-module (gnu packages gperf)
63 #:use-module (gnu packages gtk)
64 #:use-module (gnu packages libusb)
65 #:use-module (gnu packages man)
66 #:use-module (gnu packages maths)
67 #:use-module (gnu packages ncurses)
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages pciutils)
70 #:use-module (gnu packages pkg-config)
71 #:use-module (gnu packages popt)
72 #:use-module (gnu packages pulseaudio)
73 #:use-module (gnu packages python)
74 #:use-module (gnu packages readline)
75 #:use-module (gnu packages rrdtool)
76 #:use-module (gnu packages slang)
77 #:use-module (gnu packages texinfo)
78 #:use-module (gnu packages tls)
79 #:use-module (gnu packages video)
80 #:use-module (gnu packages xiph)
81 #:use-module (gnu packages xml)
82 #:use-module (gnu packages xdisorg)
83 #:use-module (gnu packages xorg)
84 #:use-module (guix build-system cmake)
85 #:use-module (guix build-system gnu)
86 #:use-module (guix build-system python)
87 #:use-module (guix build-system trivial)
88 #:use-module (guix download)
89 #:use-module ((guix licenses) #:prefix license:)
90 #:use-module (guix packages)
91 #:use-module (guix utils)
92 #:use-module (srfi srfi-1)
93 #:use-module (srfi srfi-2)
94 #:use-module (srfi srfi-26)
95 #:use-module (ice-9 match))
97 (define-public (system->linux-architecture arch)
98 "Return the Linux architecture name for ARCH, a Guix system name such as
99 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
100 (let ((arch (car (string-split arch #\-))))
101 (cond ((string=? arch "i686") "i386")
102 ((string-prefix? "mips" arch) "mips")
103 ((string-prefix? "arm" arch) "arm")
104 ((string-prefix? "aarch64" arch) "arm64")
107 (define (linux-libre-urls version)
108 "Return a list of URLs for Linux-Libre VERSION."
110 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
111 version "-gnu/linux-libre-" version "-gnu.tar.xz")
113 ;; XXX: Work around <http://bugs.gnu.org/14851>.
115 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
116 version "-gnu.tar.xz")
118 ;; Maybe this URL will become valid eventually.
120 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
121 version "-gnu.tar.xz")))
123 (define-public linux-libre-headers
125 (name "linux-libre-headers")
129 (uri (linux-libre-urls version))
132 "0k8k17in7dkjd9d8zg3i8l1ax466dba6bxw28flxizzyq8znljps"))))
133 (build-system gnu-build-system)
134 (native-inputs `(("perl" ,perl)))
136 `(#:modules ((guix build gnu-build-system)
140 (modify-phases %standard-phases
144 (let ((arch ,(system->linux-architecture
145 (or (%current-target-system)
146 (%current-system)))))
148 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
150 (and (zero? (system* "make" "defconfig"))
151 (zero? (system* "make" "mrproper" "headers_check"))))))
153 (lambda* (#:key outputs #:allow-other-keys)
154 (let ((out (assoc-ref outputs "out")))
155 (and (zero? (system* "make"
156 (string-append "INSTALL_HDR_PATH=" out)
159 (mkdir (string-append out "/include/config"))
160 (call-with-output-file
162 "/include/config/kernel.release")
164 (format p "~a-default~%" ,version)))
166 ;; Remove the '.install' and '..install.cmd' files; the
167 ;; latter contains store paths, which pulls in bootstrap
168 ;; binaries in the build environment, and prevents bit
169 ;; reproducibility for the bootstrap binaries.
170 (for-each delete-file (find-files out "\\.install"))
173 #:allowed-references ()
175 (home-page "http://www.gnu.org/software/linux-libre")
176 (synopsis "GNU Linux-Libre kernel headers")
177 (description "Headers of the Linux-Libre kernel.")
178 (license license:gpl2)))
180 (define %boot-logo-patch
181 ;; Linux-Libre boot logo featuring Freedo and a gnu.
184 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
185 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
188 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
190 (define* (kernel-config arch #:key variant)
191 "Return the absolute file name of the Linux-Libre build configuration file
192 for ARCH and optionally VARIANT, or #f if there is no such configuration."
193 (let* ((name (string-append "linux-libre-"
194 (if variant (string-append variant "-") "")
195 (if (string=? "i386" arch) "i686" arch) ".conf"))
196 (file (string-append "gnu/packages/" name)))
197 (search-path %load-path file)))
199 (define %default-extra-linux-options
200 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
201 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
202 ;; Modules required for initrd:
203 ("CONFIG_NET_9P" . m)
204 ("CONFIG_NET_9P_VIRTIO" . m)
205 ("CONFIG_VIRTIO_BLK" . m)
206 ("CONFIG_VIRTIO_NET" . m)
207 ("CONFIG_VIRTIO_PCI" . m)
208 ("CONFIG_VIRTIO_BALLOON" . m)
209 ("CONFIG_VIRTIO_MMIO" . m)
210 ("CONFIG_FUSE_FS" . m)
212 ("CONFIG_9P_FS" . m)))
214 (define (config->string options)
215 (string-join (map (match-lambda
217 (string-append option "=m"))
219 (string-append option "=y"))
221 (string-append option "=n")))
225 (define* (make-linux-libre version hash supported-systems
227 ;; A function that takes an arch and a variant.
228 ;; See kernel-config for an example.
230 (configuration-file #f)
231 (defconfig "defconfig")
232 (extra-options %default-extra-linux-options)
233 (patches (list %boot-logo-patch)))
235 (name (if extra-version
236 (string-append "linux-libre-" extra-version)
241 (uri (linux-libre-urls version))
242 (sha256 (base32 hash))
244 (supported-systems supported-systems)
245 (build-system gnu-build-system)
251 ,@(match (and configuration-file
253 (system->linux-architecture
254 (or (%current-target-system) (%current-system)))
255 #:variant (version-major+minor version)))
256 (#f ;no config for this platform
259 `(("kconfig" ,config))))))
261 `(#:modules ((guix build gnu-build-system)
266 (modify-phases %standard-phases
268 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
269 ;; Avoid introducing timestamps
270 (setenv "KCONFIG_NOTIMESTAMP" "1")
271 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
273 ;; Set ARCH and CROSS_COMPILE
274 (let ((arch ,(system->linux-architecture
275 (or (%current-target-system)
276 (%current-system)))))
278 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
281 (setenv "CROSS_COMPILE" (string-append target "-"))
282 (format #t "`CROSS_COMPILE' set to `~a'~%"
283 (getenv "CROSS_COMPILE"))))
285 (setenv "EXTRA_VERSION" ,extra-version)
287 (let ((build (assoc-ref %standard-phases 'build))
288 (config (assoc-ref inputs "kconfig")))
290 ;; Use a custom kernel configuration file or a default
291 ;; configuration file.
294 (copy-file config ".config")
295 (chmod ".config" #o666))
296 (system* "make" ,defconfig))
298 ;; Appending works even when the option wasn't in the
299 ;; file. The last one prevails if duplicated.
300 (let ((port (open-file ".config" "a"))
301 (extra-configuration ,(config->string extra-options)))
302 (display extra-configuration port)
305 (zero? (system* "make" "oldconfig")))))
307 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
308 (let* ((out (assoc-ref outputs "out"))
309 (moddir (string-append out "/lib/modules"))
310 (dtbdir (string-append out "/lib/dtbs"))
311 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
312 ;; Install kernel image, kernel configuration and link map.
313 (for-each (lambda (file) (install-file file out))
314 (find-files "." "^(\\.config|bzImage|zImage|vmlinuz|System\\.map)$"))
315 ;; Install device tree files
316 (for-each (lambda (file) (install-file file dtbdir))
317 (find-files "." "\\.dtb$"))
318 ;; Install kernel modules
320 (zero? (system* "make"
321 (string-append "DEPMOD=" kmod "/bin/depmod")
322 (string-append "MODULE_DIR=" moddir)
323 (string-append "INSTALL_PATH=" out)
324 (string-append "INSTALL_MOD_PATH=" out)
325 "INSTALL_MOD_STRIP=1"
326 "modules_install"))))))
328 (home-page "http://www.gnu.org/software/linux-libre/")
329 (synopsis "100% free redistribution of a cleaned Linux kernel")
331 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
332 It has been modified to remove all non-free binary blobs.")
333 (license license:gpl2)))
335 (define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
337 (define-public linux-libre
338 (make-linux-libre "4.9.6"
339 "0mafa628la5qj26rff014mmih2widl5k2sjxg152lmpgijmf6qhd"
340 %intel-compatible-systems
341 #:configuration-file kernel-config))
343 (define-public linux-libre-4.4
344 (make-linux-libre "4.4.45"
345 "1c6nigbl8yrqpaz89954la956lshr3p0llm52phxq2h06zblsp87"
346 %intel-compatible-systems
347 #:configuration-file kernel-config))
349 (define-public linux-libre-4.1
350 (make-linux-libre "4.1.38"
351 "165kmzglhg63hn7y4q7r6cb2dpsljxiq1czvgyx0bkd1vd2bcvsa"
352 %intel-compatible-systems
353 #:configuration-file kernel-config))
355 ;; Avoid rebuilding kernel variants when there is a minor version bump.
356 (define %linux-libre-version "4.9.6")
357 (define %linux-libre-hash "0mafa628la5qj26rff014mmih2widl5k2sjxg152lmpgijmf6qhd")
359 (define-public linux-libre-arm-generic
360 (make-linux-libre %linux-libre-version
363 #:defconfig "multi_v7_defconfig"
364 #:extra-version "arm-generic"))
368 ;;; Pluggable authentication modules (PAM).
371 (define-public linux-pam
379 "http://www.linux-pam.org/library/"
380 "Linux-PAM-" version ".tar.bz2"))
383 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
384 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
386 (build-system gnu-build-system)
390 ;; TODO: optional dependencies
391 ;; ("libxcrypt" ,libxcrypt)
392 ;; ("cracklib" ,cracklib)
395 '(;; Most users, such as `shadow', expect the headers to be under
397 #:configure-flags (list (string-append "--includedir="
398 (assoc-ref %outputs "out")
399 "/include/security"))
401 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
404 (home-page "http://www.linux-pam.org/")
405 (synopsis "Pluggable authentication modules for Linux")
407 "A *Free* project to implement OSF's RFC 86.0.
408 Pluggable authentication modules are small shared object files that can
409 be used through the PAM API to perform tasks, like authenticating a user
410 at login. Local and dynamic reconfiguration are its key features.")
411 (license license:bsd-3)))
413 (define-public linux-pam-1.2
421 "http://www.linux-pam.org/library/"
422 "Linux-PAM-" version ".tar.bz2"))
425 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
426 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
433 (define-public psmisc
440 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
444 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
445 (build-system gnu-build-system)
446 (inputs `(("ncurses" ,ncurses)))
447 (home-page "http://psmisc.sourceforge.net/")
449 "Small utilities that use the proc file system")
451 "This PSmisc package is a set of some small useful utilities that
452 use the proc file system. We're not about changing the world, but
453 providing the system administrator with some help in common tasks.")
454 (license license:gpl2+)))
456 (define-public util-linux
462 (uri (string-append "mirror://kernel.org/linux/utils/"
463 name "/v" (version-major+minor version) "/"
464 name "-" version ".tar.xz"))
467 "03xnaw3c7pavxvvh1vnimcr44hlhhf25whawiyv8dxsflfj4xkiy"))
468 (patches (search-patches "util-linux-tests.patch"))
469 (modules '((guix build utils)))
471 ;; We take the 'logger' program from GNU Inetutils and 'kill'
472 ;; from GNU Coreutils.
474 (substitute* "configure"
475 (("build_logger=yes") "build_logger=no")
476 (("build_kill=yes") "build_kill=no"))
478 (build-system gnu-build-system)
480 "static")) ; >2 MiB of static .a libraries
482 `(#:configure-flags (list "--disable-use-tty-group"
484 ;; Install completions where our
485 ;; bash-completion package expects them.
486 (string-append "--with-bashcompletiondir="
487 (assoc-ref %outputs "out")
488 "/etc/bash_completion.d"))
489 #:phases (modify-phases %standard-phases
491 'build 'set-umount-file-name
492 (lambda* (#:key outputs #:allow-other-keys)
493 ;; Tell 'eject' the right file name of 'umount'.
494 (let ((out (assoc-ref outputs "out")))
495 (substitute* "sys-utils/eject.c"
497 (string-append "\"" out "/bin/umount\"")))
501 (lambda* (#:key inputs outputs #:allow-other-keys)
502 (let ((out (assoc-ref outputs "out"))
503 (net (assoc-ref inputs "net-base")))
504 ;; Change the test to refer to the right file.
505 (substitute* "tests/ts/misc/mcookie"
507 (string-append net "/etc/services")))
510 'install 'move-static-libraries
511 (lambda* (#:key outputs #:allow-other-keys)
512 (let ((out (assoc-ref outputs "out"))
513 (static (assoc-ref outputs "static")))
514 (mkdir-p (string-append static "/lib"))
515 (with-directory-excursion out
516 (for-each (lambda (file)
518 (string-append static "/"
520 (find-files "lib" "\\.a$")))
522 (inputs `(("zlib" ,zlib)
523 ("ncurses" ,ncurses)))
526 ("net-base" ,net-base))) ;for tests
527 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
528 (synopsis "Collection of utilities for the Linux kernel")
529 (description "Util-linux is a diverse collection of Linux kernel
530 utilities. It provides dmesg and includes tools for working with file systems,
531 block devices, UUIDs, TTYs, and many other tools.")
533 ;; Note that util-linux doesn't use the same license for all the
534 ;; code. GPLv2+ is the default license for a code without an
535 ;; explicitly defined license.
536 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
537 license:bsd-4 license:public-domain))))
539 (define-public procps
545 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
546 "procps-ng-" version ".tar.xz"))
549 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
550 (build-system gnu-build-system)
552 '(#:modules ((guix build utils)
553 (guix build gnu-build-system)
557 (modify-phases %standard-phases
558 (add-before 'check 'disable-strtod-test
560 ;; Disable the 'strtod' test, which fails on 32-bit systems.
561 ;; This is what upstream does:
562 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
563 (substitute* "Makefile"
564 (("^(TESTS|check_PROGRAMS) = .*$" all)
565 (string-append "# " all "\n")))
568 'install 'post-install
569 ;; Remove commands and man pages redudant with
571 (lambda* (#:key outputs #:allow-other-keys)
572 (let* ((out (assoc-ref outputs "out"))
573 (dup (append-map (cut find-files out <>)
574 '("^kill" "^uptime"))))
575 (for-each delete-file dup)
577 (inputs `(("ncurses" ,ncurses)))
578 (home-page "https://gitlab.com/procps-ng/procps/")
579 (synopsis "Utilities that give information about processes")
581 "Procps is the package that has a bunch of small useful utilities
582 that give information about processes using the Linux /proc file system.
583 The package includes the programs ps, top, vmstat, w, kill, free,
584 slabtop, and skill.")
585 (license license:gpl2)))
587 (define-public usbutils
594 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
595 "usbutils-" version ".tar.xz"))
598 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
599 (build-system gnu-build-system)
602 ("eudev" ,eudev-with-hwdb)))
604 `(("pkg-config" ,pkg-config)))
605 (home-page "http://www.linux-usb.org/")
607 "Tools for working with USB devices, such as lsusb")
609 "Tools for working with USB devices, such as lsusb.")
610 (license license:gpl2+)))
612 (define-public e2fsprogs
619 "mirror://kernel.org/linux/kernel/people/tytso/"
620 name "/v" version "/"
621 name "-" version ".tar.xz"))
624 "1ix0b83zgw5n0p2grh2961c6796m92yr2jqc2sbr23x3lfsp8r71"))
625 (modules '((guix build utils)))
628 (substitute* "MCONFIG.in"
629 (("INSTALL_SYMLINK = /bin/sh")
630 "INSTALL_SYMLINK = sh"))
632 ;; Do not include a timestamp in libext2fs.info.gz.
633 (substitute* "doc/Makefile.in"
636 (build-system gnu-build-system)
637 (inputs `(("util-linux" ,util-linux)))
638 (native-inputs `(("pkg-config" ,pkg-config)
639 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
641 '(;; Parallel building reliably yields a failure like this:
642 ;; "make[2]: *** No rule to make target '../lib/libss.so', needed by
645 ;; util-linux is the preferred source for some of the libraries and
646 ;; commands, so disable them (see, e.g.,
647 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
648 #:configure-flags '("--disable-libblkid"
649 "--disable-libuuid" "--disable-uuidd"
652 ;; Use symlinks instead of hard links for
653 ;; 'fsck.extN' etc. This makes the resulting nar
654 ;; smaller and is preserved across copies.
655 "--enable-symlink-install"
657 ;; Install libext2fs et al.
658 "--enable-elf-shlibs")
660 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
661 (assoc-ref %outputs "out")
664 #:phases (alist-cons-before
665 'configure 'patch-shells
667 (substitute* "configure"
668 (("/bin/sh (.*)parse-types.sh" _ dir)
669 (string-append (which "sh") " " dir
671 (substitute* (find-files "." "^Makefile.in$")
673 (string-append "#!" (which "sh")))))
675 'install 'install-libs
676 (lambda* (#:key outputs #:allow-other-keys)
677 (let* ((out (assoc-ref outputs "out"))
678 (lib (string-append out "/lib")))
679 (and (zero? (system* "make" "install-libs"))
681 ;; Make the .a writable so that 'strip' works.
682 ;; Failing to do that, due to debug symbols, we
683 ;; retain a reference to the final
684 ;; linux-libre-headers, which refer to the
685 ;; bootstrap binaries.
686 (let ((archives (find-files lib "\\.a$")))
687 (for-each (lambda (file)
693 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
694 ;; they fail because we get an extra line that says "Can't check if
695 ;; file system is mounted due to missing mtab file".
697 (home-page "http://e2fsprogs.sourceforge.net/")
698 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
700 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
701 (license (list license:gpl2 ;programs
702 license:lgpl2.0 ;libext2fs
703 license:x11)))) ;libuuid
705 (define e2fsprogs/static
707 (package (inherit e2fsprogs)
709 ;; Do not build shared libraries.
710 (substitute-keyword-arguments (package-arguments e2fsprogs)
711 ((#:configure-flags _)
712 '(list "--disable-blkid"))
716 (define-public e2fsck/static
718 (name "e2fsck-static")
719 (version (package-version e2fsprogs))
720 (build-system trivial-build-system)
723 `(("e2fsprogs" ,e2fsprogs/static)))
725 `(#:modules ((guix build utils))
728 (use-modules (guix build utils)
732 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
734 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
736 (with-directory-excursion bin
737 (copy-file e2fsck "e2fsck")
738 (remove-store-references "e2fsck")
739 (chmod "e2fsck" #o555))))))
740 (home-page (package-home-page e2fsprogs))
741 (synopsis "Statically-linked e2fsck command from e2fsprogs")
742 (description "This package provides statically-linked e2fsck command taken
743 from the e2fsprogs package. It is meant to be used in initrds.")
744 (license (package-license e2fsprogs))))
746 (define-public extundelete
752 (uri (string-append "mirror://sourceforge/extundelete/"
753 "extundelete/" version "/extundelete-"
757 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
758 (build-system gnu-build-system)
759 (inputs `(("e2fsprogs" ,e2fsprogs)))
760 (home-page "http://extundelete.sourceforge.net/")
761 (synopsis "Recover deleted files from ext2/3/4 partitions")
763 "Extundelete is a set of tools that can recover deleted files from an
764 ext3 or ext4 partition.")
765 (license license:gpl2)))
767 (define-public zerofree
771 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
774 (uri (string-append home-page name "-" version
778 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
779 (build-system gnu-build-system)
781 '(#:phases (alist-replace
783 (lambda* (#:key outputs #:allow-other-keys)
784 (let* ((out (assoc-ref outputs "out"))
785 (bin (string-append out "/bin")))
787 (copy-file "zerofree"
788 (string-append bin "/zerofree"))
789 (chmod (string-append bin "/zerofree")
792 (alist-delete 'configure %standard-phases))
793 #:tests? #f)) ;no tests
794 (inputs `(("libext2fs" ,e2fsprogs)))
795 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
797 "The zerofree command scans the free blocks in an ext2 file system and
798 fills any non-zero blocks with zeroes. This is a useful way to make disk
799 images more compressible.")
800 (license license:gpl2)))
802 (define-public strace
808 (uri (string-append "mirror://sourceforge/strace/strace/" version
809 "/strace-" version ".tar.xz"))
812 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
813 (build-system gnu-build-system)
814 (native-inputs `(("perl" ,perl)))
815 (home-page "http://strace.sourceforge.net/")
816 (synopsis "System call tracer for Linux")
818 "strace is a system call tracer, i.e. a debugging tool which prints out a
819 trace of all the system calls made by a another process/program.")
820 (license license:bsd-3)))
822 (define-public ltrace
828 (uri (string-append "http://www.ltrace.org/ltrace_" version
832 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
833 (build-system gnu-build-system)
834 (inputs `(("libelf" ,libelf)))
836 ;; Compilation uses -Werror by default, but it fails.
837 '(#:configure-flags '("--disable-werror")))
838 (home-page "http://www.ltrace.org/")
839 (synopsis "Library call tracer for Linux")
841 "ltrace intercepts and records dynamic library calls which are called by
842 an executed process and the signals received by that process. It can also
843 intercept and print the system calls executed by the program.")
844 (license license:gpl2+)))
846 (define-public alsa-lib
853 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
857 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
858 (patches (search-patches "alsa-lib-mips-atomic-fix.patch"))))
859 (build-system gnu-build-system)
860 (home-page "http://www.alsa-project.org/")
861 (synopsis "The Advanced Linux Sound Architecture libraries")
863 "The Advanced Linux Sound Architecture (ALSA) provides audio and
864 MIDI functionality to the Linux-based operating system.")
865 (license license:lgpl2.1+)))
867 (define-public alsa-utils
873 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
874 name "-" version ".tar.bz2"))
877 "0z0nnqp1707bm02dys2d16m88lsg5nd26bqaf14rl3za9sjifwhj"))))
878 (build-system gnu-build-system)
880 ;; XXX: Disable man page creation until we have DocBook.
881 '(#:configure-flags (list "--disable-xmlto"
883 ;; The udev rule is responsible for restoring
885 (string-append "--with-udev-rules-dir="
886 (assoc-ref %outputs "out")
887 "/lib/udev/rules.d"))
889 (modify-phases %standard-phases
891 'install 'pre-install
893 ;; Don't try to mkdir /var/lib/alsa.
894 (substitute* "Makefile"
895 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
899 `(("libsamplerate" ,libsamplerate)
901 ("alsa-lib" ,alsa-lib)
903 ("gettext" ,gettext-minimal)))
904 (home-page "http://www.alsa-project.org/")
905 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
907 "The Advanced Linux Sound Architecture (ALSA) provides audio and
908 MIDI functionality to the Linux-based operating system.")
910 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
912 (license license:gpl2)))
914 (define-public alsa-plugins
916 (name "alsa-plugins")
920 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
921 name "-" version ".tar.bz2"))
924 "1w81z5jlwqhd1l2m7qrq69lc4k9dnrg1wn52jsl2hrf3hbhd394f"))))
925 (build-system gnu-build-system)
926 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
927 ;; be split, there are references to both in files.
928 ;; TODO: Remove OSS related plugins, they add support to run native
929 ;; ALSA applications on OSS however we do not offer OSS and OSS is
931 (outputs '("out" "pulseaudio"))
934 (modify-phases %standard-phases
935 (add-after 'install 'split
936 (lambda* (#:key inputs outputs #:allow-other-keys)
937 ;; Distribute the binaries to the various outputs.
938 (let* ((out (assoc-ref outputs "out"))
939 (pua (assoc-ref outputs "pulseaudio"))
940 (pualib (string-append pua "/lib/alsa-lib"))
941 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
944 (chdir (string-append out "/share"))
945 (for-each (lambda (file)
946 (rename-file file (string-append puaconf "/" (basename file))))
947 (find-files out "\\.(conf|example)"))
948 (for-each (lambda (file)
949 (rename-file file (string-append pualib "/" (basename file))))
950 (find-files out ".*pulse\\.(la|so)"))
952 ;; We have moved the files to output pulsaudio, the
953 ;; directory is now empty.
954 (delete-file-recursively (string-append out "/share"))
957 `(("alsa-lib" ,alsa-lib)
958 ("speex" ,speex) ; libspeexdsp resampling plugin
959 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
960 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
961 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
963 `(("pkg-config" ,pkg-config)))
964 (home-page "http://www.alsa-project.org/")
965 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
967 "The Advanced Linux Sound Architecture (ALSA) provides audio and
968 MIDI functionality to the Linux-based operating system. This package enhances ALSA
969 by providing additional plugins which include: upmixing, downmixing, jackd and
970 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
971 external rate conversion.")
972 (license (list license:gpl2+
973 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
976 (define-public iptables
983 "http://www.netfilter.org/projects/iptables/files/iptables-"
987 "1q6kg7sf0pgpq0qhab6sywl23cngxxfzc9zdzscsba8x09l4q02j"))))
988 (build-system gnu-build-system)
990 '(#:tests? #f ; no test suite
991 #:configure-flags ; add $libdir to the RUNPATH of executables
992 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
993 (home-page "http://www.netfilter.org/projects/iptables/index.html")
994 (synopsis "Program to configure the Linux IP packet filtering rules")
996 "iptables is the userspace command line program used to configure the
997 Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
998 system administrators. Since Network Address Translation is also configured
999 from the packet filter ruleset, iptables is used for this, too. The iptables
1000 package also includes ip6tables. ip6tables is used for configuring the IPv6
1002 (license license:gpl2+)))
1004 (define-public iproute
1011 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1015 "1i0n071hiqxw1gisngw2jln3kcp9sh47n6fj5hdwqrvp7w20zwy0"))))
1016 (build-system gnu-build-system)
1018 `(#:tests? #f ; no test suite
1019 #:make-flags (let ((out (assoc-ref %outputs "out")))
1021 (string-append "BASH_COMPDIR=" out
1022 "/etc/bash_completion.d")
1023 (string-append "LIBDIR=" out "/lib")
1024 (string-append "SBINDIR=" out "/sbin")
1025 (string-append "CONFDIR=" out "/etc")
1026 (string-append "DOCDIR=" out "/share/doc/"
1028 (string-append "MANDIR=" out "/share/man")))
1029 #:phases (modify-phases %standard-phases
1030 (add-before 'install 'pre-install
1032 ;; Don't attempt to create /var/lib/arpd.
1033 (substitute* "Makefile"
1034 (("^.*ARPDDIR.*$") "")))))))
1036 `(("iptables" ,iptables)
1039 `(("pkg-config" ,pkg-config)
1043 "https://wiki.linuxfoundation.org/networking/iproute2")
1045 "Utilities for controlling TCP/IP networking and traffic in Linux")
1047 "Iproute2 is a collection of utilities for controlling TCP/IP
1048 networking and traffic with the Linux kernel.
1050 Most network configuration manuals still refer to ifconfig and route as the
1051 primary network configuration tools, but ifconfig is known to behave
1052 inadequately in modern network environments. They should be deprecated, but
1053 most distros still include them. Most network configuration systems make use
1054 of ifconfig and thus provide a limited feature set. The /etc/net project aims
1055 to support most modern network technologies, as it doesn't use ifconfig and
1056 allows a system administrator to make use of all iproute2 features, including
1059 iproute2 is usually shipped in a package called iproute or iproute2 and
1060 consists of several tools, of which the most important are ip and tc. ip
1061 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
1062 tools print detailed usage messages and are accompanied by a set of
1064 (license license:gpl2+)))
1066 (define-public net-tools
1067 ;; XXX: This package is basically unmaintained, but it provides a few
1068 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1073 (home-page "http://net-tools.sourceforge.net/")
1076 (uri (list (string-append
1077 "mirror://sourceforge/net-tools/net-tools-"
1080 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1081 "/base/net-tools/net-tools-1.60.tar.bz2")))
1084 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1085 (patches (search-patches "net-tools-bitrot.patch"))))
1086 (build-system gnu-build-system)
1088 '(#:modules ((guix build gnu-build-system)
1092 #:phases (alist-cons-after
1094 (lambda* (#:key inputs #:allow-other-keys)
1095 (define (apply-patch file)
1096 (zero? (system* "patch" "-p1" "--force"
1099 (let ((patch.gz (assoc-ref inputs "patch")))
1100 (format #t "applying Debian patch set '~a'...~%"
1102 (system (string-append "gunzip < " patch.gz " > the-patch"))
1103 (and (apply-patch "the-patch")
1104 (for-each apply-patch
1105 (find-files "debian/patches"
1109 (lambda* (#:key outputs #:allow-other-keys)
1110 (let ((out (assoc-ref outputs "out")))
1111 (mkdir-p (string-append out "/bin"))
1112 (mkdir-p (string-append out "/sbin"))
1114 ;; Pretend we have everything...
1115 (system "yes | make config")
1117 ;; ... except for the things we don't have.
1118 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1119 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1120 ;; that have been removed.
1121 (substitute* '("config.make" "config.h")
1122 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1124 'install 'remove-redundant-commands
1125 (lambda* (#:key outputs #:allow-other-keys)
1126 ;; Remove commands and man pages redundant with
1128 (let* ((out (assoc-ref outputs "out"))
1129 (dup (append-map (cut find-files out <>)
1131 "^(yp|nis|dns)?domainname"))))
1132 (for-each delete-file dup)
1136 ;; Binaries that depend on libnet-tools.a don't declare that
1137 ;; dependency, making it parallel-unsafe.
1138 #:parallel-build? #f
1140 #:tests? #f ; no test suite
1141 #:make-flags (let ((out (assoc-ref %outputs "out")))
1143 (string-append "BASEDIR=" out)
1144 (string-append "INSTALLNLSDIR=" out "/share/locale")
1145 (string-append "mandir=/share/man")))))
1147 ;; Use the big Debian patch set (the thing does not even compile out of
1149 (inputs `(("patch" ,(origin
1152 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1155 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1156 (native-inputs `(("gettext" ,gettext-minimal)))
1158 (synopsis "Tools for controlling the network subsystem in Linux")
1160 "This package includes the important tools for controlling the network
1161 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1162 netstat, rarp and route. Additionally, this package contains utilities
1163 relating to particular network hardware types (plipconfig, slattach) and
1164 advanced aspects of IP configuration (iptunnel, ipmaddr).")
1165 (license license:gpl2+)))
1167 (define-public libcap
1174 "mirror://kernel.org/linux/libs/security/linux-privs/"
1175 "libcap2/libcap-" version ".tar.xz"))
1178 "0rbc9qbqs5bp9am9s9g83wxj5k4ixps2agy9dxr1v1fwg27mdr6f"))))
1179 (build-system gnu-build-system)
1180 (arguments '(#:phases
1181 (modify-phases %standard-phases
1183 ;; Add $libdir to the RUNPATH of executables.
1185 (substitute* "Make.Rules"
1187 (string-append "LDFLAGS := -Wl,-rpath="
1188 %output "/lib"))))))
1189 #:tests? #f ; no 'check' target
1190 #:make-flags (list "lib=lib"
1191 (string-append "prefix="
1192 (assoc-ref %outputs "out"))
1193 "RAISE_SETFCAP=no")))
1194 (native-inputs `(("perl" ,perl)))
1195 (inputs `(("attr" ,attr)))
1196 (home-page "https://sites.google.com/site/fullycapable/")
1197 (synopsis "Library for working with POSIX capabilities")
1199 "Libcap2 provides a programming interface to POSIX capabilities on
1200 Linux-based operating systems.")
1202 ;; License is BSD-3 or GPLv2, at the user's choice.
1203 (license license:gpl2)))
1205 (define-public bridge-utils
1207 (name "bridge-utils")
1211 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1212 "bridge-utils-" version ".tar.gz"))
1215 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1216 (build-system gnu-build-system)
1218 ;; The tarball lacks all the generated files.
1219 (native-inputs `(("autoconf" ,autoconf)
1220 ("automake" ,automake)))
1222 '(#:phases (alist-cons-after
1225 ;; Fix "field ‘ip6’ has incomplete type" errors.
1226 (substitute* "libbridge/libbridge.h"
1227 (("#include <linux/if_bridge.h>")
1228 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1230 ;; Ensure that the entire build fails if one of the
1231 ;; sub-Makefiles fails.
1232 (substitute* "Makefile.in"
1233 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1234 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1236 (zero? (system* "autoreconf" "-vf")))
1238 #:tests? #f)) ; no 'check' target
1241 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1242 (synopsis "Manipulate Ethernet bridges")
1244 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1245 to connect two Ethernet segments together in a protocol independent way.
1246 Packets are forwarded based on Ethernet address, rather than IP address (like
1247 a router). Since forwarding is done at Layer 2, all protocols can go
1248 transparently through a bridge.")
1249 (license license:gpl2+)))
1251 (define-public libnl
1258 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1262 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
1263 (build-system gnu-build-system)
1264 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1265 (home-page "http://www.infradead.org/~tgr/libnl/")
1266 (synopsis "NetLink protocol library suite")
1268 "The libnl suite is a collection of libraries providing APIs to netlink
1269 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1270 between the kernel and user space processes. It was designed to be a more
1271 flexible successor to ioctl to provide mainly networking related kernel
1272 configuration and monitoring interfaces.")
1274 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1275 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1276 (license license:gpl2)))
1285 "mirror://kernel.org/software/network/iw/iw-"
1289 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
1290 (build-system gnu-build-system)
1291 (native-inputs `(("pkg-config" ,pkg-config)))
1292 (inputs `(("libnl" ,libnl)))
1294 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1296 #:phases (alist-delete 'configure %standard-phases)))
1297 (home-page "https://wireless.wiki.kernel.org/")
1298 (synopsis "Tool for configuring wireless devices")
1300 "iw is a new nl80211 based CLI configuration utility for wireless
1301 devices. It replaces @code{iwconfig}, which is deprecated.")
1302 (license license:isc)))
1304 (define-public powertop
1312 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1316 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1317 (build-system gnu-build-system)
1320 (modify-phases %standard-phases
1321 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1322 ;; allow calibrating the network interface in GuixSD.
1323 (add-after 'unpack 'patch-absolute-file-names
1324 (lambda* (#:key inputs #:allow-other-keys)
1325 (let ((kmod (assoc-ref inputs "kmod")))
1326 (substitute* (find-files "src" "\\.cpp$")
1327 ;; Give the right 'modprobe' file name so that essential
1328 ;; modules such as msr.ko can be loaded.
1329 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1330 ;; These programs are only needed to calibrate, so using
1331 ;; relative file names avoids adding extra inputs. When they
1332 ;; are missing powertop gracefully handles it.
1333 (("/usr/bin/hcitool") "hcitool")
1334 (("/usr/bin/xset") "xset")
1335 (("/usr/sbin/hciconfig") "hciconfig"))
1340 ("ncurses" ,ncurses)
1341 ("pciutils" ,pciutils)
1344 `(("pkg-config" ,pkg-config)))
1345 (home-page "https://01.org/powertop/")
1346 (synopsis "Analyze power consumption on Intel-based laptops")
1348 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1349 power management. In addition to being a diagnostic tool, PowerTOP also has
1350 an interactive mode where the user can experiment various power management
1351 settings for cases where the operating system has not enabled these
1353 (license license:gpl2)))
1355 (define-public aumix
1362 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1363 version ".tar.bz2"))
1366 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1367 (build-system gnu-build-system)
1368 (inputs `(("ncurses" ,ncurses)))
1369 (home-page "http://www.jpj.net/~trevor/aumix.html")
1370 (synopsis "Audio mixer for X and the console")
1372 "Aumix adjusts an audio mixer from X, the console, a terminal,
1373 the command line or a script.")
1374 (license license:gpl2+)))
1376 (define-public iotop
1383 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1386 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1387 (build-system python-build-system)
1389 ;; The setup.py script expects python-2.
1390 `(#:python ,python-2
1391 ;; There are currently no checks in the package.
1393 (native-inputs `(("python" ,python-2)))
1394 (home-page "http://guichaz.free.fr/iotop/")
1396 "Displays the IO activity of running processes")
1398 "Iotop is a Python program with a top like user interface to show the
1399 processes currently causing I/O.")
1400 (license license:gpl2+)))
1408 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1409 "download/fuse-" version
1410 "/fuse-" version ".tar.gz"))
1413 "0szi2vlsjxg03y4ji51jks34p269jqj5ify6l0ajsqq6f6y8pd0c"))))
1414 (build-system gnu-build-system)
1415 (inputs `(("util-linux" ,util-linux)))
1417 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1418 (assoc-ref %outputs "out")
1420 (string-append "INIT_D_PATH="
1421 (assoc-ref %outputs "out")
1424 ;; The rule makes /dev/fuse 666.
1425 (string-append "UDEV_RULES_PATH="
1426 (assoc-ref %outputs "out")
1427 "/lib/udev/rules.d"))
1428 #:phases (alist-cons-before
1429 'build 'set-file-names
1430 (lambda* (#:key inputs #:allow-other-keys)
1431 ;; libfuse calls out to mount(8) and umount(8). Make sure
1432 ;; it refers to the right ones.
1433 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1434 (("/bin/(u?)mount" _ maybe-u)
1435 (string-append (assoc-ref inputs "util-linux")
1436 "/bin/" maybe-u "mount")))
1437 (substitute* '("util/mount.fuse.c")
1441 ;; This hack leads libfuse to search for 'fusermount' in
1442 ;; $PATH, where it may find a setuid-root binary, instead of
1443 ;; trying solely $out/sbin/fusermount and failing because
1445 (substitute* "lib/Makefile"
1446 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1447 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1449 (home-page "https://github.com/libfuse/libfuse")
1450 (synopsis "Support file systems implemented in user space")
1452 "As a consequence of its monolithic design, file system code for Linux
1453 normally goes into the kernel itself---which is not only a robustness issue,
1454 but also an impediment to system extensibility. FUSE, for \"file systems in
1455 user space\", is a kernel module and user-space library that tries to address
1456 part of this problem by allowing users to run file system implementations as
1457 user-space processes.")
1458 (license (list license:lgpl2.1 ;library
1459 license:gpl2+)))) ;command-line utilities
1461 (define-public unionfs-fuse
1463 (name "unionfs-fuse")
1468 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1472 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1473 (build-system cmake-build-system)
1474 (inputs `(("fuse" ,fuse)))
1475 (arguments '(#:tests? #f)) ; no tests
1476 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1477 (synopsis "User-space union file system")
1479 "UnionFS-FUSE is a flexible union file system implementation in user
1480 space, using the FUSE library. Mounting a union file system allows you to
1481 \"aggregate\" the contents of several directories into a single mount point.
1482 UnionFS-FUSE additionally supports copy-on-write.")
1483 (license license:bsd-3)))
1486 (package (inherit fuse)
1487 (name "fuse-static")
1488 (source (origin (inherit (package-source fuse))
1489 (modules '((guix build utils)))
1491 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1492 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1493 ;; it doesn't do that, allowing us to remove the dependency on
1494 ;; util-linux (something that is useful in initrds.)
1495 '(substitute* '("lib/mount_util.c"
1496 "util/mount_util.c")
1497 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1502 (define-public unionfs-fuse/static
1503 (package (inherit unionfs-fuse)
1504 (synopsis "User-space union file system (statically linked)")
1505 (name (string-append (package-name unionfs-fuse) "-static"))
1506 (source (origin (inherit (package-source unionfs-fuse))
1507 (modules '((guix build utils)))
1509 ;; Add -ldl to the libraries, because libfuse.a needs that.
1510 '(substitute* "src/CMakeLists.txt"
1511 (("target_link_libraries(.*)\\)" _ libs)
1512 (string-append "target_link_libraries"
1516 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1517 #:phases (alist-cons-after
1518 'install 'post-install
1519 (lambda* (#:key outputs #:allow-other-keys)
1520 (let* ((out (assoc-ref outputs "out"))
1521 (exe (string-append out "/bin/unionfs")))
1522 ;; By default, 'unionfs' keeps references to
1523 ;; $glibc/share/locale and similar stuff. Remove them.
1524 (remove-store-references exe)))
1526 (inputs `(("fuse" ,fuse-static)))))
1528 (define-public sshfs-fuse
1534 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1535 "download/sshfs_" version
1536 "/sshfs-" version ".tar.gz"))
1539 "08mdd4rs7yys7hmyig6i08qlid76p17xlvrh64k7wsrfs1s92s3z"))))
1540 (build-system gnu-build-system)
1545 `(("pkg-config" ,pkg-config)))
1546 (home-page "http://fuse.sourceforge.net/sshfs.html")
1547 (synopsis "Mount remote file systems over SSH")
1549 "This is a file system client based on the SSH File Transfer Protocol.
1550 Since most SSH servers already support this protocol it is very easy to set
1551 up: on the server side there's nothing to do; on the client side mounting the
1552 file system is as easy as logging into the server with an SSH client.")
1553 (license license:gpl2+)))
1555 (define-public numactl
1562 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1567 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1568 (build-system gnu-build-system)
1570 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1571 ;; to run, which we can't assume to have.
1574 ;; NUMA is apparently not supported on armhf, see
1575 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1576 (supported-systems (delete "armhf-linux" %supported-systems))
1577 (home-page "http://oss.sgi.com/projects/libnuma/")
1578 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1580 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1581 memory is not all in one place. The numactl program allows you to run your
1582 application program on specific CPU's and memory nodes. It does this by
1583 supplying a NUMA memory policy to the operating system before running your
1586 The package contains other commands, such as numademo, numastat and memhog.
1587 The numademo command provides a quick overview of NUMA performance on your
1589 (license (list license:gpl2 ;programs
1590 license:lgpl2.1)))) ;library
1598 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1602 "0ppv953gn2zylcagr4z6zg5y2x93dxrml29plypg6xgbq3hrv2bs"))
1603 (modules '((guix build utils)))
1606 (substitute* "tests/Makefile.in"
1607 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1610 (substitute* '("src/unicode_start" "src/unicode_stop")
1611 ;; Assume the Coreutils are in $PATH.
1614 (build-system gnu-build-system)
1617 (modify-phases %standard-phases
1618 (add-before 'build 'pre-build
1619 (lambda* (#:key inputs #:allow-other-keys)
1620 (let ((gzip (assoc-ref %build-inputs "gzip"))
1621 (bzip2 (assoc-ref %build-inputs "bzip2")))
1622 (substitute* "src/libkeymap/findfile.c"
1624 (string-append gzip "/bin/gzip"))
1626 (string-append bzip2 "/bin/bzip2"))))))
1627 (add-after 'install 'post-install
1628 (lambda* (#:key outputs #:allow-other-keys)
1629 ;; Make sure these programs find their comrades.
1630 (let* ((out (assoc-ref outputs "out"))
1631 (bin (string-append out "/bin")))
1632 (for-each (lambda (prog)
1633 (wrap-program (string-append bin "/" prog)
1634 `("PATH" ":" prefix (,bin))))
1635 '("unicode_start" "unicode_stop"))))))))
1636 (inputs `(("check" ,check)
1639 ("pam" ,linux-pam)))
1640 (native-inputs `(("pkg-config" ,pkg-config)))
1641 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1642 (synopsis "Linux keyboard utilities and keyboard maps")
1644 "This package contains keytable files and keyboard utilities compatible
1645 for systems using the Linux kernel. This includes commands such as
1646 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1647 (license license:gpl2+)))
1649 (define-public inotify-tools
1651 (name "inotify-tools")
1656 "mirror://sourceforge/inotify-tools/inotify-tools/"
1657 version "/inotify-tools-" version ".tar.gz"))
1660 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1661 (build-system gnu-build-system)
1662 (home-page "http://inotify-tools.sourceforge.net/")
1663 (synopsis "Monitor file accesses")
1665 "The inotify-tools packages provides a C library and command-line tools
1666 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1667 (license license:gpl2+)))
1676 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1677 "kmod-" version ".tar.xz"))
1680 "0mc12sx06p8il1ym3hdmgxxb37apn9yv7xij26gddjdfkx8xa0yk"))
1681 (patches (search-patches "kmod-module-directory.patch"))))
1682 (build-system gnu-build-system)
1684 `(("pkg-config" ,pkg-config)))
1689 `(#:tests? #f ; FIXME: Investigate test failures
1690 #:configure-flags '("--with-xz" "--with-zlib")
1691 #:phases (alist-cons-after
1692 'install 'install-modprobe&co
1693 (lambda* (#:key outputs #:allow-other-keys)
1694 (let* ((out (assoc-ref outputs "out"))
1695 (bin (string-append out "/bin")))
1696 (for-each (lambda (tool)
1698 (string-append bin "/" tool)))
1699 '("insmod" "rmmod" "lsmod" "modprobe"
1700 "modinfo" "depmod"))))
1702 (home-page "https://www.kernel.org/")
1703 (synopsis "Kernel module tools")
1704 (description "Kmod is a set of tools to handle common tasks with Linux
1705 kernel modules like insert, remove, list, check properties, resolve
1706 dependencies and aliases.
1708 These tools are designed on top of libkmod, a library that is shipped with
1709 kmod. The aim is to be compatible with tools, configurations and indices
1710 from the module-init-tools project.")
1711 (license license:gpl2+))) ; library under lgpl2.1+
1713 (define-public eudev
1714 ;; The post-systemd fork, maintained by Gentoo.
1721 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1725 "099w62ncq78nxpxizf910mx18hc8x4qvzw3azjd00fir89wmyjnq"))
1726 (patches (search-patches "eudev-rules-directory.patch"))))
1727 (build-system gnu-build-system)
1729 `(("pkg-config" ,pkg-config)
1733 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1734 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1735 ;; which contains the rules to do that.
1736 `(("util-linux" ,util-linux) ;for blkid
1738 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1739 (synopsis "Userspace device management")
1740 (description "Udev is a daemon which dynamically creates and removes
1741 device nodes from /dev/, handles hotplug events and loads drivers at boot
1743 (license license:gpl2+)))
1745 (define-public eudev-with-hwdb
1746 ;; TODO: Merge with 'eudev'.
1749 (name "eudev-with-hwdb")
1751 '(#:phases (modify-phases %standard-phases
1752 (add-after 'install 'build-hwdb
1753 (lambda* (#:key outputs #:allow-other-keys)
1754 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1755 ;; similar tools to display product names.
1756 (let ((out (assoc-ref outputs "out")))
1757 (zero? (system* (string-append out "/bin/udevadm")
1758 "hwdb" "--update"))))))))))
1763 (version "2.02.166")
1766 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1770 "150v0mawd2swdvypcmkjd3h3s4n5i1220h6sxx94a8jvp1kb0871"))
1771 (modules '((guix build utils)))
1774 (use-modules (guix build utils))
1776 ;; Honor sysconfdir.
1777 (substitute* "make.tmpl.in"
1779 "confdir = @sysconfdir@\n")
1780 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1781 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1782 (patches (search-patches "lvm2-static-link.patch"))))
1783 (build-system gnu-build-system)
1785 `(("pkg-config" ,pkg-config)
1786 ("procps" ,procps))) ;tests use 'pgrep'
1791 (modify-phases %standard-phases
1792 (add-after 'configure 'set-makefile-shell
1794 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1796 (setenv "SHELL" (which "sh"))
1798 ;; Replace /bin/sh with the right file name.
1799 (patch-makefile-SHELL "make.tmpl")
1801 (add-before 'strip 'make-objects-writable
1802 (lambda* (#:key outputs #:allow-other-keys)
1803 ;; Make compiled objects writable so they can be stripped.
1804 (let ((out (assoc-ref outputs "out")))
1805 (for-each (lambda (file)
1808 (find-files (string-append out "/lib"))
1809 (find-files (string-append out "/sbin"))))
1812 #:configure-flags (list (string-append "--sysconfdir="
1813 (assoc-ref %outputs "out")
1815 "--enable-udev_sync"
1816 "--enable-udev_rules"
1818 ;; Make sure programs such as 'dmsetup' can
1819 ;; find libdevmapper.so.
1820 (string-append "LDFLAGS=-Wl,-rpath="
1821 (assoc-ref %outputs "out")
1824 ;; The tests use 'mknod', which requires root access.
1826 (home-page "http://sourceware.org/lvm2/")
1827 (synopsis "Logical volume management for Linux")
1829 "LVM2 is the logical volume management tool set for Linux-based systems.
1830 This package includes the user-space libraries and tools, including the device
1831 mapper. Kernel components are part of Linux-libre.")
1833 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1834 ;; Command-line tools are GPLv2.
1835 (license (list license:gpl2 license:lgpl2.1))))
1837 (define-public lvm2-static
1840 (name "lvm2-static")
1842 ;; Propagate udev because libdevmapper.a depends on libudev.
1843 (inputs (alist-delete "udev" (package-inputs lvm2)))
1844 (propagated-inputs `(("udev" ,eudev)))
1847 (substitute-keyword-arguments (package-arguments lvm2)
1848 ((#:configure-flags flags '())
1849 ;; LVM2 doesn't use Libtool, hence the custom option.
1850 `(cons "--enable-static_link" ,flags))))
1851 (synopsis "Logical volume management for Linux (statically linked)")))
1853 (define-public wireless-tools
1855 (name "wireless-tools")
1859 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1863 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
1866 ;; Remove the older header files that are not free software.
1867 (for-each (lambda (n)
1868 (delete-file (format #f "wireless.~a.h" n)))
1869 '(10 11 12 13 14 15 16 17 18 19 20))
1871 (build-system gnu-build-system)
1874 (list (string-append "PREFIX=" %output)
1875 (string-append "INSTALL_MAN=" %output "/share/man")
1876 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1878 #:phases (modify-phases %standard-phases
1879 (delete 'configure))
1881 (synopsis "Tools for manipulating Linux Wireless Extensions")
1882 (description "Wireless Tools are used to manipulate the now-deprecated
1883 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1884 Extension was an interface allowing you to set Wireless LAN specific
1885 parameters and get the specific stats. It is deprecated in favor the nl80211
1887 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1888 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1889 ;; other files are distributed under gpl2.
1890 (license (list license:gpl2 license:lgpl2.1+))))
1898 (uri (string-append "mirror://kernel.org/software/network/crda/"
1899 "crda-" version ".tar.xz"))
1902 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
1903 (patches (search-patches "crda-optional-gcrypt.patch"))))
1904 (build-system gnu-build-system)
1906 '(#:phases (modify-phases %standard-phases
1909 'build 'no-werror-no-ldconfig
1911 (substitute* "Makefile"
1913 (("ldconfig") "true"))
1916 'build 'set-regulator-db-file-name
1917 (lambda* (#:key inputs #:allow-other-keys)
1918 ;; Tell CRDA where to find our database.
1919 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1920 (substitute* "crda.c"
1921 (("\"/lib/crda/regulatory.bin\"")
1922 (string-append "\"" regdb
1923 "/lib/crda/regulatory.bin\"")))
1925 #:test-target "verify"
1926 #:make-flags (let ((out (assoc-ref %outputs "out"))
1927 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1928 (list "CC=gcc" "V=1"
1930 ;; Disable signature-checking on 'regulatory.bin'.
1931 ;; The reason is that this simplifies maintenance
1932 ;; on our side (no need to manage a distro key
1933 ;; pair), and we can guarantee integrity of
1934 ;; 'regulatory.bin' by other means anyway, such as
1935 ;; 'guix gc --verify'. See
1936 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1940 (string-append "PREFIX=" out)
1941 (string-append "SBINDIR=" out "/sbin/")
1942 (string-append "UDEV_RULE_DIR="
1943 out "/lib/udev/rules.d")
1944 (string-append "LDFLAGS=-Wl,-rpath="
1946 (string-append "REG_BIN=" regdb
1947 "/lib/crda/regulatory.bin")))))
1948 (native-inputs `(("pkg-config" ,pkg-config)
1949 ("python" ,python-2)
1950 ("wireless-regdb" ,wireless-regdb)))
1951 (inputs `(("libnl" ,libnl)))
1953 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
1954 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
1956 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
1957 communication between the kernel Linux and user space for regulatory
1959 (license license:copyleft-next)))
1961 (define-public wireless-regdb
1963 (name "wireless-regdb")
1964 (version "2016.06.10")
1968 "mirror://kernel.org/software/network/wireless-regdb/"
1969 "wireless-regdb-" version ".tar.xz"))
1972 "1dxqy7a7zpzya30ff00s8k1qgrlndrwys99gc0r8yg0vab1z3vfg"))
1974 ;; We're building 'regulatory.bin' by ourselves.
1975 (snippet '(delete-file "regulatory.bin"))))
1976 (build-system gnu-build-system)
1978 '(#:phases (modify-phases %standard-phases
1979 (delete 'configure))
1981 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
1982 ;; is computed and can be equal to 'maintainer-clean'; when that
1983 ;; happens, we can end up deleting the 'regulatory.bin' file that we
1984 ;; just built. Thus, build things sequentially.
1985 #:parallel-build? #f
1987 #:tests? #f ;no tests
1988 #:make-flags (let ((out (assoc-ref %outputs "out")))
1989 (list (string-append "PREFIX=" out)
1990 (string-append "LSB_ID=GuixSD")
1991 (string-append "DISTRO_PUBKEY=/dev/null")
1992 (string-append "DISTRO_PRIVKEY=/dev/null")
1993 (string-append "REGDB_PUBKEY=/dev/null")
1995 ;; Leave that empty so that db2bin.py doesn't try
1996 ;; to sign 'regulatory.bin'. This allows us to
1997 ;; avoid managing a key pair for the whole distro.
1998 (string-append "REGDB_PRIVKEY=")))))
1999 (native-inputs `(("python" ,python-2)))
2001 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2002 (synopsis "Wireless regulatory database")
2004 "This package contains the wireless regulatory database Central
2005 Regulatory Database Agent (CRDA) daemon. The database contains information on
2006 country-specific regulations for the wireless spectrum.")
2007 (license license:isc)))
2009 (define-public lm-sensors
2015 (uri (list (string-append
2016 "https://github.com/groeck/lm-sensors/archive/V"
2017 (string-join (string-split version #\.) "-")
2021 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2022 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2023 (build-system gnu-build-system)
2024 (inputs `(("rrdtool" ,rrdtool)
2027 ("gnuplot" ,gnuplot)))
2028 (native-inputs `(("pkg-config" ,pkg-config)
2033 `(#:tests? #f ; no 'check' target
2034 #:make-flags (list (string-append "PREFIX=" %output)
2035 (string-append "ETCDIR=" %output "/etc")
2036 (string-append "MANDIR=" %output "/share/man"))
2041 'build 'patch-exec-paths
2042 (lambda* (#:key inputs outputs #:allow-other-keys)
2043 (substitute* "prog/detect/sensors-detect"
2045 (string-append "`" (assoc-ref inputs "coreutils")
2047 (("(`|\")modprobe" all open-quote)
2048 (string-append open-quote
2049 (assoc-ref inputs "kmod")
2051 (substitute* '("prog/pwm/pwmconfig"
2052 "prog/pwm/fancontrol")
2054 (string-append (assoc-ref inputs "gnuplot")
2057 (string-append (assoc-ref inputs "coreutils")
2060 (string-append (assoc-ref inputs "grep")
2063 (string-append (assoc-ref inputs "sed")
2066 (string-append (assoc-ref inputs "coreutils")
2069 (string-append (assoc-ref inputs "coreutils")
2072 (string-append (assoc-ref inputs "coreutils")
2073 "/bin/readlink -f"))))
2074 %standard-phases))))
2075 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2076 (synopsis "Utilities to read temperature/voltage/fan sensors")
2078 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2079 you to access information from temperature, voltage, and fan speed sensors.
2080 It works with most newer systems.")
2081 (license license:gpl2+)))
2083 (define-public i2c-tools
2090 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2091 version ".tar.bz2"))
2094 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2095 (build-system gnu-build-system)
2097 `(#:tests? #f ; no 'check' target
2098 #:make-flags (list (string-append "prefix=" %output)
2100 ;; no configure script
2101 #:phases (alist-delete 'configure %standard-phases)))
2104 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2105 (synopsis "I2C tools for Linux")
2107 "The i2c-tools package contains a heterogeneous set of I2C tools for
2108 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2109 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2111 (license license:gpl2+)))
2113 (define-public xsensors
2120 "http://www.linuxhardware.org/xsensors/xsensors-"
2124 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2125 (build-system gnu-build-system)
2126 (inputs `(("lm-sensors" ,lm-sensors)
2128 (native-inputs `(("pkg-config" ,pkg-config)))
2130 `(#:phases (alist-cons-before
2131 'configure 'enable-deprecated
2133 (substitute* "src/Makefile.in"
2134 (("-DGDK_DISABLE_DEPRECATED") "")
2135 (("-DGTK_DISABLE_DEPRECATED") "")))
2137 'configure 'remove-Werror
2139 (substitute* '("configure" "src/Makefile.in")
2141 %standard-phases))))
2142 (home-page "http://www.linuxhardware.org/xsensors/")
2143 (synopsis "Hardware health information viewer")
2145 "Xsensors reads data from the libsensors library regarding hardware
2146 health such as temperature, voltage and fan speed and displays the information
2147 in a digital read-out.")
2148 (license license:gpl2+)))
2153 (version (package-version linux-libre))
2154 (source (package-source linux-libre))
2155 (build-system gnu-build-system)
2157 '(#:phases (alist-replace
2159 (lambda* (#:key inputs #:allow-other-keys)
2160 (setenv "SHELL_PATH" (which "bash"))
2161 (chdir "tools/perf"))
2163 #:make-flags (list (string-append "DESTDIR="
2164 (assoc-ref %outputs "out"))
2167 ;; By default, 'config/Makefile' uses lib64 on
2168 ;; x86_64. Work around that.
2170 #:tests? #f)) ;no tests
2172 `(("pkg-config" ,pkg-config)
2176 ;; There are build scripts written in these languages.
2178 ("python" ,python-2)))
2180 `(("slang" ,slang) ;for the interactive TUI
2182 ("python" ,python-2) ;'perf' links against libpython
2183 ("elfutils" ,elfutils)
2186 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2187 ("libxslt" ,libxslt)
2188 ("docbook-xml" ,docbook-xml)
2189 ("docbook-xsl" ,docbook-xsl)
2191 ("asciidoc" ,asciidoc)))
2192 (home-page "https://perf.wiki.kernel.org/")
2193 (synopsis "Linux profiling with performance counters")
2195 "perf is a tool suite for profiling using hardware performance counters,
2196 with support in the Linux kernel. perf can instrument CPU performance
2197 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2198 of lightweight profiling. This package contains the user-land tools and in
2199 particular the 'perf' command.")
2200 (license (package-license linux-libre))))
2202 (define-public pflask
2208 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2210 (file-name (string-append name "-" version ".tar.gz"))
2213 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2214 (build-system cmake-build-system)
2216 '(#:tests? #f)) ; no tests
2217 (home-page "http://ghedo.github.io/pflask/")
2218 (synopsis "Simple tool for creating Linux namespace containers")
2219 (description "pflask is a simple tool for creating Linux namespace
2220 containers. It can be used for running a command or even booting an OS inside
2221 an isolated container, created with the help of Linux namespaces. It is
2222 similar in functionality to chroot, although pflask provides better isolation
2223 thanks to the use of namespaces.")
2224 (license license:bsd-2)))
2226 (define-public hdparm
2232 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2233 name "-" version ".tar.gz"))
2236 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
2237 (build-system gnu-build-system)
2239 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2240 (list (string-append "binprefix=" out)
2241 (string-append "manprefix=" out)
2243 #:phases (alist-delete 'configure %standard-phases)
2244 #:tests? #f)) ; no test suite
2245 (home-page "https://sourceforge.net/projects/hdparm/")
2246 (synopsis "Tune hard disk parameters for high performance")
2248 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
2249 is for enabling irq-unmasking and IDE multiple-mode.")
2250 (license (license:non-copyleft "file://LICENSE.TXT"))))
2252 (define-public rfkill
2258 (uri (string-append "mirror://kernel.org/software/network/"
2259 name "/" name "-" version ".tar.xz"))
2262 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2263 (build-system gnu-build-system)
2265 `(#:make-flags (list "CC=gcc"
2266 (string-append "PREFIX=" %output))
2267 #:phases (modify-phases %standard-phases
2268 (delete 'configure))
2270 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2271 (synopsis "Tool for enabling and disabling wireless devices")
2273 "rfkill is a simple tool for accessing the rfkill device interface,
2274 which is used to enable and disable wireless networking devices, typically
2275 WLAN, Bluetooth and mobile broadband.")
2276 (license (license:non-copyleft "file://COPYING"
2277 "See COPYING in the distribution."))))
2285 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2286 version "/" name "-" version ".tar.gz"))
2289 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2290 (build-system gnu-build-system)
2291 (home-page "http://acpiclient.sourceforge.net")
2292 (synopsis "Display information on ACPI devices")
2293 (description "@code{acpi} attempts to replicate the functionality of the
2294 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2295 information. It does not support ACPI suspending, only displays information
2296 about ACPI devices.")
2297 (license license:gpl2+)))
2299 (define-public acpid
2305 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2309 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
2310 (build-system gnu-build-system)
2311 (home-page "https://sourceforge.net/projects/acpid2/")
2312 (synopsis "Daemon for delivering ACPI events to user-space programs")
2314 "acpid is designed to notify user-space programs of Advanced
2315 Configuration and Power Interface (ACPI) events. acpid should be started
2316 during the system boot, and will run as a background process. When an ACPI
2317 event is received from the kernel, acpid will examine the list of rules
2318 specified in /etc/acpi/events and execute the rules that match the event.")
2319 (license license:gpl2+)))
2321 (define-public sysfsutils
2330 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2333 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2334 (build-system gnu-build-system)
2335 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2336 (synopsis "System utilities based on Linux sysfs")
2338 "These are a set of utilities built upon sysfs, a virtual file system in
2339 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2340 also contains the libsysfs library.")
2341 ;; The library is under lgpl2.1+ (all files say "or any later version").
2342 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2343 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2345 (define-public sysfsutils-1
2347 (inherit sysfsutils)
2354 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2355 "/sysfsutils-" version ".tar.gz"))
2357 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2358 (modules '((guix build utils)))
2361 (substitute* "Makefile.in"
2362 (("includedir = /usr/include/sysfs")
2363 "includedir = @includedir@"))
2364 (substitute* "configure"
2365 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2366 (string-append "includedir='" orig "/sysfs'")))))))
2367 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2369 (define-public cpufrequtils
2371 (name "cpufrequtils")
2378 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2381 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2382 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2383 (build-system gnu-build-system)
2385 `(("sysfsutils" ,sysfsutils-1)))
2387 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2388 (assoc-ref %outputs "out") "/lib"))))
2389 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2390 (synopsis "Utilities to get and set CPU frequency on Linux")
2392 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2393 information, and set the CPU frequency if supported, using the cpufreq
2394 capabilities of the Linux kernel.")
2395 (license license:gpl2)))
2397 (define-public libraw1394
2404 "mirror://kernel.org/linux/libs/ieee1394/"
2405 name "-" version ".tar.xz"))
2408 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2409 (build-system gnu-build-system)
2410 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2411 (synopsis "Interface library for the Linux IEEE1394 drivers")
2413 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2414 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2415 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2416 send to and receive from other nodes without requiring a kernel driver for the
2417 protocol in question.")
2418 (license license:lgpl2.1+)))
2420 (define-public libavc1394
2426 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2427 name "-" version ".tar.gz"))
2430 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2431 (build-system gnu-build-system)
2433 `(("pkg-config" ,pkg-config)))
2435 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2436 (home-page "https://sourceforge.net/projects/libavc1394/")
2437 (synopsis "AV/C protocol library for IEEE 1394")
2439 "Libavc1394 is a programming interface to the AV/C specification from
2440 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2441 (license license:lgpl2.1+)))
2443 (define-public libiec61883
2445 (name "libiec61883")
2450 "mirror://kernel.org/linux/libs/ieee1394/"
2451 name "-" version ".tar.xz"))
2454 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2455 (build-system gnu-build-system)
2457 `(("pkg-config" ,pkg-config)))
2459 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2460 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2461 (synopsis "Isochronous streaming media library for IEEE 1394")
2463 "The libiec61883 library provides a higher level API for streaming DV,
2464 MPEG-2 and audio over Linux IEEE 1394.")
2465 (license license:lgpl2.1+)))
2467 (define-public mdadm
2474 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2478 "0248v9f28mrbwabl94ck22gfim29sqhkf70wrpfi52nk4x3bxl17"))))
2479 (build-system gnu-build-system)
2483 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2484 (list "INSTALL=install"
2486 ;; TODO: tell it where to find 'sendmail'
2487 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2488 (string-append "BINDIR=" out "/sbin")
2489 (string-append "MANDIR=" out "/share/man")
2490 (string-append "UDEVDIR=" out "/lib/udev")))
2491 #:phases (alist-cons-before
2492 'build 'patch-program-paths
2493 (lambda* (#:key inputs #:allow-other-keys)
2494 (let ((coreutils (assoc-ref inputs "coreutils")))
2495 (substitute* "udev-md-raid-arrays.rules"
2496 (("/usr/bin/(readlink|basename)" all program)
2497 (string-append coreutils "/bin/" program)))))
2499 'build 'remove-W-error
2501 ;; We cannot build with -Werror on i686 due to a
2502 ;; 'sign-compare' warning in util.c.
2503 (substitute* "Makefile"
2506 (alist-delete 'configure %standard-phases)))
2507 ;;tests must be done as root
2509 (home-page "http://neil.brown.name/blog/mdadm")
2510 (synopsis "Tool for managing Linux Software RAID arrays")
2512 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2513 assemble, report on, and monitor arrays. It can also move spares between raid
2514 arrays when needed.")
2515 (license license:gpl2+)))
2517 (define-public mdadm-static
2520 (name "mdadm-static")
2522 (substitute-keyword-arguments (package-arguments mdadm)
2523 ((#:make-flags flags)
2524 `(cons "LDFLAGS = -static" ,flags))
2526 `(modify-phases ,phases
2527 (add-after 'install 'remove-cruft
2528 (lambda* (#:key outputs #:allow-other-keys)
2529 (let* ((out (assoc-ref outputs "out"))
2530 (precious? (lambda (file)
2531 (member file '("." ".." "sbin"))))
2532 (directories (scandir out (negate precious?))))
2533 (with-directory-excursion out
2534 (for-each delete-file-recursively directories)
2535 (remove-store-references "sbin/mdadm")
2536 (delete-file "sbin/mdmon")
2538 ((#:modules modules %gnu-build-system-modules)
2539 `((ice-9 ftw) ,@modules))
2540 ((#:strip-flags _ '())
2541 ''("--strip-all")) ;strip a few extra KiB
2542 ((#:allowed-references _ '("out"))
2543 '("out")))) ;refer only self
2544 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2546 (define-public libaio
2553 (string-append "mirror://debian/pool/main/liba/libaio/"
2554 name "_" version ".orig.tar.gz")
2555 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2556 name "-" version ".tar.gz")))
2559 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2560 (build-system gnu-build-system)
2563 (list "CC=gcc" (string-append "prefix=" %output))
2564 #:test-target "partcheck" ; need root for a full 'check'
2566 (alist-delete 'configure %standard-phases))) ; no configure script
2567 (home-page "http://lse.sourceforge.net/io/aio.html")
2568 (synopsis "Linux-native asynchronous I/O access library")
2570 "This library enables userspace to use Linux kernel asynchronous I/O
2571 system calls, important for the performance of databases and other advanced
2573 (license license:lgpl2.1+)))
2581 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2582 name "-" version ".tar.xz"))
2585 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2586 (build-system gnu-build-system)
2588 `(("libsndfile" ,libsndfile)))
2590 `(("pkg-config" ,pkg-config)))
2591 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2592 (synopsis "Bluetooth subband audio codec")
2594 "The SBC is a digital audio encoder and decoder used to transfer data to
2595 Bluetooth audio output devices like headphones or loudspeakers.")
2596 (license license:gpl2+)))
2598 (define-public bluez
2605 "mirror://kernel.org/linux/bluetooth/bluez-"
2609 "05cdnpz0w2lwq2x5ba87q1h2wgb4lfnpbnbh6p7499hx59fw1j8n"))))
2610 (build-system gnu-build-system)
2613 (let ((out (assoc-ref %outputs "out")))
2614 (list "--sysconfdir=/etc"
2615 "--localstatedir=/var"
2618 ;; Install dbus/udev files to the correct location.
2619 (string-append "--with-dbusconfdir=" out "/etc")
2620 (string-append "--with-udevdir=" out "/lib/udev")))
2622 (modify-phases %standard-phases
2623 (add-after 'install 'post-install
2624 (lambda* (#:key inputs outputs #:allow-other-keys)
2625 (let* ((out (assoc-ref outputs "out"))
2626 (servicedir (string-append out "/share/dbus-1/services"))
2627 (service "obexd/src/org.bluez.obex.service")
2628 (rule (string-append
2629 out "/lib/udev/rules.d/97-hid2hci.rules")))
2630 ;; Install the obex dbus service file.
2631 (substitute* service
2633 (string-append out "/libexec/bluetooth/obexd")))
2634 (install-file service servicedir)
2635 ;; Fix paths in the udev rule.
2637 (("hid2hci --method")
2638 (string-append out "/lib/udev/hid2hci --method"))
2640 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2643 `(("pkg-config" ,pkg-config)
2644 ("gettext" ,gettext-minimal)))
2649 ("libical" ,libical)
2650 ("readline" ,readline)))
2651 (home-page "http://www.bluez.org/")
2652 (synopsis "Linux Bluetooth protocol stack")
2654 "BlueZ provides support for the core Bluetooth layers and protocols. It
2655 is flexible, efficient and uses a modular implementation.")
2656 (license license:gpl2+)))
2658 (define-public fuse-exfat
2665 "https://github.com/relan/exfat/releases/download/v"
2666 version "/" name "-" version ".tar.gz"))
2669 "1rvq4hapy2anal1vg1yidv4x8rg4iw5sxfwqixkw0q2qsxb54471"))))
2670 (build-system gnu-build-system)
2672 `(("pkg-config" ,pkg-config)))
2675 (home-page "https://github.com/relan/exfat")
2676 (synopsis "Mount exFAT file systems")
2678 "This package provides a FUSE-based file system that provides read and
2679 write access to exFAT devices.")
2680 (license license:gpl2+)))
2689 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2690 version ".tar.bz2"))
2693 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2694 (build-system gnu-build-system)
2696 '(#:phases (modify-phases %standard-phases
2697 (add-before 'configure 'bootstrap
2699 ;; The tarball was not generated with 'make dist' so we
2700 ;; need to bootstrap things ourselves.
2701 (and (zero? (system* "./autogen.sh"))
2703 (patch-makefile-SHELL "Makefile.include.in")
2706 ;; Make sure programs find libgpm.so.
2707 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2708 (assoc-ref %outputs "out")
2711 `(("texinfo" ,texinfo)
2714 ("autoconf" ,autoconf)
2715 ("automake" ,automake)
2716 ("libtool" ,libtool)))
2717 (home-page "http://www.nico.schottelius.org/software/gpm/")
2718 (synopsis "Mouse support for the Linux console")
2720 "The GPM (general-purpose mouse) daemon is a mouse server for
2721 applications running on the Linux console. It allows users to select items
2722 and copy/paste text in the console and in xterm.")
2723 (license license:gpl2+)))
2725 (define-public btrfs-progs
2727 (name "btrfs-progs")
2731 (uri (string-append "mirror://kernel.org/linux/kernel/"
2732 "people/kdave/btrfs-progs/"
2733 "btrfs-progs-v" version ".tar.xz"))
2736 "1ppy2y9vypxw9awchari21yd3s2d7w2a9q3f4jq7dnjy5gyrnjj6"))))
2737 (build-system gnu-build-system)
2739 "static")) ; static versions of binaries in "out" (~16MiB!)
2741 '(#:phases (modify-phases %standard-phases
2742 (add-after 'build 'build-static
2743 (lambda _ (zero? (system* "make" "static"))))
2744 (add-after 'install 'install-static
2745 (let ((staticbin (string-append (assoc-ref %outputs "static")
2748 (zero? (system* "make"
2749 (string-append "bindir=" staticbin)
2750 "install-static"))))))
2751 #:test-target "test"
2752 #:parallel-tests? #f)) ; tests fail when run in parallel
2753 (inputs `(("e2fsprogs" ,e2fsprogs)
2754 ("libblkid" ,util-linux)
2755 ("libblkid:static" ,util-linux "static")
2756 ("libuuid" ,util-linux)
2757 ("libuuid:static" ,util-linux "static")
2760 (native-inputs `(("pkg-config" ,pkg-config)
2761 ("asciidoc" ,asciidoc)
2763 ;; For building documentation.
2764 ("libxml2" ,libxml2)
2765 ("docbook-xml" ,docbook-xml)
2766 ("docbook-xsl" ,docbook-xsl)
2769 (home-page "https://btrfs.wiki.kernel.org/")
2770 (synopsis "Create and manage btrfs copy-on-write file systems")
2771 (description "Btrfs is a copy-on-write (CoW) file system for Linux aimed at
2772 implementing advanced features while focusing on fault tolerance, repair and
2773 easy administration.")
2774 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2775 ;; GPL2: Everything else.
2776 (license (list license:gpl2 license:gpl2+))))
2778 (define-public btrfs-progs/static
2780 (name "btrfs-progs-static")
2781 (version (package-version btrfs-progs))
2783 (build-system trivial-build-system)
2785 `(("btrfs-progs:static" ,btrfs-progs "static")))
2787 `(#:modules ((guix build utils))
2790 (use-modules (guix build utils)
2794 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
2795 (out (assoc-ref %outputs "out"))
2796 (source (string-append btrfs "/bin/btrfs.static"))
2797 (target (string-append out "/bin/btrfs")))
2798 (mkdir-p (dirname target))
2799 (copy-file source target)
2800 (remove-store-references target)
2801 (chmod target #o555)))))
2802 (home-page (package-home-page btrfs-progs))
2803 (synopsis "Statically-linked btrfs command from btrfsprogs")
2804 (description "This package provides statically-linked command of btrfs taken
2805 from the btrfsprogs package. It is meant to be used in initrds.")
2806 (license (package-license btrfs-progs))))
2808 (define-public freefall
2811 (version (package-version linux-libre))
2812 (source (package-source linux-libre))
2813 (build-system gnu-build-system)
2815 '(#:phases (modify-phases %standard-phases
2816 (add-after 'unpack 'enter-subdirectory
2818 (chdir "tools/laptop/freefall")))
2820 (add-before 'build 'increase-timeout
2822 ;; The default of 2 seconds is too low: it assumes an
2823 ;; open lid and AC power without actually checking.
2824 (substitute* "freefall.c"
2825 (("alarm\\(2\\)") "alarm(5)")))))
2826 #:make-flags (list (string-append "PREFIX="
2827 (assoc-ref %outputs "out")))
2828 #:tests? #f)) ;no tests
2829 (home-page (package-home-page linux-libre))
2830 (synopsis "Free-fall protection for spinning laptop hard drives")
2832 "Prevents shock damage to the internal spinning hard drive(s) of some
2833 HP and Dell laptops. When sudden movement is detected, all input/output
2834 operations on the drive are suspended and its heads are parked on the ramp,
2835 where they are less likely to cause damage to the spinning disc. Requires a
2836 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2837 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2838 (license license:gpl2)))
2840 (define-public thinkfan
2846 (uri (string-append "mirror://sourceforge/thinkfan/"
2847 "/thinkfan-" version ".tar.gz"))
2850 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2851 (modules '((guix build utils)))
2852 ;; Fix erroneous man page location in Makefile leading to
2853 ;; a compilation failure.
2855 '(substitute* "CMakeLists.txt"
2856 (("thinkfan\\.1") "src/thinkfan.1")))))
2857 (build-system cmake-build-system)
2859 `(#:modules ((guix build cmake-build-system)
2862 #:tests? #f ;no test target
2864 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
2865 `("-DUSE_ATASMART:BOOL=ON")
2867 (modify-phases %standard-phases
2868 ;; Install scripts for various foreign init systems. Also fix
2869 ;; hard-coded path for daemon.
2870 (add-after 'install 'install-rc-scripts
2871 (lambda* (#:key outputs #:allow-other-keys)
2872 (let ((out (assoc-ref outputs "out"))
2874 (string-append "../thinkfan-" ,version "/rcscripts")
2877 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
2878 (string-append out "/sbin/" name)))
2879 (for-each (cute install-file <>
2880 (string-append out "/share/thinkfan"))
2884 `(("libatasmart" ,libatasmart)))
2885 (home-page "http://thinkfan.sourceforge.net/")
2886 (synopsis "Simple fan control program")
2888 "Thinkfan is a simple fan control program. It reads temperatures,
2889 checks them against configured limits and switches to appropriate (also
2890 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
2891 other @code{hwmon} driver that enables temperature reading and fan control
2893 (license license:gpl3+)))
2895 (define-public ntfs-3g
2898 (version "2016.2.22")
2901 (uri (string-append "https://tuxera.com/opensource/"
2902 "ntfs-3g_ntfsprogs-" version ".tgz"))
2905 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
2906 (modules '((guix build utils)))
2908 ;; Install under $prefix.
2909 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
2912 (build-system gnu-build-system)
2913 (inputs `(("util-linux" ,util-linux)
2914 ("fuse" ,fuse))) ;libuuid
2915 (native-inputs `(("pkg-config" ,pkg-config)))
2917 '(#:configure-flags (list "--exec-prefix=${prefix}"
2918 "--with-fuse=external" ;use our own FUSE
2919 "--enable-mount-helper"
2920 "--enable-posix-acls"
2921 "--enable-xattr-mappings")))
2922 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
2923 (synopsis "Read-write access to NTFS file systems")
2925 "NTFS-3G provides read-write access to NTFS file systems, which are
2926 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
2927 The package provides additional NTFS tools.")
2928 (license license:gpl2+)))
2930 (define-public rng-tools
2937 "http://downloads.sourceforge.net/sourceforge/gkernel/"
2938 "rng-tools-" version ".tar.gz"))
2941 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
2942 (build-system gnu-build-system)
2943 (synopsis "Random number generator daemon")
2945 "Monitor a hardware random number generator, and supply entropy
2946 from that to the system kernel's @file{/dev/random} machinery.")
2947 (home-page "https://sourceforge.net/projects/gkernel")
2948 ;; The source package is offered under the GPL2+, but the files
2949 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
2950 (license (list license:gpl2 license:gpl2+))))
2952 (define-public cpupower
2955 (version (package-version linux-libre))
2956 (source (package-source linux-libre))
2957 (build-system gnu-build-system)
2959 '(#:phases (modify-phases %standard-phases
2960 (add-after 'unpack 'enter-subdirectory
2962 (chdir "tools/power/cpupower")))
2964 (add-before 'build 'fix-makefiles
2966 (substitute* "Makefile"
2968 (("/bin/(install|pwd)" _ command) command))
2969 (substitute* "bench/Makefile"
2970 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
2971 #:make-flags (let ((out (assoc-ref %outputs "out")))
2972 (list (string-append "DESTDIR=" out)
2973 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
2974 "docdir=/share/doc/cpupower"
2975 "confdir=$(docdir)/examples"
2976 ;; The Makefile recommends the following changes
2978 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
2979 #:tests? #f)) ;no tests
2980 (native-inputs `(("gettext" ,gettext-minimal)))
2981 (inputs `(("pciutils" ,pciutils)))
2982 (home-page (package-home-page linux-libre))
2983 (synopsis "CPU frequency and voltage scaling tools for Linux")
2985 "cpupower is a set of user-space tools that use the cpufreq feature of the
2986 Linux kernel to retrieve and control processor features related to power saving,
2987 such as frequency and voltage scaling.")
2988 (license license:gpl2)))
2990 (define-public haveged
2997 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3001 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3002 (build-system gnu-build-system)
3003 (home-page "http://www.issihosts.com/haveged")
3004 (synopsis "Entropy source for the Linux random number generator")
3006 "haveged generates an unpredictable stream of random numbers for use by
3007 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3008 standard mechanisms for filling the entropy pool may not be sufficient for
3009 systems with high needs or limited user interaction, such as headless servers.
3010 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3011 indirect effects of hardware events on hidden processor state using the HArdware
3012 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3013 its environment and provides the same built-in test suite for the output stream
3014 as used on certified hardware security devices.")
3015 (license (list (license:non-copyleft "file://nist/mconf.h")
3016 (license:non-copyleft "file://nist/packtest.c")
3017 license:public-domain ; nist/dfft.c
3018 license:gpl3+)))) ; everything else
3020 (define-public ecryptfs-utils
3022 (name "ecryptfs-utils")
3027 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3028 version "/+download/ecryptfs-utils_"
3029 version ".orig.tar.gz"))
3032 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3033 (build-system gnu-build-system)
3035 `(#:configure-flags (list "--disable-pywrap")))
3037 `(("intltool" ,intltool)
3038 ("perl" ,perl) ; for pod2man
3039 ("pkg-config" ,pkg-config)))
3041 `(("keyutils" ,keyutils)
3042 ("linux-pam" ,linux-pam)
3044 (home-page "http://ecryptfs.org/")
3045 (synopsis "eCryptfs cryptographic file system utilities")
3047 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3048 Each file's cryptographic meta-data is stored inside the file itself, along
3049 with the encrypted contents. This allows individual encrypted files to be
3050 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3051 native Linux file system, and has been part of the Linux kernel since version
3052 2.6.19. This package contains the userland utilities to manage it.")
3053 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3054 ;; grant additional permission to link with OpenSSL.
3055 (license license:gpl2+)))
3057 (define-public libnfsidmap
3059 (name "libnfsidmap")
3064 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3065 name "/" name "-" version ".tar.gz"))
3068 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3069 (build-system gnu-build-system)
3071 `(#:configure-flags (list
3072 (string-append "--with-pluginpath="
3073 (assoc-ref %outputs "out")
3074 "/lib/libnfsidmap"))))
3076 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3078 "NFSv4 support library for name/ID mapping")
3079 (description "Libnfsidmap is a library holding mulitiple methods of
3080 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3081 extensible array of mapping functions, currently consisting of two choices:
3082 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3083 (license (license:non-copyleft "file://COPYING"
3084 "See COPYING in the distribution."))))
3086 (define-public module-init-tools
3088 (name "module-init-tools")
3093 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3094 "module-init-tools-" version ".tar.bz2"))
3097 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3098 (patches (search-patches "module-init-tools-moduledir.patch"))))
3099 (build-system gnu-build-system)
3101 ;; FIXME: The upstream tarball lacks man pages, and building them would
3102 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3103 ;; but they vanished. In the meantime, fake it.
3104 '(#:phases (alist-cons-before
3105 'configure 'fake-docbook
3107 (substitute* "Makefile.in"
3108 (("^DOCBOOKTOMAN.*$")
3109 "DOCBOOKTOMAN = true\n")))
3111 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3112 (synopsis "Tools for loading and managing Linux kernel modules")
3114 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3115 `insmod', `lsmod', and more.")
3116 (license license:gpl2+)))
3118 (define-public mcelog
3124 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3125 "mcelog.git/snapshot/v" version ".tar.gz"))
3128 "10xxmqpd348ifbs7w8j0m53agp28r6imv237ha3kmhp632hmyf1d"))
3129 (file-name (string-append name "-" version ".tar.gz"))
3130 (modules '((guix build utils)))
3132 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3133 `(substitute* "Makefile"
3134 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3135 (build-system gnu-build-system)
3137 `(#:phases (modify-phases %standard-phases
3138 (delete 'configure)) ; no configure script
3139 #:make-flags (let ((out (assoc-ref %outputs "out")))
3141 (string-append "prefix=" out)
3142 (string-append "DOCDIR=" out "/share/doc/mcelog")
3143 "etcprefix=$(DOCDIR)/examples"))
3144 ;; The tests will only run as root on certain supported CPU models.
3146 (supported-systems (list "i686-linux" "x86_64-linux"))
3147 (home-page "http://mcelog.org/")
3148 (synopsis "Machine check monitor for x86 Linux systems")
3150 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3151 and other hardware errors on x86 systems. It can also perform user-defined
3152 tasks, such as bringing bad pages off-line, when configurable error thresholds
3154 (license license:gpl2)))
3156 (define-public mtd-utils
3163 "ftp://ftp.infradead.org/pub/mtd-utils/"
3164 "mtd-utils-" version ".tar.bz2"))
3167 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3170 ("libuuid" ,util-linux)
3173 (build-system gnu-build-system)
3175 `(#:test-target "tests"
3176 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3177 #:phases (modify-phases %standard-phases
3178 (delete 'configure))))
3179 (synopsis "MTD Flash Storage Utilities")
3180 (description "This package provides utilities for testing, partitioning, etc
3182 (home-page "http://www.linux-mtd.infradead.org/")
3184 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3185 license:mpl1.1 ; All ftl* files
3186 license:expat)))) ; libiniparser
3188 (define-public libseccomp
3194 (uri (string-append "https://github.com/seccomp/libseccomp/"
3195 "releases/download/v" version
3196 "/libseccomp-" version ".tar.gz"))
3199 "0asnlkzqms520r0dra08dzcz5hh6hs7lkajfw9wij3vrd0hxsnzz"))))
3200 (build-system gnu-build-system)
3202 `(("which" ,which)))
3203 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3204 (description "The libseccomp library provides an easy to use, platform
3205 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3206 libseccomp API is designed to abstract away the underlying BPF based syscall
3207 filter language and present a more conventional function-call based filtering
3208 interface that should be familiar to, and easily adopted by, application
3210 (home-page "https://github.com/seccomp/libseccomp")
3211 (license license:lgpl2.1)))
3213 (define-public radeontop
3217 (home-page "https://github.com/clbr/radeontop/")
3220 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3221 (file-name (string-append name "-" version ".tar.gz"))
3224 "07fnimn6wwablmdjw0av11hk9a6xilbryh09izq4b2ic4b8md2p7"))))
3225 (build-system gnu-build-system)
3227 `(#:phases (modify-phases %standard-phases
3228 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3229 ;; dependency, and doesn't even work on release(!) tarballs.
3230 (add-after 'unpack 'report-correct-version
3231 (lambda _ (substitute* "getver.sh"
3233 (string-append "ver=" ,version)))))
3234 (delete 'configure)) ; no configure script
3235 #:make-flags (list "CC=gcc"
3236 (string-append "PREFIX=" %output))
3237 #:tests? #f)) ; no tests
3239 `(("gettext" ,gettext-minimal)
3240 ("pkg-config" ,pkg-config)))
3242 `(("libdrm" ,libdrm)
3243 ("libpciaccess" ,libpciaccess)
3244 ("ncurses" ,ncurses)))
3245 (synopsis "Usage monitor for AMD Radeon graphics")
3246 (description "RadeonTop monitors resource consumption on supported AMD
3247 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3248 a terminal or saved to a file for further processing. It measures both the
3249 activity of the GPU as a whole, which is also accurate during OpenCL
3250 computations, as well as separate component statistics that are only meaningful
3251 under OpenGL graphics workloads.")
3252 (license license:gpl3)))
3254 (define-public efivar
3260 (uri (string-append "https://github.com/rhinstaller/" name
3261 "/releases/download/" version "/" name
3262 "-" version ".tar.bz2"))
3265 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3266 (build-system gnu-build-system)
3268 `(;; Tests require a UEFI system and is not detected in the chroot.
3270 #:make-flags (list (string-append "prefix=" %output)
3271 (string-append "libdir=" %output "/lib")
3272 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3274 (modify-phases %standard-phases
3275 (delete 'configure))))
3277 `(("pkg-config" ,pkg-config)))
3280 (home-page "https://github.com/rhinstaller/efivar")
3281 (synopsis "Tool and library to manipulate EFI variables")
3282 (description "This package provides a library and a command line
3283 interface to the variable facility of UEFI boot firmware.")
3284 (license license:lgpl2.1+)))
3286 (define-public efibootmgr
3292 (uri (string-append "https://github.com/rhinstaller/" name
3293 "/releases/download/" version "/" name
3294 "-" version ".tar.bz2"))
3297 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3298 (build-system gnu-build-system)
3300 `(#:tests? #f ; No tests.
3301 #:make-flags (list (string-append "prefix=" %output)
3302 (string-append "libdir=" %output "/lib")
3303 ;; Override CFLAGS to add efivar include directory.
3304 (string-append "CFLAGS=-O2 -g -flto -I"
3305 (assoc-ref %build-inputs "efivar")
3308 (modify-phases %standard-phases
3309 (add-after 'unpack 'branding
3310 ;; Replace default loader path with something more familiar.
3312 (substitute* "src/efibootmgr.c"
3313 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3316 (delete 'configure))))
3318 `(("pkg-config" ,pkg-config)))
3320 `(("efivar" ,efivar)
3322 (home-page "https://github.com/rhinstaller/efibootmgr")
3323 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3325 "@code{efibootmgr} is a user-space application to modify the Intel
3326 Extensible Firmware Interface (EFI) Boot Manager. This application can
3327 create and destroy boot entries, change the boot order, change the next
3328 running boot option, and more.")
3329 (license license:gpl2+)))
3331 (define-public sysstat
3337 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3338 "sysstat-" version ".tar.xz"))
3341 "0f8gk1hma3bk198ziwrhh5jhisnbbgc1v4rxhny58n0zjzw0gm0z"))))
3342 (build-system gnu-build-system)
3344 `(#:tests? #f ; No test suite.
3345 ;; Without this flag, it tries to install the man pages with group 'root'
3346 ;; and fails because /etc/passwd lacks an entry for the root user.
3348 (list "--disable-file-attr"
3349 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3351 (modify-phases %standard-phases
3352 ;; The build process tries to create '/var/lib/sa', so we skip that
3354 (add-after 'build 'skip-touching-var
3356 (substitute* "Makefile"
3357 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3360 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3361 (synopsis "Performance monitoring tools for Linux")
3362 (description "The sysstat utilities are a collection of performance
3363 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3364 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3365 @code{sadf} and @code{sa}.")
3366 (license license:gpl2+)))
3368 (define-public light
3374 (uri (string-append "https://github.com/haikarainen/" name
3375 "/archive/v" version ".tar.gz"))
3378 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3379 (file-name (string-append name "-" version ".tar.gz"))))
3380 (build-system gnu-build-system)
3382 '(#:tests? #f ; no tests
3383 #:make-flags (list "CC=gcc"
3384 (string-append "PREFIX=" %output))
3386 (modify-phases %standard-phases
3388 (add-after 'unpack 'patch-makefile
3390 (substitute* "Makefile" (("chown") "#")))))))
3392 `(("help2man" ,help2man)))
3393 (home-page "https://haikarainen.github.io/light")
3394 (synopsis "GNU/Linux application to control backlights")
3396 "Light is a program to send commands to screen backlight controllers
3397 under GNU/Linux. Features include:
3400 @item It does not rely on X.
3401 @item Light can automatically figure out the best controller to use, making
3402 full use of underlying hardware.
3403 @item It is possible to set a minimum brightness value, as some controllers
3404 set the screen to be pitch black at a vaĺue of 0 (or higher).
3407 Light is the successor of lightscript.")
3408 (license license:gpl3+)))